copilot-operator 0.1.62 → 0.1.64
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.
- package/dist/src/api/operator.controller.js +36 -3
- package/dist/src/api/operator.service.js +142 -14
- package/dist/src/config/schema.js +10 -0
- package/dist/src/orchestrator/leadRunner.js +268 -30
- package/dist/src/orchestrator/subtaskRetry.js +152 -0
- package/dist/src/orchestrator/taskRunner.js +8 -0
- package/dist/src/plan/kerrigan.js +31 -4
- package/dist/src/plan/systemGuide.js +185 -2
- package/dist/src/queue/queue.js +8 -2
- package/dist/src/session/store.js +4 -0
- package/dist/web/404.html +2 -2
- package/dist/web/_next/static/chunks/1077.32bfff8490ea3d67.js +1 -0
- package/dist/web/_next/static/chunks/1548.2bbbbb4759fd5073.js +1 -0
- package/dist/web/_next/static/chunks/2163.147b0ca65a65d5dd.js +1 -0
- package/dist/web/_next/static/chunks/714.16070ca6426f260c.js +1 -0
- package/dist/web/_next/static/chunks/7220.f71047baa16e6be0.js +1 -0
- package/dist/web/_next/static/chunks/7921-90ed63bfdf7162f3.js +1 -0
- package/dist/web/_next/static/chunks/8584.abc09920f03375b1.js +1 -0
- package/dist/web/_next/static/chunks/9067.538dec4d8ec0b04e.js +1 -0
- package/dist/web/_next/static/chunks/9747.9d15583d6ebafba3.js +1 -0
- package/dist/web/_next/static/chunks/app/page-185efe80d6e8dd05.js +1 -0
- package/dist/web/_next/static/chunks/app/queue/page-d4155eb6ab172c03.js +1 -0
- package/dist/web/_next/static/chunks/app/settings/page-9a83381087178f80.js +1 -0
- package/dist/web/_next/static/chunks/{webpack-4665fed2f4b06052.js → webpack-d85f02ecd2903252.js} +1 -1
- package/dist/web/_next/static/css/{5ec15fce93be8cbe.css → d107848da2f006af.css} +1 -1
- package/dist/web/defaults.html +2 -2
- package/dist/web/defaults.txt +8 -8
- package/dist/web/index.html +3 -3
- package/dist/web/index.txt +9 -9
- package/dist/web/queue.html +2 -2
- package/dist/web/queue.txt +9 -9
- package/dist/web/settings.html +2 -2
- package/dist/web/settings.txt +9 -9
- package/dist/web/system.html +2 -2
- package/dist/web/system.txt +9 -9
- package/package.json +3 -2
- package/dist/web/_next/static/chunks/1077.42a0502bfe3f2014.js +0 -1
- package/dist/web/_next/static/chunks/1548.dbf0648a1239382e.js +0 -1
- package/dist/web/_next/static/chunks/2163.dbdeebeb0c069d62.js +0 -1
- package/dist/web/_next/static/chunks/714.6472121643f99452.js +0 -1
- package/dist/web/_next/static/chunks/7220.391debd1191fc29a.js +0 -1
- package/dist/web/_next/static/chunks/7921-0549a0038e591e42.js +0 -1
- package/dist/web/_next/static/chunks/8584.4432f14f0cd88188.js +0 -1
- package/dist/web/_next/static/chunks/9067.841d6d2f4726f9c2.js +0 -1
- package/dist/web/_next/static/chunks/9747.1a7337320eccdc8a.js +0 -1
- package/dist/web/_next/static/chunks/app/page-ea0a60db75dac546.js +0 -1
- package/dist/web/_next/static/chunks/app/queue/page-f86936d39121ade8.js +0 -1
- package/dist/web/_next/static/chunks/app/settings/page-1833ace66fc9eb0e.js +0 -1
- /package/dist/web/_next/static/{PJs9xZLAnUDPOFvGV0T_M → vU04zVwJyicqgtWQsApuV}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{PJs9xZLAnUDPOFvGV0T_M → vU04zVwJyicqgtWQsApuV}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4662],{5462:(e,l,t)=>{"use strict";t.d(l,{f:()=>s,q:()=>i});var a=t(73365),n=t(1521);function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"below",[l,t]=(0,n.useState)(!1),a=(0,n.useRef)(null),s=(0,n.useRef)(null),i=(0,n.useId)(),[r,o]=(0,n.useState)({visibility:"hidden"}),c=(0,n.useCallback)(()=>t(!1),[]),d=(0,n.useCallback)(()=>t(e=>!e),[]);return(0,n.useLayoutEffect)(()=>{var t;let n,i;if(!l)return void o({visibility:"hidden"});let r=null==(t=a.current)?void 0:t.getBoundingClientRect(),c=s.current;if(!r||!c)return;let d=c.offsetWidth,u=c.offsetHeight;"right"===e?(n=r.right+6,i=Math.min(r.top,window.innerHeight-u-8)):(n=Math.min(r.left,window.innerWidth-d-8),i=r.bottom+6+u>window.innerHeight-8?r.top-6-u:r.bottom+6),o({left:Math.max(8,n),top:Math.max(8,i)})},[l,e]),(0,n.useEffect)(()=>{if(!l)return;let e=e=>{var l,n;let i=e.target;(null==(l=s.current)?void 0:l.contains(i))||(null==(n=a.current)?void 0:n.contains(i))||t(!1)},n=e=>{var l;"Escape"===e.key&&(t(!1),null==(l=a.current)||l.focus())},i=()=>t(!1);return document.addEventListener("pointerdown",e,!0),document.addEventListener("keydown",n),window.addEventListener("resize",i),()=>{document.removeEventListener("pointerdown",e,!0),document.removeEventListener("keydown",n),window.removeEventListener("resize",i)}},[l]),{open:l,setOpen:t,toggle:d,close:c,anchor:a,panel:s,style:r,id:i}}function i(e){let{label:l,text:t}=e,n=s("below");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{ref:n.anchor,type:"button",className:"info-btn","aria-label":l,title:l,"aria-expanded":n.open,"aria-controls":n.open?n.id:void 0,onClick:n.toggle,children:"i"}),n.open&&(0,a.jsxs)("div",{ref:n.panel,id:n.id,role:"dialog","aria-label":l,className:"pop info-pop",style:n.style,children:[(0,a.jsx)("p",{className:"pop-title",children:l}),t.split(/\n\s*\n/).map((e,l)=>{let t=l>0?/^([^::.。\n]{2,90}?)\s?(?::\s|:)/.exec(e):null;return(0,a.jsx)("p",{children:t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("strong",{children:t[1]}),e.slice(t[1].length)]}):e},e)})]})]})}},11272:(e,l,t)=>{"use strict";t.d(l,{O:()=>n});var a=t(73365);function n(){return(0,a.jsxs)("svg",{className:"branch-ico",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[(0,a.jsx)("path",{d:"M4.5 3.5v9M4.5 10c0-3 7-2.5 7-5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:"4.5",cy:"3",r:"1.7",fill:"currentColor"}),(0,a.jsx)("circle",{cx:"4.5",cy:"13",r:"1.7",fill:"currentColor"}),(0,a.jsx)("circle",{cx:"11.5",cy:"4.2",r:"1.7",fill:"currentColor"})]})}},24784:(e,l,t)=>{"use strict";t.d(l,{Yb:()=>o,u:()=>r});var a=t(73365),n=t(1521),s=t(15549),i=t(8205);let r="::by-hand::";function o(e){var l,t,o;let{id:c,chosen:d,onChange:u,none:m,byHand:h,catalogue:p,disabled:x=!1,style:v}=e,{t:f}=(0,i.kj)(),j=function(e){let[l,t]=(0,n.useState)(null);return(0,n.useEffect)(()=>{if(void 0!==e)return;let l=!0;return s.FH.models().then(e=>{l&&t(e)}).catch(()=>void 0),()=>{l=!1}},[e]),void 0!==e?e:l}(p),g=null!=(l=null==j?void 0:j.options)?l:[],b=e=>e.toLowerCase().replace(/[-‐‑‒–—_]+/g," ").replace(/\s+/g," ").trim(),y=d&&d!==r?g.find(e=>b(e.name)===b(d)):void 0,k=null!=(t=null==y?void 0:y.name)?t:d,w=!!y||d===r&&void 0!==h,N=g.filter(e=>!e.group),S=new Map;for(let e of g)e.group&&S.set(e.group,[...null!=(o=S.get(e.group))?o:[],e]);return(0,a.jsxs)("select",{id:c,value:k,onChange:e=>u(e.target.value),disabled:x,style:{width:"auto",minWidth:280,...v},children:[void 0!==h&&(0,a.jsx)("option",{value:r,children:h}),void 0!==m&&(0,a.jsx)("option",{value:"",children:m}),d&&!w&&(0,a.jsx)("option",{value:d,children:f("model.notInList",{name:d})}),N.map(e=>(0,a.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(f("model.unavailable")):""]},e.name)),[...S.entries()].map(e=>{let[l,t]=e;return(0,a.jsx)("optgroup",{label:l,children:t.map(e=>(0,a.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(f("model.unavailable")):""]},e.name))},l)})]})}},51035:(e,l,t)=>{"use strict";t.d(l,{DialogHost:()=>d,Z:()=>c});var a=t(73365),n=t(1521),s=t(8205),i=t(94969);let r=null,o=[];function c(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(t=>{var a;return a={kind:"confirm",message:e,...l,resolve:t},void(r?r(a):o.push(a))})}function d(e){var l,t;let{children:c}=e,{t:d}=(0,s.kj)(),[u,m]=(0,n.useState)([]),h=(0,n.useRef)(null),p=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(r=e=>m(l=>[...l,e]),o.length>0){let e=o.splice(0,o.length);m(l=>[...l,...e])}return()=>{r=null}},[]);let x=u[0],v=(0,n.useCallback)(e=>{x&&(x.resolve(e),m(e=>e.slice(1)))},[x]);return(0,i.V)(p,!!x,h),(0,n.useEffect)(()=>{if(!x)return;let e=e=>{"Escape"===e.key&&(e.preventDefault(),v(!1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[x,v]),(0,a.jsxs)(a.Fragment,{children:[c,x&&(0,a.jsx)("div",{className:"modal-backdrop",onClick:()=>v(!1),role:"presentation",children:(0,a.jsxs)("div",{ref:p,className:"modal".concat(x.danger?" danger":""),role:"confirm"===x.kind?"alertdialog":"dialog","aria-modal":"true","aria-labelledby":"modal-title","aria-describedby":"modal-body",onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("h2",{id:"modal-title",children:null!=(l=x.title)?l:d("confirm"===x.kind?"dialog.confirmTitle":"dialog.noticeTitle")}),(0,a.jsx)("div",{id:"modal-body",className:"modal-body",children:x.message}),(0,a.jsxs)("div",{className:"row modal-actions",children:["confirm"===x.kind&&(0,a.jsx)("button",{type:"button",className:"quiet",onClick:()=>v(!1),children:d("dialog.cancel")}),(0,a.jsx)("button",{ref:h,type:"button",className:x.danger?"danger":"primary",onClick:()=>v(!0),children:null!=(t=x.okLabel)?t:d("dialog.ok")})]})]})})]})}},65323:(e,l,t)=>{Promise.resolve().then(t.bind(t,91082))},91082:(e,l,t)=>{"use strict";t.r(l),t.d(l,{default:()=>f});var a=t(73365),n=t(1521),s=t(15549);let i="{$model_name}",r="{$provider_name}",o=["button","rows","model","provider","providerModel"],c={button:null,rows:null,model:i,provider:r,providerModel:i};function d(e){return e.includes("'")?e.includes('"')?"concat('".concat(e.split("'").join("', \"'\", '"),"')"):'"'.concat(e,'"'):"'".concat(e,"'")}function u(e,l){let t=e,a=(e,l)=>{void 0!==l&&(t=t.split("'".concat(e,"'")).join(l.includes("'")?d(l):"'".concat(l,"'")).split('"'.concat(e,'"')).join(l.includes('"')?d(l):'"'.concat(l,'"')).split(e).join(l))};return a(i,l.model),a(r,l.provider),t}var m=t(8205),h=t(51035),p=t(24784),x=t(5462),v=t(11272);function f(){let{t:e}=(0,m.kj)();(0,n.useEffect)(()=>{let e,l=0,t=()=>{let t=decodeURIComponent(window.location.hash.slice(1));if(!t)return;let a=Date.now()+5e3;cancelAnimationFrame(l);let n=()=>{let s=document.getElementById(t);if(!s){Date.now()<a&&(l=requestAnimationFrame(n));return}let i="reduced"===document.documentElement.dataset.motion||window.matchMedia("(prefers-reduced-motion: reduce)").matches;s.scrollIntoView({block:"start",behavior:i?"auto":"smooth"}),s.hasAttribute("tabindex")||s.setAttribute("tabindex","-1"),s.focus({preventScroll:!0}),s.classList.remove("spotlight"),s.offsetWidth,s.classList.add("spotlight"),clearTimeout(e),e=setTimeout(()=>s.classList.remove("spotlight"),4200)};n()};return t(),window.addEventListener("hashchange",t),()=>{window.removeEventListener("hashchange",t),cancelAnimationFrame(l),clearTimeout(e)}},[]);let[l,t]=(0,n.useState)(null),[i,r]=(0,n.useState)(!1),[o,c]=(0,n.useState)("");(0,n.useEffect)(()=>{s.FH.models().then(t).catch(()=>void 0)},[]);let d=async()=>{if(await (0,h.Z)(e("model.refreshConfirm"))){r(!0),c(e("model.refreshing"));try{var l;let a=await s.FH.models().then(()=>s.FH.refreshModels());t(a),c(0===a.options.length?null!=(l=a.note)?l:e("model.none"):e("model.refreshed",{n:a.options.length}))}catch(e){c(e.message)}finally{r(!1)}}},u={catalogue:l,setCatalogue:t,refreshModels:d,refreshing:i,refreshMsg:o};return(0,a.jsxs)("div",{className:"settings",children:[(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsx)("h2",{children:e("def.title")}),(0,a.jsx)("p",{className:"muted small",children:e("def.intro")}),(0,a.jsx)("p",{className:"why",children:e("def.autoSave")})]}),(0,a.jsx)(D,{}),(0,a.jsx)(L,{}),(0,a.jsx)(F,{}),(0,a.jsx)(W,{}),(0,a.jsx)(T,{role:"worker",...u}),(0,a.jsx)(T,{role:"lead",...u}),(0,a.jsx)(T,{role:"review",...u}),(0,a.jsx)(q,{catalogue:l}),(0,a.jsx)(P,{})]})}function j(e){let{htmlFor:l,label:t,info:n,as:s="label"}=e,{t:i}=(0,m.kj)();return(0,a.jsxs)("div",{className:"field-label",children:["label"===s?(0,a.jsx)("label",{htmlFor:l,children:t}):(0,a.jsx)("span",{className:"field-name",children:t}),(0,a.jsx)(x.q,{label:i("info.about",{name:t}),text:n})]})}function g(e){let{id:l,label:t,info:n,unit:s,children:i}=e;return(0,a.jsxs)("div",{className:"settings-field",children:[(0,a.jsx)(j,{htmlFor:l,label:t,info:n}),(0,a.jsxs)("div",{className:"field-control",children:[i,s&&(0,a.jsx)("span",{className:"unit",children:s})]})]})}function b(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:900,t=(0,n.useRef)(null),a=(0,n.useRef)(null),s=(0,n.useRef)(e);return s.current=e,(0,n.useEffect)(()=>()=>{t.current&&clearTimeout(t.current),a.current&&s.current(a.current.value)},[]),e=>{t.current&&clearTimeout(t.current),a.current={value:e},t.current=setTimeout(()=>{a.current=null,s.current(e)},l)}}function y(e){let{id:l,value:t,min:s,max:i,onChange:r,disabled:o}=e,[c,d]=(0,n.useState)(String(t));return(0,n.useEffect)(()=>d(e=>k(e)===t?e:String(t)),[t]),(0,a.jsx)("input",{id:l,type:"number",className:"number",min:s,max:i,step:1,value:c,onChange:e=>{d(e.target.value);let l=k(e.target.value);null!==l&&l>=s&&l<=i&&r(l)},onBlur:()=>{let e=k(c),l=null===e?t:Math.max(s,Math.min(i,e));d(String(l)),l!==t&&r(l)},disabled:o})}function k(e){if(""===e.trim())return null;let l=Number(e);return Number.isInteger(l)?l:null}let w=(0,n.createContext)(e=>e);function N(){let[e,l]=(0,n.useState)(0),t=(0,n.useRef)(!0);return(0,n.useEffect)(()=>(t.current=!0,()=>{t.current=!1}),[]),{saving:e>0,track:(0,n.useCallback)(async e=>{let a=Date.now();l(e=>e+1);try{return await e}finally{setTimeout(()=>{t.current&&l(e=>Math.max(0,e-1))},Math.max(0,1600-(Date.now()-a)))}},[])}}function S(){let[e,l]=(0,n.useState)(1);return(0,n.useEffect)(()=>{let e=setInterval(()=>l(e=>e%3+1),380);return()=>clearInterval(e)},[]),(0,a.jsx)("span",{className:"saving-dots","aria-hidden":"true",children:".".repeat(e)})}function C(e){let{msg:l,saving:t}=e,{t:n}=(0,m.kj)();return t?(0,a.jsx)("div",{className:"row saved-note",children:(0,a.jsxs)("span",{className:"saving small",role:"status",children:[n("def.saving"),(0,a.jsx)(S,{})]})}):l?(0,a.jsx)("div",{className:"row saved-note",children:(0,a.jsx)("span",{className:"muted small",role:"status",children:l})}):null}let M={name:"",description:"",text:"",projectDir:""};function F(){let{t:e}=(0,m.kj)(),{saving:l,track:t}=N(),[i,r]=(0,n.useState)(null),[o,c]=(0,n.useState)({maxText:8e3,maxDescription:300}),[d,u]=(0,n.useState)([]),[p,x]=(0,n.useState)(""),[v,f]=(0,n.useState)(""),[j,g]=(0,n.useState)(!1),[b,y]=(0,n.useState)(M);(0,n.useEffect)(()=>{s.FH.skills().then(e=>{r(e.skills),c({maxText:e.maxText,maxDescription:e.maxDescription})}).catch(e=>f(e.message)),s.FH.project().then(e=>u([...e.rootDir?[{name:e.name||e.rootDir,dir:e.rootDir}]:[],...e.others.map(e=>({name:e.name,dir:e.rootDir}))])).catch(()=>void 0)},[]);let k=async l=>{g(!0),f("");try{let a=await t(s.FH.setSkills(l));return r(a.skills),x(e("skills.saved",{n:a.skills.length})),!0}catch(e){return f(e.message),!1}finally{g(!1)}},w=null!=i?i:[],S=async()=>{await k([...w,{...b,name:b.name.trim().toLowerCase()}])&&y(M)},F=async l=>{await (0,h.Z)(e("skills.removeConfirm",{name:w[l].name}),{okLabel:e("skills.remove"),danger:!0})&&await k(w.filter((e,t)=>t!==l))};return(0,a.jsxs)("section",{className:"panel",id:"skills","aria-labelledby":"skills-title",children:[(0,a.jsx)("h2",{id:"skills-title",children:e("skills.title")}),(0,a.jsx)("p",{className:"muted small",children:e("skills.intro")}),v&&(0,a.jsx)("div",{className:"err",children:v}),i&&0===i.length&&(0,a.jsx)("p",{className:"muted small",children:e("skills.none")}),w.map((e,l)=>(0,a.jsx)(E,{skill:e,projects:d,limits:o,onChange:e=>k(w.map((t,a)=>a===l?e:t)),onRemove:()=>void F(l),busy:j},"skill-".concat(l))),(0,a.jsx)(C,{msg:p,saving:l}),(0,a.jsx)("h3",{id:"skills-add",children:e("skills.addTitle")}),(0,a.jsx)(E,{skill:b,projects:d,limits:o,onDraft:y,busy:j}),(0,a.jsx)("div",{className:"row",children:(0,a.jsx)("button",{className:"primary",onClick:()=>void S(),disabled:j||!b.name.trim()||!b.text.trim(),children:e("skills.add")})})]})}function R(){return(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M2.5 4h11M6 4V2.5h4V4M3.8 4l.7 9.5h7l.7-9.5M6.6 6.6v4.8M9.4 6.6v4.8"})})}function E(e){let{skill:l,projects:t,limits:s,onChange:i,onDraft:r,onRemove:o,busy:c}=e,{t:d}=(0,m.kj)(),u=(0,n.useId)(),[h,p]=(0,n.useState)(l),x=(0,n.useRef)(!1);(0,n.useEffect)(()=>{x.current||p(l)},[l]);let v=e=>{let l={...h,...e};return p(l),null==r||r(l),l},f=b(async e=>{x.current=!1,i&&e.text!==l.text&&await i(e)},1200),g=()=>{i&&(h.name!==l.name||h.description!==l.description)&&i(h)};return(0,a.jsxs)("div",{className:"panel inner skill-entry".concat(i?"":" skill-new"),children:[o&&(0,a.jsxs)("div",{className:"skill-head",children:[(0,a.jsxs)("span",{className:"skill-title",children:["/",h.name]}),(0,a.jsxs)("button",{type:"button",className:"danger skill-delete",onClick:o,disabled:c,"aria-label":d("skills.removeOne",{name:h.name}),title:d("skills.removeOne",{name:h.name}),children:[(0,a.jsx)(R,{}),d("skills.remove")]})]}),(0,a.jsxs)("div",{className:"project-fields",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{htmlFor:"".concat(u,"-name"),label:d("skills.name"),info:d("skills.nameInfo")}),(0,a.jsxs)("div",{className:"input-with-buttons skill-name-box",children:[(0,a.jsx)("span",{className:"skill-slash","aria-hidden":"true",children:"/"}),(0,a.jsx)("input",{id:"".concat(u,"-name"),type:"text",value:h.name,onChange:e=>v({name:e.target.value}),onBlur:g,placeholder:"new-test",spellCheck:!1})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{htmlFor:"".concat(u,"-description"),label:d("skills.description"),info:d("skills.descriptionInfo")}),(0,a.jsx)("input",{id:"".concat(u,"-description"),type:"text",value:h.description,maxLength:s.maxDescription,onChange:e=>v({description:e.target.value}),onBlur:g})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{htmlFor:"".concat(u,"-project"),label:d("skills.project"),info:d("skills.projectInfo")}),(0,a.jsx)("div",{className:"input-with-buttons",children:(0,a.jsxs)("select",{id:"".concat(u,"-project"),value:h.projectDir,onChange:e=>{let l=v({projectDir:e.target.value});i&&i(l)},children:[(0,a.jsx)("option",{value:"",children:d("skills.allProjects")}),t.map(e=>(0,a.jsx)("option",{value:e.dir,children:e.name},e.dir))]})})]})]}),(0,a.jsxs)("div",{className:"project-level2",children:[(0,a.jsx)(j,{htmlFor:"".concat(u,"-text"),label:d("skills.text"),info:d("skills.textInfo",{n:s.maxText.toLocaleString()})}),(0,a.jsx)("textarea",{id:"".concat(u,"-text"),className:"prose",rows:5,maxLength:s.maxText,value:h.text,onChange:e=>{let l=v({text:e.target.value});i&&(x.current=!0,f(l))},placeholder:d("skills.textPlaceholder")}),(0,a.jsx)("span",{className:"muted small",children:d("skills.count",{n:h.text.length.toLocaleString(),max:s.maxText.toLocaleString()})})]})]})}function D(){let{t:e}=(0,m.kj)(),[l,t]=(0,n.useState)(null),[i,r]=(0,n.useState)("");return(0,n.useEffect)(()=>{s.FH.level1().then(e=>t(e.content)).catch(l=>r(e("l1.failed",{reason:l.message})))},[]),(0,a.jsxs)("section",{className:"panel",id:"level1","aria-labelledby":"level1-title",children:[(0,a.jsxs)("div",{className:"row section-title",children:[(0,a.jsx)("h2",{id:"level1-title",children:e("l1.title")}),(0,a.jsx)("span",{className:"badge",children:e("l1.readOnly")})]}),(0,a.jsx)("div",{className:"callout",role:"note",children:e("l1.what")}),i&&(0,a.jsx)("div",{className:"err",children:i}),(0,a.jsxs)("details",{className:"l1-text",children:[(0,a.jsx)("summary",{children:e("l1.show")}),(0,a.jsx)("pre",{className:"l1-pre",children:null!=l?l:"…"})]})]})}function L(){var e,l;let{t}=(0,m.kj)(),{saving:i,track:r}=N(),[o,c]=(0,n.useState)(null),[d,u]=(0,n.useState)(""),[h,p]=(0,n.useState)(""),[x,v]=(0,n.useState)(""),[f,g]=(0,n.useState)(""),[y,k]=(0,n.useState)(!1),[w,S]=(0,n.useState)(""),[M,F]=(0,n.useState)(""),R=(0,n.useCallback)(async()=>{try{let e=await s.FH.project();c(e),u(e.rootDir),p(e.name),g("")}catch(e){g(e.message)}},[]);(0,n.useEffect)(()=>{R()},[R]);let E=async(e,l)=>{k(!0),v("");try{let t=await r(s.FH.setProject(e));return c(t),u(t.rootDir),v(l(t)),g(""),!0}catch(e){return g(e.message),!1}finally{k(!1)}},D=e=>E({rootDir:e},e=>e.rootDir?t("proj.saved",{dir:e.rootDir}):t("proj.cleared")),L=e=>E({name:e},()=>t("proj.nameSaved")),W=b(D),O=b(L),T=async(e,l)=>{k(!0);try{var t;let a=await s.FH.browseFolder(l.trim()||void 0);a.ok?e(a.path):a.cancelled||g(null!=(t=a.reason)?t:"")}catch(e){g(e.message)}finally{k(!1)}},H=null!=(e=null==o?void 0:o.others)?e:[],A=e=>e.map(e=>({name:e.name,rootDir:e.rootDir,level2:e.level2,readOnly:e.readOnly})),q=(e,l,t)=>E({others:A(H.map(t=>t.name===e.name?{...t,...l}:t))},t),B=async()=>{await E({others:[...A(H),{name:w.trim(),rootDir:M.trim(),level2:"",readOnly:!1}]},e=>t("proj.othersSaved",{n:e.others.length}))&&(S(""),F(""))};return(0,a.jsxs)("section",{className:"panel",id:"project","aria-labelledby":"project-title",children:[(0,a.jsx)("h2",{id:"project-title",children:t("proj.title")}),(0,a.jsx)("p",{className:"muted small",children:t("proj.intro")}),f&&(0,a.jsx)("div",{className:"err",children:f}),(0,a.jsx)(I,{name:h,dir:d,repoOk:!!(null==o?void 0:o.repoOk),repoProblem:null==o?void 0:o.repoProblem,branch:null==o?void 0:o.branch,level2:null!=(l=null==o?void 0:o.level2)?l:"",readOnly:(null==o?void 0:o.readOnly)===!0,onReadOnly:e=>E({readOnly:e},()=>t(e?"proj.readOnlyOn":"proj.readOnlyOff",{name:h||d})),isDefault:!0,busy:y,onNameInput:e=>{p(e),O(e)},onName:e=>void L(e),onDirInput:e=>{u(e),W(e)},onDir:e=>void D(e),onBrowse:()=>void T(e=>void D(e),d),onLevel2:e=>E({level2:e},()=>t("proj.level2Saved",{name:h||d})),onRemove:(null==o?void 0:o.rootDir)?()=>void D(""):void 0,removeLabel:t("proj.clear")}),o&&!o.rootDir&&(0,a.jsx)("p",{className:"muted small",children:t("proj.none")}),H.map((e,l)=>(0,a.jsx)(I,{name:e.name,dir:e.rootDir,repoOk:e.repoOk,repoProblem:e.repoProblem,branch:e.branch,level2:e.level2,readOnly:!0===e.readOnly,onReadOnly:l=>q(e,{readOnly:l},()=>t(l?"proj.readOnlyOn":"proj.readOnlyOff",{name:e.name})),busy:y,onName:l=>void q(e,{name:l},()=>t("proj.nameSaved")),onDir:l=>void q(e,{rootDir:l},()=>t("proj.othersSaved",{n:H.length})),onBrowse:()=>void T(l=>void q(e,{rootDir:l},()=>t("proj.othersSaved",{n:H.length})),e.rootDir),onLevel2:l=>q(e,{level2:l},()=>t("proj.level2Saved",{name:e.name})),onRemove:()=>{let l;l=e.name,E({others:A(H.filter(e=>e.name!==l))},e=>t("proj.othersSaved",{n:e.others.length}))},removeLabel:t("proj.otherRemove")},"other-".concat(l))),(0,a.jsx)(C,{msg:x,saving:i}),(0,a.jsx)("h3",{id:"others",children:t("proj.addTitle")}),(0,a.jsx)("p",{className:"muted small",children:t("proj.othersIntro")}),(0,a.jsxs)("div",{className:"project-fields add-project",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{htmlFor:"new-project-name",label:t("proj.entryName"),info:t("proj.nameInfo")}),(0,a.jsx)("input",{id:"new-project-name",type:"text",value:w,onChange:e=>S(e.target.value),placeholder:t("proj.entryName"),disabled:y})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{htmlFor:"new-project-dir",label:t("proj.entryDir"),info:t("proj.dirInfo")}),(0,a.jsxs)("div",{className:"input-with-buttons",children:[(0,a.jsx)("input",{id:"new-project-dir",type:"text",value:M,onChange:e=>F(e.target.value),placeholder:"C:\\Projects\\my-app-tests",disabled:y}),(0,a.jsx)("button",{onClick:()=>void T(e=>F(e),M),disabled:y,children:t("mirror.browse")}),(0,a.jsx)("button",{className:"primary",onClick:()=>void B(),disabled:y||!w.trim()||!M.trim(),children:t("proj.otherAdd")})]})]})]})]})}function I(e){var l;let{name:t,dir:s,repoOk:i,repoProblem:r,branch:o,level2:c,readOnly:d,onReadOnly:u,isDefault:h=!1,busy:p,onNameInput:f,onName:g,onDirInput:y,onDir:k,onBrowse:w,onLevel2:N,onRemove:S,removeLabel:C}=e,{t:M}=(0,m.kj)(),F=(0,n.useId)(),[R,E]=(0,n.useState)(t),[D,L]=(0,n.useState)(s),[I,W]=(0,n.useState)(c),O=(0,n.useRef)(!1),[T,H]=(0,n.useState)(d);(0,n.useEffect)(()=>H(d),[d]),(0,n.useEffect)(()=>E(t),[t]),(0,n.useEffect)(()=>L(s),[s]),(0,n.useEffect)(()=>{O.current||W(c)},[c]);let A=b(async e=>{O.current=!1,e!==c&&await N(e)},1200);return(0,a.jsxs)("div",{className:"panel inner project-entry",children:[(0,a.jsxs)("div",{className:"row project-tags",children:[h&&(0,a.jsx)("span",{className:"chip",title:M("proj.isDefaultWhy"),children:M("proj.isDefault")}),T&&(0,a.jsx)("span",{className:"badge reference",title:M("proj.readOnlyInfo"),children:M("proj.readOnlyBadge")}),s&&(0,a.jsx)("span",{className:"badge ".concat(i?"done":""),title:i?M("proj.isRepo"):r,children:M(i?"proj.otherRepo":"proj.otherNotRepo")}),s&&i&&o&&(0,a.jsxs)("span",{className:"branch-tag",children:[(0,a.jsxs)("span",{className:"badge branch",children:[(0,a.jsx)(v.O,{})," ","HEAD"===o?M("proj.detached"):M("proj.branch",{name:o})]}),(0,a.jsx)(x.q,{label:M("info.about",{name:M("proj.branch",{name:o})}),text:M("proj.branchInfo")})]})]}),s&&!i&&(0,a.jsx)("p",{className:"muted small",children:r||M("proj.notRepoWhy")}),(0,a.jsxs)("div",{className:"field-label check-label project-readonly",children:[(0,a.jsx)("input",{id:"".concat(F,"-readonly"),type:"checkbox",checked:T,onChange:e=>{let l=e.target.checked;H(l),u(l).then(e=>{!1===e&&H(!l)})}}),(0,a.jsx)("label",{htmlFor:"".concat(F,"-readonly"),children:M("proj.readOnly")}),(0,a.jsx)(x.q,{label:M("info.about",{name:M("proj.readOnly")}),text:M("proj.readOnlyInfo")})]}),(0,a.jsxs)("div",{className:"project-fields",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{htmlFor:"".concat(F,"-name"),label:M("proj.entryName"),info:M("proj.nameInfo")}),(0,a.jsx)("input",{id:"".concat(F,"-name"),type:"text",value:R,onChange:e=>{E(e.target.value),null==f||f(e.target.value)},onBlur:()=>{(R!==t||f)&&g(R)},placeholder:s?null!=(l=s.replace(/[\\/]+$/,"").split(/[\\/]/).pop())?l:"":M("proj.namePlaceholder")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{htmlFor:"".concat(F,"-dir"),label:M("proj.entryDir"),info:M("proj.dirInfo")}),(0,a.jsxs)("div",{className:"input-with-buttons",children:[(0,a.jsx)("input",{id:"".concat(F,"-dir"),type:"text",value:D,onChange:e=>{L(e.target.value),null==y||y(e.target.value)},onBlur:()=>{(D!==s||y)&&k(D)},placeholder:"C:\\Projects\\my-app"}),(0,a.jsx)("button",{onClick:w,disabled:p,children:M("mirror.browse")}),S&&(0,a.jsx)("button",{className:"quiet",onClick:S,disabled:p,children:C})]})]})]}),(0,a.jsxs)("div",{className:"project-level2",children:[(0,a.jsx)(j,{htmlFor:"".concat(F,"-level2"),label:M("proj.level2"),info:M("proj.level2Info",{n:8e3.toLocaleString()})}),(0,a.jsx)("textarea",{id:"".concat(F,"-level2"),className:"prose",rows:4,maxLength:8e3,value:I,onChange:e=>{O.current=!0,W(e.target.value),A(e.target.value)},placeholder:M("proj.level2Placeholder")}),(0,a.jsx)("span",{className:"muted small",children:M("proj.level2Count",{n:I.length.toLocaleString(),max:8e3.toLocaleString()})})]})]})}function W(){let{t:e}=(0,m.kj)(),[l,t]=(0,n.useState)(""),[i,r]=(0,n.useState)(!1),[o,c]=(0,n.useState)(""),[d,u]=(0,n.useState)(""),h=async()=>{r(!0),u(""),c(e("login.waiting"));try{let e=await s.FH.login(l);e.ok?c(e.message):(c(""),u(e.message))}catch(e){c(""),u(e.message)}finally{r(!1)}};return(0,a.jsxs)("section",{className:"panel",id:"login","aria-labelledby":"login-title",children:[(0,a.jsx)("h2",{id:"login-title",children:e("login.title")}),(0,a.jsx)("p",{className:"muted small",children:e("login.intro")}),d&&(0,a.jsx)("div",{className:"err",children:d}),(0,a.jsxs)(g,{id:"login-account",label:e("login.account"),info:e("login.accountWhy"),children:[(0,a.jsx)("input",{id:"login-account",type:"email",value:l,onChange:e=>t(e.target.value),placeholder:"name@company.com",disabled:i}),(0,a.jsx)("button",{className:"primary",onClick:()=>void h(),disabled:i,children:i?e("login.busy"):e("login.button")})]}),o&&(0,a.jsx)("div",{className:"small",role:"status",children:o})]})}let O={worker:{section:"model",pick:"default-model",manualId:"manual-model",manualKey:"manualModel",field:"defaultModel",title:"def.modelTitle",intro:"def.modelIntro",info:"def.modelInfo",manualWhy:"def.manualModelWhy",saved:"def.modelSaved",cleared:"def.modelCleared",save:async e=>(await s.FH.setDefaultModel(e)).defaultModel},lead:{section:"lead-model",pick:"default-lead-model",manualId:"manual-lead-model",manualKey:"leadManualModel",field:"defaultLeadModel",title:"def.leadTitle",intro:"def.leadIntro",info:"def.leadInfo",manualWhy:"def.leadManualWhy",saved:"def.leadSaved",cleared:"def.leadCleared",save:async e=>(await s.FH.setDefaultLeadModel(e)).defaultLeadModel},review:{section:"review",pick:"default-review-model",manualId:"manual-review-model",manualKey:"reviewManualModel",field:"defaultReviewModel",title:"def.reviewTitle",intro:"def.reviewIntro",info:"def.reviewInfo",manualWhy:"def.reviewManualWhy",saved:"def.reviewSaved",cleared:"def.reviewCleared",save:async e=>(await s.FH.setDefaultReviewModel(e)).defaultReviewModel}};function T(e){var l,t;let{role:s,catalogue:i,setCatalogue:r,refreshModels:o,refreshing:c,refreshMsg:d}=e,{t:u}=(0,m.kj)(),h=(0,m.W3)(),x=O[s],{saving:v,track:f}=N(),[j,b]=(0,n.useState)(""),[y,k]=(0,n.useState)(""),[S,M]=(0,n.useState)(!1),F=null!=(l=null==i?void 0:i[x.field])?l:"",R=async e=>{M(!0),b("");try{let l=await f(x.save(e));i&&r({...i,[x.field]:l}),b(l?u(x.saved,{name:l}):u(x.cleared)),k("")}catch(e){k(e.message)}finally{M(!1)}},E="review"===s&&""!==F&&F===(null!=(t=null==i?void 0:i.defaultModel)?t:"");return(0,a.jsx)(w.Provider,{value:f,children:(0,a.jsxs)("section",{className:"panel",id:x.section,"aria-labelledby":"".concat(x.section,"-title"),children:[(0,a.jsx)("h2",{id:"".concat(x.section,"-title"),children:u(x.title)}),(0,a.jsx)("p",{className:"muted small",children:u(x.intro)}),y&&(0,a.jsx)("div",{className:"err",children:y}),(0,a.jsxs)(g,{id:x.pick,label:u("def.modelField"),info:u(x.info),children:[(0,a.jsx)(p.Yb,{id:x.pick,chosen:F,onChange:e=>void R(e),none:u("def.modelNone"),catalogue:i,disabled:S||c}),(0,a.jsx)("button",{className:"quiet",onClick:()=>void R(""),disabled:S||!F,children:u("proj.clear")}),(0,a.jsx)("button",{onClick:()=>void o(),disabled:S||c,children:u("model.refresh")})]}),(0,a.jsx)("p",{className:"muted small field-after",children:(null==i?void 0:i.readAt)?u("model.readAt",{t:h(i.readAt),n:i.options.length}):u("model.neverRead")}),E&&(0,a.jsx)("p",{className:"why field-after warned-text",children:u("def.reviewSame")}),(0,a.jsx)(H,{id:x.manualId,setting:x.manualKey,why:x.manualWhy}),(0,a.jsx)(C,{msg:j||d,saving:v})]})})}function H(e){let{id:l,setting:t,why:i}=e,{t:r}=(0,m.kj)(),o=(0,n.useContext)(w),[c,d]=(0,n.useState)(null),[u,h]=(0,n.useState)("");(0,n.useEffect)(()=>{s.FH.settings().then(e=>{var l,a,n;let s=null!=(n=e.raw.copilot)?n:{},i=(null==(a=e.defaults)||null==(l=a.copilot)?void 0:l.manualModel)!==!1,r="boolean"==typeof s.manualModel?s.manualModel:i,o=s[t];d("boolean"==typeof o?o:r)}).catch(e=>h(e.message))},[t]);let p=async e=>{d(e);try{await o(s.FH.settings().then(l=>{var a;return s.FH.saveSettings({...l.raw,copilot:{...null!=(a=l.raw.copilot)?a:{},[t]:e}})})),h("")}catch(e){h(e.message)}};return(0,a.jsxs)("div",{className:"settings-field",children:[(0,a.jsxs)("div",{className:"field-label check-label",children:[(0,a.jsx)("input",{id:l,type:"checkbox",checked:!0===c,disabled:null===c,onChange:e=>void p(e.target.checked)}),(0,a.jsx)("label",{htmlFor:l,children:r("def.manualModel")}),(0,a.jsx)(x.q,{label:r("info.about",{name:r("def.manualModel")}),text:r(i)})]}),u&&(0,a.jsx)("div",{className:"err",children:u})]})}let A=[{key:"button",label:"loc.button",why:"loc.buttonWhy"},{key:"rows",label:"loc.rows",why:"loc.rowsWhy"},{key:"model",label:"loc.model",why:"loc.modelWhy"},{key:"provider",label:"loc.provider",why:"loc.providerWhy"},{key:"providerModel",label:"loc.providerModel",why:"loc.providerModelWhy"}];function q(e){var l,t,i,r;let{catalogue:c}=e,{t:d}=(0,m.kj)(),{saving:u,track:h}=N(),[p,v]=(0,n.useState)(null),[f,j]=(0,n.useState)(null),[g,b]=(0,n.useState)(null),[y,k]=(0,n.useState)(!1),[S,M]=(0,n.useState)(""),[F,R]=(0,n.useState)(""),E=(0,n.useRef)(Promise.resolve());(0,n.useEffect)(()=>{s.FH.settings().then(e=>{var l,t,a,n,s,i;let r=null!=(a=e.raw.copilot)?a:{},c=null!=(n=r.pickerLocators)?n:{};v(Object.fromEntries(o.map(e=>{var l;return[e,null!=(l=c[e])?l:""]}))),j(null!=(s=null==(l=e.picker)?void 0:l.defaults)?s:null),b(null!=(i=null==(t=e.picker)?void 0:t.dirs)?i:null),k(!0===r.pickerSteps)}).catch(e=>R(e.message))},[]);let D=e=>{let l=async()=>{try{var l;let t=(await s.FH.settings()).raw;M(""),await h(s.FH.saveSettings({...t,copilot:e({...null!=(l=t.copilot)?l:{}})})),M(d("loc.saved")),R("")}catch(e){R(e.message)}},t=E.current.then(l,l);return E.current=t.catch(()=>void 0),t},L=null!=(t=null==c||null==(l=c.options.find(e=>!e.group))?void 0:l.name)?t:"Think deeper",I=null==c?void 0:c.options.find(e=>e.group),W=null!=(i=null==I?void 0:I.group)?i:"Claude",O=null!=(r=null==I?void 0:I.name)?r:"Opus 5.5";return(0,a.jsx)(w.Provider,{value:h,children:(0,a.jsxs)("section",{className:"panel",id:"picker-locators","aria-labelledby":"picker-locators-title",children:[(0,a.jsx)("h2",{id:"picker-locators-title",children:d("loc.title")}),(0,a.jsx)("p",{className:"muted small",children:d("loc.intro")}),(0,a.jsxs)("details",{className:"picker-how",children:[(0,a.jsx)("summary",{children:d("loc.howTitle")}),(0,a.jsxs)("ol",{className:"small",children:[(0,a.jsx)("li",{children:d("loc.how1")}),(0,a.jsx)("li",{children:d("loc.how2")}),(0,a.jsx)("li",{children:d("loc.how3")}),(0,a.jsx)("li",{children:d("loc.how4")})]})]}),F&&(0,a.jsx)("div",{className:"err",children:F}),p&&f?A.map(e=>{let l;return(0,a.jsx)(B,{field:e.key,label:d(e.label),why:d(e.why),initial:p[e.key],fallback:f[e.key],example:"model"===(l=e.key)?{name:L,names:{model:L}}:"provider"===l?{name:W,names:{provider:W}}:"providerModel"===l?{name:O,names:{model:O,provider:W}}:null,onSave:l=>{let t;return t=e.key,D(e=>{var a;let n={...null!=(a=e.pickerLocators)?a:{}};l.trim()?n[t]=l.trim():delete n[t];let s={...e,pickerLocators:n};return 0===Object.keys(n).length&&delete s.pickerLocators,s})}},e.key)}):!F&&(0,a.jsx)("p",{className:"muted small",children:d("loc.loading")}),(0,a.jsx)("div",{className:"settings-field",children:(0,a.jsxs)("div",{className:"field-label check-label",children:[(0,a.jsx)("input",{id:"picker-steps",type:"checkbox",checked:y,disabled:!p,onChange:e=>{let l=e.target.checked;k(l),D(e=>({...e,pickerSteps:l}))}}),(0,a.jsx)("label",{htmlFor:"picker-steps",children:d("loc.steps")}),(0,a.jsx)(x.q,{label:d("info.about",{name:d("loc.steps")}),text:d("loc.stepsWhy")})]})}),g&&(0,a.jsx)("p",{className:"muted small field-after picker-dirs",children:d("loc.stepsWhere",{run:g.run,read:g.read})}),(0,a.jsx)(C,{msg:S,saving:u})]})})}function B(e){let{field:l,label:t,why:s,initial:i,fallback:r,example:o,onSave:d}=e,{t:h}=(0,m.kj)(),[p,x]=(0,n.useState)(i),[v,f]=(0,n.useState)(null),g=b(e=>d(e)),y="picker-".concat(l),k=v?"placeholder"===v.kind?h("loc.noPlaceholder",{ph:v.placeholder}):"colons"===v.kind?h("loc.twoColons",{axis:v.axis}):"xpath"===v.kind?h("loc.badXPath",{msg:v.message}):h("loc.badCss",{msg:v.message}):"",w=p.trim()||r;return(0,a.jsxs)("div",{className:"settings-field picker-field",children:[(0,a.jsx)(j,{htmlFor:y,label:t,info:s}),(0,a.jsxs)("div",{className:"field-control",children:[(0,a.jsx)("input",{id:y,type:"text",className:"picker-locator",spellCheck:!1,autoComplete:"off",value:p,placeholder:r,"aria-invalid":!!v||void 0,onChange:e=>(e=>{x(e);let t=function(e,l,t){var a;let n=l.trim();if(""===n)return null;let s=c[e];if(s&&!n.includes(s))return{kind:"placeholder",placeholder:s};let i=n.startsWith("xpath=")||!n.startsWith("css=")&&/^\s*(\/|\(|\.\.?\/)/.test(n),r=/(^|[/[(|\s])(ancestor-or-self|ancestor|attribute|child|descendant-or-self|descendant|following-sibling|following|parent|preceding-sibling|preceding|self):(?!:)/.exec(n);if(r&&i)return{kind:"colons",axis:r[2]};if(!t)return null;let o=u(n.replace(/^(xpath|css)=/,""),{model:"Think deeper",provider:"Claude"});try{i?t.evaluate(o,t,null,XPathResult.ANY_TYPE,null):t.querySelector(o)}catch(l){let e=(null!=(a=l.message)?a:String(l)).replace(/^Failed to execute '\w+' on 'Document': /,"");return i?{kind:"xpath",message:e}:{kind:"css",message:e}}return null}(l,e,document);f(t),t||g(e)})(e.target.value)}),(0,a.jsx)("button",{className:"quiet",disabled:!p,onClick:()=>{x(""),f(null),d("")},children:h("loc.default")})]}),v?(0,a.jsx)("div",{className:"err field-after",role:"alert",children:k}):(0,a.jsxs)("p",{className:"muted small field-after picker-note",children:[!p.trim()&&(0,a.jsxs)("span",{children:[h("loc.isDefault")," "]}),o&&(0,a.jsxs)(a.Fragment,{children:[h("loc.example",{name:o.name})," ",(0,a.jsx)("code",{className:"picker-example",children:u(w,o.names)})]})]})]})}function P(){let{t:e}=(0,m.kj)(),{saving:l,track:t}=N(),[i,r]=(0,n.useState)(null),o=(0,n.useRef)(null),c=(0,n.useRef)(Promise.resolve()),[d,u]=(0,n.useState)(2),[p,v]=(0,n.useState)(3),[f,j]=(0,n.useState)(2),[k,w]=(0,n.useState)(2),[S,M]=(0,n.useState)(60),[F,R]=(0,n.useState)(240),[E,D]=(0,n.useState)(20),[L,I]=(0,n.useState)(900),[W,O]=(0,n.useState)(12e4),[T,H]=(0,n.useState)(!1),[A,q]=(0,n.useState)(60),[B,P]=(0,n.useState)(!1),[U,_]=(0,n.useState)(90),[K,V]=(0,n.useState)("none"),[Z,Y]=(0,n.useState)("confirm"),[$,z]=(0,n.useState)("ask"),[X,G]=(0,n.useState)("ask"),[J,Q]=(0,n.useState)(""),[ee,el]=(0,n.useState)("");(0,n.useEffect)(()=>{s.FH.settings().then(e=>{var l,t,a,n,s,i,c,d;o.current=e.raw,r(e.raw);let m=null!=(l=e.raw.limits)?l:{};v("number"==typeof m.autoContinue?m.autoContinue:3),u("number"==typeof m.retryBlockedInFreshChat?m.retryBlockedInFreshChat:2),j("number"==typeof m.minApproachesBeforeBlocked?m.minApproachesBeforeBlocked:2),w("number"==typeof m.maxReviewRounds?m.maxReviewRounds:2),M("number"==typeof m.maxIterations?m.maxIterations:60),R("number"==typeof m.maxRunMinutes?m.maxRunMinutes:240),D("number"==typeof m.maxSubtasks?m.maxSubtasks:20),O("number"==typeof m.maxMessageChars?m.maxMessageChars:12e4);let h=null!=(t=e.raw.pacing)?t:{};H(!0===h.gapEnabled),q("number"==typeof h.gapSec?h.gapSec:60),P(!0===h.gapRandom),_("number"==typeof h.gapMaxSec?h.gapMaxSec:90);let p=null!=(a=e.raw.copilot)?a:{};I("number"==typeof p.replyTimeoutSec?p.replyTimeoutSec:900);let x=null!=(n=e.raw.execution)?n:{};V(null!=(s=x.isolation)?s:"none"),Y(null!=(i=x.mode)?i:"confirm"),z(null!=(c=x.networkFetch)?c:"ask"),G(null!=(d=x.questions)?d:"ask")}).catch(e=>el(e.message))},[]);let et=(l,a,n)=>{let i=async()=>{var i;if(!o.current)return;let c=await s.FH.settings().then(e=>e.raw).catch(()=>o.current),d={...c,[l]:{...null!=(i=c[l])?i:{},[a]:n}};Q("");try{await t(s.FH.saveSettings(d)),o.current=d,r(d),Q(e("exec.saved")),el("")}catch(e){el(e.message)}},d=c.current.then(i);return c.current=d.catch(()=>void 0),d},ea=b(e=>et("limits","retryBlockedInFreshChat",e)),en=b(e=>et("limits","autoContinue",e)),es=b(e=>et("limits","minApproachesBeforeBlocked",e)),ei=b(e=>et("limits","maxReviewRounds",e)),er=b(e=>et("limits","maxIterations",e)),eo=b(e=>et("limits","maxRunMinutes",e)),ec=b(e=>et("limits","maxSubtasks",e)),ed=b(e=>et("copilot","replyTimeoutSec",e)),eu=b(e=>et("limits","maxMessageChars",e)),em=b(e=>et("pacing","gapSec",e)),eh=b(e=>et("pacing","gapMaxSec",e)),ep=(e,l)=>et("execution",e,l),ex=[{id:"auto-continue",label:e("exec.autoContinue"),info:e("exec.autoContinueWhy"),unit:e("exec.autoContinueUnit"),value:p,min:0,max:20,set:v,later:en},{id:"min-approaches",label:e("exec.minApproaches"),info:e("exec.minApproachesWhy"),unit:e("exec.minApproachesUnit"),value:f,min:2,max:20,set:j,later:es},{id:"max-review-rounds",label:e("exec.maxReviewRounds"),info:e("exec.maxReviewRoundsWhy"),unit:e("exec.maxReviewRoundsUnit"),value:k,min:1,max:6,set:w,later:ei},{id:"retry-blocked",label:e("exec.retryBlocked"),info:e("exec.retryBlockedWhy"),unit:e("exec.retryBlockedTimes"),value:d,min:0,max:5,set:u,later:ea},{id:"max-iterations",label:e("exec.maxIterations"),info:e("exec.maxIterationsWhy"),unit:e("exec.maxIterationsUnit"),value:S,min:5,max:200,set:M,later:er},{id:"max-minutes",label:e("exec.maxRunMinutes"),info:e("exec.maxRunMinutesWhy"),unit:e("exec.maxRunMinutesUnit"),value:F,min:10,max:1440,set:R,later:eo},{id:"max-subtasks",label:e("exec.maxSubtasks"),info:e("exec.maxSubtasksWhy"),unit:e("exec.maxSubtasksUnit"),value:E,min:1,max:100,set:D,later:ec},{id:"reply-timeout",label:e("exec.replyTimeout"),info:e("exec.replyTimeoutWhy"),unit:e("exec.replyTimeoutUnit"),value:L,min:60,max:10800,set:I,later:ed},{id:"max-message-chars",label:e("exec.maxMessageChars"),info:e("exec.maxMessageCharsWhy"),unit:e("exec.maxMessageCharsUnit"),value:W,min:1e3,max:1e6,set:O,later:eu}];return(0,a.jsxs)("section",{className:"panel",id:"execution","aria-labelledby":"execution-title",children:[(0,a.jsx)("h2",{id:"execution-title",children:e("exec.title")}),(0,a.jsx)("p",{className:"muted small",children:e("exec.intro")}),ee&&(0,a.jsx)("div",{className:"err",children:ee}),ex.map(e=>(0,a.jsx)(g,{id:e.id,label:e.label,info:e.info,unit:e.unit,children:(0,a.jsx)(y,{id:e.id,value:e.value,min:e.min,max:e.max,onChange:l=>{e.set(l),e.later(l)},disabled:!i})},e.id)),(0,a.jsx)("div",{className:"settings-field",children:(0,a.jsxs)("div",{className:"field-label check-label",children:[(0,a.jsx)("input",{id:"gap-on",type:"checkbox",checked:T,disabled:!i,onChange:e=>{H(e.target.checked),et("pacing","gapEnabled",e.target.checked)}}),(0,a.jsx)("label",{htmlFor:"gap-on",children:e("exec.gap")}),(0,a.jsx)(x.q,{label:e("info.about",{name:e("exec.gap")}),text:e("exec.gapWhy")})]})}),T&&(0,a.jsx)(g,{id:"gap-sec",label:e("exec.gapSec"),info:e("exec.gapSecWhy"),unit:e("exec.gapUnit"),children:(0,a.jsx)(y,{id:"gap-sec",value:A,min:1,max:3600,onChange:e=>{q(e),em(e)},disabled:!i})}),T&&(0,a.jsx)("div",{className:"settings-field gap-random",children:(0,a.jsxs)("div",{className:"field-label check-label",children:[(0,a.jsx)("input",{id:"gap-random",type:"checkbox",checked:B,disabled:!i,onChange:e=>{P(e.target.checked),et("pacing","gapRandom",e.target.checked),e.target.checked&&U<A&&(_(A),eh(A))}}),(0,a.jsx)("label",{htmlFor:"gap-random",children:e("exec.gapRandom")}),(0,a.jsx)(x.q,{label:e("info.about",{name:e("exec.gapRandom")}),text:e("exec.gapRandomWhy")})]})}),T&&B&&(0,a.jsx)(g,{id:"gap-max",label:e("exec.gapMax"),info:e("exec.gapMaxWhy"),unit:e("exec.gapUnit"),children:(0,a.jsx)(y,{id:"gap-max",value:U,min:A,max:3600,onChange:e=>{_(e),eh(e)},disabled:!i})}),(0,a.jsx)(g,{id:"isolation",label:e("exec.isolation"),info:e("exec.isolationWhy"),children:(0,a.jsxs)("select",{id:"isolation",value:K,onChange:e=>{let l=e.target.value;V(l),ep("isolation",l)},disabled:!i,children:[(0,a.jsx)("option",{value:"none",children:e("exec.isolationNone")}),(0,a.jsx)("option",{value:"none-accepted",children:e("exec.isolationNoneAccepted")}),(0,a.jsx)("option",{value:"separate-account",children:e("exec.isolationAccount")}),(0,a.jsx)("option",{value:"sandbox",children:e("exec.isolationSandbox")}),(0,a.jsx)("option",{value:"vm",children:e("exec.isolationVm")})]})}),(0,a.jsx)(g,{id:"start-mode",label:e("exec.startMode"),info:e("exec.startModeWhy"),children:(0,a.jsxs)("select",{id:"start-mode",value:Z,onChange:async l=>{let t=l.target.value;("unattended"!==t||await (0,h.Z)(e("exec.modeAutoConfirm")))&&(Y(t),ep("mode",t))},disabled:!i,children:[(0,a.jsx)("option",{value:"confirm",children:e("exec.startModeAsk")}),(0,a.jsx)("option",{value:"unattended",children:e("exec.startModeAuto")})]})}),(0,a.jsx)(g,{id:"network-fetch",label:e("exec.networkFetch"),info:e("exec.networkFetchWhy"),children:(0,a.jsxs)("select",{id:"network-fetch",value:$,onChange:e=>{let l=e.target.value;z(l),ep("networkFetch",l)},disabled:!i,children:[(0,a.jsx)("option",{value:"ask",children:e("exec.networkFetchAsk")}),(0,a.jsx)("option",{value:"refuse",children:e("exec.networkFetchRefuse")}),(0,a.jsx)("option",{value:"run",children:e("exec.networkFetchRun")})]})}),(0,a.jsx)(g,{id:"questions",label:e("exec.questions"),info:e("exec.questionsWhy"),children:(0,a.jsxs)("select",{id:"questions",value:X,onChange:async l=>{let t=l.target.value;("agree"!==t||await (0,h.Z)(e("exec.questionsAgreeConfirm")))&&(G(t),ep("questions",t))},disabled:!i,children:[(0,a.jsx)("option",{value:"ask",children:e("exec.questionsAsk")}),(0,a.jsx)("option",{value:"agree",children:e("exec.questionsAgree")})]})}),(0,a.jsx)(C,{msg:J,saving:l})]})}},94969:(e,l,t)=>{"use strict";t.d(l,{V:()=>s});var a=t(1521);let n='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function s(e,l,t){(0,a.useEffect)(()=>{var a,s;if(!l)return;let i=document.activeElement instanceof HTMLElement?document.activeElement:null,r=e.current,o=null!=(s=null!=(a=null==t?void 0:t.current)?a:null==r?void 0:r.querySelector(n))?s:null;null==o||o.focus();let c=e=>{if("Tab"!==e.key||!r)return;let l=Array.from(r.querySelectorAll(n)).filter(e=>null!==e.offsetParent);if(0===l.length)return;let t=l[0],a=l[l.length-1],s=r.contains(document.activeElement);e.shiftKey&&(document.activeElement===t||!s)?(e.preventDefault(),a.focus()):e.shiftKey||document.activeElement!==a&&s||(e.preventDefault(),t.focus())};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c),i&&document.contains(i)&&i.focus()}},[e,l,t])}}},e=>{e.O(0,[7921,2347,3131,7358],()=>e(e.s=65323)),_N_E=e.O()}]);
|
/package/dist/web/_next/static/{PJs9xZLAnUDPOFvGV0T_M → vU04zVwJyicqgtWQsApuV}/_buildManifest.js
RENAMED
|
File without changes
|
/package/dist/web/_next/static/{PJs9xZLAnUDPOFvGV0T_M → vU04zVwJyicqgtWQsApuV}/_ssgManifest.js
RENAMED
|
File without changes
|