copilot-operator 0.1.15 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/api/operator.controller.js +34 -0
- package/dist/src/api/operator.service.js +112 -1
- package/dist/src/plan/brief.js +34 -0
- package/dist/src/plan/importPlan.js +8 -1
- package/dist/src/plan/schema.js +24 -0
- package/dist/src/plan/systemGuide.js +63 -0
- package/dist/src/session/exports.js +2 -0
- package/dist/src/session/store.js +68 -6
- package/dist/src/transport/copilotTransport.js +39 -1
- package/dist/src/vcs/snapshot.js +354 -0
- package/dist/src/vcs/taskVcs.js +68 -23
- package/dist/web/404.html +2 -2
- package/dist/web/_next/static/chunks/549-a13ae394c5e6a837.js +1 -0
- package/dist/web/_next/static/chunks/867-7f27ef819d251cc5.js +1 -0
- package/dist/web/_next/static/chunks/app/defaults/page-fd819bbfa7f33982.js +1 -0
- package/dist/web/_next/static/chunks/app/page-409e37e208dc12e5.js +1 -0
- package/dist/web/_next/static/chunks/app/sessions/view/page-d28825430ca280de.js +1 -0
- package/dist/web/_next/static/css/{e2a2c9eb3c226313.css → c37978b44194c37b.css} +1 -1
- package/dist/web/appearance.html +2 -2
- package/dist/web/appearance.txt +12 -12
- package/dist/web/defaults.html +2 -2
- package/dist/web/defaults.txt +12 -12
- package/dist/web/history.html +2 -2
- package/dist/web/history.txt +12 -12
- package/dist/web/import.html +2 -2
- package/dist/web/import.txt +12 -12
- package/dist/web/index.html +2 -2
- package/dist/web/index.txt +12 -12
- package/dist/web/level1.html +2 -2
- package/dist/web/level1.txt +12 -12
- package/dist/web/presets.html +2 -2
- package/dist/web/presets.txt +12 -12
- package/dist/web/sessions/view.html +2 -2
- package/dist/web/sessions/view.txt +12 -12
- package/dist/web/system.html +2 -2
- package/dist/web/system.txt +12 -12
- package/package.json +6 -3
- package/dist/web/_next/static/chunks/549-9548d9a132c8c7d4.js +0 -1
- package/dist/web/_next/static/chunks/867-8b95ae984befc0e2.js +0 -1
- package/dist/web/_next/static/chunks/app/defaults/page-71a43ed69134b48d.js +0 -1
- package/dist/web/_next/static/chunks/app/page-13572a726de0b7db.js +0 -1
- package/dist/web/_next/static/chunks/app/sessions/view/page-886f5fc99e146408.js +0 -1
- /package/dist/web/_next/static/{IwNZiBrEMAcXEUFj2miiU → kkxFcGzA9Uo1uRAgcoDti}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{IwNZiBrEMAcXEUFj2miiU → kkxFcGzA9Uo1uRAgcoDti}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[189],{1035:(e,l,t)=>{"use strict";t.d(l,{DialogHost:()=>c,Z:()=>d});var n=t(3365),s=t(1521),a=t(867),r=t(4969);let i=null,o=[];function d(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(t=>{var n;return n={kind:"confirm",message:e,...l,resolve:t},void(i?i(n):o.push(n))})}function c(e){var l,t;let{children:d}=e,{t:c}=(0,a.kj)(),[m,u]=(0,s.useState)([]),h=(0,s.useRef)(null),x=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(i=e=>u(l=>[...l,e]),o.length>0){let e=o.splice(0,o.length);u(l=>[...l,...e])}return()=>{i=null}},[]);let p=m[0],j=(0,s.useCallback)(e=>{p&&(p.resolve(e),u(e=>e.slice(1)))},[p]);return(0,r.V)(x,!!p,h),(0,s.useEffect)(()=>{if(!p)return;let e=e=>{"Escape"===e.key&&(e.preventDefault(),j(!1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p,j]),(0,n.jsxs)(n.Fragment,{children:[d,p&&(0,n.jsx)("div",{className:"modal-backdrop",onClick:()=>j(!1),role:"presentation",children:(0,n.jsxs)("div",{ref:x,className:"modal".concat(p.danger?" danger":""),role:"confirm"===p.kind?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":"modal-title","aria-describedby":"modal-body",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("h2",{id:"modal-title",children:null!=(l=p.title)?l:c("confirm"===p.kind?"dialog.confirmTitle":"dialog.noticeTitle")}),(0,n.jsx)("div",{id:"modal-body",className:"modal-body",children:p.message}),(0,n.jsxs)("div",{className:"row modal-actions",children:["confirm"===p.kind&&(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>j(!1),children:c("dialog.cancel")}),(0,n.jsx)("button",{ref:h,type:"button",className:p.danger?"danger":"primary",onClick:()=>j(!0),children:null!=(t=p.okLabel)?t:c("dialog.ok")})]})]})})]})}},1896:(e,l,t)=>{Promise.resolve().then(t.bind(t,3197))},2285:(e,l,t)=>{"use strict";t.d(l,{b:()=>i});var n=t(3365),s=t(1521),a=t(5549),r=t(867);function i(e){var l,t;let{dir:i}=e,{t:o}=(0,r.kj)(),d=(0,r.W3)(),[c,m]=(0,s.useState)(null),[u,h]=(0,s.useState)(""),[x,p]=(0,s.useState)(""),j=async()=>{h("");try{m(await a.FH.syncPlan(i))}catch(e){h(e.message)}},v=async(e,l)=>{try{await navigator.clipboard.writeText(l),p(e),window.setTimeout(()=>p(""),2500)}catch(e){h(o("plan.copyFailed"))}},f=e=>(0,n.jsxs)("ul",{style:{margin:"2px 0 6px",paddingLeft:20},children:[e.slice(0,30).map(e=>(0,n.jsx)("li",{children:(0,n.jsx)("code",{children:e})},e)),e.length>30&&(0,n.jsx)("li",{className:"muted",children:o("sync.more",{n:e.length-30})})]});return(0,n.jsxs)("div",{className:"sync-command small",style:{marginTop:8},children:[(0,n.jsx)("button",{type:"button",onClick:()=>void j(),children:o("sync.show")}),u&&(0,n.jsx)("p",{className:"err",children:u}),c&&!c.ok&&(0,n.jsx)("p",{className:"err",children:c.problem}),(null==c?void 0:c.ok)&&(0,n.jsxs)("div",{className:"notice caution",style:{marginTop:8},children:[(0,n.jsxs)("p",{children:[o("sync.what",{branch:null!=(l=c.branch)?l:"",target:null!=(t=c.target)?t:""})," ",(0,n.jsx)("span",{className:"muted",children:c.lastFetched?o("sync.fetchedAt",{when:d(c.lastFetched)}):o("sync.neverFetched")})]}),c.willLose.commits.length+c.willLose.changed.length+c.willLose.untracked.length===0?(0,n.jsx)("p",{children:o("sync.nothingLost")}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("strong",{children:o("sync.loses")}),c.willLose.commits.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{children:o("sync.commits",{n:c.willLose.commits.length})}),f(c.willLose.commits)]}),c.willLose.changed.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{children:o("sync.changed",{n:c.willLose.changed.length})}),f(c.willLose.changed)]}),c.willLose.untracked.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{children:o("sync.untracked",{n:c.willLose.untracked.length})}),f(c.willLose.untracked)]})]}),(0,n.jsx)("p",{className:"muted",children:o("sync.keeps")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{type:"button",onClick:()=>void v("preview",c.preview),children:o("sync.copyPreview")}),"preview"===x&&(0,n.jsx)("span",{className:"badge done",children:o("plan.copied")})]}),(0,n.jsx)("pre",{className:"sync-cmd",children:c.preview}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{type:"button",className:"danger",onClick:()=>void v("command",c.command),children:o("sync.copyCommand")}),"command"===x&&(0,n.jsx)("span",{className:"badge done",children:o("plan.copied")})]}),(0,n.jsx)("pre",{className:"sync-cmd",children:c.command}),(0,n.jsx)("p",{className:"muted",children:o("sync.howToRun")})]})]})}},3197:(e,l,t)=>{"use strict";t.r(l),t.d(l,{default:()=>u});var n=t(3365),s=t(1521),a=t(2285),r=t(8197),i=t.n(r),o=t(5549),d=t(867),c=t(1035),m=t(4784);function u(){let{t:e}=(0,d.kj)(),[l,t]=(0,s.useState)(null),[a,r]=(0,s.useState)(!1),[i,m]=(0,s.useState)("");(0,s.useEffect)(()=>{o.FH.models().then(t).catch(()=>void 0)},[]);let u=async()=>{if(await (0,c.Z)(e("model.refreshConfirm"))){r(!0),m(e("model.refreshing"));try{var l;let n=await o.FH.models().then(()=>o.FH.refreshModels());t(n),m(0===n.options.length?null!=(l=n.note)?l:e("model.none"):e("model.refreshed",{n:n.options.length}))}catch(e){m(e.message)}finally{r(!1)}}},h={catalogue:l,setCatalogue:t,refreshModels:u,refreshing:a,refreshMsg:i};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"panel",children:[(0,n.jsx)("h2",{children:e("def.title")}),(0,n.jsx)("p",{className:"muted small",children:e("def.intro")}),(0,n.jsx)("p",{className:"why",children:e("def.autoSave")})]}),(0,n.jsx)(v,{}),(0,n.jsx)(g,{...h}),(0,n.jsx)(w,{...h}),(0,n.jsx)(y,{})]})}function h(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:900,t=(0,s.useRef)(null),n=(0,s.useRef)(null),a=(0,s.useRef)(e);return a.current=e,(0,s.useEffect)(()=>()=>{t.current&&clearTimeout(t.current),n.current&&a.current(n.current.value)},[]),e=>{t.current&&clearTimeout(t.current),n.current={value:e},t.current=setTimeout(()=>{n.current=null,a.current(e)},l)}}function x(e){let{id:l,value:t,min:a,max:r,onChange:i,disabled:o}=e,[d,c]=(0,s.useState)(String(t));return(0,s.useEffect)(()=>c(e=>p(e)===t?e:String(t)),[t]),(0,n.jsx)("input",{id:l,type:"number",min:a,max:r,step:1,value:d,onChange:e=>{c(e.target.value);let l=p(e.target.value);null!==l&&l>=a&&l<=r&&i(l)},onBlur:()=>{let e=p(d),l=null===e?t:Math.max(a,Math.min(r,e));c(String(l)),l!==t&&i(l)},style:{width:"9ch"},disabled:o})}function p(e){if(""===e.trim())return null;let l=Number(e);return Number.isInteger(l)?l:null}function j(e){let{msg:l,onSave:t}=e,{t:s}=(0,d.kj)();return(0,n.jsxs)("div",{className:"row",style:{marginTop:6},children:[t&&(0,n.jsx)("button",{className:"quiet",onClick:t,title:s("def.saveAnywayWhy"),children:s("def.saveAnyway")}),(0,n.jsx)("span",{className:"muted small",role:"status",children:l||s("def.savedAutomatically")})]})}function v(){var e;let{t:l}=(0,d.kj)(),[t,a]=(0,s.useState)(null),[r,i]=(0,s.useState)(""),[c,m]=(0,s.useState)(""),[u,x]=(0,s.useState)(""),[p,v]=(0,s.useState)(""),[y,g]=(0,s.useState)(!1),[w,b]=(0,s.useState)(""),[N,k]=(0,s.useState)(""),S=(0,s.useCallback)(async()=>{try{let e=await o.FH.project();a(e),i(e.rootDir),m(e.name),v("")}catch(e){v(e.message)}},[]);(0,s.useEffect)(()=>{S()},[S]);let F=async(e,l)=>{g(!0),x("");try{let t=await o.FH.setProject(e);return a(t),i(t.rootDir),x(l(t)),v(""),!0}catch(e){return v(e.message),!1}finally{g(!1)}},C=e=>F({rootDir:e},e=>e.rootDir?l("proj.saved",{dir:e.rootDir}):l("proj.cleared")),R=e=>F({name:e},()=>l("proj.nameSaved")),T=h(C),D=h(R),E=async(e,l)=>{g(!0);try{var t;let n=await o.FH.browseFolder(l.trim()||void 0);n.ok?e(n.path):n.cancelled||v(null!=(t=n.reason)?t:"")}catch(e){v(e.message)}finally{g(!1)}},M=null!=(e=null==t?void 0:t.others)?e:[],A=e=>e.map(e=>({name:e.name,rootDir:e.rootDir})),L=async()=>{await F({others:[...A(M),{name:w.trim(),rootDir:N.trim()}]},e=>l("proj.othersSaved",{n:e.others.length}))&&(b(""),k(""))};return(0,n.jsxs)("div",{className:"panel",id:"project",children:[(0,n.jsx)("h2",{children:l("proj.title")}),(0,n.jsx)("p",{className:"muted small",children:l("proj.intro")}),p&&(0,n.jsx)("div",{className:"err",children:p}),(0,n.jsx)("p",{className:"muted small",children:l("proj.listIntro")}),(0,n.jsx)(f,{name:c,dir:r,repoOk:!!(null==t?void 0:t.repoOk),repoProblem:null==t?void 0:t.repoProblem,isDefault:!0,busy:y,onNameInput:e=>{m(e),D(e)},onName:e=>void R(e),onDirInput:e=>{i(e),T(e)},onDir:e=>void C(e),onBrowse:()=>void E(e=>void C(e),r),onRemove:(null==t?void 0:t.rootDir)?()=>void C(""):void 0,removeLabel:l("proj.clear")}),(0,n.jsx)(j,{msg:u}),t&&!t.rootDir&&(0,n.jsx)("p",{className:"muted small",style:{marginTop:8},children:l("proj.none")}),M.map((e,t)=>(0,n.jsx)(f,{name:e.name,dir:e.rootDir,repoOk:e.repoOk,repoProblem:e.repoProblem,busy:y,onName:t=>void F({others:A(M.map(l=>l.name===e.name?{...l,name:t}:l))},()=>l("proj.nameSaved")),onDir:t=>void F({others:A(M.map(l=>l.name===e.name?{...l,rootDir:t}:l))},()=>l("proj.othersSaved",{n:M.length})),onBrowse:()=>void E(t=>void F({others:A(M.map(l=>l.name===e.name?{...l,rootDir:t}:l))},()=>l("proj.othersSaved",{n:M.length})),e.rootDir),onRemove:()=>{let t;t=e.name,F({others:A(M.filter(e=>e.name!==t))},e=>l("proj.othersSaved",{n:e.others.length}))},removeLabel:l("proj.otherRemove")},"other-".concat(t))),(0,n.jsx)("h3",{id:"others",children:l("proj.addTitle")}),(0,n.jsx)("p",{className:"muted small",children:l("proj.othersIntro")}),(0,n.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,n.jsx)("input",{type:"text","aria-label":l("proj.entryName"),value:w,onChange:e=>b(e.target.value),placeholder:l("proj.entryName"),disabled:y,style:{width:160}}),(0,n.jsx)("input",{type:"text",className:"grow","aria-label":l("proj.entryDir"),value:N,onChange:e=>k(e.target.value),placeholder:"C:\\Projects\\my-app-tests",disabled:y}),(0,n.jsx)("button",{onClick:()=>void E(e=>k(e),N),disabled:y,children:l("mirror.browse")}),(0,n.jsx)("button",{className:"primary",onClick:()=>void L(),disabled:y||!w.trim()||!N.trim(),children:l("proj.otherAdd")})]}),(0,n.jsx)("h3",{children:l("proj.affects")}),(0,n.jsxs)("ul",{className:"muted small",style:{margin:0,paddingLeft:20},children:[(0,n.jsx)("li",{children:l("proj.affectsNew")}),(0,n.jsx)("li",{children:l("proj.affectsExisting")}),(0,n.jsx)("li",{children:l("proj.affectsPlan")}),(0,n.jsx)("li",{children:l("proj.affectsNever")})]})]})}function f(e){var l;let{name:t,dir:r,repoOk:i,repoProblem:o,isDefault:c=!1,busy:m,onNameInput:u,onName:h,onDirInput:x,onDir:p,onBrowse:j,onRemove:v,removeLabel:f}=e,{t:y}=(0,d.kj)(),g=(0,s.useId)(),[w,b]=(0,s.useState)(t),[N,k]=(0,s.useState)(r);return(0,s.useEffect)(()=>b(t),[t]),(0,s.useEffect)(()=>k(r),[r]),(0,n.jsxs)("div",{className:"panel inner",style:{marginTop:10},children:[(0,n.jsxs)("div",{className:"row",children:[(0,n.jsxs)("div",{style:{width:"min(200px, 100%)"},children:[(0,n.jsx)("label",{htmlFor:"".concat(g,"-name"),children:y("proj.entryName")}),(0,n.jsx)("input",{id:"".concat(g,"-name"),type:"text",value:w,onChange:e=>{b(e.target.value),null==u||u(e.target.value)},onBlur:()=>{(w!==t||u)&&h(w)},placeholder:r?null!=(l=r.replace(/[\/]+$/,"").split(/[\/]/).pop())?l:"":y("proj.namePlaceholder")})]}),(0,n.jsxs)("div",{className:"grow",children:[(0,n.jsx)("label",{htmlFor:"".concat(g,"-dir"),children:y("proj.entryDir")}),(0,n.jsx)("input",{id:"".concat(g,"-dir"),type:"text",value:N,onChange:e=>{k(e.target.value),null==x||x(e.target.value)},onBlur:()=>{(N!==r||x)&&p(N)},placeholder:"C:\\Projects\\my-app"})]}),(0,n.jsx)("button",{onClick:j,disabled:m,children:y("mirror.browse")}),v&&(0,n.jsx)("button",{className:"quiet",onClick:v,disabled:m,children:f})]}),(0,n.jsxs)("div",{className:"row small",style:{marginTop:6},children:[c&&(0,n.jsx)("span",{className:"chip",title:y("proj.isDefaultWhy"),children:y("proj.isDefault")}),r&&(0,n.jsx)("span",{className:"badge ".concat(i?"done":""),title:i?y("proj.isRepo"):o,children:y(i?"proj.otherRepo":"proj.otherNotRepo")}),r&&!i&&(0,n.jsx)("span",{className:"muted",children:o||y("proj.notRepoWhy")})]}),r&&i&&(0,n.jsx)(a.b,{dir:r})]})}function y(){let{t:e}=(0,d.kj)(),[l,t]=(0,s.useState)(null),a=(0,s.useRef)(null),r=(0,s.useRef)(Promise.resolve()),[i,c]=(0,s.useState)(2),[m,u]=(0,s.useState)(2),[p,v]=(0,s.useState)(60),[f,y]=(0,s.useState)(240),[g,w]=(0,s.useState)(900),[b,N]=(0,s.useState)("none"),[k,S]=(0,s.useState)("confirm"),[F,C]=(0,s.useState)("ask"),[R,T]=(0,s.useState)(""),[D,E]=(0,s.useState)("");(0,s.useEffect)(()=>{o.FH.settings().then(e=>{var l,n,s,r,i,o;a.current=e.raw,t(e.raw);let d=null!=(l=e.raw.limits)?l:{};c("number"==typeof d.retryBlockedInFreshChat?d.retryBlockedInFreshChat:2),u("number"==typeof d.minApproachesBeforeBlocked?d.minApproachesBeforeBlocked:2),v("number"==typeof d.maxIterations?d.maxIterations:60),y("number"==typeof d.maxRunMinutes?d.maxRunMinutes:240);let m=null!=(n=e.raw.copilot)?n:{};w("number"==typeof m.replyTimeoutSec?m.replyTimeoutSec:900);let h=null!=(s=e.raw.execution)?s:{};N(null!=(r=h.isolation)?r:"none"),S(null!=(i=h.mode)?i:"confirm"),C(null!=(o=h.networkFetch)?o:"ask")}).catch(e=>E(e.message))},[]);let M=(l,n,s)=>{let i=async()=>{var r;if(!a.current)return;let i=await o.FH.settings().then(e=>e.raw).catch(()=>a.current),d={...i,[l]:{...null!=(r=i[l])?r:{},[n]:s}};T("");try{await o.FH.saveSettings(d),a.current=d,t(d),T(e("exec.saved")),E("")}catch(e){E(e.message)}},d=r.current.then(i);return r.current=d.catch(()=>void 0),d},A=h(e=>M("limits","retryBlockedInFreshChat",e)),L=h(e=>M("limits","minApproachesBeforeBlocked",e)),B=h(e=>M("limits","maxIterations",e)),I=h(e=>M("limits","maxRunMinutes",e)),P=h(e=>M("copilot","replyTimeoutSec",e)),H=(e,l)=>M("execution",e,l);return(0,n.jsxs)("div",{className:"panel",id:"execution",children:[(0,n.jsx)("h2",{children:e("exec.title")}),(0,n.jsx)("p",{className:"muted small",children:e("exec.intro")}),D&&(0,n.jsx)("div",{className:"err",children:D}),(0,n.jsx)("label",{htmlFor:"min-approaches",children:e("exec.minApproaches")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)(x,{id:"min-approaches",value:m,min:2,max:20,onChange:e=>{u(e),L(e)},disabled:!l}),(0,n.jsx)("span",{className:"muted small",children:e("exec.minApproachesUnit")})]}),(0,n.jsx)("p",{className:"why",children:e("exec.minApproachesWhy")}),(0,n.jsx)("label",{htmlFor:"retry-blocked",children:e("exec.retryBlocked")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)(x,{id:"retry-blocked",value:i,min:0,max:5,onChange:e=>{c(e),A(e)},disabled:!l}),(0,n.jsx)("span",{className:"muted small",children:e("exec.retryBlockedTimes")})]}),(0,n.jsx)("p",{className:"why",children:e("exec.retryBlockedWhy")}),(0,n.jsx)("label",{htmlFor:"max-iterations",children:e("exec.maxIterations")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)(x,{id:"max-iterations",value:p,min:5,max:200,onChange:e=>{v(e),B(e)},disabled:!l}),(0,n.jsx)("span",{className:"muted small",children:e("exec.maxIterationsUnit")})]}),(0,n.jsx)("p",{className:"why",children:e("exec.maxIterationsWhy")}),(0,n.jsx)("label",{htmlFor:"max-minutes",children:e("exec.maxRunMinutes")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)(x,{id:"max-minutes",value:f,min:10,max:1440,onChange:e=>{y(e),I(e)},disabled:!l}),(0,n.jsx)("span",{className:"muted small",children:e("exec.maxRunMinutesUnit")})]}),(0,n.jsx)("p",{className:"why",children:e("exec.maxRunMinutesWhy")}),(0,n.jsx)("label",{htmlFor:"reply-timeout",children:e("exec.replyTimeout")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)(x,{id:"reply-timeout",value:g,min:60,max:10800,onChange:e=>{w(e),P(e)},disabled:!l}),(0,n.jsx)("span",{className:"muted small",children:e("exec.replyTimeoutUnit")})]}),(0,n.jsx)("p",{className:"why",children:e("exec.replyTimeoutWhy")}),(0,n.jsx)("label",{htmlFor:"isolation",children:e("exec.isolation")}),(0,n.jsxs)("select",{id:"isolation",value:b,onChange:e=>{let l=e.target.value;N(l),H("isolation",l)},disabled:!l,children:[(0,n.jsx)("option",{value:"none",children:e("exec.isolationNone")}),(0,n.jsx)("option",{value:"none-accepted",children:e("exec.isolationNoneAccepted")}),(0,n.jsx)("option",{value:"separate-account",children:e("exec.isolationAccount")}),(0,n.jsx)("option",{value:"sandbox",children:e("exec.isolationSandbox")}),(0,n.jsx)("option",{value:"vm",children:e("exec.isolationVm")})]}),(0,n.jsx)("p",{className:"why",children:e("exec.isolationWhy")}),(0,n.jsx)("label",{htmlFor:"start-mode",children:e("exec.startMode")}),(0,n.jsxs)("select",{id:"start-mode",value:k,onChange:e=>{let l=e.target.value;S(l),H("mode",l)},disabled:!l,children:[(0,n.jsx)("option",{value:"confirm",children:e("exec.startModeAsk")}),(0,n.jsx)("option",{value:"unattended",children:e("exec.startModeAuto")})]}),(0,n.jsx)("p",{className:"why",children:e("exec.startModeWhy")}),(0,n.jsx)("label",{htmlFor:"network-fetch",children:e("exec.networkFetch")}),(0,n.jsxs)("select",{id:"network-fetch",value:F,onChange:e=>{let l=e.target.value;C(l),H("networkFetch",l)},disabled:!l,children:[(0,n.jsx)("option",{value:"ask",children:e("exec.networkFetchAsk")}),(0,n.jsx)("option",{value:"refuse",children:e("exec.networkFetchRefuse")}),(0,n.jsx)("option",{value:"run",children:e("exec.networkFetchRun")})]}),(0,n.jsx)(j,{msg:R}),(0,n.jsx)("p",{className:"why",children:e("exec.networkFetchWhy")})]})}function g(e){var l;let{catalogue:t,setCatalogue:a,refreshModels:r,refreshing:i,refreshMsg:c}=e,{t:u}=(0,d.kj)(),h=(0,d.W3)(),[x,p]=(0,s.useState)(""),[v,f]=(0,s.useState)(""),[y,g]=(0,s.useState)(!1),w=null!=(l=null==t?void 0:t.defaultModel)?l:"",b=async e=>{g(!0),p("");try{let l=await o.FH.setDefaultModel(e);t&&a({...t,defaultModel:l.defaultModel}),p(l.defaultModel?u("def.modelSaved",{name:l.defaultModel}):u("def.modelCleared")),f("")}catch(e){f(e.message)}finally{g(!1)}};return(0,n.jsxs)("div",{className:"panel",id:"model",children:[(0,n.jsx)("h2",{children:u("def.modelTitle")}),(0,n.jsx)("p",{className:"muted small",children:u("def.modelIntro")}),v&&(0,n.jsx)("div",{className:"err",children:v}),(0,n.jsx)("label",{htmlFor:"default-model",children:u("def.modelField")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)(m.Y,{id:"default-model",chosen:w,onChange:e=>void b(e),none:u("def.modelNone"),catalogue:t,disabled:y||i}),(0,n.jsx)("button",{className:"quiet",onClick:()=>void b(""),disabled:y||!w,children:u("proj.clear")}),(0,n.jsx)("button",{onClick:()=>void r(),disabled:y||i,children:u("model.refresh")})]}),(0,n.jsx)(j,{msg:x||c}),(0,n.jsx)("p",{className:"muted small",style:{marginTop:8},children:(null==t?void 0:t.readAt)?u("model.readAt",{t:h(t.readAt),n:t.options.length}):u("model.neverRead")}),(0,n.jsx)("h3",{children:u("proj.affects")}),(0,n.jsxs)("ul",{className:"muted small",style:{margin:0,paddingLeft:20},children:[(0,n.jsx)("li",{children:u("def.modelAffectsNew")}),(0,n.jsx)("li",{children:u("def.modelAffectsExisting")}),(0,n.jsx)("li",{children:u("def.modelAffectsBatch")})]})]})}function w(e){var l,t;let{catalogue:a,setCatalogue:r,refreshModels:c,refreshing:u,refreshMsg:h}=e,{t:x}=(0,d.kj)(),[p,v]=(0,s.useState)(""),[f,y]=(0,s.useState)(""),[g,w]=(0,s.useState)(!1),b=null!=(l=null==a?void 0:a.defaultReviewModel)?l:"",N=async e=>{w(!0),v("");try{let l=await o.FH.setDefaultReviewModel(e);a&&r({...a,defaultReviewModel:l.defaultReviewModel}),v(l.defaultReviewModel?x("def.reviewSaved",{name:l.defaultReviewModel}):x("def.reviewCleared")),y("")}catch(e){y(e.message)}finally{w(!1)}},k=""!==b&&b===(null!=(t=null==a?void 0:a.defaultModel)?t:"");return(0,n.jsxs)("div",{className:"panel",id:"review",children:[(0,n.jsx)("h2",{children:x("def.reviewTitle")}),(0,n.jsx)("p",{className:"muted small",children:x("def.reviewIntro")}),f&&(0,n.jsx)("div",{className:"err",children:f}),(0,n.jsx)("label",{htmlFor:"default-review-model",children:x("def.reviewField")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)(m.Y,{id:"default-review-model",chosen:b,onChange:e=>void N(e),none:x("def.reviewNone"),catalogue:a,disabled:g||u}),(0,n.jsx)("button",{className:"quiet",onClick:()=>void N(""),disabled:g||!b,children:x("proj.clear")}),(0,n.jsx)("button",{onClick:()=>void c(),disabled:g||u,children:x("model.refresh")})]}),k&&(0,n.jsx)("p",{className:"why",style:{color:"var(--warn)"},children:x("def.reviewSame")}),(0,n.jsx)(j,{msg:p||h}),(0,n.jsx)("h3",{children:x("proj.affects")}),(0,n.jsxs)("ul",{className:"muted small",style:{margin:0,paddingLeft:20},children:[(0,n.jsx)("li",{children:x("def.reviewAffectsNew")}),(0,n.jsx)("li",{children:x("def.reviewAffectsExisting")}),(0,n.jsx)("li",{children:x("def.reviewAffectsBatch")})]}),(0,n.jsxs)("div",{className:"row",style:{marginTop:12},children:[(0,n.jsx)(i(),{href:"/",className:"button-link plain",children:x("proj.toSessions")}),(0,n.jsx)(i(),{href:"/import",className:"button-link quiet",children:x("proj.toImport")})]})]})}},4784:(e,l,t)=>{"use strict";t.d(l,{Y:()=>i});var n=t(3365),s=t(1521),a=t(5549),r=t(867);function i(e){var l,t;let{id:i,chosen:o,onChange:d,none:c,catalogue:m,disabled:u=!1,style:h}=e,{t:x}=(0,r.kj)(),p=function(e){let[l,t]=(0,s.useState)(null);return(0,s.useEffect)(()=>{if(void 0!==e)return;let l=!0;return a.FH.models().then(e=>{l&&t(e)}).catch(()=>void 0),()=>{l=!1}},[e]),void 0!==e?e:l}(m),j=null!=(l=null==p?void 0:p.options)?l:[],v=j.some(e=>e.name===o),f=j.filter(e=>!e.group),y=new Map;for(let e of j)e.group&&y.set(e.group,[...null!=(t=y.get(e.group))?t:[],e]);return(0,n.jsxs)("select",{id:i,value:o,onChange:e=>d(e.target.value),disabled:u,style:{width:"auto",minWidth:280,...h},children:[(0,n.jsx)("option",{value:"",children:c}),o&&!v&&(0,n.jsx)("option",{value:o,children:x("model.notInList",{name:o})}),f.map(e=>(0,n.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(x("model.unavailable")):""]},e.name)),[...y.entries()].map(e=>{let[l,t]=e;return(0,n.jsx)("optgroup",{label:l,children:t.map(e=>(0,n.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(x("model.unavailable")):""]},e.name))},l)})]})}},4969:(e,l,t)=>{"use strict";t.d(l,{V:()=>a});var n=t(1521);let s='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function a(e,l,t){(0,n.useEffect)(()=>{var n,a;if(!l)return;let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=e.current,o=null!=(a=null!=(n=null==t?void 0:t.current)?n:null==i?void 0:i.querySelector(s))?a:null;null==o||o.focus();let d=e=>{if("Tab"!==e.key||!i)return;let l=Array.from(i.querySelectorAll(s)).filter(e=>null!==e.offsetParent);if(0===l.length)return;let t=l[0],n=l[l.length-1],a=i.contains(document.activeElement);e.shiftKey&&(document.activeElement===t||!a)?(e.preventDefault(),n.focus()):e.shiftKey||document.activeElement!==n&&a||(e.preventDefault(),t.focus())};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d),r&&document.contains(r)&&r.focus()}},[e,l,t])}}},e=>{e.O(0,[197,867,549,347,131,358],()=>e(e.s=1896)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{1035:(e,t,n)=>{"use strict";n.d(t,{DialogHost:()=>o,Z:()=>d});var l=n(3365),a=n(1521),s=n(867),i=n(4969);let r=null,c=[];function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(n=>{var l;return l={kind:"confirm",message:e,...t,resolve:n},void(r?r(l):c.push(l))})}function o(e){var t,n;let{children:d}=e,{t:o}=(0,s.kj)(),[h,m]=(0,a.useState)([]),u=(0,a.useRef)(null),p=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(r=e=>m(t=>[...t,e]),c.length>0){let e=c.splice(0,c.length);m(t=>[...t,...e])}return()=>{r=null}},[]);let g=h[0],b=(0,a.useCallback)(e=>{g&&(g.resolve(e),m(e=>e.slice(1)))},[g]);return(0,i.V)(p,!!g,u),(0,a.useEffect)(()=>{if(!g)return;let e=e=>{"Escape"===e.key&&(e.preventDefault(),b(!1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[g,b]),(0,l.jsxs)(l.Fragment,{children:[d,g&&(0,l.jsx)("div",{className:"modal-backdrop",onClick:()=>b(!1),role:"presentation",children:(0,l.jsxs)("div",{ref:p,className:"modal".concat(g.danger?" danger":""),role:"confirm"===g.kind?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":"modal-title","aria-describedby":"modal-body",onClick:e=>e.stopPropagation(),children:[(0,l.jsx)("h2",{id:"modal-title",children:null!=(t=g.title)?t:o("confirm"===g.kind?"dialog.confirmTitle":"dialog.noticeTitle")}),(0,l.jsx)("div",{id:"modal-body",className:"modal-body",children:g.message}),(0,l.jsxs)("div",{className:"row modal-actions",children:["confirm"===g.kind&&(0,l.jsx)("button",{type:"button",className:"quiet",onClick:()=>b(!1),children:o("dialog.cancel")}),(0,l.jsx)("button",{ref:u,type:"button",className:g.danger?"danger":"primary",onClick:()=>b(!0),children:null!=(n=g.okLabel)?n:o("dialog.ok")})]})]})})]})}},2114:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>u});var l=n(3365),a=n(1521),s=n(8197),i=n.n(s),r=n(5549),c=n(7527),d=n(867),o=n(1035),h=n(4811),m=n(8848);function u(){let{t:e}=(0,d.kj)(),t=(0,d.W3)(),[n,s]=(0,a.useState)(null),[h,m]=(0,a.useState)(null),[u,g]=(0,a.useState)([]),[b,x]=(0,a.useState)([]),[j,v]=(0,a.useState)([]),[f,y]=(0,a.useState)("stop"),[w,N]=(0,a.useState)(!1),[k,S]=(0,a.useState)(""),[C,F]=(0,a.useState)(""),[E,H]=(0,a.useState)(""),[W,I]=(0,a.useState)(null),[T,R]=(0,a.useState)(!1),D=(0,a.useCallback)(async()=>{try{let[e,t,n]=await Promise.all([r.FH.sessions(),r.FH.batch().catch(()=>null),r.FH.approvals().catch(()=>[])]);s(e),m(t),g(n),x(t=>t.filter(t=>e.some(e=>e.id===t))),I(!0),R(!1),H("")}catch(e){R(!(0,r.AV)()),I(!1),H(e.message)}},[]);(0,c.z)(D,3e3),(0,a.useEffect)(()=>{var e;let t=new URLSearchParams(window.location.search),n=(null!=(e=t.get("run"))?e:"").split(",").map(e=>e.trim()).filter(Boolean);0!==n.length&&(x(n),y("continue"===t.get("fail")?"continue":"stop"),N(!0),window.history.replaceState(null,"",window.location.pathname))},[]);let[P,U]=(0,a.useState)(!1),L=(0,a.useRef)(!1),q=async()=>{if(!L.current){L.current=!0,U(!0);try{let e=await r.FH.createSession(k||"session");S(""),window.location.href=(0,r.aT)(e.id)}catch(e){H(e.message),L.current=!1,U(!1)}}},M=async t=>{if(t.running)return void F(e("home.deleteRunning"));if(await (0,o.Z)(e("home.deleteConfirm",{name:t.name,n:t.tasks.length})))try{await r.FH.deleteSession(t.id),F(e("home.deleted",{name:t.name})),x(e=>e.filter(e=>e!==t.id)),await D()}catch(e){F(e.message)}},A=async()=>{let t=(null!=n?n:[]).filter(e=>j.includes(e.id)&&!e.running);if(0===t.length)return;let l=t.map(e=>"• ".concat(e.name," (").concat(e.tasks.length,")")).join("\n");if(!await (0,o.Z)(e("home.deleteSelectedConfirm",{n:t.length,names:l})))return;let a=0,s=[];for(let e of t)try{await r.FH.deleteSession(e.id),a+=1}catch(t){s.push("".concat(e.name,": ").concat(t.message))}F(0===s.length?e("home.deletedMany",{n:a}):e("home.deleteSomeFailed",{n:a,m:s.length,why:s.join("; ")})),x(e=>e.filter(e=>!t.some(t=>t.id===e))),v([]),await D()},B=async t=>{let l=(null!=n?n:[]).filter(e=>j.includes(e.id)&&!e.running);if(0===l.length)return;let a=[];for(let e of l)try{await r.FH.updateSession(e.id,{active:t})}catch(t){a.push("".concat(e.name,": ").concat(t.message))}F(0===a.length?e(t?"home.madeActive":"home.madeInactive",{n:l.length}):e("home.statusSomeFailed",{n:l.length-a.length,m:a.length,why:a.join("; ")})),t||x(e=>e.filter(e=>!l.some(t=>t.id===e))),v([]),await D()},O=t=>{if(t.running)return{label:e("state.running"),badge:"running"};let n=t.tasks.some(e=>"queued"===e.status||"running"===e.status);if("idle"!==t.status||n||0===t.tasks.length)return{label:e("state.".concat(t.status)),badge:""};let l=t.tasks.filter(e=>"done"!==e.status).length;return 0===l?{label:e("state.completed"),badge:"done",title:e("state.completedTitle")}:{label:e("state.ended"),badge:"failed",title:e("state.endedTitle",{n:l})}},_=(null!=n?n:[]).filter(e=>!e.running),K=_.filter(e=>j.includes(e.id));return(0,l.jsxs)(l.Fragment,{children:[T&&(0,l.jsxs)("div",{className:"panel",children:[(0,l.jsx)("strong",{children:e("home.noToken")}),(0,l.jsx)("div",{className:"muted small",children:e("home.noTokenHint",{cmd:"npm start"})})]}),!1===W&&!T&&(0,l.jsxs)("div",{className:"panel",children:[(0,l.jsx)("strong",{children:e("home.apiDown")}),(0,l.jsx)("div",{className:"muted small",children:e("home.apiHint",{cmd:"npm start",url:"/api"})}),E&&(0,l.jsx)("div",{className:"err",children:E})]}),(0,l.jsxs)("div",{className:"panel",id:"new-session",children:[(0,l.jsx)("h2",{children:e("home.new")}),(0,l.jsx)("p",{className:"muted small",children:e("home.newHint")}),(0,l.jsxs)("div",{className:"row",children:[(0,l.jsx)("input",{type:"text",className:"grow","aria-label":e("home.col.name"),placeholder:e("home.namePlaceholder"),value:k,onChange:e=>S(e.target.value),onKeyDown:e=>{"Enter"===e.key&&q()}}),(0,l.jsx)("button",{className:"primary",onClick:()=>void q(),disabled:P||!1===W,children:e("home.create")})]})]}),n&&n.length>0&&(0,l.jsx)(p,{sessions:n,selected:b,setSelected:x,onFailure:f,setOnFailure:y,fromPlan:w,batch:h,approvals:u,onChange:D,move:(e,t)=>{x(n=>{let l=n.indexOf(e),a=l+t;if(l<0||a<0||a>=n.length)return n;let s=[...n];return[s[l],s[a]]=[s[a],s[l]],s})}}),(0,l.jsxs)("div",{className:"panel",children:[(0,l.jsx)("h2",{children:e("home.sessions")}),null===n&&(0,l.jsx)("div",{className:"muted",children:e("home.loading")}),n&&0===n.length&&(0,l.jsx)("div",{className:"muted",children:e("home.none")}),n&&n.length>0&&(0,l.jsxs)("div",{className:"row",style:{marginBottom:10},children:[(0,l.jsx)("strong",{className:"small",children:e("home.managed",{n:K.length})}),(0,l.jsx)("button",{onClick:()=>void B(!0),disabled:0===K.length,children:e("home.makeActive")}),(0,l.jsx)("button",{onClick:()=>void B(!1),disabled:0===K.length,children:e("home.makeInactive")}),(0,l.jsx)("button",{className:"danger",onClick:()=>void A(),disabled:0===K.length,children:e("home.deleteSelected",{n:K.length})}),(0,l.jsx)("span",{className:"muted small",children:e("home.tickForBoth")})]}),n&&n.length>0&&(0,l.jsx)("p",{className:"muted small",children:e("home.deleteWhy")}),C&&(0,l.jsx)("div",{className:"muted small",role:"status",children:C}),n&&n.length>0&&(0,l.jsxs)("table",{children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{children:(0,l.jsx)("input",{type:"checkbox","aria-label":e("home.manageAll"),title:e("home.manageAll"),checked:_.length>0&&_.every(e=>j.includes(e.id)),onChange:e=>v(e.target.checked?_.map(e=>e.id):[]),disabled:0===_.length})}),(0,l.jsx)("th",{children:(0,l.jsx)("input",{type:"checkbox","aria-label":e("home.selectAll"),checked:n.length>0&&b.length===n.filter(e=>!1!==e.active).length,onChange:e=>x(e.target.checked?n.filter(e=>!1!==e.active).map(e=>e.id).reverse():[]),disabled:(null==h?void 0:h.running)===!0})}),(0,l.jsx)("th",{children:e("home.col.name")}),(0,l.jsx)("th",{children:e("home.col.tasks")}),(0,l.jsx)("th",{children:e("home.col.state")}),(0,l.jsx)("th",{children:e("home.col.chat")}),(0,l.jsx)("th",{children:e("home.col.created")}),(0,l.jsx)("th",{children:(0,l.jsx)("span",{className:"visually-hidden",children:e("home.col.remove")})})]})}),(0,l.jsx)("tbody",{children:n.map(a=>{let s=a.tasks.filter(e=>"done"===e.status).length,c=a.tasks.filter(e=>"queued"===e.status).length;return(0,l.jsxs)("tr",{className:!1===a.active?"inactive":void 0,children:[(0,l.jsx)("td",{children:(0,l.jsx)("input",{type:"checkbox",checked:j.includes(a.id),onChange:()=>v(e=>e.includes(a.id)?e.filter(e=>e!==a.id):[...e,a.id]),disabled:!!a.running,"aria-label":e("home.manageRow",{name:a.name}),title:a.running?e("home.manageRunning"):e("home.manageRow",{name:a.name})})}),(0,l.jsx)("td",{children:(0,l.jsx)("input",{type:"checkbox",checked:b.includes(a.id),onChange:()=>{var e;return e=a.id,void x(t=>{if(t.includes(e))return t.filter(t=>t!==e);let l=(null!=n?n:[]).map(e=>e.id).reverse();return[...t,e].sort((e,t)=>l.indexOf(e)-l.indexOf(t))})},disabled:(null==h?void 0:h.running)===!0||!1===a.active,"aria-label":a.name,title:!1===a.active?e("home.inactiveWhy"):void 0})}),(0,l.jsx)("td",{children:(0,l.jsx)(i(),{href:(0,r.aT)(a.id),children:a.name})}),(0,l.jsxs)("td",{children:[a.tasks.length," ",(0,l.jsx)("span",{className:"muted small",children:e("home.tasksDetail",{done:s,queued:c})})]}),(0,l.jsxs)("td",{children:[(0,l.jsx)("span",{className:"badge ".concat(O(a).badge),title:O(a).title,children:O(a).label})," ",(0,l.jsx)("span",{className:"chip".concat(!1===a.active?" inactive":""),title:e(!1===a.active?"home.inactiveWhy":"home.activeWhy"),children:e(!1===a.active?"home.statusInactive":"home.statusActive")})]}),(0,l.jsx)("td",{children:a.chat?(0,l.jsx)("a",{href:a.chat.url,target:"_blank",rel:"noreferrer",children:a.chat.name}):(0,l.jsx)("span",{className:"muted",children:e("home.notOpened")})}),(0,l.jsx)("td",{className:"muted small",children:t(a.createdAt)}),(0,l.jsx)("td",{children:(0,l.jsx)("button",{className:"quiet",onClick:()=>void M(a),disabled:!!a.running,title:e("home.delete"),children:e("home.delete")})})]},a.id)})})]})]})]})}function p(e){var t,n,s,c,u,p,g;let{sessions:b,selected:x,setSelected:j,onFailure:v,setOnFailure:f,fromPlan:y,batch:w,approvals:N,onChange:k,move:S}=e,{t:C}=(0,d.kj)(),[F,E]=(0,a.useState)(""),[H,W]=(0,a.useState)(""),[I,T]=(0,a.useState)(""),[R,D]=(0,a.useState)(""),[P,U]=(0,a.useState)(""),[L,q]=(0,a.useState)(null),[M,A]=(0,a.useState)([]);(0,a.useEffect)(()=>{r.FH.models().then(e=>{q(e),T(t=>t||e.defaultModel),D(t=>t||e.defaultReviewModel)}).catch(()=>void 0)},[]);let B=x.join(",");(0,a.useEffect)(()=>{let e=!1,t=B.split(",").filter(Boolean);if(0===t.length)return void A([]);let n=async()=>{let n=await Promise.all(t.map(async e=>{let t=await r.FH.vcsStatus(e).catch(()=>null);return{id:e,status:t}}));e||A(n.filter(e=>e.status&&!e.status.ok&&"off"!==e.status.problem).map(e=>{var t,n,l,a;return{name:null!=(l=null==(t=b.find(t=>t.id===e.id))?void 0:t.name)?l:e.id,problem:null!=(a=null==(n=e.status)?void 0:n.problem)?a:""}}))};n();let l=setInterval(()=>void n(),1e4);return()=>{e=!0,clearInterval(l)}},[B]);let O=new Map(b.map(e=>[e.id,e])),_=e=>e.tasks.filter(e=>"queued"===e.status).length,K=x.map(e=>O.get(e)).filter(e=>!!e),Z=K.filter(e=>_(e)>0&&!1!==e.active),z=Z.reduce((e,t)=>e+_(t),0),V=(null==w?void 0:w.running)===!0,Q=b.some(e=>e.running),G=V||0===Z.length||Q,J=Q?{title:"batch.oneRunning",why:"batch.oneRunningWhy"}:0===K.length?{title:"batch.pickFirst",why:"batch.pickFirstWhy"}:0===Z.length?{title:"batch.nothingRunnable",why:"batch.nothingRunnableWhy"}:null,X=(0,h.p)(),[Y,$]=(0,a.useState)(!1),ee=(0,a.useRef)(!1),et=async e=>{if(!ee.current){ee.current=!0,$(!0);try{await e()}catch(e){W(e.message)}finally{ee.current=!1,$(!1),k()}}},en=async e=>{("unattended"!==e||X||await (0,o.Z)(C("batch.unattendedConfirm",{n:Z.length})))&&await et(async()=>{var t;let n=await r.FH.startBatch(Z.map(e=>e.id),e,v,I||void 0,R||void 0,P.trim()||Z.map(e=>e.planName).find(Boolean)||void 0);E(""),W(n.started?"":null!=(t=n.reason)?t:"")})},el=K.filter(e=>{var t;return(null!=(t=e.model)?t:"")!==I}).length,ea=K.filter(e=>{var t;return(null==(t=e.review)?void 0:t.enabled)===!1}).length,es=null!=(s=null==L?void 0:L.options)?s:[],ei=es.filter(e=>!e.group),er=new Map;for(let e of es)e.group&&er.set(e.group,[...null!=(c=er.get(e.group))?c:[],e]);let ec=w?{done:w.sessions.filter(e=>"done"===e.state).length,failed:w.sessions.filter(e=>"failed"===e.state).length,skipped:w.sessions.filter(e=>"skipped"===e.state||"stopped"===e.state).length}:null,ed=null==w?void 0:w.sessions.find(e=>"running"===e.state);return(0,l.jsxs)("div",{className:"panel",children:[(0,l.jsx)("h2",{children:C("batch.title")}),(0,l.jsx)("p",{className:"muted small",children:C("batch.hint")}),!V&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"row",children:[(0,l.jsx)("strong",{className:"small",children:C("batch.selected",{n:Z.length,tasks:z})}),(0,l.jsx)("button",{className:"quiet",onClick:()=>j(b.filter(e=>_(e)>0).map(e=>e.id).reverse()),children:C("batch.selectQueued")}),(0,l.jsx)("button",{className:"quiet",onClick:()=>j([]),disabled:0===K.length,children:C("batch.selectNone")})]}),y&&(0,l.jsx)("p",{className:"muted small",children:C("batch.fromPlan")}),K.length>Z.length&&(0,l.jsx)("p",{className:"muted small",children:C("batch.notRunnable",{n:K.length-Z.length})}),Z.length>0&&(0,l.jsx)("ol",{className:"run-order",children:Z.map((e,t)=>(0,l.jsxs)("li",{children:[(0,l.jsxs)("span",{children:[e.name," ",(0,l.jsxs)("span",{className:"muted small",children:["(",_(e),")"]})]}),(0,l.jsxs)("span",{children:[(0,l.jsx)("button",{className:"quiet",onClick:()=>S(e.id,-1),disabled:0===t,"aria-label":C("batch.moveUp",{name:e.name}),children:"↑"}),(0,l.jsx)("button",{className:"quiet",onClick:()=>S(e.id,1),disabled:t===Z.length-1,"aria-label":C("batch.moveDown",{name:e.name}),children:"↓"})]})]},e.id))}),(0,l.jsx)("label",{htmlFor:"batch-run-name",children:C("batch.runName")}),(0,l.jsx)("input",{id:"batch-run-name",type:"text",value:P,onChange:e=>U(e.target.value),placeholder:null!=(u=Z.map(e=>e.planName).find(Boolean))?u:C("batch.runNamePlaceholder")}),(0,l.jsx)("p",{className:"why",children:C("batch.runNameWhy")}),(0,l.jsx)("label",{htmlFor:"batch-model",children:C("batch.model")}),(0,l.jsxs)("div",{className:"row",children:[(0,l.jsxs)("select",{id:"batch-model",value:I,onChange:e=>T(e.target.value),style:{width:"auto",minWidth:260},children:[(0,l.jsx)("option",{value:"",children:C("batch.modelKeep")}),ei.map(e=>(0,l.jsx)("option",{value:e.name,disabled:e.disabled,children:e.name},e.name)),[...er.entries()].map(e=>{let[t,n]=e;return(0,l.jsx)("optgroup",{label:t,children:n.map(e=>(0,l.jsx)("option",{value:e.name,disabled:e.disabled,children:e.name},e.name))},t)})]}),(null!=(p=null==L?void 0:L.options.length)?p:0)===0&&(0,l.jsx)("span",{className:"muted small",children:C("batch.modelNone")})]}),(0,l.jsx)("p",{className:"why",children:C("batch.modelWhy")}),(0,l.jsx)(m.L,{current:I,onUse:e=>T(e)}),I&&el>0&&(0,l.jsx)("p",{className:"why",style:{color:"var(--warn)"},children:C("batch.modelOverrides",{n:el})}),(0,l.jsx)("label",{htmlFor:"batch-review-model",children:C("batch.reviewModel")}),(0,l.jsx)("div",{className:"row",children:(0,l.jsxs)("select",{id:"batch-review-model",value:R,onChange:e=>D(e.target.value),style:{width:"auto",minWidth:260},children:[(0,l.jsx)("option",{value:"",children:C("batch.reviewModelKeep")}),ei.map(e=>(0,l.jsx)("option",{value:e.name,disabled:e.disabled,children:e.name},e.name)),[...er.entries()].map(e=>{let[t,n]=e;return(0,l.jsx)("optgroup",{label:t,children:n.map(e=>(0,l.jsx)("option",{value:e.name,disabled:e.disabled,children:e.name},e.name))},t)})]})}),(0,l.jsx)("p",{className:"why",children:C("batch.reviewModelWhy")}),""!==R&&R===I&&(0,l.jsx)("p",{className:"why",style:{color:"var(--warn)"},children:C("batch.reviewSame")}),ea>0&&(0,l.jsx)("p",{className:"why",children:C("batch.reviewOffIn",{n:ea})}),(0,l.jsxs)("fieldset",{style:{border:0,padding:0,margin:"10px 0 14px"},children:[(0,l.jsx)("legend",{className:"muted small",style:{padding:0},children:C("batch.onFailure")}),(0,l.jsxs)("div",{className:"option",children:[(0,l.jsxs)("label",{children:[(0,l.jsx)("input",{type:"radio",name:"batch-fail",checked:"stop"===v,onChange:()=>f("stop")}),(0,l.jsx)("span",{children:C("batch.chain")})]}),(0,l.jsx)("p",{className:"why",children:C("batch.chainWhy")})]}),(0,l.jsxs)("div",{className:"option",children:[(0,l.jsxs)("label",{children:[(0,l.jsx)("input",{type:"radio",name:"batch-fail",checked:"continue"===v,onChange:()=>f("continue")}),(0,l.jsx)("span",{children:C("batch.independent")})]}),(0,l.jsx)("p",{className:"why",children:C("batch.independentWhy")})]})]}),J&&(0,l.jsxs)("div",{className:"notice caution",children:[(0,l.jsx)("strong",{children:C(J.title)}),(0,l.jsx)("div",{className:"small",style:{marginTop:4},children:C(J.why)})]}),M.length>0&&(0,l.jsxs)("div",{className:"notice caution",children:[(0,l.jsx)("strong",{children:C("batch.vcsProblem")}),(0,l.jsx)("ul",{children:M.map(e=>(0,l.jsx)("li",{children:C("batch.vcsProblemRow",{name:e.name,problem:e.problem})},e.name))}),(0,l.jsx)("div",{className:"muted small",children:C("batch.vcsProblemWhy")})]}),H&&(0,l.jsxs)("div",{className:"notice caution",role:"alert",children:[(0,l.jsx)("strong",{children:C("batch.notStartedTitle")}),(0,l.jsx)("div",{className:"small",style:{marginTop:4},children:H}),/execution\.isolation/.test(H)&&(0,l.jsx)("div",{className:"small",style:{marginTop:4},children:(0,l.jsx)(i(),{href:"/defaults",children:C("batch.notStartedIsolation")})})]}),(0,l.jsxs)("div",{className:"run-choice",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("button",{className:"primary",onClick:()=>void en("unattended"),disabled:Y||G,children:C("batch.run",{n:Z.length})}),(0,l.jsx)("p",{className:"why",children:C("batch.runWhy")})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("button",{onClick:()=>void en("confirm"),disabled:Y||G,children:C("batch.runStep")}),(0,l.jsx)("p",{className:"why",children:C("batch.runStepWhy")})]})]})]}),V&&(0,l.jsxs)("div",{className:"row",children:[(null==w?void 0:w.pausing)?(0,l.jsx)("button",{className:"primary",onClick:()=>void et(async()=>{await r.FH.resumeBatch(),E("")}),disabled:Y||(null==w?void 0:w.stopping),title:C("batch.resumeWhy"),children:C("batch.resume")}):(0,l.jsx)("button",{onClick:()=>void et(async()=>{await r.FH.pauseBatch(),E(C("batch.pausing"))}),disabled:Y||(null==w?void 0:w.stopping),title:C("batch.pauseWhy"),children:C("batch.pause")}),(0,l.jsx)("button",{onClick:()=>void et(async()=>{await r.FH.stopBatch(),E(C("batch.stopping"))}),disabled:Y||(null==w?void 0:w.stopping),title:C("batch.stopWhy"),children:C("batch.stop")}),(null==w?void 0:w.pausing)&&!(null==w?void 0:w.stopping)&&(0,l.jsx)("span",{className:"muted small",children:C("batch.pausing")}),(0,l.jsx)("span",{className:"badge",children:C("batch.modelRunning",{name:(ed?(null==(t=O.get(ed.sessionId))?void 0:t.modelInUse)||(null==(n=O.get(ed.sessionId))?void 0:n.model):"")||C("model.default")})}),N.length>0&&(0,l.jsx)("span",{className:"badge waiting-approval",children:C("batch.waiting",{n:N.length})}),ed&&(0,l.jsx)("span",{className:"small",children:C("batch.progress",{name:ed.name,done:w.sessions.filter(e=>"waiting"!==e.state&&"running"!==e.state).length,total:w.sessions.length})})]}),V&&(0,l.jsx)("p",{className:"muted small",children:C("batch.hiddenWhileRunning")}),F&&(0,l.jsx)("div",{className:"muted small",role:"status",children:F}),(K.length>0||w)&&(0,l.jsxs)("div",{className:"row",style:{marginTop:12},children:[(0,l.jsx)("a",{className:"button-link",href:r.FH.debugExportUrl(K.length>0?K.map(e=>e.id):(null!=(g=null==w?void 0:w.sessions)?g:[]).map(e=>e.sessionId)),children:C("batch.debug")}),(0,l.jsx)("span",{className:"muted small",children:K.length>0?C("batch.debugSelected",{n:K.length}):C("batch.debugLast")})]}),(K.length>0||w)&&(0,l.jsx)("p",{className:"why",children:C("batch.debugWhy")}),w&&(0,l.jsxs)(l.Fragment,{children:[!V&&ec&&(0,l.jsx)("div",{className:"notice calm",style:{marginTop:12},children:(0,l.jsx)("strong",{children:C("batch.finished",ec)})}),(0,l.jsxs)("table",{style:{marginTop:10},children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{children:C("batch.col.session")}),(0,l.jsx)("th",{children:C("batch.col.state")}),(0,l.jsx)("th",{children:C("batch.col.ran")}),(0,l.jsx)("th",{children:C("batch.col.why")})]})}),(0,l.jsx)("tbody",{children:w.sessions.map(e=>{var t,n;return(0,l.jsxs)("tr",{className:"batch-row ".concat(e.state),children:[(0,l.jsx)("td",{children:(0,l.jsx)(i(),{href:(0,r.aT)(e.sessionId),children:e.name})}),(0,l.jsx)("td",{children:(0,l.jsx)("span",{className:"badge ".concat("running"===(n=e.state)?"running":"done"===n?"done":"failed"===n?"failed":"stopped"===n?"aborted":""),children:C("batch.state.".concat(e.state))})}),(0,l.jsx)("td",{className:"small",children:C("batch.ranOf",{ran:e.ran,failed:e.failed})}),(0,l.jsx)("td",{className:"muted small",children:null!=(t=e.reason)?t:""})]},e.sessionId)})})]})]})]})}},4811:(e,t,n)=>{"use strict";n.d(t,{p:()=>s});var l=n(1521),a=n(5549);function s(){let[e,t]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=!0;return a.FH.settings().then(n=>{var l;let a=null!=(l=n.raw.execution)?l:{};e&&t("unattended"===a.mode)}).catch(()=>void 0),()=>{e=!1}},[]),e}},4969:(e,t,n)=>{"use strict";n.d(t,{V:()=>s});var l=n(1521);let a='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function s(e,t,n){(0,l.useEffect)(()=>{var l,s;if(!t)return;let i=document.activeElement instanceof HTMLElement?document.activeElement:null,r=e.current,c=null!=(s=null!=(l=null==n?void 0:n.current)?l:null==r?void 0:r.querySelector(a))?s:null;null==c||c.focus();let d=e=>{if("Tab"!==e.key||!r)return;let t=Array.from(r.querySelectorAll(a)).filter(e=>null!==e.offsetParent);if(0===t.length)return;let n=t[0],l=t[t.length-1],s=r.contains(document.activeElement);e.shiftKey&&(document.activeElement===n||!s)?(e.preventDefault(),l.focus()):e.shiftKey||document.activeElement!==l&&s||(e.preventDefault(),n.focus())};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d),i&&document.contains(i)&&i.focus()}},[e,t,n])}},5704:(e,t,n)=>{Promise.resolve().then(n.bind(n,2114))},7527:(e,t,n)=>{"use strict";n.d(t,{z:()=>a});var l=n(1521);function a(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=(0,l.useRef)(e);a.current=e,(0,l.useEffect)(()=>{let e;if(!n)return;let l=!1,s=async()=>{try{await a.current()}catch(e){}finally{l||(e=setTimeout(()=>void s(),t))}};return s(),()=>{l=!0,e&&clearTimeout(e)}},[t,n])}},8848:(e,t,n)=>{"use strict";n.d(t,{H4:()=>d,L:()=>o,z4:()=>h});var l=n(3365),a=n(8197),s=n.n(a),i=n(1521),r=n(5549),c=n(867);function d(e){let{current:t,onUse:n}=e,{t:a}=(0,c.kj)(),[s,d]=(0,i.useState)(null);if((0,i.useEffect)(()=>{let e=!1;return r.FH.project().then(t=>{e||d(t)}).catch(()=>void 0),()=>{e=!0}},[]),!s)return null;let o=s.rootDir.trim(),h=t.trim().toLowerCase(),m=n?s.others.filter(e=>e.rootDir.trim().toLowerCase()!==h):[];return(0,l.jsx)(u,{label:o?a("proj.defaultIs",{dir:o}):a("proj.noneShort"),offer:o&&n&&h!==o.toLowerCase()?{text:a("proj.useIt"),onUse:()=>n(o)}:void 0,more:m.map(e=>({text:a("proj.otherUse",{name:e.name}),title:e.rootDir,onUse:()=>null==n?void 0:n(e.rootDir)})),link:o?a("proj.change"):a("proj.setIt"),anchor:"project"})}function o(e){let{current:t,onUse:n}=e,a=m(),{t:s}=(0,c.kj)();if(!a)return null;let i=a.defaultModel.trim();return(0,l.jsx)(u,{label:i?s("def.modelDefaultIs",{name:i}):s("def.modelNoneShort"),offer:i&&n&&t.trim()!==i?{text:s("def.modelUseIt"),onUse:()=>n(i)}:void 0,link:s(i?"proj.change":"proj.setIt"),anchor:"model"})}function h(e){let{current:t,onUse:n}=e,a=m(),{t:s}=(0,c.kj)();if(!a)return null;let i=a.defaultReviewModel.trim();return(0,l.jsx)(u,{label:i?s("def.reviewDefaultIs",{name:i}):s("def.reviewNoneShort"),offer:i&&n&&t.trim()!==i?{text:s("def.modelUseIt"),onUse:()=>n(i)}:void 0,link:s(i?"proj.change":"proj.setIt"),anchor:"review"})}function m(){let[e,t]=(0,i.useState)(null);return(0,i.useEffect)(()=>{let e=!1;return r.FH.models().then(n=>{e||t(n)}).catch(()=>void 0),()=>{e=!0}},[]),e}function u(e){let{label:t,offer:n,more:a=[],link:i,anchor:r}=e;return(0,l.jsxs)("p",{className:"muted small",style:{marginTop:4},children:[t," ",n&&(0,l.jsxs)(l.Fragment,{children:["\xb7"," ",(0,l.jsx)("button",{type:"button",className:"linkish",onClick:n.onUse,children:n.text})," "]}),a.map(e=>(0,l.jsxs)("span",{children:["\xb7"," ",(0,l.jsx)("button",{type:"button",className:"linkish",onClick:e.onUse,title:e.title,children:e.text})," "]},e.text)),"\xb7 ",(0,l.jsx)(s(),{href:"/defaults#".concat(r),children:i})]})}}},e=>{e.O(0,[197,867,549,347,131,358],()=>e(e.s=5704)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[66],{1205:(e,s,a)=>{"use strict";a.d(s,{AppearanceProvider:()=>m,KP:()=>h,themeScript:()=>c});var n=a(3365),t=a(1521);let l=["small","normal","large","huge","giant"],i={theme:"light",textSize:"normal",highContrast:!1,reduceMotion:!1,underlineLinks:!1,strongFocus:!1},r="cop.appearance",c="\n(function () {\n try {\n var d = document.documentElement;\n var raw = localStorage.getItem('".concat(r,"');\n var a = raw ? JSON.parse(raw) : {};\n if (!a || typeof a !== 'object') a = {};\n d.dataset.theme = a.theme === 'dark' ? 'dark' : 'light';\n d.dataset.textsize = ").concat(JSON.stringify(l),".indexOf(a.textSize) >= 0 ? a.textSize : 'normal';\n d.dataset.contrast = a.highContrast ? 'high' : 'normal';\n d.dataset.motion = a.reduceMotion ? 'reduced' : 'normal';\n d.dataset.links = a.underlineLinks ? 'underline' : 'plain';\n d.dataset.focus = a.strongFocus ? 'strong' : 'normal';\n } catch (e) {}\n})();\n");function d(e){let s=document.documentElement;s.dataset.theme=e.theme,s.dataset.textsize=e.textSize,s.dataset.contrast=e.highContrast?"high":"normal",s.dataset.motion=e.reduceMotion?"reduced":"normal",s.dataset.links=e.underlineLinks?"underline":"plain",s.dataset.focus=e.strongFocus?"strong":"normal"}let o=(0,t.createContext)({appearance:i,set:()=>void 0,reset:()=>void 0,loaded:!1});function m(e){let{children:s}=e,[a,c]=(0,t.useState)(i),[m,h]=(0,t.useState)(!1);(0,t.useEffect)(()=>{let e=i;try{let s=window.localStorage.getItem(r);s?e=function(e){let s=e&&"object"==typeof e?e:{},a=(e,s)=>"boolean"==typeof e?e:s;return{theme:"dark"===s.theme?"dark":"light"===s.theme?"light":i.theme,textSize:l.includes(s.textSize)?s.textSize:i.textSize,highContrast:a(s.highContrast,i.highContrast),reduceMotion:a(s.reduceMotion,i.reduceMotion),underlineLinks:a(s.underlineLinks,i.underlineLinks),strongFocus:a(s.strongFocus,i.strongFocus)}}(JSON.parse(s)):window.matchMedia("(prefers-color-scheme: dark)").matches&&(e={...e,theme:"dark"}),window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!s&&(e={...e,reduceMotion:!0})}catch(e){}c(e),d(e),h(!0)},[]);let u=(0,t.useCallback)(e=>{c(s=>{let a={...s,...e};d(a);try{window.localStorage.setItem(r,JSON.stringify(a))}catch(e){}return a})},[]),p=(0,t.useCallback)(()=>{c(i),d(i);try{window.localStorage.removeItem(r)}catch(e){}},[]);return(0,n.jsx)(o.Provider,{value:{appearance:a,set:u,reset:p,loaded:m},children:s})}function h(){return(0,t.useContext)(o)}},1702:(e,s,a)=>{"use strict";var n=a(9962);a.o(n,"usePathname")&&a.d(s,{usePathname:function(){return n.usePathname}}),a.o(n,"useSearchParams")&&a.d(s,{useSearchParams:function(){return n.useSearchParams}})},1772:(e,s,a)=>{Promise.resolve().then(a.bind(a,2438))},2285:(e,s,a)=>{"use strict";a.d(s,{b:()=>r});var n=a(3365),t=a(1521),l=a(5549),i=a(867);function r(e){var s,a;let{dir:r}=e,{t:c}=(0,i.kj)(),d=(0,i.W3)(),[o,m]=(0,t.useState)(null),[h,u]=(0,t.useState)(""),[p,v]=(0,t.useState)(""),x=async()=>{u("");try{m(await l.FH.syncPlan(r))}catch(e){u(e.message)}},j=async(e,s)=>{try{await navigator.clipboard.writeText(s),v(e),window.setTimeout(()=>v(""),2500)}catch(e){u(c("plan.copyFailed"))}},g=e=>(0,n.jsxs)("ul",{style:{margin:"2px 0 6px",paddingLeft:20},children:[e.slice(0,30).map(e=>(0,n.jsx)("li",{children:(0,n.jsx)("code",{children:e})},e)),e.length>30&&(0,n.jsx)("li",{className:"muted",children:c("sync.more",{n:e.length-30})})]});return(0,n.jsxs)("div",{className:"sync-command small",style:{marginTop:8},children:[(0,n.jsx)("button",{type:"button",onClick:()=>void x(),children:c("sync.show")}),h&&(0,n.jsx)("p",{className:"err",children:h}),o&&!o.ok&&(0,n.jsx)("p",{className:"err",children:o.problem}),(null==o?void 0:o.ok)&&(0,n.jsxs)("div",{className:"notice caution",style:{marginTop:8},children:[(0,n.jsxs)("p",{children:[c("sync.what",{branch:null!=(s=o.branch)?s:"",target:null!=(a=o.target)?a:""})," ",(0,n.jsx)("span",{className:"muted",children:o.lastFetched?c("sync.fetchedAt",{when:d(o.lastFetched)}):c("sync.neverFetched")})]}),o.willLose.commits.length+o.willLose.changed.length+o.willLose.untracked.length===0?(0,n.jsx)("p",{children:c("sync.nothingLost")}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("strong",{children:c("sync.loses")}),o.willLose.commits.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{children:c("sync.commits",{n:o.willLose.commits.length})}),g(o.willLose.commits)]}),o.willLose.changed.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{children:c("sync.changed",{n:o.willLose.changed.length})}),g(o.willLose.changed)]}),o.willLose.untracked.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{children:c("sync.untracked",{n:o.willLose.untracked.length})}),g(o.willLose.untracked)]})]}),(0,n.jsx)("p",{className:"muted",children:c("sync.keeps")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{type:"button",onClick:()=>void j("preview",o.preview),children:c("sync.copyPreview")}),"preview"===p&&(0,n.jsx)("span",{className:"badge done",children:c("plan.copied")})]}),(0,n.jsx)("pre",{className:"sync-cmd",children:o.preview}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{type:"button",className:"danger",onClick:()=>void j("command",o.command),children:c("sync.copyCommand")}),"command"===p&&(0,n.jsx)("span",{className:"badge done",children:c("plan.copied")})]}),(0,n.jsx)("pre",{className:"sync-cmd",children:o.command}),(0,n.jsx)("p",{className:"muted",children:c("sync.howToRun")})]})]})}},2438:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>S});var n=a(3365),t=a(1521),l=a(1702),i=a(8197),r=a.n(i),c=a(5549),d=a(867),o=a(1910),m=a(3523),h=a(3374),u=a(1205),p=a(8848),v=a(4784),x=a(2876),j=a(5132),g=a(1035),f=a(8934),b=a(4811),y=a(3041),k=a(7527),N=a(1366),w=a(2285);function S(){return(0,n.jsx)(t.Suspense,{fallback:null,children:(0,n.jsx)(C,{})})}function C(){var e;let{t:s}=(0,d.kj)(),a=null!=(e=(0,l.useSearchParams)().get("id"))?e:"",[i,o]=(0,t.useState)(null),[m,h]=(0,t.useState)([]),[u,p]=(0,t.useState)([]),[v,x]=(0,t.useState)(null),[j,g]=(0,t.useState)(""),[f,b]=(0,t.useState)(!1),y=(0,t.useRef)(null),N=(0,t.useRef)(0),w=(0,t.useCallback)(async()=>{if(!a)return;let e=++N.current;try{let s=await c.FH.session(a);if(e!==N.current)return;o(s),g("")}catch(s){if(e!==N.current)return;g(s.message)}},[a]),S=(0,t.useCallback)(()=>{y.current||(y.current=window.setTimeout(()=>{y.current=null,w()},400))},[w]);if((0,t.useEffect)(()=>{if(!a)return;c.FH.presets().then(p).catch(()=>void 0),c.FH.level1().then(x).catch(()=>void 0);let e=new EventSource(c.FH.streamUrl(a));return e.onopen=()=>b(!1),e.onmessage=e=>{let s;try{s=JSON.parse(e.data)}catch(e){return}"ping"!==s.type&&(h(e=>[...e.slice(-400),s]),S())},e.onerror=()=>{e.readyState===EventSource.CLOSED&&b(!0)},()=>{e.close()}},[a,S]),(0,k.z)(w,8e3,!!a),!a)return(0,n.jsx)("div",{className:"panel err",children:s("session.noId")});if(j&&!i)return(0,n.jsx)("div",{className:"panel err",children:j});if(!i)return(0,n.jsx)("div",{className:"panel muted",children:s("home.loading")});let C=i.tasks.filter(e=>"queued"===e.status).length;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"crumbs",children:[(0,n.jsx)(r(),{href:"/",children:s("session.crumb")})," / ",i.name]}),j&&(0,n.jsx)("div",{className:"panel err",role:"alert",children:s("session.stale",{err:j})}),f&&!j&&(0,n.jsx)("div",{className:"panel muted small",role:"status",children:s("session.streamClosed")}),(0,n.jsx)(F,{session:i,queued:C,onChange:w}),(0,n.jsx)(E,{tasks:i.tasks}),(0,n.jsx)(L,{session:i,onChange:w}),(0,n.jsx)(I,{level1:v,sent:i.contractSent}),(0,n.jsx)(T,{session:i,onChange:w}),(0,n.jsx)(M,{session:i,onChange:w}),(0,n.jsxs)("div",{className:"panel",children:[(0,n.jsx)("h2",{children:s("tasks.title")}),(0,n.jsx)("p",{className:"muted small",children:s("tasks.hint")}),(0,n.jsx)(H,{session:i,onChange:w}),0===i.tasks.length&&(0,n.jsx)("div",{className:"muted",children:s("tasks.none")}),i.tasks.map((e,s)=>(0,n.jsx)(B,{session:i,task:e,index:s+1,presets:u,onChange:w},e.id))]}),(0,n.jsx)(R,{session:i}),(0,n.jsx)(W,{session:i,presets:u,onAdded:w,onPresetsChanged:()=>c.FH.presets().then(p)}),(0,n.jsx)(A,{events:m})]})}function F(e){var s;let{session:a,queued:l,onChange:i}=e,{t:r}=(0,d.kj)(),[o,m]=(0,t.useState)(""),[h,u]=(0,t.useState)("");(0,t.useEffect)(()=>{c.FH.models().then(e=>{var s;return u(null!=(s=e.defaultModel)?s:"")}).catch(()=>void 0)},[]);let[p,v]=(0,t.useState)(a.name),[x,j]=(0,t.useState)(null!=(s=a.conversationGroup)?s:"");(0,t.useEffect)(()=>v(a.name),[a.name]),(0,t.useEffect)(()=>{var e;return j(null!=(e=a.conversationGroup)?e:"")},[a.conversationGroup]);let f=(0,b.p)(),[y,k]=(0,t.useState)(!1),N=(0,t.useRef)(!1),w=async e=>{if(!N.current){N.current=!0,k(!0);try{await e()}catch(e){m(e.message)}finally{N.current=!1,k(!1),i()}}},S=async e=>{("unattended"!==e||f||await (0,g.Z)(r("session.unattendedConfirm")))&&await w(async()=>{var s;let n=await c.FH.start(a.id,e,a.planName);m(n.started?r("unattended"===e?"session.startedAuto":"session.startedStep"):r("session.notStarted",{reason:null!=(s=n.reason)?s:""}))})},C=async()=>{if(a.running)return void m(r("home.deleteRunning"));if(await (0,g.Z)(r("home.deleteConfirm",{name:a.name,n:a.tasks.length})))try{await c.FH.deleteSession(a.id),window.location.href="/"}catch(e){m(e.message)}},F=async()=>{var e;if(x.trim()!==(null!=(e=a.conversationGroup)?e:""))try{await c.FH.updateSession(a.id,{conversationGroup:x.trim()}),m(r("session.groupSaved")),i()}catch(e){m(e.message)}},I=a.running?r("state.running"):r("state.".concat(a.status));return(0,n.jsxs)("div",{className:"panel",children:[(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("input",{type:"text",className:"grow","aria-label":r("home.col.name"),value:p,onChange:e=>v(e.target.value),onBlur:()=>void w(async()=>{p.trim()&&p!==a.name&&await c.FH.updateSession(a.id,{name:p})})}),(0,n.jsx)("span",{className:"badge ".concat(a.running?"running":""),children:I})]}),!a.running&&(0,n.jsxs)("div",{className:"run-choice",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("button",{className:"primary",onClick:()=>void S("unattended"),disabled:y||0===l,children:r("session.run",{n:l})}),(0,n.jsx)("p",{className:"why",children:r("session.runWhy")})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("button",{onClick:()=>void S("confirm"),disabled:y||0===l,children:r("session.runStep")}),(0,n.jsx)("p",{className:"why",children:r("session.runStepWhy")})]})]}),(0,n.jsxs)("div",{className:"row",style:{marginTop:10},children:[a.running&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{className:"danger",onClick:()=>void w(async()=>{await c.FH.stop(a.id),m(r("session.stopping"))}),disabled:y,children:r("session.stop")}),"unattended"===a.runMode&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"badge waiting-approval",children:r("session.modeUnattended")}),(0,n.jsx)("button",{onClick:()=>void w(async()=>{await c.FH.setRunMode(a.id,"confirm"),m(r("session.askingAgain"))}),disabled:y,children:r("session.askAgain")})]})]}),(0,n.jsx)("span",{className:"muted small",children:o}),(0,n.jsx)("span",{className:"grow"}),(0,n.jsx)("button",{className:"quiet",onClick:()=>void C(),disabled:a.running,children:r("home.delete")}),a.chat?(0,n.jsx)("a",{href:a.chat.url,target:"_blank",rel:"noreferrer",className:"small",children:r("session.openChat",{name:a.chat.name})}):(0,n.jsx)("span",{className:"muted small",children:r("session.noChat")})]}),(0,n.jsx)("label",{htmlFor:"session-group",children:r("session.group")}),(0,n.jsx)("div",{className:"row",children:(0,n.jsx)("input",{id:"session-group",type:"text",className:"grow",value:x,placeholder:r("session.groupPlaceholder"),onChange:e=>j(e.target.value),onBlur:()=>void F(),disabled:a.running})}),(0,n.jsxs)("p",{className:"why",children:[r("session.groupWhy"),a.chat&&" ".concat(r("session.groupHasChat"))]}),(0,n.jsx)("div",{className:"muted small",style:{marginTop:10},children:r("session.willUseModel",{name:a.model||(h?r("model.followsDefault",{name:h}):r("model.default"))})})]})}function I(e){var s;let{level1:a,sent:t}=e,{t:l}=(0,d.kj)();return(0,n.jsxs)("div",{className:"panel",children:[(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("h2",{className:"grow",style:{margin:0},children:l("l1.title")}),(0,n.jsx)("span",{className:"badge",children:l(t?"l1.sent":"l1.notSent")}),(0,n.jsx)(r(),{href:"/level1",className:"small",children:l("l1.edit")})]}),(0,n.jsxs)("p",{className:"muted small",style:{marginBottom:6},children:[l("l1.hint"),(null==a?void 0:a.customised)?" ".concat(l("l1.customised")):""]}),(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:l("l1.show")}),(0,n.jsx)("pre",{className:"tall",children:null!=(s=null==a?void 0:a.content)?s:"…"})]})]})}function L(e){var s,a,l,i;let{session:r,onChange:o}=e,{t:m}=(0,d.kj)(),h=(0,d.W3)(),[u,v]=(0,t.useState)(null),[x,j]=(0,t.useState)(!1),[f,b]=(0,t.useState)("");(0,t.useEffect)(()=>{c.FH.models().then(v).catch(()=>void 0)},[]);let y=async e=>{try{await c.FH.updateSession(r.id,{model:e}),b(e?m("model.saved",{name:e}):m("model.savedDefault")),o()}catch(e){b(e.message)}},k=async()=>{try{let e=await c.FH.setDefaultModel(w);v(s=>s?{...s,defaultModel:e.defaultModel}:s),b(e.defaultModel?m("model.defaultSaved",{name:e.defaultModel}):m("model.defaultCleared"))}catch(e){b(e.message)}},N=async()=>{if(await (0,g.Z)(m("model.refreshConfirm"))){j(!0),b(m("model.refreshing"));try{var e;let s=await c.FH.refreshModels();v(s),b(0===s.options.length?null!=(e=s.note)?e:m("model.none"):m("model.refreshed",{n:s.options.length}))}catch(e){b(e.message)}finally{j(!1)}}},w=null!=(s=r.model)?s:"",S=null!=(a=null==u?void 0:u.options)?a:[],C=S.some(e=>e.name===w),F=S.filter(e=>!e.group),I=new Map;for(let e of S)e.group&&I.set(e.group,[...null!=(l=I.get(e.group))?l:[],e]);return(0,n.jsxs)("div",{className:"panel",children:[(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("h2",{className:"grow",style:{margin:0},children:m("model.title")}),r.modelInUse&&(0,n.jsx)("span",{className:"chip",children:m("model.lastUsed",{name:r.modelInUse})})]}),(0,n.jsx)("p",{className:"muted small",children:m("model.hint")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsxs)("select",{"aria-label":m("model.title"),value:w,disabled:r.running,onChange:e=>void y(e.target.value),style:{width:"auto",minWidth:260},children:[(0,n.jsx)("option",{value:"",children:(null==u?void 0:u.defaultModel)?m("model.followsDefault",{name:u.defaultModel}):m("model.default")}),w&&!C&&(0,n.jsx)("option",{value:w,children:m("model.notInList",{name:w})}),F.map(e=>(0,n.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(m("model.unavailable")):""]},e.name)),[...I.entries()].map(e=>{let[s,a]=e;return(0,n.jsx)("optgroup",{label:s,children:a.map(e=>(0,n.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(m("model.unavailable")):""]},e.name))},s)})]}),(0,n.jsx)("button",{onClick:()=>void N(),disabled:x||r.running,children:m("model.refresh")}),(0,n.jsx)("span",{className:"muted small",role:"status",children:f})]}),(0,n.jsx)(p.L,{current:w,onUse:e=>void y(e)}),(0,n.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,n.jsx)("span",{className:"muted small",children:(null==u?void 0:u.defaultModel)?m("model.defaultIs",{name:u.defaultModel}):m("model.defaultIsNone")}),(0,n.jsx)("button",{onClick:()=>void k(),disabled:w===(null!=(i=null==u?void 0:u.defaultModel)?i:""),children:w?m("model.makeDefault",{name:w}):m("model.clearDefault")})]}),(null==u?void 0:u.readAt)?(0,n.jsxs)("p",{className:"muted small",style:{marginTop:8},children:[m("model.readAt",{t:h(u.readAt),n:u.options.length}),u.current?" ".concat(m("model.chatWasOn",{name:u.current})):"",u.note?" ".concat(u.note):""]}):(0,n.jsx)("p",{className:"muted small",style:{marginTop:8},children:m("model.neverRead")}),S.length>0&&(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:m("model.showDetails")}),(0,n.jsx)("pre",{className:"tall",children:S.map(e=>"".concat(e.selected?"*":" "," ").concat(e.group?"".concat(e.group," > "):"").concat(e.name)+"".concat(e.disabled?" [unavailable]":"","\n ").concat(e.raw.replace(/\n/g," | "))).join("\n")})]})]})}function M(e){var s,a;let{session:l,onChange:i}=e,{t:r}=(0,d.kj)(),o=null!=(s=l.review)?s:{enabled:!0,model:""},[m,h]=(0,t.useState)(o.enabled),[u,x]=(0,t.useState)(null!=(a=o.model)?a:""),[j,g]=(0,t.useState)(""),[f,b]=(0,t.useState)(!1),[y,k]=(0,t.useState)("");(0,t.useEffect)(()=>{c.FH.models().then(e=>{var s;return k(null!=(s=e.defaultReviewModel)?s:"")}).catch(()=>void 0)},[]);let N=async()=>{b(!0),g("");try{await c.FH.updateSession(l.id,{review:{enabled:m,model:u}}),g(r("review.saved")),i()}catch(e){g(e.message)}finally{b(!1)}};return(0,n.jsxs)("div",{className:"panel",children:[(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("h2",{className:"grow",style:{margin:0},children:r("review.title")}),(0,n.jsx)("span",{className:"badge ".concat(m?"done":""),children:m?r("review.on"):r("review.off")})]}),(0,n.jsx)("p",{className:"muted small",children:r("review.hint")}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:m,onChange:e=>h(e.target.checked),disabled:l.running}),(0,n.jsx)("span",{children:r("review.enable")})]}),(0,n.jsx)("p",{className:"why",children:r("review.enableWhy")})]}),(0,n.jsx)("label",{htmlFor:"review-model",children:r("review.modelField")}),(0,n.jsx)("div",{className:"row",children:(0,n.jsx)(v.Y,{id:"review-model",chosen:u,onChange:x,none:y?r("model.followsDefault",{name:y}):r("review.modelSame"),disabled:l.running||!m})}),(0,n.jsx)("p",{className:"why",children:r("review.modelWhy")}),(0,n.jsx)(p.z4,{current:u,onUse:e=>x(e)}),(0,n.jsxs)("div",{className:"row",style:{marginTop:10},children:[(0,n.jsx)("button",{className:"primary",onClick:()=>void N(),disabled:f||l.running,children:r("review.save")}),j&&(0,n.jsx)("span",{className:"muted small",children:j})]})]})}function T(e){var s,a,l,i,r,o,m,h,u,v,x,j,g,f,b,y,k;let{session:N,onChange:S}=e,{t:C}=(0,d.kj)(),F=null!=(a=N.vcs)?a:{enabled:!0,repoDir:"",branchMode:"per-task",commitOnFinish:!0,branchPrefix:"cop/"},[I,L]=(0,t.useState)(F.repoDir),[M,T]=(0,t.useState)(null),[H,P]=(0,t.useState)(""),[R,D]=(0,t.useState)(!1),W=JSON.stringify(F),[B,A]=(0,t.useState)(null),[O,E]=(0,t.useState)(null!=(l=F.branchName)?l:"");(0,t.useEffect)(()=>{var e;return E(null!=(e=JSON.parse(W).branchName)?e:"")},[W]);let[U,q]=(0,t.useState)(null!=(i=F.baseBranch)?i:"");(0,t.useEffect)(()=>{var e;return q(null!=(e=JSON.parse(W).baseBranch)?e:"")},[W]);let[z,G]=(0,t.useState)(null!=(r=F.existingBranch)?r:"");(0,t.useEffect)(()=>{var e;return G(null!=(e=JSON.parse(W).existingBranch)?e:"")},[W]);let J=null!=(o=F.startFrom)?o:"head";(0,t.useEffect)(()=>{L(JSON.parse(W).repoDir)},[W]);let Z=JSON.parse(W).repoDir||N.projectDir||"";(0,t.useEffect)(()=>{let e=!1;return Z.trim()?(c.FH.repoCheck(Z).then(s=>{var a;e||A(s.ok?null:null!=(a=s.problem)?a:null)}).catch(()=>{e||A(null)}),()=>{e=!0}):void A(null)},[Z]);let _=(0,t.useCallback)(()=>{c.FH.vcsStatus(N.id).then(T).catch(()=>T(null))},[N.id]);(0,t.useEffect)(_,[_,W]);let K=async e=>{try{await c.FH.updateSession(N.id,{vcs:e}),P(C("vcs.saved")),S(),_()}catch(e){P(e.message)}},Y=async()=>{D(!0),P(C("mirror.browsing"));try{let s=await c.FH.browseFolder(I.trim()||N.projectDir||void 0);if(s.ok)L(s.path),await K({repoDir:s.path});else{var e;P(s.cancelled?C("mirror.browseCancelled"):null!=(e=s.reason)?e:"")}}catch(e){P(e.message)}finally{D(!1)}},Q=F.repoDir||N.projectDir||"",V=""!==Q.trim()&&null===B;return(0,n.jsxs)("div",{className:"panel",children:[(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("h2",{className:"grow",style:{margin:0},children:C("vcs.title")}),(0,n.jsx)("span",{className:"badge ".concat(F.enabled?"done":""),children:F.enabled?C("vcs.on"):C("vcs.off")})]}),(0,n.jsx)("p",{className:"muted small",children:C("vcs.hint")}),(0,n.jsx)("label",{htmlFor:"vcs-root",children:C("vcs.repoField")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("input",{id:"vcs-root",type:"text",className:"grow",value:I,onChange:e=>L(e.target.value),onBlur:()=>I.trim()!==F.repoDir&&void K({repoDir:I.trim()}),placeholder:N.projectDir||"C:\\Projects\\my-app",disabled:N.running}),(0,n.jsx)("button",{onClick:()=>void Y(),disabled:R||N.running,children:C("mirror.browse")})]}),(0,n.jsx)(p.H4,{current:I,onUse:e=>{L(e),K({repoDir:e})}}),B&&(0,n.jsxs)("div",{className:"notice caution",style:{marginTop:8},children:[(0,n.jsx)("strong",{children:C("vcs.noRepo")}),(0,n.jsx)("div",{className:"small",style:{marginTop:4},children:B}),(0,n.jsx)("div",{className:"muted small",style:{marginTop:6},children:C("vcs.noRepoHow")})]}),!B&&""!==Q.trim()&&(0,n.jsx)("p",{className:"muted small",style:{marginTop:4},children:C("vcs.repoOk")}),""===Q.trim()&&(0,n.jsx)("p",{className:"muted small",style:{marginTop:4},children:C("vcs.pickFirst")}),(0,n.jsxs)("div",{className:"option".concat(V||F.enabled?"":" warned"),children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:F.enabled,onChange:e=>void K({enabled:e.target.checked}),disabled:N.running||!V&&!F.enabled}),(0,n.jsx)("span",{children:C("vcs.enable")})]}),(0,n.jsx)("p",{className:"why",children:C("vcs.enableWhy")})]}),F.enabled&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"muted small",style:{marginTop:4},children:Q?C("vcs.repoIs",{dir:Q}):C("vcs.repoNone")}),Q&&!B&&(0,n.jsx)(w.b,{dir:Q}),(0,n.jsx)("h3",{children:C("vcs.branches")}),"existing-branch"===J&&(0,n.jsx)("p",{className:"muted small",children:C("vcs.branchesExisting",{branch:F.existingBranch||"…"})}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"radio",name:"branchMode",checked:"per-task"===F.branchMode,onChange:()=>void K({branchMode:"per-task"}),disabled:N.running}),(0,n.jsx)("span",{children:C("vcs.perTask")})]}),(0,n.jsx)("p",{className:"why",children:C("vcs.perTaskWhy")})]}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"radio",name:"branchMode",checked:"per-session"===F.branchMode,onChange:()=>void K({branchMode:"per-session"}),disabled:N.running}),(0,n.jsx)("span",{children:C("vcs.perSession")})]}),(0,n.jsx)("p",{className:"why",children:C("vcs.perSessionWhy")})]}),"per-session"===F.branchMode&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("label",{htmlFor:"vcs-branch-name",children:C("vcs.branchName")}),(0,n.jsx)("input",{id:"vcs-branch-name",type:"text",value:O,onChange:e=>E(e.target.value),onBlur:()=>{var e;return O.trim()!==(null!=(e=F.branchName)?e:"")&&void K({branchName:O.trim()})},placeholder:N.name,disabled:N.running}),(0,n.jsx)("p",{className:"why",children:C("vcs.branchNameWhy")})]}),(0,n.jsx)("h3",{children:C("vcs.startFrom")}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"radio",name:"startFrom",checked:"branch"===J,onChange:()=>void K({startFrom:"branch"}),disabled:N.running}),(0,n.jsx)("span",{children:C("vcs.startBranch")})]}),(0,n.jsx)("p",{className:"why",children:C("vcs.startBranchWhy")})]}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"radio",name:"startFrom",checked:"previous-session"===J,onChange:()=>void K({startFrom:"previous-session"}),disabled:N.running}),(0,n.jsx)("span",{children:C("vcs.startPrevious")})]}),(0,n.jsx)("p",{className:"why",children:C("vcs.startPreviousWhy")})]}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"radio",name:"startFrom",checked:"head"===J,onChange:()=>void K({startFrom:"head"}),disabled:N.running}),(0,n.jsx)("span",{children:C("vcs.startHead")})]}),(0,n.jsx)("p",{className:"why",children:C("vcs.startHeadWhy")})]}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"radio",name:"startFrom",checked:"existing-branch"===J,onChange:()=>void K({startFrom:"existing-branch"}),disabled:N.running}),(0,n.jsx)("span",{children:C("vcs.startExisting")})]}),(0,n.jsx)("p",{className:"why",children:C("vcs.startExistingWhy")})]}),"existing-branch"===J&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("label",{htmlFor:"vcs-existing-branch",children:C("vcs.existingBranch")}),(0,n.jsx)("input",{id:"vcs-existing-branch",type:"text",list:"vcs-local-branches",value:z,onChange:e=>G(e.target.value),onBlur:()=>{var e;return z.trim()!==(null!=(e=F.existingBranch)?e:"")&&void K({existingBranch:z.trim()})},disabled:N.running}),(0,n.jsx)("datalist",{id:"vcs-local-branches",children:(null!=(m=null==M?void 0:M.branches)?m:[]).map(e=>(0,n.jsx)("option",{value:e},e))}),(0,n.jsx)("p",{className:"why",children:C("vcs.existingBranchWhy")}),F.existingBranch&&(null==M?void 0:M.branches)&&!M.branches.includes(F.existingBranch)&&(0,n.jsx)("p",{className:"err small",children:C("vcs.existingBranchMissing",{branch:F.existingBranch})})]}),("branch"===J||"previous-session"===J)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("label",{htmlFor:"vcs-base-branch",children:C("vcs.baseBranch")}),(0,n.jsx)("input",{id:"vcs-base-branch",type:"text",value:U,onChange:e=>q(e.target.value),onBlur:()=>{var e;return U.trim()!==(null!=(e=F.baseBranch)?e:"")&&void K({baseBranch:U.trim()})},placeholder:"main",disabled:N.running}),(0,n.jsx)("p",{className:"why",children:C("vcs.baseBranchWhy")})]}),N.vcsStart&&(0,n.jsxs)("p",{className:"muted small",children:["existing-branch"===N.vcsStart.kind?C("vcs.startedExisting",{branch:null!=(h=N.vcsStart.branch)?h:"",commit:N.vcsStart.commit.slice(0,8)}):"previous-session"===N.vcsStart.kind?C("vcs.startedPrevious",{name:null!=(u=null==(s=N.vcsStart.fromSession)?void 0:s.name)?u:"",branch:null!=(v=N.vcsStart.branch)?v:"",commit:N.vcsStart.commit.slice(0,8)}):"branch"===N.vcsStart.kind?C("vcs.startedBranch",{branch:null!=(x=N.vcsStart.branch)?x:"",commit:N.vcsStart.commit.slice(0,8)}):C("vcs.startedHead",{commit:N.vcsStart.commit.slice(0,8)}),N.vcsStart.note?" — ".concat(N.vcsStart.note):"",N.vcsStart.update&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("br",{}),"updated"===N.vcsStart.update.outcome?C("vcs.updated",{branch:N.vcsStart.update.branch,remote:null!=(j=N.vcsStart.update.remote)?j:"",from:(null!=(g=N.vcsStart.update.from)?g:"").slice(0,8),to:(null!=(f=N.vcsStart.update.to)?f:"").slice(0,8)}):"up-to-date"===N.vcsStart.update.outcome?C("vcs.upToDate",{branch:N.vcsStart.update.branch,remote:null!=(b=N.vcsStart.update.remote)?b:""}):C("vcs.notUpdated",{branch:N.vcsStart.update.branch,why:null!=(y=N.vcsStart.update.detail)?y:N.vcsStart.update.outcome})]})]}),"head"!==J&&(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:!1!==F.updateFromRemote,onChange:e=>void K({updateFromRemote:e.target.checked}),disabled:N.running}),(0,n.jsx)("span",{children:C("vcs.updateFromRemote")})]}),(0,n.jsx)("p",{className:"why",children:C("vcs.updateFromRemoteWhy")})]}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:F.commitOnFinish,onChange:e=>void K({commitOnFinish:e.target.checked}),disabled:N.running}),(0,n.jsx)("span",{children:C("vcs.commit")})]}),(0,n.jsx)("p",{className:"why",children:C("vcs.commitWhy")})]}),M&&!M.ok&&(0,n.jsxs)("div",{className:"notice caution",role:"status",children:[(0,n.jsx)("strong",{children:C("vcs.notReady")})," ",M.problem]}),(null==M?void 0:M.ok)&&(0,n.jsx)("div",{className:"muted small",children:C("vcs.ready",{branch:null!=(k=M.branch)?k:"—",dir:M.repoDir})}),(null==M?void 0:M.ok)&&M.work&&M.work.branches.length>0&&(0,n.jsxs)("div",{className:"muted small",children:["per-session"===M.work.mode&&M.work.complete?C("vcs.completeOn",{branch:M.work.complete}):C("vcs.noSingleBranch",{n:M.work.branches.length}),"per-task"===M.work.mode&&(0,n.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:M.work.branches.map(e=>(0,n.jsxs)("li",{children:[(0,n.jsx)("code",{children:e.branch})," — ",e.title,e.commit?"":" (".concat(C("vcs.taskNoFiles"),")")]},e.branch))})]}),(0,n.jsx)("p",{className:"muted small",children:C("vcs.pushIsYours")})]}),(0,n.jsx)("div",{className:"muted small",role:"status",children:H})]})}function H(e){var s;let{session:a,onChange:l}=e,{t:i}=(0,d.kj)(),[r,o]=(0,t.useState)(""),m=null!=(s=a.onFailure)?s:"stop",h=async e=>{if(e!==m)try{await c.FH.updateSession(a.id,{onFailure:e}),o(i("stop"===e?"chain.savedStop":"chain.savedContinue")),l()}catch(e){o(e.message)}};return(0,n.jsxs)("fieldset",{style:{border:0,padding:0,margin:"10px 0 14px"},children:[(0,n.jsx)("legend",{className:"muted small",style:{padding:0},children:i("chain.title")}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"radio",name:"chain",checked:"stop"===m,onChange:()=>void h("stop"),disabled:a.running}),(0,n.jsx)("span",{children:i("chain.stop")})]}),(0,n.jsx)("p",{className:"why",children:i("chain.stopWhy")})]}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"radio",name:"chain",checked:"continue"===m,onChange:()=>void h("continue"),disabled:a.running}),(0,n.jsx)("span",{children:i("chain.continue")})]}),(0,n.jsx)("p",{className:"why",children:i("chain.continueWhy")})]}),r&&(0,n.jsx)("div",{className:"muted small",role:"status",children:r}),a.running&&(0,n.jsx)("div",{className:"muted small",children:i("chain.locked")})]})}function P(e){let{value:s,onChange:a,presets:l,onPresetsChanged:i}=e,{t:r}=(0,d.kj)(),o=(0,t.useId)(),[m,h]=(0,t.useState)(""),u=async()=>{let e=prompt(r("l2.saveAsPrompt"));if(e)try{await c.FH.savePreset(e,s),h(r("l2.savedAs",{name:e})),null==i||i()}catch(e){h(e.message)}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("label",{className:"grow",style:{margin:0},htmlFor:"".concat(o,"-text"),children:r("l2.label")}),(0,n.jsxs)("select",{value:"","aria-label":r("l2.loadPreset"),onChange:e=>{let s=l.find(s=>s.name===e.target.value);s&&a(s.content)},children:[(0,n.jsx)("option",{value:"",children:r("l2.loadPreset")}),l.map(e=>(0,n.jsx)("option",{value:e.name,children:e.name},e.name))]}),(0,n.jsx)("button",{onClick:()=>void u(),disabled:!s.trim(),children:r("l2.saveAs")})]}),(0,n.jsx)("textarea",{id:"".concat(o,"-text"),className:"prose",value:s,onChange:e=>a(e.target.value),placeholder:r("l2.placeholder"),style:{minHeight:140,marginTop:10}}),m&&(0,n.jsx)("div",{className:"muted small",children:m})]})}function R(e){let{session:s}=e,{t:a}=(0,d.kj)(),l=(0,d.W3)(),i=s.tasks.filter(e=>"queued"!==e.status),[r,o]=(0,t.useState)([]),m=r.length>0?r:i.map(e=>e.id),h=e=>(0,c.ub)("".concat(c.nC,"/sessions/").concat(s.id,"/export?variant=").concat(e)+(r.length>0?"&tasks=".concat(encodeURIComponent(r.join(","))):""));return(0,n.jsxs)("div",{className:"panel",children:[(0,n.jsx)("h2",{children:a("export.title")}),(0,n.jsx)("p",{className:"muted small",children:a("export.hint")}),0===i.length?(0,n.jsx)("div",{className:"empty",children:a("export.nothing")}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"row",style:{marginBottom:6},children:[(0,n.jsx)("button",{className:"quiet",onClick:()=>o(i.map(e=>e.id)),children:a("export.all")}),(0,n.jsx)("button",{className:"quiet",onClick:()=>o([]),children:a("export.none")}),(0,n.jsx)("span",{className:"muted small",children:r.length>0?a("export.selected",{n:r.length}):a("export.allOf",{n:i.length})})]}),i.map(e=>{var s,t,i,c,d;return(0,n.jsx)("div",{className:"option",style:{margin:"6px 0"},children:(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:r.includes(e.id),onChange:()=>{let s;return s=e.id,o(e=>e.includes(s)?e.filter(e=>e!==s):[...e,s])}}),(0,n.jsxs)("span",{children:[e.title," ",(0,n.jsx)("span",{className:"badge ".concat(e.status),children:a("status.".concat(e.status))})," ",e.readOnly&&(0,n.jsx)("span",{className:"chip",children:a("task.readOnly")})," ",(null!=(t=null==(s=e.scope)?void 0:s.length)?t:0)>0&&(0,n.jsx)("span",{className:"chip",children:a("task.scope",{paths:(null!=(i=e.scope)?i:[]).join(", ")})})," ",(0,n.jsx)("span",{className:"muted small",children:l(null!=(d=null!=(c=e.finishedAt)?c:e.startedAt)?d:e.createdAt)})]})]})},e.id)}),(0,n.jsxs)("div",{className:"row",style:{marginTop:10},children:[(0,n.jsx)("a",{className:"button-link",href:h("outcome"),download:!0,children:a("export.outcome",{n:m.length})}),(0,n.jsx)("a",{className:"button-link",href:h("full"),download:!0,children:a("export.full",{n:m.length})})]}),(0,n.jsx)("p",{className:"muted small",style:{marginTop:8},children:a("export.outcomeWhy")})]})]})}function D(e){let{handoff:s}=e,{t:a}=(0,d.kj)(),t=(e,s)=>(0,n.jsxs)("div",{className:"handoff-row",children:[(0,n.jsx)("strong",{children:a(e)})," ",s]}),l=e=>(0,n.jsx)("ul",{children:e.map((e,s)=>(0,n.jsx)("li",{children:e},s))}),i=s.validation.filter(e=>e.passed).length;return(0,n.jsxs)("div",{className:"summary handoff",children:[(0,n.jsx)("strong",{children:a("handoff.title")}),t("handoff.outcome",(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"badge ".concat(s.outcome.status),children:a("status.".concat(s.outcome.status))}),s.outcome.reason?" ".concat(s.outcome.reason):""]})),t("handoff.files",0===s.changedFiles.length?(0,n.jsx)("span",{className:"muted",children:a("handoff.noFiles")}):(0,n.jsx)("code",{children:s.changedFiles.map(e=>"".concat(e.path).concat(e.added>=0?" +".concat(e.added,"/-").concat(e.removed):"")).join(", ")})),s.validation.length>0&&t("handoff.validation",(0,n.jsxs)(n.Fragment,{children:[a("handoff.passed",{n:i,of:s.validation.length}),s.review?" \xb7 ".concat(a("handoff.review",{verdict:s.review.verdict,open:s.review.open})):""]})),t("handoff.issues",0===s.knownIssues.length?(0,n.jsx)("span",{className:"muted",children:a("handoff.noIssues")}):l(s.knownIssues)),s.evidence.runId&&t("handoff.evidence",(0,n.jsx)("code",{children:s.evidence.runId})),(s.vcs.branch||s.vcs.problem)&&t("handoff.vcs",(0,n.jsxs)(n.Fragment,{children:[s.vcs.branch&&(0,n.jsx)("code",{children:s.vcs.branch}),s.vcs.commit?" @ ".concat(s.vcs.commit.slice(0,8)," \xb7 ").concat(a("handoff.notPushed")):s.vcs.branch?" \xb7 ".concat(a("handoff.noCommit")):"",s.vcs.problem?" — ".concat(s.vcs.problem):""]})),s.manual.length>0&&t("handoff.manual",l(s.manual)),s.notExecuted.length>0&&t("handoff.notRun",l(s.notExecuted))]})}function W(e){var s;let{session:a,presets:l,onAdded:i,onPresetsChanged:r}=e,{t:o}=(0,d.kj)(),m=[...a.tasks].reverse()[0],[h,u]=(0,t.useState)(""),[p,v]=(0,t.useState)(null!=(s=null==m?void 0:m.level2)?s:""),[x,j]=(0,t.useState)(""),[g,f]=(0,t.useState)(""),[b,y]=(0,t.useState)(!1),k=(0,t.useRef)(!1),N=async()=>{if(!k.current){k.current=!0,y(!0);try{await c.FH.addTask(a.id,{title:h,level2:p,prompt:x}),u(""),j(""),f(o("form.queued")),i()}catch(e){f(e.message)}finally{k.current=!1,y(!1)}}};return(0,n.jsxs)("div",{className:"panel",id:"new-task",children:[(0,n.jsx)("h2",{children:o("form.title")}),(0,n.jsx)("p",{className:"muted small",children:o("form.hint")}),(0,n.jsx)("label",{htmlFor:"new-task-title",children:o("form.titleLabel")}),(0,n.jsx)("input",{id:"new-task-title",type:"text",value:h,onChange:e=>u(e.target.value),placeholder:o("form.titlePlaceholder")}),(0,n.jsx)("div",{style:{marginTop:10},children:(0,n.jsx)(P,{value:p,onChange:v,presets:l,onPresetsChanged:r})}),(0,n.jsx)("label",{htmlFor:"new-task-prompt",children:o("form.taskLabel")}),(0,n.jsx)("textarea",{id:"new-task-prompt",className:"prose",value:x,onChange:e=>j(e.target.value),placeholder:o("form.taskPlaceholder"),style:{minHeight:140}}),(0,n.jsxs)("div",{className:"row",style:{marginTop:10},children:[(0,n.jsx)("button",{className:"primary",onClick:()=>void N(),disabled:b||!x.trim(),children:o("form.add")}),(0,n.jsx)("span",{className:"muted small",children:g})]})]})}function B(e){var s,a,l,i,r,u,p,v,b,k,w,S,C,F,I,L,M,T,H,R,W,B,A,E,G,J,Z,_,K,Y,Q,V,X,$,ee,es,ea,en,et,el,ei,er,ec,ed,eo,em,eh,eu,ep,ev,ex,ej,eg,ef,eb,ey,ek,eN,ew,eS,eC,eF,eI,eL,eM,eT,eH,eP,eR,eD,eW,eB,eA,eO;let{session:eE,task:eU,index:eq,presets:ez,onChange:eG}=e,{t:eJ}=(0,d.kj)(),eZ=(0,d.W3)(),[e_,eK]=(0,t.useState)(!1),[eY,eQ]=(0,t.useState)(!1),[eV,eX]=(0,t.useState)(eU.title),[e$,e0]=(0,t.useState)(eU.level2),[e1,e2]=(0,t.useState)(eU.prompt),[e8,e4]=(0,t.useState)(null!=(V=null==(s=eU.vcsPlan)?void 0:s.branch)?V:""),[e6,e3]=(0,t.useState)(null!=(X=null==(a=eU.vcsPlan)?void 0:a.commitMessage)?X:""),[e5,e7]=(0,t.useState)(null!=($=eU.checks)?$:[]),[e9,se]=(0,t.useState)(!!eU.readOnly),[ss,sa]=(0,t.useState)((null!=(ee=eU.scope)?ee:[]).join("\n")),sn={readOnly:e9,scope:e9?[]:(0,N.w)(ss)},st=(0,h.c)((0,m.DG)(eU)),[sl,si]=(0,t.useState)(null),[sr,sc]=(0,t.useState)(""),sd=async()=>{try{await c.FH.updateTask(eE.id,eU.id,{title:eV,level2:e$,prompt:e1,vcsPlan:{branch:e8,commitMessage:e6},checks:e5,...sn}),eK(!1),eG()}catch(e){sc(e.message)}},so="running"===eU.status||"waiting-approval"===eU.status,sm=!so&&"queued"!==eU.status,sh=!so&&"queued"!==eU.status,su=!so&&null!=(es=null==(l=eE.vcs)?void 0:l.enabled)&&es&&(!!(null==(i=eU.vcs)?void 0:i.baseCommit)||(null!=(ea=eU.attempts)?ea:[]).some(e=>{var s;return null==(s=e.vcs)?void 0:s.baseCommit})),sp=!so&&(0,c.Zm)(eU),sv=async()=>{if(await (0,g.Z)(eJ("task.continueConfirm",{title:eU.title})))try{await c.FH.continueTask(eE.id,eU.id),eG()}catch(e){sc(e.message)}},sx=async()=>{if(await (0,g.Z)(eJ("task.rerunConfirm",{title:eU.title})))try{await c.FH.rerunTask(eE.id,eU.id),eG()}catch(e){sc(e.message)}},sj=async()=>{if(await (0,g.Z)(eJ("task.editRanConfirm",{title:eU.title})))try{await c.FH.rerunTask(eE.id,eU.id,{title:eV,level2:e$,prompt:e1,vcsPlan:{branch:e8,commitMessage:e6},checks:e5,...sn},{buildOnFinished:"done"===eU.status}),eK(!1),eG()}catch(e){sc(e.message)}},sg=(0,y.e)(eG),sf=async()=>{let e="queued"===eU.status?"task.deleteConfirm":"task.deleteConfirmRan";if(await (0,g.Z)(eJ(e,{title:eU.title})))try{await c.FH.deleteTask(eE.id,eU.id),eG()}catch(e){sc(e.message)}},sb=async()=>{try{si(await c.FH.taskFiles(eE.id,eU.id))}catch(e){sc(e.message)}},sy=(e,s,a)=>a.length>0&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("span",{className:"muted",children:[eJ(e)," "]}),a.map(e=>(0,n.jsx)("span",{style:{marginRight:10},children:(0,n.jsx)(o.u,{label:e,save:()=>c.FH.saveTaskFile(eE.id,eU.id,s,e)})},e))]});return(0,n.jsxs)("div",{className:"task ".concat(eU.status),id:eU.id,children:[(0,n.jsxs)("div",{className:"row",children:[(0,n.jsxs)("h4",{className:"grow",children:[eq,". ",eU.title]}),(0,n.jsx)("span",{className:"badge ".concat(eU.status),children:eJ("status.".concat(eU.status))}),eU.limit&&(0,n.jsx)("span",{className:"chip",title:eJ("reg.limitChipWhy"),children:eJ("reg.limitChip",{limit:eJ("limit.".concat(eU.limit.setting),{n:eU.limit.value})})}),(null!=(en=eU.attempt)?en:1)>1&&(0,n.jsx)("span",{className:"chip",children:eJ("task.attemptN",{n:null!=(et=eU.attempt)?et:1})}),eU.iterations>0&&(0,n.jsx)("span",{className:"muted small",children:eJ("task.iterations",{n:eU.iterations})}),eU.runId&&(0,n.jsxs)("button",{className:eY?"":"quiet","aria-expanded":eY,onClick:()=>eQ(e=>!e),title:(0,m.DG)(eU)?eJ("story.showLiveWhy"):eJ("story.why"),children:[(0,m.DG)(eU)&&!eY&&(0,n.jsx)("span",{className:"dot","aria-hidden":"true"}),eY?eJ("story.hide"):(0,m.DG)(eU)?eJ("story.showLive"):eJ("story.show")]}),!so&&(0,n.jsx)("button",{onClick:()=>{if(!e_){var e,s,a,n,t,l;eX(eU.title),e0(eU.level2),e2(eU.prompt),e4(null!=(a=null==(e=eU.vcsPlan)?void 0:e.branch)?a:""),e3(null!=(n=null==(s=eU.vcsPlan)?void 0:s.commitMessage)?n:""),e7(null!=(t=eU.checks)?t:[]),se(!!eU.readOnly),sa((null!=(l=eU.scope)?l:[]).join("\n"))}eK(!e_)},title:eJ("task.editAll"),children:e_?eJ("task.cancel"):eJ("task.edit")}),sp&&(0,n.jsx)("button",{className:"primary",onClick:()=>void sv(),title:eJ("task.continueWhy"),children:eJ("task.continue")}),sh&&(0,n.jsx)("button",{className:sp?"":"primary",onClick:()=>void sx(),title:eJ("task.rerunWhy"),children:eJ("task.rerun")}),su&&(0,n.jsx)("button",{onClick:()=>void sg.restore({sessionId:eE.id,taskId:eU.id,title:eU.title}),disabled:""!==sg.busy||eE.running,title:eJ("restore.why"),children:"restore"===sg.busy?eJ("restore.checking"):eJ("restore.button")}),sm&&(0,n.jsx)("button",{onClick:()=>void sg.restartFrom({sessionId:eE.id,taskId:eU.id,title:eU.title}),disabled:""!==sg.busy||eE.running,title:eJ("restart.why"),children:"restart"===sg.busy?eJ("restart.checking"):eJ("restart.button")}),!so&&(0,n.jsx)("button",{className:"danger",onClick:()=>void sf(),children:eJ("task.delete")}),!e_&&(sr||sg.message)&&(0,n.jsx)("span",{className:"err",role:"alert",children:sr||sg.message})]}),(0,n.jsxs)("div",{className:"muted small",children:[eU.startedAt?eJ("task.started",{t:eZ(eU.startedAt)}):eJ("task.added",{t:eZ(eU.createdAt)}),eU.finishedAt?" \xb7 ".concat(eJ("task.finished",{t:eZ(eU.finishedAt)})):"",eU.startedAt&&eU.finishedAt?" \xb7 ".concat(eJ("task.took",{d:(0,c.c5)((0,m.d5)(eU.startedAt,eU.finishedAt))})):"",(0,m.DG)(eU)?" \xb7 ".concat(eJ("task.runningFor",{d:(0,c.c5)((0,m.d5)(eU.startedAt,void 0,st))})):""]}),"queued"!==eU.status&&(null==(r=eE.vcs)?void 0:r.enabled)&&eU.vcs&&(0,n.jsx)("div",{className:"muted small",children:eU.vcs.problem&&!eU.vcs.branch?(0,n.jsx)("span",{className:"reason",children:eJ("vcs.taskProblem",{problem:eU.vcs.problem})}):(0,n.jsxs)(n.Fragment,{children:[eU.vcs.branch&&eJ("vcs.taskBranch",{branch:eU.vcs.branch}),eU.vcs.baseCommit&&" \xb7 ".concat(eJ("vcs.taskBase",{commit:eU.vcs.baseCommit.slice(0,8)})),eU.vcs.commit?" \xb7 ".concat(eJ("vcs.taskCommit",{commit:eU.vcs.commit.slice(0,8)})):" \xb7 ".concat(eJ("vcs.taskNoFiles")),(null!=(el=null==(u=eU.vcs.files)?void 0:u.length)?el:0)>0&&(0,n.jsxs)("details",{style:{display:"inline"},children:[(0,n.jsxs)("summary",{style:{display:"inline",cursor:"pointer"},children:[" \xb7 ",eJ("vcs.taskFiles",{n:null!=(ei=null==(p=eU.vcs.files)?void 0:p.length)?ei:0})]}),(0,n.jsx)("ul",{style:{margin:"4px 0 4px 0",paddingLeft:20},children:(null!=(er=eU.vcs.files)?er:[]).map(e=>(0,n.jsxs)("li",{children:[(0,n.jsx)("code",{children:e.path})," ",e.added<0||e.removed<0?eJ("vcs.taskBinary"):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{style:{color:"var(--ok)"},children:["+",e.added]})," ",(0,n.jsxs)("span",{style:{color:"var(--bad)"},children:["-",e.removed]})]})]},e.path))})]}),eU.vcs.commit&&eU.vcs.baseCommit&&(0,n.jsxs)(n.Fragment,{children:[" \xb7 ",(0,n.jsx)(f.C,{sessionId:eE.id,taskId:eU.id,title:eU.title,files:null!=(ec=null==(v=eU.vcs.files)?void 0:v.length)?ec:0})]}),(null!=(ed=null==(b=eU.vcs.suspicious)?void 0:b.length)?ed:0)>0&&(0,n.jsxs)("div",{className:"err small",style:{marginTop:4},children:[eJ("vcs.suspicious",{n:null!=(eo=null==(k=eU.vcs.suspicious)?void 0:k.length)?eo:0}),(0,n.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(em=eU.vcs.suspicious)?em:[]).map(e=>(0,n.jsxs)("li",{children:[(0,n.jsx)("code",{children:e.path})," — ",e.reason]},e.path))})]}),(null!=(eh=null==(w=eU.scopeReverted)?void 0:w.length)?eh:0)>0&&(0,n.jsx)("div",{className:"small",style:{marginTop:4},children:eJ("task.scopeReverted",{n:null!=(eu=null==(S=eU.scopeReverted)?void 0:S.length)?eu:0,paths:(null!=(ep=eU.scopeReverted)?ep:[]).join(", ")})}),(null!=(ev=null==(C=eU.vcs.foreignCommits)?void 0:C.length)?ev:0)>0&&(0,n.jsxs)("div",{className:"err small",style:{marginTop:4},children:[eJ("vcs.foreignCommits",{n:null!=(ex=null==(F=eU.vcs.foreignCommits)?void 0:F.length)?ex:0}),(0,n.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(ej=eU.vcs.foreignCommits)?ej:[]).map(e=>(0,n.jsx)("li",{children:(0,n.jsx)("code",{children:e})},e))})]})]})}),"queued"===eU.status&&(null==(I=eE.vcs)?void 0:I.enabled)&&((null==(L=eU.vcsPlan)?void 0:L.branch)||(null==(M=eU.vcsPlan)?void 0:M.commitMessage))&&(0,n.jsx)("div",{className:"muted small",children:eU.vcsPlan.branch&&eU.vcsPlan.commitMessage?eJ("task.gitNames",{branch:eU.vcsPlan.branch,subject:eU.vcsPlan.commitMessage.split("\n")[0]}):eU.vcsPlan.branch?eJ("task.gitBranchOnly",{branch:eU.vcsPlan.branch}):eJ("task.gitCommitOnly",{subject:(null!=(eg=eU.vcsPlan.commitMessage)?eg:"").split("\n")[0]})}),eY&&eU.runId&&(0,n.jsx)(x.P,{sessionId:eE.id,taskId:eU.id,live:"running"===eU.status||"waiting-approval"===eU.status}),e_?(0,n.jsxs)("div",{style:{marginTop:8},children:[(0,n.jsx)("label",{children:eJ("form.titleLabel")}),(0,n.jsx)("input",{type:"text",value:eV,onChange:e=>eX(e.target.value)}),(0,n.jsx)("div",{style:{marginTop:8},children:(0,n.jsx)(P,{value:e$,onChange:e0,presets:ez})}),(0,n.jsx)("label",{children:eJ("form.taskLabel")}),(0,n.jsx)("textarea",{className:"prose",value:e1,onChange:e=>e2(e.target.value)}),(null==(T=eE.vcs)?void 0:T.enabled)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("label",{htmlFor:"branch-".concat(eU.id),children:eJ("task.branch")}),(0,n.jsx)("input",{id:"branch-".concat(eU.id),type:"text",value:e8,onChange:e=>e4(e.target.value),placeholder:eE.vcs.branchPrefix,disabled:"per-session"===eE.vcs.branchMode}),(0,n.jsx)("p",{className:"why",children:"per-session"===eE.vcs.branchMode?eJ("task.branchIgnored"):eJ("task.branchWhy")}),(0,n.jsx)("label",{htmlFor:"commit-".concat(eU.id),children:eJ("task.commitMessage")}),(0,n.jsx)("textarea",{id:"commit-".concat(eU.id),value:e6,onChange:e=>e3(e.target.value),style:{minHeight:70}}),(0,n.jsx)("p",{className:"why",children:eJ("task.commitWhy")})]}),(0,n.jsx)(O,{checks:e5,onChange:e7}),e1.trim()!==eU.prompt.trim()&&(0,n.jsx)("p",{className:"notice caution small",children:eJ("task.newIntentNote")}),(0,n.jsx)(N.y,{readOnly:e9,scope:ss,onReadOnly:se,onScope:sa}),(0,n.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,n.jsx)("button",{className:"primary",onClick:()=>void(sm?sj():sd()),children:sm?eJ("task.saveAndRerun"):eJ("task.save")}),(0,n.jsx)("span",{className:"err",children:sr})]}),sm&&(0,n.jsx)("p",{className:"muted small",children:eJ("task.editRanWhy")})]}):(0,n.jsxs)(n.Fragment,{children:[(null!=(ef=null==(H=eU.checks)?void 0:H.length)?ef:0)>0&&(0,n.jsxs)("details",{className:"small",style:{margin:"6px 0"},children:[(0,n.jsxs)("summary",{children:[eJ("checks.title")," — ",eJ("checks.n",{n:null!=(eb=null==(R=eU.checks)?void 0:R.length)?eb:0}),(null!=(ey=null==(W=eU.checkResults)?void 0:W.length)?ey:0)>0&&" \xb7 ".concat((null!=(ek=eU.checkResults)?ek:[]).filter(e=>e.passed).length,"/").concat(null==(B=eU.checkResults)?void 0:B.length," ").concat(eJ("checks.passed"))]}),(0,n.jsx)("ul",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(eN=eU.checks)?eN:[]).map((e,s)=>{var a;let t=(null!=(a=eU.checkResults)?a:[]).find(s=>s.name===e.name);return(0,n.jsxs)("li",{children:[(0,n.jsx)("strong",{children:e.name}),(0,n.jsxs)("span",{className:"muted",children:[" — ",eJ("checks.kind.".concat(e.expect)),e.value?' "'.concat(e.value,'"'):"",e.run?": ".concat(e.run):e.file?": ".concat(e.file):""]}),t&&(0,n.jsxs)("div",{className:t.passed?"muted":"reason",children:[t.passed?eJ("checks.passed"):eJ("checks.failed")," — ",t.detail]})]},"".concat(e.name,"-").concat(s))})})]}),(null!=(ew=null==(A=eU.reviewChecks)?void 0:A.length)?ew:0)>0&&(0,n.jsxs)("details",{className:"small",style:{margin:"6px 0"},children:[(0,n.jsx)("summary",{children:eJ("checks.fromReview",{n:null!=(eS=null==(E=eU.reviewChecks)?void 0:E.length)?eS:0})}),(0,n.jsx)("p",{className:"why",children:eJ("checks.fromReviewWhy")}),(0,n.jsx)("ul",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(eC=eU.reviewChecks)?eC:[]).map(e=>{var s;let a=(null!=(s=eU.checkResults)?s:[]).find(s=>s.name===e.check.name);return(0,n.jsxs)("li",{children:[(0,n.jsx)("code",{children:e.findingId})," ",(0,n.jsx)("strong",{children:e.check.name}),"active"!==e.state&&(0,n.jsx)("span",{className:"chip",style:{marginLeft:6},children:eJ("checks.state.".concat(e.state))}),(0,n.jsx)("div",{className:"muted",children:e.what}),a&&(0,n.jsxs)("div",{className:a.passed?"muted":"reason",children:[a.passed?eJ("checks.passed"):eJ("checks.failed")," — ",a.detail]})]},e.check.name)})})]}),(0,n.jsx)(z,{review:eU.review}),eU.stopCode&&!(0,m.DG)(eU)&&(0,n.jsx)("p",{className:"small",children:(0,n.jsx)("span",{className:"chip",title:eJ("stop.why"),children:eJ("stop.".concat(eU.stopCode))})}),eU.handoff&&!(0,m.DG)(eU)&&(0,n.jsx)(D,{handoff:eU.handoff}),eU.summary&&(0,n.jsxs)("div",{className:"summary",children:[(0,n.jsx)("strong",{children:eJ("task.whatWasDone")}),(0,n.jsx)(j.s,{text:eU.summary})]}),(null!=(eF=null==(G=eU.deviations)?void 0:G.length)?eF:0)>0&&(0,n.jsx)(U,{items:null!=(eI=eU.deviations)?eI:[]}),(null!=(eL=null==(J=eU.disputes)?void 0:J.length)?eL:0)>0&&(0,n.jsx)(q,{items:null!=(eM=eU.disputes)?eM:[]}),eU.environment&&(0,n.jsx)("div",{className:"muted small",style:{margin:"4px 0"},children:eJ("task.ranWith",{node:eU.environment.node,npm:null!=(eT=eU.environment.npm)?eT:"—",git:null!=(eH=eU.environment.git)?eH:"—",pwsh:null!=(eR=null!=(eP=eU.environment.pwsh)?eP:eU.environment.powershell)?eR:"—"})}),(null!=(eD=null==(Z=eU.leftovers)?void 0:Z.length)?eD:0)>0&&(0,n.jsxs)("div",{className:"err small",style:{margin:"6px 0"},children:[eJ("task.leftovers",{n:null!=(eW=null==(_=eU.leftovers)?void 0:_.length)?eW:0}),(0,n.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(eB=eU.leftovers)?eB:[]).map(e=>(0,n.jsxs)("li",{children:[(0,n.jsx)("code",{children:e.name})," pid ",e.pid,e.ports.length>0?" \xb7 ".concat(eJ("task.leftoverPorts",{ports:e.ports.join(", ")})):""," \xb7 ",e.by]},"".concat(e.by,"-").concat(e.pid)))})]}),eU.reason&&(0,n.jsx)("div",{className:"reason small",style:{margin:"6px 0"},children:eU.reason}),(null!=(eA=null==(K=eU.attempts)?void 0:K.length)?eA:0)>0&&(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:eJ("task.attempts",{n:null!=(eO=null==(Y=eU.attempts)?void 0:Y.length)?eO:0})}),null==(Q=eU.attempts)?void 0:Q.map((e,s)=>{var a,t,l,i;return(0,n.jsxs)("div",{className:"small",style:{margin:"8px 0 12px"},children:[(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("strong",{children:eJ("task.attemptN",{n:s+1})}),(0,n.jsx)("span",{className:"badge ".concat(e.status),children:eJ("status.".concat(e.status))}),e.iterations>0&&(0,n.jsx)("span",{className:"muted",children:eJ("task.iterations",{n:e.iterations})}),e.runId&&(0,n.jsx)(o.u,{label:eJ("save.attemptLog"),save:()=>c.FH.saveTaskLog(eE.id,eU.id,e.runId)}),e.runId&&(0,n.jsx)(o.H,{sessionId:eE.id,taskId:eU.id,attempt:s+1}),e.runId&&(null==(a=e.vcs)?void 0:a.commit)&&e.vcs.baseCommit&&(0,n.jsx)(f.C,{sessionId:eE.id,taskId:eU.id,runId:e.runId,title:"".concat(eU.title," — ").concat(eJ("task.attemptN",{n:s+1})),files:null!=(l=null==(t=e.vcs.files)?void 0:t.length)?l:0})]}),(0,n.jsxs)("div",{className:"muted",children:[e.startedAt?eJ("task.started",{t:eZ(e.startedAt)}):"",e.finishedAt?" \xb7 ".concat(eJ("task.finished",{t:eZ(e.finishedAt)})):""]}),e.summary&&(0,n.jsx)("div",{children:e.summary}),e.reason&&(0,n.jsx)("div",{className:"err",children:e.reason}),e.prompt&&e.prompt!==eU.prompt&&(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:eJ("task.attemptText")}),(0,n.jsx)("pre",{children:e.prompt})]})]},"".concat(null!=(i=e.runId)?i:s))})]}),"queued"===eU.status?(0,n.jsxs)("div",{style:{marginTop:8},children:[(0,n.jsx)("div",{className:"muted small",children:eJ("task.prompt")}),(0,n.jsx)("pre",{children:eU.prompt}),eU.level2.trim()?(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:eJ("task.l2Show",{n:eU.level2.trim().split("\n").length})}),(0,n.jsx)("pre",{children:eU.level2})]}):(0,n.jsx)("div",{className:"muted small",children:eJ("task.noL2")})]}):(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:eJ("task.promptAndL2")}),eU.level2.trim()&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"muted small",children:eJ("task.l2")}),(0,n.jsx)("pre",{children:eU.level2})]}),(0,n.jsx)("div",{className:"muted small",children:eJ("task.prompt")}),(0,n.jsx)("pre",{children:eU.prompt})]}),eU.firstMessage&&(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:eJ("task.firstMessage")}),(0,n.jsx)("pre",{className:"tall",children:eU.firstMessage})]}),eU.runId&&(0,n.jsxs)("details",{onToggle:e=>e.currentTarget.open&&void sb(),children:[(0,n.jsx)("summary",{children:eJ("task.files")}),(0,n.jsx)("div",{className:"row small",style:{margin:"6px 0"},children:(0,n.jsx)(o.u,{label:eJ("save.log"),save:()=>c.FH.saveTaskLog(eE.id,eU.id)})}),sl&&(0,n.jsxs)("div",{className:"small",children:[sy("task.reports","reports",sl.reports),sy("task.artifacts","artifacts",sl.artifacts),sy("task.replies","replies",sl.replies)]})]}),eU.finalReply&&(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:eJ("task.finalReply")}),(0,n.jsx)("pre",{className:"tall",children:eU.finalReply})]})]})]})}function A(e){let{events:s}=e,{t:a}=(0,d.kj)(),{appearance:l}=(0,u.KP)(),i=(0,t.useRef)(null);return(0,t.useEffect)(()=>{!l.reduceMotion&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[s.length,l.reduceMotion]),(0,n.jsxs)("div",{className:"panel",children:[(0,n.jsx)("h2",{children:a("live.title")}),(0,n.jsxs)("div",{className:"log",ref:i,children:[0===s.length&&(0,n.jsx)("div",{className:"muted",children:a("live.none")}),s.map((e,s)=>{var a;return(0,n.jsxs)("div",{className:e.level,children:[(0,n.jsx)("span",{className:"time",children:new Date(e.at).toLocaleTimeString(void 0,{hour12:!1})}),null!=(a=e.message)?a:e.type]},s)})]})]})}function O(e){let{checks:s,onChange:a}=e,{t}=(0,d.kj)(),l=(e,n)=>a(s.map((s,a)=>e===a?{...s,...n}:s));return(0,n.jsxs)("div",{style:{marginTop:12},children:[(0,n.jsx)("label",{children:t("checks.title")}),(0,n.jsx)("p",{className:"why",style:{marginTop:0},children:t("checks.why")}),0===s.length&&(0,n.jsx)("p",{className:"muted small",children:t("checks.noneWhy")}),s.map((e,i)=>{var r,d,o,m;return(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("input",{type:"text",className:"grow",value:e.name,placeholder:t("checks.namePlaceholder"),onChange:e=>l(i,{name:e.target.value}),"aria-label":t("checks.name")}),(0,n.jsx)("select",{value:e.expect,onChange:e=>l(i,{expect:e.target.value}),"aria-label":t("checks.kind"),style:{width:"auto"},children:c.FZ.map(e=>(0,n.jsx)("option",{value:e,children:t("checks.kind.".concat(e))},e))}),(0,n.jsx)("button",{className:"quiet",onClick:()=>a(s.filter((e,s)=>s!==i)),children:t("checks.remove")})]}),(0,n.jsxs)("div",{className:"row",style:{marginTop:6},children:[(0,c.rt)(e.expect)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("input",{type:"text",className:"grow",value:null!=(r=e.run)?r:"",placeholder:t("checks.run"),onChange:e=>l(i,{run:e.target.value}),"aria-label":t("checks.run")}),(0,n.jsx)("input",{type:"text",value:null!=(d=e.cwd)?d:"",placeholder:t("checks.cwd"),onChange:e=>l(i,{cwd:e.target.value}),"aria-label":t("checks.cwd"),style:{width:220}})]}):(0,n.jsx)("input",{type:"text",className:"grow",value:null!=(o=e.file)?o:"",placeholder:t("checks.file"),onChange:e=>l(i,{file:e.target.value}),"aria-label":t("checks.file")}),(0,c.dK)(e.expect)&&(0,n.jsx)("input",{type:"text",value:null!=(m=e.value)?m:"",placeholder:"output-matches"===e.expect?t("checks.valueRegex"):t("checks.value"),onChange:e=>l(i,{value:e.target.value}),"aria-label":t("checks.value"),style:{width:240}})]})]},i)}),(0,n.jsx)("button",{onClick:()=>a([...s,{name:"",expect:"exit-zero",run:""}]),children:t("checks.add")})]})}function E(e){let{tasks:s}=e,{t:a}=(0,d.kj)(),t=(0,m.hH)(s),l=(0,h.c)(!!t&&t.tasks.some(m.DG));if(!t)return null;let i=(0,m.eZ)(t.run,t.tasks,l);return(0,n.jsx)("p",{className:"muted small",style:{margin:"4px 0 10px"},children:a(i.live?"session.runClockLive":"session.runClock",{n:i.tasks,d:(0,c.c5)(i.ms)})})}function U(e){let{items:s}=e,{t:a}=(0,d.kj)();return(0,n.jsxs)("div",{className:"summary",children:[(0,n.jsx)("strong",{children:a("task.deviations",{n:s.length})}),(0,n.jsx)("ol",{style:{margin:"6px 0",paddingLeft:20},children:s.map((e,s)=>(0,n.jsxs)("li",{style:{marginBottom:6},children:[(0,n.jsx)("div",{children:e.instruction}),(0,n.jsxs)("div",{className:"muted",children:[a("task.deviationDid"),": ",e.did]}),(0,n.jsxs)("div",{className:"muted",children:[a("task.deviationWhy"),": ",e.why]})]},s))})]})}function q(e){let{items:s}=e,{t:a}=(0,d.kj)();return(0,n.jsxs)("div",{className:"summary",children:[(0,n.jsx)("strong",{children:a("task.disputes",{n:s.length})}),(0,n.jsx)("ol",{style:{margin:"6px 0",paddingLeft:20},children:s.map((e,s)=>(0,n.jsxs)("li",{style:{marginBottom:6},children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("code",{children:e.finding})," — ",e.why]}),(0,n.jsxs)("div",{className:"muted",children:[a("review.evidence"),": ",e.evidence]})]},s))})]})}function z(e){var s,a,t,l,i;let{review:r}=e,{t:c}=(0,d.kj)();if(!r)return null;if("skipped"===r.verdict)return r.skippedBecause?(0,n.jsx)("p",{className:"muted small",children:c("review.skippedWhy",{why:r.skippedBecause})}):null;let o="pass"===r.verdict?"done":"fail"===r.verdict?"blocked":"waiting-approval";return(0,n.jsxs)("div",{className:"small",style:{margin:"8px 0"},children:[(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("span",{className:"badge ".concat(o),children:c("review.verdict.".concat(r.verdict))}),r.stepsRun>0&&(0,n.jsx)("span",{className:"muted",children:c("review.ran",{n:r.stepsRun})}),r.rounds>1&&(0,n.jsx)("span",{className:"muted",children:c("review.rounds",{n:r.rounds})}),r.model&&(0,n.jsx)("span",{className:"chip",children:c("review.onModel",{model:r.model})})]}),r.problem&&(0,n.jsx)("p",{className:"reason",children:c("review.problem",{problem:r.problem})}),r.summary&&(0,n.jsx)(j.s,{text:r.summary}),(null!=(t=null==(s=r.findings)?void 0:s.length)?t:0)>0&&(0,n.jsxs)("details",{style:{marginTop:4},children:[(0,n.jsx)("summary",{children:c("review.findings",{n:null!=(l=null==(a=r.findings)?void 0:a.length)?l:0})}),(0,n.jsx)("ol",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(i=r.findings)?i:[]).map((e,s)=>(0,n.jsxs)("li",{style:{marginBottom:8},children:[(0,n.jsxs)("div",{children:[e.id&&(0,n.jsx)("code",{style:{marginRight:6},children:e.id}),e.what,"task"===e.about&&(0,n.jsx)("span",{className:"chip",style:{marginLeft:6},children:c("review.aboutTask")}),e.repeated&&(0,n.jsx)("span",{className:"chip",style:{marginLeft:6},children:c("review.repeated")})]}),e.where&&(0,n.jsx)("div",{className:"muted",children:e.where}),(0,n.jsxs)("div",{className:"muted",children:[c("review.evidence"),": ",e.evidence]})]},s))})]})]})}},4784:(e,s,a)=>{"use strict";a.d(s,{Y:()=>r});var n=a(3365),t=a(1521),l=a(5549),i=a(867);function r(e){var s,a;let{id:r,chosen:c,onChange:d,none:o,catalogue:m,disabled:h=!1,style:u}=e,{t:p}=(0,i.kj)(),v=function(e){let[s,a]=(0,t.useState)(null);return(0,t.useEffect)(()=>{if(void 0!==e)return;let s=!0;return l.FH.models().then(e=>{s&&a(e)}).catch(()=>void 0),()=>{s=!1}},[e]),void 0!==e?e:s}(m),x=null!=(s=null==v?void 0:v.options)?s:[],j=x.some(e=>e.name===c),g=x.filter(e=>!e.group),f=new Map;for(let e of x)e.group&&f.set(e.group,[...null!=(a=f.get(e.group))?a:[],e]);return(0,n.jsxs)("select",{id:r,value:c,onChange:e=>d(e.target.value),disabled:h,style:{width:"auto",minWidth:280,...u},children:[(0,n.jsx)("option",{value:"",children:o}),c&&!j&&(0,n.jsx)("option",{value:c,children:p("model.notInList",{name:c})}),g.map(e=>(0,n.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(p("model.unavailable")):""]},e.name)),[...f.entries()].map(e=>{let[s,a]=e;return(0,n.jsx)("optgroup",{label:s,children:a.map(e=>(0,n.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(p("model.unavailable")):""]},e.name))},s)})]})}},8848:(e,s,a)=>{"use strict";a.d(s,{H4:()=>d,L:()=>o,z4:()=>m});var n=a(3365),t=a(8197),l=a.n(t),i=a(1521),r=a(5549),c=a(867);function d(e){let{current:s,onUse:a}=e,{t}=(0,c.kj)(),[l,d]=(0,i.useState)(null);if((0,i.useEffect)(()=>{let e=!1;return r.FH.project().then(s=>{e||d(s)}).catch(()=>void 0),()=>{e=!0}},[]),!l)return null;let o=l.rootDir.trim(),m=s.trim().toLowerCase(),h=a?l.others.filter(e=>e.rootDir.trim().toLowerCase()!==m):[];return(0,n.jsx)(u,{label:o?t("proj.defaultIs",{dir:o}):t("proj.noneShort"),offer:o&&a&&m!==o.toLowerCase()?{text:t("proj.useIt"),onUse:()=>a(o)}:void 0,more:h.map(e=>({text:t("proj.otherUse",{name:e.name}),title:e.rootDir,onUse:()=>null==a?void 0:a(e.rootDir)})),link:o?t("proj.change"):t("proj.setIt"),anchor:"project"})}function o(e){let{current:s,onUse:a}=e,t=h(),{t:l}=(0,c.kj)();if(!t)return null;let i=t.defaultModel.trim();return(0,n.jsx)(u,{label:i?l("def.modelDefaultIs",{name:i}):l("def.modelNoneShort"),offer:i&&a&&s.trim()!==i?{text:l("def.modelUseIt"),onUse:()=>a(i)}:void 0,link:l(i?"proj.change":"proj.setIt"),anchor:"model"})}function m(e){let{current:s,onUse:a}=e,t=h(),{t:l}=(0,c.kj)();if(!t)return null;let i=t.defaultReviewModel.trim();return(0,n.jsx)(u,{label:i?l("def.reviewDefaultIs",{name:i}):l("def.reviewNoneShort"),offer:i&&a&&s.trim()!==i?{text:l("def.modelUseIt"),onUse:()=>a(i)}:void 0,link:l(i?"proj.change":"proj.setIt"),anchor:"review"})}function h(){let[e,s]=(0,i.useState)(null);return(0,i.useEffect)(()=>{let e=!1;return r.FH.models().then(a=>{e||s(a)}).catch(()=>void 0),()=>{e=!0}},[]),e}function u(e){let{label:s,offer:a,more:t=[],link:i,anchor:r}=e;return(0,n.jsxs)("p",{className:"muted small",style:{marginTop:4},children:[s," ",a&&(0,n.jsxs)(n.Fragment,{children:["\xb7"," ",(0,n.jsx)("button",{type:"button",className:"linkish",onClick:a.onUse,children:a.text})," "]}),t.map(e=>(0,n.jsxs)("span",{children:["\xb7"," ",(0,n.jsx)("button",{type:"button",className:"linkish",onClick:e.onUse,title:e.title,children:e.text})," "]},e.text)),"\xb7 ",(0,n.jsx)(l(),{href:"/defaults#".concat(r),children:i})]})}}},e=>{e.O(0,[197,867,549,36,347,131,358],()=>e(e.s=1772)),_N_E=e.O()}]);
|
/package/dist/web/_next/static/{IwNZiBrEMAcXEUFj2miiU → kkxFcGzA9Uo1uRAgcoDti}/_buildManifest.js
RENAMED
|
File without changes
|
/package/dist/web/_next/static/{IwNZiBrEMAcXEUFj2miiU → kkxFcGzA9Uo1uRAgcoDti}/_ssgManifest.js
RENAMED
|
File without changes
|