copilot-operator 0.1.7 → 0.1.8

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.
Files changed (36) hide show
  1. package/dist/src/api/operator.service.js +15 -9
  2. package/dist/src/plan/brief.js +4 -4
  3. package/dist/src/plan/systemGuide.js +22 -6
  4. package/dist/src/session/compose.js +24 -19
  5. package/dist/src/session/interruption.js +104 -0
  6. package/dist/src/session/store.js +21 -5
  7. package/dist/src/session/story.js +1 -1
  8. package/dist/web/404.html +2 -2
  9. package/dist/web/_next/static/chunks/867-3d4ee08c5f9f0e71.js +1 -0
  10. package/dist/web/_next/static/chunks/app/defaults/{page-1747c931adc746fd.js → page-dfcbd748f454d2d7.js} +1 -1
  11. package/dist/web/_next/static/chunks/app/history/page-49413c3a8266a0b7.js +1 -0
  12. package/dist/web/_next/static/chunks/app/sessions/view/page-a82e5e801dabc423.js +1 -0
  13. package/dist/web/appearance.html +2 -2
  14. package/dist/web/appearance.txt +11 -11
  15. package/dist/web/defaults.html +2 -2
  16. package/dist/web/defaults.txt +11 -11
  17. package/dist/web/history.html +2 -2
  18. package/dist/web/history.txt +11 -11
  19. package/dist/web/import.html +2 -2
  20. package/dist/web/import.txt +11 -11
  21. package/dist/web/index.html +2 -2
  22. package/dist/web/index.txt +11 -11
  23. package/dist/web/level1.html +2 -2
  24. package/dist/web/level1.txt +11 -11
  25. package/dist/web/presets.html +2 -2
  26. package/dist/web/presets.txt +11 -11
  27. package/dist/web/sessions/view.html +2 -2
  28. package/dist/web/sessions/view.txt +11 -11
  29. package/dist/web/system.html +2 -2
  30. package/dist/web/system.txt +11 -11
  31. package/package.json +1 -1
  32. package/dist/web/_next/static/chunks/867-4aa80f5a32311bce.js +0 -1
  33. package/dist/web/_next/static/chunks/app/history/page-2251664c0abe3f11.js +0 -1
  34. package/dist/web/_next/static/chunks/app/sessions/view/page-9517dd74c6d00f85.js +0 -1
  35. /package/dist/web/_next/static/{DCpEMjhrg9APkRwBBw5Do → kysrkUS5Y-ZTHsIIXgs3q}/_buildManifest.js +0 -0
  36. /package/dist/web/_next/static/{DCpEMjhrg9APkRwBBw5Do → kysrkUS5Y-ZTHsIIXgs3q}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[189],{1035:(e,l,t)=>{"use strict";t.d(l,{DialogHost:()=>d,Z:()=>o});var r=t(3365),n=t(1521),s=t(867);let a=null,i=[];function o(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(t=>{var r;return r={kind:"confirm",message:e,...l,resolve:t},void(a?a(r):i.push(r))})}function d(e){var l,t;let{children:o}=e,{t:d}=(0,s.kj)(),[c,u]=(0,n.useState)([]),m=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(a=e=>u(l=>[...l,e]),i.length>0){let e=i.splice(0,i.length);u(l=>[...l,...e])}return()=>{a=null}},[]);let h=c[0],x=(0,n.useCallback)(e=>{h&&(h.resolve(e),u(e=>e.slice(1)))},[h]);return(0,n.useEffect)(()=>{var e;if(!h)return;null==(e=m.current)||e.focus();let l=e=>{"Escape"===e.key&&(e.preventDefault(),x(!1))};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[h,x]),(0,r.jsxs)(r.Fragment,{children:[o,h&&(0,r.jsx)("div",{className:"modal-backdrop",onClick:()=>x(!1),role:"presentation",children:(0,r.jsxs)("div",{className:"modal".concat(h.danger?" danger":""),role:"confirm"===h.kind?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":"modal-title",onClick:e=>e.stopPropagation(),children:[(0,r.jsx)("h2",{id:"modal-title",children:null!=(l=h.title)?l:d("confirm"===h.kind?"dialog.confirmTitle":"dialog.noticeTitle")}),(0,r.jsx)("div",{className:"modal-body",children:h.message}),(0,r.jsxs)("div",{className:"row modal-actions",children:["confirm"===h.kind&&(0,r.jsx)("button",{type:"button",className:"quiet",onClick:()=>x(!1),children:d("dialog.cancel")}),(0,r.jsx)("button",{ref:m,type:"button",className:h.danger?"danger":"primary",onClick:()=>x(!0),children:null!=(t=h.okLabel)?t:d("dialog.ok")})]})]})})]})}},1896:(e,l,t)=>{Promise.resolve().then(t.bind(t,3197))},2244:(e,l,t)=>{"use strict";t.d(l,{k:()=>c});var r=t(3365),n=t(1521),s=t(5549),a=t(867);function i(e){return e.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/+$/,"")}function o(e,l){return"."===l||""===l||e===l||e.startsWith("".concat(l,"/"))}function d(e,l,t){return t.includes(e)?"out":t.some(l=>l!==e&&o(e,l))?"out-inherited":l.includes(e)?"in":l.some(l=>l!==e&&o(e,l))?"inherited":"none"}function c(e){let{rootDir:l,respectGitignore:t,includeEnvFiles:c,include:u,exclude:m,onChange:h}=e,{t:x}=(0,a.kj)(),[j,p]=(0,n.useState)(null),[v,f]=(0,n.useState)(""),[g,y]=(0,n.useState)(new Set),[b,N]=(0,n.useState)(""),w=async()=>{if(l.trim()){f("");try{let e=await s.FH.dirs(l,t);p(e),N("".concat(l,"|").concat(t)),y(new Set(e.filter(e=>!e.includes("/"))))}catch(e){f(e.message)}}};(0,n.useEffect)(()=>{p(null),N("")},[l,t]);let k=(0,n.useMemo)(()=>(function(e){let l=[],t=new Map;for(let n of[...e].sort()){var r;let e={path:n,name:null!=(r=n.split("/").pop())?r:n,children:[]};t.set(n,e);let s=n.includes("/")?t.get(n.slice(0,n.lastIndexOf("/"))):void 0;(s?s.children:l).push(e)}return l})(null!=j?j:[]),[j]),S=u.map(i).filter(Boolean),C=m.map(i).filter(Boolean),D=e=>(0,r.jsx)("ul",{className:"dir-tree",children:e.map(e=>{let l=d(e.path,S,C),t=g.has(e.path),n=function(e,l,t){let r=l=>l.filter(l=>l!==e&&o(l,e)).length;return{included:r(l),excluded:r(t)}}(e.path,S,C),s=!t&&e.children.length>0&&(n.included>0||n.excluded>0);return(0,r.jsxs)("li",{className:"dir ".concat(l),children:[(0,r.jsxs)("div",{className:"dir-row",children:[e.children.length>0?(0,r.jsx)("button",{type:"button",className:"dir-flip",onClick:()=>{let l;return l=e.path,y(e=>{let t=new Set(e);return t.has(l)?t.delete(l):t.add(l),t})},"aria-label":t?x("tree.fold"):x("tree.unfold"),"aria-expanded":t,children:t?"▾":"▸"}):(0,r.jsx)("span",{className:"dir-flip","aria-hidden":"true"}),(0,r.jsxs)("button",{type:"button",className:"dir-name",onClick:()=>(e=>{if("in"===d(e,S,C))return void h(S.filter(l=>l!==e),C);h([...S.filter(l=>!o(l,e)),e],C.filter(l=>!o(l,e)))})(e.path),title:"in"===l?x("tree.stateIn"):"inherited"===l?x("tree.stateInherited"):"out"===l?x("tree.stateOut"):"out-inherited"===l?x("tree.stateOutInherited"):x("tree.stateNone"),"aria-pressed":"in"===l||"inherited"===l,children:[(0,r.jsx)("span",{className:"dir-mark","aria-hidden":"true",children:"in"===l?"✓":"inherited"===l?"\xb7":"out"===l||"out-inherited"===l?"\xd7":""}),e.name]}),(0,r.jsx)("button",{type:"button",className:"dir-out".concat("out"===l?" on":""),onClick:()=>(e=>{if(C.includes(e))return void h(S,C.filter(l=>l!==e));h(S.filter(l=>l!==e&&!o(l,e)),[...C.filter(l=>!o(l,e)),e])})(e.path),title:"out"===l?x("tree.unexclude"):x("tree.exclude"),children:"−"}),s&&(0,r.jsx)("span",{className:"chip inside".concat(n.excluded>0?" out":""),title:x("tree.insideWhy"),children:n.excluded>0&&n.included>0?x("tree.insideBoth",{i:n.included,e:n.excluded}):n.excluded>0?x("tree.insideOut",{n:n.excluded}):x("tree.insideIn",{n:n.included})})]}),t&&e.children.length>0&&D(e.children)]},e.path)})}),F=b!=="".concat(l,"|").concat(t);return(0,r.jsxs)("div",{className:"dir-tree-box",children:[(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("button",{type:"button",onClick:()=>void w(),disabled:!l.trim(),children:null===j||F?x("tree.load"):x("tree.reload")}),(0,r.jsx)("span",{className:"muted small",children:x("tree.hint")})]}),v&&(0,r.jsx)("div",{className:"err small",children:v}),(0,r.jsxs)("p",{className:"muted small",style:{marginTop:6},children:[x("tree.alsoOut")," ",[t?x("tree.alsoGitignore"):null,!1===c?x("tree.alsoEnv"):null,x("tree.alsoAlways")].filter(Boolean).join(" \xb7 ")]}),null!==j&&!F&&(0===j.length?(0,r.jsx)("p",{className:"muted small",children:x("mirror.noDirs")}):D(k))]})}},3197:(e,l,t)=>{"use strict";t.r(l),t.d(l,{default:()=>m});var r=t(3365),n=t(1521),s=t(8197),a=t.n(s),i=t(5549),o=t(867),d=t(1035),c=t(4784),u=t(2244);function m(){let{t:e}=(0,o.kj)(),[l,t]=(0,n.useState)(null),[s,a]=(0,n.useState)(!1),[c,u]=(0,n.useState)("");(0,n.useEffect)(()=>{i.FH.models().then(t).catch(()=>void 0)},[]);let m=async()=>{if(await (0,d.Z)(e("model.refreshConfirm"))){a(!0),u(e("model.refreshing"));try{var l;let r=await i.FH.models().then(()=>i.FH.refreshModels());t(r),u(0===r.options.length?null!=(l=r.note)?l:e("model.none"):e("model.refreshed",{n:r.options.length}))}catch(e){u(e.message)}finally{a(!1)}}},h={catalogue:l,setCatalogue:t,refreshModels:m,refreshing:s,refreshMsg:c};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"panel",children:[(0,r.jsx)("h2",{children:e("def.title")}),(0,r.jsx)("p",{className:"muted small",children:e("def.intro")}),(0,r.jsx)("p",{className:"why",children:e("def.autoSave")})]}),(0,r.jsx)(v,{}),(0,r.jsx)(b,{...h}),(0,r.jsx)(N,{...h}),(0,r.jsx)(y,{})]})}function h(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:900,t=(0,n.useRef)(null),r=(0,n.useRef)(null),s=(0,n.useRef)(e);return s.current=e,(0,n.useEffect)(()=>()=>{t.current&&clearTimeout(t.current),r.current&&s.current(r.current.value)},[]),e=>{t.current&&clearTimeout(t.current),r.current={value:e},t.current=setTimeout(()=>{r.current=null,s.current(e)},l)}}function x(e){let{id:l,value:t,min:s,max:a,onChange:i,disabled:o}=e,[d,c]=(0,n.useState)(String(t));return(0,n.useEffect)(()=>c(e=>j(e)===t?e:String(t)),[t]),(0,r.jsx)("input",{id:l,type:"number",min:s,max:a,step:1,value:d,onChange:e=>{c(e.target.value);let l=j(e.target.value);null!==l&&l>=s&&l<=a&&i(l)},onBlur:()=>{let e=j(d),l=null===e?t:Math.max(s,Math.min(a,e));c(String(l)),l!==t&&i(l)},style:{width:90},disabled:o})}function j(e){if(""===e.trim())return null;let l=Number(e);return Number.isInteger(l)?l:null}function p(e){let{msg:l,onSave:t}=e,{t:n}=(0,o.kj)();return(0,r.jsxs)("div",{className:"row",style:{marginTop:6},children:[t&&(0,r.jsx)("button",{className:"quiet",onClick:t,title:n("def.saveAnywayWhy"),children:n("def.saveAnyway")}),(0,r.jsx)("span",{className:"muted small",role:"status",children:l||n("def.savedAutomatically")})]})}function v(){var e;let{t:l}=(0,o.kj)(),[t,s]=(0,n.useState)(null),[a,d]=(0,n.useState)(""),[c,u]=(0,n.useState)(""),[m,x]=(0,n.useState)(""),[j,v]=(0,n.useState)(""),[g,y]=(0,n.useState)(!1),[b,N]=(0,n.useState)(""),[w,k]=(0,n.useState)(""),S=(0,n.useCallback)(async()=>{try{let e=await i.FH.project();s(e),d(e.rootDir),u(e.name),v("")}catch(e){v(e.message)}},[]);(0,n.useEffect)(()=>{S()},[S]);let C=async(e,l)=>{y(!0),x("");try{let t=await i.FH.setProject(e);return s(t),d(t.rootDir),x(l(t)),v(""),!0}catch(e){return v(e.message),!1}finally{y(!1)}},D=e=>C({rootDir:e},e=>e.rootDir?l("proj.saved",{dir:e.rootDir}):l("proj.cleared")),F=e=>C({name:e},()=>l("proj.nameSaved")),R=h(D),M=h(F),T=async(e,l)=>{y(!0);try{var t;let r=await i.FH.browseFolder(l.trim()||void 0);r.ok?e(r.path):r.cancelled||v(null!=(t=r.reason)?t:"")}finally{y(!1)}},E=null!=(e=null==t?void 0:t.others)?e:[],I=e=>e.map(e=>({name:e.name,rootDir:e.rootDir,...e.mirror?{mirror:e.mirror}:{}})),B=async()=>{await C({others:[...I(E),{name:b.trim(),rootDir:w.trim()}]},e=>l("proj.othersSaved",{n:e.others.length}))&&(N(""),k(""))};return(0,r.jsxs)("div",{className:"panel",id:"project",children:[(0,r.jsx)("h2",{children:l("proj.title")}),(0,r.jsx)("p",{className:"muted small",children:l("proj.intro")}),j&&(0,r.jsx)("div",{className:"err",children:j}),t&&(0,r.jsxs)("div",{className:"option".concat(t.mirrorToDesktop?" warned":""),style:{marginBottom:12},children:[(0,r.jsxs)("label",{children:[(0,r.jsx)("input",{type:"checkbox",checked:t.mirrorToDesktop,onChange:e=>{C({mirrorToDesktop:e.target.checked},e=>e.mirrorToDesktop?l("proj.mirrorOn",{root:e.contextRoot}):l("proj.mirrorOff"))},disabled:g}),(0,r.jsx)("span",{children:l("proj.mirrorToDesktop")})]}),(0,r.jsx)("p",{className:"why",children:l("proj.mirrorToDesktopWhy",{root:t.contextRoot})})]}),(0,r.jsx)("p",{className:"muted small",children:l("proj.listIntro")}),(0,r.jsx)(f,{name:c,dir:a,repoOk:!!(null==t?void 0:t.repoOk),repoProblem:null==t?void 0:t.repoProblem,mirror:null==t?void 0:t.mirror,isDefault:!0,busy:g,onName:e=>{u(e),M(e)},onNameBlur:()=>void F(c),onDir:e=>{d(e),R(e)},onDirBlur:()=>void D(a),onBrowse:()=>void T(e=>void D(e),a),onRemove:(null==t?void 0:t.rootDir)?()=>void D(""):void 0,removeLabel:l("proj.clear"),onFolders:e=>C({mirror:e},()=>l("proj.foldersSaved"))}),(0,r.jsx)(p,{msg:m}),t&&!t.rootDir&&(0,r.jsx)("p",{className:"muted small",style:{marginTop:8},children:l("proj.none")}),E.map(e=>(0,r.jsx)(f,{name:e.name,dir:e.rootDir,repoOk:e.repoOk,repoProblem:e.repoProblem,mirror:e.mirror,busy:g,onName:t=>void C({others:I(E.map(l=>l.name===e.name?{...l,name:t}:l))},()=>l("proj.nameSaved")),onDir:t=>void C({others:I(E.map(l=>l.name===e.name?{...l,rootDir:t}:l))},()=>l("proj.othersSaved",{n:E.length})),onBrowse:()=>void T(t=>void C({others:I(E.map(l=>l.name===e.name?{...l,rootDir:t}:l))},()=>l("proj.othersSaved",{n:E.length})),e.rootDir),onRemove:()=>{let t;t=e.name,C({others:I(E.filter(e=>e.name!==t))},e=>l("proj.othersSaved",{n:e.others.length}))},removeLabel:l("proj.otherRemove"),onFolders:t=>{let r;return r=e.name,C({others:I(E.map(e=>e.name===r?{...e,mirror:t}:e))},()=>l("proj.foldersSaved"))}},e.name)),(0,r.jsx)("h3",{id:"others",children:l("proj.addTitle")}),(0,r.jsx)("p",{className:"muted small",children:l("proj.othersIntro")}),(0,r.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,r.jsx)("input",{type:"text","aria-label":l("proj.entryName"),value:b,onChange:e=>N(e.target.value),placeholder:l("proj.entryName"),disabled:g,style:{width:160}}),(0,r.jsx)("input",{type:"text",className:"grow","aria-label":l("proj.entryDir"),value:w,onChange:e=>k(e.target.value),placeholder:"C:\\Projects\\my-app-tests",disabled:g}),(0,r.jsx)("button",{onClick:()=>void T(e=>k(e),w),disabled:g,children:l("mirror.browse")}),(0,r.jsx)("button",{className:"primary",onClick:()=>void B(),disabled:g||!b.trim()||!w.trim(),children:l("proj.otherAdd")})]}),(0,r.jsx)("h3",{children:l("proj.affects")}),(0,r.jsxs)("ul",{className:"muted small",style:{margin:0,paddingLeft:20},children:[(0,r.jsx)("li",{children:l("proj.affectsNew")}),(0,r.jsx)("li",{children:l("proj.affectsExisting")}),(0,r.jsx)("li",{children:l("proj.affectsPlan")}),(0,r.jsx)("li",{children:l("proj.affectsNever")})]})]})}function f(e){var l;let{name:t,dir:n,repoOk:s,repoProblem:a,mirror:i,isDefault:d=!1,busy:c,onName:u,onNameBlur:m,onDir:h,onDirBlur:x,onBrowse:j,onRemove:p,removeLabel:v,onFolders:f}=e,{t:y}=(0,o.kj)();return(0,r.jsxs)("div",{className:"panel inner",style:{marginTop:10},children:[(0,r.jsxs)("div",{className:"row",children:[(0,r.jsxs)("div",{style:{width:200},children:[(0,r.jsx)("label",{children:y("proj.entryName")}),(0,r.jsx)("input",{type:"text",value:t,onChange:e=>u(e.target.value),onBlur:m,placeholder:n?null!=(l=n.replace(/[\/]+$/,"").split(/[\/]/).pop())?l:"":y("proj.namePlaceholder"),disabled:c})]}),(0,r.jsxs)("div",{className:"grow",children:[(0,r.jsx)("label",{children:y("proj.entryDir")}),(0,r.jsx)("input",{type:"text",value:n,onChange:e=>h(e.target.value),onBlur:x,placeholder:"C:\\Projects\\my-app",disabled:c})]}),(0,r.jsx)("button",{onClick:j,disabled:c,children:y("mirror.browse")}),p&&(0,r.jsx)("button",{className:"quiet",onClick:p,disabled:c,children:v})]}),(0,r.jsxs)("div",{className:"row small",style:{marginTop:6},children:[d&&(0,r.jsx)("span",{className:"chip",title:y("proj.isDefaultWhy"),children:y("proj.isDefault")}),n&&(0,r.jsx)("span",{className:"badge ".concat(s?"done":""),title:s?y("proj.isRepo"):a,children:y(s?"proj.otherRepo":"proj.otherNotRepo")}),n&&!s&&(0,r.jsx)("span",{className:"muted",children:a||y("proj.notRepoWhy")})]}),n&&(0,r.jsxs)("details",{className:"small",style:{marginTop:8},children:[(0,r.jsx)("summary",{children:y("proj.folders")}),(0,r.jsx)(g,{rootDir:n,value:i,onSave:f,busy:c})]})]})}function g(e){var l,t,s,a;let{rootDir:i,value:c,onSave:m,busy:x}=e,{t:j}=(0,o.kj)(),[v,f]=(0,n.useState)((null!=(l=null==c?void 0:c.includeDirs)?l:[]).join("\n")),[g,y]=(0,n.useState)((null!=(t=null==c?void 0:c.excludeDirs)?t:[]).join("\n")),[b,N]=(0,n.useState)(null==(s=null==c?void 0:c.respectGitignore)||s),[w,k]=(0,n.useState)(null!=(a=null==c?void 0:c.includeEnvFiles)&&a),S=e=>e.split("\n").map(e=>e.trim()).filter(Boolean),[C,D]=(0,n.useState)(""),F=async e=>{let l={includeDirs:S(v),excludeDirs:S(g),respectGitignore:b,includeEnvFiles:w,...e};await m(l),D(j("proj.foldersSaved"))},R=h(F),M=async e=>{(!e||await (0,d.Z)(j("mirror.envWarn")))&&(k(e),F({includeEnvFiles:e}))};return(0,r.jsxs)("div",{style:{marginTop:8},children:[(0,r.jsx)("p",{className:"muted small",children:j("proj.foldersHint")}),(0,r.jsxs)("div",{className:"row",style:{alignItems:"flex-start"},children:[(0,r.jsxs)("div",{className:"grow",children:[(0,r.jsx)("label",{children:j("mirror.include")}),(0,r.jsx)("textarea",{value:v,onChange:e=>{f(e.target.value),R({includeDirs:S(e.target.value),excludeDirs:S(g)})},placeholder:"src\ntests",style:{minHeight:70}})]}),(0,r.jsxs)("div",{className:"grow",children:[(0,r.jsx)("label",{children:j("mirror.exclude")}),(0,r.jsx)("textarea",{value:g,onChange:e=>{y(e.target.value),R({includeDirs:S(v),excludeDirs:S(e.target.value)})},placeholder:"src/generated",style:{minHeight:70}})]})]}),(0,r.jsx)(u.k,{rootDir:i,respectGitignore:b,includeEnvFiles:w,include:S(v),exclude:S(g),onChange:(e,l)=>{f(e.join("\n")),y(l.join("\n")),R({includeDirs:e,excludeDirs:l})}}),(0,r.jsx)("div",{className:"option",children:(0,r.jsxs)("label",{children:[(0,r.jsx)("input",{type:"checkbox",checked:b,onChange:e=>{N(e.target.checked),F({respectGitignore:e.target.checked})}}),(0,r.jsx)("span",{children:j("mirror.gitignore")})]})}),(0,r.jsx)("div",{className:"option".concat(w?" warned":""),children:(0,r.jsxs)("label",{children:[(0,r.jsx)("input",{type:"checkbox",checked:w,onChange:e=>void M(e.target.checked)}),(0,r.jsx)("span",{children:j("mirror.env")})]})}),(0,r.jsx)(p,{msg:x?"":C})]})}function y(){let{t:e}=(0,o.kj)(),[l,t]=(0,n.useState)(null),s=(0,n.useRef)(null),a=(0,n.useRef)(Promise.resolve()),[d,c]=(0,n.useState)(2),[u,m]=(0,n.useState)(60),[j,v]=(0,n.useState)(240),[f,g]=(0,n.useState)("none"),[y,b]=(0,n.useState)("confirm"),[N,w]=(0,n.useState)("ask"),[k,S]=(0,n.useState)(""),[C,D]=(0,n.useState)("");(0,n.useEffect)(()=>{i.FH.settings().then(e=>{var l,r,n,a,i;s.current=e.raw,t(e.raw);let o=null!=(l=e.raw.limits)?l:{};c("number"==typeof o.retryBlockedInFreshChat?o.retryBlockedInFreshChat:2),m("number"==typeof o.maxIterations?o.maxIterations:60),v("number"==typeof o.maxRunMinutes?o.maxRunMinutes:240);let d=null!=(r=e.raw.execution)?r:{};g(null!=(n=d.isolation)?n:"none"),b(null!=(a=d.mode)?a:"confirm"),w(null!=(i=d.networkFetch)?i:"ask")}).catch(e=>D(e.message))},[]);let F=(l,r,n)=>{let o=async()=>{var a;let o=s.current;if(!o)return;let d={...o,[l]:{...null!=(a=o[l])?a:{},[r]:n}};S("");try{await i.FH.saveSettings(d),s.current=d,t(d),S(e("exec.saved")),D("")}catch(e){D(e.message)}},d=a.current.then(o);return a.current=d.catch(()=>void 0),d},R=h(e=>F("limits","retryBlockedInFreshChat",e)),M=h(e=>F("limits","maxIterations",e)),T=h(e=>F("limits","maxRunMinutes",e)),E=(e,l)=>F("execution",e,l);return(0,r.jsxs)("div",{className:"panel",id:"execution",children:[(0,r.jsx)("h2",{children:e("exec.title")}),(0,r.jsx)("p",{className:"muted small",children:e("exec.intro")}),C&&(0,r.jsx)("div",{className:"err",children:C}),(0,r.jsx)("label",{htmlFor:"retry-blocked",children:e("exec.retryBlocked")}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)(x,{id:"retry-blocked",value:d,min:0,max:5,onChange:e=>{c(e),R(e)},disabled:!l}),(0,r.jsx)("span",{className:"muted small",children:e("exec.retryBlockedTimes")})]}),(0,r.jsx)("p",{className:"why",children:e("exec.retryBlockedWhy")}),(0,r.jsx)("label",{htmlFor:"max-iterations",children:e("exec.maxIterations")}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)(x,{id:"max-iterations",value:u,min:5,max:200,onChange:e=>{m(e),M(e)},disabled:!l}),(0,r.jsx)("span",{className:"muted small",children:e("exec.maxIterationsUnit")})]}),(0,r.jsx)("p",{className:"why",children:e("exec.maxIterationsWhy")}),(0,r.jsx)("label",{htmlFor:"max-minutes",children:e("exec.maxRunMinutes")}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)(x,{id:"max-minutes",value:j,min:10,max:1440,onChange:e=>{v(e),T(e)},disabled:!l}),(0,r.jsx)("span",{className:"muted small",children:e("exec.maxRunMinutesUnit")})]}),(0,r.jsx)("p",{className:"why",children:e("exec.maxRunMinutesWhy")}),(0,r.jsx)("label",{htmlFor:"isolation",children:e("exec.isolation")}),(0,r.jsxs)("select",{id:"isolation",value:f,onChange:e=>{let l=e.target.value;g(l),E("isolation",l)},disabled:!l,children:[(0,r.jsx)("option",{value:"none",children:e("exec.isolationNone")}),(0,r.jsx)("option",{value:"none-accepted",children:e("exec.isolationNoneAccepted")}),(0,r.jsx)("option",{value:"separate-account",children:e("exec.isolationAccount")}),(0,r.jsx)("option",{value:"sandbox",children:e("exec.isolationSandbox")}),(0,r.jsx)("option",{value:"vm",children:e("exec.isolationVm")})]}),(0,r.jsx)("p",{className:"why",children:e("exec.isolationWhy")}),(0,r.jsx)("label",{htmlFor:"start-mode",children:e("exec.startMode")}),(0,r.jsxs)("select",{id:"start-mode",value:y,onChange:e=>{let l=e.target.value;b(l),E("mode",l)},disabled:!l,children:[(0,r.jsx)("option",{value:"confirm",children:e("exec.startModeAsk")}),(0,r.jsx)("option",{value:"unattended",children:e("exec.startModeAuto")})]}),(0,r.jsx)("p",{className:"why",children:e("exec.startModeWhy")}),(0,r.jsx)("label",{htmlFor:"network-fetch",children:e("exec.networkFetch")}),(0,r.jsxs)("select",{id:"network-fetch",value:N,onChange:e=>{let l=e.target.value;w(l),E("networkFetch",l)},disabled:!l,children:[(0,r.jsx)("option",{value:"ask",children:e("exec.networkFetchAsk")}),(0,r.jsx)("option",{value:"refuse",children:e("exec.networkFetchRefuse")}),(0,r.jsx)("option",{value:"run",children:e("exec.networkFetchRun")})]}),(0,r.jsx)(p,{msg:k}),(0,r.jsx)("p",{className:"why",children:e("exec.networkFetchWhy")})]})}function b(e){var l;let{catalogue:t,setCatalogue:s,refreshModels:a,refreshing:d,refreshMsg:u}=e,{t:m}=(0,o.kj)(),h=(0,o.W3)(),[x,j]=(0,n.useState)(""),[v,f]=(0,n.useState)(""),[g,y]=(0,n.useState)(!1),b=null!=(l=null==t?void 0:t.defaultModel)?l:"",N=async e=>{y(!0),j("");try{let l=await i.FH.setDefaultModel(e);t&&s({...t,defaultModel:l.defaultModel}),j(l.defaultModel?m("def.modelSaved",{name:l.defaultModel}):m("def.modelCleared")),f("")}catch(e){f(e.message)}finally{y(!1)}};return(0,r.jsxs)("div",{className:"panel",id:"model",children:[(0,r.jsx)("h2",{children:m("def.modelTitle")}),(0,r.jsx)("p",{className:"muted small",children:m("def.modelIntro")}),v&&(0,r.jsx)("div",{className:"err",children:v}),(0,r.jsx)("label",{htmlFor:"default-model",children:m("def.modelField")}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)(c.Y,{id:"default-model",chosen:b,onChange:e=>void N(e),none:m("def.modelNone"),catalogue:t,disabled:g||d}),(0,r.jsx)("button",{className:"quiet",onClick:()=>void N(""),disabled:g||!b,children:m("proj.clear")}),(0,r.jsx)("button",{onClick:()=>void a(),disabled:g||d,children:m("model.refresh")})]}),(0,r.jsx)(p,{msg:x||u}),(0,r.jsx)("p",{className:"muted small",style:{marginTop:8},children:(null==t?void 0:t.readAt)?m("model.readAt",{t:h(t.readAt),n:t.options.length}):m("model.neverRead")}),(0,r.jsx)("h3",{children:m("proj.affects")}),(0,r.jsxs)("ul",{className:"muted small",style:{margin:0,paddingLeft:20},children:[(0,r.jsx)("li",{children:m("def.modelAffectsNew")}),(0,r.jsx)("li",{children:m("def.modelAffectsExisting")}),(0,r.jsx)("li",{children:m("def.modelAffectsBatch")})]})]})}function N(e){var l,t;let{catalogue:s,setCatalogue:d,refreshModels:u,refreshing:m,refreshMsg:h}=e,{t:x}=(0,o.kj)(),[j,v]=(0,n.useState)(""),[f,g]=(0,n.useState)(""),[y,b]=(0,n.useState)(!1),N=null!=(l=null==s?void 0:s.defaultReviewModel)?l:"",w=async e=>{b(!0),v("");try{let l=await i.FH.setDefaultReviewModel(e);s&&d({...s,defaultReviewModel:l.defaultReviewModel}),v(l.defaultReviewModel?x("def.reviewSaved",{name:l.defaultReviewModel}):x("def.reviewCleared")),g("")}catch(e){g(e.message)}finally{b(!1)}},k=""!==N&&N===(null!=(t=null==s?void 0:s.defaultModel)?t:"");return(0,r.jsxs)("div",{className:"panel",id:"review",children:[(0,r.jsx)("h2",{children:x("def.reviewTitle")}),(0,r.jsx)("p",{className:"muted small",children:x("def.reviewIntro")}),f&&(0,r.jsx)("div",{className:"err",children:f}),(0,r.jsx)("label",{htmlFor:"default-review-model",children:x("def.reviewField")}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)(c.Y,{id:"default-review-model",chosen:N,onChange:e=>void w(e),none:x("def.reviewNone"),catalogue:s,disabled:y||m}),(0,r.jsx)("button",{className:"quiet",onClick:()=>void w(""),disabled:y||!N,children:x("proj.clear")}),(0,r.jsx)("button",{onClick:()=>void u(),disabled:y||m,children:x("model.refresh")})]}),k&&(0,r.jsx)("p",{className:"why",style:{color:"var(--warn)"},children:x("def.reviewSame")}),(0,r.jsx)(p,{msg:j||h}),(0,r.jsx)("h3",{children:x("proj.affects")}),(0,r.jsxs)("ul",{className:"muted small",style:{margin:0,paddingLeft:20},children:[(0,r.jsx)("li",{children:x("def.reviewAffectsNew")}),(0,r.jsx)("li",{children:x("def.reviewAffectsExisting")}),(0,r.jsx)("li",{children:x("def.reviewAffectsBatch")})]}),(0,r.jsxs)("div",{className:"row",style:{marginTop:12},children:[(0,r.jsx)(a(),{href:"/",children:(0,r.jsx)("button",{children:x("proj.toSessions")})}),(0,r.jsx)(a(),{href:"/import",children:(0,r.jsx)("button",{className:"quiet",children:x("proj.toImport")})})]})]})}},4784:(e,l,t)=>{"use strict";t.d(l,{Y:()=>i});var r=t(3365),n=t(1521),s=t(5549),a=t(867);function i(e){var l,t;let{id:i,chosen:o,onChange:d,none:c,catalogue:u,disabled:m=!1,style:h}=e,{t:x}=(0,a.kj)(),j=function(e){let[l,t]=(0,n.useState)(null);return(0,n.useEffect)(()=>{if(void 0!==e)return;let l=!0;return s.FH.models().then(e=>{l&&t(e)}).catch(()=>void 0),()=>{l=!1}},[e]),void 0!==e?e:l}(u),p=null!=(l=null==j?void 0:j.options)?l:[],v=p.some(e=>e.name===o),f=p.filter(e=>!e.group),g=new Map;for(let e of p)e.group&&g.set(e.group,[...null!=(t=g.get(e.group))?t:[],e]);return(0,r.jsxs)("select",{id:i,value:o,onChange:e=>d(e.target.value),disabled:m,style:{width:"auto",minWidth:280,...h},children:[(0,r.jsx)("option",{value:"",children:c}),o&&!v&&(0,r.jsx)("option",{value:o,children:x("model.notInList",{name:o})}),f.map(e=>(0,r.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(x("model.unavailable")):""]},e.name)),[...g.entries()].map(e=>{let[l,t]=e;return(0,r.jsx)("optgroup",{label:l,children:t.map(e=>(0,r.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(x("model.unavailable")):""]},e.name))},l)})]})}}},e=>{e.O(0,[197,867,549,347,131,358],()=>e(e.s=1896)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[189],{1035:(e,l,t)=>{"use strict";t.d(l,{DialogHost:()=>d,Z:()=>o});var r=t(3365),n=t(1521),s=t(867);let a=null,i=[];function o(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(t=>{var r;return r={kind:"confirm",message:e,...l,resolve:t},void(a?a(r):i.push(r))})}function d(e){var l,t;let{children:o}=e,{t:d}=(0,s.kj)(),[c,u]=(0,n.useState)([]),m=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(a=e=>u(l=>[...l,e]),i.length>0){let e=i.splice(0,i.length);u(l=>[...l,...e])}return()=>{a=null}},[]);let h=c[0],x=(0,n.useCallback)(e=>{h&&(h.resolve(e),u(e=>e.slice(1)))},[h]);return(0,n.useEffect)(()=>{var e;if(!h)return;null==(e=m.current)||e.focus();let l=e=>{"Escape"===e.key&&(e.preventDefault(),x(!1))};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[h,x]),(0,r.jsxs)(r.Fragment,{children:[o,h&&(0,r.jsx)("div",{className:"modal-backdrop",onClick:()=>x(!1),role:"presentation",children:(0,r.jsxs)("div",{className:"modal".concat(h.danger?" danger":""),role:"confirm"===h.kind?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":"modal-title",onClick:e=>e.stopPropagation(),children:[(0,r.jsx)("h2",{id:"modal-title",children:null!=(l=h.title)?l:d("confirm"===h.kind?"dialog.confirmTitle":"dialog.noticeTitle")}),(0,r.jsx)("div",{className:"modal-body",children:h.message}),(0,r.jsxs)("div",{className:"row modal-actions",children:["confirm"===h.kind&&(0,r.jsx)("button",{type:"button",className:"quiet",onClick:()=>x(!1),children:d("dialog.cancel")}),(0,r.jsx)("button",{ref:m,type:"button",className:h.danger?"danger":"primary",onClick:()=>x(!0),children:null!=(t=h.okLabel)?t:d("dialog.ok")})]})]})})]})}},1896:(e,l,t)=>{Promise.resolve().then(t.bind(t,3197))},2244:(e,l,t)=>{"use strict";t.d(l,{k:()=>c});var r=t(3365),n=t(1521),s=t(5549),a=t(867);function i(e){return e.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/+$/,"")}function o(e,l){return"."===l||""===l||e===l||e.startsWith("".concat(l,"/"))}function d(e,l,t){return t.includes(e)?"out":t.some(l=>l!==e&&o(e,l))?"out-inherited":l.includes(e)?"in":l.some(l=>l!==e&&o(e,l))?"inherited":"none"}function c(e){let{rootDir:l,respectGitignore:t,includeEnvFiles:c,include:u,exclude:m,onChange:h}=e,{t:x}=(0,a.kj)(),[p,j]=(0,n.useState)(null),[v,f]=(0,n.useState)(""),[g,y]=(0,n.useState)(new Set),[b,N]=(0,n.useState)(""),w=async()=>{if(l.trim()){f("");try{let e=await s.FH.dirs(l,t);j(e),N("".concat(l,"|").concat(t)),y(new Set(e.filter(e=>!e.includes("/"))))}catch(e){f(e.message)}}};(0,n.useEffect)(()=>{j(null),N("")},[l,t]);let k=(0,n.useMemo)(()=>(function(e){let l=[],t=new Map;for(let n of[...e].sort()){var r;let e={path:n,name:null!=(r=n.split("/").pop())?r:n,children:[]};t.set(n,e);let s=n.includes("/")?t.get(n.slice(0,n.lastIndexOf("/"))):void 0;(s?s.children:l).push(e)}return l})(null!=p?p:[]),[p]),S=u.map(i).filter(Boolean),C=m.map(i).filter(Boolean),D=e=>(0,r.jsx)("ul",{className:"dir-tree",children:e.map(e=>{let l=d(e.path,S,C),t=g.has(e.path),n=function(e,l,t){let r=l=>l.filter(l=>l!==e&&o(l,e)).length;return{included:r(l),excluded:r(t)}}(e.path,S,C),s=!t&&e.children.length>0&&(n.included>0||n.excluded>0);return(0,r.jsxs)("li",{className:"dir ".concat(l),children:[(0,r.jsxs)("div",{className:"dir-row",children:[e.children.length>0?(0,r.jsx)("button",{type:"button",className:"dir-flip",onClick:()=>{let l;return l=e.path,y(e=>{let t=new Set(e);return t.has(l)?t.delete(l):t.add(l),t})},"aria-label":t?x("tree.fold"):x("tree.unfold"),"aria-expanded":t,children:t?"▾":"▸"}):(0,r.jsx)("span",{className:"dir-flip","aria-hidden":"true"}),(0,r.jsxs)("button",{type:"button",className:"dir-name",onClick:()=>(e=>{if("in"===d(e,S,C))return void h(S.filter(l=>l!==e),C);h([...S.filter(l=>!o(l,e)),e],C.filter(l=>!o(l,e)))})(e.path),title:"in"===l?x("tree.stateIn"):"inherited"===l?x("tree.stateInherited"):"out"===l?x("tree.stateOut"):"out-inherited"===l?x("tree.stateOutInherited"):x("tree.stateNone"),"aria-pressed":"in"===l||"inherited"===l,children:[(0,r.jsx)("span",{className:"dir-mark","aria-hidden":"true",children:"in"===l?"✓":"inherited"===l?"\xb7":"out"===l||"out-inherited"===l?"\xd7":""}),e.name]}),(0,r.jsx)("button",{type:"button",className:"dir-out".concat("out"===l?" on":""),onClick:()=>(e=>{if(C.includes(e))return void h(S,C.filter(l=>l!==e));h(S.filter(l=>l!==e&&!o(l,e)),[...C.filter(l=>!o(l,e)),e])})(e.path),title:"out"===l?x("tree.unexclude"):x("tree.exclude"),children:"−"}),s&&(0,r.jsx)("span",{className:"chip inside".concat(n.excluded>0?" out":""),title:x("tree.insideWhy"),children:n.excluded>0&&n.included>0?x("tree.insideBoth",{i:n.included,e:n.excluded}):n.excluded>0?x("tree.insideOut",{n:n.excluded}):x("tree.insideIn",{n:n.included})})]}),t&&e.children.length>0&&D(e.children)]},e.path)})}),F=b!=="".concat(l,"|").concat(t);return(0,r.jsxs)("div",{className:"dir-tree-box",children:[(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("button",{type:"button",onClick:()=>void w(),disabled:!l.trim(),children:null===p||F?x("tree.load"):x("tree.reload")}),(0,r.jsx)("span",{className:"muted small",children:x("tree.hint")})]}),v&&(0,r.jsx)("div",{className:"err small",children:v}),(0,r.jsxs)("p",{className:"muted small",style:{marginTop:6},children:[x("tree.alsoOut")," ",[t?x("tree.alsoGitignore"):null,!1===c?x("tree.alsoEnv"):null,x("tree.alsoAlways")].filter(Boolean).join(" \xb7 ")]}),null!==p&&!F&&(0===p.length?(0,r.jsx)("p",{className:"muted small",children:x("mirror.noDirs")}):D(k))]})}},3197:(e,l,t)=>{"use strict";t.r(l),t.d(l,{default:()=>m});var r=t(3365),n=t(1521),s=t(8197),a=t.n(s),i=t(5549),o=t(867),d=t(1035),c=t(4784),u=t(2244);function m(){let{t:e}=(0,o.kj)(),[l,t]=(0,n.useState)(null),[s,a]=(0,n.useState)(!1),[c,u]=(0,n.useState)("");(0,n.useEffect)(()=>{i.FH.models().then(t).catch(()=>void 0)},[]);let m=async()=>{if(await (0,d.Z)(e("model.refreshConfirm"))){a(!0),u(e("model.refreshing"));try{var l;let r=await i.FH.models().then(()=>i.FH.refreshModels());t(r),u(0===r.options.length?null!=(l=r.note)?l:e("model.none"):e("model.refreshed",{n:r.options.length}))}catch(e){u(e.message)}finally{a(!1)}}},h={catalogue:l,setCatalogue:t,refreshModels:m,refreshing:s,refreshMsg:c};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"panel",children:[(0,r.jsx)("h2",{children:e("def.title")}),(0,r.jsx)("p",{className:"muted small",children:e("def.intro")}),(0,r.jsx)("p",{className:"why",children:e("def.autoSave")})]}),(0,r.jsx)(v,{}),(0,r.jsx)(b,{...h}),(0,r.jsx)(N,{...h}),(0,r.jsx)(y,{})]})}function h(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:900,t=(0,n.useRef)(null),r=(0,n.useRef)(null),s=(0,n.useRef)(e);return s.current=e,(0,n.useEffect)(()=>()=>{t.current&&clearTimeout(t.current),r.current&&s.current(r.current.value)},[]),e=>{t.current&&clearTimeout(t.current),r.current={value:e},t.current=setTimeout(()=>{r.current=null,s.current(e)},l)}}function x(e){let{id:l,value:t,min:s,max:a,onChange:i,disabled:o}=e,[d,c]=(0,n.useState)(String(t));return(0,n.useEffect)(()=>c(e=>p(e)===t?e:String(t)),[t]),(0,r.jsx)("input",{id:l,type:"number",min:s,max:a,step:1,value:d,onChange:e=>{c(e.target.value);let l=p(e.target.value);null!==l&&l>=s&&l<=a&&i(l)},onBlur:()=>{let e=p(d),l=null===e?t:Math.max(s,Math.min(a,e));c(String(l)),l!==t&&i(l)},style:{width:90},disabled:o})}function p(e){if(""===e.trim())return null;let l=Number(e);return Number.isInteger(l)?l:null}function j(e){let{msg:l,onSave:t}=e,{t:n}=(0,o.kj)();return(0,r.jsxs)("div",{className:"row",style:{marginTop:6},children:[t&&(0,r.jsx)("button",{className:"quiet",onClick:t,title:n("def.saveAnywayWhy"),children:n("def.saveAnyway")}),(0,r.jsx)("span",{className:"muted small",role:"status",children:l||n("def.savedAutomatically")})]})}function v(){var e;let{t:l}=(0,o.kj)(),[t,s]=(0,n.useState)(null),[a,d]=(0,n.useState)(""),[c,u]=(0,n.useState)(""),[m,x]=(0,n.useState)(""),[p,v]=(0,n.useState)(""),[g,y]=(0,n.useState)(!1),[b,N]=(0,n.useState)(""),[w,k]=(0,n.useState)(""),S=(0,n.useCallback)(async()=>{try{let e=await i.FH.project();s(e),d(e.rootDir),u(e.name),v("")}catch(e){v(e.message)}},[]);(0,n.useEffect)(()=>{S()},[S]);let C=async(e,l)=>{y(!0),x("");try{let t=await i.FH.setProject(e);return s(t),d(t.rootDir),x(l(t)),v(""),!0}catch(e){return v(e.message),!1}finally{y(!1)}},D=e=>C({rootDir:e},e=>e.rootDir?l("proj.saved",{dir:e.rootDir}):l("proj.cleared")),F=e=>C({name:e},()=>l("proj.nameSaved")),T=h(D),R=h(F),M=async(e,l)=>{y(!0);try{var t;let r=await i.FH.browseFolder(l.trim()||void 0);r.ok?e(r.path):r.cancelled||v(null!=(t=r.reason)?t:"")}finally{y(!1)}},E=null!=(e=null==t?void 0:t.others)?e:[],I=e=>e.map(e=>({name:e.name,rootDir:e.rootDir,...e.mirror?{mirror:e.mirror}:{}})),B=async()=>{await C({others:[...I(E),{name:b.trim(),rootDir:w.trim()}]},e=>l("proj.othersSaved",{n:e.others.length}))&&(N(""),k(""))};return(0,r.jsxs)("div",{className:"panel",id:"project",children:[(0,r.jsx)("h2",{children:l("proj.title")}),(0,r.jsx)("p",{className:"muted small",children:l("proj.intro")}),p&&(0,r.jsx)("div",{className:"err",children:p}),t&&(0,r.jsxs)("div",{className:"option".concat(t.mirrorToDesktop?" warned":""),style:{marginBottom:12},children:[(0,r.jsxs)("label",{children:[(0,r.jsx)("input",{type:"checkbox",checked:t.mirrorToDesktop,onChange:e=>{C({mirrorToDesktop:e.target.checked},e=>e.mirrorToDesktop?l("proj.mirrorOn",{root:e.contextRoot}):l("proj.mirrorOff"))},disabled:g}),(0,r.jsx)("span",{children:l("proj.mirrorToDesktop")})]}),(0,r.jsx)("p",{className:"why",children:l("proj.mirrorToDesktopWhy",{root:t.contextRoot})})]}),(0,r.jsx)("p",{className:"muted small",children:l("proj.listIntro")}),(0,r.jsx)(f,{name:c,dir:a,repoOk:!!(null==t?void 0:t.repoOk),repoProblem:null==t?void 0:t.repoProblem,mirror:null==t?void 0:t.mirror,isDefault:!0,busy:g,onName:e=>{u(e),R(e)},onNameBlur:()=>void F(c),onDir:e=>{d(e),T(e)},onDirBlur:()=>void D(a),onBrowse:()=>void M(e=>void D(e),a),onRemove:(null==t?void 0:t.rootDir)?()=>void D(""):void 0,removeLabel:l("proj.clear"),onFolders:e=>C({mirror:e},()=>l("proj.foldersSaved"))}),(0,r.jsx)(j,{msg:m}),t&&!t.rootDir&&(0,r.jsx)("p",{className:"muted small",style:{marginTop:8},children:l("proj.none")}),E.map(e=>(0,r.jsx)(f,{name:e.name,dir:e.rootDir,repoOk:e.repoOk,repoProblem:e.repoProblem,mirror:e.mirror,busy:g,onName:t=>void C({others:I(E.map(l=>l.name===e.name?{...l,name:t}:l))},()=>l("proj.nameSaved")),onDir:t=>void C({others:I(E.map(l=>l.name===e.name?{...l,rootDir:t}:l))},()=>l("proj.othersSaved",{n:E.length})),onBrowse:()=>void M(t=>void C({others:I(E.map(l=>l.name===e.name?{...l,rootDir:t}:l))},()=>l("proj.othersSaved",{n:E.length})),e.rootDir),onRemove:()=>{let t;t=e.name,C({others:I(E.filter(e=>e.name!==t))},e=>l("proj.othersSaved",{n:e.others.length}))},removeLabel:l("proj.otherRemove"),onFolders:t=>{let r;return r=e.name,C({others:I(E.map(e=>e.name===r?{...e,mirror:t}:e))},()=>l("proj.foldersSaved"))}},e.name)),(0,r.jsx)("h3",{id:"others",children:l("proj.addTitle")}),(0,r.jsx)("p",{className:"muted small",children:l("proj.othersIntro")}),(0,r.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,r.jsx)("input",{type:"text","aria-label":l("proj.entryName"),value:b,onChange:e=>N(e.target.value),placeholder:l("proj.entryName"),disabled:g,style:{width:160}}),(0,r.jsx)("input",{type:"text",className:"grow","aria-label":l("proj.entryDir"),value:w,onChange:e=>k(e.target.value),placeholder:"C:\\Projects\\my-app-tests",disabled:g}),(0,r.jsx)("button",{onClick:()=>void M(e=>k(e),w),disabled:g,children:l("mirror.browse")}),(0,r.jsx)("button",{className:"primary",onClick:()=>void B(),disabled:g||!b.trim()||!w.trim(),children:l("proj.otherAdd")})]}),(0,r.jsx)("h3",{children:l("proj.affects")}),(0,r.jsxs)("ul",{className:"muted small",style:{margin:0,paddingLeft:20},children:[(0,r.jsx)("li",{children:l("proj.affectsNew")}),(0,r.jsx)("li",{children:l("proj.affectsExisting")}),(0,r.jsx)("li",{children:l("proj.affectsPlan")}),(0,r.jsx)("li",{children:l("proj.affectsNever")})]})]})}function f(e){var l;let{name:t,dir:n,repoOk:s,repoProblem:a,mirror:i,isDefault:d=!1,busy:c,onName:u,onNameBlur:m,onDir:h,onDirBlur:x,onBrowse:p,onRemove:j,removeLabel:v,onFolders:f}=e,{t:y}=(0,o.kj)();return(0,r.jsxs)("div",{className:"panel inner",style:{marginTop:10},children:[(0,r.jsxs)("div",{className:"row",children:[(0,r.jsxs)("div",{style:{width:200},children:[(0,r.jsx)("label",{children:y("proj.entryName")}),(0,r.jsx)("input",{type:"text",value:t,onChange:e=>u(e.target.value),onBlur:m,placeholder:n?null!=(l=n.replace(/[\/]+$/,"").split(/[\/]/).pop())?l:"":y("proj.namePlaceholder"),disabled:c})]}),(0,r.jsxs)("div",{className:"grow",children:[(0,r.jsx)("label",{children:y("proj.entryDir")}),(0,r.jsx)("input",{type:"text",value:n,onChange:e=>h(e.target.value),onBlur:x,placeholder:"C:\\Projects\\my-app",disabled:c})]}),(0,r.jsx)("button",{onClick:p,disabled:c,children:y("mirror.browse")}),j&&(0,r.jsx)("button",{className:"quiet",onClick:j,disabled:c,children:v})]}),(0,r.jsxs)("div",{className:"row small",style:{marginTop:6},children:[d&&(0,r.jsx)("span",{className:"chip",title:y("proj.isDefaultWhy"),children:y("proj.isDefault")}),n&&(0,r.jsx)("span",{className:"badge ".concat(s?"done":""),title:s?y("proj.isRepo"):a,children:y(s?"proj.otherRepo":"proj.otherNotRepo")}),n&&!s&&(0,r.jsx)("span",{className:"muted",children:a||y("proj.notRepoWhy")})]}),n&&(0,r.jsxs)("details",{className:"small",style:{marginTop:8},children:[(0,r.jsx)("summary",{children:y("proj.folders")}),(0,r.jsx)(g,{rootDir:n,value:i,onSave:f,busy:c})]})]})}function g(e){var l,t,s,a;let{rootDir:i,value:c,onSave:m,busy:x}=e,{t:p}=(0,o.kj)(),[v,f]=(0,n.useState)((null!=(l=null==c?void 0:c.includeDirs)?l:[]).join("\n")),[g,y]=(0,n.useState)((null!=(t=null==c?void 0:c.excludeDirs)?t:[]).join("\n")),[b,N]=(0,n.useState)(null==(s=null==c?void 0:c.respectGitignore)||s),[w,k]=(0,n.useState)(null!=(a=null==c?void 0:c.includeEnvFiles)&&a),S=e=>e.split("\n").map(e=>e.trim()).filter(Boolean),[C,D]=(0,n.useState)(""),F=async e=>{let l={includeDirs:S(v),excludeDirs:S(g),respectGitignore:b,includeEnvFiles:w,...e};await m(l),D(p("proj.foldersSaved"))},T=h(F),R=async e=>{(!e||await (0,d.Z)(p("mirror.envWarn")))&&(k(e),F({includeEnvFiles:e}))};return(0,r.jsxs)("div",{style:{marginTop:8},children:[(0,r.jsx)("p",{className:"muted small",children:p("proj.foldersHint")}),(0,r.jsxs)("div",{className:"row",style:{alignItems:"flex-start"},children:[(0,r.jsxs)("div",{className:"grow",children:[(0,r.jsx)("label",{children:p("mirror.include")}),(0,r.jsx)("textarea",{value:v,onChange:e=>{f(e.target.value),T({includeDirs:S(e.target.value),excludeDirs:S(g)})},placeholder:"src\ntests",style:{minHeight:70}})]}),(0,r.jsxs)("div",{className:"grow",children:[(0,r.jsx)("label",{children:p("mirror.exclude")}),(0,r.jsx)("textarea",{value:g,onChange:e=>{y(e.target.value),T({includeDirs:S(v),excludeDirs:S(e.target.value)})},placeholder:"src/generated",style:{minHeight:70}})]})]}),(0,r.jsx)(u.k,{rootDir:i,respectGitignore:b,includeEnvFiles:w,include:S(v),exclude:S(g),onChange:(e,l)=>{f(e.join("\n")),y(l.join("\n")),T({includeDirs:e,excludeDirs:l})}}),(0,r.jsx)("div",{className:"option",children:(0,r.jsxs)("label",{children:[(0,r.jsx)("input",{type:"checkbox",checked:b,onChange:e=>{N(e.target.checked),F({respectGitignore:e.target.checked})}}),(0,r.jsx)("span",{children:p("mirror.gitignore")})]})}),(0,r.jsx)("div",{className:"option".concat(w?" warned":""),children:(0,r.jsxs)("label",{children:[(0,r.jsx)("input",{type:"checkbox",checked:w,onChange:e=>void R(e.target.checked)}),(0,r.jsx)("span",{children:p("mirror.env")})]})}),(0,r.jsx)(j,{msg:x?"":C})]})}function y(){let{t:e}=(0,o.kj)(),[l,t]=(0,n.useState)(null),s=(0,n.useRef)(null),a=(0,n.useRef)(Promise.resolve()),[d,c]=(0,n.useState)(2),[u,m]=(0,n.useState)(60),[p,v]=(0,n.useState)(240),[f,g]=(0,n.useState)(900),[y,b]=(0,n.useState)("none"),[N,w]=(0,n.useState)("confirm"),[k,S]=(0,n.useState)("ask"),[C,D]=(0,n.useState)(""),[F,T]=(0,n.useState)("");(0,n.useEffect)(()=>{i.FH.settings().then(e=>{var l,r,n,a,i,o;s.current=e.raw,t(e.raw);let d=null!=(l=e.raw.limits)?l:{};c("number"==typeof d.retryBlockedInFreshChat?d.retryBlockedInFreshChat:2),m("number"==typeof d.maxIterations?d.maxIterations:60),v("number"==typeof d.maxRunMinutes?d.maxRunMinutes:240);let u=null!=(r=e.raw.copilot)?r:{};g("number"==typeof u.replyTimeoutSec?u.replyTimeoutSec:900);let h=null!=(n=e.raw.execution)?n:{};b(null!=(a=h.isolation)?a:"none"),w(null!=(i=h.mode)?i:"confirm"),S(null!=(o=h.networkFetch)?o:"ask")}).catch(e=>T(e.message))},[]);let R=(l,r,n)=>{let o=async()=>{var a;if(!s.current)return;let o=await i.FH.settings().then(e=>e.raw).catch(()=>s.current),d={...o,[l]:{...null!=(a=o[l])?a:{},[r]:n}};D("");try{await i.FH.saveSettings(d),s.current=d,t(d),D(e("exec.saved")),T("")}catch(e){T(e.message)}},d=a.current.then(o);return a.current=d.catch(()=>void 0),d},M=h(e=>R("limits","retryBlockedInFreshChat",e)),E=h(e=>R("limits","maxIterations",e)),I=h(e=>R("limits","maxRunMinutes",e)),B=h(e=>R("copilot","replyTimeoutSec",e)),A=(e,l)=>R("execution",e,l);return(0,r.jsxs)("div",{className:"panel",id:"execution",children:[(0,r.jsx)("h2",{children:e("exec.title")}),(0,r.jsx)("p",{className:"muted small",children:e("exec.intro")}),F&&(0,r.jsx)("div",{className:"err",children:F}),(0,r.jsx)("label",{htmlFor:"retry-blocked",children:e("exec.retryBlocked")}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)(x,{id:"retry-blocked",value:d,min:0,max:5,onChange:e=>{c(e),M(e)},disabled:!l}),(0,r.jsx)("span",{className:"muted small",children:e("exec.retryBlockedTimes")})]}),(0,r.jsx)("p",{className:"why",children:e("exec.retryBlockedWhy")}),(0,r.jsx)("label",{htmlFor:"max-iterations",children:e("exec.maxIterations")}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)(x,{id:"max-iterations",value:u,min:5,max:200,onChange:e=>{m(e),E(e)},disabled:!l}),(0,r.jsx)("span",{className:"muted small",children:e("exec.maxIterationsUnit")})]}),(0,r.jsx)("p",{className:"why",children:e("exec.maxIterationsWhy")}),(0,r.jsx)("label",{htmlFor:"max-minutes",children:e("exec.maxRunMinutes")}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)(x,{id:"max-minutes",value:p,min:10,max:1440,onChange:e=>{v(e),I(e)},disabled:!l}),(0,r.jsx)("span",{className:"muted small",children:e("exec.maxRunMinutesUnit")})]}),(0,r.jsx)("p",{className:"why",children:e("exec.maxRunMinutesWhy")}),(0,r.jsx)("label",{htmlFor:"reply-timeout",children:e("exec.replyTimeout")}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)(x,{id:"reply-timeout",value:f,min:60,max:10800,onChange:e=>{g(e),B(e)},disabled:!l}),(0,r.jsx)("span",{className:"muted small",children:e("exec.replyTimeoutUnit")})]}),(0,r.jsx)("p",{className:"why",children:e("exec.replyTimeoutWhy")}),(0,r.jsx)("label",{htmlFor:"isolation",children:e("exec.isolation")}),(0,r.jsxs)("select",{id:"isolation",value:y,onChange:e=>{let l=e.target.value;b(l),A("isolation",l)},disabled:!l,children:[(0,r.jsx)("option",{value:"none",children:e("exec.isolationNone")}),(0,r.jsx)("option",{value:"none-accepted",children:e("exec.isolationNoneAccepted")}),(0,r.jsx)("option",{value:"separate-account",children:e("exec.isolationAccount")}),(0,r.jsx)("option",{value:"sandbox",children:e("exec.isolationSandbox")}),(0,r.jsx)("option",{value:"vm",children:e("exec.isolationVm")})]}),(0,r.jsx)("p",{className:"why",children:e("exec.isolationWhy")}),(0,r.jsx)("label",{htmlFor:"start-mode",children:e("exec.startMode")}),(0,r.jsxs)("select",{id:"start-mode",value:N,onChange:e=>{let l=e.target.value;w(l),A("mode",l)},disabled:!l,children:[(0,r.jsx)("option",{value:"confirm",children:e("exec.startModeAsk")}),(0,r.jsx)("option",{value:"unattended",children:e("exec.startModeAuto")})]}),(0,r.jsx)("p",{className:"why",children:e("exec.startModeWhy")}),(0,r.jsx)("label",{htmlFor:"network-fetch",children:e("exec.networkFetch")}),(0,r.jsxs)("select",{id:"network-fetch",value:k,onChange:e=>{let l=e.target.value;S(l),A("networkFetch",l)},disabled:!l,children:[(0,r.jsx)("option",{value:"ask",children:e("exec.networkFetchAsk")}),(0,r.jsx)("option",{value:"refuse",children:e("exec.networkFetchRefuse")}),(0,r.jsx)("option",{value:"run",children:e("exec.networkFetchRun")})]}),(0,r.jsx)(j,{msg:C}),(0,r.jsx)("p",{className:"why",children:e("exec.networkFetchWhy")})]})}function b(e){var l;let{catalogue:t,setCatalogue:s,refreshModels:a,refreshing:d,refreshMsg:u}=e,{t:m}=(0,o.kj)(),h=(0,o.W3)(),[x,p]=(0,n.useState)(""),[v,f]=(0,n.useState)(""),[g,y]=(0,n.useState)(!1),b=null!=(l=null==t?void 0:t.defaultModel)?l:"",N=async e=>{y(!0),p("");try{let l=await i.FH.setDefaultModel(e);t&&s({...t,defaultModel:l.defaultModel}),p(l.defaultModel?m("def.modelSaved",{name:l.defaultModel}):m("def.modelCleared")),f("")}catch(e){f(e.message)}finally{y(!1)}};return(0,r.jsxs)("div",{className:"panel",id:"model",children:[(0,r.jsx)("h2",{children:m("def.modelTitle")}),(0,r.jsx)("p",{className:"muted small",children:m("def.modelIntro")}),v&&(0,r.jsx)("div",{className:"err",children:v}),(0,r.jsx)("label",{htmlFor:"default-model",children:m("def.modelField")}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)(c.Y,{id:"default-model",chosen:b,onChange:e=>void N(e),none:m("def.modelNone"),catalogue:t,disabled:g||d}),(0,r.jsx)("button",{className:"quiet",onClick:()=>void N(""),disabled:g||!b,children:m("proj.clear")}),(0,r.jsx)("button",{onClick:()=>void a(),disabled:g||d,children:m("model.refresh")})]}),(0,r.jsx)(j,{msg:x||u}),(0,r.jsx)("p",{className:"muted small",style:{marginTop:8},children:(null==t?void 0:t.readAt)?m("model.readAt",{t:h(t.readAt),n:t.options.length}):m("model.neverRead")}),(0,r.jsx)("h3",{children:m("proj.affects")}),(0,r.jsxs)("ul",{className:"muted small",style:{margin:0,paddingLeft:20},children:[(0,r.jsx)("li",{children:m("def.modelAffectsNew")}),(0,r.jsx)("li",{children:m("def.modelAffectsExisting")}),(0,r.jsx)("li",{children:m("def.modelAffectsBatch")})]})]})}function N(e){var l,t;let{catalogue:s,setCatalogue:d,refreshModels:u,refreshing:m,refreshMsg:h}=e,{t:x}=(0,o.kj)(),[p,v]=(0,n.useState)(""),[f,g]=(0,n.useState)(""),[y,b]=(0,n.useState)(!1),N=null!=(l=null==s?void 0:s.defaultReviewModel)?l:"",w=async e=>{b(!0),v("");try{let l=await i.FH.setDefaultReviewModel(e);s&&d({...s,defaultReviewModel:l.defaultReviewModel}),v(l.defaultReviewModel?x("def.reviewSaved",{name:l.defaultReviewModel}):x("def.reviewCleared")),g("")}catch(e){g(e.message)}finally{b(!1)}},k=""!==N&&N===(null!=(t=null==s?void 0:s.defaultModel)?t:"");return(0,r.jsxs)("div",{className:"panel",id:"review",children:[(0,r.jsx)("h2",{children:x("def.reviewTitle")}),(0,r.jsx)("p",{className:"muted small",children:x("def.reviewIntro")}),f&&(0,r.jsx)("div",{className:"err",children:f}),(0,r.jsx)("label",{htmlFor:"default-review-model",children:x("def.reviewField")}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)(c.Y,{id:"default-review-model",chosen:N,onChange:e=>void w(e),none:x("def.reviewNone"),catalogue:s,disabled:y||m}),(0,r.jsx)("button",{className:"quiet",onClick:()=>void w(""),disabled:y||!N,children:x("proj.clear")}),(0,r.jsx)("button",{onClick:()=>void u(),disabled:y||m,children:x("model.refresh")})]}),k&&(0,r.jsx)("p",{className:"why",style:{color:"var(--warn)"},children:x("def.reviewSame")}),(0,r.jsx)(j,{msg:p||h}),(0,r.jsx)("h3",{children:x("proj.affects")}),(0,r.jsxs)("ul",{className:"muted small",style:{margin:0,paddingLeft:20},children:[(0,r.jsx)("li",{children:x("def.reviewAffectsNew")}),(0,r.jsx)("li",{children:x("def.reviewAffectsExisting")}),(0,r.jsx)("li",{children:x("def.reviewAffectsBatch")})]}),(0,r.jsxs)("div",{className:"row",style:{marginTop:12},children:[(0,r.jsx)(a(),{href:"/",children:(0,r.jsx)("button",{children:x("proj.toSessions")})}),(0,r.jsx)(a(),{href:"/import",children:(0,r.jsx)("button",{className:"quiet",children:x("proj.toImport")})})]})]})}},4784:(e,l,t)=>{"use strict";t.d(l,{Y:()=>i});var r=t(3365),n=t(1521),s=t(5549),a=t(867);function i(e){var l,t;let{id:i,chosen:o,onChange:d,none:c,catalogue:u,disabled:m=!1,style:h}=e,{t:x}=(0,a.kj)(),p=function(e){let[l,t]=(0,n.useState)(null);return(0,n.useEffect)(()=>{if(void 0!==e)return;let l=!0;return s.FH.models().then(e=>{l&&t(e)}).catch(()=>void 0),()=>{l=!1}},[e]),void 0!==e?e:l}(u),j=null!=(l=null==p?void 0:p.options)?l:[],v=j.some(e=>e.name===o),f=j.filter(e=>!e.group),g=new Map;for(let e of j)e.group&&g.set(e.group,[...null!=(t=g.get(e.group))?t:[],e]);return(0,r.jsxs)("select",{id:i,value:o,onChange:e=>d(e.target.value),disabled:m,style:{width:"auto",minWidth:280,...h},children:[(0,r.jsx)("option",{value:"",children:c}),o&&!v&&(0,r.jsx)("option",{value:o,children:x("model.notInList",{name:o})}),f.map(e=>(0,r.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(x("model.unavailable")):""]},e.name)),[...g.entries()].map(e=>{let[l,t]=e;return(0,r.jsx)("optgroup",{label:l,children:t.map(e=>(0,r.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(x("model.unavailable")):""]},e.name))},l)})]})}}},e=>{e.O(0,[197,867,549,347,131,358],()=>e(e.s=1896)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[810],{3256:(e,s,t)=>{Promise.resolve().then(t.bind(t,4627))},4627:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>I});var n=t(3365),a=t(1521),l=t(8197),i=t.n(l),r=t(5549),d=t(3523),o=t(3374),c=t(867),u=t(1910),h=t(5132);function m(){let{t:e}=(0,c.kj)(),[s,t]=(0,a.useState)(!1);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"info-dot","aria-expanded":s,"aria-label":e("row.info"),title:e("row.info"),onClick:()=>t(e=>!e),children:"i"}),s&&(0,n.jsxs)("div",{className:"notice info-panel",children:[(0,n.jsx)("strong",{children:e("row.infoTitle")}),(0,n.jsxs)("dl",{className:"small",children:[(0,n.jsx)("dt",{children:e("reg.openTask")}),(0,n.jsx)("dd",{children:e("row.infoOpenTask")}),(0,n.jsx)("dt",{children:e("save.log")}),(0,n.jsx)("dd",{children:e("save.why")}),(0,n.jsx)("dt",{children:e("home.col.chat")}),(0,n.jsx)("dd",{children:e("row.infoChat")})]}),(0,n.jsx)("div",{className:"small",style:{marginTop:6},children:e("row.infoExports")}),(0,n.jsxs)("dl",{className:"small",children:[(0,n.jsx)("dt",{children:e("reg.exportPlan")}),(0,n.jsx)("dd",{children:e("reg.exportPlanWhy")}),(0,n.jsx)("dt",{children:e("reg.exportDomain")}),(0,n.jsx)("dd",{children:e("reg.exportDomainWhy")}),(0,n.jsx)("dt",{children:e("reg.exportBot")}),(0,n.jsx)("dd",{children:e("reg.exportBotWhy")})]}),(0,n.jsx)(h.s,{text:e("row.infoWhich"),className:"small"})]})]})}function g(e){let{onChange:s}=e,{t}=(0,c.kj)(),[l,i]=(0,a.useState)(null),[d,o]=(0,a.useState)(!1),[u,h]=(0,a.useState)(""),m=(0,a.useCallback)(async()=>{try{i(await r.FH.batch())}catch(e){}},[]);(0,a.useEffect)(()=>{m();let e=setInterval(()=>void m(),3e3);return()=>clearInterval(e)},[m]);let g=async e=>{o(!0),h("");try{"pause"===e?await r.FH.pauseBatch():"resume"===e?await r.FH.resumeBatch():await r.FH.stopBatch(),await m(),null==s||s()}catch(e){h(e.message)}finally{o(!1)}};return(null==l?void 0:l.running)?(0,n.jsxs)("div",{className:"row",style:{marginBottom:8},children:[l.pausing?(0,n.jsx)("button",{className:"primary",disabled:d,onClick:()=>void g("resume"),title:t("batch.resumeWhy"),children:t("batch.resume")}):(0,n.jsx)("button",{disabled:d||l.stopping,onClick:()=>void g("pause"),title:t("batch.pauseWhy"),children:t("batch.pause")}),(0,n.jsx)("button",{className:"danger",disabled:d||l.stopping,onClick:()=>void g("stop"),title:t("batch.stopWhy"),children:t("batch.stop")}),l.pausing&&!l.stopping&&(0,n.jsx)("span",{className:"muted small",children:t("batch.pausing")}),l.stopping&&(0,n.jsx)("span",{className:"muted small",children:t("batch.stopping")}),u&&(0,n.jsx)("span",{className:"err small",children:u})]}):null}var p=t(3041),x=t(1035),j=t(8934),v=t(4811),N=t(2876);let k=["queued","running","waiting-approval"],f=["blocked","failed","aborted","limit-reached"],b=["aborted","limit-reached"];function w(e){let{run:s}=e,{t}=(0,c.kj)(),a=s.entries.some(d.DG),l=(0,o.c)(a),i=(0,d.eZ)(s,s.entries,l);return(0,n.jsx)(n.Fragment,{children:t(i.live?"reg.runRunning":"reg.runTook",{d:(0,r.c5)(i.ms)})})}function y(e){let s=new Map,t=[];for(let n of e){if(!n.runGroup){t.push(n);continue}let e=s.get(n.runGroup.id);e?e.entries.push(n):s.set(n.runGroup.id,{...n.runGroup,entries:[n]})}let n=[...s.values()].sort((e,s)=>Date.parse(s.startedAt)-Date.parse(e.startedAt));for(let e of n)e.entries.sort((e,s)=>{var t,n;return Date.parse(null!=(t=e.startedAt)?t:e.createdAt)-Date.parse(null!=(n=s.startedAt)?n:s.createdAt)});return{runs:n,loose:t}}function I(){let{t:e}=(0,c.kj)(),s=(0,c.W3)(),[t,l]=(0,a.useState)(null),[i,d]=(0,a.useState)(""),[o,u]=(0,a.useState)(""),[h,m]=(0,a.useState)("flow"),[p,x]=(0,a.useState)(""),[j,v]=(0,a.useState)(""),[N,b]=(0,a.useState)(""),w=(0,a.useCallback)(async()=>{try{l(await r.FH.tasks()),u(new Date().toISOString()),d("")}catch(e){d(e.message)}},[]);(0,a.useEffect)(()=>{w();let e=setInterval(()=>void w(),6e3);return()=>clearInterval(e)},[w]);let I=(0,a.useMemo)(()=>{let e=new Map;for(let s of null!=t?t:[])e.has(s.sessionId)||e.set(s.sessionId,s.sessionName);return[...e.entries()]},[t]),S=(0,a.useMemo)(()=>{let e=N.trim().toLowerCase();return(null!=t?t:[]).filter(s=>{var t,n;return(!p||s.sessionId===p)&&(!j||s.status===j)&&(!e||"".concat(s.title," ").concat(null!=(t=s.summary)?t:""," ").concat(null!=(n=s.reason)?n:""," ").concat(s.sessionName).toLowerCase().includes(e))})},[t,p,j,N]),T=(0,a.useMemo)(()=>{let e=null!=t?t:[];return{total:e.length,done:e.filter(e=>"done"===e.status).length,running:e.filter(e=>"running"===e.status||"waiting-approval"===e.status).length,open:e.filter(e=>"queued"===e.status).length,failed:e.filter(e=>f.includes(e.status)).length}},[t]),P=(0,a.useMemo)(()=>{let e=new Map;for(let n of null!=t?t:[]){var s;n.runGroup&&e.set(n.runGroup.id,(null!=(s=e.get(n.runGroup.id))?s:0)+1)}return e},[t]),H=(0,a.useMemo)(()=>y(S),[S]),G=S.filter(e=>"running"===e.status||"waiting-approval"===e.status),O=S.filter(e=>"queued"===e.status),D=[...S.filter(e=>f.includes(e.status)&&"stop"===e.sessionOnFailure&&!e.sessionRunning&&O.some(s=>s.sessionId===e.sessionId)),...O].sort((e,s)=>{var t,n;return(null!=(t=e.sessionRunOrder)?t:Number.MAX_SAFE_INTEGER)-(null!=(n=s.sessionRunOrder)?n:Number.MAX_SAFE_INTEGER)||e.position-s.position}),E=S.filter(e=>!k.includes(e.status)).sort((e,s)=>{var t,n,a,l;return Date.parse(null!=(n=null!=(t=s.finishedAt)?t:s.startedAt)?n:s.createdAt)-Date.parse(null!=(l=null!=(a=e.finishedAt)?a:e.startedAt)?l:e.createdAt)}),M=""!==p||""!==j||""!==N.trim();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"panel",children:[(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("h2",{className:"grow",style:{margin:0},children:e("reg.title")}),(0,n.jsx)("span",{className:"muted small",children:o&&e("reg.updated",{t:s(o)})}),(0,n.jsx)("button",{className:"quiet",onClick:()=>void w(),children:e("reg.refresh")})]}),(0,n.jsx)("p",{className:"muted small",children:e("reg.hint")}),(0,n.jsx)(q,{sessions:I}),(0,n.jsxs)("div",{className:"counts",children:[(0,n.jsxs)("div",{className:"count",children:[(0,n.jsx)("div",{className:"n",children:T.total}),(0,n.jsx)("div",{className:"k",children:e("reg.total")})]}),(0,n.jsxs)("div",{className:"count done",children:[(0,n.jsx)("div",{className:"n",children:T.done}),(0,n.jsx)("div",{className:"k",children:e("reg.done")})]}),(0,n.jsxs)("div",{className:"count running",children:[(0,n.jsx)("div",{className:"n",children:T.running}),(0,n.jsx)("div",{className:"k",children:e("reg.runningCount")})]}),(0,n.jsxs)("div",{className:"count queued",children:[(0,n.jsx)("div",{className:"n",children:T.open}),(0,n.jsx)("div",{className:"k",children:e("reg.open")})]}),(0,n.jsxs)("div",{className:"count failed",children:[(0,n.jsx)("div",{className:"n",children:T.failed}),(0,n.jsx)("div",{className:"k",children:e("reg.failedCount")})]})]})]}),i&&(0,n.jsx)("div",{className:"panel err",children:i}),(0,n.jsxs)("div",{className:"panel",children:[(0,n.jsxs)("div",{className:"toolbar",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"f-session",style:{margin:0},children:e("reg.filterSession")}),(0,n.jsxs)("select",{id:"f-session",value:p,onChange:e=>x(e.target.value),children:[(0,n.jsx)("option",{value:"",children:e("reg.allSessions")}),I.map(e=>{let[s,t]=e;return(0,n.jsx)("option",{value:s,children:t},s)})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"f-status",style:{margin:0},children:e("reg.filterStatus")}),(0,n.jsxs)("select",{id:"f-status",value:j,onChange:e=>v(e.target.value),children:[(0,n.jsx)("option",{value:"",children:e("reg.allStatuses")}),["queued","running","waiting-approval","done","blocked","failed","aborted","limit-reached"].map(s=>(0,n.jsx)("option",{value:s,children:e("status.".concat(s))},s))]})]}),(0,n.jsxs)("div",{className:"grow",children:[(0,n.jsx)("label",{htmlFor:"f-q",style:{margin:0},children:e("reg.search")}),(0,n.jsx)("input",{id:"f-q",type:"text",value:N,onChange:e=>b(e.target.value),placeholder:e("reg.searchPlaceholder")})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{style:{margin:0},id:"view-label",children:e("reg.viewLabel")}),(0,n.jsxs)("div",{className:"segmented",role:"group","aria-labelledby":"view-label",children:[(0,n.jsx)("button",{type:"button","aria-pressed":"flow"===h,onClick:()=>m("flow"),children:e("reg.viewFlow")}),(0,n.jsx)("button",{type:"button","aria-pressed":"runs"===h,onClick:()=>m("runs"),children:e("reg.groupBy")}),(0,n.jsx)("button",{type:"button","aria-pressed":"list"===h,onClick:()=>m("list"),children:e("reg.viewList")})]})]}),M&&(0,n.jsx)("button",{className:"quiet",onClick:()=>{x(""),v(""),b("")},children:e("reg.clear")})]}),null===t&&(0,n.jsx)("div",{className:"muted",children:e("home.loading")}),null!==t&&0===t.length&&(0,n.jsx)("div",{className:"empty",children:e("reg.none")}),null!==t&&t.length>0&&0===S.length&&(0,n.jsx)("div",{className:"empty",children:e("reg.noMatch")})]}),"list"===h&&S.length>0&&(0,n.jsx)(W,{entries:[...G,...O,...E]}),"runs"===h&&S.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"panel",children:[(0,n.jsx)("h2",{children:e("reg.runGroup")}),(0,n.jsx)("p",{className:"muted small",children:e("reg.runGroupHint")})]}),H.runs.map(e=>(0,n.jsxs)("section",{className:"panel",children:[(0,n.jsx)(F,{run:e}),(0,n.jsx)(C,{entries:e.entries,sizes:P,onChange:()=>void w()})]},e.id)),H.loose.length>0&&(0,n.jsxs)("section",{className:"panel",children:[(0,n.jsx)("h2",{children:e("reg.notInARun")}),(0,n.jsx)("p",{className:"muted small",children:e("reg.notInARunHint")}),(0,n.jsx)(C,{entries:H.loose,sizes:P,onChange:()=>void w()})]})]}),"flow"===h&&(0,n.jsxs)(n.Fragment,{children:[G.length>0&&(0,n.jsxs)("section",{className:"panel",children:[(0,n.jsx)("h2",{children:e("reg.activeNow")}),(0,n.jsx)(C,{entries:G,sizes:P,onChange:()=>void w()})]}),S.length>0&&(0,n.jsxs)("section",{className:"panel",children:[(0,n.jsx)("h2",{children:e("reg.upcoming")}),(0,n.jsx)("p",{className:"muted small",children:e("reg.upcomingHint")}),(0,n.jsx)(g,{onChange:()=>void w()}),S.some(e=>e.interrupted&&!e.sessionRunning)&&(0,n.jsxs)("div",{className:"notice caution",role:"status",children:[(0,n.jsx)("strong",{children:e("reg.interruptedTitle")})," ",e("reg.interrupted",{n:S.filter(e=>e.interrupted&&!e.sessionRunning).length})]}),(0,n.jsx)(R,{entries:S,onChange:()=>void w()}),0===D.length?(0,n.jsx)("div",{className:"empty",children:e("reg.noUpcoming")}):(0,n.jsx)(C,{entries:D,upcoming:!0,sizes:P,onChange:()=>void w()})]}),S.length>0&&(0,n.jsxs)("section",{className:"panel",children:[(0,n.jsx)("h2",{children:e("reg.past")}),(0,n.jsx)("p",{className:"muted small",children:e("reg.pastHint")}),0===E.length?(0,n.jsx)("div",{className:"empty",children:e("reg.noPast")}):(0,n.jsx)(A,{entries:E,sizes:P,onChange:()=>void w()})]})]})]})}function C(e){let{entries:s,upcoming:t=!1,sizes:l,onChange:g,picking:x}=e,{t:v}=(0,c.kj)(),k=(0,c.W3)(),b=(0,p.e)(null!=g?g:()=>void 0),w=(0,o.c)(s.some(d.DG)),[y,I]=(0,a.useState)(null),[C,F]=(0,a.useState)(new Set);return(0,n.jsxs)(n.Fragment,{children:[y&&(0,n.jsx)(T,{entry:y,onClose:e=>{I(null),e&&(null==g||g())}}),(0,n.jsx)("ol",{className:"flow",children:s.map(e=>{var s,a,o,c,g,p,y,A,T,q,R,W,P,H,G,O,D,E,M,_,B,z;let L=t&&1===e.queuePosition,U=e.runGroup?null!=(y=null==l?void 0:l.get(e.runGroup.id))?y:1:0;return(0,n.jsxs)("li",{className:"".concat(e.status).concat(L?" next":""),children:[(0,n.jsxs)("div",{className:"head",children:[x&&(0,n.jsx)("input",{type:"checkbox",className:"pick","aria-label":e.title,checked:x.picked.has("".concat(e.sessionId,":").concat(e.taskId)),onChange:()=>x.toggle("".concat(e.sessionId,":").concat(e.taskId))}),(0,n.jsx)("strong",{children:e.title}),(0,n.jsx)("span",{className:"badge ".concat(e.status),children:v("status.".concat(e.status))}),L&&(0,n.jsx)("span",{className:"chip",children:v("reg.next")}),t&&f.includes(e.status)&&(0,n.jsx)("span",{className:"chip",title:v("reg.willRequeueFirstWhy"),children:v("reg.willRequeueFirst")}),e.sessionRunning&&(0,n.jsx)("span",{className:"chip",children:v("reg.sessionRunning")}),e.review&&"skipped"!==e.review.verdict&&(0,n.jsxs)("span",{className:"badge ".concat("pass"===e.review.verdict?"done":"fail"===e.review.verdict?"blocked":"waiting-approval"),title:e.review.stepsRun>0?v("review.ran",{n:e.review.stepsRun}):void 0,children:[v("review.verdict.".concat(e.review.verdict)),e.review.findings>0?" (".concat(e.review.findings,")"):""]}),(null!=(A=e.deviations)?A:0)>0&&(0,n.jsx)("span",{className:"badge waiting-approval",title:v("reg.deviationsWhy"),children:v("reg.deviations",{n:null!=(T=e.deviations)?T:0})}),(null!=(q=e.disputes)?q:0)>0&&(0,n.jsx)("span",{className:"badge waiting-approval",title:v("reg.disputesWhy"),children:v("reg.disputes",{n:null!=(R=e.disputes)?R:0})}),e.readOnly&&(0,n.jsx)("span",{className:"chip",title:v("reg.readOnlyWhy"),children:v("task.readOnly")}),(null!=(W=e.autoRetries)?W:0)>0&&(0,n.jsx)("span",{className:"badge ".concat("done"===e.status?"done":"blocked"),title:v("reg.retriedFreshWhy"),children:"done"===e.status?v("reg.retriedFreshDone",{n:null!=(P=e.autoRetries)?P:0}):v("reg.retriedFreshStill",{n:null!=(H=e.autoRetries)?H:0})}),e.runGroup&&(0,n.jsx)("span",{className:"chip",title:v("reg.runTitle",{t:U,s:e.runGroup.sessions,when:k(e.runGroup.startedAt)}),children:U>1?v("reg.runWith",{n:U-1}):v("reg.runAlone")})]}),(0,n.jsxs)("div",{className:"when",children:[(0,n.jsx)(i(),{href:(0,r.aT)(e.sessionId),children:e.sessionName})," \xb7 ",e.startedAt?v("task.started",{t:k(e.startedAt)}):v("task.added",{t:k(e.createdAt)}),e.finishedAt?" \xb7 ".concat(v("task.finished",{t:k(e.finishedAt)})):"",void 0!==e.durationMs?" \xb7 ".concat(v("reg.took",{d:(0,r.c5)(e.durationMs)})):"",(0,d.DG)(e)?" \xb7 ".concat(v("task.runningFor",{d:(0,r.c5)((0,d.d5)(e.startedAt,void 0,w))})):"",e.iterations>0?" \xb7 ".concat(v("reg.iterations",{n:e.iterations})):""]}),"queued"===e.status&&(0,n.jsx)("div",{className:"when",children:e.queuePosition&&e.queuePosition>1?v("reg.willFollow",{n:e.queuePosition-1}):e.sessionRunning?v("reg.queuePos",{n:null!=(G=e.queuePosition)?G:1}):v("reg.waitingRun")}),"blocked"===e.status&&(0,n.jsx)("p",{className:"what muted small",children:v("reg.blockedWhat")}),(null!=(O=null==(s=e.attempts)?void 0:s.length)?O:0)>0&&(0,n.jsxs)("details",{className:"small",style:{marginTop:6},children:[(0,n.jsx)("summary",{children:(null!=(D=null==(a=e.attempts)?void 0:a.length)?D:0)===1?v("reg.attemptsOne",{n:null!=(M=e.attempt)?M:(null!=(E=null==(o=e.attempts)?void 0:o.length)?E:0)+1}):v("reg.attempts",{n:null!=(B=e.attempt)?B:(null!=(_=null==(c=e.attempts)?void 0:c.length)?_:0)+1,m:null!=(z=null==(g=e.attempts)?void 0:g.length)?z:0})}),(0,n.jsx)("ol",{className:"attempts",children:null==(p=e.attempts)?void 0:p.map(s=>{var t;return(0,n.jsxs)("li",{children:[(0,n.jsxs)("div",{className:"head",children:[(0,n.jsx)("strong",{children:v("reg.attemptN",{n:s.attempt})}),(0,n.jsx)("span",{className:"badge ".concat(s.status),children:v("status.".concat(s.status))}),s.iterations>0&&(0,n.jsx)("span",{className:"muted",children:v("reg.iterations",{n:s.iterations})}),void 0!==s.durationMs&&(0,n.jsx)("span",{className:"muted",children:v("reg.took",{d:(0,r.c5)(s.durationMs)})}),s.runId&&(0,n.jsx)(u.u,{label:v("save.attemptLog"),save:()=>r.FH.saveTaskLog(e.sessionId,e.taskId,s.runId)}),s.runId&&(0,n.jsx)(u.H,{sessionId:e.sessionId,taskId:e.taskId,attempt:s.attempt}),s.runId&&void 0!==s.changedFiles&&(0,n.jsx)(j.C,{sessionId:e.sessionId,taskId:e.taskId,runId:s.runId,title:"".concat(e.title," — ").concat(v("reg.attemptN",{n:s.attempt})),files:s.changedFiles})]}),(0,n.jsxs)("div",{className:"when",children:[s.startedAt?v("task.started",{t:k(s.startedAt)}):"",s.finishedAt?" \xb7 ".concat(v("task.finished",{t:k(s.finishedAt)})):"",s.branch?" \xb7 ".concat(s.branch):""]}),s.reason&&(0,n.jsx)("p",{className:"what err",children:v("reg.stopped",{reason:s.reason})}),s.summary&&(0,n.jsx)(h.s,{text:s.summary,className:"what"})]},"".concat(null!=(t=s.runId)?t:s.attempt))})})]}),e.summary&&(0,n.jsx)(h.s,{text:e.summary,className:"what"}),e.reason&&(0,n.jsx)("p",{className:"what err",children:v("reg.stopped",{reason:e.reason})}),b.message&&(0,n.jsx)("p",{className:"what small",children:b.message}),(0,n.jsxs)("div",{className:"row small",style:{marginTop:6},children:[(0,n.jsx)(i(),{href:(0,r.aT)(e.sessionId,e.taskId),children:v("reg.openTask")}),e.runId&&(0,n.jsx)(u.u,{label:v("save.log"),save:()=>r.FH.saveTaskLog(e.sessionId,e.taskId)}),e.chatUrl&&(0,n.jsx)("a",{href:e.chatUrl,target:"_blank",rel:"noreferrer",children:v("home.col.chat")}),e.startedAt&&(0,n.jsx)(S,{where:{session:e.sessionId,task:e.taskId}}),void 0!==e.changedFiles&&(0,n.jsx)(j.C,{sessionId:e.sessionId,taskId:e.taskId,title:e.title,files:e.changedFiles}),(0,n.jsx)(m,{}),e.runId&&(0,n.jsxs)("button",{className:C.has(e.taskId)?"":"quiet",onClick:()=>{let s;return s=e.taskId,F(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})},title:(0,d.DG)(e)?v("story.showLiveWhy"):v("story.why"),children:[(0,d.DG)(e)&&!C.has(e.taskId)&&(0,n.jsx)("span",{className:"dot","aria-hidden":"true"}),C.has(e.taskId)?v("story.hide"):(0,d.DG)(e)?v("story.showLive"):v("story.show")]}),f.includes(e.status)&&!e.sessionRunning&&(0,n.jsx)("button",{className:"quiet",onClick:()=>I(e),title:v("reg.fixPromptHint"),children:v("reg.fixPrompt")}),"done"===e.status&&!e.sessionRunning&&(0,n.jsx)("button",{className:"quiet",onClick:()=>I(e),title:v("reg.newPromptHint"),children:v("reg.newPrompt")}),e.startedAt&&!e.sessionRunning&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{className:"quiet",disabled:""!==b.busy,title:v("restore.why"),onClick:()=>void b.restore({sessionId:e.sessionId,taskId:e.taskId,title:e.title}),children:"restore"===b.busy?v("restore.checking"):v("restore.button")}),(0,n.jsx)("button",{className:"quiet",disabled:""!==b.busy,title:v("restart.why"),onClick:()=>void b.restartFrom({sessionId:e.sessionId,taskId:e.taskId,title:e.title}),children:"restart"===b.busy?v("restart.checking"):v("restart.button")})]})]}),C.has(e.taskId)&&e.runId&&(0,n.jsx)(N.P,{sessionId:e.sessionId,taskId:e.taskId,live:"running"===e.status||"waiting-approval"===e.status})]},"".concat(e.sessionId,"-").concat(e.taskId))})})]})}function S(e){let{where:s}=e,{t}=(0,c.kj)();return(0,n.jsxs)("span",{className:"exports",title:t("reg.exportTitle"),children:[(0,n.jsxs)("span",{className:"muted",children:[t("reg.exportTitle"),":"]})," ",(0,n.jsx)("a",{href:r.FH.exportUrl("plan",s),title:t("reg.exportPlanWhy"),children:t("reg.exportPlan")})," \xb7 ",(0,n.jsx)("a",{href:r.FH.exportUrl("domain",s),title:t("reg.exportDomainWhy"),children:t("reg.exportDomain")})," \xb7 ",(0,n.jsx)("a",{href:r.FH.exportUrl("bot",s),title:t("reg.exportBotWhy"),children:t("reg.exportBot")})]})}function F(e){var s;let{run:t}=e,{t:a}=(0,c.kj)(),l=(0,c.W3)(),i=null!=(s=t.entries.map(e=>{var s;return null==(s=e.runGroup)?void 0:s.name}).find(Boolean))?s:a("reg.runUnnamed"),r=t.entries.filter(e=>"done"===e.status).length,d=t.entries.filter(e=>f.includes(e.status)).length;return(0,n.jsxs)("div",{className:"run-heading",children:[(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("h2",{className:"grow",style:{margin:0},children:i}),(0,n.jsxs)("span",{className:"muted small",children:[a("reg.runOf",{t:t.entries.length,s:t.sessions})," \xb7 ",a("reg.runAt",{when:l(t.startedAt)})," \xb7 ",(0,n.jsx)(w,{run:t})]})]}),(0,n.jsxs)("div",{className:"row small",style:{marginTop:4},children:[(0,n.jsx)("span",{className:"badge ".concat(d>0?"failed":r===t.entries.length?"done":""),children:a("reg.runCounts",{done:r,failed:d})}),(0,n.jsx)(S,{where:{run:t.id}})]})]})}function A(e){let{entries:s,sizes:t,onChange:l}=e,{t:i}=(0,c.kj)(),d=(0,a.useMemo)(()=>y(s),[s]),[o,u]=(0,a.useState)(!1),[h,m]=(0,a.useState)(new Set),[g,p]=(0,a.useState)(!1),[x,j]=(0,a.useState)(""),[v,N]=(0,a.useState)(""),k=e=>"".concat(e.sessionId,":").concat(e.taskId),f=s.filter(e=>e.startedAt),b=[...h],w=async()=>{p(!0),N(""),j("");try{let e=await r.FH.downloadBundle(b.map(e=>{let[s,t]=e.split(":");return{sessionId:s,taskId:t}}));j(i("reg.bundleSaved",{name:e}))}catch(e){N(e.message)}finally{p(!1)}},I=o?{picked:h,toggle:e=>m(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})}:void 0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"row small",style:{marginBottom:8},children:[o?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{className:"quiet",onClick:()=>{u(!1),m(new Set),j(""),N("")},children:i("reg.pickDone")}),(0,n.jsx)("button",{className:"quiet",onClick:()=>m(new Set(f.map(k))),children:i("reg.pickAll")}),(0,n.jsx)("button",{className:"quiet",onClick:()=>m(new Set),children:i("reg.pickNone")}),(0,n.jsx)("span",{className:"muted",children:h.size>0?i("reg.pickedN",{n:h.size}):i("reg.pickedNone")}),h.size>0&&(0,n.jsx)("button",{className:"primary",disabled:g,onClick:()=>void w(),title:i("reg.bundleWhy"),children:i("reg.bundle",{n:h.size})})]}):(0,n.jsx)("button",{className:"quiet",onClick:()=>u(!0),title:i("reg.pickWhy"),children:i("reg.pick")}),x&&(0,n.jsx)("span",{className:"muted",children:x}),v&&(0,n.jsx)("span",{className:"err",children:v})]}),d.runs.map((e,s)=>(0,n.jsxs)("details",{className:"run-fold",open:0===s||o,children:[(0,n.jsx)("summary",{children:(0,n.jsx)(F,{run:e})}),(0,n.jsx)(C,{entries:e.entries,sizes:t,onChange:l,picking:I})]},e.id)),d.loose.length>0&&(0,n.jsxs)("details",{className:"run-fold",open:0===d.runs.length||o,children:[(0,n.jsx)("summary",{children:(0,n.jsxs)("div",{className:"run-heading",children:[(0,n.jsx)("h2",{style:{margin:0},children:i("reg.notInARun")}),(0,n.jsx)("p",{className:"muted small",style:{margin:"4px 0 0"},children:i("reg.notInARunHint")})]})}),(0,n.jsx)(C,{entries:d.loose,sizes:t,onChange:l,picking:I})]})]})}function T(e){let{entry:s,onClose:t}=e,{t:l}=(0,c.kj)(),[i,d]=(0,a.useState)(null),[o,u]=(0,a.useState)(""),[h,m]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=!0;return r.FH.session(s.sessionId).then(t=>{var n;let a=t.tasks.find(e=>e.id===s.taskId);e&&d(null!=(n=null==a?void 0:a.prompt)?n:"")}).catch(s=>{e&&u(s.message)}),()=>{e=!1}},[s.sessionId,s.taskId]);let g=async()=>{if(null!==i){m(!0),u("");try{await r.FH.rerunTask(s.sessionId,s.taskId,{prompt:i},{buildOnFinished:"done"===s.status}),u(l("reg.fixPromptSaved",{title:s.title})),setTimeout(()=>t(!0),900)}catch(e){u(e.message),m(!1)}}};return(0,n.jsx)("div",{className:"modal-backdrop",role:"presentation",onClick:()=>t(!1),children:(0,n.jsxs)("div",{className:"modal wide",role:"dialog","aria-modal":"true","aria-labelledby":"fix-title",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("h2",{id:"fix-title",children:l("reg.fixPromptTitle",{title:s.title})}),(0,n.jsx)("p",{className:"muted small",children:l("done"===s.status?"reg.newPromptHint":"reg.fixPromptHint")}),s.reason&&(0,n.jsx)("p",{className:"what err small",children:l("reg.stopped",{reason:s.reason})}),null===i?(0,n.jsx)("p",{className:"muted small",children:o||l("reg.fixPromptLoading")}):(0,n.jsx)("textarea",{className:"prose",value:i,onChange:e=>d(e.target.value),style:{minHeight:260},disabled:h}),(0,n.jsxs)("div",{className:"row modal-actions",children:[o&&null!==i&&(0,n.jsx)("span",{className:"small grow",children:o}),(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>t(!1),disabled:h,children:l("dialog.cancel")}),(0,n.jsx)("button",{type:"button",className:"primary",onClick:()=>void g(),disabled:h||null===i||!i.trim(),children:l("reg.fixPromptSave")})]})]})})}function q(e){let{sessions:s}=e,{t}=(0,c.kj)();return(0,n.jsxs)("div",{className:"row",style:{margin:"14px 0 18px"},children:[(0,n.jsx)(i(),{href:"/#new-session",children:(0,n.jsx)("button",{className:"primary",children:t("reg.newSession")})}),s.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("label",{htmlFor:"new-task-session",style:{margin:0},children:[t("reg.newTask")," ",t("reg.newTaskIn")]}),(0,n.jsxs)("select",{id:"new-task-session",value:"",onChange:e=>{e.target.value&&(window.location.href=(0,r.aT)(e.target.value,"new-task"))},style:{width:"auto",minWidth:200},children:[(0,n.jsx)("option",{value:"",children:t("reg.newTaskPick")}),s.map(e=>{let[s,t]=e;return(0,n.jsx)("option",{value:s,children:t},s)})]})]})]})}function R(e){let{entries:s,onChange:t}=e,{t:l}=(0,c.kj)(),[i,d]=(0,a.useState)(!1),[o,u]=(0,a.useState)(""),[h,m]=(0,a.useState)(!1),[g,p]=(0,a.useState)(new Set),[j,N]=(0,a.useState)(null),k=s.filter(e=>"queued"===e.status),w=s.filter(e=>f.includes(e.status)&&!e.sessionRunning),y=s.some(e=>e.sessionRunning),I=w.filter(e=>"stop"===e.sessionOnFailure),C=w.filter(e=>"stop"!==e.sessionOnFailure),S=[...k,...w],F=S.filter(e=>g.has(e.taskId)),A=w.filter(e=>g.has(e.taskId)),q=k.filter(e=>g.has(e.taskId)),R=[...new Set([...F].sort((e,s)=>{var t,n;return(null!=(t=e.sessionRunOrder)?t:Number.MAX_SAFE_INTEGER)-(null!=(n=s.sessionRunOrder)?n:Number.MAX_SAFE_INTEGER)||e.position-s.position}).map(e=>e.sessionId))],W=F.filter(e=>"stop"===e.sessionOnFailure).map(e=>({e,before:S.find(s=>s.sessionId===e.sessionId&&s.position<e.position&&!g.has(s.taskId))})).filter(e=>!!e.before),[P,H]=(0,a.useState)(""),G=I.length>0?l("reg.continueWithFailed",{f:I.length,n:k.length,s:R.length}):l("reg.continue",{n:k.length,s:R.length}),O=(0,v.p)(),D=async e=>{if("unattended"!==e||O||await (0,x.Z)(l("batch.unattendedConfirm",{n:R.length}))){d(!0),u("");try{var s;for(let e of A)b.includes(e.status)?await r.FH.continueTask(e.sessionId,e.taskId):await r.FH.rerunTask(e.sessionId,e.taskId);let n=await r.FH.startBatch(R,e,"stop",void 0,void 0,P.trim()||void 0,F.map(e=>e.taskId));u(n.started?l("reg.continueStarted",{n:R.length}):l("batch.notStarted",{reason:null!=(s=n.reason)?s:""})),m(!1),t()}catch(e){u(e.message)}finally{d(!1)}}};return 0===k.length&&0===w.length?null:(0,n.jsxs)("div",{style:{marginBottom:8},children:[(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{className:"primary",disabled:i||y,onClick:()=>{p(new Set(S.map(e=>e.taskId))),m(!0),u(""),r.FH.suggestedRunName(R).then(e=>H(e.name)).catch(()=>void 0)},title:l("reg.continueWhy"),children:G}),y&&(0,n.jsx)("span",{className:"muted small",children:l("reg.continueRunning")}),o&&(0,n.jsx)("span",{className:"small",children:o})]}),h&&!y&&(0,n.jsxs)("div",{className:"notice",style:{marginTop:8},children:[(0,n.jsx)("strong",{children:l("reg.continuePanelTitle")}),(0,n.jsxs)("div",{className:"row small",style:{marginTop:6},children:[(0,n.jsx)("button",{className:"quiet small",onClick:()=>p(new Set(S.map(e=>e.taskId))),children:l("reg.pickAll")}),(0,n.jsx)("button",{className:"quiet small",onClick:()=>p(new Set),children:l("reg.pickNone")})]}),[{key:"chain",entries:I,intro:l("reg.continueChain"),fix:!0},{key:"loose",entries:C,intro:l("reg.continueIndependent"),fix:!0},{key:"queued",entries:k,intro:l("reg.continueQueued"),fix:!1}].filter(e=>e.entries.length>0).map(e=>(0,n.jsxs)("div",{style:{marginTop:6},children:[(0,n.jsx)("div",{className:"small",children:e.intro}),(0,n.jsx)("ul",{className:"small",style:{margin:"4px 0",paddingLeft:18,listStyle:"none"},children:e.entries.map(s=>(0,n.jsxs)("li",{children:[(0,n.jsxs)("label",{className:"option-inline",children:[(0,n.jsx)("input",{type:"checkbox",checked:g.has(s.taskId),onChange:e=>{let t,n;return t=s.taskId,n=e.target.checked,p(e=>{let s=new Set(e);return n?s.add(t):s.delete(t),s})}}),(0,n.jsx)("strong",{children:s.title})," \xb7 ",s.sessionName," \xb7 ",(0,n.jsx)("span",{className:"badge ".concat(s.status),children:l("status.".concat(s.status))}),b.includes(s.status)&&(0,n.jsxs)("span",{className:"muted small",children:[" \xb7 ",l("reg.willContinue")]})]})," ",(0,n.jsx)("button",{className:"quiet small",onClick:()=>p(new Set([s.taskId])),title:l("reg.pickOnlyWhy"),children:l("reg.pickOnly")}),e.fix&&(0,n.jsxs)(n.Fragment,{children:[" ",(0,n.jsx)("button",{className:"quiet small",onClick:()=>N(s),title:l("reg.fixPromptHint"),children:l("reg.fixPrompt")})]})]},s.taskId))})]},e.key)),W.length>0&&(0,n.jsx)("div",{className:"notice caution small",style:{marginTop:6},children:W.map(e=>(0,n.jsx)("div",{children:l("reg.continueGap",{task:e.e.title,before:e.before.title,session:e.e.sessionName})},e.e.taskId))}),(0,n.jsxs)("div",{style:{marginTop:8},children:[(0,n.jsx)("label",{htmlFor:"continue-run-name",children:l("batch.runName")}),(0,n.jsx)("input",{id:"continue-run-name",type:"text",value:P,onChange:e=>H(e.target.value),placeholder:l("batch.runNamePlaceholder"),disabled:i}),(0,n.jsx)("p",{className:"why",children:l("reg.continueNameWhy")})]}),(0,n.jsx)("div",{className:"small",style:{marginTop:6},children:l("reg.continueSummary",{q:q.length,r:A.length,s:R.length})}),(0,n.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,n.jsx)("button",{className:"primary",disabled:i||0===R.length,onClick:()=>void D("unattended"),title:l("reg.continueUnattendedWhy"),children:l("reg.continueUnattended")}),(0,n.jsx)("button",{disabled:i||0===R.length,onClick:()=>void D("confirm"),title:l("reg.continueWhy"),children:l("reg.continueGo")}),(0,n.jsx)("button",{className:"quiet",disabled:i,onClick:()=>m(!1),children:l("dialog.cancel")})]})]}),j&&(0,n.jsx)(T,{entry:j,onClose:e=>{N(null),e&&t()}})]})}function W(e){let{entries:s}=e,{t}=(0,c.kj)(),a=(0,c.W3)();return(0,n.jsx)("div",{className:"panel",children:(0,n.jsxs)("table",{children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:t("reg.col.task")}),(0,n.jsx)("th",{children:t("reg.col.session")}),(0,n.jsx)("th",{children:t("reg.col.status")}),(0,n.jsx)("th",{children:t("reg.col.started")}),(0,n.jsx)("th",{children:t("reg.col.took")}),(0,n.jsx)("th",{children:t("reg.col.result")})]})}),(0,n.jsx)("tbody",{children:s.map(e=>{var s;return(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{children:(0,n.jsx)(i(),{href:(0,r.aT)(e.sessionId,e.taskId),children:e.title})}),(0,n.jsx)("td",{children:(0,n.jsx)(i(),{href:(0,r.aT)(e.sessionId),children:e.sessionName})}),(0,n.jsx)("td",{children:(0,n.jsx)("span",{className:"badge ".concat(e.status),children:t("status.".concat(e.status))})}),(0,n.jsx)("td",{className:"muted small",children:e.startedAt?a(e.startedAt):"—"}),(0,n.jsx)("td",{className:"muted small",children:(0,r.c5)(e.durationMs)||"—"}),(0,n.jsx)("td",{className:"small",children:null!=(s=e.summary)?s:e.reason?(0,n.jsx)("span",{className:"err",children:e.reason}):"—"})]},"".concat(e.sessionId,"-").concat(e.taskId))})})]})})}}},e=>{e.O(0,[197,867,549,723,347,131,358],()=>e(e.s=3256)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[66],{1205:(e,s,n)=>{"use strict";n.d(s,{AppearanceProvider:()=>o,K:()=>m,themeScript:()=>i});var a=n(3365),l=n(1521);let t={theme:"light",textSize:"normal",highContrast:!1,reduceMotion:!1,underlineLinks:!1,strongFocus:!1},r="cop.appearance",i="\n(function () {\n try {\n var d = document.documentElement;\n var raw = localStorage.getItem('".concat(r,"');\n var a = raw ? JSON.parse(raw) : {};\n d.dataset.theme = a.theme === 'dark' ? 'dark' : 'light';\n d.dataset.textsize = a.textSize || 'normal';\n d.dataset.contrast = a.highContrast ? 'high' : 'normal';\n d.dataset.motion = a.reduceMotion ? 'reduced' : 'normal';\n d.dataset.links = a.underlineLinks ? 'underline' : 'plain';\n d.dataset.focus = a.strongFocus ? 'strong' : 'normal';\n } catch (e) {}\n})();\n");function 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,l.createContext)({appearance:t,set:()=>void 0,reset:()=>void 0,loaded:!1});function o(e){let{children:s}=e,[n,i]=(0,l.useState)(t),[o,m]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=t;try{let s=window.localStorage.getItem(r);s?e={...t,...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){}i(e),c(e),m(!0)},[]);let h=(0,l.useCallback)(e=>{i(s=>{let n={...s,...e};c(n);try{window.localStorage.setItem(r,JSON.stringify(n))}catch(e){}return n})},[]),u=(0,l.useCallback)(()=>{i(t),c(t);try{window.localStorage.removeItem(r)}catch(e){}},[]);return(0,a.jsx)(d.Provider,{value:{appearance:n,set:h,reset:u,loaded:o},children:s})}function m(){return(0,l.useContext)(d)}},1702:(e,s,n)=>{"use strict";var a=n(9962);n.o(a,"usePathname")&&n.d(s,{usePathname:function(){return a.usePathname}}),n.o(a,"useSearchParams")&&n.d(s,{useSearchParams:function(){return a.useSearchParams}})},1772:(e,s,n)=>{Promise.resolve().then(n.bind(n,4269))},2244:(e,s,n)=>{"use strict";n.d(s,{k:()=>o});var a=n(3365),l=n(1521),t=n(5549),r=n(867);function i(e){return e.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/+$/,"")}function c(e,s){return"."===s||""===s||e===s||e.startsWith("".concat(s,"/"))}function d(e,s,n){return n.includes(e)?"out":n.some(s=>s!==e&&c(e,s))?"out-inherited":s.includes(e)?"in":s.some(s=>s!==e&&c(e,s))?"inherited":"none"}function o(e){let{rootDir:s,respectGitignore:n,includeEnvFiles:o,include:m,exclude:h,onChange:u}=e,{t:p}=(0,r.kj)(),[x,v]=(0,l.useState)(null),[j,g]=(0,l.useState)(""),[f,k]=(0,l.useState)(new Set),[b,y]=(0,l.useState)(""),N=async()=>{if(s.trim()){g("");try{let e=await t.FH.dirs(s,n);v(e),y("".concat(s,"|").concat(n)),k(new Set(e.filter(e=>!e.includes("/"))))}catch(e){g(e.message)}}};(0,l.useEffect)(()=>{v(null),y("")},[s,n]);let w=(0,l.useMemo)(()=>(function(e){let s=[],n=new Map;for(let l of[...e].sort()){var a;let e={path:l,name:null!=(a=l.split("/").pop())?a:l,children:[]};n.set(l,e);let t=l.includes("/")?n.get(l.slice(0,l.lastIndexOf("/"))):void 0;(t?t.children:s).push(e)}return s})(null!=x?x:[]),[x]),C=m.map(i).filter(Boolean),S=h.map(i).filter(Boolean),F=e=>(0,a.jsx)("ul",{className:"dir-tree",children:e.map(e=>{let s=d(e.path,C,S),n=f.has(e.path),l=function(e,s,n){let a=s=>s.filter(s=>s!==e&&c(s,e)).length;return{included:a(s),excluded:a(n)}}(e.path,C,S),t=!n&&e.children.length>0&&(l.included>0||l.excluded>0);return(0,a.jsxs)("li",{className:"dir ".concat(s),children:[(0,a.jsxs)("div",{className:"dir-row",children:[e.children.length>0?(0,a.jsx)("button",{type:"button",className:"dir-flip",onClick:()=>{let s;return s=e.path,k(e=>{let n=new Set(e);return n.has(s)?n.delete(s):n.add(s),n})},"aria-label":n?p("tree.fold"):p("tree.unfold"),"aria-expanded":n,children:n?"▾":"▸"}):(0,a.jsx)("span",{className:"dir-flip","aria-hidden":"true"}),(0,a.jsxs)("button",{type:"button",className:"dir-name",onClick:()=>(e=>{if("in"===d(e,C,S))return void u(C.filter(s=>s!==e),S);u([...C.filter(s=>!c(s,e)),e],S.filter(s=>!c(s,e)))})(e.path),title:"in"===s?p("tree.stateIn"):"inherited"===s?p("tree.stateInherited"):"out"===s?p("tree.stateOut"):"out-inherited"===s?p("tree.stateOutInherited"):p("tree.stateNone"),"aria-pressed":"in"===s||"inherited"===s,children:[(0,a.jsx)("span",{className:"dir-mark","aria-hidden":"true",children:"in"===s?"✓":"inherited"===s?"\xb7":"out"===s||"out-inherited"===s?"\xd7":""}),e.name]}),(0,a.jsx)("button",{type:"button",className:"dir-out".concat("out"===s?" on":""),onClick:()=>(e=>{if(S.includes(e))return void u(C,S.filter(s=>s!==e));u(C.filter(s=>s!==e&&!c(s,e)),[...S.filter(s=>!c(s,e)),e])})(e.path),title:"out"===s?p("tree.unexclude"):p("tree.exclude"),children:"−"}),t&&(0,a.jsx)("span",{className:"chip inside".concat(l.excluded>0?" out":""),title:p("tree.insideWhy"),children:l.excluded>0&&l.included>0?p("tree.insideBoth",{i:l.included,e:l.excluded}):l.excluded>0?p("tree.insideOut",{n:l.excluded}):p("tree.insideIn",{n:l.included})})]}),n&&e.children.length>0&&F(e.children)]},e.path)})}),D=b!=="".concat(s,"|").concat(n);return(0,a.jsxs)("div",{className:"dir-tree-box",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("button",{type:"button",onClick:()=>void N(),disabled:!s.trim(),children:null===x||D?p("tree.load"):p("tree.reload")}),(0,a.jsx)("span",{className:"muted small",children:p("tree.hint")})]}),j&&(0,a.jsx)("div",{className:"err small",children:j}),(0,a.jsxs)("p",{className:"muted small",style:{marginTop:6},children:[p("tree.alsoOut")," ",[n?p("tree.alsoGitignore"):null,!1===o?p("tree.alsoEnv"):null,p("tree.alsoAlways")].filter(Boolean).join(" \xb7 ")]}),null!==x&&!D&&(0===x.length?(0,a.jsx)("p",{className:"muted small",children:p("mirror.noDirs")}):F(w))]})}},4269:(e,s,n)=>{"use strict";n.r(s),n.d(s,{default:()=>C});var a=n(3365),l=n(1521),t=n(1702),r=n(8197),i=n.n(r),c=n(5549),d=n(867),o=n(1910),m=n(3523),h=n(3374);function u(e){let s=e.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/+$/,"");return""===s?".":s}function p(e){return e.split("\n").map(e=>e.trim()).filter(Boolean)}var x=n(1205),v=n(8848),j=n(4784),g=n(2244),f=n(2876),k=n(5132),b=n(1035),y=n(8934),N=n(4811),w=n(3041);function C(){return(0,a.jsx)(l.Suspense,{fallback:null,children:(0,a.jsx)(S,{})})}function S(){var e;let{t:s}=(0,d.kj)(),n=null!=(e=(0,t.useSearchParams)().get("id"))?e:"",[r,o]=(0,l.useState)(null),[m,h]=(0,l.useState)([]),[u,p]=(0,l.useState)([]),[x,v]=(0,l.useState)(null),[j,g]=(0,l.useState)(""),f=(0,l.useRef)(null),k=(0,l.useCallback)(async()=>{try{o(await c.FH.session(n)),g("")}catch(e){g(e.message)}},[n]),b=(0,l.useCallback)(()=>{f.current||(f.current=window.setTimeout(()=>{f.current=null,k()},400))},[k]);if((0,l.useEffect)(()=>{k(),c.FH.presets().then(p).catch(()=>void 0),c.FH.level1().then(v).catch(()=>void 0);let e=new EventSource(c.FH.streamUrl(n));e.onmessage=e=>{let s=JSON.parse(e.data);"ping"!==s.type&&(h(e=>[...e.slice(-400),s]),b())},e.onerror=()=>{};let s=setInterval(()=>void k(),8e3);return()=>{e.close(),clearInterval(s)}},[n,k,b]),j&&!r)return(0,a.jsx)("div",{className:"panel err",children:j});if(!r)return(0,a.jsx)("div",{className:"panel muted",children:s("home.loading")});let y=r.tasks.filter(e=>"queued"===e.status).length;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"crumbs",children:[(0,a.jsx)(i(),{href:"/",children:s("session.crumb")})," / ",r.name]}),(0,a.jsx)(F,{session:r,queued:y,onChange:k}),(0,a.jsx)(U,{tasks:r.tasks}),(0,a.jsx)(H,{session:r,onChange:k}),(0,a.jsx)(D,{level1:x,sent:r.contractSent}),(0,a.jsx)(T,{session:r,onChange:k}),(0,a.jsx)(I,{session:r,onChange:k}),(0,a.jsx)(M,{session:r,onChange:k}),(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsx)("h2",{children:s("tasks.title")}),(0,a.jsx)("p",{className:"muted small",children:s("tasks.hint")}),(0,a.jsx)(W,{session:r,onChange:k}),0===r.tasks.length&&(0,a.jsx)("div",{className:"muted",children:s("tasks.none")}),r.tasks.map((e,s)=>(0,a.jsx)(B,{session:r,task:e,index:s+1,presets:u,onChange:k},e.id))]}),(0,a.jsx)(O,{session:r}),(0,a.jsx)(A,{session:r,presets:u,onAdded:k,onPresetsChanged:()=>c.FH.presets().then(p)}),(0,a.jsx)(E,{events:m})]})}function F(e){var s;let{session:n,queued:t,onChange:r}=e,{t:i}=(0,d.kj)(),[o,m]=(0,l.useState)(""),[h,u]=(0,l.useState)("");(0,l.useEffect)(()=>{c.FH.models().then(e=>{var s;return u(null!=(s=e.defaultModel)?s:"")}).catch(()=>void 0)},[]);let[p,x]=(0,l.useState)(n.name),[v,j]=(0,l.useState)(null!=(s=n.conversationGroup)?s:"");(0,l.useEffect)(()=>x(n.name),[n.name]),(0,l.useEffect)(()=>{var e;return j(null!=(e=n.conversationGroup)?e:"")},[n.conversationGroup]);let g=(0,N.p)(),f=async e=>{var s;if("unattended"===e&&!g&&!await (0,b.Z)(i("session.unattendedConfirm")))return;let a=await c.FH.start(n.id,e,n.planName);m(a.started?i("unattended"===e?"session.startedAuto":"session.startedStep"):i("session.notStarted",{reason:null!=(s=a.reason)?s:""})),r()},k=async()=>{await c.FH.stop(n.id),m(i("session.stopping")),r()},y=async()=>{await c.FH.setRunMode(n.id,"confirm"),m(i("session.askingAgain")),r()},w=async()=>{p.trim()&&p!==n.name&&await c.FH.updateSession(n.id,{name:p}),r()},C=async()=>{if(n.running)return void m(i("home.deleteRunning"));if(await (0,b.Z)(i("home.deleteConfirm",{name:n.name,n:n.tasks.length})))try{await c.FH.deleteSession(n.id),window.location.href="/"}catch(e){m(e.message)}},S=async()=>{var e;if(v.trim()!==(null!=(e=n.conversationGroup)?e:""))try{await c.FH.updateSession(n.id,{conversationGroup:v.trim()}),m(i("session.groupSaved")),r()}catch(e){m(e.message)}},F=n.running?i("state.running"):i("state.".concat(n.status));return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("input",{type:"text",className:"grow",value:p,onChange:e=>x(e.target.value),onBlur:()=>void w()}),(0,a.jsx)("span",{className:"badge ".concat(n.running?"running":""),children:F})]}),!n.running&&(0,a.jsxs)("div",{className:"run-choice",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void f("unattended"),disabled:0===t,children:i("session.run",{n:t})}),(0,a.jsx)("p",{className:"why",children:i("session.runWhy")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("button",{onClick:()=>void f("confirm"),disabled:0===t,children:i("session.runStep")}),(0,a.jsx)("p",{className:"why",children:i("session.runStepWhy")})]})]}),(0,a.jsxs)("div",{className:"row",style:{marginTop:10},children:[n.running&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{className:"danger",onClick:()=>void k(),children:i("session.stop")}),"unattended"===n.runMode&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"badge waiting-approval",children:i("session.modeUnattended")}),(0,a.jsx)("button",{onClick:()=>void y(),children:i("session.askAgain")})]})]}),(0,a.jsx)("span",{className:"muted small",children:o}),(0,a.jsx)("span",{className:"grow"}),(0,a.jsx)("button",{className:"quiet",onClick:()=>void C(),disabled:n.running,children:i("home.delete")}),n.chat?(0,a.jsx)("a",{href:n.chat.url,target:"_blank",rel:"noreferrer",className:"small",children:i("session.openChat",{name:n.chat.name})}):(0,a.jsx)("span",{className:"muted small",children:i("session.noChat")})]}),(0,a.jsx)("label",{htmlFor:"session-group",children:i("session.group")}),(0,a.jsx)("div",{className:"row",children:(0,a.jsx)("input",{id:"session-group",type:"text",className:"grow",value:v,placeholder:i("session.groupPlaceholder"),onChange:e=>j(e.target.value),onBlur:()=>void S(),disabled:n.running})}),(0,a.jsxs)("p",{className:"why",children:[i("session.groupWhy"),n.chat&&" ".concat(i("session.groupHasChat"))]}),(0,a.jsxs)("div",{className:"muted small",style:{marginTop:10},children:[i("session.willUseModel",{name:n.model||(h?i("model.followsDefault",{name:h}):i("model.default"))})," \xb7 ",n.mirror.enabled&&n.mirror.rootDir?i("session.willUseFiles",{root:n.mirror.rootDir,dirs:n.mirror.includeDirs.length?n.mirror.includeDirs.join(", "):"."}):(0,a.jsx)("span",{className:"err",children:i("session.noFiles")})]})]})}function D(e){var s;let{level1:n,sent:l}=e,{t}=(0,d.kj)();return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("h2",{className:"grow",style:{margin:0},children:t("l1.title")}),(0,a.jsx)("span",{className:"badge",children:t(l?"l1.sent":"l1.notSent")}),(0,a.jsx)(i(),{href:"/level1",className:"small",children:t("l1.edit")})]}),(0,a.jsxs)("p",{className:"muted small",style:{marginBottom:6},children:[t("l1.hint"),(null==n?void 0:n.customised)?" ".concat(t("l1.customised")):""]}),(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:t("l1.show")}),(0,a.jsx)("pre",{className:"tall",children:null!=(s=null==n?void 0:n.content)?s:"…"})]})]})}function H(e){var s,n,t,r;let{session:i,onChange:o}=e,{t:m}=(0,d.kj)(),h=(0,d.W3)(),[u,p]=(0,l.useState)(null),[x,j]=(0,l.useState)(!1),[g,f]=(0,l.useState)("");(0,l.useEffect)(()=>{c.FH.models().then(p).catch(()=>void 0)},[]);let k=async e=>{try{await c.FH.updateSession(i.id,{model:e}),f(e?m("model.saved",{name:e}):m("model.savedDefault")),o()}catch(e){f(e.message)}},y=async()=>{try{let e=await c.FH.setDefaultModel(w);p(s=>s?{...s,defaultModel:e.defaultModel}:s),f(e.defaultModel?m("model.defaultSaved",{name:e.defaultModel}):m("model.defaultCleared"))}catch(e){f(e.message)}},N=async()=>{if(await (0,b.Z)(m("model.refreshConfirm"))){j(!0),f(m("model.refreshing"));try{var e;let s=await c.FH.refreshModels();p(s),f(0===s.options.length?null!=(e=s.note)?e:m("model.none"):m("model.refreshed",{n:s.options.length}))}catch(e){f(e.message)}finally{j(!1)}}},w=null!=(s=i.model)?s:"",C=null!=(n=null==u?void 0:u.options)?n:[],S=C.some(e=>e.name===w),F=C.filter(e=>!e.group),D=new Map;for(let e of C)e.group&&D.set(e.group,[...null!=(t=D.get(e.group))?t:[],e]);return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("h2",{className:"grow",style:{margin:0},children:m("model.title")}),i.modelInUse&&(0,a.jsx)("span",{className:"chip",children:m("model.lastUsed",{name:i.modelInUse})})]}),(0,a.jsx)("p",{className:"muted small",children:m("model.hint")}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsxs)("select",{"aria-label":m("model.title"),value:w,disabled:i.running,onChange:e=>void k(e.target.value),style:{width:"auto",minWidth:260},children:[(0,a.jsx)("option",{value:"",children:(null==u?void 0:u.defaultModel)?m("model.followsDefault",{name:u.defaultModel}):m("model.default")}),w&&!S&&(0,a.jsx)("option",{value:w,children:m("model.notInList",{name:w})}),F.map(e=>(0,a.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(m("model.unavailable")):""]},e.name)),[...D.entries()].map(e=>{let[s,n]=e;return(0,a.jsx)("optgroup",{label:s,children:n.map(e=>(0,a.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(m("model.unavailable")):""]},e.name))},s)})]}),(0,a.jsx)("button",{onClick:()=>void N(),disabled:x||i.running,children:m("model.refresh")}),(0,a.jsx)("span",{className:"muted small",role:"status",children:g})]}),(0,a.jsx)(v.L,{current:w,onUse:e=>void k(e)}),(0,a.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,a.jsx)("span",{className:"muted small",children:(null==u?void 0:u.defaultModel)?m("model.defaultIs",{name:u.defaultModel}):m("model.defaultIsNone")}),(0,a.jsx)("button",{onClick:()=>void y(),disabled:w===(null!=(r=null==u?void 0:u.defaultModel)?r:""),children:w?m("model.makeDefault",{name:w}):m("model.clearDefault")})]}),(null==u?void 0:u.readAt)?(0,a.jsxs)("p",{className:"muted small",style:{marginTop:8},children:[m("model.readAt",{t:h(u.readAt),n:u.options.length}),u.current?" ".concat(m("model.chatWasOn",{name:u.current})):"",u.note?" ".concat(u.note):""]}):(0,a.jsx)("p",{className:"muted small",style:{marginTop:8},children:m("model.neverRead")}),C.length>0&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:m("model.showDetails")}),(0,a.jsx)("pre",{className:"tall",children:C.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 I(e){var s,n;let{session:t,onChange:r}=e,{t:i}=(0,d.kj)(),o=null!=(s=t.review)?s:{enabled:!0,model:""},[m,h]=(0,l.useState)(o.enabled),[u,p]=(0,l.useState)(null!=(n=o.model)?n:""),[x,g]=(0,l.useState)(""),[f,k]=(0,l.useState)(!1),[b,y]=(0,l.useState)("");(0,l.useEffect)(()=>{c.FH.models().then(e=>{var s;return y(null!=(s=e.defaultReviewModel)?s:"")}).catch(()=>void 0)},[]);let N=async()=>{k(!0),g("");try{await c.FH.updateSession(t.id,{review:{enabled:m,model:u}}),g(i("review.saved")),r()}catch(e){g(e.message)}finally{k(!1)}};return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("h2",{className:"grow",style:{margin:0},children:i("review.title")}),(0,a.jsx)("span",{className:"badge ".concat(m?"done":""),children:m?i("review.on"):i("review.off")})]}),(0,a.jsx)("p",{className:"muted small",children:i("review.hint")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:m,onChange:e=>h(e.target.checked),disabled:t.running}),(0,a.jsx)("span",{children:i("review.enable")})]}),(0,a.jsx)("p",{className:"why",children:i("review.enableWhy")})]}),(0,a.jsx)("label",{htmlFor:"review-model",children:i("review.modelField")}),(0,a.jsx)("div",{className:"row",children:(0,a.jsx)(j.Y,{id:"review-model",chosen:u,onChange:p,none:b?i("model.followsDefault",{name:b}):i("review.modelSame"),disabled:t.running||!m})}),(0,a.jsx)("p",{className:"why",children:i("review.modelWhy")}),(0,a.jsx)(v.z4,{current:u,onUse:e=>p(e)}),(0,a.jsxs)("div",{className:"row",style:{marginTop:10},children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void N(),disabled:f||t.running,children:i("review.save")}),x&&(0,a.jsx)("span",{className:"muted small",children:x})]})]})}function T(e){var s,n,t,r,i,o,m,h,u;let{session:p,onChange:x}=e,{t:j}=(0,d.kj)(),g=null!=(n=p.vcs)?n:{enabled:!0,repoDir:"",branchMode:"per-task",commitOnFinish:!0,branchPrefix:"cop/"},[f,k]=(0,l.useState)(g.repoDir),[b,y]=(0,l.useState)(null),[N,w]=(0,l.useState)(""),[C,S]=(0,l.useState)(!1),F=JSON.stringify(g),[D,H]=(0,l.useState)(null),[I,T]=(0,l.useState)(null!=(t=g.branchName)?t:"");(0,l.useEffect)(()=>{var e;return T(null!=(e=JSON.parse(F).branchName)?e:"")},[F]);let[M,P]=(0,l.useState)(null!=(r=g.baseBranch)?r:"");(0,l.useEffect)(()=>{var e;return P(null!=(e=JSON.parse(F).baseBranch)?e:"")},[F]);let W=null!=(i=g.startFrom)?i:"head";(0,l.useEffect)(()=>{k(JSON.parse(F).repoDir)},[F]);let L=JSON.parse(F).repoDir||p.mirror.rootDir||"";(0,l.useEffect)(()=>{let e=!1;return L.trim()?(c.FH.repoCheck(L).then(s=>{var n;e||H(s.ok?null:null!=(n=s.problem)?n:null)}).catch(()=>{e||H(null)}),()=>{e=!0}):void H(null)},[L]);let O=(0,l.useCallback)(()=>{c.FH.vcsStatus(p.id).then(y).catch(()=>y(null))},[p.id]);(0,l.useEffect)(O,[O,F]);let A=async e=>{try{await c.FH.updateSession(p.id,{vcs:e}),w(j("vcs.saved")),x(),O()}catch(e){w(e.message)}},B=async()=>{S(!0),w(j("mirror.browsing"));try{let s=await c.FH.browseFolder(f.trim()||p.mirror.rootDir||void 0);if(s.ok)k(s.path),await A({repoDir:s.path});else{var e;w(s.cancelled?j("mirror.browseCancelled"):null!=(e=s.reason)?e:"")}}finally{S(!1)}},E=g.repoDir||p.mirror.rootDir||"",R=""!==E.trim()&&null===D;return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("h2",{className:"grow",style:{margin:0},children:j("vcs.title")}),(0,a.jsx)("span",{className:"badge ".concat(g.enabled?"done":""),children:g.enabled?j("vcs.on"):j("vcs.off")})]}),(0,a.jsx)("p",{className:"muted small",children:j("vcs.hint")}),(0,a.jsx)("label",{htmlFor:"vcs-root",children:j("vcs.repoField")}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("input",{id:"vcs-root",type:"text",className:"grow",value:f,onChange:e=>k(e.target.value),onBlur:()=>f.trim()!==g.repoDir&&void A({repoDir:f.trim()}),placeholder:p.mirror.rootDir||"C:\\Projects\\my-app",disabled:p.running}),(0,a.jsx)("button",{onClick:()=>void B(),disabled:C||p.running,children:j("mirror.browse")})]}),(0,a.jsx)(v.H4,{current:f,onUse:e=>{k(e),A({repoDir:e})}}),D&&(0,a.jsxs)("div",{className:"notice caution",style:{marginTop:8},children:[(0,a.jsx)("strong",{children:j("vcs.noRepo")}),(0,a.jsx)("div",{className:"small",style:{marginTop:4},children:D}),(0,a.jsx)("div",{className:"muted small",style:{marginTop:6},children:j("vcs.noRepoHow")})]}),!D&&""!==E.trim()&&(0,a.jsx)("p",{className:"muted small",style:{marginTop:4},children:j("vcs.repoOk")}),""===E.trim()&&(0,a.jsx)("p",{className:"muted small",style:{marginTop:4},children:j("vcs.pickFirst")}),(0,a.jsxs)("div",{className:"option".concat(R||g.enabled?"":" warned"),children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:g.enabled,onChange:e=>void A({enabled:e.target.checked}),disabled:p.running||!R&&!g.enabled}),(0,a.jsx)("span",{children:j("vcs.enable")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.enableWhy")})]}),g.enabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"muted small",style:{marginTop:4},children:E?j("vcs.repoIs",{dir:E}):j("vcs.repoNone")}),(0,a.jsx)("h3",{children:j("vcs.branches")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"branchMode",checked:"per-task"===g.branchMode,onChange:()=>void A({branchMode:"per-task"}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.perTask")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.perTaskWhy")})]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"branchMode",checked:"per-session"===g.branchMode,onChange:()=>void A({branchMode:"per-session"}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.perSession")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.perSessionWhy")})]}),"per-session"===g.branchMode&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"vcs-branch-name",children:j("vcs.branchName")}),(0,a.jsx)("input",{id:"vcs-branch-name",type:"text",value:I,onChange:e=>T(e.target.value),onBlur:()=>{var e;return I.trim()!==(null!=(e=g.branchName)?e:"")&&void A({branchName:I.trim()})},placeholder:p.name,disabled:p.running}),(0,a.jsx)("p",{className:"why",children:j("vcs.branchNameWhy")})]}),(0,a.jsx)("h3",{children:j("vcs.startFrom")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"startFrom",checked:"branch"===W,onChange:()=>void A({startFrom:"branch"}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.startBranch")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.startBranchWhy")})]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"startFrom",checked:"previous-session"===W,onChange:()=>void A({startFrom:"previous-session"}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.startPrevious")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.startPreviousWhy")})]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"startFrom",checked:"head"===W,onChange:()=>void A({startFrom:"head"}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.startHead")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.startHeadWhy")})]}),"head"!==W&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"vcs-base-branch",children:j("vcs.baseBranch")}),(0,a.jsx)("input",{id:"vcs-base-branch",type:"text",value:M,onChange:e=>P(e.target.value),onBlur:()=>{var e;return M.trim()!==(null!=(e=g.baseBranch)?e:"")&&void A({baseBranch:M.trim()})},placeholder:"main",disabled:p.running}),(0,a.jsx)("p",{className:"why",children:j("vcs.baseBranchWhy")})]}),p.vcsStart&&(0,a.jsxs)("p",{className:"muted small",children:["previous-session"===p.vcsStart.kind?j("vcs.startedPrevious",{name:null!=(o=null==(s=p.vcsStart.fromSession)?void 0:s.name)?o:"",branch:null!=(m=p.vcsStart.branch)?m:"",commit:p.vcsStart.commit.slice(0,8)}):"branch"===p.vcsStart.kind?j("vcs.startedBranch",{branch:null!=(h=p.vcsStart.branch)?h:"",commit:p.vcsStart.commit.slice(0,8)}):j("vcs.startedHead",{commit:p.vcsStart.commit.slice(0,8)}),p.vcsStart.note?" — ".concat(p.vcsStart.note):""]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:g.commitOnFinish,onChange:e=>void A({commitOnFinish:e.target.checked}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.commit")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.commitWhy")})]}),b&&!b.ok&&(0,a.jsxs)("div",{className:"notice caution",role:"status",children:[(0,a.jsx)("strong",{children:j("vcs.notReady")})," ",b.problem]}),(null==b?void 0:b.ok)&&(0,a.jsx)("div",{className:"muted small",children:j("vcs.ready",{branch:null!=(u=b.branch)?u:"—",dir:b.repoDir})}),(null==b?void 0:b.ok)&&b.work&&b.work.branches.length>0&&(0,a.jsxs)("div",{className:"muted small",children:["per-session"===b.work.mode&&b.work.complete?j("vcs.completeOn",{branch:b.work.complete}):j("vcs.noSingleBranch",{n:b.work.branches.length}),"per-task"===b.work.mode&&(0,a.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:b.work.branches.map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.branch})," — ",e.title,e.commit?"":" (".concat(j("vcs.taskNoFiles"),")")]},e.branch))})]}),(0,a.jsx)("p",{className:"muted small",children:j("vcs.pushIsYours")})]}),(0,a.jsx)("div",{className:"muted small",role:"status",children:N})]})}function M(e){var s,n,t,r;let{session:i,onChange:o}=e,{t:m}=(0,d.kj)(),[h,x]=(0,l.useState)(i.mirror.enabled),[j,f]=(0,l.useState)(i.mirror.rootDir),[k,y]=(0,l.useState)(i.mirror.includeDirs.join("\n")),[N,w]=(0,l.useState)(i.mirror.excludeDirs.join("\n")),[C,S]=(0,l.useState)(null==(s=i.mirror.respectGitignore)||s),[F,D]=(0,l.useState)(null!=(n=i.mirror.includeEnvFiles)&&n),[H,I]=(0,l.useState)(null),[T,M]=(0,l.useState)(null),[W,L]=(0,l.useState)(""),[O,A]=(0,l.useState)(""),[B,E]=(0,l.useState)([]),R=JSON.stringify(i.mirror);(0,l.useEffect)(()=>{var e,s;let n=JSON.parse(R);x(n.enabled),f(n.rootDir),y(n.includeDirs.join("\n")),w(n.excludeDirs.join("\n")),S(null==(e=n.respectGitignore)||e),D(null!=(s=n.includeEnvFiles)&&s)},[R]),(0,l.useEffect)(()=>{c.FH.doctor().then(e=>{var s;return E(null!=(s=e.alwaysIgnoredDirs)?s:[])}).catch(()=>void 0)},[]);let U=p(k),G=p(N),q=function(e,s){let n=e.map(u).filter(Boolean),a=s.map(u).filter(Boolean),l=[];for(let e of n)for(let s of a)if(e.toLowerCase()===s.toLowerCase())l.push({include:e,exclude:s,kind:"same"});else("."===s?"."!==e:e.toLowerCase().startsWith("".concat(s.toLowerCase(),"/")))&&l.push({include:e,exclude:s,kind:"excluded-parent"});return l}(U,G),J={rootDir:j.trim(),includeDirs:U,excludeDirs:G,respectGitignore:C,includeEnvFiles:F},z=h&&!J.rootDir,Z=q.length>0||z,_=JSON.stringify({enabled:i.mirror.enabled,rootDir:i.mirror.rootDir,includeDirs:i.mirror.includeDirs,excludeDirs:i.mirror.excludeDirs,respectGitignore:null==(t=i.mirror.respectGitignore)||t,includeEnvFiles:null!=(r=i.mirror.includeEnvFiles)&&r}),K=JSON.stringify({enabled:h,...J}),Y=async()=>{if(!Z)try{await c.FH.updateSession(i.id,{mirror:{enabled:h,...J}}),A(m("mirror.saved")),o()}catch(e){A(e.message)}},$=async()=>{try{I(await c.FH.dirs(j,C)),A("")}catch(e){A(e.message)}},Q=async()=>{L("browse"),A(m("mirror.browsing"));try{let s=await c.FH.browseFolder(j.trim()||void 0);if(s.ok)f(s.path),I(null),M(null),A("");else{var e;A(s.cancelled?m("mirror.browseCancelled"):null!=(e=s.reason)?e:"")}}catch(e){A(e.message)}finally{L("")}},V=async()=>{if(!J.rootDir)return void A(m("mirror.needRoot"));L("check"),A(m("mirror.checking"));try{M(await c.FH.previewMirror(J)),A("")}catch(e){M(null),A(e.message)}finally{L("")}},X=async e=>{(!e||await (0,b.Z)(m("mirror.envWarn")))&&(D(e),M(null))};return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("h2",{className:"grow",style:{margin:0},children:m("mirror.title")}),(0,a.jsx)("span",{className:"badge ".concat(i.mirror.enabled?"done":""),children:i.mirror.enabled?m("mirror.stateOn"):m("mirror.stateOff")})]}),(0,a.jsx)("p",{className:"muted small",children:m("mirror.hint",{example:"src--test--a.spec.ts.txt"})}),(0,a.jsx)("div",{className:"option",children:(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:h,onChange:e=>x(e.target.checked)}),(0,a.jsx)("span",{children:m("mirror.enable")})]})}),(0,a.jsx)("label",{htmlFor:"mirror-root",children:m("mirror.root")}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("input",{id:"mirror-root",type:"text",className:"grow",value:j,onChange:e=>{f(e.target.value),M(null)},placeholder:"C:\\Projects\\my-app"}),(0,a.jsx)("button",{onClick:()=>void Q(),disabled:"browse"===W,children:m("mirror.browse")}),(0,a.jsx)("button",{onClick:()=>void $(),disabled:!j.trim(),children:m("mirror.listDirs")})]}),(0,a.jsx)("div",{className:"muted small",style:{marginTop:4},children:m("mirror.rootHint")}),(0,a.jsx)(v.H4,{current:j,onUse:e=>{f(e),M(null)}}),H&&(0,a.jsx)("div",{className:"small muted",style:{margin:"6px 0"},children:0===H.length?m("mirror.noDirs"):H.join(" \xb7 ")}),(0,a.jsx)("h3",{children:m("mirror.rules")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:C,onChange:e=>{S(e.target.checked),M(null)}}),(0,a.jsx)("span",{children:m("mirror.gitignore")})]}),(0,a.jsx)("p",{className:"why",children:m("mirror.gitignoreWhy")})]}),(0,a.jsxs)("div",{className:"option".concat(F?" warned":""),children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:F,onChange:e=>X(e.target.checked)}),(0,a.jsx)("span",{children:m("mirror.env")})]}),(0,a.jsx)("p",{className:"why",children:m("mirror.envWhy")}),F&&(0,a.jsx)("p",{className:"why",children:(0,a.jsx)("strong",{children:m("mirror.envOn")})})]}),B.length>0&&(0,a.jsx)("p",{className:"muted small",children:m("mirror.alwaysOut",{dirs:B.join(", ")})}),(0,a.jsxs)("div",{className:"row",style:{alignItems:"flex-start"},children:[(0,a.jsxs)("div",{className:"grow",children:[(0,a.jsx)("label",{htmlFor:"mirror-include",children:m("mirror.include")}),(0,a.jsx)("textarea",{id:"mirror-include",value:k,onChange:e=>{y(e.target.value),M(null)},placeholder:"src\ntests",style:{minHeight:80},"aria-invalid":q.length>0})]}),(0,a.jsxs)("div",{className:"grow",children:[(0,a.jsx)("label",{htmlFor:"mirror-exclude",children:m("mirror.exclude")}),(0,a.jsx)("textarea",{id:"mirror-exclude",value:N,onChange:e=>{w(e.target.value),M(null)},placeholder:"src/generated",style:{minHeight:80},"aria-invalid":q.length>0})]})]}),(0,a.jsx)(g.k,{rootDir:j,respectGitignore:C,includeEnvFiles:F,include:k.split("\n"),exclude:N.split("\n"),onChange:(e,s)=>{y(e.join("\n")),w(s.join("\n")),M(null)}}),q.length>0&&(0,a.jsxs)("div",{className:"notice",role:"alert",children:[(0,a.jsx)("strong",{children:m("mirror.conflict")}),(0,a.jsx)("ul",{children:q.map((e,s)=>(0,a.jsx)("li",{children:"same"===e.kind?m("mirror.conflictSame",{dir:e.include}):m("mirror.conflictParent",{include:e.include,exclude:e.exclude})},s))}),(0,a.jsx)("div",{style:{marginTop:6},children:m("mirror.conflictFix")})]}),z&&(0,a.jsx)("div",{className:"notice caution",role:"alert",children:(0,a.jsx)("strong",{children:m("mirror.needRoot")})}),K!==_&&(0,a.jsxs)("div",{className:"notice caution",role:"status",children:[(0,a.jsx)("strong",{children:m("mirror.unsaved")})," ",m("mirror.unsavedWhy")]}),(0,a.jsxs)("div",{className:"row",style:{marginTop:10},children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void Y(),disabled:Z,children:m("mirror.save")}),(0,a.jsx)("button",{onClick:()=>void V(),disabled:q.length>0||"check"===W,children:m("mirror.check")}),(0,a.jsx)("span",{className:"muted small",role:"status",children:O})]}),T&&(0,a.jsx)(P,{preview:T})]})}function P(e){let{preview:s}=e,{t:n}=(0,d.kj)();return 0===s.files.length?(0,a.jsx)("div",{className:"notice caution",style:{marginTop:10},children:(0,a.jsx)("strong",{children:n("mirror.checkedNone")})}):(0,a.jsxs)("div",{className:"notice calm",style:{marginTop:10},children:[(0,a.jsx)("strong",{children:n("mirror.checked",{files:s.files.length,size:(0,c.zi)(s.totalBytes)})})," ",s.envFiles.length>0&&(0,a.jsx)("span",{className:"err",children:n("mirror.checkedEnv",{n:s.envFiles.length})})," ",s.skipped.length>0&&(0,a.jsx)("span",{className:"muted",children:n("mirror.checkedSkipped",{n:s.skipped.length})}),(0,a.jsxs)("details",{style:{marginTop:6},children:[(0,a.jsx)("summary",{children:n("mirror.showFiles")}),(0,a.jsx)("pre",{className:"tall",children:s.files.join("\n")})]}),s.skipped.length>0&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:n("mirror.showSkipped")}),(0,a.jsx)("pre",{className:"tall",children:s.skipped.map(e=>"".concat(e.relPath," — ").concat(e.reason)).join("\n")})]})]})}function W(e){var s;let{session:n,onChange:t}=e,{t:r}=(0,d.kj)(),[i,o]=(0,l.useState)(""),m=null!=(s=n.onFailure)?s:"stop",h=async e=>{if(e!==m)try{await c.FH.updateSession(n.id,{onFailure:e}),o(r("stop"===e?"chain.savedStop":"chain.savedContinue")),t()}catch(e){o(e.message)}};return(0,a.jsxs)("fieldset",{style:{border:0,padding:0,margin:"10px 0 14px"},children:[(0,a.jsx)("legend",{className:"muted small",style:{padding:0},children:r("chain.title")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"chain",checked:"stop"===m,onChange:()=>void h("stop"),disabled:n.running}),(0,a.jsx)("span",{children:r("chain.stop")})]}),(0,a.jsx)("p",{className:"why",children:r("chain.stopWhy")})]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"chain",checked:"continue"===m,onChange:()=>void h("continue"),disabled:n.running}),(0,a.jsx)("span",{children:r("chain.continue")})]}),(0,a.jsx)("p",{className:"why",children:r("chain.continueWhy")})]}),i&&(0,a.jsx)("div",{className:"muted small",role:"status",children:i}),n.running&&(0,a.jsx)("div",{className:"muted small",children:r("chain.locked")})]})}function L(e){let{value:s,onChange:n,presets:t,onPresetsChanged:r}=e,{t:i}=(0,d.kj)(),[o,m]=(0,l.useState)(""),h=async()=>{let e=prompt(i("l2.saveAsPrompt"));if(e)try{await c.FH.savePreset(e,s),m(i("l2.savedAs",{name:e})),null==r||r()}catch(e){m(e.message)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("label",{className:"grow",style:{margin:0},children:i("l2.label")}),(0,a.jsxs)("select",{value:"",onChange:e=>{let s=t.find(s=>s.name===e.target.value);s&&n(s.content)},children:[(0,a.jsx)("option",{value:"",children:i("l2.loadPreset")}),t.map(e=>(0,a.jsx)("option",{value:e.name,children:e.name},e.name))]}),(0,a.jsx)("button",{onClick:()=>void h(),disabled:!s.trim(),children:i("l2.saveAs")})]}),(0,a.jsx)("textarea",{className:"prose",value:s,onChange:e=>n(e.target.value),placeholder:i("l2.placeholder"),style:{minHeight:140,marginTop:10}}),o&&(0,a.jsx)("div",{className:"muted small",children:o})]})}function O(e){let{session:s}=e,{t:n}=(0,d.kj)(),t=(0,d.W3)(),r=s.tasks.filter(e=>"queued"!==e.status),[i,o]=(0,l.useState)([]),m=i.length>0?i:r.map(e=>e.id),h=e=>(0,c.ub)("".concat(c.nC,"/sessions/").concat(s.id,"/export?variant=").concat(e)+(i.length>0?"&tasks=".concat(encodeURIComponent(i.join(","))):""));return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsx)("h2",{children:n("export.title")}),(0,a.jsx)("p",{className:"muted small",children:n("export.hint")}),0===r.length?(0,a.jsx)("div",{className:"empty",children:n("export.nothing")}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",style:{marginBottom:6},children:[(0,a.jsx)("button",{className:"quiet",onClick:()=>o(r.map(e=>e.id)),children:n("export.all")}),(0,a.jsx)("button",{className:"quiet",onClick:()=>o([]),children:n("export.none")}),(0,a.jsx)("span",{className:"muted small",children:i.length>0?n("export.selected",{n:i.length}):n("export.allOf",{n:r.length})})]}),r.map(e=>{var s,l;return(0,a.jsx)("div",{className:"option",style:{margin:"6px 0"},children:(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:i.includes(e.id),onChange:()=>{let s;return s=e.id,o(e=>e.includes(s)?e.filter(e=>e!==s):[...e,s])}}),(0,a.jsxs)("span",{children:[e.title," ",(0,a.jsx)("span",{className:"badge ".concat(e.status),children:n("status.".concat(e.status))})," ",e.readOnly&&(0,a.jsx)("span",{className:"chip",children:n("task.readOnly")})," ",(0,a.jsx)("span",{className:"muted small",children:t(null!=(l=null!=(s=e.finishedAt)?s:e.startedAt)?l:e.createdAt)})]})]})},e.id)}),(0,a.jsxs)("div",{className:"row",style:{marginTop:10},children:[(0,a.jsx)("a",{className:"button-link",href:h("outcome"),download:!0,children:n("export.outcome",{n:m.length})}),(0,a.jsx)("a",{className:"button-link",href:h("full"),download:!0,children:n("export.full",{n:m.length})})]}),(0,a.jsx)("p",{className:"muted small",style:{marginTop:8},children:n("export.outcomeWhy")})]})]})}function A(e){var s;let{session:n,presets:t,onAdded:r,onPresetsChanged:i}=e,{t:o}=(0,d.kj)(),m=[...n.tasks].reverse()[0],[h,u]=(0,l.useState)(""),[p,x]=(0,l.useState)(null!=(s=null==m?void 0:m.level2)?s:""),[v,j]=(0,l.useState)(""),[g,f]=(0,l.useState)(""),k=async()=>{try{await c.FH.addTask(n.id,{title:h,level2:p,prompt:v}),u(""),j(""),f(o("form.queued")),r()}catch(e){f(e.message)}};return(0,a.jsxs)("div",{className:"panel",id:"new-task",children:[(0,a.jsx)("h2",{children:o("form.title")}),(0,a.jsx)("p",{className:"muted small",children:o("form.hint")}),(0,a.jsx)("label",{children:o("form.titleLabel")}),(0,a.jsx)("input",{type:"text",value:h,onChange:e=>u(e.target.value),placeholder:o("form.titlePlaceholder")}),(0,a.jsx)("div",{style:{marginTop:10},children:(0,a.jsx)(L,{value:p,onChange:x,presets:t,onPresetsChanged:i})}),(0,a.jsx)("label",{children:o("form.taskLabel")}),(0,a.jsx)("textarea",{className:"prose",value:v,onChange:e=>j(e.target.value),placeholder:o("form.taskPlaceholder"),style:{minHeight:140}}),(0,a.jsxs)("div",{className:"row",style:{marginTop:10},children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void k(),disabled:!v.trim(),children:o("form.add")}),(0,a.jsx)("span",{className:"muted small",children:g})]})]})}function B(e){var s,n,t,r,i,u,p,x,v,j,g,N,C,S,F,D,H,I,T,M,P,W,O,A,B,E,U,z,Z,_,K,Y,$,Q,V,X,ee,es,en,ea,el,et,er,ei,ec,ed,eo,em,eh,eu,ep,ex,ev,ej,eg,ef,ek,eb,ey,eN,ew,eC,eS;let{session:eF,task:eD,index:eH,presets:eI,onChange:eT}=e,{t:eM}=(0,d.kj)(),eP=(0,d.W3)(),[eW,eL]=(0,l.useState)(!1),[eO,eA]=(0,l.useState)(!1),[eB,eE]=(0,l.useState)(eD.title),[eR,eU]=(0,l.useState)(eD.level2),[eG,eq]=(0,l.useState)(eD.prompt),[eJ,ez]=(0,l.useState)(null!=(z=null==(s=eD.vcsPlan)?void 0:s.branch)?z:""),[eZ,e_]=(0,l.useState)(null!=(Z=null==(n=eD.vcsPlan)?void 0:n.commitMessage)?Z:""),[eK,eY]=(0,l.useState)(null!=(_=eD.checks)?_:[]),e$=(0,h.c)((0,m.DG)(eD)),[eQ,eV]=(0,l.useState)(null),[eX,e0]=(0,l.useState)(""),e1=async()=>{try{await c.FH.updateTask(eF.id,eD.id,{title:eB,level2:eR,prompt:eG,vcsPlan:{branch:eJ,commitMessage:eZ},checks:eK}),eL(!1),eT()}catch(e){e0(e.message)}},e2="running"===eD.status||"waiting-approval"===eD.status,e4=!e2&&"queued"!==eD.status,e6=!e2&&"queued"!==eD.status,e8=!e2&&null!=(K=null==(t=eF.vcs)?void 0:t.enabled)&&K&&(!!(null==(r=eD.vcs)?void 0:r.baseCommit)||(null!=(Y=eD.attempts)?Y:[]).some(e=>{var s;return null==(s=e.vcs)?void 0:s.baseCommit})),e5=!e2&&("limit-reached"===eD.status||"aborted"===eD.status),e3=async()=>{if(await (0,b.Z)(eM("task.continueConfirm",{title:eD.title})))try{await c.FH.continueTask(eF.id,eD.id),eT()}catch(e){e0(e.message)}},e7=async()=>{if(await (0,b.Z)(eM("task.rerunConfirm",{title:eD.title})))try{await c.FH.rerunTask(eF.id,eD.id),eT()}catch(e){e0(e.message)}},e9=async()=>{if(await (0,b.Z)(eM("task.editRanConfirm",{title:eD.title})))try{await c.FH.rerunTask(eF.id,eD.id,{title:eB,level2:eR,prompt:eG,vcsPlan:{branch:eJ,commitMessage:eZ},checks:eK},{buildOnFinished:"done"===eD.status}),eL(!1),eT()}catch(e){e0(e.message)}},se=(0,w.e)(eT),ss=async()=>{let e="queued"===eD.status?"task.deleteConfirm":"task.deleteConfirmRan";if(await (0,b.Z)(eM(e,{title:eD.title})))try{await c.FH.deleteTask(eF.id,eD.id),eT()}catch(e){e0(e.message)}},sn=async()=>{eQ||eV(await c.FH.taskFiles(eF.id,eD.id))},sa=(e,s,n)=>n.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("span",{className:"muted",children:[eM(e)," "]}),n.map(e=>(0,a.jsx)("span",{style:{marginRight:10},children:(0,a.jsx)(o.u,{label:e,save:()=>c.FH.saveTaskFile(eF.id,eD.id,s,e)})},e))]});return(0,a.jsxs)("div",{className:"task ".concat(eD.status),id:eD.id,children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsxs)("h4",{className:"grow",children:[eH,". ",eD.title]}),(0,a.jsx)("span",{className:"badge ".concat(eD.status),children:eM("status.".concat(eD.status))}),(null!=($=eD.attempt)?$:1)>1&&(0,a.jsx)("span",{className:"chip",children:eM("task.attemptN",{n:null!=(Q=eD.attempt)?Q:1})}),eD.iterations>0&&(0,a.jsx)("span",{className:"muted small",children:eM("task.iterations",{n:eD.iterations})}),eD.runId&&(0,a.jsxs)("button",{className:eO?"":"quiet",onClick:()=>eA(e=>!e),title:(0,m.DG)(eD)?eM("story.showLiveWhy"):eM("story.why"),children:[(0,m.DG)(eD)&&!eO&&(0,a.jsx)("span",{className:"dot","aria-hidden":"true"}),eO?eM("story.hide"):(0,m.DG)(eD)?eM("story.showLive"):eM("story.show")]}),!e2&&(0,a.jsx)("button",{onClick:()=>eL(e=>!e),title:eM("task.editAll"),children:eW?eM("task.cancel"):eM("task.edit")}),e5&&(0,a.jsx)("button",{className:"primary",onClick:()=>void e3(),title:eM("task.continueWhy"),children:eM("task.continue")}),e6&&(0,a.jsx)("button",{className:e5?"":"primary",onClick:()=>void e7(),title:eM("task.rerunWhy"),children:eM("task.rerun")}),e8&&(0,a.jsx)("button",{onClick:()=>void se.restore({sessionId:eF.id,taskId:eD.id,title:eD.title}),disabled:""!==se.busy||eF.running,title:eM("restore.why"),children:"restore"===se.busy?eM("restore.checking"):eM("restore.button")}),e4&&(0,a.jsx)("button",{onClick:()=>void se.restartFrom({sessionId:eF.id,taskId:eD.id,title:eD.title}),disabled:""!==se.busy||eF.running,title:eM("restart.why"),children:"restart"===se.busy?eM("restart.checking"):eM("restart.button")}),!e2&&(0,a.jsx)("button",{className:"danger",onClick:()=>void ss(),children:eM("task.delete")}),!eW&&(eX||se.message)&&(0,a.jsx)("span",{className:"err",role:"alert",children:eX||se.message})]}),(0,a.jsxs)("div",{className:"muted small",children:[eD.startedAt?eM("task.started",{t:eP(eD.startedAt)}):eM("task.added",{t:eP(eD.createdAt)}),eD.finishedAt?" \xb7 ".concat(eM("task.finished",{t:eP(eD.finishedAt)})):"",eD.startedAt&&eD.finishedAt?" \xb7 ".concat(eM("task.took",{d:(0,c.c5)((0,m.d5)(eD.startedAt,eD.finishedAt))})):"",(0,m.DG)(eD)?" \xb7 ".concat(eM("task.runningFor",{d:(0,c.c5)((0,m.d5)(eD.startedAt,void 0,e$))})):""]}),"queued"!==eD.status&&(null==(i=eF.vcs)?void 0:i.enabled)&&eD.vcs&&(0,a.jsx)("div",{className:"muted small",children:eD.vcs.problem&&!eD.vcs.branch?(0,a.jsx)("span",{className:"reason",children:eM("vcs.taskProblem",{problem:eD.vcs.problem})}):(0,a.jsxs)(a.Fragment,{children:[eD.vcs.branch&&eM("vcs.taskBranch",{branch:eD.vcs.branch}),eD.vcs.baseCommit&&" \xb7 ".concat(eM("vcs.taskBase",{commit:eD.vcs.baseCommit.slice(0,8)})),eD.vcs.commit?" \xb7 ".concat(eM("vcs.taskCommit",{commit:eD.vcs.commit.slice(0,8)})):" \xb7 ".concat(eM("vcs.taskNoFiles")),(null!=(V=null==(u=eD.vcs.files)?void 0:u.length)?V:0)>0&&(0,a.jsxs)("details",{style:{display:"inline"},children:[(0,a.jsxs)("summary",{style:{display:"inline",cursor:"pointer"},children:[" \xb7 ",eM("vcs.taskFiles",{n:null!=(X=null==(p=eD.vcs.files)?void 0:p.length)?X:0})]}),(0,a.jsx)("ul",{style:{margin:"4px 0 4px 0",paddingLeft:20},children:(null!=(ee=eD.vcs.files)?ee:[]).map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.path})," ",e.added<0||e.removed<0?eM("vcs.taskBinary"):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{style:{color:"var(--ok)"},children:["+",e.added]})," ",(0,a.jsxs)("span",{style:{color:"var(--bad)"},children:["-",e.removed]})]})]},e.path))})]}),eD.vcs.commit&&eD.vcs.baseCommit&&(0,a.jsxs)(a.Fragment,{children:[" \xb7 ",(0,a.jsx)(y.C,{sessionId:eF.id,taskId:eD.id,title:eD.title,files:null!=(es=null==(x=eD.vcs.files)?void 0:x.length)?es:0})]}),(null!=(en=null==(v=eD.vcs.suspicious)?void 0:v.length)?en:0)>0&&(0,a.jsxs)("div",{className:"err small",style:{marginTop:4},children:[eM("vcs.suspicious",{n:null!=(ea=null==(j=eD.vcs.suspicious)?void 0:j.length)?ea:0}),(0,a.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(el=eD.vcs.suspicious)?el:[]).map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.path})," — ",e.reason]},e.path))})]})]})}),"queued"===eD.status&&(null==(g=eF.vcs)?void 0:g.enabled)&&((null==(N=eD.vcsPlan)?void 0:N.branch)||(null==(C=eD.vcsPlan)?void 0:C.commitMessage))&&(0,a.jsx)("div",{className:"muted small",children:eD.vcsPlan.branch&&eD.vcsPlan.commitMessage?eM("task.gitNames",{branch:eD.vcsPlan.branch,subject:eD.vcsPlan.commitMessage.split("\n")[0]}):eD.vcsPlan.branch?eM("task.gitBranchOnly",{branch:eD.vcsPlan.branch}):eM("task.gitCommitOnly",{subject:(null!=(et=eD.vcsPlan.commitMessage)?et:"").split("\n")[0]})}),eO&&eD.runId&&(0,a.jsx)(f.P,{sessionId:eF.id,taskId:eD.id,live:"running"===eD.status||"waiting-approval"===eD.status}),eW?(0,a.jsxs)("div",{style:{marginTop:8},children:[(0,a.jsx)("label",{children:eM("form.titleLabel")}),(0,a.jsx)("input",{type:"text",value:eB,onChange:e=>eE(e.target.value)}),(0,a.jsx)("div",{style:{marginTop:8},children:(0,a.jsx)(L,{value:eR,onChange:eU,presets:eI})}),(0,a.jsx)("label",{children:eM("form.taskLabel")}),(0,a.jsx)("textarea",{className:"prose",value:eG,onChange:e=>eq(e.target.value)}),(null==(S=eF.vcs)?void 0:S.enabled)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"branch-".concat(eD.id),children:eM("task.branch")}),(0,a.jsx)("input",{id:"branch-".concat(eD.id),type:"text",value:eJ,onChange:e=>ez(e.target.value),placeholder:eF.vcs.branchPrefix,disabled:"per-session"===eF.vcs.branchMode}),(0,a.jsx)("p",{className:"why",children:"per-session"===eF.vcs.branchMode?eM("task.branchIgnored"):eM("task.branchWhy")}),(0,a.jsx)("label",{htmlFor:"commit-".concat(eD.id),children:eM("task.commitMessage")}),(0,a.jsx)("textarea",{id:"commit-".concat(eD.id),value:eZ,onChange:e=>e_(e.target.value),style:{minHeight:70}}),(0,a.jsx)("p",{className:"why",children:eM("task.commitWhy")})]}),(0,a.jsx)(R,{checks:eK,onChange:eY}),(0,a.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void(e4?e9():e1()),children:e4?eM("task.saveAndRerun"):eM("task.save")}),(0,a.jsx)("span",{className:"err",children:eX})]}),e4&&(0,a.jsx)("p",{className:"muted small",children:eM("task.editRanWhy")})]}):(0,a.jsxs)(a.Fragment,{children:[(null!=(er=null==(F=eD.checks)?void 0:F.length)?er:0)>0&&(0,a.jsxs)("details",{className:"small",style:{margin:"6px 0"},children:[(0,a.jsxs)("summary",{children:[eM("checks.title")," — ",eM("checks.n",{n:null!=(ei=null==(D=eD.checks)?void 0:D.length)?ei:0}),(null!=(ec=null==(H=eD.checkResults)?void 0:H.length)?ec:0)>0&&" \xb7 ".concat((null!=(ed=eD.checkResults)?ed:[]).filter(e=>e.passed).length,"/").concat(null==(I=eD.checkResults)?void 0:I.length," ").concat(eM("checks.passed"))]}),(0,a.jsx)("ul",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(eo=eD.checks)?eo:[]).map((e,s)=>{var n;let l=(null!=(n=eD.checkResults)?n:[]).find(s=>s.name===e.name);return(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:e.name}),(0,a.jsxs)("span",{className:"muted",children:[" — ",eM("checks.kind.".concat(e.expect)),e.value?' "'.concat(e.value,'"'):"",e.run?": ".concat(e.run):e.file?": ".concat(e.file):""]}),l&&(0,a.jsxs)("div",{className:l.passed?"muted":"reason",children:[l.passed?eM("checks.passed"):eM("checks.failed")," — ",l.detail]})]},"".concat(e.name,"-").concat(s))})})]}),(null!=(em=null==(T=eD.reviewChecks)?void 0:T.length)?em:0)>0&&(0,a.jsxs)("details",{className:"small",style:{margin:"6px 0"},children:[(0,a.jsx)("summary",{children:eM("checks.fromReview",{n:null!=(eh=null==(M=eD.reviewChecks)?void 0:M.length)?eh:0})}),(0,a.jsx)("p",{className:"why",children:eM("checks.fromReviewWhy")}),(0,a.jsx)("ul",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(eu=eD.reviewChecks)?eu:[]).map(e=>{var s;let n=(null!=(s=eD.checkResults)?s:[]).find(s=>s.name===e.check.name);return(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.findingId})," ",(0,a.jsx)("strong",{children:e.check.name}),"active"!==e.state&&(0,a.jsx)("span",{className:"chip",style:{marginLeft:6},children:eM("checks.state.".concat(e.state))}),(0,a.jsx)("div",{className:"muted",children:e.what}),n&&(0,a.jsxs)("div",{className:n.passed?"muted":"reason",children:[n.passed?eM("checks.passed"):eM("checks.failed")," — ",n.detail]})]},e.check.name)})})]}),(0,a.jsx)(J,{review:eD.review}),eD.summary&&(0,a.jsxs)("div",{className:"summary",children:[(0,a.jsx)("strong",{children:eM("task.whatWasDone")}),(0,a.jsx)(k.s,{text:eD.summary})]}),(null!=(ep=null==(P=eD.deviations)?void 0:P.length)?ep:0)>0&&(0,a.jsx)(G,{items:null!=(ex=eD.deviations)?ex:[]}),(null!=(ev=null==(W=eD.disputes)?void 0:W.length)?ev:0)>0&&(0,a.jsx)(q,{items:null!=(ej=eD.disputes)?ej:[]}),eD.environment&&(0,a.jsx)("div",{className:"muted small",style:{margin:"4px 0"},children:eM("task.ranWith",{node:eD.environment.node,npm:null!=(eg=eD.environment.npm)?eg:"—",git:null!=(ef=eD.environment.git)?ef:"—",pwsh:null!=(eb=null!=(ek=eD.environment.pwsh)?ek:eD.environment.powershell)?eb:"—"})}),(null!=(ey=null==(O=eD.leftovers)?void 0:O.length)?ey:0)>0&&(0,a.jsxs)("div",{className:"err small",style:{margin:"6px 0"},children:[eM("task.leftovers",{n:null!=(eN=null==(A=eD.leftovers)?void 0:A.length)?eN:0}),(0,a.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(ew=eD.leftovers)?ew:[]).map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.name})," pid ",e.pid,e.ports.length>0?" \xb7 ".concat(eM("task.leftoverPorts",{ports:e.ports.join(", ")})):""," \xb7 ",e.by]},"".concat(e.by,"-").concat(e.pid)))})]}),eD.reason&&(0,a.jsx)("div",{className:"reason small",style:{margin:"6px 0"},children:eD.reason}),(null!=(eC=null==(B=eD.attempts)?void 0:B.length)?eC:0)>0&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eM("task.attempts",{n:null!=(eS=null==(E=eD.attempts)?void 0:E.length)?eS:0})}),null==(U=eD.attempts)?void 0:U.map((e,s)=>{var n,l,t,r;return(0,a.jsxs)("div",{className:"small",style:{margin:"8px 0 12px"},children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("strong",{children:eM("task.attemptN",{n:s+1})}),(0,a.jsx)("span",{className:"badge ".concat(e.status),children:eM("status.".concat(e.status))}),e.iterations>0&&(0,a.jsx)("span",{className:"muted",children:eM("task.iterations",{n:e.iterations})}),e.runId&&(0,a.jsx)(o.u,{label:eM("save.attemptLog"),save:()=>c.FH.saveTaskLog(eF.id,eD.id,e.runId)}),e.runId&&(0,a.jsx)(o.H,{sessionId:eF.id,taskId:eD.id,attempt:s+1}),e.runId&&(null==(n=e.vcs)?void 0:n.commit)&&e.vcs.baseCommit&&(0,a.jsx)(y.C,{sessionId:eF.id,taskId:eD.id,runId:e.runId,title:"".concat(eD.title," — ").concat(eM("task.attemptN",{n:s+1})),files:null!=(t=null==(l=e.vcs.files)?void 0:l.length)?t:0})]}),(0,a.jsxs)("div",{className:"muted",children:[e.startedAt?eM("task.started",{t:eP(e.startedAt)}):"",e.finishedAt?" \xb7 ".concat(eM("task.finished",{t:eP(e.finishedAt)})):""]}),e.summary&&(0,a.jsx)("div",{children:e.summary}),e.reason&&(0,a.jsx)("div",{className:"err",children:e.reason}),e.prompt&&e.prompt!==eD.prompt&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eM("task.attemptText")}),(0,a.jsx)("pre",{children:e.prompt})]})]},"".concat(null!=(r=e.runId)?r:s))})]}),"queued"===eD.status?(0,a.jsxs)("div",{style:{marginTop:8},children:[(0,a.jsx)("div",{className:"muted small",children:eM("task.prompt")}),(0,a.jsx)("pre",{children:eD.prompt}),eD.level2.trim()?(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eM("task.l2Show",{n:eD.level2.trim().split("\n").length})}),(0,a.jsx)("pre",{children:eD.level2})]}):(0,a.jsx)("div",{className:"muted small",children:eM("task.noL2")})]}):(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eM("task.promptAndL2")}),eD.level2.trim()&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"muted small",children:eM("task.l2")}),(0,a.jsx)("pre",{children:eD.level2})]}),(0,a.jsx)("div",{className:"muted small",children:eM("task.prompt")}),(0,a.jsx)("pre",{children:eD.prompt})]}),eD.firstMessage&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eM("task.firstMessage")}),(0,a.jsx)("pre",{className:"tall",children:eD.firstMessage})]}),eD.runId&&(0,a.jsxs)("details",{onToggle:e=>e.currentTarget.open&&void sn(),children:[(0,a.jsx)("summary",{children:eM("task.files")}),(0,a.jsx)("div",{className:"row small",style:{margin:"6px 0"},children:(0,a.jsx)(o.u,{label:eM("save.log"),save:()=>c.FH.saveTaskLog(eF.id,eD.id)})}),eQ&&(0,a.jsxs)("div",{className:"small",children:[sa("task.reports","reports",eQ.reports),sa("task.artifacts","artifacts",eQ.artifacts),sa("task.replies","replies",eQ.replies)]})]}),eD.finalReply&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eM("task.finalReply")}),(0,a.jsx)("pre",{className:"tall",children:eD.finalReply})]})]})]})}function E(e){let{events:s}=e,{t:n}=(0,d.kj)(),{appearance:t}=(0,x.K)(),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>{!t.reduceMotion&&r.current&&(r.current.scrollTop=r.current.scrollHeight)},[s.length,t.reduceMotion]),(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsx)("h2",{children:n("live.title")}),(0,a.jsxs)("div",{className:"log",ref:r,children:[0===s.length&&(0,a.jsx)("div",{className:"muted",children:n("live.none")}),s.map((e,s)=>{var n;return(0,a.jsxs)("div",{className:e.level,children:[(0,a.jsx)("span",{className:"time",children:new Date(e.at).toLocaleTimeString(void 0,{hour12:!1})}),null!=(n=e.message)?n:e.type]},s)})]})]})}function R(e){let{checks:s,onChange:n}=e,{t:l}=(0,d.kj)(),t=(e,a)=>n(s.map((s,n)=>e===n?{...s,...a}:s));return(0,a.jsxs)("div",{style:{marginTop:12},children:[(0,a.jsx)("label",{children:l("checks.title")}),(0,a.jsx)("p",{className:"why",style:{marginTop:0},children:l("checks.why")}),0===s.length&&(0,a.jsx)("p",{className:"muted small",children:l("checks.noneWhy")}),s.map((e,r)=>{var i,d,o,m;return(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("input",{type:"text",className:"grow",value:e.name,placeholder:l("checks.namePlaceholder"),onChange:e=>t(r,{name:e.target.value}),"aria-label":l("checks.name")}),(0,a.jsx)("select",{value:e.expect,onChange:e=>t(r,{expect:e.target.value}),"aria-label":l("checks.kind"),style:{width:"auto"},children:c.FZ.map(e=>(0,a.jsx)("option",{value:e,children:l("checks.kind.".concat(e))},e))}),(0,a.jsx)("button",{className:"quiet",onClick:()=>n(s.filter((e,s)=>s!==r)),children:l("checks.remove")})]}),(0,a.jsxs)("div",{className:"row",style:{marginTop:6},children:[(0,c.rt)(e.expect)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{type:"text",className:"grow",value:null!=(i=e.run)?i:"",placeholder:l("checks.run"),onChange:e=>t(r,{run:e.target.value}),"aria-label":l("checks.run")}),(0,a.jsx)("input",{type:"text",value:null!=(d=e.cwd)?d:"",placeholder:l("checks.cwd"),onChange:e=>t(r,{cwd:e.target.value}),"aria-label":l("checks.cwd"),style:{width:220}})]}):(0,a.jsx)("input",{type:"text",className:"grow",value:null!=(o=e.file)?o:"",placeholder:l("checks.file"),onChange:e=>t(r,{file:e.target.value}),"aria-label":l("checks.file")}),(0,c.dK)(e.expect)&&(0,a.jsx)("input",{type:"text",value:null!=(m=e.value)?m:"",placeholder:"output-matches"===e.expect?l("checks.valueRegex"):l("checks.value"),onChange:e=>t(r,{value:e.target.value}),"aria-label":l("checks.value"),style:{width:240}})]})]},r)}),(0,a.jsx)("button",{onClick:()=>n([...s,{name:"",expect:"exit-zero",run:""}]),children:l("checks.add")})]})}function U(e){let{tasks:s}=e,{t:n}=(0,d.kj)(),l=(0,m.hH)(s),t=(0,h.c)(!!l&&l.tasks.some(m.DG));if(!l)return null;let r=(0,m.eZ)(l.run,l.tasks,t);return(0,a.jsx)("p",{className:"muted small",style:{margin:"4px 0 10px"},children:n(r.live?"session.runClockLive":"session.runClock",{n:r.tasks,d:(0,c.c5)(r.ms)})})}function G(e){let{items:s}=e,{t:n}=(0,d.kj)();return(0,a.jsxs)("div",{className:"summary",children:[(0,a.jsx)("strong",{children:n("task.deviations",{n:s.length})}),(0,a.jsx)("ol",{style:{margin:"6px 0",paddingLeft:20},children:s.map((e,s)=>(0,a.jsxs)("li",{style:{marginBottom:6},children:[(0,a.jsx)("div",{children:e.instruction}),(0,a.jsxs)("div",{className:"muted",children:[n("task.deviationDid"),": ",e.did]}),(0,a.jsxs)("div",{className:"muted",children:[n("task.deviationWhy"),": ",e.why]})]},s))})]})}function q(e){let{items:s}=e,{t:n}=(0,d.kj)();return(0,a.jsxs)("div",{className:"summary",children:[(0,a.jsx)("strong",{children:n("task.disputes",{n:s.length})}),(0,a.jsx)("ol",{style:{margin:"6px 0",paddingLeft:20},children:s.map((e,s)=>(0,a.jsxs)("li",{style:{marginBottom:6},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("code",{children:e.finding})," — ",e.why]}),(0,a.jsxs)("div",{className:"muted",children:[n("review.evidence"),": ",e.evidence]})]},s))})]})}function J(e){var s,n,l,t,r;let{review:i}=e,{t:c}=(0,d.kj)();if(!i||"skipped"===i.verdict)return null;let o="pass"===i.verdict?"done":"fail"===i.verdict?"blocked":"waiting-approval";return(0,a.jsxs)("div",{className:"small",style:{margin:"8px 0"},children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("span",{className:"badge ".concat(o),children:c("review.verdict.".concat(i.verdict))}),i.stepsRun>0&&(0,a.jsx)("span",{className:"muted",children:c("review.ran",{n:i.stepsRun})}),i.rounds>1&&(0,a.jsx)("span",{className:"muted",children:c("review.rounds",{n:i.rounds})}),i.model&&(0,a.jsx)("span",{className:"chip",children:c("review.onModel",{model:i.model})})]}),i.problem&&(0,a.jsx)("p",{className:"reason",children:c("review.problem",{problem:i.problem})}),i.summary&&(0,a.jsx)(k.s,{text:i.summary}),(null!=(l=null==(s=i.findings)?void 0:s.length)?l:0)>0&&(0,a.jsxs)("details",{style:{marginTop:4},children:[(0,a.jsx)("summary",{children:c("review.findings",{n:null!=(t=null==(n=i.findings)?void 0:n.length)?t:0})}),(0,a.jsx)("ol",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(r=i.findings)?r:[]).map((e,s)=>(0,a.jsxs)("li",{style:{marginBottom:8},children:[(0,a.jsxs)("div",{children:[e.id&&(0,a.jsx)("code",{style:{marginRight:6},children:e.id}),e.what,"task"===e.about&&(0,a.jsx)("span",{className:"chip",style:{marginLeft:6},children:c("review.aboutTask")}),e.repeated&&(0,a.jsx)("span",{className:"chip",style:{marginLeft:6},children:c("review.repeated")})]}),e.where&&(0,a.jsx)("div",{className:"muted",children:e.where}),(0,a.jsxs)("div",{className:"muted",children:[c("review.evidence"),": ",e.evidence]})]},s))})]})]})}},4784:(e,s,n)=>{"use strict";n.d(s,{Y:()=>i});var a=n(3365),l=n(1521),t=n(5549),r=n(867);function i(e){var s,n;let{id:i,chosen:c,onChange:d,none:o,catalogue:m,disabled:h=!1,style:u}=e,{t:p}=(0,r.kj)(),x=function(e){let[s,n]=(0,l.useState)(null);return(0,l.useEffect)(()=>{if(void 0!==e)return;let s=!0;return t.FH.models().then(e=>{s&&n(e)}).catch(()=>void 0),()=>{s=!1}},[e]),void 0!==e?e:s}(m),v=null!=(s=null==x?void 0:x.options)?s:[],j=v.some(e=>e.name===c),g=v.filter(e=>!e.group),f=new Map;for(let e of v)e.group&&f.set(e.group,[...null!=(n=f.get(e.group))?n:[],e]);return(0,a.jsxs)("select",{id:i,value:c,onChange:e=>d(e.target.value),disabled:h,style:{width:"auto",minWidth:280,...u},children:[(0,a.jsx)("option",{value:"",children:o}),c&&!j&&(0,a.jsx)("option",{value:c,children:p("model.notInList",{name:c})}),g.map(e=>(0,a.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,n]=e;return(0,a.jsx)("optgroup",{label:s,children:n.map(e=>(0,a.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(p("model.unavailable")):""]},e.name))},s)})]})}},8848:(e,s,n)=>{"use strict";n.d(s,{H4:()=>d,L:()=>o,z4:()=>m});var a=n(3365),l=n(8197),t=n.n(l),r=n(1521),i=n(5549),c=n(867);function d(e){let{current:s,onUse:n}=e,{t:l}=(0,c.kj)(),[t,d]=(0,r.useState)(null);if((0,r.useEffect)(()=>{let e=!1;return i.FH.project().then(s=>{e||d(s)}).catch(()=>void 0),()=>{e=!0}},[]),!t)return null;let o=t.rootDir.trim(),m=s.trim().toLowerCase(),h=n?t.others.filter(e=>e.rootDir.trim().toLowerCase()!==m):[];return(0,a.jsx)(u,{label:o?l("proj.defaultIs",{dir:o}):l("proj.noneShort"),offer:o&&n&&m!==o.toLowerCase()?{text:l("proj.useIt"),onUse:()=>n(o)}:void 0,more:h.map(e=>({text:l("proj.otherUse",{name:e.name}),title:e.rootDir,onUse:()=>null==n?void 0:n(e.rootDir)})),link:o?l("proj.change"):l("proj.setIt"),anchor:"project"})}function o(e){let{current:s,onUse:n}=e,l=h(),{t}=(0,c.kj)();if(!l)return null;let r=l.defaultModel.trim();return(0,a.jsx)(u,{label:r?t("def.modelDefaultIs",{name:r}):t("def.modelNoneShort"),offer:r&&n&&s.trim()!==r?{text:t("def.modelUseIt"),onUse:()=>n(r)}:void 0,link:t(r?"proj.change":"proj.setIt"),anchor:"model"})}function m(e){let{current:s,onUse:n}=e,l=h(),{t}=(0,c.kj)();if(!l)return null;let r=l.defaultReviewModel.trim();return(0,a.jsx)(u,{label:r?t("def.reviewDefaultIs",{name:r}):t("def.reviewNoneShort"),offer:r&&n&&s.trim()!==r?{text:t("def.modelUseIt"),onUse:()=>n(r)}:void 0,link:t(r?"proj.change":"proj.setIt"),anchor:"review"})}function h(){let[e,s]=(0,r.useState)(null);return(0,r.useEffect)(()=>{let e=!1;return i.FH.models().then(n=>{e||s(n)}).catch(()=>void 0),()=>{e=!0}},[]),e}function u(e){let{label:s,offer:n,more:l=[],link:r,anchor:i}=e;return(0,a.jsxs)("p",{className:"muted small",style:{marginTop:4},children:[s," ",n&&(0,a.jsxs)(a.Fragment,{children:["\xb7"," ",(0,a.jsx)("button",{type:"button",className:"linkish",onClick:n.onUse,children:n.text})," "]}),l.map(e=>(0,a.jsxs)("span",{children:["\xb7"," ",(0,a.jsx)("button",{type:"button",className:"linkish",onClick:e.onUse,title:e.title,children:e.text})," "]},e.text)),"\xb7 ",(0,a.jsx)(t(),{href:"/defaults#".concat(i),children:r})]})}}},e=>{e.O(0,[197,867,549,723,347,131,358],()=>e(e.s=1772)),_N_E=e.O()}]);
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html><!--DCpEMjhrg9APkRwBBw5Do--><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/b67acb571615432b.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-4aa80f5a32311bce.js" async=""></script><script src="/_next/static/chunks/549-33f0d3d53338b2f2.js" async=""></script><script src="/_next/static/chunks/app/layout-e0174d863960f109.js" async=""></script><script src="/_next/static/chunks/app/appearance/page-501842e7aeac7f6b.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><!--kysrkUS5Y_ZTHsIIXgs3q--><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/b67acb571615432b.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-3d4ee08c5f9f0e71.js" async=""></script><script src="/_next/static/chunks/549-33f0d3d53338b2f2.js" async=""></script><script src="/_next/static/chunks/app/layout-e0174d863960f109.js" async=""></script><script src="/_next/static/chunks/app/appearance/page-501842e7aeac7f6b.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;
@@ -12,4 +12,4 @@
12
12
  d.dataset.focus = a.strongFocus ? 'strong' : 'normal';
