copilot-operator 0.1.25 → 0.1.26

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.
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[66],{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))},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),h=a(3523),u=a(3374),m=a(8078),p=a(8848),v=a(4784),x=a(2876),j=a(5132),g=a(1035),f=a(8934),y=a(4811),b=a(3041),k=a(7527),N=a(1366),w=a(8596);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),[h,u]=(0,t.useState)([]),[m,p]=(0,t.useState)([]),[v,x]=(0,t.useState)(null),[j,g]=(0,t.useState)(""),[f,y]=(0,t.useState)(!1),b=(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)(()=>{b.current||(b.current=window.setTimeout(()=>{b.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=()=>y(!1),e.onmessage=e=>{let s;try{s=JSON.parse(e.data)}catch(e){return}"ping"!==s.type&&(u(e=>[...e.slice(-400),s]),S())},e.onerror=()=>{e.readyState===EventSource.CLOSED&&y(!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)(q,{tasks:i.tasks}),(0,n.jsx)(T,{session:i,onChange:w}),(0,n.jsx)(I,{level1:v,sent:i.contractSent}),(0,n.jsx)(B,{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)(L,{session:i,task:e,index:s+1,presets:m,onChange:w},e.id))]}),(0,n.jsx)(O,{session:i}),(0,n.jsx)(D,{session:i,presets:m,onAdded:w,onPresetsChanged:()=>c.FH.presets().then(p)}),(0,n.jsx)(A,{events:h})]})}function F(e){var s;let{session:a,queued:l,onChange:i}=e,{t:r}=(0,d.kj)(),[o,h]=(0,t.useState)(""),[u,m]=(0,t.useState)("");(0,t.useEffect)(()=>{c.FH.models().then(e=>{var s;return m(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,y.p)(),[b,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){h(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);h(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 h(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){h(e.message)}},F=async()=>{var e;if(x.trim()!==(null!=(e=a.conversationGroup)?e:""))try{await c.FH.updateSession(a.id,{conversationGroup:x.trim()}),h(r("session.groupSaved")),i()}catch(e){h(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:b||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:b||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),h(r("session.stopping"))}),disabled:b,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"),h(r("session.askingAgain"))}),disabled:b,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||(u?r("model.followsDefault",{name:u}):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 T(e){var s,a,l,i;let{session:r,onChange:o}=e,{t:h}=(0,d.kj)(),u=(0,d.W3)(),[m,v]=(0,t.useState)(null),[x,j]=(0,t.useState)(!1),[f,y]=(0,t.useState)("");(0,t.useEffect)(()=>{c.FH.models().then(v).catch(()=>void 0)},[]);let b=async e=>{try{await c.FH.updateSession(r.id,{model:e}),y(e?h("model.saved",{name:e}):h("model.savedDefault")),o()}catch(e){y(e.message)}},k=async()=>{try{let e=await c.FH.setDefaultModel(w);v(s=>s?{...s,defaultModel:e.defaultModel}:s),y(e.defaultModel?h("model.defaultSaved",{name:e.defaultModel}):h("model.defaultCleared"))}catch(e){y(e.message)}},N=async()=>{if(await (0,g.Z)(h("model.refreshConfirm"))){j(!0),y(h("model.refreshing"));try{var e;let s=await c.FH.refreshModels();v(s),y(0===s.options.length?null!=(e=s.note)?e:h("model.none"):h("model.refreshed",{n:s.options.length}))}catch(e){y(e.message)}finally{j(!1)}}},w=null!=(s=r.model)?s:"",S=null!=(a=null==m?void 0:m.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:h("model.title")}),r.modelInUse&&(0,n.jsx)("span",{className:"chip",children:h("model.lastUsed",{name:r.modelInUse})})]}),(0,n.jsx)("p",{className:"muted small",children:h("model.hint")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsxs)("select",{"aria-label":h("model.title"),value:w,disabled:r.running,onChange:e=>void b(e.target.value),style:{width:"auto",minWidth:260},children:[(0,n.jsx)("option",{value:"",children:(null==m?void 0:m.defaultModel)?h("model.followsDefault",{name:m.defaultModel}):h("model.default")}),w&&!C&&(0,n.jsx)("option",{value:w,children:h("model.notInList",{name:w})}),F.map(e=>(0,n.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(h("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(h("model.unavailable")):""]},e.name))},s)})]}),(0,n.jsx)("button",{onClick:()=>void N(),disabled:x||r.running,children:h("model.refresh")}),(0,n.jsx)("span",{className:"muted small",role:"status",children:f})]}),(0,n.jsx)(p.L,{current:w,onUse:e=>void b(e)}),(0,n.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,n.jsx)("span",{className:"muted small",children:(null==m?void 0:m.defaultModel)?h("model.defaultIs",{name:m.defaultModel}):h("model.defaultIsNone")}),(0,n.jsx)("button",{onClick:()=>void k(),disabled:w===(null!=(i=null==m?void 0:m.defaultModel)?i:""),children:w?h("model.makeDefault",{name:w}):h("model.clearDefault")})]}),(null==m?void 0:m.readAt)?(0,n.jsxs)("p",{className:"muted small",style:{marginTop:8},children:[h("model.readAt",{t:u(m.readAt),n:m.options.length}),m.current?" ".concat(h("model.chatWasOn",{name:m.current})):"",m.note?" ".concat(m.note):""]}):(0,n.jsx)("p",{className:"muted small",style:{marginTop:8},children:h("model.neverRead")}),S.length>0&&(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:h("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:""},[h,u]=(0,t.useState)(o.enabled),[m,x]=(0,t.useState)(null!=(a=o.model)?a:""),[j,g]=(0,t.useState)(""),[f,y]=(0,t.useState)(!1),[b,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()=>{y(!0),g("");try{await c.FH.updateSession(l.id,{review:{enabled:h,model:m}}),g(r("review.saved")),i()}catch(e){g(e.message)}finally{y(!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(h?"done":""),children:h?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:h,onChange:e=>u(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:m,onChange:x,none:b?r("model.followsDefault",{name:b}):r("review.modelSame"),disabled:l.running||!h})}),(0,n.jsx)("p",{className:"why",children:r("review.modelWhy")}),(0,n.jsx)(p.z4,{current:m,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 W(e){var s;let{session:a,plan:l,onDone:i}=e,{t:r}=(0,d.kj)(),o=()=>Object.fromEntries(l.entries.filter(e=>e.choice).map(e=>[e.path,e.choice])),h=JSON.stringify(l.entries.map(e=>[e.path,e.choice])),[u,m]=(0,t.useState)(o);(0,t.useEffect)(()=>m(o()),[h]);let[p,v]=(0,t.useState)(!1),[x,j]=(0,t.useState)(""),g=l.entries.filter(e=>"include"===u[e.path]).length,f=async()=>{v(!0),j("");try{var e,s,n;let t=await c.FH.vcsSnapshot(a.id,u);j(t.ok?r("vcs.snapshotTaken",{branch:null!=(e=t.branch)?e:"",commit:(null!=(s=t.commit)?s:"").slice(0,8)}):null!=(n=t.problem)?n:""),i()}catch(e){j(e.message)}finally{v(!1)}};return(0,n.jsxs)("div",{className:"option",children:[(0,n.jsx)("p",{className:"small",children:r("vcs.snapshotList",{n:l.entries.length,branch:null!=(s=l.baselineBranch)?s:"—"})}),(0,n.jsx)("ul",{style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:l.entries.map(e=>{var s;return(0,n.jsxs)("li",{style:{marginBottom:4,overflowWrap:"anywhere"},children:[(0,n.jsx)("code",{children:e.path})," ",(0,n.jsxs)("span",{className:"muted small",children:["(",e.input?"".concat(r("vcs.snapshotInput"),", "):"",r("vcs.snapshotKind.".concat(e.kind)),void 0!==e.size?", ".concat((0,c.zi)(e.size)):"",")"]})," ",0===e.allowed.length?(0,n.jsx)("span",{className:"err small",children:r("vcs.snapshotBlocked")}):(0,n.jsx)("select",{"aria-label":e.path,value:null!=(s=u[e.path])?s:"",onChange:s=>m({...u,[e.path]:s.target.value}),disabled:p||a.running||e.allowed.length<2,children:e.allowed.map(e=>(0,n.jsx)("option",{value:e,children:r("include"===e?"vcs.snapshotInclude":"vcs.snapshotLeaveOut")},e))}),e.reason&&(0,n.jsx)("div",{className:"muted small",children:e.reason})]},e.path)})}),(0,n.jsx)("button",{className:"primary",onClick:()=>void f(),disabled:p||a.running||!l.ok||0===g,children:r("vcs.snapshotTake")}),(0,n.jsx)("p",{className:"why",children:r("vcs.snapshotCancelWhy")}),x&&(0,n.jsx)("p",{className:"small",role:"status",children:x})]})}function B(e){var s,a,l,i,r,o,h,u,m,v,x,j,g,f,y,b,k,N,S,C,F,I,T,M,B,H,R,O,P,D,L,A,E,q,U,J;let{session:z,onChange:G}=e,{t:Z}=(0,d.kj)(),K=null!=(g=z.vcs)?g:{enabled:!0,repoDir:"",branchMode:"per-task",commitOnFinish:!0,branchPrefix:"cop/"},[_,Y]=(0,t.useState)(K.repoDir),[Q,V]=(0,t.useState)(null),[X,$]=(0,t.useState)(""),[ee,es]=(0,t.useState)(!1),ea=JSON.stringify(K),[en,et]=(0,t.useState)(null),[el,ei]=(0,t.useState)(null!=(f=K.branchName)?f:"");(0,t.useEffect)(()=>{var e;return ei(null!=(e=JSON.parse(ea).branchName)?e:"")},[ea]);let[er,ec]=(0,t.useState)(null!=(y=K.baseBranch)?y:"");(0,t.useEffect)(()=>{var e;return ec(null!=(e=JSON.parse(ea).baseBranch)?e:"")},[ea]);let[ed,eo]=(0,t.useState)((null!=(b=null==(s=K.userInputs)?void 0:s.paths)?b:[]).join("\n"));(0,t.useEffect)(()=>{var e,s;return eo((null!=(s=null==(e=JSON.parse(ea).userInputs)?void 0:e.paths)?s:[]).join("\n"))},[ea]);let[eh,eu]=(0,t.useState)((null!=(k=null==(a=K.artifacts)?void 0:a.paths)?k:[]).join("\n"));(0,t.useEffect)(()=>{var e,s;return eu((null!=(s=null==(e=JSON.parse(ea).artifacts)?void 0:e.paths)?s:[]).join("\n"))},[ea]);let em=e=>e.split(/\r?\n/).map(e=>e.trim()).filter(Boolean),[ep,ev]=(0,t.useState)(null!=(N=K.existingBranch)?N:"");(0,t.useEffect)(()=>{var e;return ev(null!=(e=JSON.parse(ea).existingBranch)?e:"")},[ea]);let ex=null!=(S=K.startFrom)?S:"head";(0,t.useEffect)(()=>{Y(JSON.parse(ea).repoDir)},[ea]);let ej=JSON.parse(ea).repoDir||z.projectDir||"";(0,t.useEffect)(()=>{let e=!1;return ej.trim()?(c.FH.repoCheck(ej).then(s=>{var a;e||et(s.ok?null:null!=(a=s.problem)?a:null)}).catch(()=>{e||et(null)}),()=>{e=!0}):void et(null)},[ej]);let eg=(0,t.useCallback)(()=>{c.FH.vcsStatus(z.id).then(V).catch(()=>V(null))},[z.id]);(0,t.useEffect)(eg,[eg,ea]);let ef=async e=>{try{await c.FH.updateSession(z.id,{vcs:e}),$(Z("vcs.saved")),G(),eg()}catch(e){$(e.message)}},ey=async()=>{es(!0),$(Z("mirror.browsing"));try{let s=await c.FH.browseFolder(_.trim()||z.projectDir||void 0);if(s.ok)Y(s.path),await ef({repoDir:s.path});else{var e;$(s.cancelled?Z("mirror.browseCancelled"):null!=(e=s.reason)?e:"")}}catch(e){$(e.message)}finally{es(!1)}},eb=K.repoDir||z.projectDir||"",ek=""!==eb.trim()&&null===en;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:Z("vcs.title")}),(0,n.jsx)("span",{className:"badge ".concat(K.enabled?"done":""),children:K.enabled?Z("vcs.on"):Z("vcs.off")})]}),(0,n.jsx)("p",{className:"muted small",children:Z("vcs.hint")}),(0,n.jsx)("label",{htmlFor:"vcs-root",children:Z("vcs.repoField")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("input",{id:"vcs-root",type:"text",className:"grow",value:_,onChange:e=>Y(e.target.value),onBlur:()=>_.trim()!==K.repoDir&&void ef({repoDir:_.trim()}),placeholder:z.projectDir||"C:\\Projects\\my-app",disabled:z.running}),(0,n.jsx)("button",{onClick:()=>void ey(),disabled:ee||z.running,children:Z("mirror.browse")})]}),(0,n.jsx)(p.H4,{current:_,onUse:e=>{Y(e),ef({repoDir:e})}}),en&&(0,n.jsxs)("div",{className:"notice caution",style:{marginTop:8},children:[(0,n.jsx)("strong",{children:Z("vcs.noRepo")}),(0,n.jsx)("div",{className:"small",style:{marginTop:4},children:en}),(0,n.jsx)("div",{className:"muted small",style:{marginTop:6},children:Z("vcs.noRepoHow")})]}),!en&&""!==eb.trim()&&(0,n.jsx)("p",{className:"muted small",style:{marginTop:4},children:Z("vcs.repoOk")}),""===eb.trim()&&(0,n.jsx)("p",{className:"muted small",style:{marginTop:4},children:Z("vcs.pickFirst")}),(0,n.jsxs)("div",{className:"option".concat(ek||K.enabled?"":" warned"),children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:K.enabled,onChange:e=>void ef({enabled:e.target.checked}),disabled:z.running||!ek&&!K.enabled}),(0,n.jsx)("span",{children:Z("vcs.enable")})]}),(0,n.jsx)("p",{className:"why",children:Z("vcs.enableWhy")})]}),K.enabled&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"muted small",style:{marginTop:4},children:eb?Z("vcs.repoIs",{dir:eb}):Z("vcs.repoNone")}),eb&&!en&&(0,n.jsx)(w.E,{dir:eb}),(0,n.jsx)("h3",{children:Z("vcs.branches")}),"existing-branch"===ex&&(0,n.jsx)("p",{className:"muted small",children:Z("vcs.branchesExisting",{branch:K.existingBranch||"…"})}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"radio",name:"branchMode",checked:"per-task"===K.branchMode,onChange:()=>void ef({branchMode:"per-task"}),disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.perTask")})]}),(0,n.jsx)("p",{className:"why",children:Z("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"===K.branchMode,onChange:()=>void ef({branchMode:"per-session"}),disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.perSession")})]}),(0,n.jsx)("p",{className:"why",children:Z("vcs.perSessionWhy")})]}),"per-session"===K.branchMode&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("label",{htmlFor:"vcs-branch-name",children:Z("vcs.branchName")}),(0,n.jsx)("input",{id:"vcs-branch-name",type:"text",value:el,onChange:e=>ei(e.target.value),onBlur:()=>{var e;return el.trim()!==(null!=(e=K.branchName)?e:"")&&void ef({branchName:el.trim()})},placeholder:z.name,disabled:z.running}),(0,n.jsx)("p",{className:"why",children:Z("vcs.branchNameWhy")})]}),(0,n.jsx)("h3",{children:Z("vcs.startFrom")}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"radio",name:"startFrom",checked:"branch"===ex,onChange:()=>void ef({startFrom:"branch"}),disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.startBranch")})]}),(0,n.jsx)("p",{className:"why",children:Z("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"===ex,onChange:()=>void ef({startFrom:"previous-session"}),disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.startPrevious")})]}),(0,n.jsx)("p",{className:"why",children:Z("vcs.startPreviousWhy")})]}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"radio",name:"startFrom",checked:"head"===ex,onChange:()=>void ef({startFrom:"head"}),disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.startHead")})]}),(0,n.jsx)("p",{className:"why",children:Z("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"===ex,onChange:()=>void ef({startFrom:"existing-branch"}),disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.startExisting")})]}),(0,n.jsx)("p",{className:"why",children:Z("vcs.startExistingWhy")})]}),"existing-branch"===ex&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("label",{htmlFor:"vcs-existing-branch",children:Z("vcs.existingBranch")}),(0,n.jsx)("input",{id:"vcs-existing-branch",type:"text",list:"vcs-local-branches",value:ep,onChange:e=>ev(e.target.value),onBlur:()=>{var e;return ep.trim()!==(null!=(e=K.existingBranch)?e:"")&&void ef({existingBranch:ep.trim()})},disabled:z.running}),(0,n.jsx)("datalist",{id:"vcs-local-branches",children:(null!=(C=null==Q?void 0:Q.branches)?C:[]).map(e=>(0,n.jsx)("option",{value:e},e))}),(0,n.jsx)("p",{className:"why",children:Z("vcs.existingBranchWhy")}),K.existingBranch&&(null==Q?void 0:Q.branches)&&!Q.branches.includes(K.existingBranch)&&(0,n.jsx)("p",{className:"err small",children:Z("vcs.existingBranchMissing",{branch:K.existingBranch})})]}),("branch"===ex||"previous-session"===ex)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("label",{htmlFor:"vcs-base-branch",children:Z("vcs.baseBranch")}),(0,n.jsx)("input",{id:"vcs-base-branch",type:"text",value:er,onChange:e=>ec(e.target.value),onBlur:()=>{var e;return er.trim()!==(null!=(e=K.baseBranch)?e:"")&&void ef({baseBranch:er.trim()})},placeholder:"main",disabled:z.running}),(0,n.jsx)("p",{className:"why",children:Z("vcs.baseBranchWhy")})]}),z.vcsStart&&(0,n.jsxs)("p",{className:"muted small",children:["existing-branch"===z.vcsStart.kind?Z("vcs.startedExisting",{branch:null!=(F=z.vcsStart.branch)?F:"",commit:z.vcsStart.commit.slice(0,8)}):"previous-session"===z.vcsStart.kind?Z("vcs.startedPrevious",{name:null!=(I=null==(l=z.vcsStart.fromSession)?void 0:l.name)?I:"",branch:null!=(T=z.vcsStart.branch)?T:"",commit:z.vcsStart.commit.slice(0,8)}):"branch"===z.vcsStart.kind?Z("vcs.startedBranch",{branch:null!=(M=z.vcsStart.branch)?M:"",commit:z.vcsStart.commit.slice(0,8)}):"snapshot"===z.vcsStart.kind?Z("vcs.startedSnapshot",{branch:null!=(B=z.vcsStart.branch)?B:"",commit:z.vcsStart.commit.slice(0,8),from:null!=(H=null==(i=z.vcsStart.snapshot)?void 0:i.fromBranch)?H:"HEAD",n:null!=(R=null==(r=z.vcsStart.snapshot)?void 0:r.included.length)?R:0,out:null!=(O=null==(o=z.vcsStart.snapshot)?void 0:o.leftOut.length)?O:0}):Z("vcs.startedHead",{commit:z.vcsStart.commit.slice(0,8)}),z.vcsStart.note?" — ".concat(z.vcsStart.note):"",z.vcsStart.update&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("br",{}),"updated"===z.vcsStart.update.outcome?Z("vcs.updated",{branch:z.vcsStart.update.branch,remote:null!=(P=z.vcsStart.update.remote)?P:"",from:(null!=(D=z.vcsStart.update.from)?D:"").slice(0,8),to:(null!=(L=z.vcsStart.update.to)?L:"").slice(0,8)}):"up-to-date"===z.vcsStart.update.outcome?Z("vcs.upToDate",{branch:z.vcsStart.update.branch,remote:null!=(A=z.vcsStart.update.remote)?A:""}):Z("vcs.notUpdated",{branch:z.vcsStart.update.branch,why:null!=(E=z.vcsStart.update.detail)?E:z.vcsStart.update.outcome})]})]}),"head"!==ex&&(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:!1!==K.updateFromRemote,onChange:e=>void ef({updateFromRemote:e.target.checked}),disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.updateFromRemote")})]}),(0,n.jsx)("p",{className:"why",children:Z("vcs.updateFromRemoteWhy")})]}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:K.commitOnFinish,onChange:e=>void ef({commitOnFinish:e.target.checked}),disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.commit")})]}),(0,n.jsx)("p",{className:"why",children:Z("vcs.commitWhy")})]}),"existing-branch"!==ex&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("h3",{children:Z("vcs.dirty")}),["reject","snapshot","tracked-only-snapshot"].map(e=>{var s,a;return(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"radio",name:"vcs-dirty-".concat(z.id),checked:(null!=(a=null==(s=K.dirtyWorktree)?void 0:s.policy)?a:"reject")===e,onChange:()=>{var s;ef({dirtyWorktree:{policy:e,requireApproval:null==(s=K.dirtyWorktree)?void 0:s.requireApproval}})},disabled:z.running}),(0,n.jsx)("span",{children:Z("reject"===e?"vcs.dirtyReject":"snapshot"===e?"vcs.dirtySnapshot":"vcs.dirtyTracked")})]}),(0,n.jsx)("p",{className:"why",children:Z("reject"===e?"vcs.dirtyRejectWhy":"snapshot"===e?"vcs.dirtySnapshotWhy":"vcs.dirtyTrackedWhy")})]},e)}),(null!=(q=null==(h=K.dirtyWorktree)?void 0:h.policy)?q:"reject")!=="reject"&&(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:(null==(u=K.dirtyWorktree)?void 0:u.requireApproval)!==!1,onChange:e=>{var s,a;ef({dirtyWorktree:{policy:null!=(a=null==(s=K.dirtyWorktree)?void 0:s.policy)?a:"snapshot",requireApproval:e.target.checked}})},disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.dirtyApproval")})]}),(0,n.jsx)("p",{className:"why",children:Z("vcs.dirtyApprovalWhy")})]})]}),(0,n.jsx)("h3",{children:Z("vcs.inputs")}),(0,n.jsx)("label",{htmlFor:"vcs-inputs-".concat(z.id),children:Z("vcs.inputsField")}),(0,n.jsx)("textarea",{id:"vcs-inputs-".concat(z.id),rows:3,value:ed,onChange:e=>eo(e.target.value),onBlur:()=>{var e,s;return JSON.stringify(em(ed))!==JSON.stringify(null!=(s=null==(e=K.userInputs)?void 0:e.paths)?s:[])&&void ef({userInputs:{...K.userInputs,paths:em(ed)}})},disabled:z.running,placeholder:"rules-engine/test-data/schemas/*.yaml",spellCheck:!1}),(0,n.jsx)("p",{className:"why",children:Z("vcs.inputsWhy")}),(null!=(U=null==(m=K.userInputs)?void 0:m.paths.length)?U:0)>0&&(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:(null==(v=K.userInputs)?void 0:v.readOnly)!==!1,onChange:e=>{var s,a,n;ef({userInputs:{paths:null!=(n=null==(s=K.userInputs)?void 0:s.paths)?n:[],requireApproval:null==(a=K.userInputs)?void 0:a.requireApproval,readOnly:e.target.checked}})},disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.inputsReadOnly")})]}),(0,n.jsx)("p",{className:"why",children:Z("vcs.inputsReadOnlyWhy")})]}),(null==(x=z.vcsStart)?void 0:x.inputs)&&(0,n.jsx)("p",{className:"muted small",children:z.vcsStart.inputs.carried?Z("vcs.inputsCarried",{n:z.vcsStart.inputs.files.length,branch:z.vcsStart.inputs.carried.branch,onto:z.vcsStart.inputs.carried.onto.slice(0,8)}):Z("vcs.inputsRecorded",{n:z.vcsStart.inputs.files.length,commit:z.vcsStart.commit.slice(0,8)})}),(0,n.jsx)("h3",{children:Z("vcs.artifacts")}),(0,n.jsx)("label",{htmlFor:"vcs-artifacts-".concat(z.id),children:Z("vcs.artifactsField")}),(0,n.jsx)("textarea",{id:"vcs-artifacts-".concat(z.id),rows:2,value:eh,onChange:e=>eu(e.target.value),onBlur:()=>{var e,s;return JSON.stringify(em(eh))!==JSON.stringify(null!=(s=null==(e=K.artifacts)?void 0:e.paths)?s:[])&&void ef({artifacts:{paths:em(eh)}})},disabled:z.running,placeholder:"rules-engine/test-results/**",spellCheck:!1}),(0,n.jsx)("p",{className:"why",children:Z("vcs.artifactsWhy")}),Q&&!Q.ok&&(0,n.jsxs)("div",{className:"notice caution",role:"status",children:[(0,n.jsx)("strong",{children:Z("vcs.notReady")})," ",Q.problem]}),(null==Q||null==(j=Q.snapshot)?void 0:j.needed)&&Q.snapshot.entries.length>0&&(0,n.jsx)(W,{session:z,plan:Q.snapshot,onDone:()=>{G(),eg()}}),(null==Q?void 0:Q.ok)&&(0,n.jsx)("div",{className:"muted small",children:Z("vcs.ready",{branch:null!=(J=Q.branch)?J:"—",dir:Q.repoDir})}),(null==Q?void 0:Q.ok)&&Q.work&&Q.work.branches.length>0&&(0,n.jsxs)("div",{className:"muted small",children:["per-session"===Q.work.mode&&Q.work.complete?Z("vcs.completeOn",{branch:Q.work.complete}):Z("vcs.noSingleBranch",{n:Q.work.branches.length}),"per-task"===Q.work.mode&&(0,n.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:Q.work.branches.map(e=>(0,n.jsxs)("li",{children:[(0,n.jsx)("code",{children:e.branch})," — ",e.title,e.commit?"":" (".concat(Z("vcs.taskNoFiles"),")")]},e.branch))})]}),(0,n.jsx)("p",{className:"muted small",children:Z("vcs.pushIsYours")})]}),(0,n.jsx)("div",{className:"muted small",role:"status",children:X})]})}function H(e){var s;let{session:a,onChange:l}=e,{t:i}=(0,d.kj)(),[r,o]=(0,t.useState)(""),h=null!=(s=a.onFailure)?s:"stop",u=async e=>{if(e!==h)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"===h,onChange:()=>void u("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"===h,onChange:()=>void u("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 R(e){let{value:s,onChange:a,presets:l,onPresetsChanged:i}=e,{t:r}=(0,d.kj)(),o=(0,t.useId)(),[h,u]=(0,t.useState)(""),m=async()=>{let e=prompt(r("l2.saveAsPrompt"));if(e)try{await c.FH.savePreset(e,s),u(r("l2.savedAs",{name:e})),null==i||i()}catch(e){u(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 m(),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}}),h&&(0,n.jsx)("div",{className:"muted small",children:h})]})}function O(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)([]),h=r.length>0?r:i.map(e=>e.id),u=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:u("outcome"),download:!0,children:a("export.outcome",{n:h.length})}),(0,n.jsx)("a",{className:"button-link",href:u("full"),download:!0,children:a("export.full",{n:h.length})})]}),(0,n.jsx)("p",{className:"muted small",style:{marginTop:8},children:a("export.outcomeWhy")})]})]})}function P(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 D(e){var s;let{session:a,presets:l,onAdded:i,onPresetsChanged:r}=e,{t:o}=(0,d.kj)(),h=[...a.tasks].reverse()[0],[u,m]=(0,t.useState)(""),[p,v]=(0,t.useState)(null!=(s=null==h?void 0:h.level2)?s:""),[x,j]=(0,t.useState)(""),[g,f]=(0,t.useState)(""),[y,b]=(0,t.useState)(!1),k=(0,t.useRef)(!1),N=async()=>{if(!k.current){k.current=!0,b(!0);try{await c.FH.addTask(a.id,{title:u,level2:p,prompt:x}),m(""),j(""),f(o("form.queued")),i()}catch(e){f(e.message)}finally{k.current=!1,b(!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:u,onChange:e=>m(e.target.value),placeholder:o("form.titlePlaceholder")}),(0,n.jsx)("div",{style:{marginTop:10},children:(0,n.jsx)(R,{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:y||!x.trim(),children:o("form.add")}),(0,n.jsx)("span",{className:"muted small",children:g})]})]})}function L(e){var s,a,l,i,r,m,p,v,y,k,w,S,C,F,I,T,M,W,B,H,O,D,L,A,q,G,Z,K,_,Y,Q,V,X,$,ee,es,ea,en,et,el,ei,er,ec,ed,eo,eh,eu,em,ep,ev,ex,ej,eg,ef,ey,eb,ek,eN,ew,eS,eC,eF,eI,eT,eM,eW,eB,eH,eR,eO,eP,eD,eL,eA,eE,eq,eU,eJ,ez,eG,eZ,eK,e_,eY;let{session:eQ,task:eV,index:eX,presets:e$,onChange:e0}=e,{t:e1}=(0,d.kj)(),e2=(0,d.W3)(),[e8,e4]=(0,t.useState)(!1),[e6,e3]=(0,t.useState)(!1),[e5,e7]=(0,t.useState)(eV.title),[e9,se]=(0,t.useState)(eV.level2),[ss,sa]=(0,t.useState)(eV.prompt),[sn,st]=(0,t.useState)(null!=(es=null==(s=eV.vcsPlan)?void 0:s.branch)?es:""),[sl,si]=(0,t.useState)(null!=(ea=null==(a=eV.vcsPlan)?void 0:a.commitMessage)?ea:""),[sr,sc]=(0,t.useState)(null!=(en=eV.checks)?en:[]),[sd,so]=(0,t.useState)(!!eV.readOnly),[sh,su]=(0,t.useState)((null!=(et=eV.scope)?et:[]).join("\n")),sm={readOnly:sd,scope:sd?[]:(0,N.w)(sh)},sp=(0,u.c)((0,h.DG)(eV)),[sv,sx]=(0,t.useState)(null),[sj,sg]=(0,t.useState)(""),sf=async()=>{try{await c.FH.updateTask(eQ.id,eV.id,{title:e5,level2:e9,prompt:ss,vcsPlan:{branch:sn,commitMessage:sl},checks:sr,...sm}),e4(!1),e0()}catch(e){sg(e.message)}},sy="running"===eV.status||"waiting-approval"===eV.status,sb=!sy&&"queued"!==eV.status,sk=!sy&&"queued"!==eV.status,sN=!sy&&null!=(el=null==(l=eQ.vcs)?void 0:l.enabled)&&el&&(!!(null==(i=eV.vcs)?void 0:i.baseCommit)||(null!=(ei=eV.attempts)?ei:[]).some(e=>{var s;return null==(s=e.vcs)?void 0:s.baseCommit})),sw=!sy&&(0,c.Zm)(eV),sS=async()=>{if(await (0,g.Z)(e1("task.continueConfirm",{title:eV.title})))try{await c.FH.continueTask(eQ.id,eV.id),e0()}catch(e){sg(e.message)}},sC=async()=>{if(await (0,g.Z)(e1("task.rerunConfirm",{title:eV.title})))try{await c.FH.rerunTask(eQ.id,eV.id),e0()}catch(e){sg(e.message)}},sF=async()=>{if(await (0,g.Z)(e1("task.editRanConfirm",{title:eV.title})))try{await c.FH.rerunTask(eQ.id,eV.id,{title:e5,level2:e9,prompt:ss,vcsPlan:{branch:sn,commitMessage:sl},checks:sr,...sm},{buildOnFinished:"done"===eV.status}),e4(!1),e0()}catch(e){sg(e.message)}},sI=(0,b.e)(e0),sT=async()=>{let e="queued"===eV.status?"task.deleteConfirm":"task.deleteConfirmRan";if(await (0,g.Z)(e1(e,{title:eV.title})))try{await c.FH.deleteTask(eQ.id,eV.id),e0()}catch(e){sg(e.message)}},sM=async()=>{try{sx(await c.FH.taskFiles(eQ.id,eV.id))}catch(e){sg(e.message)}},sW=(e,s,a)=>a.length>0&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("span",{className:"muted",children:[e1(e)," "]}),a.map(e=>(0,n.jsx)("span",{style:{marginRight:10},children:(0,n.jsx)(o.u,{label:e,save:()=>c.FH.saveTaskFile(eQ.id,eV.id,s,e)})},e))]});return(0,n.jsxs)("div",{className:"task ".concat(eV.status),id:eV.id,children:[(0,n.jsxs)("div",{className:"row",children:[(0,n.jsxs)("h4",{className:"grow",children:[eX,". ",eV.title]}),(0,n.jsx)("span",{className:"badge ".concat(eV.status),children:e1("status.".concat(eV.status))}),eV.limit&&(0,n.jsx)("span",{className:"chip",title:e1("reg.limitChipWhy"),children:e1("reg.limitChip",{limit:e1("limit.".concat(eV.limit.setting),{n:eV.limit.value})})}),(null!=(er=eV.attempt)?er:1)>1&&(0,n.jsx)("span",{className:"chip",children:e1("task.attemptN",{n:null!=(ec=eV.attempt)?ec:1})}),eV.iterations>0&&(0,n.jsx)("span",{className:"muted small",children:e1("task.iterations",{n:eV.iterations})}),eV.runId&&(0,n.jsxs)("button",{className:e6?"":"quiet","aria-expanded":e6,onClick:()=>e3(e=>!e),title:(0,h.DG)(eV)?e1("story.showLiveWhy"):e1("story.why"),children:[(0,h.DG)(eV)&&!e6&&(0,n.jsx)("span",{className:"dot","aria-hidden":"true"}),e6?e1("story.hide"):(0,h.DG)(eV)?e1("story.showLive"):e1("story.show")]}),!sy&&(0,n.jsx)("button",{onClick:()=>{if(!e8){var e,s,a,n,t,l;e7(eV.title),se(eV.level2),sa(eV.prompt),st(null!=(a=null==(e=eV.vcsPlan)?void 0:e.branch)?a:""),si(null!=(n=null==(s=eV.vcsPlan)?void 0:s.commitMessage)?n:""),sc(null!=(t=eV.checks)?t:[]),so(!!eV.readOnly),su((null!=(l=eV.scope)?l:[]).join("\n"))}e4(!e8)},title:e1("task.editAll"),children:e8?e1("task.cancel"):e1("task.edit")}),sw&&(0,n.jsx)("button",{className:"primary",onClick:()=>void sS(),title:e1("task.continueWhy"),children:e1("task.continue")}),sk&&(0,n.jsx)("button",{className:sw?"":"primary",onClick:()=>void sC(),title:e1("task.rerunWhy"),children:e1("task.rerun")}),sN&&(0,n.jsx)("button",{onClick:()=>void sI.restore({sessionId:eQ.id,taskId:eV.id,title:eV.title}),disabled:""!==sI.busy||eQ.running,title:e1("restore.why"),children:"restore"===sI.busy?e1("restore.checking"):e1("restore.button")}),sb&&(0,n.jsx)("button",{onClick:()=>void sI.restartFrom({sessionId:eQ.id,taskId:eV.id,title:eV.title}),disabled:""!==sI.busy||eQ.running,title:e1("restart.why"),children:"restart"===sI.busy?e1("restart.checking"):e1("restart.button")}),!sy&&(0,n.jsx)("button",{className:"danger",onClick:()=>void sT(),children:e1("task.delete")}),!e8&&(sj||sI.message)&&(0,n.jsx)("span",{className:"err",role:"alert",children:sj||sI.message})]}),(0,n.jsxs)("div",{className:"muted small",children:[eV.startedAt?e1("task.started",{t:e2(eV.startedAt)}):e1("task.added",{t:e2(eV.createdAt)}),eV.finishedAt?" \xb7 ".concat(e1("task.finished",{t:e2(eV.finishedAt)})):"",eV.startedAt&&eV.finishedAt?" \xb7 ".concat(e1("task.took",{d:(0,c.c5)((0,h.d5)(eV.startedAt,eV.finishedAt))})):"",(0,h.DG)(eV)?" \xb7 ".concat(e1("task.runningFor",{d:(0,c.c5)((0,h.d5)(eV.startedAt,void 0,sp))})):""]}),"queued"!==eV.status&&(null==(r=eQ.vcs)?void 0:r.enabled)&&eV.vcs&&(0,n.jsx)("div",{className:"muted small",children:eV.vcs.problem&&!eV.vcs.branch?(0,n.jsx)("span",{className:"reason",children:e1("vcs.taskProblem",{problem:eV.vcs.problem})}):(0,n.jsxs)(n.Fragment,{children:[eV.vcs.branch&&e1("vcs.taskBranch",{branch:eV.vcs.branch}),eV.vcs.baseCommit&&" \xb7 ".concat(e1("vcs.taskBase",{commit:eV.vcs.baseCommit.slice(0,8)})),eV.vcs.commit?" \xb7 ".concat(e1("vcs.taskCommit",{commit:eV.vcs.commit.slice(0,8)})):" \xb7 ".concat(e1("vcs.taskNoFiles")),(null!=(ed=null==(m=eV.vcs.files)?void 0:m.length)?ed:0)>0&&(0,n.jsxs)("details",{style:{display:"inline"},children:[(0,n.jsxs)("summary",{style:{display:"inline",cursor:"pointer"},children:[" \xb7 ",e1("vcs.taskFiles",{n:null!=(eo=null==(p=eV.vcs.files)?void 0:p.length)?eo:0})]}),(0,n.jsx)("ul",{style:{margin:"4px 0 4px 0",paddingLeft:20},children:(null!=(eh=eV.vcs.files)?eh:[]).map(e=>(0,n.jsxs)("li",{children:[(0,n.jsx)("code",{children:e.path})," ",e.added<0||e.removed<0?e1("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))})]}),eV.vcs.commit&&eV.vcs.baseCommit&&(0,n.jsxs)(n.Fragment,{children:[" \xb7 ",(0,n.jsx)(f.C,{sessionId:eQ.id,taskId:eV.id,title:eV.title,files:null!=(eu=null==(v=eV.vcs.files)?void 0:v.length)?eu:0})]}),(null!=(em=null==(y=eV.vcs.suspicious)?void 0:y.length)?em:0)>0&&(0,n.jsxs)("div",{className:"err small",style:{marginTop:4},children:[e1("vcs.suspicious",{n:null!=(ep=null==(k=eV.vcs.suspicious)?void 0:k.length)?ep:0}),(0,n.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(ev=eV.vcs.suspicious)?ev:[]).map(e=>(0,n.jsxs)("li",{children:[(0,n.jsx)("code",{children:e.path})," — ",e.reason]},e.path))})]}),(null!=(ex=null==(w=eV.scopeReverted)?void 0:w.length)?ex:0)>0&&(0,n.jsx)("div",{className:"small",style:{marginTop:4},children:e1(eV.readOnly?"task.readOnlyReverted":"task.scopeReverted",{n:null!=(ej=null==(S=eV.scopeReverted)?void 0:S.length)?ej:0,paths:(null!=(eg=eV.scopeReverted)?eg:[]).join(", ")})}),(null!=(ef=null==(C=eV.inputsRestored)?void 0:C.length)?ef:0)>0&&(0,n.jsx)("div",{className:"small",style:{marginTop:4},children:e1("task.inputsRestored",{n:null!=(ey=null==(F=eV.inputsRestored)?void 0:F.length)?ey:0,paths:(null!=(eb=eV.inputsRestored)?eb:[]).join(", ")})}),(null!=(ek=null==(I=eV.artifactsKept)?void 0:I.length)?ek:0)>0&&(0,n.jsx)("div",{className:"muted small",style:{marginTop:4,overflowWrap:"anywhere"},children:e1("task.artifactsKept",{n:null!=(eN=null==(T=eV.artifactsKept)?void 0:T.length)?eN:0,paths:(null!=(ew=eV.artifactsKept)?ew:[]).slice(0,10).map(e=>e.path).join(", ")})}),(null!=(eS=null==(M=eV.vcs.foreignCommits)?void 0:M.length)?eS:0)>0&&(0,n.jsxs)("div",{className:"err small",style:{marginTop:4},children:[e1("vcs.foreignCommits",{n:null!=(eC=null==(W=eV.vcs.foreignCommits)?void 0:W.length)?eC:0}),(0,n.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(eF=eV.vcs.foreignCommits)?eF:[]).map(e=>(0,n.jsx)("li",{children:(0,n.jsx)("code",{children:e})},e))})]})]})}),"queued"===eV.status&&(null==(B=eQ.vcs)?void 0:B.enabled)&&((null==(H=eV.vcsPlan)?void 0:H.branch)||(null==(O=eV.vcsPlan)?void 0:O.commitMessage))&&(0,n.jsx)("div",{className:"muted small",children:eV.vcsPlan.branch&&eV.vcsPlan.commitMessage?e1("task.gitNames",{branch:eV.vcsPlan.branch,subject:eV.vcsPlan.commitMessage.split("\n")[0]}):eV.vcsPlan.branch?e1("task.gitBranchOnly",{branch:eV.vcsPlan.branch}):e1("task.gitCommitOnly",{subject:(null!=(eI=eV.vcsPlan.commitMessage)?eI:"").split("\n")[0]})}),e6&&eV.runId&&(0,n.jsx)(x.P,{sessionId:eQ.id,taskId:eV.id,live:"running"===eV.status||"waiting-approval"===eV.status}),e8?(0,n.jsxs)("div",{style:{marginTop:8},children:[(0,n.jsx)("label",{children:e1("form.titleLabel")}),(0,n.jsx)("input",{type:"text",value:e5,onChange:e=>e7(e.target.value)}),(0,n.jsx)("div",{style:{marginTop:8},children:(0,n.jsx)(R,{value:e9,onChange:se,presets:e$})}),(0,n.jsx)("label",{children:e1("form.taskLabel")}),(0,n.jsx)("textarea",{className:"prose",value:ss,onChange:e=>sa(e.target.value)}),(null==(D=eQ.vcs)?void 0:D.enabled)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("label",{htmlFor:"branch-".concat(eV.id),children:e1("task.branch")}),(0,n.jsx)("input",{id:"branch-".concat(eV.id),type:"text",value:sn,onChange:e=>st(e.target.value),placeholder:eQ.vcs.branchPrefix,disabled:"per-session"===eQ.vcs.branchMode}),(0,n.jsx)("p",{className:"why",children:"per-session"===eQ.vcs.branchMode?e1("task.branchIgnored"):e1("task.branchWhy")}),(0,n.jsx)("label",{htmlFor:"commit-".concat(eV.id),children:e1("task.commitMessage")}),(0,n.jsx)("textarea",{id:"commit-".concat(eV.id),value:sl,onChange:e=>si(e.target.value),style:{minHeight:70}}),(0,n.jsx)("p",{className:"why",children:e1("task.commitWhy")})]}),(0,n.jsx)(E,{checks:sr,onChange:sc}),ss.trim()!==eV.prompt.trim()&&(0,n.jsx)("p",{className:"notice caution small",children:e1("task.newIntentNote")}),(0,n.jsx)(N.y,{readOnly:sd,scope:sh,onReadOnly:so,onScope:su}),(0,n.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,n.jsx)("button",{className:"primary",onClick:()=>void(sb?sF():sf()),children:sb?e1("task.saveAndRerun"):e1("task.save")}),(0,n.jsx)("span",{className:"err",children:sj})]}),sb&&(0,n.jsx)("p",{className:"muted small",children:e1("task.editRanWhy")})]}):(0,n.jsxs)(n.Fragment,{children:[(null!=(eT=null==(L=eV.checks)?void 0:L.length)?eT:0)>0&&(0,n.jsxs)("details",{className:"small",style:{margin:"6px 0"},children:[(0,n.jsxs)("summary",{children:[e1("checks.title")," — ",e1("checks.n",{n:null!=(eM=null==(A=eV.checks)?void 0:A.length)?eM:0}),(null!=(eW=null==(q=eV.checkResults)?void 0:q.length)?eW:0)>0&&" \xb7 ".concat((null!=(eB=eV.checkResults)?eB:[]).filter(e=>e.passed).length,"/").concat(null==(G=eV.checkResults)?void 0:G.length," ").concat(e1("checks.passed"))]}),(0,n.jsx)("ul",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(eH=eV.checks)?eH:[]).map((e,s)=>{var a;let t=(null!=(a=eV.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:[" — ",e1("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?e1("checks.passed"):e1("checks.failed")," — ",t.detail]})]},"".concat(e.name,"-").concat(s))})})]}),(null!=(eR=null==(Z=eV.reviewChecks)?void 0:Z.length)?eR:0)>0&&(0,n.jsxs)("details",{className:"small",style:{margin:"6px 0"},children:[(0,n.jsx)("summary",{children:e1("checks.fromReview",{n:null!=(eO=null==(K=eV.reviewChecks)?void 0:K.length)?eO:0})}),(0,n.jsx)("p",{className:"why",children:e1("checks.fromReviewWhy")}),(0,n.jsx)("ul",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(eP=eV.reviewChecks)?eP:[]).map(e=>{var s;let a=(null!=(s=eV.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:e1("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?e1("checks.passed"):e1("checks.failed")," — ",a.detail]})]},"".concat(e.attempt,":").concat(e.findingId,":").concat(e.check.name))})})]}),(0,n.jsx)(z,{review:eV.review}),eV.stopCode&&!(0,h.DG)(eV)&&(0,n.jsx)("p",{className:"small",children:(0,n.jsx)("span",{className:"chip",title:e1("stop.why"),children:e1("stop.".concat(eV.stopCode))})}),eV.handoff&&!(0,h.DG)(eV)&&(0,n.jsx)(P,{handoff:eV.handoff}),eV.summary&&(0,n.jsxs)("div",{className:"summary",children:[(0,n.jsx)("strong",{children:e1("task.whatWasDone")}),(0,n.jsx)(j.s,{text:eV.summary})]}),(null!=(eD=null==(_=eV.deviations)?void 0:_.length)?eD:0)>0&&(0,n.jsx)(U,{items:null!=(eL=eV.deviations)?eL:[]}),(null!=(eA=null==(Y=eV.disputes)?void 0:Y.length)?eA:0)>0&&(0,n.jsx)(J,{items:null!=(eE=eV.disputes)?eE:[]}),eV.environment&&(0,n.jsx)("div",{className:"muted small",style:{margin:"4px 0"},children:e1("task.ranWith",{node:eV.environment.node,npm:null!=(eq=eV.environment.npm)?eq:"—",git:null!=(eU=eV.environment.git)?eU:"—",pwsh:null!=(ez=null!=(eJ=eV.environment.pwsh)?eJ:eV.environment.powershell)?ez:"—"})}),(null!=(eG=null==(Q=eV.leftovers)?void 0:Q.length)?eG:0)>0&&(0,n.jsxs)("div",{className:"err small",style:{margin:"6px 0"},children:[e1("task.leftovers",{n:null!=(eZ=null==(V=eV.leftovers)?void 0:V.length)?eZ:0}),(0,n.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(eK=eV.leftovers)?eK:[]).map(e=>(0,n.jsxs)("li",{children:[(0,n.jsx)("code",{children:e.name})," pid ",e.pid,e.ports.length>0?" \xb7 ".concat(e1("task.leftoverPorts",{ports:e.ports.join(", ")})):""," \xb7 ",e.by]},"".concat(e.by,"-").concat(e.pid)))})]}),eV.reason&&(0,n.jsx)("div",{className:"reason small",style:{margin:"6px 0"},children:eV.reason}),(null!=(e_=null==(X=eV.attempts)?void 0:X.length)?e_:0)>0&&(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:e1("task.attempts",{n:null!=(eY=null==($=eV.attempts)?void 0:$.length)?eY:0})}),null==(ee=eV.attempts)?void 0:ee.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:e1("task.attemptN",{n:s+1})}),(0,n.jsx)("span",{className:"badge ".concat(e.status),children:e1("status.".concat(e.status))}),e.iterations>0&&(0,n.jsx)("span",{className:"muted",children:e1("task.iterations",{n:e.iterations})}),e.runId&&(0,n.jsx)(o.u,{label:e1("save.attemptLog"),save:()=>c.FH.saveTaskLog(eQ.id,eV.id,e.runId)}),e.runId&&(0,n.jsx)(o.H,{sessionId:eQ.id,taskId:eV.id,attempt:s+1}),e.runId&&(null==(a=e.vcs)?void 0:a.commit)&&e.vcs.baseCommit&&(0,n.jsx)(f.C,{sessionId:eQ.id,taskId:eV.id,runId:e.runId,title:"".concat(eV.title," — ").concat(e1("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?e1("task.started",{t:e2(e.startedAt)}):"",e.finishedAt?" \xb7 ".concat(e1("task.finished",{t:e2(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!==eV.prompt&&(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:e1("task.attemptText")}),(0,n.jsx)("pre",{children:e.prompt})]})]},"".concat(null!=(i=e.runId)?i:s))})]}),"queued"===eV.status?(0,n.jsxs)("div",{style:{marginTop:8},children:[(0,n.jsx)("div",{className:"muted small",children:e1("task.prompt")}),(0,n.jsx)("pre",{children:eV.prompt}),eV.level2.trim()?(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:e1("task.l2Show",{n:eV.level2.trim().split("\n").length})}),(0,n.jsx)("pre",{children:eV.level2})]}):(0,n.jsx)("div",{className:"muted small",children:e1("task.noL2")})]}):(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:e1("task.promptAndL2")}),eV.level2.trim()&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"muted small",children:e1("task.l2")}),(0,n.jsx)("pre",{children:eV.level2})]}),(0,n.jsx)("div",{className:"muted small",children:e1("task.prompt")}),(0,n.jsx)("pre",{children:eV.prompt})]}),eV.firstMessage&&(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:e1("task.firstMessage")}),(0,n.jsx)("pre",{className:"tall",children:eV.firstMessage})]}),eV.runId&&(0,n.jsxs)("details",{onToggle:e=>e.currentTarget.open&&void sM(),children:[(0,n.jsx)("summary",{children:e1("task.files")}),(0,n.jsx)("div",{className:"row small",style:{margin:"6px 0"},children:(0,n.jsx)(o.u,{label:e1("save.log"),save:()=>c.FH.saveTaskLog(eQ.id,eV.id)})}),sv&&(0,n.jsxs)("div",{className:"small",children:[sW("task.reports","reports",sv.reports),sW("task.artifacts","artifacts",sv.artifacts),sW("task.replies","replies",sv.replies)]})]}),eV.finalReply&&(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:e1("task.finalReply")}),(0,n.jsx)("pre",{className:"tall",children:eV.finalReply})]})]})]})}function A(e){let{events:s}=e,{t:a}=(0,d.kj)(),{appearance:l}=(0,m.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 E(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,h;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!=(h=e.value)?h:"",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 q(e){let{tasks:s}=e,{t:a}=(0,d.kj)(),t=(0,h.hH)(s),l=(0,u.c)(!!t&&t.tasks.some(h.DG));if(!t)return null;let i=(0,h.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 J(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:h,disabled:u=!1,style:m}=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}(h),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:u,style:{width:"auto",minWidth:280,...m},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)})]})}},8078:(e,s,a)=>{"use strict";a.d(s,{AppearanceProvider:()=>o,KP:()=>h});var n=a(3365),t=a(1521);let l="cop.appearance",i=["small","normal","large","huge","giant"];"\n(function () {\n try {\n var d = document.documentElement;\n var raw = localStorage.getItem('".concat(l,"');\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(i),".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");let r={theme:"light",textSize:"normal",highContrast:!1,reduceMotion:!1,underlineLinks:!1,strongFocus:!1};function c(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 d=(0,t.createContext)({appearance:r,set:()=>void 0,reset:()=>void 0,loaded:!1});function o(e){let{children:s}=e,[a,o]=(0,t.useState)(r),[h,u]=(0,t.useState)(!1);(0,t.useEffect)(()=>{let e=r;try{let s=window.localStorage.getItem(l);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":r.theme,textSize:i.includes(s.textSize)?s.textSize:r.textSize,highContrast:a(s.highContrast,r.highContrast),reduceMotion:a(s.reduceMotion,r.reduceMotion),underlineLinks:a(s.underlineLinks,r.underlineLinks),strongFocus:a(s.strongFocus,r.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){}o(e),c(e),u(!0)},[]);let m=(0,t.useCallback)(e=>{o(s=>{let a={...s,...e};c(a);try{window.localStorage.setItem(l,JSON.stringify(a))}catch(e){}return a})},[]),p=(0,t.useCallback)(()=>{o(r),c(r);try{window.localStorage.removeItem(l)}catch(e){}},[]);return(0,n.jsx)(d.Provider,{value:{appearance:a,set:m,reset:p,loaded:h},children:s})}function h(){return(0,t.useContext)(d)}},8596:(e,s,a)=>{"use strict";a.d(s,{E:()=>r});var n=a(3365),t=a(1521),l=a(5549),i=a(867);function r(e){var s,a,r,c,d,o,h;let{dir:u,onDone:m}=e,{t:p}=(0,i.kj)(),v=(0,i.W3)(),[x,j]=(0,t.useState)(null),[g,f]=(0,t.useState)(""),[y,b]=(0,t.useState)(""),[k,N]=(0,t.useState)(""),[w,S]=(0,t.useState)(!1),C=e=>(null!=e?e:"—").slice(0,8),F=async e=>{b(""),N(""),f(e?"fetch":"prepare");try{j(await l.FH.preparePreview(u,e))}catch(e){b(e.message)}finally{f("")}},I=async()=>{if(null==x?void 0:x.fingerprint){b(""),f("prepare");try{var e,s;let a=await l.FH.prepareProject(u,x.fingerprint,{savedBranch:x.savedBranch,savedMainBranch:x.savedMainBranch});a.ok?(N(null!=(s=a.result)?s:""),j(null),null==m||m()):b(null!=(e=a.problem)?e:"")}catch(e){b(e.message)}finally{f("")}}},T=async e=>{try{await navigator.clipboard.writeText(e),S(!0),window.setTimeout(()=>S(!1),2500)}catch(e){b(p("plan.copyFailed"))}},M=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:p("prep.more",{n:e.length-30})})]}),W=x&&!x.ok&&x.fetched&&!x.fetched.ok;return(0,n.jsxs)("div",{className:"prepare-folder small",style:{marginTop:8,overflowWrap:"anywhere"},children:[(0,n.jsx)("button",{type:"button",onClick:()=>void F(!0),disabled:!!g,children:p("prep.show")}),(0,n.jsx)("p",{className:"why",children:p("prep.why")}),(0,n.jsx)("p",{className:"why",children:p("prep.password")}),"fetch"===g&&(0,n.jsx)("p",{role:"status",children:p("prep.fetching")}),y&&(0,n.jsx)("p",{className:"err",role:"alert",children:y}),k&&(0,n.jsx)("p",{className:"notice",role:"status",children:k}),x&&!x.ok&&!W&&(0,n.jsx)("p",{className:"err",children:x.problem}),W&&(0,n.jsxs)("div",{className:"notice caution",style:{marginTop:8},children:[(0,n.jsxs)("p",{children:[(0,n.jsx)("strong",{children:p("prep.fetchFailed")})," ",(0,n.jsx)("code",{children:null==(s=x.fetched)?void 0:s.detail})]}),(null==(a=x.fetched)?void 0:a.auth)&&(0,n.jsx)("p",{children:p("prep.fetchAuth")}),(0,n.jsx)("div",{className:"row",children:(0,n.jsx)("button",{type:"button",onClick:()=>void F(!0),disabled:!!g,children:p("prep.retry")})}),x.fetchCommand&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{style:{marginTop:8},children:p("prep.ownTerminal")}),(0,n.jsx)("pre",{className:"sync-cmd",children:x.fetchCommand}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{type:"button",onClick:()=>{var e;T(null!=(e=x.fetchCommand)?e:"")},children:p("prep.copyFetch")}),w&&(0,n.jsx)("span",{className:"badge done",children:p("prep.copied")}),(0,n.jsx)("button",{type:"button",onClick:()=>void F(!1),disabled:!!g,children:p("prep.useFetched")})]}),x.lastFetched&&(0,n.jsx)("p",{className:"muted",children:p("prep.lastFetched",{when:v(x.lastFetched)})})]})]}),(null==x?void 0:x.ok)&&(0,n.jsxs)("div",{className:"notice caution",style:{marginTop:8},children:[(0,n.jsx)("p",{children:p("prep.where",{target:null!=(r=x.target)?r:"",commit:C(x.targetCommit),branch:null!=(c=x.branch)?c:"HEAD",head:C(x.head)})}),!x.fetched&&(0,n.jsxs)("p",{className:"muted",children:[p("prep.notFetched")," ",x.lastFetched?p("prep.lastFetched",{when:v(x.lastFetched)}):p("prep.lastFetchedUnknown")]}),x.alreadyThere?(0,n.jsx)("p",{children:p("prep.already")}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("strong",{children:p("prep.willDo")}),(0,n.jsxs)("ol",{style:{margin:"4px 0",paddingLeft:20},children:[x.savedBranch&&(0,n.jsxs)("li",{children:[p("prep.keepChanges",{changed:x.changed.length,untracked:x.untracked.length,saved:x.savedBranch}),M([...x.changed,...x.untracked])]}),x.savedMainBranch&&(0,n.jsxs)("li",{children:[p("prep.keepMain",{n:x.mainOnlyCommits.length,branch:null!=(d=x.localBranch)?d:"",saved:x.savedMainBranch}),M(x.mainOnlyCommits)]}),(0,n.jsx)("li",{children:p("prep.moveTo",{branch:null!=(o=x.localBranch)?o:"",commit:C(x.targetCommit),target:null!=(h=x.target)?h:""})})]}),x.branchOnlyCommits.length>0&&x.branch&&(0,n.jsx)("p",{children:p("prep.branchStays",{branch:x.branch,n:x.branchOnlyCommits.length})}),(0,n.jsx)("p",{className:"muted",children:p("prep.ignored")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{type:"button",className:"primary",onClick:()=>void I(),disabled:!!g,children:p("prep.confirm")}),(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>j(null),disabled:!!g,children:p("prep.cancel")})]})]})]})]})}},8848:(e,s,a)=>{"use strict";a.d(s,{H4:()=>d,L:()=>o,z4:()=>h});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(),h=s.trim().toLowerCase(),u=a?l.others.filter(e=>e.rootDir.trim().toLowerCase()!==h):[];return(0,n.jsx)(m,{label:o?t("proj.defaultIs",{dir:o}):t("proj.noneShort"),offer:o&&a&&h!==o.toLowerCase()?{text:t("proj.useIt"),onUse:()=>a(o)}:void 0,more:u.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=u(),{t:l}=(0,c.kj)();if(!t)return null;let i=t.defaultModel.trim();return(0,n.jsx)(m,{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 h(e){let{current:s,onUse:a}=e,t=u(),{t:l}=(0,c.kj)();if(!t)return null;let i=t.defaultReviewModel.trim();return(0,n.jsx)(m,{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 u(){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 m(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()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[66],{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))},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),h=a(3523),u=a(3374),m=a(8078),p=a(8848),v=a(4784),x=a(2876),j=a(5132),g=a(1035),f=a(8934),y=a(4811),b=a(3041),k=a(7527),N=a(1366),w=a(8596);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),[h,u]=(0,t.useState)([]),[m,p]=(0,t.useState)([]),[v,x]=(0,t.useState)(null),[j,g]=(0,t.useState)(""),[f,y]=(0,t.useState)(!1),b=(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)(()=>{b.current||(b.current=window.setTimeout(()=>{b.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=()=>y(!1),e.onmessage=e=>{let s;try{s=JSON.parse(e.data)}catch(e){return}"ping"!==s.type&&(u(e=>[...e.slice(-400),s]),S())},e.onerror=()=>{e.readyState===EventSource.CLOSED&&y(!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)(q,{tasks:i.tasks}),(0,n.jsx)(T,{session:i,onChange:w}),(0,n.jsx)(I,{level1:v,sent:i.contractSent}),(0,n.jsx)(B,{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)(D,{session:i,task:e,index:s+1,presets:m,onChange:w},e.id))]}),(0,n.jsx)(O,{session:i}),(0,n.jsx)(L,{session:i,presets:m,onAdded:w,onPresetsChanged:()=>c.FH.presets().then(p)}),(0,n.jsx)(A,{events:h})]})}function F(e){var s;let{session:a,queued:l,onChange:i}=e,{t:r}=(0,d.kj)(),[o,h]=(0,t.useState)(""),[u,m]=(0,t.useState)("");(0,t.useEffect)(()=>{c.FH.models().then(e=>{var s;return m(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,y.p)(),[b,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){h(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);h(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 h(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){h(e.message)}},F=async()=>{var e;if(x.trim()!==(null!=(e=a.conversationGroup)?e:""))try{await c.FH.updateSession(a.id,{conversationGroup:x.trim()}),h(r("session.groupSaved")),i()}catch(e){h(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:b||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:b||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),h(r("session.stopping"))}),disabled:b,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"),h(r("session.askingAgain"))}),disabled:b,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||(u?r("model.followsDefault",{name:u}):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 T(e){var s,a,l,i;let{session:r,onChange:o}=e,{t:h}=(0,d.kj)(),u=(0,d.W3)(),[m,v]=(0,t.useState)(null),[x,j]=(0,t.useState)(!1),[f,y]=(0,t.useState)("");(0,t.useEffect)(()=>{c.FH.models().then(v).catch(()=>void 0)},[]);let b=async e=>{try{await c.FH.updateSession(r.id,{model:e}),y(e?h("model.saved",{name:e}):h("model.savedDefault")),o()}catch(e){y(e.message)}},k=async()=>{try{let e=await c.FH.setDefaultModel(w);v(s=>s?{...s,defaultModel:e.defaultModel}:s),y(e.defaultModel?h("model.defaultSaved",{name:e.defaultModel}):h("model.defaultCleared"))}catch(e){y(e.message)}},N=async()=>{if(await (0,g.Z)(h("model.refreshConfirm"))){j(!0),y(h("model.refreshing"));try{var e;let s=await c.FH.refreshModels();v(s),y(0===s.options.length?null!=(e=s.note)?e:h("model.none"):h("model.refreshed",{n:s.options.length}))}catch(e){y(e.message)}finally{j(!1)}}},w=null!=(s=r.model)?s:"",S=null!=(a=null==m?void 0:m.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:h("model.title")}),r.modelInUse&&(0,n.jsx)("span",{className:"chip",children:h("model.lastUsed",{name:r.modelInUse})})]}),(0,n.jsx)("p",{className:"muted small",children:h("model.hint")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsxs)("select",{"aria-label":h("model.title"),value:w,disabled:r.running,onChange:e=>void b(e.target.value),style:{width:"auto",minWidth:260},children:[(0,n.jsx)("option",{value:"",children:(null==m?void 0:m.defaultModel)?h("model.followsDefault",{name:m.defaultModel}):h("model.default")}),w&&!C&&(0,n.jsx)("option",{value:w,children:h("model.notInList",{name:w})}),F.map(e=>(0,n.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(h("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(h("model.unavailable")):""]},e.name))},s)})]}),(0,n.jsx)("button",{onClick:()=>void N(),disabled:x||r.running,children:h("model.refresh")}),(0,n.jsx)("span",{className:"muted small",role:"status",children:f})]}),(0,n.jsx)(p.L,{current:w,onUse:e=>void b(e)}),(0,n.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,n.jsx)("span",{className:"muted small",children:(null==m?void 0:m.defaultModel)?h("model.defaultIs",{name:m.defaultModel}):h("model.defaultIsNone")}),(0,n.jsx)("button",{onClick:()=>void k(),disabled:w===(null!=(i=null==m?void 0:m.defaultModel)?i:""),children:w?h("model.makeDefault",{name:w}):h("model.clearDefault")})]}),(null==m?void 0:m.readAt)?(0,n.jsxs)("p",{className:"muted small",style:{marginTop:8},children:[h("model.readAt",{t:u(m.readAt),n:m.options.length}),m.current?" ".concat(h("model.chatWasOn",{name:m.current})):"",m.note?" ".concat(m.note):""]}):(0,n.jsx)("p",{className:"muted small",style:{marginTop:8},children:h("model.neverRead")}),S.length>0&&(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:h("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:""},[h,u]=(0,t.useState)(o.enabled),[m,x]=(0,t.useState)(null!=(a=o.model)?a:""),[j,g]=(0,t.useState)(""),[f,y]=(0,t.useState)(!1),[b,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()=>{y(!0),g("");try{await c.FH.updateSession(l.id,{review:{enabled:h,model:m}}),g(r("review.saved")),i()}catch(e){g(e.message)}finally{y(!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(h?"done":""),children:h?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:h,onChange:e=>u(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:m,onChange:x,none:b?r("model.followsDefault",{name:b}):r("review.modelSame"),disabled:l.running||!h})}),(0,n.jsx)("p",{className:"why",children:r("review.modelWhy")}),(0,n.jsx)(p.z4,{current:m,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 W(e){var s;let{session:a,plan:l,onDone:i}=e,{t:r}=(0,d.kj)(),o=()=>Object.fromEntries(l.entries.filter(e=>e.choice).map(e=>[e.path,e.choice])),h=JSON.stringify(l.entries.map(e=>[e.path,e.choice])),[u,m]=(0,t.useState)(o);(0,t.useEffect)(()=>m(o()),[h]);let[p,v]=(0,t.useState)(!1),[x,j]=(0,t.useState)(""),g=l.entries.filter(e=>"include"===u[e.path]).length,f=async()=>{v(!0),j("");try{var e,s,n;let t=await c.FH.vcsSnapshot(a.id,u);j(t.ok?r("vcs.snapshotTaken",{branch:null!=(e=t.branch)?e:"",commit:(null!=(s=t.commit)?s:"").slice(0,8)}):null!=(n=t.problem)?n:""),i()}catch(e){j(e.message)}finally{v(!1)}};return(0,n.jsxs)("div",{className:"option",children:[(0,n.jsx)("p",{className:"small",children:r("vcs.snapshotList",{n:l.entries.length,branch:null!=(s=l.baselineBranch)?s:"—"})}),(0,n.jsx)("ul",{style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:l.entries.map(e=>{var s;return(0,n.jsxs)("li",{style:{marginBottom:4,overflowWrap:"anywhere"},children:[(0,n.jsx)("code",{children:e.path})," ",(0,n.jsxs)("span",{className:"muted small",children:["(",e.input?"".concat(r("vcs.snapshotInput"),", "):"",r("vcs.snapshotKind.".concat(e.kind)),void 0!==e.size?", ".concat((0,c.zi)(e.size)):"",")"]})," ",0===e.allowed.length?(0,n.jsx)("span",{className:"err small",children:r("vcs.snapshotBlocked")}):(0,n.jsx)("select",{"aria-label":e.path,value:null!=(s=u[e.path])?s:"",onChange:s=>m({...u,[e.path]:s.target.value}),disabled:p||a.running||e.allowed.length<2,children:e.allowed.map(e=>(0,n.jsx)("option",{value:e,children:r("include"===e?"vcs.snapshotInclude":"vcs.snapshotLeaveOut")},e))}),e.reason&&(0,n.jsx)("div",{className:"muted small",children:e.reason})]},e.path)})}),(0,n.jsx)("button",{className:"primary",onClick:()=>void f(),disabled:p||a.running||!l.ok||0===g,children:r("vcs.snapshotTake")}),(0,n.jsx)("p",{className:"why",children:r("vcs.snapshotCancelWhy")}),x&&(0,n.jsx)("p",{className:"small",role:"status",children:x})]})}function B(e){var s,a,l,i,r,o,h,u,m,v,x,j,g,f,y,b,k,N,S,C,F,I,T,M,B,H,R,O,P,L,D,A,E,q,U,J;let{session:z,onChange:G}=e,{t:Z}=(0,d.kj)(),K=null!=(g=z.vcs)?g:{enabled:!0,repoDir:"",branchMode:"per-task",commitOnFinish:!0,branchPrefix:"cop/"},[_,Y]=(0,t.useState)(K.repoDir),[Q,V]=(0,t.useState)(null),[X,$]=(0,t.useState)(""),[ee,es]=(0,t.useState)(!1),ea=JSON.stringify(K),[en,et]=(0,t.useState)(null),[el,ei]=(0,t.useState)(null!=(f=K.branchName)?f:"");(0,t.useEffect)(()=>{var e;return ei(null!=(e=JSON.parse(ea).branchName)?e:"")},[ea]);let[er,ec]=(0,t.useState)(null!=(y=K.baseBranch)?y:"");(0,t.useEffect)(()=>{var e;return ec(null!=(e=JSON.parse(ea).baseBranch)?e:"")},[ea]);let[ed,eo]=(0,t.useState)((null!=(b=null==(s=K.userInputs)?void 0:s.paths)?b:[]).join("\n"));(0,t.useEffect)(()=>{var e,s;return eo((null!=(s=null==(e=JSON.parse(ea).userInputs)?void 0:e.paths)?s:[]).join("\n"))},[ea]);let[eh,eu]=(0,t.useState)((null!=(k=null==(a=K.artifacts)?void 0:a.paths)?k:[]).join("\n"));(0,t.useEffect)(()=>{var e,s;return eu((null!=(s=null==(e=JSON.parse(ea).artifacts)?void 0:e.paths)?s:[]).join("\n"))},[ea]);let em=e=>e.split(/\r?\n/).map(e=>e.trim()).filter(Boolean),[ep,ev]=(0,t.useState)(null!=(N=K.existingBranch)?N:"");(0,t.useEffect)(()=>{var e;return ev(null!=(e=JSON.parse(ea).existingBranch)?e:"")},[ea]);let ex=null!=(S=K.startFrom)?S:"head";(0,t.useEffect)(()=>{Y(JSON.parse(ea).repoDir)},[ea]);let ej=JSON.parse(ea).repoDir||z.projectDir||"";(0,t.useEffect)(()=>{let e=!1;return ej.trim()?(c.FH.repoCheck(ej).then(s=>{var a;e||et(s.ok?null:null!=(a=s.problem)?a:null)}).catch(()=>{e||et(null)}),()=>{e=!0}):void et(null)},[ej]);let eg=(0,t.useCallback)(()=>{c.FH.vcsStatus(z.id).then(V).catch(()=>V(null))},[z.id]);(0,t.useEffect)(eg,[eg,ea]);let ef=async e=>{try{await c.FH.updateSession(z.id,{vcs:e}),$(Z("vcs.saved")),G(),eg()}catch(e){$(e.message)}},ey=async()=>{es(!0),$(Z("mirror.browsing"));try{let s=await c.FH.browseFolder(_.trim()||z.projectDir||void 0);if(s.ok)Y(s.path),await ef({repoDir:s.path});else{var e;$(s.cancelled?Z("mirror.browseCancelled"):null!=(e=s.reason)?e:"")}}catch(e){$(e.message)}finally{es(!1)}},eb=K.repoDir||z.projectDir||"",ek=""!==eb.trim()&&null===en;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:Z("vcs.title")}),(0,n.jsx)("span",{className:"badge ".concat(K.enabled?"done":""),children:K.enabled?Z("vcs.on"):Z("vcs.off")})]}),(0,n.jsx)("p",{className:"muted small",children:Z("vcs.hint")}),(0,n.jsx)("label",{htmlFor:"vcs-root",children:Z("vcs.repoField")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("input",{id:"vcs-root",type:"text",className:"grow",value:_,onChange:e=>Y(e.target.value),onBlur:()=>_.trim()!==K.repoDir&&void ef({repoDir:_.trim()}),placeholder:z.projectDir||"C:\\Projects\\my-app",disabled:z.running}),(0,n.jsx)("button",{onClick:()=>void ey(),disabled:ee||z.running,children:Z("mirror.browse")})]}),(0,n.jsx)(p.H4,{current:_,onUse:e=>{Y(e),ef({repoDir:e})}}),en&&(0,n.jsxs)("div",{className:"notice caution",style:{marginTop:8},children:[(0,n.jsx)("strong",{children:Z("vcs.noRepo")}),(0,n.jsx)("div",{className:"small",style:{marginTop:4},children:en}),(0,n.jsx)("div",{className:"muted small",style:{marginTop:6},children:Z("vcs.noRepoHow")})]}),!en&&""!==eb.trim()&&(0,n.jsx)("p",{className:"muted small",style:{marginTop:4},children:Z("vcs.repoOk")}),""===eb.trim()&&(0,n.jsx)("p",{className:"muted small",style:{marginTop:4},children:Z("vcs.pickFirst")}),(0,n.jsxs)("div",{className:"option".concat(ek||K.enabled?"":" warned"),children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:K.enabled,onChange:e=>void ef({enabled:e.target.checked}),disabled:z.running||!ek&&!K.enabled}),(0,n.jsx)("span",{children:Z("vcs.enable")})]}),(0,n.jsx)("p",{className:"why",children:Z("vcs.enableWhy")})]}),K.enabled&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"muted small",style:{marginTop:4},children:eb?Z("vcs.repoIs",{dir:eb}):Z("vcs.repoNone")}),eb&&!en&&(0,n.jsx)(w.E,{dir:eb}),(0,n.jsx)("h3",{children:Z("vcs.branches")}),"existing-branch"===ex&&(0,n.jsx)("p",{className:"muted small",children:Z("vcs.branchesExisting",{branch:K.existingBranch||"…"})}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"radio",name:"branchMode",checked:"per-task"===K.branchMode,onChange:()=>void ef({branchMode:"per-task"}),disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.perTask")})]}),(0,n.jsx)("p",{className:"why",children:Z("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"===K.branchMode,onChange:()=>void ef({branchMode:"per-session"}),disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.perSession")})]}),(0,n.jsx)("p",{className:"why",children:Z("vcs.perSessionWhy")})]}),"per-session"===K.branchMode&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("label",{htmlFor:"vcs-branch-name",children:Z("vcs.branchName")}),(0,n.jsx)("input",{id:"vcs-branch-name",type:"text",value:el,onChange:e=>ei(e.target.value),onBlur:()=>{var e;return el.trim()!==(null!=(e=K.branchName)?e:"")&&void ef({branchName:el.trim()})},placeholder:z.name,disabled:z.running}),(0,n.jsx)("p",{className:"why",children:Z("vcs.branchNameWhy")})]}),(0,n.jsx)("h3",{children:Z("vcs.startFrom")}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"radio",name:"startFrom",checked:"branch"===ex,onChange:()=>void ef({startFrom:"branch"}),disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.startBranch")})]}),(0,n.jsx)("p",{className:"why",children:Z("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"===ex,onChange:()=>void ef({startFrom:"previous-session"}),disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.startPrevious")})]}),(0,n.jsx)("p",{className:"why",children:Z("vcs.startPreviousWhy")})]}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"radio",name:"startFrom",checked:"head"===ex,onChange:()=>void ef({startFrom:"head"}),disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.startHead")})]}),(0,n.jsx)("p",{className:"why",children:Z("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"===ex,onChange:()=>void ef({startFrom:"existing-branch"}),disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.startExisting")})]}),(0,n.jsx)("p",{className:"why",children:Z("vcs.startExistingWhy")})]}),"existing-branch"===ex&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("label",{htmlFor:"vcs-existing-branch",children:Z("vcs.existingBranch")}),(0,n.jsx)("input",{id:"vcs-existing-branch",type:"text",list:"vcs-local-branches",value:ep,onChange:e=>ev(e.target.value),onBlur:()=>{var e;return ep.trim()!==(null!=(e=K.existingBranch)?e:"")&&void ef({existingBranch:ep.trim()})},disabled:z.running}),(0,n.jsx)("datalist",{id:"vcs-local-branches",children:(null!=(C=null==Q?void 0:Q.branches)?C:[]).map(e=>(0,n.jsx)("option",{value:e},e))}),(0,n.jsx)("p",{className:"why",children:Z("vcs.existingBranchWhy")}),K.existingBranch&&(null==Q?void 0:Q.branches)&&!Q.branches.includes(K.existingBranch)&&(0,n.jsx)("p",{className:"err small",children:Z("vcs.existingBranchMissing",{branch:K.existingBranch})})]}),("branch"===ex||"previous-session"===ex)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("label",{htmlFor:"vcs-base-branch",children:Z("vcs.baseBranch")}),(0,n.jsx)("input",{id:"vcs-base-branch",type:"text",value:er,onChange:e=>ec(e.target.value),onBlur:()=>{var e;return er.trim()!==(null!=(e=K.baseBranch)?e:"")&&void ef({baseBranch:er.trim()})},placeholder:"main",disabled:z.running}),(0,n.jsx)("p",{className:"why",children:Z("vcs.baseBranchWhy")})]}),z.vcsStart&&(0,n.jsxs)("p",{className:"muted small",children:["existing-branch"===z.vcsStart.kind?Z("vcs.startedExisting",{branch:null!=(F=z.vcsStart.branch)?F:"",commit:z.vcsStart.commit.slice(0,8)}):"previous-session"===z.vcsStart.kind?Z("vcs.startedPrevious",{name:null!=(I=null==(l=z.vcsStart.fromSession)?void 0:l.name)?I:"",branch:null!=(T=z.vcsStart.branch)?T:"",commit:z.vcsStart.commit.slice(0,8)}):"branch"===z.vcsStart.kind?Z("vcs.startedBranch",{branch:null!=(M=z.vcsStart.branch)?M:"",commit:z.vcsStart.commit.slice(0,8)}):"snapshot"===z.vcsStart.kind?Z("vcs.startedSnapshot",{branch:null!=(B=z.vcsStart.branch)?B:"",commit:z.vcsStart.commit.slice(0,8),from:null!=(H=null==(i=z.vcsStart.snapshot)?void 0:i.fromBranch)?H:"HEAD",n:null!=(R=null==(r=z.vcsStart.snapshot)?void 0:r.included.length)?R:0,out:null!=(O=null==(o=z.vcsStart.snapshot)?void 0:o.leftOut.length)?O:0}):Z("vcs.startedHead",{commit:z.vcsStart.commit.slice(0,8)}),z.vcsStart.note?" — ".concat(z.vcsStart.note):"",z.vcsStart.update&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("br",{}),"updated"===z.vcsStart.update.outcome?Z("vcs.updated",{branch:z.vcsStart.update.branch,remote:null!=(P=z.vcsStart.update.remote)?P:"",from:(null!=(L=z.vcsStart.update.from)?L:"").slice(0,8),to:(null!=(D=z.vcsStart.update.to)?D:"").slice(0,8)}):"up-to-date"===z.vcsStart.update.outcome?Z("vcs.upToDate",{branch:z.vcsStart.update.branch,remote:null!=(A=z.vcsStart.update.remote)?A:""}):Z("vcs.notUpdated",{branch:z.vcsStart.update.branch,why:null!=(E=z.vcsStart.update.detail)?E:z.vcsStart.update.outcome})]})]}),"head"!==ex&&(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:!1!==K.updateFromRemote,onChange:e=>void ef({updateFromRemote:e.target.checked}),disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.updateFromRemote")})]}),(0,n.jsx)("p",{className:"why",children:Z("vcs.updateFromRemoteWhy")})]}),(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:K.commitOnFinish,onChange:e=>void ef({commitOnFinish:e.target.checked}),disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.commit")})]}),(0,n.jsx)("p",{className:"why",children:Z("vcs.commitWhy")})]}),"existing-branch"!==ex&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("h3",{children:Z("vcs.dirty")}),["reject","snapshot","tracked-only-snapshot"].map(e=>{var s,a;return(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"radio",name:"vcs-dirty-".concat(z.id),checked:(null!=(a=null==(s=K.dirtyWorktree)?void 0:s.policy)?a:"reject")===e,onChange:()=>{var s;ef({dirtyWorktree:{policy:e,requireApproval:null==(s=K.dirtyWorktree)?void 0:s.requireApproval}})},disabled:z.running}),(0,n.jsx)("span",{children:Z("reject"===e?"vcs.dirtyReject":"snapshot"===e?"vcs.dirtySnapshot":"vcs.dirtyTracked")})]}),(0,n.jsx)("p",{className:"why",children:Z("reject"===e?"vcs.dirtyRejectWhy":"snapshot"===e?"vcs.dirtySnapshotWhy":"vcs.dirtyTrackedWhy")})]},e)}),(null!=(q=null==(h=K.dirtyWorktree)?void 0:h.policy)?q:"reject")!=="reject"&&(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:(null==(u=K.dirtyWorktree)?void 0:u.requireApproval)!==!1,onChange:e=>{var s,a;ef({dirtyWorktree:{policy:null!=(a=null==(s=K.dirtyWorktree)?void 0:s.policy)?a:"snapshot",requireApproval:e.target.checked}})},disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.dirtyApproval")})]}),(0,n.jsx)("p",{className:"why",children:Z("vcs.dirtyApprovalWhy")})]})]}),(0,n.jsx)("h3",{children:Z("vcs.inputs")}),(0,n.jsx)("label",{htmlFor:"vcs-inputs-".concat(z.id),children:Z("vcs.inputsField")}),(0,n.jsx)("textarea",{id:"vcs-inputs-".concat(z.id),rows:3,value:ed,onChange:e=>eo(e.target.value),onBlur:()=>{var e,s;return JSON.stringify(em(ed))!==JSON.stringify(null!=(s=null==(e=K.userInputs)?void 0:e.paths)?s:[])&&void ef({userInputs:{...K.userInputs,paths:em(ed)}})},disabled:z.running,placeholder:"rules-engine/test-data/schemas/*.yaml",spellCheck:!1}),(0,n.jsx)("p",{className:"why",children:Z("vcs.inputsWhy")}),(null!=(U=null==(m=K.userInputs)?void 0:m.paths.length)?U:0)>0&&(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:(null==(v=K.userInputs)?void 0:v.readOnly)!==!1,onChange:e=>{var s,a,n;ef({userInputs:{paths:null!=(n=null==(s=K.userInputs)?void 0:s.paths)?n:[],requireApproval:null==(a=K.userInputs)?void 0:a.requireApproval,readOnly:e.target.checked}})},disabled:z.running}),(0,n.jsx)("span",{children:Z("vcs.inputsReadOnly")})]}),(0,n.jsx)("p",{className:"why",children:Z("vcs.inputsReadOnlyWhy")})]}),(null==(x=z.vcsStart)?void 0:x.inputs)&&(0,n.jsx)("p",{className:"muted small",children:z.vcsStart.inputs.carried?Z("vcs.inputsCarried",{n:z.vcsStart.inputs.files.length,branch:z.vcsStart.inputs.carried.branch,onto:z.vcsStart.inputs.carried.onto.slice(0,8)}):Z("vcs.inputsRecorded",{n:z.vcsStart.inputs.files.length,commit:z.vcsStart.commit.slice(0,8)})}),(0,n.jsx)("h3",{children:Z("vcs.artifacts")}),(0,n.jsx)("label",{htmlFor:"vcs-artifacts-".concat(z.id),children:Z("vcs.artifactsField")}),(0,n.jsx)("textarea",{id:"vcs-artifacts-".concat(z.id),rows:2,value:eh,onChange:e=>eu(e.target.value),onBlur:()=>{var e,s;return JSON.stringify(em(eh))!==JSON.stringify(null!=(s=null==(e=K.artifacts)?void 0:e.paths)?s:[])&&void ef({artifacts:{paths:em(eh)}})},disabled:z.running,placeholder:"rules-engine/test-results/**",spellCheck:!1}),(0,n.jsx)("p",{className:"why",children:Z("vcs.artifactsWhy")}),Q&&!Q.ok&&(0,n.jsxs)("div",{className:"notice caution",role:"status",children:[(0,n.jsx)("strong",{children:Z("vcs.notReady")})," ",Q.problem]}),(null==Q||null==(j=Q.snapshot)?void 0:j.needed)&&Q.snapshot.entries.length>0&&(0,n.jsx)(W,{session:z,plan:Q.snapshot,onDone:()=>{G(),eg()}}),(null==Q?void 0:Q.ok)&&(0,n.jsx)("div",{className:"muted small",children:Z("vcs.ready",{branch:null!=(J=Q.branch)?J:"—",dir:Q.repoDir})}),(null==Q?void 0:Q.ok)&&Q.work&&Q.work.branches.length>0&&(0,n.jsxs)("div",{className:"muted small",children:["per-session"===Q.work.mode&&Q.work.complete?Z("vcs.completeOn",{branch:Q.work.complete}):Z("vcs.noSingleBranch",{n:Q.work.branches.length}),"per-task"===Q.work.mode&&(0,n.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:Q.work.branches.map(e=>(0,n.jsxs)("li",{children:[(0,n.jsx)("code",{children:e.branch})," — ",e.title,e.commit?"":" (".concat(Z("vcs.taskNoFiles"),")")]},e.branch))})]}),(0,n.jsx)("p",{className:"muted small",children:Z("vcs.pushIsYours")})]}),(0,n.jsx)("div",{className:"muted small",role:"status",children:X})]})}function H(e){var s;let{session:a,onChange:l}=e,{t:i}=(0,d.kj)(),[r,o]=(0,t.useState)(""),h=null!=(s=a.onFailure)?s:"stop",u=async e=>{if(e!==h)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"===h,onChange:()=>void u("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"===h,onChange:()=>void u("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 R(e){let{value:s,onChange:a,presets:l,onPresetsChanged:i}=e,{t:r}=(0,d.kj)(),o=(0,t.useId)(),[h,u]=(0,t.useState)(""),m=async()=>{let e=prompt(r("l2.saveAsPrompt"));if(e)try{await c.FH.savePreset(e,s),u(r("l2.savedAs",{name:e})),null==i||i()}catch(e){u(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 m(),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}}),h&&(0,n.jsx)("div",{className:"muted small",children:h})]})}function O(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)([]),h=r.length>0?r:i.map(e=>e.id),u=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:u("outcome"),download:!0,children:a("export.outcome",{n:h.length})}),(0,n.jsx)("a",{className:"button-link",href:u("full"),download:!0,children:a("export.full",{n:h.length})})]}),(0,n.jsx)("p",{className:"muted small",style:{marginTop:8},children:a("export.outcomeWhy")})]})]})}function P(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 L(e){var s;let{session:a,presets:l,onAdded:i,onPresetsChanged:r}=e,{t:o}=(0,d.kj)(),h=[...a.tasks].reverse()[0],[u,m]=(0,t.useState)(""),[p,v]=(0,t.useState)(null!=(s=null==h?void 0:h.level2)?s:""),[x,j]=(0,t.useState)(""),[g,f]=(0,t.useState)(""),[y,b]=(0,t.useState)(!1),k=(0,t.useRef)(!1),N=async()=>{if(!k.current){k.current=!0,b(!0);try{await c.FH.addTask(a.id,{title:u,level2:p,prompt:x}),m(""),j(""),f(o("form.queued")),i()}catch(e){f(e.message)}finally{k.current=!1,b(!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:u,onChange:e=>m(e.target.value),placeholder:o("form.titlePlaceholder")}),(0,n.jsx)("div",{style:{marginTop:10},children:(0,n.jsx)(R,{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:y||!x.trim(),children:o("form.add")}),(0,n.jsx)("span",{className:"muted small",children:g})]})]})}function D(e){var s,a,l,i,r,m,p,v,y,k,w,S,C,F,I,T,M,W,B,H,O,L,D,A,q,G,Z,K,_,Y,Q,V,X,$,ee,es,ea,en,et,el,ei,er,ec,ed,eo,eh,eu,em,ep,ev,ex,ej,eg,ef,ey,eb,ek,eN,ew,eS,eC,eF,eI,eT,eM,eW,eB,eH,eR,eO,eP,eL,eD,eA,eE,eq,eU,eJ,ez,eG,eZ,eK,e_,eY;let{session:eQ,task:eV,index:eX,presets:e$,onChange:e0}=e,{t:e1}=(0,d.kj)(),e2=(0,d.W3)(),[e8,e4]=(0,t.useState)(!1),[e6,e3]=(0,t.useState)(!1),[e5,e7]=(0,t.useState)(eV.title),[e9,se]=(0,t.useState)(eV.level2),[ss,sa]=(0,t.useState)(eV.prompt),[sn,st]=(0,t.useState)(null!=(es=null==(s=eV.vcsPlan)?void 0:s.branch)?es:""),[sl,si]=(0,t.useState)(null!=(ea=null==(a=eV.vcsPlan)?void 0:a.commitMessage)?ea:""),[sr,sc]=(0,t.useState)(null!=(en=eV.checks)?en:[]),[sd,so]=(0,t.useState)(!!eV.readOnly),[sh,su]=(0,t.useState)((null!=(et=eV.scope)?et:[]).join("\n")),sm={readOnly:sd,scope:sd?[]:(0,N.w)(sh)},sp=(0,u.c)((0,h.DG)(eV)),[sv,sx]=(0,t.useState)(null),[sj,sg]=(0,t.useState)(""),sf=async()=>{try{await c.FH.updateTask(eQ.id,eV.id,{title:e5,level2:e9,prompt:ss,vcsPlan:{branch:sn,commitMessage:sl},checks:sr,...sm}),e4(!1),e0()}catch(e){sg(e.message)}},sy="running"===eV.status||"waiting-approval"===eV.status,sb=!sy&&"queued"!==eV.status,sk=!sy&&"queued"!==eV.status,sN=!sy&&null!=(el=null==(l=eQ.vcs)?void 0:l.enabled)&&el&&(!!(null==(i=eV.vcs)?void 0:i.baseCommit)||(null!=(ei=eV.attempts)?ei:[]).some(e=>{var s;return null==(s=e.vcs)?void 0:s.baseCommit})),sw=!sy&&(0,c.Zm)(eV),sS=async()=>{if(await (0,g.Z)(e1("task.continueConfirm",{title:eV.title})))try{await c.FH.continueTask(eQ.id,eV.id),e0()}catch(e){sg(e.message)}},sC=async()=>{if(await (0,g.Z)(e1("task.rerunConfirm",{title:eV.title})))try{await c.FH.rerunTask(eQ.id,eV.id),e0()}catch(e){sg(e.message)}},sF=async()=>{if(await (0,g.Z)(e1("task.editRanConfirm",{title:eV.title})))try{await c.FH.rerunTask(eQ.id,eV.id,{title:e5,level2:e9,prompt:ss,vcsPlan:{branch:sn,commitMessage:sl},checks:sr,...sm},{buildOnFinished:"done"===eV.status}),e4(!1),e0()}catch(e){sg(e.message)}},sI=(0,b.e)(e0),sT=async()=>{let e="queued"===eV.status?"task.deleteConfirm":"task.deleteConfirmRan";if(await (0,g.Z)(e1(e,{title:eV.title})))try{await c.FH.deleteTask(eQ.id,eV.id),e0()}catch(e){sg(e.message)}},sM=async()=>{try{sx(await c.FH.taskFiles(eQ.id,eV.id))}catch(e){sg(e.message)}},sW=(e,s,a)=>a.length>0&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("span",{className:"muted",children:[e1(e)," "]}),a.map(e=>(0,n.jsx)("span",{style:{marginRight:10},children:(0,n.jsx)(o.u,{label:e,save:()=>c.FH.saveTaskFile(eQ.id,eV.id,s,e)})},e))]});return(0,n.jsxs)("div",{className:"task ".concat(eV.status),id:eV.id,children:[(0,n.jsxs)("div",{className:"row",children:[(0,n.jsxs)("h4",{className:"grow",children:[eX,". ",eV.title]}),(0,n.jsx)("span",{className:"badge ".concat(eV.status),children:e1("status.".concat(eV.status))}),eV.limit&&(0,n.jsx)("span",{className:"chip",title:e1("reg.limitChipWhy"),children:e1("reg.limitChip",{limit:e1("limit.".concat(eV.limit.setting),{n:eV.limit.value})})}),(null!=(er=eV.attempt)?er:1)>1&&(0,n.jsx)("span",{className:"chip",children:e1("task.attemptN",{n:null!=(ec=eV.attempt)?ec:1})}),eV.iterations>0&&(0,n.jsx)("span",{className:"muted small",children:e1("task.iterations",{n:eV.iterations})}),eV.runId&&(0,n.jsxs)("button",{className:e6?"":"quiet","aria-expanded":e6,onClick:()=>e3(e=>!e),title:(0,h.DG)(eV)?e1("story.showLiveWhy"):e1("story.why"),children:[(0,h.DG)(eV)&&!e6&&(0,n.jsx)("span",{className:"dot","aria-hidden":"true"}),e6?e1("story.hide"):(0,h.DG)(eV)?e1("story.showLive"):e1("story.show")]}),!sy&&(0,n.jsx)("button",{onClick:()=>{if(!e8){var e,s,a,n,t,l;e7(eV.title),se(eV.level2),sa(eV.prompt),st(null!=(a=null==(e=eV.vcsPlan)?void 0:e.branch)?a:""),si(null!=(n=null==(s=eV.vcsPlan)?void 0:s.commitMessage)?n:""),sc(null!=(t=eV.checks)?t:[]),so(!!eV.readOnly),su((null!=(l=eV.scope)?l:[]).join("\n"))}e4(!e8)},title:e1("task.editAll"),children:e8?e1("task.cancel"):e1("task.edit")}),sw&&(0,n.jsx)("button",{className:"primary",onClick:()=>void sS(),title:e1("task.continueWhy"),children:e1("task.continue")}),sk&&(0,n.jsx)("button",{className:sw?"":"primary",onClick:()=>void sC(),title:e1("task.rerunWhy"),children:e1("task.rerun")}),sN&&(0,n.jsx)("button",{onClick:()=>void sI.restore({sessionId:eQ.id,taskId:eV.id,title:eV.title}),disabled:""!==sI.busy||eQ.running,title:e1("restore.why"),children:"restore"===sI.busy?e1("restore.checking"):e1("restore.button")}),sb&&(0,n.jsx)("button",{onClick:()=>void sI.restartFrom({sessionId:eQ.id,taskId:eV.id,title:eV.title}),disabled:""!==sI.busy||eQ.running,title:e1("restart.why"),children:"restart"===sI.busy?e1("restart.checking"):e1("restart.button")}),!sy&&(0,n.jsx)("button",{className:"danger",onClick:()=>void sT(),children:e1("task.delete")}),!e8&&(sj||sI.message)&&(0,n.jsx)("span",{className:"err",role:"alert",children:sj||sI.message})]}),(0,n.jsxs)("div",{className:"muted small",children:[eV.startedAt?e1("task.started",{t:e2(eV.startedAt)}):e1("task.added",{t:e2(eV.createdAt)}),eV.finishedAt?" \xb7 ".concat(e1("task.finished",{t:e2(eV.finishedAt)})):"",eV.startedAt&&eV.finishedAt?" \xb7 ".concat(e1("task.took",{d:(0,c.c5)((0,h.d5)(eV.startedAt,eV.finishedAt))})):"",(0,h.DG)(eV)?" \xb7 ".concat(e1("task.runningFor",{d:(0,c.c5)((0,h.d5)(eV.startedAt,void 0,sp))})):""]}),"queued"!==eV.status&&(null==(r=eQ.vcs)?void 0:r.enabled)&&eV.vcs&&(0,n.jsx)("div",{className:"muted small",children:eV.vcs.problem&&!eV.vcs.branch?(0,n.jsx)("span",{className:"reason",children:e1("vcs.taskProblem",{problem:eV.vcs.problem})}):(0,n.jsxs)(n.Fragment,{children:[eV.vcs.branch&&e1("vcs.taskBranch",{branch:eV.vcs.branch}),eV.vcs.baseCommit&&" \xb7 ".concat(e1("vcs.taskBase",{commit:eV.vcs.baseCommit.slice(0,8)})),eV.vcs.commit?" \xb7 ".concat(e1("vcs.taskCommit",{commit:eV.vcs.commit.slice(0,8)})):" \xb7 ".concat(e1("vcs.taskNoFiles")),(null!=(ed=null==(m=eV.vcs.files)?void 0:m.length)?ed:0)>0&&(0,n.jsxs)("details",{style:{display:"inline"},children:[(0,n.jsxs)("summary",{style:{display:"inline",cursor:"pointer"},children:[" \xb7 ",e1("vcs.taskFiles",{n:null!=(eo=null==(p=eV.vcs.files)?void 0:p.length)?eo:0})]}),(0,n.jsx)("ul",{style:{margin:"4px 0 4px 0",paddingLeft:20},children:(null!=(eh=eV.vcs.files)?eh:[]).map(e=>(0,n.jsxs)("li",{children:[(0,n.jsx)("code",{children:e.path})," ",e.added<0||e.removed<0?e1("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))})]}),eV.vcs.commit&&eV.vcs.baseCommit&&(0,n.jsxs)(n.Fragment,{children:[" \xb7 ",(0,n.jsx)(f.C,{sessionId:eQ.id,taskId:eV.id,title:eV.title,files:null!=(eu=null==(v=eV.vcs.files)?void 0:v.length)?eu:0})]}),(null!=(em=null==(y=eV.vcs.suspicious)?void 0:y.length)?em:0)>0&&(0,n.jsxs)("div",{className:"err small",style:{marginTop:4},children:[e1("vcs.suspicious",{n:null!=(ep=null==(k=eV.vcs.suspicious)?void 0:k.length)?ep:0}),(0,n.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(ev=eV.vcs.suspicious)?ev:[]).map(e=>(0,n.jsxs)("li",{children:[(0,n.jsx)("code",{children:e.path})," — ",e.reason]},e.path))})]}),(null!=(ex=null==(w=eV.scopeReverted)?void 0:w.length)?ex:0)>0&&(0,n.jsx)("div",{className:"small",style:{marginTop:4},children:e1(eV.readOnly?"task.readOnlyReverted":"task.scopeReverted",{n:null!=(ej=null==(S=eV.scopeReverted)?void 0:S.length)?ej:0,paths:(null!=(eg=eV.scopeReverted)?eg:[]).join(", ")})}),(null!=(ef=null==(C=eV.inputsRestored)?void 0:C.length)?ef:0)>0&&(0,n.jsx)("div",{className:"small",style:{marginTop:4},children:e1("task.inputsRestored",{n:null!=(ey=null==(F=eV.inputsRestored)?void 0:F.length)?ey:0,paths:(null!=(eb=eV.inputsRestored)?eb:[]).join(", ")})}),(null!=(ek=null==(I=eV.artifactsKept)?void 0:I.length)?ek:0)>0&&(0,n.jsx)("div",{className:"muted small",style:{marginTop:4,overflowWrap:"anywhere"},children:e1("task.artifactsKept",{n:null!=(eN=null==(T=eV.artifactsKept)?void 0:T.length)?eN:0,paths:(null!=(ew=eV.artifactsKept)?ew:[]).slice(0,10).map(e=>e.path).join(", ")})}),(null!=(eS=null==(M=eV.vcs.foreignCommits)?void 0:M.length)?eS:0)>0&&(0,n.jsxs)("div",{className:"err small",style:{marginTop:4},children:[e1("vcs.foreignCommits",{n:null!=(eC=null==(W=eV.vcs.foreignCommits)?void 0:W.length)?eC:0}),(0,n.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(eF=eV.vcs.foreignCommits)?eF:[]).map(e=>(0,n.jsx)("li",{children:(0,n.jsx)("code",{children:e})},e))})]})]})}),"queued"===eV.status&&(null==(B=eQ.vcs)?void 0:B.enabled)&&((null==(H=eV.vcsPlan)?void 0:H.branch)||(null==(O=eV.vcsPlan)?void 0:O.commitMessage))&&(0,n.jsx)("div",{className:"muted small",children:eV.vcsPlan.branch&&eV.vcsPlan.commitMessage?e1("task.gitNames",{branch:eV.vcsPlan.branch,subject:eV.vcsPlan.commitMessage.split("\n")[0]}):eV.vcsPlan.branch?e1("task.gitBranchOnly",{branch:eV.vcsPlan.branch}):e1("task.gitCommitOnly",{subject:(null!=(eI=eV.vcsPlan.commitMessage)?eI:"").split("\n")[0]})}),e6&&eV.runId&&(0,n.jsx)(x.P,{sessionId:eQ.id,taskId:eV.id,live:"running"===eV.status||"waiting-approval"===eV.status}),e8?(0,n.jsxs)("div",{style:{marginTop:8},children:[(0,n.jsx)("label",{children:e1("form.titleLabel")}),(0,n.jsx)("input",{type:"text",value:e5,onChange:e=>e7(e.target.value)}),(0,n.jsx)("div",{style:{marginTop:8},children:(0,n.jsx)(R,{value:e9,onChange:se,presets:e$})}),(0,n.jsx)("label",{children:e1("form.taskLabel")}),(0,n.jsx)("textarea",{className:"prose",value:ss,onChange:e=>sa(e.target.value)}),(null==(L=eQ.vcs)?void 0:L.enabled)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("label",{htmlFor:"branch-".concat(eV.id),children:e1("task.branch")}),(0,n.jsx)("input",{id:"branch-".concat(eV.id),type:"text",value:sn,onChange:e=>st(e.target.value),placeholder:eQ.vcs.branchPrefix,disabled:"per-session"===eQ.vcs.branchMode}),(0,n.jsx)("p",{className:"why",children:"per-session"===eQ.vcs.branchMode?e1("task.branchIgnored"):e1("task.branchWhy")}),(0,n.jsx)("label",{htmlFor:"commit-".concat(eV.id),children:e1("task.commitMessage")}),(0,n.jsx)("textarea",{id:"commit-".concat(eV.id),value:sl,onChange:e=>si(e.target.value),style:{minHeight:70}}),(0,n.jsx)("p",{className:"why",children:e1("task.commitWhy")})]}),(0,n.jsx)(E,{checks:sr,onChange:sc}),ss.trim()!==eV.prompt.trim()&&(0,n.jsx)("p",{className:"notice caution small",children:e1("task.newIntentNote")}),(0,n.jsx)(N.y,{readOnly:sd,scope:sh,onReadOnly:so,onScope:su}),(0,n.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,n.jsx)("button",{className:"primary",onClick:()=>void(sb?sF():sf()),children:sb?e1("task.saveAndRerun"):e1("task.save")}),(0,n.jsx)("span",{className:"err",children:sj})]}),sb&&(0,n.jsx)("p",{className:"muted small",children:e1("task.editRanWhy")})]}):(0,n.jsxs)(n.Fragment,{children:[(null!=(eT=null==(D=eV.checks)?void 0:D.length)?eT:0)>0&&(0,n.jsxs)("details",{className:"small",style:{margin:"6px 0"},children:[(0,n.jsxs)("summary",{children:[e1("checks.title")," — ",e1("checks.n",{n:null!=(eM=null==(A=eV.checks)?void 0:A.length)?eM:0}),(null!=(eW=null==(q=eV.checkResults)?void 0:q.length)?eW:0)>0&&" \xb7 ".concat((null!=(eB=eV.checkResults)?eB:[]).filter(e=>e.passed).length,"/").concat(null==(G=eV.checkResults)?void 0:G.length," ").concat(e1("checks.passed"))]}),(0,n.jsx)("ul",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(eH=eV.checks)?eH:[]).map((e,s)=>{var a;let t=(null!=(a=eV.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:[" — ",e1("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?e1("checks.passed"):e1("checks.failed")," — ",t.detail]})]},"".concat(e.name,"-").concat(s))})})]}),(null!=(eR=null==(Z=eV.reviewChecks)?void 0:Z.length)?eR:0)>0&&(0,n.jsxs)("details",{className:"small",style:{margin:"6px 0"},children:[(0,n.jsx)("summary",{children:e1("checks.fromReview",{n:null!=(eO=null==(K=eV.reviewChecks)?void 0:K.length)?eO:0})}),(0,n.jsx)("p",{className:"why",children:e1("checks.fromReviewWhy")}),(0,n.jsx)("ul",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(eP=eV.reviewChecks)?eP:[]).map(e=>{var s;let a=(null!=(s=eV.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:e1("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?e1("checks.passed"):e1("checks.failed")," — ",a.detail]})]},"".concat(e.attempt,":").concat(e.findingId,":").concat(e.check.name))})})]}),(0,n.jsx)(z,{review:eV.review}),eV.stopCode&&!(0,h.DG)(eV)&&(0,n.jsx)("p",{className:"small",children:(0,n.jsx)("span",{className:"chip",title:e1("stop.why"),children:e1("stop.".concat(eV.stopCode))})}),eV.handoff&&!(0,h.DG)(eV)&&(0,n.jsx)(P,{handoff:eV.handoff}),eV.summary&&(0,n.jsxs)("div",{className:"summary",children:[(0,n.jsx)("strong",{children:e1("task.whatWasDone")}),(0,n.jsx)(j.s,{text:eV.summary})]}),(null!=(eL=null==(_=eV.deviations)?void 0:_.length)?eL:0)>0&&(0,n.jsx)(U,{items:null!=(eD=eV.deviations)?eD:[]}),(null!=(eA=null==(Y=eV.disputes)?void 0:Y.length)?eA:0)>0&&(0,n.jsx)(J,{items:null!=(eE=eV.disputes)?eE:[]}),eV.environment&&(0,n.jsx)("div",{className:"muted small",style:{margin:"4px 0"},children:e1("task.ranWith",{node:eV.environment.node,npm:null!=(eq=eV.environment.npm)?eq:"—",git:null!=(eU=eV.environment.git)?eU:"—",pwsh:null!=(ez=null!=(eJ=eV.environment.pwsh)?eJ:eV.environment.powershell)?ez:"—"})}),(null!=(eG=null==(Q=eV.leftovers)?void 0:Q.length)?eG:0)>0&&(0,n.jsxs)("div",{className:"err small",style:{margin:"6px 0"},children:[e1("task.leftovers",{n:null!=(eZ=null==(V=eV.leftovers)?void 0:V.length)?eZ:0}),(0,n.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(eK=eV.leftovers)?eK:[]).map(e=>(0,n.jsxs)("li",{children:[(0,n.jsx)("code",{children:e.name})," pid ",e.pid,e.ports.length>0?" \xb7 ".concat(e1("task.leftoverPorts",{ports:e.ports.join(", ")})):""," \xb7 ",e.by]},"".concat(e.by,"-").concat(e.pid)))})]}),eV.reason&&(0,n.jsx)("div",{className:"reason small",style:{margin:"6px 0"},children:eV.reason}),(null!=(e_=null==(X=eV.attempts)?void 0:X.length)?e_:0)>0&&(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:e1("task.attempts",{n:null!=(eY=null==($=eV.attempts)?void 0:$.length)?eY:0})}),null==(ee=eV.attempts)?void 0:ee.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:e1("task.attemptN",{n:s+1})}),(0,n.jsx)("span",{className:"badge ".concat(e.status),children:e1("status.".concat(e.status))}),e.iterations>0&&(0,n.jsx)("span",{className:"muted",children:e1("task.iterations",{n:e.iterations})}),e.runId&&(0,n.jsx)(o.u,{label:e1("save.attemptLog"),save:()=>c.FH.saveTaskLog(eQ.id,eV.id,e.runId)}),e.runId&&(0,n.jsx)(o.H,{sessionId:eQ.id,taskId:eV.id,attempt:s+1}),e.runId&&(null==(a=e.vcs)?void 0:a.commit)&&e.vcs.baseCommit&&(0,n.jsx)(f.C,{sessionId:eQ.id,taskId:eV.id,runId:e.runId,title:"".concat(eV.title," — ").concat(e1("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?e1("task.started",{t:e2(e.startedAt)}):"",e.finishedAt?" \xb7 ".concat(e1("task.finished",{t:e2(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!==eV.prompt&&(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:e1("task.attemptText")}),(0,n.jsx)("pre",{children:e.prompt})]})]},"".concat(null!=(i=e.runId)?i:s))})]}),"queued"===eV.status?(0,n.jsxs)("div",{style:{marginTop:8},children:[(0,n.jsx)("div",{className:"muted small",children:e1("task.prompt")}),(0,n.jsx)("pre",{children:eV.prompt}),eV.level2.trim()?(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:e1("task.l2Show",{n:eV.level2.trim().split("\n").length})}),(0,n.jsx)("pre",{children:eV.level2})]}):(0,n.jsx)("div",{className:"muted small",children:e1("task.noL2")})]}):(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:e1("task.promptAndL2")}),eV.level2.trim()&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"muted small",children:e1("task.l2")}),(0,n.jsx)("pre",{children:eV.level2})]}),(0,n.jsx)("div",{className:"muted small",children:e1("task.prompt")}),(0,n.jsx)("pre",{children:eV.prompt})]}),eV.firstMessage&&(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:e1("task.firstMessage")}),(0,n.jsx)("pre",{className:"tall",children:eV.firstMessage})]}),eV.runId&&(0,n.jsxs)("details",{onToggle:e=>e.currentTarget.open&&void sM(),children:[(0,n.jsx)("summary",{children:e1("task.files")}),(0,n.jsx)("div",{className:"row small",style:{margin:"6px 0"},children:(0,n.jsx)(o.u,{label:e1("save.log"),save:()=>c.FH.saveTaskLog(eQ.id,eV.id)})}),sv&&(0,n.jsxs)("div",{className:"small",children:[sW("task.reports","reports",sv.reports),sW("task.artifacts","artifacts",sv.artifacts),sW("task.replies","replies",sv.replies)]})]}),eV.finalReply&&(0,n.jsxs)("details",{children:[(0,n.jsx)("summary",{children:e1("task.finalReply")}),(0,n.jsx)("pre",{className:"tall",children:eV.finalReply})]})]})]})}function A(e){let{events:s}=e,{t:a}=(0,d.kj)(),{appearance:l}=(0,m.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 E(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,h;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!=(h=e.value)?h:"",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 q(e){let{tasks:s}=e,{t:a}=(0,d.kj)(),t=(0,h.hH)(s),l=(0,u.c)(!!t&&t.tasks.some(h.DG));if(!t)return null;let i=(0,h.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 J(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,r;let{id:c,chosen:d,onChange:o,none:h,catalogue:u,disabled:m=!1,style:p}=e,{t:v}=(0,i.kj)(),x=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}(u),j=null!=(s=null==x?void 0:x.options)?s:[],g=e=>e.toLowerCase().replace(/[-‐‑‒–—_]+/g," ").replace(/\s+/g," ").trim(),f=d?j.find(e=>g(e.name)===g(d)):void 0,y=null!=(a=null==f?void 0:f.name)?a:d,b=!!f,k=j.filter(e=>!e.group),N=new Map;for(let e of j)e.group&&N.set(e.group,[...null!=(r=N.get(e.group))?r:[],e]);return(0,n.jsxs)("select",{id:c,value:y,onChange:e=>o(e.target.value),disabled:m,style:{width:"auto",minWidth:280,...p},children:[(0,n.jsx)("option",{value:"",children:h}),d&&!b&&(0,n.jsx)("option",{value:d,children:v("model.notInList",{name:d})}),k.map(e=>(0,n.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(v("model.unavailable")):""]},e.name)),[...N.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(v("model.unavailable")):""]},e.name))},s)})]})}},8078:(e,s,a)=>{"use strict";a.d(s,{AppearanceProvider:()=>o,KP:()=>h});var n=a(3365),t=a(1521);let l="cop.appearance",i=["small","normal","large","huge","giant"];"\n(function () {\n try {\n var d = document.documentElement;\n var raw = localStorage.getItem('".concat(l,"');\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(i),".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");let r={theme:"light",textSize:"normal",highContrast:!1,reduceMotion:!1,underlineLinks:!1,strongFocus:!1};function c(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 d=(0,t.createContext)({appearance:r,set:()=>void 0,reset:()=>void 0,loaded:!1});function o(e){let{children:s}=e,[a,o]=(0,t.useState)(r),[h,u]=(0,t.useState)(!1);(0,t.useEffect)(()=>{let e=r;try{let s=window.localStorage.getItem(l);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":r.theme,textSize:i.includes(s.textSize)?s.textSize:r.textSize,highContrast:a(s.highContrast,r.highContrast),reduceMotion:a(s.reduceMotion,r.reduceMotion),underlineLinks:a(s.underlineLinks,r.underlineLinks),strongFocus:a(s.strongFocus,r.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){}o(e),c(e),u(!0)},[]);let m=(0,t.useCallback)(e=>{o(s=>{let a={...s,...e};c(a);try{window.localStorage.setItem(l,JSON.stringify(a))}catch(e){}return a})},[]),p=(0,t.useCallback)(()=>{o(r),c(r);try{window.localStorage.removeItem(l)}catch(e){}},[]);return(0,n.jsx)(d.Provider,{value:{appearance:a,set:m,reset:p,loaded:h},children:s})}function h(){return(0,t.useContext)(d)}},8596:(e,s,a)=>{"use strict";a.d(s,{E:()=>r});var n=a(3365),t=a(1521),l=a(5549),i=a(867);function r(e){var s,a,r,c,d,o,h;let{dir:u,onDone:m}=e,{t:p}=(0,i.kj)(),v=(0,i.W3)(),[x,j]=(0,t.useState)(null),[g,f]=(0,t.useState)(""),[y,b]=(0,t.useState)(""),[k,N]=(0,t.useState)(""),[w,S]=(0,t.useState)(!1),C=e=>(null!=e?e:"—").slice(0,8),F=async e=>{b(""),N(""),f(e?"fetch":"prepare");try{j(await l.FH.preparePreview(u,e))}catch(e){b(e.message)}finally{f("")}},I=async()=>{if(null==x?void 0:x.fingerprint){b(""),f("prepare");try{var e,s;let a=await l.FH.prepareProject(u,x.fingerprint,{savedBranch:x.savedBranch,savedMainBranch:x.savedMainBranch});a.ok?(N(null!=(s=a.result)?s:""),j(null),null==m||m()):b(null!=(e=a.problem)?e:"")}catch(e){b(e.message)}finally{f("")}}},T=async e=>{try{await navigator.clipboard.writeText(e),S(!0),window.setTimeout(()=>S(!1),2500)}catch(e){b(p("plan.copyFailed"))}},M=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:p("prep.more",{n:e.length-30})})]}),W=x&&!x.ok&&x.fetched&&!x.fetched.ok;return(0,n.jsxs)("div",{className:"prepare-folder small",style:{marginTop:8,overflowWrap:"anywhere"},children:[(0,n.jsx)("button",{type:"button",onClick:()=>void F(!0),disabled:!!g,children:p("prep.show")}),(0,n.jsx)("p",{className:"why",children:p("prep.why")}),(0,n.jsx)("p",{className:"why",children:p("prep.password")}),"fetch"===g&&(0,n.jsx)("p",{role:"status",children:p("prep.fetching")}),y&&(0,n.jsx)("p",{className:"err",role:"alert",children:y}),k&&(0,n.jsx)("p",{className:"notice",role:"status",children:k}),x&&!x.ok&&!W&&(0,n.jsx)("p",{className:"err",children:x.problem}),W&&(0,n.jsxs)("div",{className:"notice caution",style:{marginTop:8},children:[(0,n.jsxs)("p",{children:[(0,n.jsx)("strong",{children:p("prep.fetchFailed")})," ",(0,n.jsx)("code",{children:null==(s=x.fetched)?void 0:s.detail})]}),(null==(a=x.fetched)?void 0:a.auth)&&(0,n.jsx)("p",{children:p("prep.fetchAuth")}),(0,n.jsx)("div",{className:"row",children:(0,n.jsx)("button",{type:"button",onClick:()=>void F(!0),disabled:!!g,children:p("prep.retry")})}),x.fetchCommand&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{style:{marginTop:8},children:p("prep.ownTerminal")}),(0,n.jsx)("pre",{className:"sync-cmd",children:x.fetchCommand}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{type:"button",onClick:()=>{var e;T(null!=(e=x.fetchCommand)?e:"")},children:p("prep.copyFetch")}),w&&(0,n.jsx)("span",{className:"badge done",children:p("prep.copied")}),(0,n.jsx)("button",{type:"button",onClick:()=>void F(!1),disabled:!!g,children:p("prep.useFetched")})]}),x.lastFetched&&(0,n.jsx)("p",{className:"muted",children:p("prep.lastFetched",{when:v(x.lastFetched)})})]})]}),(null==x?void 0:x.ok)&&(0,n.jsxs)("div",{className:"notice caution",style:{marginTop:8},children:[(0,n.jsx)("p",{children:p("prep.where",{target:null!=(r=x.target)?r:"",commit:C(x.targetCommit),branch:null!=(c=x.branch)?c:"HEAD",head:C(x.head)})}),!x.fetched&&(0,n.jsxs)("p",{className:"muted",children:[p("prep.notFetched")," ",x.lastFetched?p("prep.lastFetched",{when:v(x.lastFetched)}):p("prep.lastFetchedUnknown")]}),x.alreadyThere?(0,n.jsx)("p",{children:p("prep.already")}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("strong",{children:p("prep.willDo")}),(0,n.jsxs)("ol",{style:{margin:"4px 0",paddingLeft:20},children:[x.savedBranch&&(0,n.jsxs)("li",{children:[p("prep.keepChanges",{changed:x.changed.length,untracked:x.untracked.length,saved:x.savedBranch}),M([...x.changed,...x.untracked])]}),x.savedMainBranch&&(0,n.jsxs)("li",{children:[p("prep.keepMain",{n:x.mainOnlyCommits.length,branch:null!=(d=x.localBranch)?d:"",saved:x.savedMainBranch}),M(x.mainOnlyCommits)]}),(0,n.jsx)("li",{children:p("prep.moveTo",{branch:null!=(o=x.localBranch)?o:"",commit:C(x.targetCommit),target:null!=(h=x.target)?h:""})})]}),x.branchOnlyCommits.length>0&&x.branch&&(0,n.jsx)("p",{children:p("prep.branchStays",{branch:x.branch,n:x.branchOnlyCommits.length})}),(0,n.jsx)("p",{className:"muted",children:p("prep.ignored")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{type:"button",className:"primary",onClick:()=>void I(),disabled:!!g,children:p("prep.confirm")}),(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>j(null),disabled:!!g,children:p("prep.cancel")})]})]})]})]})}},8848:(e,s,a)=>{"use strict";a.d(s,{H4:()=>d,L:()=>o,z4:()=>h});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(),h=s.trim().toLowerCase(),u=a?l.others.filter(e=>e.rootDir.trim().toLowerCase()!==h):[];return(0,n.jsx)(m,{label:o?t("proj.defaultIs",{dir:o}):t("proj.noneShort"),offer:o&&a&&h!==o.toLowerCase()?{text:t("proj.useIt"),onUse:()=>a(o)}:void 0,more:u.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=u(),{t:l}=(0,c.kj)();if(!t)return null;let i=t.defaultModel.trim();return(0,n.jsx)(m,{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 h(e){let{current:s,onUse:a}=e,t=u(),{t:l}=(0,c.kj)();if(!t)return null;let i=t.defaultReviewModel.trim();return(0,n.jsx)(m,{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 u(){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 m(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()}]);
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html><!--beP1HgHJZvBVRTsoU1sZv--><html lang="en" data-theme="light" data-textsize="normal" data-contrast="normal" data-motion="normal" data-links="plain" data-focus="normal"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/c37978b44194c37b.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js"/><script src="/_next/static/chunks/c7879cf7-b5ab1053c1d9a2e7.js" async=""></script><script src="/_next/static/chunks/131-bae98f790a541679.js" async=""></script><script src="/_next/static/chunks/main-app-e3a5f713ba31557e.js" async=""></script><script src="/_next/static/chunks/197-f7c33a0114fc3db3.js" async=""></script><script src="/_next/static/chunks/867-52e371cb1ec49089.js" async=""></script><script src="/_next/static/chunks/549-7e35e4fdefadb05d.js" async=""></script><script src="/_next/static/chunks/app/layout-3efbb282292ccc38.js" async=""></script><script src="/_next/static/chunks/app/appearance/page-a18019cdc395de3d.js" async=""></script><title>copilot-operator</title><meta name="description" content="Runs task loops with Microsoft 365 Copilot on this machine."/><script>
1
+ <!DOCTYPE html><!--jYvSWuPPywbxckIuz6cNs--><html lang="en" data-theme="light" data-textsize="normal" data-contrast="normal" data-motion="normal" data-links="plain" data-focus="normal"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/c37978b44194c37b.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js"/><script src="/_next/static/chunks/c7879cf7-b5ab1053c1d9a2e7.js" async=""></script><script src="/_next/static/chunks/131-bae98f790a541679.js" async=""></script><script src="/_next/static/chunks/main-app-e3a5f713ba31557e.js" async=""></script><script src="/_next/static/chunks/197-f7c33a0114fc3db3.js" async=""></script><script src="/_next/static/chunks/867-52e371cb1ec49089.js" async=""></script><script src="/_next/static/chunks/549-7e35e4fdefadb05d.js" async=""></script><script src="/_next/static/chunks/app/layout-3efbb282292ccc38.js" async=""></script><script src="/_next/static/chunks/app/appearance/page-a18019cdc395de3d.js" async=""></script><title>copilot-operator</title><meta name="description" content="Runs task loops with Microsoft 365 Copilot on this machine."/><script>
2
2
  (function () {
3
3
  try {
4
4
  var d = document.documentElement;
@@ -13,4 +13,4 @@
13
13
  d.dataset.focus = a.strongFocus ? 'strong' : 'normal';
14
14
  } catch (e) {}
15
15
  })();
16
- </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><a class="skip-link" href="#main">Skip to the content</a><div class="wrap"><header class="top"><h1><a href="/">copilot-operator</a></h1><nav aria-label="Main"><a href="/"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v4H4zM4 11h16v4H4zM4 17h10v2H4z"></path></svg><span>Sessions</span></a><a href="/defaults"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm8.5 4 1.5 1-1.6 2.8-1.8-.4a7 7 0 0 1-1.5 1.5l.4 1.8L14.7 21l-1-1.5a7 7 0 0 1-3.4 0l-1 1.5-2.8-1.6.4-1.8A7 7 0 0 1 5.4 16l-1.8.4L2 13.6 3.5 12.6V11.4L2 10.4l1.6-2.8 1.8.4A7 7 0 0 1 6.9 6.5l-.4-1.8L9.3 3l1 1.5a7 7 0 0 1 3.4 0l1-1.5 2.8 1.6-.4 1.8a7 7 0 0 1 1.5 1.5l1.8-.4L22 10.4l-1.5 1z"></path></svg><span>Settings</span></a><a href="/import"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3v10m0 0 4-4m-4 4-4-4M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Plan from JSON</span></a><a href="/history"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 1 0 8.5 6M12 7v5l3 2M3 4v5h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Task register</span></a><a href="/level1"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M6 3h9l5 5v13H6zM14 3v6h6M9 13h7M9 17h7" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 1 prompt</span></a><a href="/presets"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M5 4h14v4H5zM5 10h14v4H5zM5 16h9v4H5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 2 presets</span></a><a aria-current="page" href="/appearance"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 0 0 0 18c1.5 0 2-1 2-2s-1-1.5-1-2.5S14 15 15.5 15H17a4 4 0 0 0 4-4 8 8 0 0 0-9-8zM8 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path></svg><span>Appearance</span></a><a href="/system"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v10H4zM2 19h20M9 15v4M15 15v4" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>System</span></a><select aria-label="Language" style="width:auto"><option value="en" selected="">English</option><option value="bg">Български</option></select></nav></header><main id="main"><div class="panel"><h2>Appearance</h2><p class="muted small">Kept in this browser only. Nothing here is sent anywhere or shared with another machine.</p><h3>Theme</h3><div class="segmented" role="group" aria-label="Theme"><button type="button" aria-pressed="false">Light</button><button type="button" aria-pressed="false">Dark</button></div><p class="muted small" style="margin-top:6px">Warm light for a bright room, warm dark for a dim one.</p></div><div class="panel"><h2>Accessibility</h2><p class="muted small">Each of these can be turned on by itself; they are independent of the theme and of the language.</p><h3>Text size</h3><div class="segmented" role="group" aria-label="Text size"><button type="button" aria-pressed="false">Small</button><button type="button" aria-pressed="false">Normal</button><button type="button" aria-pressed="false">Large</button><button type="button" aria-pressed="false">Larger</button><button type="button" aria-pressed="false">Largest</button></div><p class="muted small" style="margin-top:6px">One step below normal and three above. Scales the whole interface, not only the body text, and is remembered in this browser.</p><div class="option"><label><input type="checkbox"/><span>Higher contrast</span></label><p class="why">Stronger borders and darker text. Drops some of the warmth in exchange for legibility.</p></div><div class="option"><label><input type="checkbox"/><span>Less motion</span></label><p class="why">No transitions, and the live log stops scrolling itself while a run is in progress.</p></div><div class="option"><label><input type="checkbox"/><span>Underline every link</span></label><p class="why">Links stop relying on colour alone to be recognisable.</p></div><div class="option"><label><input type="checkbox"/><span>Thick focus outline</span></label><p class="why">Makes what the keyboard is on impossible to lose, when tabbing through a page.</p></div><div class="row" style="margin-top:12px"><button>Back to the defaults</button></div></div><div class="panel"><h2>How it looks</h2><p class="small">A task that ended with a summary, one waiting for approval, and a link.<!-- --> <a href="#main">a link in a sentence</a></p><div class="row"><span class="badge done">done</span><span class="badge running">running</span><span class="badge waiting-approval">waiting for approval</span><span class="badge failed">failed</span></div><div class="summary" style="margin-top:10px"><strong>What was done</strong><div>A task that ended with a summary, one waiting for approval, and a link.</div></div><div class="row"><button class="primary">Run</button><button>Skip</button><button class="danger">Abort task</button></div></div><!--$--><!--/$--></main></div><script src="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[8078,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"AppearanceProvider\"]\n3:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"LanguageProvider\"]\n4:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"DialogHost\"]\n5:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"SkipLink\"]\n6:I[8197,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"\"]\n7:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"Nav\"]\n8:I[6657,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"GlobalApprovals\"]\n9:I[5204,[],\"\"]\na:I[2642,[],\"\"]\nb:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"ScrollJump\"]\nc:I[7089,[],\"ClientPageRoot\"]\nd:I[4585,[\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"429\",\"static/chunks/app/appearance/page-a18019cdc395de3d.js\"],\"default\"]\n10:I[433,[],\"OutletBoundary\"]\n12:I[9884,[],\"AsyncMetadataOutlet\"]\n14:I[433,[],\"ViewportBoundary\"]\n16:I[433,["])</script><script>self.__next_f.push([1,"],\"MetadataBoundary\"]\n17:\"$Sreact.suspense\"\n19:I[3536,[],\"\"]\n:HL[\"/_next/static/css/c37978b44194c37b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"beP1HgHJZvBVRTsoU1sZv\",\"p\":\"\",\"c\":[\"\",\"appearance\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"appearance\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/c37978b44194c37b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"data-theme\":\"light\",\"data-textsize\":\"normal\",\"data-contrast\":\"normal\",\"data-motion\":\"normal\",\"data-links\":\"plain\",\"data-focus\":\"normal\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n(function () {\\n try {\\n var d = document.documentElement;\\n var raw = localStorage.getItem('cop.appearance');\\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 = [\\\"small\\\",\\\"normal\\\",\\\"large\\\",\\\"huge\\\",\\\"giant\\\"].indexOf(a.textSize) \u003e= 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\"}}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"children\":[[\"$\",\"$L5\",null,{}],[\"$\",\"div\",null,{\"className\":\"wrap\",\"children\":[[\"$\",\"header\",null,{\"className\":\"top\",\"children\":[[\"$\",\"h1\",null,{\"children\":[\"$\",\"$L6\",null,{\"href\":\"/\",\"children\":\"copilot-operator\"}]}],[\"$\",\"$L7\",null,{}]]}],[\"$\",\"$L8\",null,{}],[\"$\",\"main\",null,{\"id\":\"main\",\"children\":[\"$\",\"$L9\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$La\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}],[\"$\",\"$Lb\",null,{}]]}]}]}]}]]}]]}],{\"children\":[\"appearance\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L9\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$La\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$Lc\",null,{\"Component\":\"$d\",\"searchParams\":{},\"params\":{},\"promises\":[\"$@e\",\"$@f\"]}],null,[\"$\",\"$L10\",null,{\"children\":[\"$L11\",[\"$\",\"$L12\",null,{\"promise\":\"$@13\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[[\"$\",\"$L14\",null,{\"children\":\"$L15\"}],null],[\"$\",\"$L16\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$17\",null,{\"fallback\":null,\"children\":\"$L18\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$19\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"e:{}\nf:\"$0:f:0:1:2:children:2:children:1:props:children:0:props:params\"\n"])</script><script>self.__next_f.push([1,"15:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n11:null\n"])</script><script>self.__next_f.push([1,"13:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"copilot-operator\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Runs task loops with Microsoft 365 Copilot on this machine.\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"18:\"$13:metadata\"\n"])</script></body></html>
16
+ </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><a class="skip-link" href="#main">Skip to the content</a><div class="wrap"><header class="top"><h1><a href="/">copilot-operator</a></h1><nav aria-label="Main"><a href="/"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v4H4zM4 11h16v4H4zM4 17h10v2H4z"></path></svg><span>Sessions</span></a><a href="/defaults"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm8.5 4 1.5 1-1.6 2.8-1.8-.4a7 7 0 0 1-1.5 1.5l.4 1.8L14.7 21l-1-1.5a7 7 0 0 1-3.4 0l-1 1.5-2.8-1.6.4-1.8A7 7 0 0 1 5.4 16l-1.8.4L2 13.6 3.5 12.6V11.4L2 10.4l1.6-2.8 1.8.4A7 7 0 0 1 6.9 6.5l-.4-1.8L9.3 3l1 1.5a7 7 0 0 1 3.4 0l1-1.5 2.8 1.6-.4 1.8a7 7 0 0 1 1.5 1.5l1.8-.4L22 10.4l-1.5 1z"></path></svg><span>Settings</span></a><a href="/import"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3v10m0 0 4-4m-4 4-4-4M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Plan from JSON</span></a><a href="/history"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 1 0 8.5 6M12 7v5l3 2M3 4v5h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Task register</span></a><a href="/level1"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M6 3h9l5 5v13H6zM14 3v6h6M9 13h7M9 17h7" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 1 prompt</span></a><a href="/presets"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M5 4h14v4H5zM5 10h14v4H5zM5 16h9v4H5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 2 presets</span></a><a aria-current="page" href="/appearance"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 0 0 0 18c1.5 0 2-1 2-2s-1-1.5-1-2.5S14 15 15.5 15H17a4 4 0 0 0 4-4 8 8 0 0 0-9-8zM8 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path></svg><span>Appearance</span></a><a href="/system"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v10H4zM2 19h20M9 15v4M15 15v4" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>System</span></a><select aria-label="Language" style="width:auto"><option value="en" selected="">English</option><option value="bg">Български</option></select></nav></header><main id="main"><div class="panel"><h2>Appearance</h2><p class="muted small">Kept in this browser only. Nothing here is sent anywhere or shared with another machine.</p><h3>Theme</h3><div class="segmented" role="group" aria-label="Theme"><button type="button" aria-pressed="false">Light</button><button type="button" aria-pressed="false">Dark</button></div><p class="muted small" style="margin-top:6px">Warm light for a bright room, warm dark for a dim one.</p></div><div class="panel"><h2>Accessibility</h2><p class="muted small">Each of these can be turned on by itself; they are independent of the theme and of the language.</p><h3>Text size</h3><div class="segmented" role="group" aria-label="Text size"><button type="button" aria-pressed="false">Small</button><button type="button" aria-pressed="false">Normal</button><button type="button" aria-pressed="false">Large</button><button type="button" aria-pressed="false">Larger</button><button type="button" aria-pressed="false">Largest</button></div><p class="muted small" style="margin-top:6px">One step below normal and three above. Scales the whole interface, not only the body text, and is remembered in this browser.</p><div class="option"><label><input type="checkbox"/><span>Higher contrast</span></label><p class="why">Stronger borders and darker text. Drops some of the warmth in exchange for legibility.</p></div><div class="option"><label><input type="checkbox"/><span>Less motion</span></label><p class="why">No transitions, and the live log stops scrolling itself while a run is in progress.</p></div><div class="option"><label><input type="checkbox"/><span>Underline every link</span></label><p class="why">Links stop relying on colour alone to be recognisable.</p></div><div class="option"><label><input type="checkbox"/><span>Thick focus outline</span></label><p class="why">Makes what the keyboard is on impossible to lose, when tabbing through a page.</p></div><div class="row" style="margin-top:12px"><button>Back to the defaults</button></div></div><div class="panel"><h2>How it looks</h2><p class="small">A task that ended with a summary, one waiting for approval, and a link.<!-- --> <a href="#main">a link in a sentence</a></p><div class="row"><span class="badge done">done</span><span class="badge running">running</span><span class="badge waiting-approval">waiting for approval</span><span class="badge failed">failed</span></div><div class="summary" style="margin-top:10px"><strong>What was done</strong><div>A task that ended with a summary, one waiting for approval, and a link.</div></div><div class="row"><button class="primary">Run</button><button>Skip</button><button class="danger">Abort task</button></div></div><!--$--><!--/$--></main></div><script src="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[8078,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"AppearanceProvider\"]\n3:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"LanguageProvider\"]\n4:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"DialogHost\"]\n5:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"SkipLink\"]\n6:I[8197,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"\"]\n7:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"Nav\"]\n8:I[6657,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"GlobalApprovals\"]\n9:I[5204,[],\"\"]\na:I[2642,[],\"\"]\nb:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"549\",\"static/chunks/549-7e35e4fdefadb05d.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"ScrollJump\"]\nc:I[7089,[],\"ClientPageRoot\"]\nd:I[4585,[\"867\",\"static/chunks/867-52e371cb1ec49089.js\",\"429\",\"static/chunks/app/appearance/page-a18019cdc395de3d.js\"],\"default\"]\n10:I[433,[],\"OutletBoundary\"]\n12:I[9884,[],\"AsyncMetadataOutlet\"]\n14:I[433,[],\"ViewportBoundary\"]\n16:I[433,["])</script><script>self.__next_f.push([1,"],\"MetadataBoundary\"]\n17:\"$Sreact.suspense\"\n19:I[3536,[],\"\"]\n:HL[\"/_next/static/css/c37978b44194c37b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"jYvSWuPPywbxckIuz6cNs\",\"p\":\"\",\"c\":[\"\",\"appearance\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"appearance\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/c37978b44194c37b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"data-theme\":\"light\",\"data-textsize\":\"normal\",\"data-contrast\":\"normal\",\"data-motion\":\"normal\",\"data-links\":\"plain\",\"data-focus\":\"normal\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n(function () {\\n try {\\n var d = document.documentElement;\\n var raw = localStorage.getItem('cop.appearance');\\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 = [\\\"small\\\",\\\"normal\\\",\\\"large\\\",\\\"huge\\\",\\\"giant\\\"].indexOf(a.textSize) \u003e= 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\"}}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"children\":[[\"$\",\"$L5\",null,{}],[\"$\",\"div\",null,{\"className\":\"wrap\",\"children\":[[\"$\",\"header\",null,{\"className\":\"top\",\"children\":[[\"$\",\"h1\",null,{\"children\":[\"$\",\"$L6\",null,{\"href\":\"/\",\"children\":\"copilot-operator\"}]}],[\"$\",\"$L7\",null,{}]]}],[\"$\",\"$L8\",null,{}],[\"$\",\"main\",null,{\"id\":\"main\",\"children\":[\"$\",\"$L9\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$La\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}],[\"$\",\"$Lb\",null,{}]]}]}]}]}]]}]]}],{\"children\":[\"appearance\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L9\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$La\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$Lc\",null,{\"Component\":\"$d\",\"searchParams\":{},\"params\":{},\"promises\":[\"$@e\",\"$@f\"]}],null,[\"$\",\"$L10\",null,{\"children\":[\"$L11\",[\"$\",\"$L12\",null,{\"promise\":\"$@13\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[[\"$\",\"$L14\",null,{\"children\":\"$L15\"}],null],[\"$\",\"$L16\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$17\",null,{\"fallback\":null,\"children\":\"$L18\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$19\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"e:{}\nf:\"$0:f:0:1:2:children:2:children:1:props:children:0:props:params\"\n"])</script><script>self.__next_f.push([1,"15:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n11:null\n"])</script><script>self.__next_f.push([1,"13:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"copilot-operator\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Runs task loops with Microsoft 365 Copilot on this machine.\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"18:\"$13:metadata\"\n"])</script></body></html>
@@ -18,7 +18,7 @@ d:I[4585,["867","static/chunks/867-52e371cb1ec49089.js","429","static/chunks/app
18
18
  17:"$Sreact.suspense"
19
19
  19:I[3536,[],""]
20
20
  :HL["/_next/static/css/c37978b44194c37b.css","style"]
21
- 0:{"P":null,"b":"beP1HgHJZvBVRTsoU1sZv","p":"","c":["","appearance"],"i":false,"f":[[["",{"children":["appearance",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/c37978b44194c37b.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"data-theme":"light","data-textsize":"normal","data-contrast":"normal","data-motion":"normal","data-links":"plain","data-focus":"normal","children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n(function () {\n try {\n var d = document.documentElement;\n var raw = localStorage.getItem('cop.appearance');\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 = [\"small\",\"normal\",\"large\",\"huge\",\"giant\"].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"}}]}],["$","body",null,{"children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":[["$","$L5",null,{}],["$","div",null,{"className":"wrap","children":[["$","header",null,{"className":"top","children":[["$","h1",null,{"children":["$","$L6",null,{"href":"/","children":"copilot-operator"}]}],["$","$L7",null,{}]]}],["$","$L8",null,{}],["$","main",null,{"id":"main","children":["$","$L9",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}],["$","$Lb",null,{}]]}]}]}]}]]}]]}],{"children":["appearance",["$","$1","c",{"children":[null,["$","$L9",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$Lc",null,{"Component":"$d","searchParams":{},"params":{},"promises":["$@e","$@f"]}],null,["$","$L10",null,{"children":["$L11",["$","$L12",null,{"promise":"$@13"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$L14",null,{"children":"$L15"}],null],["$","$L16",null,{"children":["$","div",null,{"hidden":true,"children":["$","$17",null,{"fallback":null,"children":"$L18"}]}]}]]}],false]],"m":"$undefined","G":["$19",[]],"s":false,"S":true}
21
+ 0:{"P":null,"b":"jYvSWuPPywbxckIuz6cNs","p":"","c":["","appearance"],"i":false,"f":[[["",{"children":["appearance",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/c37978b44194c37b.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"data-theme":"light","data-textsize":"normal","data-contrast":"normal","data-motion":"normal","data-links":"plain","data-focus":"normal","children":[["$","head",null,{"children":["$","script",null,{"dangerouslySetInnerHTML":{"__html":"\n(function () {\n try {\n var d = document.documentElement;\n var raw = localStorage.getItem('cop.appearance');\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 = [\"small\",\"normal\",\"large\",\"huge\",\"giant\"].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"}}]}],["$","body",null,{"children":["$","$L2",null,{"children":["$","$L3",null,{"children":["$","$L4",null,{"children":[["$","$L5",null,{}],["$","div",null,{"className":"wrap","children":[["$","header",null,{"className":"top","children":[["$","h1",null,{"children":["$","$L6",null,{"href":"/","children":"copilot-operator"}]}],["$","$L7",null,{}]]}],["$","$L8",null,{}],["$","main",null,{"id":"main","children":["$","$L9",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]]}],["$","$Lb",null,{}]]}]}]}]}]]}]]}],{"children":["appearance",["$","$1","c",{"children":[null,["$","$L9",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$La",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$Lc",null,{"Component":"$d","searchParams":{},"params":{},"promises":["$@e","$@f"]}],null,["$","$L10",null,{"children":["$L11",["$","$L12",null,{"promise":"$@13"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$L14",null,{"children":"$L15"}],null],["$","$L16",null,{"children":["$","div",null,{"hidden":true,"children":["$","$17",null,{"fallback":null,"children":"$L18"}]}]}]]}],false]],"m":"$undefined","G":["$19",[]],"s":false,"S":true}
22
22
  e:{}
23
23
  f:"$0:f:0:1:2:children:2:children:1:props:children:0:props:params"
24
24
  15:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]