cogpit 3.5.4 → 3.5.5
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/README.md +11 -5
- package/dist/cli-runtime.js +2916 -2294
- package/dist/cli.js +1 -1
- package/dist/instance-worker.js +510 -254
- package/dist/web/assets/AgentCheckDialog-DdcPaEtO.js +1 -0
- package/dist/web/assets/{AutomationsPanel-DTiDsq54.js → AutomationsPanel-DHA6W_CZ.js} +1 -1
- package/dist/web/assets/{CogpitBlock-Hk57z10V.js → CogpitBlock-CN0s_qTc.js} +15 -15
- package/dist/web/assets/CommandPaletteHost-D5mRzqIm.js +1 -0
- package/dist/web/assets/{ConfigBrowser-C77Ydij0.js → ConfigBrowser-CXxrxWWl.js} +1 -1
- package/dist/web/assets/{CrewPanel-BzEJLKMd.js → CrewPanel-DJM6YaDN.js} +1 -1
- package/dist/web/assets/{HighlightedEditor-D1S-wotA.js → HighlightedEditor-G-YJnadM.js} +1 -1
- package/dist/web/assets/KeyboardShortcutsDialog-CcyskXfr.js +1 -0
- package/dist/web/assets/MissionHome-o1MjTkAZ.js +2 -0
- package/dist/web/assets/{MobileFileChanges-DovO__Ap.js → MobileFileChanges-SeyE4VAV.js} +1 -1
- package/dist/web/assets/{PluginsDialog-o6ySRFLf.js → PluginsDialog-BPHFbLGS.js} +1 -1
- package/dist/web/assets/{PreviewPanel-kD79kXYD.js → PreviewPanel-Cb6P4TQ0.js} +1 -1
- package/dist/web/assets/{ProjectFilesPanel-CwEqOA2q.js → ProjectFilesPanel-BIEcyM9w.js} +3 -3
- package/dist/web/assets/{ProjectSwitcherModal-BnWbJWEX.js → ProjectSwitcherModal-CXI-isj1.js} +1 -1
- package/dist/web/assets/{TerminalOutput-DsK-7nR8.js → TerminalOutput-Cmf1kDEH.js} +1 -1
- package/dist/web/assets/{ThemeSelectorModal-D5SBWDm5.js → ThemeSelectorModal-DKvI2x91.js} +1 -1
- package/dist/web/assets/{WorkflowsPanel-NU49178V.js → WorkflowsPanel-B7bJ_vvB.js} +1 -1
- package/dist/web/assets/WorktreePanel-Bu2NThZy.js +1 -0
- package/dist/web/assets/{edition-ui-7WkqSCbs.js → edition-ui-CpK32xJF.js} +1 -1
- package/dist/web/assets/index-BYVl1VlW.js +515 -0
- package/dist/web/assets/{index-BgZ8qUzM.js → index-DUyjpORE.js} +2 -2
- package/dist/web/assets/index-N7rDyHyl.js +2 -0
- package/dist/web/assets/index-RGkLLDnk.css +1 -0
- package/dist/web/assets/{index-CevokSRq.js → index-TyUw7tBu.js} +2 -2
- package/dist/web/assets/index-lC5dVkKa.js +1 -0
- package/dist/web/assets/session-parser.worker-tdry_1oJ.js +43 -0
- package/dist/web/assets/{switch-DI9dp0Ya.js → switch-DFZA-ROd.js} +1 -1
- package/dist/web/assets/{vendor-ui-Dc_kJXxz.js → vendor-ui-B0az9ATE.js} +220 -200
- package/dist/web/index.html +4 -4
- package/package.json +1 -1
- package/dist/web/assets/CommandPaletteHost-BYfieK7H.js +0 -1
- package/dist/web/assets/KeyboardShortcutsDialog-B_DSi5JO.js +0 -1
- package/dist/web/assets/MissionHome-B3uYgylE.js +0 -2
- package/dist/web/assets/WorktreePanel-DPk5b1Os.js +0 -1
- package/dist/web/assets/index-Bg4A-xl7.js +0 -510
- package/dist/web/assets/index-C2tUYo8z.js +0 -1
- package/dist/web/assets/index-DIuobrPN.js +0 -2
- package/dist/web/assets/index-DMO9bL9w.css +0 -1
- package/dist/web/assets/session-parser.worker-DCsmYUeX.js +0 -41
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as x,j as s}from"./vendor-react-gGw_S5I_.js";import{bA as d,l as p,D as j,j as u,bC as D,bD as C,B as k,aE as A,n as b,o as w}from"./index-BYVl1VlW.js";import"./vendor-ui-B0az9ATE.js";import"./vendor-markdown-BEJ8yVzA.js";function v(f){const e=x.c(20),{open:h,onOpenChange:t}=f,n=d(h);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsxs(p,{children:[s.jsx(j,{children:"Agent setup"}),s.jsx(u,{children:"Which coding agents are installed on this computer, and whether you're signed in."})]}),e[0]=g):g=e[0];let i;e[1]!==t?(i=()=>t(!1),e[1]=t,e[2]=i):i=e[2];let l;e[3]!==n||e[4]!==i?(l=s.jsx(D,{check:n,onSignInStarted:i}),e[3]=n,e[4]=i,e[5]=l):l=e[5];let o;e[6]!==n?(o=s.jsx(C,{check:n}),e[6]=n,e[7]=o):o=e[7];let a;e[8]!==t?(a=s.jsx(k,{type:"button",onClick:()=>t(!1),children:"Done"}),e[8]=t,e[9]=a):a=e[9];let c;e[10]!==o||e[11]!==a?(c=s.jsxs(A,{children:[o,a]}),e[10]=o,e[11]=a,e[12]=c):c=e[12];let r;e[13]!==l||e[14]!==c?(r=s.jsxs(b,{className:"max-h-[calc(100dvh-2rem)] overflow-y-auto sm:max-w-lg",children:[g,l,c]}),e[13]=l,e[14]=c,e[15]=r):r=e[15];let m;return e[16]!==t||e[17]!==h||e[18]!==r?(m=s.jsx(w,{open:h,onOpenChange:t,children:r}),e[16]=t,e[17]=h,e[18]=r,e[19]=m):m=e[19],m}export{v as AgentCheckDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as xe,r as N,j as t}from"./vendor-react-gGw_S5I_.js";import{F as Oe,a0 as he,b7 as Ue,B as _,bs as Ye,bu as He,dx as Je,dy as Qe,dz as et,cj as tt}from"./index-Bg4A-xl7.js";import{cG as st,bO as lt,a4 as nt,a$ as at,a_ as it,b0 as ot,bg as rt}from"./vendor-ui-Dc_kJXxz.js";import"./vendor-markdown-BEJ8yVzA.js";async function Ze(s){const e=await s.json().catch(()=>({}));if(!s.ok)throw new Error(e.error??`Request failed (${s.status})`);return e}function ct(s){const e=xe.c(12),[n,S]=N.useState(null),[o,m]=N.useState(null);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=async()=>{try{S((await Ze(await Oe("/api/automations"))).tasks),m(null)}catch(i){const u=i;m(u instanceof Error?u.message:"Could not load tasks")}},e[0]=p):p=e[0];const x=p;let l,v;e[1]!==s?(l=()=>{if(!s)return;x();const i=setInterval(()=>{x()},1e4);return()=>clearInterval(i)},v=[s,x],e[1]=s,e[2]=l,e[3]=v):(l=e[2],v=e[3]),N.useEffect(l,v);const I=mt,R=dt;let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=async i=>{const u=await Ze(await i());return x(),u},e[4]=k):k=e[4];const g=k;let E,j,C,b;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=(i,u,f)=>g(()=>f?he(`/api/automations/${f.id}`,{definition:i,state:u,expectedRevision:f.revision},{method:"PUT"}):he("/api/automations",{definition:i,state:u})),j=i=>g(()=>Oe(`/api/automations/${i}`,{method:"DELETE"})),C=(i,u)=>g(()=>he(`/api/automations/${i}/${u}`,{})),b=i=>g(()=>he(`/api/automations/${i}/rotate-secret`,{})),e[5]=E,e[6]=j,e[7]=C,e[8]=b):(E=e[5],j=e[6],C=e[7],b=e[8]);let h;return e[9]!==o||e[10]!==n?(h={tasks:n,error:o,refresh:x,save:E,remove:j,act:C,rotate:b,runs:I,actOnRun:R},e[9]=o,e[10]=n,e[11]=h):h=e[11],h}function dt(s,e,n){return he(`/api/automations/${s}/runs/${e}/${n}`,{}).then(Ze)}async function mt(s){return(await Ze(await Oe(`/api/automations/${s}/runs`))).runs}const Ge=["sun","mon","tue","wed","thu","fri","sat"],$="w-full rounded border bg-background px-2 py-1 text-xs",ut=Intl.DateTimeFormat().resolvedOptions().timeZone;function ht(s){if(!s)return"No schedule";if(s.kind==="interval")return`Every ${s.everyMinutes} min`;const e=s.days.length===7?"every day":s.days.join(", ");return`${s.time} ${e} (${s.timeZone})`}function qe(s){return s?new Date(s).toLocaleString():"—"}const xt={scheduled:"Waiting",admitting:"Starting",creating:"Starting session",admitted:"Delivering",held:"Held",unknown:"Outcome unknown",completed:"Started",failed:"Failed",cancelled:"Cancelled",skipped:"Skipped"};function pt(s,e){var S,o,m;const n=s==null?void 0:s.schedule;return{name:(s==null?void 0:s.name)??"",prompt:(s==null?void 0:s.prompt)??"",cwd:(s==null?void 0:s.project.cwd)??e??"",agent:(s==null?void 0:s.provider.agent)??et,instanceId:(s==null?void 0:s.provider.instanceId)??"default",model:(s==null?void 0:s.provider.model)??"",workspace:(s==null?void 0:s.workspace)??"project",scheduleKind:n?n.kind:s?"none":"daily",everyMinutes:(n==null?void 0:n.kind)==="interval"?n.everyMinutes:60,time:(n==null?void 0:n.kind)==="daily"?n.time:"09:00",days:(n==null?void 0:n.kind)==="daily"?n.days:["mon","tue","wed","thu","fri"],timeZone:(n==null?void 0:n.kind)==="daily"?n.timeZone:ut,webhook:((S=s==null?void 0:s.webhook)==null?void 0:S.enabled)??!1,scheme:((o=s==null?void 0:s.webhook)==null?void 0:o.scheme)??"cogpit",coalesceSeconds:((m=s==null?void 0:s.webhook)==null?void 0:m.coalesceSeconds)??30,missed:(s==null?void 0:s.missed)??"skip",overlap:(s==null?void 0:s.overlap)??"skip",paused:(s==null?void 0:s.state)==="paused"}}function ft(s){const e=s.cwd.trim();return{name:s.name,prompt:s.prompt,project:{dirName:tt(s.agent,e),cwd:e},provider:{agent:s.agent,instanceId:s.instanceId,...s.model.trim()?{model:s.model.trim()}:{}},workspace:s.workspace,schedule:s.scheduleKind==="none"?null:s.scheduleKind==="interval"?{kind:"interval",everyMinutes:s.everyMinutes}:{kind:"daily",time:s.time,days:s.days,timeZone:s.timeZone},webhook:s.webhook?{enabled:!0,scheme:s.scheme,coalesceSeconds:s.coalesceSeconds}:null,missed:s.missed,overlap:s.overlap}}function vt(s){const e=xe.c(131),{task:n,cwd:S,onSave:o,onCancel:m}=s,p=N.useId();let x;e[0]!==S||e[1]!==n?(x=()=>pt(n,S),e[0]=S,e[1]=n,e[2]=x):x=e[2];const[l,v]=N.useState(x),[I,R]=N.useState(null),[k,g]=N.useState(!1);let E;e[3]===Symbol.for("react.memo_cache_sentinel")?(E=[],e[3]=E):E=e[3];const[j,C]=N.useState(E),b=Je(l.agent,l.instanceId);let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=(a,A)=>v(me=>({...me,[a]:A})),e[4]=h):h=e[4];const i=h;let u,f;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{Oe("/api/provider-instances").then(Nt).then(a=>C(a.instances??[]),yt)},f=[],e[5]=u,e[6]=f):(u=e[5],f=e[6]),N.useEffect(u,f);let d;e[7]!==p?(d=a=>`${p}-${a}`,e[7]=p,e[8]=d):d=e[8];const r=d,w=n?`Edit ${n.name}`:"New task";let y;e[9]!==l||e[10]!==o?(y=a=>{a.preventDefault(),g(!0),R(null),o(ft(l),l.paused?"paused":"active").catch(A=>R(A instanceof Error?A.message:"Could not save")).finally(()=>g(!1))},e[9]=l,e[10]=o,e[11]=y):y=e[11];const P=r("name");let F;e[12]!==P?(F=t.jsx("label",{htmlFor:P,children:"Name"}),e[12]=P,e[13]=F):F=e[13];const Z=r("name");let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=a=>i("name",a.target.value),e[14]=M):M=e[14];let K;e[15]!==l.name||e[16]!==Z?(K=t.jsx("input",{id:Z,className:$,value:l.name,required:!0,maxLength:120,onChange:M}),e[15]=l.name,e[16]=Z,e[17]=K):K=e[17];const c=r("prompt");let z;e[18]!==c?(z=t.jsx("label",{htmlFor:c,children:"What the session should do"}),e[18]=c,e[19]=z):z=e[19];const T=r("prompt");let O;e[20]===Symbol.for("react.memo_cache_sentinel")?(O=a=>i("prompt",a.target.value),e[20]=O):O=e[20];let D;e[21]!==l.prompt||e[22]!==T?(D=t.jsx("textarea",{id:T,className:$,rows:4,value:l.prompt,required:!0,onChange:O}),e[21]=l.prompt,e[22]=T,e[23]=D):D=e[23];const ue=r("cwd");let W;e[24]!==ue?(W=t.jsx("label",{htmlFor:ue,children:"Project folder"}),e[24]=ue,e[25]=W):W=e[25];const We=r("cwd");let pe;e[26]===Symbol.for("react.memo_cache_sentinel")?(pe=a=>i("cwd",a.target.value),e[26]=pe):pe=e[26];let L;e[27]!==l.cwd||e[28]!==We?(L=t.jsx("input",{id:We,className:`${$} font-mono`,value:l.cwd,required:!0,placeholder:"/path/to/project",onChange:pe}),e[27]=l.cwd,e[28]=We,e[29]=L):L=e[29];const Be=l.agent;let fe,ve;e[30]===Symbol.for("react.memo_cache_sentinel")?(fe=a=>v(A=>({...A,agent:a.target.value,instanceId:"default",model:""})),ve=Qe.map(wt),e[30]=fe,e[31]=ve):(fe=e[30],ve=e[31]);let U;e[32]!==l.agent?(U=t.jsxs("label",{className:"flex flex-col gap-1",children:["Provider",t.jsx("select",{className:$,value:Be,onChange:fe,children:ve})]}),e[32]=l.agent,e[33]=U):U=e[33];const Ve=l.instanceId;let ge,je;e[34]===Symbol.for("react.memo_cache_sentinel")?(ge=a=>i("instanceId",a.target.value),je=t.jsx("option",{value:"default",children:"Default"}),e[34]=ge,e[35]=je):(ge=e[34],je=e[35]);let G;if(e[36]!==l.agent||e[37]!==j){let a;e[39]!==l.agent?(a=A=>A.agent===l.agent&&!A.retired,e[39]=l.agent,e[40]=a):a=e[40],G=j.filter(a).map(bt),e[36]=l.agent,e[37]=j,e[38]=G}else G=e[38];let H;e[41]!==l.instanceId||e[42]!==G?(H=t.jsxs("label",{className:"flex flex-col gap-1",children:["Account",t.jsxs("select",{className:$,value:Ve,onChange:ge,children:[je,G]})]}),e[41]=l.instanceId,e[42]=G,e[43]=H):H=e[43];const Xe=l.model;let be,we;e[44]===Symbol.for("react.memo_cache_sentinel")?(be=a=>i("model",a.target.value),we=t.jsx("option",{value:"",children:"Provider default"}),e[44]=be,e[45]=we):(be=e[44],we=e[45]);let q;e[46]!==b?(q=b.filter(jt).map(gt),e[46]=b,e[47]=q):q=e[47];let B;e[48]!==l.model||e[49]!==q?(B=t.jsxs("label",{className:"flex flex-col gap-1",children:["Model",t.jsxs("select",{className:$,value:Xe,onChange:be,children:[we,q]})]}),e[48]=l.model,e[49]=q,e[50]=B):B=e[50];let ye,Ne,Se;e[51]===Symbol.for("react.memo_cache_sentinel")?(ye=a=>i("workspace",a.target.value),Ne=t.jsx("option",{value:"project",children:"Project folder"}),Se=t.jsx("option",{value:"worktree",children:"New worktree per run"}),e[51]=ye,e[52]=Ne,e[53]=Se):(ye=e[51],Ne=e[52],Se=e[53]);let V;e[54]!==l.workspace?(V=t.jsxs("label",{className:"flex flex-col gap-1",children:["Workspace",t.jsxs("select",{className:$,value:l.workspace,onChange:ye,children:[Ne,Se]})]}),e[54]=l.workspace,e[55]=V):V=e[55];let X;e[56]!==U||e[57]!==H||e[58]!==B||e[59]!==V?(X=t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[U,H,B,V]}),e[56]=U,e[57]=H,e[58]=B,e[59]=V,e[60]=X):X=e[60];let Ce;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ce=t.jsx("legend",{className:"px-1",children:"Schedule"}),e[61]=Ce):Ce=e[61];let _e,Ee,$e,Ie;e[62]===Symbol.for("react.memo_cache_sentinel")?(_e=a=>i("scheduleKind",a.target.value),Ee=t.jsx("option",{value:"none",children:"None (webhook or manual only)"}),$e=t.jsx("option",{value:"interval",children:"Every few minutes"}),Ie=t.jsx("option",{value:"daily",children:"At a time of day"}),e[62]=_e,e[63]=Ee,e[64]=$e,e[65]=Ie):(_e=e[62],Ee=e[63],$e=e[64],Ie=e[65]);let Y;e[66]!==l.scheduleKind?(Y=t.jsxs("select",{"aria-label":"Schedule kind",className:$,value:l.scheduleKind,onChange:_e,children:[Ee,$e,Ie]}),e[66]=l.scheduleKind,e[67]=Y):Y=e[67];let J;e[68]!==l.everyMinutes||e[69]!==l.scheduleKind?(J=l.scheduleKind==="interval"&&t.jsxs("label",{className:"flex items-center gap-2",children:["Every ",t.jsx("input",{"aria-label":"Minutes between runs",type:"number",min:5,className:`${$} w-20`,value:l.everyMinutes,onChange:a=>i("everyMinutes",Number(a.target.value))})," minutes"]}),e[68]=l.everyMinutes,e[69]=l.scheduleKind,e[70]=J):J=e[70];let Q;e[71]!==l.days||e[72]!==l.scheduleKind||e[73]!==l.time||e[74]!==l.timeZone?(Q=l.scheduleKind==="daily"&&t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:"flex items-center gap-2",children:["At ",t.jsx("input",{"aria-label":"Time of day",type:"time",className:`${$} w-28`,value:l.time,onChange:a=>i("time",a.target.value)}),"in ",t.jsx("input",{"aria-label":"Time zone",className:`${$} w-44`,value:l.timeZone,onChange:a=>i("timeZone",a.target.value)})]}),t.jsx("div",{role:"group","aria-label":"Weekdays",className:"flex flex-wrap gap-2",children:Ge.map(a=>t.jsxs("label",{className:"flex items-center gap-1",children:[t.jsx("input",{type:"checkbox",checked:l.days.includes(a),onChange:A=>i("days",A.target.checked?Ge.filter(me=>me===a||l.days.includes(me)):l.days.filter(me=>me!==a))}),a]},a))})]}),e[71]=l.days,e[72]=l.scheduleKind,e[73]=l.time,e[74]=l.timeZone,e[75]=Q):Q=e[75];let ze,Re,ke;e[76]===Symbol.for("react.memo_cache_sentinel")?(ze=a=>i("missed",a.target.value),Re=t.jsx("option",{value:"skip",children:"Skip them"}),ke=t.jsx("option",{value:"run-once",children:"Run once when back"}),e[76]=ze,e[77]=Re,e[78]=ke):(ze=e[76],Re=e[77],ke=e[78]);let ee;e[79]!==l.missed?(ee=t.jsxs("label",{className:"flex flex-col gap-1",children:["If runs were missed while Cogpit was off",t.jsxs("select",{className:$,value:l.missed,onChange:ze,children:[Re,ke]})]}),e[79]=l.missed,e[80]=ee):ee=e[80];let te;e[81]!==Y||e[82]!==J||e[83]!==Q||e[84]!==ee?(te=t.jsxs("fieldset",{className:"flex flex-col gap-2 rounded border p-2",children:[Ce,Y,J,Q,ee]}),e[81]=Y,e[82]=J,e[83]=Q,e[84]=ee,e[85]=te):te=e[85];let Ae;e[86]===Symbol.for("react.memo_cache_sentinel")?(Ae=t.jsx("legend",{className:"px-1",children:"Webhook"}),e[86]=Ae):Ae=e[86];let Te;e[87]===Symbol.for("react.memo_cache_sentinel")?(Te=a=>i("webhook",a.target.checked),e[87]=Te):Te=e[87];let se;e[88]!==l.webhook?(se=t.jsxs("label",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"checkbox",checked:l.webhook,onChange:Te})," Run when a signed delivery arrives"]}),e[88]=l.webhook,e[89]=se):se=e[89];let le;e[90]!==l.coalesceSeconds||e[91]!==l.scheme||e[92]!==l.webhook?(le=l.webhook&&t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[t.jsxs("label",{className:"flex flex-col gap-1",children:["Signature",t.jsxs("select",{className:$,value:l.scheme,onChange:a=>i("scheme",a.target.value),children:[t.jsx("option",{value:"cogpit",children:"Cogpit (timestamped)"}),t.jsx("option",{value:"github",children:"GitHub (X-Hub-Signature-256)"})]})]}),t.jsxs("label",{className:"flex flex-col gap-1",children:["Group a burst for (seconds)",t.jsx("input",{type:"number",min:0,max:600,className:$,value:l.coalesceSeconds,onChange:a=>i("coalesceSeconds",Number(a.target.value))})]})]}),e[90]=l.coalesceSeconds,e[91]=l.scheme,e[92]=l.webhook,e[93]=le):le=e[93];let ne;e[94]!==se||e[95]!==le?(ne=t.jsxs("fieldset",{className:"flex flex-col gap-2 rounded border p-2",children:[Ae,se,le]}),e[94]=se,e[95]=le,e[96]=ne):ne=e[96];let Fe,Ke,De;e[97]===Symbol.for("react.memo_cache_sentinel")?(Fe=a=>i("overlap",a.target.value),Ke=t.jsx("option",{value:"skip",children:"Skip the new run"}),De=t.jsx("option",{value:"allow",children:"Start it anyway"}),e[97]=Fe,e[98]=Ke,e[99]=De):(Fe=e[97],Ke=e[98],De=e[99]);let ae;e[100]!==l.overlap?(ae=t.jsxs("label",{className:"flex flex-col gap-1",children:["While the previous run still works",t.jsxs("select",{className:$,value:l.overlap,onChange:Fe,children:[Ke,De]})]}),e[100]=l.overlap,e[101]=ae):ae=e[101];let Pe;e[102]===Symbol.for("react.memo_cache_sentinel")?(Pe=a=>i("paused",a.target.checked),e[102]=Pe):Pe=e[102];let ie;e[103]!==l.paused?(ie=t.jsxs("label",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"checkbox",checked:l.paused,onChange:Pe})," Save paused"]}),e[103]=l.paused,e[104]=ie):ie=e[104];let oe;e[105]!==I?(oe=I&&t.jsx("p",{role:"alert",className:"text-destructive",children:I}),e[105]=I,e[106]=oe):oe=e[106];let re;e[107]!==m?(re=t.jsx(_,{type:"button",variant:"ghost",size:"sm",onClick:m,children:"Cancel"}),e[107]=m,e[108]=re):re=e[108];const Le=k?"Saving…":n?"Save changes":"Create task";let ce;e[109]!==k||e[110]!==Le?(ce=t.jsx(_,{type:"submit",size:"sm",disabled:k,children:Le}),e[109]=k,e[110]=Le,e[111]=ce):ce=e[111];let de;e[112]!==re||e[113]!==ce?(de=t.jsxs("div",{className:"flex justify-end gap-2",children:[re,ce]}),e[112]=re,e[113]=ce,e[114]=de):de=e[114];let Me;return e[115]!==F||e[116]!==K||e[117]!==z||e[118]!==D||e[119]!==W||e[120]!==L||e[121]!==X||e[122]!==te||e[123]!==ne||e[124]!==ae||e[125]!==ie||e[126]!==oe||e[127]!==w||e[128]!==de||e[129]!==y?(Me=t.jsxs("form",{className:"flex flex-col gap-2 rounded-md border p-3 text-xs","aria-label":w,onSubmit:y,children:[F,K,z,D,W,L,X,te,ne,ae,ie,oe,de]}),e[115]=F,e[116]=K,e[117]=z,e[118]=D,e[119]=W,e[120]=L,e[121]=X,e[122]=te,e[123]=ne,e[124]=ae,e[125]=ie,e[126]=oe,e[127]=w,e[128]=de,e[129]=y,e[130]=Me):Me=e[130],Me}function gt(s){return t.jsx("option",{value:s.value,children:s.label},s.value)}function jt(s){return s.value}function bt(s){return t.jsx("option",{value:s.id,children:s.label},s.id)}function wt(s){return t.jsx("option",{value:s,children:He(s).displayName},s)}function yt(){}function Nt(s){return s.ok?s.json():{instances:[]}}const St=5e3;function Ct(s){const e=xe.c(28),{task:n,automations:S,active:o,version:m,openSession:p}=s,[x,l]=N.useState(null),[v,I]=N.useState(null),[R,k]=N.useState(0),{runs:g,actOnRun:E}=S;let j;e[0]!==o||e[1]!==g||e[2]!==n.id?(j=()=>{let d=!0;const r=()=>{g(n.id).then(y=>{d&&(l(y),I(null))},y=>{d&&I(y instanceof Error?y.message:"Could not load runs")})};r();const w=o?setInterval(r,St):void 0;return()=>{d=!1,clearInterval(w)}},e[0]=o,e[1]=g,e[2]=n.id,e[3]=j):j=e[3];let C;e[4]!==o||e[5]!==g||e[6]!==R||e[7]!==n.id||e[8]!==n.updatedAt||e[9]!==m?(C=[g,n.id,n.updatedAt,o,m,R],e[4]=o,e[5]=g,e[6]=R,e[7]=n.id,e[8]=n.updatedAt,e[9]=m,e[10]=C):C=e[10],N.useEffect(j,C);let b;e[11]!==E||e[12]!==n.id?(b=(d,r)=>{E(n.id,d.id,r).then(()=>k(_t),w=>I(w instanceof Error?w.message:"Could not update the run"))},e[11]=E,e[12]=n.id,e[13]=b):b=e[13];const h=b;if(v){let d;return e[14]!==v?(d=t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:v}),e[14]=v,e[15]=d):d=e[15],d}if(!x){let d;return e[16]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("p",{role:"status",className:"text-xs text-muted-foreground",children:"Loading runs…"}),e[16]=d):d=e[16],d}if(x.length===0){let d;return e[17]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("p",{className:"text-xs text-muted-foreground",children:"No runs yet."}),e[17]=d):d=e[17],d}const i=`Runs of ${n.name}`;let u;if(e[18]!==h||e[19]!==p||e[20]!==x){let d;e[22]!==h||e[23]!==p?(d=r=>{var w;return t.jsxs("li",{className:"flex flex-wrap items-center gap-2 rounded border px-2 py-1 text-xs",children:[t.jsx("span",{className:"font-medium",children:xt[r.state]}),t.jsxs("span",{className:"text-muted-foreground",children:[r.trigger,r.deliveries>1?` · ${r.deliveries} deliveries`:""," · ",qe(r.dueAt)]}),r.session&&t.jsx("span",{className:"text-muted-foreground",children:r.session.working?"session working":"session idle"}),r.reason&&t.jsx("span",{className:"basis-full text-muted-foreground",children:r.reason}),t.jsxs("span",{className:"ml-auto flex gap-1",children:[((w=r.session)==null?void 0:w.dirName)&&r.session.fileName&&p&&t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>p(r.session.dirName,r.session.fileName),children:"Open session"}),(r.state==="scheduled"||r.state==="held")&&t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>h(r,"cancel"),children:"Cancel"}),r.state==="held"&&r.hold==="reauthorize"&&t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>h(r,"reauthorize"),children:"Reauthorize"}),r.state==="unknown"&&t.jsxs(t.Fragment,{children:[t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>h(r,"mark-started"),children:"It started"}),t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>h(r,"mark-not-started"),children:"It did not start"})]})]})]},r.id)},e[22]=h,e[23]=p,e[24]=d):d=e[24],u=x.map(d),e[18]=h,e[19]=p,e[20]=x,e[21]=u}else u=e[21];let f;return e[25]!==i||e[26]!==u?(f=t.jsx("ol",{"aria-label":i,className:"flex flex-col gap-1",children:u}),e[25]=i,e[26]=u,e[27]=f):f=e[27],f}function _t(s){return s+1}function At(s){const e=xe.c(3),n=Ue("hostFiles"),S=Ue("terminal");if(!n||!S){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("p",{role:"status",className:"p-3 text-xs text-muted-foreground",children:"Scheduled tasks need host-file and terminal access on this server."}),e[0]=m):m=e[0],m}let o;return e[1]!==s?(o=t.jsx(Et,{...s}),e[1]=s,e[2]=o):o=e[2],o}function Et(s){var F,Z,M,K;const e=xe.c(31),{context:n,active:S}=s,o=ct(S),[m,p]=N.useState(null),[x,l]=N.useState(null),[v,I]=N.useState(null),[R,k]=N.useState(null),[g,E]=N.useState(0);let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=c=>{c.catch(z=>k(z instanceof Error?z.message:"The request failed"))},e[0]=j):j=e[0];const C=j;let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("h2",{className:"text-sm font-medium",children:"Scheduled and webhook tasks"}),e[1]=b):b=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs("div",{className:"flex items-center justify-between",children:[b,t.jsxs(_,{size:"sm",variant:"outline",onClick:()=>p("new"),children:[t.jsx(rt,{"data-icon":"inline-start"}),"New task"]})]}),e[2]=h):h=e[2];let i;e[3]!==R?(i=R&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:R}),e[3]=R,e[4]=i):i=e[4];let u;e[5]!==o.error?(u=o.error&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:o.error}),e[5]=o.error,e[6]=u):u=e[6];let f;e[7]!==o||e[8]!==n||e[9]!==m?(f=m&&t.jsx(vt,{task:m==="new"?null:m,cwd:n.projectPath,onCancel:()=>p(null),onSave:async(c,z)=>{const T=await o.save(c,z,m==="new"?void 0:m);T.webhookSecret&&I({taskId:T.task.id,value:T.webhookSecret}),p(null)}}),e[7]=o,e[8]=n,e[9]=m,e[10]=f):f=e[10];let d;e[11]!==v?(d=v&&t.jsxs("div",{role:"status",className:"flex flex-col gap-1 rounded-md border border-warning/40 p-2 text-xs",children:[t.jsx("p",{children:"Webhook secret — shown only now. Store it with the sender:"}),t.jsx("code",{className:"break-all font-mono",children:v.value}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(_,{size:"xs",variant:"outline",onClick:()=>void Ye(v.value),children:"Copy secret"}),t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>I(null),children:"Done"})]})]}),e[11]=v,e[12]=d):d=e[12];let r;e[13]!==((F=o.tasks)==null?void 0:F.length)||e[14]!==m?(r=((Z=o.tasks)==null?void 0:Z.length)===0&&!m&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No tasks yet. A task starts a new session on a schedule, when a signed webhook arrives, or when you run it."}),e[13]=(M=o.tasks)==null?void 0:M.length,e[14]=m,e[15]=r):r=e[15];let w;e[16]!==S||e[17]!==o||e[18]!==n||e[19]!==x||e[20]!==g?(w=(K=o.tasks)==null?void 0:K.map(c=>{var z,T,O,D;return t.jsxs("li",{className:"flex flex-col gap-2 rounded-md border p-2 text-xs",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("span",{className:"font-medium",children:c.name}),t.jsx("span",{className:"rounded bg-muted px-1.5",children:c.state==="paused"?"Paused":"Active"}),((z=c.authority)==null?void 0:z.revoked)&&t.jsx("span",{className:"text-destructive",children:"Authorization revoked"}),((T=c.authority)==null?void 0:T.source)==="none"&&t.jsx("span",{className:"text-warning",children:"Runs wait for you to reauthorize them"})]}),t.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-muted-foreground",children:[t.jsxs("span",{children:[t.jsx(st,{className:"mr-1 inline size-3","aria-hidden":!0}),ht(c.schedule)]}),t.jsxs("span",{children:["Next: ",qe(c.nextRunAt)]}),t.jsx("span",{className:"font-mono",children:c.project.cwd}),t.jsxs("span",{children:[He(c.provider.agent).displayName,c.provider.model?` · ${c.provider.model}`:""," · ",c.workspace==="worktree"?"new worktree":"project folder"]})]}),((O=c.webhook)==null?void 0:O.enabled)&&t.jsxs("div",{className:"flex flex-col gap-1 text-muted-foreground",children:[t.jsxs("span",{children:[t.jsx(lt,{className:"mr-1 inline size-3","aria-hidden":!0}),c.webhookUrl?t.jsx("code",{className:"break-all",children:c.webhookUrl}):"Webhook ingress is not available on this server's sign-in"]}),c.webhookReachability==="local-only"&&t.jsx("span",{children:"Reachable only where this machine is; set COGPIT_PUBLIC_URL when a tunnel or proxy exposes it."})]}),t.jsxs("div",{className:"flex flex-wrap gap-1",children:[t.jsxs(_,{size:"xs",variant:"outline",onClick:()=>C(o.act(c.id,"run").then(()=>E($t))),children:[t.jsx(nt,{"data-icon":"inline-start"}),"Run now"]}),c.state==="active"?t.jsxs(_,{size:"xs",variant:"ghost",onClick:()=>C(o.act(c.id,"pause")),children:[t.jsx(at,{"data-icon":"inline-start"}),"Pause"]}):t.jsxs(_,{size:"xs",variant:"ghost",onClick:()=>C(o.act(c.id,"resume")),children:[t.jsx(it,{"data-icon":"inline-start"}),"Resume"]}),t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>p(c),children:"Edit"}),((D=c.webhook)==null?void 0:D.enabled)&&t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>C(o.rotate(c.id).then(ue=>I({taskId:c.id,value:ue.webhookSecret}))),children:"Rotate secret"}),t.jsx(_,{size:"xs",variant:"ghost","aria-expanded":x===c.id,onClick:()=>l(x===c.id?null:c.id),children:"History"}),t.jsx(_,{size:"xs",variant:"ghost","aria-label":`Delete ${c.name}`,onClick:()=>{window.confirm(`Delete ${c.name}? Waiting runs are cancelled.`)&&C(o.remove(c.id))},children:t.jsx(ot,{"data-icon":"inline-start"})})]}),x===c.id&&t.jsx(Ct,{task:c,automations:o,active:S,version:g,openSession:n.openSession})]},c.id)}),e[16]=S,e[17]=o,e[18]=n,e[19]=x,e[20]=g,e[21]=w):w=e[21];let y;e[22]!==w?(y=t.jsx("ul",{"aria-label":"Tasks",className:"flex flex-col gap-2",children:w}),e[22]=w,e[23]=y):y=e[23];let P;return e[24]!==y||e[25]!==i||e[26]!==u||e[27]!==f||e[28]!==d||e[29]!==r?(P=t.jsxs("section",{"aria-label":"Automations",className:"flex h-full min-h-0 flex-col gap-3 overflow-auto p-3",children:[h,i,u,f,d,r,y]}),e[24]=y,e[25]=i,e[26]=u,e[27]=f,e[28]=d,e[29]=r,e[30]=P):P=e[30],P}function $t(s){return s+1}export{At as AutomationsPanel};
|
|
1
|
+
import{c as xe,r as N,j as t}from"./vendor-react-gGw_S5I_.js";import{F as Ze,a0 as he,b7 as Ue,B as _,bw as Ye,by as qe,dK as Je,dL as Qe,dM as et,cu as tt}from"./index-BYVl1VlW.js";import{cK as st,bP as lt,a4 as nt,b5 as at,b4 as it,b6 as ot,bl as rt}from"./vendor-ui-B0az9ATE.js";import"./vendor-markdown-BEJ8yVzA.js";async function Oe(s){const e=await s.json().catch(()=>({}));if(!s.ok)throw new Error(e.error??`Request failed (${s.status})`);return e}function ct(s){const e=xe.c(12),[n,S]=N.useState(null),[o,m]=N.useState(null);let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p=async()=>{try{S((await Oe(await Ze("/api/automations"))).tasks),m(null)}catch(i){const u=i;m(u instanceof Error?u.message:"Could not load tasks")}},e[0]=p):p=e[0];const x=p;let l,v;e[1]!==s?(l=()=>{if(!s)return;x();const i=setInterval(()=>{x()},1e4);return()=>clearInterval(i)},v=[s,x],e[1]=s,e[2]=l,e[3]=v):(l=e[2],v=e[3]),N.useEffect(l,v);const I=mt,R=dt;let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=async i=>{const u=await Oe(await i());return x(),u},e[4]=k):k=e[4];const g=k;let E,j,C,b;e[5]===Symbol.for("react.memo_cache_sentinel")?(E=(i,u,f)=>g(()=>f?he(`/api/automations/${f.id}`,{definition:i,state:u,expectedRevision:f.revision},{method:"PUT"}):he("/api/automations",{definition:i,state:u})),j=i=>g(()=>Ze(`/api/automations/${i}`,{method:"DELETE"})),C=(i,u)=>g(()=>he(`/api/automations/${i}/${u}`,{})),b=i=>g(()=>he(`/api/automations/${i}/rotate-secret`,{})),e[5]=E,e[6]=j,e[7]=C,e[8]=b):(E=e[5],j=e[6],C=e[7],b=e[8]);let h;return e[9]!==o||e[10]!==n?(h={tasks:n,error:o,refresh:x,save:E,remove:j,act:C,rotate:b,runs:I,actOnRun:R},e[9]=o,e[10]=n,e[11]=h):h=e[11],h}function dt(s,e,n){return he(`/api/automations/${s}/runs/${e}/${n}`,{}).then(Oe)}async function mt(s){return(await Oe(await Ze(`/api/automations/${s}/runs`))).runs}const He=["sun","mon","tue","wed","thu","fri","sat"],$="w-full rounded border bg-background px-2 py-1 text-xs",ut=Intl.DateTimeFormat().resolvedOptions().timeZone;function ht(s){if(!s)return"No schedule";if(s.kind==="interval")return`Every ${s.everyMinutes} min`;const e=s.days.length===7?"every day":s.days.join(", ");return`${s.time} ${e} (${s.timeZone})`}function Ge(s){return s?new Date(s).toLocaleString():"—"}const xt={scheduled:"Waiting",admitting:"Starting",creating:"Starting session",admitted:"Delivering",held:"Held",unknown:"Outcome unknown",completed:"Started",failed:"Failed",cancelled:"Cancelled",skipped:"Skipped"};function pt(s,e){var S,o,m;const n=s==null?void 0:s.schedule;return{name:(s==null?void 0:s.name)??"",prompt:(s==null?void 0:s.prompt)??"",cwd:(s==null?void 0:s.project.cwd)??e??"",agent:(s==null?void 0:s.provider.agent)??et,instanceId:(s==null?void 0:s.provider.instanceId)??"default",model:(s==null?void 0:s.provider.model)??"",workspace:(s==null?void 0:s.workspace)??"project",scheduleKind:n?n.kind:s?"none":"daily",everyMinutes:(n==null?void 0:n.kind)==="interval"?n.everyMinutes:60,time:(n==null?void 0:n.kind)==="daily"?n.time:"09:00",days:(n==null?void 0:n.kind)==="daily"?n.days:["mon","tue","wed","thu","fri"],timeZone:(n==null?void 0:n.kind)==="daily"?n.timeZone:ut,webhook:((S=s==null?void 0:s.webhook)==null?void 0:S.enabled)??!1,scheme:((o=s==null?void 0:s.webhook)==null?void 0:o.scheme)??"cogpit",coalesceSeconds:((m=s==null?void 0:s.webhook)==null?void 0:m.coalesceSeconds)??30,missed:(s==null?void 0:s.missed)??"skip",overlap:(s==null?void 0:s.overlap)??"skip",paused:(s==null?void 0:s.state)==="paused"}}function ft(s){const e=s.cwd.trim();return{name:s.name,prompt:s.prompt,project:{dirName:tt(s.agent,e),cwd:e},provider:{agent:s.agent,instanceId:s.instanceId,...s.model.trim()?{model:s.model.trim()}:{}},workspace:s.workspace,schedule:s.scheduleKind==="none"?null:s.scheduleKind==="interval"?{kind:"interval",everyMinutes:s.everyMinutes}:{kind:"daily",time:s.time,days:s.days,timeZone:s.timeZone},webhook:s.webhook?{enabled:!0,scheme:s.scheme,coalesceSeconds:s.coalesceSeconds}:null,missed:s.missed,overlap:s.overlap}}function vt(s){const e=xe.c(131),{task:n,cwd:S,onSave:o,onCancel:m}=s,p=N.useId();let x;e[0]!==S||e[1]!==n?(x=()=>pt(n,S),e[0]=S,e[1]=n,e[2]=x):x=e[2];const[l,v]=N.useState(x),[I,R]=N.useState(null),[k,g]=N.useState(!1);let E;e[3]===Symbol.for("react.memo_cache_sentinel")?(E=[],e[3]=E):E=e[3];const[j,C]=N.useState(E),b=Je(l.agent,l.instanceId);let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=(a,A)=>v(me=>({...me,[a]:A})),e[4]=h):h=e[4];const i=h;let u,f;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{Ze("/api/provider-instances").then(Nt).then(a=>C(a.instances??[]),yt)},f=[],e[5]=u,e[6]=f):(u=e[5],f=e[6]),N.useEffect(u,f);let d;e[7]!==p?(d=a=>`${p}-${a}`,e[7]=p,e[8]=d):d=e[8];const r=d,w=n?`Edit ${n.name}`:"New task";let y;e[9]!==l||e[10]!==o?(y=a=>{a.preventDefault(),g(!0),R(null),o(ft(l),l.paused?"paused":"active").catch(A=>R(A instanceof Error?A.message:"Could not save")).finally(()=>g(!1))},e[9]=l,e[10]=o,e[11]=y):y=e[11];const D=r("name");let K;e[12]!==D?(K=t.jsx("label",{htmlFor:D,children:"Name"}),e[12]=D,e[13]=K):K=e[13];const O=r("name");let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=a=>i("name",a.target.value),e[14]=M):M=e[14];let F;e[15]!==l.name||e[16]!==O?(F=t.jsx("input",{id:O,className:$,value:l.name,required:!0,maxLength:120,onChange:M}),e[15]=l.name,e[16]=O,e[17]=F):F=e[17];const c=r("prompt");let z;e[18]!==c?(z=t.jsx("label",{htmlFor:c,children:"What the session should do"}),e[18]=c,e[19]=z):z=e[19];const T=r("prompt");let Z;e[20]===Symbol.for("react.memo_cache_sentinel")?(Z=a=>i("prompt",a.target.value),e[20]=Z):Z=e[20];let P;e[21]!==l.prompt||e[22]!==T?(P=t.jsx("textarea",{id:T,className:$,rows:4,value:l.prompt,required:!0,onChange:Z}),e[21]=l.prompt,e[22]=T,e[23]=P):P=e[23];const ue=r("cwd");let W;e[24]!==ue?(W=t.jsx("label",{htmlFor:ue,children:"Project folder"}),e[24]=ue,e[25]=W):W=e[25];const We=r("cwd");let pe;e[26]===Symbol.for("react.memo_cache_sentinel")?(pe=a=>i("cwd",a.target.value),e[26]=pe):pe=e[26];let L;e[27]!==l.cwd||e[28]!==We?(L=t.jsx("input",{id:We,className:`${$} font-mono`,value:l.cwd,required:!0,placeholder:"/path/to/project",onChange:pe}),e[27]=l.cwd,e[28]=We,e[29]=L):L=e[29];const Be=l.agent;let fe,ve;e[30]===Symbol.for("react.memo_cache_sentinel")?(fe=a=>v(A=>({...A,agent:a.target.value,instanceId:"default",model:""})),ve=Qe.map(wt),e[30]=fe,e[31]=ve):(fe=e[30],ve=e[31]);let U;e[32]!==l.agent?(U=t.jsxs("label",{className:"flex flex-col gap-1",children:["Provider",t.jsx("select",{className:$,value:Be,onChange:fe,children:ve})]}),e[32]=l.agent,e[33]=U):U=e[33];const Ve=l.instanceId;let ge,je;e[34]===Symbol.for("react.memo_cache_sentinel")?(ge=a=>i("instanceId",a.target.value),je=t.jsx("option",{value:"default",children:"Default"}),e[34]=ge,e[35]=je):(ge=e[34],je=e[35]);let H;if(e[36]!==l.agent||e[37]!==j){let a;e[39]!==l.agent?(a=A=>A.agent===l.agent&&!A.retired,e[39]=l.agent,e[40]=a):a=e[40],H=j.filter(a).map(bt),e[36]=l.agent,e[37]=j,e[38]=H}else H=e[38];let q;e[41]!==l.instanceId||e[42]!==H?(q=t.jsxs("label",{className:"flex flex-col gap-1",children:["Account",t.jsxs("select",{className:$,value:Ve,onChange:ge,children:[je,H]})]}),e[41]=l.instanceId,e[42]=H,e[43]=q):q=e[43];const Xe=l.model;let be,we;e[44]===Symbol.for("react.memo_cache_sentinel")?(be=a=>i("model",a.target.value),we=t.jsx("option",{value:"",children:"Provider default"}),e[44]=be,e[45]=we):(be=e[44],we=e[45]);let G;e[46]!==b?(G=b.filter(jt).map(gt),e[46]=b,e[47]=G):G=e[47];let B;e[48]!==l.model||e[49]!==G?(B=t.jsxs("label",{className:"flex flex-col gap-1",children:["Model",t.jsxs("select",{className:$,value:Xe,onChange:be,children:[we,G]})]}),e[48]=l.model,e[49]=G,e[50]=B):B=e[50];let ye,Ne,Se;e[51]===Symbol.for("react.memo_cache_sentinel")?(ye=a=>i("workspace",a.target.value),Ne=t.jsx("option",{value:"project",children:"Project folder"}),Se=t.jsx("option",{value:"worktree",children:"New worktree per run"}),e[51]=ye,e[52]=Ne,e[53]=Se):(ye=e[51],Ne=e[52],Se=e[53]);let V;e[54]!==l.workspace?(V=t.jsxs("label",{className:"flex flex-col gap-1",children:["Workspace",t.jsxs("select",{className:$,value:l.workspace,onChange:ye,children:[Ne,Se]})]}),e[54]=l.workspace,e[55]=V):V=e[55];let X;e[56]!==U||e[57]!==q||e[58]!==B||e[59]!==V?(X=t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[U,q,B,V]}),e[56]=U,e[57]=q,e[58]=B,e[59]=V,e[60]=X):X=e[60];let Ce;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ce=t.jsx("legend",{className:"px-1",children:"Schedule"}),e[61]=Ce):Ce=e[61];let _e,Ee,$e,Ie;e[62]===Symbol.for("react.memo_cache_sentinel")?(_e=a=>i("scheduleKind",a.target.value),Ee=t.jsx("option",{value:"none",children:"None (webhook or manual only)"}),$e=t.jsx("option",{value:"interval",children:"Every few minutes"}),Ie=t.jsx("option",{value:"daily",children:"At a time of day"}),e[62]=_e,e[63]=Ee,e[64]=$e,e[65]=Ie):(_e=e[62],Ee=e[63],$e=e[64],Ie=e[65]);let Y;e[66]!==l.scheduleKind?(Y=t.jsxs("select",{"aria-label":"Schedule kind",className:$,value:l.scheduleKind,onChange:_e,children:[Ee,$e,Ie]}),e[66]=l.scheduleKind,e[67]=Y):Y=e[67];let J;e[68]!==l.everyMinutes||e[69]!==l.scheduleKind?(J=l.scheduleKind==="interval"&&t.jsxs("label",{className:"flex items-center gap-2",children:["Every ",t.jsx("input",{"aria-label":"Minutes between runs",type:"number",min:5,className:`${$} w-20`,value:l.everyMinutes,onChange:a=>i("everyMinutes",Number(a.target.value))})," minutes"]}),e[68]=l.everyMinutes,e[69]=l.scheduleKind,e[70]=J):J=e[70];let Q;e[71]!==l.days||e[72]!==l.scheduleKind||e[73]!==l.time||e[74]!==l.timeZone?(Q=l.scheduleKind==="daily"&&t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:"flex items-center gap-2",children:["At ",t.jsx("input",{"aria-label":"Time of day",type:"time",className:`${$} w-28`,value:l.time,onChange:a=>i("time",a.target.value)}),"in ",t.jsx("input",{"aria-label":"Time zone",className:`${$} w-44`,value:l.timeZone,onChange:a=>i("timeZone",a.target.value)})]}),t.jsx("div",{role:"group","aria-label":"Weekdays",className:"flex flex-wrap gap-2",children:He.map(a=>t.jsxs("label",{className:"flex items-center gap-1",children:[t.jsx("input",{type:"checkbox",checked:l.days.includes(a),onChange:A=>i("days",A.target.checked?He.filter(me=>me===a||l.days.includes(me)):l.days.filter(me=>me!==a))}),a]},a))})]}),e[71]=l.days,e[72]=l.scheduleKind,e[73]=l.time,e[74]=l.timeZone,e[75]=Q):Q=e[75];let ze,Re,ke;e[76]===Symbol.for("react.memo_cache_sentinel")?(ze=a=>i("missed",a.target.value),Re=t.jsx("option",{value:"skip",children:"Skip them"}),ke=t.jsx("option",{value:"run-once",children:"Run once when back"}),e[76]=ze,e[77]=Re,e[78]=ke):(ze=e[76],Re=e[77],ke=e[78]);let ee;e[79]!==l.missed?(ee=t.jsxs("label",{className:"flex flex-col gap-1",children:["If runs were missed while Cogpit was off",t.jsxs("select",{className:$,value:l.missed,onChange:ze,children:[Re,ke]})]}),e[79]=l.missed,e[80]=ee):ee=e[80];let te;e[81]!==Y||e[82]!==J||e[83]!==Q||e[84]!==ee?(te=t.jsxs("fieldset",{className:"flex flex-col gap-2 rounded border p-2",children:[Ce,Y,J,Q,ee]}),e[81]=Y,e[82]=J,e[83]=Q,e[84]=ee,e[85]=te):te=e[85];let Ae;e[86]===Symbol.for("react.memo_cache_sentinel")?(Ae=t.jsx("legend",{className:"px-1",children:"Webhook"}),e[86]=Ae):Ae=e[86];let Te;e[87]===Symbol.for("react.memo_cache_sentinel")?(Te=a=>i("webhook",a.target.checked),e[87]=Te):Te=e[87];let se;e[88]!==l.webhook?(se=t.jsxs("label",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"checkbox",checked:l.webhook,onChange:Te})," Run when a signed delivery arrives"]}),e[88]=l.webhook,e[89]=se):se=e[89];let le;e[90]!==l.coalesceSeconds||e[91]!==l.scheme||e[92]!==l.webhook?(le=l.webhook&&t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[t.jsxs("label",{className:"flex flex-col gap-1",children:["Signature",t.jsxs("select",{className:$,value:l.scheme,onChange:a=>i("scheme",a.target.value),children:[t.jsx("option",{value:"cogpit",children:"Cogpit (timestamped)"}),t.jsx("option",{value:"github",children:"GitHub (X-Hub-Signature-256)"})]})]}),t.jsxs("label",{className:"flex flex-col gap-1",children:["Group a burst for (seconds)",t.jsx("input",{type:"number",min:0,max:600,className:$,value:l.coalesceSeconds,onChange:a=>i("coalesceSeconds",Number(a.target.value))})]})]}),e[90]=l.coalesceSeconds,e[91]=l.scheme,e[92]=l.webhook,e[93]=le):le=e[93];let ne;e[94]!==se||e[95]!==le?(ne=t.jsxs("fieldset",{className:"flex flex-col gap-2 rounded border p-2",children:[Ae,se,le]}),e[94]=se,e[95]=le,e[96]=ne):ne=e[96];let Ke,Fe,Pe;e[97]===Symbol.for("react.memo_cache_sentinel")?(Ke=a=>i("overlap",a.target.value),Fe=t.jsx("option",{value:"skip",children:"Skip the new run"}),Pe=t.jsx("option",{value:"allow",children:"Start it anyway"}),e[97]=Ke,e[98]=Fe,e[99]=Pe):(Ke=e[97],Fe=e[98],Pe=e[99]);let ae;e[100]!==l.overlap?(ae=t.jsxs("label",{className:"flex flex-col gap-1",children:["While the previous run still works",t.jsxs("select",{className:$,value:l.overlap,onChange:Ke,children:[Fe,Pe]})]}),e[100]=l.overlap,e[101]=ae):ae=e[101];let De;e[102]===Symbol.for("react.memo_cache_sentinel")?(De=a=>i("paused",a.target.checked),e[102]=De):De=e[102];let ie;e[103]!==l.paused?(ie=t.jsxs("label",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"checkbox",checked:l.paused,onChange:De})," Save paused"]}),e[103]=l.paused,e[104]=ie):ie=e[104];let oe;e[105]!==I?(oe=I&&t.jsx("p",{role:"alert",className:"text-destructive",children:I}),e[105]=I,e[106]=oe):oe=e[106];let re;e[107]!==m?(re=t.jsx(_,{type:"button",variant:"ghost",size:"sm",onClick:m,children:"Cancel"}),e[107]=m,e[108]=re):re=e[108];const Le=k?"Saving…":n?"Save changes":"Create task";let ce;e[109]!==k||e[110]!==Le?(ce=t.jsx(_,{type:"submit",size:"sm",disabled:k,children:Le}),e[109]=k,e[110]=Le,e[111]=ce):ce=e[111];let de;e[112]!==re||e[113]!==ce?(de=t.jsxs("div",{className:"flex justify-end gap-2",children:[re,ce]}),e[112]=re,e[113]=ce,e[114]=de):de=e[114];let Me;return e[115]!==K||e[116]!==F||e[117]!==z||e[118]!==P||e[119]!==W||e[120]!==L||e[121]!==X||e[122]!==te||e[123]!==ne||e[124]!==ae||e[125]!==ie||e[126]!==oe||e[127]!==w||e[128]!==de||e[129]!==y?(Me=t.jsxs("form",{className:"flex flex-col gap-2 rounded-md border p-3 text-xs","aria-label":w,onSubmit:y,children:[K,F,z,P,W,L,X,te,ne,ae,ie,oe,de]}),e[115]=K,e[116]=F,e[117]=z,e[118]=P,e[119]=W,e[120]=L,e[121]=X,e[122]=te,e[123]=ne,e[124]=ae,e[125]=ie,e[126]=oe,e[127]=w,e[128]=de,e[129]=y,e[130]=Me):Me=e[130],Me}function gt(s){return t.jsx("option",{value:s.value,children:s.label},s.value)}function jt(s){return s.value}function bt(s){return t.jsx("option",{value:s.id,children:s.label},s.id)}function wt(s){return t.jsx("option",{value:s,children:qe(s).displayName},s)}function yt(){}function Nt(s){return s.ok?s.json():{instances:[]}}const St=5e3;function Ct(s){const e=xe.c(28),{task:n,automations:S,active:o,version:m,openSession:p}=s,[x,l]=N.useState(null),[v,I]=N.useState(null),[R,k]=N.useState(0),{runs:g,actOnRun:E}=S;let j;e[0]!==o||e[1]!==g||e[2]!==n.id?(j=()=>{let d=!0;const r=()=>{g(n.id).then(y=>{d&&(l(y),I(null))},y=>{d&&I(y instanceof Error?y.message:"Could not load runs")})};r();const w=o?setInterval(r,St):void 0;return()=>{d=!1,clearInterval(w)}},e[0]=o,e[1]=g,e[2]=n.id,e[3]=j):j=e[3];let C;e[4]!==o||e[5]!==g||e[6]!==R||e[7]!==n.id||e[8]!==n.updatedAt||e[9]!==m?(C=[g,n.id,n.updatedAt,o,m,R],e[4]=o,e[5]=g,e[6]=R,e[7]=n.id,e[8]=n.updatedAt,e[9]=m,e[10]=C):C=e[10],N.useEffect(j,C);let b;e[11]!==E||e[12]!==n.id?(b=(d,r)=>{E(n.id,d.id,r).then(()=>k(_t),w=>I(w instanceof Error?w.message:"Could not update the run"))},e[11]=E,e[12]=n.id,e[13]=b):b=e[13];const h=b;if(v){let d;return e[14]!==v?(d=t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:v}),e[14]=v,e[15]=d):d=e[15],d}if(!x){let d;return e[16]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("p",{role:"status",className:"text-xs text-muted-foreground",children:"Loading runs…"}),e[16]=d):d=e[16],d}if(x.length===0){let d;return e[17]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx("p",{className:"text-xs text-muted-foreground",children:"No runs yet."}),e[17]=d):d=e[17],d}const i=`Runs of ${n.name}`;let u;if(e[18]!==h||e[19]!==p||e[20]!==x){let d;e[22]!==h||e[23]!==p?(d=r=>{var w;return t.jsxs("li",{className:"flex flex-wrap items-center gap-2 rounded border px-2 py-1 text-xs",children:[t.jsx("span",{className:"font-medium",children:xt[r.state]}),t.jsxs("span",{className:"text-muted-foreground",children:[r.trigger,r.deliveries>1?` · ${r.deliveries} deliveries`:""," · ",Ge(r.dueAt)]}),r.session&&t.jsx("span",{className:"text-muted-foreground",children:r.session.working?"session working":"session idle"}),r.reason&&t.jsx("span",{className:"basis-full text-muted-foreground",children:r.reason}),t.jsxs("span",{className:"ml-auto flex gap-1",children:[((w=r.session)==null?void 0:w.dirName)&&r.session.fileName&&p&&t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>p(r.session.dirName,r.session.fileName),children:"Open session"}),(r.state==="scheduled"||r.state==="held")&&t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>h(r,"cancel"),children:"Cancel"}),r.state==="held"&&r.hold==="reauthorize"&&t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>h(r,"reauthorize"),children:"Reauthorize"}),r.state==="unknown"&&t.jsxs(t.Fragment,{children:[t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>h(r,"mark-started"),children:"It started"}),t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>h(r,"mark-not-started"),children:"It did not start"})]})]})]},r.id)},e[22]=h,e[23]=p,e[24]=d):d=e[24],u=x.map(d),e[18]=h,e[19]=p,e[20]=x,e[21]=u}else u=e[21];let f;return e[25]!==i||e[26]!==u?(f=t.jsx("ol",{"aria-label":i,className:"flex flex-col gap-1",children:u}),e[25]=i,e[26]=u,e[27]=f):f=e[27],f}function _t(s){return s+1}function At(s){const e=xe.c(3),n=Ue("hostFiles"),S=Ue("terminal");if(!n||!S){let m;return e[0]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("p",{role:"status",className:"p-3 text-xs text-muted-foreground",children:"Scheduled tasks need host-file and terminal access on this server."}),e[0]=m):m=e[0],m}let o;return e[1]!==s?(o=t.jsx(Et,{...s}),e[1]=s,e[2]=o):o=e[2],o}function Et(s){var K,O,M,F;const e=xe.c(31),{context:n,active:S}=s,o=ct(S),[m,p]=N.useState(null),[x,l]=N.useState(null),[v,I]=N.useState(null),[R,k]=N.useState(null),[g,E]=N.useState(0);let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=c=>{c.catch(z=>k(z instanceof Error?z.message:"The request failed"))},e[0]=j):j=e[0];const C=j;let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("h2",{className:"text-sm font-medium",children:"Scheduled and webhook tasks"}),e[1]=b):b=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs("div",{className:"flex items-center justify-between",children:[b,t.jsxs(_,{size:"sm",variant:"outline",onClick:()=>p("new"),children:[t.jsx(rt,{"data-icon":"inline-start"}),"New task"]})]}),e[2]=h):h=e[2];let i;e[3]!==R?(i=R&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:R}),e[3]=R,e[4]=i):i=e[4];let u;e[5]!==o.error?(u=o.error&&t.jsx("p",{role:"alert",className:"text-xs text-destructive",children:o.error}),e[5]=o.error,e[6]=u):u=e[6];let f;e[7]!==o||e[8]!==n||e[9]!==m?(f=m&&t.jsx(vt,{task:m==="new"?null:m,cwd:n.projectPath,onCancel:()=>p(null),onSave:async(c,z)=>{const T=await o.save(c,z,m==="new"?void 0:m);T.webhookSecret&&I({taskId:T.task.id,value:T.webhookSecret}),p(null)}}),e[7]=o,e[8]=n,e[9]=m,e[10]=f):f=e[10];let d;e[11]!==v?(d=v&&t.jsxs("div",{role:"status",className:"flex flex-col gap-1 rounded-md border border-warning/40 p-2 text-xs",children:[t.jsx("p",{children:"Webhook secret — shown only now. Store it with the sender:"}),t.jsx("code",{className:"break-all font-mono",children:v.value}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(_,{size:"xs",variant:"outline",onClick:()=>void Ye(v.value),children:"Copy secret"}),t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>I(null),children:"Done"})]})]}),e[11]=v,e[12]=d):d=e[12];let r;e[13]!==((K=o.tasks)==null?void 0:K.length)||e[14]!==m?(r=((O=o.tasks)==null?void 0:O.length)===0&&!m&&t.jsx("p",{className:"text-xs text-muted-foreground",children:"No tasks yet. A task starts a new session on a schedule, when a signed webhook arrives, or when you run it."}),e[13]=(M=o.tasks)==null?void 0:M.length,e[14]=m,e[15]=r):r=e[15];let w;e[16]!==S||e[17]!==o||e[18]!==n||e[19]!==x||e[20]!==g?(w=(F=o.tasks)==null?void 0:F.map(c=>{var z,T,Z,P;return t.jsxs("li",{className:"flex flex-col gap-2 rounded-md border p-2 text-xs",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("span",{className:"font-medium",children:c.name}),t.jsx("span",{className:"rounded bg-muted px-1.5",children:c.state==="paused"?"Paused":"Active"}),((z=c.authority)==null?void 0:z.revoked)&&t.jsx("span",{className:"text-destructive",children:"Authorization revoked"}),((T=c.authority)==null?void 0:T.source)==="none"&&t.jsx("span",{className:"text-warning",children:"Runs wait for you to reauthorize them"})]}),t.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-muted-foreground",children:[t.jsxs("span",{children:[t.jsx(st,{className:"mr-1 inline size-3","aria-hidden":!0}),ht(c.schedule)]}),t.jsxs("span",{children:["Next: ",Ge(c.nextRunAt)]}),t.jsx("span",{className:"font-mono",children:c.project.cwd}),t.jsxs("span",{children:[qe(c.provider.agent).displayName,c.provider.model?` · ${c.provider.model}`:""," · ",c.workspace==="worktree"?"new worktree":"project folder"]})]}),((Z=c.webhook)==null?void 0:Z.enabled)&&t.jsxs("div",{className:"flex flex-col gap-1 text-muted-foreground",children:[t.jsxs("span",{children:[t.jsx(lt,{className:"mr-1 inline size-3","aria-hidden":!0}),c.webhookUrl?t.jsx("code",{className:"break-all",children:c.webhookUrl}):"Webhook ingress is not available on this server's sign-in"]}),c.webhookReachability==="local-only"&&t.jsx("span",{children:"Reachable only where this machine is; set COGPIT_PUBLIC_URL when a tunnel or proxy exposes it."})]}),t.jsxs("div",{className:"flex flex-wrap gap-1",children:[t.jsxs(_,{size:"xs",variant:"outline",onClick:()=>C(o.act(c.id,"run").then(()=>E($t))),children:[t.jsx(nt,{"data-icon":"inline-start"}),"Run now"]}),c.state==="active"?t.jsxs(_,{size:"xs",variant:"ghost",onClick:()=>C(o.act(c.id,"pause")),children:[t.jsx(at,{"data-icon":"inline-start"}),"Pause"]}):t.jsxs(_,{size:"xs",variant:"ghost",onClick:()=>C(o.act(c.id,"resume")),children:[t.jsx(it,{"data-icon":"inline-start"}),"Resume"]}),t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>p(c),children:"Edit"}),((P=c.webhook)==null?void 0:P.enabled)&&t.jsx(_,{size:"xs",variant:"ghost",onClick:()=>C(o.rotate(c.id).then(ue=>I({taskId:c.id,value:ue.webhookSecret}))),children:"Rotate secret"}),t.jsx(_,{size:"xs",variant:"ghost","aria-expanded":x===c.id,onClick:()=>l(x===c.id?null:c.id),children:"History"}),t.jsx(_,{size:"xs",variant:"ghost","aria-label":`Delete ${c.name}`,onClick:()=>{window.confirm(`Delete ${c.name}? Waiting runs are cancelled.`)&&C(o.remove(c.id))},children:t.jsx(ot,{"data-icon":"inline-start"})})]}),x===c.id&&t.jsx(Ct,{task:c,automations:o,active:S,version:g,openSession:n.openSession})]},c.id)}),e[16]=S,e[17]=o,e[18]=n,e[19]=x,e[20]=g,e[21]=w):w=e[21];let y;e[22]!==w?(y=t.jsx("ul",{"aria-label":"Tasks",className:"flex flex-col gap-2",children:w}),e[22]=w,e[23]=y):y=e[23];let D;return e[24]!==y||e[25]!==i||e[26]!==u||e[27]!==f||e[28]!==d||e[29]!==r?(D=t.jsxs("section",{"aria-label":"Automations",className:"flex h-full min-h-0 flex-col gap-3 overflow-auto p-3",children:[h,i,u,f,d,r,y]}),e[24]=y,e[25]=i,e[26]=u,e[27]=f,e[28]=d,e[29]=r,e[30]=D):D=e[30],D}function $t(s){return s+1}export{At as AutomationsPanel};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{c as qe,j as O,r as ge}from"./vendor-react-gGw_S5I_.js";import{
|
|
1
|
+
import{c as qe,j as O,r as ge}from"./vendor-react-gGw_S5I_.js";import{d8 as si,d9 as fi,da as ai,db as pi,aZ as di,c as xe,B as Ue}from"./index-BYVl1VlW.js";import{u as Kn,aW as hi}from"./vendor-ui-B0az9ATE.js";import"./vendor-markdown-BEJ8yVzA.js";function mi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var U={},Fe={},te={},gn;function ke(){if(gn)return te;gn=1;function t(s){return typeof s>"u"||s===null}function i(s){return typeof s=="object"&&s!==null}function m(s){return Array.isArray(s)?s:t(s)?[]:[s]}function y(s,c){if(c){const A=Object.keys(c);for(let r=0,f=A.length;r<f;r+=1){const C=A[r];s[C]=c[C]}}return s}function p(s,c){let A="";for(let r=0;r<c;r+=1)A+=s;return A}function h(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return te.isNothing=t,te.isObject=i,te.toArray=m,te.repeat=p,te.isNegativeZero=h,te.extend=y,te}var $e,xn;function Ee(){if(xn)return $e;xn=1;function t(m,y){let p="";const h=m.reason||"(unknown reason)";return m.mark?(m.mark.name&&(p+='in "'+m.mark.name+'" '),p+="("+(m.mark.line+1)+":"+(m.mark.column+1)+")",!y&&m.mark.snippet&&(p+=`
|
|
2
2
|
|
|
3
|
-
`+m.mark.snippet),h+" "+p):h}function i(m,y){Error.call(this),this.name="YAMLException",this.reason=m,this.mark=y,this.message=t(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.toString=function(y){return this.name+": "+t(this,y)},$e=i,$e}var Ge,An;function gi(){if(An)return Ge;An=1;const t=ke();function i(p,h,s,c,A){let r="",f="";const C=Math.floor(A/2)-1;return c-h>C&&(r=" ... ",h=c-C+r.length),s-c>C&&(f=" ...",s=c+C-f.length),{str:r+p.slice(h,s).replace(/\t/g,"→")+f,pos:c-h+r.length}}function m(p,h){return t.repeat(" ",h-p.length)+p}function y(p,h){if(h=Object.create(h||null),!p.buffer)return null;h.maxLength||(h.maxLength=79),typeof h.indent!="number"&&(h.indent=1),typeof h.linesBefore!="number"&&(h.linesBefore=3),typeof h.linesAfter!="number"&&(h.linesAfter=2);const s=/\r?\n|\r|\0/g,c=[0],A=[];let r,f=-1;for(;r=s.exec(p.buffer);)A.push(r.index),c.push(r.index+r[0].length),p.position<=r.index&&f<0&&(f=c.length-2);f<0&&(f=c.length-1);let C="";const
|
|
4
|
-
`+C}const V=i(p.buffer,c[f],A[f],p.position,R);C+=t.repeat(" ",h.indent)+m((p.line+1).toString(),
|
|
5
|
-
`,C+=t.repeat("-",h.indent+
|
|
6
|
-
`;for(let F=1;F<=h.linesAfter&&!(f+F>=A.length);F++){const H=i(p.buffer,c[f+F],A[f+F],p.position-(c[f]-c[f+F]),R);C+=t.repeat(" ",h.indent)+m((p.line+F+1).toString(),
|
|
7
|
-
`}return C.replace(/\n$/,"")}return Ge=y,Ge}var We,yn;function G(){if(yn)return We;yn=1;const t=Ee(),i=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],m=["scalar","sequence","mapping"];function y(h){const s={};return h!==null&&Object.keys(h).forEach(function(c){h[c].forEach(function(A){s[String(A)]=c})}),s}function p(h,s){if(s=s||{},Object.keys(s).forEach(function(c){if(i.indexOf(c)===-1)throw new t('Unknown option "'+c+'" is met in definition of "'+h+'" YAML type.')}),this.options=s,this.tag=h,this.kind=s.kind||null,this.resolve=s.resolve||function(){return!0},this.construct=s.construct||function(c){return c},this.instanceOf=s.instanceOf||null,this.predicate=s.predicate||null,this.represent=s.represent||null,this.representName=s.representName||null,this.defaultStyle=s.defaultStyle||null,this.multi=s.multi||!1,this.styleAliases=y(s.styleAliases||null),m.indexOf(this.kind)===-1)throw new t('Unknown kind "'+this.kind+'" is specified for "'+h+'" YAML type.')}return We=p,We}var Qe,bn;function Un(){if(bn)return Qe;bn=1;const t=Ee(),i=G();function m(h,s){const c=[];return h[s].forEach(function(A){let r=c.length;c.forEach(function(f,C){f.tag===A.tag&&f.kind===A.kind&&f.multi===A.multi&&(r=C)}),c[r]=A}),c}function y(){const h={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function s(c){c.multi?(h.multi[c.kind].push(c),h.multi.fallback.push(c)):h[c.kind][c.tag]=h.fallback[c.tag]=c}for(let c=0,A=arguments.length;c<A;c+=1)arguments[c].forEach(s);return h}function p(h){return this.extend(h)}return p.prototype.extend=function(s){let c=[],A=[];if(s instanceof i)A.push(s);else if(Array.isArray(s))A=A.concat(s);else if(s&&(Array.isArray(s.implicit)||Array.isArray(s.explicit)))s.implicit&&(c=c.concat(s.implicit)),s.explicit&&(A=A.concat(s.explicit));else throw new t("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");c.forEach(function(f){if(!(f instanceof i))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(f.loadKind&&f.loadKind!=="scalar")throw new t("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(f.multi)throw new t("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),A.forEach(function(f){if(!(f instanceof i))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const r=Object.create(p.prototype);return r.implicit=(this.implicit||[]).concat(c),r.explicit=(this.explicit||[]).concat(A),r.compiledImplicit=m(r,"implicit"),r.compiledExplicit=m(r,"explicit"),r.compiledTypeMap=y(r.compiledImplicit,r.compiledExplicit),r},Qe=p,Qe}var ze,wn;function $n(){if(wn)return ze;wn=1;const t=G();return ze=new t("tag:yaml.org,2002:str",{kind:"scalar",construct:function(i){return i!==null?i:""}}),ze}var Ve,Sn;function Gn(){if(Sn)return Ve;Sn=1;const t=G();return Ve=new t("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(i){return i!==null?i:[]}}),Ve}var Xe,Cn;function Wn(){if(Cn)return Xe;Cn=1;const t=G();return Xe=new t("tag:yaml.org,2002:map",{kind:"mapping",construct:function(i){return i!==null?i:{}}}),Xe}var Ze,Tn;function Qn(){if(Tn)return Ze;Tn=1;const t=Un();return Ze=new t({explicit:[$n(),Gn(),Wn()]}),Ze}var Je,kn;function zn(){if(kn)return Je;kn=1;const t=G();function i(p){if(p===null)return!0;const h=p.length;return h===1&&p==="~"||h===4&&(p==="null"||p==="Null"||p==="NULL")}function m(){return null}function y(p){return p===null}return Je=new t("tag:yaml.org,2002:null",{kind:"scalar",resolve:i,construct:m,predicate:y,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),Je}var en,En;function Vn(){if(En)return en;En=1;const t=G();function i(p){if(p===null)return!1;const h=p.length;return h===4&&(p==="true"||p==="True"||p==="TRUE")||h===5&&(p==="false"||p==="False"||p==="FALSE")}function m(p){return p==="true"||p==="True"||p==="TRUE"}function y(p){return Object.prototype.toString.call(p)==="[object Boolean]"}return en=new t("tag:yaml.org,2002:bool",{kind:"scalar",resolve:i,construct:m,predicate:y,represent:{lowercase:function(p){return p?"true":"false"},uppercase:function(p){return p?"TRUE":"FALSE"},camelcase:function(p){return p?"True":"False"}},defaultStyle:"lowercase"}),en}var nn,Nn;function Xn(){if(Nn)return nn;Nn=1;const t=ke(),i=G();function m(r){return r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102}function y(r){return r>=48&&r<=55}function p(r){return r>=48&&r<=57}function h(r){if(r===null)return!1;const f=r.length;let C=0,
|
|
8
|
-
\r`;function m(s){if(s===null)return!1;let c=0;const A=s.length,r=i;for(let f=0;f<A;f++){const C=r.indexOf(s.charAt(f));if(!(C>64)){if(C<0)return!1;c+=6}}return c%8===0}function y(s){const c=s.replace(/[\r\n=]/g,""),A=c.length,r=i;let f=0;const C=[];for(let R=0;R<A;R++)R%4===0&&R&&(C.push(f>>16&255),C.push(f>>8&255),C.push(f&255)),f=f<<6|r.indexOf(c.charAt(R));const
|
|
9
|
-
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"
";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function pe(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function
|
|
10
|
-
`,l-1))}function Ie(e,l,g){let x,a,n,o,u,b;const w=e.kind,S=e.result;let d=e.input.charCodeAt(e.position);if(q(d)||z(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96)return!1;if(d===63||d===45){const T=e.input.charCodeAt(e.position+1);if(q(T)||g&&z(T))return!1}for(e.kind="scalar",e.result="",x=a=e.position,n=!1;d!==0;){if(d===58){const T=e.input.charCodeAt(e.position+1);if(q(T)||g&&z(T))break}else if(d===35){const T=e.input.charCodeAt(e.position-1);if(q(T))break}else{if(e.position===e.lineStart&&Z(e)||g&&z(d))break;if(K(d))if(o=e.line,u=e.lineStart,b=e.lineIndent,Y(e,!1,-1),e.lineIndent>=l){n=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=o,e.lineStart=u,e.lineIndent=b;break}}n&&(W(e,x,a,!1),me(e,e.line-o),x=a=e.position,n=!1),D(d)||(a=e.position+1),d=e.input.charCodeAt(++e.position)}return W(e,x,a,!1),e.result?!0:(e.kind=w,e.result=S,!1)}function we(e,l){let g,x,a=e.input.charCodeAt(e.position);if(a!==39)return!1;for(e.kind="scalar",e.result="",e.position++,g=x=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===39)if(W(e,g,e.position,!0),a=e.input.charCodeAt(++e.position),a===39)g=e.position,e.position++,x=e.position;else return!0;else K(a)?(W(e,g,x,!0),me(e,Y(e,!1,l)),g=x=e.position):e.position===e.lineStart&&Z(e)?k(e,"unexpected end of the document within a single quoted scalar"):(e.position++,D(a)||(x=e.position));k(e,"unexpected end of the stream within a single quoted scalar")}function Oe(e,l){let g,x,a,n=e.input.charCodeAt(e.position);if(n!==34)return!1;for(e.kind="scalar",e.result="",e.position++,g=x=e.position;(n=e.input.charCodeAt(e.position))!==0;){if(n===34)return W(e,g,e.position,!0),e.position++,!0;if(n===92){if(W(e,g,e.position,!0),n=e.input.charCodeAt(++e.position),K(n))Y(e,!1,l);else if(n<256&&P[n])e.result+=$[n],e.position++;else if((a=fe(n))>0){let o=a,u=0;for(;o>0;o--)n=e.input.charCodeAt(++e.position),(a=se(n))>=0?u=(u<<4)+a:k(e,"expected hexadecimal character");e.result+=pe(u),e.position++}else k(e,"unknown escape sequence");g=x=e.position}else K(n)?(W(e,g,x,!0),me(e,Y(e,!1,l)),g=x=e.position):e.position===e.lineStart&&Z(e)?k(e,"unexpected end of the document within a double quoted scalar"):(e.position++,D(n)||(x=e.position))}k(e,"unexpected end of the stream within a double quoted scalar")}function
|
|
3
|
+
`+m.mark.snippet),h+" "+p):h}function i(m,y){Error.call(this),this.name="YAMLException",this.reason=m,this.mark=y,this.message=t(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.toString=function(y){return this.name+": "+t(this,y)},$e=i,$e}var Ge,An;function gi(){if(An)return Ge;An=1;const t=ke();function i(p,h,s,c,A){let r="",f="";const C=Math.floor(A/2)-1;return c-h>C&&(r=" ... ",h=c-C+r.length),s-c>C&&(f=" ...",s=c+C-f.length),{str:r+p.slice(h,s).replace(/\t/g,"→")+f,pos:c-h+r.length}}function m(p,h){return t.repeat(" ",h-p.length)+p}function y(p,h){if(h=Object.create(h||null),!p.buffer)return null;h.maxLength||(h.maxLength=79),typeof h.indent!="number"&&(h.indent=1),typeof h.linesBefore!="number"&&(h.linesBefore=3),typeof h.linesAfter!="number"&&(h.linesAfter=2);const s=/\r?\n|\r|\0/g,c=[0],A=[];let r,f=-1;for(;r=s.exec(p.buffer);)A.push(r.index),c.push(r.index+r[0].length),p.position<=r.index&&f<0&&(f=c.length-2);f<0&&(f=c.length-1);let C="";const L=Math.min(p.line+h.linesAfter,A.length).toString().length,R=h.maxLength-(h.indent+L+3);for(let F=1;F<=h.linesBefore&&!(f-F<0);F++){const H=i(p.buffer,c[f-F],A[f-F],p.position-(c[f]-c[f-F]),R);C=t.repeat(" ",h.indent)+m((p.line-F+1).toString(),L)+" | "+H.str+`
|
|
4
|
+
`+C}const V=i(p.buffer,c[f],A[f],p.position,R);C+=t.repeat(" ",h.indent)+m((p.line+1).toString(),L)+" | "+V.str+`
|
|
5
|
+
`,C+=t.repeat("-",h.indent+L+3+V.pos)+`^
|
|
6
|
+
`;for(let F=1;F<=h.linesAfter&&!(f+F>=A.length);F++){const H=i(p.buffer,c[f+F],A[f+F],p.position-(c[f]-c[f+F]),R);C+=t.repeat(" ",h.indent)+m((p.line+F+1).toString(),L)+" | "+H.str+`
|
|
7
|
+
`}return C.replace(/\n$/,"")}return Ge=y,Ge}var We,yn;function G(){if(yn)return We;yn=1;const t=Ee(),i=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],m=["scalar","sequence","mapping"];function y(h){const s={};return h!==null&&Object.keys(h).forEach(function(c){h[c].forEach(function(A){s[String(A)]=c})}),s}function p(h,s){if(s=s||{},Object.keys(s).forEach(function(c){if(i.indexOf(c)===-1)throw new t('Unknown option "'+c+'" is met in definition of "'+h+'" YAML type.')}),this.options=s,this.tag=h,this.kind=s.kind||null,this.resolve=s.resolve||function(){return!0},this.construct=s.construct||function(c){return c},this.instanceOf=s.instanceOf||null,this.predicate=s.predicate||null,this.represent=s.represent||null,this.representName=s.representName||null,this.defaultStyle=s.defaultStyle||null,this.multi=s.multi||!1,this.styleAliases=y(s.styleAliases||null),m.indexOf(this.kind)===-1)throw new t('Unknown kind "'+this.kind+'" is specified for "'+h+'" YAML type.')}return We=p,We}var Qe,bn;function Un(){if(bn)return Qe;bn=1;const t=Ee(),i=G();function m(h,s){const c=[];return h[s].forEach(function(A){let r=c.length;c.forEach(function(f,C){f.tag===A.tag&&f.kind===A.kind&&f.multi===A.multi&&(r=C)}),c[r]=A}),c}function y(){const h={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function s(c){c.multi?(h.multi[c.kind].push(c),h.multi.fallback.push(c)):h[c.kind][c.tag]=h.fallback[c.tag]=c}for(let c=0,A=arguments.length;c<A;c+=1)arguments[c].forEach(s);return h}function p(h){return this.extend(h)}return p.prototype.extend=function(s){let c=[],A=[];if(s instanceof i)A.push(s);else if(Array.isArray(s))A=A.concat(s);else if(s&&(Array.isArray(s.implicit)||Array.isArray(s.explicit)))s.implicit&&(c=c.concat(s.implicit)),s.explicit&&(A=A.concat(s.explicit));else throw new t("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");c.forEach(function(f){if(!(f instanceof i))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(f.loadKind&&f.loadKind!=="scalar")throw new t("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(f.multi)throw new t("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),A.forEach(function(f){if(!(f instanceof i))throw new t("Specified list of YAML types (or a single Type object) contains a non-Type object.")});const r=Object.create(p.prototype);return r.implicit=(this.implicit||[]).concat(c),r.explicit=(this.explicit||[]).concat(A),r.compiledImplicit=m(r,"implicit"),r.compiledExplicit=m(r,"explicit"),r.compiledTypeMap=y(r.compiledImplicit,r.compiledExplicit),r},Qe=p,Qe}var ze,wn;function $n(){if(wn)return ze;wn=1;const t=G();return ze=new t("tag:yaml.org,2002:str",{kind:"scalar",construct:function(i){return i!==null?i:""}}),ze}var Ve,Sn;function Gn(){if(Sn)return Ve;Sn=1;const t=G();return Ve=new t("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(i){return i!==null?i:[]}}),Ve}var Xe,Cn;function Wn(){if(Cn)return Xe;Cn=1;const t=G();return Xe=new t("tag:yaml.org,2002:map",{kind:"mapping",construct:function(i){return i!==null?i:{}}}),Xe}var Ze,Tn;function Qn(){if(Tn)return Ze;Tn=1;const t=Un();return Ze=new t({explicit:[$n(),Gn(),Wn()]}),Ze}var Je,kn;function zn(){if(kn)return Je;kn=1;const t=G();function i(p){if(p===null)return!0;const h=p.length;return h===1&&p==="~"||h===4&&(p==="null"||p==="Null"||p==="NULL")}function m(){return null}function y(p){return p===null}return Je=new t("tag:yaml.org,2002:null",{kind:"scalar",resolve:i,construct:m,predicate:y,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),Je}var en,En;function Vn(){if(En)return en;En=1;const t=G();function i(p){if(p===null)return!1;const h=p.length;return h===4&&(p==="true"||p==="True"||p==="TRUE")||h===5&&(p==="false"||p==="False"||p==="FALSE")}function m(p){return p==="true"||p==="True"||p==="TRUE"}function y(p){return Object.prototype.toString.call(p)==="[object Boolean]"}return en=new t("tag:yaml.org,2002:bool",{kind:"scalar",resolve:i,construct:m,predicate:y,represent:{lowercase:function(p){return p?"true":"false"},uppercase:function(p){return p?"TRUE":"FALSE"},camelcase:function(p){return p?"True":"False"}},defaultStyle:"lowercase"}),en}var nn,Nn;function Xn(){if(Nn)return nn;Nn=1;const t=ke(),i=G();function m(r){return r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102}function y(r){return r>=48&&r<=55}function p(r){return r>=48&&r<=57}function h(r){if(r===null)return!1;const f=r.length;let C=0,L=!1;if(!f)return!1;let R=r[C];if((R==="-"||R==="+")&&(R=r[++C]),R==="0"){if(C+1===f)return!0;if(R=r[++C],R==="b"){for(C++;C<f;C++){if(R=r[C],R!=="0"&&R!=="1")return!1;L=!0}return L&&isFinite(s(r))}if(R==="x"){for(C++;C<f;C++){if(!m(r.charCodeAt(C)))return!1;L=!0}return L&&isFinite(s(r))}if(R==="o"){for(C++;C<f;C++){if(!y(r.charCodeAt(C)))return!1;L=!0}return L&&isFinite(s(r))}}for(;C<f;C++){if(!p(r.charCodeAt(C)))return!1;L=!0}return L?isFinite(s(r)):!1}function s(r){let f=r,C=1,L=f[0];if((L==="-"||L==="+")&&(L==="-"&&(C=-1),f=f.slice(1),L=f[0]),f==="0")return 0;if(L==="0"){if(f[1]==="b")return C*parseInt(f.slice(2),2);if(f[1]==="x")return C*parseInt(f.slice(2),16);if(f[1]==="o")return C*parseInt(f.slice(2),8)}return C*parseInt(f,10)}function c(r){return s(r)}function A(r){return Object.prototype.toString.call(r)==="[object Number]"&&r%1===0&&!t.isNegativeZero(r)}return nn=new i("tag:yaml.org,2002:int",{kind:"scalar",resolve:h,construct:c,predicate:A,represent:{binary:function(r){return r>=0?"0b"+r.toString(2):"-0b"+r.toString(2).slice(1)},octal:function(r){return r>=0?"0o"+r.toString(8):"-0o"+r.toString(8).slice(1)},decimal:function(r){return r.toString(10)},hexadecimal:function(r){return r>=0?"0x"+r.toString(16).toUpperCase():"-0x"+r.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),nn}var rn,In;function Zn(){if(In)return rn;In=1;const t=ke(),i=G(),m=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),y=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function p(r){return r===null||!m.test(r)?!1:isFinite(parseFloat(r,10))?!0:y.test(r)}function h(r){let f=r.toLowerCase();const C=f[0]==="-"?-1:1;return"+-".indexOf(f[0])>=0&&(f=f.slice(1)),f===".inf"?C===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:f===".nan"?NaN:C*parseFloat(f,10)}const s=/^[-+]?[0-9]+e/;function c(r,f){if(isNaN(r))switch(f){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===r)switch(f){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===r)switch(f){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(t.isNegativeZero(r))return"-0.0";const C=r.toString(10);return s.test(C)?C.replace("e",".e"):C}function A(r){return Object.prototype.toString.call(r)==="[object Number]"&&(r%1!==0||t.isNegativeZero(r))}return rn=new i("tag:yaml.org,2002:float",{kind:"scalar",resolve:p,construct:h,predicate:A,represent:c,defaultStyle:"lowercase"}),rn}var ln,On;function Jn(){return On||(On=1,ln=Qn().extend({implicit:[zn(),Vn(),Xn(),Zn()]})),ln}var on,Ln;function ei(){return Ln||(Ln=1,on=Jn()),on}var tn,_n;function ni(){if(_n)return tn;_n=1;const t=G(),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),m=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function y(s){return s===null?!1:i.exec(s)!==null||m.exec(s)!==null}function p(s){let c=0,A=null,r=i.exec(s);if(r===null&&(r=m.exec(s)),r===null)throw new Error("Date resolve error");const f=+r[1],C=+r[2]-1,L=+r[3];if(!r[4])return new Date(Date.UTC(f,C,L));const R=+r[4],V=+r[5],F=+r[6];if(r[7]){for(c=r[7].slice(0,3);c.length<3;)c+="0";c=+c}if(r[9]){const X=+r[10],K=+(r[11]||0);A=(X*60+K)*6e4,r[9]==="-"&&(A=-A)}const H=new Date(Date.UTC(f,C,L,R,V,F,c));return A&&H.setTime(H.getTime()-A),H}function h(s){return s.toISOString()}return tn=new t("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:y,construct:p,instanceOf:Date,represent:h}),tn}var cn,vn;function ii(){if(vn)return cn;vn=1;const t=G();function i(m){return m==="<<"||m===null}return cn=new t("tag:yaml.org,2002:merge",{kind:"scalar",resolve:i}),cn}var un,Mn;function ri(){if(Mn)return un;Mn=1;const t=G(),i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
8
|
+
\r`;function m(s){if(s===null)return!1;let c=0;const A=s.length,r=i;for(let f=0;f<A;f++){const C=r.indexOf(s.charAt(f));if(!(C>64)){if(C<0)return!1;c+=6}}return c%8===0}function y(s){const c=s.replace(/[\r\n=]/g,""),A=c.length,r=i;let f=0;const C=[];for(let R=0;R<A;R++)R%4===0&&R&&(C.push(f>>16&255),C.push(f>>8&255),C.push(f&255)),f=f<<6|r.indexOf(c.charAt(R));const L=A%4*6;return L===0?(C.push(f>>16&255),C.push(f>>8&255),C.push(f&255)):L===18?(C.push(f>>10&255),C.push(f>>2&255)):L===12&&C.push(f>>4&255),new Uint8Array(C)}function p(s){let c="",A=0;const r=s.length,f=i;for(let L=0;L<r;L++)L%3===0&&L&&(c+=f[A>>18&63],c+=f[A>>12&63],c+=f[A>>6&63],c+=f[A&63]),A=(A<<8)+s[L];const C=r%3;return C===0?(c+=f[A>>18&63],c+=f[A>>12&63],c+=f[A>>6&63],c+=f[A&63]):C===2?(c+=f[A>>10&63],c+=f[A>>4&63],c+=f[A<<2&63],c+=f[64]):C===1&&(c+=f[A>>2&63],c+=f[A<<4&63],c+=f[64],c+=f[64]),c}function h(s){return Object.prototype.toString.call(s)==="[object Uint8Array]"}return un=new t("tag:yaml.org,2002:binary",{kind:"scalar",resolve:m,construct:y,predicate:h,represent:p}),un}var sn,Rn;function li(){if(Rn)return sn;Rn=1;const t=G(),i=Object.prototype.hasOwnProperty,m=Object.prototype.toString;function y(h){if(h===null)return!0;const s={},c=h;for(let A=0,r=c.length;A<r;A+=1){const f=c[A];let C=!1;if(m.call(f)!=="[object Object]")return!1;let L;for(L in f)if(i.call(f,L))if(!C)C=!0;else return!1;if(!C||i.call(s,L))return!1;Object.defineProperty(s,L,{value:!0})}return!0}function p(h){return h!==null?h:[]}return sn=new t("tag:yaml.org,2002:omap",{kind:"sequence",resolve:y,construct:p}),sn}var fn,jn;function oi(){if(jn)return fn;jn=1;const t=G(),i=Object.prototype.toString;function m(p){if(p===null)return!0;const h=p,s=new Array(h.length);for(let c=0,A=h.length;c<A;c+=1){const r=h[c];if(i.call(r)!=="[object Object]")return!1;const f=Object.keys(r);if(f.length!==1)return!1;s[c]=[f[0],r[f[0]]]}return!0}function y(p){if(p===null)return[];const h=p,s=new Array(h.length);for(let c=0,A=h.length;c<A;c+=1){const r=h[c],f=Object.keys(r);s[c]=[f[0],r[f[0]]]}return s}return fn=new t("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:m,construct:y}),fn}var an,Fn;function ti(){if(Fn)return an;Fn=1;const t=G(),i=Object.prototype.hasOwnProperty;function m(p){if(p===null)return!0;const h=p;for(const s in h)if(i.call(h,s)&&h[s]!==null)return!1;return!0}function y(p){return p!==null?p:{}}return an=new t("tag:yaml.org,2002:set",{kind:"mapping",resolve:m,construct:y}),an}var pn,qn;function hn(){return qn||(qn=1,pn=ei().extend({implicit:[ni(),ii()],explicit:[ri(),li(),oi(),ti()]})),pn}var Dn;function xi(){if(Dn)return Fe;Dn=1;const t=ke(),i=Ee(),m=gi(),y=hn(),p=Object.prototype.hasOwnProperty,h=1,s=2,c=3,A=4,r=1,f=2,C=3,L=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,R=/[\x85\u2028\u2029]/,V=/[,\[\]{}]/,F=/^(?:!|!!|![0-9A-Za-z-]+!)$/,H=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function X(e){return Object.prototype.toString.call(e)}function K(e){return e===10||e===13}function D(e){return e===9||e===32}function q(e){return e===9||e===32||e===10||e===13}function z(e){return e===44||e===91||e===93||e===123||e===125}function se(e){if(e>=48&&e<=57)return e-48;const l=e|32;return l>=97&&l<=102?l-97+10:-1}function fe(e){return e===120?2:e===117?4:e===85?8:0}function ae(e){return e>=48&&e<=57?e-48:-1}function ne(e){switch(e){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
9
|
+
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"
";case 95:return" ";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function pe(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function _(e,l,g){l==="__proto__"?Object.defineProperty(e,l,{configurable:!0,enumerable:!0,writable:!0,value:g}):e[l]=g}const P=new Array(256),$=new Array(256);for(let e=0;e<256;e++)P[e]=ne(e)?1:0,$[e]=ne(e);function j(e,l){this.input=e,this.filename=l.filename||null,this.schema=l.schema||y,this.onWarning=l.onWarning||null,this.legacy=l.legacy||!1,this.json=l.json||!1,this.listener=l.listener||null,this.maxDepth=typeof l.maxDepth=="number"?l.maxDepth:100,this.maxTotalMergeKeys=typeof l.maxTotalMergeKeys=="number"?l.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function B(e,l){const g={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return g.snippet=m(g),new i(l,g)}function k(e,l){throw B(e,l)}function de(e,l){e.onWarning&&e.onWarning.call(null,B(e,l))}function J(e,l,g){const x=e.anchorMapTransactions;if(x.length!==0){const a=x[x.length-1];p.call(a,l)||(a[l]={existed:p.call(e.anchorMap,l),value:e.anchorMap[l]})}e.anchorMap[l]=g}function De(e){e.anchorMapTransactions.push(Object.create(null))}function ce(e){const l=e.anchorMapTransactions.pop(),g=e.anchorMapTransactions;if(g.length===0)return;const x=g[g.length-1],a=Object.keys(l);for(let n=0,o=a.length;n<o;n+=1){const u=a[n];p.call(x,u)||(x[u]=l[u])}}function Ye(e){const l=e.anchorMapTransactions.pop(),g=Object.keys(l);for(let x=g.length-1;x>=0;x-=1){const a=l[g[x]];a.existed?e.anchorMap[g[x]]=a.value:delete e.anchorMap[g[x]]}}function Ae(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,tag:e.tag,anchor:e.anchor,kind:e.kind,result:e.result}}function he(e,l){e.position=l.position,e.line=l.line,e.lineStart=l.lineStart,e.lineIndent=l.lineIndent,e.firstTabInLine=l.firstTabInLine,e.tag=l.tag,e.anchor=l.anchor,e.kind=l.kind,e.result=l.result}const Ne={YAML:function(l,g,x){l.version!==null&&k(l,"duplication of %YAML directive"),x.length!==1&&k(l,"YAML directive accepts exactly one argument");const a=/^([0-9]+)\.([0-9]+)$/.exec(x[0]);a===null&&k(l,"ill-formed argument of the YAML directive");const n=parseInt(a[1],10),o=parseInt(a[2],10);n!==1&&k(l,"unacceptable YAML version of the document"),l.version=x[0],l.checkLineBreaks=o<2,o!==1&&o!==2&&de(l,"unsupported YAML version of the document")},TAG:function(l,g,x){let a;x.length!==2&&k(l,"TAG directive accepts exactly two arguments");const n=x[0];a=x[1],F.test(n)||k(l,"ill-formed tag handle (first argument) of the TAG directive"),p.call(l.tagMap,n)&&k(l,'there is a previously declared suffix for "'+n+'" tag handle'),H.test(a)||k(l,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{k(l,"tag prefix is malformed: "+a)}l.tagMap[n]=a}};function W(e,l,g,x){if(l<g){const a=e.input.slice(l,g);if(x)for(let n=0,o=a.length;n<o;n+=1){const u=a.charCodeAt(n);u===9||u>=32&&u<=1114111||k(e,"expected valid JSON character")}else L.test(a)&&k(e,"the stream contains non-printable characters");e.result+=a}}function ie(e){e.totalMergeKeys++,e.maxTotalMergeKeys!==-1&&e.totalMergeKeys>e.maxTotalMergeKeys&&k(e,"merge keys exceeded maxTotalMergeKeys ("+e.maxTotalMergeKeys+")")}function ye(e,l,g,x){t.isObject(g)||k(e,"cannot merge mappings; the provided source object is unacceptable"),ie(e);const a=Object.keys(g);for(let n=0,o=a.length;n<o;n+=1){const u=a[n];ie(e),p.call(l,u)||(_(l,u,g[u]),x[u]=!0)}}function ee(e,l,g,x,a,n,o,u,b){if(Array.isArray(a)){a=Array.prototype.slice.call(a);for(let w=0,S=a.length;w<S;w+=1)Array.isArray(a[w])&&k(e,"nested arrays are not supported inside keys"),typeof a=="object"&&X(a[w])==="[object Object]"&&(a[w]="[object Object]")}if(typeof a=="object"&&X(a)==="[object Object]"&&(a="[object Object]"),a=String(a),l===null&&(l={}),x==="tag:yaml.org,2002:merge")if(Array.isArray(n)){n.length>100&&k(e,"abnormal merge sequence size");for(let w=0,S=n.length;w<S;w+=1)ye(e,l,n[w],g)}else ye(e,l,n,g);else!e.json&&!p.call(g,a)&&p.call(l,a)&&(e.line=o||e.line,e.lineStart=u||e.lineStart,e.position=b||e.position,k(e,"duplicated mapping key")),_(l,a,n),delete g[a];return l}function be(e){const l=e.input.charCodeAt(e.position);l===10?e.position++:l===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):k(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function Y(e,l,g){let x=0,a=e.input.charCodeAt(e.position);for(;a!==0;){for(;D(a);)a===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),a=e.input.charCodeAt(++e.position);if(l&&a===35)do a=e.input.charCodeAt(++e.position);while(a!==10&&a!==13&&a!==0);if(K(a))for(be(e),a=e.input.charCodeAt(e.position),x++,e.lineIndent=0;a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);else break}return g!==-1&&x!==0&&e.lineIndent<g&&de(e,"deficient indentation"),x}function Z(e){let l=e.position,g=e.input.charCodeAt(l);return!!((g===45||g===46)&&g===e.input.charCodeAt(l+1)&&g===e.input.charCodeAt(l+2)&&(l+=3,g=e.input.charCodeAt(l),g===0||q(g)))}function me(e,l){l===1?e.result+=" ":l>1&&(e.result+=t.repeat(`
|
|
10
|
+
`,l-1))}function Ie(e,l,g){let x,a,n,o,u,b;const w=e.kind,S=e.result;let d=e.input.charCodeAt(e.position);if(q(d)||z(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96)return!1;if(d===63||d===45){const T=e.input.charCodeAt(e.position+1);if(q(T)||g&&z(T))return!1}for(e.kind="scalar",e.result="",x=a=e.position,n=!1;d!==0;){if(d===58){const T=e.input.charCodeAt(e.position+1);if(q(T)||g&&z(T))break}else if(d===35){const T=e.input.charCodeAt(e.position-1);if(q(T))break}else{if(e.position===e.lineStart&&Z(e)||g&&z(d))break;if(K(d))if(o=e.line,u=e.lineStart,b=e.lineIndent,Y(e,!1,-1),e.lineIndent>=l){n=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=o,e.lineStart=u,e.lineIndent=b;break}}n&&(W(e,x,a,!1),me(e,e.line-o),x=a=e.position,n=!1),D(d)||(a=e.position+1),d=e.input.charCodeAt(++e.position)}return W(e,x,a,!1),e.result?!0:(e.kind=w,e.result=S,!1)}function we(e,l){let g,x,a=e.input.charCodeAt(e.position);if(a!==39)return!1;for(e.kind="scalar",e.result="",e.position++,g=x=e.position;(a=e.input.charCodeAt(e.position))!==0;)if(a===39)if(W(e,g,e.position,!0),a=e.input.charCodeAt(++e.position),a===39)g=e.position,e.position++,x=e.position;else return!0;else K(a)?(W(e,g,x,!0),me(e,Y(e,!1,l)),g=x=e.position):e.position===e.lineStart&&Z(e)?k(e,"unexpected end of the document within a single quoted scalar"):(e.position++,D(a)||(x=e.position));k(e,"unexpected end of the stream within a single quoted scalar")}function Oe(e,l){let g,x,a,n=e.input.charCodeAt(e.position);if(n!==34)return!1;for(e.kind="scalar",e.result="",e.position++,g=x=e.position;(n=e.input.charCodeAt(e.position))!==0;){if(n===34)return W(e,g,e.position,!0),e.position++,!0;if(n===92){if(W(e,g,e.position,!0),n=e.input.charCodeAt(++e.position),K(n))Y(e,!1,l);else if(n<256&&P[n])e.result+=$[n],e.position++;else if((a=fe(n))>0){let o=a,u=0;for(;o>0;o--)n=e.input.charCodeAt(++e.position),(a=se(n))>=0?u=(u<<4)+a:k(e,"expected hexadecimal character");e.result+=pe(u),e.position++}else k(e,"unknown escape sequence");g=x=e.position}else K(n)?(W(e,g,x,!0),me(e,Y(e,!1,l)),g=x=e.position):e.position===e.lineStart&&Z(e)?k(e,"unexpected end of the document within a double quoted scalar"):(e.position++,D(n)||(x=e.position))}k(e,"unexpected end of the stream within a double quoted scalar")}function Le(e,l){let g=!0,x,a,n;const o=e.tag;let u;const b=e.anchor;let w,S,d,T;const E=Object.create(null);let N,I,v,M=e.input.charCodeAt(e.position);if(M===91)w=93,T=!1,u=[];else if(M===123)w=125,T=!0,u={};else return!1;for(e.anchor!==null&&J(e,e.anchor,u),M=e.input.charCodeAt(++e.position);M!==0;){if(Y(e,!0,l),M=e.input.charCodeAt(e.position),M===w)return e.position++,e.tag=o,e.anchor=b,e.kind=T?"mapping":"sequence",e.result=u,!0;if(g?M===44&&k(e,"expected the node content, but found ','"):k(e,"missed comma between flow collection entries"),I=N=v=null,S=d=!1,M===63){const oe=e.input.charCodeAt(e.position+1);q(oe)&&(S=d=!0,e.position++,Y(e,!0,l))}x=e.line,a=e.lineStart,n=e.position,le(e,l,h,!1,!0),I=e.tag,N=e.result,Y(e,!0,l),M=e.input.charCodeAt(e.position),(d||e.line===x)&&M===58&&(S=!0,M=e.input.charCodeAt(++e.position),Y(e,!0,l),le(e,l,h,!1,!0),v=e.result),T?ee(e,u,E,I,N,v,x,a,n):S?u.push(ee(e,null,E,I,N,v,x,a,n)):u.push(N),Y(e,!0,l),M=e.input.charCodeAt(e.position),M===44?(g=!0,M=e.input.charCodeAt(++e.position)):g=!1}k(e,"unexpected end of the stream within a flow collection")}function re(e,l){let g,x=r,a=!1,n=!1,o=l,u=0,b=!1,w,S=e.input.charCodeAt(e.position);if(S===124)g=!1;else if(S===62)g=!0;else return!1;for(e.kind="scalar",e.result="";S!==0;)if(S=e.input.charCodeAt(++e.position),S===43||S===45)r===x?x=S===43?C:f:k(e,"repeat of a chomping mode identifier");else if((w=ae(S))>=0)w===0?k(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):n?k(e,"repeat of an indentation width identifier"):(o=l+w-1,n=!0);else break;if(D(S)){do S=e.input.charCodeAt(++e.position);while(D(S));if(S===35)do S=e.input.charCodeAt(++e.position);while(!K(S)&&S!==0)}for(;S!==0;){for(be(e),e.lineIndent=0,S=e.input.charCodeAt(e.position);(!n||e.lineIndent<o)&&S===32;)e.lineIndent++,S=e.input.charCodeAt(++e.position);if(!n&&e.lineIndent>o&&(o=e.lineIndent),K(S)){u++;continue}if(!n&&o===0&&k(e,"missing indentation for block scalar"),e.lineIndent<o){x===C?e.result+=t.repeat(`
|
|
11
11
|
`,a?1+u:u):x===r&&a&&(e.result+=`
|
|
12
12
|
`);break}g?D(S)?(b=!0,e.result+=t.repeat(`
|
|
13
13
|
`,a?1+u:u)):b?(b=!1,e.result+=t.repeat(`
|
|
14
14
|
`,u+1)):u===0?a&&(e.result+=" "):e.result+=t.repeat(`
|
|
15
15
|
`,u):e.result+=t.repeat(`
|
|
16
|
-
`,a?1+u:u),a=!0,n=!0,u=0;const d=e.position;for(;!K(S)&&S!==0;)S=e.input.charCodeAt(++e.position);W(e,d,e.position,!1)}return!0}function
|
|
17
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));const g=new j(e,l),x=e.indexOf("\0");for(x!==-1&&(g.position=x,k(g,"null byte is not allowed in input")),g.input+="\0";g.input.charCodeAt(g.position)===32;)g.lineIndent+=1,g.position+=1;for(;g.position<g.length-1;)Be(g);return g.documents}function He(e,l,g){l!==null&&typeof l=="object"&&typeof g>"u"&&(g=l,l=null);const x=Se(e,g);if(typeof l!="function")return x;for(let a=0,n=x.length;a<n;a+=1)l(x[a])}function Ke(e,l){const g=Se(e,l);if(g.length!==0){if(g.length===1)return g[0];throw new i("expected a single document in the stream, but found more")}}return Fe.loadAll=He,Fe.load=Ke,Fe}var dn={},Yn;function Ai(){if(Yn)return dn;Yn=1;const t=ke(),i=Ee(),m=hn(),y=Object.prototype.toString,p=Object.prototype.hasOwnProperty,h=65279,s=9,c=10,A=13,r=32,f=33,C=34,
|
|
16
|
+
`,a?1+u:u),a=!0,n=!0,u=0;const d=e.position;for(;!K(S)&&S!==0;)S=e.input.charCodeAt(++e.position);W(e,d,e.position,!1)}return!0}function _e(e,l){const g=e.tag,x=e.anchor,a=[];let n=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&J(e,e.anchor,a);let o=e.input.charCodeAt(e.position);for(;o!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,k(e,"tab characters must not be used in indentation")),o===45);){const u=e.input.charCodeAt(e.position+1);if(!q(u))break;if(n=!0,e.position++,Y(e,!0,-1)&&e.lineIndent<=l){a.push(null),o=e.input.charCodeAt(e.position);continue}const b=e.line;if(le(e,l,c,!1,!0),a.push(e.result),Y(e,!0,-1),o=e.input.charCodeAt(e.position),(e.line===b||e.lineIndent>l)&&o!==0)k(e,"bad indentation of a sequence entry");else if(e.lineIndent<l)break}return n?(e.tag=g,e.anchor=x,e.kind="sequence",e.result=a,!0):!1}function ve(e,l,g){let x,a,n,o;const u=e.tag,b=e.anchor,w={},S=Object.create(null);let d=null,T=null,E=null,N=!1,I=!1;if(e.firstTabInLine!==-1)return!1;e.anchor!==null&&J(e,e.anchor,w);let v=e.input.charCodeAt(e.position);for(;v!==0;){!N&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,k(e,"tab characters must not be used in indentation"));const M=e.input.charCodeAt(e.position+1),oe=e.line;if((v===63||v===58)&&q(M))v===63?(N&&(ee(e,w,S,d,T,null,a,n,o),d=T=E=null),I=!0,N=!0,x=!0):N?(N=!1,x=!0):k(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,v=M;else{if(a=e.line,n=e.lineStart,o=e.position,!le(e,g,s,!1,!0))break;if(e.line===oe){for(v=e.input.charCodeAt(e.position);D(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),q(v)||k(e,"a whitespace character is expected after the key-value separator within a block mapping"),N&&(ee(e,w,S,d,T,null,a,n,o),d=T=E=null),I=!0,N=!1,x=!1,d=e.tag,T=e.result;else if(I)k(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=u,e.anchor=b,!0}else if(I)k(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=u,e.anchor=b,!0}if((e.line===oe||e.lineIndent>l)&&(N&&(a=e.line,n=e.lineStart,o=e.position),le(e,l,A,!0,x)&&(N?T=e.result:E=e.result),N||(ee(e,w,S,d,T,E,a,n,o),d=T=E=null),Y(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===oe||e.lineIndent>l)&&v!==0)k(e,"bad indentation of a mapping entry");else if(e.lineIndent<l)break}return N&&ee(e,w,S,d,T,null,a,n,o),I&&(e.tag=u,e.anchor=b,e.kind="mapping",e.result=w),I}function Me(e){let l=!1,g=!1,x,a,n=e.input.charCodeAt(e.position);if(n!==33)return!1;e.tag!==null&&k(e,"duplication of a tag property"),n=e.input.charCodeAt(++e.position),n===60?(l=!0,n=e.input.charCodeAt(++e.position)):n===33?(g=!0,x="!!",n=e.input.charCodeAt(++e.position)):x="!";let o=e.position;if(l){do n=e.input.charCodeAt(++e.position);while(n!==0&&n!==62);e.position<e.length?(a=e.input.slice(o,e.position),n=e.input.charCodeAt(++e.position)):k(e,"unexpected end of the stream within a verbatim tag")}else{for(;n!==0&&!q(n);)n===33&&(g?k(e,"tag suffix cannot contain exclamation marks"):(x=e.input.slice(o-1,e.position+1),F.test(x)||k(e,"named tag handle cannot contain such characters"),g=!0,o=e.position+1)),n=e.input.charCodeAt(++e.position);a=e.input.slice(o,e.position),V.test(a)&&k(e,"tag suffix cannot contain flow indicator characters")}a&&!H.test(a)&&k(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{k(e,"tag name is malformed: "+a)}return l?e.tag=a:p.call(e.tagMap,x)?e.tag=e.tagMap[x]+a:x==="!"?e.tag="!"+a:x==="!!"?e.tag="tag:yaml.org,2002:"+a:k(e,'undeclared tag handle "'+x+'"'),!0}function Re(e){let l=e.input.charCodeAt(e.position);if(l!==38)return!1;e.anchor!==null&&k(e,"duplication of an anchor property"),l=e.input.charCodeAt(++e.position);const g=e.position;for(;l!==0&&!q(l)&&!z(l);)l=e.input.charCodeAt(++e.position);return e.position===g&&k(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(g,e.position),!0}function Pe(e){let l=e.input.charCodeAt(e.position);if(l!==42)return!1;l=e.input.charCodeAt(++e.position);const g=e.position;for(;l!==0&&!q(l)&&!z(l);)l=e.input.charCodeAt(++e.position);e.position===g&&k(e,"name of an alias node must contain at least one character");const x=e.input.slice(g,e.position);return p.call(e.anchorMap,x)||k(e,'unidentified alias "'+x+'"'),e.result=e.anchorMap[x],Y(e,!0,-1),!0}function je(e,l,g,x){const a=Ae(e);return De(e),he(e,l),e.tag=null,e.anchor=null,e.kind=null,e.result=null,ve(e,g,x)&&e.kind==="mapping"?(ce(e),!0):(Ye(e),he(e,a),!1)}function le(e,l,g,x,a){let n,o,u=1,b=!1,w=!1,S=null,d,T,E;e.depth>=e.maxDepth&&k(e,"nesting exceeded maxDepth ("+e.maxDepth+")"),e.depth+=1,e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null;const N=n=o=A===g||c===g;if(x&&Y(e,!0,-1)&&(b=!0,e.lineIndent>l?u=1:e.lineIndent===l?u=0:e.lineIndent<l&&(u=-1)),u===1)for(;;){const I=e.input.charCodeAt(e.position),v=Ae(e);if(b&&(I===33&&e.tag!==null||I===38&&e.anchor!==null)||!Me(e)&&!Re(e))break;S===null&&(S=v),Y(e,!0,-1)?(b=!0,o=N,e.lineIndent>l?u=1:e.lineIndent===l?u=0:e.lineIndent<l&&(u=-1)):o=!1}if(o&&(o=b||a),u===1||A===g)if(h===g||s===g?T=l:T=l+1,E=e.position-e.lineStart,u===1)if(o&&(_e(e,E)||ve(e,E,T))||Le(e,T))w=!0;else{const I=e.input.charCodeAt(e.position);S!==null&&N&&!o&&I!==124&&I!==62&&je(e,S,S.position-S.lineStart,T)||n&&re(e,T)||we(e,T)||Oe(e,T)?w=!0:Pe(e)?(w=!0,(e.tag!==null||e.anchor!==null)&&k(e,"alias node should not have any properties")):Ie(e,T,h===g)&&(w=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&J(e,e.anchor,e.result)}else u===0&&(w=o&&_e(e,E));if(e.tag===null)e.anchor!==null&&J(e,e.anchor,e.result);else if(e.tag==="?"){e.result!==null&&e.kind!=="scalar"&&k(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"');for(let I=0,v=e.implicitTypes.length;I<v;I+=1)if(d=e.implicitTypes[I],d.resolve(e.result)){e.result=d.construct(e.result),e.tag=d.tag,e.anchor!==null&&J(e,e.anchor,e.result);break}}else if(e.tag!=="!"){if(p.call(e.typeMap[e.kind||"fallback"],e.tag))d=e.typeMap[e.kind||"fallback"][e.tag];else{d=null;const I=e.typeMap.multi[e.kind||"fallback"];for(let v=0,M=I.length;v<M;v+=1)if(e.tag.slice(0,I[v].tag.length)===I[v].tag){d=I[v];break}}d||k(e,"unknown tag !<"+e.tag+">"),e.result!==null&&d.kind!==e.kind&&k(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result,e.tag)?(e.result=d.construct(e.result,e.tag),e.anchor!==null&&J(e,e.anchor,e.result)):k(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.depth-=1,e.tag!==null||e.anchor!==null||w}function Be(e){const l=e.position;let g=!1,x;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(x=e.input.charCodeAt(e.position))!==0&&(Y(e,!0,-1),x=e.input.charCodeAt(e.position),!(e.lineIndent>0||x!==37));){g=!0,x=e.input.charCodeAt(++e.position);let a=e.position;for(;x!==0&&!q(x);)x=e.input.charCodeAt(++e.position);const n=e.input.slice(a,e.position),o=[];for(n.length<1&&k(e,"directive name must not be less than one character in length");x!==0;){for(;D(x);)x=e.input.charCodeAt(++e.position);if(x===35){do x=e.input.charCodeAt(++e.position);while(x!==0&&!K(x));break}if(K(x))break;for(a=e.position;x!==0&&!q(x);)x=e.input.charCodeAt(++e.position);o.push(e.input.slice(a,e.position))}x!==0&&be(e),p.call(Ne,n)?Ne[n](e,n,o):de(e,'unknown document directive "'+n+'"')}if(Y(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,Y(e,!0,-1)):g&&k(e,"directives end mark is expected"),le(e,e.lineIndent-1,A,!1,!0),Y(e,!0,-1),e.checkLineBreaks&&R.test(e.input.slice(l,e.position))&&de(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Z(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,Y(e,!0,-1));return}e.position<e.length-1&&k(e,"end of the stream or a document separator is expected")}function Se(e,l){e=String(e),l=l||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
17
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));const g=new j(e,l),x=e.indexOf("\0");for(x!==-1&&(g.position=x,k(g,"null byte is not allowed in input")),g.input+="\0";g.input.charCodeAt(g.position)===32;)g.lineIndent+=1,g.position+=1;for(;g.position<g.length-1;)Be(g);return g.documents}function He(e,l,g){l!==null&&typeof l=="object"&&typeof g>"u"&&(g=l,l=null);const x=Se(e,g);if(typeof l!="function")return x;for(let a=0,n=x.length;a<n;a+=1)l(x[a])}function Ke(e,l){const g=Se(e,l);if(g.length!==0){if(g.length===1)return g[0];throw new i("expected a single document in the stream, but found more")}}return Fe.loadAll=He,Fe.load=Ke,Fe}var dn={},Yn;function Ai(){if(Yn)return dn;Yn=1;const t=ke(),i=Ee(),m=hn(),y=Object.prototype.toString,p=Object.prototype.hasOwnProperty,h=65279,s=9,c=10,A=13,r=32,f=33,C=34,L=35,R=37,V=38,F=39,H=42,X=44,K=45,D=58,q=61,z=62,se=63,fe=64,ae=91,ne=93,pe=96,_=123,P=124,$=125,j={};j[0]="\\0",j[7]="\\a",j[8]="\\b",j[9]="\\t",j[10]="\\n",j[11]="\\v",j[12]="\\f",j[13]="\\r",j[27]="\\e",j[34]='\\"',j[92]="\\\\",j[133]="\\N",j[160]="\\_",j[8232]="\\L",j[8233]="\\P";const B=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],k=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function de(n,o){if(o===null)return{};const u={},b=Object.keys(o);for(let w=0,S=b.length;w<S;w+=1){let d=b[w],T=String(o[d]);d.slice(0,2)==="!!"&&(d="tag:yaml.org,2002:"+d.slice(2));const E=n.compiledTypeMap.fallback[d];E&&p.call(E.styleAliases,T)&&(T=E.styleAliases[T]),u[d]=T}return u}function J(n){let o,u;const b=n.toString(16).toUpperCase();if(n<=255)o="x",u=2;else if(n<=65535)o="u",u=4;else if(n<=4294967295)o="U",u=8;else throw new i("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+o+t.repeat("0",u-b.length)+b}const De=1,ce=2;function Ye(n){this.schema=n.schema||m,this.indent=Math.max(1,n.indent||2),this.noArrayIndent=n.noArrayIndent||!1,this.skipInvalid=n.skipInvalid||!1,this.flowLevel=t.isNothing(n.flowLevel)?-1:n.flowLevel,this.styleMap=de(this.schema,n.styles||null),this.sortKeys=n.sortKeys||!1,this.lineWidth=n.lineWidth||80,this.noRefs=n.noRefs||!1,this.noCompatMode=n.noCompatMode||!1,this.condenseFlow=n.condenseFlow||!1,this.quotingType=n.quotingType==='"'?ce:De,this.forceQuotes=n.forceQuotes||!1,this.replacer=typeof n.replacer=="function"?n.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Ae(n,o){const u=t.repeat(" ",o);let b=0,w="";const S=n.length;for(;b<S;){let d;const T=n.indexOf(`
|
|
18
18
|
`,b);T===-1?(d=n.slice(b),b=S):(d=n.slice(b,T+1),b=T+1),d.length&&d!==`
|
|
19
19
|
`&&(w+=u),w+=d}return w}function he(n,o){return`
|
|
20
|
-
`+t.repeat(" ",n.indent*o)}function Ne(n,o){for(let u=0,b=n.implicitTypes.length;u<b;u+=1)if(n.implicitTypes[u].resolve(o))return!0;return!1}function W(n){return n===r||n===s}function ie(n){return n>=32&&n<=126||n>=161&&n<=55295&&n!==8232&&n!==8233||n>=57344&&n<=65533&&n!==h||n>=65536&&n<=1114111}function ye(n){return ie(n)&&n!==h&&n!==A&&n!==c}function ee(n,o,u){const b=ye(n),w=b&&!W(n);return(u?b:b&&n!==X&&n!==ae&&n!==ne&&n!==
|
|
20
|
+
`+t.repeat(" ",n.indent*o)}function Ne(n,o){for(let u=0,b=n.implicitTypes.length;u<b;u+=1)if(n.implicitTypes[u].resolve(o))return!0;return!1}function W(n){return n===r||n===s}function ie(n){return n>=32&&n<=126||n>=161&&n<=55295&&n!==8232&&n!==8233||n>=57344&&n<=65533&&n!==h||n>=65536&&n<=1114111}function ye(n){return ie(n)&&n!==h&&n!==A&&n!==c}function ee(n,o,u){const b=ye(n),w=b&&!W(n);return(u?b:b&&n!==X&&n!==ae&&n!==ne&&n!==_&&n!==$)&&n!==L&&!(o===D&&!w)||ye(o)&&!W(o)&&n===L||o===D&&w}function be(n){return ie(n)&&n!==h&&!W(n)&&n!==K&&n!==se&&n!==D&&n!==X&&n!==ae&&n!==ne&&n!==_&&n!==$&&n!==L&&n!==V&&n!==H&&n!==f&&n!==P&&n!==q&&n!==z&&n!==F&&n!==C&&n!==R&&n!==fe&&n!==pe}function Y(n){return!W(n)&&n!==D}function Z(n,o){const u=n.charCodeAt(o);let b;return u>=55296&&u<=56319&&o+1<n.length&&(b=n.charCodeAt(o+1),b>=56320&&b<=57343)?(u-55296)*1024+b-56320+65536:u}function me(n){return/^\n* /.test(n)}const Ie=1,we=2,Oe=3,Le=4,re=5;function _e(n,o,u,b,w,S,d,T){let E,N=0,I=null,v=!1,M=!1;const oe=b!==-1;let Ce=-1,Te=be(Z(n,0))&&Y(Z(n,n.length-1));if(o||d)for(E=0;E<n.length;N>=65536?E+=2:E++){if(N=Z(n,E),!ie(N))return re;Te=Te&&ee(N,I,T),I=N}else{for(E=0;E<n.length;N>=65536?E+=2:E++){if(N=Z(n,E),N===c)v=!0,oe&&(M=M||E-Ce-1>b&&n[Ce+1]!==" ",Ce=E);else if(!ie(N))return re;Te=Te&&ee(N,I,T),I=N}M=M||oe&&E-Ce-1>b&&n[Ce+1]!==" "}return!v&&!M?Te&&!d&&!w(n)?Ie:S===ce?re:we:u>9&&me(n)?re:d?S===ce?re:we:M?Le:Oe}function ve(n,o,u,b,w){n.dump=(function(){if(o.length===0)return n.quotingType===ce?'""':"''";if(!n.noCompatMode&&(B.indexOf(o)!==-1||k.test(o)))return n.quotingType===ce?'"'+o+'"':"'"+o+"'";const S=n.indent*Math.max(1,u),d=n.lineWidth===-1?-1:Math.max(Math.min(n.lineWidth,40),n.lineWidth-S),T=b||n.flowLevel>-1&&u>=n.flowLevel;function E(N){return Ne(n,N)}switch(_e(o,T,n.indent,d,E,n.quotingType,n.forceQuotes&&!b,w)){case Ie:return o;case we:return"'"+o.replace(/'/g,"''")+"'";case Oe:return"|"+Me(o,n.indent)+Re(Ae(o,S));case Le:return">"+Me(o,n.indent)+Re(Ae(Pe(o,d),S));case re:return'"'+le(o)+'"';default:throw new i("impossible error: invalid scalar style")}})()}function Me(n,o){const u=me(n)?String(o):"",b=n[n.length-1]===`
|
|
21
21
|
`,S=b&&(n[n.length-2]===`
|
|
22
22
|
`||n===`
|
|
23
23
|
`)?"+":b?"":"-";return u+S+`
|
|
@@ -29,7 +29,7 @@ import{c as qe,j as O,r as ge}from"./vendor-react-gGw_S5I_.js";import{cX as si,c
|
|
|
29
29
|
`+n.slice(w,S),w=S+1),d=T;return E+=`
|
|
30
30
|
`,n.length-w>o&&d>w?E+=n.slice(w,d)+`
|
|
31
31
|
`+n.slice(d+1):E+=n.slice(w),E.slice(1)}function le(n){let o="",u=0;for(let b=0;b<n.length;u>=65536?b+=2:b++){u=Z(n,b);const w=j[u];!w&&ie(u)?(o+=n[b],u>=65536&&(o+=n[b+1])):o+=w||J(u)}return o}function Be(n,o,u){let b="";const w=n.tag;for(let S=0,d=u.length;S<d;S+=1){let T=u[S];n.replacer&&(T=n.replacer.call(u,String(S),T)),(l(n,o,T,!1,!1)||typeof T>"u"&&l(n,o,null,!1,!1))&&(b!==""&&(b+=","+(n.condenseFlow?"":" ")),b+=n.dump)}n.tag=w,n.dump="["+b+"]"}function Se(n,o,u,b){let w="";const S=n.tag;for(let d=0,T=u.length;d<T;d+=1){let E=u[d];n.replacer&&(E=n.replacer.call(u,String(d),E)),(l(n,o+1,E,!0,!0,!1,!0)||typeof E>"u"&&l(n,o+1,null,!0,!0,!1,!0))&&((!b||w!=="")&&(w+=he(n,o)),n.dump&&c===n.dump.charCodeAt(0)?w+="-":w+="- ",w+=n.dump)}n.tag=S,n.dump=w||"[]"}function He(n,o,u){let b="";const w=n.tag,S=Object.keys(u);for(let d=0,T=S.length;d<T;d+=1){let E="";b!==""&&(E+=", "),n.condenseFlow&&(E+='"');const N=S[d];let I=u[N];n.replacer&&(I=n.replacer.call(u,N,I)),l(n,o,N,!1,!1)&&(n.dump.length>1024&&(E+="? "),E+=n.dump+(n.condenseFlow?'"':"")+":"+(n.condenseFlow?"":" "),l(n,o,I,!1,!1)&&(E+=n.dump,b+=E))}n.tag=w,n.dump="{"+b+"}"}function Ke(n,o,u,b){let w="";const S=n.tag,d=Object.keys(u);if(n.sortKeys===!0)d.sort();else if(typeof n.sortKeys=="function")d.sort(n.sortKeys);else if(n.sortKeys)throw new i("sortKeys must be a boolean or a function");for(let T=0,E=d.length;T<E;T+=1){let N="";(!b||w!=="")&&(N+=he(n,o));const I=d[T];let v=u[I];if(n.replacer&&(v=n.replacer.call(u,I,v)),!l(n,o+1,I,!0,!0,!0))continue;const M=n.tag!==null&&n.tag!=="?"||n.dump&&n.dump.length>1024;M&&(n.dump&&c===n.dump.charCodeAt(0)?N+="?":N+="? "),N+=n.dump,M&&(N+=he(n,o)),l(n,o+1,v,!0,M)&&(n.dump&&c===n.dump.charCodeAt(0)?N+=":":N+=": ",N+=n.dump,w+=N)}n.tag=S,n.dump=w||"{}"}function e(n,o,u){const b=u?n.explicitTypes:n.implicitTypes;for(let w=0,S=b.length;w<S;w+=1){const d=b[w];if((d.instanceOf||d.predicate)&&(!d.instanceOf||typeof o=="object"&&o instanceof d.instanceOf)&&(!d.predicate||d.predicate(o))){if(u?d.multi&&d.representName?n.tag=d.representName(o):n.tag=d.tag:n.tag="?",d.represent){const T=n.styleMap[d.tag]||d.defaultStyle;let E;if(y.call(d.represent)==="[object Function]")E=d.represent(o,T);else if(p.call(d.represent,T))E=d.represent[T](o,T);else throw new i("!<"+d.tag+'> tag resolver accepts not "'+T+'" style');n.dump=E}return!0}}return!1}function l(n,o,u,b,w,S,d){n.tag=null,n.dump=u,e(n,u,!1)||e(n,u,!0);const T=y.call(n.dump),E=b;b&&(b=n.flowLevel<0||n.flowLevel>o);const N=T==="[object Object]"||T==="[object Array]";let I,v;if(N&&(I=n.duplicates.indexOf(u),v=I!==-1),(n.tag!==null&&n.tag!=="?"||v||n.indent!==2&&o>0)&&(w=!1),v&&n.usedDuplicates[I])n.dump="*ref_"+I;else{if(N&&v&&!n.usedDuplicates[I]&&(n.usedDuplicates[I]=!0),T==="[object Object]")b&&Object.keys(n.dump).length!==0?(Ke(n,o,n.dump,w),v&&(n.dump="&ref_"+I+n.dump)):(He(n,o,n.dump),v&&(n.dump="&ref_"+I+" "+n.dump));else if(T==="[object Array]")b&&n.dump.length!==0?(n.noArrayIndent&&!d&&o>0?Se(n,o-1,n.dump,w):Se(n,o,n.dump,w),v&&(n.dump="&ref_"+I+n.dump)):(Be(n,o,n.dump),v&&(n.dump="&ref_"+I+" "+n.dump));else if(T==="[object String]")n.tag!=="?"&&ve(n,n.dump,o,S,E);else{if(T==="[object Undefined]")return!1;if(n.skipInvalid)return!1;throw new i("unacceptable kind of an object to dump "+T)}if(n.tag!==null&&n.tag!=="?"){let M=encodeURI(n.tag[0]==="!"?n.tag.slice(1):n.tag).replace(/!/g,"%21");n.tag[0]==="!"?M="!"+M:M.slice(0,18)==="tag:yaml.org,2002:"?M="!!"+M.slice(18):M="!<"+M+">",n.dump=M+" "+n.dump}}return!0}function g(n,o){const u=[],b=[];x(n,u,b);const w=b.length;for(let S=0;S<w;S+=1)o.duplicates.push(u[b[S]]);o.usedDuplicates=new Array(w)}function x(n,o,u){if(n!==null&&typeof n=="object"){const b=o.indexOf(n);if(b!==-1)u.indexOf(b)===-1&&u.push(b);else if(o.push(n),Array.isArray(n))for(let w=0,S=n.length;w<S;w+=1)x(n[w],o,u);else{const w=Object.keys(n);for(let S=0,d=w.length;S<d;S+=1)x(n[w[S]],o,u)}}}function a(n,o){o=o||{};const u=new Ye(o);u.noRefs||g(n,u);let b=n;return u.replacer&&(b=u.replacer.call({"":b},"",b)),l(u,0,b,!0,!0)?u.dump+`
|
|
32
|
-
`:""}return dn.dump=a,dn}var Pn;function yi(){if(Pn)return U;Pn=1;const t=xi(),i=Ai();function m(y,p){return function(){throw new Error("Function yaml."+y+" is removed in js-yaml 4. Use yaml."+p+" instead, which is now safe by default.")}}return U.Type=G(),U.Schema=Un(),U.FAILSAFE_SCHEMA=Qn(),U.JSON_SCHEMA=Jn(),U.CORE_SCHEMA=ei(),U.DEFAULT_SCHEMA=hn(),U.load=t.load,U.loadAll=t.loadAll,U.dump=i.dump,U.YAMLException=Ee(),U.types={binary:ri(),float:Zn(),map:Wn(),null:zn(),pairs:oi(),set:ti(),timestamp:ni(),bool:Vn(),int:Xn(),merge:ii(),omap:li(),seq:Gn(),str:$n()},U.safeLoad=m("safeLoad","load"),U.safeLoadAll=m("safeLoadAll","loadAll"),U.safeDump=m("safeDump","dump"),U}var bi=yi();const wi=mi(bi),{Type:Ki,Schema:Ui,FAILSAFE_SCHEMA:$i,JSON_SCHEMA:Gi,CORE_SCHEMA:Wi,DEFAULT_SCHEMA:Qi,load:Si,loadAll:zi,dump:Vi,YAMLException:Xi,types:Zi,safeLoad:Ji,safeLoadAll:er,safeDump:nr}=wi,ue=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function Q(t){return typeof t=="string"?t.trim()||null:typeof t=="number"||typeof t=="boolean"?String(t):null}function Bn(t){const i=typeof t=="string"?Number(t):t;return typeof i=="number"&&Number.isFinite(i)&&i>=0?i:null}function ci(t,i){if(Array.isArray(t))return t;if(!ue(t))return null;for(const m of i)if(Array.isArray(t[m]))return t[m];return null}function mn(t){const i=ue(t)?Q(t.title):null;return i?{title:i}:{}}const Ci=new Set(["warning","danger","success"]);function Ti(t){if(!ue(t))return null;const i=ue(t.progress)?t.progress:null,m=Bn(i==null?void 0:i.done),y=Bn(i==null?void 0:i.total),p=(Array.isArray(t.values)?t.values:[]).flatMap(s=>{if(!ue(s))return[];const c=Q(s.label),A=Q(s.value);if(!c||A===null)return[];const r=Q(s.tone);return[{label:c,value:A,...r&&Ci.has(r)&&{tone:r}}]}),h={kind:"status",...mn(t),...m!==null&&y!==null&&y>0&&{progress:{done:Math.min(m,y),total:y}},values:p};return h.progress||p.length>0?h:null}function ki(t){const i=ci(t,["decisions","items"]);if(!i)return null;const m=i.flatMap((y,p)=>{if(!ue(y))return[];const h=Q(y.question),s=(Array.isArray(y.options)?y.options:[]).map(Q).filter(r=>!!r);if(!h||s.length===0)return[];const c=Q(y.recommended),A=Q(y.detail);return[{id:Q(y.id)??String(p+1),question:h,options:s,...c&&s.includes(c)&&{recommended:c},...A&&{detail:A}}]});return new Set(m.map(y=>y.id)).size!==m.length?null:m.length>0?{kind:"decisions",...mn(t),decisions:m}:null}const Ei=new Set(["todo","doing","done","blocked","skipped"]);function Ni(t){const i=ci(t,["items"]);if(!i)return null;const m=i.flatMap(y=>{const p=Q(y);if(p)return[{text:p,state:"todo"}];if(!ue(y))return[];const h=Q(y.text);if(!h)return[];const s=Q(y.state),c=Q(y.note);return[{text:h,state:s&&Ei.has(s)?s:"todo",...c&&{note:c}}]});return m.length>0?{kind:"checklist",...mn(t),items:m}:null}const Ii={status:Ti,decisions:ki,checklist:Ni};function Oi(t,i){let m;try{m=Si(i)}catch{return null}return Ii[t](m)}function
|
|
33
|
-
`)}function ir(t){const i=qe.c(13),{kind:m,source:y,occurrence:p,fallback:h}=t,s=p===void 0?"0":p;let c;i[0]!==m||i[1]!==y?(c=Oi(m,y),i[0]=m,i[1]=y,i[2]=c):c=i[2];const A=c;if(!A){let r;return i[3]!==h?(r=O.jsx(O.Fragment,{children:h}),i[3]=h,i[4]=r):r=i[4],r}switch(A.kind){case"status":{let r;return i[5]!==A?(r=O.jsx(
|
|
32
|
+
`:""}return dn.dump=a,dn}var Pn;function yi(){if(Pn)return U;Pn=1;const t=xi(),i=Ai();function m(y,p){return function(){throw new Error("Function yaml."+y+" is removed in js-yaml 4. Use yaml."+p+" instead, which is now safe by default.")}}return U.Type=G(),U.Schema=Un(),U.FAILSAFE_SCHEMA=Qn(),U.JSON_SCHEMA=Jn(),U.CORE_SCHEMA=ei(),U.DEFAULT_SCHEMA=hn(),U.load=t.load,U.loadAll=t.loadAll,U.dump=i.dump,U.YAMLException=Ee(),U.types={binary:ri(),float:Zn(),map:Wn(),null:zn(),pairs:oi(),set:ti(),timestamp:ni(),bool:Vn(),int:Xn(),merge:ii(),omap:li(),seq:Gn(),str:$n()},U.safeLoad=m("safeLoad","load"),U.safeLoadAll=m("safeLoadAll","loadAll"),U.safeDump=m("safeDump","dump"),U}var bi=yi();const wi=mi(bi),{Type:Ki,Schema:Ui,FAILSAFE_SCHEMA:$i,JSON_SCHEMA:Gi,CORE_SCHEMA:Wi,DEFAULT_SCHEMA:Qi,load:Si,loadAll:zi,dump:Vi,YAMLException:Xi,types:Zi,safeLoad:Ji,safeLoadAll:er,safeDump:nr}=wi,ue=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function Q(t){return typeof t=="string"?t.trim()||null:typeof t=="number"||typeof t=="boolean"?String(t):null}function Bn(t){const i=typeof t=="string"?Number(t):t;return typeof i=="number"&&Number.isFinite(i)&&i>=0?i:null}function ci(t,i){if(Array.isArray(t))return t;if(!ue(t))return null;for(const m of i)if(Array.isArray(t[m]))return t[m];return null}function mn(t){const i=ue(t)?Q(t.title):null;return i?{title:i}:{}}const Ci=new Set(["warning","danger","success"]);function Ti(t){if(!ue(t))return null;const i=ue(t.progress)?t.progress:null,m=Bn(i==null?void 0:i.done),y=Bn(i==null?void 0:i.total),p=(Array.isArray(t.values)?t.values:[]).flatMap(s=>{if(!ue(s))return[];const c=Q(s.label),A=Q(s.value);if(!c||A===null)return[];const r=Q(s.tone);return[{label:c,value:A,...r&&Ci.has(r)&&{tone:r}}]}),h={kind:"status",...mn(t),...m!==null&&y!==null&&y>0&&{progress:{done:Math.min(m,y),total:y}},values:p};return h.progress||p.length>0?h:null}function ki(t){const i=ci(t,["decisions","items"]);if(!i)return null;const m=i.flatMap((y,p)=>{if(!ue(y))return[];const h=Q(y.question),s=(Array.isArray(y.options)?y.options:[]).map(Q).filter(r=>!!r);if(!h||s.length===0)return[];const c=Q(y.recommended),A=Q(y.detail);return[{id:Q(y.id)??String(p+1),question:h,options:s,...c&&s.includes(c)&&{recommended:c},...A&&{detail:A}}]});return new Set(m.map(y=>y.id)).size!==m.length?null:m.length>0?{kind:"decisions",...mn(t),decisions:m}:null}const Ei=new Set(["todo","doing","done","blocked","skipped"]);function Ni(t){const i=ci(t,["items"]);if(!i)return null;const m=i.flatMap(y=>{const p=Q(y);if(p)return[{text:p,state:"todo"}];if(!ue(y))return[];const h=Q(y.text);if(!h)return[];const s=Q(y.state),c=Q(y.note);return[{text:h,state:s&&Ei.has(s)?s:"todo",...c&&{note:c}}]});return m.length>0?{kind:"checklist",...mn(t),items:m}:null}const Ii={status:Ti,decisions:ki,checklist:Ni};function Oi(t,i){let m;try{m=Si(i)}catch{return null}return Ii[t](m)}function Li(t,i){return["Decisions:",...t.filter(y=>i[y.id]).map(y=>`- ${y.id}: ${y.question} ${i[y.id]}`)].join(`
|
|
33
|
+
`)}function ir(t){const i=qe.c(13),{kind:m,source:y,occurrence:p,fallback:h}=t,s=p===void 0?"0":p;let c;i[0]!==m||i[1]!==y?(c=Oi(m,y),i[0]=m,i[1]=y,i[2]=c):c=i[2];const A=c;if(!A){let r;return i[3]!==h?(r=O.jsx(O.Fragment,{children:h}),i[3]=h,i[4]=r):r=i[4],r}switch(A.kind){case"status":{let r;return i[5]!==A?(r=O.jsx(_i,{block:A}),i[5]=A,i[6]=r):r=i[6],r}case"checklist":{let r;return i[7]!==A?(r=O.jsx(Ri,{block:A}),i[7]=A,i[8]=r):r=i[8],r}case"decisions":{let r;return i[9]!==A||i[10]!==s||i[11]!==y?(r=O.jsx(Di,{block:A,source:y,occurrence:s}),i[9]=A,i[10]=s,i[11]=y,i[12]=r):r=i[12],r}}}function ui(t){const i=qe.c(3),{label:m,children:y}=t;let p;return i[0]!==y||i[1]!==m?(p=O.jsx("section",{"aria-label":m,"data-cogpit-block":!0,className:"my-3 rounded-lg border border-border bg-card p-3 text-sm",children:y}),i[0]=y,i[1]=m,i[2]=p):p=i[2],p}const Hn={warning:"text-warning",danger:"text-destructive",success:"text-success"};function _i(t){const i=qe.c(14),{block:m}=t,{progress:y}=m;let p;i[0]!==y?(p=y?Math.round(y.done/y.total*100):null,i[0]=y,i[1]=p):p=i[1];const h=p,s=m.title??"Status";let c;i[2]!==m.title?(c=m.title&&O.jsx("h4",{className:"mb-2 text-[13.5px] font-medium",children:m.title}),i[2]=m.title,i[3]=c):c=i[3];let A;i[4]!==h||i[5]!==y?(A=y&&O.jsxs("div",{className:"mb-2.5",children:[O.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":y.total,"aria-valuenow":y.done,"aria-label":`${y.done} of ${y.total} done`,className:"h-1.5 overflow-hidden rounded-full bg-muted",children:O.jsx("div",{className:"h-full rounded-full bg-foreground",style:{width:`${h}%`}})}),O.jsxs("div",{className:"mt-1.5 flex justify-between text-xs tabular-nums text-muted-foreground",children:[O.jsxs("span",{children:[y.done," of ",y.total," done"]}),O.jsxs("span",{children:[h,"%"]})]})]}),i[4]=h,i[5]=y,i[6]=A):A=i[6];let r;i[7]!==m.values?(r=m.values.length>0&&O.jsx("dl",{className:"grid grid-cols-1 gap-x-5 sm:grid-cols-2",children:m.values.map(vi)}),i[7]=m.values,i[8]=r):r=i[8];let f;return i[9]!==s||i[10]!==c||i[11]!==A||i[12]!==r?(f=O.jsxs(ui,{label:s,children:[c,A,r]}),i[9]=s,i[10]=c,i[11]=A,i[12]=r,i[13]=f):f=i[13],f}function vi(t){return O.jsxs("div",{className:"flex justify-between gap-3 border-t border-border/70 py-1.5 text-[12.5px]",children:[O.jsx("dt",{className:xe("text-muted-foreground",t.tone&&Hn[t.tone]),children:t.label}),O.jsx("dd",{className:xe("text-right tabular-nums",t.tone&&Hn[t.tone]),children:t.value})]},t.label)}const Mi={done:{mark:O.jsx(Kn,{className:"size-2.5"}),ring:"border-success text-success",text:"text-muted-foreground line-through decoration-muted-foreground/50",label:"Done"},doing:{mark:null,ring:"border-success bg-success/25",text:"",label:"In progress"},blocked:{mark:O.jsx(hi,{className:"size-2.5"}),ring:"border-warning text-warning",text:"text-warning",label:"Blocked"},skipped:{mark:null,ring:"border-dashed border-muted-foreground/60",text:"text-muted-foreground line-through",label:"Skipped"},todo:{mark:null,ring:"border-muted-foreground/60",text:"",label:"To do"}};function Ri(t){const i=qe.c(18),{block:m}=t;let y;i[0]!==m.items?(y=m.items.filter(Fi),i[0]=m.items,i[1]=y):y=i[1];const p=y.length,h=m.title??"Checklist";let s;i[2]!==m.title?(s=m.title&&O.jsx("h4",{className:"text-[13.5px] font-medium",children:m.title}),i[2]=m.title,i[3]=s):s=i[3];let c;i[4]!==m.items.length||i[5]!==p?(c=O.jsxs("span",{className:"text-xs tabular-nums text-muted-foreground",children:[p," of ",m.items.length]}),i[4]=m.items.length,i[5]=p,i[6]=c):c=i[6];let A;i[7]!==s||i[8]!==c?(A=O.jsxs("div",{className:"mb-1.5 flex items-baseline gap-2",children:[s,c]}),i[7]=s,i[8]=c,i[9]=A):A=i[9];let r;i[10]!==m.items?(r=m.items.map(ji),i[10]=m.items,i[11]=r):r=i[11];let f;i[12]!==r?(f=O.jsx("ul",{className:"flex flex-col",children:r}),i[12]=r,i[13]=f):f=i[13];let C;return i[14]!==h||i[15]!==A||i[16]!==f?(C=O.jsxs(ui,{label:h,children:[A,f]}),i[14]=h,i[15]=A,i[16]=f,i[17]=C):C=i[17],C}function ji(t,i){const m=Mi[t.state];return O.jsxs("li",{className:"flex items-center gap-2.5 py-1 text-[13px]",children:[O.jsx("span",{className:xe("grid size-3.5 shrink-0 place-items-center rounded-full border-[1.5px]",m.ring),"aria-label":m.label,role:"img",children:m.mark}),O.jsx("span",{className:xe("min-w-0 flex-1",m.text),children:t.text}),t.note&&O.jsx("span",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground",children:t.note})]},`${i}:${t.text}`)}function Fi(t){return t.state==="done"}function qi(t){let i=5381;for(let m=0;m<t.length;m++)i=(i<<5)+i+t.charCodeAt(m)|0;return(i>>>0).toString(36)}function Di({block:t,source:i,occurrence:m}){var pe;const y=si(),p=fi(),h=ge.useContext(ai),s=((pe=y==null?void 0:y.session)==null?void 0:pe.sessionId)??"none",[c,A]=pi(di(`cogpit-decisions:${s}:${qi(`${(h==null?void 0:h.messageKey)??""}
|
|
34
34
|
${m}
|
|
35
|
-
${i}`)}`),{answers:{},sentAt:null}),r=c??{answers:{},sentAt:null},[f,C]=ge.useState(0),[
|
|
35
|
+
${i}`)}`),{answers:{},sentAt:null}),r=c??{answers:{},sentAt:null},[f,C]=ge.useState(0),[L,R]=ge.useState(new Set),[V,F]=ge.useState(!1),H=ge.useRef(!1),[X,K]=ge.useState(null),D=!!p&&(y==null?void 0:y.permissions.send)!==!1&&r.sentAt===null&&!V,q=t.decisions.filter(_=>r.answers[_.id]).length,z=(_,P)=>{if(!D||H.current)return;A({...r,answers:{...r.answers,[_]:P}}),R(j=>{const B=new Set(j);return B.delete(_),B});const $=t.decisions.findIndex((j,B)=>B>f&&!r.answers[j.id]&&j.id!==_);$>=0&&C($)},se=async()=>{if(!p||!D||q===0||H.current)return;H.current=!0,F(!0),K(null);const _=await p.chat.sendMessage(Li(t.decisions,r.answers)).catch(()=>!1);H.current=!1,F(!1),_?A({...r,sentAt:Date.now()}):K("Couldn't send the answers. Try again from the composer if this keeps happening.")},fe=_=>P=>{P.stopPropagation(),_()},ae=_=>{const P=t.decisions[f];P&&((_.metaKey||_.ctrlKey)&&_.key==="Enter"?(_.preventDefault(),se()):_.key==="ArrowDown"||_.key==="ArrowUp"?(_.preventDefault(),C($=>Math.max(0,Math.min(t.decisions.length-1,$+(_.key==="ArrowDown"?1:-1))))):_.key==="Enter"&&P.recommended&&_.target===_.currentTarget?(_.preventDefault(),z(P.id,P.recommended)):/^[1-9]$/.test(_.key)&&P.options[Number(_.key)-1]&&(_.preventDefault(),z(P.id,P.options[Number(_.key)-1])))},ne=t.title??`${t.decisions.length} ${t.decisions.length===1?"decision":"decisions"}`;return O.jsxs("section",{"aria-label":ne,"data-cogpit-block":!0,tabIndex:0,onKeyDown:ae,className:"my-3 rounded-lg border border-border bg-card p-3 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[O.jsxs("div",{className:"mb-1 flex flex-wrap items-baseline gap-x-2.5",children:[O.jsx("h4",{className:"text-[13.5px] font-medium",children:ne}),O.jsx("span",{className:"text-xs text-muted-foreground",children:r.sentAt?"Sent":"Answer in any order; your answers go back as one message."})]}),O.jsx("ol",{className:"flex flex-col",children:t.decisions.map((_,P)=>{const $=r.answers[_.id],j=!$||L.has(_.id);return O.jsxs("li",{"data-decision":_.id,onClick:()=>C(P),className:xe("grid grid-cols-[18px_minmax(0,1fr)] gap-x-2.5 gap-y-1 border-t border-border/70 py-2.5 first:border-t-0",P===f&&D&&"rounded-md bg-accent/40"),children:[O.jsx("span",{className:"pt-px text-right text-[11px] tabular-nums text-muted-foreground/80",children:P+1}),O.jsx("span",{className:xe("text-[13px]",j?"font-medium":"text-muted-foreground"),children:_.question}),_.detail&&j&&O.jsx("span",{className:"col-start-2 text-xs text-muted-foreground",children:_.detail}),j?O.jsx("span",{className:"col-start-2 mt-1 flex flex-wrap items-center gap-1.5",children:_.options.map((B,k)=>O.jsxs(Ue,{type:"button",size:"xs",variant:$===B?"default":"outline","aria-pressed":$===B,"aria-keyshortcuts":k<9?String(k+1):void 0,disabled:!D,onClick:fe(()=>z(_.id,B)),children:[B,B===_.recommended&&O.jsx("span",{className:"font-normal opacity-60",children:"recommended"})]},B))}):O.jsxs("span",{className:"col-start-2 flex items-center gap-2 text-[12.5px] text-success",children:[O.jsx(Kn,{className:"size-3.5","aria-hidden":"true"}),$,D&&O.jsx(Ue,{type:"button",variant:"ghost",size:"xs",className:"text-muted-foreground",onClick:fe(()=>{R(B=>new Set(B).add(_.id)),C(P)}),children:"Change"})]})]},_.id)})}),X&&O.jsx("p",{role:"alert",className:"mt-2 text-xs text-destructive",children:X}),r.sentAt===null&&O.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 border-t border-border/70 pt-2.5 text-xs text-muted-foreground",children:[O.jsxs("span",{className:"tabular-nums",children:[q," of ",t.decisions.length," answered"]}),O.jsx("span",{className:"flex-1"}),D&&O.jsx("span",{className:"hidden sm:inline",children:"1–9 picks · Enter takes the recommended · ⌘Enter sends"}),O.jsx(Ue,{type:"button",size:"xs",disabled:!D||q===0||V,onClick:()=>void se(),children:q===t.decisions.length?"Send answers":`Send ${q} ${q===1?"answer":"answers"}`})]})]})}export{ir as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as p,j as u,r as U}from"./vendor-react-gGw_S5I_.js";import{bb as w,bc as ae,x as he,bd as ue,be as fe,bf as we,bg as ve,bh as Ce,bi as be,bj as Se,bk as je,bl as Te,bm as ke,bn as ye,bo as Fe,W as Pe,bp as xe,bq as Oe,aH as se,aY as Q,br as Ne,a$ as Re,bs as Ae,bt as Ie,bu as Ee,bv as $e,bw as De,F as Be}from"./index-BYVl1VlW.js";import{bl as We,di as Me,bU as ie,ao as He,cX as Le,cS as _e,bo as Ue,cm as Ge,ba as le,cy as Ke,cJ as qe,aF as ze,c2 as Xe,a9 as Je,dj as Ve,cv as Ye,bQ as Qe,c8 as ce,dk as Ze,dl as pe,cA as et,cY as tt,dm as nt,aJ as ot,a3 as at,aX as re,cp as st,c3 as it,cC as lt,ae as ct,cD as rt,cB as dt}from"./vendor-ui-B0az9ATE.js";import"./vendor-markdown-BEJ8yVzA.js";function o(t,e,a,l,i,r,h){return{id:t,label:e,icon:l,run:i,shortcut:r,description:h,value:`${e} ${a}`}}function X(...t){return t.filter(e=>e!==!1&&e!==void 0)}function Z(t,e,a,l,i){const r=o(t,e,a,l,i);return{...r,value:`Help ${r.value}`}}function mt(t){const e=p.c(94);let a;e[0]!==t.canFocusComposer||e[1]!==t.extraActions||e[2]!==t.onDuplicateSession||e[3]!==t.onFindInConversation||e[4]!==t.onFocusComposer||e[5]!==t.onGoHome||e[6]!==t.onNewSession||e[7]!==t.onToggleMissionControl||e[8]!==t.showMission?(a=X(o("home","Go to Mission Control","home overview dashboard",_e,t.onGoHome),o("mission-control",t.showMission?"Exit Mission Control":"Open Mission Control","live sessions blocked waiting answer everything at once",Le,t.onToggleMissionControl,w("missionControl")),...(t.extraActions??[]).map(ut),o("new-session","Start a new session","project agent chat create",We,t.onNewSession,w("newSession")),t.onDuplicateSession&&o("duplicate-session","Duplicate this session","copy fork clone branch thread",Me,t.onDuplicateSession),t.canFocusComposer&&o("focus-composer","Focus message composer","chat prompt input",ie,t.onFocusComposer,w("focusComposer")),t.onFindInConversation&&o("find-in-conversation","Find in conversation","search text transcript turns matches",He,t.onFindInConversation,w("findInConversation"))),e[0]=t.canFocusComposer,e[1]=t.extraActions,e[2]=t.onDuplicateSession,e[3]=t.onFindInConversation,e[4]=t.onFocusComposer,e[5]=t.onGoHome,e[6]=t.onNewSession,e[7]=t.onToggleMissionControl,e[8]=t.showMission,e[9]=a):a=e[9];const l=a;let i;e[10]!==t?(i=(t.projects??[]).slice(0,8).map(n=>o(`project-${n.dirName}`,n.shortName,`${n.path} ${n.dirName} project workspace`,Ue,()=>{var c;return(c=t.onOpenProject)==null?void 0:c.call(t,n.dirName)},void 0,`${n.path} · ${n.sessionCount} session${n.sessionCount===1?"":"s"}`)),e[10]=t,e[11]=i):i=e[11];const r=i;let h;e[12]!==t?(h=(t.recentSessions??[]).slice(0,10).map(n=>{const N=(n.aiTitle||n.name||n.slug||n.lastUserMessage||n.firstUserMessage||n.sessionId).replace(/\s+/g," ").trim().slice(0,160)||n.sessionId,P=[n.projectShortName,n.gitBranch].filter(Boolean).join(" · ");return o(`session-${n.dirName}-${n.fileName}`,N,`${n.projectShortName} ${n.cwd??""} ${n.gitBranch??""} ${n.sessionId} recent thread conversation`,ie,()=>{var $;return($=t.onOpenSession)==null?void 0:$.call(t,n.dirName,n.fileName)},void 0,P)}),e[12]=t,e[13]=h):h=e[13];const f=h;let g;if(e[14]!==t){const n=t.devices??[];g=n.length>1&&t.onSwitchDevice?n.slice(0,ae.length).map((c,N)=>o(`device-${c.id}`,c.isActive?`${c.name} (current)`:`Switch to ${c.name}`,`device machine host remote ${c.id}`,c.isLocal?Ge:le,()=>{var P;return(P=t.onSwitchDevice)==null?void 0:P.call(t,c.id)},w(ae[N]))):[],e[14]=t,e[15]=g}else g=e[15];const d=g;let m;if(e[16]!==t.canOpenTerminal||e[17]!==t.hasFileChanges||e[18]!==t.hasSession||e[19]!==t.onToggleBrowser||e[20]!==t.onToggleFileChanges||e[21]!==t.onToggleProjectFiles||e[22]!==t.onToggleSidebar||e[23]!==t.onToggleStats||e[24]!==t.onToggleWorktrees||e[25]!==t.showBrowser||e[26]!==t.showFileChanges||e[27]!==t.showProjectFiles||e[28]!==t.showSidebar||e[29]!==t.showStats||e[30]!==t.showWorktrees||e[31]!==t.supportsWorktrees){let n;e[33]!==t.hasSession||e[34]!==t.onToggleStats||e[35]!==t.showStats?(n=t.hasSession&&o("toggle-stats",t.showStats?"Hide session details":"Show session details","stats tokens usage panel",Ke,t.onToggleStats,w("toggleStats")),e[33]=t.hasSession,e[34]=t.onToggleStats,e[35]=t.showStats,e[36]=n):n=e[36];let c;e[37]!==t.onToggleProjectFiles||e[38]!==t.showProjectFiles?(c=t.onToggleProjectFiles&&o("project-files",t.showProjectFiles?"Close project files":"Open project files","browse edit save workspace source code",qe,t.onToggleProjectFiles,w("projectFiles")),e[37]=t.onToggleProjectFiles,e[38]=t.showProjectFiles,e[39]=c):c=e[39];let N;e[40]!==t.onToggleBrowser||e[41]!==t.showBrowser?(N=t.onToggleBrowser&&o("toggle-browser",t.showBrowser?"Hide browser":"Show browser","web page live view browse panel",ze,t.onToggleBrowser),e[40]=t.onToggleBrowser,e[41]=t.showBrowser,e[42]=N):N=e[42];let P;e[43]!==t.hasFileChanges||e[44]!==t.onToggleFileChanges||e[45]!==t.showFileChanges?(P=t.hasFileChanges&&o("toggle-file-changes",t.showFileChanges?"Hide file changes":"Show file changes","diff edits review panel",Xe,t.onToggleFileChanges),e[43]=t.hasFileChanges,e[44]=t.onToggleFileChanges,e[45]=t.showFileChanges,e[46]=P):P=e[46];let $;e[47]!==t.canOpenTerminal||e[48]!==t.onToggleWorktrees||e[49]!==t.showWorktrees||e[50]!==t.supportsWorktrees?($=t.supportsWorktrees&&t.canOpenTerminal&&o("toggle-worktrees",t.showWorktrees?"Hide worktrees":"Show worktrees","git branches panel",Je,t.onToggleWorktrees),e[47]=t.canOpenTerminal,e[48]=t.onToggleWorktrees,e[49]=t.showWorktrees,e[50]=t.supportsWorktrees,e[51]=$):$=e[51],m=X(o("toggle-sidebar",t.showSidebar?"Hide session sidebar":"Show session sidebar","projects navigation panel",Ve,t.onToggleSidebar,w("toggleSidebar")),n,c,N,P,$),e[16]=t.canOpenTerminal,e[17]=t.hasFileChanges,e[18]=t.hasSession,e[19]=t.onToggleBrowser,e[20]=t.onToggleFileChanges,e[21]=t.onToggleProjectFiles,e[22]=t.onToggleSidebar,e[23]=t.onToggleStats,e[24]=t.onToggleWorktrees,e[25]=t.showBrowser,e[26]=t.showFileChanges,e[27]=t.showProjectFiles,e[28]=t.showSidebar,e[29]=t.showStats,e[30]=t.showWorktrees,e[31]=t.supportsWorktrees,e[32]=m}else m=e[32];const C=m;let L;e[52]!==t?(L=X(t.onOpenProjectInEditor&&o("open-project-editor","Open project in editor","code cursor vscode zed workspace",it,t.onOpenProjectInEditor),t.onRevealProject&&o("reveal-project","Reveal project in file manager","finder explorer folder directory",st,t.onRevealProject),t.onCopyResumeCommand&&o("copy-resume-command","Copy resume command","cli claude codex copilot terminal clipboard continue session",re,t.onCopyResumeCommand),t.onCopyProjectPath&&o("copy-project-path","Copy project path","workspace directory clipboard",re,t.onCopyProjectPath),t.onOpenIntegratedTerminal&&o("integrated-terminal","New integrated terminal","embedded shell command line process panel",at,t.onOpenIntegratedTerminal,w("newIntegratedTerminal")),t.canOpenTerminal&&o("terminal","Open in system terminal","external shell command line app",ot,t.onOpenTerminal,w("systemTerminal")),t.onTogglePreview&&o("preview","Toggle development preview","browser localhost dev server website",nt,t.onTogglePreview,w("preview")),t.onOpenConfig&&o("config",t.showConfig?"Close agent configuration":"Open agent configuration","skills commands claude settings files",tt,t.onOpenConfig),o("settings","Open Cogpit settings","preferences network",et,t.onOpenSettings),t.onCheckAgents&&o("check-agents","Check agent setup","install sign in login doctor environment agents cli",pe,t.onCheckAgents),o("theme","Change theme & chat width","appearance light dark oled width narrow wide",Ze,t.onOpenTheme,w("themeSelector")),o("expand","Expand all groups","conversation details",ce,t.onExpandAll,w("expandAll")),o("expand-payloads","Expand all tool payloads","raw input result diff conversation details",ce,t.onExpandToolPayloads,w("expandToolPayloads")),o("collapse","Collapse all","conversation groups payloads details",Qe,t.onCollapseAll),t.onKillAll&&o("kill-all","Kill all agent processes","stop terminate halt everything runaway",Ye,t.onKillAll),t.onOpenDevices&&o("manage-devices","Manage devices…","remote machines hub hosts edit rename remove switch",ct,()=>{var n;return(n=t.onOpenDevices)==null?void 0:n.call(t,"manage")}),t.onOpenDevices&&o("add-device","Add device…","remote machine hub host connect pair new",le,()=>{var n;return(n=t.onOpenDevices)==null?void 0:n.call(t,"add")})),e[52]=t,e[53]=L):L=e[53];const D=L;let B;e[54]!==t.onOpenKeyboardShortcuts?(B=X(Z("documentation","Documentation","docs guide manual readme getting started learn how to",dt,ht),t.onOpenKeyboardShortcuts&&Z("keyboard-shortcuts","Keyboard shortcuts","keys hotkeys keybindings cheat sheet customize",lt,t.onOpenKeyboardShortcuts),Z("report-issue","Report an issue","bug problem feedback support github",rt,gt)),e[54]=t.onOpenKeyboardShortcuts,e[55]=B):B=e[55];const G=B;let O;e[56]!==l?(O={value:"Navigation",items:l},e[56]=l,e[57]=O):O=e[57];let R;e[58]!==f?(R=f.length>0?[{value:"Recent sessions",items:f}]:[],e[58]=f,e[59]=R):R=e[59];let A;e[60]!==r?(A=r.length>0?[{value:"Projects",items:r}]:[],e[60]=r,e[61]=A):A=e[61];let S;e[62]!==d?(S=d.length>0?[{value:"Devices",items:d}]:[],e[62]=d,e[63]=S):S=e[63];let j;e[64]!==C?(j={value:"View",items:C},e[64]=C,e[65]=j):j=e[65];let T;e[66]!==D?(T={value:"Tools",items:D},e[66]=D,e[67]=T):T=e[67];let k;e[68]!==G?(k={value:"Help & docs",items:G},e[68]=G,e[69]=k):k=e[69];let W;e[70]!==S||e[71]!==j||e[72]!==T||e[73]!==k||e[74]!==O||e[75]!==R||e[76]!==A?(W=[O,...R,...A,...S,j,T,k],e[70]=S,e[71]=j,e[72]=T,e[73]=k,e[74]=O,e[75]=R,e[76]=A,e[77]=W):W=e[77];const M=W;let s;e[78]!==t?(s=function(c){t.onOpenChange(!1),c.run()},e[78]=t,e[79]=s):s=e[79];const H=s;let b;e[80]===Symbol.for("react.memo_cache_sentinel")?(b=u.jsx(fe,{"aria-label":"Search commands",autoFocus:!0,placeholder:"Search commands..."}),e[80]=b):b=e[80];let y;e[81]!==t.loadingNavigation?(y=t.loadingNavigation&&u.jsxs("div",{className:"motion-enter flex items-center gap-2 px-3 py-2 text-xs text-muted-foreground",role:"status",children:[u.jsx(he,{className:"size-3.5"}),"Loading projects and sessions..."]}),e[81]=t.loadingNavigation,e[82]=y):y=e[82];let I;e[83]===Symbol.for("react.memo_cache_sentinel")?(I=u.jsx(we,{children:"No matching actions."}),e[83]=I):I=e[83];let F;e[84]!==M||e[85]!==H?(F=u.jsxs(ve,{className:"max-h-[min(26rem,60vh)]",children:[I,u.jsx(ft,{groups:M,onRun:H})]}),e[84]=M,e[85]=H,e[86]=F):F=e[86];let v;e[87]!==y||e[88]!==F?(v=u.jsxs(Ce,{label:"Search commands",loop:!0,children:[b,y,F]}),e[87]=y,e[88]=F,e[89]=v):v=e[89];let E;return e[90]!==t.onOpenChange||e[91]!==t.open||e[92]!==v?(E=u.jsx(ue,{open:t.open,onOpenChange:t.onOpenChange,title:"Command palette",description:"Search for a Cogpit action to run.",className:"max-w-xl",children:v}),e[90]=t.onOpenChange,e[91]=t.open,e[92]=v,e[93]=E):E=e[93],E}function gt(){return window.open(be,"_blank","noopener,noreferrer")}function ht(){return window.open(Se,"_blank","noopener,noreferrer")}function ut(t){return o(t.id,t.label,t.keywords,t.icon,t.onSelect)}function ft(t){const e=p.c(8),{groups:a,onRun:l}=t,i=je(Ct);let r;e[0]!==a||e[1]!==i?(r=i?a.map(g=>({group:g,score:Math.max(0,...g.items.map(d=>Te(d.value,i)))})).sort(vt).map(wt):a,e[0]=a,e[1]=i,e[2]=r):r=e[2];const h=r;let f;if(e[3]!==l||e[4]!==h){let g;e[6]!==l?(g=d=>u.jsx(ke,{heading:d.value,children:d.items.map(m=>{const C=m.icon;return u.jsxs(ye,{value:m.value,onSelect:()=>l(m),children:[u.jsx(C,{"aria-hidden":"true"}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"block truncate",children:m.label}),m.description&&u.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:m.description})]}),m.shortcut&&u.jsx(Fe,{children:m.shortcut})]},m.id)})},d.value),e[6]=l,e[7]=g):g=e[7],f=h.map(g),e[3]=l,e[4]=h,e[5]=f}else f=e[5];return f}function wt(t){const{group:e}=t;return e}function vt(t,e){return e.score-t.score}function Ct(t){return t.search}async function de(t,e){const a=await Be(t,{signal:e});if(!a.ok)throw new Error(`Request failed (${a.status})`);const l=await a.json();return Array.isArray(l)?l:[]}function kt(t){var ee;const e=p.c(51);let a,l,i,r,h,f;e[0]!==t?({open:i,currentProjectDirName:a,projectCwd:h,onProcessStarted:l,launchTerminalRequest:f,...r}=t,e[0]=t,e[1]=a,e[2]=l,e[3]=i,e[4]=r,e[5]=h,e[6]=f):(a=e[1],l=e[2],i=e[3],r=e[4],h=e[5],f=e[6]);const g=f===void 0?0:f,d=Pe();let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=[],e[7]=m):m=e[7];const[C,L]=U.useState(m);let D;e[8]===Symbol.for("react.memo_cache_sentinel")?(D=[],e[8]=D):D=e[8];const[B,G]=U.useState(D),[O,R]=U.useState(!1),A=U.useRef(0),S=xe();let j,T;e[9]!==S||e[10]!==i?(j=()=>{if(!i)return;const x=new AbortController,K=Re();return R(!0),Promise.allSettled([de("/api/projects",x.signal),de(Ae({limit:"12",perProject:"3"},S),x.signal)]).then(ge=>{const[te,ne]=ge;if(x.signal.aborted)return;const oe=ne.status==="fulfilled"?ne.value:[];Ie(oe,K),L(te.status==="fulfilled"?te.value:[]),G(oe),R(!1)}),()=>x.abort()},T=[i,S],e[9]=S,e[10]=i,e[11]=j,e[12]=T):(j=e[11],T=e[12]),U.useEffect(j,T);let k;e[13]!==C?(k=Oe(C),e[13]=C,e[14]=k):k=e[14];const W=k;let M;e:{if(h){M=h;break e}if(!a){M=null;break e}let x;e[15]!==a||e[16]!==C?(x=((ee=C.find(K=>K.dirName===a))==null?void 0:ee.path)??null,e[15]=a,e[16]=C,e[17]=x):x=e[17],M=x}const s=M;let H;e[18]!==l||e[19]!==d||e[20]!==s?(H=()=>{if(!s)return;const x=d.spawnTerminal({cwd:s}),K=s.replace(/\/+$/,"").split("/").at(-1)||"Terminal";l({id:x,name:K,type:"terminal",status:"running",source:s})},e[18]=l,e[19]=d,e[20]=s,e[21]=H):H=e[21];const b=H;let y,I;e[22]!==b||e[23]!==g||e[24]!==d.status||e[25]!==s?(I=()=>{g<=A.current||!s||d.status!=="connected"||(A.current=g,b())},y=[b,g,d.status,s],e[22]=b,e[23]=g,e[24]=d.status,e[25]=s,e[26]=y,e[27]=I):(y=e[26],I=e[27]),U.useEffect(I,y);let F;e[28]!==a||e[29]!==s?(F={path:s,dirName:a},e[28]=a,e[29]=s,e[30]=F):F=e[30];const v=F;let E;e[31]!==v?(E=()=>Ee(v),e[31]=v,e[32]=E):E=e[32];const n=E;let c;e[33]!==v?(c=()=>$e(v),e[33]=v,e[34]=c):c=e[34];const N=c,P=!se()&&Q("hostFiles"),$=Q("hostFiles")&&(!se()||Ne());let q;e[35]!==s?(q=()=>{s&&De(s)},e[35]=s,e[36]=q):q=e[36];const me=q;let _;e[37]!==b||e[38]!==d.status||e[39]!==s?(_=s&&d.status==="connected"&&Q("terminal")?b:void 0,e[37]=b,e[38]=d.status,e[39]=s,e[40]=_):_=e[40];const J=s&&$?n:void 0,V=s&&P?N:void 0,Y=s?me:void 0;let z;return e[41]!==O||e[42]!==i||e[43]!==r||e[44]!==B||e[45]!==W||e[46]!==_||e[47]!==J||e[48]!==V||e[49]!==Y?(z=u.jsx(mt,{...r,open:i,projects:W,recentSessions:B,loadingNavigation:O,onOpenIntegratedTerminal:_,onOpenProjectInEditor:J,onRevealProject:V,onCopyProjectPath:Y}),e[41]=O,e[42]=i,e[43]=r,e[44]=B,e[45]=W,e[46]=_,e[47]=J,e[48]=V,e[49]=Y,e[50]=z):z=e[50],z}export{kt as CommandPaletteHost};
|