13
13
  } catch (e) {}
14
14
  })();
15
- </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">Normal</button><button type="button" aria-pressed="false">Large</button><button type="button" aria-pressed="false">Largest</button></div><p class="muted small" style="margin-top:6px">Scales the whole interface, not only the body text.</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[1205,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-4aa80f5a32311bce.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"themeScript\"]\n3:I[1205,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-4aa80f5a32311bce.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"AppearanceProvider\"]\n4:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-4aa80f5a32311bce.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"LanguageProvider\"]\n5:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-4aa80f5a32311bce.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"DialogHost\"]\n6:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-4aa80f5a32311bce.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"SkipLink\"]\n7:I[8197,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-4aa80f5a32311bce.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"\"]\n8:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-4aa80f5a32311bce.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"Nav\"]\n9:I[6657,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-4aa80f5a32311bce.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"GlobalApprovals\"]\na:I[5204,[],\"\"]\nb:I[2642,[],\"\"]\nc:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-4aa80f5a32311bce.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"ScrollJump\"]\nd:I[7089,[],\"ClientPageRoot\"]\ne:I[4585,[\"867\",\"stat"])</script><script>self.__next_f.push([1,"ic/chunks/867-4aa80f5a32311bce.js\",\"429\",\"static/chunks/app/appearance/page-501842e7aeac7f6b.js\"],\"default\"]\n11:I[433,[],\"OutletBoundary\"]\n13:I[9884,[],\"AsyncMetadataOutlet\"]\n15:I[433,[],\"ViewportBoundary\"]\n17:I[433,[],\"MetadataBoundary\"]\n18:\"$Sreact.suspense\"\n1a:I[3536,[],\"\"]\n:HL[\"/_next/static/css/b67acb571615432b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"DCpEMjhrg9APkRwBBw5Do\",\"p\":\"\",\"c\":[\"\",\"appearance\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"appearance\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/b67acb571615432b.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\":\"$2\"}}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$L5\",null,{\"children\":[[\"$\",\"$L6\",null,{}],[\"$\",\"div\",null,{\"className\":\"wrap\",\"children\":[[\"$\",\"header\",null,{\"className\":\"top\",\"children\":[[\"$\",\"h1\",null,{\"children\":[\"$\",\"$L7\",null,{\"href\":\"/\",\"children\":\"copilot-operator\"}]}],[\"$\",\"$L8\",null,{}]]}],[\"$\",\"$L9\",null,{}],[\"$\",\"main\",null,{\"id\":\"main\",\"children\":[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lb\",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\"}]}]]}],[\"$\",\"$Lc\",null,{}]]}]}]}]}]]}]]}],{\"children\":[\"appearance\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$Ld\",null,{\"Component\":\"$e\",\"searchParams\":{},\"params\":{},\"promises\":[\"$@f\",\"$@10\"]}],null,[\"$\",\"$L11\",null,{\"children\":[\"$L12\",[\"$\",\"$L13\",null,{\"promise\":\"$@14\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[[\"$\",\"$L15\",null,{\"children\":\"$L16\"}],null],[\"$\",\"$L17\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$18\",null,{\"fallback\":null,\"children\":\"$L19\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$1a\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"f:{}\n10:\"$0:f:0:1:2:children:2:children:1:props:children:0:props:params\"\n"])</script><script>self.__next_f.push([1,"16:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n12:null\n"])</script><script>self.__next_f.push([1,"14:{\"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,"19:\"$14:metadata\"\n"])</script></body></html>
15
+ </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">Normal</button><button type="button" aria-pressed="false">Large</button><button type="button" aria-pressed="false">Largest</button></div><p class="muted small" style="margin-top:6px">Scales the whole interface, not only the body text.</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[1205,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-3d4ee08c5f9f0e71.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"themeScript\"]\n3:I[1205,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-3d4ee08c5f9f0e71.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"AppearanceProvider\"]\n4:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-3d4ee08c5f9f0e71.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"LanguageProvider\"]\n5:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-3d4ee08c5f9f0e71.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"DialogHost\"]\n6:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-3d4ee08c5f9f0e71.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"SkipLink\"]\n7:I[8197,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-3d4ee08c5f9f0e71.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"\"]\n8:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-3d4ee08c5f9f0e71.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"Nav\"]\n9:I[6657,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-3d4ee08c5f9f0e71.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"GlobalApprovals\"]\na:I[5204,[],\"\"]\nb:I[2642,[],\"\"]\nc:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-3d4ee08c5f9f0e71.js\",\"549\",\"static/chunks/549-33f0d3d53338b2f2.js\",\"177\",\"static/chunks/app/layout-e0174d863960f109.js\"],\"ScrollJump\"]\nd:I[7089,[],\"ClientPageRoot\"]\ne:I[4585,[\"867\",\"stat"])</script><script>self.__next_f.push([1,"ic/chunks/867-3d4ee08c5f9f0e71.js\",\"429\",\"static/chunks/app/appearance/page-501842e7aeac7f6b.js\"],\"default\"]\n11:I[433,[],\"OutletBoundary\"]\n13:I[9884,[],\"AsyncMetadataOutlet\"]\n15:I[433,[],\"ViewportBoundary\"]\n17:I[433,[],\"MetadataBoundary\"]\n18:\"$Sreact.suspense\"\n1a:I[3536,[],\"\"]\n:HL[\"/_next/static/css/b67acb571615432b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"kysrkUS5Y-ZTHsIIXgs3q\",\"p\":\"\",\"c\":[\"\",\"appearance\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"appearance\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/b67acb571615432b.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\":\"$2\"}}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$L5\",null,{\"children\":[[\"$\",\"$L6\",null,{}],[\"$\",\"div\",null,{\"className\":\"wrap\",\"children\":[[\"$\",\"header\",null,{\"className\":\"top\",\"children\":[[\"$\",\"h1\",null,{\"children\":[\"$\",\"$L7\",null,{\"href\":\"/\",\"children\":\"copilot-operator\"}]}],[\"$\",\"$L8\",null,{}]]}],[\"$\",\"$L9\",null,{}],[\"$\",\"main\",null,{\"id\":\"main\",\"children\":[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lb\",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\"}]}]]}],[\"$\",\"$Lc\",null,{}]]}]}]}]}]]}]]}],{\"children\":[\"appearance\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$La\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$Lb\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$Ld\",null,{\"Component\":\"$e\",\"searchParams\":{},\"params\":{},\"promises\":[\"$@f\",\"$@10\"]}],null,[\"$\",\"$L11\",null,{\"children\":[\"$L12\",[\"$\",\"$L13\",null,{\"promise\":\"$@14\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[[\"$\",\"$L15\",null,{\"children\":\"$L16\"}],null],[\"$\",\"$L17\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$18\",null,{\"fallback\":null,\"children\":\"$L19\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$1a\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"f:{}\n10:\"$0:f:0:1:2:children:2:children:1:props:children:0:props:params\"\n"])</script><script>self.__next_f.push([1,"16:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n12:null\n"])</script><script>self.__next_f.push([1,"14:{\"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,"19:\"$14:metadata\"\n"])</script></body></html>