@hearsay-tools/squawk 0.18.0-pr4335.8428 → 0.18.0-pr4338.8441
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/boot.d.ts +5 -1
- package/dist/boot.js +5 -2
- package/dist/boot.js.map +1 -1
- package/dist/cli-dispatch.d.ts +1 -1
- package/dist/cli-dispatch.js +24 -16
- package/dist/cli-dispatch.js.map +1 -1
- package/dist/contract/index.js +5 -2
- package/dist/contract/live-coordination.d.ts +30 -12
- package/dist/contract/live.d.ts +29 -0
- package/dist/core/managed-session.d.ts +0 -5
- package/dist/core/managed-session.js +0 -25
- package/dist/core/managed-session.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/plugin/bundled-features.d.ts +11 -0
- package/dist/plugin/bundled-features.js +37 -0
- package/dist/plugin/bundled-features.js.map +1 -0
- package/dist/plugin/cli.js +1 -1
- package/dist/plugin/loader.d.ts +2 -0
- package/dist/plugin/loader.js +23 -11
- package/dist/plugin/loader.js.map +1 -1
- package/dist/runners/antigravity/acp/events.d.ts +3 -5
- package/dist/runners/antigravity/acp/events.js +8 -11
- package/dist/runners/antigravity/acp/events.js.map +1 -1
- package/dist/server/live-routes.d.ts +7 -0
- package/dist/server/live-routes.js +1 -0
- package/dist/server/live-routes.js.map +1 -1
- package/dist/server/project-settings-routes.d.ts +107 -107
- package/dist/server/project-settings-routes.js +1 -0
- package/dist/server/project-settings-routes.js.map +1 -1
- package/dist/server/provider-sign-in-routes.d.ts +2 -2
- package/dist/server/run-event-feed.d.ts +7 -1
- package/dist/server/run-event-feed.js +58 -9
- package/dist/server/run-event-feed.js.map +1 -1
- package/dist/server/runs-routes.d.ts +704 -704
- package/dist/server/server.d.ts +133 -126
- package/dist/server/workspace-live-routes.d.ts +7 -0
- package/dist/workflows/run/session-events.js +0 -16
- package/dist/workflows/run/session-events.js.map +1 -1
- package/package.json +4 -4
- package/scripts/measure-transcript-facts-health.mjs +41 -4
- package/scripts/measure-transcript-facts-lag.mjs +3 -3
- package/scripts/transcript-facts-timing.mjs +133 -9
- package/web/dist/assets/{accounts-section-DmCfsIhE.js → accounts-section-DN0FBK_g.js} +1 -1
- package/web/dist/assets/{activity-motion-Dl9i8LMp.js → activity-motion-f8hpl5Ze.js} +1 -1
- package/web/dist/assets/{activity-route-Cu2YIdei.js → activity-route-Wg282MWR.js} +1 -1
- package/web/dist/assets/{agent-config-section-Bzm4-R__.js → agent-config-section-DYBoyQjx.js} +1 -1
- package/web/dist/assets/{agent-defaults-section-BKqo164A.js → agent-defaults-section-DvKhfLah.js} +1 -1
- package/web/dist/assets/{appearance-BqzgpB-Y.js → appearance-bxy5kq6O.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-BlGo3o7a.js → archive-on-merge-field-BHtW_R72.js} +1 -1
- package/web/dist/assets/attention-CexCTxjN.js +1 -0
- package/web/dist/assets/{automation-format-CUP262Tk.js → automation-format-DB34jUyF.js} +1 -1
- package/web/dist/assets/{automations-route-CUgWc2Qw.js → automations-route-CfkpBhz1.js} +1 -1
- package/web/dist/assets/{cez-idle-CQtDz5jk.js → cez-idle-CdswdDRd.js} +1 -1
- package/web/dist/assets/{commit-diff-panel-Cm558uOv.js → commit-diff-panel-Gb9038QD.js} +1 -1
- package/web/dist/assets/{diff-GEuSlT_R.js → diff-f_-bSIKM.js} +2 -2
- package/web/dist/assets/{diff-view-DLSixc9l.js → diff-view-X6OteUc2.js} +1 -1
- package/web/dist/assets/{file-preview-RPc0KAo_.js → file-preview-badfok9-.js} +1 -1
- package/web/dist/assets/{folder-browser-CffyHz8w.js → folder-browser-OPEKYHN1.js} +1 -1
- package/web/dist/assets/{git-toolbar-Dd_SYvD0.js → git-toolbar-DN0_Mq8X.js} +1 -1
- package/web/dist/assets/{github-CQ7IuYHM.js → github-CkzNHNBP.js} +1 -1
- package/web/dist/assets/{global-activity-route-BxZ0CMwG.js → global-activity-route-DD15s5cC.js} +1 -1
- package/web/dist/assets/{index-BRgRv29I.js → index-Dedol522.js} +5 -5
- package/web/dist/assets/{label-6PgIe3Ny.js → label-Cptt_zCn.js} +1 -1
- package/web/dist/assets/{live-protocol-DteqtbyN.js → live-protocol-DMhTnCmf.js} +1 -1
- package/web/dist/assets/{live-reads-BxjlQXfN.js → live-reads-jRSHgWlx.js} +1 -1
- package/web/dist/assets/{markdown-CIm2Q7mB.js → markdown-C4Vx2p8H.js} +3 -3
- package/web/dist/assets/{notifications-section-Cw8yBZWz.js → notifications-section-B-dnPl16.js} +1 -1
- package/web/dist/assets/{open-in-menu-AZMtej8C.js → open-in-menu-ytsrlsSn.js} +1 -1
- package/web/dist/assets/{preview-pane-connected-C3DmH_yh.js → preview-pane-connected-wlT7my-5.js} +1 -1
- package/web/dist/assets/{project-location-DzOgHfcA.js → project-location-BIWHn5XU.js} +1 -1
- package/web/dist/assets/{project-router-CDPfL2Jz.js → project-router-CWwXAsqF.js} +1 -1
- package/web/dist/assets/{project-scope-context-D9axDY18.js → project-scope-context-Dq-Iq7xE.js} +1 -1
- package/web/dist/assets/{projects-section-DftkCQ4q.js → projects-section-Cmk9b5sT.js} +1 -1
- package/web/dist/assets/{prompt-templates-section-CKSYhpin.js → prompt-templates-section-BKieLK_2.js} +1 -1
- package/web/dist/assets/{queries-DzwCG927.js → queries-Dd6O2cf-.js} +1 -1
- package/web/dist/assets/{reference-chip-BnIoiMgY.js → reference-chip-D52WtrZ9.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-C727a84A.js → remote-settings-notice-CX1Fz0Rm.js} +1 -1
- package/web/dist/assets/{repo-git-CfmNmHkb.js → repo-git-DPYA8VnX.js} +1 -1
- package/web/dist/assets/{report-reader-wIj2Yog1.js → report-reader-BYc3i5OQ.js} +1 -1
- package/web/dist/assets/{reports-DSkGAItT.js → reports-DtAmI1Ei.js} +1 -1
- package/web/dist/assets/{resources-section-DaEv2dar.js → resources-section-Dje_gDYP.js} +1 -1
- package/web/dist/assets/{run-header-CVZ0ZK7C.js → run-header-3nM40dop.js} +1 -1
- package/web/dist/assets/{settings-agent-picker-DMVlOQzv.js → settings-agent-picker-BxH3NSsW.js} +1 -1
- package/web/dist/assets/{settings-shell-DfnGZk9I.js → settings-shell-UvqivQaP.js} +1 -1
- package/web/dist/assets/{sidebar-section-DYJZAqtU.js → sidebar-section-BQ3vF2oy.js} +1 -1
- package/web/dist/assets/{skills-CfzNcHh1.js → skills-Dh0FFNiL.js} +1 -1
- package/web/dist/assets/{tab-link-BaKE6KnE.js → tab-link-qPg641SX.js} +1 -1
- package/web/dist/assets/{task-changes-C1I9CMew.js → task-changes-DIGOC-vV.js} +1 -1
- package/web/dist/assets/{task-commits-d_R4H7pu.js → task-commits-BI8NVi-K.js} +1 -1
- package/web/dist/assets/{task-files-B2JBO9Dx.js → task-files-DS7fsOMA.js} +1 -1
- package/web/dist/assets/{task-github-item-C9HMDHKn.js → task-github-item-BBWTgTX0.js} +1 -1
- package/web/dist/assets/{task-groups-DoiPFEfM.js → task-groups-CZAR_voe.js} +1 -1
- package/web/dist/assets/{task-thread-dKvX9xg6.js → task-thread-CGszK8tw.js} +9 -9
- package/web/dist/assets/{tasks-table-CmESFng9.js → tasks-table-CPP0rXJp.js} +1 -1
- package/web/dist/assets/thread-state-BpGQxoQF.js +4 -0
- package/web/dist/assets/{use-hand-to-agent-state-DzHDdmHn.js → use-hand-to-agent-state-Bs7tQKKt.js} +1 -1
- package/web/dist/assets/{useInfiniteQuery-GZp9laKm.js → useInfiniteQuery-D9ecHhMH.js} +1 -1
- package/web/dist/assets/useQuery-B0ubYnT2.js +1 -0
- package/web/dist/assets/{workflows-DqArthZn.js → workflows-CUMw82nv.js} +1 -1
- package/web/dist/assets/{workspace-tools-S5KvgCRm.js → workspace-tools-DKpPyGmZ.js} +1 -1
- package/web/dist/assets/{worktrees-section-DNFnQfiW.js → worktrees-section-D-Ga83TD.js} +1 -1
- package/web/dist/index.html +16 -16
- package/web/dist/live-worker.js +2 -2
- package/web/dist/assets/attention-CvHM4cjG.js +0 -1
- package/web/dist/assets/thread-state-B3HGSNEy.js +0 -4
- package/web/dist/assets/useQuery-CzVHT8UE.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,s as i,t as a}from"./utils-DSMR_WLb.js";import{Bn as o,Br as s,Hr as c,Rn as l,Rr as u,Ur as d,Vn as f,ci as p,gr as ee,qr as te,vr as ne,zn as m}from"./project-scope-context-D9axDY18.js";import{B as h,H as g,I as _,N as v,W as y,z as b}from"./live-protocol-DteqtbyN.js";import{Lt as x,Rt as S,Zt as C,gt as w,nn as T}from"./queries-DzwCG927.js";import{i as E,r as D}from"./cez-idle-CQtDz5jk.js";import{a as O}from"./dist-C5mlVBmd.js";var re=class extends EventTarget{readyState=0;release;constructor(e,t){super(),this.release=this.subscribe()}subscribe(){let e=()=>queueMicrotask(()=>{this.readyState===0&&(this.readyState=1,this.dispatchEvent(new Event(`open`)))});return c({kind:`workspace`},{ready:e,reset:()=>{this.readyState!==2&&(this.readyState=0,e())},frame:t=>{if(`data`in t&&t.event===`reconnect`){this.readyState=0,e();return}if(`data`in t&&t.event===`disconnect`){this.readyState===1&&(this.readyState=0,this.dispatchEvent(new Event(`error`)));return}`data`in t&&t.event===`ready`&&d(),`data`in t&&this.dispatchEvent(new MessageEvent(t.event,{data:t.data}))}})}requestReady(){return this.readyState!==2&&s()}close(){this.readyState=2,this.release()}},k=e(t(),1);h({runs:_(`summary`).optional()});var A=y().min(1),j=b().int().positive(),ie=h({project:A,seq:j,run:f,relationships:y().min(1)}),ae=h({project:A,seq:j,id:y().min(1)}),M=h({generation:y().min(1),seq:b().int().nonnegative()}),oe=h({project:A,usage:g(y(),l)});h({runs:v(o),referenceStatuses:m,perProjectLimit:b(),truncated:v(y()),generation:y().min(1),eventSeq:b().int().nonnegative()});function se(e,t){if(e===`ping`)return{project:null,event:{type:`ping`}};let n;try{n=JSON.parse(t)}catch{return null}switch(e){case`run-summary`:{let e=ie.safeParse(n);return e.success?{project:e.data.project,event:{type:`run-summary`,summary:e.data.run,seq:e.data.seq,relationships:e.data.relationships}}:null}case`run-deleted`:{let e=ae.safeParse(n);return e.success?{project:e.data.project,event:{type:`run-deleted`,id:e.data.id,seq:e.data.seq}}:null}case`usage`:{let e=oe.safeParse(n);return e.success?{project:e.data.project,event:{type:`usage`,usage:e.data.usage}}:null}case`ready`:{let e=M.safeParse(n);return e.success?{project:null,event:{type:`ready`,generation:e.data.generation,seq:e.data.seq}}:null}default:return null}}function N(){let e;return{ready(t){let n=e!==void 0&&t>e;return e=t,n},frame(t){let n=e!==void 0&&t!==e+1;return e=t,n},reset(){e=void 0}}}function P(e,t){if(!e)return;let n=e.findIndex(e=>e.id===t.id);if(n>=0){let r=[...e];return r[n]=t,r}let r=e.findIndex(e=>(e.createdAt??``).localeCompare(t.createdAt)<0),i=[...e];return i.splice(r<0?e.length:r,0,t),i}function ce(e,t){if(!e)return;let n=e.filter(e=>e.id!==t);return n.length===e.length?e:n}var F=Object.freeze({});function le(){let e=F,t=new Set;return{subscribe(e){return t.add(e),()=>t.delete(e)},get:()=>e,set(n){e=n;for(let e of t)e()}}}function I(e,t){let n=e.getQueryData(t);if(n?.finishBlocked===void 0)return;let{finishBlocked:r,...i}=n;e.setQueryData(t,i)}function ue(e){let t=new Map,n=t=>e.getQueryCache().find({queryKey:t,exact:!0}),r=t=>{if(!t.owed||t.timer!==void 0)return;let i=n(t.key);if(!i){t.owed=!1;return}if(!i.isActive()){t.owed=!1,e.invalidateQueries({queryKey:t.key,exact:!0,refetchType:`none`});return}if(i.state.fetchStatus!==`idle`)return;let a=t.lastStart+400-Date.now();if(a>0){t.timer=setTimeout(()=>{t.timer=void 0,r(t)},a);return}t.owed=!1,t.lastStart=Date.now(),e.refetchQueries({queryKey:t.key,exact:!0,type:`active`},{cancelRefetch:!1})},i=e.getQueryCache().subscribe(n=>{if(n.type!==`updated`||t.size===0)return;let i=t.get(JSON.stringify(n.query.queryKey));if(i){if(n.action.type===`success`&&!n.action.manual){let t=n.query.promise;t&&i.preEvent.has(t)&&(i.preEvent.delete(t),I(e,i.key),i.owed=!0)}n.query.state.fetchStatus===`idle`&&r(i)}});return{onEvent(i){let a=x.runs.detail(i),o=n(a);if(!o)return;let s=JSON.stringify(a),c=t.get(s);c||(c={key:a,owed:!1,lastStart:0,preEvent:new WeakSet},t.set(s,c)),o.state.fetchStatus!==`idle`&&o.promise&&c.preEvent.add(o.promise),I(e,a),c.owed=!0,r(c)},forget(e){let n=JSON.stringify(x.runs.detail(e));clearTimeout(t.get(n)?.timer),t.delete(n)},cancel(){i();for(let e of t.values())clearTimeout(e.timer);t.clear()}}}function de(e){let t=new Map;return{refresh(n){let r=x.runs.detail(n);if(!e.getQueryState(r))return;let i=JSON.stringify(r);clearTimeout(t.get(i)),e.cancelQueries({queryKey:r}),t.set(i,setTimeout(()=>{t.delete(i),e.invalidateQueries({queryKey:r})},400))},cancel(){for(let e of t.values())clearTimeout(e);t.clear()}}}var L=n(),fe=r(`/workspace/events?runs=summary`),R=2,z=3e3,B=[`run-summary`,`run-deleted`,`usage`,`ping`,`ready`],V=[`project-added`,`project-removed`,`checkout-progress`,`automation-change`,`project-ready`],H=new Set;function pe(e){return H.add(e),()=>{H.delete(e)}}function U(e){return e[1]===`runs`&&e[2]===`list`}function W(e,t){return e.cancelQueries({queryKey:t}).then(()=>e.invalidateQueries({queryKey:t}))}function G(e){return e.invalidateQueries({predicate:e=>U(e.queryKey),refetchType:`none`}),e.getQueryCache().findAll({predicate:e=>U(e.queryKey)&&(e.state.data!==void 0||e.state.fetchStatus!==`idle`)}).map(t=>W(e,t.queryKey))}var me=1e3,K=new WeakMap;function q(e){let t=x.repoBranches,n=K.get(e);if(n){n.set(JSON.stringify(t),t);return}K.set(e,new Map([[JSON.stringify(t),t]])),setTimeout(()=>{let t=K.get(e);K.delete(e);for(let n of t?.values()??[])e.invalidateQueries({queryKey:n})},me)}function J(e,t,n=!1){if(t?.aborted)return Promise.resolve();let r=[x.runs.all,S.runsIndex,S.projects,x.health,x.worktrees,x.repoBranches,S.providerStatus],i=()=>{for(let t of r)e.cancelQueries({queryKey:t})};return t?.addEventListener(`abort`,i,{once:!0}),E(()=>{for(let t of e.getQueryCache().findAll({predicate:e=>U(e.queryKey)}))t.state.data===void 0&&t.state.fetchStatus!==`idle`&&e.cancelQueries({queryKey:t.queryKey,exact:!0});return[e.invalidateQueries({queryKey:x.runs.all,...n?{predicate:e=>[`list`,`detail`,`relationships`,`archived`].includes(String(e.queryKey[2]))}:{}}),e.invalidateQueries({predicate:e=>U(e.queryKey)}),C(e).reconcile(),e.invalidateQueries({queryKey:S.projects}),W(e,x.health),e.invalidateQueries({queryKey:x.worktrees}),e.invalidateQueries({queryKey:x.repoBranches}),e.invalidateQueries({queryKey:S.providerStatus}),n?void 0:e.invalidateQueries({predicate:({queryKey:e})=>e.length===3&&e[1]===`github`&&(e[2]===null||typeof e[2]==`number`)})]}).finally(()=>t?.removeEventListener(`abort`,i))}function Y(e){return i()??X(e)}function X(e){let t=e.getQueryData(S.projects)?.bootProject;return typeof t==`string`&&t!==``?t:e.getQueryData(x.health)?.bootProject??e.getQueryData([`default`,`health`])?.bootProject}function he(e,t){return[T({projectId:e,boot:e===t}).cacheScope,`runs`,`list`]}function ge(e){let t=new Map,n=new Map,r=t=>{let r=n.get(JSON.stringify(t));if(!r)return;let i=e.getQueryCache().find({queryKey:t,exact:!0}),a=i?.promise;r.phase=`awaiting-fetch`,r.dirty=!1,e.invalidateQueries({queryKey:t,exact:!0}),i?.promise&&i.promise!==a&&(r.phase=`fetching`)},i=e.getQueryCache().subscribe(t=>{if(!n.size||t.type!==`updated`)return;let i=JSON.stringify(t.query.queryKey),a=n.get(i);if(a){if(t.action.type===`setState`){t.query.state.isInvalidated||e.invalidateQueries({queryKey:a.key,exact:!0,refetchType:`none`});return}if(t.action.type===`fetch`){a.phase===`awaiting-fetch`&&(a.phase=`fetching`),a.dirty=!1;return}if(t.action.type===`success`){if(!t.action.manual){a.phase===`fetching`&&!a.dirty?n.delete(i):r(a.key);return}a.phase!==`needs-start`&&(a.phase===`fetching`&&(a.dirty=!0),e.invalidateQueries({queryKey:a.key,exact:!0},{cancelRefetch:!1}))}}}),a=(t,r)=>{let i=JSON.stringify(t),a=e.getQueryCache().find({queryKey:t,exact:!0});if(!a)return;let o=n.get(i);!o&&(a.state.fetchStatus!==`idle`||a.state.isInvalidated)||o&&a.state.fetchStatus===`idle`?(n.set(i,{key:t,phase:`needs-start`,dirty:!1}),a.state.fetchStatus!==`idle`&&e.cancelQueries({queryKey:t,exact:!0}),r.some(e=>JSON.stringify(e)===i)||r.push(t)):o?.phase===`fetching`&&(o.dirty=!0)},o,s,c=(i=!1)=>{s!==void 0&&clearTimeout(s),s=void 0,o!==void 0&&cancelAnimationFrame(o),o=void 0;let c=[];for(let{key:r,baseList:i,baseQuery:o,baseUpdateCount:s,runs:l}of t.values()){let t=e.getQueryCache().find({queryKey:r,exact:!0});if(t!==o||t?.state.dataUpdateCount!==s||t?.state.data!==i){c.push(r),n.set(JSON.stringify(r),{key:r,phase:`needs-start`,dirty:!1}),e.cancelQueries({queryKey:r,exact:!0});continue}a(r,c),e.setQueryData(r,e=>{let t=e;for(let e of l.values())t=P(t,e);return t})}if(t.clear(),!i)for(let e of c)r(e);return c},l=t=>{let n=[he(t,X(e))],r=[t,`runs`,`list`];return(t===Y(e)||e.getQueryState(r))&&n.push(r),t===Y(e)&&n.push(x.runs.list()),[...new Map(n.map(e=>[JSON.stringify(e),e])).values()]};return{onEvent(i,u){let d=l(i);if(u.type===`run-summary`&&u.summary.archived&&d.every(t=>!e.getQueryData(t)?.find(e=>e.id===u.summary.id)?.archived)&&u.type===`run-summary`){for(let r of d){let i=JSON.stringify(r),a=n.get(i);a?.phase===`fetching`&&(a.dirty=!0);let o=t.get(i);if(!o){let n=e.getQueryCache().find({queryKey:r,exact:!0});o={key:r,baseList:n?.state.data,baseQuery:n,baseUpdateCount:n?.state.dataUpdateCount,runs:new Map},t.set(i,o)}o.runs.set(u.summary.id,u.summary)}s===void 0&&(s=setTimeout(()=>{c()},50),typeof requestAnimationFrame==`function`&&(o=requestAnimationFrame(()=>{c()})));return}let f=c(!0);for(let t of d)a(t,f),u.type===`run-summary`?e.setQueryData(t,e=>P(e,u.summary)):e.setQueryData(t,e=>ce(e,u.id));for(let e of f)r(e)},flush:c,cancel(){i(),n.clear()}}}var _e=400;function ve(e){let t=new Map,n=new Map,r=(t,r)=>{if(r&&!e.getQueryState(t))return;let i=JSON.stringify(t);n.has(i)||n.set(i,setTimeout(()=>{n.delete(i),e.invalidateQueries({queryKey:t})},_e))};return{onSummary(e,n){let i=e.delegation?.role===`worker`?e.delegation.parentRunId:void 0,a=e.delegation?.role===`worker`?e.delegation.supervisorRunId:void 0,o=t.get(e.id);if(t.set(e.id,{shape:n,...i===void 0?{}:{parentRunId:i},...a===void 0?{}:{supervisorRunId:a}}),o?.shape!==n){r(x.runs.relationships(e.id),!0);for(let e of[i,a])e!==void 0&&r(x.runs.relationships(e),!0)}},onDeleted(n){let i=t.get(n);t.delete(n),e.removeQueries({queryKey:x.runs.relationships(n)}),i?.supervisorRunId!==void 0&&r(x.runs.relationships(i.supervisorRunId),!0),i?.parentRunId===void 0?r([...x.runs.all,`relationships`],!1):r(x.runs.relationships(i.parentRunId),!0)},cancel(){for(let e of n.values())clearTimeout(e);n.clear(),t.clear()}}}var Z={predicate:e=>e.queryKey[1]===`runs`&&e.queryKey[2]===`archived`};function ye(e,t){if(t.delegation?.role===`worker`)return;let n=!1;for(let r of e.getQueryCache().findAll(Z)){let i=r.state.data;i&&(i.pages.some(e=>e.runs.some(e=>e.id===t.id))?(e.setQueryData(r.queryKey,{...i,pages:i.pages.map(e=>({...e,runs:e.runs.map(e=>e.id===t.id?t:e)}))}),(!t.archived||r.queryKey[3]!==``)&&(n=!0)):t.archived&&(n=!0))}n&&e.invalidateQueries(Z)}function be(e,t,n,r,i){switch(n.type){case`run-summary`:{let t=n.summary;if(ye(e,t),i.onSummary(t,n.relationships),r.fetcher.onEvent(t.id),t.delegation?.role===`worker`){let n=t.delegation.parentRunId;I(e,x.runs.detail(n)),r.refreshParent(n)}let a=x.runs.changes(t.id);e.getQueryData(a)!==void 0&&e.invalidateQueries({queryKey:a}),e.invalidateQueries({queryKey:x.worktrees}),q(e);return}case`run-deleted`:i.onDeleted(n.id),r.fetcher.forget(n.id),e.removeQueries({queryKey:x.runs.detail(n.id)}),e.removeQueries({queryKey:x.runs.diff(n.id)}),e.setQueriesData(Z,e=>e&&e.pages.some(e=>e.runs.some(e=>e.id===n.id))?{...e,pages:e.pages.map(e=>({...e,runs:e.runs.filter(e=>e.id!==n.id)}))}:e),e.invalidateQueries(Z),e.invalidateQueries({queryKey:x.worktrees}),q(e);return;case`usage`:t.set(n.usage);return;case`ping`:case`ready`:return}}function xe(e,t=fe){let n=p();(0,k.useEffect)(()=>{let r=re;if(typeof r!=`function`)return;let i=null,a=C(n);a.setUnknownGenerationHandler(()=>{let e=i?.requestReady;return typeof e==`function`&&e.call(i)});let o=de(n),s=ue(n),c={fetcher:s,refreshParent:o.refresh},l=N(),d=ge(n),f=ve(n),p=!1,m,h=!1,g=!1,_=!1,v=!1,y=()=>{_=!0,v=!1;let e=S.providerStatus;n.cancelQueries({queryKey:e,exact:!0}).then(()=>n.invalidateQueries({queryKey:e,exact:!0,refetchType:`active`})).finally(()=>{if(g||!v){_=!1;return}y()})},b=()=>{g||m!==void 0||(m=setTimeout(()=>{m=void 0,g||w()},z))},w=()=>{i?.close(),i=new r(t,{withCredentials:!0}),i.addEventListener(`open`,()=>{p=!0,l.reset(),a.detach(),D(!1),h&&(d.flush(),J(n)),h||(E(()=>G(n)),n.cancelQueries({queryKey:x.health}).then(()=>{g||n.invalidateQueries({queryKey:x.health})}),a.reconcile()),h=!0});for(let t of B)i.addEventListener(t,r=>{let i=se(t,r.data);if(!i)return;if(i.event.type===`ready`){let e=l.ready(i.event.seq);a.ready(i.event.generation,i.event.seq),e&&(d.flush(),J(n));return}let o=(i.event.type===`run-summary`||i.event.type===`run-deleted`)&&l.frame(i.event.seq);i.event.type===`ping`&&p&&(p=!1,E(()=>G(n)),D(!0)),i.project!==null&&(i.event.type===`run-summary`||i.event.type===`run-deleted`?a.run(i.project,i.event,o):i.event.type===`usage`&&a.usage(i.project,i.event.usage)),i.project!==null&&(i.event.type===`run-summary`||i.event.type===`run-deleted`)&&d.onEvent(i.project,i.event),(i.project===null||i.project===Y(n))&&be(n,e,i.event,c,f),o&&(d.flush(),J(n))});for(let e of V)i.addEventListener(e,t=>{let r;try{r=JSON.parse(t.data)}catch{return}if(e===`project-ready`?a.reconcile({hold:!0}):e!==`checkout-progress`&&e!==`automation-change`&&n.invalidateQueries({queryKey:S.projects}),e===`project-added`){let e=r?.project?.id;typeof e==`string`&&e!==``&&a.restoreProject(e),a.reconcile({hold:!0})}if(e===`project-removed`){let e=r?.id;typeof e==`string`&&e!==``&&a.dropProject(e)}for(let t of[...H])t(e,r)});i.addEventListener(`health`,e=>{let t;try{t=JSON.parse(e.data)}catch{return}let r=te.safeParse(t);r.success&&(n.cancelQueries({queryKey:x.health}),n.setQueryData(x.health,r.data))}),i.addEventListener(`provider-status`,e=>{let t;try{t=JSON.parse(e.data)}catch{return}let r=ne(t);if(!r)return;let i=S.providerStatus,a=ee(n.getQueryData(i),r);if(a!==void 0){n.setQueryData(i,a);return}if(_){v=!0;return}y()}),i.addEventListener(`error`,()=>{D(!1),a.detach(),i?.readyState===R&&b()})},T=()=>{document.visibilityState===`visible`&&(d.flush(),a.flush(),(!i||i.readyState===R)&&(clearTimeout(m),m=void 0,w()))},O=()=>{clearTimeout(m),m=void 0,d.flush()};document.addEventListener(`visibilitychange`,T),window.addEventListener(`pagehide`,O);let k=u((e,t)=>(d.flush(),J(n,e,t)));return w(),()=>{k(),g=!0,D(!1),clearTimeout(m),d.flush(),d.cancel(),a.stop(),o.cancel(),s.cancel(),a.setUnknownGenerationHandler(void 0),f.cancel(),document.removeEventListener(`visibilitychange`,T),window.removeEventListener(`pagehide`,O),i?.close(),i=null}},[n,e,t])}var Q=(0,k.createContext)(null);function Se({children:e}){let[t]=(0,k.useState)(le);return xe(t),w(),(0,L.jsx)(Q.Provider,{value:t,children:e})}function Ce(e){let t=(0,k.useContext)(Q),n=t?t.get:Te;return(0,k.useSyncExternalStore)(t?t.subscribe:we,()=>e?n()[e]:void 0,()=>void 0)}var we=()=>()=>void 0,Te=()=>F,Ee=`Label`,$=k.forwardRef((e,t)=>(0,L.jsx)(O.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));$.displayName=Ee;var De=$;function Oe({className:e,...t}){return(0,L.jsx)(De,{"data-slot":`label`,className:a(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}export{Ce as i,Se as n,pe as r,Oe as t};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{a as r,s as i,t as a}from"./utils-DSMR_WLb.js";import{Bn as o,Br as s,Hr as c,Rn as l,Rr as u,Ur as d,Vn as f,ci as p,gr as ee,qr as te,vr as ne,zn as m}from"./project-scope-context-Dq-Iq7xE.js";import{B as h,H as g,I as _,N as v,W as y,z as b}from"./live-protocol-DMhTnCmf.js";import{Lt as x,Rt as S,Zt as C,gt as w,nn as T}from"./queries-Dd6O2cf-.js";import{i as E,r as D}from"./cez-idle-CdswdDRd.js";import{a as O}from"./dist-C5mlVBmd.js";var re=class extends EventTarget{readyState=0;release;constructor(e,t){super(),this.release=this.subscribe()}subscribe(){let e=()=>queueMicrotask(()=>{this.readyState===0&&(this.readyState=1,this.dispatchEvent(new Event(`open`)))});return c({kind:`workspace`},{ready:e,reset:()=>{this.readyState!==2&&(this.readyState=0,e())},frame:t=>{if(`data`in t&&t.event===`reconnect`){this.readyState=0,e();return}if(`data`in t&&t.event===`disconnect`){this.readyState===1&&(this.readyState=0,this.dispatchEvent(new Event(`error`)));return}`data`in t&&t.event===`ready`&&d(),`data`in t&&this.dispatchEvent(new MessageEvent(t.event,{data:t.data}))}})}requestReady(){return this.readyState!==2&&s()}close(){this.readyState=2,this.release()}},k=e(t(),1);h({runs:_(`summary`).optional()});var A=y().min(1),j=b().int().positive(),ie=h({project:A,seq:j,run:f,relationships:y().min(1)}),ae=h({project:A,seq:j,id:y().min(1)}),M=h({generation:y().min(1),seq:b().int().nonnegative()}),oe=h({project:A,usage:g(y(),l)});h({runs:v(o),referenceStatuses:m,perProjectLimit:b(),truncated:v(y()),generation:y().min(1),eventSeq:b().int().nonnegative()});function se(e,t){if(e===`ping`)return{project:null,event:{type:`ping`}};let n;try{n=JSON.parse(t)}catch{return null}switch(e){case`run-summary`:{let e=ie.safeParse(n);return e.success?{project:e.data.project,event:{type:`run-summary`,summary:e.data.run,seq:e.data.seq,relationships:e.data.relationships}}:null}case`run-deleted`:{let e=ae.safeParse(n);return e.success?{project:e.data.project,event:{type:`run-deleted`,id:e.data.id,seq:e.data.seq}}:null}case`usage`:{let e=oe.safeParse(n);return e.success?{project:e.data.project,event:{type:`usage`,usage:e.data.usage}}:null}case`ready`:{let e=M.safeParse(n);return e.success?{project:null,event:{type:`ready`,generation:e.data.generation,seq:e.data.seq}}:null}default:return null}}function N(){let e;return{ready(t){let n=e!==void 0&&t>e;return e=t,n},frame(t){let n=e!==void 0&&t!==e+1;return e=t,n},reset(){e=void 0}}}function P(e,t){if(!e)return;let n=e.findIndex(e=>e.id===t.id);if(n>=0){let r=[...e];return r[n]=t,r}let r=e.findIndex(e=>(e.createdAt??``).localeCompare(t.createdAt)<0),i=[...e];return i.splice(r<0?e.length:r,0,t),i}function ce(e,t){if(!e)return;let n=e.filter(e=>e.id!==t);return n.length===e.length?e:n}var F=Object.freeze({});function le(){let e=F,t=new Set;return{subscribe(e){return t.add(e),()=>t.delete(e)},get:()=>e,set(n){e=n;for(let e of t)e()}}}function I(e,t){let n=e.getQueryData(t);if(n?.finishBlocked===void 0)return;let{finishBlocked:r,...i}=n;e.setQueryData(t,i)}function ue(e){let t=new Map,n=t=>e.getQueryCache().find({queryKey:t,exact:!0}),r=t=>{if(!t.owed||t.timer!==void 0)return;let i=n(t.key);if(!i){t.owed=!1;return}if(!i.isActive()){t.owed=!1,e.invalidateQueries({queryKey:t.key,exact:!0,refetchType:`none`});return}if(i.state.fetchStatus!==`idle`)return;let a=t.lastStart+400-Date.now();if(a>0){t.timer=setTimeout(()=>{t.timer=void 0,r(t)},a);return}t.owed=!1,t.lastStart=Date.now(),e.refetchQueries({queryKey:t.key,exact:!0,type:`active`},{cancelRefetch:!1})},i=e.getQueryCache().subscribe(n=>{if(n.type!==`updated`||t.size===0)return;let i=t.get(JSON.stringify(n.query.queryKey));if(i){if(n.action.type===`success`&&!n.action.manual){let t=n.query.promise;t&&i.preEvent.has(t)&&(i.preEvent.delete(t),I(e,i.key),i.owed=!0)}n.query.state.fetchStatus===`idle`&&r(i)}});return{onEvent(i){let a=x.runs.detail(i),o=n(a);if(!o)return;let s=JSON.stringify(a),c=t.get(s);c||(c={key:a,owed:!1,lastStart:0,preEvent:new WeakSet},t.set(s,c)),o.state.fetchStatus!==`idle`&&o.promise&&c.preEvent.add(o.promise),I(e,a),c.owed=!0,r(c)},forget(e){let n=JSON.stringify(x.runs.detail(e));clearTimeout(t.get(n)?.timer),t.delete(n)},cancel(){i();for(let e of t.values())clearTimeout(e.timer);t.clear()}}}function de(e){let t=new Map;return{refresh(n){let r=x.runs.detail(n);if(!e.getQueryState(r))return;let i=JSON.stringify(r);clearTimeout(t.get(i)),e.cancelQueries({queryKey:r}),t.set(i,setTimeout(()=>{t.delete(i),e.invalidateQueries({queryKey:r})},400))},cancel(){for(let e of t.values())clearTimeout(e);t.clear()}}}var L=n(),fe=r(`/workspace/events?runs=summary`),R=2,z=3e3,B=[`run-summary`,`run-deleted`,`usage`,`ping`,`ready`],V=[`project-added`,`project-removed`,`checkout-progress`,`automation-change`,`project-ready`],H=new Set;function pe(e){return H.add(e),()=>{H.delete(e)}}function U(e){return e[1]===`runs`&&e[2]===`list`}function W(e,t){return e.cancelQueries({queryKey:t}).then(()=>e.invalidateQueries({queryKey:t}))}function G(e){return e.invalidateQueries({predicate:e=>U(e.queryKey),refetchType:`none`}),e.getQueryCache().findAll({predicate:e=>U(e.queryKey)&&(e.state.data!==void 0||e.state.fetchStatus!==`idle`)}).map(t=>W(e,t.queryKey))}var me=1e3,K=new WeakMap;function q(e){let t=x.repoBranches,n=K.get(e);if(n){n.set(JSON.stringify(t),t);return}K.set(e,new Map([[JSON.stringify(t),t]])),setTimeout(()=>{let t=K.get(e);K.delete(e);for(let n of t?.values()??[])e.invalidateQueries({queryKey:n})},me)}function J(e,t,n=!1){if(t?.aborted)return Promise.resolve();let r=[x.runs.all,S.runsIndex,S.projects,x.health,x.worktrees,x.repoBranches,S.providerStatus],i=()=>{for(let t of r)e.cancelQueries({queryKey:t})};return t?.addEventListener(`abort`,i,{once:!0}),E(()=>{for(let t of e.getQueryCache().findAll({predicate:e=>U(e.queryKey)}))t.state.data===void 0&&t.state.fetchStatus!==`idle`&&e.cancelQueries({queryKey:t.queryKey,exact:!0});return[e.invalidateQueries({queryKey:x.runs.all,...n?{predicate:e=>[`list`,`detail`,`relationships`,`archived`].includes(String(e.queryKey[2]))}:{}}),e.invalidateQueries({predicate:e=>U(e.queryKey)}),C(e).reconcile(),e.invalidateQueries({queryKey:S.projects}),W(e,x.health),e.invalidateQueries({queryKey:x.worktrees}),e.invalidateQueries({queryKey:x.repoBranches}),e.invalidateQueries({queryKey:S.providerStatus}),n?void 0:e.invalidateQueries({predicate:({queryKey:e})=>e.length===3&&e[1]===`github`&&(e[2]===null||typeof e[2]==`number`)})]}).finally(()=>t?.removeEventListener(`abort`,i))}function Y(e){return i()??X(e)}function X(e){let t=e.getQueryData(S.projects)?.bootProject;return typeof t==`string`&&t!==``?t:e.getQueryData(x.health)?.bootProject??e.getQueryData([`default`,`health`])?.bootProject}function he(e,t){return[T({projectId:e,boot:e===t}).cacheScope,`runs`,`list`]}function ge(e){let t=new Map,n=new Map,r=t=>{let r=n.get(JSON.stringify(t));if(!r)return;let i=e.getQueryCache().find({queryKey:t,exact:!0}),a=i?.promise;r.phase=`awaiting-fetch`,r.dirty=!1,e.invalidateQueries({queryKey:t,exact:!0}),i?.promise&&i.promise!==a&&(r.phase=`fetching`)},i=e.getQueryCache().subscribe(t=>{if(!n.size||t.type!==`updated`)return;let i=JSON.stringify(t.query.queryKey),a=n.get(i);if(a){if(t.action.type===`setState`){t.query.state.isInvalidated||e.invalidateQueries({queryKey:a.key,exact:!0,refetchType:`none`});return}if(t.action.type===`fetch`){a.phase===`awaiting-fetch`&&(a.phase=`fetching`),a.dirty=!1;return}if(t.action.type===`success`){if(!t.action.manual){a.phase===`fetching`&&!a.dirty?n.delete(i):r(a.key);return}a.phase!==`needs-start`&&(a.phase===`fetching`&&(a.dirty=!0),e.invalidateQueries({queryKey:a.key,exact:!0},{cancelRefetch:!1}))}}}),a=(t,r)=>{let i=JSON.stringify(t),a=e.getQueryCache().find({queryKey:t,exact:!0});if(!a)return;let o=n.get(i);!o&&(a.state.fetchStatus!==`idle`||a.state.isInvalidated)||o&&a.state.fetchStatus===`idle`?(n.set(i,{key:t,phase:`needs-start`,dirty:!1}),a.state.fetchStatus!==`idle`&&e.cancelQueries({queryKey:t,exact:!0}),r.some(e=>JSON.stringify(e)===i)||r.push(t)):o?.phase===`fetching`&&(o.dirty=!0)},o,s,c=(i=!1)=>{s!==void 0&&clearTimeout(s),s=void 0,o!==void 0&&cancelAnimationFrame(o),o=void 0;let c=[];for(let{key:r,baseList:i,baseQuery:o,baseUpdateCount:s,runs:l}of t.values()){let t=e.getQueryCache().find({queryKey:r,exact:!0});if(t!==o||t?.state.dataUpdateCount!==s||t?.state.data!==i){c.push(r),n.set(JSON.stringify(r),{key:r,phase:`needs-start`,dirty:!1}),e.cancelQueries({queryKey:r,exact:!0});continue}a(r,c),e.setQueryData(r,e=>{let t=e;for(let e of l.values())t=P(t,e);return t})}if(t.clear(),!i)for(let e of c)r(e);return c},l=t=>{let n=[he(t,X(e))],r=[t,`runs`,`list`];return(t===Y(e)||e.getQueryState(r))&&n.push(r),t===Y(e)&&n.push(x.runs.list()),[...new Map(n.map(e=>[JSON.stringify(e),e])).values()]};return{onEvent(i,u){let d=l(i);if(u.type===`run-summary`&&u.summary.archived&&d.every(t=>!e.getQueryData(t)?.find(e=>e.id===u.summary.id)?.archived)&&u.type===`run-summary`){for(let r of d){let i=JSON.stringify(r),a=n.get(i);a?.phase===`fetching`&&(a.dirty=!0);let o=t.get(i);if(!o){let n=e.getQueryCache().find({queryKey:r,exact:!0});o={key:r,baseList:n?.state.data,baseQuery:n,baseUpdateCount:n?.state.dataUpdateCount,runs:new Map},t.set(i,o)}o.runs.set(u.summary.id,u.summary)}s===void 0&&(s=setTimeout(()=>{c()},50),typeof requestAnimationFrame==`function`&&(o=requestAnimationFrame(()=>{c()})));return}let f=c(!0);for(let t of d)a(t,f),u.type===`run-summary`?e.setQueryData(t,e=>P(e,u.summary)):e.setQueryData(t,e=>ce(e,u.id));for(let e of f)r(e)},flush:c,cancel(){i(),n.clear()}}}var _e=400;function ve(e){let t=new Map,n=new Map,r=(t,r)=>{if(r&&!e.getQueryState(t))return;let i=JSON.stringify(t);n.has(i)||n.set(i,setTimeout(()=>{n.delete(i),e.invalidateQueries({queryKey:t})},_e))};return{onSummary(e,n){let i=e.delegation?.role===`worker`?e.delegation.parentRunId:void 0,a=e.delegation?.role===`worker`?e.delegation.supervisorRunId:void 0,o=t.get(e.id);if(t.set(e.id,{shape:n,...i===void 0?{}:{parentRunId:i},...a===void 0?{}:{supervisorRunId:a}}),o?.shape!==n){r(x.runs.relationships(e.id),!0);for(let e of[i,a])e!==void 0&&r(x.runs.relationships(e),!0)}},onDeleted(n){let i=t.get(n);t.delete(n),e.removeQueries({queryKey:x.runs.relationships(n)}),i?.supervisorRunId!==void 0&&r(x.runs.relationships(i.supervisorRunId),!0),i?.parentRunId===void 0?r([...x.runs.all,`relationships`],!1):r(x.runs.relationships(i.parentRunId),!0)},cancel(){for(let e of n.values())clearTimeout(e);n.clear(),t.clear()}}}var Z={predicate:e=>e.queryKey[1]===`runs`&&e.queryKey[2]===`archived`};function ye(e,t){if(t.delegation?.role===`worker`)return;let n=!1;for(let r of e.getQueryCache().findAll(Z)){let i=r.state.data;i&&(i.pages.some(e=>e.runs.some(e=>e.id===t.id))?(e.setQueryData(r.queryKey,{...i,pages:i.pages.map(e=>({...e,runs:e.runs.map(e=>e.id===t.id?t:e)}))}),(!t.archived||r.queryKey[3]!==``)&&(n=!0)):t.archived&&(n=!0))}n&&e.invalidateQueries(Z)}function be(e,t,n,r,i){switch(n.type){case`run-summary`:{let t=n.summary;if(ye(e,t),i.onSummary(t,n.relationships),r.fetcher.onEvent(t.id),t.delegation?.role===`worker`){let n=t.delegation.parentRunId;I(e,x.runs.detail(n)),r.refreshParent(n)}let a=x.runs.changes(t.id);e.getQueryData(a)!==void 0&&e.invalidateQueries({queryKey:a}),e.invalidateQueries({queryKey:x.worktrees}),q(e);return}case`run-deleted`:i.onDeleted(n.id),r.fetcher.forget(n.id),e.removeQueries({queryKey:x.runs.detail(n.id)}),e.removeQueries({queryKey:x.runs.diff(n.id)}),e.setQueriesData(Z,e=>e&&e.pages.some(e=>e.runs.some(e=>e.id===n.id))?{...e,pages:e.pages.map(e=>({...e,runs:e.runs.filter(e=>e.id!==n.id)}))}:e),e.invalidateQueries(Z),e.invalidateQueries({queryKey:x.worktrees}),q(e);return;case`usage`:t.set(n.usage);return;case`ping`:case`ready`:return}}function xe(e,t=fe){let n=p();(0,k.useEffect)(()=>{let r=re;if(typeof r!=`function`)return;let i=null,a=C(n);a.setUnknownGenerationHandler(()=>{let e=i?.requestReady;return typeof e==`function`&&e.call(i)});let o=de(n),s=ue(n),c={fetcher:s,refreshParent:o.refresh},l=N(),d=ge(n),f=ve(n),p=!1,m,h=!1,g=!1,_=!1,v=!1,y=()=>{_=!0,v=!1;let e=S.providerStatus;n.cancelQueries({queryKey:e,exact:!0}).then(()=>n.invalidateQueries({queryKey:e,exact:!0,refetchType:`active`})).finally(()=>{if(g||!v){_=!1;return}y()})},b=()=>{g||m!==void 0||(m=setTimeout(()=>{m=void 0,g||w()},z))},w=()=>{i?.close(),i=new r(t,{withCredentials:!0}),i.addEventListener(`open`,()=>{p=!0,l.reset(),a.detach(),D(!1),h&&(d.flush(),J(n)),h||(E(()=>G(n)),n.cancelQueries({queryKey:x.health}).then(()=>{g||n.invalidateQueries({queryKey:x.health})}),a.reconcile()),h=!0});for(let t of B)i.addEventListener(t,r=>{let i=se(t,r.data);if(!i)return;if(i.event.type===`ready`){let e=l.ready(i.event.seq);a.ready(i.event.generation,i.event.seq),e&&(d.flush(),J(n));return}let o=(i.event.type===`run-summary`||i.event.type===`run-deleted`)&&l.frame(i.event.seq);i.event.type===`ping`&&p&&(p=!1,E(()=>G(n)),D(!0)),i.project!==null&&(i.event.type===`run-summary`||i.event.type===`run-deleted`?a.run(i.project,i.event,o):i.event.type===`usage`&&a.usage(i.project,i.event.usage)),i.project!==null&&(i.event.type===`run-summary`||i.event.type===`run-deleted`)&&d.onEvent(i.project,i.event),(i.project===null||i.project===Y(n))&&be(n,e,i.event,c,f),o&&(d.flush(),J(n))});for(let e of V)i.addEventListener(e,t=>{let r;try{r=JSON.parse(t.data)}catch{return}if(e===`project-ready`?a.reconcile({hold:!0}):e!==`checkout-progress`&&e!==`automation-change`&&n.invalidateQueries({queryKey:S.projects}),e===`project-added`){let e=r?.project?.id;typeof e==`string`&&e!==``&&a.restoreProject(e),a.reconcile({hold:!0})}if(e===`project-removed`){let e=r?.id;typeof e==`string`&&e!==``&&a.dropProject(e)}for(let t of[...H])t(e,r)});i.addEventListener(`health`,e=>{let t;try{t=JSON.parse(e.data)}catch{return}let r=te.safeParse(t);r.success&&(n.cancelQueries({queryKey:x.health}),n.setQueryData(x.health,r.data))}),i.addEventListener(`provider-status`,e=>{let t;try{t=JSON.parse(e.data)}catch{return}let r=ne(t);if(!r)return;let i=S.providerStatus,a=ee(n.getQueryData(i),r);if(a!==void 0){n.setQueryData(i,a);return}if(_){v=!0;return}y()}),i.addEventListener(`error`,()=>{D(!1),a.detach(),i?.readyState===R&&b()})},T=()=>{document.visibilityState===`visible`&&(d.flush(),a.flush(),(!i||i.readyState===R)&&(clearTimeout(m),m=void 0,w()))},O=()=>{clearTimeout(m),m=void 0,d.flush()};document.addEventListener(`visibilitychange`,T),window.addEventListener(`pagehide`,O);let k=u((e,t)=>(d.flush(),J(n,e,t)));return w(),()=>{k(),g=!0,D(!1),clearTimeout(m),d.flush(),d.cancel(),a.stop(),o.cancel(),s.cancel(),a.setUnknownGenerationHandler(void 0),f.cancel(),document.removeEventListener(`visibilitychange`,T),window.removeEventListener(`pagehide`,O),i?.close(),i=null}},[n,e,t])}var Q=(0,k.createContext)(null);function Se({children:e}){let[t]=(0,k.useState)(le);return xe(t),w(),(0,L.jsx)(Q.Provider,{value:t,children:e})}function Ce(e){let t=(0,k.useContext)(Q),n=t?t.get:Te;return(0,k.useSyncExternalStore)(t?t.subscribe:we,()=>e?n()[e]:void 0,()=>void 0)}var we=()=>()=>void 0,Te=()=>F,Ee=`Label`,$=k.forwardRef((e,t)=>(0,L.jsx)(O.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));$.displayName=Ee;var De=$;function Oe({className:e,...t}){return(0,L.jsx)(De,{"data-slot":`label`,className:a(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}export{Ce as i,Se as n,pe as r,Oe as t};
|
|
@@ -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=_,s=!u.jitless,c=s&&ce.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?Cn([],p,u,f,d,e):u):n(u,f):(u.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),u)}});function En(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=>!S(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=>w(e,r,d())))}),t)}var Dn=s(`$ZodUnion`,(e,t)=>{D.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=>En(t,r,e,i)):En(o,r,e,i)}}),On=s(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Dn.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(!_(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)}}),kn=s(`$ZodIntersection`,(e,t)=>{D.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])=>jn(e,t,n)):jn(e,i,a)}});function An(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(v(e)&&v(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=An(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=An(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 jn(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}),S(e))return e;let o=An(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Mn=s(`$ZodRecord`,(e,t)=>{D.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!v(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=>w(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(...C(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...C(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`&&ht.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=>w(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(...C(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...C(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Nn=s(`$ZodEnum`,(e,t)=>{D.init(e,t);let n=f(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ue.has(typeof e)).map(e=>typeof e==`string`?y(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}}),Pn=s(`$ZodLiteral`,(e,t)=>{if(D.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`?y(e):e?y(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}}),Fn=s(`$ZodTransform`,(e,t)=>{D.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 In(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Ln=s(`$ZodOptional`,(e,t)=>{D.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=>In(e,r)):In(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Rn=s(`$ZodExactOptional`,(e,t)=>{Ln.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)}),zn=s(`$ZodNullable`,(e,t)=>{D.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)}),Bn=s(`$ZodDefault`,(e,t)=>{D.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=>Vn(e,t)):Vn(r,t)}});function Vn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Hn=s(`$ZodPrefault`,(e,t)=>{D.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))}),Un=s(`$ZodNonOptional`,(e,t)=>{D.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=>Wn(t,e)):Wn(i,e)}});function Wn(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 Gn=s(`$ZodCatch`,(e,t)=>{D.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=>w(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=>w(e,n,d()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Kn=s(`$ZodPipe`,(e,t)=>{D.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=>qn(e,t.in,n)):qn(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>qn(e,t.out,n)):qn(r,t.out,n)}});function qn(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 Jn=s(`$ZodPreprocess`,(e,t)=>{Kn.init(e,t)}),Yn=s(`$ZodReadonly`,(e,t)=>{D.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(Xn):Xn(r)}});function Xn(e){return e.value=Object.freeze(e.value),e}var Zn=s(`$ZodCustom`,(e,t)=>{E.init(e,t),D.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=>Qn(t,n,r,e));Qn(i,n,r,e)}});function Qn(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(T(e))}}var $n,er=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 tr(){return new er}($n=globalThis).__zod_globalRegistry??($n.__zod_globalRegistry=tr());var k=globalThis.__zod_globalRegistry;function nr(e,t){return new e({type:`string`,...x(t)})}function rr(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...x(t)})}function ir(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...x(t)})}function ar(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...x(t)})}function or(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...x(t)})}function sr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...x(t)})}function cr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...x(t)})}function lr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...x(t)})}function ur(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...x(t)})}function dr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...x(t)})}function fr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...x(t)})}function pr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...x(t)})}function mr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...x(t)})}function hr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...x(t)})}function gr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...x(t)})}function _r(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...x(t)})}function vr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...x(t)})}function yr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...x(t)})}function br(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...x(t)})}function xr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...x(t)})}function Sr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...x(t)})}function Cr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...x(t)})}function wr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...x(t)})}function Tr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...x(t)})}function Er(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...x(t)})}function Dr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...x(t)})}function Or(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...x(t)})}function kr(e,t){return new e({type:`number`,checks:[],...x(t)})}function Ar(e,t){return new e({type:`number`,coerce:!0,checks:[],...x(t)})}function jr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...x(t)})}function Mr(e,t){return new e({type:`boolean`,...x(t)})}function Nr(e,t){return new e({type:`null`,...x(t)})}function Pr(e){return new e({type:`any`})}function Fr(e){return new e({type:`unknown`})}function Ir(e,t){return new e({type:`never`,...x(t)})}function Lr(e,t){return new xt({check:`less_than`,...x(t),value:e,inclusive:!1})}function Rr(e,t){return new xt({check:`less_than`,...x(t),value:e,inclusive:!0})}function zr(e,t){return new St({check:`greater_than`,...x(t),value:e,inclusive:!1})}function Br(e,t){return new St({check:`greater_than`,...x(t),value:e,inclusive:!0})}function Vr(e,t){return new Ct({check:`multiple_of`,...x(t),value:e})}function Hr(e,t){return new Tt({check:`max_length`,...x(t),maximum:e})}function Ur(e,t){return new Et({check:`min_length`,...x(t),minimum:e})}function Wr(e,t){return new Dt({check:`length_equals`,...x(t),length:e})}function Gr(e,t){return new kt({check:`string_format`,format:`regex`,...x(t),pattern:e})}function Kr(e){return new At({check:`string_format`,format:`lowercase`,...x(e)})}function qr(e){return new jt({check:`string_format`,format:`uppercase`,...x(e)})}function Jr(e,t){return new Mt({check:`string_format`,format:`includes`,...x(t),includes:e})}function Yr(e,t){return new Nt({check:`string_format`,format:`starts_with`,...x(t),prefix:e})}function Xr(e,t){return new Pt({check:`string_format`,format:`ends_with`,...x(t),suffix:e})}function A(e){return new Ft({check:`overwrite`,tx:e})}function Zr(e){return A(t=>t.normalize(e))}function Qr(){return A(e=>e.trim())}function $r(){return A(e=>e.toLowerCase())}function ei(){return A(e=>e.toUpperCase())}function ti(){return A(e=>oe(e))}function ni(e,t,n){return new e({type:`array`,element:t,...x(n)})}function ri(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...x(n)})}function ii(e,t){let n=ai(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(T(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(T(r))}},e(t.value,t)),t);return n}function ai(e,t){let n=new E({check:`custom`,...x(t)});return n._zod.check=e,n}function oi(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??k,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 j(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,j(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`&&M(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 si(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 ci(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:ui(t,`input`,e.processors),output:ui(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function M(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 M(r.element,n);if(r.type===`set`)return M(r.valueType,n);if(r.type===`lazy`)return M(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 M(r.innerType,n);if(r.type===`intersection`)return M(r.left,n)||M(r.right,n);if(r.type===`record`||r.type===`map`)return M(r.keyType,n)||M(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:M(r.in,n)||M(r.out,n);if(r.type===`object`){for(let e in r.shape)if(M(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(M(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(M(e,n))return!0;return!!(r.rest&&M(r.rest,n))}return!1}var li=(e,t={})=>n=>{let r=oi({...n,processors:t});return j(e,r),si(r,e),ci(r,e)},ui=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=oi({...i??{},target:a,io:t,processors:n});return j(e,o),si(o,e),ci(o,e)},di={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},fi=(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=di[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}))])}},pi=(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)},mi=(e,t,n,r)=>{n.type=`boolean`},hi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},gi=(e,t,n,r)=>{n.not={}},_i=(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},vi=(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},yi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},bi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},xi=(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=j(a.element,t,{...r,path:[...r.path,`items`]})},Si=(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]=j(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=j(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ci=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>j(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},wi=(e,t,n,r)=>{let i=e._zod.def,a=j(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=j(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]]},Ti=(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=j(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=j(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=j(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)}},Ei=(e,t,n,r)=>{let i=e._zod.def,a=j(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`}]},Di=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Oi=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},ki=(e,t,n,r)=>{let i=e._zod.def;j(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)))},Ai=(e,t,n,r)=>{let i=e._zod.def;j(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},ji=(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;j(o,t,r);let s=t.seen.get(e);s.ref=o},Mi=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ni=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Pi=s(`ZodISODateTime`,(e,t)=>{Xt.init(e,t),R.init(e,t)});function N(e){return Tr(Pi,e)}var Fi=s(`ZodISODate`,(e,t)=>{Zt.init(e,t),R.init(e,t)});function Ii(e){return Er(Fi,e)}var Li=s(`ZodISOTime`,(e,t)=>{Qt.init(e,t),R.init(e,t)});function Ri(e){return Dr(Li,e)}var zi=s(`ZodISODuration`,(e,t)=>{$t.init(e,t),R.init(e,t)});function Bi(e){return Or(zi,e)}var P=s(`ZodError`,(e,t)=>{we.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>De(e,t)},flatten:{value:t=>Ee(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}),Vi=Oe(P),Hi=ke(P),Ui=Ae(P),Wi=Me(P),Gi=Pe(P),Ki=Fe(P),qi=Ie(P),Ji=Le(P),Yi=Re(P),Xi=ze(P),Zi=Be(P),Qi=Ve(P),$i=new WeakMap;function F(e,t,n){let r=Object.getPrototypeOf(e),i=$i.get(r);if(i||(i=new Set,$i.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 I=s(`ZodType`,(e,t)=>(D.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:ui(e,`input`),output:ui(e,`output`)}}),e.toJSONSchema=li(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Vi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ui(e,t,n),e.parseAsync=async(t,n)=>Hi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Wi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Gi(e,t,n),e.decode=(t,n)=>Ki(e,t,n),e.encodeAsync=async(t,n)=>qi(e,t,n),e.decodeAsync=async(t,n)=>Ji(e,t,n),e.safeEncode=(t,n)=>Yi(e,t,n),e.safeDecode=(t,n)=>Xi(e,t,n),e.safeEncodeAsync=async(t,n)=>Zi(e,t,n),e.safeDecodeAsync=async(t,n)=>Qi(e,t,n),F(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 b(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(mo(e,t))},superRefine(e,t){return this.check(ho(e,t))},overwrite(e){return this.check(A(e))},optional(){return Ja(this)},exactOptional(){return Xa(this)},nullable(){return Qa(this)},nullish(){return Ja(Qa(this))},nonoptional(e){return io(this,e)},array(){return W(this)},or(e){return K([this,e])},and(e){return Ba(this,e)},transform(e){return co(this,Ka(e))},default(e){return eo(this,e)},prefault(e){return no(this,e)},catch(e){return oo(this,e)},pipe(e){return co(this,e)},readonly(){return fo(this)},describe(e){let t=this.clone();return k.add(t,{description:e}),t},meta(...e){if(e.length===0)return k.get(this);let t=this.clone();return k.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 k.get(e)?.description},configurable:!0}),e)),ea=s(`_ZodString`,(e,t)=>{Rt.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,F(e,`_ZodString`,{regex(...e){return this.check(Gr(...e))},includes(...e){return this.check(Jr(...e))},startsWith(...e){return this.check(Yr(...e))},endsWith(...e){return this.check(Xr(...e))},min(...e){return this.check(Ur(...e))},max(...e){return this.check(Hr(...e))},length(...e){return this.check(Wr(...e))},nonempty(...e){return this.check(Ur(1,...e))},lowercase(e){return this.check(Kr(e))},uppercase(e){return this.check(qr(e))},trim(){return this.check(Qr())},normalize(...e){return this.check(Zr(...e))},toLowerCase(){return this.check($r())},toUpperCase(){return this.check(ei())},slugify(){return this.check(ti())}})}),ta=s(`ZodString`,(e,t)=>{Rt.init(e,t),ea.init(e,t),e.email=t=>e.check(rr(na,t)),e.url=t=>e.check(lr(ia,t)),e.jwt=t=>e.check(wr(ba,t)),e.emoji=t=>e.check(ur(oa,t)),e.guid=t=>e.check(ir(ra,t)),e.uuid=t=>e.check(ar(z,t)),e.uuidv4=t=>e.check(or(z,t)),e.uuidv6=t=>e.check(sr(z,t)),e.uuidv7=t=>e.check(cr(z,t)),e.nanoid=t=>e.check(dr(sa,t)),e.guid=t=>e.check(ir(ra,t)),e.cuid=t=>e.check(fr(ca,t)),e.cuid2=t=>e.check(pr(la,t)),e.ulid=t=>e.check(mr(ua,t)),e.base64=t=>e.check(xr(_a,t)),e.base64url=t=>e.check(Sr(va,t)),e.xid=t=>e.check(hr(da,t)),e.ksuid=t=>e.check(gr(fa,t)),e.ipv4=t=>e.check(_r(pa,t)),e.ipv6=t=>e.check(vr(ma,t)),e.cidrv4=t=>e.check(yr(ha,t)),e.cidrv6=t=>e.check(br(ga,t)),e.e164=t=>e.check(Cr(ya,t)),e.datetime=t=>e.check(N(t)),e.date=t=>e.check(Ii(t)),e.time=t=>e.check(Ri(t)),e.duration=t=>e.check(Bi(t))});function L(e){return nr(ta,e)}var R=s(`ZodStringFormat`,(e,t)=>{O.init(e,t),ea.init(e,t)}),na=s(`ZodEmail`,(e,t)=>{Vt.init(e,t),R.init(e,t)}),ra=s(`ZodGUID`,(e,t)=>{zt.init(e,t),R.init(e,t)}),z=s(`ZodUUID`,(e,t)=>{Bt.init(e,t),R.init(e,t)});function B(e){return ar(z,e)}var ia=s(`ZodURL`,(e,t)=>{Ht.init(e,t),R.init(e,t)});function aa(e){return lr(ia,e)}var oa=s(`ZodEmoji`,(e,t)=>{Ut.init(e,t),R.init(e,t)}),sa=s(`ZodNanoID`,(e,t)=>{Wt.init(e,t),R.init(e,t)}),ca=s(`ZodCUID`,(e,t)=>{Gt.init(e,t),R.init(e,t)}),la=s(`ZodCUID2`,(e,t)=>{Kt.init(e,t),R.init(e,t)}),ua=s(`ZodULID`,(e,t)=>{qt.init(e,t),R.init(e,t)}),da=s(`ZodXID`,(e,t)=>{Jt.init(e,t),R.init(e,t)}),fa=s(`ZodKSUID`,(e,t)=>{Yt.init(e,t),R.init(e,t)}),pa=s(`ZodIPv4`,(e,t)=>{en.init(e,t),R.init(e,t)}),ma=s(`ZodIPv6`,(e,t)=>{tn.init(e,t),R.init(e,t)}),ha=s(`ZodCIDRv4`,(e,t)=>{nn.init(e,t),R.init(e,t)}),ga=s(`ZodCIDRv6`,(e,t)=>{rn.init(e,t),R.init(e,t)}),_a=s(`ZodBase64`,(e,t)=>{on.init(e,t),R.init(e,t)}),va=s(`ZodBase64URL`,(e,t)=>{cn.init(e,t),R.init(e,t)}),ya=s(`ZodE164`,(e,t)=>{ln.init(e,t),R.init(e,t)}),ba=s(`ZodJWT`,(e,t)=>{dn.init(e,t),R.init(e,t)}),xa=s(`ZodNumber`,(e,t)=>{fn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r),F(e,`ZodNumber`,{gt(e,t){return this.check(zr(e,t))},gte(e,t){return this.check(Br(e,t))},min(e,t){return this.check(Br(e,t))},lt(e,t){return this.check(Lr(e,t))},lte(e,t){return this.check(Rr(e,t))},max(e,t){return this.check(Rr(e,t))},int(e){return this.check(Ca(e))},safe(e){return this.check(Ca(e))},positive(e){return this.check(zr(0,e))},nonnegative(e){return this.check(Br(0,e))},negative(e){return this.check(Lr(0,e))},nonpositive(e){return this.check(Rr(0,e))},multipleOf(e,t){return this.check(Vr(e,t))},step(e,t){return this.check(Vr(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 V(e){return kr(xa,e)}var Sa=s(`ZodNumberFormat`,(e,t)=>{pn.init(e,t),xa.init(e,t)});function Ca(e){return jr(Sa,e)}var wa=s(`ZodBoolean`,(e,t)=>{mn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r)});function H(e){return Mr(wa,e)}var Ta=s(`ZodNull`,(e,t)=>{hn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r)});function Ea(e){return Nr(Ta,e)}var Da=s(`ZodAny`,(e,t)=>{gn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Oa(){return Pr(Da)}var ka=s(`ZodUnknown`,(e,t)=>{_n.init(e,t),I.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function U(){return Fr(ka)}var Aa=s(`ZodNever`,(e,t)=>{vn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r)});function ja(e){return Ir(Aa,e)}var Ma=s(`ZodArray`,(e,t)=>{bn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.element=t.element,F(e,`ZodArray`,{min(e,t){return this.check(Ur(e,t))},nonempty(e){return this.check(Ur(1,e))},max(e,t){return this.check(Hr(e,t))},length(e,t){return this.check(Wr(e,t))},unwrap(){return this.element}})});function W(e,t){return ni(Ma,e,t)}var Na=s(`ZodObject`,(e,t)=>{Tn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r),m(e,`shape`,()=>t.shape),F(e,`ZodObject`,{keyof(){return q(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:U()})},loose(){return this.clone({...this._zod.def,catchall:U()})},strict(){return this.clone({...this._zod.def,catchall:ja()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return he(this,e)},safeExtend(e){return ge(this,e)},merge(e){return _e(this,e)},pick(e){return pe(this,e)},omit(e){return me(this,e)},partial(...e){return ve(qa,this,e[0])},required(...e){return ye(ro,this,e[0])}})});function G(e,t){return new Na({type:`object`,shape:e??{},...x(t)})}function Pa(e,t){return new Na({type:`object`,shape:e,catchall:ja(),...x(t)})}function Fa(e,t){return new Na({type:`object`,shape:e,catchall:U(),...x(t)})}var Ia=s(`ZodUnion`,(e,t)=>{Dn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e.options=t.options});function K(e,t){return new Ia({type:`union`,options:e,...x(t)})}var La=s(`ZodDiscriminatedUnion`,(e,t)=>{Ia.init(e,t),On.init(e,t)});function Ra(e,t,n){return new La({type:`union`,options:t,discriminator:e,...x(n)})}var za=s(`ZodIntersection`,(e,t)=>{kn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r)});function Ba(e,t){return new za({type:`intersection`,left:e,right:t})}var Va=s(`ZodRecord`,(e,t)=>{Mn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Ha(e,t,n){return!t||!t._zod?new Va({type:`record`,keyType:L(),valueType:e,...x(t)}):new Va({type:`record`,keyType:e,valueType:t,...x(n)})}var Ua=s(`ZodEnum`,(e,t)=>{Nn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(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 Ua({...t,checks:[],...x(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 Ua({...t,checks:[],...x(r),entries:i})}});function q(e,t){return new Ua({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...x(t)})}var Wa=s(`ZodLiteral`,(e,t)=>{Pn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(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 J(e,t){return new Wa({type:`literal`,values:Array.isArray(e)?e:[e],...x(t)})}var Ga=s(`ZodTransform`,(e,t)=>{Fn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(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(T(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(T(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 Ka(e){return new Ga({type:`transform`,transform:e})}var qa=s(`ZodOptional`,(e,t)=>{Ln.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ja(e){return new qa({type:`optional`,innerType:e})}var Ya=s(`ZodExactOptional`,(e,t)=>{Rn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Xa(e){return new Ya({type:`optional`,innerType:e})}var Za=s(`ZodNullable`,(e,t)=>{zn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qa(e){return new Za({type:`nullable`,innerType:e})}var $a=s(`ZodDefault`,(e,t)=>{Bn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function eo(e,t){return new $a({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():le(t)}})}var to=s(`ZodPrefault`,(e,t)=>{Hn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function no(e,t){return new to({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():le(t)}})}var ro=s(`ZodNonOptional`,(e,t)=>{Un.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function io(e,t){return new ro({type:`nonoptional`,innerType:e,...x(t)})}var ao=s(`ZodCatch`,(e,t)=>{Gn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function oo(e,t){return new ao({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var so=s(`ZodPipe`,(e,t)=>{Kn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.in=t.in,e.out=t.out});function co(e,t){return new so({type:`pipe`,in:e,out:t})}var lo=s(`ZodPreprocess`,(e,t)=>{so.init(e,t),Jn.init(e,t)}),uo=s(`ZodReadonly`,(e,t)=>{Yn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fo(e){return new uo({type:`readonly`,innerType:e})}var po=s(`ZodCustom`,(e,t)=>{Zn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r)});function mo(e,t={}){return ri(po,e,t)}function ho(e,t){return ii(e,t)}function go(e,t){return new lo({type:`pipe`,in:Ka(e),out:t})}function _o(e){return Ar(xa,e)}var Y={questions:4,id:64,header:12,question:400,minOptions:2,maxOptions:4,label:60,description:280,context:2e4},vo=L().min(1).max(Y.context),yo=G({label:L().min(1).max(Y.label),description:L().max(Y.description).optional()}).strict(),bo=G({id:L().min(1).max(Y.id).optional(),header:L().min(1).max(Y.header),question:L().min(1).max(Y.question),options:W(yo).min(Y.minOptions).max(Y.maxOptions).refine(e=>new Set(e.map(e=>e.label)).size===e.length,{message:`option labels must be unique within a question`}).optional(),multiSelect:H().optional(),allowFreeText:H().optional()}).strict(),xo=G({context:vo.optional(),questions:W(bo).min(1).max(Y.questions).refine(e=>new Set(e.map(e=>e.question)).size===e.length,{message:`question texts must be unique`})}).strict(),So=q([`low`,`medium`,`high`,`xhigh`,`max`]),Co=L().max(32).optional(),wo=q([`family`,`peer`]),To=G({senderRunId:B(),recipientRunId:B(),kind:q([`request`,`progress`,`follow-up`,`reply`]),requestId:B().optional(),relationship:wo.optional()}).strict(),X=To.extend({id:B(),text:L().min(1).max(1e5),createdAt:N(),deadline:N().optional(),requestHash:L().regex(/^[0-9a-f]{64}$/),state:q([`accepted`,`continuation-required`,`destroyed`,`late`]),resumed:J(!0).optional(),instruction:L().max(2048).optional(),question:xo.optional()}),Z=G({requestId:B(),status:q([`replied`,`replied-late`,`completed-without-reply`,`failed`,`cancelled`,`destroyed`,`timed-out`,`sender-closed`,`human-fallback`,`deleted`]),observedAt:N(),replyId:B().optional()}).strict(),Eo=G({messages:W(X).max(1024),outcomes:W(Z).max(1024)}).strict(),Do=L().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`);Eo.extend({hint:L().optional(),nextBefore:Do.optional()}),G({messages:W(X).max(32),outcomes:W(Z).max(32),receiptId:B().optional(),expiresAt:N().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`}),G({receiptId:B()}).strict(),G({receiptId:B(),status:q([`acknowledged`,`already-acknowledged`,`released`])}).strict(),G({id:B(),recipientRunId:B(),kind:To.shape.kind,requestId:B().optional(),text:L().min(1).max(1e5).refine(e=>e.trim().length>0),timeoutSeconds:V().int().min(1).max(86400).default(600),resume:H().optional(),model:L().trim().min(1).max(512).optional(),effort:Co}).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`}).refine(e=>e.resume===!0||e.model===void 0&&e.effort===void 0,{message:`--model and --effort require --resume`});var Oo=q([`applied`,`unchanged`,`refused`,`unknown`]),ko=G({activeMessages:V().int().nonnegative(),activeMessageLimit:V().int().positive(),openRequests:V().int().nonnegative(),openRequestLimit:V().int().positive(),recipientInbox:V().int().nonnegative().optional(),inboxLimit:V().int().positive(),warning:L().min(1).optional()}).strict();G({message:X,delivery:q([`queued`,`delivered`,`consumed`,`not-delivered`]),outcome:Z.optional(),effect:Oo.optional(),capacity:ko.optional()}).strict(),G({recipientRunId:B(),before:Do.optional()}).strict(),G({requestId:B()}).strict(),G({requestIds:W(B()).min(1).max(32).refine(e=>new Set(e).size===e.length),mode:q([`one`,`any`,`all`]).optional(),timeoutSeconds:V().int().min(1).max(7200).default(600)}).strict().refine(e=>e.mode!==`one`||e.requestIds.length===1,{message:`one requires exactly one request`});var Ao=G({receiptId:B(),generation:B(),expiresAt:N(),acknowledgedAt:N().optional(),memberIds:W(B()).min(1).max(32).refine(e=>new Set(e).size===e.length).optional()}).strict(),jo=G({conversation:To.optional(),id:B(),source:q([`agent`,`lifecycle`]),parentRunId:B(),text:L().min(1).max(1e5),createdAt:N(),deliveredAt:N().optional(),consumedAt:N().optional(),awaitingRead:J(!0).optional(),inboxClaim:Ao.optional(),purpose:q([`completion-refusal`,`undelivered-question`]).optional(),requestHash:L().regex(/^[0-9a-f]{64}$/).optional(),deadline:N().optional()}).strict(),Mo=G({workerId:B(),status:q([`review`,`done`,`failed`,`cancelled`]),observedAt:N(),summary:L().max(4e3).optional(),revision:V().int().nonnegative().optional()}).strict(),No=q([`one`,`any`,`all`]),Q=Fa({seq:V(),ts:L(),stepId:L().optional(),type:L()}),Po=Q.extend({type:J(`conversation-message`),message:X,delivery:q([`queued`,`delivered`,`consumed`,`not-delivered`]),deliveredAt:N().optional(),consumedAt:N().optional()}),Fo=Q.extend({type:J(`request-outcome`),outcome:Z}),Io=Q.extend({type:J(`agent-input`),input:jo}),Lo=Q.extend({type:J(`human-input-delivered`),askSeq:V().int().nonnegative(),source:q([`human`,`parent`,`cezar`]).optional()}),Ro=Q.extend({type:J(`human-ask-closed`),askSeq:V().int().nonnegative(),reason:q([`finish`,`superseded`,`parent-stopped`,`worker-stopped`,`undeliverable`])});Q.extend({type:J(`worker-question-routed`),askSeq:V().int().nonnegative(),messageId:B(),parentRunId:B()}),Q.extend({type:J(`worker-question-fallback`),askSeq:V().int().nonnegative(),reason:L().min(1).max(200)}),Q.extend({type:J(`worker-question-undelivered`),askSeq:V().int().nonnegative(),reason:L().min(1).max(200)}),Q.extend({type:J(`worker-outcome`),outcome:Mo});var zo=G({id:L().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/)}),$=L().min(1).max(2048);G({cursor:$.optional()}),G({cursor:$.optional(),afterSeq:_o().int().nonnegative().optional()});var Bo=G({seq:V(),ts:L(),stepId:L().optional(),type:L()}).catchall(Oa()),Vo=G({events:W(Bo),itemCount:V().int().min(0).max(100),olderCursor:$.optional(),newerCursor:$.optional(),liveCursor:$,asOfSeq:V().int().nonnegative(),hasOlder:H()}),Ho=G({contextEvents:W(Bo),asOfSeq:V().int().nonnegative()}),Uo=G({checkoutId:L().optional(),name:L(),phase:q([`cloning`,`done`,`error`]),line:L().optional(),error:L().optional(),warning:L().optional()}),Wo=1024*1024,Go=G({projectId:L().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/),runId:zo.shape.id,cursor:$.optional(),afterSeq:V().int().nonnegative().safe()});G({runs:W(Go).min(1).max(32)}).refine(({runs:e})=>new Set(e.map(e=>`${e.projectId}/${e.runId}`)).size===e.length,{message:`duplicate run demand`});var Ko=Go.pick({projectId:!0,runId:!0}),qo=Ko.extend({type:q([`error`,`reset`]),status:K([J(400),J(404),J(409),J(413),J(503)]),error:L()}),Jo=K([Ko.extend({type:J(`batch`),events:W(Bo).max(256),cursor:$,afterSeq:V().int().nonnegative(),hasMore:H()}),qo]),Yo=G({generation:L(),results:W(Jo)}),Xo=K([G({type:J(`ready`),generation:L()}),G({type:J(`ping`)}),Ko.extend({type:J(`event`),name:q([`run-event`,`ui-event`]),event:Bo}),qo]),Zo=`cezar-live-v3`,Qo=15e3,$o=5e3;function es(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 ts=Ra(`kind`,[G({kind:J(`workspace`)}),Go.extend({kind:J(`run`)}),G({kind:J(`topic`),topic:L().min(1).max(128)}),G({kind:J(`read`),path:L().max(4096).refine(es),intervalMs:V().int().min(1e3).max(2147483647)})]),ns=G({id:L().min(1).max(128),demand:ts}),rs=G({version:J(3),documentId:L().min(1).max(128),epoch:V().int().nonnegative()}),is=Ra(`type`,[rs.extend({type:J(`sync`),entries:W(ns).max(64),workspaceReady:J(!0).optional()}).refine(e=>new Set(e.entries.map(e=>e.id)).size===e.entries.length),rs.extend({type:J(`ack`),id:L(),seq:V().int().nonnegative()}),rs.extend({type:J(`refresh`),id:L()})]),as=G({event:L(),data:L(),id:L()}),os=Ra(`type`,[G({type:J(`unavailable`),version:J(3),epoch:V(),reason:L()}),G({type:J(`hello`),version:J(3)}),G({type:J(`alive`),version:J(3),epoch:V()}),G({type:J(`frame`),version:J(3),epoch:V(),id:L(),frame:K([as,Xo])}),G({type:J(`value`),version:J(3),epoch:V(),id:L(),value:U(),error:L().optional()}),G({type:J(`reset`),version:J(3),epoch:V(),id:L(),reason:L()})]),ss=e=>`${e.projectId}/${e.runId}`,cs=`live channel refused`;export{_o as A,G as B,jo as C,So as D,Co as E,Ra as F,K as G,Ha as H,J as I,B as J,U as K,Fa as L,Ea as M,W as N,vo as O,H as P,t as Q,ja as R,No as S,Z as T,Pa as U,go as V,L as W,Xe as X,N as Y,a as Z,Lo as _,es as a,Vo as b,os as c,Xo as d,Wo as f,Ro as g,Po as h,$o as i,q as j,xo as k,ss as l,Uo as m,Qo as n,ts as o,Io as p,aa as q,Zo as r,is as s,cs as t,Yo as u,Fo as v,Eo as w,Mo as x,Ho as y,V 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 ci(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:ui(t,`input`,e.processors),output:ui(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function M(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 M(r.element,n);if(r.type===`set`)return M(r.valueType,n);if(r.type===`lazy`)return M(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 M(r.innerType,n);if(r.type===`intersection`)return M(r.left,n)||M(r.right,n);if(r.type===`record`||r.type===`map`)return M(r.keyType,n)||M(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:M(r.in,n)||M(r.out,n);if(r.type===`object`){for(let e in r.shape)if(M(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(M(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(M(e,n))return!0;return!!(r.rest&&M(r.rest,n))}return!1}var li=(e,t={})=>n=>{let r=oi({...n,processors:t});return j(e,r),si(r,e),ci(r,e)},ui=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=oi({...i??{},target:a,io:t,processors:n});return j(e,o),si(o,e),ci(o,e)},di={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},fi=(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=di[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}))])}},pi=(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)},mi=(e,t,n,r)=>{n.type=`boolean`},hi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},gi=(e,t,n,r)=>{n.not={}},_i=(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},vi=(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},yi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},bi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},xi=(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=j(a.element,t,{...r,path:[...r.path,`items`]})},Si=(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]=j(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=j(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ci=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>j(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},wi=(e,t,n,r)=>{let i=e._zod.def,a=j(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=j(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]]},Ti=(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=j(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=j(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=j(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)}},Ei=(e,t,n,r)=>{let i=e._zod.def,a=j(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`}]},Di=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Oi=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},ki=(e,t,n,r)=>{let i=e._zod.def;j(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)))},Ai=(e,t,n,r)=>{let i=e._zod.def;j(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},ji=(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;j(o,t,r);let s=t.seen.get(e);s.ref=o},Mi=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ni=(e,t,n,r)=>{let i=e._zod.def;j(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Pi=s(`ZodISODateTime`,(e,t)=>{Xt.init(e,t),R.init(e,t)});function N(e){return Tr(Pi,e)}var Fi=s(`ZodISODate`,(e,t)=>{Zt.init(e,t),R.init(e,t)});function Ii(e){return Er(Fi,e)}var Li=s(`ZodISOTime`,(e,t)=>{Qt.init(e,t),R.init(e,t)});function Ri(e){return Dr(Li,e)}var zi=s(`ZodISODuration`,(e,t)=>{$t.init(e,t),R.init(e,t)});function Bi(e){return Or(zi,e)}var P=s(`ZodError`,(e,t)=>{we.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>De(e,t)},flatten:{value:t=>Ee(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}),Vi=Oe(P),Hi=ke(P),Ui=Ae(P),Wi=Me(P),Gi=Pe(P),Ki=Fe(P),qi=Ie(P),Ji=Le(P),Yi=Re(P),Xi=ze(P),Zi=Be(P),Qi=Ve(P),$i=new WeakMap;function F(e,t,n){let r=Object.getPrototypeOf(e),i=$i.get(r);if(i||(i=new Set,$i.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 I=s(`ZodType`,(e,t)=>(D.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:ui(e,`input`),output:ui(e,`output`)}}),e.toJSONSchema=li(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Vi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ui(e,t,n),e.parseAsync=async(t,n)=>Hi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Wi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Gi(e,t,n),e.decode=(t,n)=>Ki(e,t,n),e.encodeAsync=async(t,n)=>qi(e,t,n),e.decodeAsync=async(t,n)=>Ji(e,t,n),e.safeEncode=(t,n)=>Yi(e,t,n),e.safeDecode=(t,n)=>Xi(e,t,n),e.safeEncodeAsync=async(t,n)=>Zi(e,t,n),e.safeDecodeAsync=async(t,n)=>Qi(e,t,n),F(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 b(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(mo(e,t))},superRefine(e,t){return this.check(ho(e,t))},overwrite(e){return this.check(A(e))},optional(){return Ja(this)},exactOptional(){return Xa(this)},nullable(){return Qa(this)},nullish(){return Ja(Qa(this))},nonoptional(e){return io(this,e)},array(){return W(this)},or(e){return K([this,e])},and(e){return Ba(this,e)},transform(e){return co(this,Ka(e))},default(e){return eo(this,e)},prefault(e){return no(this,e)},catch(e){return oo(this,e)},pipe(e){return co(this,e)},readonly(){return fo(this)},describe(e){let t=this.clone();return k.add(t,{description:e}),t},meta(...e){if(e.length===0)return k.get(this);let t=this.clone();return k.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 k.get(e)?.description},configurable:!0}),e)),ea=s(`_ZodString`,(e,t)=>{Rt.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,F(e,`_ZodString`,{regex(...e){return this.check(Gr(...e))},includes(...e){return this.check(Jr(...e))},startsWith(...e){return this.check(Yr(...e))},endsWith(...e){return this.check(Xr(...e))},min(...e){return this.check(Ur(...e))},max(...e){return this.check(Hr(...e))},length(...e){return this.check(Wr(...e))},nonempty(...e){return this.check(Ur(1,...e))},lowercase(e){return this.check(Kr(e))},uppercase(e){return this.check(qr(e))},trim(){return this.check(Qr())},normalize(...e){return this.check(Zr(...e))},toLowerCase(){return this.check($r())},toUpperCase(){return this.check(ei())},slugify(){return this.check(ti())}})}),ta=s(`ZodString`,(e,t)=>{Rt.init(e,t),ea.init(e,t),e.email=t=>e.check(rr(na,t)),e.url=t=>e.check(lr(ia,t)),e.jwt=t=>e.check(wr(ba,t)),e.emoji=t=>e.check(ur(oa,t)),e.guid=t=>e.check(ir(ra,t)),e.uuid=t=>e.check(ar(z,t)),e.uuidv4=t=>e.check(or(z,t)),e.uuidv6=t=>e.check(sr(z,t)),e.uuidv7=t=>e.check(cr(z,t)),e.nanoid=t=>e.check(dr(sa,t)),e.guid=t=>e.check(ir(ra,t)),e.cuid=t=>e.check(fr(ca,t)),e.cuid2=t=>e.check(pr(la,t)),e.ulid=t=>e.check(mr(ua,t)),e.base64=t=>e.check(xr(_a,t)),e.base64url=t=>e.check(Sr(va,t)),e.xid=t=>e.check(hr(da,t)),e.ksuid=t=>e.check(gr(fa,t)),e.ipv4=t=>e.check(_r(pa,t)),e.ipv6=t=>e.check(vr(ma,t)),e.cidrv4=t=>e.check(yr(ha,t)),e.cidrv6=t=>e.check(br(ga,t)),e.e164=t=>e.check(Cr(ya,t)),e.datetime=t=>e.check(N(t)),e.date=t=>e.check(Ii(t)),e.time=t=>e.check(Ri(t)),e.duration=t=>e.check(Bi(t))});function L(e){return nr(ta,e)}var R=s(`ZodStringFormat`,(e,t)=>{O.init(e,t),ea.init(e,t)}),na=s(`ZodEmail`,(e,t)=>{Vt.init(e,t),R.init(e,t)}),ra=s(`ZodGUID`,(e,t)=>{zt.init(e,t),R.init(e,t)}),z=s(`ZodUUID`,(e,t)=>{Bt.init(e,t),R.init(e,t)});function B(e){return ar(z,e)}var ia=s(`ZodURL`,(e,t)=>{Ht.init(e,t),R.init(e,t)});function aa(e){return lr(ia,e)}var oa=s(`ZodEmoji`,(e,t)=>{Ut.init(e,t),R.init(e,t)}),sa=s(`ZodNanoID`,(e,t)=>{Wt.init(e,t),R.init(e,t)}),ca=s(`ZodCUID`,(e,t)=>{Gt.init(e,t),R.init(e,t)}),la=s(`ZodCUID2`,(e,t)=>{Kt.init(e,t),R.init(e,t)}),ua=s(`ZodULID`,(e,t)=>{qt.init(e,t),R.init(e,t)}),da=s(`ZodXID`,(e,t)=>{Jt.init(e,t),R.init(e,t)}),fa=s(`ZodKSUID`,(e,t)=>{Yt.init(e,t),R.init(e,t)}),pa=s(`ZodIPv4`,(e,t)=>{en.init(e,t),R.init(e,t)}),ma=s(`ZodIPv6`,(e,t)=>{tn.init(e,t),R.init(e,t)}),ha=s(`ZodCIDRv4`,(e,t)=>{nn.init(e,t),R.init(e,t)}),ga=s(`ZodCIDRv6`,(e,t)=>{rn.init(e,t),R.init(e,t)}),_a=s(`ZodBase64`,(e,t)=>{on.init(e,t),R.init(e,t)}),va=s(`ZodBase64URL`,(e,t)=>{cn.init(e,t),R.init(e,t)}),ya=s(`ZodE164`,(e,t)=>{ln.init(e,t),R.init(e,t)}),ba=s(`ZodJWT`,(e,t)=>{dn.init(e,t),R.init(e,t)}),xa=s(`ZodNumber`,(e,t)=>{fn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r),F(e,`ZodNumber`,{gt(e,t){return this.check(zr(e,t))},gte(e,t){return this.check(Br(e,t))},min(e,t){return this.check(Br(e,t))},lt(e,t){return this.check(Lr(e,t))},lte(e,t){return this.check(Rr(e,t))},max(e,t){return this.check(Rr(e,t))},int(e){return this.check(Ca(e))},safe(e){return this.check(Ca(e))},positive(e){return this.check(zr(0,e))},nonnegative(e){return this.check(Br(0,e))},negative(e){return this.check(Lr(0,e))},nonpositive(e){return this.check(Rr(0,e))},multipleOf(e,t){return this.check(Vr(e,t))},step(e,t){return this.check(Vr(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 V(e){return kr(xa,e)}var Sa=s(`ZodNumberFormat`,(e,t)=>{pn.init(e,t),xa.init(e,t)});function Ca(e){return jr(Sa,e)}var wa=s(`ZodBoolean`,(e,t)=>{mn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r)});function H(e){return Mr(wa,e)}var Ta=s(`ZodNull`,(e,t)=>{hn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r)});function Ea(e){return Nr(Ta,e)}var Da=s(`ZodAny`,(e,t)=>{gn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Oa(){return Pr(Da)}var ka=s(`ZodUnknown`,(e,t)=>{_n.init(e,t),I.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function U(){return Fr(ka)}var Aa=s(`ZodNever`,(e,t)=>{vn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r)});function ja(e){return Ir(Aa,e)}var Ma=s(`ZodArray`,(e,t)=>{bn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.element=t.element,F(e,`ZodArray`,{min(e,t){return this.check(Ur(e,t))},nonempty(e){return this.check(Ur(1,e))},max(e,t){return this.check(Hr(e,t))},length(e,t){return this.check(Wr(e,t))},unwrap(){return this.element}})});function W(e,t){return ni(Ma,e,t)}var Na=s(`ZodObject`,(e,t)=>{Tn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r),m(e,`shape`,()=>t.shape),F(e,`ZodObject`,{keyof(){return q(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:U()})},loose(){return this.clone({...this._zod.def,catchall:U()})},strict(){return this.clone({...this._zod.def,catchall:ja()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return he(this,e)},safeExtend(e){return ge(this,e)},merge(e){return _e(this,e)},pick(e){return pe(this,e)},omit(e){return me(this,e)},partial(...e){return ve(qa,this,e[0])},required(...e){return ye(ro,this,e[0])}})});function G(e,t){return new Na({type:`object`,shape:e??{},...x(t)})}function Pa(e,t){return new Na({type:`object`,shape:e,catchall:ja(),...x(t)})}function Fa(e,t){return new Na({type:`object`,shape:e,catchall:U(),...x(t)})}var Ia=s(`ZodUnion`,(e,t)=>{Dn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e.options=t.options});function K(e,t){return new Ia({type:`union`,options:e,...x(t)})}var La=s(`ZodDiscriminatedUnion`,(e,t)=>{Ia.init(e,t),On.init(e,t)});function Ra(e,t,n){return new La({type:`union`,options:t,discriminator:e,...x(n)})}var za=s(`ZodIntersection`,(e,t)=>{kn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r)});function Ba(e,t){return new za({type:`intersection`,left:e,right:t})}var Va=s(`ZodRecord`,(e,t)=>{Mn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Ha(e,t,n){return!t||!t._zod?new Va({type:`record`,keyType:L(),valueType:e,...x(t)}):new Va({type:`record`,keyType:e,valueType:t,...x(n)})}var Ua=s(`ZodEnum`,(e,t)=>{Nn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(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 Ua({...t,checks:[],...x(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 Ua({...t,checks:[],...x(r),entries:i})}});function q(e,t){return new Ua({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...x(t)})}var Wa=s(`ZodLiteral`,(e,t)=>{Pn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(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 J(e,t){return new Wa({type:`literal`,values:Array.isArray(e)?e:[e],...x(t)})}var Ga=s(`ZodTransform`,(e,t)=>{Fn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(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(T(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(T(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 Ka(e){return new Ga({type:`transform`,transform:e})}var qa=s(`ZodOptional`,(e,t)=>{Ln.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ja(e){return new qa({type:`optional`,innerType:e})}var Ya=s(`ZodExactOptional`,(e,t)=>{Rn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Xa(e){return new Ya({type:`optional`,innerType:e})}var Za=s(`ZodNullable`,(e,t)=>{zn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qa(e){return new Za({type:`nullable`,innerType:e})}var $a=s(`ZodDefault`,(e,t)=>{Bn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function eo(e,t){return new $a({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():le(t)}})}var to=s(`ZodPrefault`,(e,t)=>{Hn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function no(e,t){return new to({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():le(t)}})}var ro=s(`ZodNonOptional`,(e,t)=>{Un.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function io(e,t){return new ro({type:`nonoptional`,innerType:e,...x(t)})}var ao=s(`ZodCatch`,(e,t)=>{Gn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function oo(e,t){return new ao({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var so=s(`ZodPipe`,(e,t)=>{Kn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.in=t.in,e.out=t.out});function co(e,t){return new so({type:`pipe`,in:e,out:t})}var lo=s(`ZodPreprocess`,(e,t)=>{so.init(e,t),Jn.init(e,t)}),uo=s(`ZodReadonly`,(e,t)=>{Yn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fo(e){return new uo({type:`readonly`,innerType:e})}var po=s(`ZodCustom`,(e,t)=>{Zn.init(e,t),I.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r)});function mo(e,t={}){return ri(po,e,t)}function ho(e,t){return ii(e,t)}function go(e,t){return new lo({type:`pipe`,in:Ka(e),out:t})}function _o(e){return Ar(xa,e)}var Y={questions:4,id:64,header:12,question:400,minOptions:2,maxOptions:4,label:60,description:280,context:2e4},vo=L().min(1).max(Y.context),yo=G({label:L().min(1).max(Y.label),description:L().max(Y.description).optional()}).strict(),bo=G({id:L().min(1).max(Y.id).optional(),header:L().min(1).max(Y.header),question:L().min(1).max(Y.question),options:W(yo).min(Y.minOptions).max(Y.maxOptions).refine(e=>new Set(e.map(e=>e.label)).size===e.length,{message:`option labels must be unique within a question`}).optional(),multiSelect:H().optional(),allowFreeText:H().optional()}).strict(),xo=G({context:vo.optional(),questions:W(bo).min(1).max(Y.questions).refine(e=>new Set(e.map(e=>e.question)).size===e.length,{message:`question texts must be unique`})}).strict(),So=q([`low`,`medium`,`high`,`xhigh`,`max`]),Co=L().max(32).optional(),wo=q([`family`,`peer`]),To=G({senderRunId:B(),recipientRunId:B(),kind:q([`request`,`progress`,`follow-up`,`reply`]),requestId:B().optional(),relationship:wo.optional()}).strict(),Eo=To.extend({id:B(),text:L().min(1).max(1e5),createdAt:N(),deadline:N().optional(),requestHash:L().regex(/^[0-9a-f]{64}$/),state:q([`accepted`,`continuation-required`,`destroyed`,`late`]),resumed:J(!0).optional(),instruction:L().max(2048).optional(),question:xo.optional()}),X=G({requestId:B(),status:q([`replied`,`replied-late`,`completed-without-reply`,`failed`,`cancelled`,`destroyed`,`timed-out`,`sender-closed`,`human-fallback`,`deleted`]),observedAt:N(),replyId:B().optional()}).strict(),Do=G({messages:W(Eo).max(1024),outcomes:W(X).max(1024)}).strict(),Oo=L().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`);Do.extend({hint:L().optional(),nextBefore:Oo.optional()}),G({messages:W(Eo).max(32),outcomes:W(X).max(32),receiptId:B().optional(),expiresAt:N().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`}),G({receiptId:B()}).strict(),G({receiptId:B(),status:q([`acknowledged`,`already-acknowledged`,`released`])}).strict(),G({id:B(),recipientRunId:B(),kind:To.shape.kind,requestId:B().optional(),text:L().min(1).max(1e5).refine(e=>e.trim().length>0),timeoutSeconds:V().int().min(1).max(86400).default(600),resume:H().optional(),model:L().trim().min(1).max(512).optional(),effort:Co}).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`}).refine(e=>e.resume===!0||e.model===void 0&&e.effort===void 0,{message:`--model and --effort require --resume`});var ko=q([`applied`,`unchanged`,`refused`,`unknown`]),Ao=G({activeMessages:V().int().nonnegative(),activeMessageLimit:V().int().positive(),openRequests:V().int().nonnegative(),openRequestLimit:V().int().positive(),recipientInbox:V().int().nonnegative().optional(),inboxLimit:V().int().positive(),warning:L().min(1).optional()}).strict();G({message:Eo,delivery:q([`queued`,`delivered`,`consumed`,`not-delivered`]),outcome:X.optional(),effect:ko.optional(),capacity:Ao.optional()}).strict(),G({recipientRunId:B(),before:Oo.optional()}).strict(),G({requestId:B()}).strict(),G({requestIds:W(B()).min(1).max(32).refine(e=>new Set(e).size===e.length),mode:q([`one`,`any`,`all`]).optional(),timeoutSeconds:V().int().min(1).max(7200).default(600)}).strict().refine(e=>e.mode!==`one`||e.requestIds.length===1,{message:`one requires exactly one request`});var jo=G({receiptId:B(),generation:B(),expiresAt:N(),acknowledgedAt:N().optional(),memberIds:W(B()).min(1).max(32).refine(e=>new Set(e).size===e.length).optional()}).strict(),Mo=G({conversation:To.optional(),id:B(),source:q([`agent`,`lifecycle`]),parentRunId:B(),text:L().min(1).max(1e5),createdAt:N(),deliveredAt:N().optional(),consumedAt:N().optional(),awaitingRead:J(!0).optional(),inboxClaim:jo.optional(),purpose:q([`completion-refusal`,`undelivered-question`]).optional(),requestHash:L().regex(/^[0-9a-f]{64}$/).optional(),deadline:N().optional()}).strict(),No=G({workerId:B(),status:q([`review`,`done`,`failed`,`cancelled`]),observedAt:N(),summary:L().max(4e3).optional(),revision:V().int().nonnegative().optional()}).strict(),Po=q([`one`,`any`,`all`]),Z=Fa({seq:V(),ts:L(),stepId:L().optional(),type:L()}),Fo=Z.extend({type:J(`conversation-message`),message:Eo,delivery:q([`queued`,`delivered`,`consumed`,`not-delivered`]),deliveredAt:N().optional(),consumedAt:N().optional()}),Io=Z.extend({type:J(`request-outcome`),outcome:X}),Lo=Z.extend({type:J(`agent-input`),input:Mo}),Ro=Z.extend({type:J(`human-input-delivered`),askSeq:V().int().nonnegative(),source:q([`human`,`parent`,`cezar`]).optional()}),zo=Z.extend({type:J(`human-ask-closed`),askSeq:V().int().nonnegative(),reason:q([`finish`,`superseded`,`parent-stopped`,`worker-stopped`,`undeliverable`])});Z.extend({type:J(`worker-question-routed`),askSeq:V().int().nonnegative(),messageId:B(),parentRunId:B()}),Z.extend({type:J(`worker-question-fallback`),askSeq:V().int().nonnegative(),reason:L().min(1).max(200)}),Z.extend({type:J(`worker-question-undelivered`),askSeq:V().int().nonnegative(),reason:L().min(1).max(200)}),Z.extend({type:J(`worker-outcome`),outcome:No});var Bo=G({id:L().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/)}),Q=L().min(1).max(2048);G({cursor:Q.optional()}),G({cursor:Q.optional(),afterSeq:_o().int().nonnegative().optional()});var $=G({seq:V(),ts:L(),stepId:L().optional(),type:L()}).catchall(Oa()),Vo=G({events:W($),itemCount:V().int().min(0).max(100),olderCursor:Q.optional(),newerCursor:Q.optional(),liveCursor:Q,asOfSeq:V().int().nonnegative(),hasOlder:H()}),Ho=G({contextEvents:W($),asOfSeq:V().int().nonnegative()}),Uo=G({checkoutId:L().optional(),name:L(),phase:q([`cloning`,`done`,`error`]),line:L().optional(),error:L().optional(),warning:L().optional()}),Wo=1024*1024,Go=G({projectId:L().min(1).max(128).regex(/^[a-zA-Z0-9_-]+$/),runId:Bo.shape.id,cursor:Q.optional(),afterSeq:V().int().nonnegative().safe()});G({runs:W(Go).min(1).max(32)}).refine(({runs:e})=>new Set(e.map(e=>`${e.projectId}/${e.runId}`)).size===e.length,{message:`duplicate run demand`});var Ko=Go.pick({projectId:!0,runId:!0}),qo=Ko.extend({type:q([`error`,`reset`]),status:K([J(400),J(404),J(409),J(413),J(503)]),error:L()}),Jo=K([Ko.extend({type:J(`batch`),events:W($).max(256),snapshots:W($).max(256).optional(),cursor:Q,afterSeq:V().int().nonnegative(),hasMore:H()}),qo]),Yo=G({generation:L(),results:W(Jo)}),Xo=K([G({type:J(`ready`),generation:L()}),G({type:J(`ping`)}),Ko.extend({type:J(`event`),name:q([`run-event`,`ui-event`]),event:$}),Ko.extend({type:J(`snapshot`),name:J(`ui-event`),event:$}),qo]),Zo=`cezar-live-v4`,Qo=15e3,$o=5e3;function es(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 ts=Ra(`kind`,[G({kind:J(`workspace`)}),Go.extend({kind:J(`run`)}),G({kind:J(`topic`),topic:L().min(1).max(128)}),G({kind:J(`read`),path:L().max(4096).refine(es),intervalMs:V().int().min(1e3).max(2147483647)})]),ns=G({id:L().min(1).max(128),demand:ts}),rs=G({version:J(4),documentId:L().min(1).max(128),epoch:V().int().nonnegative()}),is=Ra(`type`,[rs.extend({type:J(`sync`),entries:W(ns).max(64),workspaceReady:J(!0).optional()}).refine(e=>new Set(e.entries.map(e=>e.id)).size===e.entries.length),rs.extend({type:J(`ack`),id:L(),seq:V().int().nonnegative()}),rs.extend({type:J(`ack-snapshot`),id:L()}),rs.extend({type:J(`refresh`),id:L()})]),as=G({event:L(),data:L(),id:L()}),os=Ra(`type`,[G({type:J(`unavailable`),version:J(4),epoch:V(),reason:L()}),G({type:J(`hello`),version:J(4)}),G({type:J(`alive`),version:J(4),epoch:V()}),G({type:J(`frame`),version:J(4),epoch:V(),id:L(),frame:K([as,Xo])}),G({type:J(`value`),version:J(4),epoch:V(),id:L(),value:U(),error:L().optional()}),G({type:J(`reset`),version:J(4),epoch:V(),id:L(),reason:L()})]),ss=e=>`${e.projectId}/${e.runId}`,cs=`live channel refused`;export{_o as A,G as B,Mo as C,So as D,Co as E,Ra as F,K as G,Ha as H,J as I,B as J,U as K,Fa as L,Ea as M,W as N,vo as O,H as P,t as Q,ja as R,Po as S,X as T,Pa as U,go as V,L as W,Xe as X,N as Y,a as Z,Ro as _,es as a,Vo as b,os as c,Xo as d,Wo as f,zo as g,Fo as h,$o as i,q as j,xo as k,ss as l,Uo as m,Qo as n,ts as o,Lo as p,aa as q,Zo as r,is as s,cs as t,Yo as u,Io as v,Do as w,No as x,Ho as y,V as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";import{Hr as n,ci as r}from"./project-scope-context-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t}from"./react-runtime-CCIEwYL0.js";import{Hr as n,ci as r}from"./project-scope-context-Dq-Iq7xE.js";import{a as i}from"./live-protocol-DMhTnCmf.js";function a(e,t){return n({kind:`topic`,topic:e},{value:t})}var o=e(t(),1);function s(e,t){if(!i(e.path))throw Error(`unsupported shared read`);let r=new URL(e.path,`http://cezar.invalid`);return r.searchParams.sort(),n({kind:`read`,path:`${r.pathname}${r.search}`,intervalMs:e.intervalMs},{value:t})}function c(e,t,n,i){let a=r(),c=JSON.stringify(t),l=(0,o.useMemo)(()=>JSON.parse(c),[c]);(0,o.useEffect)(()=>{if(!e||n===!1)return;let t=!0,r=s({path:e,intervalMs:n},(e,n)=>{n||a.cancelQueries({queryKey:l,exact:!0}).then(()=>{t&&a.setQueryData(l,i?i(e,a):e)})});return()=>{t=!1,r()}},[a,e,l,n,i])}export{c as n,a as r,s as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{r}from"./utils-DSMR_WLb.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{d as a,f as o,p as s}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{Gt as c,Ht as l,Jt as ee,Kt as te,Ut as u,Vt as ne,Wt as d,qt as f}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{r}from"./utils-DSMR_WLb.js";import{t as i}from"./preload-helper-Czpn1I53.js";import{d as a,f as o,p as s}from"./chunk-KS7C4IRE-Cg8l-LDN.js";import{Gt as c,Ht as l,Jt as ee,Kt as te,Ut as u,Vt as ne,Wt as d,qt as f}from"./index-Dedol522.js";import{i as p,n as m,s as h}from"./chunk-BO2N2NFS-DQrpGzb-.js";import{i as re,o as g,r as ie,t as _}from"./highlighter-DvLzHjjY.js";var v=e(t(),1),y=n();function b({isOpen:e,onClose:t,onConfirm:n,url:r}){return(0,y.jsx)(ne,{open:e,onOpenChange:e=>{e||t()},children:(0,y.jsxs)(d,{"data-slot":`link-safety-dialog`,children:[(0,y.jsxs)(f,{children:[(0,y.jsx)(ee,{children:`Open this link?`}),(0,y.jsxs)(c,{children:[`It leaves Squawk in a new tab. The words of a link in a transcript are the agent's — the address below is where it actually goes.`,(0,y.jsx)(`span`,{"data-slot":`link-safety-url`,className:`mt-3 block wrap-anywhere rounded-md border border-border bg-muted px-3 py-2 font-mono text-xs text-foreground`,children:r})]})]}),(0,y.jsxs)(te,{children:[(0,y.jsx)(u,{children:`Cancel`}),(0,y.jsx)(l,{onClick:n,children:`Open link`})]})]})})}var x=String.raw`https?:\/\/(?:cdn\.jsdelivr\.net\/npm|unpkg\.com)\/`,ae=[{id:`tailwind-v3`,script:/^https?:\/\/cdn\.tailwindcss\.com(?:\/[\d.]+)?\/?(?:[?#]|$)/i},{id:`tailwind`,script:new RegExp(String.raw`^${x}@tailwindcss\/browser@4(?:\.[.\d]*)?(?:\/dist\/index\.global(?:\.min)?\.js)?\/?(?:[?#]|$)`,`i`)},{id:`mermaid`,script:new RegExp(String.raw`^${x}mermaid@11(?:\.[.\d]*)?\/dist\/mermaid(?:\.esm)?(?:\.min)?\.m?js(?:[?#]|$)`,`i`)}],S=new RegExp(String.raw`(['"])(${x}mermaid@11(?:\.[.\d]*)?(?:\/dist\/mermaid(?:\.esm)?(?:\.min)?\.mjs|\/\+esm)?)\1`,`gi`);function C(e){let t=e.trim();return ae.find(e=>e.script.test(t))?.id??null}function w(e){let t=new DOMParser().parseFromString(e,`text/html`),n=new Set;for(let e of t.querySelectorAll(`script`)){let t=e.getAttribute(`src`),r=t===null?null:C(t);r&&n.add(r===`tailwind-v3`?`tailwind`:r).add(r),t===null&&e.getAttribute(`type`)===`module`&&(e.textContent??``).search(S)>=0&&n.add(`mermaid`),S.lastIndex=0}return[...n].sort()}var T={tailwind:async()=>(await i(()=>import(`./index.global-D3Ga_D3Y.js`),[])).default,"tailwind-v3":()=>Promise.resolve(le),mermaid:async()=>(await i(()=>import(`./mermaid.min-3O9YjB2l.js`),[])).default};async function oe(e){let t=await Promise.all(e.map(e=>T[e]().then(t=>[e,t],()=>null)));return Object.fromEntries(t.filter(e=>e!==null))}function se(){let e={colors:`color`,fontFamily:`font`,fontSize:`text`,fontWeight:`font-weight`,spacing:`spacing`,borderRadius:`radius`,boxShadow:`shadow`,dropShadow:`drop-shadow`,blur:`blur`,screens:`breakpoint`,letterSpacing:`tracking`,lineHeight:`leading`,maxWidth:`container`,animation:`animate`,aspectRatio:`aspect`},t=e=>typeof e==`object`&&!!e&&!Array.isArray(e),n=t=>Object.hasOwn(e,t)?e[t]:void 0,r=(e,n,i,a)=>{if(t(a)){for(let[t,o]of Object.entries(a))r(e,n,t===`DEFAULT`?i:i?`${i}-${t}`:t,o);return}let o=i?`--${n}-${i}`:`--${n}`;if(n===`text`&&Array.isArray(a)){e.push(`${o}: ${String(a[0])};`);let n=t(a[1])?a[1].lineHeight:a[1];typeof n==`string`&&e.push(`${o}--line-height: ${n};`);return}typeof a==`string`||typeof a==`number`?e.push(`${o}: ${a};`):Array.isArray(a)&&e.push(`${o}: ${a.join(`, `)};`)},i=e=>{let[t,n]=Array.isArray(e)?e:[e];if(t!==`class`&&t!==`selector`)return``;let r=typeof n==`string`?n:`.dark`;return`@custom-variant dark (&:where(${r}, ${r} *));\n`},a=e=>{let a=t(e)?e:{},o=t(a.theme)?a.theme:{},s=[];for(let[e,t]of Object.entries(o)){let i=n(e);i&&(s.push(`--${i}-*: initial;`),r(s,i,``,t))}for(let[e,i]of Object.entries(t(o.extend)?o.extend:{})){let t=n(e);t&&r(s,t,``,i)}return`${i(a.darkMode)}@theme {\n${s.join(`
|
|
2
2
|
`)}\n}`},o=document.createElement(`style`);o.setAttribute(`type`,`text/tailwindcss`),document.currentScript?.before(o);let s={};Object.defineProperty(globalThis,"tailwind",{configurable:!0,value:{get config(){return s},set config(e){s=e,o.textContent=a(e)}}})}var ce=`(${se.toString()})()`,le=[`@import "tailwindcss/theme.css";@import "tailwindcss/preflight.css";@import "tailwindcss/utilities.css";`,`@theme{`,`--color-slate-50:#f8fafc;--color-slate-100:#f1f5f9;--color-slate-200:#e2e8f0;--color-slate-300:#cbd5e1;--color-slate-400:#94a3b8;--color-slate-500:#64748b;--color-slate-600:#475569;--color-slate-700:#334155;--color-slate-800:#1e293b;--color-slate-900:#0f172a;--color-slate-950:#020617;`,`--color-gray-50:#f9fafb;--color-gray-100:#f3f4f6;--color-gray-200:#e5e7eb;--color-gray-300:#d1d5db;--color-gray-400:#9ca3af;--color-gray-500:#6b7280;--color-gray-600:#4b5563;--color-gray-700:#374151;--color-gray-800:#1f2937;--color-gray-900:#111827;--color-gray-950:#030712;`,`--color-zinc-50:#fafafa;--color-zinc-100:#f4f4f5;--color-zinc-200:#e4e4e7;--color-zinc-300:#d4d4d8;--color-zinc-400:#a1a1aa;--color-zinc-500:#71717a;--color-zinc-600:#52525b;--color-zinc-700:#3f3f46;--color-zinc-800:#27272a;--color-zinc-900:#18181b;--color-zinc-950:#09090b;`,`--color-neutral-50:#fafafa;--color-neutral-100:#f5f5f5;--color-neutral-200:#e5e5e5;--color-neutral-300:#d4d4d4;--color-neutral-400:#a3a3a3;--color-neutral-500:#737373;--color-neutral-600:#525252;--color-neutral-700:#404040;--color-neutral-800:#262626;--color-neutral-900:#171717;--color-neutral-950:#0a0a0a;`,`--color-stone-50:#fafaf9;--color-stone-100:#f5f5f4;--color-stone-200:#e7e5e4;--color-stone-300:#d6d3d1;--color-stone-400:#a8a29e;--color-stone-500:#78716c;--color-stone-600:#57534e;--color-stone-700:#44403c;--color-stone-800:#292524;--color-stone-900:#1c1917;--color-stone-950:#0c0a09;`,`--color-red-50:#fef2f2;--color-red-100:#fee2e2;--color-red-200:#fecaca;--color-red-300:#fca5a5;--color-red-400:#f87171;--color-red-500:#ef4444;--color-red-600:#dc2626;--color-red-700:#b91c1c;--color-red-800:#991b1b;--color-red-900:#7f1d1d;--color-red-950:#450a0a;`,`--color-orange-50:#fff7ed;--color-orange-100:#ffedd5;--color-orange-200:#fed7aa;--color-orange-300:#fdba74;--color-orange-400:#fb923c;--color-orange-500:#f97316;--color-orange-600:#ea580c;--color-orange-700:#c2410c;--color-orange-800:#9a3412;--color-orange-900:#7c2d12;--color-orange-950:#431407;`,`--color-amber-50:#fffbeb;--color-amber-100:#fef3c7;--color-amber-200:#fde68a;--color-amber-300:#fcd34d;--color-amber-400:#fbbf24;--color-amber-500:#f59e0b;--color-amber-600:#d97706;--color-amber-700:#b45309;--color-amber-800:#92400e;--color-amber-900:#78350f;--color-amber-950:#451a03;`,`--color-yellow-50:#fefce8;--color-yellow-100:#fef9c3;--color-yellow-200:#fef08a;--color-yellow-300:#fde047;--color-yellow-400:#facc15;--color-yellow-500:#eab308;--color-yellow-600:#ca8a04;--color-yellow-700:#a16207;--color-yellow-800:#854d0e;--color-yellow-900:#713f12;--color-yellow-950:#422006;`,`--color-lime-50:#f7fee7;--color-lime-100:#ecfccb;--color-lime-200:#d9f99d;--color-lime-300:#bef264;--color-lime-400:#a3e635;--color-lime-500:#84cc16;--color-lime-600:#65a30d;--color-lime-700:#4d7c0f;--color-lime-800:#3f6212;--color-lime-900:#365314;--color-lime-950:#1a2e05;`,`--color-green-50:#f0fdf4;--color-green-100:#dcfce7;--color-green-200:#bbf7d0;--color-green-300:#86efac;--color-green-400:#4ade80;--color-green-500:#22c55e;--color-green-600:#16a34a;--color-green-700:#15803d;--color-green-800:#166534;--color-green-900:#14532d;--color-green-950:#052e16;`,`--color-emerald-50:#ecfdf5;--color-emerald-100:#d1fae5;--color-emerald-200:#a7f3d0;--color-emerald-300:#6ee7b7;--color-emerald-400:#34d399;--color-emerald-500:#10b981;--color-emerald-600:#059669;--color-emerald-700:#047857;--color-emerald-800:#065f46;--color-emerald-900:#064e3b;--color-emerald-950:#022c22;`,`--color-teal-50:#f0fdfa;--color-teal-100:#ccfbf1;--color-teal-200:#99f6e4;--color-teal-300:#5eead4;--color-teal-400:#2dd4bf;--color-teal-500:#14b8a6;--color-teal-600:#0d9488;--color-teal-700:#0f766e;--color-teal-800:#115e59;--color-teal-900:#134e4a;--color-teal-950:#042f2e;`,`--color-cyan-50:#ecfeff;--color-cyan-100:#cffafe;--color-cyan-200:#a5f3fc;--color-cyan-300:#67e8f9;--color-cyan-400:#22d3ee;--color-cyan-500:#06b6d4;--color-cyan-600:#0891b2;--color-cyan-700:#0e7490;--color-cyan-800:#155e75;--color-cyan-900:#164e63;--color-cyan-950:#083344;`,`--color-sky-50:#f0f9ff;--color-sky-100:#e0f2fe;--color-sky-200:#bae6fd;--color-sky-300:#7dd3fc;--color-sky-400:#38bdf8;--color-sky-500:#0ea5e9;--color-sky-600:#0284c7;--color-sky-700:#0369a1;--color-sky-800:#075985;--color-sky-900:#0c4a6e;--color-sky-950:#082f49;`,`--color-blue-50:#eff6ff;--color-blue-100:#dbeafe;--color-blue-200:#bfdbfe;--color-blue-300:#93c5fd;--color-blue-400:#60a5fa;--color-blue-500:#3b82f6;--color-blue-600:#2563eb;--color-blue-700:#1d4ed8;--color-blue-800:#1e40af;--color-blue-900:#1e3a8a;--color-blue-950:#172554;`,`--color-indigo-50:#eef2ff;--color-indigo-100:#e0e7ff;--color-indigo-200:#c7d2fe;--color-indigo-300:#a5b4fc;--color-indigo-400:#818cf8;--color-indigo-500:#6366f1;--color-indigo-600:#4f46e5;--color-indigo-700:#4338ca;--color-indigo-800:#3730a3;--color-indigo-900:#312e81;--color-indigo-950:#1e1b4b;`,`--color-violet-50:#f5f3ff;--color-violet-100:#ede9fe;--color-violet-200:#ddd6fe;--color-violet-300:#c4b5fd;--color-violet-400:#a78bfa;--color-violet-500:#8b5cf6;--color-violet-600:#7c3aed;--color-violet-700:#6d28d9;--color-violet-800:#5b21b6;--color-violet-900:#4c1d95;--color-violet-950:#2e1065;`,`--color-purple-50:#faf5ff;--color-purple-100:#f3e8ff;--color-purple-200:#e9d5ff;--color-purple-300:#d8b4fe;--color-purple-400:#c084fc;--color-purple-500:#a855f7;--color-purple-600:#9333ea;--color-purple-700:#7e22ce;--color-purple-800:#6b21a8;--color-purple-900:#581c87;--color-purple-950:#3b0764;`,`--color-fuchsia-50:#fdf4ff;--color-fuchsia-100:#fae8ff;--color-fuchsia-200:#f5d0fe;--color-fuchsia-300:#f0abfc;--color-fuchsia-400:#e879f9;--color-fuchsia-500:#d946ef;--color-fuchsia-600:#c026d3;--color-fuchsia-700:#a21caf;--color-fuchsia-800:#86198f;--color-fuchsia-900:#701a75;--color-fuchsia-950:#4a044e;`,`--color-pink-50:#fdf2f8;--color-pink-100:#fce7f3;--color-pink-200:#fbcfe8;--color-pink-300:#f9a8d4;--color-pink-400:#f472b6;--color-pink-500:#ec4899;--color-pink-600:#db2777;--color-pink-700:#be185d;--color-pink-800:#9d174d;--color-pink-900:#831843;--color-pink-950:#500724;`,`--color-rose-50:#fff1f2;--color-rose-100:#ffe4e6;--color-rose-200:#fecdd3;--color-rose-300:#fda4af;--color-rose-400:#fb7185;--color-rose-500:#f43f5e;--color-rose-600:#e11d48;--color-rose-700:#be123c;--color-rose-800:#9f1239;--color-rose-900:#881337;--color-rose-950:#4c0519;`,`--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";`,`--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;`,`--text-xs--line-height:1rem;--text-sm--line-height:1.25rem;--text-base--line-height:1.5rem;--text-lg--line-height:1.75rem;`,`--text-xl--line-height:1.75rem;--text-2xl--line-height:2rem;--text-3xl--line-height:2.25rem;--text-4xl--line-height:2.5rem;`,`--shadow-sm:0 1px 2px 0 rgb(0 0 0 / 0.05);--radius-sm:0.125rem;--blur-sm:4px;`,`}`,`body{line-height:inherit}`,`*,::after,::before,::backdrop,::file-selector-button{border-color:var(--color-gray-200,currentColor)}`,`input::placeholder,textarea::placeholder{color:var(--color-gray-400)}`,`button:not(:disabled),[role="button"]:not(:disabled){cursor:pointer}`].join(`
|
|
3
|
-
`),E=`default-src 'none'; script-src 'unsafe-inline' data:; img-src data:; media-src data:; font-src data:; style-src 'unsafe-inline' data:; form-action 'none'; base-uri 'none'`,ue=`${E}; frame-src 'none'`,D=`allow-scripts allow-popups allow-popups-to-escape-sandbox`,O=`clipboard-write`,k=`data:text/javascript,export%20default%20globalThis.mermaid`;function A(e){return/\.html?$/i.test(e)}var j=/^(?:https?:|mailto:)/i,M=/^data:/i,N=`http://www.w3.org/1999/xlink`,P=/^(?:[a-z][a-z\d+.-]*:|\/\/)/i,F=/url\(\s*(['"]?)([^'")]*)\1\s*\)|@import\s+(['"])([^'"]+)\3/gi,I=[`src`,`href`,`xlink:href`,`poster`,`background`],L=/(?:^|,)\s*(data:\S+|[^,\s]+)/gi,R=/\b(?:preconnect|dns-prefetch|prefetch|preload|modulepreload|prerender)\b/i;function z(e,t){let n=e.trim();!n||n.startsWith(`#`)||M.test(n)||(P.test(n)?t.remote++:t.relative++)}function B(e,t){for(let n of e.matchAll(F))z(n[2]??n[4]??``,t)}function V(e,t){let n=e.createElement(`script`);return n.textContent=t.replace(/<\/script/gi,`<\\/script`),n}function H(e,t){let n=e.createElement(`style`);return n.setAttribute(`type`,`text/tailwindcss`),n.textContent=t,n}var U=`http://www.w3.org/2000/svg`;function de(e){return e.namespaceURI===U?e.getAttribute(`href`)??e.getAttributeNS(N,`href`):e.getAttribute(`src`)}function fe(e,t,n,r){let i=r===void 0?[]:[H(e,r),V(e,ce)],a=V(e,n),o=t.hasAttribute(`defer`)||t.hasAttribute(`async`)||t.getAttribute(`type`)===`module`;o&&e.body.append(a),t.replaceWith(...i,...o?[]:[a])}function W(e,t,n){let r=new Set,i=new Set;for(let a of[...e.querySelectorAll(`script`)]){let o=de(a);if(o!==null&&M.test(o.trim()))continue;if(o===null){if(a.getAttribute(`type`)===`module`)for(let e of(a.textContent??``).matchAll(S))i.add(e[2]);continue}let s=C(o),c=s===`tailwind-v3`?`tailwind`:s,l=c?n[c]:void 0;if(!c||l===void 0||s===`tailwind-v3`&&n[`tailwind-v3`]===void 0){t.scripts++,a.remove();continue}if(r.has(c)){a.remove();continue}r.add(c),fe(e,a,l,s===`tailwind-v3`?n[`tailwind-v3`]:void 0)}if(!i.size)return;if(n.mermaid===void 0){t.scripts+=i.size;return}let a=e.createElement(`script`);a.setAttribute(`type`,`importmap`),a.textContent=JSON.stringify({imports:Object.fromEntries([...i].map(e=>[e,k]))}),e.head.prepend(a,...r.has(`mermaid`)?[]:[V(e,n.mermaid)])}function pe(e,t,n){let r=t=>{let n=[...e.querySelectorAll(t)];return n.forEach(e=>e.remove()),n.length};W(e,t,n),t.embeds=r(`iframe, frame, frameset, object, embed, portal`),r(`base, meta[http-equiv]`);for(let t of e.querySelectorAll(`link`))R.test(t.getAttribute(`rel`)??``)&&t.remove();for(let t of e.querySelectorAll(`[ping]`))t.removeAttribute(`ping`);for(let n of e.querySelectorAll(`form`))t.forms++,n.removeAttribute(`action`);for(let t of e.querySelectorAll(`[formaction]`))t.removeAttribute(`formaction`)}function me(e,t){for(let n of e.querySelectorAll(`a, area`)){let e=n.getAttribute(`href`)??n.getAttributeNS(N,`href`);if(e===null)continue;let r=e.trim();if(r.startsWith(`#`)){n.setAttribute(`href`,`about:srcdoc${r}`),n.removeAttributeNS(N,`href`),n.removeAttribute(`target`);continue}if(j.test(r)){n.setAttribute(`target`,`_blank`),n.setAttribute(`rel`,`noopener noreferrer`);continue}P.test(r)||t.relative++,n.removeAttribute(`href`),n.removeAttributeNS(N,`href`),n.removeAttribute(`target`)}}function he(e,t){for(let n of e.querySelectorAll(`[style]`))B(n.getAttribute(`style`),t);for(let n of e.querySelectorAll(`style`))/^(?:text\/css)?$/i.test(n.getAttribute(`type`)?.trim()??``)&&B(n.textContent??``,t);for(let n of e.querySelectorAll(`link[href]`))z(n.getAttribute(`href`),t);for(let n of e.querySelectorAll(`img, source, video, audio, track, input, image, use, body, table, td`)){for(let e of I){let r=n.getAttribute(e);r!==null&&z(r,t)}for(let e of(n.getAttribute(`srcset`)??``).matchAll(L))z(e[1],t)}}function ge(e,t={}){let n=new DOMParser().parseFromString(e,`text/html`),r={scripts:0,remote:0,relative:0,forms:0,embeds:0};pe(n,r,t),me(n,r),he(n,r);let i=n.createElement(`meta`);i.setAttribute(`http-equiv`,`Content-Security-Policy`),i.setAttribute(`content`,E);let a=n.createElement(`meta`);return a.setAttribute(`name`,`referrer`),a.setAttribute(`content`,`no-referrer`),n.head.prepend(i,a),{srcdoc:`<!DOCTYPE html>${n.documentElement.outerHTML}`,blocked:r}}var G=e=>e.replace(/&/g,`&`).replace(/"/g,`"`);function _e(e,t){return`<!DOCTYPE html><html><head><meta http-equiv="Content-Security-Policy" content="${ue}"><meta name="referrer" content="no-referrer"><style>html,body{margin:0;height:100%;overflow:hidden}iframe{display:block;border:0;width:100%;height:100%}</style></head><body><iframe title="${G(t)}" sandbox="${D}" allow="${O}" referrerpolicy="no-referrer" srcdoc="${G(e)}"></iframe></body></html>`}var K=(0,v.createContext)(null),ve=/^[0-9a-f-]{36}$/i,ye=/^(\/p\/[^/?#]+\/tasks\/[^/?#]+)\/files\?(artifact=[^&#]*)$/;function q(e){let t=new URLSearchParams(e);return[...t.keys()].length===1&&ve.test(t.get(`artifact`)??``)}function be(e,t,n){if(e.startsWith(`${t}?artifact=`))return q(e.slice(t.length+1))?n+e.slice(t.length):null;let r=ye.exec(e);return r&&q(r[2])?`${r[1]}/report?${r[2]}`:void 0}var xe=/^\/(?:api|p|tasks|new|settings|skills|workflows|git|github|inbox|automations)(?:\/|[?#]|$)/;function Se(e,t){let n=/^[a-z]:[\\/]/i.test(e),r=/^file:/i.test(e);if(!n&&/^[a-z][a-z\d+.-]*:/i.test(e)&&!r)return null;let i=r?e:decodeURIComponent(e);if(/[\u0000-\u001f]/.test(i))return null;if(!t||i.startsWith(`/`)||n||r)return i;let a=t.replaceAll(`\\`,`/`);return a.slice(0,a.lastIndexOf(`/`)+1)+i}function J(e,t){if(!e||/[\u0000-\u001f]/.test(e)||e.startsWith(`#`)||e.startsWith(`//`))return null;let n=e.indexOf(`#`),r=n<0?e:e.slice(0,n),i=n<0?``:e.slice(n),a=t.projectId?`/p/${encodeURIComponent(t.projectId)}`:``,o=`/tasks/${encodeURIComponent(t.runId)}/files`,s=`/tasks/${encodeURIComponent(t.runId)}/report`,c=be(r,o,a+s);if(c!==void 0)return c===null?null:c+i;if(xe.test(r))return null;let l=Se(r,t.basePath);return l===null?null:`${a}${A(l)?s:o}?path=${encodeURIComponent(l)}${i}`}var Y=`text-accent-text underline underline-offset-2`;function Ce({href:e,children:t,internal:n,...r}){let[i,o]=(0,v.useState)(!1),s=a();return e?n?s?(0,y.jsx)(we,{...r,href:e,children:t}):(0,y.jsx)(`a`,{...r,href:e,"data-streamdown":`link`,className:Y,children:t}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`a`,{...r,href:e,"data-streamdown":`link`,className:`cursor-pointer ${Y}`,onClick:e=>{e.preventDefault(),o(!0)},children:t}),(0,y.jsx)(b,{isOpen:i,url:e,onClose:()=>o(!1),onConfirm:()=>{window.open(e,`_blank`,`noreferrer`),o(!1)}})]}):(0,y.jsx)(`span`,{children:t})}function we({href:e,children:t,...n}){let r=s(),i=o();return(0,y.jsx)(`a`,{...n,href:e,"data-streamdown":`link`,className:Y,onClick:t=>X(t,r,e,i),children:t})}function X(e,t,n,r){e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),t(n,{state:{readerFrom:r.pathname+r.search,filesRestoreKey:r.key}}))}var Te={name:`shiki`,type:`code-highlighter`,getThemes:()=>[_,_],getSupportedLanguages:()=>g(),supportsLanguage:e=>g().includes(String(e).toLowerCase()),highlight:({code:e,language:t},n)=>re(e,String(t))||(ie(e,String(t)).then(e=>n?.(e)),null)};function
|
|
4
|
-
`)){let e=r.value.split(/\r?\n/);e.forEach((t,r)=>{r>0&&!(t===``&&r===e.length-1)&&n.push({type:`break`}),t&&n.push({type:`text`,value:t})})}else e(r),n.push(r);t.children=n};return e}var Z=[...Object.values(m),
|
|
3
|
+
`),E=`default-src 'none'; script-src 'unsafe-inline' data:; img-src data:; media-src data:; font-src data:; style-src 'unsafe-inline' data:; form-action 'none'; base-uri 'none'`,ue=`${E}; frame-src 'none'`,D=`allow-scripts allow-popups allow-popups-to-escape-sandbox`,O=`clipboard-write`,k=`data:text/javascript,export%20default%20globalThis.mermaid`;function A(e){return/\.html?$/i.test(e)}var j=/^(?:https?:|mailto:)/i,M=/^data:/i,N=`http://www.w3.org/1999/xlink`,P=/^(?:[a-z][a-z\d+.-]*:|\/\/)/i,F=/url\(\s*(['"]?)([^'")]*)\1\s*\)|@import\s+(['"])([^'"]+)\3/gi,I=[`src`,`href`,`xlink:href`,`poster`,`background`],L=/(?:^|,)\s*(data:\S+|[^,\s]+)/gi,R=/\b(?:preconnect|dns-prefetch|prefetch|preload|modulepreload|prerender)\b/i;function z(e,t){let n=e.trim();!n||n.startsWith(`#`)||M.test(n)||(P.test(n)?t.remote++:t.relative++)}function B(e,t){for(let n of e.matchAll(F))z(n[2]??n[4]??``,t)}function V(e,t){let n=e.createElement(`script`);return n.textContent=t.replace(/<\/script/gi,`<\\/script`),n}function H(e,t){let n=e.createElement(`style`);return n.setAttribute(`type`,`text/tailwindcss`),n.textContent=t,n}var U=`http://www.w3.org/2000/svg`;function de(e){return e.namespaceURI===U?e.getAttribute(`href`)??e.getAttributeNS(N,`href`):e.getAttribute(`src`)}function fe(e,t,n,r){let i=r===void 0?[]:[H(e,r),V(e,ce)],a=V(e,n),o=t.hasAttribute(`defer`)||t.hasAttribute(`async`)||t.getAttribute(`type`)===`module`;o&&e.body.append(a),t.replaceWith(...i,...o?[]:[a])}function W(e,t,n){let r=new Set,i=new Set;for(let a of[...e.querySelectorAll(`script`)]){let o=de(a);if(o!==null&&M.test(o.trim()))continue;if(o===null){if(a.getAttribute(`type`)===`module`)for(let e of(a.textContent??``).matchAll(S))i.add(e[2]);continue}let s=C(o),c=s===`tailwind-v3`?`tailwind`:s,l=c?n[c]:void 0;if(!c||l===void 0||s===`tailwind-v3`&&n[`tailwind-v3`]===void 0){t.scripts++,a.remove();continue}if(r.has(c)){a.remove();continue}r.add(c),fe(e,a,l,s===`tailwind-v3`?n[`tailwind-v3`]:void 0)}if(!i.size)return;if(n.mermaid===void 0){t.scripts+=i.size;return}let a=e.createElement(`script`);a.setAttribute(`type`,`importmap`),a.textContent=JSON.stringify({imports:Object.fromEntries([...i].map(e=>[e,k]))}),e.head.prepend(a,...r.has(`mermaid`)?[]:[V(e,n.mermaid)])}function pe(e,t,n){let r=t=>{let n=[...e.querySelectorAll(t)];return n.forEach(e=>e.remove()),n.length};W(e,t,n),t.embeds=r(`iframe, frame, frameset, object, embed, portal`),r(`base, meta[http-equiv]`);for(let t of e.querySelectorAll(`link`))R.test(t.getAttribute(`rel`)??``)&&t.remove();for(let t of e.querySelectorAll(`[ping]`))t.removeAttribute(`ping`);for(let n of e.querySelectorAll(`form`))t.forms++,n.removeAttribute(`action`);for(let t of e.querySelectorAll(`[formaction]`))t.removeAttribute(`formaction`)}function me(e,t){for(let n of e.querySelectorAll(`a, area`)){let e=n.getAttribute(`href`)??n.getAttributeNS(N,`href`);if(e===null)continue;let r=e.trim();if(r.startsWith(`#`)){n.setAttribute(`href`,`about:srcdoc${r}`),n.removeAttributeNS(N,`href`),n.removeAttribute(`target`);continue}if(j.test(r)){n.setAttribute(`target`,`_blank`),n.setAttribute(`rel`,`noopener noreferrer`);continue}P.test(r)||t.relative++,n.removeAttribute(`href`),n.removeAttributeNS(N,`href`),n.removeAttribute(`target`)}}function he(e,t){for(let n of e.querySelectorAll(`[style]`))B(n.getAttribute(`style`),t);for(let n of e.querySelectorAll(`style`))/^(?:text\/css)?$/i.test(n.getAttribute(`type`)?.trim()??``)&&B(n.textContent??``,t);for(let n of e.querySelectorAll(`link[href]`))z(n.getAttribute(`href`),t);for(let n of e.querySelectorAll(`img, source, video, audio, track, input, image, use, body, table, td`)){for(let e of I){let r=n.getAttribute(e);r!==null&&z(r,t)}for(let e of(n.getAttribute(`srcset`)??``).matchAll(L))z(e[1],t)}}function ge(e,t={}){let n=new DOMParser().parseFromString(e,`text/html`),r={scripts:0,remote:0,relative:0,forms:0,embeds:0};pe(n,r,t),me(n,r),he(n,r);let i=n.createElement(`meta`);i.setAttribute(`http-equiv`,`Content-Security-Policy`),i.setAttribute(`content`,E);let a=n.createElement(`meta`);return a.setAttribute(`name`,`referrer`),a.setAttribute(`content`,`no-referrer`),n.head.prepend(i,a),{srcdoc:`<!DOCTYPE html>${n.documentElement.outerHTML}`,blocked:r}}var G=e=>e.replace(/&/g,`&`).replace(/"/g,`"`);function _e(e,t){return`<!DOCTYPE html><html><head><meta http-equiv="Content-Security-Policy" content="${ue}"><meta name="referrer" content="no-referrer"><style>html,body{margin:0;height:100%;overflow:hidden}iframe{display:block;border:0;width:100%;height:100%}</style></head><body><iframe title="${G(t)}" sandbox="${D}" allow="${O}" referrerpolicy="no-referrer" srcdoc="${G(e)}"></iframe></body></html>`}var K=(0,v.createContext)(null),ve=/^[0-9a-f-]{36}$/i,ye=/^(\/p\/[^/?#]+\/tasks\/[^/?#]+)\/files\?(artifact=[^&#]*)$/;function q(e){let t=new URLSearchParams(e);return[...t.keys()].length===1&&ve.test(t.get(`artifact`)??``)}function be(e,t,n){if(e.startsWith(`${t}?artifact=`))return q(e.slice(t.length+1))?n+e.slice(t.length):null;let r=ye.exec(e);return r&&q(r[2])?`${r[1]}/report?${r[2]}`:void 0}var xe=/^\/(?:api|p|tasks|new|settings|skills|workflows|git|github|inbox|automations)(?:\/|[?#]|$)/;function Se(e,t){let n=/^[a-z]:[\\/]/i.test(e),r=/^file:/i.test(e);if(!n&&/^[a-z][a-z\d+.-]*:/i.test(e)&&!r)return null;let i=r?e:decodeURIComponent(e);if(/[\u0000-\u001f]/.test(i))return null;if(!t||i.startsWith(`/`)||n||r)return i;let a=t.replaceAll(`\\`,`/`);return a.slice(0,a.lastIndexOf(`/`)+1)+i}function J(e,t){if(!e||/[\u0000-\u001f]/.test(e)||e.startsWith(`#`)||e.startsWith(`//`))return null;let n=e.indexOf(`#`),r=n<0?e:e.slice(0,n),i=n<0?``:e.slice(n),a=t.projectId?`/p/${encodeURIComponent(t.projectId)}`:``,o=`/tasks/${encodeURIComponent(t.runId)}/files`,s=`/tasks/${encodeURIComponent(t.runId)}/report`,c=be(r,o,a+s);if(c!==void 0)return c===null?null:c+i;if(xe.test(r))return null;let l=Se(r,t.basePath);return l===null?null:`${a}${A(l)?s:o}?path=${encodeURIComponent(l)}${i}`}var Y=`text-accent-text underline underline-offset-2`;function Ce({href:e,children:t,internal:n,...r}){let[i,o]=(0,v.useState)(!1),s=a();return e?n?s?(0,y.jsx)(we,{...r,href:e,children:t}):(0,y.jsx)(`a`,{...r,href:e,"data-streamdown":`link`,className:Y,children:t}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`a`,{...r,href:e,"data-streamdown":`link`,className:`cursor-pointer ${Y}`,onClick:e=>{e.preventDefault(),o(!0)},children:t}),(0,y.jsx)(b,{isOpen:i,url:e,onClose:()=>o(!1),onConfirm:()=>{window.open(e,`_blank`,`noreferrer`),o(!1)}})]}):(0,y.jsx)(`span`,{children:t})}function we({href:e,children:t,...n}){let r=s(),i=o();return(0,y.jsx)(`a`,{...n,href:e,"data-streamdown":`link`,className:Y,onClick:t=>X(t,r,e,i),children:t})}function X(e,t,n,r){e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),t(n,{state:{readerFrom:r.pathname+r.search,filesRestoreKey:r.key}}))}var Te={code:{name:`shiki`,type:`code-highlighter`,getThemes:()=>[_,_],getSupportedLanguages:()=>g(),supportsLanguage:e=>g().includes(String(e).toLowerCase()),highlight:({code:e,language:t},n)=>re(e,String(t))||(ie(e,String(t)).then(e=>n?.(e)),null)}},Ee=[_,_],De={code:{copy:!0,download:!1},table:!1,mermaid:!1},Oe=[...Object.values(h),Fe];function ke(){let e=t=>{if(!t.children)return;let n=[];for(let r of t.children)if(r.type===`text`&&r.value?.includes(`
|
|
4
|
+
`)){let e=r.value.split(/\r?\n/);e.forEach((t,r)=>{r>0&&!(t===``&&r===e.length-1)&&n.push({type:`break`}),t&&n.push({type:`text`,value:t})})}else e(r),n.push(r);t.children=n};return e}var Z=[...Object.values(m),ke],Ae=[`p`,`strong`,`em`,`del`,`code`,`a`],je={p:`span`,a:`span`},Me={enabled:!0,renderModal:e=>(0,y.jsx)(b,{...e})},Ne=`https://refused.invalid/`,Q=new WeakSet;function $(e){let t=e.position?.start.offset,n=e.position?.end.offset;return t===void 0||n===void 0?null:`${t}:${n}`}function Pe(e){return(t,n)=>{let r=new Set,i=new Map,a=t=>{if((t.type===`link`||t.type===`definition`)&&t.url){let n=J(t.url,e);if(t.type===`definition`&&t.identifier&&!i.has(t.identifier)&&i.set(t.identifier,n!==null),n){t.url=n;let e=$(t);t.type===`link`&&e!==null&&r.add(e)}}t.children?.forEach(a)};a(t);let o=e=>{let t=$(e);e.type===`linkReference`&&e.identifier&&i.get(e.identifier)&&t!==null&&r.add(t),e.children?.forEach(o)};o(t),n.data.taskLinks=r}}function Fe(){return(e,t)=>{let n=e=>{let r=$(e);e.tagName===`a`&&r!==null&&t.data.taskLinks instanceof Set&&t.data.taskLinks.has(r)&&Q.add(e),e.children?.forEach(n)};n(e)}}var Ie=0,Le=(0,v.memo)(function({children:e,breaks:t=!1,inline:n=!1,document:i=!1,imageSrc:a}){let o=(0,v.useContext)(K),s=(0,v.useMemo)(()=>{let e={instance:++Ie},n=new Set;function r(){let e=t=>{if(t.type===`image`&&t.url&&a){let e=a(t.url);t.url=e?new URL(e,window.location.href).href:Ne,e&&n.add(t.url)}t.children?.forEach(e)};return e}let s=o?[[Pe,o]]:[],c=i&&a?[[r,e]]:[];return{key:e.instance,remark:[...t?Z:Object.values(m),...s,...c],components:{...o||i?{a:({href:e,children:t,node:n})=>i&&!o&&!/^(?:https?:|mailto:|#)/i.test(e??``)?(0,y.jsx)(`span`,{children:t}):(0,y.jsx)(Ce,{href:e,internal:n!==void 0&&Q.has(n),children:t})}:{},...i?{img:({src:e,alt:t})=>typeof e==`string`&&n.has(e)?(0,y.jsx)(`img`,{src:e,alt:t??``,loading:`lazy`}):(0,y.jsxs)(`span`,{className:`text-muted-foreground`,children:[`[Image: `,t||`embedded image`,`]`]})}:{}}}},[o,t,i,a]);return(0,y.jsx)(p,{className:n?`thread-markdown thread-markdown-inline`:`thread-markdown`,plugins:Te,shikiTheme:Ee,...r({rehypePlugins:o?Oe:void 0,remarkPlugins:o||i&&a?s.remark:t?Z:void 0,allowedElements:n?Ae:void 0,unwrapDisallowed:n||void 0,components:n?je:o||i?s.components:void 0}),linkSafety:Me,controls:De,lineNumbers:!1,children:e},s.key)});export{O as a,ge as c,oe as d,J as i,_e as l,X as n,D as o,K as r,A as s,Le as t,w as u};
|
package/web/dist/assets/{notifications-section-Cw8yBZWz.js → notifications-section-B-dnPl16.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{ci as r,rn as i}from"./project-scope-context-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{ci as r,rn as i}from"./project-scope-context-Dq-Iq7xE.js";import{Nt as a,Rt as o}from"./queries-Dd6O2cf-.js";import{n as s}from"./toaster-Bo5vCbz-.js";import{t as c}from"./switch-Bv2Zf1uU.js";import{ct as l,lt as u}from"./index-Dedol522.js";var d=e(t(),1),f=n();function p(){let e=r(),t=a(),[n,p]=d.useState(!1),[m,h]=d.useState(u),g=t.data;d.useEffect(()=>{g!==void 0&&p(l(g.notifications).enabled)},[g]);let _=d.useCallback(t=>{p(t),i({notifications:{enabled:t}}).then(t=>e.setQueryData(o.uiState,t)).catch(t=>{s(t instanceof Error?t.message:String(t),{tone:`danger`}),e.invalidateQueries({queryKey:o.uiState})})},[e]),v=d.useCallback(e=>{if(!e){_(!1);return}if(u()!=="default"){_(!0);return}_(!0),Notification.requestPermission().then(e=>h(e)).catch(()=>h(u()))},[_]),y=m===`unsupported`;return(0,f.jsx)(`div`,{"data-slot":`notifications-section`,className:`mx-auto flex w-full max-w-2xl flex-col gap-7 p-4 pb-[calc(90px+env(safe-area-inset-bottom))] md:p-6 md:pb-6`,children:(0,f.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,f.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:(0,f.jsx)(`label`,{htmlFor:`notifications-enabled`,children:`Notify when an agent needs you`})}),(0,f.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`A browser notification when a task starts waiting, asks for review, or fails — only while this tab is in the background. Off by default.`})]}),(0,f.jsx)(c,{id:`notifications-enabled`,"data-slot":`notifications-toggle`,checked:n,disabled:y,onCheckedChange:v})]}),y?null:(0,f.jsxs)(`p`,{"data-slot":`notifications-permission`,"data-permission":m,className:`mt-4 text-[13px] text-muted-foreground`,children:[`Browser permission · `,m===`granted`?`Allowed`:m===`denied`?`Blocked`:`Not requested`]}),(0,f.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Permission is requested only when you enable notifications.`}),y?(0,f.jsx)(`p`,{"data-slot":`notifications-unsupported`,className:`text-[13px] text-muted-foreground`,children:`This browser does not support notifications, so the toggle is unavailable here.`}):null,!y&&n&&m===`denied`?(0,f.jsxs)(`div`,{"data-slot":`notifications-denied`,className:`mt-5 flex flex-col gap-2`,children:[(0,f.jsx)(`h3`,{className:`text-sm`,children:`Allow notifications in your browser`}),(0,f.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`This browser is blocking notifications. Your preference is saved. Allow notifications in the browser’s site settings to receive them.`}),(0,f.jsx)(`p`,{className:`settings-readout`,children:`Notifications are blocked for this site.`})]}):null]})})}export{p as NotificationsSection};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{Gt as t,Xt as n}from"./queries-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{Gt as t,Xt as n}from"./queries-Dd6O2cf-.js";import{t as r}from"./createLucideIcon-BHp8sXmF.js";import{t as i}from"./bot-TkDIw4y-.js";import{t as a}from"./external-link-BE6y205O.js";import{t as o}from"./folder-o-AvL3y3.js";import{n as s,t as c}from"./smartphone-Lr8Ug2z_.js";import{t as l}from"./square-terminal-B6RYYieR.js";import{t as u}from"./button-BQ2y4XRB.js";import{i as d,l as f,p,r as m,t as h}from"./dropdown-menu-4e2iKSMT.js";import{t as g}from"./own-lookup-DS54wXvD.js";var _=r(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),v=r(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),y=r(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),b=r(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),x=r(`diamond`,[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]),S=r(`feather`,[[`path`,{d:`M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z`,key:`18jl4k`}],[`path`,{d:`M16 8 2 22`,key:`vp34q`}],[`path`,{d:`M17.5 15H9`,key:`1oz8nu`}]]),C=r(`gem`,[[`path`,{d:`M10.5 3 8 9l4 13 4-13-2.5-6`,key:`b3dvk1`}],[`path`,{d:`M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z`,key:`7w4byz`}],[`path`,{d:`M2 9h20`,key:`16fsjt`}]]),w=r(`hammer`,[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]),T=r(`hexagon`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]),E=r(`mouse-pointer-2`,[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]),D=r(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),O=r(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),k=r(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),A=r(`waves-horizontal`,[[`path`,{d:`M2 12q2.5 2 5 0t5 0 5 0 5 0`,key:`8ddzzs`}],[`path`,{d:`M2 19q2.5 2 5 0t5 0 5 0 5 0`,key:`1wj4st`}],[`path`,{d:`M2 5q2.5 2 5 0t5 0 5 0 5 0`,key:`69x50u`}]]),j=r(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),M=e(),N={folder:o,terminal:l,vscode:y,cursor:E,zed:j,windsurf:A,sublime:S,idea:x,pycharm:T,webstorm:s,goland:O,rubymine:C,phpstorm:v,clion:b,rider:_,"android-studio":c,xcode:w,warp:D,bot:i,sparkles:k};function P(e,n){let r=F(e.id);return g(N,r===void 0?e.icon:t(n,r)?.icon)??a}function F(e){let t=e.startsWith(`cli:`)?e.slice(4):``;return t===``?void 0:t}function I({choices:e,onPick:t,label:r=`Open in…`,title:i,triggerVariant:o=`ghost`,disabled:s=!1,leading:c,trailing:l,slot:g,className:_}){let v=n().data;return(0,M.jsxs)(h,{children:[(0,M.jsx)(p,{asChild:!0,children:(0,M.jsxs)(u,{variant:o,size:`sm`,title:i,disabled:s,"data-slot":g,className:_,children:[(0,M.jsx)(a,{"aria-hidden":`true`}),r]})}),(0,M.jsxs)(m,{align:`end`,children:[c,c&&e.length>0?(0,M.jsx)(f,{}):null,e.map(({target:e,suffix:n,title:r})=>{let i=P(e,v);return(0,M.jsxs)(d,{"data-target":e.id,title:r,onSelect:()=>t(e.id),children:[(0,M.jsx)(i,{"aria-hidden":`true`}),e.label,n??``]},e.id)}),l]})]})}export{F as n,P as r,I as t};
|