copilot-operator 0.1.66 → 0.1.67

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 +8 -1
  2. package/dist/src/api/operator.service.js +3 -1
  3. package/dist/src/cli.js +1 -0
  4. package/dist/src/config/schema.js +7 -0
  5. package/dist/src/exec/authorizer.js +26 -6
  6. package/dist/src/exec/commandHeads.js +30 -6
  7. package/dist/src/exec/platforms.js +13 -2
  8. package/dist/src/exec/policy.js +31 -4
  9. package/dist/src/exec/policyManifest.js +9 -0
  10. package/dist/src/exec/readOnly.js +158 -0
  11. package/dist/src/orchestrator/taskRunner.js +4 -2
  12. package/dist/src/plan/kerrigan.js +3 -1
  13. package/dist/src/plan/systemGuide.js +63 -0
  14. package/dist/web/404.html +2 -2
  15. package/dist/web/_next/static/chunks/1024-5f630cbb54e7346f.js +1 -0
  16. package/dist/web/_next/static/chunks/{1077.b88b069535f7008e.js → 1077.3b82a837cf810f8b.js} +1 -1
  17. package/dist/web/_next/static/chunks/{1548.9e01803e48173ea9.js → 1548.52bfcd01c16aaafe.js} +1 -1
  18. package/dist/web/_next/static/chunks/{2163.018cd5f719ae4b3d.js → 2163.e60d3be9bb3f8b3f.js} +1 -1
  19. package/dist/web/_next/static/chunks/{714.281f68f85df26013.js → 714.b452ef814760b5a5.js} +1 -1
  20. package/dist/web/_next/static/chunks/{7220.3bd10a3e4e053e0c.js → 7220.96b18052ed9c06c7.js} +1 -1
  21. package/dist/web/_next/static/chunks/{7921-1c173d00d23b3589.js → 7921-dd201ce7aa02c12d.js} +1 -1
  22. package/dist/web/_next/static/chunks/{8124-bb544c96a7c0e7e3.js → 8124-c27ce7bd781f4c56.js} +1 -1
  23. package/dist/web/_next/static/chunks/{8584.c7cd52c2e7075bcb.js → 8584.ab8d406781cdd45c.js} +1 -1
  24. package/dist/web/_next/static/chunks/{9067.feaf894390db1a88.js → 9067.5b8abc40104d51d9.js} +1 -1
  25. package/dist/web/_next/static/chunks/9747.cf0353e7ffec2ee4.js +1 -0
  26. package/dist/web/_next/static/chunks/app/{page-95379244849623fc.js → page-ab73d1b3ba9181c2.js} +1 -1
  27. package/dist/web/_next/static/chunks/app/settings/page-7d120feb5af0ace9.js +1 -0
  28. package/dist/web/_next/static/chunks/{webpack-5ea108bc2e386c55.js → webpack-23ace264f775d98a.js} +1 -1
  29. package/dist/web/_next/static/css/{a112074f3d1a8a07.css → 532df8667473c4fc.css} +1 -1
  30. package/dist/web/defaults.html +2 -2
  31. package/dist/web/defaults.txt +8 -8
  32. package/dist/web/index.html +3 -3
  33. package/dist/web/index.txt +9 -9
  34. package/dist/web/queue.html +2 -2
  35. package/dist/web/queue.txt +9 -9
  36. package/dist/web/settings.html +2 -2
  37. package/dist/web/settings.txt +9 -9
  38. package/dist/web/system.html +2 -2
  39. package/dist/web/system.txt +9 -9
  40. package/package.json +3 -2
  41. package/dist/web/_next/static/chunks/1024-444e9060299d04ba.js +0 -1
  42. package/dist/web/_next/static/chunks/9747.7cee8a2d8301f25c.js +0 -1
  43. package/dist/web/_next/static/chunks/app/settings/page-9a83381087178f80.js +0 -1
  44. /package/dist/web/_next/static/{BbWvNQTsh3pH7ZN_RKR60 → JpBxrjYpw2xowWbFoiPjO}/_buildManifest.js +0 -0
  45. /package/dist/web/_next/static/{BbWvNQTsh3pH7ZN_RKR60 → JpBxrjYpw2xowWbFoiPjO}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8124],{1702:(e,a,t)=>{var r=t(99962);t.o(r,"usePathname")&&t.d(a,{usePathname:function(){return r.usePathname}}),t.o(r,"useRouter")&&t.d(a,{useRouter:function(){return r.useRouter}})},16752:(e,a,t)=>{t.d(a,{s:()=>M,i:()=>y,SkipLink:()=>N});var r=t(73365),s=t(1521),l=t(18197),n=t.n(l),i=t(1702),o=t(15549),c=t(87527),d=t(8205),h=t(99755);let p={gb:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"30",height:"20",fill:"#012169"}),(0,r.jsx)("path",{d:"M0 0 30 20M30 0 0 20",stroke:"#fff",strokeWidth:"4"}),(0,r.jsx)("path",{d:"M0 0 30 20M30 0 0 20",stroke:"#c8102e",strokeWidth:"1.4"}),(0,r.jsx)("path",{d:"M15 0v20M0 10h30",stroke:"#fff",strokeWidth:"6"}),(0,r.jsx)("path",{d:"M15 0v20M0 10h30",stroke:"#c8102e",strokeWidth:"3.4"})]}),bg:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"30",height:"20",fill:"#fff"}),(0,r.jsx)("rect",{y:"6.67",width:"30",height:"6.67",fill:"#00966e"}),(0,r.jsx)("rect",{y:"13.33",width:"30",height:"6.67",fill:"#d62612"})]}),de:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"30",height:"6.67",fill:"#000"}),(0,r.jsx)("rect",{y:"6.67",width:"30",height:"6.67",fill:"#dd0000"}),(0,r.jsx)("rect",{y:"13.33",width:"30",height:"6.67",fill:"#ffce00"})]}),es:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"30",height:"20",fill:"#aa151b"}),(0,r.jsx)("rect",{y:"5",width:"30",height:"10",fill:"#f1bf00"}),(0,r.jsx)("rect",{x:"7",y:"7.5",width:"3.4",height:"5",rx:"0.8",fill:"#aa151b",opacity:"0.85"})]}),fr:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"10",height:"20",fill:"#002395"}),(0,r.jsx)("rect",{x:"10",width:"10",height:"20",fill:"#fff"}),(0,r.jsx)("rect",{x:"20",width:"10",height:"20",fill:"#ed2939"})]}),pt:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"12",height:"20",fill:"#006600"}),(0,r.jsx)("rect",{x:"12",width:"18",height:"20",fill:"#ff0000"}),(0,r.jsx)("circle",{cx:"12",cy:"10",r:"4.2",fill:"none",stroke:"#ffcc00",strokeWidth:"1.4"}),(0,r.jsx)("path",{d:"M10.3 7.8h3.4v3.2a1.7 1.7 0 0 1-3.4 0z",fill:"#fff",stroke:"#d00",strokeWidth:"0.6"})]}),jp:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"30",height:"20",fill:"#fff"}),(0,r.jsx)("circle",{cx:"15",cy:"10",r:"6",fill:"#bc002d"})]}),kr:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"30",height:"20",fill:"#fff"}),(0,r.jsx)("path",{d:"M10 10a5 5 0 0 1 10 0 2.5 2.5 0 0 1-5 0 2.5 2.5 0 0 0-5 0z",fill:"#cd2e3a"}),(0,r.jsx)("path",{d:"M10 10a5 5 0 0 0 10 0 2.5 2.5 0 0 0-5 0 2.5 2.5 0 0 1-5 0z",fill:"#0047a0"}),(0,r.jsxs)("g",{stroke:"#000",strokeWidth:"0.9",children:[(0,r.jsx)("path",{d:"M4.2 5.6 6.8 2.4M5.1 6.3 7.7 3.1M6 7 8.6 3.8"}),(0,r.jsx)("path",{d:"M21.4 3.8 24 7M22.3 3.1 24.9 6.3M23.2 2.4 25.8 5.6"}),(0,r.jsx)("path",{d:"M4.2 14.4 6.8 17.6M5.1 13.7 7.7 16.9M6 13 8.6 16.2"}),(0,r.jsx)("path",{d:"M21.4 16.2 24 13M22.3 16.9 24.9 13.7M23.2 17.6 25.8 14.4"})]})]}),sa:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"30",height:"20",fill:"#006c35"}),(0,r.jsx)("path",{d:"M7 8.2c1-.9 2 .9 3 0s2 .9 3 0 2 .9 3 0 2 .9 3 0 2 .9 3 0",fill:"none",stroke:"#fff",strokeWidth:"1.1",strokeLinecap:"round"}),(0,r.jsx)("path",{d:"M8 12.6h13.4M21.4 12.6l1.6-.9M9.6 11.6v2",stroke:"#fff",strokeWidth:"1",strokeLinecap:"round"})]})};function u(e){let{id:a}=e;return(0,r.jsx)("svg",{className:"flag",viewBox:"0 0 30 20","aria-hidden":"true",focusable:"false",children:p[a]})}var m=t(5462);function x(){let{locale:e,setLocale:a}=(0,d.Ym)(),{t}=(0,d.kj)(),s=(0,m.f)("below");return(0,r.jsxs)("span",{className:"lang-menu",children:[(0,r.jsxs)("button",{ref:s.anchor,type:"button",className:"lang-btn","aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.id:void 0,onClick:s.toggle,title:t("lang.menu"),children:[(0,r.jsxs)("svg",{className:"lang-globe",viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"6.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),(0,r.jsx)("path",{d:"M1.5 8h13M8 1.5c2 2 2.8 4 2.8 6.5S10 12.5 8 14.5M8 1.5C6 3.5 5.2 5.5 5.2 8S6 12.5 8 14.5",fill:"none",stroke:"currentColor",strokeWidth:"1.1"})]}),(0,r.jsx)("span",{lang:"en",children:t("lang.label")}),(0,r.jsx)("span",{"aria-hidden":"true",children:"▾"})]}),s.open&&(0,r.jsx)("div",{ref:s.panel,id:s.id,role:"menu","aria-label":t("lang.menu"),className:"pop menu lang-list",style:s.style,children:h.Yj.map(t=>(0,r.jsxs)("button",{type:"button",role:"menuitemradio","aria-checked":t.code===e,onClick:()=>{a(t.code),s.close()},children:[(0,r.jsx)(u,{id:t.flag}),(0,r.jsx)("span",{className:"lang-native",lang:t.code,dir:t.dir,children:t.native}),"en"!==t.code&&(0,r.jsx)("span",{className:"lang-english muted small",lang:"en",children:t.english}),(0,r.jsx)("span",{className:"lang-tick","aria-hidden":"true",children:t.code===e?"✓":""})]},t.code))})]})}var f=t(98078);let j=[{value:"system",label:"theme.system"},{value:"light",label:"theme.light"},{value:"dark",label:"theme.dark"}],v={smallest:"ap.sizeSmallest",verysmall:"ap.sizeVerySmall",compact:"ap.sizeCompact",small:"ap.sizeSmall",normal:"ap.sizeNormal",large:"ap.sizeLarge",huge:"ap.sizeHuge",giant:"ap.sizeGiant"},g=[{name:"nightLight",label:"ap.night"},{name:"underlineLinks",label:"ap.links"},{name:"reduceMotion",label:"ap.motion"},{name:"highContrast",label:"ap.contrast"},{name:"strongFocus",label:"ap.focus"},{name:"systemCursor",label:"ap.systemCursor"}];function k(){let{t:e}=(0,d.kj)(),{appearance:a,set:t,reset:s,loaded:l}=(0,f.KP)(),n=(0,m.f)("below"),i=f.Xm.indexOf(a.textSize);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{ref:n.anchor,type:"button",className:"lang-btn ap-btn".concat(n.open?" on":""),"aria-label":e("wb.appearance"),title:e("wb.appearance"),"aria-expanded":n.open,"aria-controls":n.open?n.id:void 0,onClick:n.toggle,children:[(0,r.jsxs)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.8","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"8.5"}),(0,r.jsx)("path",{d:"M12 3.5a8.5 8.5 0 0 1 0 17z",fill:"currentColor",stroke:"none"})]}),(0,r.jsx)("span",{"aria-hidden":"true",children:e("nav.appearance")})]}),n.open&&(0,r.jsxs)("div",{ref:n.panel,id:n.id,role:"dialog","aria-label":e("wb.appearance"),className:"pop wb-appear",style:n.style,children:[(0,r.jsx)("p",{className:"pop-title",children:e("wb.appearance")}),(0,r.jsx)("p",{className:"wb-appear-label",id:"".concat(n.id,"-theme"),children:e("ap.theme")}),(0,r.jsx)("div",{className:"segmented",role:"group","aria-labelledby":"".concat(n.id,"-theme"),children:j.map(s=>(0,r.jsx)("button",{type:"button","aria-pressed":l&&a.theme===s.value,onClick:()=>t({theme:s.value}),children:e(s.label)},s.value))}),(0,r.jsx)("p",{className:"wb-appear-label",id:"".concat(n.id,"-size"),children:e("ap.size")}),(0,r.jsxs)("div",{className:"wb-appear-size",role:"group","aria-labelledby":"".concat(n.id,"-size"),children:[(0,r.jsx)("button",{type:"button","aria-label":e("ap.smaller"),title:e("ap.smaller"),disabled:i<=0,onClick:()=>t({textSize:f.Xm[i-1]}),children:"A−"}),(0,r.jsx)("span",{"aria-live":"polite",children:e(v[a.textSize])}),(0,r.jsx)("button",{type:"button","aria-label":e("ap.larger"),title:e("ap.larger"),disabled:i>=f.Xm.length-1,onClick:()=>t({textSize:f.Xm[i+1]}),children:"A+"})]}),g.map(s=>(0,r.jsxs)("label",{className:"wb-appear-aid",children:[(0,r.jsx)("input",{type:"checkbox",checked:a[s.name],onChange:e=>t({[s.name]:e.target.checked})}),(0,r.jsx)("span",{children:e(s.label)})]},s.name)),(0,r.jsx)("div",{className:"row",children:(0,r.jsx)("button",{type:"button",className:"quiet small",onClick:s,children:e("ap.reset")})})]})]})}let w={workbench:(0,r.jsx)("path",{d:"M4 5h16v11H9l-5 4zM8 9h8M8 12h5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),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"}),system:(0,r.jsx)("path",{d:"M4 5h16v10H4zM2 19h20M9 15v4M15 15v4",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),queue:(0,r.jsx)("path",{d:"M4 6h16M4 12h16M4 18h10M17 16l3 2-3 2z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round",strokeLinecap:"round"})},b=[{href:"/",label:"nav.workbench",icon:"workbench"},{href:"/queue",label:"nav.queue",icon:"queue"},{href:"/settings",label:"nav.defaults",icon:"defaults"},{href:"/system",label:"nav.system",icon:"system"}];function y(){return(0,r.jsxs)("span",{className:"nav-pair",children:[(0,r.jsx)(k,{}),(0,r.jsx)(x,{})]})}function N(){let{t:e}=(0,d.kj)();return(0,r.jsx)("a",{className:"skip-link",href:"#main",children:e("a11y.skip")})}function M(){let{t:e}=(0,d.kj)(),a=(0,i.usePathname)(),t=function(){let[e,a]=(0,s.useState)(0);return(0,c.z)(()=>o.FH.activity().then(e=>a(e.sessions)).catch(()=>void 0),4e3),e}();return(0,r.jsxs)("nav",{"aria-label":e("nav.label"),children:[b.flatMap(s=>[(0,r.jsxs)(n(),{href:s.href,"aria-current":a===s.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:w[s.icon]}),(0,r.jsx)("span",{children:e(s.label)}),"/"===s.href&&t>0&&(0,r.jsxs)("span",{className:"live",title:e("nav.liveTitle",{n:t}),children:[(0,r.jsx)("span",{className:"dot","aria-hidden":"true"}),e("nav.live")]})]},s.href)]),(0,r.jsx)(y,{})]})}},36657:(e,a,t)=>{t.d(a,{M:()=>g,U:()=>j});var r=t(73365),s=t(1521),l=t(18197),n=t.n(l),i=t(1702),o=t(15549),c=t(8205),d=t(51035),h=t(87527),p=t(33389),u=t(61238),m=t(52157),x=t(79717),f=t(92842);function j(){let{t:e}=(0,c.kj)(),a=(0,i.usePathname)(),[t,l]=(0,s.useState)([]),[n,d]=(0,s.useState)({}),p=(0,s.useRef)({}),x=(0,s.useRef)(new Set),f=(0,s.useRef)(""),j=(0,s.useRef)(new Set),g=(0,s.useCallback)(async()=>{try{let e=await o.FH.approvals();l(e.filter(e=>!j.current.has(e.id)));let a=[...new Set(e.map(e=>e.sessionId).filter(e=>!(e in p.current)))],t=a.sort().join(",");if(a.length>0&&t!==f.current){for(let e of(f.current=t,await o.FH.sessions().catch(()=>[])))p.current[e.id]=e.name,"chat"===e.kind&&x.current.add(e.id);d({...p.current})}}catch(e){}},[]);(0,h.z)(g,2e3);let k=(0,u.v)(),[w,b]=(0,s.useState)(0),y=(0,s.useRef)(0);(0,s.useEffect)(()=>{let e=setInterval(()=>{"visible"===document.visibilityState&&document.hasFocus()&&(y.current=Date.now()),b(e=>e+1)},450);return()=>clearInterval(e)},[]);let N=(null==k?void 0:k.last)?Date.parse(k.last.at):0,M=(0,m.WT)(t.length,k,w%3+1,!!(null==k?void 0:k.last)&&y.current-N<12e3);(0,s.useEffect)(()=>{document.title=M},[M]);let C="/"===a?t.filter(e=>e.sessionId in p.current&&(!x.current.has(e.sessionId)||!!e.model)):t;return 0===C.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")}),C.map(e=>{var a;return(0,r.jsx)(v,{approval:e,sessionName:null!=(a=n[e.sessionId])?a:e.sessionId,onDecided:a=>{var t;return t=e.id,void(a&&(j.current.add(t),l(e=>e.filter(e=>e.id!==t))),g())}},e.id)})]})}function v(e){let{approval:a,sessionName:t,onDecided:s}=e,{t:l}=(0,c.kj)(),i=(0,c.W3)(),{err:h,choose:u,mark:m}=(0,p.p)(),x=async e=>{("run-all"!==e||await (0,d.Z)(l("approval.runAllConfirm")))&&s(await u(e,async()=>{await o.FH.decide(a.id,e)}))};if(a.plan)return(0,r.jsx)(g,{approval:a,sessionName:t,onDecided:s});if(a.model){var j;let e=a.model;return(0,r.jsxs)("div",{className:"approval",children:[(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("strong",{children:l(e.manual?"approval.manualTitle":"approval.modelTitle")}),a.actor&&(0,r.jsx)(f.y,{actor:a.actor,how:"asks"}),(0,r.jsx)(n(),{href:"/",children:t}),(0,r.jsx)("span",{className:"muted small",children:i(a.createdAt)})]}),e.review&&(0,r.jsxs)("div",{className:"approval-review",role:"note",children:[(0,r.jsx)("strong",{children:l("approval.reviewModelTitle")}),(0,r.jsx)("span",{children:l("approval.reviewModelWhy")})]}),e.role&&(0,r.jsxs)("div",{className:"approval-review",role:"note",children:[(0,r.jsx)("strong",{children:l("lead"===e.role?"approval.leadModelTitle":"approval.workerModelTitle")}),(0,r.jsx)("span",{children:l("lead"===e.role?"approval.leadModelWhy":"approval.workerModelWhy")})]}),(0,r.jsx)("p",{children:e.manual?e.asked?l("approval.manualAsk",{model:e.asked}):l("approval.manualAskAny"):l("approval.modelAsk",{model:e.asked})}),(0,r.jsx)("p",{className:"muted small",children:l("approval.modelShown",{shown:null!=(j=e.shown)?j:"—"})}),!e.manual&&(0,r.jsx)("p",{className:"reason small",children:l("approval.modelWhy",{why:e.why,tries:e.tries})}),h&&(0,r.jsx)("p",{className:"err",role:"alert",children:h}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("button",{className:"primary",...m("run"),onClick:()=>void x("run"),children:l(e.manual?"approval.manualReady":"approval.modelChosen")}),!e.manual&&(0,r.jsx)("button",{...m("skip"),onClick:()=>void x("skip"),children:l("approval.modelAsItIs")}),(0,r.jsx)("button",{className:"danger",...m("abort"),onClick:()=>void x("abort"),children:l("approval.modelStop")})]})]})}return(0,r.jsxs)("div",{className:"approval",children:[(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("strong",{children:l("approval.title",{n:a.stepId})}),a.actor&&(0,r.jsx)(f.y,{actor:a.actor,how:"asks"}),(0,r.jsx)(n(),{href:"/",children:t}),(0,r.jsx)("span",{className:"muted small",children:i(a.createdAt)})]}),(0,r.jsx)("pre",{style:{margin:"8px 0"},children:a.description}),a.platform&&(0,r.jsx)("p",{className:"reason small",children:l("approval.platform",{platform:a.platform})}),a.network&&(0,r.jsx)("p",{className:"reason small",children:l("approval.network")}),h&&(0,r.jsx)("p",{className:"err",role:"alert",children:h}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("button",{className:"primary",...m("run"),onClick:()=>void x("run"),children:l("approval.run")}),!a.network&&!a.platform&&(0,r.jsx)("button",{...m("run-all"),onClick:()=>void x("run-all"),title:l("approval.runAllWhy"),children:l("approval.runAll")}),(0,r.jsx)("button",{...m("skip"),onClick:()=>void x("skip"),children:l("approval.skip")}),(0,r.jsx)("button",{className:"danger",...m("abort"),onClick:()=>void x("abort"),children:l("approval.abort")})]})]})}function g(e){let{approval:a,sessionName:t,onDecided:l}=e,{t:i}=(0,c.kj)(),h=(0,c.W3)(),[u,m]=(0,s.useState)(""),{locked:j,err:v,setErr:g,choose:k,mark:w}=(0,p.p)(),b=a.plan,y=async e=>{if("revise"===e&&!u.trim())return void g(i("pm.reviseNeedsNote"));("stop"!==e||await (0,d.Z)(i("pm.stopConfirm")))&&l(await k(e,async()=>{await o.FH.decidePlan(a.id,e,u)}))};return(0,r.jsxs)("div",{className:"approval",children:[(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("strong",{children:i("pm.cardTitle",{title:b.title})}),a.actor&&(0,r.jsx)(f.y,{actor:a.actor,how:"asks"}),void 0!==t&&(0,r.jsx)(n(),{href:"/",children:t}),(0,r.jsx)("span",{className:"muted small",children:h(a.createdAt)})]}),(0,r.jsx)("p",{className:"small",children:i("pm.cardWhy")}),(0,r.jsx)(x.D,{plan:b.plan,showApproval:!1}),(0,r.jsx)("label",{htmlFor:"plan-note-".concat(a.id),children:i("pm.note")}),(0,r.jsx)("textarea",{id:"plan-note-".concat(a.id),className:"prose",value:u,onChange:e=>m(e.target.value),placeholder:i("pm.notePlaceholder"),style:{minHeight:70},disabled:j}),v&&(0,r.jsx)("p",{className:"err",role:"alert",children:v}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("button",{className:"primary",...w("approve"),onClick:()=>void y("approve"),children:i("pm.approve")}),(0,r.jsx)("button",{...w("revise"),onClick:()=>void y("revise"),title:i("pm.reviseWhy"),children:i("pm.revise")}),(0,r.jsx)("button",{className:"danger",...w("stop"),onClick:()=>void y("stop"),children:i("pm.stop")})]})]})}},61238:(e,a,t)=>{t.d(a,{v:()=>c});var r=t(1521),s=t(15549);t(52157);let l=null,n=null,i=new Set;async function o(){try{l=await s.FH.activity()}catch(e){return}for(let e of i)e(l)}function c(){let[e,a]=(0,r.useState)(l);return(0,r.useEffect)(()=>(i.add(a),n?a(l):(o(),n=setInterval(()=>void o(),2e3)),()=>{i.delete(a),0===i.size&&n&&(clearInterval(n),n=null)}),[]),e}},83285:(e,a,t)=>{t.d(a,{g:()=>i});var r=t(73365),s=t(1521);let l="translate(104 14) scale(0.74) rotate(42 50 50)",n={ellipse:{cx:96,cy:64,rx:86,ry:36,rotate:-25,width:6.5},under:{d:"M70 104 C112 124 166 112 186 86 C194 74 192 60 184 52",width:6},trace:{d:"M22 28 C18 42 22 56 34 70",width:2.4}};function i(e){let{className:a="brand-logo"}=e,t="cop-logo-".concat((0,s.useId)().replace(/[^a-zA-Z0-9-]/g,"")),i=n.ellipse;return(0,r.jsxs)("svg",{className:a,viewBox:"0 0 200 120","aria-hidden":"true",focusable:"false",children:[(0,r.jsx)("defs",{children:(0,r.jsxs)("mask",{id:t,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"200",height:"120",children:[(0,r.jsx)("rect",{width:"200",height:"120",fill:"#fff"}),(0,r.jsx)("path",{d:"M50 3L94 60L94 62.6L69.5 89.6L30.5 89.6L6 62.6L6 60Z",transform:l,fill:"#000",stroke:"#000",strokeWidth:18,strokeLinejoin:"round"})]})}),(0,r.jsxs)("g",{mask:"url(#".concat(t,")"),fill:"none",stroke:"var(--logo-orbit)",strokeLinecap:"round",children:[(0,r.jsx)("ellipse",{cx:i.cx,cy:i.cy,rx:i.rx,ry:i.ry,transform:"rotate(".concat(i.rotate," ").concat(i.cx," ").concat(i.cy,")"),strokeWidth:i.width}),(0,r.jsx)("path",{d:n.under.d,strokeWidth:n.under.width}),(0,r.jsx)("path",{d:n.trace.d,strokeWidth:n.trace.width})]}),(0,r.jsx)("path",{className:"brand-plane",d:"M50 3C54.6 3 56.6 8.2 56.6 14.5L56.6 35.5L91.5 55.8C93.2 56.8 94 58.2 94 60L94 62.6L56.6 52.8L55.4 74.5L69.5 84.6L69.5 89.6L52.6 85.6L50 89.8L47.4 85.6L30.5 89.6L30.5 84.6L44.6 74.5L43.4 52.8L6 62.6L6 60C6 58.2 6.8 56.8 8.5 55.8L43.4 35.5L43.4 14.5C43.4 8.2 45.4 3 50 3Z",transform:l,fill:"var(--logo-plane)"})]})}},92842:(e,a,t)=>{t.d(a,{y:()=>n});var r=t(73365),s=t(52157),l=t(8205);function n(e){let{actor:a,acting:t,how:n="name"}=e,{t:i}=(0,l.kj)(),o=(0,s.Gy)(i,a,t),c="asks"===n?i("actor.asks",{who:o}):"now"===n?i("actor.now",{who:o}):o;return(0,r.jsxs)("span",{className:"actor-chip actor-".concat(a),"data-actor":a,title:i(s.Xi[a]),children:[(0,r.jsx)("span",{className:"actor-dot","aria-hidden":"true"}),c]})}},98078:(e,a,t)=>{t.d(a,{AppearanceProvider:()=>d,Xm:()=>n,KP:()=>h});var r=t(73365),s=t(1521);let l="cop.appearance",n=["smallest","verysmall","compact","small","normal","large","huge","giant"];"(function(){try{\nvar d=document.documentElement,raw=localStorage.getItem('".concat(l,"'),a=raw?JSON.parse(raw):{};\nif(!a||typeof a!=='object')a={};\nd.dataset.theme=a.theme==='dark'||a.theme==='light'?a.theme:window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';\nd.dataset.textsize=").concat(JSON.stringify(n),".indexOf(a.textSize)>=0?a.textSize:'normal';\nd.dataset.contrast=a.highContrast?'high':'normal';\nd.dataset.motion=a.reduceMotion?'reduced':'normal';\nd.dataset.links=a.underlineLinks?'underline':'plain';\nd.dataset.focus=a.strongFocus?'strong':'normal';\nd.dataset.night=a.nightLight?'on':'off';\nd.dataset.cursor=a.systemCursor?'system':'own';\nvar l=(localStorage.getItem('cop.locale')||'').toLowerCase();\nif(").concat(JSON.stringify(["ar"]),".indexOf(l)>=0){d.dir='rtl';d.lang=l;}\n}catch(e){}})();");let i={theme:"system",textSize:"normal",highContrast:!1,reduceMotion:!1,underlineLinks:!1,strongFocus:!1,nightLight:!1,systemCursor:!1};function o(e){let a=document.documentElement;a.dataset.theme="system"===e.theme?!function(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch(e){return!1}}()?"light":"dark":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",a.dataset.night=e.nightLight?"on":"off",a.dataset.cursor=e.systemCursor?"system":"own"}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,p]=(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||"light"===a.theme||"system"===a.theme?a.theme:i.theme,textSize:n.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),nightLight:t(a.nightLight,i.nightLight),systemCursor:t(a.systemCursor,i.systemCursor)}}(JSON.parse(a))),window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!a&&(e={...e,reduceMotion:!0})}catch(e){}d(e),o(e),p(!0)},[]),(0,s.useEffect)(()=>{let e;if("system"!==t.theme)return;try{e=window.matchMedia("(prefers-color-scheme: dark)")}catch(e){return}let a=()=>o(t);return e.addEventListener("change",a),()=>e.removeEventListener("change",a)},[t]);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})},[]),m=(0,s.useCallback)(()=>{d(i),o(i);try{window.localStorage.removeItem(l)}catch(e){}},[]);return(0,r.jsx)(c.Provider,{value:{appearance:t,set:u,reset:m,loaded:h},children:a})}function h(){return(0,s.useContext)(c)}}}]);
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8124],{1702:(e,a,t)=>{var r=t(99962);t.o(r,"usePathname")&&t.d(a,{usePathname:function(){return r.usePathname}}),t.o(r,"useRouter")&&t.d(a,{useRouter:function(){return r.useRouter}})},16752:(e,a,t)=>{t.d(a,{s:()=>M,i:()=>y,SkipLink:()=>N});var r=t(73365),s=t(1521),l=t(18197),n=t.n(l),i=t(1702),o=t(15549),c=t(87527),d=t(8205),h=t(99755);let p={gb:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"30",height:"20",fill:"#012169"}),(0,r.jsx)("path",{d:"M0 0 30 20M30 0 0 20",stroke:"#fff",strokeWidth:"4"}),(0,r.jsx)("path",{d:"M0 0 30 20M30 0 0 20",stroke:"#c8102e",strokeWidth:"1.4"}),(0,r.jsx)("path",{d:"M15 0v20M0 10h30",stroke:"#fff",strokeWidth:"6"}),(0,r.jsx)("path",{d:"M15 0v20M0 10h30",stroke:"#c8102e",strokeWidth:"3.4"})]}),bg:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"30",height:"20",fill:"#fff"}),(0,r.jsx)("rect",{y:"6.67",width:"30",height:"6.67",fill:"#00966e"}),(0,r.jsx)("rect",{y:"13.33",width:"30",height:"6.67",fill:"#d62612"})]}),de:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"30",height:"6.67",fill:"#000"}),(0,r.jsx)("rect",{y:"6.67",width:"30",height:"6.67",fill:"#dd0000"}),(0,r.jsx)("rect",{y:"13.33",width:"30",height:"6.67",fill:"#ffce00"})]}),es:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"30",height:"20",fill:"#aa151b"}),(0,r.jsx)("rect",{y:"5",width:"30",height:"10",fill:"#f1bf00"}),(0,r.jsx)("rect",{x:"7",y:"7.5",width:"3.4",height:"5",rx:"0.8",fill:"#aa151b",opacity:"0.85"})]}),fr:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"10",height:"20",fill:"#002395"}),(0,r.jsx)("rect",{x:"10",width:"10",height:"20",fill:"#fff"}),(0,r.jsx)("rect",{x:"20",width:"10",height:"20",fill:"#ed2939"})]}),pt:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"12",height:"20",fill:"#006600"}),(0,r.jsx)("rect",{x:"12",width:"18",height:"20",fill:"#ff0000"}),(0,r.jsx)("circle",{cx:"12",cy:"10",r:"4.2",fill:"none",stroke:"#ffcc00",strokeWidth:"1.4"}),(0,r.jsx)("path",{d:"M10.3 7.8h3.4v3.2a1.7 1.7 0 0 1-3.4 0z",fill:"#fff",stroke:"#d00",strokeWidth:"0.6"})]}),jp:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"30",height:"20",fill:"#fff"}),(0,r.jsx)("circle",{cx:"15",cy:"10",r:"6",fill:"#bc002d"})]}),kr:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"30",height:"20",fill:"#fff"}),(0,r.jsx)("path",{d:"M10 10a5 5 0 0 1 10 0 2.5 2.5 0 0 1-5 0 2.5 2.5 0 0 0-5 0z",fill:"#cd2e3a"}),(0,r.jsx)("path",{d:"M10 10a5 5 0 0 0 10 0 2.5 2.5 0 0 0-5 0 2.5 2.5 0 0 1-5 0z",fill:"#0047a0"}),(0,r.jsxs)("g",{stroke:"#000",strokeWidth:"0.9",children:[(0,r.jsx)("path",{d:"M4.2 5.6 6.8 2.4M5.1 6.3 7.7 3.1M6 7 8.6 3.8"}),(0,r.jsx)("path",{d:"M21.4 3.8 24 7M22.3 3.1 24.9 6.3M23.2 2.4 25.8 5.6"}),(0,r.jsx)("path",{d:"M4.2 14.4 6.8 17.6M5.1 13.7 7.7 16.9M6 13 8.6 16.2"}),(0,r.jsx)("path",{d:"M21.4 16.2 24 13M22.3 16.9 24.9 13.7M23.2 17.6 25.8 14.4"})]})]}),sa:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",{width:"30",height:"20",fill:"#006c35"}),(0,r.jsx)("path",{d:"M7 8.2c1-.9 2 .9 3 0s2 .9 3 0 2 .9 3 0 2 .9 3 0 2 .9 3 0",fill:"none",stroke:"#fff",strokeWidth:"1.1",strokeLinecap:"round"}),(0,r.jsx)("path",{d:"M8 12.6h13.4M21.4 12.6l1.6-.9M9.6 11.6v2",stroke:"#fff",strokeWidth:"1",strokeLinecap:"round"})]})};function u(e){let{id:a}=e;return(0,r.jsx)("svg",{className:"flag",viewBox:"0 0 30 20","aria-hidden":"true",focusable:"false",children:p[a]})}var m=t(5462);function x(){let{locale:e,setLocale:a}=(0,d.Ym)(),{t}=(0,d.kj)(),s=(0,m.f)("below");return(0,r.jsxs)("span",{className:"lang-menu",children:[(0,r.jsxs)("button",{ref:s.anchor,type:"button",className:"lang-btn","aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.id:void 0,onClick:s.toggle,title:t("lang.menu"),children:[(0,r.jsxs)("svg",{className:"lang-globe",viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"8",cy:"8",r:"6.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),(0,r.jsx)("path",{d:"M1.5 8h13M8 1.5c2 2 2.8 4 2.8 6.5S10 12.5 8 14.5M8 1.5C6 3.5 5.2 5.5 5.2 8S6 12.5 8 14.5",fill:"none",stroke:"currentColor",strokeWidth:"1.1"})]}),(0,r.jsx)("span",{lang:"en",children:t("lang.label")}),(0,r.jsx)("span",{"aria-hidden":"true",children:"▾"})]}),s.open&&(0,r.jsx)("div",{ref:s.panel,id:s.id,role:"menu","aria-label":t("lang.menu"),className:"pop menu lang-list",style:s.style,children:h.Yj.map(t=>(0,r.jsxs)("button",{type:"button",role:"menuitemradio","aria-checked":t.code===e,onClick:()=>{a(t.code),s.close()},children:[(0,r.jsx)(u,{id:t.flag}),(0,r.jsx)("span",{className:"lang-native",lang:t.code,dir:t.dir,children:t.native}),"en"!==t.code&&(0,r.jsx)("span",{className:"lang-english muted small",lang:"en",children:t.english}),(0,r.jsx)("span",{className:"lang-tick","aria-hidden":"true",children:t.code===e?"✓":""})]},t.code))})]})}var f=t(98078);let j=[{value:"system",label:"theme.system"},{value:"light",label:"theme.light"},{value:"dark",label:"theme.dark"}],v={smallest:"ap.sizeSmallest",verysmall:"ap.sizeVerySmall",compact:"ap.sizeCompact",small:"ap.sizeSmall",normal:"ap.sizeNormal",large:"ap.sizeLarge",huge:"ap.sizeHuge",giant:"ap.sizeGiant"},g=[{name:"nightLight",label:"ap.night"},{name:"underlineLinks",label:"ap.links"},{name:"reduceMotion",label:"ap.motion"},{name:"highContrast",label:"ap.contrast"},{name:"strongFocus",label:"ap.focus"},{name:"systemCursor",label:"ap.systemCursor"}];function k(){let{t:e}=(0,d.kj)(),{appearance:a,set:t,reset:s,loaded:l}=(0,f.KP)(),n=(0,m.f)("below"),i=f.Xm.indexOf(a.textSize);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{ref:n.anchor,type:"button",className:"lang-btn ap-btn".concat(n.open?" on":""),"aria-label":e("wb.appearance"),title:e("wb.appearance"),"aria-expanded":n.open,"aria-controls":n.open?n.id:void 0,onClick:n.toggle,children:[(0,r.jsxs)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.8","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"8.5"}),(0,r.jsx)("path",{d:"M12 3.5a8.5 8.5 0 0 1 0 17z",fill:"currentColor",stroke:"none"})]}),(0,r.jsx)("span",{"aria-hidden":"true",children:e("nav.appearance")})]}),n.open&&(0,r.jsxs)("div",{ref:n.panel,id:n.id,role:"dialog","aria-label":e("wb.appearance"),className:"pop wb-appear",style:n.style,children:[(0,r.jsx)("p",{className:"pop-title",children:e("wb.appearance")}),(0,r.jsx)("p",{className:"wb-appear-label",id:"".concat(n.id,"-theme"),children:e("ap.theme")}),(0,r.jsx)("div",{className:"segmented",role:"group","aria-labelledby":"".concat(n.id,"-theme"),children:j.map(s=>(0,r.jsx)("button",{type:"button","aria-pressed":l&&a.theme===s.value,onClick:()=>t({theme:s.value}),children:e(s.label)},s.value))}),(0,r.jsx)("p",{className:"wb-appear-label",id:"".concat(n.id,"-size"),children:e("ap.size")}),(0,r.jsxs)("div",{className:"wb-appear-size",role:"group","aria-labelledby":"".concat(n.id,"-size"),children:[(0,r.jsx)("button",{type:"button","aria-label":e("ap.smaller"),title:e("ap.smaller"),disabled:i<=0,onClick:()=>t({textSize:f.Xm[i-1]}),children:"A−"}),(0,r.jsx)("span",{"aria-live":"polite",children:e(v[a.textSize])}),(0,r.jsx)("button",{type:"button","aria-label":e("ap.larger"),title:e("ap.larger"),disabled:i>=f.Xm.length-1,onClick:()=>t({textSize:f.Xm[i+1]}),children:"A+"})]}),g.map(s=>(0,r.jsxs)("label",{className:"wb-appear-aid",children:[(0,r.jsx)("input",{type:"checkbox",checked:a[s.name],onChange:e=>t({[s.name]:e.target.checked})}),(0,r.jsx)("span",{children:e(s.label)})]},s.name)),(0,r.jsx)("div",{className:"row",children:(0,r.jsx)("button",{type:"button",className:"quiet small",onClick:s,children:e("ap.reset")})})]})]})}let w={workbench:(0,r.jsx)("path",{d:"M4 5h16v11H9l-5 4zM8 9h8M8 12h5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),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"}),system:(0,r.jsx)("path",{d:"M4 5h16v10H4zM2 19h20M9 15v4M15 15v4",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),queue:(0,r.jsx)("path",{d:"M4 6h16M4 12h16M4 18h10M17 16l3 2-3 2z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round",strokeLinecap:"round"})},b=[{href:"/",label:"nav.workbench",icon:"workbench"},{href:"/queue",label:"nav.queue",icon:"queue"},{href:"/settings",label:"nav.defaults",icon:"defaults"},{href:"/system",label:"nav.system",icon:"system"}];function y(){return(0,r.jsxs)("span",{className:"nav-pair",children:[(0,r.jsx)(k,{}),(0,r.jsx)(x,{})]})}function N(){let{t:e}=(0,d.kj)();return(0,r.jsx)("a",{className:"skip-link",href:"#main",children:e("a11y.skip")})}function M(){let{t:e}=(0,d.kj)(),a=(0,i.usePathname)(),t=function(){let[e,a]=(0,s.useState)(0);return(0,c.z)(()=>o.FH.activity().then(e=>a(e.sessions)).catch(()=>void 0),4e3),e}();return(0,r.jsxs)("nav",{"aria-label":e("nav.label"),children:[b.flatMap(s=>[(0,r.jsxs)(n(),{href:s.href,"aria-current":a===s.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:w[s.icon]}),(0,r.jsx)("span",{children:e(s.label)}),"/"===s.href&&t>0&&(0,r.jsxs)("span",{className:"live",title:e("nav.liveTitle",{n:t}),children:[(0,r.jsx)("span",{className:"dot","aria-hidden":"true"}),e("nav.live")]})]},s.href)]),(0,r.jsx)(y,{})]})}},36657:(e,a,t)=>{t.d(a,{M:()=>g,U:()=>j});var r=t(73365),s=t(1521),l=t(18197),n=t.n(l),i=t(1702),o=t(15549),c=t(8205),d=t(51035),h=t(87527),p=t(33389),u=t(61238),m=t(52157),x=t(79717),f=t(92842);function j(){let{t:e}=(0,c.kj)(),a=(0,i.usePathname)(),[t,l]=(0,s.useState)([]),[n,d]=(0,s.useState)({}),p=(0,s.useRef)({}),x=(0,s.useRef)(new Set),f=(0,s.useRef)(""),j=(0,s.useRef)(new Set),g=(0,s.useCallback)(async()=>{try{let e=await o.FH.approvals();l(e.filter(e=>!j.current.has(e.id)));let a=[...new Set(e.map(e=>e.sessionId).filter(e=>!(e in p.current)))],t=a.sort().join(",");if(a.length>0&&t!==f.current){for(let e of(f.current=t,await o.FH.sessions().catch(()=>[])))p.current[e.id]=e.name,"chat"===e.kind&&x.current.add(e.id);d({...p.current})}}catch(e){}},[]);(0,h.z)(g,2e3);let k=(0,u.v)(),[w,b]=(0,s.useState)(0),y=(0,s.useRef)(0);(0,s.useEffect)(()=>{let e=setInterval(()=>{"visible"===document.visibilityState&&document.hasFocus()&&(y.current=Date.now()),b(e=>e+1)},450);return()=>clearInterval(e)},[]);let N=(null==k?void 0:k.last)?Date.parse(k.last.at):0,M=(0,m.WT)(t.length,k,w%3+1,!!(null==k?void 0:k.last)&&y.current-N<12e3);(0,s.useEffect)(()=>{document.title=M},[M]);let C="/"===a?t.filter(e=>e.sessionId in p.current&&(!x.current.has(e.sessionId)||!!e.model)):t;return 0===C.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")}),C.map(e=>{var a;return(0,r.jsx)(v,{approval:e,sessionName:null!=(a=n[e.sessionId])?a:e.sessionId,onDecided:a=>{var t;return t=e.id,void(a&&(j.current.add(t),l(e=>e.filter(e=>e.id!==t))),g())}},e.id)})]})}function v(e){let{approval:a,sessionName:t,onDecided:s}=e,{t:l}=(0,c.kj)(),i=(0,c.W3)(),{err:h,choose:u,mark:m}=(0,p.p)(),x=async e=>{("run-all"!==e||await (0,d.Z)(l("approval.runAllConfirm")))&&s(await u(e,async()=>{await o.FH.decide(a.id,e)}))};if(a.plan)return(0,r.jsx)(g,{approval:a,sessionName:t,onDecided:s});if(a.model){var j;let e=a.model;return(0,r.jsxs)("div",{className:"approval",children:[(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("strong",{children:l(e.manual?"approval.manualTitle":"approval.modelTitle")}),a.actor&&(0,r.jsx)(f.y,{actor:a.actor,how:"asks"}),(0,r.jsx)(n(),{href:"/",children:t}),(0,r.jsx)("span",{className:"muted small",children:i(a.createdAt)})]}),e.review&&(0,r.jsxs)("div",{className:"approval-review",role:"note",children:[(0,r.jsx)("strong",{children:l("approval.reviewModelTitle")}),(0,r.jsx)("span",{children:l("approval.reviewModelWhy")})]}),e.role&&(0,r.jsxs)("div",{className:"approval-review",role:"note",children:[(0,r.jsx)("strong",{children:l("lead"===e.role?"approval.leadModelTitle":"approval.workerModelTitle")}),(0,r.jsx)("span",{children:l("lead"===e.role?"approval.leadModelWhy":"approval.workerModelWhy")})]}),(0,r.jsx)("p",{children:e.manual?e.asked?l("approval.manualAsk",{model:e.asked}):l("approval.manualAskAny"):l("approval.modelAsk",{model:e.asked})}),(0,r.jsx)("p",{className:"muted small",children:l("approval.modelShown",{shown:null!=(j=e.shown)?j:"—"})}),!e.manual&&(0,r.jsx)("p",{className:"reason small",children:l("approval.modelWhy",{why:e.why,tries:e.tries})}),h&&(0,r.jsx)("p",{className:"err",role:"alert",children:h}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("button",{className:"primary",...m("run"),onClick:()=>void x("run"),children:l(e.manual?"approval.manualReady":"approval.modelChosen")}),!e.manual&&(0,r.jsx)("button",{...m("skip"),onClick:()=>void x("skip"),children:l("approval.modelAsItIs")}),(0,r.jsx)("button",{className:"danger",...m("abort"),onClick:()=>void x("abort"),children:l("approval.modelStop")})]})]})}return(0,r.jsxs)("div",{className:"approval",children:[(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("strong",{children:l("approval.title",{n:a.stepId})}),a.actor&&(0,r.jsx)(f.y,{actor:a.actor,how:"asks"}),(0,r.jsx)(n(),{href:"/",children:t}),(0,r.jsx)("span",{className:"muted small",children:i(a.createdAt)})]}),(0,r.jsx)("pre",{style:{margin:"8px 0"},children:a.description}),a.platform&&(0,r.jsx)("p",{className:"reason small",children:l("approval.platform",{platform:a.platform})}),a.readOnly&&(0,r.jsx)("p",{className:"reason small",children:l("approval.readOnly")}),a.network&&(0,r.jsx)("p",{className:"reason small",children:l("approval.network")}),h&&(0,r.jsx)("p",{className:"err",role:"alert",children:h}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("button",{className:"primary",...m("run"),onClick:()=>void x("run"),children:l("approval.run")}),!a.network&&!a.platform&&(0,r.jsx)("button",{...m("run-all"),onClick:()=>void x("run-all"),title:l("approval.runAllWhy"),children:l("approval.runAll")}),(0,r.jsx)("button",{...m("skip"),onClick:()=>void x("skip"),children:l("approval.skip")}),(0,r.jsx)("button",{className:"danger",...m("abort"),onClick:()=>void x("abort"),children:l("approval.abort")})]})]})}function g(e){let{approval:a,sessionName:t,onDecided:l}=e,{t:i}=(0,c.kj)(),h=(0,c.W3)(),[u,m]=(0,s.useState)(""),{locked:j,err:v,setErr:g,choose:k,mark:w}=(0,p.p)(),b=a.plan,y=async e=>{if("revise"===e&&!u.trim())return void g(i("pm.reviseNeedsNote"));("stop"!==e||await (0,d.Z)(i("pm.stopConfirm")))&&l(await k(e,async()=>{await o.FH.decidePlan(a.id,e,u)}))};return(0,r.jsxs)("div",{className:"approval",children:[(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("strong",{children:i("pm.cardTitle",{title:b.title})}),a.actor&&(0,r.jsx)(f.y,{actor:a.actor,how:"asks"}),void 0!==t&&(0,r.jsx)(n(),{href:"/",children:t}),(0,r.jsx)("span",{className:"muted small",children:h(a.createdAt)})]}),(0,r.jsx)("p",{className:"small",children:i("pm.cardWhy")}),(0,r.jsx)(x.D,{plan:b.plan,showApproval:!1}),(0,r.jsx)("label",{htmlFor:"plan-note-".concat(a.id),children:i("pm.note")}),(0,r.jsx)("textarea",{id:"plan-note-".concat(a.id),className:"prose",value:u,onChange:e=>m(e.target.value),placeholder:i("pm.notePlaceholder"),style:{minHeight:70},disabled:j}),v&&(0,r.jsx)("p",{className:"err",role:"alert",children:v}),(0,r.jsxs)("div",{className:"row",children:[(0,r.jsx)("button",{className:"primary",...w("approve"),onClick:()=>void y("approve"),children:i("pm.approve")}),(0,r.jsx)("button",{...w("revise"),onClick:()=>void y("revise"),title:i("pm.reviseWhy"),children:i("pm.revise")}),(0,r.jsx)("button",{className:"danger",...w("stop"),onClick:()=>void y("stop"),children:i("pm.stop")})]})]})}},61238:(e,a,t)=>{t.d(a,{v:()=>c});var r=t(1521),s=t(15549);t(52157);let l=null,n=null,i=new Set;async function o(){try{l=await s.FH.activity()}catch(e){return}for(let e of i)e(l)}function c(){let[e,a]=(0,r.useState)(l);return(0,r.useEffect)(()=>(i.add(a),n?a(l):(o(),n=setInterval(()=>void o(),2e3)),()=>{i.delete(a),0===i.size&&n&&(clearInterval(n),n=null)}),[]),e}},83285:(e,a,t)=>{t.d(a,{g:()=>i});var r=t(73365),s=t(1521);let l="translate(104 14) scale(0.74) rotate(42 50 50)",n={ellipse:{cx:96,cy:64,rx:86,ry:36,rotate:-25,width:6.5},under:{d:"M70 104 C112 124 166 112 186 86 C194 74 192 60 184 52",width:6},trace:{d:"M22 28 C18 42 22 56 34 70",width:2.4}};function i(e){let{className:a="brand-logo"}=e,t="cop-logo-".concat((0,s.useId)().replace(/[^a-zA-Z0-9-]/g,"")),i=n.ellipse;return(0,r.jsxs)("svg",{className:a,viewBox:"0 0 200 120","aria-hidden":"true",focusable:"false",children:[(0,r.jsx)("defs",{children:(0,r.jsxs)("mask",{id:t,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"200",height:"120",children:[(0,r.jsx)("rect",{width:"200",height:"120",fill:"#fff"}),(0,r.jsx)("path",{d:"M50 3L94 60L94 62.6L69.5 89.6L30.5 89.6L6 62.6L6 60Z",transform:l,fill:"#000",stroke:"#000",strokeWidth:18,strokeLinejoin:"round"})]})}),(0,r.jsxs)("g",{mask:"url(#".concat(t,")"),fill:"none",stroke:"var(--logo-orbit)",strokeLinecap:"round",children:[(0,r.jsx)("ellipse",{cx:i.cx,cy:i.cy,rx:i.rx,ry:i.ry,transform:"rotate(".concat(i.rotate," ").concat(i.cx," ").concat(i.cy,")"),strokeWidth:i.width}),(0,r.jsx)("path",{d:n.under.d,strokeWidth:n.under.width}),(0,r.jsx)("path",{d:n.trace.d,strokeWidth:n.trace.width})]}),(0,r.jsx)("path",{className:"brand-plane",d:"M50 3C54.6 3 56.6 8.2 56.6 14.5L56.6 35.5L91.5 55.8C93.2 56.8 94 58.2 94 60L94 62.6L56.6 52.8L55.4 74.5L69.5 84.6L69.5 89.6L52.6 85.6L50 89.8L47.4 85.6L30.5 89.6L30.5 84.6L44.6 74.5L43.4 52.8L6 62.6L6 60C6 58.2 6.8 56.8 8.5 55.8L43.4 35.5L43.4 14.5C43.4 8.2 45.4 3 50 3Z",transform:l,fill:"var(--logo-plane)"})]})}},92842:(e,a,t)=>{t.d(a,{y:()=>n});var r=t(73365),s=t(52157),l=t(8205);function n(e){let{actor:a,acting:t,how:n="name"}=e,{t:i}=(0,l.kj)(),o=(0,s.Gy)(i,a,t),c="asks"===n?i("actor.asks",{who:o}):"now"===n?i("actor.now",{who:o}):o;return(0,r.jsxs)("span",{className:"actor-chip actor-".concat(a),"data-actor":a,title:i(s.Xi[a]),children:[(0,r.jsx)("span",{className:"actor-dot","aria-hidden":"true"}),c]})}},98078:(e,a,t)=>{t.d(a,{AppearanceProvider:()=>d,Xm:()=>n,KP:()=>h});var r=t(73365),s=t(1521);let l="cop.appearance",n=["smallest","verysmall","compact","small","normal","large","huge","giant"];"(function(){try{\nvar d=document.documentElement,raw=localStorage.getItem('".concat(l,"'),a=raw?JSON.parse(raw):{};\nif(!a||typeof a!=='object')a={};\nd.dataset.theme=a.theme==='dark'||a.theme==='light'?a.theme:window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';\nd.dataset.textsize=").concat(JSON.stringify(n),".indexOf(a.textSize)>=0?a.textSize:'normal';\nd.dataset.contrast=a.highContrast?'high':'normal';\nd.dataset.motion=a.reduceMotion?'reduced':'normal';\nd.dataset.links=a.underlineLinks?'underline':'plain';\nd.dataset.focus=a.strongFocus?'strong':'normal';\nd.dataset.night=a.nightLight?'on':'off';\nd.dataset.cursor=a.systemCursor?'system':'own';\nvar l=(localStorage.getItem('cop.locale')||'').toLowerCase();\nif(").concat(JSON.stringify(["ar"]),".indexOf(l)>=0){d.dir='rtl';d.lang=l;}\n}catch(e){}})();");let i={theme:"system",textSize:"normal",highContrast:!1,reduceMotion:!1,underlineLinks:!1,strongFocus:!1,nightLight:!1,systemCursor:!1};function o(e){let a=document.documentElement;a.dataset.theme="system"===e.theme?!function(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch(e){return!1}}()?"light":"dark":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",a.dataset.night=e.nightLight?"on":"off",a.dataset.cursor=e.systemCursor?"system":"own"}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,p]=(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||"light"===a.theme||"system"===a.theme?a.theme:i.theme,textSize:n.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),nightLight:t(a.nightLight,i.nightLight),systemCursor:t(a.systemCursor,i.systemCursor)}}(JSON.parse(a))),window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!a&&(e={...e,reduceMotion:!0})}catch(e){}d(e),o(e),p(!0)},[]),(0,s.useEffect)(()=>{let e;if("system"!==t.theme)return;try{e=window.matchMedia("(prefers-color-scheme: dark)")}catch(e){return}let a=()=>o(t);return e.addEventListener("change",a),()=>e.removeEventListener("change",a)},[t]);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})},[]),m=(0,s.useCallback)(()=>{d(i),o(i);try{window.localStorage.removeItem(l)}catch(e){}},[]);return(0,r.jsx)(c.Provider,{value:{appearance:t,set:u,reset:m,loaded:h},children:a})}function h(){return(0,s.useContext)(c)}}}]);