@hearsay-tools/squawk 0.19.0-dev.9155 → 0.19.0-dev.9162
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/ci-wait/controller.d.ts +7 -7
- package/dist/features/reports/routes.d.ts +2 -2
- package/dist/server/activity-routes.d.ts +23 -23
- package/dist/server/project-settings-routes.d.ts +107 -107
- package/dist/server/projects-routes.d.ts +41 -41
- package/dist/server/provider-sign-in-routes.d.ts +2 -2
- package/dist/server/runner-install-routes.d.ts +10 -10
- package/dist/server/runs-routes.d.ts +311 -311
- package/dist/server/server.d.ts +1170 -1170
- package/dist/server/workspace-identity-routes.d.ts +5 -5
- package/package.json +4 -4
- package/web/dist/assets/accounts-section-m_1ntZJh.js +1 -0
- package/web/dist/assets/activity-motion-DDqgr8eF.js +1 -0
- package/web/dist/assets/activity-route-BlEZZxyI.js +1 -0
- package/web/dist/assets/agent-accounts-D_ZKAmaW.js +1 -0
- package/web/dist/assets/{agent-config-section-D8pxNy2V.js → agent-config-section-wICtFVks.js} +2 -2
- package/web/dist/assets/agent-defaults-section-BC9Ypg0g.js +1 -0
- package/web/dist/assets/{appearance-D_t3wCjY.js → appearance-fkDdWPlG.js} +1 -1
- package/web/dist/assets/{archive-on-merge-field-C63xRNFZ.js → archive-on-merge-field-B6kX09p-.js} +1 -1
- package/web/dist/assets/{ask-card-kqWOqKIc.js → ask-card-Cue5EajQ.js} +5 -5
- package/web/dist/assets/attention-BI6592lk.js +1 -0
- package/web/dist/assets/{automation-format-DB34jUyF.js → automation-format-jKMOXcHS.js} +1 -1
- package/web/dist/assets/automations-route-BfOpJjLK.js +2 -0
- package/web/dist/assets/{badge-DVxxThpb.js → badge-DAnkqD7i.js} +1 -1
- package/web/dist/assets/{button-B22ANdCY.js → button-BV_AiLj2.js} +1 -1
- package/web/dist/assets/{centered-state-BgSV4e79.js → centered-state-N8vWM_Hw.js} +1 -1
- package/web/dist/assets/{cez-idle-CdswdDRd.js → cez-idle-C0drOeLs.js} +1 -1
- package/web/dist/assets/{change-counts-wqSYI3W8.js → change-counts-BLLRvt46.js} +1 -1
- package/web/dist/assets/chunk-KS7C4IRE-BdLLx37K.js +3 -0
- package/web/dist/assets/{code-editor-GfQChdgl.js → code-editor-DZMD1guX.js} +1 -1
- package/web/dist/assets/{code-workbench-CUkiQ1pF.js → code-workbench-B0GIezrD.js} +1 -1
- package/web/dist/assets/{collapsible-Bx2vViFx.js → collapsible-D5i3hm2L.js} +1 -1
- package/web/dist/assets/{command-B2Y0By1v.js → command-4D8sPZJy.js} +1 -1
- package/web/dist/assets/{commit-list-Bjc-pQxv.js → commit-list-StLehTiQ.js} +1 -1
- package/web/dist/assets/{dialog-rpNyAWGb.js → dialog-DKr-j9S6.js} +1 -1
- package/web/dist/assets/diff-DEw-tkVq.js +3 -0
- package/web/dist/assets/{diff-controls-CaCUSyxs.js → diff-controls-CSO8HgZ0.js} +1 -1
- package/web/dist/assets/{diff-stat-Dy4uLuyP.js → diff-stat-DCO_BkZB.js} +1 -1
- package/web/dist/assets/{diff-view-4wxDvYXE.js → diff-view-BcU4Rnuo.js} +3 -3
- package/web/dist/assets/discard-changes-dialog-BEsdWdyJ.js +1 -0
- package/web/dist/assets/{dist-BSUJIXeE.js → dist-B2_vvox1.js} +1 -1
- package/web/dist/assets/dist-CCX8mhHc.js +1 -0
- package/web/dist/assets/{dist-BuF3mvCA.js → dist-ClMNSUvT.js} +1 -1
- package/web/dist/assets/{dist--f2yFdPY.js → dist-CyFJ-9Ex.js} +1 -1
- package/web/dist/assets/{dist-DudPJH39.js → dist-Du6flkGD.js} +1 -1
- package/web/dist/assets/{dropdown-menu-DjtKUK8F.js → dropdown-menu-NJZfnQCU.js} +1 -1
- package/web/dist/assets/{es2015-CUEfzDjB.js → es2015-BHonSvOU.js} +1 -1
- package/web/dist/assets/file-preview-_4nAs_Ai.js +2 -0
- package/web/dist/assets/{folder-browser-Civftk0W.js → folder-browser-CFd1U5hn.js} +1 -1
- package/web/dist/assets/{git-toolbar-CepvG0Ng.js → git-toolbar-DXnIUFi1.js} +1 -1
- package/web/dist/assets/github-g-Ykk4uE.js +1 -0
- package/web/dist/assets/{global-activity-route-DhmrWj31.js → global-activity-route-OsAvUny-.js} +2 -2
- package/web/dist/assets/highlighter-Crq-WTmN.js +3 -0
- package/web/dist/assets/host-context-DDbYAKpm.js +1 -0
- package/web/dist/assets/host-storage-B72yoDU1.js +1 -0
- package/web/dist/assets/hosts-CpDMDiQW.js +1 -0
- package/web/dist/assets/{html-report-frame-Ck76gKfA.js → html-report-frame-Bk6UkqKa.js} +1 -1
- package/web/dist/assets/{image-preview-CeEKI2T5.js → image-preview-CdL9a1Zj.js} +1 -1
- package/web/dist/assets/index-D_WkVdwL.css +1 -0
- package/web/dist/assets/index-Dp7K74Jw.js +21 -0
- package/web/dist/assets/label-CgU9vxuM.js +1 -0
- package/web/dist/assets/{live-protocol-DMhTnCmf.js → live-protocol-CNUmr-VT.js} +1 -1
- package/web/dist/assets/markdown-BB-PN03o.js +2 -0
- package/web/dist/assets/{middle-truncated-name-D41ibfXD.js → middle-truncated-name-jUQS2QzL.js} +1 -1
- package/web/dist/assets/{nav-row-styles-CgP5uNp4.js → nav-row-styles-CIedRn3A.js} +1 -1
- package/web/dist/assets/{open-in-menu-CbQWVBD0.js → open-in-menu-BI7mnPPf.js} +1 -1
- package/web/dist/assets/{option-select-BwSkbCrQ.js → option-select-Bmm4ktgQ.js} +1 -1
- package/web/dist/assets/{page-shell-BgabWJ3w.js → page-shell-BdjH5hyc.js} +1 -1
- package/web/dist/assets/{popover-CvL6hQ5c.js → popover-BQolmvDR.js} +1 -1
- package/web/dist/assets/{preferences-section-Cvh644K0.js → preferences-section-dKDCZSWD.js} +1 -1
- package/web/dist/assets/preview-EtD19mg1.js +1 -0
- package/web/dist/assets/preview-pane-connected-DBbCXW1b.js +3 -0
- package/web/dist/assets/{project-location-DR8go8oL.js → project-location-DJjcFmsE.js} +1 -1
- package/web/dist/assets/project-router-Dc6KBQsv.js +1 -0
- package/web/dist/assets/projects-section-CVFyzORg.js +1 -0
- package/web/dist/assets/{prompt-templates-section-DcxD28iA.js → prompt-templates-section-Jj1YbCwG.js} +2 -2
- package/web/dist/assets/queries-IlC9MZgh.js +1 -0
- package/web/dist/assets/{read-state-c_RNJaXO.js → read-state-BeVNfGkB.js} +1 -1
- package/web/dist/assets/{reference-chip-z7dZJVH-.js → reference-chip-BjerVjzM.js} +1 -1
- package/web/dist/assets/{remote-settings-notice-Dtaa3ovl.js → remote-settings-notice-Czl9yS5W.js} +1 -1
- package/web/dist/assets/repo-git-C9N9wa5l.js +1 -0
- package/web/dist/assets/{report-reader-mbkd2DKt.js → report-reader-Ci4sWoe1.js} +1 -1
- package/web/dist/assets/report-selection-CZ8eb9QP.js +1 -0
- package/web/dist/assets/reports-CQPRtR5G.js +1 -0
- package/web/dist/assets/{resources-section-g5XRlefz.js → resources-section-lLpdP6MD.js} +1 -1
- package/web/dist/assets/{review-notes-drafts-BdBvLP6E.js → review-notes-drafts-BjXqp0gY.js} +1 -1
- package/web/dist/assets/{review-panel-Ba8yb8Fu.js → review-panel-B4dp-Rol.js} +1 -1
- package/web/dist/assets/{review-strip-CdlMeV2i.js → review-strip-BE71YjB6.js} +1 -1
- package/web/dist/assets/{run-detail-refresh-C5qmRdgD.js → run-detail-refresh-CE0vyYYA.js} +1 -1
- package/web/dist/assets/{run-diff-BDMdnSv7.js → run-diff-ClfLRsHF.js} +3 -3
- package/web/dist/assets/run-header-DvbVw3uo.js +2 -0
- package/web/dist/assets/{select-DdH25sWT.js → select-CYo1lo6a.js} +1 -1
- package/web/dist/assets/{session-context-section-BqEdLdTv.js → session-context-section-B_NEOGby.js} +2 -2
- package/web/dist/assets/{settings-agent-picker-b4M6fQ8m.js → settings-agent-picker-DeAST7qR.js} +1 -1
- package/web/dist/assets/{settings-field-Bhh8I9fJ.js → settings-field-AyinSFR_.js} +1 -1
- package/web/dist/assets/{settings-list-detail-D3ibaYUj.js → settings-list-detail-BlEEuyae.js} +1 -1
- package/web/dist/assets/settings-save-bar-Dd3bTznK.js +1 -0
- package/web/dist/assets/{settings-shell-BUwdvhI9.js → settings-shell-Bt7NYun7.js} +1 -1
- package/web/dist/assets/sidebar-section-DdrFJBTL.js +1 -0
- package/web/dist/assets/{skills-BLkPhZO8.js → skills-DNCuhhKf.js} +1 -1
- package/web/dist/assets/status-dot-Bmn4xhch.js +1 -0
- package/web/dist/assets/{switch-CAKeV99j.js → switch-B9OfOEzC.js} +1 -1
- package/web/dist/assets/{tab-link-BKlpD9sn.js → tab-link-6TltE1jl.js} +1 -1
- package/web/dist/assets/{task-changes-Drvnew5P.js → task-changes-CdAzeh9M.js} +2 -2
- package/web/dist/assets/{task-commits-1MJHuX1i.js → task-commits-CzZJZj2x.js} +1 -1
- package/web/dist/assets/{task-file-scope-CB3L3KQl.js → task-file-scope-BuFeMG6a.js} +1 -1
- package/web/dist/assets/task-files-BFdMVAb3.js +1 -0
- package/web/dist/assets/{task-github-item-CMNk7FxR.js → task-github-item-Dv0Uflz7.js} +1 -1
- package/web/dist/assets/{task-groups-CGCnVqHE.js → task-groups-DCg4iOB9.js} +1 -1
- package/web/dist/assets/task-thread-C98mqSie.js +2 -0
- package/web/dist/assets/{textarea-vEsJAUAV.js → textarea-BGp28xFr.js} +1 -1
- package/web/dist/assets/thread-state-DqBwIoCM.js +4 -0
- package/web/dist/assets/toaster-DNnL8v10.js +4 -0
- package/web/dist/assets/{tool-display-B9NN44oU.js → tool-display-CTbToGmi.js} +1 -1
- package/web/dist/assets/use-finish-run-CFEVvqeg.js +1 -0
- package/web/dist/assets/use-hand-to-agent-state-BYN578_s.js +1 -0
- package/web/dist/assets/use-path-bases-B238cLk1.js +1 -0
- package/web/dist/assets/{use-search-params-writer-ClMScnNe.js → use-search-params-writer-DD5PEEZw.js} +1 -1
- package/web/dist/assets/use-workspace-config-save-DScW6_8J.js +1 -0
- package/web/dist/assets/{workflows-BUcx-n8J.js → workflows-IT5WTfLr.js} +3 -3
- package/web/dist/assets/{workspace-tools-dbiR1fzO.js → workspace-tools-D_opTe6D.js} +1 -1
- package/web/dist/assets/{worktrees-section-Dyb_QkSd.js → worktrees-section-B8ycJMoK.js} +4 -4
- package/web/dist/assets/zoomable-image-CULOtYYp.js +1 -0
- package/web/dist/index.html +41 -37
- package/web/dist/live-worker.js +2 -2
- package/web/dist/assets/accounts-section-BsgnDmow.js +0 -1
- package/web/dist/assets/activity-motion-Ckq9kC3I.js +0 -1
- package/web/dist/assets/activity-route-5S9WhN9U.js +0 -1
- package/web/dist/assets/agent-accounts-D_7QcFSx.js +0 -1
- package/web/dist/assets/agent-defaults-section-et5LHv9W.js +0 -1
- package/web/dist/assets/attention-DnxGjw_R.js +0 -1
- package/web/dist/assets/automations-route-B5YBpGMc.js +0 -2
- package/web/dist/assets/chunk-KS7C4IRE-Cg8l-LDN.js +0 -3
- package/web/dist/assets/diff-lwWO-At7.js +0 -3
- package/web/dist/assets/discard-changes-dialog-B3gvm7lX.js +0 -1
- package/web/dist/assets/dist-C_rn70hE.js +0 -1
- package/web/dist/assets/file-preview-98pJhZJj.js +0 -2
- package/web/dist/assets/github-4Jhl7lLG.js +0 -1
- package/web/dist/assets/highlighter-Cfo7mLVB.js +0 -3
- package/web/dist/assets/index-BK1FcZrA.css +0 -1
- package/web/dist/assets/index-DJB0lid-.js +0 -21
- package/web/dist/assets/label-feCJ3WOT.js +0 -1
- package/web/dist/assets/markdown-BAPhDASs.js +0 -2
- package/web/dist/assets/preview-pane-connected-B08ZdGux.js +0 -3
- package/web/dist/assets/project-router-j0uBi7Ep.js +0 -1
- package/web/dist/assets/projects-section-XDboHBFP.js +0 -1
- package/web/dist/assets/queries-CchoEEzj.js +0 -1
- package/web/dist/assets/repo-git-Dp9R2TuI.js +0 -1
- package/web/dist/assets/report-selection-BdGxjISG.js +0 -1
- package/web/dist/assets/reports-ya2OW-iR.js +0 -1
- package/web/dist/assets/run-header-BTRXYB4W.js +0 -2
- package/web/dist/assets/settings-save-bar-DFY_Km4X.js +0 -1
- package/web/dist/assets/sidebar-section-CcucfASN.js +0 -1
- package/web/dist/assets/status-dot-Drd4-nfa.js +0 -1
- package/web/dist/assets/task-files-B9okW1TC.js +0 -1
- package/web/dist/assets/task-thread-_2ch8BRt.js +0 -2
- package/web/dist/assets/thread-state-qNczqxZQ.js +0 -4
- package/web/dist/assets/toaster-zMN8cNZQ.js +0 -4
- package/web/dist/assets/use-finish-run-Dvm4JnAH.js +0 -1
- package/web/dist/assets/use-hand-to-agent-state-CBJvP-US.js +0 -1
- package/web/dist/assets/use-path-bases-C9yvZF5B.js +0 -1
- package/web/dist/assets/use-workspace-config-save-9jm9qV6u.js +0 -1
- package/web/dist/assets/zoomable-image-BUTgYpld.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ht as r,Vt as i,cn as a,tn as o,yt as s}from"./queries-IlC9MZgh.js";import{f as c,p as l,u}from"./host-context-DDbYAKpm.js";import{$t as d,Ar as f,Dr as p,Fi as m,Qt as h,Tr as ee,Xt as g,Zt as _,ar as te,kr as v,rr as y,vi as ne}from"./toaster-DNnL8v10.js";import{B as b,H as x,I as S,N as C,W as w,z as T}from"./live-protocol-CNUmr-VT.js";import{i as E,r as D}from"./cez-idle-C0drOeLs.js";import{o as O}from"./dist-CCX8mhHc.js";import{n as re,t as k}from"./hosts-CpDMDiQW.js";import{n as ie,r as A,t as j}from"./run-detail-refresh-CE0vyYYA.js";import{h as ae}from"./es2015-BHonSvOU.js";var oe=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 v({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`&&f(),`data`in t&&this.dispatchEvent(new MessageEvent(t.event,{data:t.data}))}})}requestReady(){return this.readyState!==2&&p()}close(){this.readyState=2,this.release()}},M=e(t(),1);b({runs:S(`summary`).optional()});var N=w().min(1),P=T().int().positive(),se=b({project:N,seq:P,run:d,relationships:w().min(1)}),ce=b({project:N,seq:P,id:w().min(1)}),le=b({generation:w().min(1),seq:T().int().nonnegative()}),ue=b({project:N,usage:x(w(),g)});b({runs:C(h),referenceStatuses:_,perProjectLimit:T(),truncated:C(w()),generation:w().min(1),eventSeq:T().int().nonnegative()});function de(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=se.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=ce.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=ue.safeParse(n);return e.success?{project:e.data.project,event:{type:`usage`,usage:e.data.usage}}:null}case`ready`:{let e=le.safeParse(n);return e.success?{project:null,event:{type:`ready`,generation:e.data.generation,seq:e.data.seq}}:null}default:return null}}function fe(){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 F(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 pe(e,t){if(!e)return;let n=e.filter(e=>e.id!==t);return n.length===e.length?e:n}var I=Object.freeze({});function L(){let e=I,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()}}}var R=n(),z=`/workspace/events?runs=summary`,B=2,me=3e3,he=[`run-summary`,`run-deleted`,`usage`,`ping`,`ready`],ge=[`project-added`,`project-removed`,`checkout-progress`,`automation-change`,`project-ready`],V=new Set;function _e(e){return V.add(e),()=>{V.delete(e)}}function H(e){return e[1]===`runs`&&e[2]===`list`}function U(e,t){return e.cancelQueries({queryKey:t}).then(()=>e.invalidateQueries({queryKey:t}))}function W(e){return e.invalidateQueries({predicate:e=>H(e.queryKey),refetchType:`none`}),e.getQueryCache().findAll({predicate:e=>H(e.queryKey)&&(e.state.data!==void 0||e.state.fetchStatus!==`idle`)}).map(t=>U(e,t.queryKey))}var ve=1e3,G=new WeakMap;function K(e){let t=i.repoBranches,n=G.get(e);if(n){n.set(JSON.stringify(t),t);return}G.set(e,new Map([[JSON.stringify(t),t]])),setTimeout(()=>{let t=G.get(e);G.delete(e);for(let n of t?.values()??[])e.invalidateQueries({queryKey:n})},ve)}function q(e,t,n=!1){if(t?.aborted)return Promise.resolve();let a=[i.runs.all,r.runsIndex,r.projects,i.health,i.worktrees,i.repoBranches,r.providerStatus],s=()=>{for(let t of a)e.cancelQueries({queryKey:t})};return t?.addEventListener(`abort`,s,{once:!0}),E(()=>{for(let t of e.getQueryCache().findAll({predicate:e=>H(e.queryKey)}))t.state.data===void 0&&t.state.fetchStatus!==`idle`&&e.cancelQueries({queryKey:t.queryKey,exact:!0});return[e.invalidateQueries({queryKey:i.runs.all,...n?{predicate:e=>[`list`,`detail`,`relationships`,`archived`].includes(String(e.queryKey[2]))}:{}}),e.invalidateQueries({predicate:e=>H(e.queryKey)}),o(e).reconcile(),e.invalidateQueries({queryKey:r.projects}),U(e,i.health),e.invalidateQueries({queryKey:i.worktrees}),e.invalidateQueries({queryKey:i.repoBranches}),e.invalidateQueries({queryKey:r.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`,s))}function J(e){return c()??Y(e)}function Y(e){let t=e.getQueryData(r.projects);if(t?.bootProject!==null)return typeof t?.bootProject==`string`&&t.bootProject!==``?t.bootProject:e.getQueryData(i.health)?.bootProject??e.getQueryData([`default`,`health`])?.bootProject??void 0}function ye(e,t){return[a({projectId:e,boot:e===t}).cacheScope,`runs`,`list`]}function be(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`)},a=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}))}}}),o=(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)},s,c,l=(i=!1)=>{c!==void 0&&clearTimeout(c),c=void 0,s!==void 0&&cancelAnimationFrame(s),s=void 0;let a=[];for(let{key:r,baseList:i,baseQuery:s,baseUpdateCount:c,runs:l}of t.values()){let t=e.getQueryCache().find({queryKey:r,exact:!0});if(t!==s||t?.state.dataUpdateCount!==c||t?.state.data!==i){a.push(r),n.set(JSON.stringify(r),{key:r,phase:`needs-start`,dirty:!1}),e.cancelQueries({queryKey:r,exact:!0});continue}o(r,a),e.setQueryData(r,e=>{let t=e;for(let e of l.values())t=F(t,e);return t})}if(t.clear(),!i)for(let e of a)r(e);return a},u=t=>{let n=[ye(t,Y(e))],r=[t,`runs`,`list`];return(t===J(e)||e.getQueryState(r))&&n.push(r),t===J(e)&&n.push(i.runs.list()),[...new Map(n.map(e=>[JSON.stringify(e),e])).values()]};return{onEvent(i,a){let d=u(i);if(a.type===`run-summary`&&a.summary.archived&&d.every(t=>!e.getQueryData(t)?.find(e=>e.id===a.summary.id)?.archived)&&a.type===`run-summary`){for(let r of d){let i=JSON.stringify(r),o=n.get(i);o?.phase===`fetching`&&(o.dirty=!0);let s=t.get(i);if(!s){let n=e.getQueryCache().find({queryKey:r,exact:!0});s={key:r,baseList:n?.state.data,baseQuery:n,baseUpdateCount:n?.state.dataUpdateCount,runs:new Map},t.set(i,s)}s.runs.set(a.summary.id,a.summary)}c===void 0&&(c=setTimeout(()=>{l()},50),typeof requestAnimationFrame==`function`&&(s=requestAnimationFrame(()=>{l()})));return}let f=l(!0);for(let t of d)o(t,f),a.type===`run-summary`?e.setQueryData(t,e=>F(e,a.summary)):e.setQueryData(t,e=>pe(e,a.id));for(let e of f)r(e)},flush:l,cancel(){a(),n.clear()}}}var xe=400;function Se(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})},xe))};return{onSummary(e,n){let a=e.delegation?.role===`worker`?e.delegation.parentRunId:void 0,o=e.delegation?.role===`worker`?e.delegation.supervisorRunId:void 0,s=t.get(e.id);if(t.set(e.id,{shape:n,...a===void 0?{}:{parentRunId:a},...o===void 0?{}:{supervisorRunId:o}}),s?.shape!==n){r(i.runs.relationships(e.id),!0);for(let e of[a,o])e!==void 0&&r(i.runs.relationships(e),!0)}},onDeleted(n){let a=t.get(n);t.delete(n),e.removeQueries({queryKey:i.runs.relationships(n)}),a?.supervisorRunId!==void 0&&r(i.runs.relationships(a.supervisorRunId),!0),a?.parentRunId===void 0?r([...i.runs.all,`relationships`],!1):r(i.runs.relationships(a.parentRunId),!0)},cancel(){for(let e of n.values())clearTimeout(e);n.clear(),t.clear()}}}var X={predicate:e=>e.queryKey[1]===`runs`&&e.queryKey[2]===`archived`};function Z(e,t){if(t.delegation?.role===`worker`)return;let n=!1;for(let r of e.getQueryCache().findAll(X)){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(X)}function Ce(e,t,n,r,a){switch(n.type){case`run-summary`:{let t=n.summary;if(Z(e,t),a.onSummary(t,n.relationships),r.fetcher.onEvent(t.id),t.delegation?.role===`worker`){let n=t.delegation.parentRunId;A(e,i.runs.detail(n)),r.refreshParent(n)}let o=i.runs.changes(t.id);e.getQueryData(o)!==void 0&&e.invalidateQueries({queryKey:o}),e.invalidateQueries({queryKey:i.worktrees}),K(e);return}case`run-deleted`:a.onDeleted(n.id),r.fetcher.forget(n.id),e.removeQueries({queryKey:i.runs.detail(n.id)}),e.removeQueries({queryKey:i.runs.diff(n.id)}),e.setQueriesData(X,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(X),e.invalidateQueries({queryKey:i.worktrees}),K(e);return;case`usage`:t.set(n.usage);return;case`ping`:case`ready`:return}}function we(e,t,n,r){if(n!==l()){if(r.type===`run-summary`){let i=r.summary;if(t.fetcher.onEvent(i.id,n),i.delegation?.role===`worker`){let r=i.delegation.parentRunId;A(e,[n,`runs`,`detail`,r]),t.refreshParent(r,n)}return}t.fetcher.forget(r.id,n),e.removeQueries({queryKey:[n,`runs`,`detail`,r.id]}),e.removeQueries({queryKey:[n,`runs`,`diff`,r.id]})}}function Te(e,t=u(z)){let n=m();(0,M.useEffect)(()=>{let a=oe;if(typeof a!=`function`)return;let s=null,c=o(n);c.setUnknownGenerationHandler(()=>{let e=s?.requestReady;return typeof e==`function`&&e.call(s)});let l=ie(n),u=j(n),d={fetcher:u,refreshParent:l.refresh},f=fe(),p=be(n),m=Se(n),h=!1,g,_=!1,v=!1,b=!1,x=!1,S=()=>{b=!0,x=!1;let e=r.providerStatus;n.cancelQueries({queryKey:e,exact:!0}).then(()=>n.invalidateQueries({queryKey:e,exact:!0,refetchType:`active`})).finally(()=>{if(v||!x){b=!1;return}S()})},C=()=>{v||g!==void 0||(g=setTimeout(()=>{g=void 0,v||w()},me))},w=()=>{s?.close(),s=new a(t,{withCredentials:!0}),s.addEventListener(`open`,()=>{h=!0,f.reset(),c.detach(),D(!1),_&&(p.flush(),q(n)),_||(E(()=>W(n)),n.cancelQueries({queryKey:i.health}).then(()=>{v||n.invalidateQueries({queryKey:i.health})}),c.reconcile()),_=!0});for(let t of he)s.addEventListener(t,r=>{let i=de(t,r.data);if(!i)return;if(i.event.type===`ready`){let e=f.ready(i.event.seq);c.ready(i.event.generation,i.event.seq),e&&(p.flush(),q(n));return}let a=(i.event.type===`run-summary`||i.event.type===`run-deleted`)&&f.frame(i.event.seq);i.event.type===`ping`&&h&&(h=!1,E(()=>W(n)),D(!0)),i.project!==null&&(i.event.type===`run-summary`||i.event.type===`run-deleted`?c.run(i.project,i.event,a):i.event.type===`usage`&&c.usage(i.project,i.event.usage)),i.project!==null&&(i.event.type===`run-summary`||i.event.type===`run-deleted`)&&(p.onEvent(i.project,i.event),we(n,d,i.project,i.event)),(i.project===null||i.project===J(n))&&Ce(n,e,i.event,d,m),a&&(p.flush(),q(n))});for(let e of ge)s.addEventListener(e,t=>{let i;try{i=JSON.parse(t.data)}catch{return}if(e===`project-ready`)c.reconcile({hold:!0});else if(e!==`checkout-progress`&&e!==`automation-change`){n.invalidateQueries({queryKey:r.projects});let e=n.getQueryState(k.hostsProjects);e&&re(e.data,e.status===`error`)&&n.invalidateQueries({queryKey:k.hostsProjects})}if(e===`project-added`){let e=i?.project?.id;typeof e==`string`&&e!==``&&c.restoreProject(e),c.reconcile({hold:!0})}if(e===`project-removed`){let e=i?.id;typeof e==`string`&&e!==``&&c.dropProject(e)}for(let t of[...V])t(e,i)});s.addEventListener(`health`,e=>{let t;try{t=JSON.parse(e.data)}catch{return}let r=ne.safeParse(t);r.success&&(n.cancelQueries({queryKey:i.health}),n.setQueryData(i.health,r.data))}),s.addEventListener(`provider-status`,e=>{let t;try{t=JSON.parse(e.data)}catch{return}let i=te(t);if(!i)return;let a=r.providerStatus,o=y(n.getQueryData(a),i);if(o!==void 0){n.setQueryData(a,o);return}if(b){x=!0;return}S()}),s.addEventListener(`error`,()=>{D(!1),c.detach(),s?.readyState===B&&C()})},T=()=>{document.visibilityState===`visible`&&(p.flush(),c.flush(),(!s||s.readyState===B)&&(clearTimeout(g),g=void 0,w()))},O=()=>{clearTimeout(g),g=void 0,p.flush()};document.addEventListener(`visibilitychange`,T),window.addEventListener(`pagehide`,O);let A=ee((e,t)=>(p.flush(),q(n,e,t)));return w(),()=>{A(),v=!0,D(!1),clearTimeout(g),p.flush(),p.cancel(),c.stop(),l.cancel(),u.cancel(),c.setUnknownGenerationHandler(void 0),m.cancel(),document.removeEventListener(`visibilitychange`,T),window.removeEventListener(`pagehide`,O),s?.close(),s=null}},[n,e,t])}var Q=(0,M.createContext)(null);function Ee({children:e}){let[t]=(0,M.useState)(L);return Te(t),s(),(0,R.jsx)(Q.Provider,{value:t,children:e})}function De(e){let t=(0,M.useContext)(Q),n=t?t.get:ke;return(0,M.useSyncExternalStore)(t?t.subscribe:Oe,()=>e?n()[e]:void 0,()=>void 0)}var Oe=()=>()=>void 0,ke=()=>I,Ae=`Label`,$=M.forwardRef((e,t)=>(0,R.jsx)(ae.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));$.displayName=Ae;var je=$;function Me({className:e,...t}){return(0,R.jsx)(je,{"data-slot":`label`,className:O(`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{De as i,Ee as n,_e as r,Me 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(),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};
|
|
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({workerId:B(),status:q([`review`,`done`,`failed`,`cancelled`]),observedAt:N(),summary:L().max(4e3).optional(),revision:V().int().nonnegative().optional()}).strict(),Mo=q([`one`,`any`,`all`]),No=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(),Po=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:No.optional(),purpose:q([`completion-refusal`,`undelivered-question`]).optional(),requestHash:L().regex(/^[0-9a-f]{64}$/).optional(),deadline:N().optional()}).strict(),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:Po}),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:jo});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,jo 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,Po as x,Ho as y,V as z};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{d as r,f as i,m as a,p as o}from"./chunk-KS7C4IRE-BdLLx37K.js";import{c as s}from"./dist-CCX8mhHc.js";import{$t as c,S as l,an as u,en as d,h as f,in as p,nn as m,on as h,rn as g,tn as _,x as v}from"./index-Dp7K74Jw.js";import{i as y,n as b,s as x}from"./chunk-BO2N2NFS-DQrpGzb-.js";import{i as S,o as C,r as w,t as T}from"./highlighter-Crq-WTmN.js";var E=e(t(),1),D=n();function O({isOpen:e,onClose:t,onConfirm:n,url:r}){return(0,D.jsx)(c,{open:e,onOpenChange:e=>{e||t()},children:(0,D.jsxs)(m,{"data-slot":`link-safety-dialog`,children:[(0,D.jsxs)(u,{children:[(0,D.jsx)(h,{children:`Open this link?`}),(0,D.jsxs)(g,{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,D.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,D.jsxs)(p,{children:[(0,D.jsx)(_,{children:`Cancel`}),(0,D.jsx)(d,{onClick:n,children:`Open link`})]})]})})}var k=`text-accent-text underline underline-offset-2`;function A({href:e,children:t,internal:n,...r}){let[a,o]=(0,E.useState)(!1),s=i();return e?n?s?(0,D.jsx)(j,{...r,href:e,children:t}):(0,D.jsx)(`a`,{...r,href:e,"data-streamdown":`link`,className:k,children:t}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`a`,{...r,href:e,"data-streamdown":`link`,className:`cursor-pointer ${k}`,onClick:e=>{e.preventDefault(),o(!0)},children:t}),(0,D.jsx)(O,{isOpen:a,url:e,onClose:()=>o(!1),onConfirm:()=>{window.open(e,`_blank`,`noreferrer`),o(!1)}})]}):(0,D.jsx)(`span`,{children:t})}function j({href:e,children:t,...n}){let i=a(),s=o(),c=r(e),l=f();return(0,D.jsx)(`a`,{...n,href:c,"data-streamdown":`link`,className:k,onClick:t=>{M(t,l,e)||P(t,i,e,s)},children:t})}function M(e,t,n){if(!t?.showing||!N(e))return!1;let r=new URL(n,window.location.origin),i=/\/files\/?$/.test(r.pathname)?r.searchParams.get(`path`):null;return!i||!t.revealChange(i)?!1:(e.preventDefault(),!0)}var N=e=>e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey;function P(e,t,n,r){N(e)&&(e.preventDefault(),t(n,{state:{readerFrom:r.pathname+r.search,filesRestoreKey:r.key}}))}var F={code:{name:`shiki`,type:`code-highlighter`,getThemes:()=>[T,T],getSupportedLanguages:()=>C(),supportsLanguage:e=>C().includes(String(e).toLowerCase()),highlight:({code:e,language:t},n)=>S(e,String(t))||(w(e,String(t)).then(e=>n?.(e)),null)}},I=[T,T],L={code:{copy:!0,download:!1},table:!1,mermaid:!1},R=[...Object.values(x),J];function z(){let e=t=>{if(!t.children)return;let n=[];for(let r of t.children)if(r.type===`text`&&r.value?.includes(`
|
|
2
|
+
`)){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 B=[...Object.values(b),z],V=[`p`,`strong`,`em`,`del`,`code`,`a`],H={p:`span`,a:`span`},U={enabled:!0,renderModal:e=>(0,D.jsx)(O,{...e})},W=`https://refused.invalid/`,G=new WeakSet;function K(e){let t=e.position?.start.offset,n=e.position?.end.offset;return t===void 0||n===void 0?null:`${t}:${n}`}function q(e){return(t,n)=>{let r=new Set,i=new Map,a=t=>{if((t.type===`link`||t.type===`definition`)&&t.url){let n=l(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=K(t);t.type===`link`&&e!==null&&r.add(e)}}t.children?.forEach(a)};a(t);let o=e=>{let t=K(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 J(){return(e,t)=>{let n=e=>{let r=K(e);e.tagName===`a`&&r!==null&&t.data.taskLinks instanceof Set&&t.data.taskLinks.has(r)&&G.add(e),e.children?.forEach(n)};n(e)}}var Y=0,X=(0,E.memo)(function({children:e,breaks:t=!1,inline:n=!1,document:r=!1,imageSrc:i}){let a=(0,E.useContext)(v),o=(0,E.useMemo)(()=>{let e={instance:++Y},n=new Set;function o(){let e=t=>{if(t.type===`image`&&t.url&&i){let e=i(t.url);t.url=e?new URL(e,window.location.href).href:W,e&&n.add(t.url)}t.children?.forEach(e)};return e}let s=a?[[q,a]]:[],c=r&&i?[[o,e]]:[];return{key:e.instance,remark:[...t?B:Object.values(b),...s,...c],components:{...a||r?{a:({href:e,children:t,node:n})=>r&&!a&&!/^(?:https?:|mailto:|#)/i.test(e??``)?(0,D.jsx)(`span`,{children:t}):(0,D.jsx)(A,{href:e,internal:n!==void 0&&G.has(n),children:t})}:{},...r?{img:({src:e,alt:t})=>typeof e==`string`&&n.has(e)?(0,D.jsx)(`img`,{src:e,alt:t??``,loading:`lazy`}):(0,D.jsxs)(`span`,{className:`text-muted-foreground`,children:[`[Image: `,t||`embedded image`,`]`]})}:{}}}},[a,t,r,i]);return(0,D.jsx)(y,{className:n?`thread-markdown thread-markdown-inline`:`thread-markdown`,plugins:F,shikiTheme:I,...s({rehypePlugins:a?R:void 0,remarkPlugins:a||r&&i?o.remark:t?B:void 0,allowedElements:n?V:void 0,unwrapDisallowed:n||void 0,components:n?H:a||r?o.components:void 0}),linkSafety:U,controls:L,lineNumbers:!1,children:e},o.key)});export{P as n,X as t};
|
package/web/dist/assets/{middle-truncated-name-D41ibfXD.js → middle-truncated-name-jUQS2QzL.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{o as t}from"./dist-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{o as t}from"./dist-CCX8mhHc.js";var n=e(),r=12;function i(e){let t=e.lastIndexOf(`.`);if(t<=0)return``;let n=e.lastIndexOf(`.`,t-1);return n>0&&e.length-n<=r?e.slice(n):e.slice(t)}function a({name:e,path:r,className:a}){let o=i(e),s=e.slice(0,e.length-o.length);return(0,n.jsxs)(`span`,{"data-slot":`middle-truncated-name`,title:r,className:t(`flex min-w-0`,a),children:[(0,n.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),o?(0,n.jsx)(`span`,{className:`shrink-0 whitespace-pre`,children:o}):null]})}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./dist-
|
|
1
|
+
import"./dist-CCX8mhHc.js";import{t as e}from"./createLucideIcon-BHp8sXmF.js";var t=e(`circle-dashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),n=`bg-sidebar-row-selected text-foreground font-medium hover:bg-sidebar-row-selected`,r=`bg-sidebar-row-selected text-foreground hover:bg-sidebar-row-selected`,i=`flex flex-col gap-[12px]`,a=`flex flex-col gap-px`,o=`flex flex-col gap-px`,s=`truncate px-[10px] pt-[2px] pb-[4px] text-xs font-medium text-soft-foreground`,c=`group flex h-[32px] items-center gap-[10px] rounded-[6px] px-[10px] text-[13px] text-muted-foreground focus-visible:outline-2 focus-visible:outline-ring`,l=`hover:bg-sidebar-row-hover hover:text-foreground`,u=`size-[15px] shrink-0 text-soft-foreground group-aria-[current=page]:text-foreground`,d=`ml-auto text-xs tabular-nums text-soft-foreground`,f=`mb-[16px] flex flex-col`,p=`px-[10px] pt-[2px] pb-[4px] text-[12px] font-medium text-soft-foreground`,m=`group flex h-[48px] items-center gap-[12px] rounded-[8px] px-[10px] text-[14px] text-foreground focus-visible:outline-2 focus-visible:outline-ring`,h=`size-[18px] shrink-0 text-soft-foreground group-aria-[current=page]:text-foreground`,g=`ml-auto text-[13px] tabular-nums text-soft-foreground`,_=`size-[15px] shrink-0 text-soft-foreground`;export{t as _,p as a,i as c,s as d,u as f,n as g,o as h,f as i,d as l,l as m,_ as n,h as o,c as p,g as r,m as s,r as t,a as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{Yt as t,en as n}from"./queries-IlC9MZgh.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-BV_AiLj2.js";import{i as d,l as f,p,r as m,t as h}from"./dropdown-menu-NJZfnQCU.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{j as i,F as n,P as r,I as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{a as t,i as n,n as r,r as i,t as a}from"./select-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{a as t,i as n,n as r,r as i,t as a}from"./select-CYo1lo6a.js";var o=e(),s=`\0empty`,c=e=>e===``?s:e,l=e=>e===s?``:e;function u({value:e,onValueChange:s,options:u,disabled:d,placeholder:f,contentClassName:p,...m}){let h=String(e);return(0,o.jsxs)(a,{value:u.some(e=>e.value===h)?c(h):``,onValueChange:e=>s(l(e)),...d===void 0?{}:{disabled:d},children:[(0,o.jsx)(n,{"data-value":h,...m,children:(0,o.jsx)(t,{...f===void 0?{}:{placeholder:f}})}),(0,o.jsx)(r,{...p===void 0?{}:{className:p},children:u.map(e=>(0,o.jsx)(i,{value:c(e.value),"data-value":e.value,...e.disabled?{disabled:!0}:{},children:e.label},e.value))})]})}export{u as t};
|
|
@@ -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{o as r}from"./dist-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{o as r}from"./dist-CCX8mhHc.js";import{t as i}from"./button-BV_AiLj2.js";var a=n(),o=e(t(),1),s=`(min-width: 48rem)`;function c(){let[e,t]=(0,o.useState)(()=>typeof window.matchMedia!=`function`||window.matchMedia(`(min-width: 48rem)`).matches);return(0,o.useEffect)(()=>{if(typeof window.matchMedia!=`function`)return;let e=window.matchMedia(s),n=()=>t(e.matches);return n(),e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function l(e,t=3){return e<=0?`empty`:e<=t?`sparse`:`full`}function u({variant:e=`outline`,className:t,...n}){return(0,a.jsx)(i,{variant:e,size:`default`,"data-page-shell-action":``,className:r(`shrink-0`,t),...n})}function d({title:e,scope:t,subtitle:n,status:i,primaryAction:o,secondaryActions:s,headerSlot:c=`page-header`,scopeSlot:l=`page-header-scope`,subtitleSlot:u=`page-header-subtitle`,hideSubtitleOnMobile:d=!1,headerExtra:f,headerRef:p}){let m=!!(i||s||o);return(0,a.jsx)(`header`,{ref:p,"data-slot":`page-shell-header`,"data-header-slot":c,children:(0,a.jsxs)(`div`,{"data-slot":c,className:`flex min-w-0 flex-col`,children:[(0,a.jsxs)(`div`,{"data-slot":`page-shell-header-row`,children:[(0,a.jsxs)(`div`,{"data-slot":`page-shell-header-title-block`,children:[(0,a.jsxs)(`h1`,{"data-slot":`page-shell-header-title`,className:`min-w-0 break-words`,children:[e,t?(0,a.jsxs)(a.Fragment,{children:[` `,(0,a.jsxs)(`span`,{"data-slot":l,className:`font-normal text-muted-foreground`,children:[`· `,t]})]}):null]}),n?(0,a.jsx)(`p`,{"data-slot":u,className:r(`mt-1 text-[13px] text-muted-foreground`,d&&`max-md:hidden`),children:n}):null]}),m?(0,a.jsxs)(`div`,{"data-slot":`page-shell-header-actions`,children:[i?(0,a.jsx)(`div`,{"data-slot":`page-header-status`,className:`flex shrink-0 items-center`,children:i}):null,s?(0,a.jsx)(`div`,{"data-slot":`page-header-secondary`,className:`flex flex-wrap items-center gap-2`,children:s}):null,o?(0,a.jsx)(`div`,{"data-slot":`page-header-primary`,className:`flex shrink-0 items-center`,children:o}):null]}):null]}),f]})})}function f({template:e,route:t,density:n,header:r,headerSpacing:i=`default`,fillHeight:o=!1,flushPadding:s=!1,beforeHeader:c,emptyState:l,sparseFooter:u,rootProps:f,rootRef:p,className:m,bodyClassName:h,children:g}){let _=n===`empty`&&l!==void 0;return(0,a.jsx)(`div`,{ref:p,"data-slot":`page-shell`,"data-route":t,"data-template":e,"data-density":n,"data-header-spacing":i,"data-fill-height":o?`true`:void 0,"data-flush-padding":s?`true`:void 0,className:m,...f,children:(0,a.jsxs)(`div`,{"data-slot":`page-shell-frame`,children:[c,r?(0,a.jsx)(d,{...r}):null,(0,a.jsx)(`div`,{"data-slot":`page-shell-body`,className:h,children:_?(0,a.jsx)(`div`,{"data-slot":`page-shell-empty`,children:l}):(0,a.jsxs)(a.Fragment,{children:[g,n===`sparse`&&u?u:null]})})]})})}function p(e){return(0,a.jsx)(f,{template:`Table`,...e})}function m(e){return(0,a.jsx)(f,{template:`Split`,...e})}function h(e){return(0,a.jsx)(f,{template:`Reading`,...e})}function g(e){return(0,a.jsx)(f,{template:`Form`,...e})}function _(e){return(0,a.jsx)(f,{template:`Board`,...e})}function v({icon:e,title:t,description:n,actions:i,slot:o=`page-shell-empty-state`,className:s}){return(0,a.jsxs)(`section`,{"data-slot":o,"data-page-shell-empty":``,"aria-label":t,className:r(`flex flex-col items-start gap-3 rounded-xl border border-border bg-card p-6`,s),children:[(0,a.jsxs)(`div`,{className:`flex items-start gap-3`,children:[e?(0,a.jsx)(`span`,{"aria-hidden":`true`,className:`mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-lg border border-border bg-muted/50 text-muted-foreground [&_svg]:size-4`,children:e}):null,(0,a.jsxs)(`div`,{className:`min-w-0`,children:[(0,a.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:t}),n?(0,a.jsx)(`div`,{className:`mt-1 text-sm leading-relaxed text-muted-foreground`,children:n}):null]})]}),i?(0,a.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1`,children:i}):null]})}function y({summary:e,actions:t,slot:n=`page-shell-sparse-footer`,className:i}){return(0,a.jsxs)(`aside`,{"data-slot":n,"data-page-shell-sparse":``,className:r(`min-w-0`,i),children:[(0,a.jsx)(`div`,{className:`min-w-0 text-muted-foreground`,children:e}),t?(0,a.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:t}):null]})}function b(e){let t=c(),[n,r]=(0,o.useState)(!1);return(0,o.useLayoutEffect)(()=>{let n=e.current;if(!n)return;let i=e=>{r(e>0?e>=660:t)};if(i(n.getBoundingClientRect().width),typeof ResizeObserver!=`function`)return;let a=new ResizeObserver(e=>{let t=e[0]?.contentRect.width??n.getBoundingClientRect().width;i(t)});return a.observe(n),()=>a.disconnect()},[e,t]),n}function x({list:e,detail:t,className:n}){return(0,a.jsx)(`div`,{"data-slot":`page-shell-split-host`,className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:(0,a.jsxs)(`div`,{"data-slot":`page-shell-split-pane`,"data-has-detail":t?`true`:`false`,className:n,children:[(0,a.jsx)(`div`,{"data-slot":`page-shell-split-list`,className:`flex min-h-0 min-w-0 flex-col`,children:e}),t?(0,a.jsx)(`div`,{"data-slot":`page-shell-split-detail`,className:`flex min-h-0 min-w-0 flex-col`,children:t}):null]})})}export{_ as a,u as c,p as d,l as f,b as i,h as l,c as m,y as n,g as o,s as p,x as r,f as s,v as t,m as u};
|
|
@@ -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,n as i,o as a}from"./dist-
|
|
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,n as i,o as a}from"./dist-CCX8mhHc.js";import{a as o,d as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,t as g,u as _}from"./es2015-BHonSvOU.js";import{a as v,i as ee,n as y,r as b,t as x}from"./dist-Du6flkGD.js";var S=e(t(),1),C=n(),w=`Popover`,[T,te]=d(w,[v]),E=v(),[ne,D]=T(w),O=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,c=E(t),l=S.useRef(null),[d,f]=S.useState(!1),[p,m]=s({prop:r,defaultProp:i??!1,onChange:a,caller:w});return(0,C.jsx)(ee,{...c,children:(0,C.jsx)(ne,{scope:t,contentId:u(),triggerRef:l,open:p,onOpenChange:m,onOpenToggle:S.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:d,onCustomAnchorAdd:S.useCallback(()=>f(!0),[]),onCustomAnchorRemove:S.useCallback(()=>f(!1),[]),modal:o,children:n})})};O.displayName=w;var k=`PopoverAnchor`,A=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=D(k,n),a=E(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return S.useEffect(()=>(o(),()=>s()),[o,s]),(0,C.jsx)(x,{...a,...r,ref:t})});A.displayName=k;var j=`PopoverTrigger`,M=S.forwardRef((e,t)=>{let{__scopePopover:n,...i}=e,a=D(j,n),o=E(n),s=r(t,a.triggerRef),l=(0,C.jsx)(c.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":K(a.open),...i,ref:s,onClick:m(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:(0,C.jsx)(x,{asChild:!0,...o,children:l})});M.displayName=j;var N=`PopoverPortal`,[P,F]=T(N,{forceMount:void 0}),I=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=D(N,t);return(0,C.jsx)(P,{scope:t,forceMount:n,children:(0,C.jsx)(_,{present:n||a.open,children:(0,C.jsx)(l,{asChild:!0,container:i,children:r})})})};I.displayName=N;var L=`PopoverContent`,R=S.forwardRef((e,t)=>{let n=F(L,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=D(L,e.__scopePopover);return(0,C.jsx)(_,{present:r||a.open,children:a.modal?(0,C.jsx)(z,{...i,ref:t}):(0,C.jsx)(B,{...i,ref:t})})});R.displayName=L;var re=i(`PopoverContent.RemoveScroll`),z=S.forwardRef((e,t)=>{let n=D(L,e.__scopePopover),i=S.useRef(null),a=r(t,i),o=S.useRef(!1);return S.useEffect(()=>{let e=i.current;if(e)return g(e)},[]),(0,C.jsx)(f,{as:re,allowPinchZoom:!0,children:(0,C.jsx)(V,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:m(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:m(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;o.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:m(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),B=S.forwardRef((e,t)=>{let n=D(L,e.__scopePopover),r=S.useRef(!1),i=S.useRef(!1);return(0,C.jsx)(V,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),V=S.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,m=D(L,n),g=E(n);return h(),(0,C.jsx)(o,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,C.jsx)(p,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,C.jsx)(b,{"data-state":K(m.open),role:`dialog`,id:m.contentId,...g,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),H=`PopoverClose`,U=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=D(H,n);return(0,C.jsx)(c.button,{type:`button`,...r,ref:t,onClick:m(e.onClick,()=>i.onOpenChange(!1))})});U.displayName=H;var W=`PopoverArrow`,G=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=E(n);return(0,C.jsx)(y,{...i,...r,ref:t})});G.displayName=W;function K(e){return e?`open`:`closed`}var q=O,J=A,Y=M,ie=I,ae=R;function X(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function oe(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=X(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(X(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function se(e){let t=e.visualViewport;return t?{top:Math.max(0,Math.round(t.offsetTop)),bottom:X(e)}:{top:0,bottom:0}}function ce(e,t=0){let n=typeof t==`number`?{top:t,right:t,bottom:t,left:t}:t;return{top:(n.top??0)+e.top,right:n.right??0,bottom:(n.bottom??0)+e.bottom,left:n.left??0}}function le(e,t){let n=e.visualViewport;if(!n)return t({top:0,bottom:0}),()=>{};let r=()=>t(se(e));return r(),n.addEventListener(`resize`,r),n.addEventListener(`scroll`,r),()=>{n.removeEventListener(`resize`,r),n.removeEventListener(`scroll`,r)}}function ue(){let[e,t]=(0,S.useState)({top:0,bottom:0});return(0,S.useEffect)(()=>le(window,e=>t(t=>t.top===e.top&&t.bottom===e.bottom?t:e)),[]),e}function de(e){let t=(0,S.useRef)(e);t.current=e,(0,S.useEffect)(()=>{let e=document.documentElement;return oe(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}var fe=new Set([``,`text`,`search`,`email`,`url`,`tel`,`password`,`number`]);function pe(e){if(!e||typeof e!=`object`)return!1;let t=e,n=t.tagName?.toUpperCase();return n===`TEXTAREA`?!0:n===`INPUT`?fe.has((t.type??``).toLowerCase()):t.isContentEditable===!0}var Z=new WeakMap;function me(e){let t=Z.get(e),n=t&&t.width===e.innerWidth?Math.max(t.height,e.innerHeight):e.innerHeight;return Z.set(e,{width:e.innerWidth,height:n}),n-e.innerHeight}function Q(e){let t=me(e),n=e.visualViewport?.scale??1;return Math.abs(n-1)<.05&&X(e)>80||t>80&&pe(e.document?.activeElement)}function he(){let[e,t]=(0,S.useState)(!1);return(0,S.useEffect)(()=>{let e=window,n=()=>t(Q(e));n();let r=e.visualViewport;return r?.addEventListener(`resize`,n),r?.addEventListener(`scroll`,n),window.addEventListener(`resize`,n),document.addEventListener(`focusin`,n),document.addEventListener(`focusout`,n),()=>{r?.removeEventListener(`resize`,n),r?.removeEventListener(`scroll`,n),window.removeEventListener(`resize`,n),document.removeEventListener(`focusin`,n),document.removeEventListener(`focusout`,n)}},[]),e}var $=S.createContext(null);function ge({...e}){let t=S.useRef(!1);return(0,C.jsx)($,{value:t,children:(0,C.jsx)(q,{"data-slot":`popover`,...e})})}function _e({onPointerDownCapture:e,onKeyDownCapture:t,...n}){let r=S.useContext($);return(0,C.jsx)(Y,{"data-slot":`popover-trigger`,...n,onPointerDownCapture:t=>{r&&(r.current=t.pointerType===`touch`),e?.(t)},onKeyDownCapture:e=>{r&&(r.current=!1),t?.(e)}})}function ve({className:e,align:t=`center`,sideOffset:n=4,collisionPadding:r,onOpenAutoFocus:i,...o}){let s=ue(),c=S.useContext($);return(0,C.jsx)(ie,{children:(0,C.jsx)(ae,{"data-slot":`popover-content`,align:t,sideOffset:n,onOpenAutoFocus:e=>{let t=c?.current;if(c&&(c.current=!1),i?.(e),e.defaultPrevented||!t)return;let n=e.target;n instanceof HTMLElement&&n.querySelector(`[cmdk-input]`)&&(e.preventDefault(),n.focus({preventScroll:!0}))},collisionPadding:ce(s,r),className:a(`z-50 w-72 max-w-(--radix-popover-content-available-width) [overflow-wrap:anywhere] origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...o})})}function ye({...e}){return(0,C.jsx)(J,{"data-slot":`popover-anchor`,...e})}export{Q as a,_e as i,ye as n,de as o,ve as r,he as s,ge as t};
|
|
@@ -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{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Ht as r,It as i}from"./queries-IlC9MZgh.js";import{Fi as a,Ln as o,n as s}from"./toaster-DNnL8v10.js";import{t as c}from"./switch-B9OfOEzC.js";import{gt as l,ht as u}from"./index-Dp7K74Jw.js";import{n as d,t as f}from"./save-cue-CpHgT93o.js";import{n as p}from"./archive-on-merge-field-B6kX09p-.js";var m=e(t(),1),h=n();function g(){let e=a(),t=i(),[n,p]=m.useState(!1),[g,_]=m.useState(l),v=d(),y=t.data;m.useEffect(()=>{y!==void 0&&p(u(y.notifications).enabled)},[y]);let b=m.useCallback(t=>{p(t),o({notifications:{enabled:t}}).then(t=>{e.setQueryData(r.uiState,t),v.flash()}).catch(t=>{s(t instanceof Error?t.message:String(t),{tone:`danger`}),e.invalidateQueries({queryKey:r.uiState})})},[e,v.flash]),x=m.useCallback(e=>{if(!e){b(!1);return}if(l()!=="default"){b(!0);return}b(!0),Notification.requestPermission().then(e=>_(e)).catch(()=>_(l()))},[b]),S=g===`unsupported`;return(0,h.jsxs)(`section`,{"data-slot":`notifications-section`,className:`settings-field flex flex-col gap-2`,children:[(0,h.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:(0,h.jsx)(`label`,{htmlFor:`notifications-enabled`,children:`Notify when an agent needs you`})}),(0,h.jsxs)(`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,h.jsx)(f,{saved:v.saved})]})]}),(0,h.jsx)(c,{id:`notifications-enabled`,"data-slot":`notifications-toggle`,checked:n,disabled:S,onCheckedChange:x})]}),S?null:(0,h.jsxs)(`p`,{"data-slot":`notifications-permission`,"data-permission":g,className:`mt-4 text-[13px] text-muted-foreground`,children:[`Browser permission · `,g===`granted`?`Allowed`:g===`denied`?`Blocked`:`Not requested`]}),(0,h.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Permission is requested only when you enable notifications.`}),S?(0,h.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,!S&&n&&g===`denied`?(0,h.jsxs)(`div`,{"data-slot":`notifications-denied`,className:`mt-5 flex flex-col gap-2`,children:[(0,h.jsx)(`h3`,{className:`text-sm`,children:`Allow notifications in your browser`}),(0,h.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,h.jsx)(`p`,{className:`settings-readout`,children:`Notifications are blocked for this site.`})]}):null]})}function _(){return(0,h.jsxs)(`div`,{"data-slot":`preferences-section`,className:`flex w-full flex-col gap-7`,children:[(0,h.jsx)(g,{}),(0,h.jsx)(p,{})]})}export{_ as PreferencesSection};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{p as r}from"./host-context-DDbYAKpm.js";import{At as i,Ci as a,Fi as o,jt as s,kr as c,wi as l}from"./toaster-DNnL8v10.js";import{t as u}from"./createLucideIcon-BHp8sXmF.js";import{t as d}from"./button-BV_AiLj2.js";var f=u(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),p=e(t(),1),m=n(),h=class extends p.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e,t){console.error(`Squawk cockpit: the preview pane crashed`,e,t.componentStack)}render(){return this.state.failed?(0,m.jsxs)(`div`,{"data-slot":`preview-pane-error`,role:`alert`,className:`flex h-full flex-col items-center justify-center gap-3 p-6 text-center`,children:[(0,m.jsx)(`p`,{className:`text-sm font-semibold text-foreground`,children:`The preview hit an error`}),(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The task is unaffected. Close the preview and open it again.`}),(0,m.jsx)(d,{variant:`outline`,onClick:this.props.onClose,children:`Close preview`})]}):this.props.children}};function g(...e){let t=[],n=-1/0,r=!0;for(let i of e){for(let e of i){if(e.seq<=n){r=!1;break}t.push(e),n=e.seq}if(!r)break}if(r)return t;let i=new Map;for(let t of e)for(let e of t)i.set(e.seq,e);return[...i.values()].sort((e,t)=>e.seq-t.seq)}var _=(e,t)=>JSON.stringify([e.stepId??null,t]);function v(e,t){if(typeof t.delta!=`string`)return;let n=e.item.kind===`tool`?t.field===`output`?`output`:void 0:t.field!==`output`&&(e.item.kind===`message`||e.item.kind===`reasoning`)?`text`:void 0;if(!n)return;let r=e.item[n];e.item={...e.item,[n]:(typeof r==`string`?r:``)+t.delta},e.event={...e.event,seq:t.seq,ts:t.ts}}function y(e,t){for(let[n,r]of e)r.event.stepId===t&&e.delete(n)}function b(e,t,n){let r=t.item;if(t.type===`item.delta`){let r=e.get(_(t,t.itemId));r&&(v(r,t),r.touched||=n)}else t.type===`item.completed`&&r&&typeof r==`object`?e.delete(_(t,r.id)):(t.type===`item.started`||t.type===`item.updated`)&&r&&typeof r==`object`&&`kind`in r?e.set(_(t,r.id),{event:t,item:r,touched:n&&t.type===`item.updated`}):(t.type===`turn.completed`||t.type===`session.started`||t.type===`session.ended`)&&y(e,t.stepId)}function x(e,t){let n=new Set(t.map(({seq:e})=>e)),r=new Map;for(let t of e)b(r,t,n.has(t.seq));return[...r.values()].filter(({touched:e})=>e).map(({event:e,item:t})=>({...e,type:`item.updated`,item:t})).sort((e,t)=>e.seq-t.seq)}function S(e,t={}){let[n,i]=(0,p.useState)([]),{cursor:a,afterSeq:o=0,maxEvents:s,compactAt:l,onCompact:u,onReset:d,carryOver:f}=t,m=(0,p.useRef)(void 0),h=(0,p.useRef)(f);return h.current=f,(0,p.useEffect)(()=>{let t=r(),n=e===void 0?void 0:`${t}/${e}`,f=n!==void 0&&m.current===n;if(m.current=n,i(e=>f&&h.current?h.current(e):[]),!e)return;let p=o,_=!1,v=!1,y=0,b=[],x,S,C=()=>{if(x!==void 0&&globalThis.cancelAnimationFrame?.(x),clearTimeout(S),x=void 0,S=void 0,_||b.length===0)return;let e=b;b=[],y+=e.length,i(t=>{let n=g(t,e);return!v&&l!==void 0&&y>=l&&(v=!0,queueMicrotask(()=>{_||u?.()})),s===void 0||n.length<=s?n:n.slice(-s)})},w=()=>{S===void 0&&(S=setTimeout(C,50),typeof globalThis.requestAnimationFrame==`function`&&(x=globalThis.requestAnimationFrame(C)))},T=c({kind:`run`,projectId:t,runId:e,afterSeq:o,...a?{cursor:a}:{}},{frame:e=>{if(`type`in e){if(e.type===`event`&&e.event.seq>p)p=e.event.seq;else if(e.type!==`snapshot`)return;b.push(e.event),w()}},reset:async(e,t)=>{C();let n=await d?.(e,t);return n&&(p=Math.max(p,n.afterSeq)),n}});return()=>{_=!0,x!==void 0&&globalThis.cancelAnimationFrame?.(x),clearTimeout(S),T()}},[e,a,o,s,l,u,d]),n}var C=5,w=200,T=5e3;function E(e,t,n){e.setQueryData(t,e=>{if(!e)return{pages:[n],pageParams:[void 0]};let t=[...e.pages],r=[...e.pageParams],i=-1;for(let e=0;e<t.length;e+=1)(i===-1||t[e].asOfSeq>t[i].asOfSeq)&&(i=e);if(i>=0&&t[i].asOfSeq>n.asOfSeq)return e;for(i>=0&&t[i].newerCursor===void 0?(t[i]=n,r[i]=void 0):(t.push(n),r.push(void 0));t.length>C;)t.shift(),r.shift();return{pages:t,pageParams:r}})}function D(e,t){return e!==void 0&&(t===void 0||e.asOfSeq>=t.asOfSeq)}function O(e,t,n,r){let i=(0,p.useRef)(void 0),a=r&&t.data!==void 0&&!t.isFetching&&!D(t.data,n),o=e===void 0||n===void 0?void 0:`${e}:${n.asOfSeq}`;(0,p.useEffect)(()=>{!a||o===void 0||i.current===o||(i.current=o,t.refetch())},[a,t,o])}function k(e,t){return e!==void 0&&e.asOfSeq>t.asOfSeq?e:t}function A(e){let t=r(),n=o(),c=[`run-history`,t,e],u=[`run-history-context`,t,e],d=a({queryKey:c,enabled:e!==void 0,initialPageParam:void 0,queryFn:({pageParam:t,signal:n})=>i(e,t,{signal:n}),getPreviousPageParam:e=>e.olderCursor,getNextPageParam:e=>e.newerCursor,maxPages:C,staleTime:1/0,retry:1}),f=l({queryKey:u,enabled:e!==void 0,queryFn:async({signal:t})=>{let r=await s(e,{signal:t});return k(n.getQueryData(u),r)},retry:1}),m=(0,p.useCallback)(async r=>{let a=r?{signal:r}:void 0,o=await i(e,void 0,a),c=await s(e,a);return r?.throwIfAborted(),E(n,[`run-history`,t,e],o),n.setQueryData([`run-history-context`,t,e],e=>k(e,c)),o},[n,e,t]),h=(0,p.useCallback)(async(t,n)=>{if(e===void 0)return;let r=await m(n);return{cursor:r.liveCursor,afterSeq:r.asOfSeq}},[m,e]),_=d.isError||f.isError,v=S(_?e:void 0,{onReset:h}),y=d.data?.pages??[],b=y.reduce((e,t)=>t.newerCursor===void 0?t:e??t,void 0),A=(0,p.useRef)(!1),j=(0,p.useCallback)(()=>{e===void 0||A.current||(A.current=!0,m().catch(()=>{}).finally(()=>{A.current=!1}))},[m,e]),M=e=>e!==void 0&&n.getQueryData([`run-history`,t,e])!==void 0,[N,P]=(0,p.useState)(()=>({runId:e,pending:M(e)})),F=N.pending;N.runId!==e&&(F=M(e),P({runId:e,pending:F})),(0,p.useEffect)(()=>{if(!F||e===void 0)return;let t=!1,n=new AbortController;return m(n.signal).catch(()=>{}).finally(()=>{t||P({runId:e,pending:!1})}),()=>{t=!0,n.abort()}},[m,F,e]);let I=(0,p.useMemo)(()=>g(...y.map(e=>e.events)),[y]),L=(0,p.useRef)({runId:e,current:I,previous:[]});(L.current.current!==I||L.current.runId!==e)&&(L.current={runId:e,current:I,previous:L.current.runId===e?L.current.current:[]});let R=(0,p.useCallback)(e=>{let{current:t,previous:n}=L.current;return x(g(n,t,e),e)},[]),z=S(!_&&b&&!F?e:void 0,{cursor:b?.liveCursor,afterSeq:b?.asOfSeq,maxEvents:T,compactAt:w,onCompact:j,onReset:h,carryOver:R}),B=(0,p.useRef)(0);B.current=z.length,(0,p.useEffect)(()=>()=>{B.current>0&&j()},[j]);let V=(0,p.useMemo)(()=>_?v:g(I,z),[_,v,I,z]);O(e,f,b,!_);let H=_||D(f.data,b),U=(0,p.useMemo)(()=>{if(_)return v;let e=f.data?.contextEvents??[],t=f.data?.asOfSeq??0;return g(e,V.filter(({seq:e})=>e>t))},[f.data,_,v,V]),W=(0,p.useCallback)(async()=>{await d.fetchPreviousPage()},[d.fetchPreviousPage]),G=(0,p.useCallback)(async()=>{_||(await n.resetQueries({queryKey:[`run-history`,t,e],exact:!0}),n.invalidateQueries({queryKey:[`run-history-context`,t,e],exact:!0}))},[_,n,e,t]);return{visibleEvents:V,currentEvents:U,currentComplete:H,isPending:!_&&d.isPending,contextPending:!_&&f.isPending,fallback:_,hasOlder:!_&&!!d.hasPreviousPage,isFetchingOlder:d.isFetchingPreviousPage,olderError:d.isFetchPreviousPageError?d.error instanceof Error?d.error.message:`Could not load earlier items`:void 0,loadOlder:W,jumpToLatest:G,retainedPages:y.length}}export{h as n,f as r,A as t};
|