@hearsay-tools/squawk 0.17.0-dev.5734 → 0.17.0-dev.5739
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/dist/contract/discovery.d.ts +1 -32
- package/dist/contract/health.d.ts +2 -17
- package/dist/contract/index.js +2573 -2565
- package/dist/contract/repo-info.d.ts +12 -0
- package/dist/contract/repo.d.ts +1 -2
- package/dist/contract/runner.d.ts +15 -0
- package/dist/contract/usage-limit-hold.d.ts +15 -0
- package/dist/contract/waits.d.ts +2 -11
- package/dist/contract/workflows.d.ts +1 -1
- package/dist/contract/workspace.d.ts +36 -1
- package/dist/delegation/routes.d.ts +4 -4
- package/dist/delegation/transport.d.ts +71 -71
- package/dist/runs/run-exits.js.map +1 -1
- package/dist/voice/routes.d.ts +19 -19
- package/dist/workflows/run/wait-engine.d.ts +72 -72
- package/dist/workflows/run-states.js +3 -3
- package/dist/workflows/run-states.js.map +1 -1
- package/package.json +4 -4
- package/web/dist/assets/activity-motion-Deqj_hcK.js +2 -0
- package/web/dist/assets/{activity-route-De0BnSrc.js → activity-route-Z8SMpPLm.js} +1 -1
- package/web/dist/assets/{agent-accounts-BCg-578Q.js → agent-accounts-f1cxwgfz.js} +2 -2
- package/web/dist/assets/{cez-idle-BT0U4GN_.js → cez-idle-EVoUsgU3.js} +1 -1
- package/web/dist/assets/{commit-diff-panel-DYtYc_dH.js → commit-diff-panel-DZutYRbq.js} +1 -1
- package/web/dist/assets/{control-locations-CA9TMupq.js → control-locations-C9II3kPz.js} +1 -1
- package/web/dist/assets/{diff-tVGVhYyc.js → diff-DNAtaTLC.js} +2 -2
- package/web/dist/assets/{diff-view-CNM3u77o.js → diff-view---8Bt-0a.js} +1 -1
- package/web/dist/assets/{file-preview-C1eTdJLJ.js → file-preview-D08Kq15E.js} +1 -1
- package/web/dist/assets/{git-toolbar-Dwz8p8GW.js → git-toolbar-DMDmGits.js} +1 -1
- package/web/dist/assets/{github-BSezqH6f.js → github-DlMu4p0I.js} +1 -1
- package/web/dist/assets/{github-sidebar-model-Ct0DltOv.js → github-sidebar-model-B0Ufci5S.js} +1 -1
- package/web/dist/assets/{global-activity-route-BZiYz-B0.js → global-activity-route-mJrrP9I0.js} +1 -1
- package/web/dist/assets/{index-D489J7QW.js → index-FoxgrgAH.js} +8 -8
- package/web/dist/assets/{live-protocol-BDY7JJpT.js → live-protocol-BVn0UA_g.js} +1 -1
- package/web/dist/assets/{live-refetch-C0kQc3-z.js → live-refetch-BdnmTJ_8.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-DGkEs_L3.js → preview-pane-connected-KzJn9jAG.js} +1 -1
- package/web/dist/assets/{project-router-1m_VlC22.js → project-router-MMOk9VbW.js} +1 -1
- package/web/dist/assets/project-scope-context-B3M-u8R0.js +4 -0
- package/web/dist/assets/{queries-DYfIpJ-d.js → queries-DORTKwyN.js} +1 -1
- package/web/dist/assets/{repo-git-CU1S5P-y.js → repo-git-Bf_EfIHt.js} +1 -1
- package/web/dist/assets/{report-reader-DlZol2Ux.js → report-reader-ztLhC9gp.js} +1 -1
- package/web/dist/assets/reports-BxGqf1aC.js +1 -0
- package/web/dist/assets/{run-header-DPjiPKRe.js → run-header-CDMGqoPE.js} +1 -1
- package/web/dist/assets/skills-D2r8n5IP.js +1 -0
- package/web/dist/assets/{tab-link-DCUifQ46.js → tab-link-BvoGfK8S.js} +1 -1
- package/web/dist/assets/{task-changes-BZXWvQN3.js → task-changes-CfUCDwcL.js} +1 -1
- package/web/dist/assets/{task-commits-ByI9MSfc.js → task-commits-IOjoz_mL.js} +1 -1
- package/web/dist/assets/{task-files-LJbenpiH.js → task-files-CpUYhIpd.js} +1 -1
- package/web/dist/assets/{task-github-item-B0CU9lGR.js → task-github-item-B8YPhQDV.js} +1 -1
- package/web/dist/assets/task-thread-2Kme3Fc0.js +9 -0
- package/web/dist/assets/{thread-state-BLaCzqeX.js → thread-state-C136Em0C.js} +1 -1
- package/web/dist/assets/{use-hand-to-agent-state-BkmKad8x.js → use-hand-to-agent-state-C6u70P2A.js} +1 -1
- package/web/dist/assets/{useInfiniteQuery-qEY8OhKb.js → useInfiniteQuery-BbYMWe23.js} +1 -1
- package/web/dist/assets/useQuery-CqqnAJvu.js +1 -0
- package/web/dist/assets/{workflows-Dbxb-d-6.js → workflows-CWrdqLII.js} +1 -1
- package/web/dist/assets/{ws-DvGmrP4z.js → ws-BtSVmivO.js} +1 -1
- package/web/dist/index.html +13 -13
- package/web/dist/live-worker.js +1 -1
- package/web/dist/assets/activity-motion-hhx0e841.js +0 -2
- package/web/dist/assets/project-scope-context-CaUqlAd7.js +0 -4
- package/web/dist/assets/reports-DIGGjk7C.js +0 -1
- package/web/dist/assets/skills-BMwanop_.js +0 -1
- package/web/dist/assets/task-thread-CXCN__1a.js +0 -9
- package/web/dist/assets/useQuery-DOJQOEBO.js +0 -1
|
@@ -61,4 +61,4 @@ var e={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInte
|
|
|
61
61
|
|
|
62
62
|
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=ce,s=!u.jitless,c=s&&le.value,l=t.catchall,d;e._zod.parse=(u,f)=>{d??=r.value;let p=u.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),u=a(u,f),l?Tn([],p,u,f,d,e):u):n(u,f):(u.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),u)}});function On(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!x(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>C(e,r,d())))}),t)}var kn=s(`$ZodUnion`,(e,t)=>{T.init(e,t),m(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),m(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),m(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),m(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ne(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>On(t,r,e,i)):On(o,r,e,i)}}),An=s(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,kn.init(e,t);let n=e._zod.parse;m(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=ee(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!ce(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),jn=s(`$ZodIntersection`,(e,t)=>{T.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Nn(e,t,n)):Nn(e,i,a)}});function Mn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_(e)&&_(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Mn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Mn(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Nn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),x(e))return e;let o=Mn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Pn=s(`$ZodRecord`,(e,t)=>{T.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!_(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>C(e,r,d())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...S(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...S(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&_t.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>C(e,r,d())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...S(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...S(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Fn=s(`$ZodEnum`,(e,t)=>{T.init(e,t);let n=f(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>de.has(typeof e)).map(e=>typeof e==`string`?v(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),In=s(`$ZodLiteral`,(e,t)=>{if(T.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?v(e):e?v(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Ln=s(`$ZodTransform`,(e,t)=>{T.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new l(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new c;return n.value=i,n.fallback=!0,n}});function Rn(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var zn=s(`$ZodOptional`,(e,t)=>{T.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,m(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),m(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ne(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Rn(e,r)):Rn(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Bn=s(`$ZodExactOptional`,(e,t)=>{zn.init(e,t),m(e._zod,`values`,()=>t.innerType._zod.values),m(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Vn=s(`$ZodNullable`,(e,t)=>{T.init(e,t),m(e._zod,`optin`,()=>t.innerType._zod.optin),m(e._zod,`optout`,()=>t.innerType._zod.optout),m(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ne(e.source)}|null)$`):void 0}),m(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Hn=s(`$ZodDefault`,(e,t)=>{T.init(e,t),e._zod.optin=`optional`,m(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Un(e,t)):Un(r,t)}});function Un(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Wn=s(`$ZodPrefault`,(e,t)=>{T.init(e,t),e._zod.optin=`optional`,m(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Gn=s(`$ZodNonOptional`,(e,t)=>{T.init(e,t),m(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Kn(t,e)):Kn(i,e)}});function Kn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var qn=s(`$ZodCatch`,(e,t)=>{T.init(e,t),e._zod.optin=`optional`,m(e._zod,`optout`,()=>t.innerType._zod.optout),m(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>C(e,n,d()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>C(e,n,d()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Jn=s(`$ZodPipe`,(e,t)=>{T.init(e,t),m(e._zod,`values`,()=>t.in._zod.values),m(e._zod,`optin`,()=>t.in._zod.optin),m(e._zod,`optout`,()=>t.out._zod.optout),m(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Yn(e,t.in,n)):Yn(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Yn(e,t.out,n)):Yn(r,t.out,n)}});function Yn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Xn=s(`$ZodPreprocess`,(e,t)=>{Jn.init(e,t)}),Zn=s(`$ZodReadonly`,(e,t)=>{T.init(e,t),m(e._zod,`propValues`,()=>t.innerType._zod.propValues),m(e._zod,`values`,()=>t.innerType._zod.values),m(e._zod,`optin`,()=>t.innerType?._zod?.optin),m(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Qn):Qn(r)}});function Qn(e){return e.value=Object.freeze(e.value),e}var $n=s(`$ZodCustom`,(e,t)=>{w.init(e,t),T.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>er(t,n,r,e));er(i,n,r,e)}});function er(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(we(e))}}var tr,nr=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function rr(){return new nr}(tr=globalThis).__zod_globalRegistry??(tr.__zod_globalRegistry=rr());var ir=globalThis.__zod_globalRegistry;function ar(e,t){return new e({type:`string`,...b(t)})}function or(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...b(t)})}function sr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...b(t)})}function cr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...b(t)})}function lr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...b(t)})}function ur(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...b(t)})}function dr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...b(t)})}function fr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...b(t)})}function pr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...b(t)})}function mr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...b(t)})}function hr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...b(t)})}function gr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...b(t)})}function _r(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...b(t)})}function vr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...b(t)})}function yr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...b(t)})}function br(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...b(t)})}function xr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...b(t)})}function Sr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...b(t)})}function Cr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...b(t)})}function wr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...b(t)})}function Tr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...b(t)})}function Er(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...b(t)})}function Dr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...b(t)})}function Or(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...b(t)})}function kr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...b(t)})}function Ar(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...b(t)})}function jr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...b(t)})}function Mr(e,t){return new e({type:`number`,checks:[],...b(t)})}function Nr(e,t){return new e({type:`number`,coerce:!0,checks:[],...b(t)})}function Pr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...b(t)})}function Fr(e,t){return new e({type:`boolean`,...b(t)})}function Ir(e,t){return new e({type:`null`,...b(t)})}function Lr(e){return new e({type:`any`})}function Rr(e){return new e({type:`unknown`})}function zr(e,t){return new e({type:`never`,...b(t)})}function Br(e,t){return new Ct({check:`less_than`,...b(t),value:e,inclusive:!1})}function Vr(e,t){return new Ct({check:`less_than`,...b(t),value:e,inclusive:!0})}function Hr(e,t){return new wt({check:`greater_than`,...b(t),value:e,inclusive:!1})}function Ur(e,t){return new wt({check:`greater_than`,...b(t),value:e,inclusive:!0})}function Wr(e,t){return new Tt({check:`multiple_of`,...b(t),value:e})}function Gr(e,t){return new Dt({check:`max_length`,...b(t),maximum:e})}function Kr(e,t){return new Ot({check:`min_length`,...b(t),minimum:e})}function qr(e,t){return new kt({check:`length_equals`,...b(t),length:e})}function Jr(e,t){return new jt({check:`string_format`,format:`regex`,...b(t),pattern:e})}function Yr(e){return new Mt({check:`string_format`,format:`lowercase`,...b(e)})}function Xr(e){return new Nt({check:`string_format`,format:`uppercase`,...b(e)})}function Zr(e,t){return new Pt({check:`string_format`,format:`includes`,...b(t),includes:e})}function Qr(e,t){return new Ft({check:`string_format`,format:`starts_with`,...b(t),prefix:e})}function $r(e,t){return new It({check:`string_format`,format:`ends_with`,...b(t),suffix:e})}function D(e){return new Lt({check:`overwrite`,tx:e})}function ei(e){return D(t=>t.normalize(e))}function ti(){return D(e=>e.trim())}function ni(){return D(e=>e.toLowerCase())}function ri(){return D(e=>e.toUpperCase())}function ii(){return D(e=>oe(e))}function ai(e,t,n){return new e({type:`array`,element:t,...b(n)})}function oi(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...b(n)})}function si(e,t){let n=ci(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(we(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(we(r))}},e(t.value,t)),t);return n}function ci(e,t){let n=new w({check:`custom`,...b(t)});return n._zod.check=e,n}function li(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??ir,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function O(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,O(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&k(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ui(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
63
63
|
|
|
64
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function di(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:pi(t,`input`,e.processors),output:pi(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function k(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return k(r.element,n);if(r.type===`set`)return k(r.valueType,n);if(r.type===`lazy`)return k(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return k(r.innerType,n);if(r.type===`intersection`)return k(r.left,n)||k(r.right,n);if(r.type===`record`||r.type===`map`)return k(r.keyType,n)||k(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:k(r.in,n)||k(r.out,n);if(r.type===`object`){for(let e in r.shape)if(k(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(k(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(k(e,n))return!0;return!!(r.rest&&k(r.rest,n))}return!1}var fi=(e,t={})=>n=>{let r=li({...n,processors:t});return O(e,r),ui(r,e),di(r,e)},pi=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=li({...i??{},target:a,io:t,processors:n});return O(e,o),ui(o,e),di(o,e)},mi={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},hi=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=mi[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},gi=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},_i=(e,t,n,r)=>{n.type=`boolean`},vi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},yi=(e,t,n,r)=>{n.not={}},bi=(e,t,n,r)=>{let i=e._zod.def,a=f(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},xi=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Si=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Ci=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},wi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=O(a.element,t,{...r,path:[...r.path,`items`]})},Ti=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=O(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=O(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ei=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>O(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Di=(e,t,n,r)=>{let i=e._zod.def,a=O(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=O(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Oi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=O(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=O(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=O(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},ki=(e,t,n,r)=>{let i=e._zod.def,a=O(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ai=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ji=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Mi=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Ni=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Pi=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;O(o,t,r);let s=t.seen.get(e);s.ref=o},Fi=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ii=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Li=s(`ZodISODateTime`,(e,t)=>{Qt.init(e,t),P.init(e,t)});function A(e){return Or(Li,e)}var Ri=s(`ZodISODate`,(e,t)=>{$t.init(e,t),P.init(e,t)});function zi(e){return kr(Ri,e)}var Bi=s(`ZodISOTime`,(e,t)=>{en.init(e,t),P.init(e,t)});function Vi(e){return Ar(Bi,e)}var Hi=s(`ZodISODuration`,(e,t)=>{tn.init(e,t),P.init(e,t)});function Ui(e){return jr(Hi,e)}var j=s(`ZodError`,(e,t)=>{Ee.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>ke(e,t)},flatten:{value:t=>Oe(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,p,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,p,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Wi=Ae(j),Gi=je(j),Ki=Me(j),qi=Pe(j),Ji=Ie(j),Yi=Le(j),Xi=Re(j),Zi=ze(j),Qi=Be(j),$i=Ve(j),ea=He(j),ta=Ue(j),na=new WeakMap;function ra(e,t,n){let r=Object.getPrototypeOf(e),i=na.get(r);if(i||(i=new Set,na.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var M=s(`ZodType`,(e,t)=>(T.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:pi(e,`input`),output:pi(e,`output`)}}),e.toJSONSchema=fi(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Wi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ki(e,t,n),e.parseAsync=async(t,n)=>Gi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>qi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ji(e,t,n),e.decode=(t,n)=>Yi(e,t,n),e.encodeAsync=async(t,n)=>Xi(e,t,n),e.decodeAsync=async(t,n)=>Zi(e,t,n),e.safeEncode=(t,n)=>Qi(e,t,n),e.safeDecode=(t,n)=>$i(e,t,n),e.safeEncodeAsync=async(t,n)=>ea(e,t,n),e.safeDecodeAsync=async(t,n)=>ta(e,t,n),ra(e,`ZodType`,{check(...e){let t=this.def;return this.clone(g(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return y(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(_o(e,t))},superRefine(e,t){return this.check(vo(e,t))},overwrite(e){return this.check(D(e))},optional(){return Za(this)},exactOptional(){return $a(this)},nullable(){return to(this)},nullish(){return Za(to(this))},nonoptional(e){return so(this,e)},array(){return R(this)},or(e){return V([this,e])},and(e){return Wa(this,e)},transform(e){return fo(this,Ya(e))},default(e){return ro(this,e)},prefault(e){return ao(this,e)},catch(e){return lo(this,e)},pipe(e){return fo(this,e)},readonly(){return ho(this)},describe(e){let t=this.clone();return ir.add(t,{description:e}),t},meta(...e){if(e.length===0)return ir.get(this);let t=this.clone();return ir.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return ir.get(e)?.description},configurable:!0}),e)),ia=s(`_ZodString`,(e,t)=>{Bt.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,ra(e,`_ZodString`,{regex(...e){return this.check(Jr(...e))},includes(...e){return this.check(Zr(...e))},startsWith(...e){return this.check(Qr(...e))},endsWith(...e){return this.check($r(...e))},min(...e){return this.check(Kr(...e))},max(...e){return this.check(Gr(...e))},length(...e){return this.check(qr(...e))},nonempty(...e){return this.check(Kr(1,...e))},lowercase(e){return this.check(Yr(e))},uppercase(e){return this.check(Xr(e))},trim(){return this.check(ti())},normalize(...e){return this.check(ei(...e))},toLowerCase(){return this.check(ni())},toUpperCase(){return this.check(ri())},slugify(){return this.check(ii())}})}),aa=s(`ZodString`,(e,t)=>{Bt.init(e,t),ia.init(e,t),e.email=t=>e.check(or(oa,t)),e.url=t=>e.check(fr(la,t)),e.jwt=t=>e.check(Dr(Ta,t)),e.emoji=t=>e.check(pr(da,t)),e.guid=t=>e.check(sr(sa,t)),e.uuid=t=>e.check(cr(ca,t)),e.uuidv4=t=>e.check(lr(ca,t)),e.uuidv6=t=>e.check(ur(ca,t)),e.uuidv7=t=>e.check(dr(ca,t)),e.nanoid=t=>e.check(mr(fa,t)),e.guid=t=>e.check(sr(sa,t)),e.cuid=t=>e.check(hr(pa,t)),e.cuid2=t=>e.check(gr(ma,t)),e.ulid=t=>e.check(_r(ha,t)),e.base64=t=>e.check(wr(Sa,t)),e.base64url=t=>e.check(Tr(Ca,t)),e.xid=t=>e.check(vr(ga,t)),e.ksuid=t=>e.check(yr(_a,t)),e.ipv4=t=>e.check(br(va,t)),e.ipv6=t=>e.check(xr(ya,t)),e.cidrv4=t=>e.check(Sr(ba,t)),e.cidrv6=t=>e.check(Cr(xa,t)),e.e164=t=>e.check(Er(wa,t)),e.datetime=t=>e.check(A(t)),e.date=t=>e.check(zi(t)),e.time=t=>e.check(Vi(t)),e.duration=t=>e.check(Ui(t))});function N(e){return ar(aa,e)}var P=s(`ZodStringFormat`,(e,t)=>{E.init(e,t),ia.init(e,t)}),oa=s(`ZodEmail`,(e,t)=>{Ut.init(e,t),P.init(e,t)}),sa=s(`ZodGUID`,(e,t)=>{Vt.init(e,t),P.init(e,t)}),ca=s(`ZodUUID`,(e,t)=>{Ht.init(e,t),P.init(e,t)});function F(e){return cr(ca,e)}var la=s(`ZodURL`,(e,t)=>{Wt.init(e,t),P.init(e,t)});function ua(e){return fr(la,e)}var da=s(`ZodEmoji`,(e,t)=>{Gt.init(e,t),P.init(e,t)}),fa=s(`ZodNanoID`,(e,t)=>{Kt.init(e,t),P.init(e,t)}),pa=s(`ZodCUID`,(e,t)=>{qt.init(e,t),P.init(e,t)}),ma=s(`ZodCUID2`,(e,t)=>{Jt.init(e,t),P.init(e,t)}),ha=s(`ZodULID`,(e,t)=>{Yt.init(e,t),P.init(e,t)}),ga=s(`ZodXID`,(e,t)=>{Xt.init(e,t),P.init(e,t)}),_a=s(`ZodKSUID`,(e,t)=>{Zt.init(e,t),P.init(e,t)}),va=s(`ZodIPv4`,(e,t)=>{nn.init(e,t),P.init(e,t)}),ya=s(`ZodIPv6`,(e,t)=>{rn.init(e,t),P.init(e,t)}),ba=s(`ZodCIDRv4`,(e,t)=>{an.init(e,t),P.init(e,t)}),xa=s(`ZodCIDRv6`,(e,t)=>{on.init(e,t),P.init(e,t)}),Sa=s(`ZodBase64`,(e,t)=>{cn.init(e,t),P.init(e,t)}),Ca=s(`ZodBase64URL`,(e,t)=>{un.init(e,t),P.init(e,t)}),wa=s(`ZodE164`,(e,t)=>{dn.init(e,t),P.init(e,t)}),Ta=s(`ZodJWT`,(e,t)=>{pn.init(e,t),P.init(e,t)}),Ea=s(`ZodNumber`,(e,t)=>{mn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r),ra(e,`ZodNumber`,{gt(e,t){return this.check(Hr(e,t))},gte(e,t){return this.check(Ur(e,t))},min(e,t){return this.check(Ur(e,t))},lt(e,t){return this.check(Br(e,t))},lte(e,t){return this.check(Vr(e,t))},max(e,t){return this.check(Vr(e,t))},int(e){return this.check(Oa(e))},safe(e){return this.check(Oa(e))},positive(e){return this.check(Hr(0,e))},nonnegative(e){return this.check(Ur(0,e))},negative(e){return this.check(Br(0,e))},nonpositive(e){return this.check(Vr(0,e))},multipleOf(e,t){return this.check(Wr(e,t))},step(e,t){return this.check(Wr(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function I(e){return Mr(Ea,e)}var Da=s(`ZodNumberFormat`,(e,t)=>{hn.init(e,t),Ea.init(e,t)});function Oa(e){return Pr(Da,e)}var ka=s(`ZodBoolean`,(e,t)=>{gn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r)});function L(e){return Fr(ka,e)}var Aa=s(`ZodNull`,(e,t)=>{_n.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r)});function ja(e){return Ir(Aa,e)}var Ma=s(`ZodAny`,(e,t)=>{vn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Na(){return Lr(Ma)}var Pa=s(`ZodUnknown`,(e,t)=>{yn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Fa(){return Rr(Pa)}var Ia=s(`ZodNever`,(e,t)=>{bn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r)});function La(e){return zr(Ia,e)}var Ra=s(`ZodArray`,(e,t)=>{Sn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.element=t.element,ra(e,`ZodArray`,{min(e,t){return this.check(Kr(e,t))},nonempty(e){return this.check(Kr(1,e))},max(e,t){return this.check(Gr(e,t))},length(e,t){return this.check(qr(e,t))},unwrap(){return this.element}})});function R(e,t){return ai(Ra,e,t)}var za=s(`ZodObject`,(e,t)=>{Dn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),m(e,`shape`,()=>t.shape),ra(e,`ZodObject`,{keyof(){return W(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Fa()})},loose(){return this.clone({...this._zod.def,catchall:Fa()})},strict(){return this.clone({...this._zod.def,catchall:La()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ge(this,e)},safeExtend(e){return _e(this,e)},merge(e){return ve(this,e)},pick(e){return me(this,e)},omit(e){return he(this,e)},partial(...e){return ye(Xa,this,e[0])},required(...e){return be(oo,this,e[0])}})});function z(e,t){return new za({type:`object`,shape:e??{},...b(t)})}function Ba(e,t){return new za({type:`object`,shape:e,catchall:La(),...b(t)})}function B(e,t){return new za({type:`object`,shape:e,catchall:Fa(),...b(t)})}var Va=s(`ZodUnion`,(e,t)=>{kn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e.options=t.options});function V(e,t){return new Va({type:`union`,options:e,...b(t)})}var Ha=s(`ZodDiscriminatedUnion`,(e,t)=>{Va.init(e,t),An.init(e,t)});function H(e,t,n){return new Ha({type:`union`,options:t,discriminator:e,...b(n)})}var Ua=s(`ZodIntersection`,(e,t)=>{jn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r)});function Wa(e,t){return new Ua({type:`intersection`,left:e,right:t})}var Ga=s(`ZodRecord`,(e,t)=>{Pn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function U(e,t,n){return!t||!t._zod?new Ga({type:`record`,keyType:N(),valueType:e,...b(t)}):new Ga({type:`record`,keyType:e,valueType:t,...b(n)})}var Ka=s(`ZodEnum`,(e,t)=>{Fn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ka({...t,checks:[],...b(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ka({...t,checks:[],...b(r),entries:i})}});function W(e,t){return new Ka({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...b(t)})}var qa=s(`ZodLiteral`,(e,t)=>{In.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function G(e,t){return new qa({type:`literal`,values:Array.isArray(e)?e:[e],...b(t)})}var Ja=s(`ZodTransform`,(e,t)=>{Ln.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new l(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(we(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(we(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Ya(e){return new Ja({type:`transform`,transform:e})}var Xa=s(`ZodOptional`,(e,t)=>{zn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Za(e){return new Xa({type:`optional`,innerType:e})}var Qa=s(`ZodExactOptional`,(e,t)=>{Bn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $a(e){return new Qa({type:`optional`,innerType:e})}var eo=s(`ZodNullable`,(e,t)=>{Vn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function to(e){return new eo({type:`nullable`,innerType:e})}var no=s(`ZodDefault`,(e,t)=>{Hn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ro(e,t){return new no({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ue(t)}})}var io=s(`ZodPrefault`,(e,t)=>{Wn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ao(e,t){return new io({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ue(t)}})}var oo=s(`ZodNonOptional`,(e,t)=>{Gn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function so(e,t){return new oo({type:`nonoptional`,innerType:e,...b(t)})}var co=s(`ZodCatch`,(e,t)=>{qn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lo(e,t){return new co({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var uo=s(`ZodPipe`,(e,t)=>{Jn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pi(e,t,n,r),e.in=t.in,e.out=t.out});function fo(e,t){return new uo({type:`pipe`,in:e,out:t})}var po=s(`ZodPreprocess`,(e,t)=>{uo.init(e,t),Xn.init(e,t)}),mo=s(`ZodReadonly`,(e,t)=>{Zn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ho(e){return new mo({type:`readonly`,innerType:e})}var go=s(`ZodCustom`,(e,t)=>{$n.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r)});function _o(e,t={}){return oi(go,e,t)}function vo(e,t){return si(e,t)}function yo(e,t){return new po({type:`pipe`,in:Ya(e),out:t})}var bo={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},xo;xo||={};function So(e){return Nr(Ea,e)}var Co=z({status:W([`idle`,`preparing`,`ready`,`restarting`,`error`]),supported:L(),targetVersion:N().optional(),message:N().optional()});U(N(),La()),z({state:Co});var K=W([`claude`,`codex`,`opencode`,`pi`,`cursor`,`omp`]),wo=z({root:N(),branch:N(),remote:N().optional()}),To=z({name:W([...K.options,`gh`,`git`]),available:L(),version:N().optional(),hint:N().optional()}),Eo=z({kind:G(`github`),available:L().optional(),reason:N().optional()}),Do=z({localHandoff:L(),settingsAdmin:L(),remoteSettingsAdmin:L(),singleProject:L(),automations:L(),preview:L(),voice:L(),tokenMetrics:L(),tokenUsageMetrics:L(),costMetrics:L()}),Oo=z({version:N(),latestVersion:N().optional(),repoRoot:N(),repo:wo.nullable(),checks:R(To),defaultRunner:K,forge:Eo.nullable(),capabilities:Do,projects:R(z({id:N(),name:N()})),bootProject:N(),applicationUpdate:Co.optional()}),q={questions:4,id:64,header:12,question:400,minOptions:2,maxOptions:4,label:60,description:280,context:2e4},ko=N().min(1).max(q.context),Ao=z({label:N().min(1).max(q.label),description:N().max(q.description).optional()}).strict(),jo=z({id:N().min(1).max(q.id).optional(),header:N().min(1).max(q.header),question:N().min(1).max(q.question),options:R(Ao).min(q.minOptions).max(q.maxOptions).refine(e=>new Set(e.map(e=>e.label)).size===e.length,{message:`option labels must be unique within a question`}).optional(),multiSelect:L().optional()}).strict(),Mo=z({context:ko.optional(),questions:R(jo).min(1).max(q.questions).refine(e=>new Set(e.map(e=>e.question)).size===e.length,{message:`question texts must be unique`})}).strict(),No=W([`family`,`peer`]),Po=z({senderRunId:F(),recipientRunId:F(),kind:W([`request`,`progress`,`follow-up`,`reply`]),requestId:F().optional(),relationship:No.optional()}).strict(),Fo=Po.extend({id:F(),text:N().min(1).max(1e5),createdAt:A(),deadline:A().optional(),requestHash:N().regex(/^[0-9a-f]{64}$/),state:W([`accepted`,`continuation-required`,`destroyed`,`late`]),resumed:G(!0).optional(),instruction:N().max(2048).optional(),question:Mo.optional()}),J=z({requestId:F(),status:W([`replied`,`replied-late`,`completed-without-reply`,`failed`,`cancelled`,`destroyed`,`timed-out`,`sender-closed`,`human-fallback`,`deleted`]),observedAt:A(),replyId:F().optional()}).strict(),Io=z({messages:R(Fo).max(1024),outcomes:R(J).max(1024)}).strict(),Lo=N().max(128).regex(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z)~([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i,`Not a history cursor; pass nextBefore from an earlier page`);Io.extend({hint:N().optional(),nextBefore:Lo.optional()}),z({messages:R(Fo).max(32),outcomes:R(J).max(32),receiptId:F().optional(),expiresAt:A().optional()}).strict().refine(e=>e.messages.length>0?e.receiptId!==void 0&&e.expiresAt!==void 0:e.receiptId===void 0&&e.expiresAt===void 0,{message:`A nonempty inbox batch requires a receipt and expiry`}),z({receiptId:F()}).strict(),z({receiptId:F(),status:W([`acknowledged`,`already-acknowledged`,`released`])}).strict(),z({id:F(),recipientRunId:F(),kind:Po.shape.kind,requestId:F().optional(),text:N().min(1).max(1e5).refine(e=>e.trim().length>0),timeoutSeconds:I().int().min(1).max(86400).default(600),resume:L().optional()}).strict().refine(e=>e.timeoutSeconds<=1800||e.resume===!0&&e.kind===`request`,{path:[`timeoutSeconds`],message:`Only --resume requests accept deadlines above 1800 seconds (maximum 86400)`}).refine(e=>(e.kind===`reply`||e.kind===`follow-up`)==(e.requestId!==void 0),{message:`Replies and follow-ups require a request ID; new messages must omit it`}).refine(e=>!e.resume||e.kind===`request`||e.kind===`progress`,{message:`--resume requires a new request or progress instruction`});var Ro=W([`applied`,`unchanged`,`refused`,`unknown`]);z({message:Fo,delivery:W([`queued`,`delivered`,`consumed`,`not-delivered`]),outcome:J.optional(),effect:Ro.optional()}).strict(),z({recipientRunId:F(),before:Lo.optional()}).strict(),z({requestId:F()}).strict(),z({requestIds:R(F()).min(1).max(32).refine(e=>new Set(e).size===e.length),mode:W([`one`,`any`,`all`]).optional(),timeoutSeconds:I().int().min(1).max(1800).default(600)}).strict().refine(e=>e.mode!==`one`||e.requestIds.length===1,{message:`one requires exactly one request`});function zo(){return z({claude:N().optional(),codex:N().optional(),opencode:N().optional(),pi:N().optional(),cursor:N().optional(),omp:N().optional()})}var Bo=W([`low`,`medium`,`high`,`xhigh`,`max`]),Vo=N().max(32).optional(),Ho=z({repo:N().min(1).max(500),name:N().min(1).max(200)}).strict();z({browseRoot:N(),projectsDir:N(),archiveOnMerge:L().nullable(),effectiveArchiveOnMerge:L(),archiveOnMergeSource:W([`global`,`environment`,`default`]),composerDefaults:z({autonomous:L().nullable(),worktree:L().nullable(),inheritedAutonomous:V([L(),G(`source-dependent`)]),inheritedWorktree:L()}),resources:z({maxParallel:I(),maxMonitoringSessions:I(),monitoringWakeIntervalMinutes:I().nullable(),autoResumeOnUsageLimit:L(),memoryLimitMb:I().nullable(),worktreeRetentionDefault:I()}),agentDefaults:z({runner:K.optional(),models:zo().optional()})}),z({browseRoot:N().trim().min(1).max(4096).optional(),projectsDir:N().trim().min(1).max(4096).optional(),archiveOnMerge:L().nullable().optional(),composerDefaults:z({autonomous:L().nullable().optional(),worktree:L().nullable().optional()}).optional(),agentDefaults:z({runner:K.nullable().optional(),models:z({claude:N().trim().min(1).max(200).nullable().optional(),codex:N().trim().min(1).max(200).nullable().optional(),opencode:N().trim().min(1).max(200).nullable().optional(),pi:N().trim().min(1).max(200).nullable().optional(),cursor:N().trim().min(1).max(200).nullable().optional(),omp:N().trim().min(1).max(200).nullable().optional()}).optional()}).optional(),resources:z({maxParallel:I().int().min(1).max(16).optional(),maxMonitoringSessions:I().int().min(0).max(16).optional(),monitoringWakeIntervalMinutes:I().int().min(1).max(60).nullable().optional(),autoResumeOnUsageLimit:L().optional(),memoryLimitMb:I().int().min(0).max(1048576).nullable().optional(),worktreeRetentionDefault:I().int().min(0).max(1e3).optional()}).optional()});var Uo=z({accent:W([`cezarion`,`lime`,`violet`]).optional(),density:W([`comfortable`,`compact`,`ultra`]).optional(),width:W([`narrow`,`wide`]).optional()}),Wo=B({expandedColumns:U(N(),L()).optional()}),Go=z({overall:I().int().positive().nullable().optional(),needsYou:I().int().positive().nullable().optional(),finished:I().int().positive().nullable().optional(),working:I().int().positive().nullable().optional()});function Ko(e){let t={overall:10,needsYou:null,finished:null,working:null},n=typeof e==`object`&&e&&!Array.isArray(e)?e:{};for(let e of Object.keys(t)){let r=Go.shape[e].safeParse(n[e]);r.success&&r.data!==void 0&&(t[e]=r.data)}return t}B({sidebarLimits:Go.optional(),lastTask:z({source:W([`workflow`,`skill`]),ref:N()}).nullable().optional(),recentSources:R(z({source:W([`workflow`,`skill`]),ref:N()})).optional(),lastWorktree:L().optional(),lastAutonomous:L().optional(),disabledTeamSkills:R(Ho).max(200).optional(),skillUsage:U(N(),I()).optional(),runsView:W([`list`,`table`]).optional(),githubView:W([`issues`,`prs`]).optional(),appearance:Uo.optional(),promptTemplates:R(z({id:N(),label:N(),text:N(),skills:R(N()).optional()})).optional()});var qo=Ba({projectId:N().min(1).max(64),pathname:N().min(1).max(2048).startsWith(`/p/`),search:N().max(4096).startsWith(`?`).optional(),hash:N().max(2048).startsWith(`#`).optional()}),Jo=B({sidebar:B({collapsed:U(N(),L()).optional(),projectOrder:R(N()).optional()}).optional(),dismissedProviderAuthFailures:zo().optional(),appearance:Uo.optional(),notifications:B({enabled:L().optional()}).optional(),taskTable:Wo.optional(),lastLocation:qo.optional()}),Yo=200,Xo=50;B({...Jo.shape,sidebar:B({collapsed:U(N().min(1).max(64),L()).refine(e=>Object.keys(e).length<=Yo,{message:`sidebar.collapsed must have at most ${Yo} entries`}).optional(),projectOrder:R(N().min(1).max(64)).max(Yo).optional()}).optional(),dismissedProviderAuthFailures:Ba({claude:N().min(1).max(128).optional(),codex:N().min(1).max(128).optional(),opencode:N().min(1).max(128).optional(),pi:N().min(1).max(128).optional(),cursor:N().min(1).max(128).optional(),omp:N().min(1).max(128).optional()}).optional(),taskTable:Wo.extend({expandedColumns:U(N().min(1).max(64),L()).refine(e=>Object.keys(e).length<=Xo,{message:`taskTable.expandedColumns must have at most ${Xo} entries`}).optional()}).optional()}).superRefine((e,t)=>{Object.keys(e).length>Yo&&t.addIssue({code:`custom`,message:`ui-state has too many keys (max ${Yo})`})});var Zo=zo(),Qo=4e3,$o=7200,es=z({commands:R(N().trim().min(1).max(Qo)).max(20),timeoutSeconds:I().int().min(1).max($o).optional()}).strict();z({archiveOnMerge:L().nullable(),effectiveArchiveOnMerge:L(),archiveOnMergeSource:W([`project`,`global`,`environment`,`default`]),baseBranch:N().nullable(),defaultRunner:K,systemPrompt:N().nullable(),defaultModels:Zo,modelsLocked:L(),maxParallel:I(),memoryLimitMb:I().nullable(),worktreeRetention:I(),liveTitleUpdates:L().nullable(),reviewGate:L().nullable(),worktreeSetup:z({commands:R(N()),timeoutSeconds:I()}).nullable(),worktreeSetupIssue:N().nullable()}),z({archiveOnMerge:L().nullable().optional(),baseBranch:N().trim().min(1).max(200).nullable().optional(),defaultRunner:K.optional(),systemPrompt:N().trim().max(2e4).nullable().optional(),defaultModels:z({claude:N().trim().max(200).nullable().optional(),codex:N().trim().max(200).nullable().optional(),opencode:N().trim().max(200).nullable().optional(),pi:N().trim().max(200).nullable().optional(),cursor:N().trim().max(200).nullable().optional(),omp:N().trim().max(200).nullable().optional()}).optional(),maxParallel:I().int().min(1).max(16).optional(),memoryLimitMb:I().int().min(0).max(1048576).nullable().optional(),worktreeRetention:I().int().min(0).max(1e3).nullable().optional(),liveTitleUpdates:L().nullable().optional(),reviewGate:L().nullable().optional(),worktreeSetup:es.nullable().optional()});var ts=K,ns=z({provider:ts,status:W([`connected`,`disconnected`,`not-installed`,`unknown`]),enabled:L().optional(),hint:N().optional(),authFailureId:N().optional(),profileId:N().optional()});z({providers:R(ns)}),H(`opened`,[z({opened:G(!0),command:N()}),z({opened:G(!1),connected:G(!0),command:N()})]);var rs=W([`claude`,`codex`,`opencode`,`pi`,`cursor`,`omp`]),is=rs.options;function as(e){return is.includes(e)}var os=z({id:N(),label:N(),description:N(),effortLevels:R(Bo).optional()}),ss=z({runner:K,models:R(os),source:W([`live`,`cache`,`unavailable`]),stale:L(),reason:N().optional()});z({targets:R(z({id:N(),label:N(),icon:N().optional()}))}),z({target:N().trim().min(1,`target required`).max(200)}),z({opened:G(!0),path:N()}),H(`kind`,[...H(`kind`,[z({kind:G(`runners`)}).strict(),z({kind:G(`models`),runner:rs}).strict()]).options,z({kind:G(`tasks`),all:L().optional(),offset:I().int().min(0).max(2**53-1).optional()}).strict()]);var cs=ns.omit({provider:!0,profileId:!0}).extend({runner:rs});V([z({scope:G(`host-default-account`),runners:R(cs)}),ss,z({tasks:R(z({id:N(),title:N(),runner:K.optional(),status:W([`queued`,`running`,`waiting`,`review`,`done`,`failed`,`cancelled`]),attention:W([`permission`,`error`,`waiting`,`running`,`unseen`,`none`]),attentionLabel:N(),accepts:L(),reason:N().optional()})).max(32),nextOffset:I().int().nonnegative().optional()})]);var ls=z({runner:rs,requestedModel:N(),availableModels:R(os),otherRunners:R(rs)}),us=W([`spawn`,`inspect`,`steer`,`stop`,`destroy`,`diff`,`wait`]),Y=N().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),ds=N().regex(/^[0-9a-f]{64}$/),fs=R(F()).min(1).max(32).refine(e=>new Set(e).size===e.length),ps=R(us).max(7).refine(e=>new Set(e).size===e.length),ms=R(W([`process`,`worktree`,`branch`])).max(3).refine(e=>new Set(e).size===e.length),hs=N().max(2e3),gs=z({ownerRunId:F(),resourceId:F(),kind:G(`owned-isolated`),path:N().min(1),branch:N().min(1),baselineSha:Y}).strict(),X=z({workerId:F(),status:W([`review`,`done`,`failed`,`cancelled`]),observedAt:A(),summary:N().max(4e3).optional(),revision:I().int().nonnegative().optional()}).strict(),_s=W([`one`,`any`,`all`]),Z=z({id:F(),workerIds:R(F()).max(32).refine(e=>new Set(e).size===e.length),requestIds:R(F()).min(1).max(32).optional(),requestOutcomes:R(J).max(32).optional(),deadline:A(),mode:_s.optional(),revisions:R(z({workerId:F(),revision:I().int().nonnegative()}).strict()).max(32).optional(),reason:W([`outcome`,`timeout`,`cancelled`,`message`]).optional(),phase:W([`registered`,`parked`,`wake-pending`]),outcomes:R(X).max(32),wakeId:F().optional()}).strict(),vs=Z.omit({deadline:!0,requestIds:!0,requestOutcomes:!0}).extend({via:G(`completion`)}).strict(),ys=z({attempts:I().int().positive(),nextAt:A(),needsAttention:G(!0).optional()}).strict(),bs=z({requestedAt:A(),phase:W([`requested`,`terminating`,`cleaning`,`complete`,`incomplete`]),remaining:ms,error:hs.optional()}).strict(),xs=bs.extend({retry:ys.optional()}).strict(),Ss=z({requestId:F(),workerId:F(),requestHash:ds,deletion:z({phase:W([`pending`,`complete`]),revision:I().int().nonnegative(),resourceId:F(),generation:F()}).strict().optional()}).strict(),Cs=W(K.options),ws=N().min(1).max(4096).refine(e=>!/[\\\u0000-\u001f\u007f:]/.test(e)&&!e.startsWith(`/`)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&e.toLowerCase()!==`.git`));function Ts(e){return e.split(`/`).at(-1)?.toLowerCase()===`.gitignore`?`--attach cannot attach a .gitignore: ${e}; ignore rules must come from the baseline`:void 0}var Es=H(`kind`,[z({kind:G(`baseline-file`),path:ws}).strict(),z({kind:G(`parent-attachment`),id:N().min(1).max(255).regex(/^[A-Za-z0-9_-][A-Za-z0-9._-]*$/).refine(e=>!e.includes(`..`))}).strict(),z({kind:G(`parent-file`),path:ws}).strict().superRefine(({path:e},t)=>{let n=Ts(e);n&&t.addIssue({code:`custom`,path:[`path`],message:n})})]),Ds=z({text:N().max(1e5).optional(),artifacts:R(Es).max(32).optional()}).strict().superRefine(({artifacts:e=[]},t)=>{let n=new Set;for(let[r,i]of e.entries())i.kind===`parent-file`&&(n.has(i.path)&&t.addIssue({code:bo.custom,path:[`artifacts`,r,`path`],message:`duplicate --attach path: ${i.path}`}),n.add(i.path))}),Os=z({source:Es,path:N().min(1).max(8192),sha256:ds,bytes:I().int().min(0).max(2**53-1)}).strict(),ks=z({text:N().max(1e5).optional(),inputs:R(Os).max(32)}).strict(),As=z({state:G(`unavailable`),reason:W([`no-assistant-output`,`missing`,`unreadable`,`unverified`]),detail:hs.optional()}).strict(),js=z({state:G(`deleted`),reason:G(`missing`)}).strict(),Ms=W([`running`,`review-ready`,`completed`,`failed`,`cancelled`]),Ns=H(`state`,[z({state:G(`available`),id:N().max(255),path:N().max(8192)}).strict(),As.extend({id:N().max(255),path:N().max(8192)}),js.extend({id:N().max(255),path:N().max(8192)})]);z({result:z({workerId:F(),parentRunId:F(),revision:I().int().nonnegative(),observedAt:A(),status:W([`queued`,`running`,`waiting`,`review`,`done`,`failed`,`cancelled`]),outcome:W([`running`,`review-ready`,`completed`,`failed`,`cancelled`,`destroyed`]),lastExecutionOutcome:Ms,partial:L(),settled:L(),error:hs.optional(),backend:Cs.optional(),model:N().max(512).optional(),baselineSha:Y,workspace:gs.extend({state:W([`available`,`unavailable`,`deleted`]).optional()}),cleanup:W([`retained`,`requested`,`terminating`,`cleaning`,`complete`,`incomplete`]),summary:H(`state`,[z({state:G(`available`),text:N().min(1).max(4e3),source:G(`assistant`),seq:I().int().nonnegative(),truncated:L()}).strict(),As,js]),head:H(`state`,[z({state:G(`available`),sha:Y}).strict(),As.extend({sha:Y.optional()}),js.extend({sha:Y.optional()})]),diff:H(`state`,[z({state:G(`available`),snapshotId:F(),path:N().min(1).max(8192),truncated:L()}).strict(),As,js]),artifacts:H(`state`,[z({state:G(`available`),items:R(Ns).max(32),truncated:L()}).strict(),As,js])}).strict(),diffSnapshot:N().max(4e5).optional()}).strict();var Ps=z({workerId:F(),revision:I().int().nonnegative(),snapshotId:F(),observedAt:A(),lastExecutionOutcome:Ms,previous:z({revision:I().int().nonnegative(),observedAt:A(),lastExecutionOutcome:Ms}).strict().optional()}).strict(),Fs=H(`role`,[z({role:G(`root`),conversation:Io.optional(),permissions:ps,receipts:R(Ss).max(1024).refine(e=>new Set(e.map(e=>e.requestId)).size===e.length&&new Set(e.map(e=>e.workerId)).size===e.length),wait:Z.optional(),lastWait:Z.optional(),results:R(Ps).max(1024).refine(e=>new Set(e.map(e=>e.workerId)).size===e.length).optional(),finishRequestedAt:A().optional(),historyDeletion:G(`pending`).optional(),completion:z({phase:W([`waiting`,`attention`]),waitId:F().optional()}).strict().optional()}).strict(),z({role:G(`worker`),wait:Z.optional(),lastWait:Z.optional(),permissions:ps,parentRunId:F(),workspace:gs,destroy:bs.optional(),context:ks.optional(),executionRevision:I().int().nonnegative().optional(),executionStartSeq:I().int().nonnegative().optional()}).strict(),z({role:G(`invalid`)}).strict()]),Is=H(`role`,[Fs.options[0].pick({role:!0}).strip().extend({wait:Z.pick({phase:!0,requestIds:!0,workerIds:!0}).partial({workerIds:!0}).strip().extend({outcomes:R(X.pick({workerId:!0}).strip()).max(32).optional()}).optional()}),Fs.options[1].pick({role:!0,parentRunId:!0}).strip().extend({wait:Z.pick({phase:!0,requestIds:!0}).strip().optional()}),Fs.options[2].strip()]);z({task:N().min(1).max(1e5),baseline:N().min(1).max(1024),requestId:F(),context:Ds.optional(),backend:Cs.optional(),model:N().trim().min(1).max(512).optional(),effort:Vo,workflow:N().trim().min(1).max(200).optional(),skill:N().trim().min(1).max(200).optional()}).strict().refine(e=>e.skill===void 0||e.workflow===void 0,{message:`--skill and --workflow cannot be used together`}).refine(e=>e.task.length+(e.context?.text?.length??0)<=1e5,{message:`Combined task and context exceed 100000 characters`}),z({text:N().max(1e5).refine(e=>e.trim().length>0)}).strict(),z({workerIds:fs,timeoutSeconds:I().int().min(1).max(1800).default(600),mode:_s.optional()}).strict().refine(e=>e.mode!==`one`||e.workerIds.length===1,{message:`one mode requires exactly one worker`});var Ls=z({receiptId:F(),generation:F(),expiresAt:A(),acknowledgedAt:A().optional(),memberIds:R(F()).min(1).max(32).refine(e=>new Set(e).size===e.length).optional()}).strict(),Rs=z({conversation:Po.optional(),id:F(),source:W([`agent`,`lifecycle`]),parentRunId:F(),text:N().min(1).max(1e5),createdAt:A(),deliveredAt:A().optional(),consumedAt:A().optional(),awaitingRead:G(!0).optional(),inboxClaim:Ls.optional(),purpose:W([`completion-refusal`,`undelivered-question`]).optional(),requestHash:N().regex(/^[0-9a-f]{64}$/).optional(),deadline:A().optional()}).strict(),zs=z({workerId:F(),parentRunId:F(),status:W([`queued`,`running`,`waiting`,...X.shape.status.options]),currentStepId:N().optional(),workspace:gs,backend:Cs.optional(),model:N().max(512).optional(),inputs:R(Os).max(32).optional(),wait:Z.optional(),completionWait:vs.optional(),destroy:xs.optional(),outcome:X.optional()}),Bs=zs.pick({workerId:!0,parentRunId:!0,status:!0,workspace:!0,destroy:!0}).extend({revision:I().int().nonnegative(),settled:L(),destroyed:L()}).strict(),Vs=z({workers:R(Bs).max(1024)}).strict();z({offset:N().regex(/^\d{1,4}$/).refine(e=>Number(e)<=1024).optional()}).strict(),Vs.extend({workers:R(Bs).max(32),nextOffset:I().int().min(1).max(1024).optional()}).strict(),z({workerId:F(),baselineSha:Y,diff:N().max(4e5),truncated:L()}),z({workerId:F(),state:W([`stopping`,`terminated`])}),z({workerId:F(),state:W([`complete`,`incomplete`]),deleted:R(H(`kind`,[z({kind:G(`worktree`),path:N().max(8192)}).strict(),z({kind:G(`branch`),ref:N().max(1024)}).strict()])).max(2).optional(),remaining:ms,error:hs.optional()});var Hs=z({outstanding:I().int().nonnegative(),limit:I().int().nonnegative(),created:I().int().nonnegative(),creationLimit:I().int().nonnegative()}).strict(),Us=z({id:N(),title:N(),titleSummary:N().optional(),titleOrigin:W([`user`,`auto`,`marker`]).optional()}),Ws=z({parentRunId:F().optional(),workers:R(zs).max(1024),titles:R(Us).max(1025).optional(),capacity:Hs.optional()});z({code:W([`unavailable_transport`,`unauthenticated`,`denied_scope`,`invalid_input`,`invalid_baseline`,`incompatible_state`,`capacity_limit`,`unavailable_diff`,`incomplete_cleanup`]),error:hs,modelChoices:ls.optional()}),z({workerId:F()}).strict(),z({workerId:F(),baselineSha:Y}).strict(),z({workerId:F(),state:W([`queued`,`delivered`])}).strict();var Gs=z({wait:Z,instruction:N().min(1).max(1e3)}).strict();z({}).strict(),z({waitId:F()}).strict();var Ks=z({wait:Z}).strict();z({peerIds:fs,timeoutSeconds:I().int().min(1).max(1800).default(600)}).strict();var qs=H(`reason`,[z({reason:G(`message`),peerRunId:F(),messageId:F()}).strict(),z({reason:G(`settled`),peerRunId:F()}).strict(),z({reason:G(`timeout`)}).strict()]);function Js(e,t){(e.phase===`resolved`||e.phase===`delivered`)&&!e.result&&t.addIssue({code:`custom`,message:`a ${e.phase} peer wait has a result`,path:[`result`]}),e.phase===`open`&&e.result&&t.addIssue({code:`custom`,message:`an open peer wait has no result`,path:[`result`]})}var Ys=z({id:F(),peerIds:fs,deadline:A(),phase:W([`open`,`resolved`,`delivered`,`cancelled`]),result:qs.optional()}).strict().superRefine(Js),Xs=z({wait:Ys,instruction:N().min(1).max(1e3)}).strict(),Zs=z({wait:Ys}).strict();V([Gs,Xs]),V([Ks,Zs]);var Q=B({seq:I(),ts:N(),stepId:N().optional(),type:N()}),Qs=Q.extend({type:G(`conversation-message`),message:Fo,delivery:W([`queued`,`delivered`,`consumed`,`not-delivered`]),deliveredAt:A().optional(),consumedAt:A().optional()}),$s=Q.extend({type:G(`request-outcome`),outcome:J}),ec=Q.extend({type:G(`agent-input`),input:Rs}),tc=Q.extend({type:G(`human-input-delivered`),askSeq:I().int().nonnegative(),source:W([`human`,`parent`,`cezar`]).optional()}),nc=Q.extend({type:G(`human-ask-closed`),askSeq:I().int().nonnegative(),reason:W([`finish`,`superseded`,`parent-stopped`,`worker-stopped`,`undeliverable`])});Q.extend({type:G(`worker-question-routed`),askSeq:I().int().nonnegative(),messageId:F(),parentRunId:F()}),Q.extend({type:G(`worker-question-fallback`),askSeq:I().int().nonnegative(),reason:N().min(1).max(200)}),Q.extend({type:G(`worker-question-undelivered`),askSeq:I().int().nonnegative(),reason:N().min(1).max(200)}),Q.extend({type:G(`worker-outcome`),outcome:X});var rc=z({id:N().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/)}),$=N().min(1).max(2048);z({cursor:$.optional()}),z({cursor:$.optional(),afterSeq:So().int().nonnegative().optional()});var ic=z({seq:I(),ts:N(),stepId:N().optional(),type:N()}).catchall(Na()),ac=z({events:R(ic),itemCount:I().int().min(0).max(100),olderCursor:$.optional(),newerCursor:$.optional(),liveCursor:$,asOfSeq:I().int().nonnegative(),hasOlder:L()}),oc=z({contextEvents:R(ic),asOfSeq:I().int().nonnegative()}),sc=z({checkoutId:N().optional(),name:N(),phase:W([`cloning`,`done`,`error`]),line:N().optional(),error:N().optional(),warning:N().optional()}),cc=1024*1024,lc=z({projectId:N().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/),runId:rc.shape.id,cursor:$.optional(),afterSeq:I().int().nonnegative().safe()});z({runs:R(lc).min(1).max(32)}).refine(({runs:e})=>new Set(e.map(e=>`${e.projectId}/${e.runId}`)).size===e.length,{message:`duplicate run demand`});var uc=lc.pick({projectId:!0,runId:!0}),dc=uc.extend({type:W([`error`,`reset`]),status:V([G(400),G(404),G(409),G(413),G(503)]),error:N()}),fc=V([uc.extend({type:G(`batch`),events:R(ic).max(256),cursor:$,afterSeq:I().int().nonnegative(),hasMore:L()}),dc]),pc=z({generation:N(),results:R(fc)}),mc=V([z({type:G(`ready`),generation:N()}),z({type:G(`ping`)}),uc.extend({type:G(`event`),name:W([`run-event`,`ui-event`]),event:ic}),dc]),hc=`cezar-live-v3`,gc=15e3,_c=5e3;function vc(e){return!e.startsWith(`/api/v1/`)||e.includes(`#`)||/[\\\r\n]/.test(e)?!1:/^\/api\/v1\/(?:workspace\/(?:runs-index|activity)|p\/[a-zA-Z0-9_-]+\/(?:reports\/state|runs\/[a-zA-Z0-9._-]+\/(?:changes|commits)|github(?:\/(?:checks|ref-status))?))(?:\?[^#]*)?$/.test(e)}var yc=H(`kind`,[z({kind:G(`workspace`)}),lc.extend({kind:G(`run`)}),z({kind:G(`topic`),topic:N().min(1).max(128)}),z({kind:G(`read`),path:N().max(4096).refine(vc),intervalMs:I().int().min(1e3).max(2147483647)})]),bc=z({id:N().min(1).max(128),demand:yc}),xc=z({version:G(3),documentId:N().min(1).max(128),epoch:I().int().nonnegative()}),Sc=H(`type`,[xc.extend({type:G(`sync`),entries:R(bc).max(64),workspaceReady:G(!0).optional()}).refine(e=>new Set(e.entries.map(e=>e.id)).size===e.entries.length),xc.extend({type:G(`ack`),id:N(),seq:I().int().nonnegative()}),xc.extend({type:G(`refresh`),id:N()})]),Cc=z({event:N(),data:N(),id:N()}),wc=H(`type`,[z({type:G(`unavailable`),version:G(3),epoch:I(),reason:N()}),z({type:G(`hello`),version:G(3)}),z({type:G(`alive`),version:G(3),epoch:I()}),z({type:G(`frame`),version:G(3),epoch:I(),id:N(),frame:V([Cc,mc])}),z({type:G(`value`),version:G(3),epoch:I(),id:N(),value:Fa(),error:N().optional()}),z({type:G(`reset`),version:G(3),epoch:I(),id:N(),reason:N()})]),Tc=e=>`${e.projectId}/${e.runId}`;export{H as $,_s as A,zo as B,qs as C,ys as D,Ws as E,ns as F,Oo as G,ko as H,as as I,So as J,wo as K,ss as L,$o as M,Ko as N,fs as O,ts as P,L as Q,Go as R,Fs as S,Is as T,Mo as U,J as V,Do as W,ja as X,W as Y,R as Z,$s as _,yc as a,U as at,rc as b,Tc as c,Fa as ct,cc as d,A as dt,G as et,ec as f,a as ft,tc as g,nc as h,vc as i,yo as it,Qo as j,X as k,pc as l,ua as lt,Qs as m,hc as n,I as nt,Sc as o,N as ot,sc as p,t as pt,K as q,_c as r,z as rt,wc as s,V as st,gc as t,La as tt,mc as u,F as ut,oc as v,Js as w,Rs as x,ac as y,Ho as z};
|
|
64
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function di(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:pi(t,`input`,e.processors),output:pi(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function k(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return k(r.element,n);if(r.type===`set`)return k(r.valueType,n);if(r.type===`lazy`)return k(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return k(r.innerType,n);if(r.type===`intersection`)return k(r.left,n)||k(r.right,n);if(r.type===`record`||r.type===`map`)return k(r.keyType,n)||k(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:k(r.in,n)||k(r.out,n);if(r.type===`object`){for(let e in r.shape)if(k(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(k(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(k(e,n))return!0;return!!(r.rest&&k(r.rest,n))}return!1}var fi=(e,t={})=>n=>{let r=li({...n,processors:t});return O(e,r),ui(r,e),di(r,e)},pi=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=li({...i??{},target:a,io:t,processors:n});return O(e,o),ui(o,e),di(o,e)},mi={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},hi=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=mi[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},gi=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},_i=(e,t,n,r)=>{n.type=`boolean`},vi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},yi=(e,t,n,r)=>{n.not={}},bi=(e,t,n,r)=>{let i=e._zod.def,a=f(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},xi=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Si=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Ci=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},wi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=O(a.element,t,{...r,path:[...r.path,`items`]})},Ti=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=O(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=O(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ei=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>O(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Di=(e,t,n,r)=>{let i=e._zod.def,a=O(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=O(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Oi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=O(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=O(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=O(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},ki=(e,t,n,r)=>{let i=e._zod.def,a=O(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ai=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ji=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Mi=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Ni=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Pi=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;O(o,t,r);let s=t.seen.get(e);s.ref=o},Fi=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ii=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Li=s(`ZodISODateTime`,(e,t)=>{Qt.init(e,t),P.init(e,t)});function A(e){return Or(Li,e)}var Ri=s(`ZodISODate`,(e,t)=>{$t.init(e,t),P.init(e,t)});function zi(e){return kr(Ri,e)}var Bi=s(`ZodISOTime`,(e,t)=>{en.init(e,t),P.init(e,t)});function Vi(e){return Ar(Bi,e)}var Hi=s(`ZodISODuration`,(e,t)=>{tn.init(e,t),P.init(e,t)});function Ui(e){return jr(Hi,e)}var j=s(`ZodError`,(e,t)=>{Ee.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>ke(e,t)},flatten:{value:t=>Oe(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,p,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,p,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Wi=Ae(j),Gi=je(j),Ki=Me(j),qi=Pe(j),Ji=Ie(j),Yi=Le(j),Xi=Re(j),Zi=ze(j),Qi=Be(j),$i=Ve(j),ea=He(j),ta=Ue(j),na=new WeakMap;function ra(e,t,n){let r=Object.getPrototypeOf(e),i=na.get(r);if(i||(i=new Set,na.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var M=s(`ZodType`,(e,t)=>(T.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:pi(e,`input`),output:pi(e,`output`)}}),e.toJSONSchema=fi(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Wi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ki(e,t,n),e.parseAsync=async(t,n)=>Gi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>qi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Ji(e,t,n),e.decode=(t,n)=>Yi(e,t,n),e.encodeAsync=async(t,n)=>Xi(e,t,n),e.decodeAsync=async(t,n)=>Zi(e,t,n),e.safeEncode=(t,n)=>Qi(e,t,n),e.safeDecode=(t,n)=>$i(e,t,n),e.safeEncodeAsync=async(t,n)=>ea(e,t,n),e.safeDecodeAsync=async(t,n)=>ta(e,t,n),ra(e,`ZodType`,{check(...e){let t=this.def;return this.clone(g(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return y(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(_o(e,t))},superRefine(e,t){return this.check(vo(e,t))},overwrite(e){return this.check(D(e))},optional(){return Za(this)},exactOptional(){return $a(this)},nullable(){return to(this)},nullish(){return Za(to(this))},nonoptional(e){return so(this,e)},array(){return R(this)},or(e){return V([this,e])},and(e){return Wa(this,e)},transform(e){return fo(this,Ya(e))},default(e){return ro(this,e)},prefault(e){return ao(this,e)},catch(e){return lo(this,e)},pipe(e){return fo(this,e)},readonly(){return ho(this)},describe(e){let t=this.clone();return ir.add(t,{description:e}),t},meta(...e){if(e.length===0)return ir.get(this);let t=this.clone();return ir.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return ir.get(e)?.description},configurable:!0}),e)),ia=s(`_ZodString`,(e,t)=>{Bt.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,ra(e,`_ZodString`,{regex(...e){return this.check(Jr(...e))},includes(...e){return this.check(Zr(...e))},startsWith(...e){return this.check(Qr(...e))},endsWith(...e){return this.check($r(...e))},min(...e){return this.check(Kr(...e))},max(...e){return this.check(Gr(...e))},length(...e){return this.check(qr(...e))},nonempty(...e){return this.check(Kr(1,...e))},lowercase(e){return this.check(Yr(e))},uppercase(e){return this.check(Xr(e))},trim(){return this.check(ti())},normalize(...e){return this.check(ei(...e))},toLowerCase(){return this.check(ni())},toUpperCase(){return this.check(ri())},slugify(){return this.check(ii())}})}),aa=s(`ZodString`,(e,t)=>{Bt.init(e,t),ia.init(e,t),e.email=t=>e.check(or(oa,t)),e.url=t=>e.check(fr(la,t)),e.jwt=t=>e.check(Dr(Ta,t)),e.emoji=t=>e.check(pr(da,t)),e.guid=t=>e.check(sr(sa,t)),e.uuid=t=>e.check(cr(ca,t)),e.uuidv4=t=>e.check(lr(ca,t)),e.uuidv6=t=>e.check(ur(ca,t)),e.uuidv7=t=>e.check(dr(ca,t)),e.nanoid=t=>e.check(mr(fa,t)),e.guid=t=>e.check(sr(sa,t)),e.cuid=t=>e.check(hr(pa,t)),e.cuid2=t=>e.check(gr(ma,t)),e.ulid=t=>e.check(_r(ha,t)),e.base64=t=>e.check(wr(Sa,t)),e.base64url=t=>e.check(Tr(Ca,t)),e.xid=t=>e.check(vr(ga,t)),e.ksuid=t=>e.check(yr(_a,t)),e.ipv4=t=>e.check(br(va,t)),e.ipv6=t=>e.check(xr(ya,t)),e.cidrv4=t=>e.check(Sr(ba,t)),e.cidrv6=t=>e.check(Cr(xa,t)),e.e164=t=>e.check(Er(wa,t)),e.datetime=t=>e.check(A(t)),e.date=t=>e.check(zi(t)),e.time=t=>e.check(Vi(t)),e.duration=t=>e.check(Ui(t))});function N(e){return ar(aa,e)}var P=s(`ZodStringFormat`,(e,t)=>{E.init(e,t),ia.init(e,t)}),oa=s(`ZodEmail`,(e,t)=>{Ut.init(e,t),P.init(e,t)}),sa=s(`ZodGUID`,(e,t)=>{Vt.init(e,t),P.init(e,t)}),ca=s(`ZodUUID`,(e,t)=>{Ht.init(e,t),P.init(e,t)});function F(e){return cr(ca,e)}var la=s(`ZodURL`,(e,t)=>{Wt.init(e,t),P.init(e,t)});function ua(e){return fr(la,e)}var da=s(`ZodEmoji`,(e,t)=>{Gt.init(e,t),P.init(e,t)}),fa=s(`ZodNanoID`,(e,t)=>{Kt.init(e,t),P.init(e,t)}),pa=s(`ZodCUID`,(e,t)=>{qt.init(e,t),P.init(e,t)}),ma=s(`ZodCUID2`,(e,t)=>{Jt.init(e,t),P.init(e,t)}),ha=s(`ZodULID`,(e,t)=>{Yt.init(e,t),P.init(e,t)}),ga=s(`ZodXID`,(e,t)=>{Xt.init(e,t),P.init(e,t)}),_a=s(`ZodKSUID`,(e,t)=>{Zt.init(e,t),P.init(e,t)}),va=s(`ZodIPv4`,(e,t)=>{nn.init(e,t),P.init(e,t)}),ya=s(`ZodIPv6`,(e,t)=>{rn.init(e,t),P.init(e,t)}),ba=s(`ZodCIDRv4`,(e,t)=>{an.init(e,t),P.init(e,t)}),xa=s(`ZodCIDRv6`,(e,t)=>{on.init(e,t),P.init(e,t)}),Sa=s(`ZodBase64`,(e,t)=>{cn.init(e,t),P.init(e,t)}),Ca=s(`ZodBase64URL`,(e,t)=>{un.init(e,t),P.init(e,t)}),wa=s(`ZodE164`,(e,t)=>{dn.init(e,t),P.init(e,t)}),Ta=s(`ZodJWT`,(e,t)=>{pn.init(e,t),P.init(e,t)}),Ea=s(`ZodNumber`,(e,t)=>{mn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r),ra(e,`ZodNumber`,{gt(e,t){return this.check(Hr(e,t))},gte(e,t){return this.check(Ur(e,t))},min(e,t){return this.check(Ur(e,t))},lt(e,t){return this.check(Br(e,t))},lte(e,t){return this.check(Vr(e,t))},max(e,t){return this.check(Vr(e,t))},int(e){return this.check(Oa(e))},safe(e){return this.check(Oa(e))},positive(e){return this.check(Hr(0,e))},nonnegative(e){return this.check(Ur(0,e))},negative(e){return this.check(Br(0,e))},nonpositive(e){return this.check(Vr(0,e))},multipleOf(e,t){return this.check(Wr(e,t))},step(e,t){return this.check(Wr(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function I(e){return Mr(Ea,e)}var Da=s(`ZodNumberFormat`,(e,t)=>{hn.init(e,t),Ea.init(e,t)});function Oa(e){return Pr(Da,e)}var ka=s(`ZodBoolean`,(e,t)=>{gn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r)});function L(e){return Fr(ka,e)}var Aa=s(`ZodNull`,(e,t)=>{_n.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r)});function ja(e){return Ir(Aa,e)}var Ma=s(`ZodAny`,(e,t)=>{vn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Na(){return Lr(Ma)}var Pa=s(`ZodUnknown`,(e,t)=>{yn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Fa(){return Rr(Pa)}var Ia=s(`ZodNever`,(e,t)=>{bn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r)});function La(e){return zr(Ia,e)}var Ra=s(`ZodArray`,(e,t)=>{Sn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.element=t.element,ra(e,`ZodArray`,{min(e,t){return this.check(Kr(e,t))},nonempty(e){return this.check(Kr(1,e))},max(e,t){return this.check(Gr(e,t))},length(e,t){return this.check(qr(e,t))},unwrap(){return this.element}})});function R(e,t){return ai(Ra,e,t)}var za=s(`ZodObject`,(e,t)=>{Dn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),m(e,`shape`,()=>t.shape),ra(e,`ZodObject`,{keyof(){return W(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Fa()})},loose(){return this.clone({...this._zod.def,catchall:Fa()})},strict(){return this.clone({...this._zod.def,catchall:La()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ge(this,e)},safeExtend(e){return _e(this,e)},merge(e){return ve(this,e)},pick(e){return me(this,e)},omit(e){return he(this,e)},partial(...e){return ye(Xa,this,e[0])},required(...e){return be(oo,this,e[0])}})});function z(e,t){return new za({type:`object`,shape:e??{},...b(t)})}function Ba(e,t){return new za({type:`object`,shape:e,catchall:La(),...b(t)})}function B(e,t){return new za({type:`object`,shape:e,catchall:Fa(),...b(t)})}var Va=s(`ZodUnion`,(e,t)=>{kn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e.options=t.options});function V(e,t){return new Va({type:`union`,options:e,...b(t)})}var Ha=s(`ZodDiscriminatedUnion`,(e,t)=>{Va.init(e,t),An.init(e,t)});function H(e,t,n){return new Ha({type:`union`,options:t,discriminator:e,...b(n)})}var Ua=s(`ZodIntersection`,(e,t)=>{jn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r)});function Wa(e,t){return new Ua({type:`intersection`,left:e,right:t})}var Ga=s(`ZodRecord`,(e,t)=>{Pn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function U(e,t,n){return!t||!t._zod?new Ga({type:`record`,keyType:N(),valueType:e,...b(t)}):new Ga({type:`record`,keyType:e,valueType:t,...b(n)})}var Ka=s(`ZodEnum`,(e,t)=>{Fn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ka({...t,checks:[],...b(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ka({...t,checks:[],...b(r),entries:i})}});function W(e,t){return new Ka({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...b(t)})}var qa=s(`ZodLiteral`,(e,t)=>{In.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function G(e,t){return new qa({type:`literal`,values:Array.isArray(e)?e:[e],...b(t)})}var Ja=s(`ZodTransform`,(e,t)=>{Ln.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new l(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(we(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(we(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Ya(e){return new Ja({type:`transform`,transform:e})}var Xa=s(`ZodOptional`,(e,t)=>{zn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Za(e){return new Xa({type:`optional`,innerType:e})}var Qa=s(`ZodExactOptional`,(e,t)=>{Bn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $a(e){return new Qa({type:`optional`,innerType:e})}var eo=s(`ZodNullable`,(e,t)=>{Vn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function to(e){return new eo({type:`nullable`,innerType:e})}var no=s(`ZodDefault`,(e,t)=>{Hn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ro(e,t){return new no({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ue(t)}})}var io=s(`ZodPrefault`,(e,t)=>{Wn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ao(e,t){return new io({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ue(t)}})}var oo=s(`ZodNonOptional`,(e,t)=>{Gn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function so(e,t){return new oo({type:`nonoptional`,innerType:e,...b(t)})}var co=s(`ZodCatch`,(e,t)=>{qn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lo(e,t){return new co({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var uo=s(`ZodPipe`,(e,t)=>{Jn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pi(e,t,n,r),e.in=t.in,e.out=t.out});function fo(e,t){return new uo({type:`pipe`,in:e,out:t})}var po=s(`ZodPreprocess`,(e,t)=>{uo.init(e,t),Xn.init(e,t)}),mo=s(`ZodReadonly`,(e,t)=>{Zn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ho(e){return new mo({type:`readonly`,innerType:e})}var go=s(`ZodCustom`,(e,t)=>{$n.init(e,t),M.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r)});function _o(e,t={}){return oi(go,e,t)}function vo(e,t){return si(e,t)}function yo(e,t){return new po({type:`pipe`,in:Ya(e),out:t})}var bo={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},xo;xo||={};function So(e){return Nr(Ea,e)}var K=W([`claude`,`codex`,`opencode`,`pi`,`cursor`,`omp`]),q={questions:4,id:64,header:12,question:400,minOptions:2,maxOptions:4,label:60,description:280,context:2e4},Co=N().min(1).max(q.context),wo=z({label:N().min(1).max(q.label),description:N().max(q.description).optional()}).strict(),To=z({id:N().min(1).max(q.id).optional(),header:N().min(1).max(q.header),question:N().min(1).max(q.question),options:R(wo).min(q.minOptions).max(q.maxOptions).refine(e=>new Set(e.map(e=>e.label)).size===e.length,{message:`option labels must be unique within a question`}).optional(),multiSelect:L().optional()}).strict(),Eo=z({context:Co.optional(),questions:R(To).min(1).max(q.questions).refine(e=>new Set(e.map(e=>e.question)).size===e.length,{message:`question texts must be unique`})}).strict(),Do=W([`family`,`peer`]),Oo=z({senderRunId:F(),recipientRunId:F(),kind:W([`request`,`progress`,`follow-up`,`reply`]),requestId:F().optional(),relationship:Do.optional()}).strict(),ko=Oo.extend({id:F(),text:N().min(1).max(1e5),createdAt:A(),deadline:A().optional(),requestHash:N().regex(/^[0-9a-f]{64}$/),state:W([`accepted`,`continuation-required`,`destroyed`,`late`]),resumed:G(!0).optional(),instruction:N().max(2048).optional(),question:Eo.optional()}),J=z({requestId:F(),status:W([`replied`,`replied-late`,`completed-without-reply`,`failed`,`cancelled`,`destroyed`,`timed-out`,`sender-closed`,`human-fallback`,`deleted`]),observedAt:A(),replyId:F().optional()}).strict(),Ao=z({messages:R(ko).max(1024),outcomes:R(J).max(1024)}).strict(),jo=N().max(128).regex(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z)~([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i,`Not a history cursor; pass nextBefore from an earlier page`);Ao.extend({hint:N().optional(),nextBefore:jo.optional()}),z({messages:R(ko).max(32),outcomes:R(J).max(32),receiptId:F().optional(),expiresAt:A().optional()}).strict().refine(e=>e.messages.length>0?e.receiptId!==void 0&&e.expiresAt!==void 0:e.receiptId===void 0&&e.expiresAt===void 0,{message:`A nonempty inbox batch requires a receipt and expiry`}),z({receiptId:F()}).strict(),z({receiptId:F(),status:W([`acknowledged`,`already-acknowledged`,`released`])}).strict(),z({id:F(),recipientRunId:F(),kind:Oo.shape.kind,requestId:F().optional(),text:N().min(1).max(1e5).refine(e=>e.trim().length>0),timeoutSeconds:I().int().min(1).max(86400).default(600),resume:L().optional()}).strict().refine(e=>e.timeoutSeconds<=1800||e.resume===!0&&e.kind===`request`,{path:[`timeoutSeconds`],message:`Only --resume requests accept deadlines above 1800 seconds (maximum 86400)`}).refine(e=>(e.kind===`reply`||e.kind===`follow-up`)==(e.requestId!==void 0),{message:`Replies and follow-ups require a request ID; new messages must omit it`}).refine(e=>!e.resume||e.kind===`request`||e.kind===`progress`,{message:`--resume requires a new request or progress instruction`});var Mo=W([`applied`,`unchanged`,`refused`,`unknown`]);z({message:ko,delivery:W([`queued`,`delivered`,`consumed`,`not-delivered`]),outcome:J.optional(),effect:Mo.optional()}).strict(),z({recipientRunId:F(),before:jo.optional()}).strict(),z({requestId:F()}).strict(),z({requestIds:R(F()).min(1).max(32).refine(e=>new Set(e).size===e.length),mode:W([`one`,`any`,`all`]).optional(),timeoutSeconds:I().int().min(1).max(1800).default(600)}).strict().refine(e=>e.mode!==`one`||e.requestIds.length===1,{message:`one requires exactly one request`});var No=W([`low`,`medium`,`high`,`xhigh`,`max`]),Po=N().max(32).optional();function Fo(){return z({claude:N().optional(),codex:N().optional(),opencode:N().optional(),pi:N().optional(),cursor:N().optional(),omp:N().optional()})}var Io=z({repo:N().min(1).max(500),name:N().min(1).max(200)}).strict();z({browseRoot:N(),projectsDir:N(),archiveOnMerge:L().nullable(),effectiveArchiveOnMerge:L(),archiveOnMergeSource:W([`global`,`environment`,`default`]),composerDefaults:z({autonomous:L().nullable(),worktree:L().nullable(),inheritedAutonomous:V([L(),G(`source-dependent`)]),inheritedWorktree:L()}),resources:z({maxParallel:I(),maxMonitoringSessions:I(),monitoringWakeIntervalMinutes:I().nullable(),autoResumeOnUsageLimit:L(),memoryLimitMb:I().nullable(),worktreeRetentionDefault:I()}),agentDefaults:z({runner:K.optional(),models:Fo().optional()})}),z({browseRoot:N().trim().min(1).max(4096).optional(),projectsDir:N().trim().min(1).max(4096).optional(),archiveOnMerge:L().nullable().optional(),composerDefaults:z({autonomous:L().nullable().optional(),worktree:L().nullable().optional()}).optional(),agentDefaults:z({runner:K.nullable().optional(),models:z({claude:N().trim().min(1).max(200).nullable().optional(),codex:N().trim().min(1).max(200).nullable().optional(),opencode:N().trim().min(1).max(200).nullable().optional(),pi:N().trim().min(1).max(200).nullable().optional(),cursor:N().trim().min(1).max(200).nullable().optional(),omp:N().trim().min(1).max(200).nullable().optional()}).optional()}).optional(),resources:z({maxParallel:I().int().min(1).max(16).optional(),maxMonitoringSessions:I().int().min(0).max(16).optional(),monitoringWakeIntervalMinutes:I().int().min(1).max(60).nullable().optional(),autoResumeOnUsageLimit:L().optional(),memoryLimitMb:I().int().min(0).max(1048576).nullable().optional(),worktreeRetentionDefault:I().int().min(0).max(1e3).optional()}).optional()});var Lo=z({accent:W([`cezarion`,`lime`,`violet`]).optional(),density:W([`comfortable`,`compact`,`ultra`]).optional(),width:W([`narrow`,`wide`]).optional()}),Ro=B({expandedColumns:U(N(),L()).optional()}),zo=z({overall:I().int().positive().nullable().optional(),needsYou:I().int().positive().nullable().optional(),finished:I().int().positive().nullable().optional(),working:I().int().positive().nullable().optional()});function Bo(e){let t={overall:10,needsYou:null,finished:null,working:null},n=typeof e==`object`&&e&&!Array.isArray(e)?e:{};for(let e of Object.keys(t)){let r=zo.shape[e].safeParse(n[e]);r.success&&r.data!==void 0&&(t[e]=r.data)}return t}B({sidebarLimits:zo.optional(),lastTask:z({source:W([`workflow`,`skill`]),ref:N()}).nullable().optional(),recentSources:R(z({source:W([`workflow`,`skill`]),ref:N()})).optional(),lastWorktree:L().optional(),lastAutonomous:L().optional(),disabledTeamSkills:R(Io).max(200).optional(),skillUsage:U(N(),I()).optional(),runsView:W([`list`,`table`]).optional(),githubView:W([`issues`,`prs`]).optional(),appearance:Lo.optional(),promptTemplates:R(z({id:N(),label:N(),text:N(),skills:R(N()).optional()})).optional()});var Vo=Ba({projectId:N().min(1).max(64),pathname:N().min(1).max(2048).startsWith(`/p/`),search:N().max(4096).startsWith(`?`).optional(),hash:N().max(2048).startsWith(`#`).optional()}),Ho=B({sidebar:B({collapsed:U(N(),L()).optional(),projectOrder:R(N()).optional()}).optional(),dismissedProviderAuthFailures:Fo().optional(),appearance:Lo.optional(),notifications:B({enabled:L().optional()}).optional(),taskTable:Ro.optional(),lastLocation:Vo.optional()}),Uo=200,Wo=50;B({...Ho.shape,sidebar:B({collapsed:U(N().min(1).max(64),L()).refine(e=>Object.keys(e).length<=Uo,{message:`sidebar.collapsed must have at most ${Uo} entries`}).optional(),projectOrder:R(N().min(1).max(64)).max(Uo).optional()}).optional(),dismissedProviderAuthFailures:Ba({claude:N().min(1).max(128).optional(),codex:N().min(1).max(128).optional(),opencode:N().min(1).max(128).optional(),pi:N().min(1).max(128).optional(),cursor:N().min(1).max(128).optional(),omp:N().min(1).max(128).optional()}).optional(),taskTable:Ro.extend({expandedColumns:U(N().min(1).max(64),L()).refine(e=>Object.keys(e).length<=Wo,{message:`taskTable.expandedColumns must have at most ${Wo} entries`}).optional()}).optional()}).superRefine((e,t)=>{Object.keys(e).length>Uo&&t.addIssue({code:`custom`,message:`ui-state has too many keys (max ${Uo})`})});var Go=Fo(),Ko=4e3,qo=7200,Jo=z({commands:R(N().trim().min(1).max(Ko)).max(20),timeoutSeconds:I().int().min(1).max(qo).optional()}).strict();z({archiveOnMerge:L().nullable(),effectiveArchiveOnMerge:L(),archiveOnMergeSource:W([`project`,`global`,`environment`,`default`]),baseBranch:N().nullable(),defaultRunner:K,systemPrompt:N().nullable(),defaultModels:Go,modelsLocked:L(),maxParallel:I(),memoryLimitMb:I().nullable(),worktreeRetention:I(),liveTitleUpdates:L().nullable(),reviewGate:L().nullable(),worktreeSetup:z({commands:R(N()),timeoutSeconds:I()}).nullable(),worktreeSetupIssue:N().nullable()}),z({archiveOnMerge:L().nullable().optional(),baseBranch:N().trim().min(1).max(200).nullable().optional(),defaultRunner:K.optional(),systemPrompt:N().trim().max(2e4).nullable().optional(),defaultModels:z({claude:N().trim().max(200).nullable().optional(),codex:N().trim().max(200).nullable().optional(),opencode:N().trim().max(200).nullable().optional(),pi:N().trim().max(200).nullable().optional(),cursor:N().trim().max(200).nullable().optional(),omp:N().trim().max(200).nullable().optional()}).optional(),maxParallel:I().int().min(1).max(16).optional(),memoryLimitMb:I().int().min(0).max(1048576).nullable().optional(),worktreeRetention:I().int().min(0).max(1e3).nullable().optional(),liveTitleUpdates:L().nullable().optional(),reviewGate:L().nullable().optional(),worktreeSetup:Jo.nullable().optional()});var Yo=K,Xo=z({provider:Yo,status:W([`connected`,`disconnected`,`not-installed`,`unknown`]),enabled:L().optional(),hint:N().optional(),authFailureId:N().optional(),profileId:N().optional()});z({providers:R(Xo)}),H(`opened`,[z({opened:G(!0),command:N()}),z({opened:G(!1),connected:G(!0),command:N()})]);var Zo=W([`claude`,`codex`,`opencode`,`pi`,`cursor`,`omp`]),Qo=Zo.options;function $o(e){return Qo.includes(e)}var es=z({id:N(),label:N(),description:N(),effortLevels:R(No).optional()}),ts=z({runner:K,models:R(es),source:W([`live`,`cache`,`unavailable`]),stale:L(),reason:N().optional()}),ns=z({runner:Zo,requestedModel:N(),availableModels:R(es),otherRunners:R(Zo)});z({targets:R(z({id:N(),label:N(),icon:N().optional()}))}),z({target:N().trim().min(1,`target required`).max(200)}),z({opened:G(!0),path:N()});var rs=W([`spawn`,`inspect`,`steer`,`stop`,`destroy`,`diff`,`wait`]),Y=N().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),is=N().regex(/^[0-9a-f]{64}$/),as=R(F()).min(1).max(32).refine(e=>new Set(e).size===e.length),os=R(rs).max(7).refine(e=>new Set(e).size===e.length),ss=R(W([`process`,`worktree`,`branch`])).max(3).refine(e=>new Set(e).size===e.length),cs=N().max(2e3),ls=z({ownerRunId:F(),resourceId:F(),kind:G(`owned-isolated`),path:N().min(1),branch:N().min(1),baselineSha:Y}).strict(),X=z({workerId:F(),status:W([`review`,`done`,`failed`,`cancelled`]),observedAt:A(),summary:N().max(4e3).optional(),revision:I().int().nonnegative().optional()}).strict(),us=W([`one`,`any`,`all`]),Z=z({id:F(),workerIds:R(F()).max(32).refine(e=>new Set(e).size===e.length),requestIds:R(F()).min(1).max(32).optional(),requestOutcomes:R(J).max(32).optional(),deadline:A(),mode:us.optional(),revisions:R(z({workerId:F(),revision:I().int().nonnegative()}).strict()).max(32).optional(),reason:W([`outcome`,`timeout`,`cancelled`,`message`]).optional(),phase:W([`registered`,`parked`,`wake-pending`]),outcomes:R(X).max(32),wakeId:F().optional()}).strict(),ds=Z.omit({deadline:!0,requestIds:!0,requestOutcomes:!0}).extend({via:G(`completion`)}).strict(),fs=z({attempts:I().int().positive(),nextAt:A(),needsAttention:G(!0).optional()}).strict(),ps=z({requestedAt:A(),phase:W([`requested`,`terminating`,`cleaning`,`complete`,`incomplete`]),remaining:ss,error:cs.optional()}).strict(),ms=ps.extend({retry:fs.optional()}).strict(),hs=z({requestId:F(),workerId:F(),requestHash:is,deletion:z({phase:W([`pending`,`complete`]),revision:I().int().nonnegative(),resourceId:F(),generation:F()}).strict().optional()}).strict(),gs=W(K.options),_s=N().min(1).max(4096).refine(e=>!/[\\\u0000-\u001f\u007f:]/.test(e)&&!e.startsWith(`/`)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&e.toLowerCase()!==`.git`));function vs(e){return e.split(`/`).at(-1)?.toLowerCase()===`.gitignore`?`--attach cannot attach a .gitignore: ${e}; ignore rules must come from the baseline`:void 0}var ys=H(`kind`,[z({kind:G(`baseline-file`),path:_s}).strict(),z({kind:G(`parent-attachment`),id:N().min(1).max(255).regex(/^[A-Za-z0-9_-][A-Za-z0-9._-]*$/).refine(e=>!e.includes(`..`))}).strict(),z({kind:G(`parent-file`),path:_s}).strict().superRefine(({path:e},t)=>{let n=vs(e);n&&t.addIssue({code:`custom`,path:[`path`],message:n})})]),bs=z({text:N().max(1e5).optional(),artifacts:R(ys).max(32).optional()}).strict().superRefine(({artifacts:e=[]},t)=>{let n=new Set;for(let[r,i]of e.entries())i.kind===`parent-file`&&(n.has(i.path)&&t.addIssue({code:bo.custom,path:[`artifacts`,r,`path`],message:`duplicate --attach path: ${i.path}`}),n.add(i.path))}),xs=z({source:ys,path:N().min(1).max(8192),sha256:is,bytes:I().int().min(0).max(2**53-1)}).strict(),Ss=z({text:N().max(1e5).optional(),inputs:R(xs).max(32)}).strict(),Cs=z({state:G(`unavailable`),reason:W([`no-assistant-output`,`missing`,`unreadable`,`unverified`]),detail:cs.optional()}).strict(),ws=z({state:G(`deleted`),reason:G(`missing`)}).strict(),Ts=W([`running`,`review-ready`,`completed`,`failed`,`cancelled`]),Es=H(`state`,[z({state:G(`available`),id:N().max(255),path:N().max(8192)}).strict(),Cs.extend({id:N().max(255),path:N().max(8192)}),ws.extend({id:N().max(255),path:N().max(8192)})]);z({result:z({workerId:F(),parentRunId:F(),revision:I().int().nonnegative(),observedAt:A(),status:W([`queued`,`running`,`waiting`,`review`,`done`,`failed`,`cancelled`]),outcome:W([`running`,`review-ready`,`completed`,`failed`,`cancelled`,`destroyed`]),lastExecutionOutcome:Ts,partial:L(),settled:L(),error:cs.optional(),backend:gs.optional(),model:N().max(512).optional(),baselineSha:Y,workspace:ls.extend({state:W([`available`,`unavailable`,`deleted`]).optional()}),cleanup:W([`retained`,`requested`,`terminating`,`cleaning`,`complete`,`incomplete`]),summary:H(`state`,[z({state:G(`available`),text:N().min(1).max(4e3),source:G(`assistant`),seq:I().int().nonnegative(),truncated:L()}).strict(),Cs,ws]),head:H(`state`,[z({state:G(`available`),sha:Y}).strict(),Cs.extend({sha:Y.optional()}),ws.extend({sha:Y.optional()})]),diff:H(`state`,[z({state:G(`available`),snapshotId:F(),path:N().min(1).max(8192),truncated:L()}).strict(),Cs,ws]),artifacts:H(`state`,[z({state:G(`available`),items:R(Es).max(32),truncated:L()}).strict(),Cs,ws])}).strict(),diffSnapshot:N().max(4e5).optional()}).strict();var Ds=z({workerId:F(),revision:I().int().nonnegative(),snapshotId:F(),observedAt:A(),lastExecutionOutcome:Ts,previous:z({revision:I().int().nonnegative(),observedAt:A(),lastExecutionOutcome:Ts}).strict().optional()}).strict(),Os=H(`role`,[z({role:G(`root`),conversation:Ao.optional(),permissions:os,receipts:R(hs).max(1024).refine(e=>new Set(e.map(e=>e.requestId)).size===e.length&&new Set(e.map(e=>e.workerId)).size===e.length),wait:Z.optional(),lastWait:Z.optional(),results:R(Ds).max(1024).refine(e=>new Set(e.map(e=>e.workerId)).size===e.length).optional(),finishRequestedAt:A().optional(),historyDeletion:G(`pending`).optional(),completion:z({phase:W([`waiting`,`attention`]),waitId:F().optional()}).strict().optional()}).strict(),z({role:G(`worker`),wait:Z.optional(),lastWait:Z.optional(),permissions:os,parentRunId:F(),workspace:ls,destroy:ps.optional(),context:Ss.optional(),executionRevision:I().int().nonnegative().optional(),executionStartSeq:I().int().nonnegative().optional()}).strict(),z({role:G(`invalid`)}).strict()]),ks=H(`role`,[Os.options[0].pick({role:!0}).strip().extend({wait:Z.pick({phase:!0,requestIds:!0,workerIds:!0}).partial({workerIds:!0}).strip().extend({outcomes:R(X.pick({workerId:!0}).strip()).max(32).optional()}).optional()}),Os.options[1].pick({role:!0,parentRunId:!0}).strip().extend({wait:Z.pick({phase:!0,requestIds:!0}).strip().optional()}),Os.options[2].strip()]);z({task:N().min(1).max(1e5),baseline:N().min(1).max(1024),requestId:F(),context:bs.optional(),backend:gs.optional(),model:N().trim().min(1).max(512).optional(),effort:Po,workflow:N().trim().min(1).max(200).optional(),skill:N().trim().min(1).max(200).optional()}).strict().refine(e=>e.skill===void 0||e.workflow===void 0,{message:`--skill and --workflow cannot be used together`}).refine(e=>e.task.length+(e.context?.text?.length??0)<=1e5,{message:`Combined task and context exceed 100000 characters`}),z({text:N().max(1e5).refine(e=>e.trim().length>0)}).strict(),z({workerIds:as,timeoutSeconds:I().int().min(1).max(1800).default(600),mode:us.optional()}).strict().refine(e=>e.mode!==`one`||e.workerIds.length===1,{message:`one mode requires exactly one worker`});var As=z({receiptId:F(),generation:F(),expiresAt:A(),acknowledgedAt:A().optional(),memberIds:R(F()).min(1).max(32).refine(e=>new Set(e).size===e.length).optional()}).strict(),js=z({conversation:Oo.optional(),id:F(),source:W([`agent`,`lifecycle`]),parentRunId:F(),text:N().min(1).max(1e5),createdAt:A(),deliveredAt:A().optional(),consumedAt:A().optional(),awaitingRead:G(!0).optional(),inboxClaim:As.optional(),purpose:W([`completion-refusal`,`undelivered-question`]).optional(),requestHash:N().regex(/^[0-9a-f]{64}$/).optional(),deadline:A().optional()}).strict(),Ms=z({workerId:F(),parentRunId:F(),status:W([`queued`,`running`,`waiting`,...X.shape.status.options]),currentStepId:N().optional(),workspace:ls,backend:gs.optional(),model:N().max(512).optional(),inputs:R(xs).max(32).optional(),wait:Z.optional(),completionWait:ds.optional(),destroy:ms.optional(),outcome:X.optional()}),Ns=Ms.pick({workerId:!0,parentRunId:!0,status:!0,workspace:!0,destroy:!0}).extend({revision:I().int().nonnegative(),settled:L(),destroyed:L()}).strict(),Ps=z({workers:R(Ns).max(1024)}).strict();z({offset:N().regex(/^\d{1,4}$/).refine(e=>Number(e)<=1024).optional()}).strict(),Ps.extend({workers:R(Ns).max(32),nextOffset:I().int().min(1).max(1024).optional()}).strict(),z({workerId:F(),baselineSha:Y,diff:N().max(4e5),truncated:L()}),z({workerId:F(),state:W([`stopping`,`terminated`])}),z({workerId:F(),state:W([`complete`,`incomplete`]),deleted:R(H(`kind`,[z({kind:G(`worktree`),path:N().max(8192)}).strict(),z({kind:G(`branch`),ref:N().max(1024)}).strict()])).max(2).optional(),remaining:ss,error:cs.optional()});var Fs=z({outstanding:I().int().nonnegative(),limit:I().int().nonnegative(),created:I().int().nonnegative(),creationLimit:I().int().nonnegative()}).strict(),Is=z({id:N(),title:N(),titleSummary:N().optional(),titleOrigin:W([`user`,`auto`,`marker`]).optional()}),Ls=z({parentRunId:F().optional(),workers:R(Ms).max(1024),titles:R(Is).max(1025).optional(),capacity:Fs.optional()});z({code:W([`unavailable_transport`,`unauthenticated`,`denied_scope`,`invalid_input`,`invalid_baseline`,`incompatible_state`,`capacity_limit`,`unavailable_diff`,`incomplete_cleanup`]),error:cs,modelChoices:ns.optional()}),z({workerId:F()}).strict(),z({workerId:F(),baselineSha:Y}).strict(),z({workerId:F(),state:W([`queued`,`delivered`])}).strict();var Rs=z({wait:Z,instruction:N().min(1).max(1e3)}).strict();z({}).strict(),z({waitId:F()}).strict();var zs=z({wait:Z}).strict();z({peerIds:as,timeoutSeconds:I().int().min(1).max(1800).default(600)}).strict();var Bs=H(`reason`,[z({reason:G(`message`),peerRunId:F(),messageId:F()}).strict(),z({reason:G(`settled`),peerRunId:F()}).strict(),z({reason:G(`timeout`)}).strict()]);function Vs(e,t){(e.phase===`resolved`||e.phase===`delivered`)&&!e.result&&t.addIssue({code:`custom`,message:`a ${e.phase} peer wait has a result`,path:[`result`]}),e.phase===`open`&&e.result&&t.addIssue({code:`custom`,message:`an open peer wait has no result`,path:[`result`]})}var Hs=z({id:F(),peerIds:as,deadline:A(),phase:W([`open`,`resolved`,`delivered`,`cancelled`]),result:Bs.optional()}).strict().superRefine(Vs),Us=z({wait:Hs,instruction:N().min(1).max(1e3)}).strict(),Ws=z({wait:Hs}).strict();V([Rs,Us]),V([zs,Ws]);var Q=B({seq:I(),ts:N(),stepId:N().optional(),type:N()}),Gs=Q.extend({type:G(`conversation-message`),message:ko,delivery:W([`queued`,`delivered`,`consumed`,`not-delivered`]),deliveredAt:A().optional(),consumedAt:A().optional()}),Ks=Q.extend({type:G(`request-outcome`),outcome:J}),qs=Q.extend({type:G(`agent-input`),input:js}),Js=Q.extend({type:G(`human-input-delivered`),askSeq:I().int().nonnegative(),source:W([`human`,`parent`,`cezar`]).optional()}),Ys=Q.extend({type:G(`human-ask-closed`),askSeq:I().int().nonnegative(),reason:W([`finish`,`superseded`,`parent-stopped`,`worker-stopped`,`undeliverable`])});Q.extend({type:G(`worker-question-routed`),askSeq:I().int().nonnegative(),messageId:F(),parentRunId:F()}),Q.extend({type:G(`worker-question-fallback`),askSeq:I().int().nonnegative(),reason:N().min(1).max(200)}),Q.extend({type:G(`worker-question-undelivered`),askSeq:I().int().nonnegative(),reason:N().min(1).max(200)}),Q.extend({type:G(`worker-outcome`),outcome:X});var Xs=z({id:N().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/)}),$=N().min(1).max(2048);z({cursor:$.optional()}),z({cursor:$.optional(),afterSeq:So().int().nonnegative().optional()});var Zs=z({seq:I(),ts:N(),stepId:N().optional(),type:N()}).catchall(Na()),Qs=z({events:R(Zs),itemCount:I().int().min(0).max(100),olderCursor:$.optional(),newerCursor:$.optional(),liveCursor:$,asOfSeq:I().int().nonnegative(),hasOlder:L()}),$s=z({contextEvents:R(Zs),asOfSeq:I().int().nonnegative()}),ec=z({checkoutId:N().optional(),name:N(),phase:W([`cloning`,`done`,`error`]),line:N().optional(),error:N().optional(),warning:N().optional()}),tc=1024*1024,nc=z({projectId:N().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/),runId:Xs.shape.id,cursor:$.optional(),afterSeq:I().int().nonnegative().safe()});z({runs:R(nc).min(1).max(32)}).refine(({runs:e})=>new Set(e.map(e=>`${e.projectId}/${e.runId}`)).size===e.length,{message:`duplicate run demand`});var rc=nc.pick({projectId:!0,runId:!0}),ic=rc.extend({type:W([`error`,`reset`]),status:V([G(400),G(404),G(409),G(413),G(503)]),error:N()}),ac=V([rc.extend({type:G(`batch`),events:R(Zs).max(256),cursor:$,afterSeq:I().int().nonnegative(),hasMore:L()}),ic]),oc=z({generation:N(),results:R(ac)}),sc=V([z({type:G(`ready`),generation:N()}),z({type:G(`ping`)}),rc.extend({type:G(`event`),name:W([`run-event`,`ui-event`]),event:Zs}),ic]),cc=`cezar-live-v3`,lc=15e3,uc=5e3;function dc(e){return!e.startsWith(`/api/v1/`)||e.includes(`#`)||/[\\\r\n]/.test(e)?!1:/^\/api\/v1\/(?:workspace\/(?:runs-index|activity)|p\/[a-zA-Z0-9_-]+\/(?:reports\/state|runs\/[a-zA-Z0-9._-]+\/(?:changes|commits)|github(?:\/(?:checks|ref-status))?))(?:\?[^#]*)?$/.test(e)}var fc=H(`kind`,[z({kind:G(`workspace`)}),nc.extend({kind:G(`run`)}),z({kind:G(`topic`),topic:N().min(1).max(128)}),z({kind:G(`read`),path:N().max(4096).refine(dc),intervalMs:I().int().min(1e3).max(2147483647)})]),pc=z({id:N().min(1).max(128),demand:fc}),mc=z({version:G(3),documentId:N().min(1).max(128),epoch:I().int().nonnegative()}),hc=H(`type`,[mc.extend({type:G(`sync`),entries:R(pc).max(64),workspaceReady:G(!0).optional()}).refine(e=>new Set(e.entries.map(e=>e.id)).size===e.entries.length),mc.extend({type:G(`ack`),id:N(),seq:I().int().nonnegative()}),mc.extend({type:G(`refresh`),id:N()})]),gc=z({event:N(),data:N(),id:N()}),_c=H(`type`,[z({type:G(`unavailable`),version:G(3),epoch:I(),reason:N()}),z({type:G(`hello`),version:G(3)}),z({type:G(`alive`),version:G(3),epoch:I()}),z({type:G(`frame`),version:G(3),epoch:I(),id:N(),frame:V([gc,sc])}),z({type:G(`value`),version:G(3),epoch:I(),id:N(),value:Fa(),error:N().optional()}),z({type:G(`reset`),version:G(3),epoch:I(),id:N(),reason:N()})]),vc=e=>`${e.projectId}/${e.runId}`;export{I as $,us as A,Fo as B,Bs as C,fs as D,Ls as E,Xo as F,So as G,Co as H,$o as I,R as J,W as K,ts as L,qo as M,Bo as N,as as O,Yo as P,La as Q,zo as R,Os as S,ks as T,Eo as U,J as V,K as W,H as X,L as Y,G as Z,Ks as _,fc as a,Fa as at,Xs as b,vc as c,A as ct,tc as d,z as et,qs as f,Js as g,Ys as h,dc as i,V as it,Ko as j,X as k,oc as l,a as lt,Gs as m,cc as n,U as nt,hc as o,ua as ot,ec as p,ja as q,uc as r,N as rt,_c as s,F as st,lc as t,yo as tt,sc as u,t as ut,$s as v,Vs as w,js as x,Qs as y,Io as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Hn as e,Ln as t}from"./project-scope-context-
|
|
1
|
+
import{Hn as e,Ln as t}from"./project-scope-context-B3M-u8R0.js";function n(e,t){return e??t}function r(e,t){let r=n(e,t);return r===`1`||r===`true`}function i(e,t,r){return e?.trim()||n(t,r)||``}function a(){return r(void 0,void 0)}function o(n){return t[e(n).bucket]<=t.waiting}function s(e){return!a()&&e}export{i,o as n,a as r,s as t};
|
package/web/dist/assets/{preview-pane-connected-DGkEs_L3.js → preview-pane-connected-KzJn9jAG.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{L as t,t as n,u as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{Fr as o,Ir as s,Pr as c,gr as l}from"./project-scope-context-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{L as t,t as n,u as r}from"./button-CHUAMTHK.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{Fr as o,Ir as s,Pr as c,gr as l}from"./project-scope-context-B3M-u8R0.js";import{n as u}from"./toaster-B1MyeHiE.js";import{a as d,c as f,i as p,l as m,p as h,r as g,s as _,t as v}from"./dropdown-menu-DhrBcVgr.js";import{t as y}from"./loader-circle-CZkGEdoI.js";import{t as b}from"./createLucideIcon-BHp8sXmF.js";import{t as ee}from"./arrow-right-Dh_Lx3um.js";import{n as x,r as S,t as C}from"./hourglass-B0lPAJvT.js";import{t as w}from"./info-DA1x_4bz.js";import{c as T,n as E,o as te,s as ne}from"./thread-state-C136Em0C.js";import{s as re}from"./project-router-MMOk9VbW.js";import{$t as D,A as O,Bt as k,D as ie,Gt as ae,Ht as oe,It as se,Jt as ce,Lt as le,O as ue,Qt as de,Rt as fe,Ut as pe,Wt as me,Yt as A,Zt as j,_t as he,ct as ge,dt as M,ft as _e,gt as ve,ht as ye,k as N,lt as be,ot as P,st as F,ut as xe}from"./index-FoxgrgAH.js";var Se=b(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),I=b(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),L=b(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),R=b(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),z=b(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),B=b(`folder-x`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`m9.5 10.5 5 5`,key:`ra9qjz`}],[`path`,{d:`m14.5 10.5-5 5`,key:`l2rkpq`}]]),Ce=b(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),we=b(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),V=b(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),H=b(`maximize`,[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]),U=b(`monitor-smartphone`,[[`path`,{d:`M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8`,key:`10dyio`}],[`path`,{d:`M10 19v-3.96 3.15`,key:`1irgej`}],[`path`,{d:`M7 19h5`,key:`qswx4l`}],[`rect`,{width:`6`,height:`10`,x:`16`,y:`12`,rx:`2`,key:`1egngj`}]]),W=b(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),G=b(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),K=b(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Te=b(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Ee=b(`tablet`,[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]),De=b(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Oe=b(`unplug`,[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]),ke=b(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),q=e(i(),1),Ae=1e3,je=[500,1e3,2e3,4e3,8e3],Me=1;function Ne(e,t){let n=`/api/v1/p/${encodeURIComponent(e.projectId)}/runs/${encodeURIComponent(e.runId)}/preview/ws`,r=()=>`${location.protocol===`https:`?`wss:`:`ws:`}//${location.host}${n}`,i=null,a,s=!1,u=!1,d=0,f=0,p=()=>typeof document>`u`||c(),m=()=>{if(s||!p())return;let e=globalThis.WebSocket;if(typeof e!=`function`)return;let n=new e(r());n.binaryType=`blob`,i=n,n.addEventListener(`open`,()=>{n===i&&(u=!0,t.onTransport(`open`))}),n.addEventListener(`message`,e=>{if(n!==i)return;let r=e.data;if(typeof r==`string`){let e;try{e=JSON.parse(r)}catch{return}let n=l.safeParse(e);n.success&&t.onMessage(n.data);return}r instanceof Blob&&(f=0,t.onFrame(r))}),n.addEventListener(`error`,()=>void 0),n.addEventListener(`close`,()=>{if(n!==i||s)return;if(i=null,!u){if(d+=1,d>=2){s=!0,t.onTransport(`blocked`);return}t.onTransport(`reconnecting`,d),a=setTimeout(m,Ae);return}if(f>=5){s=!0,t.onTransport(`closed`);return}let e=je[Math.min(f,je.length-1)];f+=1,t.onTransport(`reconnecting`,f),a=setTimeout(m,e)})},h=o(e=>{if(!s)if(e)i||m();else{clearTimeout(a),a=void 0;let e=i;i=null,e?.close()}});return t.onTransport(`connecting`),m(),{send(e){i?.readyState===Me&&i.send(JSON.stringify(e))},close(){s=!0,h(),clearTimeout(a),a=void 0;let e=i;i=null,e?.close()}}}var J=a();function Pe({iconOnly:e=!1,responsive:t=!1,className:n}){return t?(0,J.jsx)(N,{children:(0,J.jsxs)(ie,{children:[(0,J.jsx)(O,{asChild:!0,children:(0,J.jsxs)(`span`,{role:`img`,"aria-label":`Experimental`,tabIndex:0,"data-slot":`preview-experimental`,className:r(`inline-flex h-7 min-w-7 shrink-0 items-center justify-center gap-0 rounded-full bg-muted px-0 text-xs font-semibold text-muted-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none @min-[640px]:gap-1.5 @min-[640px]:px-2.5`,n),children:[(0,J.jsx)(z,{className:`size-3.5`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`hidden @min-[640px]:inline`,children:`Experimental`})]})}),(0,J.jsx)(ue,{children:`Experimental`})]})}):e?(0,J.jsx)(N,{children:(0,J.jsxs)(ie,{children:[(0,J.jsx)(O,{asChild:!0,children:(0,J.jsx)(`span`,{role:`img`,"aria-label":`Experimental`,tabIndex:0,"data-slot":`preview-experimental`,className:r(`inline-flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`,n),children:(0,J.jsx)(z,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,J.jsx)(ue,{children:`Experimental`})]})}):(0,J.jsxs)(`span`,{"data-slot":`preview-experimental`,className:r(`inline-flex h-7 shrink-0 items-center gap-1.5 rounded-full bg-muted px-2.5 text-xs font-semibold text-muted-foreground`,n),children:[(0,J.jsx)(z,{className:`size-3.5`,"aria-hidden":`true`}),`Experimental`]})}function Y({text:e,source:t,onCopy:n,className:i}){let a=e.replace(/\s+$/,``).split(`
|
|
2
2
|
`);return(0,J.jsxs)(`div`,{"data-slot":`preview-log-tail`,className:r(`min-w-0 rounded-lg bg-muted px-3.5 py-3 font-mono text-xs`,i),children:[(0,J.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3 font-sans text-xs text-soft-foreground`,children:[(0,J.jsxs)(`span`,{className:`min-w-0 truncate`,children:[(0,J.jsx)(`span`,{className:`font-semibold tracking-wide uppercase`,children:`Log tail`}),` last ${a.length} ${a.length===1?`line`:`lines`} · ${t}`]}),(0,J.jsxs)(`button`,{type:`button`,className:`-m-2 inline-flex min-h-11 items-center gap-1.5 rounded-sm p-2 text-muted-foreground hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none md:m-0 md:min-h-0 md:p-0`,onClick:()=>n(e),children:[(0,J.jsx)(A,{className:`size-3.5`,"aria-hidden":`true`}),`Copy`]})]}),(0,J.jsx)(`pre`,{className:`max-h-48 overflow-auto break-words whitespace-pre-wrap text-foreground`,children:e.replace(/\s+$/,``)})]})}var Fe=/^([a-z][a-z0-9+.-]*):/i;function Ie(e,t){let n=e.trim();if(n===``)return{kind:`error`,message:`Type a URL or a port.`};if(/^\d{1,5}$/.test(n)){let e=Number(n);return e<1||e>65535?{kind:`error`,message:`A port is a number from 1 to 65535.`}:t.some(t=>t.port===e)?{kind:`server`,port:e}:{kind:`url`,url:`http://localhost:${e}`}}let r=Fe.exec(n)?.[1]?.toLowerCase();return r&&!/^[a-z0-9.-]+:\d/i.test(n)?r!==`http`&&r!==`https`?{kind:`error`,message:`Only http and https addresses open here.`}:Le(n):Le(`http://${n}`)}function Le(e){let t={kind:`error`,message:`That is not a valid address.`};if(/\s/.test(e))return t;try{new URL(e)}catch{return t}return{kind:`url`,url:e}}function Re(e){return e.replace(/^https?:\/\//i,``)}var ze=`https://github.com/hearsay-tools/cezarion#environment-variables`;function Be({state:e,actions:t,url:n,worktree:r}){switch(e.stage){case`chromium-missing`:return(0,J.jsx)(We,{state:e,actions:t});case`downloading`:return(0,J.jsx)(Ke,{state:e,actions:t});case`download-failed`:return(0,J.jsx)(qe,{state:e,actions:t});case`sandbox-failed`:return(0,J.jsx)(Je,{state:e,actions:t});case`browser-exited`:return(0,J.jsx)(Ye,{state:e,actions:t});case`needs-approval`:return(0,J.jsx)(Qe,{state:e,actions:t});case`port-held`:return(0,J.jsx)($e,{state:e,actions:t});case`server-starting`:return(0,J.jsx)(et,{state:e,actions:t});case`server-stalled`:return(0,J.jsx)(tt,{state:e,actions:t});case`server-exited`:return(0,J.jsx)(nt,{state:e,actions:t});case`server-stopped`:return(0,J.jsx)(rt,{state:e,actions:t});case`loading`:return(0,J.jsx)(at,{step:e.step,url:n});case`worktree-removed`:return(0,J.jsx)(ot,{state:e,actions:t,worktree:r});case`proxy-blocked`:return(0,J.jsx)(st,{actions:t});case`taken-over`:return(0,J.jsx)(lt,{state:e,actions:t})}}function X({icon:e,title:t,children:n,state:r}){return(0,J.jsxs)(`div`,{"data-slot":`preview-state`,"data-state":r,className:`mx-auto flex h-full w-full max-w-[560px] flex-col justify-center gap-4 px-6 py-8`,children:[(0,J.jsx)(`div`,{"aria-hidden":`true`,className:`flex size-9 items-center justify-center rounded-lg bg-muted text-foreground [&_svg]:size-[18px]`,children:e}),(0,J.jsx)(`h2`,{className:`text-xl leading-tight font-semibold text-foreground`,children:t}),n]})}var Z=({children:e})=>(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e}),Q=({children:e})=>(0,J.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:e});function Ve({server:e}){return(0,J.jsxs)(`p`,{className:`flex items-start gap-2 text-xs text-muted-foreground`,children:[(0,J.jsx)(le,{className:`mt-px size-3.5 shrink-0`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{children:`Runs ${M(e.command)} in this task's worktree, on the host.`})]})}function He({copy:e,command:t,label:n}){return(0,J.jsxs)(`div`,{"data-slot":`preview-install-command`,className:`min-w-0 rounded-lg bg-muted px-3.5 py-3`,children:[(0,J.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between gap-3 text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:[(0,J.jsx)(`span`,{children:n}),(0,J.jsx)(`button`,{type:`button`,"aria-label":`Copy command`,className:`-m-2 inline-flex size-11 items-center justify-center rounded-sm text-muted-foreground hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none md:m-0 md:size-6`,onClick:()=>e(t),children:(0,J.jsx)(A,{className:`size-4`,"aria-hidden":`true`})})]}),(0,J.jsx)(`code`,{className:`block font-mono text-sm break-words whitespace-pre-wrap text-foreground`,children:t})]})}function Ue({server:e,status:t}){return(0,J.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-border bg-card px-3.5 py-3 text-sm`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1`,children:[(0,J.jsx)(P,{tone:`neutral`,shape:`ring`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`font-semibold text-foreground`,children:e.label}),(0,J.jsxs)(`span`,{className:`font-mono text-muted-foreground`,children:[`:`,e.port]}),(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:t})]}),(0,J.jsxs)(`div`,{className:`mt-2.5 min-w-0 rounded-md bg-muted px-3 py-2 font-mono text-xs`,children:[(0,J.jsx)(`p`,{className:`break-words whitespace-pre-wrap text-foreground`,children:e.command}),e.cwd?(0,J.jsxs)(`p`,{className:`mt-1 flex gap-3 text-soft-foreground`,children:[(0,J.jsx)(`span`,{children:`cwd`}),(0,J.jsx)(`span`,{className:`break-all`,children:e.cwd})]}):null]}),(0,J.jsx)(`div`,{className:`mt-2.5`,children:(0,J.jsx)(Ve,{server:e})})]})}function We({state:e,actions:r}){return(0,J.jsxs)(X,{state:e.stage,icon:(0,J.jsx)(R,{}),title:`This host has no browser yet`,children:[(0,J.jsx)(Z,{children:e.canDownload?`Preview runs Chromium on the machine ${t(`cezar`)} runs on. ${t(`cezar`)} can download it into ~/.cache/cez/ (about 150 MB). Nothing else on the host changes.`:`Preview runs Chromium on the machine ${t(`cezar`)} runs on. ${t(`cezar`)} has no download for this platform, so install it with the system package manager.`}),e.canDownload?(0,J.jsx)(Q,{children:(0,J.jsxs)(n,{variant:`contrast`,onClick:r.download,children:[(0,J.jsx)(R,{"aria-hidden":`true`}),`Download Chromium`]})}):null,(0,J.jsx)(He,{command:e.installCommand,copy:r.copy,label:e.canDownload?`Or install it yourself`:`Install it yourself`})]})}function Ge(e){return Math.round(e/1e6)}function Ke({state:e,actions:t}){let r=(0,q.useRef)(null);r.current??={at:Date.now(),received:e.received};let i=e.total>0?Math.min(100,Math.floor(e.received/e.total*100)):0,a=(Date.now()-r.current.at)/1e3,o=a>=1?(e.received-r.current.received)/a:0,s=o>0?Math.ceil((e.total-e.received)/o):void 0;return(0,J.jsxs)(X,{state:e.stage,icon:(0,J.jsx)(R,{}),title:`Downloading Chromium`,children:[(0,J.jsx)(Z,{children:`Into ~/.cache/cez/, no root needed. Nothing else on the host changes.`}),(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,J.jsx)(`div`,{role:`progressbar`,"aria-label":`Chromium download`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":i,className:`h-1.5 overflow-hidden rounded-full bg-muted`,children:(0,J.jsx)(`div`,{className:`h-full rounded-full bg-success`,style:{width:`${i}%`}})}),(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs text-muted-foreground`,children:[(0,J.jsx)(`span`,{className:`font-mono`,children:`${Ge(e.received)} of ${Ge(e.total)} MB · ${i}%`}),s===void 0?null:(0,J.jsx)(`span`,{children:`about ${s} s left`})]})]}),(0,J.jsx)(Q,{children:(0,J.jsx)(n,{variant:`outline`,onClick:t.cancelDownload,children:`Cancel`})})]})}function qe({state:e,actions:t}){return(0,J.jsxs)(X,{state:e.stage,icon:(0,J.jsx)(De,{className:`text-danger`}),title:`Couldn't download Chromium`,children:[(0,J.jsx)(Z,{children:`${e.error.replace(/\.$/,``)}. Install Chromium with the system package manager, then retry.`}),(0,J.jsx)(He,{command:e.installCommand,copy:t.copy,label:`Install it yourself`}),(0,J.jsxs)(Q,{children:[(0,J.jsxs)(n,{variant:`contrast`,onClick:t.download,children:[(0,J.jsx)(T,{"aria-hidden":`true`}),`Retry download`]}),(0,J.jsxs)(n,{variant:`outline`,onClick:()=>t.copy(`Chromium download failed\n${e.error}\nInstall: ${e.installCommand}`),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Copy diagnostics`]})]})]})}function Je({state:e,actions:r}){return(0,J.jsxs)(X,{state:e.stage,icon:(0,J.jsx)(Te,{className:`text-danger`}),title:`Chromium couldn't start its sandbox`,children:[(0,J.jsxs)(Z,{children:[`The host blocks the sandbox Chromium needs. This usually means `,t(`cezar`),` runs as root, or inside a container without user namespaces.`]}),(0,J.jsx)(Y,{text:e.stderrTail,source:`chromium`,onCopy:r.copy}),(0,J.jsxs)(Q,{children:[(0,J.jsxs)(n,{variant:`contrast`,onClick:r.retryBrowser,children:[(0,J.jsx)(T,{"aria-hidden":`true`}),`Retry`]}),(0,J.jsxs)(n,{variant:`outline`,onClick:()=>r.copy(`Chromium failed to start its sandbox\n${e.stderrTail}`),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Copy diagnostics`]})]}),(0,J.jsx)(`a`,{className:`text-sm font-medium text-accent-text underline-offset-2 hover:underline`,href:ze,target:`_blank`,rel:`noopener noreferrer`,children:`Docs: running without the sandbox (CEZ_PREVIEW_NO_SANDBOX=1)`})]})}function Ye({state:e,actions:t}){let r=e.reason===`timeout`,i=e.signal?` (${e.signal})`:e.exitCode===void 0?``:` (code ${e.exitCode})`,a=e.serverUp?`The dev server is still up; only the browser needs a restart.`:`The browser needs a restart.`,o=r?`Chromium did not start in time`:`Chromium exited${i}`;return(0,J.jsxs)(X,{state:e.stage,icon:(0,J.jsx)(x,{className:`text-danger`}),title:r?`The browser did not start`:`The browser stopped`,children:[(0,J.jsx)(Z,{children:r?`Chromium did not open its DevTools port in time. ${a}`:`Chromium exited unexpectedly${i}. ${a}`}),(0,J.jsx)(Y,{text:e.stderrTail,source:`chromium`,onCopy:t.copy}),(0,J.jsxs)(Q,{children:[(0,J.jsxs)(n,{variant:`contrast`,onClick:t.retryBrowser,children:[(0,J.jsx)(T,{"aria-hidden":`true`}),`Retry`]}),(0,J.jsxs)(n,{variant:`outline`,onClick:()=>t.copy(`${o}\n${e.stderrTail}`),children:[(0,J.jsx)(A,{"aria-hidden":`true`}),`Copy diagnostics`]})]})]})}var Xe=2;function Ze(e){let[t,n]=(0,q.useState)(()=>Date.now());return(0,q.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}function Qe({state:e,actions:r}){let{server:i,wasRunning:a}=e;return(0,J.jsxs)(X,{state:e.stage,icon:a?(0,J.jsx)(Oe,{className:`text-pending-strong`}):(0,J.jsx)(k,{}),title:a?`Nothing answers on :${i.port} anymore`:`${i.label} isn't running yet`,children:[(0,J.jsx)(Z,{children:a?`${i.label} was running when the agent registered it, likely inside the agent's own session, which has ended. ${t(`cezar`)} can start it with the registered command.`:`The agent registered this server. Nothing runs until you approve it here.`}),(0,J.jsx)(Ue,{server:i,status:a?`was running when registered · silent now`:`registered · not started`}),(0,J.jsx)(Q,{children:(0,J.jsxs)(n,{variant:`contrast`,onClick:()=>r.run(i.port),children:[(0,J.jsx)(k,{"aria-hidden":`true`}),`Run and open`]})})]})}function $e({state:e,actions:t}){let{server:r,ownerTitle:i}=e;return(0,J.jsxs)(X,{state:e.stage,icon:(0,J.jsx)(De,{className:`text-pending-strong`}),title:`${r.label} :${r.port} is in use by another task`,children:[(0,J.jsx)(Z,{children:`Task "${i}" is running its own server on :${r.port}. Register a different port for this task, or stop that task's server.`}),(0,J.jsx)(Q,{children:(0,J.jsx)(n,{variant:`contrast`,onClick:t.close,children:`Close preview`})})]})}function et({state:e,actions:r}){let{server:i}=e,a=Ze(1e3),o=Math.max(0,Math.floor((a-Date.parse(e.startedAt))/1e3)),[s,c]=(0,q.useState)(()=>Date.now());(0,q.useEffect)(()=>c(Date.now()),[e.attempt]);let l=Math.max(0,Math.ceil(Xe-(a-s)/1e3));return(0,J.jsxs)(X,{state:e.stage,icon:(0,J.jsx)(k,{}),title:`Starting ${i.label}`,children:[(0,J.jsx)(Z,{children:`${t(`cezar`)} ran ${M(i.command)} in the worktree. The page opens as soon as :${i.port} answers.`}),(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-border px-3.5 py-3 text-sm`,children:[(0,J.jsxs)(`span`,{className:`flex items-center gap-2.5 font-semibold text-foreground`,children:[(0,J.jsx)(y,{className:`size-4 animate-spin text-success motion-reduce:animate-none`,"aria-hidden":`true`}),l>0?`Attempt ${e.attempt} · next try in ${l} s`:`Attempt ${e.attempt}`]}),(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`started ${o} s ago`})]}),e.logTail.length>0?(0,J.jsx)(Y,{text:e.logTail.join(`
|
|
3
3
|
`),source:M(i.command),onCopy:r.copy}):null,(0,J.jsx)(Q,{children:(0,J.jsx)(n,{variant:`outline`,onClick:()=>r.stop(i.port),children:`Stop server`})})]})}function tt({state:e,actions:t}){let{server:r}=e;return(0,J.jsxs)(X,{state:e.stage,icon:(0,J.jsx)(C,{className:`text-pending-strong`}),title:`${r.label} is running, but :${r.port} is silent`,children:[(0,J.jsx)(Z,{children:`The process has run for 2 min without opening the port. It may be waiting on another service, or listening somewhere else.`}),(0,J.jsx)(Y,{text:e.logTail,source:M(r.command),onCopy:t.copy}),(0,J.jsxs)(Q,{children:[(0,J.jsx)(n,{variant:`contrast`,onClick:()=>t.keepWaiting(r.port),children:`Keep waiting`}),(0,J.jsx)(n,{variant:`outline`,onClick:()=>t.stop(r.port),children:`Stop server`})]})]})}function nt({state:e,actions:t}){let{server:r}=e;return(0,J.jsxs)(X,{state:e.stage,icon:(0,J.jsx)(x,{className:`text-danger`}),title:e.exitCode===null?`${r.label} was stopped by a signal`:`${r.label} exited with code ${e.exitCode}`,children:[(0,J.jsx)(Z,{children:`${M(r.command)} stopped.`}),(0,J.jsx)(Y,{text:e.logTail,source:M(r.command),onCopy:t.copy}),(0,J.jsx)(Q,{children:(0,J.jsxs)(n,{variant:`contrast`,onClick:()=>t.run(r.port),children:[(0,J.jsx)(T,{"aria-hidden":`true`}),`Start again`]})}),(0,J.jsx)(Ve,{server:r})]})}function rt({state:e,actions:r}){let{server:i}=e,a=e.reason===`idle`;return(0,J.jsxs)(X,{state:e.stage,icon:(0,J.jsx)(oe,{}),title:a?`Stopped after 15 min idle`:`${i.label} stopped`,children:[(0,J.jsx)(Z,{children:a?`Nobody had this pane open for 15 min, so ${t(`cezar`)} stopped ${i.label} :${i.port} and the browser to free memory. Start again reopens ${Re(e.lastUrl)}.`:`You stopped ${i.label} :${i.port}. Start again reopens ${Re(e.lastUrl)}.`}),(0,J.jsx)(Q,{children:(0,J.jsxs)(n,{variant:`contrast`,onClick:()=>r.run(i.port),children:[(0,J.jsx)(T,{"aria-hidden":`true`}),`Start again`]})}),(0,J.jsx)(Ve,{server:i})]})}var it=[`browser`,`page`,`frame`];function at({step:e,url:t}){let n=it.indexOf(e),i=t?Re(t):`the page`;return(0,J.jsx)(`div`,{"data-slot":`preview-state`,"data-state":`loading`,className:`mx-auto flex h-full w-full max-w-[560px] flex-col justify-center px-6 py-8`,children:(0,J.jsx)(`ol`,{"aria-label":`Opening the page`,className:`mx-auto flex flex-col gap-4 text-sm`,children:[{done:`Browser started`,active:`Starting the browser`},{done:`Opened ${i}`,active:`Opening ${i}`},{done:`First frame`,active:`First frame`}].map((e,t)=>{let i=t<n,a=t===n;return(0,J.jsxs)(`li`,{"aria-current":a?`step`:void 0,className:r(`flex items-center gap-3`,a?`font-semibold text-foreground`:i?`text-foreground`:`text-soft-foreground`),children:[i?(0,J.jsx)(S,{className:`size-5 text-success`,"aria-hidden":`true`}):a?(0,J.jsx)(y,{className:`size-5 animate-spin text-success motion-reduce:animate-none`,"aria-hidden":`true`}):(0,J.jsx)(L,{className:`size-5 text-border`,"aria-hidden":`true`}),i?e.done:a?e.active:e.done]},t)})})})}function ot({state:e,actions:t,worktree:r}){let i=r?/\.ai\/(?:cezar|squawk)\/worktrees\/[^/]+/.exec(r)?.[0]:void 0,a=e.server?.label;return(0,J.jsxs)(X,{state:e.stage,icon:(0,J.jsx)(B,{}),title:`This task's worktree is gone`,children:[(0,J.jsx)(Z,{children:`${a??`The server`} ran in ${i??`this task's worktree`}, which has been removed. There is nothing left to start.`}),e.server?(0,J.jsx)(te,{entry:{kind:`preview-server`,id:`preview-server:${e.server.port}`,server:e.server,state:`unavailable`},inPreview:!1}):null,(0,J.jsx)(Q,{children:(0,J.jsx)(n,{variant:`outline`,onClick:t.close,children:`Close preview`})})]})}function st({actions:e}){return(0,J.jsxs)(`div`,{"data-slot":`preview-state`,"data-state":`proxy-blocked`,className:`mx-auto flex h-full w-full max-w-[560px] flex-col justify-center gap-4 px-6 py-8`,children:[(0,J.jsx)(`div`,{children:(0,J.jsx)(Pe,{})}),(0,J.jsx)(`div`,{"aria-hidden":`true`,className:`flex size-9 items-center justify-center rounded-lg bg-muted text-foreground [&_svg]:size-[18px]`,children:(0,J.jsx)(W,{})}),(0,J.jsx)(`h2`,{className:`text-xl leading-tight font-semibold text-foreground`,children:`Preview doesn't work behind this proxy yet`}),(0,J.jsxs)(Z,{children:[`The proxy in front of `,t(`cezar`),` didn't let the preview's WebSocket through. This is a known gap behind Basic Auth. Everything else in `,t(`cezar`),` keeps working.`]}),(0,J.jsxs)(Q,{children:[(0,J.jsx)(n,{variant:`outline`,onClick:e.close,children:`Close preview`}),(0,J.jsx)(`a`,{className:`inline-flex min-h-11 items-center text-sm font-medium text-accent-text underline-offset-2 hover:underline`,href:ze,target:`_blank`,rel:`noopener noreferrer`,children:`Which setups work`})]})]})}function ct(e){let t=/iPhone/.test(e)?`iPhone`:/iPad/.test(e)?`iPad`:/Android/.test(e)?`Android`:/Windows/.test(e)?`Windows`:/Mac OS X|Macintosh/.test(e)?`Mac`:/Linux|X11/.test(e)?`Linux`:``,n=/Edg\//.test(e)?`Edge`:/Firefox\/|FxiOS/.test(e)?`Firefox`:/Chrome\/|CriOS/.test(e)?`Chrome`:/Safari\//.test(e)?`Safari`:``;return n&&t?`${n} on ${t}`:n||t}function lt({state:e,actions:t}){let r=ct(e.by);return(0,J.jsxs)(X,{state:e.stage,icon:(0,J.jsx)(U,{}),title:`Preview is open somewhere else`,children:[(0,J.jsx)(Z,{children:`Another tab took this browser${r?` (${r})`:``}. Only one tab can view and drive it at a time.`}),(0,J.jsxs)(Q,{children:[(0,J.jsxs)(n,{variant:`contrast`,onClick:t.useHere,children:[(0,J.jsx)(R,{"aria-hidden":`true`}),`Use it here`]}),(0,J.jsx)(n,{variant:`outline`,onClick:t.close,children:`Close preview`})]})]})}function ut({attempt:e,exhausted:t,onReconnect:r}){return(0,J.jsxs)(`div`,{"data-slot":`preview-connection-banner`,role:`status`,className:`absolute inset-x-3 top-3 z-10 flex flex-wrap items-center justify-between gap-x-3 gap-y-2 rounded-lg border border-border bg-card px-3.5 py-2.5 text-sm shadow-sm`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,J.jsx)(ke,{className:`size-4 shrink-0 text-danger`,"aria-hidden":`true`}),(0,J.jsxs)(`span`,{children:[(0,J.jsx)(`strong`,{className:`font-semibold text-foreground`,children:`Lost the connection to the host`}),t?null:(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:` · reconnecting (attempt ${e} of 5)`})]})]}),(0,J.jsx)(n,{variant:`outline`,onClick:r,children:t?`Reconnect`:`Reconnect now`})]})}function dt({servers:e,states:t,onOpen:r,agentLive:i=!1,agentIdle:a=!1,onOpenAgent:o}){return(0,J.jsxs)(`div`,{"data-slot":`preview-state`,"data-state":a?`agent-idle`:`empty`,className:`mx-auto flex h-full w-full max-w-[560px] flex-col justify-center gap-4 px-6 py-8`,children:[(0,J.jsx)(`h2`,{className:`text-xl leading-tight font-semibold text-foreground`,children:`Open a page in this task's browser`}),(0,J.jsx)(Z,{children:`The browser runs on the host, next to the worktree. Type a URL, a bare port such as 3000, or open a server the agent registered.`}),a?(0,J.jsxs)(`p`,{role:`status`,className:`flex items-start gap-2 text-sm text-foreground`,children:[(0,J.jsx)(Oe,{className:`mt-0.5 size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{children:`The agent is not driving the browser now.`})]}):null,i&&o!==void 0?(0,J.jsxs)(`section`,{"aria-labelledby":`preview-agent`,className:`overflow-hidden rounded-lg border border-border bg-card`,children:[(0,J.jsx)(`h3`,{id:`preview-agent`,className:`border-b border-border px-3.5 py-2.5 text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Driven by the agent`}),(0,J.jsxs)(`div`,{"data-slot":`preview-agent-entry`,className:`flex items-center justify-between gap-3 px-3.5 py-2 text-sm`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-0.5`,children:[(0,J.jsx)(P,{tone:`success`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`font-semibold text-foreground`,children:`Agent's page`}),(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`The agent drives this page through agent-browser.`})]}),(0,J.jsx)(n,{variant:`outline`,size:`sm`,className:`max-md:h-11`,"aria-label":`Open the agent's page`,onClick:o,children:`Open`})]})]}):null,e.length>0?(0,J.jsxs)(`section`,{"aria-labelledby":`preview-registered`,className:`overflow-hidden rounded-lg border border-border bg-card`,children:[(0,J.jsx)(`h3`,{id:`preview-registered`,className:`border-b border-border px-3.5 py-2.5 text-xs font-semibold tracking-wide text-soft-foreground uppercase`,children:`Registered in this task`}),(0,J.jsx)(`ul`,{children:e.map(e=>{let i=be(e,t),a=_e(i);return(0,J.jsxs)(`li`,{className:`flex items-center justify-between gap-3 border-b border-border px-3.5 py-2 text-sm last:border-b-0`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-0.5`,children:[(0,J.jsx)(P,{tone:a.tone,shape:a.ring?`ring`:`filled`,pulse:a.pulse,"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`font-semibold text-foreground`,children:e.label}),(0,J.jsxs)(`span`,{className:`font-mono text-muted-foreground`,children:[`:`,e.port]}),(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:a.text})]}),(0,J.jsx)(n,{variant:`outline`,size:`sm`,className:`max-md:h-11`,onClick:()=>r(e.port),children:xe(i)?`Open`:`Review`})]},e.port)})})]}):null,(0,J.jsxs)(`p`,{className:`flex items-start gap-2 text-xs text-muted-foreground`,children:[(0,J.jsx)(w,{className:`mt-px size-3.5 shrink-0`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{children:`Review opens a server's approval in this pane: its command, cwd and Run and open. Nothing runs from this list. Paste works; copying text out, file pickers and downloads don't yet.`})]})]})}function ft({dialog:e,onResult:t}){let[r,i]=(0,q.useState)(e.defaultPrompt??``),a=e.type===`beforeunload`,o=(0,q.useRef)(null),s=(0,q.useRef)(null);(0,q.useEffect)(()=>{(e.type===`prompt`?s.current:o.current)?.focus()},[e.type]);let c=(0,q.useRef)(t);c.current=t,(0,q.useEffect)(()=>{let e=e=>{if(e.key!==`Escape`||e.defaultPrevented)return;let t=e.target instanceof Element?e.target:null;t&&t!==document.body&&!t.closest(`[data-slot="preview-pane-body"], [data-slot="preview-page-dialog"]`)||(e.stopPropagation(),c.current({accept:!1}))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]);let l=()=>t(e.type===`prompt`?{accept:!0,text:r}:{accept:!0});return(0,J.jsx)(`div`,{"data-slot":`preview-page-dialog`,className:`absolute inset-0 z-20 flex items-center justify-center bg-foreground/30 p-4`,children:(0,J.jsxs)(`div`,{role:`alertdialog`,"aria-modal":`true`,"aria-label":`${e.origin} says`,className:`w-full max-w-[380px] rounded-xl border border-border bg-card p-4 shadow-lg`,children:[(0,J.jsx)(`p`,{className:`mb-3 truncate font-mono text-xs text-muted-foreground`,children:`${e.origin} says`}),(0,J.jsx)(`p`,{className:`mb-4 text-sm break-words whitespace-pre-wrap text-foreground`,children:e.message||(a?`Changes you made may not be saved.`:``)}),e.type===`prompt`?(0,J.jsx)(`input`,{ref:s,value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&l()},className:`mb-4 h-11 w-full rounded-md border border-border bg-background px-3 text-sm outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`}):null,(0,J.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[e.type===`alert`?null:(0,J.jsx)(n,{variant:`outline`,onClick:()=>t({accept:!1}),children:a?`Stay`:`Cancel`}),(0,J.jsx)(n,{ref:o,variant:`contrast`,onClick:l,children:a?`Leave`:`OK`})]})]})})}var pt=10,mt=500,ht=500,gt=4,_t=16,vt=e=>!!e.altKey|(e.ctrlKey?2:0)|(e.metaKey?4:0)|(e.shiftKey?8:0);function yt(e,t,n,r){return{x:Math.round((e-n.left)/r),y:Math.round((t-n.top)/r)}}function bt(e,t){return{rect:e,scale:t,touches:new Map,multiTouch:!1,click:{at:-1/0,x:0,y:0,button:-1,count:1}}}var xt=[`left`,`middle`,`right`];function $(e,t,n,r){let i=yt(n.clientX,n.clientY,t.rect,t.scale);return{t:`mouse`,type:e,x:i.x,y:i.y,button:xt[n.button]??`none`,buttons:n.buttons,clickCount:1,modifiers:vt(n),...r}}var St=e=>e===0?0:-e;function Ct(e,t,n,r,i){let a=yt(t,n,e.rect,e.scale);return{t:`mouse`,type:`mouseWheel`,x:a.x,y:a.y,button:`none`,buttons:0,deltaX:St(r/e.scale),deltaY:St(i/e.scale),modifiers:0}}function wt(e,t){let{touches:n}=t,r=n.get(e.pointerId),i=()=>{n.delete(e.pointerId),n.size===0&&(t.multiTouch=!1)};switch(e.type){case`pointerdown`:return n.set(e.pointerId,{startX:e.clientX,startY:e.clientY,startAt:e.timeStamp,lastX:e.clientX,lastY:e.clientY,scrolling:!1}),n.size>1&&(t.multiTouch=!0),[];case`pointermove`:{if(!r)return[];if(t.multiTouch)return r.lastX=e.clientX,r.lastY=e.clientY,[];if(!r.scrolling){if(Math.hypot(e.clientX-r.startX,e.clientY-r.startY)<=pt)return[];r.scrolling=!0}let n=e.clientX-r.lastX,i=e.clientY-r.lastY;return r.lastX=e.clientX,r.lastY=e.clientY,n===0&&i===0?[]:[Ct(t,e.clientX,e.clientY,n,i)]}case`pointerup`:{let n=r!==void 0&&!t.multiTouch&&!r.scrolling&&e.timeStamp-r.startAt<=mt;if(i(),!n||!r)return[];let a={...e,clientX:r.startX,clientY:r.startY};return[$(`mouseMoved`,t,a,{button:`none`,buttons:0}),$(`mousePressed`,t,a,{button:`left`,buttons:1}),$(`mouseReleased`,t,a,{button:`left`,buttons:0})]}case`pointercancel`:return i(),[]}}function Tt(e,t){if(e.pointerType===`touch`)return wt(e,t);switch(e.type){case`pointerdown`:{let n=t.click,r=n.button===e.button&&e.timeStamp-n.at<=ht&&Math.hypot(e.clientX-n.x,e.clientY-n.y)<=gt;return t.click={at:e.timeStamp,x:e.clientX,y:e.clientY,button:e.button,count:r?n.count+1:1},[$(`mousePressed`,t,e,{clickCount:t.click.count})]}case`pointermove`:return[$(`mouseMoved`,t,e,{button:e.buttons&1?`left`:`none`})];case`pointerup`:return[$(`mouseReleased`,t,e,{clickCount:t.click.count})];case`pointercancel`:return[]}}function Et(e,t,n){let r=yt(e.clientX,e.clientY,t,n),i=e.deltaMode===1?_t:1;return{t:`mouse`,type:`mouseWheel`,x:r.x,y:r.y,button:`none`,buttons:e.buttons??0,deltaX:e.deltaX*i/n,deltaY:e.deltaY*i/n,modifiers:vt(e)}}var Dt={a:`selectAll`,c:`copy`,x:`cut`,z:`undo`,y:`redo`};function Ot(e){let t=e.key.toLowerCase(),n=(e.ctrlKey||e.metaKey)&&!e.getModifierState?.(`AltGraph`);if(n&&(t===`v`||t===`k`))return;let r={t:`key`,key:e.key,code:e.code,modifiers:vt(e),vk:e.keyCode};if(e.type===`keyup`)return{...r,type:`keyUp`};let i=n?``:e.key.length===1?e.key:e.key===`Enter`?`\r`:e.key===`Tab`?` `:``,a=n?t===`z`&&e.shiftKey?`redo`:Dt[t]:void 0,o={t:`key`,type:i?`keyDown`:`rawKeyDown`,key:e.key,code:e.code,text:i,modifiers:vt(e),vk:e.keyCode};return a?{...o,commands:[a]}:o}function kt(e){return e?{t:`insertText`,text:e}:void 0}var At=e=>e,jt=e=>e.key===`Escape`&&e.shiftKey&&!e.ctrlKey&&!e.metaKey&&!e.altKey;function Mt({scale:e,send:t,onLeave:n}){let r=(0,q.useRef)(null),i=(0,q.useRef)(bt({left:0,top:0},e)),a=(0,q.useRef)(e);a.current=e;let o=(0,q.useRef)(t);o.current=t;let s=(0,q.useRef)(void 0),c=()=>{let e=r.current;e&&(i.current.rect=e.getBoundingClientRect()),i.current.scale=a.current},l=e=>{c();for(let t of Tt(At(e),i.current))o.current(t)},u=()=>{let e=s.current;e&&(s.current=void 0,cancelAnimationFrame(e.frame),l(e.event))};(0,q.useEffect)(()=>()=>{s.current&&cancelAnimationFrame(s.current.frame)},[]),(0,q.useEffect)(()=>{document.activeElement===document.body&&r.current?.focus({preventScroll:!0})},[]),(0,q.useEffect)(()=>{let e=r.current;if(!e)return;let t=e=>{e.preventDefault(),c(),o.current(Et(e,i.current.rect,i.current.scale))};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[]),(0,q.useEffect)(()=>{let e=e=>{if(document.activeElement!==r.current)return;let t=kt(e.clipboardData?.getData(`text`)??``);t&&(e.preventDefault(),o.current(t))};return document.addEventListener(`paste`,e),()=>document.removeEventListener(`paste`,e)},[]);let d=e=>{u(),r.current?.focus({preventScroll:!0});try{r.current?.setPointerCapture(e.pointerId)}catch{}l(e.nativeEvent)},f=e=>{let t=e.nativeEvent;if(t.pointerType===`touch`)return l(t);let n=s.current;if(n){n.event=t;return}s.current={event:t,frame:requestAnimationFrame(()=>{let e=s.current;s.current=void 0,e&&l(e.event)})}},p=e=>{u(),l(e.nativeEvent)},m=e=>{if(jt(e)){e.preventDefault(),e.stopPropagation(),e.type===`keydown`&&(n?n():r.current?.blur());return}let i=Ot(e.nativeEvent);i&&(e.preventDefault(),e.stopPropagation(),t(i))};return(0,J.jsx)(`div`,{ref:r,"data-slot":`preview-input`,role:`application`,"aria-label":`Page preview, interactive`,"aria-description":`Keys go to the page, Tab included. Press Shift+Escape to return to the cockpit.`,tabIndex:0,onPointerDown:d,onPointerMove:f,onPointerUp:p,onPointerCancel:p,onContextMenu:e=>e.preventDefault(),onKeyDown:m,onKeyUp:m,className:`absolute inset-0 touch-none select-none outline-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-inset`})}async function Nt(e){if(typeof createImageBitmap==`function`){let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,release:()=>t.close()}}let t=URL.createObjectURL(e),n=new Image;return n.src=t,await n.decode(),{source:n,width:n.naturalWidth,height:n.naturalHeight,release:()=>URL.revokeObjectURL(t)}}function Pt({ref:e,viewport:t,dimmed:n=!1,cursor:i,onSize:a,renderInput:o,children:s}){let l=(0,q.useRef)(0),u=(0,q.useRef)(null),d=(0,q.useRef)(null),[f,p]=(0,q.useState)(null),m=(0,q.useRef)(a);m.current=a,(0,q.useImperativeHandle)(e,()=>({async draw(e){let t=++l.current,n=d.current,r=n?.getContext(`2d`);if(!(!n||!r||!c()))try{let i=await Nt(e);try{if(t!==l.current||!c()||d.current!==n)return;n.width!==i.width&&(n.width=i.width),n.height!==i.height&&(n.height=i.height),r.drawImage(i.source,0,0)}finally{i.release()}}catch{}}}),[]),(0,q.useEffect)(()=>{let e=u.current;if(!e)return;let t=()=>{let t=Math.round(e.clientWidth),n=Math.round(e.clientHeight);t===0||n===0||(p(e=>e&&e.w===t&&e.h===n?e:{w:t,h:n}),m.current?.({w:t,h:n}))};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let h=t===`fit`?f:t,g=t===`fit`||!f?1:Math.min(1,(f.w-24)/t.w,(f.h-24)/t.h),_=h?{width:Math.floor(h.w*g),height:Math.floor(h.h*g)}:void 0;return(0,J.jsxs)(`div`,{ref:u,"data-slot":`preview-stage`,"data-viewport":t===`fit`?`fit`:`${t.w}x${t.h}`,className:r(`relative min-h-0 flex-1 overflow-hidden bg-muted`,t!==`fit`&&`flex items-start justify-center overflow-auto p-3`),children:[h?(0,J.jsxs)(`div`,{"data-slot":`preview-surface`,"data-scale":g,style:{..._,cursor:i},className:r(`relative shrink-0 bg-card`,t!==`fit`&&`shadow-md`,n&&`opacity-60 saturate-50`),children:[(0,J.jsx)(`canvas`,{ref:d,"aria-label":`Page preview`,role:`img`,style:_,className:`block touch-none select-none`}),o?.({canvas:d.current,scale:g,viewport:h})]}):null,s]})}var Ft=`cez-preview-quality`,It=[{value:`normal`,label:`Normal`,detail:`The default. Lighter on CPU and network.`},{value:`high`,label:`High`,detail:`Sharper text and fine detail. Uses more CPU and network.`},{value:`ultra`,label:`Ultra`,detail:`High at your screen's pixel density, up to 2×. Uses the most CPU and network.`}];function Lt(e){return It.find(t=>t.value===e)?.value??`normal`}var Rt=e=>It.find(t=>t.value===e)?.label??`Normal`;function zt(){try{return Lt(localStorage.getItem(Ft))}catch{return`normal`}}function Bt(e){try{localStorage.setItem(Ft,e)}catch{}}var Vt=[{w:390,h:844,icon:fe},{w:820,h:1180,icon:Ee},{w:1440,h:900,icon:pe}],Ht=`size-8 shrink-0 max-md:size-11`,Ut=e=>e===`fit`?`Fit`:`${e.w} × ${e.h}`;function Wt(e){let[t,n]=(0,q.useState)(()=>Date.now());return(0,q.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var Gt=e=>`${e.fps} fps · ${e.kbps} KB/s${e.rttMs===void 0?``:` · ${e.rttMs} ms`}`;function Kt({stats:e,shrunk:t}){let n=Wt(250),r=e.lastFrameAt===void 0||n-e.lastFrameAt>=1e3;return t?(0,J.jsx)(P,{"data-slot":`preview-stats`,tone:r?`neutral`:`success`,"aria-label":`Preview is live`,role:`img`}):(0,J.jsxs)(`span`,{"data-slot":`preview-stats`,role:`img`,"aria-label":r?`idle`:Gt(e),className:`flex shrink-0 items-center gap-1.5 font-mono text-xs whitespace-nowrap text-muted-foreground`,children:[(0,J.jsx)(P,{tone:r?`neutral`:`success`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`hidden @min-[640px]:inline-block w-[28ch] overflow-hidden text-ellipsis`,children:r?`idle`:Gt(e)})]})}function qt({current:e,agentShown:t,...r}){let i=e?e.label:t?`Agent's page`:`Server`;return(0,J.jsxs)(n,{variant:`outline`,size:`sm`,className:`max-w-[11rem] min-w-0 gap-1.5 max-md:h-11`,"aria-label":e?`Server: ${e.label} :${e.port}`:t?`Server: ${i}`:`Server`,...r,children:[e||t?(0,J.jsx)(P,{tone:`neutral`,shape:`ring`,"aria-hidden":`true`}):(0,J.jsx)(ne,{"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`truncate`,children:i}),e?(0,J.jsxs)(`span`,{className:`font-mono font-normal text-muted-foreground`,children:[`:`,e.port]}):null,(0,J.jsx)(j,{className:`size-3.5 text-muted-foreground`,"aria-hidden":`true`})]})}function Jt({shown:e,live:t,onSelect:n}){return(0,J.jsxs)(p,{className:`min-h-11 gap-2.5 md:min-h-0`,onSelect:n,children:[(0,J.jsx)(P,{tone:t?`success`:`neutral`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`font-semibold`,children:`Agent's page`}),(0,J.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:`agent-browser`}),e?(0,J.jsx)(D,{className:`size-4`,"aria-hidden":`true`}):null]})}function Yt(e,t){return e?`${e.label} :${e.port}`:t?`Agent's page`:`Preview`}function Xt(e){let t=e.onPickAgent!==void 0,n=e.agentLive===!0&&t,r=e.agentShown===!0;return{agentLive:n,agentShown:r,agentListed:n||r&&t}}function Zt(e){let{compact:t=!1,navEnabled:r,loading:i=!1}=e,a=(0,q.useRef)(null),o=e.urlInputRef??a,s=(0,q.useRef)(!1),[c,l]=(0,q.useState)(null),[u,d]=(0,q.useState)(!1),f=(0,J.jsx)(n,{variant:`ghost`,size:`icon-sm`,className:Ht,"aria-label":`Back`,disabled:!r,onClick:e.onBack,children:(0,J.jsx)(Se,{"aria-hidden":`true`})}),p=(0,J.jsx)(n,{variant:`ghost`,size:`icon-sm`,className:Ht,"aria-label":`Forward`,disabled:!r,onClick:e.onForward,children:(0,J.jsx)(ee,{"aria-hidden":`true`})}),m=(0,J.jsx)(n,{variant:`ghost`,size:`icon-sm`,className:Ht,"aria-label":`Reload`,"aria-busy":i||void 0,disabled:!r||i,onClick:()=>e.onReload(!1),children:(0,J.jsx)(K,{"aria-hidden":`true`})}),h=e.onSession?(0,J.jsxs)(n,{variant:`outline`,size:`sm`,className:`shrink-0 gap-1 max-md:h-11`,onClick:e.onSession,children:[(0,J.jsx)(de,{"aria-hidden":`true`}),`Session`]}):null,g=i?(0,J.jsx)(`div`,{role:`progressbar`,"aria-label":`Loading the page`,className:`absolute inset-x-0 bottom-0 h-0.5 overflow-hidden bg-transparent`,children:(0,J.jsx)(`div`,{className:`preview-progress h-full w-2/5 bg-success`})}):null,_=(0,J.jsx)($t,{props:e,input:o,draft:c,setDraft:l,focused:u,setFocused:d}),{agentListed:v}=Xt(e),y=e.servers.length+ +!!v>=2,b=y||e.adopted,x={back:f,forward:p,reload:m,address:_,more:(0,J.jsx)(an,{props:e,compact:t,crowded:b}),session:h,progress:g};return t?(0,J.jsx)(on,{props:e,elements:x}):(0,J.jsx)(sn,{props:e,elements:x,switcher:y,crowded:b,input:o,focusUrlAfterMenu:s})}function Qt({props:e,input:t,focusUrlAfterMenu:n}){let{servers:r,current:i}=e,{agentLive:a,agentShown:o,agentListed:s}=Xt(e);return(0,J.jsxs)(v,{children:[(0,J.jsx)(h,{asChild:!0,children:(0,J.jsx)(qt,{current:i,agentShown:o})}),(0,J.jsxs)(g,{align:`start`,className:`min-w-64`,onCloseAutoFocus:e=>{n.current&&(n.current=!1,e.preventDefault(),t.current?.focus())},children:[s?(0,J.jsx)(Jt,{shown:o,live:a,onSelect:()=>e.onPickAgent?.()}):null,r.map(t=>{let n=_e(be(t,e.serverStates));return(0,J.jsxs)(p,{className:`min-h-11 gap-2.5 md:min-h-0`,onSelect:()=>e.onPickServer(t.port),children:[(0,J.jsx)(P,{tone:n.tone,shape:n.ring?`ring`:`filled`,pulse:n.pulse,"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`font-semibold`,children:t.label}),(0,J.jsxs)(`span`,{className:`font-mono text-muted-foreground`,children:[`:`,t.port]}),(0,J.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:n.text}),i?.port===t.port?(0,J.jsx)(D,{className:`size-4`,"aria-hidden":`true`}):null]},t.port)}),(0,J.jsx)(m,{}),(0,J.jsxs)(p,{className:`min-h-11 gap-2.5 md:min-h-0`,onSelect:()=>{n.current=!0},children:[(0,J.jsx)(ae,{"aria-hidden":`true`}),`Type a URL instead`]})]})]})}function $t({props:e,input:n,draft:i,setDraft:a,focused:o,setFocused:s}){let{url:c,adopted:l}=e;return(0,J.jsxs)(`div`,{className:`relative flex min-w-[9rem] flex-1 items-center`,children:[(0,J.jsx)(ae,{className:`pointer-events-none absolute left-2.5 size-4 text-muted-foreground`,"aria-hidden":`true`}),(0,J.jsx)(`input`,{ref:n,type:`text`,"aria-label":`Page address`,placeholder:`Type a URL or a port`,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,value:i??(o?c:Re(c)),title:c||void 0,className:r(`h-8 w-full min-w-0 truncate rounded-md border border-transparent bg-muted pl-8 font-mono text-[13px] text-foreground outline-none placeholder:text-soft-foreground focus-visible:border-ring focus-visible:bg-background focus-visible:ring-[3px] focus-visible:ring-ring/30 max-md:h-11`,l?`pr-40`:`pr-2.5`),onFocus:e=>{let t=e.currentTarget;s(!0),requestAnimationFrame(()=>{document.activeElement===t&&t.select()})},onBlur:()=>{s(!1),a(null)},onChange:e=>a(e.target.value),onKeyDown:t=>{t.key===`Enter`?(e.onNavigate(i??c),t.currentTarget.blur()):t.key===`Escape`&&t.currentTarget.blur()}}),l&&!o?(0,J.jsxs)(`span`,{className:`pointer-events-none absolute right-2 inline-flex h-6 items-center gap-1 rounded-full border border-border bg-card px-2 text-xs font-semibold text-muted-foreground`,children:[(0,J.jsx)(we,{className:`size-3`,"aria-hidden":`true`}),`Not started by `,t(`cezar`)]}):null]})}function en({props:e}){let{viewport:t}=e;return(0,J.jsxs)(v,{children:[(0,J.jsx)(h,{asChild:!0,children:(0,J.jsxs)(n,{variant:`outline`,size:`sm`,className:`shrink-0 gap-1.5`,"aria-label":`Viewport size: ${Ut(t)}`,children:[t===`fit`?(0,J.jsx)(H,{"aria-hidden":`true`}):(0,J.jsx)(pe,{"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:r(`hidden @min-[500px]:inline`,t!==`fit`&&`font-mono font-normal`),children:Ut(t)}),(0,J.jsx)(j,{className:`size-3.5 text-muted-foreground`,"aria-hidden":`true`})]})}),(0,J.jsxs)(g,{align:`start`,className:`min-w-56`,children:[(0,J.jsxs)(p,{className:`gap-2.5`,onSelect:()=>e.onViewport(`fit`),children:[(0,J.jsx)(H,{"aria-hidden":`true`}),`Fit`,(0,J.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:`pane size`}),t===`fit`?(0,J.jsx)(D,{className:`size-4`,"aria-hidden":`true`}):null]}),Vt.map(({w:n,h:r,icon:i})=>(0,J.jsxs)(p,{className:`gap-2.5 font-mono`,onSelect:()=>e.onViewport({w:n,h:r}),children:[(0,J.jsx)(i,{"aria-hidden":`true`}),n,` × `,r,t!==`fit`&&t.w===n&&t.h===r?(0,J.jsx)(D,{className:`ml-auto size-4`,"aria-hidden":`true`}):null]},`${n}x${r}`))]})]})}function tn({quality:e,onQuality:t,compact:n}){return(0,J.jsx)(_,{value:e,onValueChange:e=>t(Lt(e)),children:It.map(e=>(0,J.jsx)(f,{value:e.value,"data-quality":e.value,className:r(`items-start`,n&&`min-h-11`),children:(0,J.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,J.jsx)(`span`,{children:e.label}),(0,J.jsx)(`span`,{className:`text-xs whitespace-normal text-muted-foreground`,children:e.detail})]})},e.value))})}function nn({props:e}){let{quality:t}=e;return(0,J.jsxs)(v,{children:[(0,J.jsx)(h,{asChild:!0,children:(0,J.jsxs)(n,{variant:`outline`,size:`sm`,className:`shrink-0 gap-1.5`,"aria-label":`Stream quality: ${Rt(t)}`,children:[(0,J.jsx)(Ce,{"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`hidden @min-[560px]:inline`,children:Rt(t)}),(0,J.jsx)(j,{className:`size-3.5 text-muted-foreground`,"aria-hidden":`true`})]})}),(0,J.jsxs)(g,{align:`start`,className:`w-64`,children:[(0,J.jsx)(d,{className:`text-xs font-normal text-muted-foreground`,children:`Stream quality`}),(0,J.jsx)(tn,{quality:t,onQuality:e.onQuality,compact:!1})]})]})}function rn({stats:e,status:t,crowded:n}){return e?(0,J.jsx)(Kt,{stats:e,shrunk:n}):t?(0,J.jsxs)(`span`,{"data-slot":`preview-status`,className:`flex shrink-0 items-center gap-1.5 font-mono text-xs whitespace-nowrap text-muted-foreground`,children:[(0,J.jsx)(P,{tone:t.tone,"aria-hidden":`true`}),t.label]}):null}function an({props:e,compact:r,crowded:i}){let{stats:a,navEnabled:o,url:s,current:c,adopted:l}=e;return(0,J.jsxs)(v,{children:[(0,J.jsx)(h,{asChild:!0,children:(0,J.jsx)(n,{variant:`ghost`,size:`icon-sm`,className:Ht,"aria-label":`More`,children:(0,J.jsx)(ce,{"aria-hidden":`true`})})}),(0,J.jsxs)(g,{align:`end`,className:`min-w-64`,children:[i&&a&&!r?(0,J.jsx)(d,{className:`font-mono text-xs font-normal text-muted-foreground`,children:Gt(a)}):null,(0,J.jsxs)(p,{className:`min-h-11 gap-2.5 md:min-h-0`,disabled:!o,onSelect:()=>e.onReload(!0),children:[(0,J.jsx)(G,{"aria-hidden":`true`}),`Reload without cache`]}),(0,J.jsxs)(p,{className:`min-h-11 gap-2.5 md:min-h-0`,disabled:s===``,onSelect:e.onCopyUrl,children:[(0,J.jsx)(me,{"aria-hidden":`true`}),`Copy page URL`]}),c?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(m,{}),l?(0,J.jsxs)(p,{disabled:!0,className:`items-start gap-2.5 opacity-100 data-[disabled]:opacity-100`,children:[(0,J.jsx)(V,{className:`mt-0.5 text-muted-foreground`,"aria-hidden":`true`}),(0,J.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`Stop server · ${c.label} :${c.port}`}),(0,J.jsxs)(`span`,{className:`text-xs whitespace-normal text-muted-foreground`,children:[t(`cezar`),` didn't start this server, so it won't stop it. Stop it where it was started.`]})]})]}):(0,J.jsxs)(p,{variant:`destructive`,className:`min-h-11 gap-2.5 md:min-h-0`,onSelect:()=>e.onStop(c.port),children:[(0,J.jsx)(I,{"aria-hidden":`true`}),`Stop server · ${c.label} :${c.port}`]})]}):null,r?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(m,{}),(0,J.jsx)(d,{className:`text-xs font-normal text-muted-foreground`,children:`Stream quality`}),(0,J.jsx)(tn,{quality:e.quality,onQuality:e.onQuality,compact:!0}),(0,J.jsx)(m,{}),(0,J.jsxs)(p,{className:`min-h-11 gap-2.5`,onSelect:e.onClose,children:[(0,J.jsx)(se,{"aria-hidden":`true`}),`Close preview`]})]}):null]})]})}function on({props:e,elements:t}){let{stats:n,current:r,badge:i=!0}=e,{agentShown:a}=Xt(e),{back:o,forward:s,reload:c,address:l,more:u,session:d,progress:f}=t;return(0,J.jsxs)(`div`,{"data-slot":`preview-toolbar`,"data-compact":``,className:`relative flex shrink-0 flex-col border-b border-border bg-background`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 px-2 pt-[max(0.25rem,env(safe-area-inset-top))]`,children:[d,(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-center leading-tight`,children:[(0,J.jsxs)(`span`,{className:`flex max-w-full items-center gap-1.5 text-sm font-semibold text-foreground`,children:[n?(0,J.jsx)(P,{tone:`success`,"aria-hidden":`true`}):null,(0,J.jsx)(`span`,{className:`truncate`,children:Yt(r,a)})]}),i?(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Experimental`}):null]}),u]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-1 px-2 py-1`,children:[o,s,c,l]}),f]})}function sn({props:e,elements:t,switcher:r,crowded:i,input:a,focusUrlAfterMenu:o}){let{badge:s=!0,stats:c,status:l}=e,{back:u,forward:d,reload:f,address:p,more:m,session:h,progress:g}=t;return(0,J.jsxs)(`div`,{"data-slot":`preview-toolbar`,className:`@container relative flex shrink-0 items-center gap-1.5 border-b border-border bg-background px-2.5 py-2`,children:[h,u,d,f,r?(0,J.jsx)(Qt,{props:e,input:a,focusUrlAfterMenu:o}):null,p,(0,J.jsx)(en,{props:e}),(0,J.jsx)(nn,{props:e}),(0,J.jsx)(rn,{stats:c,status:l,crowded:i}),s?(0,J.jsx)(Pe,{iconOnly:i,responsive:!i}):null,(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`mx-0.5 h-5 w-px shrink-0 bg-border`}),m,(0,J.jsx)(n,{variant:`ghost`,size:`icon-sm`,className:Ht,"aria-label":`Close preview`,onClick:e.onClose,children:(0,J.jsx)(se,{"aria-hidden":`true`})}),g]})}function cn({transport:e,takenOver:t,empty:n,stage:r,hasFrame:i,lost:a,url:o,worktree:s}){let c=a||e!==`blocked`&&t!==void 0;return e===`blocked`?{content:{kind:`state`,state:{stage:`proxy-blocked`}},dim:c}:t===void 0?n||r?.stage===`agent-idle`?{content:{kind:`empty`,agentIdle:!n&&r?.stage===`agent-idle`},dim:c}:r?.stage===`streaming`||r?.stage===`loading`&&i?{content:{kind:`none`},dim:c}:r?{content:{kind:`state`,state:r,url:o,worktree:s},dim:c}:a?{content:{kind:`none`},dim:c}:{content:{kind:`state`,state:{t:`state`,stage:`loading`,step:`browser`},url:o},dim:c}:{content:{kind:`state`,state:{stage:`taken-over`,by:t}},dim:c}}function ln(e,{servers:t,serverStates:n,agentLive:r,openServer:i,openAgent:a,actions:o}){switch(e.kind){case`none`:return null;case`state`:{let{kind:t,...n}=e;return(0,J.jsx)(Be,{...n,actions:o})}case`empty`:return(0,J.jsx)(dt,{servers:t,states:n,onOpen:e=>i(e),agentLive:r===!0,agentIdle:e.agentIdle,onOpenAgent:a})}}function un(){let e=typeof window>`u`?void 0:window.devicePixelRatio;return typeof e==`number`&&e>0?e:1}function dn(){let[e,t]=(0,q.useState)(un);return(0,q.useEffect)(()=>{let n=window.matchMedia?.(`(resolution: ${e}dppx)`);if(!n)return;let r=()=>t(un());return n.addEventListener(`change`,r),()=>n.removeEventListener(`change`,r)},[e]),e}var fn=2e3,pn=500,mn=1e3;function hn(e,t){switch(e.stage){case`needs-approval`:case`port-held`:case`server-starting`:case`server-stalled`:case`server-exited`:case`server-stopped`:return e.server.port===t;case`loading`:case`streaming`:return!0;default:return!1}}function gn(e){navigator.clipboard?.writeText(e).then(()=>u(`Copied`),()=>u(`Couldn't copy to the clipboard`,{tone:`danger`}))}var _n=e=>`http://localhost:${e.port}${e.path&&e.path!==`/`?e.path:``}`;function vn(e,t){return e?.port===void 0?e?.agent===!0||e?.url!==void 0:e.restored!==!0||t.some(t=>t.port===e.port)}function yn(e){return`port`in e?{port:e.port}:`agent`in e?{agent:!0}:{url:e.url}}function bn({run:e,servers:t,request:n,onTarget:r,onLive:i,onClose:a}){let o=dn(),l=(0,q.useRef)(o);l.current=o;let u=s(),d=(0,q.useRef)(crypto.randomUUID()),f=(0,q.useRef)(!1),p=re(),m=ve(ye,!1),[h,g]=(0,q.useState)(0),[_,v]=(0,q.useState)({state:`connecting`,attempt:0}),[y,b]=(0,q.useState)(!1),[ee,x]=(0,q.useState)(void 0),[S,C]=(0,q.useState)(void 0),[w,T]=(0,q.useState)(``),[E,te]=(0,q.useState)(void 0),[ne,D]=(0,q.useState)(!1),[O,k]=(0,q.useState)(void 0),[ie,ae]=(0,q.useState)(!1),[oe,se]=(0,q.useState)(!1),[ce,le]=(0,q.useState)(void 0),[ue,de]=(0,q.useState)(void 0),[fe,pe]=(0,q.useState)(void 0),[me,A]=(0,q.useState)(`fit`),[j,he]=(0,q.useState)(zt),[ge,M]=(0,q.useState)(null),[_e,N]=(0,q.useState)(void 0),[be,P]=(0,q.useState)(0),F=(0,q.useRef)(void 0),xe=(0,q.useRef)(null),Se=(0,q.useRef)(null),I=(0,q.useRef)(void 0),L=(0,q.useRef)(void 0),R=(0,q.useRef)(j);R.current=j;let z=(0,q.useRef)({port:E,stage:S,agent:ne});z.current={port:E,stage:S,agent:ne};let B=(0,q.useRef)([]),Ce=(0,q.useRef)(void 0),we=(0,q.useRef)(!1),V=(0,q.useRef)(!1),H=(0,q.useCallback)(e=>{V.current&&F.current?.send(e)},[]);(0,q.useEffect)(()=>{let t;return t=Ne({projectId:p??`default`,runId:e.id},{onFrame(e){if(!c())return;let n=Date.now();B.current.push({at:n,bytes:e.size}),we.current||(we.current=!0,se(!0)),(xe.current?.draw(e)??Promise.resolve()).finally(()=>t?.send({t:`ack`}))},onMessage(e){switch(e.t){case`state`:if(C(e),(e.stage===`streaming`||e.stage===`loading`)&&P(e=>e+1),L.current!==void 0&&hn(e,L.current)){let n=L.current;L.current=void 0,(e.stage===`needs-approval`||e.stage===`server-exited`||e.stage===`server-stopped`)&&t?.send({t:`run`,port:n})}return;case`url`:return T(e.url);case`cursor`:return le(e.cursor);case`dialog`:return de(e);case`pong`:Ce.current=Math.max(0,Date.now()-e.ts);return;case`downloadProgress`:C(t=>t?.stage===`downloading`?{...t,received:e.received,total:e.total}:t);return;case`replaced`:x(e.by),V.current=!1,t?.close();return}},onTransport(e,n){V.current=e===`open`,v({state:e,attempt:n??0}),e===`open`&&(b(!0),I.current&&(t?.send({t:`open`,target:I.current,viewerId:d.current,resume:f.current,quality:R.current,dpr:l.current}),f.current=!0))}}),F.current=t,()=>{V.current=!1,t?.close(),F.current===t&&(F.current=void 0)}},[p,e.id,h]);let U=u&&_.state===`open`&&ee===void 0,W=m||me===`fit`?ge:me;(0,q.useEffect)(()=>{W&&U&&(S?.stage===`streaming`||S?.stage===`loading`)&&H({t:`resize`,w:W.w,h:W.h,...o===1?{}:{dpr:o}})},[W?.w,W?.h,o,U,S?.stage,be,H]),(0,q.useEffect)(()=>{if(!U)return;let e=setInterval(()=>H({t:`ping`,ts:Date.now()}),fn);return()=>clearInterval(e)},[U,H]);let G=U&&S?.stage===`streaming`;(0,q.useEffect)(()=>{if(!G){pe(void 0);return}let e=setInterval(()=>{let e=Date.now();B.current=B.current.filter(t=>e-t.at<=mn);let t={fps:B.current.length,kbps:Math.round(B.current.reduce((e,t)=>e+t.bytes,0)/1024),...Ce.current===void 0?{}:{rttMs:Ce.current},...B.current.length>0?{lastFrameAt:B.current.at(-1).at}:{}};pe(e=>{let n=t.lastFrameAt??e?.lastFrameAt,r={...t,...n===void 0?{}:{lastFrameAt:n}};return e&&e.fps===r.fps&&e.kbps===r.kbps&&e.rttMs===r.rttMs&&e.lastFrameAt===r.lastFrameAt?e:r})},pn);return()=>clearInterval(e)},[G]),(0,q.useEffect)(()=>(i?.(G),()=>i?.(!1)),[G,i]),(0,q.useEffect)(()=>{O&&r?.(O)},[O,r]);let K=(0,q.useCallback)((e,t,n=!1)=>{I.current=e,L.current=n&&`port`in e?e.port:void 0,ae(!0),C(void 0),x(void 0),N(void 0),T(t),te(`port`in e?e.port:void 0),D(`agent`in e),k(yn(e)),H({t:`open`,target:e,viewerId:d.current,quality:R.current,dpr:l.current}),f.current=V.current},[H]),Te=(0,q.useCallback)((e,n=!1)=>{let r=t.find(t=>t.port===e);K({port:e},r?_n(r):`http://localhost:${e}`,n)},[t,K]),Ee=(0,q.useCallback)(()=>K({agent:!0},``),[K]);(0,q.useEffect)(()=>{if(n?.agent){if(z.current.agent&&z.current.stage?.stage===`streaming`)return;Ee();return}if(n?.url!==void 0){let e=Ie(n.url,t);e.kind===`server`?Te(e.port):e.kind===`url`&&K({url:e.url},e.url);return}n?.port!==void 0&&(n.restored&&!t.some(e=>e.port===n.port)||z.current.port===n.port&&z.current.stage?.stage===`streaming`&&n.run!==!0||Te(n.port,n.run===!0))},[n]);let De=!ie&&!ee&&_.state!==`blocked`,Oe=vn(n,t);(0,q.useEffect)(()=>{De&&!Oe&&Se.current?.focus()},[De,Oe]);let ke=e=>{let n=Ie(e,t);if(n.kind===`error`)return N(n.message);if(n.kind===`server`)return Te(n.port);if(z.current.stage?.stage===`streaming`&&!z.current.agent)return I.current={url:n.url},L.current=void 0,te(void 0),k({url:n.url}),N(void 0),T(n.url),H({t:`nav`,url:n.url});K({url:n.url},n.url)},Ae=(0,q.useCallback)(e=>{R.current=e,he(e),Bt(e),H({t:`quality`,quality:e})},[H]),je=()=>{f.current=!1,x(void 0),v({state:`connecting`,attempt:0}),we.current=!1,g(e=>e+1)};return{compact:m,transport:_,everOpened:y,takenOver:ee,stage:S,url:w,port:E,agent:ne,hasFrame:oe,cursor:ce,dialog:ue,setDialog:de,stats:fe,viewport:me,setViewport:A,quality:j,chooseQuality:Ae,setStageSize:M,addressError:_e,stageHandle:xe,urlInput:Se,send:H,connected:U,streaming:G,openServer:Te,openAgent:Ee,empty:De,navigate:ke,reconnect:je,actions:(0,q.useMemo)(()=>({download:()=>H({t:`download`}),cancelDownload:()=>H({t:`cancelDownload`}),retryBrowser:()=>H({t:`retryBrowser`}),run:e=>H({t:`run`,port:e}),stop:e=>H({t:`stop`,port:e}),keepWaiting:e=>H({t:`keepWaiting`,port:e}),close:a,useHere:je,copy:gn}),[H,a])}}function xn(e){return(0,J.jsx)(he,{onClose:e.onClose,children:(0,J.jsx)(wn,{...e})})}function Sn(e,t,n,r){return e.state===`blocked`?{tone:`neutral`,label:`not supported`}:n?{tone:`neutral`,label:`paused`}:t&&(e.state===`reconnecting`||e.state===`closed`)?{tone:`danger`,label:`offline`}:e.state===`open`?r?Cn(r):void 0:{tone:`neutral`,label:`connecting…`}}function Cn(e){switch(e.stage){case`downloading`:return{tone:`pending`,label:`downloading`};case`download-failed`:return{tone:`danger`,label:`download failed`};case`sandbox-failed`:return{tone:`danger`,label:`browser failed`};case`browser-exited`:return{tone:`danger`,label:e.reason===`timeout`?`browser timed out`:`browser exited`};case`needs-approval`:return{tone:`neutral`,label:`not started`};case`port-held`:return{tone:`danger`,label:`port in use`};case`server-starting`:return{tone:`pending`,label:`waiting for :${e.server.port}`};case`server-stalled`:return{tone:`pending`,label:`waiting · 2 min`};case`server-exited`:return{tone:`danger`,label:`server exited`};case`server-stopped`:return{tone:`neutral`,label:`stopped`};case`agent-idle`:return{tone:`neutral`,label:`agent idle`};case`loading`:return{tone:`neutral`,label:`connecting…`};default:return}}function wn(e){let{run:t,servers:n,serverStates:r,agentLive:i,onSession:a,onClose:o}=e,s=bn(e),{compact:c,transport:l,everOpened:u,takenOver:d,stage:f,url:p,port:m,agent:h,hasFrame:g,stats:_,viewport:v,setViewport:y,quality:b,chooseQuality:ee,addressError:x,urlInput:S,send:C,streaming:w,openServer:T,openAgent:E,empty:te,navigate:ne,actions:re}=s,D=n.find(e=>e.port===m),O=f?.stage===`streaming`&&f.adopted,k=u&&(l.state===`reconnecting`||l.state===`closed`),{content:ie,dim:ae}=cn({transport:l.state,takenOver:d,empty:te,stage:f,hasFrame:g,lost:k,url:p,worktree:t.worktreePath}),oe=ln(ie,{servers:n,serverStates:r,agentLive:i,openServer:T,openAgent:E,actions:re});return(0,J.jsxs)(`section`,{"data-slot":`preview-pane-body`,"aria-label":`Live preview`,className:`flex h-full min-h-0 flex-col bg-background text-foreground`,children:[(0,J.jsx)(Zt,{url:p,servers:n,serverStates:r,badge:l.state!==`blocked`,current:D,agentLive:i===!0,agentShown:h,adopted:O,viewport:c?`fit`:v,quality:b,compact:c,navEnabled:w,loading:f?.stage===`loading`,stats:w?_??{fps:0,kbps:0}:void 0,status:w?void 0:Sn(l,u,d!==void 0,f),urlInputRef:S,onSession:a,onNavigate:ne,onBack:()=>C({t:`back`}),onForward:()=>C({t:`forward`}),onReload:e=>C({t:`reload`,...e?{ignoreCache:!0}:{}}),onPickServer:e=>T(e),onPickAgent:E,onViewport:y,onQuality:ee,onCopyUrl:()=>gn(p),onStop:e=>C({t:`stop`,port:e}),onClose:o}),x?(0,J.jsx)(`p`,{role:`alert`,className:`border-b border-border bg-card px-3 py-1.5 text-xs text-danger`,children:x}):null,(0,J.jsx)(Tn,{transportState:s,overlay:oe,dim:ae,lost:k})]})}function Tn({transportState:e,overlay:t,dim:n,lost:r}){let{connected:i,dialog:a,hasFrame:o,stage:s,stageHandle:c,compact:l,viewport:u,cursor:d,setStageSize:f,send:p,urlInput:m,transport:h,reconnect:g,setDialog:_}=e,v=s?.stage,y=i&&t===null&&!a;return(0,J.jsxs)(Pt,{ref:c,viewport:l?`fit`:u,dimmed:n&&o&&(v===`streaming`||v===`loading`||n),cursor:d,onSize:f,renderInput:e=>y?(0,J.jsx)(Mt,{scale:e.scale,send:p,onLeave:()=>m.current?.focus()}):null,children:[r?(0,J.jsx)(ut,{attempt:h.attempt,exhausted:h.state===`closed`,onReconnect:g}):null,t?(0,J.jsx)(`div`,{"data-slot":`preview-overlay`,className:n&&o?`absolute inset-0 overflow-auto bg-background/85`:`absolute inset-0 overflow-auto bg-background`,children:t}):null,a?(0,J.jsx)(ft,{dialog:a,onResult:e=>{_(void 0),p({t:`dialogResult`,...e})}}):null]})}function En(e){let{visibleEvents:t}=ge(e);return(0,q.useMemo)(()=>{let e=new Map;for(let n of E(t,{activeTurn:!1}).turns)for(let t of n.items)t.kind===`preview-server`&&e.set(t.server.port,t);return e},[t])}function Dn(e){let t=En(e.run.id),n=F(e.run.id);return(0,J.jsx)(xn,{...e,serverStates:t,agentLive:n})}export{Dn as ConnectedPreviewPane};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{C as t,b as n,h as r,m as i,p as a,w as o}from"./button-CHUAMTHK.js";import{i as s,t as c}from"./react-runtime-CCIEwYL0.js";import{r as l}from"./project-scope-context-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{C as t,b as n,h as r,m as i,p as a,w as o}from"./button-CHUAMTHK.js";import{i as s,t as c}from"./react-runtime-CCIEwYL0.js";import{r as l}from"./project-scope-context-B3M-u8R0.js";var u=e(s(),1),d=c(),f=/^\/p\/([^/]+)(?=\/|$)/;function p(e){let t=f.exec(e)?.[1];return t===void 0?null:decodeURIComponent(t)}function m(e){let t=f.exec(e);if(!t)return e;let n=e.slice(t[0].length);return n===``?`/`:n}function h(e,t){return!t.startsWith(`/`)||t===`/p`||t.startsWith(`/p/`)?t:`/p/${encodeURIComponent(e)}${t}`}function g(e,t){return e===null?t:typeof t==`string`?h(e,t):t.pathname===void 0?t:{...t,pathname:h(e,t.pathname)}}function _(){let{projectId:e}=l(),{pathname:n}=t();return e??p(n)}function v(){let e=_();return(0,u.useCallback)(t=>g(e,t),[e])}function y(){let{pathname:e}=t();return(0,u.useMemo)(()=>m(e),[e])}function b(e){let{pathname:r}=t();return(0,u.useMemo)(()=>n(e,m(r)),[e,r])}function x({to:e,...t}){let n=v();return(0,d.jsx)(a,{...t,to:n(e)})}function S({to:e,...t}){let n=v();return(0,d.jsx)(i,{...t,to:n(e)})}function C({to:e,...t}){let n=v();return(0,d.jsx)(r,{...t,to:n(e)})}function w(){let e=o(),t=v();return(0,u.useMemo)(()=>((n,r)=>typeof n==`number`?e(n):e(t(n),r)),[e,t])}export{g as a,w as c,p as i,b as l,S as n,m as o,C as r,_ as s,x as t,y as u};
|