copilot-operator 0.1.5 → 0.1.6

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 (45) hide show
  1. package/dist/src/api/operator.controller.js +5 -2
  2. package/dist/src/api/operator.service.js +34 -12
  3. package/dist/src/orchestrator/taskRunner.js +11 -1
  4. package/dist/src/plan/brief.js +52 -10
  5. package/dist/src/plan/script.js +13 -0
  6. package/dist/src/plan/systemGuide.js +1377 -185
  7. package/dist/src/session/compose.js +5 -1
  8. package/dist/src/session/exports.js +1 -0
  9. package/dist/src/session/store.js +4 -1
  10. package/dist/src/session/story.js +10 -1
  11. package/dist/src/vcs/taskVcs.js +2 -1
  12. package/dist/web/404.html +2 -2
  13. package/dist/web/_next/static/chunks/549-afafecd6bfbb138e.js +1 -0
  14. package/dist/web/_next/static/chunks/56-91cd1709158ebf99.js +1 -0
  15. package/dist/web/_next/static/chunks/867-fc983d08916b4e28.js +1 -0
  16. package/dist/web/_next/static/chunks/app/history/page-b3b4af994c868b5d.js +1 -0
  17. package/dist/web/_next/static/chunks/app/layout-e0174d863960f109.js +1 -0
  18. package/dist/web/_next/static/chunks/app/sessions/view/{page-4631bdf5113a73b2.js → page-d4213354730a945c.js} +1 -1
  19. package/dist/web/_next/static/css/{5a10c60adf9c5336.css → 63fea96806e6b2cb.css} +1 -1
  20. package/dist/web/appearance.html +2 -2
  21. package/dist/web/appearance.txt +25 -24
  22. package/dist/web/defaults.html +2 -2
  23. package/dist/web/defaults.txt +25 -24
  24. package/dist/web/history.html +2 -2
  25. package/dist/web/history.txt +25 -24
  26. package/dist/web/import.html +2 -2
  27. package/dist/web/import.txt +25 -24
  28. package/dist/web/index.html +2 -2
  29. package/dist/web/index.txt +25 -24
  30. package/dist/web/level1.html +2 -2
  31. package/dist/web/level1.txt +25 -24
  32. package/dist/web/presets.html +2 -2
  33. package/dist/web/presets.txt +25 -24
  34. package/dist/web/sessions/view.html +2 -2
  35. package/dist/web/sessions/view.txt +25 -24
  36. package/dist/web/system.html +2 -2
  37. package/dist/web/system.txt +25 -24
  38. package/package.json +1 -1
  39. package/dist/web/_next/static/chunks/549-2086c05135bc9753.js +0 -1
  40. package/dist/web/_next/static/chunks/867-0cd2c3cfd0ff0a45.js +0 -1
  41. package/dist/web/_next/static/chunks/89-382e9b29486d2747.js +0 -1
  42. package/dist/web/_next/static/chunks/app/history/page-83543937cecde5de.js +0 -1
  43. package/dist/web/_next/static/chunks/app/layout-92fa876afe619cf3.js +0 -1
  44. /package/dist/web/_next/static/{7TE2rEuHqGdGx14If8TEb → WJ_8hRZsp4VWiDZx8NMUw}/_buildManifest.js +0 -0
  45. /package/dist/web/_next/static/{7TE2rEuHqGdGx14If8TEb → WJ_8hRZsp4VWiDZx8NMUw}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
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:()=>w});var n=t(3365),a=t(1521),l=t(8197),i=t.n(l),r=t(5549),d=t(3523),c=t(3374),o=t(867),u=t(1910),h=t(5132);function m(){let{t:e}=(0,o.kj)(),[s,t]=(0,a.useState)(!1);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"info-dot","aria-expanded":s,"aria-label":e("row.info"),title:e("row.info"),onClick:()=>t(e=>!e),children:"i"}),s&&(0,n.jsxs)("div",{className:"notice info-panel",children:[(0,n.jsx)("strong",{children:e("row.infoTitle")}),(0,n.jsxs)("dl",{className:"small",children:[(0,n.jsx)("dt",{children:e("reg.openTask")}),(0,n.jsx)("dd",{children:e("row.infoOpenTask")}),(0,n.jsx)("dt",{children:e("save.log")}),(0,n.jsx)("dd",{children:e("save.why")}),(0,n.jsx)("dt",{children:e("home.col.chat")}),(0,n.jsx)("dd",{children:e("row.infoChat")})]}),(0,n.jsx)("div",{className:"small",style:{marginTop:6},children:e("row.infoExports")}),(0,n.jsxs)("dl",{className:"small",children:[(0,n.jsx)("dt",{children:e("reg.exportPlan")}),(0,n.jsx)("dd",{children:e("reg.exportPlanWhy")}),(0,n.jsx)("dt",{children:e("reg.exportDomain")}),(0,n.jsx)("dd",{children:e("reg.exportDomainWhy")}),(0,n.jsx)("dt",{children:e("reg.exportBot")}),(0,n.jsx)("dd",{children:e("reg.exportBotWhy")})]}),(0,n.jsx)(h.s,{text:e("row.infoWhich"),className:"small"})]})]})}function g(e){let{onChange:s}=e,{t}=(0,o.kj)(),[l,i]=(0,a.useState)(null),[d,c]=(0,a.useState)(!1),[u,h]=(0,a.useState)(""),m=(0,a.useCallback)(async()=>{try{i(await r.FH.batch())}catch(e){}},[]);(0,a.useEffect)(()=>{m();let e=setInterval(()=>void m(),3e3);return()=>clearInterval(e)},[m]);let g=async e=>{c(!0),h("");try{"pause"===e?await r.FH.pauseBatch():"resume"===e?await r.FH.resumeBatch():await r.FH.stopBatch(),await m(),null==s||s()}catch(e){h(e.message)}finally{c(!1)}};return(null==l?void 0:l.running)?(0,n.jsxs)("div",{className:"row",style:{marginBottom:8},children:[l.pausing?(0,n.jsx)("button",{className:"primary",disabled:d,onClick:()=>void g("resume"),title:t("batch.resumeWhy"),children:t("batch.resume")}):(0,n.jsx)("button",{disabled:d||l.stopping,onClick:()=>void g("pause"),title:t("batch.pauseWhy"),children:t("batch.pause")}),(0,n.jsx)("button",{className:"danger",disabled:d||l.stopping,onClick:()=>void g("stop"),title:t("batch.stopWhy"),children:t("batch.stop")}),l.pausing&&!l.stopping&&(0,n.jsx)("span",{className:"muted small",children:t("batch.pausing")}),l.stopping&&(0,n.jsx)("span",{className:"muted small",children:t("batch.stopping")}),u&&(0,n.jsx)("span",{className:"err small",children:u})]}):null}var x=t(3041),p=t(1035),j=t(4811),v=t(7619);let N=["queued","running","waiting-approval"],k=["blocked","failed","aborted","limit-reached"];function f(e){let{run:s}=e,{t}=(0,o.kj)(),a=s.entries.some(d.DG),l=(0,c.c)(a),i=(0,d.eZ)(s,s.entries,l);return(0,n.jsx)(n.Fragment,{children:t(i.live?"reg.runRunning":"reg.runTook",{d:(0,r.c5)(i.ms)})})}function b(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 w(){let{t:e}=(0,o.kj)(),s=(0,o.W3)(),[t,l]=(0,a.useState)(null),[i,d]=(0,a.useState)(""),[c,u]=(0,a.useState)(""),[h,m]=(0,a.useState)("flow"),[x,p]=(0,a.useState)(""),[j,v]=(0,a.useState)(""),[f,w]=(0,a.useState)(""),I=(0,a.useCallback)(async()=>{try{l(await r.FH.tasks()),u(new Date().toISOString()),d("")}catch(e){d(e.message)}},[]);(0,a.useEffect)(()=>{I();let e=setInterval(()=>void I(),6e3);return()=>clearInterval(e)},[I]);let F=(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]),R=(0,a.useMemo)(()=>{let e=f.trim().toLowerCase();return(null!=t?t:[]).filter(s=>{var t,n;return(!x||s.sessionId===x)&&(!j||s.status===j)&&(!e||"".concat(s.title," ").concat(null!=(t=s.summary)?t:""," ").concat(null!=(n=s.reason)?n:""," ").concat(s.sessionName).toLowerCase().includes(e))})},[t,x,j,f]),W=(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=>k.includes(e.status)).length}},[t]),P=(0,a.useMemo)(()=>{let e=new Map;for(let n of null!=t?t:[]){var s;n.runGroup&&e.set(n.runGroup.id,(null!=(s=e.get(n.runGroup.id))?s:0)+1)}return e},[t]),G=(0,a.useMemo)(()=>b(R),[R]),H=R.filter(e=>"running"===e.status||"waiting-approval"===e.status),D=R.filter(e=>"queued"===e.status),E=[...R.filter(e=>k.includes(e.status)&&"stop"===e.sessionOnFailure&&!e.sessionRunning&&D.some(s=>s.sessionId===e.sessionId)),...D].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}),M=R.filter(e=>!N.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)}),O=""!==x||""!==j||""!==f.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:c&&e("reg.updated",{t:s(c)})}),(0,n.jsx)("button",{className:"quiet",onClick:()=>void I(),children:e("reg.refresh")})]}),(0,n.jsx)("p",{className:"muted small",children:e("reg.hint")}),(0,n.jsx)(A,{sessions:F}),(0,n.jsxs)("div",{className:"counts",children:[(0,n.jsxs)("div",{className:"count",children:[(0,n.jsx)("div",{className:"n",children:W.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:W.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:W.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:W.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:W.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:x,onChange:e=>p(e.target.value),children:[(0,n.jsx)("option",{value:"",children:e("reg.allSessions")}),F.map(e=>{let[s,t]=e;return(0,n.jsx)("option",{value:s,children:t},s)})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"f-status",style:{margin:0},children:e("reg.filterStatus")}),(0,n.jsxs)("select",{id:"f-status",value:j,onChange:e=>v(e.target.value),children:[(0,n.jsx)("option",{value:"",children:e("reg.allStatuses")}),["queued","running","waiting-approval","done","blocked","failed","aborted","limit-reached"].map(s=>(0,n.jsx)("option",{value:s,children:e("status.".concat(s))},s))]})]}),(0,n.jsxs)("div",{className:"grow",children:[(0,n.jsx)("label",{htmlFor:"f-q",style:{margin:0},children:e("reg.search")}),(0,n.jsx)("input",{id:"f-q",type:"text",value:f,onChange:e=>w(e.target.value),placeholder:e("reg.searchPlaceholder")})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{style:{margin:0},id:"view-label",children:e("reg.viewLabel")}),(0,n.jsxs)("div",{className:"segmented",role:"group","aria-labelledby":"view-label",children:[(0,n.jsx)("button",{type:"button","aria-pressed":"flow"===h,onClick:()=>m("flow"),children:e("reg.viewFlow")}),(0,n.jsx)("button",{type:"button","aria-pressed":"runs"===h,onClick:()=>m("runs"),children:e("reg.groupBy")}),(0,n.jsx)("button",{type:"button","aria-pressed":"list"===h,onClick:()=>m("list"),children:e("reg.viewList")})]})]}),O&&(0,n.jsx)("button",{className:"quiet",onClick:()=>{p(""),v(""),w("")},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===R.length&&(0,n.jsx)("div",{className:"empty",children:e("reg.noMatch")})]}),"list"===h&&R.length>0&&(0,n.jsx)(q,{entries:[...H,...D,...M]}),"runs"===h&&R.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")})]}),G.runs.map(e=>(0,n.jsxs)("section",{className:"panel",children:[(0,n.jsx)(C,{run:e}),(0,n.jsx)(y,{entries:e.entries,sizes:P,onChange:()=>void I()})]},e.id)),G.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)(y,{entries:G.loose,sizes:P,onChange:()=>void I()})]})]}),"flow"===h&&(0,n.jsxs)(n.Fragment,{children:[H.length>0&&(0,n.jsxs)("section",{className:"panel",children:[(0,n.jsx)("h2",{children:e("reg.activeNow")}),(0,n.jsx)(y,{entries:H,sizes:P,onChange:()=>void I()})]}),R.length>0&&(0,n.jsxs)("section",{className:"panel",children:[(0,n.jsx)("h2",{children:e("reg.upcoming")}),(0,n.jsx)("p",{className:"muted small",children:e("reg.upcomingHint")}),(0,n.jsx)(g,{onChange:()=>void I()}),(0,n.jsx)(T,{entries:R,onChange:()=>void I()}),0===E.length?(0,n.jsx)("div",{className:"empty",children:e("reg.noUpcoming")}):(0,n.jsx)(y,{entries:E,upcoming:!0,sizes:P,onChange:()=>void I()})]}),R.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===M.length?(0,n.jsx)("div",{className:"empty",children:e("reg.noPast")}):(0,n.jsx)(S,{entries:M,sizes:P,onChange:()=>void I()})]})]})]})}function y(e){let{entries:s,upcoming:t=!1,sizes:l,onChange:g,picking:p}=e,{t:j}=(0,o.kj)(),N=(0,o.W3)(),f=(0,x.e)(null!=g?g:()=>void 0),b=(0,c.c)(s.some(d.DG)),[w,y]=(0,a.useState)(null),[C,S]=(0,a.useState)(new Set);return(0,n.jsxs)(n.Fragment,{children:[w&&(0,n.jsx)(F,{entry:w,onClose:e=>{y(null),e&&(null==g||g())}}),(0,n.jsx)("ol",{className:"flow",children:s.map(e=>{var s,a,c,o,g,x,w,F,A,T,q,R,W,P,G,H,D,E,M,O,_,B;let L=t&&1===e.queuePosition,z=e.runGroup?null!=(w=null==l?void 0:l.get(e.runGroup.id))?w:1:0;return(0,n.jsxs)("li",{className:"".concat(e.status).concat(L?" next":""),children:[(0,n.jsxs)("div",{className:"head",children:[p&&(0,n.jsx)("input",{type:"checkbox",className:"pick","aria-label":e.title,checked:p.picked.has("".concat(e.sessionId,":").concat(e.taskId)),onChange:()=>p.toggle("".concat(e.sessionId,":").concat(e.taskId))}),(0,n.jsx)("strong",{children:e.title}),(0,n.jsx)("span",{className:"badge ".concat(e.status),children:j("status.".concat(e.status))}),L&&(0,n.jsx)("span",{className:"chip",children:j("reg.next")}),t&&k.includes(e.status)&&(0,n.jsx)("span",{className:"chip",title:j("reg.willRequeueFirstWhy"),children:j("reg.willRequeueFirst")}),e.sessionRunning&&(0,n.jsx)("span",{className:"chip",children:j("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?j("review.ran",{n:e.review.stepsRun}):void 0,children:[j("review.verdict.".concat(e.review.verdict)),e.review.findings>0?" (".concat(e.review.findings,")"):""]}),(null!=(F=e.deviations)?F:0)>0&&(0,n.jsx)("span",{className:"badge waiting-approval",title:j("reg.deviationsWhy"),children:j("reg.deviations",{n:null!=(A=e.deviations)?A:0})}),(null!=(T=e.disputes)?T:0)>0&&(0,n.jsx)("span",{className:"badge waiting-approval",title:j("reg.disputesWhy"),children:j("reg.disputes",{n:null!=(q=e.disputes)?q:0})}),e.readOnly&&(0,n.jsx)("span",{className:"chip",title:j("reg.readOnlyWhy"),children:j("task.readOnly")}),(null!=(R=e.autoRetries)?R:0)>0&&(0,n.jsx)("span",{className:"badge ".concat("done"===e.status?"done":"blocked"),title:j("reg.retriedFreshWhy"),children:"done"===e.status?j("reg.retriedFreshDone",{n:null!=(W=e.autoRetries)?W:0}):j("reg.retriedFreshStill",{n:null!=(P=e.autoRetries)?P:0})}),e.runGroup&&(0,n.jsx)("span",{className:"chip",title:j("reg.runTitle",{t:z,s:e.runGroup.sessions,when:N(e.runGroup.startedAt)}),children:z>1?j("reg.runWith",{n:z-1}):j("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?j("task.started",{t:N(e.startedAt)}):j("task.added",{t:N(e.createdAt)}),e.finishedAt?" \xb7 ".concat(j("task.finished",{t:N(e.finishedAt)})):"",void 0!==e.durationMs?" \xb7 ".concat(j("reg.took",{d:(0,r.c5)(e.durationMs)})):"",(0,d.DG)(e)?" \xb7 ".concat(j("task.runningFor",{d:(0,r.c5)((0,d.d5)(e.startedAt,void 0,b))})):"",e.iterations>0?" \xb7 ".concat(j("reg.iterations",{n:e.iterations})):""]}),"queued"===e.status&&(0,n.jsx)("div",{className:"when",children:e.queuePosition&&e.queuePosition>1?j("reg.willFollow",{n:e.queuePosition-1}):e.sessionRunning?j("reg.queuePos",{n:null!=(G=e.queuePosition)?G:1}):j("reg.waitingRun")}),"blocked"===e.status&&(0,n.jsx)("p",{className:"what muted small",children:j("reg.blockedWhat")}),(null!=(H=null==(s=e.attempts)?void 0:s.length)?H:0)>0&&(0,n.jsxs)("details",{className:"small",style:{marginTop:6},children:[(0,n.jsx)("summary",{children:(null!=(D=null==(a=e.attempts)?void 0:a.length)?D:0)===1?j("reg.attemptsOne",{n:null!=(M=e.attempt)?M:(null!=(E=null==(c=e.attempts)?void 0:c.length)?E:0)+1}):j("reg.attempts",{n:null!=(_=e.attempt)?_:(null!=(O=null==(o=e.attempts)?void 0:o.length)?O:0)+1,m:null!=(B=null==(g=e.attempts)?void 0:g.length)?B:0})}),(0,n.jsx)("ol",{className:"attempts",children:null==(x=e.attempts)?void 0:x.map(s=>{var t;return(0,n.jsxs)("li",{children:[(0,n.jsxs)("div",{className:"head",children:[(0,n.jsx)("strong",{children:j("reg.attemptN",{n:s.attempt})}),(0,n.jsx)("span",{className:"badge ".concat(s.status),children:j("status.".concat(s.status))}),s.iterations>0&&(0,n.jsx)("span",{className:"muted",children:j("reg.iterations",{n:s.iterations})}),void 0!==s.durationMs&&(0,n.jsx)("span",{className:"muted",children:j("reg.took",{d:(0,r.c5)(s.durationMs)})}),s.runId&&(0,n.jsx)(u.u,{label:j("save.attemptLog"),save:()=>r.FH.saveTaskLog(e.sessionId,e.taskId,s.runId)}),s.runId&&(0,n.jsx)(u.H,{sessionId:e.sessionId,taskId:e.taskId,attempt:s.attempt})]}),(0,n.jsxs)("div",{className:"when",children:[s.startedAt?j("task.started",{t:N(s.startedAt)}):"",s.finishedAt?" \xb7 ".concat(j("task.finished",{t:N(s.finishedAt)})):"",s.branch?" \xb7 ".concat(s.branch):""]}),s.reason&&(0,n.jsx)("p",{className:"what err",children:j("reg.stopped",{reason:s.reason})}),s.summary&&(0,n.jsx)(h.s,{text:s.summary,className:"what"})]},"".concat(null!=(t=s.runId)?t:s.attempt))})})]}),e.summary&&(0,n.jsx)(h.s,{text:e.summary,className:"what"}),e.reason&&(0,n.jsx)("p",{className:"what err",children:j("reg.stopped",{reason:e.reason})}),f.message&&(0,n.jsx)("p",{className:"what small",children:f.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:j("reg.openTask")}),e.runId&&(0,n.jsx)(u.u,{label:j("save.log"),save:()=>r.FH.saveTaskLog(e.sessionId,e.taskId)}),e.chatUrl&&(0,n.jsx)("a",{href:e.chatUrl,target:"_blank",rel:"noreferrer",children:j("home.col.chat")}),e.startedAt&&(0,n.jsx)(I,{where:{session:e.sessionId,task:e.taskId}}),(0,n.jsx)(m,{}),e.runId&&(0,n.jsxs)("button",{className:C.has(e.taskId)?"":"quiet",onClick:()=>{let s;return s=e.taskId,S(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})},title:(0,d.DG)(e)?j("story.showLiveWhy"):j("story.why"),children:[(0,d.DG)(e)&&!C.has(e.taskId)&&(0,n.jsx)("span",{className:"dot","aria-hidden":"true"}),C.has(e.taskId)?j("story.hide"):(0,d.DG)(e)?j("story.showLive"):j("story.show")]}),k.includes(e.status)&&!e.sessionRunning&&(0,n.jsx)("button",{className:"quiet",onClick:()=>y(e),title:j("reg.fixPromptHint"),children:j("reg.fixPrompt")}),e.startedAt&&!e.sessionRunning&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{className:"quiet",disabled:""!==f.busy,title:j("restore.why"),onClick:()=>void f.restore({sessionId:e.sessionId,taskId:e.taskId,title:e.title}),children:"restore"===f.busy?j("restore.checking"):j("restore.button")}),(0,n.jsx)("button",{className:"quiet",disabled:""!==f.busy,title:j("restart.why"),onClick:()=>void f.restartFrom({sessionId:e.sessionId,taskId:e.taskId,title:e.title}),children:"restart"===f.busy?j("restart.checking"):j("restart.button")})]})]}),C.has(e.taskId)&&e.runId&&(0,n.jsx)(v.P,{sessionId:e.sessionId,taskId:e.taskId,live:"running"===e.status||"waiting-approval"===e.status})]},"".concat(e.sessionId,"-").concat(e.taskId))})})]})}function I(e){let{where:s}=e,{t}=(0,o.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 C(e){var s;let{run:t}=e,{t:a}=(0,o.kj)(),l=(0,o.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=>k.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)(f,{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)(I,{where:{run:t.id}})]})]})}function S(e){let{entries:s,sizes:t,onChange:l}=e,{t:i}=(0,o.kj)(),d=(0,a.useMemo)(()=>b(s),[s]),[c,u]=(0,a.useState)(!1),[h,m]=(0,a.useState)(new Set),[g,x]=(0,a.useState)(!1),[p,j]=(0,a.useState)(""),[v,N]=(0,a.useState)(""),k=e=>"".concat(e.sessionId,":").concat(e.taskId),f=s.filter(e=>e.startedAt),w=[...h],I=async()=>{x(!0),N(""),j("");try{let e=await r.FH.downloadBundle(w.map(e=>{let[s,t]=e.split(":");return{sessionId:s,taskId:t}}));j(i("reg.bundleSaved",{name:e}))}catch(e){N(e.message)}finally{x(!1)}},S=c?{picked:h,toggle:e=>m(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})}:void 0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"row small",style:{marginBottom:8},children:[c?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{className:"quiet",onClick:()=>{u(!1),m(new Set),j(""),N("")},children:i("reg.pickDone")}),(0,n.jsx)("button",{className:"quiet",onClick:()=>m(new Set(f.map(k))),children:i("reg.pickAll")}),(0,n.jsx)("button",{className:"quiet",onClick:()=>m(new Set),children:i("reg.pickNone")}),(0,n.jsx)("span",{className:"muted",children:h.size>0?i("reg.pickedN",{n:h.size}):i("reg.pickedNone")}),h.size>0&&(0,n.jsx)("button",{className:"primary",disabled:g,onClick:()=>void I(),title:i("reg.bundleWhy"),children:i("reg.bundle",{n:h.size})})]}):(0,n.jsx)("button",{className:"quiet",onClick:()=>u(!0),title:i("reg.pickWhy"),children:i("reg.pick")}),p&&(0,n.jsx)("span",{className:"muted",children:p}),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)(C,{run:e})}),(0,n.jsx)(y,{entries:e.entries,sizes:t,onChange:l,picking:S})]},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)(y,{entries:d.loose,sizes:t,onChange:l,picking:S})]})]})}function F(e){let{entry:s,onClose:t}=e,{t:l}=(0,o.kj)(),[i,d]=(0,a.useState)(null),[c,u]=(0,a.useState)(""),[h,m]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=!0;return r.FH.session(s.sessionId).then(t=>{var n;let a=t.tasks.find(e=>e.id===s.taskId);e&&d(null!=(n=null==a?void 0:a.prompt)?n:"")}).catch(s=>{e&&u(s.message)}),()=>{e=!1}},[s.sessionId,s.taskId]);let g=async()=>{if(null!==i){m(!0),u("");try{await r.FH.rerunTask(s.sessionId,s.taskId,{prompt:i}),u(l("reg.fixPromptSaved",{title:s.title})),setTimeout(()=>t(!0),900)}catch(e){u(e.message),m(!1)}}};return(0,n.jsx)("div",{className:"modal-backdrop",role:"presentation",onClick:()=>t(!1),children:(0,n.jsxs)("div",{className:"modal wide",role:"dialog","aria-modal":"true","aria-labelledby":"fix-title",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("h2",{id:"fix-title",children:l("reg.fixPromptTitle",{title:s.title})}),(0,n.jsx)("p",{className:"muted small",children:l("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:c||l("reg.fixPromptLoading")}):(0,n.jsx)("textarea",{className:"prose",value:i,onChange:e=>d(e.target.value),style:{minHeight:260},disabled:h}),(0,n.jsxs)("div",{className:"row modal-actions",children:[c&&null!==i&&(0,n.jsx)("span",{className:"small grow",children:c}),(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>t(!1),disabled:h,children:l("dialog.cancel")}),(0,n.jsx)("button",{type:"button",className:"primary",onClick:()=>void g(),disabled:h||null===i||!i.trim(),children:l("reg.fixPromptSave")})]})]})})}function A(e){let{sessions:s}=e,{t}=(0,o.kj)();return(0,n.jsxs)("div",{className:"row",style:{margin:"14px 0 18px"},children:[(0,n.jsx)(i(),{href:"/#new-session",children:(0,n.jsx)("button",{className:"primary",children:t("reg.newSession")})}),s.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("label",{htmlFor:"new-task-session",style:{margin:0},children:[t("reg.newTask")," ",t("reg.newTaskIn")]}),(0,n.jsxs)("select",{id:"new-task-session",value:"",onChange:e=>{e.target.value&&(window.location.href=(0,r.aT)(e.target.value,"new-task"))},style:{width:"auto",minWidth:200},children:[(0,n.jsx)("option",{value:"",children:t("reg.newTaskPick")}),s.map(e=>{let[s,t]=e;return(0,n.jsx)("option",{value:s,children:t},s)})]})]})]})}function T(e){let{entries:s,onChange:t}=e,{t:l}=(0,o.kj)(),[i,d]=(0,a.useState)(!1),[c,u]=(0,a.useState)(""),[h,m]=(0,a.useState)(!1),[g,x]=(0,a.useState)(new Set),[v,N]=(0,a.useState)(null),f=s.filter(e=>"queued"===e.status),b=s.filter(e=>k.includes(e.status)&&!e.sessionRunning),w=s.some(e=>e.sessionRunning),y=b.filter(e=>"stop"===e.sessionOnFailure),I=b.filter(e=>"stop"!==e.sessionOnFailure),C=[...y,...I.filter(e=>g.has(e.taskId))],S=[...new Set([...f,...C].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))],[A,T]=(0,a.useState)(""),q=y.length>0?l("reg.continueWithFailed",{f:y.length,n:f.length,s:S.length}):l("reg.continue",{n:f.length,s:S.length}),R=(0,j.p)(),W=async e=>{if("unattended"!==e||R||await (0,p.Z)(l("batch.unattendedConfirm",{n:S.length}))){d(!0),u("");try{var s;for(let e of C)await r.FH.rerunTask(e.sessionId,e.taskId);let n=await r.FH.startBatch(S,e,"stop",void 0,void 0,A.trim()||void 0);u(n.started?l("reg.continueStarted",{n:S.length}):l("batch.notStarted",{reason:null!=(s=n.reason)?s:""})),m(!1),t()}catch(e){u(e.message)}finally{d(!1)}}};return 0===f.length&&0===b.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||w,onClick:()=>{x(new Set(I.map(e=>e.taskId))),m(!0),u(""),r.FH.suggestedRunName(S).then(e=>T(e.name)).catch(()=>void 0)},title:l("reg.continueWhy"),children:q}),w&&(0,n.jsx)("span",{className:"muted small",children:l("reg.continueRunning")}),c&&(0,n.jsx)("span",{className:"small",children:c})]}),h&&!w&&(0,n.jsxs)("div",{className:"notice",style:{marginTop:8},children:[(0,n.jsx)("strong",{children:l("reg.continuePanelTitle")}),y.length>0&&(0,n.jsxs)("div",{style:{marginTop:6},children:[(0,n.jsx)("div",{className:"small",children:l("reg.continueChain")}),(0,n.jsx)("ul",{className:"small",style:{margin:"4px 0",paddingLeft:18},children:y.map(e=>(0,n.jsxs)("li",{children:[(0,n.jsx)("strong",{children:e.title})," \xb7 ",e.sessionName," \xb7 ",(0,n.jsx)("span",{className:"badge ".concat(e.status),children:l("status.".concat(e.status))})," ",(0,n.jsx)("button",{className:"quiet small",onClick:()=>N(e),children:l("reg.fixPrompt")})]},e.taskId))})]}),I.length>0&&(0,n.jsxs)("div",{style:{marginTop:6},children:[(0,n.jsx)("div",{className:"small",children:l("reg.continueIndependent")}),(0,n.jsx)("ul",{className:"small",style:{margin:"4px 0",paddingLeft:18,listStyle:"none"},children:I.map(e=>(0,n.jsxs)("li",{children:[(0,n.jsxs)("label",{className:"option-inline",children:[(0,n.jsx)("input",{type:"checkbox",checked:g.has(e.taskId),onChange:s=>x(t=>{let n=new Set(t);return s.target.checked?n.add(e.taskId):n.delete(e.taskId),n})}),(0,n.jsx)("strong",{children:e.title})," \xb7 ",e.sessionName," \xb7 ",(0,n.jsx)("span",{className:"badge ".concat(e.status),children:l("status.".concat(e.status))})]})," ",(0,n.jsx)("button",{className:"quiet small",onClick:()=>N(e),title:l("reg.fixPromptHint"),children:l("reg.fixPrompt")})]},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:A,onChange:e=>T(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:f.length,r:C.length,s:S.length})}),(0,n.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,n.jsx)("button",{className:"primary",disabled:i||0===S.length,onClick:()=>void W("unattended"),title:l("reg.continueUnattendedWhy"),children:l("reg.continueUnattended")}),(0,n.jsx)("button",{disabled:i||0===S.length,onClick:()=>void W("confirm"),title:l("reg.continueWhy"),children:l("reg.continueGo")}),(0,n.jsx)("button",{className:"quiet",disabled:i,onClick:()=>m(!1),children:l("dialog.cancel")})]})]}),v&&(0,n.jsx)(F,{entry:v,onClose:e=>{N(null),e&&t()}})]})}function q(e){let{entries:s}=e,{t}=(0,o.kj)(),a=(0,o.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,89,347,131,358],()=>e(e.s=3256)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{216:(e,a,t)=>{Promise.resolve().then(t.t.bind(t,8197,23)),Promise.resolve().then(t.bind(t,6657)),Promise.resolve().then(t.bind(t,1035)),Promise.resolve().then(t.t.bind(t,952,23)),Promise.resolve().then(t.bind(t,8214)),Promise.resolve().then(t.bind(t,1205)),Promise.resolve().then(t.bind(t,867))},952:()=>{},1035:(e,a,t)=>{"use strict";t.d(a,{DialogHost:()=>c,Z:()=>o});var n=t(3365),r=t(1521),s=t(867);let l=null,i=[];function o(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(t=>{var n;return n={kind:"confirm",message:e,...a,resolve:t},void(l?l(n):i.push(n))})}function c(e){var a,t;let{children:o}=e,{t:c}=(0,s.kj)(),[d,h]=(0,r.useState)([]),u=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(l=e=>h(a=>[...a,e]),i.length>0){let e=i.splice(0,i.length);h(a=>[...a,...e])}return()=>{l=null}},[]);let m=d[0],v=(0,r.useCallback)(e=>{m&&(m.resolve(e),h(e=>e.slice(1)))},[m]);return(0,r.useEffect)(()=>{var e;if(!m)return;null==(e=u.current)||e.focus();let a=e=>{"Escape"===e.key&&(e.preventDefault(),v(!1))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[m,v]),(0,n.jsxs)(n.Fragment,{children:[o,m&&(0,n.jsx)("div",{className:"modal-backdrop",onClick:()=>v(!1),role:"presentation",children:(0,n.jsxs)("div",{className:"modal".concat(m.danger?" danger":""),role:"confirm"===m.kind?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":"modal-title",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("h2",{id:"modal-title",children:null!=(a=m.title)?a:c("confirm"===m.kind?"dialog.confirmTitle":"dialog.noticeTitle")}),(0,n.jsx)("div",{className:"modal-body",children:m.message}),(0,n.jsxs)("div",{className:"row modal-actions",children:["confirm"===m.kind&&(0,n.jsx)("button",{type:"button",className:"quiet",onClick:()=>v(!1),children:c("dialog.cancel")}),(0,n.jsx)("button",{ref:u,type:"button",className:m.danger?"danger":"primary",onClick:()=>v(!0),children:null!=(t=m.okLabel)?t:c("dialog.ok")})]})]})})]})}},1205:(e,a,t)=>{"use strict";t.d(a,{AppearanceProvider:()=>d,K:()=>h,themeScript:()=>i});var n=t(3365),r=t(1521);let s={theme:"light",textSize:"normal",highContrast:!1,reduceMotion:!1,underlineLinks:!1,strongFocus:!1},l="cop.appearance",i="\n(function () {\n try {\n var d = document.documentElement;\n var raw = localStorage.getItem('".concat(l,"');\n var a = raw ? JSON.parse(raw) : {};\n d.dataset.theme = a.theme === 'dark' ? 'dark' : 'light';\n d.dataset.textsize = a.textSize || 'normal';\n d.dataset.contrast = a.highContrast ? 'high' : 'normal';\n d.dataset.motion = a.reduceMotion ? 'reduced' : 'normal';\n d.dataset.links = a.underlineLinks ? 'underline' : 'plain';\n d.dataset.focus = a.strongFocus ? 'strong' : 'normal';\n } catch (e) {}\n})();\n");function 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,r.createContext)({appearance:s,set:()=>void 0,reset:()=>void 0,loaded:!1});function d(e){let{children:a}=e,[t,i]=(0,r.useState)(s),[d,h]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=s;try{let a=window.localStorage.getItem(l);a?e={...s,...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){}i(e),o(e),h(!0)},[]);let u=(0,r.useCallback)(e=>{i(a=>{let t={...a,...e};o(t);try{window.localStorage.setItem(l,JSON.stringify(t))}catch(e){}return t})},[]),m=(0,r.useCallback)(()=>{i(s),o(s);try{window.localStorage.removeItem(l)}catch(e){}},[]);return(0,n.jsx)(c.Provider,{value:{appearance:t,set:u,reset:m,loaded:d},children:a})}function h(){return(0,r.useContext)(c)}},1702:(e,a,t)=>{"use strict";var n=t(9962);t.o(n,"usePathname")&&t.d(a,{usePathname:function(){return n.usePathname}}),t.o(n,"useSearchParams")&&t.d(a,{useSearchParams:function(){return n.useSearchParams}})},6657:(e,a,t)=>{"use strict";t.d(a,{GlobalApprovals:()=>d});var n=t(3365),r=t(1521),s=t(8197),l=t.n(s),i=t(5549),o=t(867),c=t(1035);function d(){let{t:e}=(0,o.kj)(),[a,t]=(0,r.useState)([]),[s,l]=(0,r.useState)({}),c=(0,r.useCallback)(async()=>{try{let e=await i.FH.approvals();if(t(e),e.some(e=>!s[e.sessionId])){let e=await i.FH.sessions().catch(()=>[]);l(Object.fromEntries(e.map(e=>[e.id,e.name])))}}catch(e){}},[s]);return((0,r.useEffect)(()=>{c();let e=setInterval(()=>void c(),2e3);return()=>clearInterval(e)},[c]),(0,r.useEffect)(()=>{let t="copilot-operator";document.title=a.length>0?"(".concat(a.length,") ").concat(e("approval.tabTitle")," — ").concat(t):t},[a.length,e]),0===a.length)?null:(0,n.jsxs)("section",{className:"approval-banner",role:"alert","aria-live":"assertive",children:[(0,n.jsx)("h2",{children:e("approval.waitingHere")}),(0,n.jsx)("p",{className:"small",children:e("approval.waitingHereWhy")}),a.map(e=>{var a;return(0,n.jsx)(h,{approval:e,sessionName:null!=(a=s[e.sessionId])?a:e.sessionId,onDecided:()=>void c()},e.id)})]})}function h(e){let{approval:a,sessionName:t,onDecided:s}=e,{t:d}=(0,o.kj)(),h=(0,o.W3)(),[u,m]=(0,r.useState)(!1),v=async e=>{if("run-all"!==e||await (0,c.Z)(d("approval.runAllConfirm"))){m(!0);try{await i.FH.decide(a.id,e)}finally{m(!1),s()}}};return(0,n.jsxs)("div",{className:"approval",children:[(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("strong",{children:d("approval.title",{n:a.stepId})}),(0,n.jsx)(l(),{href:(0,i.aT)(a.sessionId),children:t}),(0,n.jsx)("span",{className:"muted small",children:h(a.createdAt)})]}),(0,n.jsx)("pre",{style:{margin:"8px 0"},children:a.description}),a.network&&(0,n.jsx)("p",{className:"reason small",children:d("approval.network")}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)("button",{className:"primary",disabled:u,onClick:()=>void v("run"),children:d("approval.run")}),!a.network&&(0,n.jsx)("button",{disabled:u,onClick:()=>void v("run-all"),title:d("approval.runAllWhy"),children:d("approval.runAll")}),(0,n.jsx)("button",{disabled:u,onClick:()=>void v("skip"),children:d("approval.skip")}),(0,n.jsx)("button",{className:"danger",disabled:u,onClick:()=>void v("abort"),children:d("approval.abort")})]})]})}},8214:(e,a,t)=>{"use strict";t.d(a,{Nav:()=>m,SkipLink:()=>u});var n=t(3365),r=t(1521),s=t(8197),l=t.n(s),i=t(1702),o=t(5549),c=t(867);let d={sessions:(0,n.jsx)("path",{d:"M4 5h16v4H4zM4 11h16v4H4zM4 17h10v2H4z"}),defaults:(0,n.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,n.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,n.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,n.jsx)("path",{d:"M6 3h9l5 5v13H6zM14 3v6h6M9 13h7M9 17h7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),presets:(0,n.jsx)("path",{d:"M5 4h14v4H5zM5 10h14v4H5zM5 16h9v4H5z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),appearance:(0,n.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,n.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 u(){let{t:e}=(0,c.kj)();return(0,n.jsx)("a",{className:"skip-link",href:"#main",children:e("a11y.skip")})}function m(){let{t:e}=(0,c.kj)(),a=(0,i.usePathname)(),t=function(){let[e,a]=(0,r.useState)(0);return(0,r.useEffect)(()=>{let e=!0,t=()=>o.FH.activity().then(t=>{e&&a(t.sessions)}).catch(()=>void 0);t();let n=setInterval(t,4e3);return()=>{e=!1,clearInterval(n)}},[]),e}();return(0,n.jsxs)("nav",{"aria-label":e("nav.label"),children:[h.map(r=>(0,n.jsxs)(l(),{href:r.href,"aria-current":a===r.href?"page":void 0,children:[(0,n.jsx)("svg",{className:"nav-icon",viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor","aria-hidden":"true",children:d[r.icon]}),(0,n.jsx)("span",{children:e(r.label)}),"/history"===r.href&&t>0&&(0,n.jsxs)("span",{className:"live",title:e("nav.liveTitle",{n:t}),children:[(0,n.jsx)("span",{className:"dot","aria-hidden":"true"}),e("nav.live")]})]},r.href)),(0,n.jsx)(c.c5,{})]})}}},e=>{e.O(0,[353,197,867,549,347,131,358],()=>e(e.s=216)),_N_E=e.O()}]);