@hearsay-tools/squawk 0.18.0-pr3501.6256.2 → 0.18.0-pr3505.6261

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/contract/index.js +492 -492
  2. package/dist/delegation/transport.d.ts +11 -11
  3. package/dist/runs/run-exits.d.ts +301 -301
  4. package/dist/workflows/input-acknowledgement.d.ts +24 -24
  5. package/package.json +4 -4
  6. package/web/dist/assets/activity-motion-yRfsq26m.js +2 -0
  7. package/web/dist/assets/{activity-route-CE2cYbQO.js → activity-route-CcjiDVlr.js} +1 -1
  8. package/web/dist/assets/agent-accounts-C14ohMG_.js +18 -0
  9. package/web/dist/assets/attention-D0CyU08o.js +1 -0
  10. package/web/dist/assets/{cez-idle-NomdGTfa.js → cez-idle-xv7f96fc.js} +1 -1
  11. package/web/dist/assets/{commit-diff-panel-DBrsQdXO.js → commit-diff-panel-C071yAQE.js} +1 -1
  12. package/web/dist/assets/{diff-D81T6FlH.js → diff-BnKrNzO6.js} +2 -2
  13. package/web/dist/assets/{diff-view-Sqk3iny_.js → diff-view-D6ljveL0.js} +1 -1
  14. package/web/dist/assets/{file-preview-CFvc38AT.js → file-preview-7ATj_IJp.js} +1 -1
  15. package/web/dist/assets/{git-toolbar-CZAj0VNk.js → git-toolbar-BSTMJPo4.js} +1 -1
  16. package/web/dist/assets/{github-Cdg3-sQK.js → github-Crr8_taH.js} +1 -1
  17. package/web/dist/assets/{global-activity-route-9DUVLRv0.js → global-activity-route-Dlg4nNjK.js} +1 -1
  18. package/web/dist/assets/{index-s7PhnzDS.js → index-DXc4Wqxm.js} +9 -9
  19. package/web/dist/assets/{live-protocol-DBPXI6ks.js → live-protocol-DjH6ZQwI.js} +1 -1
  20. package/web/dist/assets/{popover-G6KGT-qq.js → popover-C930d2dH.js} +1 -1
  21. package/web/dist/assets/{preview-pane-connected-DVlhmoyi.js → preview-pane-connected-B2qXE2AQ.js} +2 -2
  22. package/web/dist/assets/{project-router-BFKfAFvq.js → project-router-BRZW1N_s.js} +1 -1
  23. package/web/dist/assets/project-scope-context-WRT8Dvpw.js +4 -0
  24. package/web/dist/assets/{prompt-template-menu-D4-inlE4.js → prompt-template-menu-BksxTKqX.js} +1 -1
  25. package/web/dist/assets/queries-DdqJy71d.js +1 -0
  26. package/web/dist/assets/{reference-chip-Drpbf-MP.js → reference-chip-BHpiE7O2.js} +1 -1
  27. package/web/dist/assets/{repo-git-CwibBYwB.js → repo-git-2fklKmdO.js} +1 -1
  28. package/web/dist/assets/{report-reader-BdYHFEdw.js → report-reader-Dj9NU2fc.js} +1 -1
  29. package/web/dist/assets/reports-BE6wtSWw.js +1 -0
  30. package/web/dist/assets/{run-header-Dc5892Cu.js → run-header-B_aK7sJV.js} +2 -2
  31. package/web/dist/assets/skills-BFA2tySa.js +1 -0
  32. package/web/dist/assets/{tab-link-DDpdYMnv.js → tab-link-C87YL9QC.js} +1 -1
  33. package/web/dist/assets/{task-changes-CN0VE5bZ.js → task-changes-e6zjxrwH.js} +1 -1
  34. package/web/dist/assets/{task-commits-ycrhlORw.js → task-commits-CJHXztnJ.js} +1 -1
  35. package/web/dist/assets/{task-files-CjqaWaul.js → task-files-BK8Fhm1l.js} +1 -1
  36. package/web/dist/assets/{task-github-item-CezPgdB9.js → task-github-item-CJMKAWxL.js} +1 -1
  37. package/web/dist/assets/{task-thread-BfsMGE4k.js → task-thread-Cv_fZqYj.js} +6 -6
  38. package/web/dist/assets/{thread-state-B6Ar3fj6.js → thread-state-CPb3qK6B.js} +1 -1
  39. package/web/dist/assets/{use-hand-to-agent-state-BOTjwkGM.js → use-hand-to-agent-state-DladAj2W.js} +1 -1
  40. package/web/dist/assets/{useInfiniteQuery-BmfExLUr.js → useInfiniteQuery-Cn8aJj7F.js} +1 -1
  41. package/web/dist/assets/useQuery-CnaQ7qgN.js +1 -0
  42. package/web/dist/assets/{workflows-B32GiY9u.js → workflows-BT_I7xcp.js} +1 -1
  43. package/web/dist/assets/ws-netTapLq.js +1 -0
  44. package/web/dist/index.html +14 -14
  45. package/web/dist/live-worker.js +1 -1
  46. package/web/dist/assets/activity-motion-DjMpx0QL.js +0 -2
  47. package/web/dist/assets/agent-accounts-BNlpWTOY.js +0 -18
  48. package/web/dist/assets/attention-VmnPpwJx.js +0 -1
  49. package/web/dist/assets/project-scope-context-DSkcNKO7.js +0 -4
  50. package/web/dist/assets/queries-D2MPDhtr.js +0 -1
  51. package/web/dist/assets/reports-CWlWhffn.js +0 -1
  52. package/web/dist/assets/skills-B2Cc1jJi.js +0 -1
  53. package/web/dist/assets/useQuery-8pHkglP4.js +0 -1
  54. package/web/dist/assets/ws-CEQH0TUT.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 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<=7200||e.resume===!0&&e.kind===`request`,{path:[`timeoutSeconds`],message:`Only --resume requests accept deadlines above 7200 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(7200).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=K,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:W([`assistant`,`failure`]),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(7200).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(7200).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};
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<=7200||e.resume===!0&&e.kind===`request`,{path:[`timeoutSeconds`],message:`Only --resume requests accept deadlines above 7200 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(7200).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(),Fo=W([`queued`,`running`,`waiting`,`review`,`done`,`failed`,`cancelled`]),Io=W([`pending`,`running`,`waiting`,`review`,`done`,`failed`,`cancelled`,`skipped`]),Lo=W([`agent`,`check`]);function Ro(){return z({claude:N().optional(),codex:N().optional(),opencode:N().optional(),pi:N().optional(),cursor:N().optional(),omp:N().optional()})}var zo=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:Ro().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 Bo=z({accent:W([`cezarion`,`lime`,`violet`]).optional(),density:W([`comfortable`,`compact`,`ultra`]).optional(),width:W([`narrow`,`wide`]).optional()}),Vo=B({expandedColumns:U(N(),L()).optional()}),Ho=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 Uo(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=Ho.shape[e].safeParse(n[e]);r.success&&r.data!==void 0&&(t[e]=r.data)}return t}B({sidebarLimits:Ho.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(zo).max(200).optional(),skillUsage:U(N(),I()).optional(),runsView:W([`list`,`table`]).optional(),githubView:W([`issues`,`prs`]).optional(),appearance:Bo.optional(),promptTemplates:R(z({id:N(),label:N(),text:N(),skills:R(N()).optional()})).optional()});var Wo=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()}),Go=B({sidebar:B({collapsed:U(N(),L()).optional(),projectOrder:R(N()).optional()}).optional(),dismissedProviderAuthFailures:Ro().optional(),appearance:Bo.optional(),notifications:B({enabled:L().optional()}).optional(),taskTable:Vo.optional(),lastLocation:Wo.optional()}),Ko=200,qo=50;B({...Go.shape,sidebar:B({collapsed:U(N().min(1).max(64),L()).refine(e=>Object.keys(e).length<=Ko,{message:`sidebar.collapsed must have at most ${Ko} entries`}).optional(),projectOrder:R(N().min(1).max(64)).max(Ko).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:Vo.extend({expandedColumns:U(N().min(1).max(64),L()).refine(e=>Object.keys(e).length<=qo,{message:`taskTable.expandedColumns must have at most ${qo} entries`}).optional()}).optional()}).superRefine((e,t)=>{Object.keys(e).length>Ko&&t.addIssue({code:`custom`,message:`ui-state has too many keys (max ${Ko})`})});var Jo=Ro(),Yo=4e3,Xo=7200,Zo=z({commands:R(N().trim().min(1).max(Yo)).max(20),timeoutSeconds:I().int().min(1).max(Xo).optional()}).strict();z({archiveOnMerge:L().nullable(),effectiveArchiveOnMerge:L(),archiveOnMergeSource:W([`project`,`global`,`environment`,`default`]),baseBranch:N().nullable(),defaultRunner:K,systemPrompt:N().nullable(),defaultModels:Jo,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:Zo.nullable().optional()});var Qo=K,$o=z({provider:Qo,status:W([`connected`,`disconnected`,`not-installed`,`unknown`]),enabled:L().optional(),hint:N().optional(),authFailureId:N().optional(),profileId:N().optional()});z({providers:R($o)}),H(`opened`,[z({opened:G(!0),command:N()}),z({opened:G(!1),connected:G(!0),command:N()})]);var es=K,ts=es.options;function ns(e){return ts.includes(e)}var rs=z({id:N(),label:N(),description:N(),effortLevels:R(No).optional()}),is=z({runner:K,models:R(rs),source:W([`live`,`cache`,`unavailable`]),stale:L(),reason:N().optional()}),as=z({runner:es,requestedModel:N(),availableModels:R(rs),otherRunners:R(es)});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 os=W([`spawn`,`inspect`,`steer`,`stop`,`destroy`,`diff`,`wait`]),Y=N().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),ss=N().regex(/^[0-9a-f]{64}$/),cs=R(F()).min(1).max(32).refine(e=>new Set(e).size===e.length),ls=R(os).max(7).refine(e=>new Set(e).size===e.length),us=R(W([`process`,`worktree`,`branch`])).max(3).refine(e=>new Set(e).size===e.length),ds=N().max(2e3),fs=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(),ps=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:ps.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(),ms=Z.omit({deadline:!0,requestIds:!0,requestOutcomes:!0}).extend({via:G(`completion`)}).strict(),hs=z({attempts:I().int().positive(),nextAt:A(),needsAttention:G(!0).optional()}).strict(),gs=z({requestedAt:A(),phase:W([`requested`,`terminating`,`cleaning`,`complete`,`incomplete`]),remaining:us,error:ds.optional()}).strict(),_s=gs.extend({retry:hs.optional()}).strict(),vs=z({requestId:F(),workerId:F(),requestHash:ss,deletion:z({phase:W([`pending`,`complete`]),revision:I().int().nonnegative(),resourceId:F(),generation:F()}).strict().optional()}).strict(),ys=W(K.options),bs=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 xs(e){return e.split(`/`).at(-1)?.toLowerCase()===`.gitignore`?`--attach cannot attach a .gitignore: ${e}; ignore rules must come from the baseline`:void 0}var Ss=H(`kind`,[z({kind:G(`baseline-file`),path:bs}).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:bs}).strict().superRefine(({path:e},t)=>{let n=xs(e);n&&t.addIssue({code:`custom`,path:[`path`],message:n})})]),Cs=z({text:N().max(1e5).optional(),artifacts:R(Ss).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))}),ws=z({source:Ss,path:N().min(1).max(8192),sha256:ss,bytes:I().int().min(0).max(2**53-1)}).strict(),Ts=z({text:N().max(1e5).optional(),inputs:R(ws).max(32)}).strict(),Es=z({state:G(`unavailable`),reason:W([`no-assistant-output`,`missing`,`unreadable`,`unverified`]),detail:ds.optional()}).strict(),Ds=z({state:G(`deleted`),reason:G(`missing`)}).strict(),Os=W([`running`,`review-ready`,`completed`,`failed`,`cancelled`]),ks=H(`state`,[z({state:G(`available`),id:N().max(255),path:N().max(8192)}).strict(),Es.extend({id:N().max(255),path:N().max(8192)}),Ds.extend({id:N().max(255),path:N().max(8192)})]);z({result:z({workerId:F(),parentRunId:F(),revision:I().int().nonnegative(),observedAt:A(),status:Fo,outcome:W([`running`,`review-ready`,`completed`,`failed`,`cancelled`,`destroyed`]),lastExecutionOutcome:Os,partial:L(),settled:L(),error:ds.optional(),backend:ys.optional(),model:N().max(512).optional(),baselineSha:Y,workspace:fs.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:W([`assistant`,`failure`]),seq:I().int().nonnegative(),truncated:L()}).strict(),Es,Ds]),head:H(`state`,[z({state:G(`available`),sha:Y}).strict(),Es.extend({sha:Y.optional()}),Ds.extend({sha:Y.optional()})]),diff:H(`state`,[z({state:G(`available`),snapshotId:F(),path:N().min(1).max(8192),truncated:L()}).strict(),Es,Ds]),artifacts:H(`state`,[z({state:G(`available`),items:R(ks).max(32),truncated:L()}).strict(),Es,Ds])}).strict(),diffSnapshot:N().max(4e5).optional()}).strict();var As=z({workerId:F(),revision:I().int().nonnegative(),snapshotId:F(),observedAt:A(),lastExecutionOutcome:Os,previous:z({revision:I().int().nonnegative(),observedAt:A(),lastExecutionOutcome:Os}).strict().optional()}).strict(),js=H(`role`,[z({role:G(`root`),conversation:Ao.optional(),permissions:ls,receipts:R(vs).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(As).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:ls,parentRunId:F(),workspace:fs,destroy:gs.optional(),context:Ts.optional(),executionRevision:I().int().nonnegative().optional(),executionStartSeq:I().int().nonnegative().optional()}).strict(),z({role:G(`invalid`)}).strict()]),Ms=H(`role`,[js.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()}),js.options[1].pick({role:!0,parentRunId:!0}).strip().extend({wait:Z.pick({phase:!0,requestIds:!0}).strip().optional()}),js.options[2].strip()]);z({task:N().min(1).max(1e5),baseline:N().min(1).max(1024),requestId:F(),context:Cs.optional(),backend:ys.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:cs,timeoutSeconds:I().int().min(1).max(7200).default(600),mode:ps.optional()}).strict().refine(e=>e.mode!==`one`||e.workerIds.length===1,{message:`one mode requires exactly one worker`});var Ns=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(),Ps=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:Ns.optional(),purpose:W([`completion-refusal`,`undelivered-question`]).optional(),requestHash:N().regex(/^[0-9a-f]{64}$/).optional(),deadline:A().optional()}).strict(),Fs=z({workerId:F(),parentRunId:F(),status:W([`queued`,`running`,`waiting`,...X.shape.status.options]),currentStepId:N().optional(),workspace:fs,backend:ys.optional(),model:N().max(512).optional(),inputs:R(ws).max(32).optional(),wait:Z.optional(),completionWait:ms.optional(),destroy:_s.optional(),outcome:X.optional()}),Is=Fs.pick({workerId:!0,parentRunId:!0,status:!0,workspace:!0,destroy:!0}).extend({revision:I().int().nonnegative(),settled:L(),destroyed:L()}).strict(),Ls=z({workers:R(Is).max(1024)}).strict();z({offset:N().regex(/^\d{1,4}$/).refine(e=>Number(e)<=1024).optional()}).strict(),Ls.extend({workers:R(Is).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:us,error:ds.optional()});var Rs=z({outstanding:I().int().nonnegative(),limit:I().int().nonnegative(),created:I().int().nonnegative(),creationLimit:I().int().nonnegative()}).strict(),zs=z({id:N(),title:N(),titleSummary:N().optional(),titleOrigin:W([`user`,`auto`,`marker`]).optional()}),Bs=z({parentRunId:F().optional(),workers:R(Fs).max(1024),titles:R(zs).max(1025).optional(),capacity:Rs.optional()});z({code:W([`unavailable_transport`,`unauthenticated`,`denied_scope`,`invalid_input`,`invalid_baseline`,`incompatible_state`,`capacity_limit`,`unavailable_diff`,`incomplete_cleanup`]),error:ds,modelChoices:as.optional()}),z({workerId:F()}).strict(),z({workerId:F(),baselineSha:Y}).strict(),z({workerId:F(),state:W([`queued`,`delivered`])}).strict();var Vs=z({wait:Z,instruction:N().min(1).max(1e3)}).strict();z({}).strict(),z({waitId:F()}).strict();var Hs=z({wait:Z}).strict();z({peerIds:cs,timeoutSeconds:I().int().min(1).max(7200).default(600)}).strict();var Us=H(`reason`,[z({reason:G(`message`),peerRunId:F(),messageId:F()}).strict(),z({reason:G(`settled`),peerRunId:F()}).strict(),z({reason:G(`timeout`)}).strict()]);function Ws(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 Gs=z({id:F(),peerIds:cs,deadline:A(),phase:W([`open`,`resolved`,`delivered`,`cancelled`]),result:Us.optional()}).strict().superRefine(Ws),Ks=z({wait:Gs,instruction:N().min(1).max(1e3)}).strict(),qs=z({wait:Gs}).strict();V([Vs,Ks]),V([Hs,qs]);var Q=B({seq:I(),ts:N(),stepId:N().optional(),type:N()}),Js=Q.extend({type:G(`conversation-message`),message:ko,delivery:W([`queued`,`delivered`,`consumed`,`not-delivered`]),deliveredAt:A().optional(),consumedAt:A().optional()}),Ys=Q.extend({type:G(`request-outcome`),outcome:J}),Xs=Q.extend({type:G(`agent-input`),input:Ps}),Zs=Q.extend({type:G(`human-input-delivered`),askSeq:I().int().nonnegative(),source:W([`human`,`parent`,`cezar`]).optional()}),Qs=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 $s=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 ec=z({seq:I(),ts:N(),stepId:N().optional(),type:N()}).catchall(Na()),tc=z({events:R(ec),itemCount:I().int().min(0).max(100),olderCursor:$.optional(),newerCursor:$.optional(),liveCursor:$,asOfSeq:I().int().nonnegative(),hasOlder:L()}),nc=z({contextEvents:R(ec),asOfSeq:I().int().nonnegative()}),rc=z({checkoutId:N().optional(),name:N(),phase:W([`cloning`,`done`,`error`]),line:N().optional(),error:N().optional(),warning:N().optional()}),ic=1024*1024,ac=z({projectId:N().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/),runId:$s.shape.id,cursor:$.optional(),afterSeq:I().int().nonnegative().safe()});z({runs:R(ac).min(1).max(32)}).refine(({runs:e})=>new Set(e.map(e=>`${e.projectId}/${e.runId}`)).size===e.length,{message:`duplicate run demand`});var oc=ac.pick({projectId:!0,runId:!0}),sc=oc.extend({type:W([`error`,`reset`]),status:V([G(400),G(404),G(409),G(413),G(503)]),error:N()}),cc=V([oc.extend({type:G(`batch`),events:R(ec).max(256),cursor:$,afterSeq:I().int().nonnegative(),hasMore:L()}),sc]),lc=z({generation:N(),results:R(cc)}),uc=V([z({type:G(`ready`),generation:N()}),z({type:G(`ping`)}),oc.extend({type:G(`event`),name:W([`run-event`,`ui-event`]),event:ec}),sc]),dc=`cezar-live-v3`,fc=15e3,pc=5e3;function mc(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 hc=H(`kind`,[z({kind:G(`workspace`)}),ac.extend({kind:G(`run`)}),z({kind:G(`topic`),topic:N().min(1).max(128)}),z({kind:G(`read`),path:N().max(4096).refine(mc),intervalMs:I().int().min(1e3).max(2147483647)})]),gc=z({id:N().min(1).max(128),demand:hc}),_c=z({version:G(3),documentId:N().min(1).max(128),epoch:I().int().nonnegative()}),vc=H(`type`,[_c.extend({type:G(`sync`),entries:R(gc).max(64),workspaceReady:G(!0).optional()}).refine(e=>new Set(e.entries.map(e=>e.id)).size===e.entries.length),_c.extend({type:G(`ack`),id:N(),seq:I().int().nonnegative()}),_c.extend({type:G(`refresh`),id:N()})]),yc=z({event:N(),data:N(),id:N()}),bc=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([yc,uc])}),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()})]),xc=e=>`${e.projectId}/${e.runId}`;export{H as $,ps as A,Ro as B,Us as C,hs as D,Bs as E,$o as F,Co as G,Lo as H,ns as I,So as J,Eo as K,is as L,Xo as M,Uo as N,cs as O,Qo as P,L as Q,Ho as R,js as S,Ms as T,Io as U,Fo as V,J as W,ja as X,W as Y,R as Z,Ys as _,hc as a,U as at,$s as b,xc as c,Fa as ct,ic as d,A as dt,G as et,Xs as f,a as ft,Zs as g,Qs as h,mc as i,yo as it,Yo as j,X as k,lc as l,ua as lt,Js as m,dc as n,I as nt,vc as o,N as ot,rc as p,t as pt,K as q,pc as r,z as rt,bc as s,V as st,fc as t,La as tt,uc as u,F as ut,nc as v,Ws as w,Ps as x,tc as y,zo as z};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,s as n,u as r}from"./button-CS5tOblf.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{Bn as o,Fn as s,Wn as c,ar as l}from"./project-scope-context-DSkcNKO7.js";import{N as u}from"./live-protocol-DBPXI6ks.js";import"./queries-D2MPDhtr.js";import{t as d}from"./createLucideIcon-BHp8sXmF.js";import{a as f,d as p,h as m,i as ee,l as te,m as ne,n as re,o as ie,p as h,r as ae,t as oe,u as g}from"./es2015-CX0rgbM5.js";import{_,b as se,v as ce,x as le,y as ue}from"./dropdown-menu-D7f0O7xR.js";import"./attention-VmnPpwJx.js";function de(e){if(e.workflow===`(planned)`||e.workflow===`(inbox)`){let t=(e.steps??[]).find(e=>e.kind===`agent`);if(t?.name)return t.name}return e.workflow}var fe=d(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),v=e(i(),1),y=a(),b=`Popover`,[x,pe]=ne(b,[le]),S=le(),[me,C]=x(b),w=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=S(t),c=v.useRef(null),[l,u]=v.useState(!1),[d,f]=p({prop:r,defaultProp:i??!1,onChange:a,caller:b});return(0,y.jsx)(se,{...s,children:(0,y.jsx)(me,{scope:t,contentId:te(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:v.useCallback(()=>u(!0),[]),onCustomAnchorRemove:v.useCallback(()=>u(!1),[]),modal:o,children:n})})};w.displayName=b;var T=`PopoverAnchor`,E=v.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=C(T,n),a=S(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return v.useEffect(()=>(o(),()=>s()),[o,s]),(0,y.jsx)(_,{...a,...r,ref:t})});E.displayName=T;var D=`PopoverTrigger`,O=v.forwardRef((e,t)=>{let{__scopePopover:r,...i}=e,a=C(D,r),o=S(r),s=n(t,a.triggerRef),c=(0,y.jsx)(m.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":F(a.open),...i,ref:s,onClick:h(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:(0,y.jsx)(_,{asChild:!0,...o,children:c})});O.displayName=D;var k=`PopoverPortal`,[he,ge]=x(k,{forceMount:void 0}),A=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=C(k,t);return(0,y.jsx)(he,{scope:t,forceMount:n,children:(0,y.jsx)(g,{present:n||a.open,children:(0,y.jsx)(ee,{asChild:!0,container:i,children:r})})})};A.displayName=k;var j=`PopoverContent`,M=v.forwardRef((e,t)=>{let n=ge(j,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=C(j,e.__scopePopover);return(0,y.jsx)(g,{present:r||a.open,children:a.modal?(0,y.jsx)(ve,{...i,ref:t}):(0,y.jsx)(ye,{...i,ref:t})})});M.displayName=j;var _e=t(`PopoverContent.RemoveScroll`),ve=v.forwardRef((e,t)=>{let r=C(j,e.__scopePopover),i=v.useRef(null),a=n(t,i),o=v.useRef(!1);return v.useEffect(()=>{let e=i.current;if(e)return oe(e)},[]),(0,y.jsx)(re,{as:_e,allowPinchZoom:!0,children:(0,y.jsx)(N,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:h(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||r.triggerRef.current?.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;o.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:h(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),ye=v.forwardRef((e,t)=>{let n=C(j,e.__scopePopover),r=v.useRef(!1),i=v.useRef(!1);return(0,y.jsx)(N,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),N=v.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,p=C(j,n),m=S(n);return ae(),(0,y.jsx)(f,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,y.jsx)(ie,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,y.jsx)(ue,{"data-state":F(p.open),role:`dialog`,id:p.contentId,...m,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),P=`PopoverClose`,be=v.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=C(P,n);return(0,y.jsx)(m.button,{type:`button`,...r,ref:t,onClick:h(e.onClick,()=>i.onOpenChange(!1))})});be.displayName=P;var xe=`PopoverArrow`,Se=v.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=S(n);return(0,y.jsx)(ce,{...i,...r,ref:t})});Se.displayName=xe;function F(e){return e?`open`:`closed`}var Ce=w,we=E,Te=O,Ee=A,De=M;function I(e){return l(e)?!1:e.status===`queued`||e.status===`running`||e.status===`waiting`}function Oe(e){return I(e)&&e.status!==`queued`}function L(e,t,n){return e.archived||!(e.status===`done`||e.status===`failed`||e.status===`cancelled`)||e.delegation?.role===`worker`||n!==void 0&&c(e)!==n?!1:t===`unpinned`?!e.pinned:t!==`pinned`||e.pinned===!0}var ke=[`done`,`failed`];function R(e){return e.archived||l(e)||!ke.includes(e.status)?!1:e.finishedAt!==void 0}function Ae(e){let t=e.finishedAt;return t===void 0||!R(e)?!1:e.seenAt===void 0||e.seenAt<t}var z=[`Needs you`,`Finished`,`Working`,`Archived`],je={waiting:0,review:1,running:2,queued:4,done:5,failed:6,cancelled:7},Me=3,B=e=>l(e)?Me:je[e.status]??9;function Ne(e){let t=e=>s[o(e).bucket];return[...e].sort((e,n)=>t(e)-t(n)||B(e)-B(n))[0]}function V(e,t){return t===`archived`?`Archived`:o(e).bucket===`waiting`?`Needs you`:e.status===`waiting`||e.status===`running`||e.status===`queued`?`Working`:`Finished`}function H(e){let t=e.titleSummary;return t===void 0||!(e.titleOrigin===`user`||e.titleOrigin===`marker`)&&/[.!?][A-Z]/.test(t)?e.title:t}function U(e){let t=/^(\d{1,9}): (.+)$/.exec(e),n=t?.[1],r=t?.[2];return n===void 0||r===void 0?{ref:null,rest:e}:{ref:Number(n),rest:r}}function Pe(e,t){return t!==void 0&&U(e).ref===t}function W(e){let t=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt));return new Map(t.map((e,t)=>[e.id,t+1]))}function G(e,t){return e.filter(e=>t===`archived`?e.archived:!e.archived).sort((e,n)=>{if(t!==`archived`){let t=Number(!!n.pinned)-Number(!!e.pinned);if(t!==0)return t}let r=B(e)-B(n);if(r!==0)return r;if(l(e)&&l(n)){let t=e.autoResumeAt.localeCompare(n.autoResumeAt);if(t!==0)return t}return e.status===`queued`&&n.status===`queued`?e.createdAt.localeCompare(n.createdAt):n.createdAt.localeCompare(e.createdAt)})}function K(e){return e.delegation?.role===`worker`}function Fe(e,t){if(e==null)return null;let n=t.find(t=>t.id===e);return!n||!K(n)?e:n.delegation?.parentRunId??e}function Ie(e,t,n=W(e)){let r=G(e,t).filter(e=>!K(e)),i=new Map,a=(e,t)=>{let n=i.get(e);n?n.push(t):i.set(e,[t])};for(let e of r)a(V(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null});return z.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function Le(e,t={}){let n=typeof t==`number`?{overall:t}:u(t),r={"Needs you":`needsYou`,Finished:`finished`,Working:`working`},i=[],a=n.overall===void 0?10:n.overall??1/0;for(let t of e){let e=t.label===`Archived`?1/0:n[r[t.label]]??1/0,o=t.rows.filter(n=>{let r=n.run.pinned;return t.label!==`Archived`&&r?!0:a<=0||e<=0?!1:(--a,--e,!0)});o.length&&i.push({label:t.label,rows:o})}return i}function Re(e,t){if(t.length===0)return[...e];let n=new Set(e.map(e=>e.id)),r=new Set,i=t.filter(e=>n.has(e.id)||r.has(e.id)?!1:(r.add(e.id),!0));return[...e,...i]}function ze(e){let t=0,n=0,r=0;for(let i of e)if(!K(i)){if(i.archived){n+=1;continue}t+=1,o(i).bucket===`waiting`&&(r+=1)}return{active:t,archived:n,waiting:r}}function Be(e,t){let n=t===`automations`;return e.filter(e=>!e.archived&&c(e)===n)}var q={"Needs you":`needs-you`,Finished:`finished`,Working:`working`},Ve=Object.keys(q),He=`section`;function Ue(e,t){return`/?origin=${t===`automations`?`automations`:`direct`}&${He}=${q[e]}`}function We(e){return Ve.find(t=>q[t]===e)??null}function Ge(e){let t={active:0,automations:0,activeWaiting:0,automationsWaiting:0};for(let n of e){if(K(n)||n.archived)continue;let e=+(o(n).bucket===`waiting`);c(n)?(t.automations+=1,t.automationsWaiting+=e):(t.active+=1,t.activeWaiting+=e)}return t}function J(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function Ke(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=J(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(J(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function qe(e){let t=e.visualViewport;return t?{top:Math.max(0,Math.round(t.offsetTop)),bottom:J(e)}:{top:0,bottom:0}}function Je(e,t=0){let n=typeof t==`number`?{top:t,right:t,bottom:t,left:t}:t;return{top:(n.top??0)+e.top,right:n.right??0,bottom:(n.bottom??0)+e.bottom,left:n.left??0}}function Ye(e,t){let n=e.visualViewport;if(!n)return t({top:0,bottom:0}),()=>{};let r=()=>t(qe(e));return r(),n.addEventListener(`resize`,r),n.addEventListener(`scroll`,r),()=>{n.removeEventListener(`resize`,r),n.removeEventListener(`scroll`,r)}}function Xe(){let[e,t]=(0,v.useState)({top:0,bottom:0});return(0,v.useEffect)(()=>Ye(window,e=>t(t=>t.top===e.top&&t.bottom===e.bottom?t:e)),[]),e}function Ze(e){let t=(0,v.useRef)(e);t.current=e,(0,v.useEffect)(()=>{let e=document.documentElement;return Ke(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}var Qe=new Set([``,`text`,`search`,`email`,`url`,`tel`,`password`,`number`]);function $e(e){if(!e||typeof e!=`object`)return!1;let t=e,n=t.tagName?.toUpperCase();return n===`TEXTAREA`?!0:n===`INPUT`?Qe.has((t.type??``).toLowerCase()):t.isContentEditable===!0}var et=new WeakMap;function tt(e){let t=et.get(e),n=t&&t.width===e.innerWidth?Math.max(t.height,e.innerHeight):e.innerHeight;return et.set(e,{width:e.innerWidth,height:n}),n-e.innerHeight}function nt(e){let t=tt(e),n=e.visualViewport?.scale??1;return Math.abs(n-1)<.05&&J(e)>80||t>80&&$e(e.document?.activeElement)}function rt(){let[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=window,n=()=>t(nt(e));n();let r=e.visualViewport;return r?.addEventListener(`resize`,n),r?.addEventListener(`scroll`,n),window.addEventListener(`resize`,n),document.addEventListener(`focusin`,n),document.addEventListener(`focusout`,n),()=>{r?.removeEventListener(`resize`,n),r?.removeEventListener(`scroll`,n),window.removeEventListener(`resize`,n),document.removeEventListener(`focusin`,n),document.removeEventListener(`focusout`,n)}},[]),e}function it(e){let t=/\/(\d+)\/?$/.exec(e.trim()),n=t?Number(t[1]):NaN;return Number.isInteger(n)&&n>0?n:null}function at(e){let t=new Set;for(let n of[e.pullRequestUrl,e.referencedPullRequestUrl,e.referencedIssueUrl]){let e=n?it(n):null;e!==null&&t.add(e)}for(let n of[e.prNumber,e.issueNumber,e.markerRefs?.pr,e.markerRefs?.issue])typeof n==`number`&&Number.isInteger(n)&&n>0&&t.add(n);for(let n of e.pullRequests??[])t.add(n.number);return[...t]}var ot=[{id:`title`,kind:`text`,scopes:[`stored`],source:`summary`,texts:e=>[e.title]},{id:`titleSummary`,kind:`text`,scopes:[`stored`],source:`summary`,texts:e=>[e.titleSummary]},{id:`displayTitle`,kind:`text`,scopes:[`shown`],source:`reader`,texts:(e,t)=>[t.displayTitle]},{id:`branch`,kind:`text`,scopes:[`stored`,`shown`],source:`summary`,texts:e=>[e.branch]},{id:`workflow`,kind:`text`,scopes:[`stored`,`shown`],source:`summary`,texts:e=>[e.workflow]},{id:`workflowLabel`,kind:`text`,scopes:[`stored`,`shown`],source:`summary`,texts:e=>[e.workflowLabel]},{id:`automation`,kind:`text`,scopes:[`stored`,`shown`],source:`reader`,texts:(e,t)=>[t.automation],universe:e=>[...e.automationNames?.values()??[]]},{id:`projectName`,kind:`text`,scopes:[`shown`],source:`reader`,texts:(e,t)=>[t.projectName]},{id:`tags`,kind:`text`,scopes:[`shown`],source:`reader`,texts:(e,t)=>t.tags??[]},{id:`id`,kind:`identifier`,scopes:[`stored`],source:`summary`,texts:e=>[e.id]},{id:`urls`,kind:`link`,scopes:[`stored`],source:`summary`,texts:e=>[e.pullRequestUrl,e.referencedPullRequestUrl,e.referencedIssueUrl,...(e.pullRequests??[]).map(e=>e.url)]},{id:`heldReferences`,kind:`reference`,scopes:[`stored`],source:`summary`,numbers:at},{id:`shownReferences`,kind:`reference`,scopes:[`shown`],source:`reader`,numbers:(e,t)=>t.references?.()??[]}];function st(e){return e.trim().toLowerCase().split(/\s+/).filter(e=>e!==``)}function ct(e,t){if(t!==`phrase`)return st(e);let n=e.trim().toLowerCase();return n===``?[]:[n]}function lt(e,t){return t&&e.automationId!==void 0?t.get(e.automationId)??e.automationId:void 0}function ut(e,t){let n=t.scope??`stored`,r=t.scope===`shown`?t.omit??[]:[],i=t.scope===`shown`?t.extras:{automation:lt(e,t.automationNames)},a=[],o=[],s=[],c={text:a,identifier:o,link:s},l=[];for(let t of ot)if(!(!t.scopes.includes(n)||r.includes(t.id))){if(t.kind===`reference`){l.push(()=>t.numbers(e,i));continue}for(let n of t.texts(e,i))typeof n==`string`&&c[t.kind].push(n.toLowerCase())}let u;return{prose:a,ids:o,links:s,references:()=>u??=new Set(l.flatMap(e=>e().map(String)))}}function dt(e,t,n={}){let r=ct(t,n.mode);if(r.length===0)return!1;let{prose:i,ids:a,links:o,references:s}=ut(e,n);return r.every(e=>{if(i.some(t=>t.includes(e)))return!0;let t=e.replace(/^#/,``);return/^\d+$/.test(t)?s().has(String(Number(t)))||a.some(e=>e.startsWith(t)):a.some(t=>t.includes(e))||o.some(t=>t.includes(e))})}var ft=new Set([`running`,`waiting`]);function Y(e){return e?e>=1024**3?`${(e/1024**3).toFixed(1)} GB`:e>=1024**2?`${Math.round(e/1024**2)} MB`:`${Math.round(e/1024)} kB`:``}function pt(e){return e===void 0?``:`$${e>=10?e.toFixed(0):e.toFixed(2)}`}function mt(e,t=new Date){if(!l(e))return;let n=new Date(e.autoResumeAt);if(!Number.isFinite(n.getTime()))return;let r=n.toDateString()===t.toDateString(),i=new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(n);return{label:r?i:`${new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(n)} ${i}`,title:`Resumes automatically at ${new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(n)}`}}function ht(e){return e.steps?de({workflow:e.workflow,steps:e.steps}):e.workflowLabel??e.workflow}function gt(e,t,n=()=>``){let r=e.filter(e=>!K(e));return t.trim()?r.filter(e=>dt(e,t,{scope:`shown`,mode:`phrase`,extras:{displayTitle:H(e),automation:n(e),references:()=>_t(e)}})):[...r]}function _t(e){return X(e).map(e=>e.number)}function vt(e,t){return e.filter(e=>L(e,t)).length}function yt(e){return vt(e)}function bt(e){return xt(e)[0]??e.pullRequests?.find(e=>e.url)?.url}function xt(e){let t=[];return e.pullRequestUrl&&t.push(e.pullRequestUrl),!(e.markerRefs?.issue!==void 0&&e.markerRefs?.pr===void 0)&&e.referencedPullRequestUrl&&t.push(e.referencedPullRequestUrl),t}function St(e,t){if(e.referencedIssueUrl)return e.referencedIssueUrl;let n=e.issueNumber??e.markerRefs?.issue;if(!(!n||!t))return`${t}/issues/${n}`}function Ct(e){let t=`${e.kind}#${e.number}`;if(!e.url)return`${t}@project:${e.projectId??`default`}`;try{let n=new URL(e.url),r=n.pathname.split(`/`).filter(Boolean).slice(0,2).join(`/`);return`${t}@${n.host.toLowerCase()}/${r.toLowerCase()}`}catch{return`${t}@${e.url}`}}function X(e,t,n=e.projectId){let r=xt(e),i=e.markerRefs?.pr,a=[...i===void 0||[...r,...(e.pullRequests??[]).flatMap(e=>e.url?[e.url]:[])].some(e=>Q(e)===String(i))?[]:[{kind:`PR`,number:i}],...r.map(e=>({kind:`PR`,url:e})),{kind:`PR`,number:e.prNumber},...(e.pullRequests??[]).map(e=>({kind:`PR`,number:e.number,...e.url?{url:e.url}:{},authoritative:!0})),{kind:`Issue`,url:St(e,t)},{kind:`Issue`,number:e.issueNumber}],o=new Set,s=[];for(let e of a){let r=e.url?Number(Q(e.url)):e.number;if(!r||!Number.isInteger(r)||!e.url&&!e.authoritative&&s.some(t=>t.url&&t.kind===e.kind&&t.number===r))continue;let i=e.url??wt(e.kind,r,t),a={kind:e.kind,number:r,...i?{url:i}:n===void 0?{}:{projectId:n}},c=Ct(a);o.has(c)||(o.add(c),s.push(a))}return s}function wt(e,t,n){if(n)return`${n}/${e===`PR`?`pull`:`issues`}/${t}`}function Tt(e){return X(e)[0]}function Z(e,t){if(!e.url)return!0;if(!t)return!1;let n=Et(t);return n!==void 0&&Et(e.url)===n}function Et(e){try{let t=new URL(e),[n,r]=t.pathname.split(`/`).filter(Boolean);return n&&r?`${t.host}/${n}/${r}`.toLowerCase():void 0}catch{return}}function Dt(e,t){let n=[];for(let r of X(e,t)){if(!Z(r,t))continue;let e=r.kind===`PR`?`pr`:`issue`;n.some(t=>t.kind===e&&t.number===r.number)||n.push({kind:e,number:r.number})}return n}function Ot(e,t,n,r){if(Z(n,r))return`/p/${e}/tasks/${t}/${n.kind===`PR`?`pr`:`issue`}/${n.number}`}function Q(e){return/\/(\d+)\/?(?:[?#].*)?$/.exec(e)?.[1]??null}function kt(e,t){let n=ft.has(e.status)?t:void 0;if(n)return{cpu:{text:`${n.cpuPct.toFixed(0)}%`,kind:`live`},mem:{text:Y(n.rssBytes),kind:`live`}};let r=Y(e.peakRssBytes);return{cpu:{text:``,kind:`none`},mem:r?{text:`peak ${r}`,kind:`peak`,title:`peak — run finished${e.peakProcCount?` · ${e.peakProcCount} procs`:``}`}:{text:``,kind:`none`}}}var $=v.createContext(null);function At({...e}){let t=v.useRef(!1);return(0,y.jsx)($,{value:t,children:(0,y.jsx)(Ce,{"data-slot":`popover`,...e})})}function jt({onPointerDownCapture:e,onKeyDownCapture:t,...n}){let r=v.useContext($);return(0,y.jsx)(Te,{"data-slot":`popover-trigger`,...n,onPointerDownCapture:t=>{r&&(r.current=t.pointerType===`touch`),e?.(t)},onKeyDownCapture:e=>{r&&(r.current=!1),t?.(e)}})}function Mt({className:e,align:t=`center`,sideOffset:n=4,collisionPadding:i,onOpenAutoFocus:a,...o}){let s=Xe(),c=v.useContext($);return(0,y.jsx)(Ee,{children:(0,y.jsx)(De,{"data-slot":`popover-content`,align:t,sideOffset:n,onOpenAutoFocus:e=>{let t=c?.current;if(c&&(c.current=!1),a?.(e),e.defaultPrevented||!t)return;let n=e.target;n instanceof HTMLElement&&n.querySelector(`[cmdk-input]`)&&(e.preventDefault(),n.focus({preventScroll:!0}))},collisionPadding:Je(s,i),className:r(`z-50 w-72 max-w-(--radix-popover-content-available-width) [overflow-wrap:anywhere] origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...o})})}function Nt({...e}){return(0,y.jsx)(we,{"data-slot":`popover-anchor`,...e})}export{Le as A,Fe as B,dt as C,He as D,z as E,We as F,Re as G,Be as H,W as I,Oe as J,R as K,Pe as L,K as M,ze as N,Ve as O,Ne as P,H as R,ht as S,rt as T,G as U,Ge as V,U as W,Ae as X,L as Y,fe as Z,Dt as _,gt as a,X as b,Y as c,Ct as d,mt as f,Ot as g,St as h,jt as i,Ie as j,V as k,Z as l,vt as m,Nt as n,yt as o,_t as p,I as q,Mt as r,pt as s,At as t,Q as u,bt as v,Ze as w,kt as x,Tt as y,Ue as z};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,s as n,u as r}from"./button-CS5tOblf.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{Bn as o,Fn as s,Wn as c,ar as l}from"./project-scope-context-WRT8Dvpw.js";import{N as u}from"./live-protocol-DjH6ZQwI.js";import"./queries-DdqJy71d.js";import{t as d}from"./createLucideIcon-BHp8sXmF.js";import{a as f,d as p,h as m,i as ee,l as te,m as ne,n as re,o as ie,p as h,r as ae,t as oe,u as g}from"./es2015-CX0rgbM5.js";import{_,b as se,v as ce,x as le,y as ue}from"./dropdown-menu-D7f0O7xR.js";import"./attention-D0CyU08o.js";function de(e){if(e.workflow===`(planned)`||e.workflow===`(inbox)`){let t=(e.steps??[]).find(e=>e.kind===`agent`);if(t?.name)return t.name}return e.workflow}var fe=d(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),v=e(i(),1),y=a(),b=`Popover`,[x,pe]=ne(b,[le]),S=le(),[me,C]=x(b),w=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=S(t),c=v.useRef(null),[l,u]=v.useState(!1),[d,f]=p({prop:r,defaultProp:i??!1,onChange:a,caller:b});return(0,y.jsx)(se,{...s,children:(0,y.jsx)(me,{scope:t,contentId:te(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:v.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:v.useCallback(()=>u(!0),[]),onCustomAnchorRemove:v.useCallback(()=>u(!1),[]),modal:o,children:n})})};w.displayName=b;var T=`PopoverAnchor`,E=v.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=C(T,n),a=S(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return v.useEffect(()=>(o(),()=>s()),[o,s]),(0,y.jsx)(_,{...a,...r,ref:t})});E.displayName=T;var D=`PopoverTrigger`,O=v.forwardRef((e,t)=>{let{__scopePopover:r,...i}=e,a=C(D,r),o=S(r),s=n(t,a.triggerRef),c=(0,y.jsx)(m.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":F(a.open),...i,ref:s,onClick:h(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:(0,y.jsx)(_,{asChild:!0,...o,children:c})});O.displayName=D;var k=`PopoverPortal`,[he,ge]=x(k,{forceMount:void 0}),A=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=C(k,t);return(0,y.jsx)(he,{scope:t,forceMount:n,children:(0,y.jsx)(g,{present:n||a.open,children:(0,y.jsx)(ee,{asChild:!0,container:i,children:r})})})};A.displayName=k;var j=`PopoverContent`,M=v.forwardRef((e,t)=>{let n=ge(j,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=C(j,e.__scopePopover);return(0,y.jsx)(g,{present:r||a.open,children:a.modal?(0,y.jsx)(ve,{...i,ref:t}):(0,y.jsx)(ye,{...i,ref:t})})});M.displayName=j;var _e=t(`PopoverContent.RemoveScroll`),ve=v.forwardRef((e,t)=>{let r=C(j,e.__scopePopover),i=v.useRef(null),a=n(t,i),o=v.useRef(!1);return v.useEffect(()=>{let e=i.current;if(e)return oe(e)},[]),(0,y.jsx)(re,{as:_e,allowPinchZoom:!0,children:(0,y.jsx)(N,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:h(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||r.triggerRef.current?.focus()}),onPointerDownOutside:h(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;o.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:h(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),ye=v.forwardRef((e,t)=>{let n=C(j,e.__scopePopover),r=v.useRef(!1),i=v.useRef(!1);return(0,y.jsx)(N,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),N=v.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,p=C(j,n),m=S(n);return ae(),(0,y.jsx)(f,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,y.jsx)(ie,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,y.jsx)(ue,{"data-state":F(p.open),role:`dialog`,id:p.contentId,...m,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),P=`PopoverClose`,be=v.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=C(P,n);return(0,y.jsx)(m.button,{type:`button`,...r,ref:t,onClick:h(e.onClick,()=>i.onOpenChange(!1))})});be.displayName=P;var xe=`PopoverArrow`,Se=v.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=S(n);return(0,y.jsx)(ce,{...i,...r,ref:t})});Se.displayName=xe;function F(e){return e?`open`:`closed`}var Ce=w,we=E,Te=O,Ee=A,De=M;function I(e){return l(e)?!1:e.status===`queued`||e.status===`running`||e.status===`waiting`}function Oe(e){return I(e)&&e.status!==`queued`}function L(e,t,n){return e.archived||!(e.status===`done`||e.status===`failed`||e.status===`cancelled`)||e.delegation?.role===`worker`||n!==void 0&&c(e)!==n?!1:t===`unpinned`?!e.pinned:t!==`pinned`||e.pinned===!0}var ke=[`done`,`failed`];function R(e){return e.archived||l(e)||!ke.includes(e.status)?!1:e.finishedAt!==void 0}function Ae(e){let t=e.finishedAt;return t===void 0||!R(e)?!1:e.seenAt===void 0||e.seenAt<t}var z=[`Needs you`,`Finished`,`Working`,`Archived`],je={waiting:0,review:1,running:2,queued:4,done:5,failed:6,cancelled:7},Me=3,B=e=>l(e)?Me:je[e.status]??9;function Ne(e){let t=e=>s[o(e).bucket];return[...e].sort((e,n)=>t(e)-t(n)||B(e)-B(n))[0]}function V(e,t){return t===`archived`?`Archived`:o(e).bucket===`waiting`?`Needs you`:e.status===`waiting`||e.status===`running`||e.status===`queued`?`Working`:`Finished`}function H(e){let t=e.titleSummary;return t===void 0||!(e.titleOrigin===`user`||e.titleOrigin===`marker`)&&/[.!?][A-Z]/.test(t)?e.title:t}function U(e){let t=/^(\d{1,9}): (.+)$/.exec(e),n=t?.[1],r=t?.[2];return n===void 0||r===void 0?{ref:null,rest:e}:{ref:Number(n),rest:r}}function Pe(e,t){return t!==void 0&&U(e).ref===t}function W(e){let t=e.filter(e=>!e.archived&&e.status===`queued`).sort((e,t)=>e.createdAt.localeCompare(t.createdAt));return new Map(t.map((e,t)=>[e.id,t+1]))}function G(e,t){return e.filter(e=>t===`archived`?e.archived:!e.archived).sort((e,n)=>{if(t!==`archived`){let t=Number(!!n.pinned)-Number(!!e.pinned);if(t!==0)return t}let r=B(e)-B(n);if(r!==0)return r;if(l(e)&&l(n)){let t=e.autoResumeAt.localeCompare(n.autoResumeAt);if(t!==0)return t}return e.status===`queued`&&n.status===`queued`?e.createdAt.localeCompare(n.createdAt):n.createdAt.localeCompare(e.createdAt)})}function K(e){return e.delegation?.role===`worker`}function Fe(e,t){if(e==null)return null;let n=t.find(t=>t.id===e);return!n||!K(n)?e:n.delegation?.parentRunId??e}function Ie(e,t,n=W(e)){let r=G(e,t).filter(e=>!K(e)),i=new Map,a=(e,t)=>{let n=i.get(e);n?n.push(t):i.set(e,[t])};for(let e of r)a(V(e,t),{kind:`run`,run:e,queuePosition:n.get(e.id)??null});return z.filter(e=>i.has(e)).map(e=>({label:e,rows:i.get(e)}))}function Le(e,t={}){let n=typeof t==`number`?{overall:t}:u(t),r={"Needs you":`needsYou`,Finished:`finished`,Working:`working`},i=[],a=n.overall===void 0?10:n.overall??1/0;for(let t of e){let e=t.label===`Archived`?1/0:n[r[t.label]]??1/0,o=t.rows.filter(n=>{let r=n.run.pinned;return t.label!==`Archived`&&r?!0:a<=0||e<=0?!1:(--a,--e,!0)});o.length&&i.push({label:t.label,rows:o})}return i}function Re(e,t){if(t.length===0)return[...e];let n=new Set(e.map(e=>e.id)),r=new Set,i=t.filter(e=>n.has(e.id)||r.has(e.id)?!1:(r.add(e.id),!0));return[...e,...i]}function ze(e){let t=0,n=0,r=0;for(let i of e)if(!K(i)){if(i.archived){n+=1;continue}t+=1,o(i).bucket===`waiting`&&(r+=1)}return{active:t,archived:n,waiting:r}}function Be(e,t){let n=t===`automations`;return e.filter(e=>!e.archived&&c(e)===n)}var q={"Needs you":`needs-you`,Finished:`finished`,Working:`working`},Ve=Object.keys(q),He=`section`;function Ue(e,t){return`/?origin=${t===`automations`?`automations`:`direct`}&${He}=${q[e]}`}function We(e){return Ve.find(t=>q[t]===e)??null}function Ge(e){let t={active:0,automations:0,activeWaiting:0,automationsWaiting:0};for(let n of e){if(K(n)||n.archived)continue;let e=+(o(n).bucket===`waiting`);c(n)?(t.automations+=1,t.automationsWaiting+=e):(t.active+=1,t.activeWaiting+=e)}return t}function J(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function Ke(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=J(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(J(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function qe(e){let t=e.visualViewport;return t?{top:Math.max(0,Math.round(t.offsetTop)),bottom:J(e)}:{top:0,bottom:0}}function Je(e,t=0){let n=typeof t==`number`?{top:t,right:t,bottom:t,left:t}:t;return{top:(n.top??0)+e.top,right:n.right??0,bottom:(n.bottom??0)+e.bottom,left:n.left??0}}function Ye(e,t){let n=e.visualViewport;if(!n)return t({top:0,bottom:0}),()=>{};let r=()=>t(qe(e));return r(),n.addEventListener(`resize`,r),n.addEventListener(`scroll`,r),()=>{n.removeEventListener(`resize`,r),n.removeEventListener(`scroll`,r)}}function Xe(){let[e,t]=(0,v.useState)({top:0,bottom:0});return(0,v.useEffect)(()=>Ye(window,e=>t(t=>t.top===e.top&&t.bottom===e.bottom?t:e)),[]),e}function Ze(e){let t=(0,v.useRef)(e);t.current=e,(0,v.useEffect)(()=>{let e=document.documentElement;return Ke(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}var Qe=new Set([``,`text`,`search`,`email`,`url`,`tel`,`password`,`number`]);function $e(e){if(!e||typeof e!=`object`)return!1;let t=e,n=t.tagName?.toUpperCase();return n===`TEXTAREA`?!0:n===`INPUT`?Qe.has((t.type??``).toLowerCase()):t.isContentEditable===!0}var et=new WeakMap;function tt(e){let t=et.get(e),n=t&&t.width===e.innerWidth?Math.max(t.height,e.innerHeight):e.innerHeight;return et.set(e,{width:e.innerWidth,height:n}),n-e.innerHeight}function nt(e){let t=tt(e),n=e.visualViewport?.scale??1;return Math.abs(n-1)<.05&&J(e)>80||t>80&&$e(e.document?.activeElement)}function rt(){let[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=window,n=()=>t(nt(e));n();let r=e.visualViewport;return r?.addEventListener(`resize`,n),r?.addEventListener(`scroll`,n),window.addEventListener(`resize`,n),document.addEventListener(`focusin`,n),document.addEventListener(`focusout`,n),()=>{r?.removeEventListener(`resize`,n),r?.removeEventListener(`scroll`,n),window.removeEventListener(`resize`,n),document.removeEventListener(`focusin`,n),document.removeEventListener(`focusout`,n)}},[]),e}function it(e){let t=/\/(\d+)\/?$/.exec(e.trim()),n=t?Number(t[1]):NaN;return Number.isInteger(n)&&n>0?n:null}function at(e){let t=new Set;for(let n of[e.pullRequestUrl,e.referencedPullRequestUrl,e.referencedIssueUrl]){let e=n?it(n):null;e!==null&&t.add(e)}for(let n of[e.prNumber,e.issueNumber,e.markerRefs?.pr,e.markerRefs?.issue])typeof n==`number`&&Number.isInteger(n)&&n>0&&t.add(n);for(let n of e.pullRequests??[])t.add(n.number);return[...t]}var ot=[{id:`title`,kind:`text`,scopes:[`stored`],source:`summary`,texts:e=>[e.title]},{id:`titleSummary`,kind:`text`,scopes:[`stored`],source:`summary`,texts:e=>[e.titleSummary]},{id:`displayTitle`,kind:`text`,scopes:[`shown`],source:`reader`,texts:(e,t)=>[t.displayTitle]},{id:`branch`,kind:`text`,scopes:[`stored`,`shown`],source:`summary`,texts:e=>[e.branch]},{id:`workflow`,kind:`text`,scopes:[`stored`,`shown`],source:`summary`,texts:e=>[e.workflow]},{id:`workflowLabel`,kind:`text`,scopes:[`stored`,`shown`],source:`summary`,texts:e=>[e.workflowLabel]},{id:`automation`,kind:`text`,scopes:[`stored`,`shown`],source:`reader`,texts:(e,t)=>[t.automation],universe:e=>[...e.automationNames?.values()??[]]},{id:`projectName`,kind:`text`,scopes:[`shown`],source:`reader`,texts:(e,t)=>[t.projectName]},{id:`tags`,kind:`text`,scopes:[`shown`],source:`reader`,texts:(e,t)=>t.tags??[]},{id:`id`,kind:`identifier`,scopes:[`stored`],source:`summary`,texts:e=>[e.id]},{id:`urls`,kind:`link`,scopes:[`stored`],source:`summary`,texts:e=>[e.pullRequestUrl,e.referencedPullRequestUrl,e.referencedIssueUrl,...(e.pullRequests??[]).map(e=>e.url)]},{id:`heldReferences`,kind:`reference`,scopes:[`stored`],source:`summary`,numbers:at},{id:`shownReferences`,kind:`reference`,scopes:[`shown`],source:`reader`,numbers:(e,t)=>t.references?.()??[]}];function st(e){return e.trim().toLowerCase().split(/\s+/).filter(e=>e!==``)}function ct(e,t){if(t!==`phrase`)return st(e);let n=e.trim().toLowerCase();return n===``?[]:[n]}function lt(e,t){return t&&e.automationId!==void 0?t.get(e.automationId)??e.automationId:void 0}function ut(e,t){let n=t.scope??`stored`,r=t.scope===`shown`?t.omit??[]:[],i=t.scope===`shown`?t.extras:{automation:lt(e,t.automationNames)},a=[],o=[],s=[],c={text:a,identifier:o,link:s},l=[];for(let t of ot)if(!(!t.scopes.includes(n)||r.includes(t.id))){if(t.kind===`reference`){l.push(()=>t.numbers(e,i));continue}for(let n of t.texts(e,i))typeof n==`string`&&c[t.kind].push(n.toLowerCase())}let u;return{prose:a,ids:o,links:s,references:()=>u??=new Set(l.flatMap(e=>e().map(String)))}}function dt(e,t,n={}){let r=ct(t,n.mode);if(r.length===0)return!1;let{prose:i,ids:a,links:o,references:s}=ut(e,n);return r.every(e=>{if(i.some(t=>t.includes(e)))return!0;let t=e.replace(/^#/,``);return/^\d+$/.test(t)?s().has(String(Number(t)))||a.some(e=>e.startsWith(t)):a.some(t=>t.includes(e))||o.some(t=>t.includes(e))})}var ft=new Set([`running`,`waiting`]);function Y(e){return e?e>=1024**3?`${(e/1024**3).toFixed(1)} GB`:e>=1024**2?`${Math.round(e/1024**2)} MB`:`${Math.round(e/1024)} kB`:``}function pt(e){return e===void 0?``:`$${e>=10?e.toFixed(0):e.toFixed(2)}`}function mt(e,t=new Date){if(!l(e))return;let n=new Date(e.autoResumeAt);if(!Number.isFinite(n.getTime()))return;let r=n.toDateString()===t.toDateString(),i=new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(n);return{label:r?i:`${new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(n)} ${i}`,title:`Resumes automatically at ${new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`long`}).format(n)}`}}function ht(e){return e.steps?de({workflow:e.workflow,steps:e.steps}):e.workflowLabel??e.workflow}function gt(e,t,n=()=>``){let r=e.filter(e=>!K(e));return t.trim()?r.filter(e=>dt(e,t,{scope:`shown`,mode:`phrase`,extras:{displayTitle:H(e),automation:n(e),references:()=>_t(e)}})):[...r]}function _t(e){return X(e).map(e=>e.number)}function vt(e,t){return e.filter(e=>L(e,t)).length}function yt(e){return vt(e)}function bt(e){return xt(e)[0]??e.pullRequests?.find(e=>e.url)?.url}function xt(e){let t=[];return e.pullRequestUrl&&t.push(e.pullRequestUrl),!(e.markerRefs?.issue!==void 0&&e.markerRefs?.pr===void 0)&&e.referencedPullRequestUrl&&t.push(e.referencedPullRequestUrl),t}function St(e,t){if(e.referencedIssueUrl)return e.referencedIssueUrl;let n=e.issueNumber??e.markerRefs?.issue;if(!(!n||!t))return`${t}/issues/${n}`}function Ct(e){let t=`${e.kind}#${e.number}`;if(!e.url)return`${t}@project:${e.projectId??`default`}`;try{let n=new URL(e.url),r=n.pathname.split(`/`).filter(Boolean).slice(0,2).join(`/`);return`${t}@${n.host.toLowerCase()}/${r.toLowerCase()}`}catch{return`${t}@${e.url}`}}function X(e,t,n=e.projectId){let r=xt(e),i=e.markerRefs?.pr,a=[...i===void 0||[...r,...(e.pullRequests??[]).flatMap(e=>e.url?[e.url]:[])].some(e=>Q(e)===String(i))?[]:[{kind:`PR`,number:i}],...r.map(e=>({kind:`PR`,url:e})),{kind:`PR`,number:e.prNumber},...(e.pullRequests??[]).map(e=>({kind:`PR`,number:e.number,...e.url?{url:e.url}:{},authoritative:!0})),{kind:`Issue`,url:St(e,t)},{kind:`Issue`,number:e.issueNumber}],o=new Set,s=[];for(let e of a){let r=e.url?Number(Q(e.url)):e.number;if(!r||!Number.isInteger(r)||!e.url&&!e.authoritative&&s.some(t=>t.url&&t.kind===e.kind&&t.number===r))continue;let i=e.url??wt(e.kind,r,t),a={kind:e.kind,number:r,...i?{url:i}:n===void 0?{}:{projectId:n}},c=Ct(a);o.has(c)||(o.add(c),s.push(a))}return s}function wt(e,t,n){if(n)return`${n}/${e===`PR`?`pull`:`issues`}/${t}`}function Tt(e){return X(e)[0]}function Z(e,t){if(!e.url)return!0;if(!t)return!1;let n=Et(t);return n!==void 0&&Et(e.url)===n}function Et(e){try{let t=new URL(e),[n,r]=t.pathname.split(`/`).filter(Boolean);return n&&r?`${t.host}/${n}/${r}`.toLowerCase():void 0}catch{return}}function Dt(e,t){let n=[];for(let r of X(e,t)){if(!Z(r,t))continue;let e=r.kind===`PR`?`pr`:`issue`;n.some(t=>t.kind===e&&t.number===r.number)||n.push({kind:e,number:r.number})}return n}function Ot(e,t,n,r){if(Z(n,r))return`/p/${e}/tasks/${t}/${n.kind===`PR`?`pr`:`issue`}/${n.number}`}function Q(e){return/\/(\d+)\/?(?:[?#].*)?$/.exec(e)?.[1]??null}function kt(e,t){let n=ft.has(e.status)?t:void 0;if(n)return{cpu:{text:`${n.cpuPct.toFixed(0)}%`,kind:`live`},mem:{text:Y(n.rssBytes),kind:`live`}};let r=Y(e.peakRssBytes);return{cpu:{text:``,kind:`none`},mem:r?{text:`peak ${r}`,kind:`peak`,title:`peak — run finished${e.peakProcCount?` · ${e.peakProcCount} procs`:``}`}:{text:``,kind:`none`}}}var $=v.createContext(null);function At({...e}){let t=v.useRef(!1);return(0,y.jsx)($,{value:t,children:(0,y.jsx)(Ce,{"data-slot":`popover`,...e})})}function jt({onPointerDownCapture:e,onKeyDownCapture:t,...n}){let r=v.useContext($);return(0,y.jsx)(Te,{"data-slot":`popover-trigger`,...n,onPointerDownCapture:t=>{r&&(r.current=t.pointerType===`touch`),e?.(t)},onKeyDownCapture:e=>{r&&(r.current=!1),t?.(e)}})}function Mt({className:e,align:t=`center`,sideOffset:n=4,collisionPadding:i,onOpenAutoFocus:a,...o}){let s=Xe(),c=v.useContext($);return(0,y.jsx)(Ee,{children:(0,y.jsx)(De,{"data-slot":`popover-content`,align:t,sideOffset:n,onOpenAutoFocus:e=>{let t=c?.current;if(c&&(c.current=!1),a?.(e),e.defaultPrevented||!t)return;let n=e.target;n instanceof HTMLElement&&n.querySelector(`[cmdk-input]`)&&(e.preventDefault(),n.focus({preventScroll:!0}))},collisionPadding:Je(s,i),className:r(`z-50 w-72 max-w-(--radix-popover-content-available-width) [overflow-wrap:anywhere] origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...o})})}function Nt({...e}){return(0,y.jsx)(we,{"data-slot":`popover-anchor`,...e})}export{Le as A,Fe as B,dt as C,He as D,z as E,We as F,Re as G,Be as H,W as I,Oe as J,R as K,Pe as L,K as M,ze as N,Ve as O,Ne as P,H as R,ht as S,rt as T,G as U,Ge as V,U as W,Ae as X,L as Y,fe as Z,Dt as _,gt as a,X as b,Y as c,Ct as d,mt as f,Ot as g,St as h,jt as i,Ie as j,V as k,Z as l,vt as m,Nt as n,yt as o,_t as p,I as q,Mt as r,pt as s,At as t,Q as u,bt as v,Ze as w,kt as x,Tt as y,Ue as z};