copilot-operator 0.1.17 → 0.1.19

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 (56) hide show
  1. package/dist/src/api/operator.service.js +33 -2
  2. package/dist/src/cli.js +11 -29
  3. package/dist/src/config/version.js +30 -0
  4. package/dist/src/orchestrator/derivedChecks.js +19 -1
  5. package/dist/src/orchestrator/review.js +2 -2
  6. package/dist/src/orchestrator/taskRunner.js +130 -10
  7. package/dist/src/plan/brief.js +38 -4
  8. package/dist/src/plan/importPlan.js +42 -1
  9. package/dist/src/plan/schema.js +53 -0
  10. package/dist/src/plan/systemGuide.js +50 -2
  11. package/dist/src/protocol/replySchema.js +1 -1
  12. package/dist/src/protocol/reviewSchema.js +10 -5
  13. package/dist/src/session/exports.js +53 -13
  14. package/dist/src/session/model.js +20 -0
  15. package/dist/src/session/store.js +80 -0
  16. package/dist/src/vcs/artifacts.js +185 -0
  17. package/dist/src/vcs/inputs.js +449 -0
  18. package/dist/src/vcs/snapshot.js +174 -22
  19. package/dist/src/vcs/taskVcs.js +272 -37
  20. package/dist/web/404.html +2 -2
  21. package/dist/web/_next/static/chunks/549-5d7c845fb0a27dbe.js +1 -0
  22. package/dist/web/_next/static/chunks/867-d9c54f7a2b285b3f.js +1 -0
  23. package/dist/web/_next/static/chunks/app/appearance/page-a18019cdc395de3d.js +1 -0
  24. package/dist/web/_next/static/chunks/app/history/page-a0bd59986f7c8beb.js +1 -0
  25. package/dist/web/_next/static/chunks/app/layout-3efbb282292ccc38.js +1 -0
  26. package/dist/web/_next/static/chunks/app/sessions/view/page-99f9153fd75078d0.js +1 -0
  27. package/dist/web/_next/static/chunks/app/system/page-5ae1f8054208e6eb.js +1 -0
  28. package/dist/web/appearance.html +2 -2
  29. package/dist/web/appearance.txt +25 -26
  30. package/dist/web/defaults.html +2 -2
  31. package/dist/web/defaults.txt +25 -26
  32. package/dist/web/history.html +2 -2
  33. package/dist/web/history.txt +25 -26
  34. package/dist/web/import.html +2 -2
  35. package/dist/web/import.txt +25 -26
  36. package/dist/web/index.html +2 -2
  37. package/dist/web/index.txt +25 -26
  38. package/dist/web/level1.html +2 -2
  39. package/dist/web/level1.txt +25 -26
  40. package/dist/web/presets.html +2 -2
  41. package/dist/web/presets.txt +25 -26
  42. package/dist/web/sessions/view.html +2 -2
  43. package/dist/web/sessions/view.txt +25 -26
  44. package/dist/web/system.html +2 -2
  45. package/dist/web/system.txt +25 -26
  46. package/package.json +8 -3
  47. package/prompts/level1.md +547 -546
  48. package/dist/web/_next/static/chunks/549-a13ae394c5e6a837.js +0 -1
  49. package/dist/web/_next/static/chunks/867-7f27ef819d251cc5.js +0 -1
  50. package/dist/web/_next/static/chunks/app/appearance/page-9b13583bfee63b32.js +0 -1
  51. package/dist/web/_next/static/chunks/app/history/page-d7314ac22d47a3ab.js +0 -1
  52. package/dist/web/_next/static/chunks/app/layout-560bd6d173302e5a.js +0 -1
  53. package/dist/web/_next/static/chunks/app/sessions/view/page-d28825430ca280de.js +0 -1
  54. package/dist/web/_next/static/chunks/app/system/page-3aa2a0fef5454e69.js +0 -1
  55. /package/dist/web/_next/static/{kkxFcGzA9Uo1uRAgcoDti → ofnRLEgWx9th5w_qtuFnB}/_buildManifest.js +0 -0
  56. /package/dist/web/_next/static/{kkxFcGzA9Uo1uRAgcoDti → ofnRLEgWx9th5w_qtuFnB}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[429],{4585:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>r});var n=t(3365),s=t(8078),l=t(867);function r(){let{t:e}=(0,l.kj)(),{appearance:a,set:t,reset:r,loaded:o}=(0,s.KP)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"panel",children:[(0,n.jsx)("h2",{children:e("ap.title")}),(0,n.jsx)("p",{className:"muted small",children:e("ap.hint")}),(0,n.jsx)("h3",{children:e("ap.theme")}),(0,n.jsx)("div",{className:"segmented",role:"group","aria-label":e("ap.theme"),children:[{value:"light",label:"theme.light"},{value:"dark",label:"theme.dark"}].map(s=>(0,n.jsx)("button",{type:"button","aria-pressed":o&&a.theme===s.value,onClick:()=>t({theme:s.value}),children:e(s.label)},s.value))}),(0,n.jsx)("p",{className:"muted small",style:{marginTop:6},children:e("ap.themeWhy")})]}),(0,n.jsxs)("div",{className:"panel",children:[(0,n.jsx)("h2",{children:e("ap.a11y")}),(0,n.jsx)("p",{className:"muted small",children:e("ap.a11yHint")}),(0,n.jsx)("h3",{children:e("ap.size")}),(0,n.jsx)("div",{className:"segmented",role:"group","aria-label":e("ap.size"),children:[{value:"small",label:"ap.sizeSmall"},{value:"normal",label:"ap.sizeNormal"},{value:"large",label:"ap.sizeLarge"},{value:"huge",label:"ap.sizeHuge"},{value:"giant",label:"ap.sizeGiant"}].map(s=>(0,n.jsx)("button",{type:"button","aria-pressed":o&&a.textSize===s.value,onClick:()=>t({textSize:s.value}),children:e(s.label)},s.value))}),(0,n.jsx)("p",{className:"muted small",style:{marginTop:6},children:e("ap.sizeWhy")}),(0,n.jsx)(i,{name:"highContrast",label:"ap.contrast",why:"ap.contrastWhy"}),(0,n.jsx)(i,{name:"reduceMotion",label:"ap.motion",why:"ap.motionWhy"}),(0,n.jsx)(i,{name:"underlineLinks",label:"ap.links",why:"ap.linksWhy"}),(0,n.jsx)(i,{name:"strongFocus",label:"ap.focus",why:"ap.focusWhy"}),(0,n.jsx)("div",{className:"row",style:{marginTop:12},children:(0,n.jsx)("button",{onClick:r,children:e("ap.reset")})})]}),(0,n.jsxs)("div",{className:"panel",children:[(0,n.jsx)("h2",{children:e("ap.example")}),(0,n.jsxs)("p",{className:"small",children:[e("ap.exampleText")," ",(0,n.jsx)("a",{href:"#main",children:e("ap.exampleLink")})]}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("span",{className:"badge done",children:e("status.done")}),(0,n.jsx)("span",{className:"badge running",children:e("status.running")}),(0,n.jsx)("span",{className:"badge waiting-approval",children:e("status.waiting-approval")}),(0,n.jsx)("span",{className:"badge failed",children:e("status.failed")})]}),(0,n.jsxs)("div",{className:"summary",style:{marginTop:10},children:[(0,n.jsx)("strong",{children:e("task.whatWasDone")}),(0,n.jsx)("div",{children:e("ap.exampleText")})]}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{className:"primary",children:e("approval.run")}),(0,n.jsx)("button",{children:e("approval.skip")}),(0,n.jsx)("button",{className:"danger",children:e("approval.abort")})]})]})]})}function i(e){let{name:a,label:t,why:r}=e,{t:i}=(0,l.kj)(),{appearance:o,set:c}=(0,s.KP)();return(0,n.jsxs)("div",{className:"option",children:[(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:o[a],onChange:e=>c({[a]:e.target.checked})}),(0,n.jsx)("span",{children:i(t)})]}),(0,n.jsx)("p",{className:"why",children:i(r)})]})}},6876:(e,a,t)=>{Promise.resolve().then(t.bind(t,4585))},8078:(e,a,t)=>{"use strict";t.d(a,{AppearanceProvider:()=>d,KP:()=>h});var n=t(3365),s=t(1521);let l="cop.appearance",r=["small","normal","large","huge","giant"];"\n(function () {\n try {\n var d = document.documentElement;\n var raw = localStorage.getItem('".concat(l,"');\n var a = raw ? JSON.parse(raw) : {};\n if (!a || typeof a !== 'object') a = {};\n d.dataset.theme = a.theme === 'dark' ? 'dark' : 'light';\n d.dataset.textsize = ").concat(JSON.stringify(r),".indexOf(a.textSize) >= 0 ? a.textSize : 'normal';\n d.dataset.contrast = a.highContrast ? 'high' : 'normal';\n d.dataset.motion = a.reduceMotion ? 'reduced' : 'normal';\n d.dataset.links = a.underlineLinks ? 'underline' : 'plain';\n d.dataset.focus = a.strongFocus ? 'strong' : 'normal';\n } catch (e) {}\n})();\n");let i={theme:"light",textSize:"normal",highContrast:!1,reduceMotion:!1,underlineLinks:!1,strongFocus:!1};function o(e){let a=document.documentElement;a.dataset.theme=e.theme,a.dataset.textsize=e.textSize,a.dataset.contrast=e.highContrast?"high":"normal",a.dataset.motion=e.reduceMotion?"reduced":"normal",a.dataset.links=e.underlineLinks?"underline":"plain",a.dataset.focus=e.strongFocus?"strong":"normal"}let c=(0,s.createContext)({appearance:i,set:()=>void 0,reset:()=>void 0,loaded:!1});function d(e){let{children:a}=e,[t,d]=(0,s.useState)(i),[h,m]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e=i;try{let a=window.localStorage.getItem(l);a?e=function(e){let a=e&&"object"==typeof e?e:{},t=(e,a)=>"boolean"==typeof e?e:a;return{theme:"dark"===a.theme?"dark":"light"===a.theme?"light":i.theme,textSize:r.includes(a.textSize)?a.textSize:i.textSize,highContrast:t(a.highContrast,i.highContrast),reduceMotion:t(a.reduceMotion,i.reduceMotion),underlineLinks:t(a.underlineLinks,i.underlineLinks),strongFocus:t(a.strongFocus,i.strongFocus)}}(JSON.parse(a)):window.matchMedia("(prefers-color-scheme: dark)").matches&&(e={...e,theme:"dark"}),window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!a&&(e={...e,reduceMotion:!0})}catch(e){}d(e),o(e),m(!0)},[]);let u=(0,s.useCallback)(e=>{d(a=>{let t={...a,...e};o(t);try{window.localStorage.setItem(l,JSON.stringify(t))}catch(e){}return t})},[]),p=(0,s.useCallback)(()=>{d(i),o(i);try{window.localStorage.removeItem(l)}catch(e){}},[]);return(0,n.jsx)(c.Provider,{value:{appearance:t,set:u,reset:p,loaded:h},children:a})}function h(){return(0,s.useContext)(c)}}},e=>{e.O(0,[867,347,131,358],()=>e(e.s=6876)),_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:()=>F});var n=t(3365),a=t(1521),l=t(8197),i=t.n(l),r=t(5549),d=t(7527),c=t(4969),o=t(1366),u=t(3523),h=t(3374),m=t(867),g=t(1910),p=t(5132);function x(){let{t:e}=(0,m.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)(p.s,{text:e("row.infoWhich"),className:"small"})]})]})}function j(e){let{onChange:s}=e,{t}=(0,m.kj)(),[l,i]=(0,a.useState)(null),[c,o]=(0,a.useState)(!1),[u,h]=(0,a.useState)(""),g=(0,a.useCallback)(async()=>{try{i(await r.FH.batch())}catch(e){}},[]);(0,d.z)(g,3e3);let p=async e=>{o(!0),h("");try{"pause"===e?await r.FH.pauseBatch():"resume"===e?await r.FH.resumeBatch():await r.FH.stopBatch(),await g(),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:c,onClick:()=>void p("resume"),title:t("batch.resumeWhy"),children:t("batch.resume")}):(0,n.jsx)("button",{disabled:c||l.stopping,onClick:()=>void p("pause"),title:t("batch.pauseWhy"),children:t("batch.pause")}),(0,n.jsx)("button",{className:"danger",disabled:c||l.stopping,onClick:()=>void p("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 v=t(3041),k=t(1035),N=t(8934),f=t(4811),b=t(2876);let w=["queued","running","waiting-approval"],y=["blocked","failed","aborted","limit-reached"],I=e=>!!e.continuable;function C(e){let{run:s}=e,{t}=(0,m.kj)(),a=s.entries.some(u.DG),l=(0,h.c)(a),i=(0,u.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 S(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 F(){let{t:e}=(0,m.kj)(),s=(0,m.W3)(),[t,l]=(0,a.useState)(null),[i,c]=(0,a.useState)(""),[o,u]=(0,a.useState)(""),[h,g]=(0,a.useState)("flow"),[p,x]=(0,a.useState)(""),[v,k]=(0,a.useState)(""),[N,f]=(0,a.useState)(""),b=(0,a.useCallback)(async()=>{try{l(await r.FH.tasks()),u(new Date().toISOString()),c("")}catch(e){c(e.message)}},[]);(0,d.z)(b,6e3);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]),C=(0,a.useMemo)(()=>{let e=N.trim().toLowerCase();return(null!=t?t:[]).filter(s=>{var t,n;return(!p||s.sessionId===p)&&(!v||s.status===v)&&(!e||"".concat(s.title," ").concat(null!=(t=s.summary)?t:""," ").concat(null!=(n=s.reason)?n:""," ").concat(s.sessionName).toLowerCase().includes(e))})},[t,p,v,N]),F=(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=>y.includes(e.status)).length}},[t]),H=(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]),P=(0,a.useMemo)(()=>S(C),[C]),E=C.filter(e=>"running"===e.status||"waiting-approval"===e.status),O=C.filter(e=>"queued"===e.status),_=[...C.filter(e=>y.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}),B=C.filter(e=>!w.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)}),z=""!==p||""!==v||""!==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 b(),children:e("reg.refresh")})]}),(0,n.jsx)("p",{className:"muted small",children:e("reg.hint")}),(0,n.jsx)(G,{sessions:I}),(0,n.jsxs)("div",{className:"counts",children:[(0,n.jsxs)("div",{className:"count",children:[(0,n.jsx)("div",{className:"n",children:F.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:F.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:F.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:F.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:F.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:v,onChange:e=>k(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=>f(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:()=>g("flow"),children:e("reg.viewFlow")}),(0,n.jsx)("button",{type:"button","aria-pressed":"runs"===h,onClick:()=>g("runs"),children:e("reg.groupBy")}),(0,n.jsx)("button",{type:"button","aria-pressed":"list"===h,onClick:()=>g("list"),children:e("reg.viewList")})]})]}),z&&(0,n.jsx)("button",{className:"quiet",onClick:()=>{x(""),k(""),f("")},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===C.length&&(0,n.jsx)("div",{className:"empty",children:e("reg.noMatch")})]}),"list"===h&&C.length>0&&(0,n.jsx)(M,{entries:[...E,...O,...B]}),"runs"===h&&C.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")})]}),P.runs.map(e=>(0,n.jsxs)("section",{className:"panel",children:[(0,n.jsx)(W,{run:e}),(0,n.jsx)(R,{entries:e.entries,sizes:H,onChange:()=>void b()})]},e.id)),P.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)(R,{entries:P.loose,sizes:H,onChange:()=>void b()})]})]}),"flow"===h&&(0,n.jsxs)(n.Fragment,{children:[E.length>0&&(0,n.jsxs)("section",{className:"panel",children:[(0,n.jsx)("h2",{children:e("reg.activeNow")}),(0,n.jsx)(R,{entries:E,sizes:H,onChange:()=>void b()})]}),C.length>0&&(0,n.jsxs)("div",{style:{marginBottom:12},children:[(0,n.jsx)(j,{onChange:()=>void b()}),C.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:C.filter(e=>e.interrupted&&!e.sessionRunning).length})]}),(0,n.jsx)(D,{entries:C,onChange:()=>void b()})]}),C.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===B.length?(0,n.jsx)("div",{className:"empty",children:e("reg.noPast")}):(0,n.jsx)(q,{entries:B,sizes:H,onChange:()=>void b()})]}),C.length>0&&(0,n.jsx)("section",{className:"panel",children:(0,n.jsxs)(T,{count:_.length,children:[(0,n.jsx)("p",{className:"muted small",children:e("reg.upcomingHint")}),0===_.length?(0,n.jsx)("div",{className:"empty",children:e("reg.noUpcoming")}):(0,n.jsx)(R,{entries:_,upcoming:!0,sizes:H,onChange:()=>void b()})]})}),t&&t.length>0&&(0,n.jsx)(A,{refreshKey:o})]})]})}let H="cop.register.upcomingOpen";function T(e){let{count:s,children:t}=e,{t:l}=(0,m.kj)(),[i,r]=(0,a.useState)(()=>{try{let e=window.localStorage.getItem(H);if("true"===e||"false"===e)return"true"===e}catch(e){}return s<=8});return(0,n.jsxs)("details",{open:i,children:[(0,n.jsx)("summary",{onClick:e=>{e.preventDefault();let s=!i;r(s);try{window.localStorage.setItem(H,String(s))}catch(e){}},children:(0,n.jsxs)("h2",{style:{display:"inline"},children:[l("reg.upcoming")," (",s,")"]})}),i&&t]})}function A(e){let{refreshKey:s}=e,{t}=(0,m.kj)(),[l,i]=(0,a.useState)(null),[d,c]=(0,a.useState)("");if((0,a.useEffect)(()=>{r.FH.metrics().then(e=>{i(e),c("")}).catch(e=>c(e.message))},[s]),!l)return d?(0,n.jsx)("div",{className:"panel err",children:d}):null;let o=e=>0===e.of?"—":"".concat(e.n," / ").concat(e.of," (").concat(Math.round(100*e.n/e.of),"%)"),u=[["metrics.tasks",e=>"".concat(e.tasks," \xb7 ").concat(t("metrics.attemptsN",{n:e.attempts}))],["metrics.firstPass",e=>o(e.firstPass)],["metrics.doneInTheEnd",e=>o(e.doneInTheEnd)],["metrics.falseCompletion",e=>o(e.falseCompletion)],["metrics.reviewRejection",e=>o(e.reviewRejection)],["metrics.repeatedCommands",e=>o(e.repeatedCommands)],["metrics.noProgress",e=>o(e.noProgress)],["metrics.scopeViolation",e=>o(e.scopeViolation)],["metrics.unrelatedDiff",e=>o(e.unrelatedDiff)],["metrics.resumed",e=>o(e.resumed)],["metrics.freshRetries",e=>String(e.freshRetries)],["metrics.manual",e=>String(e.manualInterventions)],["metrics.ended",e=>Object.entries(e.ended).map(e=>{let[s,n]=e;return"".concat(t("status.".concat(s))," ").concat(n)}).join(", ")||"—"]],h=l.rows[0];return(0,n.jsxs)("section",{className:"panel metrics",children:[(0,n.jsx)("h2",{children:t("metrics.title")}),(0,n.jsx)("p",{className:"muted small",children:t("metrics.hint")}),h&&h.withStats<h.attempts&&(0,n.jsx)("p",{className:"muted small",children:t("metrics.olderAttempts",{n:h.attempts-h.withStats})}),(0,n.jsx)("div",{className:"table-scroll",children:(0,n.jsxs)("table",{children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:t("metrics.col.measure")}),l.rows.map(e=>(0,n.jsx)("th",{children:"all"===e.group?t("metrics.col.all"):e.group},e.group))]})}),(0,n.jsx)("tbody",{children:u.map(e=>{let[s,a]=e;return(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{children:t(s)}),l.rows.map(e=>(0,n.jsx)("td",{children:a(e)},e.group))]},s)})})]})})]})}function R(e){let{entries:s,upcoming:t=!1,sizes:l,onChange:d,picking:c}=e,{t:o}=(0,m.kj)(),j=(0,m.W3)(),k=(0,v.e)(null!=d?d:()=>void 0),f=(0,h.c)(s.some(u.DG)),[w,C]=(0,a.useState)(null),[S,F]=(0,a.useState)(new Set),[H,T]=(0,a.useState)(null);return(0,n.jsxs)(n.Fragment,{children:[w&&(0,n.jsx)(E,{entry:w,onClose:e=>{C(null),e&&(null==d||d())}}),(0,n.jsx)("ol",{className:"flow",children:s.map(e=>{var s,a,h,m,v,w,A,R,W,q,E,G,D,M,_,B,z,L,U,X,V,Z,K,Q,J,Y,$;let ee=t&&1===e.queuePosition,es=e.runGroup?null!=(R=null==l?void 0:l.get(e.runGroup.id))?R:1:0;return(0,n.jsxs)("li",{className:"".concat(e.status).concat(ee?" next":""),children:[(0,n.jsxs)("div",{className:"head",children:[c&&(0,n.jsx)("input",{type:"checkbox",className:"pick","aria-label":e.title,checked:c.picked.has("".concat(e.sessionId,":").concat(e.taskId)),onChange:()=>c.toggle("".concat(e.sessionId,":").concat(e.taskId))}),(0,n.jsx)("strong",{children:e.title}),(0,n.jsx)("span",{className:"badge ".concat(e.status),children:o("status.".concat(e.status))}),ee&&(0,n.jsx)("span",{className:"chip",children:o("reg.next")}),e.limit&&(0,n.jsx)("span",{className:"chip",title:o("reg.limitChipWhy"),children:o("reg.limitChip",{limit:($=e.limit,o("limit.".concat($.setting),{n:$.value}))})}),t&&y.includes(e.status)&&(0,n.jsx)("span",{className:"chip",title:o("reg.willRequeueFirstWhy"),children:o("reg.willRequeueFirst")}),e.sessionRunning&&(0,n.jsx)("span",{className:"chip",children:o("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?o("review.ran",{n:e.review.stepsRun}):void 0,children:[o("review.verdict.".concat(e.review.verdict)),e.review.findings>0?" (".concat(e.review.findings,")"):""]}),(null!=(W=e.deviations)?W:0)>0&&(0,n.jsx)("span",{className:"badge waiting-approval",title:o("reg.deviationsWhy"),children:o("reg.deviations",{n:null!=(q=e.deviations)?q:0})}),(null!=(E=e.disputes)?E:0)>0&&(0,n.jsx)("span",{className:"badge waiting-approval",title:o("reg.disputesWhy"),children:o("reg.disputes",{n:null!=(G=e.disputes)?G:0})}),e.readOnly&&(0,n.jsx)("span",{className:"chip",title:o("reg.readOnlyWhy"),children:o("task.readOnly")}),e.stopCode&&(0,n.jsx)("span",{className:"chip",title:o("stop.why"),children:o("stop.".concat(e.stopCode))}),(null!=(D=null==(s=e.scope)?void 0:s.length)?D:0)>0&&(0,n.jsx)("span",{className:"chip",title:o("task.scopeWhy"),children:o("task.scope",{paths:(null!=(M=e.scope)?M:[]).join(", ")})}),(null!=(_=e.autoRetries)?_:0)>0&&(0,n.jsx)("span",{className:"badge ".concat("done"===e.status?"done":"blocked"===e.status?"blocked":""),title:o("reg.retriedFreshWhy"),children:"done"===e.status?o("reg.retriedFreshDone",{n:null!=(B=e.autoRetries)?B:0}):"blocked"===e.status?o("reg.retriedFreshStill",{n:null!=(z=e.autoRetries)?z:0}):o("reg.retriedFreshOther",{n:null!=(L=e.autoRetries)?L:0})}),e.runGroup&&(0,n.jsx)("span",{className:"chip",title:o("reg.runTitle",{t:es,s:e.runGroup.sessions,when:j(e.runGroup.startedAt)}),children:es>1?o("reg.runWith",{n:es-1}):o("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?o("task.started",{t:j(e.startedAt)}):o("task.added",{t:j(e.createdAt)}),e.finishedAt?" \xb7 ".concat(o("task.finished",{t:j(e.finishedAt)})):"",void 0!==e.durationMs?" \xb7 ".concat(o("reg.took",{d:(0,r.c5)(e.durationMs)})):"",(0,u.DG)(e)?" \xb7 ".concat(o("task.runningFor",{d:(0,r.c5)((0,u.d5)(e.startedAt,void 0,f))})):"",e.iterations>0?" \xb7 ".concat(o("reg.iterations",{n:e.iterations})):""]}),"queued"===e.status&&(0,n.jsx)("div",{className:"when",children:e.queuePosition&&e.queuePosition>1?o("reg.willFollow",{n:e.queuePosition-1}):e.sessionRunning?o("reg.queuePos",{n:null!=(U=e.queuePosition)?U:1}):o("reg.waitingRun")}),"blocked"===e.status&&(0,n.jsx)("p",{className:"what muted small",children:o("reg.blockedWhat")}),(null!=(X=null==(a=e.attempts)?void 0:a.length)?X:0)>0&&(0,n.jsxs)("details",{className:"small",style:{marginTop:6},children:[(0,n.jsx)("summary",{children:(null!=(V=null==(h=e.attempts)?void 0:h.length)?V:0)===1?o("reg.attemptsOne",{n:null!=(K=e.attempt)?K:(null!=(Z=null==(m=e.attempts)?void 0:m.length)?Z:0)+1}):o("reg.attempts",{n:null!=(J=e.attempt)?J:(null!=(Q=null==(v=e.attempts)?void 0:v.length)?Q:0)+1,m:null!=(Y=null==(w=e.attempts)?void 0:w.length)?Y:0})}),(0,n.jsx)("ol",{className:"attempts",children:null==(A=e.attempts)?void 0:A.map(s=>{var t;return(0,n.jsxs)("li",{children:[(0,n.jsxs)("div",{className:"head",children:[(0,n.jsx)("strong",{children:o("reg.attemptN",{n:s.attempt})}),(0,n.jsx)("span",{className:"badge ".concat(s.status),children:o("status.".concat(s.status))}),s.iterations>0&&(0,n.jsx)("span",{className:"muted",children:o("reg.iterations",{n:s.iterations})}),void 0!==s.durationMs&&(0,n.jsx)("span",{className:"muted",children:o("reg.took",{d:(0,r.c5)(s.durationMs)})}),s.runId&&(0,n.jsx)(g.u,{label:o("save.attemptLog"),save:()=>r.FH.saveTaskLog(e.sessionId,e.taskId,s.runId)}),s.runId&&(0,n.jsx)(g.H,{sessionId:e.sessionId,taskId:e.taskId,attempt:s.attempt}),s.runId&&void 0!==s.changedFiles&&(0,n.jsx)(N.C,{sessionId:e.sessionId,taskId:e.taskId,runId:s.runId,title:"".concat(e.title," — ").concat(o("reg.attemptN",{n:s.attempt})),files:s.changedFiles})]}),(0,n.jsxs)("div",{className:"when",children:[s.startedAt?o("task.started",{t:j(s.startedAt)}):"",s.finishedAt?" \xb7 ".concat(o("task.finished",{t:j(s.finishedAt)})):"",s.branch?" \xb7 ".concat(s.branch):""]}),s.reason&&(0,n.jsx)("p",{className:"what err",children:o("reg.stopped",{reason:s.reason})}),s.summary&&(0,n.jsx)(p.s,{text:s.summary,className:"what"})]},"".concat(null!=(t=s.runId)?t:s.attempt))})})]}),e.summary&&(0,n.jsx)(p.s,{text:e.summary,className:"what"}),e.reason&&(0,n.jsx)("p",{className:"what err",children:o("reg.stopped",{reason:e.reason})}),k.message&&k.messageTask===e.taskId&&(0,n.jsx)("p",{className:"what small",children:k.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:o("reg.openTask")}),e.runId&&(0,n.jsx)(g.u,{label:o("save.log"),save:()=>r.FH.saveTaskLog(e.sessionId,e.taskId)}),e.chatUrl&&(0,n.jsx)("a",{href:e.chatUrl,target:"_blank",rel:"noreferrer",children:o("home.col.chat")}),e.startedAt&&(0,n.jsx)(P,{where:{session:e.sessionId,task:e.taskId}}),void 0!==e.changedFiles&&(0,n.jsx)(N.C,{sessionId:e.sessionId,taskId:e.taskId,title:e.title,files:e.changedFiles}),(0,n.jsx)(x,{}),e.runId&&(0,n.jsxs)("button",{className:S.has(e.taskId)?"":"quiet","aria-expanded":S.has(e.taskId),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,u.DG)(e)?o("story.showLiveWhy"):o("story.why"),children:[(0,u.DG)(e)&&!S.has(e.taskId)&&(0,n.jsx)("span",{className:"dot","aria-hidden":"true"}),S.has(e.taskId)?o("story.hide"):(0,u.DG)(e)?o("story.showLive"):o("story.show")]}),I(e)&&!e.sessionRunning&&!e.sessionInactive&&(0,n.jsx)("button",{className:H===e.taskId?"":"primary","aria-expanded":H===e.taskId,onClick:()=>T(H===e.taskId?null:e.taskId),title:o("reg.continueHereWhy"),children:o("reg.continueHere")}),!I(e)&&("failed"===e.status||"blocked"===e.status)&&!e.sessionRunning&&!e.sessionInactive&&(0,n.jsx)("button",{className:H===e.taskId?"":"primary","aria-expanded":H===e.taskId,onClick:()=>T(H===e.taskId?null:e.taskId),title:o("reg.rerunHereWhy"),children:o("reg.rerunHere")}),y.includes(e.status)&&!e.sessionRunning&&(0,n.jsx)("button",{className:"quiet",onClick:()=>C(e),title:o("reg.fixPromptHint"),children:o("reg.fixPrompt")}),"done"===e.status&&!e.sessionRunning&&(0,n.jsx)("button",{className:"quiet",onClick:()=>C(e),title:o("reg.newPromptHint"),children:o("reg.newPrompt")}),e.startedAt&&!e.sessionRunning&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{className:"quiet",disabled:""!==k.busy,title:o("restore.why"),onClick:()=>void k.restore({sessionId:e.sessionId,taskId:e.taskId,title:e.title}),children:"restore"===k.busy?o("restore.checking"):o("restore.button")}),(0,n.jsx)("button",{className:"quiet",disabled:""!==k.busy,title:o("restart.why"),onClick:()=>void k.restartFrom({sessionId:e.sessionId,taskId:e.taskId,title:e.title}),children:"restart"===k.busy?o("restart.checking"):o("restart.button")})]})]}),H===e.taskId&&(I(e)||"failed"===e.status||"blocked"===e.status)&&!e.sessionRunning&&(0,n.jsx)(O,{entry:e,onClose:e=>{T(null),e&&(null==d||d())}}),S.has(e.taskId)&&e.runId&&(0,n.jsx)(b.P,{sessionId:e.sessionId,taskId:e.taskId,live:"running"===e.status||"waiting-approval"===e.status})]},"".concat(e.sessionId,"-").concat(e.taskId))})})]})}function P(e){let{where:s}=e,{t}=(0,m.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 W(e){var s;let{run:t}=e,{t:a}=(0,m.kj)(),l=(0,m.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=>y.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)(C,{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)(P,{where:{run:t.id}})]})]})}function q(e){let{entries:s,sizes:t,onChange:l}=e,{t:i}=(0,m.kj)(),d=(0,a.useMemo)(()=>S(s),[s]),[c,o]=(0,a.useState)(!1),[u,h]=(0,a.useState)(new Set),[g,p]=(0,a.useState)(!1),[x,j]=(0,a.useState)(""),[v,k]=(0,a.useState)(""),N=e=>"".concat(e.sessionId,":").concat(e.taskId),f=s.filter(e=>e.startedAt),b=[...u],w=async()=>{p(!0),k(""),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){k(e.message)}finally{p(!1)}},y=c?{picked:u,toggle:e=>h(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:[c?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{className:"quiet",onClick:()=>{o(!1),h(new Set),j(""),k("")},children:i("reg.pickDone")}),(0,n.jsx)("button",{className:"quiet",onClick:()=>h(new Set(f.map(N))),children:i("reg.pickAll")}),(0,n.jsx)("button",{className:"quiet",onClick:()=>h(new Set),children:i("reg.pickNone")}),(0,n.jsx)("span",{className:"muted",children:u.size>0?i("reg.pickedN",{n:u.size}):i("reg.pickedNone")}),u.size>0&&(0,n.jsx)("button",{className:"primary",disabled:g,onClick:()=>void w(),title:i("reg.bundleWhy"),children:i("reg.bundle",{n:u.size})})]}):(0,n.jsx)("button",{className:"quiet",onClick:()=>o(!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||c,children:[(0,n.jsx)("summary",{children:(0,n.jsx)(W,{run:e})}),(0,n.jsx)(R,{entries:e.entries,sizes:t,onChange:l,picking:y})]},e.id)),d.loose.length>0&&(0,n.jsxs)("details",{className:"run-fold",open:0===d.runs.length||c,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)(R,{entries:d.loose,sizes:t,onChange:l,picking:y})]})]})}function E(e){let{entry:s,onClose:t}=e,{t:l}=(0,m.kj)(),[i,d]=(0,a.useState)(null),[u,h]=(0,a.useState)(""),[g,p]=(0,a.useState)(!1),[x,j]=(0,a.useState)([]),[v,k]=(0,a.useState)(new Set),[N,f]=(0,a.useState)(!1),[b,w]=(0,a.useState)(""),[y,I]=(0,a.useState)(""),C=(0,a.useRef)(null);(0,c.V)(C,!0),(0,a.useEffect)(()=>{let e=e=>{"Escape"!==e.key||g||t(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[g,t]),(0,a.useEffect)(()=>{let e=!0;return r.FH.session(s.sessionId).then(t=>{var n,a,l,i;let r=t.tasks.find(e=>e.id===s.taskId);if(!e)return;d(null!=(n=null==r?void 0:r.prompt)?n:""),I(null!=(a=null==r?void 0:r.prompt)?a:"");let c=null!=(l=null==r?void 0:r.checks)?l:[];j(c),k(new Set("done"===s.status?[]:c.map((e,s)=>s))),f(!!(null==r?void 0:r.readOnly)),w((null!=(i=null==r?void 0:r.scope)?i:[]).join("\n"))}).catch(s=>{e&&h(s.message)}),()=>{e=!1}},[s.sessionId,s.taskId]);let S=async()=>{if(null!==i){p(!0),h("");try{await r.FH.rerunTask(s.sessionId,s.taskId,{prompt:i,checks:x.filter((e,s)=>v.has(s)),readOnly:N,scope:N?[]:(0,o.w)(b)},{buildOnFinished:"done"===s.status}),h(l("reg.fixPromptSaved",{title:s.title})),setTimeout(()=>t(!0),900)}catch(e){h(e.message),p(!1)}}};return(0,n.jsx)("div",{className:"modal-backdrop",role:"presentation",onClick:()=>t(!1),children:(0,n.jsxs)("div",{ref:C,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:u||l("reg.fixPromptLoading")}):(0,n.jsx)("textarea",{className:"prose","aria-labelledby":"fix-title",value:i,onChange:e=>d(e.target.value),style:{minHeight:260},disabled:g}),null!==i&&x.length>0&&(0,n.jsxs)("div",{style:{marginTop:10},children:[(0,n.jsx)("strong",{className:"small",children:l("reg.keepChecks")}),(0,n.jsx)("p",{className:"why",children:l("reg.keepChecksWhy")}),x.map((e,s)=>(0,n.jsx)("div",{className:"option",style:{margin:"4px 0"},children:(0,n.jsxs)("label",{children:[(0,n.jsx)("input",{type:"checkbox",checked:v.has(s),onChange:e=>k(t=>{let n=new Set(t);return e.target.checked?n.add(s):n.delete(s),n})}),(0,n.jsx)("span",{children:e.name})]})},s))]}),null!==i&&i.trim()!==y.trim()&&(0,n.jsx)("p",{className:"notice caution small",children:l("task.newIntentNote")}),null!==i&&(0,n.jsx)(o.y,{readOnly:N,scope:b,onReadOnly:f,onScope:w}),(0,n.jsxs)("div",{className:"row modal-actions",children:[u&&null!==i&&(0,n.jsx)("span",{className:"small grow",children:u}),(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>t(!1),disabled:g,children:l("dialog.cancel")}),(0,n.jsx)("button",{type:"button",className:"primary",onClick:()=>void S(),disabled:g||null===i||!i.trim(),children:l("reg.fixPromptSave")})]})]})})}function G(e){let{sessions:s}=e,{t}=(0,m.kj)();return(0,n.jsxs)("div",{className:"row",style:{margin:"14px 0 18px"},children:[(0,n.jsx)(i(),{href:"/#new-session",className:"button-link",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 O(e){let{entry:s,onClose:t}=e,{t:l}=(0,m.kj)(),i=(0,f.p)(),[d,c]=(0,a.useState)(!1),[o,u]=(0,a.useState)(""),h=I(s),g=h?s.branch?s.commit?l("reg.continueHereCommitted",{branch:s.branch,commit:s.commit.slice(0,8)}):s.vcsProblem?l("reg.continueHereNotCommitted",{branch:s.branch,problem:s.vcsProblem}):l("reg.continueHereNothingNew",{branch:s.branch}):s.vcsProblem?l("reg.continueHereVcsInactive",{problem:s.vcsProblem}):l("reg.continueHereNoVcs"):l("reg.rerunHereBranch"),p=async e=>{if("unattended"!==e||i||await (0,k.Z)(l("batch.unattendedConfirm",{n:1}))){c(!0),u("");try{h?await r.FH.continueTask(s.sessionId,s.taskId):await r.FH.rerunTask(s.sessionId,s.taskId);let a=await r.FH.suggestedRunName([s.sessionId]).then(e=>e.name).catch(()=>void 0),i=await r.FH.startBatch([s.sessionId],e,"stop",void 0,void 0,a,[s.taskId]);if(!i.started){var n;u(l("batch.notStarted",{reason:null!=(n=i.reason)?n:""}));return}u(l("reg.continueHereStarted",{title:s.title})),t(!0)}catch(e){u(e.message)}finally{c(!1)}}};return(0,n.jsxs)("div",{className:"notice",role:"group","aria-label":l(h?"reg.continueHereTitle":"reg.rerunHereTitle",{title:s.title}),style:{marginTop:8},children:[(0,n.jsx)("strong",{children:l(h?"reg.continueHereTitle":"reg.rerunHereTitle",{title:s.title})}),s.reason&&(0,n.jsx)("p",{className:"small",children:s.reason}),(0,n.jsxs)("ul",{className:"small",children:[(0,n.jsx)("li",{children:l(h?"reg.continueHereChat":"reg.rerunHereChat")}),(0,n.jsx)("li",{children:g}),(0,n.jsx)("li",{children:l(h?"reg.continueHereCount":"reg.rerunHereKept")}),(0,n.jsx)("li",{children:l("reg.continueHereAlone")})]}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{className:"primary",disabled:d,onClick:()=>void p("confirm"),title:l("reg.continueWhy"),children:l("reg.continueGo")}),(0,n.jsx)("button",{disabled:d,onClick:()=>void p("unattended"),title:l("reg.continueUnattendedWhy"),children:l("reg.continueUnattended")}),(0,n.jsx)("button",{className:"quiet",disabled:d,onClick:()=>t(!1),children:l("dialog.cancel")}),o&&(0,n.jsx)("span",{className:"small",children:o})]})]})}function D(e){let{entries:s,onChange:t}=e,{t:l}=(0,m.kj)(),[i,d]=(0,a.useState)(!1),[c,o]=(0,a.useState)(""),[u,h]=(0,a.useState)(!1),[g,p]=(0,a.useState)(new Set),[x,j]=(0,a.useState)(null),v=s.filter(e=>"queued"===e.status&&!e.sessionInactive),N=s.filter(e=>y.includes(e.status)&&!e.sessionRunning&&!e.sessionInactive),b=s.some(e=>e.sessionRunning),w=N.filter(e=>"stop"===e.sessionOnFailure),C=N.filter(e=>"stop"!==e.sessionOnFailure),S=[...v,...N],F=S.filter(e=>g.has(e.taskId)),H=N.filter(e=>g.has(e.taskId)),T=v.filter(e=>g.has(e.taskId)),A=[...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))],R=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,W]=(0,a.useState)(""),q=w.length>0?l("reg.continueWithFailed",{f:w.length,n:v.length,s:A.length}):l("reg.continue",{n:v.length,s:A.length}),G=(0,f.p)(),O=async e=>{if("unattended"!==e||G||await (0,k.Z)(l("batch.unattendedConfirm",{n:A.length}))){d(!0),o("");try{var s;for(let e of H)I(e)?await r.FH.continueTask(e.sessionId,e.taskId):await r.FH.rerunTask(e.sessionId,e.taskId);let n=await r.FH.startBatch(A,e,"stop",void 0,void 0,P.trim()||void 0,F.map(e=>e.taskId));o(n.started?l("reg.continueStarted",{n:A.length}):l("batch.notStarted",{reason:null!=(s=n.reason)?s:""})),h(!1),t()}catch(e){o(e.message)}finally{d(!1)}}};return 0===v.length&&0===N.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||b,onClick:()=>{p(new Set(S.map(e=>e.taskId))),h(!0),o("");let e=[...new Set([...S].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))];r.FH.suggestedRunName(e).then(e=>W(e.name)).catch(()=>void 0)},title:l("reg.continueWhy"),children:q}),b&&(0,n.jsx)("span",{className:"muted small",children:l("reg.continueRunning")}),c&&(0,n.jsx)("span",{className:"small",children:c})]}),u&&!b&&(0,n.jsxs)("div",{className:"notice",style:{marginTop:8},children:[(0,n.jsx)("strong",{children:l("reg.continuePanelTitle")}),(0,n.jsxs)("div",{className:"row",style:{marginTop:6},children:[(0,n.jsx)("span",{className:"small",children:l("reg.pickedCount",{n:F.length,of:S.length})}),(0,n.jsx)("button",{className:"small",onClick:()=>p(new Set),disabled:0===F.length,children:l("reg.pickNone")}),(0,n.jsx)("button",{className:"small",onClick:()=>p(new Set(S.map(e=>e.taskId))),disabled:F.length===S.length,children:l("reg.pickAll")})]}),[{key:"chain",entries:w,intro:l("reg.continueChain"),fix:!0},{key:"loose",entries:C,intro:l("reg.continueIndependent"),fix:!0},{key:"queued",entries:v,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))}),I(s)&&(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:()=>j(s),title:l("reg.fixPromptHint"),children:l("reg.fixPrompt")})]})]},s.taskId))})]},e.key)),R.length>0&&(0,n.jsx)("div",{className:"notice caution small",style:{marginTop:6},children:R.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=>W(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:T.length,r:H.length,s:A.length})}),(0,n.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,n.jsx)("button",{className:"primary",disabled:i||0===A.length,onClick:()=>void O("unattended"),title:l("reg.continueUnattendedWhy"),children:l("reg.continueUnattended")}),(0,n.jsx)("button",{disabled:i||0===A.length,onClick:()=>void O("confirm"),title:l("reg.continueWhy"),children:l("reg.continueGo")}),(0,n.jsx)("button",{className:"quiet",disabled:i,onClick:()=>h(!1),children:l("dialog.cancel")})]})]}),x&&(0,n.jsx)(E,{entry:x,onClose:e=>{j(null),e&&t()}})]})}function M(e){let{entries:s}=e,{t}=(0,m.kj)(),a=(0,m.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,36,347,131,358],()=>e(e.s=3256)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{952:()=>{},1035:(e,t,n)=>{"use strict";n.d(t,{DialogHost:()=>d,Z:()=>c});var r=n(3365),a=n(1521),l=n(867),o=n(4969);let s=null,i=[];function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(n=>{var r;return r={kind:"confirm",message:e,...t,resolve:n},void(s?s(r):i.push(r))})}function d(e){var t,n;let{children:c}=e,{t:d}=(0,l.kj)(),[u,h]=(0,a.useState)([]),m=(0,a.useRef)(null),v=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(s=e=>h(t=>[...t,e]),i.length>0){let e=i.splice(0,i.length);h(t=>[...t,...e])}return()=>{s=null}},[]);let p=u[0],f=(0,a.useCallback)(e=>{p&&(p.resolve(e),h(e=>e.slice(1)))},[p]);return(0,o.V)(v,!!p,m),(0,a.useEffect)(()=>{if(!p)return;let e=e=>{"Escape"===e.key&&(e.preventDefault(),f(!1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p,f]),(0,r.jsxs)(r.Fragment,{children:[c,p&&(0,r.jsx)("div",{className:"modal-backdrop",onClick:()=>f(!1),role:"presentation",children:(0,r.jsxs)("div",{ref:v,className:"modal".concat(p.danger?" danger":""),role:"confirm"===p.kind?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":"modal-title","aria-describedby":"modal-body",onClick:e=>e.stopPropagation(),children:[(0,r.jsx)("h2",{id:"modal-title",children:null!=(t=p.title)?t:d("confirm"===p.kind?"dialog.confirmTitle":"dialog.noticeTitle")}),(0,r.jsx)("div",{id:"modal-body",className:"modal-body",children:p.message}),(0,r.jsxs)("div",{className:"row modal-actions",children:["confirm"===p.kind&&(0,r.jsx)("button",{type:"button",className:"quiet",onClick:()=>f(!1),children:d("dialog.cancel")}),(0,r.jsx)("button",{ref:m,type:"button",className:p.danger?"danger":"primary",onClick:()=>f(!0),children:null!=(n=p.okLabel)?n:d("dialog.ok")})]})]})})]})}},1702:(e,t,n)=>{"use strict";var r=n(9962);n.o(r,"usePathname")&&n.d(t,{usePathname:function(){return r.usePathname}}),n.o(r,"useSearchParams")&&n.d(t,{useSearchParams:function(){return r.useSearchParams}})},4969:(e,t,n)=>{"use strict";n.d(t,{V:()=>l});var r=n(1521);let a='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function l(e,t,n){(0,r.useEffect)(()=>{var r,l;if(!t)return;let o=document.activeElement instanceof HTMLElement?document.activeElement:null,s=e.current,i=null!=(l=null!=(r=null==n?void 0:n.current)?r:null==s?void 0:s.querySelector(a))?l:null;null==i||i.focus();let c=e=>{if("Tab"!==e.key||!s)return;let t=Array.from(s.querySelectorAll(a)).filter(e=>null!==e.offsetParent);if(0===t.length)return;let n=t[0],r=t[t.length-1],l=s.contains(document.activeElement);e.shiftKey&&(document.activeElement===n||!l)?(e.preventDefault(),r.focus()):e.shiftKey||document.activeElement!==r&&l||(e.preventDefault(),n.focus())};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c),o&&document.contains(o)&&o.focus()}},[e,t,n])}},5924:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,8197,23)),Promise.resolve().then(n.bind(n,6657)),Promise.resolve().then(n.bind(n,1035)),Promise.resolve().then(n.t.bind(n,952,23)),Promise.resolve().then(n.bind(n,8214)),Promise.resolve().then(n.bind(n,7712)),Promise.resolve().then(n.bind(n,8078)),Promise.resolve().then(n.bind(n,867))},6657:(e,t,n)=>{"use strict";n.d(t,{GlobalApprovals:()=>u});var r=n(3365),a=n(1521),l=n(8197),o=n.n(l),s=n(5549),i=n(867),c=n(1035),d=n(7527);function u(){let{t:e}=(0,i.kj)(),[t,n]=(0,a.useState)([]),[l,o]=(0,a.useState)({}),c=(0,a.useRef)({}),u=(0,a.useRef)(""),m=(0,a.useCallback)(async()=>{try{let e=await s.FH.approvals();n(e);let t=[...new Set(e.map(e=>e.sessionId).filter(e=>!(e in c.current)))],r=t.sort().join(",");if(t.length>0&&r!==u.current){for(let e of(u.current=r,await s.FH.sessions().catch(()=>[])))c.current[e.id]=e.name;o({...c.current})}}catch(e){}},[]);return((0,d.z)(m,2e3),(0,a.useEffect)(()=>{let n="copilot-operator";document.title=t.length>0?"(".concat(t.length,") ").concat(e("approval.tabTitle")," — ").concat(n):n},[t.length,e]),0===t.length)?null:(0,r.jsxs)("section",{className:"approval-banner",role:"alert","aria-live":"assertive",children:[(0,r.jsx)("h2",{children:e("approval.waitingHere")}),(0,r.jsx)("p",{className:"small",children:e("approval.waitingHereWhy")}),t.map(e=>{var t;return(0,r.jsx)(h,{approval:e,sessionName:null!=(t=l[e.sessionId])?t:e.sessionId,onDecided:()=>void m()},e.id)})]})}function h(e){let{approval:t,sessionName:n,onDecided:l}=e,{t:d}=(0,i.kj)(),u=(0,i.W3)(),[h,m]=(0,a.useState)(!1),[v,p]=(0,a.useState)(""),f=(0,a.useRef)(!1),k=async e=>{if(!f.current&&("run-all"!==e||await (0,c.Z)(d("approval.runAllConfirm")))){f.current=!0,m(!0),p("");try{await s.FH.decide(t.id,e)}catch(e){p(e.message)}finally{f.current=!1,m(!1),l()}}};return(0,r.jsxs)("div",{className:"approval",children:[(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("strong",{children:d("approval.title",{n:t.stepId})}),(0,r.jsx)(o(),{href:(0,s.aT)(t.sessionId),children:n}),(0,r.jsx)("span",{className:"muted small",children:u(t.createdAt)})]}),(0,r.jsx)("pre",{style:{margin:"8px 0"},children:t.description}),t.network&&(0,r.jsx)("p",{className:"reason small",children:d("approval.network")}),v&&(0,r.jsx)("p",{className:"err",role:"alert",children:v}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("button",{className:"primary",disabled:h,onClick:()=>void k("run"),children:d("approval.run")}),!t.network&&(0,r.jsx)("button",{disabled:h,onClick:()=>void k("run-all"),title:d("approval.runAllWhy"),children:d("approval.runAll")}),(0,r.jsx)("button",{disabled:h,onClick:()=>void k("skip"),children:d("approval.skip")}),(0,r.jsx)("button",{className:"danger",disabled:h,onClick:()=>void k("abort"),children:d("approval.abort")})]})]})}},7527:(e,t,n)=>{"use strict";n.d(t,{z:()=>a});var r=n(1521);function a(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=(0,r.useRef)(e);a.current=e,(0,r.useEffect)(()=>{let e;if(!n)return;let r=!1,l=async()=>{try{await a.current()}catch(e){}finally{r||(e=setTimeout(()=>void l(),t))}};return l(),()=>{r=!0,e&&clearTimeout(e)}},[t,n])}},7712:(e,t,n)=>{"use strict";n.d(t,{ScrollJump:()=>o});var r=n(3365),a=n(1521),l=n(867);function o(){let{t:e}=(0,l.kj)(),[t,n]=(0,a.useState)({long:!1,atTop:!0,atBottom:!1});return((0,a.useEffect)(()=>{let e=()=>{let e=document.documentElement;n({long:e.scrollHeight>2*window.innerHeight,atTop:window.scrollY<200,atBottom:window.innerHeight+window.scrollY>=e.scrollHeight-200})};e(),window.addEventListener("scroll",e,{passive:!0}),window.addEventListener("resize",e);let t=new ResizeObserver(e);return t.observe(document.body),()=>{window.removeEventListener("scroll",e),window.removeEventListener("resize",e),t.disconnect()}},[]),t.long)?(0,r.jsxs)("div",{className:"scroll-jump",children:[!t.atTop&&(0,r.jsx)("button",{type:"button","aria-label":e("scroll.top"),title:e("scroll.top"),onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),children:"↑"}),!t.atBottom&&(0,r.jsx)("button",{type:"button","aria-label":e("scroll.bottom"),title:e("scroll.bottom"),onClick:()=>window.scrollTo({top:document.documentElement.scrollHeight,behavior:"smooth"}),children:"↓"})]}):null}},8078:(e,t,n)=>{"use strict";n.d(t,{AppearanceProvider:()=>d,KP:()=>u});var r=n(3365),a=n(1521);let l="cop.appearance",o=["small","normal","large","huge","giant"];"\n(function () {\n try {\n var d = document.documentElement;\n var raw = localStorage.getItem('".concat(l,"');\n var a = raw ? JSON.parse(raw) : {};\n if (!a || typeof a !== 'object') a = {};\n d.dataset.theme = a.theme === 'dark' ? 'dark' : 'light';\n d.dataset.textsize = ").concat(JSON.stringify(o),".indexOf(a.textSize) >= 0 ? a.textSize : 'normal';\n d.dataset.contrast = a.highContrast ? 'high' : 'normal';\n d.dataset.motion = a.reduceMotion ? 'reduced' : 'normal';\n d.dataset.links = a.underlineLinks ? 'underline' : 'plain';\n d.dataset.focus = a.strongFocus ? 'strong' : 'normal';\n } catch (e) {}\n})();\n");let s={theme:"light",textSize:"normal",highContrast:!1,reduceMotion:!1,underlineLinks:!1,strongFocus:!1};function i(e){let t=document.documentElement;t.dataset.theme=e.theme,t.dataset.textsize=e.textSize,t.dataset.contrast=e.highContrast?"high":"normal",t.dataset.motion=e.reduceMotion?"reduced":"normal",t.dataset.links=e.underlineLinks?"underline":"plain",t.dataset.focus=e.strongFocus?"strong":"normal"}let c=(0,a.createContext)({appearance:s,set:()=>void 0,reset:()=>void 0,loaded:!1});function d(e){let{children:t}=e,[n,d]=(0,a.useState)(s),[u,h]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=s;try{let t=window.localStorage.getItem(l);t?e=function(e){let t=e&&"object"==typeof e?e:{},n=(e,t)=>"boolean"==typeof e?e:t;return{theme:"dark"===t.theme?"dark":"light"===t.theme?"light":s.theme,textSize:o.includes(t.textSize)?t.textSize:s.textSize,highContrast:n(t.highContrast,s.highContrast),reduceMotion:n(t.reduceMotion,s.reduceMotion),underlineLinks:n(t.underlineLinks,s.underlineLinks),strongFocus:n(t.strongFocus,s.strongFocus)}}(JSON.parse(t)):window.matchMedia("(prefers-color-scheme: dark)").matches&&(e={...e,theme:"dark"}),window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!t&&(e={...e,reduceMotion:!0})}catch(e){}d(e),i(e),h(!0)},[]);let m=(0,a.useCallback)(e=>{d(t=>{let n={...t,...e};i(n);try{window.localStorage.setItem(l,JSON.stringify(n))}catch(e){}return n})},[]),v=(0,a.useCallback)(()=>{d(s),i(s);try{window.localStorage.removeItem(l)}catch(e){}},[]);return(0,r.jsx)(c.Provider,{value:{appearance:n,set:m,reset:v,loaded:u},children:t})}function u(){return(0,a.useContext)(c)}},8214:(e,t,n)=>{"use strict";n.d(t,{Nav:()=>v,SkipLink:()=>m});var r=n(3365),a=n(1521),l=n(8197),o=n.n(l),s=n(1702),i=n(5549),c=n(7527),d=n(867);let u={sessions:(0,r.jsx)("path",{d:"M4 5h16v4H4zM4 11h16v4H4zM4 17h10v2H4z"}),defaults:(0,r.jsx)("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"}),import:(0,r.jsx)("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",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),history:(0,r.jsx)("path",{d:"M12 3a9 9 0 1 0 8.5 6M12 7v5l3 2M3 4v5h5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),level1:(0,r.jsx)("path",{d:"M6 3h9l5 5v13H6zM14 3v6h6M9 13h7M9 17h7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),presets:(0,r.jsx)("path",{d:"M5 4h14v4H5zM5 10h14v4H5zM5 16h9v4H5z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),appearance:(0,r.jsx)("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"}),system:(0,r.jsx)("path",{d:"M4 5h16v10H4zM2 19h20M9 15v4M15 15v4",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"})},h=[{href:"/",label:"nav.sessions",icon:"sessions"},{href:"/defaults",label:"nav.defaults",icon:"defaults"},{href:"/import",label:"nav.import",icon:"import"},{href:"/history",label:"nav.history",icon:"history"},{href:"/level1",label:"nav.level1",icon:"level1"},{href:"/presets",label:"nav.presets",icon:"presets"},{href:"/appearance",label:"nav.appearance",icon:"appearance"},{href:"/system",label:"nav.system",icon:"system"}];function m(){let{t:e}=(0,d.kj)();return(0,r.jsx)("a",{className:"skip-link",href:"#main",children:e("a11y.skip")})}function v(){let{t:e}=(0,d.kj)(),t=(0,s.usePathname)(),n=function(){let[e,t]=(0,a.useState)(0);return(0,c.z)(()=>i.FH.activity().then(e=>t(e.sessions)).catch(()=>void 0),4e3),e}();return(0,r.jsxs)("nav",{"aria-label":e("nav.label"),children:[h.map(a=>(0,r.jsxs)(o(),{href:a.href,"aria-current":t===a.href?"page":void 0,children:[(0,r.jsx)("svg",{className:"nav-icon",viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor","aria-hidden":"true",children:u[a.icon]}),(0,r.jsx)("span",{children:e(a.label)}),"/history"===a.href&&n>0&&(0,r.jsxs)("span",{className:"live",title:e("nav.liveTitle",{n:n}),children:[(0,r.jsx)("span",{className:"dot","aria-hidden":"true"}),e("nav.live")]})]},a.href)),(0,r.jsx)(d.c5,{})]})}}},e=>{e.O(0,[353,197,867,549,347,131,358],()=>e(e.s=5924)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[66],{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,2438))},2285:(e,s,n)=>{"use strict";n.d(s,{b:()=>r});var a=n(3365),t=n(1521),l=n(5549),i=n(867);function r(e){var s,n;let{dir:r}=e,{t:c}=(0,i.kj)(),d=(0,i.W3)(),[o,h]=(0,t.useState)(null),[u,m]=(0,t.useState)(""),[p,v]=(0,t.useState)(""),x=async()=>{m("");try{h(await l.FH.syncPlan(r))}catch(e){m(e.message)}},j=async(e,s)=>{try{await navigator.clipboard.writeText(s),v(e),window.setTimeout(()=>v(""),2500)}catch(e){m(c("plan.copyFailed"))}},g=e=>(0,a.jsxs)("ul",{style:{margin:"2px 0 6px",paddingLeft:20},children:[e.slice(0,30).map(e=>(0,a.jsx)("li",{children:(0,a.jsx)("code",{children:e})},e)),e.length>30&&(0,a.jsx)("li",{className:"muted",children:c("sync.more",{n:e.length-30})})]});return(0,a.jsxs)("div",{className:"sync-command small",style:{marginTop:8},children:[(0,a.jsx)("button",{type:"button",onClick:()=>void x(),children:c("sync.show")}),u&&(0,a.jsx)("p",{className:"err",children:u}),o&&!o.ok&&(0,a.jsx)("p",{className:"err",children:o.problem}),(null==o?void 0:o.ok)&&(0,a.jsxs)("div",{className:"notice caution",style:{marginTop:8},children:[(0,a.jsxs)("p",{children:[c("sync.what",{branch:null!=(s=o.branch)?s:"",target:null!=(n=o.target)?n:""})," ",(0,a.jsx)("span",{className:"muted",children:o.lastFetched?c("sync.fetchedAt",{when:d(o.lastFetched)}):c("sync.neverFetched")})]}),o.willLose.commits.length+o.willLose.changed.length+o.willLose.untracked.length===0?(0,a.jsx)("p",{children:c("sync.nothingLost")}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:c("sync.loses")}),o.willLose.commits.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{children:c("sync.commits",{n:o.willLose.commits.length})}),g(o.willLose.commits)]}),o.willLose.changed.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{children:c("sync.changed",{n:o.willLose.changed.length})}),g(o.willLose.changed)]}),o.willLose.untracked.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{children:c("sync.untracked",{n:o.willLose.untracked.length})}),g(o.willLose.untracked)]})]}),(0,a.jsx)("p",{className:"muted",children:c("sync.keeps")}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("button",{type:"button",onClick:()=>void j("preview",o.preview),children:c("sync.copyPreview")}),"preview"===p&&(0,a.jsx)("span",{className:"badge done",children:c("plan.copied")})]}),(0,a.jsx)("pre",{className:"sync-cmd",children:o.preview}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("button",{type:"button",className:"danger",onClick:()=>void j("command",o.command),children:c("sync.copyCommand")}),"command"===p&&(0,a.jsx)("span",{className:"badge done",children:c("plan.copied")})]}),(0,a.jsx)("pre",{className:"sync-cmd",children:o.command}),(0,a.jsx)("p",{className:"muted",children:c("sync.howToRun")})]})]})}},2438:(e,s,n)=>{"use strict";n.r(s),n.d(s,{default:()=>S});var a=n(3365),t=n(1521),l=n(1702),i=n(8197),r=n.n(i),c=n(5549),d=n(867),o=n(1910),h=n(3523),u=n(3374),m=n(8078),p=n(8848),v=n(4784),x=n(2876),j=n(5132),g=n(1035),y=n(8934),f=n(4811),b=n(3041),k=n(7527),N=n(1366),w=n(2285);function S(){return(0,a.jsx)(t.Suspense,{fallback:null,children:(0,a.jsx)(C,{})})}function C(){var e;let{t:s}=(0,d.kj)(),n=null!=(e=(0,l.useSearchParams)().get("id"))?e:"",[i,o]=(0,t.useState)(null),[h,u]=(0,t.useState)([]),[m,p]=(0,t.useState)([]),[v,x]=(0,t.useState)(null),[j,g]=(0,t.useState)(""),[y,f]=(0,t.useState)(!1),b=(0,t.useRef)(null),N=(0,t.useRef)(0),w=(0,t.useCallback)(async()=>{if(!n)return;let e=++N.current;try{let s=await c.FH.session(n);if(e!==N.current)return;o(s),g("")}catch(s){if(e!==N.current)return;g(s.message)}},[n]),S=(0,t.useCallback)(()=>{b.current||(b.current=window.setTimeout(()=>{b.current=null,w()},400))},[w]);if((0,t.useEffect)(()=>{if(!n)return;c.FH.presets().then(p).catch(()=>void 0),c.FH.level1().then(x).catch(()=>void 0);let e=new EventSource(c.FH.streamUrl(n));return e.onopen=()=>f(!1),e.onmessage=e=>{let s;try{s=JSON.parse(e.data)}catch(e){return}"ping"!==s.type&&(u(e=>[...e.slice(-400),s]),S())},e.onerror=()=>{e.readyState===EventSource.CLOSED&&f(!0)},()=>{e.close()}},[n,S]),(0,k.z)(w,8e3,!!n),!n)return(0,a.jsx)("div",{className:"panel err",children:s("session.noId")});if(j&&!i)return(0,a.jsx)("div",{className:"panel err",children:j});if(!i)return(0,a.jsx)("div",{className:"panel muted",children:s("home.loading")});let C=i.tasks.filter(e=>"queued"===e.status).length;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"crumbs",children:[(0,a.jsx)(r(),{href:"/",children:s("session.crumb")})," / ",i.name]}),j&&(0,a.jsx)("div",{className:"panel err",role:"alert",children:s("session.stale",{err:j})}),y&&!j&&(0,a.jsx)("div",{className:"panel muted small",role:"status",children:s("session.streamClosed")}),(0,a.jsx)(F,{session:i,queued:C,onChange:w}),(0,a.jsx)(q,{tasks:i.tasks}),(0,a.jsx)(T,{session:i,onChange:w}),(0,a.jsx)(I,{level1:v,sent:i.contractSent}),(0,a.jsx)(H,{session:i,onChange:w}),(0,a.jsx)(L,{session:i,onChange:w}),(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)(M,{session:i,onChange:w}),0===i.tasks.length&&(0,a.jsx)("div",{className:"muted",children:s("tasks.none")}),i.tasks.map((e,s)=>(0,a.jsx)(D,{session:i,task:e,index:s+1,presets:m,onChange:w},e.id))]}),(0,a.jsx)(P,{session:i}),(0,a.jsx)(B,{session:i,presets:m,onAdded:w,onPresetsChanged:()=>c.FH.presets().then(p)}),(0,a.jsx)(A,{events:h})]})}function F(e){var s;let{session:n,queued:l,onChange:i}=e,{t:r}=(0,d.kj)(),[o,h]=(0,t.useState)(""),[u,m]=(0,t.useState)("");(0,t.useEffect)(()=>{c.FH.models().then(e=>{var s;return m(null!=(s=e.defaultModel)?s:"")}).catch(()=>void 0)},[]);let[p,v]=(0,t.useState)(n.name),[x,j]=(0,t.useState)(null!=(s=n.conversationGroup)?s:"");(0,t.useEffect)(()=>v(n.name),[n.name]),(0,t.useEffect)(()=>{var e;return j(null!=(e=n.conversationGroup)?e:"")},[n.conversationGroup]);let y=(0,f.p)(),[b,k]=(0,t.useState)(!1),N=(0,t.useRef)(!1),w=async e=>{if(!N.current){N.current=!0,k(!0);try{await e()}catch(e){h(e.message)}finally{N.current=!1,k(!1),i()}}},S=async e=>{("unattended"!==e||y||await (0,g.Z)(r("session.unattendedConfirm")))&&await w(async()=>{var s;let a=await c.FH.start(n.id,e,n.planName);h(a.started?r("unattended"===e?"session.startedAuto":"session.startedStep"):r("session.notStarted",{reason:null!=(s=a.reason)?s:""}))})},C=async()=>{if(n.running)return void h(r("home.deleteRunning"));if(await (0,g.Z)(r("home.deleteConfirm",{name:n.name,n:n.tasks.length})))try{await c.FH.deleteSession(n.id),window.location.href="/"}catch(e){h(e.message)}},F=async()=>{var e;if(x.trim()!==(null!=(e=n.conversationGroup)?e:""))try{await c.FH.updateSession(n.id,{conversationGroup:x.trim()}),h(r("session.groupSaved")),i()}catch(e){h(e.message)}},I=n.running?r("state.running"):r("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","aria-label":r("home.col.name"),value:p,onChange:e=>v(e.target.value),onBlur:()=>void w(async()=>{p.trim()&&p!==n.name&&await c.FH.updateSession(n.id,{name:p})})}),(0,a.jsx)("span",{className:"badge ".concat(n.running?"running":""),children:I})]}),!n.running&&(0,a.jsxs)("div",{className:"run-choice",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void S("unattended"),disabled:b||0===l,children:r("session.run",{n:l})}),(0,a.jsx)("p",{className:"why",children:r("session.runWhy")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("button",{onClick:()=>void S("confirm"),disabled:b||0===l,children:r("session.runStep")}),(0,a.jsx)("p",{className:"why",children:r("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 w(async()=>{await c.FH.stop(n.id),h(r("session.stopping"))}),disabled:b,children:r("session.stop")}),"unattended"===n.runMode&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"badge waiting-approval",children:r("session.modeUnattended")}),(0,a.jsx)("button",{onClick:()=>void w(async()=>{await c.FH.setRunMode(n.id,"confirm"),h(r("session.askingAgain"))}),disabled:b,children:r("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:r("home.delete")}),n.chat?(0,a.jsx)("a",{href:n.chat.url,target:"_blank",rel:"noreferrer",className:"small",children:r("session.openChat",{name:n.chat.name})}):(0,a.jsx)("span",{className:"muted small",children:r("session.noChat")})]}),(0,a.jsx)("label",{htmlFor:"session-group",children:r("session.group")}),(0,a.jsx)("div",{className:"row",children:(0,a.jsx)("input",{id:"session-group",type:"text",className:"grow",value:x,placeholder:r("session.groupPlaceholder"),onChange:e=>j(e.target.value),onBlur:()=>void F(),disabled:n.running})}),(0,a.jsxs)("p",{className:"why",children:[r("session.groupWhy"),n.chat&&" ".concat(r("session.groupHasChat"))]}),(0,a.jsx)("div",{className:"muted small",style:{marginTop:10},children:r("session.willUseModel",{name:n.model||(u?r("model.followsDefault",{name:u}):r("model.default"))})})]})}function I(e){var s;let{level1:n,sent:t}=e,{t:l}=(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:l("l1.title")}),(0,a.jsx)("span",{className:"badge",children:l(t?"l1.sent":"l1.notSent")}),(0,a.jsx)(r(),{href:"/level1",className:"small",children:l("l1.edit")})]}),(0,a.jsxs)("p",{className:"muted small",style:{marginBottom:6},children:[l("l1.hint"),(null==n?void 0:n.customised)?" ".concat(l("l1.customised")):""]}),(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:l("l1.show")}),(0,a.jsx)("pre",{className:"tall",children:null!=(s=null==n?void 0:n.content)?s:"…"})]})]})}function T(e){var s,n,l,i;let{session:r,onChange:o}=e,{t:h}=(0,d.kj)(),u=(0,d.W3)(),[m,v]=(0,t.useState)(null),[x,j]=(0,t.useState)(!1),[y,f]=(0,t.useState)("");(0,t.useEffect)(()=>{c.FH.models().then(v).catch(()=>void 0)},[]);let b=async e=>{try{await c.FH.updateSession(r.id,{model:e}),f(e?h("model.saved",{name:e}):h("model.savedDefault")),o()}catch(e){f(e.message)}},k=async()=>{try{let e=await c.FH.setDefaultModel(w);v(s=>s?{...s,defaultModel:e.defaultModel}:s),f(e.defaultModel?h("model.defaultSaved",{name:e.defaultModel}):h("model.defaultCleared"))}catch(e){f(e.message)}},N=async()=>{if(await (0,g.Z)(h("model.refreshConfirm"))){j(!0),f(h("model.refreshing"));try{var e;let s=await c.FH.refreshModels();v(s),f(0===s.options.length?null!=(e=s.note)?e:h("model.none"):h("model.refreshed",{n:s.options.length}))}catch(e){f(e.message)}finally{j(!1)}}},w=null!=(s=r.model)?s:"",S=null!=(n=null==m?void 0:m.options)?n:[],C=S.some(e=>e.name===w),F=S.filter(e=>!e.group),I=new Map;for(let e of S)e.group&&I.set(e.group,[...null!=(l=I.get(e.group))?l:[],e]);return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("h2",{className:"grow",style:{margin:0},children:h("model.title")}),r.modelInUse&&(0,a.jsx)("span",{className:"chip",children:h("model.lastUsed",{name:r.modelInUse})})]}),(0,a.jsx)("p",{className:"muted small",children:h("model.hint")}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsxs)("select",{"aria-label":h("model.title"),value:w,disabled:r.running,onChange:e=>void b(e.target.value),style:{width:"auto",minWidth:260},children:[(0,a.jsx)("option",{value:"",children:(null==m?void 0:m.defaultModel)?h("model.followsDefault",{name:m.defaultModel}):h("model.default")}),w&&!C&&(0,a.jsx)("option",{value:w,children:h("model.notInList",{name:w})}),F.map(e=>(0,a.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(h("model.unavailable")):""]},e.name)),[...I.entries()].map(e=>{let[s,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(h("model.unavailable")):""]},e.name))},s)})]}),(0,a.jsx)("button",{onClick:()=>void N(),disabled:x||r.running,children:h("model.refresh")}),(0,a.jsx)("span",{className:"muted small",role:"status",children:y})]}),(0,a.jsx)(p.L,{current:w,onUse:e=>void b(e)}),(0,a.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,a.jsx)("span",{className:"muted small",children:(null==m?void 0:m.defaultModel)?h("model.defaultIs",{name:m.defaultModel}):h("model.defaultIsNone")}),(0,a.jsx)("button",{onClick:()=>void k(),disabled:w===(null!=(i=null==m?void 0:m.defaultModel)?i:""),children:w?h("model.makeDefault",{name:w}):h("model.clearDefault")})]}),(null==m?void 0:m.readAt)?(0,a.jsxs)("p",{className:"muted small",style:{marginTop:8},children:[h("model.readAt",{t:u(m.readAt),n:m.options.length}),m.current?" ".concat(h("model.chatWasOn",{name:m.current})):"",m.note?" ".concat(m.note):""]}):(0,a.jsx)("p",{className:"muted small",style:{marginTop:8},children:h("model.neverRead")}),S.length>0&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:h("model.showDetails")}),(0,a.jsx)("pre",{className:"tall",children:S.map(e=>"".concat(e.selected?"*":" "," ").concat(e.group?"".concat(e.group," > "):"").concat(e.name)+"".concat(e.disabled?" [unavailable]":"","\n ").concat(e.raw.replace(/\n/g," | "))).join("\n")})]})]})}function L(e){var s,n;let{session:l,onChange:i}=e,{t:r}=(0,d.kj)(),o=null!=(s=l.review)?s:{enabled:!0,model:""},[h,u]=(0,t.useState)(o.enabled),[m,x]=(0,t.useState)(null!=(n=o.model)?n:""),[j,g]=(0,t.useState)(""),[y,f]=(0,t.useState)(!1),[b,k]=(0,t.useState)("");(0,t.useEffect)(()=>{c.FH.models().then(e=>{var s;return k(null!=(s=e.defaultReviewModel)?s:"")}).catch(()=>void 0)},[]);let N=async()=>{f(!0),g("");try{await c.FH.updateSession(l.id,{review:{enabled:h,model:m}}),g(r("review.saved")),i()}catch(e){g(e.message)}finally{f(!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:r("review.title")}),(0,a.jsx)("span",{className:"badge ".concat(h?"done":""),children:h?r("review.on"):r("review.off")})]}),(0,a.jsx)("p",{className:"muted small",children:r("review.hint")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:h,onChange:e=>u(e.target.checked),disabled:l.running}),(0,a.jsx)("span",{children:r("review.enable")})]}),(0,a.jsx)("p",{className:"why",children:r("review.enableWhy")})]}),(0,a.jsx)("label",{htmlFor:"review-model",children:r("review.modelField")}),(0,a.jsx)("div",{className:"row",children:(0,a.jsx)(v.Y,{id:"review-model",chosen:m,onChange:x,none:b?r("model.followsDefault",{name:b}):r("review.modelSame"),disabled:l.running||!h})}),(0,a.jsx)("p",{className:"why",children:r("review.modelWhy")}),(0,a.jsx)(p.z4,{current:m,onUse:e=>x(e)}),(0,a.jsxs)("div",{className:"row",style:{marginTop:10},children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void N(),disabled:y||l.running,children:r("review.save")}),j&&(0,a.jsx)("span",{className:"muted small",children:j})]})]})}function W(e){var s;let{session:n,plan:l,onDone:i}=e,{t:r}=(0,d.kj)(),o=()=>Object.fromEntries(l.entries.filter(e=>e.choice).map(e=>[e.path,e.choice])),h=JSON.stringify(l.entries.map(e=>[e.path,e.choice])),[u,m]=(0,t.useState)(o);(0,t.useEffect)(()=>m(o()),[h]);let[p,v]=(0,t.useState)(!1),[x,j]=(0,t.useState)(""),g=l.entries.filter(e=>"include"===u[e.path]).length,y=async()=>{v(!0),j("");try{var e,s,a;let t=await c.FH.vcsSnapshot(n.id,u);j(t.ok?r("vcs.snapshotTaken",{branch:null!=(e=t.branch)?e:"",commit:(null!=(s=t.commit)?s:"").slice(0,8)}):null!=(a=t.problem)?a:""),i()}catch(e){j(e.message)}finally{v(!1)}};return(0,a.jsxs)("div",{className:"option",children:[(0,a.jsx)("p",{className:"small",children:r("vcs.snapshotList",{n:l.entries.length,branch:null!=(s=l.baselineBranch)?s:"—"})}),(0,a.jsx)("ul",{style:{margin:"4px 0",paddingLeft:0,listStyle:"none"},children:l.entries.map(e=>{var s;return(0,a.jsxs)("li",{style:{marginBottom:4,overflowWrap:"anywhere"},children:[(0,a.jsx)("code",{children:e.path})," ",(0,a.jsxs)("span",{className:"muted small",children:["(",e.input?"".concat(r("vcs.snapshotInput"),", "):"",r("vcs.snapshotKind.".concat(e.kind)),void 0!==e.size?", ".concat((0,c.zi)(e.size)):"",")"]})," ",0===e.allowed.length?(0,a.jsx)("span",{className:"err small",children:r("vcs.snapshotBlocked")}):(0,a.jsx)("select",{"aria-label":e.path,value:null!=(s=u[e.path])?s:"",onChange:s=>m({...u,[e.path]:s.target.value}),disabled:p||n.running||e.allowed.length<2,children:e.allowed.map(e=>(0,a.jsx)("option",{value:e,children:r("include"===e?"vcs.snapshotInclude":"vcs.snapshotLeaveOut")},e))}),e.reason&&(0,a.jsx)("div",{className:"muted small",children:e.reason})]},e.path)})}),(0,a.jsx)("button",{className:"primary",onClick:()=>void y(),disabled:p||n.running||!l.ok||0===g,children:r("vcs.snapshotTake")}),(0,a.jsx)("p",{className:"why",children:r("vcs.snapshotCancelWhy")}),x&&(0,a.jsx)("p",{className:"small",role:"status",children:x})]})}function H(e){var s,n,l,i,r,o,h,u,m,v,x,j,g,y,f,b,k,N,S,C,F,I,T,L,H,M,R,P,O,B,D,A,E,q,U,J;let{session:z,onChange:G}=e,{t:Z}=(0,d.kj)(),K=null!=(g=z.vcs)?g:{enabled:!0,repoDir:"",branchMode:"per-task",commitOnFinish:!0,branchPrefix:"cop/"},[_,Y]=(0,t.useState)(K.repoDir),[Q,V]=(0,t.useState)(null),[X,$]=(0,t.useState)(""),[ee,es]=(0,t.useState)(!1),en=JSON.stringify(K),[ea,et]=(0,t.useState)(null),[el,ei]=(0,t.useState)(null!=(y=K.branchName)?y:"");(0,t.useEffect)(()=>{var e;return ei(null!=(e=JSON.parse(en).branchName)?e:"")},[en]);let[er,ec]=(0,t.useState)(null!=(f=K.baseBranch)?f:"");(0,t.useEffect)(()=>{var e;return ec(null!=(e=JSON.parse(en).baseBranch)?e:"")},[en]);let[ed,eo]=(0,t.useState)((null!=(b=null==(s=K.userInputs)?void 0:s.paths)?b:[]).join("\n"));(0,t.useEffect)(()=>{var e,s;return eo((null!=(s=null==(e=JSON.parse(en).userInputs)?void 0:e.paths)?s:[]).join("\n"))},[en]);let[eh,eu]=(0,t.useState)((null!=(k=null==(n=K.artifacts)?void 0:n.paths)?k:[]).join("\n"));(0,t.useEffect)(()=>{var e,s;return eu((null!=(s=null==(e=JSON.parse(en).artifacts)?void 0:e.paths)?s:[]).join("\n"))},[en]);let em=e=>e.split(/\r?\n/).map(e=>e.trim()).filter(Boolean),[ep,ev]=(0,t.useState)(null!=(N=K.existingBranch)?N:"");(0,t.useEffect)(()=>{var e;return ev(null!=(e=JSON.parse(en).existingBranch)?e:"")},[en]);let ex=null!=(S=K.startFrom)?S:"head";(0,t.useEffect)(()=>{Y(JSON.parse(en).repoDir)},[en]);let ej=JSON.parse(en).repoDir||z.projectDir||"";(0,t.useEffect)(()=>{let e=!1;return ej.trim()?(c.FH.repoCheck(ej).then(s=>{var n;e||et(s.ok?null:null!=(n=s.problem)?n:null)}).catch(()=>{e||et(null)}),()=>{e=!0}):void et(null)},[ej]);let eg=(0,t.useCallback)(()=>{c.FH.vcsStatus(z.id).then(V).catch(()=>V(null))},[z.id]);(0,t.useEffect)(eg,[eg,en]);let ey=async e=>{try{await c.FH.updateSession(z.id,{vcs:e}),$(Z("vcs.saved")),G(),eg()}catch(e){$(e.message)}},ef=async()=>{es(!0),$(Z("mirror.browsing"));try{let s=await c.FH.browseFolder(_.trim()||z.projectDir||void 0);if(s.ok)Y(s.path),await ey({repoDir:s.path});else{var e;$(s.cancelled?Z("mirror.browseCancelled"):null!=(e=s.reason)?e:"")}}catch(e){$(e.message)}finally{es(!1)}},eb=K.repoDir||z.projectDir||"",ek=""!==eb.trim()&&null===ea;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:Z("vcs.title")}),(0,a.jsx)("span",{className:"badge ".concat(K.enabled?"done":""),children:K.enabled?Z("vcs.on"):Z("vcs.off")})]}),(0,a.jsx)("p",{className:"muted small",children:Z("vcs.hint")}),(0,a.jsx)("label",{htmlFor:"vcs-root",children:Z("vcs.repoField")}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("input",{id:"vcs-root",type:"text",className:"grow",value:_,onChange:e=>Y(e.target.value),onBlur:()=>_.trim()!==K.repoDir&&void ey({repoDir:_.trim()}),placeholder:z.projectDir||"C:\\Projects\\my-app",disabled:z.running}),(0,a.jsx)("button",{onClick:()=>void ef(),disabled:ee||z.running,children:Z("mirror.browse")})]}),(0,a.jsx)(p.H4,{current:_,onUse:e=>{Y(e),ey({repoDir:e})}}),ea&&(0,a.jsxs)("div",{className:"notice caution",style:{marginTop:8},children:[(0,a.jsx)("strong",{children:Z("vcs.noRepo")}),(0,a.jsx)("div",{className:"small",style:{marginTop:4},children:ea}),(0,a.jsx)("div",{className:"muted small",style:{marginTop:6},children:Z("vcs.noRepoHow")})]}),!ea&&""!==eb.trim()&&(0,a.jsx)("p",{className:"muted small",style:{marginTop:4},children:Z("vcs.repoOk")}),""===eb.trim()&&(0,a.jsx)("p",{className:"muted small",style:{marginTop:4},children:Z("vcs.pickFirst")}),(0,a.jsxs)("div",{className:"option".concat(ek||K.enabled?"":" warned"),children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:K.enabled,onChange:e=>void ey({enabled:e.target.checked}),disabled:z.running||!ek&&!K.enabled}),(0,a.jsx)("span",{children:Z("vcs.enable")})]}),(0,a.jsx)("p",{className:"why",children:Z("vcs.enableWhy")})]}),K.enabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"muted small",style:{marginTop:4},children:eb?Z("vcs.repoIs",{dir:eb}):Z("vcs.repoNone")}),eb&&!ea&&(0,a.jsx)(w.b,{dir:eb}),(0,a.jsx)("h3",{children:Z("vcs.branches")}),"existing-branch"===ex&&(0,a.jsx)("p",{className:"muted small",children:Z("vcs.branchesExisting",{branch:K.existingBranch||"…"})}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"branchMode",checked:"per-task"===K.branchMode,onChange:()=>void ey({branchMode:"per-task"}),disabled:z.running}),(0,a.jsx)("span",{children:Z("vcs.perTask")})]}),(0,a.jsx)("p",{className:"why",children:Z("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"===K.branchMode,onChange:()=>void ey({branchMode:"per-session"}),disabled:z.running}),(0,a.jsx)("span",{children:Z("vcs.perSession")})]}),(0,a.jsx)("p",{className:"why",children:Z("vcs.perSessionWhy")})]}),"per-session"===K.branchMode&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"vcs-branch-name",children:Z("vcs.branchName")}),(0,a.jsx)("input",{id:"vcs-branch-name",type:"text",value:el,onChange:e=>ei(e.target.value),onBlur:()=>{var e;return el.trim()!==(null!=(e=K.branchName)?e:"")&&void ey({branchName:el.trim()})},placeholder:z.name,disabled:z.running}),(0,a.jsx)("p",{className:"why",children:Z("vcs.branchNameWhy")})]}),(0,a.jsx)("h3",{children:Z("vcs.startFrom")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"startFrom",checked:"branch"===ex,onChange:()=>void ey({startFrom:"branch"}),disabled:z.running}),(0,a.jsx)("span",{children:Z("vcs.startBranch")})]}),(0,a.jsx)("p",{className:"why",children:Z("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"===ex,onChange:()=>void ey({startFrom:"previous-session"}),disabled:z.running}),(0,a.jsx)("span",{children:Z("vcs.startPrevious")})]}),(0,a.jsx)("p",{className:"why",children:Z("vcs.startPreviousWhy")})]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"startFrom",checked:"head"===ex,onChange:()=>void ey({startFrom:"head"}),disabled:z.running}),(0,a.jsx)("span",{children:Z("vcs.startHead")})]}),(0,a.jsx)("p",{className:"why",children:Z("vcs.startHeadWhy")})]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"startFrom",checked:"existing-branch"===ex,onChange:()=>void ey({startFrom:"existing-branch"}),disabled:z.running}),(0,a.jsx)("span",{children:Z("vcs.startExisting")})]}),(0,a.jsx)("p",{className:"why",children:Z("vcs.startExistingWhy")})]}),"existing-branch"===ex&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"vcs-existing-branch",children:Z("vcs.existingBranch")}),(0,a.jsx)("input",{id:"vcs-existing-branch",type:"text",list:"vcs-local-branches",value:ep,onChange:e=>ev(e.target.value),onBlur:()=>{var e;return ep.trim()!==(null!=(e=K.existingBranch)?e:"")&&void ey({existingBranch:ep.trim()})},disabled:z.running}),(0,a.jsx)("datalist",{id:"vcs-local-branches",children:(null!=(C=null==Q?void 0:Q.branches)?C:[]).map(e=>(0,a.jsx)("option",{value:e},e))}),(0,a.jsx)("p",{className:"why",children:Z("vcs.existingBranchWhy")}),K.existingBranch&&(null==Q?void 0:Q.branches)&&!Q.branches.includes(K.existingBranch)&&(0,a.jsx)("p",{className:"err small",children:Z("vcs.existingBranchMissing",{branch:K.existingBranch})})]}),("branch"===ex||"previous-session"===ex)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"vcs-base-branch",children:Z("vcs.baseBranch")}),(0,a.jsx)("input",{id:"vcs-base-branch",type:"text",value:er,onChange:e=>ec(e.target.value),onBlur:()=>{var e;return er.trim()!==(null!=(e=K.baseBranch)?e:"")&&void ey({baseBranch:er.trim()})},placeholder:"main",disabled:z.running}),(0,a.jsx)("p",{className:"why",children:Z("vcs.baseBranchWhy")})]}),z.vcsStart&&(0,a.jsxs)("p",{className:"muted small",children:["existing-branch"===z.vcsStart.kind?Z("vcs.startedExisting",{branch:null!=(F=z.vcsStart.branch)?F:"",commit:z.vcsStart.commit.slice(0,8)}):"previous-session"===z.vcsStart.kind?Z("vcs.startedPrevious",{name:null!=(I=null==(l=z.vcsStart.fromSession)?void 0:l.name)?I:"",branch:null!=(T=z.vcsStart.branch)?T:"",commit:z.vcsStart.commit.slice(0,8)}):"branch"===z.vcsStart.kind?Z("vcs.startedBranch",{branch:null!=(L=z.vcsStart.branch)?L:"",commit:z.vcsStart.commit.slice(0,8)}):"snapshot"===z.vcsStart.kind?Z("vcs.startedSnapshot",{branch:null!=(H=z.vcsStart.branch)?H:"",commit:z.vcsStart.commit.slice(0,8),from:null!=(M=null==(i=z.vcsStart.snapshot)?void 0:i.fromBranch)?M:"HEAD",n:null!=(R=null==(r=z.vcsStart.snapshot)?void 0:r.included.length)?R:0,out:null!=(P=null==(o=z.vcsStart.snapshot)?void 0:o.leftOut.length)?P:0}):Z("vcs.startedHead",{commit:z.vcsStart.commit.slice(0,8)}),z.vcsStart.note?" — ".concat(z.vcsStart.note):"",z.vcsStart.update&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("br",{}),"updated"===z.vcsStart.update.outcome?Z("vcs.updated",{branch:z.vcsStart.update.branch,remote:null!=(O=z.vcsStart.update.remote)?O:"",from:(null!=(B=z.vcsStart.update.from)?B:"").slice(0,8),to:(null!=(D=z.vcsStart.update.to)?D:"").slice(0,8)}):"up-to-date"===z.vcsStart.update.outcome?Z("vcs.upToDate",{branch:z.vcsStart.update.branch,remote:null!=(A=z.vcsStart.update.remote)?A:""}):Z("vcs.notUpdated",{branch:z.vcsStart.update.branch,why:null!=(E=z.vcsStart.update.detail)?E:z.vcsStart.update.outcome})]})]}),"head"!==ex&&(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:!1!==K.updateFromRemote,onChange:e=>void ey({updateFromRemote:e.target.checked}),disabled:z.running}),(0,a.jsx)("span",{children:Z("vcs.updateFromRemote")})]}),(0,a.jsx)("p",{className:"why",children:Z("vcs.updateFromRemoteWhy")})]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:K.commitOnFinish,onChange:e=>void ey({commitOnFinish:e.target.checked}),disabled:z.running}),(0,a.jsx)("span",{children:Z("vcs.commit")})]}),(0,a.jsx)("p",{className:"why",children:Z("vcs.commitWhy")})]}),"existing-branch"!==ex&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h3",{children:Z("vcs.dirty")}),["reject","snapshot","tracked-only-snapshot"].map(e=>{var s,n;return(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"vcs-dirty-".concat(z.id),checked:(null!=(n=null==(s=K.dirtyWorktree)?void 0:s.policy)?n:"reject")===e,onChange:()=>{var s;ey({dirtyWorktree:{policy:e,requireApproval:null==(s=K.dirtyWorktree)?void 0:s.requireApproval}})},disabled:z.running}),(0,a.jsx)("span",{children:Z("reject"===e?"vcs.dirtyReject":"snapshot"===e?"vcs.dirtySnapshot":"vcs.dirtyTracked")})]}),(0,a.jsx)("p",{className:"why",children:Z("reject"===e?"vcs.dirtyRejectWhy":"snapshot"===e?"vcs.dirtySnapshotWhy":"vcs.dirtyTrackedWhy")})]},e)}),(null!=(q=null==(h=K.dirtyWorktree)?void 0:h.policy)?q:"reject")!=="reject"&&(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:(null==(u=K.dirtyWorktree)?void 0:u.requireApproval)!==!1,onChange:e=>{var s,n;ey({dirtyWorktree:{policy:null!=(n=null==(s=K.dirtyWorktree)?void 0:s.policy)?n:"snapshot",requireApproval:e.target.checked}})},disabled:z.running}),(0,a.jsx)("span",{children:Z("vcs.dirtyApproval")})]}),(0,a.jsx)("p",{className:"why",children:Z("vcs.dirtyApprovalWhy")})]})]}),(0,a.jsx)("h3",{children:Z("vcs.inputs")}),(0,a.jsx)("label",{htmlFor:"vcs-inputs-".concat(z.id),children:Z("vcs.inputsField")}),(0,a.jsx)("textarea",{id:"vcs-inputs-".concat(z.id),rows:3,value:ed,onChange:e=>eo(e.target.value),onBlur:()=>{var e,s;return JSON.stringify(em(ed))!==JSON.stringify(null!=(s=null==(e=K.userInputs)?void 0:e.paths)?s:[])&&void ey({userInputs:{...K.userInputs,paths:em(ed)}})},disabled:z.running,placeholder:"rules-engine/test-data/schemas/*.yaml",spellCheck:!1}),(0,a.jsx)("p",{className:"why",children:Z("vcs.inputsWhy")}),(null!=(U=null==(m=K.userInputs)?void 0:m.paths.length)?U:0)>0&&(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:(null==(v=K.userInputs)?void 0:v.readOnly)!==!1,onChange:e=>{var s,n,a;ey({userInputs:{paths:null!=(a=null==(s=K.userInputs)?void 0:s.paths)?a:[],requireApproval:null==(n=K.userInputs)?void 0:n.requireApproval,readOnly:e.target.checked}})},disabled:z.running}),(0,a.jsx)("span",{children:Z("vcs.inputsReadOnly")})]}),(0,a.jsx)("p",{className:"why",children:Z("vcs.inputsReadOnlyWhy")})]}),(null==(x=z.vcsStart)?void 0:x.inputs)&&(0,a.jsx)("p",{className:"muted small",children:z.vcsStart.inputs.carried?Z("vcs.inputsCarried",{n:z.vcsStart.inputs.files.length,branch:z.vcsStart.inputs.carried.branch,onto:z.vcsStart.inputs.carried.onto.slice(0,8)}):Z("vcs.inputsRecorded",{n:z.vcsStart.inputs.files.length,commit:z.vcsStart.commit.slice(0,8)})}),(0,a.jsx)("h3",{children:Z("vcs.artifacts")}),(0,a.jsx)("label",{htmlFor:"vcs-artifacts-".concat(z.id),children:Z("vcs.artifactsField")}),(0,a.jsx)("textarea",{id:"vcs-artifacts-".concat(z.id),rows:2,value:eh,onChange:e=>eu(e.target.value),onBlur:()=>{var e,s;return JSON.stringify(em(eh))!==JSON.stringify(null!=(s=null==(e=K.artifacts)?void 0:e.paths)?s:[])&&void ey({artifacts:{paths:em(eh)}})},disabled:z.running,placeholder:"rules-engine/test-results/**",spellCheck:!1}),(0,a.jsx)("p",{className:"why",children:Z("vcs.artifactsWhy")}),Q&&!Q.ok&&(0,a.jsxs)("div",{className:"notice caution",role:"status",children:[(0,a.jsx)("strong",{children:Z("vcs.notReady")})," ",Q.problem]}),(null==Q||null==(j=Q.snapshot)?void 0:j.needed)&&Q.snapshot.entries.length>0&&(0,a.jsx)(W,{session:z,plan:Q.snapshot,onDone:()=>{G(),eg()}}),(null==Q?void 0:Q.ok)&&(0,a.jsx)("div",{className:"muted small",children:Z("vcs.ready",{branch:null!=(J=Q.branch)?J:"—",dir:Q.repoDir})}),(null==Q?void 0:Q.ok)&&Q.work&&Q.work.branches.length>0&&(0,a.jsxs)("div",{className:"muted small",children:["per-session"===Q.work.mode&&Q.work.complete?Z("vcs.completeOn",{branch:Q.work.complete}):Z("vcs.noSingleBranch",{n:Q.work.branches.length}),"per-task"===Q.work.mode&&(0,a.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:Q.work.branches.map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.branch})," — ",e.title,e.commit?"":" (".concat(Z("vcs.taskNoFiles"),")")]},e.branch))})]}),(0,a.jsx)("p",{className:"muted small",children:Z("vcs.pushIsYours")})]}),(0,a.jsx)("div",{className:"muted small",role:"status",children:X})]})}function M(e){var s;let{session:n,onChange:l}=e,{t:i}=(0,d.kj)(),[r,o]=(0,t.useState)(""),h=null!=(s=n.onFailure)?s:"stop",u=async e=>{if(e!==h)try{await c.FH.updateSession(n.id,{onFailure:e}),o(i("stop"===e?"chain.savedStop":"chain.savedContinue")),l()}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:i("chain.title")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"chain",checked:"stop"===h,onChange:()=>void u("stop"),disabled:n.running}),(0,a.jsx)("span",{children:i("chain.stop")})]}),(0,a.jsx)("p",{className:"why",children:i("chain.stopWhy")})]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"chain",checked:"continue"===h,onChange:()=>void u("continue"),disabled:n.running}),(0,a.jsx)("span",{children:i("chain.continue")})]}),(0,a.jsx)("p",{className:"why",children:i("chain.continueWhy")})]}),r&&(0,a.jsx)("div",{className:"muted small",role:"status",children:r}),n.running&&(0,a.jsx)("div",{className:"muted small",children:i("chain.locked")})]})}function R(e){let{value:s,onChange:n,presets:l,onPresetsChanged:i}=e,{t:r}=(0,d.kj)(),o=(0,t.useId)(),[h,u]=(0,t.useState)(""),m=async()=>{let e=prompt(r("l2.saveAsPrompt"));if(e)try{await c.FH.savePreset(e,s),u(r("l2.savedAs",{name:e})),null==i||i()}catch(e){u(e.message)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("label",{className:"grow",style:{margin:0},htmlFor:"".concat(o,"-text"),children:r("l2.label")}),(0,a.jsxs)("select",{value:"","aria-label":r("l2.loadPreset"),onChange:e=>{let s=l.find(s=>s.name===e.target.value);s&&n(s.content)},children:[(0,a.jsx)("option",{value:"",children:r("l2.loadPreset")}),l.map(e=>(0,a.jsx)("option",{value:e.name,children:e.name},e.name))]}),(0,a.jsx)("button",{onClick:()=>void m(),disabled:!s.trim(),children:r("l2.saveAs")})]}),(0,a.jsx)("textarea",{id:"".concat(o,"-text"),className:"prose",value:s,onChange:e=>n(e.target.value),placeholder:r("l2.placeholder"),style:{minHeight:140,marginTop:10}}),h&&(0,a.jsx)("div",{className:"muted small",children:h})]})}function P(e){let{session:s}=e,{t:n}=(0,d.kj)(),l=(0,d.W3)(),i=s.tasks.filter(e=>"queued"!==e.status),[r,o]=(0,t.useState)([]),h=r.length>0?r:i.map(e=>e.id),u=e=>(0,c.ub)("".concat(c.nC,"/sessions/").concat(s.id,"/export?variant=").concat(e)+(r.length>0?"&tasks=".concat(encodeURIComponent(r.join(","))):""));return(0,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===i.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(i.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:r.length>0?n("export.selected",{n:r.length}):n("export.allOf",{n:i.length})})]}),i.map(e=>{var s,t,i,c,d;return(0,a.jsx)("div",{className:"option",style:{margin:"6px 0"},children:(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:r.includes(e.id),onChange:()=>{let s;return s=e.id,o(e=>e.includes(s)?e.filter(e=>e!==s):[...e,s])}}),(0,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")})," ",(null!=(t=null==(s=e.scope)?void 0:s.length)?t:0)>0&&(0,a.jsx)("span",{className:"chip",children:n("task.scope",{paths:(null!=(i=e.scope)?i:[]).join(", ")})})," ",(0,a.jsx)("span",{className:"muted small",children:l(null!=(d=null!=(c=e.finishedAt)?c:e.startedAt)?d:e.createdAt)})]})]})},e.id)}),(0,a.jsxs)("div",{className:"row",style:{marginTop:10},children:[(0,a.jsx)("a",{className:"button-link",href:u("outcome"),download:!0,children:n("export.outcome",{n:h.length})}),(0,a.jsx)("a",{className:"button-link",href:u("full"),download:!0,children:n("export.full",{n:h.length})})]}),(0,a.jsx)("p",{className:"muted small",style:{marginTop:8},children:n("export.outcomeWhy")})]})]})}function O(e){let{handoff:s}=e,{t:n}=(0,d.kj)(),t=(e,s)=>(0,a.jsxs)("div",{className:"handoff-row",children:[(0,a.jsx)("strong",{children:n(e)})," ",s]}),l=e=>(0,a.jsx)("ul",{children:e.map((e,s)=>(0,a.jsx)("li",{children:e},s))}),i=s.validation.filter(e=>e.passed).length;return(0,a.jsxs)("div",{className:"summary handoff",children:[(0,a.jsx)("strong",{children:n("handoff.title")}),t("handoff.outcome",(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"badge ".concat(s.outcome.status),children:n("status.".concat(s.outcome.status))}),s.outcome.reason?" ".concat(s.outcome.reason):""]})),t("handoff.files",0===s.changedFiles.length?(0,a.jsx)("span",{className:"muted",children:n("handoff.noFiles")}):(0,a.jsx)("code",{children:s.changedFiles.map(e=>"".concat(e.path).concat(e.added>=0?" +".concat(e.added,"/-").concat(e.removed):"")).join(", ")})),s.validation.length>0&&t("handoff.validation",(0,a.jsxs)(a.Fragment,{children:[n("handoff.passed",{n:i,of:s.validation.length}),s.review?" \xb7 ".concat(n("handoff.review",{verdict:s.review.verdict,open:s.review.open})):""]})),t("handoff.issues",0===s.knownIssues.length?(0,a.jsx)("span",{className:"muted",children:n("handoff.noIssues")}):l(s.knownIssues)),s.evidence.runId&&t("handoff.evidence",(0,a.jsx)("code",{children:s.evidence.runId})),(s.vcs.branch||s.vcs.problem)&&t("handoff.vcs",(0,a.jsxs)(a.Fragment,{children:[s.vcs.branch&&(0,a.jsx)("code",{children:s.vcs.branch}),s.vcs.commit?" @ ".concat(s.vcs.commit.slice(0,8)," \xb7 ").concat(n("handoff.notPushed")):s.vcs.branch?" \xb7 ".concat(n("handoff.noCommit")):"",s.vcs.problem?" — ".concat(s.vcs.problem):""]})),s.manual.length>0&&t("handoff.manual",l(s.manual)),s.notExecuted.length>0&&t("handoff.notRun",l(s.notExecuted))]})}function B(e){var s;let{session:n,presets:l,onAdded:i,onPresetsChanged:r}=e,{t:o}=(0,d.kj)(),h=[...n.tasks].reverse()[0],[u,m]=(0,t.useState)(""),[p,v]=(0,t.useState)(null!=(s=null==h?void 0:h.level2)?s:""),[x,j]=(0,t.useState)(""),[g,y]=(0,t.useState)(""),[f,b]=(0,t.useState)(!1),k=(0,t.useRef)(!1),N=async()=>{if(!k.current){k.current=!0,b(!0);try{await c.FH.addTask(n.id,{title:u,level2:p,prompt:x}),m(""),j(""),y(o("form.queued")),i()}catch(e){y(e.message)}finally{k.current=!1,b(!1)}}};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",{htmlFor:"new-task-title",children:o("form.titleLabel")}),(0,a.jsx)("input",{id:"new-task-title",type:"text",value:u,onChange:e=>m(e.target.value),placeholder:o("form.titlePlaceholder")}),(0,a.jsx)("div",{style:{marginTop:10},children:(0,a.jsx)(R,{value:p,onChange:v,presets:l,onPresetsChanged:r})}),(0,a.jsx)("label",{htmlFor:"new-task-prompt",children:o("form.taskLabel")}),(0,a.jsx)("textarea",{id:"new-task-prompt",className:"prose",value:x,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 N(),disabled:f||!x.trim(),children:o("form.add")}),(0,a.jsx)("span",{className:"muted small",children:g})]})]})}function D(e){var s,n,l,i,r,m,p,v,f,k,w,S,C,F,I,T,L,W,H,M,P,B,D,A,q,G,Z,K,_,Y,Q,V,X,$,ee,es,en,ea,et,el,ei,er,ec,ed,eo,eh,eu,em,ep,ev,ex,ej,eg,ey,ef,eb,ek,eN,ew,eS,eC,eF,eI,eT,eL,eW,eH,eM,eR,eP,eO,eB,eD,eA,eE,eq,eU,eJ,ez,eG,eZ,eK,e_,eY;let{session:eQ,task:eV,index:eX,presets:e$,onChange:e0}=e,{t:e1}=(0,d.kj)(),e2=(0,d.W3)(),[e8,e4]=(0,t.useState)(!1),[e6,e3]=(0,t.useState)(!1),[e5,e7]=(0,t.useState)(eV.title),[e9,se]=(0,t.useState)(eV.level2),[ss,sn]=(0,t.useState)(eV.prompt),[sa,st]=(0,t.useState)(null!=(es=null==(s=eV.vcsPlan)?void 0:s.branch)?es:""),[sl,si]=(0,t.useState)(null!=(en=null==(n=eV.vcsPlan)?void 0:n.commitMessage)?en:""),[sr,sc]=(0,t.useState)(null!=(ea=eV.checks)?ea:[]),[sd,so]=(0,t.useState)(!!eV.readOnly),[sh,su]=(0,t.useState)((null!=(et=eV.scope)?et:[]).join("\n")),sm={readOnly:sd,scope:sd?[]:(0,N.w)(sh)},sp=(0,u.c)((0,h.DG)(eV)),[sv,sx]=(0,t.useState)(null),[sj,sg]=(0,t.useState)(""),sy=async()=>{try{await c.FH.updateTask(eQ.id,eV.id,{title:e5,level2:e9,prompt:ss,vcsPlan:{branch:sa,commitMessage:sl},checks:sr,...sm}),e4(!1),e0()}catch(e){sg(e.message)}},sf="running"===eV.status||"waiting-approval"===eV.status,sb=!sf&&"queued"!==eV.status,sk=!sf&&"queued"!==eV.status,sN=!sf&&null!=(el=null==(l=eQ.vcs)?void 0:l.enabled)&&el&&(!!(null==(i=eV.vcs)?void 0:i.baseCommit)||(null!=(ei=eV.attempts)?ei:[]).some(e=>{var s;return null==(s=e.vcs)?void 0:s.baseCommit})),sw=!sf&&(0,c.Zm)(eV),sS=async()=>{if(await (0,g.Z)(e1("task.continueConfirm",{title:eV.title})))try{await c.FH.continueTask(eQ.id,eV.id),e0()}catch(e){sg(e.message)}},sC=async()=>{if(await (0,g.Z)(e1("task.rerunConfirm",{title:eV.title})))try{await c.FH.rerunTask(eQ.id,eV.id),e0()}catch(e){sg(e.message)}},sF=async()=>{if(await (0,g.Z)(e1("task.editRanConfirm",{title:eV.title})))try{await c.FH.rerunTask(eQ.id,eV.id,{title:e5,level2:e9,prompt:ss,vcsPlan:{branch:sa,commitMessage:sl},checks:sr,...sm},{buildOnFinished:"done"===eV.status}),e4(!1),e0()}catch(e){sg(e.message)}},sI=(0,b.e)(e0),sT=async()=>{let e="queued"===eV.status?"task.deleteConfirm":"task.deleteConfirmRan";if(await (0,g.Z)(e1(e,{title:eV.title})))try{await c.FH.deleteTask(eQ.id,eV.id),e0()}catch(e){sg(e.message)}},sL=async()=>{try{sx(await c.FH.taskFiles(eQ.id,eV.id))}catch(e){sg(e.message)}},sW=(e,s,n)=>n.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("span",{className:"muted",children:[e1(e)," "]}),n.map(e=>(0,a.jsx)("span",{style:{marginRight:10},children:(0,a.jsx)(o.u,{label:e,save:()=>c.FH.saveTaskFile(eQ.id,eV.id,s,e)})},e))]});return(0,a.jsxs)("div",{className:"task ".concat(eV.status),id:eV.id,children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsxs)("h4",{className:"grow",children:[eX,". ",eV.title]}),(0,a.jsx)("span",{className:"badge ".concat(eV.status),children:e1("status.".concat(eV.status))}),eV.limit&&(0,a.jsx)("span",{className:"chip",title:e1("reg.limitChipWhy"),children:e1("reg.limitChip",{limit:e1("limit.".concat(eV.limit.setting),{n:eV.limit.value})})}),(null!=(er=eV.attempt)?er:1)>1&&(0,a.jsx)("span",{className:"chip",children:e1("task.attemptN",{n:null!=(ec=eV.attempt)?ec:1})}),eV.iterations>0&&(0,a.jsx)("span",{className:"muted small",children:e1("task.iterations",{n:eV.iterations})}),eV.runId&&(0,a.jsxs)("button",{className:e6?"":"quiet","aria-expanded":e6,onClick:()=>e3(e=>!e),title:(0,h.DG)(eV)?e1("story.showLiveWhy"):e1("story.why"),children:[(0,h.DG)(eV)&&!e6&&(0,a.jsx)("span",{className:"dot","aria-hidden":"true"}),e6?e1("story.hide"):(0,h.DG)(eV)?e1("story.showLive"):e1("story.show")]}),!sf&&(0,a.jsx)("button",{onClick:()=>{if(!e8){var e,s,n,a,t,l;e7(eV.title),se(eV.level2),sn(eV.prompt),st(null!=(n=null==(e=eV.vcsPlan)?void 0:e.branch)?n:""),si(null!=(a=null==(s=eV.vcsPlan)?void 0:s.commitMessage)?a:""),sc(null!=(t=eV.checks)?t:[]),so(!!eV.readOnly),su((null!=(l=eV.scope)?l:[]).join("\n"))}e4(!e8)},title:e1("task.editAll"),children:e8?e1("task.cancel"):e1("task.edit")}),sw&&(0,a.jsx)("button",{className:"primary",onClick:()=>void sS(),title:e1("task.continueWhy"),children:e1("task.continue")}),sk&&(0,a.jsx)("button",{className:sw?"":"primary",onClick:()=>void sC(),title:e1("task.rerunWhy"),children:e1("task.rerun")}),sN&&(0,a.jsx)("button",{onClick:()=>void sI.restore({sessionId:eQ.id,taskId:eV.id,title:eV.title}),disabled:""!==sI.busy||eQ.running,title:e1("restore.why"),children:"restore"===sI.busy?e1("restore.checking"):e1("restore.button")}),sb&&(0,a.jsx)("button",{onClick:()=>void sI.restartFrom({sessionId:eQ.id,taskId:eV.id,title:eV.title}),disabled:""!==sI.busy||eQ.running,title:e1("restart.why"),children:"restart"===sI.busy?e1("restart.checking"):e1("restart.button")}),!sf&&(0,a.jsx)("button",{className:"danger",onClick:()=>void sT(),children:e1("task.delete")}),!e8&&(sj||sI.message)&&(0,a.jsx)("span",{className:"err",role:"alert",children:sj||sI.message})]}),(0,a.jsxs)("div",{className:"muted small",children:[eV.startedAt?e1("task.started",{t:e2(eV.startedAt)}):e1("task.added",{t:e2(eV.createdAt)}),eV.finishedAt?" \xb7 ".concat(e1("task.finished",{t:e2(eV.finishedAt)})):"",eV.startedAt&&eV.finishedAt?" \xb7 ".concat(e1("task.took",{d:(0,c.c5)((0,h.d5)(eV.startedAt,eV.finishedAt))})):"",(0,h.DG)(eV)?" \xb7 ".concat(e1("task.runningFor",{d:(0,c.c5)((0,h.d5)(eV.startedAt,void 0,sp))})):""]}),"queued"!==eV.status&&(null==(r=eQ.vcs)?void 0:r.enabled)&&eV.vcs&&(0,a.jsx)("div",{className:"muted small",children:eV.vcs.problem&&!eV.vcs.branch?(0,a.jsx)("span",{className:"reason",children:e1("vcs.taskProblem",{problem:eV.vcs.problem})}):(0,a.jsxs)(a.Fragment,{children:[eV.vcs.branch&&e1("vcs.taskBranch",{branch:eV.vcs.branch}),eV.vcs.baseCommit&&" \xb7 ".concat(e1("vcs.taskBase",{commit:eV.vcs.baseCommit.slice(0,8)})),eV.vcs.commit?" \xb7 ".concat(e1("vcs.taskCommit",{commit:eV.vcs.commit.slice(0,8)})):" \xb7 ".concat(e1("vcs.taskNoFiles")),(null!=(ed=null==(m=eV.vcs.files)?void 0:m.length)?ed:0)>0&&(0,a.jsxs)("details",{style:{display:"inline"},children:[(0,a.jsxs)("summary",{style:{display:"inline",cursor:"pointer"},children:[" \xb7 ",e1("vcs.taskFiles",{n:null!=(eo=null==(p=eV.vcs.files)?void 0:p.length)?eo:0})]}),(0,a.jsx)("ul",{style:{margin:"4px 0 4px 0",paddingLeft:20},children:(null!=(eh=eV.vcs.files)?eh:[]).map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.path})," ",e.added<0||e.removed<0?e1("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))})]}),eV.vcs.commit&&eV.vcs.baseCommit&&(0,a.jsxs)(a.Fragment,{children:[" \xb7 ",(0,a.jsx)(y.C,{sessionId:eQ.id,taskId:eV.id,title:eV.title,files:null!=(eu=null==(v=eV.vcs.files)?void 0:v.length)?eu:0})]}),(null!=(em=null==(f=eV.vcs.suspicious)?void 0:f.length)?em:0)>0&&(0,a.jsxs)("div",{className:"err small",style:{marginTop:4},children:[e1("vcs.suspicious",{n:null!=(ep=null==(k=eV.vcs.suspicious)?void 0:k.length)?ep:0}),(0,a.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(ev=eV.vcs.suspicious)?ev:[]).map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.path})," — ",e.reason]},e.path))})]}),(null!=(ex=null==(w=eV.scopeReverted)?void 0:w.length)?ex:0)>0&&(0,a.jsx)("div",{className:"small",style:{marginTop:4},children:e1("task.scopeReverted",{n:null!=(ej=null==(S=eV.scopeReverted)?void 0:S.length)?ej:0,paths:(null!=(eg=eV.scopeReverted)?eg:[]).join(", ")})}),(null!=(ey=null==(C=eV.inputsRestored)?void 0:C.length)?ey:0)>0&&(0,a.jsx)("div",{className:"small",style:{marginTop:4},children:e1("task.inputsRestored",{n:null!=(ef=null==(F=eV.inputsRestored)?void 0:F.length)?ef:0,paths:(null!=(eb=eV.inputsRestored)?eb:[]).join(", ")})}),(null!=(ek=null==(I=eV.artifactsKept)?void 0:I.length)?ek:0)>0&&(0,a.jsx)("div",{className:"muted small",style:{marginTop:4,overflowWrap:"anywhere"},children:e1("task.artifactsKept",{n:null!=(eN=null==(T=eV.artifactsKept)?void 0:T.length)?eN:0,paths:(null!=(ew=eV.artifactsKept)?ew:[]).slice(0,10).map(e=>e.path).join(", ")})}),(null!=(eS=null==(L=eV.vcs.foreignCommits)?void 0:L.length)?eS:0)>0&&(0,a.jsxs)("div",{className:"err small",style:{marginTop:4},children:[e1("vcs.foreignCommits",{n:null!=(eC=null==(W=eV.vcs.foreignCommits)?void 0:W.length)?eC:0}),(0,a.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(eF=eV.vcs.foreignCommits)?eF:[]).map(e=>(0,a.jsx)("li",{children:(0,a.jsx)("code",{children:e})},e))})]})]})}),"queued"===eV.status&&(null==(H=eQ.vcs)?void 0:H.enabled)&&((null==(M=eV.vcsPlan)?void 0:M.branch)||(null==(P=eV.vcsPlan)?void 0:P.commitMessage))&&(0,a.jsx)("div",{className:"muted small",children:eV.vcsPlan.branch&&eV.vcsPlan.commitMessage?e1("task.gitNames",{branch:eV.vcsPlan.branch,subject:eV.vcsPlan.commitMessage.split("\n")[0]}):eV.vcsPlan.branch?e1("task.gitBranchOnly",{branch:eV.vcsPlan.branch}):e1("task.gitCommitOnly",{subject:(null!=(eI=eV.vcsPlan.commitMessage)?eI:"").split("\n")[0]})}),e6&&eV.runId&&(0,a.jsx)(x.P,{sessionId:eQ.id,taskId:eV.id,live:"running"===eV.status||"waiting-approval"===eV.status}),e8?(0,a.jsxs)("div",{style:{marginTop:8},children:[(0,a.jsx)("label",{children:e1("form.titleLabel")}),(0,a.jsx)("input",{type:"text",value:e5,onChange:e=>e7(e.target.value)}),(0,a.jsx)("div",{style:{marginTop:8},children:(0,a.jsx)(R,{value:e9,onChange:se,presets:e$})}),(0,a.jsx)("label",{children:e1("form.taskLabel")}),(0,a.jsx)("textarea",{className:"prose",value:ss,onChange:e=>sn(e.target.value)}),(null==(B=eQ.vcs)?void 0:B.enabled)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"branch-".concat(eV.id),children:e1("task.branch")}),(0,a.jsx)("input",{id:"branch-".concat(eV.id),type:"text",value:sa,onChange:e=>st(e.target.value),placeholder:eQ.vcs.branchPrefix,disabled:"per-session"===eQ.vcs.branchMode}),(0,a.jsx)("p",{className:"why",children:"per-session"===eQ.vcs.branchMode?e1("task.branchIgnored"):e1("task.branchWhy")}),(0,a.jsx)("label",{htmlFor:"commit-".concat(eV.id),children:e1("task.commitMessage")}),(0,a.jsx)("textarea",{id:"commit-".concat(eV.id),value:sl,onChange:e=>si(e.target.value),style:{minHeight:70}}),(0,a.jsx)("p",{className:"why",children:e1("task.commitWhy")})]}),(0,a.jsx)(E,{checks:sr,onChange:sc}),ss.trim()!==eV.prompt.trim()&&(0,a.jsx)("p",{className:"notice caution small",children:e1("task.newIntentNote")}),(0,a.jsx)(N.y,{readOnly:sd,scope:sh,onReadOnly:so,onScope:su}),(0,a.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void(sb?sF():sy()),children:sb?e1("task.saveAndRerun"):e1("task.save")}),(0,a.jsx)("span",{className:"err",children:sj})]}),sb&&(0,a.jsx)("p",{className:"muted small",children:e1("task.editRanWhy")})]}):(0,a.jsxs)(a.Fragment,{children:[(null!=(eT=null==(D=eV.checks)?void 0:D.length)?eT:0)>0&&(0,a.jsxs)("details",{className:"small",style:{margin:"6px 0"},children:[(0,a.jsxs)("summary",{children:[e1("checks.title")," — ",e1("checks.n",{n:null!=(eL=null==(A=eV.checks)?void 0:A.length)?eL:0}),(null!=(eW=null==(q=eV.checkResults)?void 0:q.length)?eW:0)>0&&" \xb7 ".concat((null!=(eH=eV.checkResults)?eH:[]).filter(e=>e.passed).length,"/").concat(null==(G=eV.checkResults)?void 0:G.length," ").concat(e1("checks.passed"))]}),(0,a.jsx)("ul",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(eM=eV.checks)?eM:[]).map((e,s)=>{var n;let t=(null!=(n=eV.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:[" — ",e1("checks.kind.".concat(e.expect)),e.value?' "'.concat(e.value,'"'):"",e.run?": ".concat(e.run):e.file?": ".concat(e.file):""]}),t&&(0,a.jsxs)("div",{className:t.passed?"muted":"reason",children:[t.passed?e1("checks.passed"):e1("checks.failed")," — ",t.detail]})]},"".concat(e.name,"-").concat(s))})})]}),(null!=(eR=null==(Z=eV.reviewChecks)?void 0:Z.length)?eR:0)>0&&(0,a.jsxs)("details",{className:"small",style:{margin:"6px 0"},children:[(0,a.jsx)("summary",{children:e1("checks.fromReview",{n:null!=(eP=null==(K=eV.reviewChecks)?void 0:K.length)?eP:0})}),(0,a.jsx)("p",{className:"why",children:e1("checks.fromReviewWhy")}),(0,a.jsx)("ul",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(eO=eV.reviewChecks)?eO:[]).map(e=>{var s;let n=(null!=(s=eV.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:e1("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?e1("checks.passed"):e1("checks.failed")," — ",n.detail]})]},"".concat(e.attempt,":").concat(e.findingId,":").concat(e.check.name))})})]}),(0,a.jsx)(z,{review:eV.review}),eV.stopCode&&!(0,h.DG)(eV)&&(0,a.jsx)("p",{className:"small",children:(0,a.jsx)("span",{className:"chip",title:e1("stop.why"),children:e1("stop.".concat(eV.stopCode))})}),eV.handoff&&!(0,h.DG)(eV)&&(0,a.jsx)(O,{handoff:eV.handoff}),eV.summary&&(0,a.jsxs)("div",{className:"summary",children:[(0,a.jsx)("strong",{children:e1("task.whatWasDone")}),(0,a.jsx)(j.s,{text:eV.summary})]}),(null!=(eB=null==(_=eV.deviations)?void 0:_.length)?eB:0)>0&&(0,a.jsx)(U,{items:null!=(eD=eV.deviations)?eD:[]}),(null!=(eA=null==(Y=eV.disputes)?void 0:Y.length)?eA:0)>0&&(0,a.jsx)(J,{items:null!=(eE=eV.disputes)?eE:[]}),eV.environment&&(0,a.jsx)("div",{className:"muted small",style:{margin:"4px 0"},children:e1("task.ranWith",{node:eV.environment.node,npm:null!=(eq=eV.environment.npm)?eq:"—",git:null!=(eU=eV.environment.git)?eU:"—",pwsh:null!=(ez=null!=(eJ=eV.environment.pwsh)?eJ:eV.environment.powershell)?ez:"—"})}),(null!=(eG=null==(Q=eV.leftovers)?void 0:Q.length)?eG:0)>0&&(0,a.jsxs)("div",{className:"err small",style:{margin:"6px 0"},children:[e1("task.leftovers",{n:null!=(eZ=null==(V=eV.leftovers)?void 0:V.length)?eZ:0}),(0,a.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(eK=eV.leftovers)?eK:[]).map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.name})," pid ",e.pid,e.ports.length>0?" \xb7 ".concat(e1("task.leftoverPorts",{ports:e.ports.join(", ")})):""," \xb7 ",e.by]},"".concat(e.by,"-").concat(e.pid)))})]}),eV.reason&&(0,a.jsx)("div",{className:"reason small",style:{margin:"6px 0"},children:eV.reason}),(null!=(e_=null==(X=eV.attempts)?void 0:X.length)?e_:0)>0&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:e1("task.attempts",{n:null!=(eY=null==($=eV.attempts)?void 0:$.length)?eY:0})}),null==(ee=eV.attempts)?void 0:ee.map((e,s)=>{var n,t,l,i;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:e1("task.attemptN",{n:s+1})}),(0,a.jsx)("span",{className:"badge ".concat(e.status),children:e1("status.".concat(e.status))}),e.iterations>0&&(0,a.jsx)("span",{className:"muted",children:e1("task.iterations",{n:e.iterations})}),e.runId&&(0,a.jsx)(o.u,{label:e1("save.attemptLog"),save:()=>c.FH.saveTaskLog(eQ.id,eV.id,e.runId)}),e.runId&&(0,a.jsx)(o.H,{sessionId:eQ.id,taskId:eV.id,attempt:s+1}),e.runId&&(null==(n=e.vcs)?void 0:n.commit)&&e.vcs.baseCommit&&(0,a.jsx)(y.C,{sessionId:eQ.id,taskId:eV.id,runId:e.runId,title:"".concat(eV.title," — ").concat(e1("task.attemptN",{n:s+1})),files:null!=(l=null==(t=e.vcs.files)?void 0:t.length)?l:0})]}),(0,a.jsxs)("div",{className:"muted",children:[e.startedAt?e1("task.started",{t:e2(e.startedAt)}):"",e.finishedAt?" \xb7 ".concat(e1("task.finished",{t:e2(e.finishedAt)})):""]}),e.summary&&(0,a.jsx)("div",{children:e.summary}),e.reason&&(0,a.jsx)("div",{className:"err",children:e.reason}),e.prompt&&e.prompt!==eV.prompt&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:e1("task.attemptText")}),(0,a.jsx)("pre",{children:e.prompt})]})]},"".concat(null!=(i=e.runId)?i:s))})]}),"queued"===eV.status?(0,a.jsxs)("div",{style:{marginTop:8},children:[(0,a.jsx)("div",{className:"muted small",children:e1("task.prompt")}),(0,a.jsx)("pre",{children:eV.prompt}),eV.level2.trim()?(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:e1("task.l2Show",{n:eV.level2.trim().split("\n").length})}),(0,a.jsx)("pre",{children:eV.level2})]}):(0,a.jsx)("div",{className:"muted small",children:e1("task.noL2")})]}):(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:e1("task.promptAndL2")}),eV.level2.trim()&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"muted small",children:e1("task.l2")}),(0,a.jsx)("pre",{children:eV.level2})]}),(0,a.jsx)("div",{className:"muted small",children:e1("task.prompt")}),(0,a.jsx)("pre",{children:eV.prompt})]}),eV.firstMessage&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:e1("task.firstMessage")}),(0,a.jsx)("pre",{className:"tall",children:eV.firstMessage})]}),eV.runId&&(0,a.jsxs)("details",{onToggle:e=>e.currentTarget.open&&void sL(),children:[(0,a.jsx)("summary",{children:e1("task.files")}),(0,a.jsx)("div",{className:"row small",style:{margin:"6px 0"},children:(0,a.jsx)(o.u,{label:e1("save.log"),save:()=>c.FH.saveTaskLog(eQ.id,eV.id)})}),sv&&(0,a.jsxs)("div",{className:"small",children:[sW("task.reports","reports",sv.reports),sW("task.artifacts","artifacts",sv.artifacts),sW("task.replies","replies",sv.replies)]})]}),eV.finalReply&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:e1("task.finalReply")}),(0,a.jsx)("pre",{className:"tall",children:eV.finalReply})]})]})]})}function A(e){let{events:s}=e,{t:n}=(0,d.kj)(),{appearance:l}=(0,m.KP)(),i=(0,t.useRef)(null);return(0,t.useEffect)(()=>{!l.reduceMotion&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[s.length,l.reduceMotion]),(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsx)("h2",{children:n("live.title")}),(0,a.jsxs)("div",{className:"log",ref:i,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 E(e){let{checks:s,onChange:n}=e,{t}=(0,d.kj)(),l=(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:t("checks.title")}),(0,a.jsx)("p",{className:"why",style:{marginTop:0},children:t("checks.why")}),0===s.length&&(0,a.jsx)("p",{className:"muted small",children:t("checks.noneWhy")}),s.map((e,i)=>{var r,d,o,h;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:t("checks.namePlaceholder"),onChange:e=>l(i,{name:e.target.value}),"aria-label":t("checks.name")}),(0,a.jsx)("select",{value:e.expect,onChange:e=>l(i,{expect:e.target.value}),"aria-label":t("checks.kind"),style:{width:"auto"},children:c.FZ.map(e=>(0,a.jsx)("option",{value:e,children:t("checks.kind.".concat(e))},e))}),(0,a.jsx)("button",{className:"quiet",onClick:()=>n(s.filter((e,s)=>s!==i)),children:t("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!=(r=e.run)?r:"",placeholder:t("checks.run"),onChange:e=>l(i,{run:e.target.value}),"aria-label":t("checks.run")}),(0,a.jsx)("input",{type:"text",value:null!=(d=e.cwd)?d:"",placeholder:t("checks.cwd"),onChange:e=>l(i,{cwd:e.target.value}),"aria-label":t("checks.cwd"),style:{width:220}})]}):(0,a.jsx)("input",{type:"text",className:"grow",value:null!=(o=e.file)?o:"",placeholder:t("checks.file"),onChange:e=>l(i,{file:e.target.value}),"aria-label":t("checks.file")}),(0,c.dK)(e.expect)&&(0,a.jsx)("input",{type:"text",value:null!=(h=e.value)?h:"",placeholder:"output-matches"===e.expect?t("checks.valueRegex"):t("checks.value"),onChange:e=>l(i,{value:e.target.value}),"aria-label":t("checks.value"),style:{width:240}})]})]},i)}),(0,a.jsx)("button",{onClick:()=>n([...s,{name:"",expect:"exit-zero",run:""}]),children:t("checks.add")})]})}function q(e){let{tasks:s}=e,{t:n}=(0,d.kj)(),t=(0,h.hH)(s),l=(0,u.c)(!!t&&t.tasks.some(h.DG));if(!t)return null;let i=(0,h.eZ)(t.run,t.tasks,l);return(0,a.jsx)("p",{className:"muted small",style:{margin:"4px 0 10px"},children:n(i.live?"session.runClockLive":"session.runClock",{n:i.tasks,d:(0,c.c5)(i.ms)})})}function U(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 J(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 z(e){var s,n,t,l,i;let{review:r}=e,{t:c}=(0,d.kj)();if(!r)return null;if("skipped"===r.verdict)return r.skippedBecause?(0,a.jsx)("p",{className:"muted small",children:c("review.skippedWhy",{why:r.skippedBecause})}):null;let o="pass"===r.verdict?"done":"fail"===r.verdict?"blocked":"waiting-approval";return(0,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(r.verdict))}),r.stepsRun>0&&(0,a.jsx)("span",{className:"muted",children:c("review.ran",{n:r.stepsRun})}),r.rounds>1&&(0,a.jsx)("span",{className:"muted",children:c("review.rounds",{n:r.rounds})}),r.model&&(0,a.jsx)("span",{className:"chip",children:c("review.onModel",{model:r.model})})]}),r.problem&&(0,a.jsx)("p",{className:"reason",children:c("review.problem",{problem:r.problem})}),r.summary&&(0,a.jsx)(j.s,{text:r.summary}),(null!=(t=null==(s=r.findings)?void 0:s.length)?t:0)>0&&(0,a.jsxs)("details",{style:{marginTop:4},children:[(0,a.jsx)("summary",{children:c("review.findings",{n:null!=(l=null==(n=r.findings)?void 0:n.length)?l:0})}),(0,a.jsx)("ol",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(i=r.findings)?i:[]).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:()=>r});var a=n(3365),t=n(1521),l=n(5549),i=n(867);function r(e){var s,n;let{id:r,chosen:c,onChange:d,none:o,catalogue:h,disabled:u=!1,style:m}=e,{t:p}=(0,i.kj)(),v=function(e){let[s,n]=(0,t.useState)(null);return(0,t.useEffect)(()=>{if(void 0!==e)return;let s=!0;return l.FH.models().then(e=>{s&&n(e)}).catch(()=>void 0),()=>{s=!1}},[e]),void 0!==e?e:s}(h),x=null!=(s=null==v?void 0:v.options)?s:[],j=x.some(e=>e.name===c),g=x.filter(e=>!e.group),y=new Map;for(let e of x)e.group&&y.set(e.group,[...null!=(n=y.get(e.group))?n:[],e]);return(0,a.jsxs)("select",{id:r,value:c,onChange:e=>d(e.target.value),disabled:u,style:{width:"auto",minWidth:280,...m},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)),[...y.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)})]})}},8078:(e,s,n)=>{"use strict";n.d(s,{AppearanceProvider:()=>o,KP:()=>h});var a=n(3365),t=n(1521);let l="cop.appearance",i=["small","normal","large","huge","giant"];"\n(function () {\n try {\n var d = document.documentElement;\n var raw = localStorage.getItem('".concat(l,"');\n var a = raw ? JSON.parse(raw) : {};\n if (!a || typeof a !== 'object') a = {};\n d.dataset.theme = a.theme === 'dark' ? 'dark' : 'light';\n d.dataset.textsize = ").concat(JSON.stringify(i),".indexOf(a.textSize) >= 0 ? a.textSize : 'normal';\n d.dataset.contrast = a.highContrast ? 'high' : 'normal';\n d.dataset.motion = a.reduceMotion ? 'reduced' : 'normal';\n d.dataset.links = a.underlineLinks ? 'underline' : 'plain';\n d.dataset.focus = a.strongFocus ? 'strong' : 'normal';\n } catch (e) {}\n})();\n");let r={theme:"light",textSize:"normal",highContrast:!1,reduceMotion:!1,underlineLinks:!1,strongFocus:!1};function c(e){let s=document.documentElement;s.dataset.theme=e.theme,s.dataset.textsize=e.textSize,s.dataset.contrast=e.highContrast?"high":"normal",s.dataset.motion=e.reduceMotion?"reduced":"normal",s.dataset.links=e.underlineLinks?"underline":"plain",s.dataset.focus=e.strongFocus?"strong":"normal"}let d=(0,t.createContext)({appearance:r,set:()=>void 0,reset:()=>void 0,loaded:!1});function o(e){let{children:s}=e,[n,o]=(0,t.useState)(r),[h,u]=(0,t.useState)(!1);(0,t.useEffect)(()=>{let e=r;try{let s=window.localStorage.getItem(l);s?e=function(e){let s=e&&"object"==typeof e?e:{},n=(e,s)=>"boolean"==typeof e?e:s;return{theme:"dark"===s.theme?"dark":"light"===s.theme?"light":r.theme,textSize:i.includes(s.textSize)?s.textSize:r.textSize,highContrast:n(s.highContrast,r.highContrast),reduceMotion:n(s.reduceMotion,r.reduceMotion),underlineLinks:n(s.underlineLinks,r.underlineLinks),strongFocus:n(s.strongFocus,r.strongFocus)}}(JSON.parse(s)):window.matchMedia("(prefers-color-scheme: dark)").matches&&(e={...e,theme:"dark"}),window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!s&&(e={...e,reduceMotion:!0})}catch(e){}o(e),c(e),u(!0)},[]);let m=(0,t.useCallback)(e=>{o(s=>{let n={...s,...e};c(n);try{window.localStorage.setItem(l,JSON.stringify(n))}catch(e){}return n})},[]),p=(0,t.useCallback)(()=>{o(r),c(r);try{window.localStorage.removeItem(l)}catch(e){}},[]);return(0,a.jsx)(d.Provider,{value:{appearance:n,set:m,reset:p,loaded:h},children:s})}function h(){return(0,t.useContext)(d)}},8848:(e,s,n)=>{"use strict";n.d(s,{H4:()=>d,L:()=>o,z4:()=>h});var a=n(3365),t=n(8197),l=n.n(t),i=n(1521),r=n(5549),c=n(867);function d(e){let{current:s,onUse:n}=e,{t}=(0,c.kj)(),[l,d]=(0,i.useState)(null);if((0,i.useEffect)(()=>{let e=!1;return r.FH.project().then(s=>{e||d(s)}).catch(()=>void 0),()=>{e=!0}},[]),!l)return null;let o=l.rootDir.trim(),h=s.trim().toLowerCase(),u=n?l.others.filter(e=>e.rootDir.trim().toLowerCase()!==h):[];return(0,a.jsx)(m,{label:o?t("proj.defaultIs",{dir:o}):t("proj.noneShort"),offer:o&&n&&h!==o.toLowerCase()?{text:t("proj.useIt"),onUse:()=>n(o)}:void 0,more:u.map(e=>({text:t("proj.otherUse",{name:e.name}),title:e.rootDir,onUse:()=>null==n?void 0:n(e.rootDir)})),link:o?t("proj.change"):t("proj.setIt"),anchor:"project"})}function o(e){let{current:s,onUse:n}=e,t=u(),{t:l}=(0,c.kj)();if(!t)return null;let i=t.defaultModel.trim();return(0,a.jsx)(m,{label:i?l("def.modelDefaultIs",{name:i}):l("def.modelNoneShort"),offer:i&&n&&s.trim()!==i?{text:l("def.modelUseIt"),onUse:()=>n(i)}:void 0,link:l(i?"proj.change":"proj.setIt"),anchor:"model"})}function h(e){let{current:s,onUse:n}=e,t=u(),{t:l}=(0,c.kj)();if(!t)return null;let i=t.defaultReviewModel.trim();return(0,a.jsx)(m,{label:i?l("def.reviewDefaultIs",{name:i}):l("def.reviewNoneShort"),offer:i&&n&&s.trim()!==i?{text:l("def.modelUseIt"),onUse:()=>n(i)}:void 0,link:l(i?"proj.change":"proj.setIt"),anchor:"review"})}function u(){let[e,s]=(0,i.useState)(null);return(0,i.useEffect)(()=>{let e=!1;return r.FH.models().then(n=>{e||s(n)}).catch(()=>void 0),()=>{e=!0}},[]),e}function m(e){let{label:s,offer:n,more:t=[],link:i,anchor:r}=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})," "]}),t.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)(l(),{href:"/defaults#".concat(r),children:i})]})}}},e=>{e.O(0,[197,867,549,36,347,131,358],()=>e(e.s=1772)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[186],{3134:(s,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>t});var r=n(3365),l=n(1521),i=n(5549),d=n(867);function t(){var s;let{t:e}=(0,d.kj)(),[n,t]=(0,l.useState)(null),[c,h]=(0,l.useState)(null),[a,x]=(0,l.useState)("");(0,l.useEffect)(()=>{i.FH.doctor().then(t).catch(s=>x(s.message)),i.FH.settings().then(h).catch(s=>x(s.message))},[]);let j=null==n?void 0:n.profileHeldBy;return(0,r.jsxs)(r.Fragment,{children:[a&&(0,r.jsx)("div",{className:"panel err",children:a}),(0,r.jsxs)("div",{className:"panel",children:[(0,r.jsx)("h2",{children:e("sys.machine")}),!n&&(0,r.jsx)("div",{className:"muted",children:e("sys.loading")}),n&&(0,r.jsx)("table",{children:(0,r.jsxs)("tbody",{children:[(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.version")}),(0,r.jsx)("td",{children:String(null!=(s=n.version)?s:"—")})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.node")}),(0,r.jsx)("td",{children:String(n.node)})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.edge")}),(0,r.jsx)("td",{children:n.edge?String(n.edge):(0,r.jsx)("span",{className:"err",children:e("sys.edgeMissing")})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.profile")}),(0,r.jsxs)("td",{children:[String(n.profileDir)," ",n.profileExists?"":(0,r.jsx)("span",{className:"muted",children:e("sys.profileMissing")})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.profileInUse")}),(0,r.jsx)("td",{children:Array.isArray(j)&&j.length>0&&n.botRunning?(0,r.jsx)("span",{className:"muted",children:e("sys.profileBot",{n:j.length})}):Array.isArray(j)&&j.length>0?(0,r.jsx)("span",{className:"err",children:e("sys.profileHeld",{pids:j.join(", ")})}):"unknown"===j?(0,r.jsx)("span",{className:"muted",children:e("sys.profileUnknown")}):e("sys.profileFree")})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.desktop")}),(0,r.jsxs)("td",{children:[String(n.desktop)," ",(0,r.jsx)("span",{className:"muted",children:e(n.desktopSynced?"sys.desktopSynced":"sys.desktopLocal")})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.cwd")}),(0,r.jsx)("td",{children:String(n.cwd)})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.runs")}),(0,r.jsx)("td",{children:String(n.runsDir)})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.data")}),(0,r.jsx)("td",{children:String(n.dataDir)})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:e("sys.mode")}),(0,r.jsx)("td",{children:String(n.mode)})]})]})})]}),(0,r.jsxs)("div",{className:"panel",children:[(0,r.jsx)("h2",{children:e("sys.settings")}),(0,r.jsx)("p",{className:"muted small",children:e("sys.settingsHint",{file:"data/settings.json",example:"run.example.yaml"})}),c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h3",{children:e("sys.asSaved")}),(0,r.jsx)("pre",{className:"tall",children:JSON.stringify(c.raw,null,2)}),(0,r.jsx)("h3",{children:e("sys.resolved")}),(0,r.jsx)("pre",{children:JSON.stringify(c.resolved,null,2)})]})]}),(0,r.jsxs)("div",{className:"panel",children:[(0,r.jsx)("h2",{children:e("sys.signin")}),(0,r.jsx)("p",{className:"muted small",children:e("sys.signinHint")}),(0,r.jsx)("pre",{children:"npx tsx src/cli.ts login --account you@yourtenant.org"})]})]})}},5323:(s,e,n)=>{Promise.resolve().then(n.bind(n,3134))}},s=>{s.O(0,[867,549,347,131,358],()=>s(s.s=5323)),_N_E=s.O()}]);
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html><!--kkxFcGzA9Uo1uRAgcoDti--><html lang="en" data-theme="light" data-textsize="normal" data-contrast="normal" data-motion="normal" data-links="plain" data-focus="normal"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/c37978b44194c37b.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js"/><script src="/_next/static/chunks/c7879cf7-b5ab1053c1d9a2e7.js" async=""></script><script src="/_next/static/chunks/131-bae98f790a541679.js" async=""></script><script src="/_next/static/chunks/main-app-e3a5f713ba31557e.js" async=""></script><script src="/_next/static/chunks/197-f7c33a0114fc3db3.js" async=""></script><script src="/_next/static/chunks/867-7f27ef819d251cc5.js" async=""></script><script src="/_next/static/chunks/549-a13ae394c5e6a837.js" async=""></script><script src="/_next/static/chunks/app/layout-560bd6d173302e5a.js" async=""></script><script src="/_next/static/chunks/app/appearance/page-9b13583bfee63b32.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><!--ofnRLEgWx9th5w_qtuFnB--><html lang="en" data-theme="light" data-textsize="normal" data-contrast="normal" data-motion="normal" data-links="plain" data-focus="normal"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/c37978b44194c37b.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js"/><script src="/_next/static/chunks/c7879cf7-b5ab1053c1d9a2e7.js" async=""></script><script src="/_next/static/chunks/131-bae98f790a541679.js" async=""></script><script src="/_next/static/chunks/main-app-e3a5f713ba31557e.js" async=""></script><script src="/_next/static/chunks/197-f7c33a0114fc3db3.js" async=""></script><script src="/_next/static/chunks/867-d9c54f7a2b285b3f.js" async=""></script><script src="/_next/static/chunks/549-5d7c845fb0a27dbe.js" async=""></script><script src="/_next/static/chunks/app/layout-3efbb282292ccc38.js" async=""></script><script src="/_next/static/chunks/app/appearance/page-a18019cdc395de3d.js" async=""></script><title>copilot-operator</title><meta name="description" content="Runs task loops with Microsoft 365 Copilot on this machine."/><script>
2
2
  (function () {
3
3
  try {
4
4
  var d = document.documentElement;
@@ -13,4 +13,4 @@
13
13
  d.dataset.focus = a.strongFocus ? 'strong' : 'normal';
14
14
  } catch (e) {}
15
15
  })();
16
- </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><a class="skip-link" href="#main">Skip to the content</a><div class="wrap"><header class="top"><h1><a href="/">copilot-operator</a></h1><nav aria-label="Main"><a href="/"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v4H4zM4 11h16v4H4zM4 17h10v2H4z"></path></svg><span>Sessions</span></a><a href="/defaults"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm8.5 4 1.5 1-1.6 2.8-1.8-.4a7 7 0 0 1-1.5 1.5l.4 1.8L14.7 21l-1-1.5a7 7 0 0 1-3.4 0l-1 1.5-2.8-1.6.4-1.8A7 7 0 0 1 5.4 16l-1.8.4L2 13.6 3.5 12.6V11.4L2 10.4l1.6-2.8 1.8.4A7 7 0 0 1 6.9 6.5l-.4-1.8L9.3 3l1 1.5a7 7 0 0 1 3.4 0l1-1.5 2.8 1.6-.4 1.8a7 7 0 0 1 1.5 1.5l1.8-.4L22 10.4l-1.5 1z"></path></svg><span>Settings</span></a><a href="/import"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3v10m0 0 4-4m-4 4-4-4M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Plan from JSON</span></a><a href="/history"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 1 0 8.5 6M12 7v5l3 2M3 4v5h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Task register</span></a><a href="/level1"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M6 3h9l5 5v13H6zM14 3v6h6M9 13h7M9 17h7" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 1 prompt</span></a><a href="/presets"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M5 4h14v4H5zM5 10h14v4H5zM5 16h9v4H5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 2 presets</span></a><a aria-current="page" href="/appearance"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 0 0 0 18c1.5 0 2-1 2-2s-1-1.5-1-2.5S14 15 15.5 15H17a4 4 0 0 0 4-4 8 8 0 0 0-9-8zM8 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path></svg><span>Appearance</span></a><a href="/system"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v10H4zM2 19h20M9 15v4M15 15v4" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>System</span></a><select aria-label="Language" style="width:auto"><option value="en" selected="">English</option><option value="bg">Български</option></select></nav></header><main id="main"><div class="panel"><h2>Appearance</h2><p class="muted small">Kept in this browser only. Nothing here is sent anywhere or shared with another machine.</p><h3>Theme</h3><div class="segmented" role="group" aria-label="Theme"><button type="button" aria-pressed="false">Light</button><button type="button" aria-pressed="false">Dark</button></div><p class="muted small" style="margin-top:6px">Warm light for a bright room, warm dark for a dim one.</p></div><div class="panel"><h2>Accessibility</h2><p class="muted small">Each of these can be turned on by itself; they are independent of the theme and of the language.</p><h3>Text size</h3><div class="segmented" role="group" aria-label="Text size"><button type="button" aria-pressed="false">Small</button><button type="button" aria-pressed="false">Normal</button><button type="button" aria-pressed="false">Large</button><button type="button" aria-pressed="false">Larger</button><button type="button" aria-pressed="false">Largest</button></div><p class="muted small" style="margin-top:6px">One step below normal and three above. Scales the whole interface, not only the body text, and is remembered in this browser.</p><div class="option"><label><input type="checkbox"/><span>Higher contrast</span></label><p class="why">Stronger borders and darker text. Drops some of the warmth in exchange for legibility.</p></div><div class="option"><label><input type="checkbox"/><span>Less motion</span></label><p class="why">No transitions, and the live log stops scrolling itself while a run is in progress.</p></div><div class="option"><label><input type="checkbox"/><span>Underline every link</span></label><p class="why">Links stop relying on colour alone to be recognisable.</p></div><div class="option"><label><input type="checkbox"/><span>Thick focus outline</span></label><p class="why">Makes what the keyboard is on impossible to lose, when tabbing through a page.</p></div><div class="row" style="margin-top:12px"><button>Back to the defaults</button></div></div><div class="panel"><h2>How it looks</h2><p class="small">A task that ended with a summary, one waiting for approval, and a link.<!-- --> <a href="#main">a link in a sentence</a></p><div class="row"><span class="badge done">done</span><span class="badge running">running</span><span class="badge waiting-approval">waiting for approval</span><span class="badge failed">failed</span></div><div class="summary" style="margin-top:10px"><strong>What was done</strong><div>A task that ended with a summary, one waiting for approval, and a link.</div></div><div class="row"><button class="primary">Run</button><button>Skip</button><button class="danger">Abort task</button></div></div><!--$--><!--/$--></main></div><script src="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[1205,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7f27ef819d251cc5.js\",\"549\",\"static/chunks/549-a13ae394c5e6a837.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"themeScript\"]\n3:I[1205,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7f27ef819d251cc5.js\",\"549\",\"static/chunks/549-a13ae394c5e6a837.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"AppearanceProvider\"]\n4:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7f27ef819d251cc5.js\",\"549\",\"static/chunks/549-a13ae394c5e6a837.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"LanguageProvider\"]\n5:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7f27ef819d251cc5.js\",\"549\",\"static/chunks/549-a13ae394c5e6a837.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"DialogHost\"]\n6:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7f27ef819d251cc5.js\",\"549\",\"static/chunks/549-a13ae394c5e6a837.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"SkipLink\"]\n7:I[8197,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7f27ef819d251cc5.js\",\"549\",\"static/chunks/549-a13ae394c5e6a837.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"\"]\n8:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7f27ef819d251cc5.js\",\"549\",\"static/chunks/549-a13ae394c5e6a837.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"Nav\"]\n9:I[6657,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7f27ef819d251cc5.js\",\"549\",\"static/chunks/549-a13ae394c5e6a837.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"GlobalApprovals\"]\na:I[5204,[],\"\"]\nb:I[2642,[],\"\"]\nc:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-7f27ef819d251cc5.js\",\"549\",\"static/chunks/549-a13ae394c5e6a837.js\",\"177\",\"static/chunks/app/layout-560bd6d173302e5a.js\"],\"ScrollJump\"]\nd:I[7089,[],\"ClientPageRoot\"]\ne:I[4585,[\"867\",\"stat"])</script><script>self.__next_f.push([1,"ic/chunks/867-7f27ef819d251cc5.js\",\"429\",\"static/chunks/app/appearance/page-9b13583bfee63b32.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/c37978b44194c37b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"kkxFcGzA9Uo1uRAgcoDti\",\"p\":\"\",\"c\":[\"\",\"appearance\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"appearance\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/c37978b44194c37b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"data-theme\":\"light\",\"data-textsize\":\"normal\",\"data-contrast\":\"normal\",\"data-motion\":\"normal\",\"data-links\":\"plain\",\"data-focus\":\"normal\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"$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>
16
+ </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><a class="skip-link" href="#main">Skip to the content</a><div class="wrap"><header class="top"><h1><a href="/">copilot-operator</a></h1><nav aria-label="Main"><a href="/"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v4H4zM4 11h16v4H4zM4 17h10v2H4z"></path></svg><span>Sessions</span></a><a href="/defaults"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zm8.5 4 1.5 1-1.6 2.8-1.8-.4a7 7 0 0 1-1.5 1.5l.4 1.8L14.7 21l-1-1.5a7 7 0 0 1-3.4 0l-1 1.5-2.8-1.6.4-1.8A7 7 0 0 1 5.4 16l-1.8.4L2 13.6 3.5 12.6V11.4L2 10.4l1.6-2.8 1.8.4A7 7 0 0 1 6.9 6.5l-.4-1.8L9.3 3l1 1.5a7 7 0 0 1 3.4 0l1-1.5 2.8 1.6-.4 1.8a7 7 0 0 1 1.5 1.5l1.8-.4L22 10.4l-1.5 1z"></path></svg><span>Settings</span></a><a href="/import"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3v10m0 0 4-4m-4 4-4-4M4 15v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Plan from JSON</span></a><a href="/history"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 1 0 8.5 6M12 7v5l3 2M3 4v5h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg><span>Task register</span></a><a href="/level1"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M6 3h9l5 5v13H6zM14 3v6h6M9 13h7M9 17h7" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 1 prompt</span></a><a href="/presets"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M5 4h14v4H5zM5 10h14v4H5zM5 16h9v4H5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>Level 2 presets</span></a><a aria-current="page" href="/appearance"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M12 3a9 9 0 0 0 0 18c1.5 0 2-1 2-2s-1-1.5-1-2.5S14 15 15.5 15H17a4 4 0 0 0 4-4 8 8 0 0 0-9-8zM8 9a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm4 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"></path></svg><span>Appearance</span></a><a href="/system"><svg class="nav-icon" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true"><path d="M4 5h16v10H4zM2 19h20M9 15v4M15 15v4" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"></path></svg><span>System</span></a><select aria-label="Language" style="width:auto"><option value="en" selected="">English</option><option value="bg">Български</option></select></nav></header><main id="main"><div class="panel"><h2>Appearance</h2><p class="muted small">Kept in this browser only. Nothing here is sent anywhere or shared with another machine.</p><h3>Theme</h3><div class="segmented" role="group" aria-label="Theme"><button type="button" aria-pressed="false">Light</button><button type="button" aria-pressed="false">Dark</button></div><p class="muted small" style="margin-top:6px">Warm light for a bright room, warm dark for a dim one.</p></div><div class="panel"><h2>Accessibility</h2><p class="muted small">Each of these can be turned on by itself; they are independent of the theme and of the language.</p><h3>Text size</h3><div class="segmented" role="group" aria-label="Text size"><button type="button" aria-pressed="false">Small</button><button type="button" aria-pressed="false">Normal</button><button type="button" aria-pressed="false">Large</button><button type="button" aria-pressed="false">Larger</button><button type="button" aria-pressed="false">Largest</button></div><p class="muted small" style="margin-top:6px">One step below normal and three above. Scales the whole interface, not only the body text, and is remembered in this browser.</p><div class="option"><label><input type="checkbox"/><span>Higher contrast</span></label><p class="why">Stronger borders and darker text. Drops some of the warmth in exchange for legibility.</p></div><div class="option"><label><input type="checkbox"/><span>Less motion</span></label><p class="why">No transitions, and the live log stops scrolling itself while a run is in progress.</p></div><div class="option"><label><input type="checkbox"/><span>Underline every link</span></label><p class="why">Links stop relying on colour alone to be recognisable.</p></div><div class="option"><label><input type="checkbox"/><span>Thick focus outline</span></label><p class="why">Makes what the keyboard is on impossible to lose, when tabbing through a page.</p></div><div class="row" style="margin-top:12px"><button>Back to the defaults</button></div></div><div class="panel"><h2>How it looks</h2><p class="small">A task that ended with a summary, one waiting for approval, and a link.<!-- --> <a href="#main">a link in a sentence</a></p><div class="row"><span class="badge done">done</span><span class="badge running">running</span><span class="badge waiting-approval">waiting for approval</span><span class="badge failed">failed</span></div><div class="summary" style="margin-top:10px"><strong>What was done</strong><div>A task that ended with a summary, one waiting for approval, and a link.</div></div><div class="row"><button class="primary">Run</button><button>Skip</button><button class="danger">Abort task</button></div></div><!--$--><!--/$--></main></div><script src="/_next/static/chunks/webpack-0f31b926d9a9c5a4.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[8078,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-d9c54f7a2b285b3f.js\",\"549\",\"static/chunks/549-5d7c845fb0a27dbe.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"AppearanceProvider\"]\n3:I[867,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-d9c54f7a2b285b3f.js\",\"549\",\"static/chunks/549-5d7c845fb0a27dbe.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"LanguageProvider\"]\n4:I[1035,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-d9c54f7a2b285b3f.js\",\"549\",\"static/chunks/549-5d7c845fb0a27dbe.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"DialogHost\"]\n5:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-d9c54f7a2b285b3f.js\",\"549\",\"static/chunks/549-5d7c845fb0a27dbe.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"SkipLink\"]\n6:I[8197,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-d9c54f7a2b285b3f.js\",\"549\",\"static/chunks/549-5d7c845fb0a27dbe.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"\"]\n7:I[8214,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-d9c54f7a2b285b3f.js\",\"549\",\"static/chunks/549-5d7c845fb0a27dbe.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"Nav\"]\n8:I[6657,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-d9c54f7a2b285b3f.js\",\"549\",\"static/chunks/549-5d7c845fb0a27dbe.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"GlobalApprovals\"]\n9:I[5204,[],\"\"]\na:I[2642,[],\"\"]\nb:I[7712,[\"197\",\"static/chunks/197-f7c33a0114fc3db3.js\",\"867\",\"static/chunks/867-d9c54f7a2b285b3f.js\",\"549\",\"static/chunks/549-5d7c845fb0a27dbe.js\",\"177\",\"static/chunks/app/layout-3efbb282292ccc38.js\"],\"ScrollJump\"]\nc:I[7089,[],\"ClientPageRoot\"]\nd:I[4585,[\"867\",\"static/chunks/867-d9c54f7a2b285b3f.js\",\"429\",\"static/chunks/app/appearance/page-a18019cdc395de3d.js\"],\"default\"]\n10:I[433,[],\"OutletBoundary\"]\n12:I[9884,[],\"AsyncMetadataOutlet\"]\n14:I[433,[],\"ViewportBoundary\"]\n16:I[433,["])</script><script>self.__next_f.push([1,"],\"MetadataBoundary\"]\n17:\"$Sreact.suspense\"\n19:I[3536,[],\"\"]\n:HL[\"/_next/static/css/c37978b44194c37b.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"ofnRLEgWx9th5w_qtuFnB\",\"p\":\"\",\"c\":[\"\",\"appearance\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"appearance\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/c37978b44194c37b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"data-theme\":\"light\",\"data-textsize\":\"normal\",\"data-contrast\":\"normal\",\"data-motion\":\"normal\",\"data-links\":\"plain\",\"data-focus\":\"normal\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n(function () {\\n try {\\n var d = document.documentElement;\\n var raw = localStorage.getItem('cop.appearance');\\n var a = raw ? JSON.parse(raw) : {};\\n if (!a || typeof a !== 'object') a = {};\\n d.dataset.theme = a.theme === 'dark' ? 'dark' : 'light';\\n d.dataset.textsize = [\\\"small\\\",\\\"normal\\\",\\\"large\\\",\\\"huge\\\",\\\"giant\\\"].indexOf(a.textSize) \u003e= 0 ? a.textSize : 'normal';\\n d.dataset.contrast = a.highContrast ? 'high' : 'normal';\\n d.dataset.motion = a.reduceMotion ? 'reduced' : 'normal';\\n d.dataset.links = a.underlineLinks ? 'underline' : 'plain';\\n d.dataset.focus = a.strongFocus ? 'strong' : 'normal';\\n } catch (e) {}\\n})();\\n\"}}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"children\":[[\"$\",\"$L5\",null,{}],[\"$\",\"div\",null,{\"className\":\"wrap\",\"children\":[[\"$\",\"header\",null,{\"className\":\"top\",\"children\":[[\"$\",\"h1\",null,{\"children\":[\"$\",\"$L6\",null,{\"href\":\"/\",\"children\":\"copilot-operator\"}]}],[\"$\",\"$L7\",null,{}]]}],[\"$\",\"$L8\",null,{}],[\"$\",\"main\",null,{\"id\":\"main\",\"children\":[\"$\",\"$L9\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$La\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}],[\"$\",\"$Lb\",null,{}]]}]}]}]}]]}]]}],{\"children\":[\"appearance\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L9\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$La\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"$Lc\",null,{\"Component\":\"$d\",\"searchParams\":{},\"params\":{},\"promises\":[\"$@e\",\"$@f\"]}],null,[\"$\",\"$L10\",null,{\"children\":[\"$L11\",[\"$\",\"$L12\",null,{\"promise\":\"$@13\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[[\"$\",\"$L14\",null,{\"children\":\"$L15\"}],null],[\"$\",\"$L16\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$17\",null,{\"fallback\":null,\"children\":\"$L18\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$19\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"e:{}\nf:\"$0:f:0:1:2:children:2:children:1:props:children:0:props:params\"\n"])</script><script>self.__next_f.push([1,"15:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n11:null\n"])</script><script>self.__next_f.push([1,"13:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"copilot-operator\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Runs task loops with Microsoft 365 Copilot on this machine.\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"18:\"$13:metadata\"\n"])</script></body></html>