copilot-operator 0.1.11 → 0.1.12
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 +1 -1
- package/dist/src/api/operator.service.js +64 -6
- package/dist/src/config/schema.js +14 -3
- package/dist/src/context/desktopMirror.js +34 -12
- package/dist/src/context/projectMirror.js +69 -1
- package/dist/src/orchestrator/contract.js +56 -1
- package/dist/src/orchestrator/taskRunner.js +116 -11
- package/dist/src/plan/brief.js +20 -8
- package/dist/src/plan/systemGuide.js +42 -10
- package/dist/src/session/compose.js +16 -1
- package/dist/src/session/exportRecord.js +8 -1
- package/dist/src/session/handoff.js +41 -3
- package/dist/src/session/model.js +9 -0
- package/dist/src/session/store.js +11 -7
- package/dist/src/session/story.js +74 -18
- package/dist/src/transport/chatTransport.js +1 -0
- package/dist/src/transport/copilotTransport.js +80 -61
- package/dist/src/vcs/git.js +15 -0
- package/dist/src/vcs/taskVcs.js +29 -6
- package/dist/web/404.html +2 -2
- package/dist/web/_next/static/chunks/36-c3dd06c6a459c114.js +1 -0
- package/dist/web/_next/static/chunks/549-a5a59a94f92bb3eb.js +1 -0
- package/dist/web/_next/static/chunks/867-b64c436f5b25f39e.js +1 -0
- package/dist/web/_next/static/chunks/app/defaults/page-5f180a88398be4c9.js +1 -0
- package/dist/web/_next/static/chunks/app/history/page-854e3dde672e38a2.js +1 -0
- package/dist/web/_next/static/chunks/app/page-13572a726de0b7db.js +1 -0
- package/dist/web/_next/static/chunks/app/sessions/view/{page-d7e1f83d13c6356b.js → page-cc99401da5173b36.js} +1 -1
- package/dist/web/_next/static/css/{2ad2a74b7e07dcc9.css → a0642fdb8adf9edb.css} +1 -1
- package/dist/web/appearance.html +2 -2
- package/dist/web/appearance.txt +12 -12
- package/dist/web/defaults.html +2 -2
- package/dist/web/defaults.txt +12 -12
- package/dist/web/history.html +2 -2
- package/dist/web/history.txt +12 -12
- package/dist/web/import.html +2 -2
- package/dist/web/import.txt +12 -12
- package/dist/web/index.html +2 -2
- package/dist/web/index.txt +12 -12
- package/dist/web/level1.html +2 -2
- package/dist/web/level1.txt +12 -12
- package/dist/web/presets.html +2 -2
- package/dist/web/presets.txt +12 -12
- package/dist/web/sessions/view.html +2 -2
- package/dist/web/sessions/view.txt +12 -12
- package/dist/web/system.html +2 -2
- package/dist/web/system.txt +12 -12
- package/package.json +6 -3
- package/dist/web/_next/static/chunks/36-17a3bcb0c2553c7c.js +0 -1
- package/dist/web/_next/static/chunks/549-8f69ef8086802748.js +0 -1
- package/dist/web/_next/static/chunks/867-f82c74b7b2ed5c54.js +0 -1
- package/dist/web/_next/static/chunks/app/defaults/page-abfa73fb08822e36.js +0 -1
- package/dist/web/_next/static/chunks/app/history/page-a9f2060f86a4a10e.js +0 -1
- package/dist/web/_next/static/chunks/app/page-2ac6b67f4ddcb808.js +0 -1
- /package/dist/web/_next/static/{oyfXbuB_cq0sRZP7ukHlQ → bcBE4tY_aNh6kzLzN1luP}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{oyfXbuB_cq0sRZP7ukHlQ → bcBE4tY_aNh6kzLzN1luP}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[66],{1205:(e,s,n)=>{"use strict";n.d(s,{AppearanceProvider:()=>m,KP:()=>h,themeScript:()=>c});var a=n(3365),l=n(1521);let t=["small","normal","large","huge","giant"],r={theme:"light",textSize:"normal",highContrast:!1,reduceMotion:!1,underlineLinks:!1,strongFocus:!1},i="cop.appearance",c="\n(function () {\n try {\n var d = document.documentElement;\n var raw = localStorage.getItem('".concat(i,"');\n var a = raw ? JSON.parse(raw) : {};\n if (!a || typeof a !== 'object') a = {};\n d.dataset.theme = a.theme === 'dark' ? 'dark' : 'light';\n d.dataset.textsize = ").concat(JSON.stringify(t),".indexOf(a.textSize) >= 0 ? a.textSize : 'normal';\n d.dataset.contrast = a.highContrast ? 'high' : 'normal';\n d.dataset.motion = a.reduceMotion ? 'reduced' : 'normal';\n d.dataset.links = a.underlineLinks ? 'underline' : 'plain';\n d.dataset.focus = a.strongFocus ? 'strong' : 'normal';\n } catch (e) {}\n})();\n");function d(e){let s=document.documentElement;s.dataset.theme=e.theme,s.dataset.textsize=e.textSize,s.dataset.contrast=e.highContrast?"high":"normal",s.dataset.motion=e.reduceMotion?"reduced":"normal",s.dataset.links=e.underlineLinks?"underline":"plain",s.dataset.focus=e.strongFocus?"strong":"normal"}let o=(0,l.createContext)({appearance:r,set:()=>void 0,reset:()=>void 0,loaded:!1});function m(e){let{children:s}=e,[n,c]=(0,l.useState)(r),[m,h]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=r;try{let s=window.localStorage.getItem(i);s?e=function(e){let s=e&&"object"==typeof e?e:{},n=(e,s)=>"boolean"==typeof e?e:s;return{theme:"dark"===s.theme?"dark":"light"===s.theme?"light":r.theme,textSize:t.includes(s.textSize)?s.textSize:r.textSize,highContrast:n(s.highContrast,r.highContrast),reduceMotion:n(s.reduceMotion,r.reduceMotion),underlineLinks:n(s.underlineLinks,r.underlineLinks),strongFocus:n(s.strongFocus,r.strongFocus)}}(JSON.parse(s)):window.matchMedia("(prefers-color-scheme: dark)").matches&&(e={...e,theme:"dark"}),window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!s&&(e={...e,reduceMotion:!0})}catch(e){}c(e),d(e),h(!0)},[]);let u=(0,l.useCallback)(e=>{c(s=>{let n={...s,...e};d(n);try{window.localStorage.setItem(i,JSON.stringify(n))}catch(e){}return n})},[]),p=(0,l.useCallback)(()=>{c(r),d(r);try{window.localStorage.removeItem(i)}catch(e){}},[]);return(0,a.jsx)(o.Provider,{value:{appearance:n,set:u,reset:p,loaded:m},children:s})}function h(){return(0,l.useContext)(o)}},1702:(e,s,n)=>{"use strict";var a=n(9962);n.o(a,"usePathname")&&n.d(s,{usePathname:function(){return a.usePathname}}),n.o(a,"useSearchParams")&&n.d(s,{useSearchParams:function(){return a.useSearchParams}})},1772:(e,s,n)=>{Promise.resolve().then(n.bind(n,4269))},4269:(e,s,n)=>{"use strict";n.r(s),n.d(s,{default:()=>D});var a=n(3365),l=n(1521),t=n(1702),r=n(8197),i=n.n(r),c=n(5549),d=n(867),o=n(1910),m=n(3523),h=n(3374);function u(e){let s=e.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/+$/,"");return""===s?".":s}function p(e){return e.split("\n").map(e=>e.trim()).filter(Boolean)}var v=n(1205),x=n(8848),j=n(4784),g=n(2244),f=n(2876),k=n(5132),y=n(1035),b=n(8934),N=n(4811),w=n(3041),C=n(7527),S=n(1366),F=n(2285);function D(){return(0,a.jsx)(l.Suspense,{fallback:null,children:(0,a.jsx)(H,{})})}function H(){var e;let{t:s}=(0,d.kj)(),n=null!=(e=(0,t.useSearchParams)().get("id"))?e:"",[r,o]=(0,l.useState)(null),[m,h]=(0,l.useState)([]),[u,p]=(0,l.useState)([]),[v,x]=(0,l.useState)(null),[j,g]=(0,l.useState)(""),[f,k]=(0,l.useState)(!1),y=(0,l.useRef)(null),b=(0,l.useRef)(0),N=(0,l.useCallback)(async()=>{if(!n)return;let e=++b.current;try{let s=await c.FH.session(n);if(e!==b.current)return;o(s),g("")}catch(s){if(e!==b.current)return;g(s.message)}},[n]),w=(0,l.useCallback)(()=>{y.current||(y.current=window.setTimeout(()=>{y.current=null,N()},400))},[N]);if((0,l.useEffect)(()=>{if(!n)return;c.FH.presets().then(p).catch(()=>void 0),c.FH.level1().then(x).catch(()=>void 0);let e=new EventSource(c.FH.streamUrl(n));return e.onopen=()=>k(!1),e.onmessage=e=>{let s;try{s=JSON.parse(e.data)}catch(e){return}"ping"!==s.type&&(h(e=>[...e.slice(-400),s]),w())},e.onerror=()=>{e.readyState===EventSource.CLOSED&&k(!0)},()=>{e.close()}},[n,w]),(0,C.z)(N,8e3,!!n),!n)return(0,a.jsx)("div",{className:"panel err",children:s("session.noId")});if(j&&!r)return(0,a.jsx)("div",{className:"panel err",children:j});if(!r)return(0,a.jsx)("div",{className:"panel muted",children:s("home.loading")});let S=r.tasks.filter(e=>"queued"===e.status).length;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"crumbs",children:[(0,a.jsx)(i(),{href:"/",children:s("session.crumb")})," / ",r.name]}),j&&(0,a.jsx)("div",{className:"panel err",role:"alert",children:s("session.stale",{err:j})}),f&&!j&&(0,a.jsx)("div",{className:"panel muted small",role:"status",children:s("session.streamClosed")}),(0,a.jsx)(I,{session:r,queued:S,onChange:N}),(0,a.jsx)(J,{tasks:r.tasks}),(0,a.jsx)(M,{session:r,onChange:N}),(0,a.jsx)(T,{level1:v,sent:r.contractSent}),(0,a.jsx)(L,{session:r,onChange:N}),(0,a.jsx)(P,{session:r,onChange:N}),(0,a.jsx)(R,{session:r,onChange:N}),(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsx)("h2",{children:s("tasks.title")}),(0,a.jsx)("p",{className:"muted small",children:s("tasks.hint")}),(0,a.jsx)(W,{session:r,onChange:N}),0===r.tasks.length&&(0,a.jsx)("div",{className:"muted",children:s("tasks.none")}),r.tasks.map((e,s)=>(0,a.jsx)(G,{session:r,task:e,index:s+1,presets:u,onChange:N},e.id))]}),(0,a.jsx)(A,{session:r}),(0,a.jsx)(U,{session:r,presets:u,onAdded:N,onPresetsChanged:()=>c.FH.presets().then(p)}),(0,a.jsx)(z,{events:m})]})}function I(e){var s;let{session:n,queued:t,onChange:r}=e,{t:i}=(0,d.kj)(),[o,m]=(0,l.useState)(""),[h,u]=(0,l.useState)("");(0,l.useEffect)(()=>{c.FH.models().then(e=>{var s;return u(null!=(s=e.defaultModel)?s:"")}).catch(()=>void 0)},[]);let[p,v]=(0,l.useState)(n.name),[x,j]=(0,l.useState)(null!=(s=n.conversationGroup)?s:"");(0,l.useEffect)(()=>v(n.name),[n.name]),(0,l.useEffect)(()=>{var e;return j(null!=(e=n.conversationGroup)?e:"")},[n.conversationGroup]);let g=(0,N.p)(),[f,k]=(0,l.useState)(!1),b=(0,l.useRef)(!1),w=async e=>{if(!b.current){b.current=!0,k(!0);try{await e()}catch(e){m(e.message)}finally{b.current=!1,k(!1),r()}}},C=async e=>{("unattended"!==e||g||await (0,y.Z)(i("session.unattendedConfirm")))&&await w(async()=>{var s;let a=await c.FH.start(n.id,e,n.planName);m(a.started?i("unattended"===e?"session.startedAuto":"session.startedStep"):i("session.notStarted",{reason:null!=(s=a.reason)?s:""}))})},S=async()=>{if(n.running)return void m(i("home.deleteRunning"));if(await (0,y.Z)(i("home.deleteConfirm",{name:n.name,n:n.tasks.length})))try{await c.FH.deleteSession(n.id),window.location.href="/"}catch(e){m(e.message)}},F=async()=>{var e;if(x.trim()!==(null!=(e=n.conversationGroup)?e:""))try{await c.FH.updateSession(n.id,{conversationGroup:x.trim()}),m(i("session.groupSaved")),r()}catch(e){m(e.message)}},D=n.running?i("state.running"):i("state.".concat(n.status));return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("input",{type:"text",className:"grow","aria-label":i("home.col.name"),value:p,onChange:e=>v(e.target.value),onBlur:()=>void w(async()=>{p.trim()&&p!==n.name&&await c.FH.updateSession(n.id,{name:p})})}),(0,a.jsx)("span",{className:"badge ".concat(n.running?"running":""),children:D})]}),!n.running&&(0,a.jsxs)("div",{className:"run-choice",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void C("unattended"),disabled:f||0===t,children:i("session.run",{n:t})}),(0,a.jsx)("p",{className:"why",children:i("session.runWhy")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("button",{onClick:()=>void C("confirm"),disabled:f||0===t,children:i("session.runStep")}),(0,a.jsx)("p",{className:"why",children:i("session.runStepWhy")})]})]}),(0,a.jsxs)("div",{className:"row",style:{marginTop:10},children:[n.running&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{className:"danger",onClick:()=>void w(async()=>{await c.FH.stop(n.id),m(i("session.stopping"))}),disabled:f,children:i("session.stop")}),"unattended"===n.runMode&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"badge waiting-approval",children:i("session.modeUnattended")}),(0,a.jsx)("button",{onClick:()=>void w(async()=>{await c.FH.setRunMode(n.id,"confirm"),m(i("session.askingAgain"))}),disabled:f,children:i("session.askAgain")})]})]}),(0,a.jsx)("span",{className:"muted small",children:o}),(0,a.jsx)("span",{className:"grow"}),(0,a.jsx)("button",{className:"quiet",onClick:()=>void S(),disabled:n.running,children:i("home.delete")}),n.chat?(0,a.jsx)("a",{href:n.chat.url,target:"_blank",rel:"noreferrer",className:"small",children:i("session.openChat",{name:n.chat.name})}):(0,a.jsx)("span",{className:"muted small",children:i("session.noChat")})]}),(0,a.jsx)("label",{htmlFor:"session-group",children:i("session.group")}),(0,a.jsx)("div",{className:"row",children:(0,a.jsx)("input",{id:"session-group",type:"text",className:"grow",value:x,placeholder:i("session.groupPlaceholder"),onChange:e=>j(e.target.value),onBlur:()=>void F(),disabled:n.running})}),(0,a.jsxs)("p",{className:"why",children:[i("session.groupWhy"),n.chat&&" ".concat(i("session.groupHasChat"))]}),(0,a.jsxs)("div",{className:"muted small",style:{marginTop:10},children:[i("session.willUseModel",{name:n.model||(h?i("model.followsDefault",{name:h}):i("model.default"))})," \xb7 ",n.mirror.enabled&&n.mirror.rootDir?i("session.willUseFiles",{root:n.mirror.rootDir,dirs:n.mirror.includeDirs.length?n.mirror.includeDirs.join(", "):"."}):(0,a.jsx)("span",{className:"err",children:i("session.noFiles")})]})]})}function T(e){var s;let{level1:n,sent:l}=e,{t}=(0,d.kj)();return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("h2",{className:"grow",style:{margin:0},children:t("l1.title")}),(0,a.jsx)("span",{className:"badge",children:t(l?"l1.sent":"l1.notSent")}),(0,a.jsx)(i(),{href:"/level1",className:"small",children:t("l1.edit")})]}),(0,a.jsxs)("p",{className:"muted small",style:{marginBottom:6},children:[t("l1.hint"),(null==n?void 0:n.customised)?" ".concat(t("l1.customised")):""]}),(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:t("l1.show")}),(0,a.jsx)("pre",{className:"tall",children:null!=(s=null==n?void 0:n.content)?s:"…"})]})]})}function M(e){var s,n,t,r;let{session:i,onChange:o}=e,{t:m}=(0,d.kj)(),h=(0,d.W3)(),[u,p]=(0,l.useState)(null),[v,j]=(0,l.useState)(!1),[g,f]=(0,l.useState)("");(0,l.useEffect)(()=>{c.FH.models().then(p).catch(()=>void 0)},[]);let k=async e=>{try{await c.FH.updateSession(i.id,{model:e}),f(e?m("model.saved",{name:e}):m("model.savedDefault")),o()}catch(e){f(e.message)}},b=async()=>{try{let e=await c.FH.setDefaultModel(w);p(s=>s?{...s,defaultModel:e.defaultModel}:s),f(e.defaultModel?m("model.defaultSaved",{name:e.defaultModel}):m("model.defaultCleared"))}catch(e){f(e.message)}},N=async()=>{if(await (0,y.Z)(m("model.refreshConfirm"))){j(!0),f(m("model.refreshing"));try{var e;let s=await c.FH.refreshModels();p(s),f(0===s.options.length?null!=(e=s.note)?e:m("model.none"):m("model.refreshed",{n:s.options.length}))}catch(e){f(e.message)}finally{j(!1)}}},w=null!=(s=i.model)?s:"",C=null!=(n=null==u?void 0:u.options)?n:[],S=C.some(e=>e.name===w),F=C.filter(e=>!e.group),D=new Map;for(let e of C)e.group&&D.set(e.group,[...null!=(t=D.get(e.group))?t:[],e]);return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("h2",{className:"grow",style:{margin:0},children:m("model.title")}),i.modelInUse&&(0,a.jsx)("span",{className:"chip",children:m("model.lastUsed",{name:i.modelInUse})})]}),(0,a.jsx)("p",{className:"muted small",children:m("model.hint")}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsxs)("select",{"aria-label":m("model.title"),value:w,disabled:i.running,onChange:e=>void k(e.target.value),style:{width:"auto",minWidth:260},children:[(0,a.jsx)("option",{value:"",children:(null==u?void 0:u.defaultModel)?m("model.followsDefault",{name:u.defaultModel}):m("model.default")}),w&&!S&&(0,a.jsx)("option",{value:w,children:m("model.notInList",{name:w})}),F.map(e=>(0,a.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(m("model.unavailable")):""]},e.name)),[...D.entries()].map(e=>{let[s,n]=e;return(0,a.jsx)("optgroup",{label:s,children:n.map(e=>(0,a.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(m("model.unavailable")):""]},e.name))},s)})]}),(0,a.jsx)("button",{onClick:()=>void N(),disabled:v||i.running,children:m("model.refresh")}),(0,a.jsx)("span",{className:"muted small",role:"status",children:g})]}),(0,a.jsx)(x.L,{current:w,onUse:e=>void k(e)}),(0,a.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,a.jsx)("span",{className:"muted small",children:(null==u?void 0:u.defaultModel)?m("model.defaultIs",{name:u.defaultModel}):m("model.defaultIsNone")}),(0,a.jsx)("button",{onClick:()=>void b(),disabled:w===(null!=(r=null==u?void 0:u.defaultModel)?r:""),children:w?m("model.makeDefault",{name:w}):m("model.clearDefault")})]}),(null==u?void 0:u.readAt)?(0,a.jsxs)("p",{className:"muted small",style:{marginTop:8},children:[m("model.readAt",{t:h(u.readAt),n:u.options.length}),u.current?" ".concat(m("model.chatWasOn",{name:u.current})):"",u.note?" ".concat(u.note):""]}):(0,a.jsx)("p",{className:"muted small",style:{marginTop:8},children:m("model.neverRead")}),C.length>0&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:m("model.showDetails")}),(0,a.jsx)("pre",{className:"tall",children:C.map(e=>"".concat(e.selected?"*":" "," ").concat(e.group?"".concat(e.group," > "):"").concat(e.name)+"".concat(e.disabled?" [unavailable]":"","\n ").concat(e.raw.replace(/\n/g," | "))).join("\n")})]})]})}function P(e){var s,n;let{session:t,onChange:r}=e,{t:i}=(0,d.kj)(),o=null!=(s=t.review)?s:{enabled:!0,model:""},[m,h]=(0,l.useState)(o.enabled),[u,p]=(0,l.useState)(null!=(n=o.model)?n:""),[v,g]=(0,l.useState)(""),[f,k]=(0,l.useState)(!1),[y,b]=(0,l.useState)("");(0,l.useEffect)(()=>{c.FH.models().then(e=>{var s;return b(null!=(s=e.defaultReviewModel)?s:"")}).catch(()=>void 0)},[]);let N=async()=>{k(!0),g("");try{await c.FH.updateSession(t.id,{review:{enabled:m,model:u}}),g(i("review.saved")),r()}catch(e){g(e.message)}finally{k(!1)}};return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("h2",{className:"grow",style:{margin:0},children:i("review.title")}),(0,a.jsx)("span",{className:"badge ".concat(m?"done":""),children:m?i("review.on"):i("review.off")})]}),(0,a.jsx)("p",{className:"muted small",children:i("review.hint")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:m,onChange:e=>h(e.target.checked),disabled:t.running}),(0,a.jsx)("span",{children:i("review.enable")})]}),(0,a.jsx)("p",{className:"why",children:i("review.enableWhy")})]}),(0,a.jsx)("label",{htmlFor:"review-model",children:i("review.modelField")}),(0,a.jsx)("div",{className:"row",children:(0,a.jsx)(j.Y,{id:"review-model",chosen:u,onChange:p,none:y?i("model.followsDefault",{name:y}):i("review.modelSame"),disabled:t.running||!m})}),(0,a.jsx)("p",{className:"why",children:i("review.modelWhy")}),(0,a.jsx)(x.z4,{current:u,onUse:e=>p(e)}),(0,a.jsxs)("div",{className:"row",style:{marginTop:10},children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void N(),disabled:f||t.running,children:i("review.save")}),v&&(0,a.jsx)("span",{className:"muted small",children:v})]})]})}function L(e){var s,n,t,r,i,o,m,h,u;let{session:p,onChange:v}=e,{t:j}=(0,d.kj)(),g=null!=(n=p.vcs)?n:{enabled:!0,repoDir:"",branchMode:"per-task",commitOnFinish:!0,branchPrefix:"cop/"},[f,k]=(0,l.useState)(g.repoDir),[y,b]=(0,l.useState)(null),[N,w]=(0,l.useState)(""),[C,S]=(0,l.useState)(!1),D=JSON.stringify(g),[H,I]=(0,l.useState)(null),[T,M]=(0,l.useState)(null!=(t=g.branchName)?t:"");(0,l.useEffect)(()=>{var e;return M(null!=(e=JSON.parse(D).branchName)?e:"")},[D]);let[P,L]=(0,l.useState)(null!=(r=g.baseBranch)?r:"");(0,l.useEffect)(()=>{var e;return L(null!=(e=JSON.parse(D).baseBranch)?e:"")},[D]);let R=null!=(i=g.startFrom)?i:"head";(0,l.useEffect)(()=>{k(JSON.parse(D).repoDir)},[D]);let O=JSON.parse(D).repoDir||p.mirror.rootDir||"";(0,l.useEffect)(()=>{let e=!1;return O.trim()?(c.FH.repoCheck(O).then(s=>{var n;e||I(s.ok?null:null!=(n=s.problem)?n:null)}).catch(()=>{e||I(null)}),()=>{e=!0}):void I(null)},[O]);let W=(0,l.useCallback)(()=>{c.FH.vcsStatus(p.id).then(b).catch(()=>b(null))},[p.id]);(0,l.useEffect)(W,[W,D]);let E=async e=>{try{await c.FH.updateSession(p.id,{vcs:e}),w(j("vcs.saved")),v(),W()}catch(e){w(e.message)}},A=async()=>{S(!0),w(j("mirror.browsing"));try{let s=await c.FH.browseFolder(f.trim()||p.mirror.rootDir||void 0);if(s.ok)k(s.path),await E({repoDir:s.path});else{var e;w(s.cancelled?j("mirror.browseCancelled"):null!=(e=s.reason)?e:"")}}catch(e){w(e.message)}finally{S(!1)}},B=g.repoDir||p.mirror.rootDir||"",U=""!==B.trim()&&null===H;return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("h2",{className:"grow",style:{margin:0},children:j("vcs.title")}),(0,a.jsx)("span",{className:"badge ".concat(g.enabled?"done":""),children:g.enabled?j("vcs.on"):j("vcs.off")})]}),(0,a.jsx)("p",{className:"muted small",children:j("vcs.hint")}),(0,a.jsx)("label",{htmlFor:"vcs-root",children:j("vcs.repoField")}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("input",{id:"vcs-root",type:"text",className:"grow",value:f,onChange:e=>k(e.target.value),onBlur:()=>f.trim()!==g.repoDir&&void E({repoDir:f.trim()}),placeholder:p.mirror.rootDir||"C:\\Projects\\my-app",disabled:p.running}),(0,a.jsx)("button",{onClick:()=>void A(),disabled:C||p.running,children:j("mirror.browse")})]}),(0,a.jsx)(x.H4,{current:f,onUse:e=>{k(e),E({repoDir:e})}}),H&&(0,a.jsxs)("div",{className:"notice caution",style:{marginTop:8},children:[(0,a.jsx)("strong",{children:j("vcs.noRepo")}),(0,a.jsx)("div",{className:"small",style:{marginTop:4},children:H}),(0,a.jsx)("div",{className:"muted small",style:{marginTop:6},children:j("vcs.noRepoHow")})]}),!H&&""!==B.trim()&&(0,a.jsx)("p",{className:"muted small",style:{marginTop:4},children:j("vcs.repoOk")}),""===B.trim()&&(0,a.jsx)("p",{className:"muted small",style:{marginTop:4},children:j("vcs.pickFirst")}),(0,a.jsxs)("div",{className:"option".concat(U||g.enabled?"":" warned"),children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:g.enabled,onChange:e=>void E({enabled:e.target.checked}),disabled:p.running||!U&&!g.enabled}),(0,a.jsx)("span",{children:j("vcs.enable")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.enableWhy")})]}),g.enabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"muted small",style:{marginTop:4},children:B?j("vcs.repoIs",{dir:B}):j("vcs.repoNone")}),B&&!H&&(0,a.jsx)(F.b,{dir:B}),(0,a.jsx)("h3",{children:j("vcs.branches")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"branchMode",checked:"per-task"===g.branchMode,onChange:()=>void E({branchMode:"per-task"}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.perTask")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.perTaskWhy")})]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"branchMode",checked:"per-session"===g.branchMode,onChange:()=>void E({branchMode:"per-session"}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.perSession")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.perSessionWhy")})]}),"per-session"===g.branchMode&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"vcs-branch-name",children:j("vcs.branchName")}),(0,a.jsx)("input",{id:"vcs-branch-name",type:"text",value:T,onChange:e=>M(e.target.value),onBlur:()=>{var e;return T.trim()!==(null!=(e=g.branchName)?e:"")&&void E({branchName:T.trim()})},placeholder:p.name,disabled:p.running}),(0,a.jsx)("p",{className:"why",children:j("vcs.branchNameWhy")})]}),(0,a.jsx)("h3",{children:j("vcs.startFrom")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"startFrom",checked:"branch"===R,onChange:()=>void E({startFrom:"branch"}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.startBranch")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.startBranchWhy")})]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"startFrom",checked:"previous-session"===R,onChange:()=>void E({startFrom:"previous-session"}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.startPrevious")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.startPreviousWhy")})]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"startFrom",checked:"head"===R,onChange:()=>void E({startFrom:"head"}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.startHead")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.startHeadWhy")})]}),"head"!==R&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"vcs-base-branch",children:j("vcs.baseBranch")}),(0,a.jsx)("input",{id:"vcs-base-branch",type:"text",value:P,onChange:e=>L(e.target.value),onBlur:()=>{var e;return P.trim()!==(null!=(e=g.baseBranch)?e:"")&&void E({baseBranch:P.trim()})},placeholder:"main",disabled:p.running}),(0,a.jsx)("p",{className:"why",children:j("vcs.baseBranchWhy")})]}),p.vcsStart&&(0,a.jsxs)("p",{className:"muted small",children:["previous-session"===p.vcsStart.kind?j("vcs.startedPrevious",{name:null!=(o=null==(s=p.vcsStart.fromSession)?void 0:s.name)?o:"",branch:null!=(m=p.vcsStart.branch)?m:"",commit:p.vcsStart.commit.slice(0,8)}):"branch"===p.vcsStart.kind?j("vcs.startedBranch",{branch:null!=(h=p.vcsStart.branch)?h:"",commit:p.vcsStart.commit.slice(0,8)}):j("vcs.startedHead",{commit:p.vcsStart.commit.slice(0,8)}),p.vcsStart.note?" — ".concat(p.vcsStart.note):""]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:g.commitOnFinish,onChange:e=>void E({commitOnFinish:e.target.checked}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.commit")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.commitWhy")})]}),y&&!y.ok&&(0,a.jsxs)("div",{className:"notice caution",role:"status",children:[(0,a.jsx)("strong",{children:j("vcs.notReady")})," ",y.problem]}),(null==y?void 0:y.ok)&&(0,a.jsx)("div",{className:"muted small",children:j("vcs.ready",{branch:null!=(u=y.branch)?u:"—",dir:y.repoDir})}),(null==y?void 0:y.ok)&&y.work&&y.work.branches.length>0&&(0,a.jsxs)("div",{className:"muted small",children:["per-session"===y.work.mode&&y.work.complete?j("vcs.completeOn",{branch:y.work.complete}):j("vcs.noSingleBranch",{n:y.work.branches.length}),"per-task"===y.work.mode&&(0,a.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:y.work.branches.map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.branch})," — ",e.title,e.commit?"":" (".concat(j("vcs.taskNoFiles"),")")]},e.branch))})]}),(0,a.jsx)("p",{className:"muted small",children:j("vcs.pushIsYours")})]}),(0,a.jsx)("div",{className:"muted small",role:"status",children:N})]})}function R(e){var s,n,t,r;let{session:i,onChange:o}=e,{t:m}=(0,d.kj)(),[h,v]=(0,l.useState)(i.mirror.enabled),[j,f]=(0,l.useState)(i.mirror.rootDir),[k,b]=(0,l.useState)(i.mirror.includeDirs.join("\n")),[N,w]=(0,l.useState)(i.mirror.excludeDirs.join("\n")),[C,S]=(0,l.useState)(null==(s=i.mirror.respectGitignore)||s),[F,D]=(0,l.useState)(null!=(n=i.mirror.includeEnvFiles)&&n),[H,I]=(0,l.useState)(null),[T,M]=(0,l.useState)(null),[P,L]=(0,l.useState)(""),[R,W]=(0,l.useState)(""),[E,A]=(0,l.useState)([]),B=JSON.stringify(i.mirror);(0,l.useEffect)(()=>{var e,s;let n=JSON.parse(B);v(n.enabled),f(n.rootDir),b(n.includeDirs.join("\n")),w(n.excludeDirs.join("\n")),S(null==(e=n.respectGitignore)||e),D(null!=(s=n.includeEnvFiles)&&s)},[B]),(0,l.useEffect)(()=>{c.FH.doctor().then(e=>{var s;return A(null!=(s=e.alwaysIgnoredDirs)?s:[])}).catch(()=>void 0)},[]);let U=p(k),G=p(N),z=function(e,s){let n=e.map(u).filter(Boolean),a=s.map(u).filter(Boolean),l=[];for(let e of n)for(let s of a)if(e.toLowerCase()===s.toLowerCase())l.push({include:e,exclude:s,kind:"same"});else("."===s?"."!==e:e.toLowerCase().startsWith("".concat(s.toLowerCase(),"/")))&&l.push({include:e,exclude:s,kind:"excluded-parent"});return l}(U,G),q={rootDir:j.trim(),includeDirs:U,excludeDirs:G,respectGitignore:C,includeEnvFiles:F},J=h&&!q.rootDir,Z=z.length>0||J,_=JSON.stringify({enabled:i.mirror.enabled,rootDir:i.mirror.rootDir,includeDirs:i.mirror.includeDirs,excludeDirs:i.mirror.excludeDirs,respectGitignore:null==(t=i.mirror.respectGitignore)||t,includeEnvFiles:null!=(r=i.mirror.includeEnvFiles)&&r}),K=JSON.stringify({enabled:h,...q}),Y=async()=>{if(!Z)try{await c.FH.updateSession(i.id,{mirror:{enabled:h,...q}}),W(m("mirror.saved")),o()}catch(e){W(e.message)}},$=async()=>{try{I(await c.FH.dirs(j,C)),W("")}catch(e){W(e.message)}},Q=async()=>{L("browse"),W(m("mirror.browsing"));try{let s=await c.FH.browseFolder(j.trim()||void 0);if(s.ok)f(s.path),I(null),M(null),W("");else{var e;W(s.cancelled?m("mirror.browseCancelled"):null!=(e=s.reason)?e:"")}}catch(e){W(e.message)}finally{L("")}},V=async()=>{if(!q.rootDir)return void W(m("mirror.needRoot"));L("check"),W(m("mirror.checking"));try{M(await c.FH.previewMirror(q)),W("")}catch(e){M(null),W(e.message)}finally{L("")}},X=async e=>{(!e||await (0,y.Z)(m("mirror.envWarn")))&&(D(e),M(null))};return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("h2",{className:"grow",style:{margin:0},children:m("mirror.title")}),(0,a.jsx)("span",{className:"badge ".concat(i.mirror.enabled?"done":""),children:i.mirror.enabled?m("mirror.stateOn"):m("mirror.stateOff")})]}),(0,a.jsx)("p",{className:"muted small",children:m("mirror.hint",{example:"src--test--a.spec.ts.txt"})}),(0,a.jsx)("div",{className:"option",children:(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:h,onChange:e=>v(e.target.checked)}),(0,a.jsx)("span",{children:m("mirror.enable")})]})}),(0,a.jsx)("label",{htmlFor:"mirror-root",children:m("mirror.root")}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("input",{id:"mirror-root",type:"text",className:"grow",value:j,onChange:e=>{f(e.target.value),M(null)},placeholder:"C:\\Projects\\my-app"}),(0,a.jsx)("button",{onClick:()=>void Q(),disabled:"browse"===P,children:m("mirror.browse")}),(0,a.jsx)("button",{onClick:()=>void $(),disabled:!j.trim(),children:m("mirror.listDirs")})]}),(0,a.jsx)("div",{className:"muted small",style:{marginTop:4},children:m("mirror.rootHint")}),(0,a.jsx)(x.H4,{current:j,onUse:e=>{f(e),M(null)}}),H&&(0,a.jsx)("div",{className:"small muted",style:{margin:"6px 0"},children:0===H.length?m("mirror.noDirs"):H.join(" \xb7 ")}),(0,a.jsx)("h3",{children:m("mirror.rules")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:C,onChange:e=>{S(e.target.checked),M(null)}}),(0,a.jsx)("span",{children:m("mirror.gitignore")})]}),(0,a.jsx)("p",{className:"why",children:m("mirror.gitignoreWhy")})]}),(0,a.jsxs)("div",{className:"option".concat(F?" warned":""),children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:F,onChange:e=>X(e.target.checked)}),(0,a.jsx)("span",{children:m("mirror.env")})]}),(0,a.jsx)("p",{className:"why",children:m("mirror.envWhy")}),F&&(0,a.jsx)("p",{className:"why",children:(0,a.jsx)("strong",{children:m("mirror.envOn")})})]}),E.length>0&&(0,a.jsx)("p",{className:"muted small",children:m("mirror.alwaysOut",{dirs:E.join(", ")})}),(0,a.jsxs)("div",{className:"row",style:{alignItems:"flex-start"},children:[(0,a.jsxs)("div",{className:"grow",children:[(0,a.jsx)("label",{htmlFor:"mirror-include",children:m("mirror.include")}),(0,a.jsx)("textarea",{id:"mirror-include",value:k,onChange:e=>{b(e.target.value),M(null)},placeholder:"src\ntests",style:{minHeight:80},"aria-invalid":z.length>0})]}),(0,a.jsxs)("div",{className:"grow",children:[(0,a.jsx)("label",{htmlFor:"mirror-exclude",children:m("mirror.exclude")}),(0,a.jsx)("textarea",{id:"mirror-exclude",value:N,onChange:e=>{w(e.target.value),M(null)},placeholder:"src/generated",style:{minHeight:80},"aria-invalid":z.length>0})]})]}),(0,a.jsx)(g.k,{rootDir:j,respectGitignore:C,includeEnvFiles:F,include:k.split("\n"),exclude:N.split("\n"),onChange:(e,s)=>{b(e.join("\n")),w(s.join("\n")),M(null)}}),z.length>0&&(0,a.jsxs)("div",{className:"notice",role:"alert",children:[(0,a.jsx)("strong",{children:m("mirror.conflict")}),(0,a.jsx)("ul",{children:z.map((e,s)=>(0,a.jsx)("li",{children:"same"===e.kind?m("mirror.conflictSame",{dir:e.include}):m("mirror.conflictParent",{include:e.include,exclude:e.exclude})},s))}),(0,a.jsx)("div",{style:{marginTop:6},children:m("mirror.conflictFix")})]}),J&&(0,a.jsx)("div",{className:"notice caution",role:"alert",children:(0,a.jsx)("strong",{children:m("mirror.needRoot")})}),K!==_&&(0,a.jsxs)("div",{className:"notice caution",role:"status",children:[(0,a.jsx)("strong",{children:m("mirror.unsaved")})," ",m("mirror.unsavedWhy")]}),(0,a.jsxs)("div",{className:"row",style:{marginTop:10},children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void Y(),disabled:Z,children:m("mirror.save")}),(0,a.jsx)("button",{onClick:()=>void V(),disabled:z.length>0||"check"===P,children:m("mirror.check")}),(0,a.jsx)("span",{className:"muted small",role:"status",children:R})]}),T&&(0,a.jsx)(O,{preview:T})]})}function O(e){let{preview:s}=e,{t:n}=(0,d.kj)();return 0===s.files.length?(0,a.jsx)("div",{className:"notice caution",style:{marginTop:10},children:(0,a.jsx)("strong",{children:n("mirror.checkedNone")})}):(0,a.jsxs)("div",{className:"notice calm",style:{marginTop:10},children:[(0,a.jsx)("strong",{children:n("mirror.checked",{files:s.files.length,size:(0,c.zi)(s.totalBytes)})})," ",s.envFiles.length>0&&(0,a.jsx)("span",{className:"err",children:n("mirror.checkedEnv",{n:s.envFiles.length})})," ",s.skipped.length>0&&(0,a.jsx)("span",{className:"muted",children:n("mirror.checkedSkipped",{n:s.skipped.length})}),(0,a.jsxs)("details",{style:{marginTop:6},children:[(0,a.jsx)("summary",{children:n("mirror.showFiles")}),(0,a.jsx)("pre",{className:"tall",children:s.files.join("\n")})]}),s.skipped.length>0&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:n("mirror.showSkipped")}),(0,a.jsx)("pre",{className:"tall",children:s.skipped.map(e=>"".concat(e.relPath," — ").concat(e.reason)).join("\n")})]})]})}function W(e){var s;let{session:n,onChange:t}=e,{t:r}=(0,d.kj)(),[i,o]=(0,l.useState)(""),m=null!=(s=n.onFailure)?s:"stop",h=async e=>{if(e!==m)try{await c.FH.updateSession(n.id,{onFailure:e}),o(r("stop"===e?"chain.savedStop":"chain.savedContinue")),t()}catch(e){o(e.message)}};return(0,a.jsxs)("fieldset",{style:{border:0,padding:0,margin:"10px 0 14px"},children:[(0,a.jsx)("legend",{className:"muted small",style:{padding:0},children:r("chain.title")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"chain",checked:"stop"===m,onChange:()=>void h("stop"),disabled:n.running}),(0,a.jsx)("span",{children:r("chain.stop")})]}),(0,a.jsx)("p",{className:"why",children:r("chain.stopWhy")})]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"chain",checked:"continue"===m,onChange:()=>void h("continue"),disabled:n.running}),(0,a.jsx)("span",{children:r("chain.continue")})]}),(0,a.jsx)("p",{className:"why",children:r("chain.continueWhy")})]}),i&&(0,a.jsx)("div",{className:"muted small",role:"status",children:i}),n.running&&(0,a.jsx)("div",{className:"muted small",children:r("chain.locked")})]})}function E(e){let{value:s,onChange:n,presets:t,onPresetsChanged:r}=e,{t:i}=(0,d.kj)(),o=(0,l.useId)(),[m,h]=(0,l.useState)(""),u=async()=>{let e=prompt(i("l2.saveAsPrompt"));if(e)try{await c.FH.savePreset(e,s),h(i("l2.savedAs",{name:e})),null==r||r()}catch(e){h(e.message)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("label",{className:"grow",style:{margin:0},htmlFor:"".concat(o,"-text"),children:i("l2.label")}),(0,a.jsxs)("select",{value:"","aria-label":i("l2.loadPreset"),onChange:e=>{let s=t.find(s=>s.name===e.target.value);s&&n(s.content)},children:[(0,a.jsx)("option",{value:"",children:i("l2.loadPreset")}),t.map(e=>(0,a.jsx)("option",{value:e.name,children:e.name},e.name))]}),(0,a.jsx)("button",{onClick:()=>void u(),disabled:!s.trim(),children:i("l2.saveAs")})]}),(0,a.jsx)("textarea",{id:"".concat(o,"-text"),className:"prose",value:s,onChange:e=>n(e.target.value),placeholder:i("l2.placeholder"),style:{minHeight:140,marginTop:10}}),m&&(0,a.jsx)("div",{className:"muted small",children:m})]})}function A(e){let{session:s}=e,{t:n}=(0,d.kj)(),t=(0,d.W3)(),r=s.tasks.filter(e=>"queued"!==e.status),[i,o]=(0,l.useState)([]),m=i.length>0?i:r.map(e=>e.id),h=e=>(0,c.ub)("".concat(c.nC,"/sessions/").concat(s.id,"/export?variant=").concat(e)+(i.length>0?"&tasks=".concat(encodeURIComponent(i.join(","))):""));return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsx)("h2",{children:n("export.title")}),(0,a.jsx)("p",{className:"muted small",children:n("export.hint")}),0===r.length?(0,a.jsx)("div",{className:"empty",children:n("export.nothing")}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",style:{marginBottom:6},children:[(0,a.jsx)("button",{className:"quiet",onClick:()=>o(r.map(e=>e.id)),children:n("export.all")}),(0,a.jsx)("button",{className:"quiet",onClick:()=>o([]),children:n("export.none")}),(0,a.jsx)("span",{className:"muted small",children:i.length>0?n("export.selected",{n:i.length}):n("export.allOf",{n:r.length})})]}),r.map(e=>{var s,l,r,c,d;return(0,a.jsx)("div",{className:"option",style:{margin:"6px 0"},children:(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:i.includes(e.id),onChange:()=>{let s;return s=e.id,o(e=>e.includes(s)?e.filter(e=>e!==s):[...e,s])}}),(0,a.jsxs)("span",{children:[e.title," ",(0,a.jsx)("span",{className:"badge ".concat(e.status),children:n("status.".concat(e.status))})," ",e.readOnly&&(0,a.jsx)("span",{className:"chip",children:n("task.readOnly")})," ",(null!=(l=null==(s=e.scope)?void 0:s.length)?l:0)>0&&(0,a.jsx)("span",{className:"chip",children:n("task.scope",{paths:(null!=(r=e.scope)?r:[]).join(", ")})})," ",(0,a.jsx)("span",{className:"muted small",children:t(null!=(d=null!=(c=e.finishedAt)?c:e.startedAt)?d:e.createdAt)})]})]})},e.id)}),(0,a.jsxs)("div",{className:"row",style:{marginTop:10},children:[(0,a.jsx)("a",{className:"button-link",href:h("outcome"),download:!0,children:n("export.outcome",{n:m.length})}),(0,a.jsx)("a",{className:"button-link",href:h("full"),download:!0,children:n("export.full",{n:m.length})})]}),(0,a.jsx)("p",{className:"muted small",style:{marginTop:8},children:n("export.outcomeWhy")})]})]})}function B(e){let{handoff:s}=e,{t:n}=(0,d.kj)(),l=(e,s)=>(0,a.jsxs)("div",{className:"handoff-row",children:[(0,a.jsx)("strong",{children:n(e)})," ",s]}),t=e=>(0,a.jsx)("ul",{children:e.map((e,s)=>(0,a.jsx)("li",{children:e},s))}),r=s.validation.filter(e=>e.passed).length;return(0,a.jsxs)("div",{className:"summary handoff",children:[(0,a.jsx)("strong",{children:n("handoff.title")}),l("handoff.outcome",(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"badge ".concat(s.outcome.status),children:n("status.".concat(s.outcome.status))}),s.outcome.reason?" ".concat(s.outcome.reason):""]})),l("handoff.files",0===s.changedFiles.length?(0,a.jsx)("span",{className:"muted",children:n("handoff.noFiles")}):(0,a.jsx)("code",{children:s.changedFiles.map(e=>"".concat(e.path).concat(e.added>=0?" +".concat(e.added,"/-").concat(e.removed):"")).join(", ")})),s.validation.length>0&&l("handoff.validation",(0,a.jsxs)(a.Fragment,{children:[n("handoff.passed",{n:r,of:s.validation.length}),s.review?" \xb7 ".concat(n("handoff.review",{verdict:s.review.verdict,open:s.review.open})):""]})),l("handoff.issues",0===s.knownIssues.length?(0,a.jsx)("span",{className:"muted",children:n("handoff.noIssues")}):t(s.knownIssues)),s.evidence.runId&&l("handoff.evidence",(0,a.jsx)("code",{children:s.evidence.runId})),(s.vcs.branch||s.vcs.problem)&&l("handoff.vcs",(0,a.jsxs)(a.Fragment,{children:[s.vcs.branch&&(0,a.jsx)("code",{children:s.vcs.branch}),s.vcs.commit?" @ ".concat(s.vcs.commit.slice(0,8)," \xb7 ").concat(n("handoff.notPushed")):s.vcs.branch?" \xb7 ".concat(n("handoff.noCommit")):"",s.vcs.problem?" — ".concat(s.vcs.problem):""]})),s.manual.length>0&&l("handoff.manual",t(s.manual)),s.notExecuted.length>0&&l("handoff.notRun",t(s.notExecuted))]})}function U(e){var s;let{session:n,presets:t,onAdded:r,onPresetsChanged:i}=e,{t:o}=(0,d.kj)(),m=[...n.tasks].reverse()[0],[h,u]=(0,l.useState)(""),[p,v]=(0,l.useState)(null!=(s=null==m?void 0:m.level2)?s:""),[x,j]=(0,l.useState)(""),[g,f]=(0,l.useState)(""),[k,y]=(0,l.useState)(!1),b=(0,l.useRef)(!1),N=async()=>{if(!b.current){b.current=!0,y(!0);try{await c.FH.addTask(n.id,{title:h,level2:p,prompt:x}),u(""),j(""),f(o("form.queued")),r()}catch(e){f(e.message)}finally{b.current=!1,y(!1)}}};return(0,a.jsxs)("div",{className:"panel",id:"new-task",children:[(0,a.jsx)("h2",{children:o("form.title")}),(0,a.jsx)("p",{className:"muted small",children:o("form.hint")}),(0,a.jsx)("label",{htmlFor:"new-task-title",children:o("form.titleLabel")}),(0,a.jsx)("input",{id:"new-task-title",type:"text",value:h,onChange:e=>u(e.target.value),placeholder:o("form.titlePlaceholder")}),(0,a.jsx)("div",{style:{marginTop:10},children:(0,a.jsx)(E,{value:p,onChange:v,presets:t,onPresetsChanged:i})}),(0,a.jsx)("label",{htmlFor:"new-task-prompt",children:o("form.taskLabel")}),(0,a.jsx)("textarea",{id:"new-task-prompt",className:"prose",value:x,onChange:e=>j(e.target.value),placeholder:o("form.taskPlaceholder"),style:{minHeight:140}}),(0,a.jsxs)("div",{className:"row",style:{marginTop:10},children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void N(),disabled:k||!x.trim(),children:o("form.add")}),(0,a.jsx)("span",{className:"muted small",children:g})]})]})}function G(e){var s,n,t,r,i,u,p,v,x,j,g,N,C,F,D,H,I,T,M,P,L,R,O,W,A,U,G,z,J,Y,$,Q,V,X,ee,es,en,ea,el,et,er,ei,ec,ed,eo,em,eh,eu,ep,ev,ex,ej,eg,ef,ek,ey,eb,eN,ew,eC,eS,eF,eD,eH,eI,eT,eM,eP,eL,eR,eO,eW,eE,eA;let{session:eB,task:eU,index:eG,presets:ez,onChange:eq}=e,{t:eJ}=(0,d.kj)(),eZ=(0,d.W3)(),[e_,eK]=(0,l.useState)(!1),[eY,e$]=(0,l.useState)(!1),[eQ,eV]=(0,l.useState)(eU.title),[eX,e0]=(0,l.useState)(eU.level2),[e1,e2]=(0,l.useState)(eU.prompt),[e4,e6]=(0,l.useState)(null!=(Q=null==(s=eU.vcsPlan)?void 0:s.branch)?Q:""),[e8,e3]=(0,l.useState)(null!=(V=null==(n=eU.vcsPlan)?void 0:n.commitMessage)?V:""),[e5,e7]=(0,l.useState)(null!=(X=eU.checks)?X:[]),[e9,se]=(0,l.useState)(!!eU.readOnly),[ss,sn]=(0,l.useState)((null!=(ee=eU.scope)?ee:[]).join("\n")),sa={readOnly:e9,scope:e9?[]:(0,S.w)(ss)},sl=(0,h.c)((0,m.DG)(eU)),[st,sr]=(0,l.useState)(null),[si,sc]=(0,l.useState)(""),sd=async()=>{try{await c.FH.updateTask(eB.id,eU.id,{title:eQ,level2:eX,prompt:e1,vcsPlan:{branch:e4,commitMessage:e8},checks:e5,...sa}),eK(!1),eq()}catch(e){sc(e.message)}},so="running"===eU.status||"waiting-approval"===eU.status,sm=!so&&"queued"!==eU.status,sh=!so&&"queued"!==eU.status,su=!so&&null!=(es=null==(t=eB.vcs)?void 0:t.enabled)&&es&&(!!(null==(r=eU.vcs)?void 0:r.baseCommit)||(null!=(en=eU.attempts)?en:[]).some(e=>{var s;return null==(s=e.vcs)?void 0:s.baseCommit})),sp=!so&&("limit-reached"===eU.status||"aborted"===eU.status),sv=async()=>{if(await (0,y.Z)(eJ("task.continueConfirm",{title:eU.title})))try{await c.FH.continueTask(eB.id,eU.id),eq()}catch(e){sc(e.message)}},sx=async()=>{if(await (0,y.Z)(eJ("task.rerunConfirm",{title:eU.title})))try{await c.FH.rerunTask(eB.id,eU.id),eq()}catch(e){sc(e.message)}},sj=async()=>{if(await (0,y.Z)(eJ("task.editRanConfirm",{title:eU.title})))try{await c.FH.rerunTask(eB.id,eU.id,{title:eQ,level2:eX,prompt:e1,vcsPlan:{branch:e4,commitMessage:e8},checks:e5,...sa},{buildOnFinished:"done"===eU.status}),eK(!1),eq()}catch(e){sc(e.message)}},sg=(0,w.e)(eq),sf=async()=>{let e="queued"===eU.status?"task.deleteConfirm":"task.deleteConfirmRan";if(await (0,y.Z)(eJ(e,{title:eU.title})))try{await c.FH.deleteTask(eB.id,eU.id),eq()}catch(e){sc(e.message)}},sk=async()=>{try{sr(await c.FH.taskFiles(eB.id,eU.id))}catch(e){sc(e.message)}},sy=(e,s,n)=>n.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("span",{className:"muted",children:[eJ(e)," "]}),n.map(e=>(0,a.jsx)("span",{style:{marginRight:10},children:(0,a.jsx)(o.u,{label:e,save:()=>c.FH.saveTaskFile(eB.id,eU.id,s,e)})},e))]});return(0,a.jsxs)("div",{className:"task ".concat(eU.status),id:eU.id,children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsxs)("h4",{className:"grow",children:[eG,". ",eU.title]}),(0,a.jsx)("span",{className:"badge ".concat(eU.status),children:eJ("status.".concat(eU.status))}),(null!=(ea=eU.attempt)?ea:1)>1&&(0,a.jsx)("span",{className:"chip",children:eJ("task.attemptN",{n:null!=(el=eU.attempt)?el:1})}),eU.iterations>0&&(0,a.jsx)("span",{className:"muted small",children:eJ("task.iterations",{n:eU.iterations})}),eU.runId&&(0,a.jsxs)("button",{className:eY?"":"quiet","aria-expanded":eY,onClick:()=>e$(e=>!e),title:(0,m.DG)(eU)?eJ("story.showLiveWhy"):eJ("story.why"),children:[(0,m.DG)(eU)&&!eY&&(0,a.jsx)("span",{className:"dot","aria-hidden":"true"}),eY?eJ("story.hide"):(0,m.DG)(eU)?eJ("story.showLive"):eJ("story.show")]}),!so&&(0,a.jsx)("button",{onClick:()=>{if(!e_){var e,s,n,a,l,t;eV(eU.title),e0(eU.level2),e2(eU.prompt),e6(null!=(n=null==(e=eU.vcsPlan)?void 0:e.branch)?n:""),e3(null!=(a=null==(s=eU.vcsPlan)?void 0:s.commitMessage)?a:""),e7(null!=(l=eU.checks)?l:[]),se(!!eU.readOnly),sn((null!=(t=eU.scope)?t:[]).join("\n"))}eK(!e_)},title:eJ("task.editAll"),children:e_?eJ("task.cancel"):eJ("task.edit")}),sp&&(0,a.jsx)("button",{className:"primary",onClick:()=>void sv(),title:eJ("task.continueWhy"),children:eJ("task.continue")}),sh&&(0,a.jsx)("button",{className:sp?"":"primary",onClick:()=>void sx(),title:eJ("task.rerunWhy"),children:eJ("task.rerun")}),su&&(0,a.jsx)("button",{onClick:()=>void sg.restore({sessionId:eB.id,taskId:eU.id,title:eU.title}),disabled:""!==sg.busy||eB.running,title:eJ("restore.why"),children:"restore"===sg.busy?eJ("restore.checking"):eJ("restore.button")}),sm&&(0,a.jsx)("button",{onClick:()=>void sg.restartFrom({sessionId:eB.id,taskId:eU.id,title:eU.title}),disabled:""!==sg.busy||eB.running,title:eJ("restart.why"),children:"restart"===sg.busy?eJ("restart.checking"):eJ("restart.button")}),!so&&(0,a.jsx)("button",{className:"danger",onClick:()=>void sf(),children:eJ("task.delete")}),!e_&&(si||sg.message)&&(0,a.jsx)("span",{className:"err",role:"alert",children:si||sg.message})]}),(0,a.jsxs)("div",{className:"muted small",children:[eU.startedAt?eJ("task.started",{t:eZ(eU.startedAt)}):eJ("task.added",{t:eZ(eU.createdAt)}),eU.finishedAt?" \xb7 ".concat(eJ("task.finished",{t:eZ(eU.finishedAt)})):"",eU.startedAt&&eU.finishedAt?" \xb7 ".concat(eJ("task.took",{d:(0,c.c5)((0,m.d5)(eU.startedAt,eU.finishedAt))})):"",(0,m.DG)(eU)?" \xb7 ".concat(eJ("task.runningFor",{d:(0,c.c5)((0,m.d5)(eU.startedAt,void 0,sl))})):""]}),"queued"!==eU.status&&(null==(i=eB.vcs)?void 0:i.enabled)&&eU.vcs&&(0,a.jsx)("div",{className:"muted small",children:eU.vcs.problem&&!eU.vcs.branch?(0,a.jsx)("span",{className:"reason",children:eJ("vcs.taskProblem",{problem:eU.vcs.problem})}):(0,a.jsxs)(a.Fragment,{children:[eU.vcs.branch&&eJ("vcs.taskBranch",{branch:eU.vcs.branch}),eU.vcs.baseCommit&&" \xb7 ".concat(eJ("vcs.taskBase",{commit:eU.vcs.baseCommit.slice(0,8)})),eU.vcs.commit?" \xb7 ".concat(eJ("vcs.taskCommit",{commit:eU.vcs.commit.slice(0,8)})):" \xb7 ".concat(eJ("vcs.taskNoFiles")),(null!=(et=null==(u=eU.vcs.files)?void 0:u.length)?et:0)>0&&(0,a.jsxs)("details",{style:{display:"inline"},children:[(0,a.jsxs)("summary",{style:{display:"inline",cursor:"pointer"},children:[" \xb7 ",eJ("vcs.taskFiles",{n:null!=(er=null==(p=eU.vcs.files)?void 0:p.length)?er:0})]}),(0,a.jsx)("ul",{style:{margin:"4px 0 4px 0",paddingLeft:20},children:(null!=(ei=eU.vcs.files)?ei:[]).map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.path})," ",e.added<0||e.removed<0?eJ("vcs.taskBinary"):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{style:{color:"var(--ok)"},children:["+",e.added]})," ",(0,a.jsxs)("span",{style:{color:"var(--bad)"},children:["-",e.removed]})]})]},e.path))})]}),eU.vcs.commit&&eU.vcs.baseCommit&&(0,a.jsxs)(a.Fragment,{children:[" \xb7 ",(0,a.jsx)(b.C,{sessionId:eB.id,taskId:eU.id,title:eU.title,files:null!=(ec=null==(v=eU.vcs.files)?void 0:v.length)?ec:0})]}),(null!=(ed=null==(x=eU.vcs.suspicious)?void 0:x.length)?ed:0)>0&&(0,a.jsxs)("div",{className:"err small",style:{marginTop:4},children:[eJ("vcs.suspicious",{n:null!=(eo=null==(j=eU.vcs.suspicious)?void 0:j.length)?eo:0}),(0,a.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(em=eU.vcs.suspicious)?em:[]).map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.path})," — ",e.reason]},e.path))})]}),(null!=(eh=null==(g=eU.scopeReverted)?void 0:g.length)?eh:0)>0&&(0,a.jsx)("div",{className:"small",style:{marginTop:4},children:eJ("task.scopeReverted",{n:null!=(eu=null==(N=eU.scopeReverted)?void 0:N.length)?eu:0,paths:(null!=(ep=eU.scopeReverted)?ep:[]).join(", ")})}),(null!=(ev=null==(C=eU.vcs.foreignCommits)?void 0:C.length)?ev:0)>0&&(0,a.jsxs)("div",{className:"err small",style:{marginTop:4},children:[eJ("vcs.foreignCommits",{n:null!=(ex=null==(F=eU.vcs.foreignCommits)?void 0:F.length)?ex:0}),(0,a.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(ej=eU.vcs.foreignCommits)?ej:[]).map(e=>(0,a.jsx)("li",{children:(0,a.jsx)("code",{children:e})},e))})]})]})}),"queued"===eU.status&&(null==(D=eB.vcs)?void 0:D.enabled)&&((null==(H=eU.vcsPlan)?void 0:H.branch)||(null==(I=eU.vcsPlan)?void 0:I.commitMessage))&&(0,a.jsx)("div",{className:"muted small",children:eU.vcsPlan.branch&&eU.vcsPlan.commitMessage?eJ("task.gitNames",{branch:eU.vcsPlan.branch,subject:eU.vcsPlan.commitMessage.split("\n")[0]}):eU.vcsPlan.branch?eJ("task.gitBranchOnly",{branch:eU.vcsPlan.branch}):eJ("task.gitCommitOnly",{subject:(null!=(eg=eU.vcsPlan.commitMessage)?eg:"").split("\n")[0]})}),eY&&eU.runId&&(0,a.jsx)(f.P,{sessionId:eB.id,taskId:eU.id,live:"running"===eU.status||"waiting-approval"===eU.status}),e_?(0,a.jsxs)("div",{style:{marginTop:8},children:[(0,a.jsx)("label",{children:eJ("form.titleLabel")}),(0,a.jsx)("input",{type:"text",value:eQ,onChange:e=>eV(e.target.value)}),(0,a.jsx)("div",{style:{marginTop:8},children:(0,a.jsx)(E,{value:eX,onChange:e0,presets:ez})}),(0,a.jsx)("label",{children:eJ("form.taskLabel")}),(0,a.jsx)("textarea",{className:"prose",value:e1,onChange:e=>e2(e.target.value)}),(null==(T=eB.vcs)?void 0:T.enabled)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"branch-".concat(eU.id),children:eJ("task.branch")}),(0,a.jsx)("input",{id:"branch-".concat(eU.id),type:"text",value:e4,onChange:e=>e6(e.target.value),placeholder:eB.vcs.branchPrefix,disabled:"per-session"===eB.vcs.branchMode}),(0,a.jsx)("p",{className:"why",children:"per-session"===eB.vcs.branchMode?eJ("task.branchIgnored"):eJ("task.branchWhy")}),(0,a.jsx)("label",{htmlFor:"commit-".concat(eU.id),children:eJ("task.commitMessage")}),(0,a.jsx)("textarea",{id:"commit-".concat(eU.id),value:e8,onChange:e=>e3(e.target.value),style:{minHeight:70}}),(0,a.jsx)("p",{className:"why",children:eJ("task.commitWhy")})]}),(0,a.jsx)(q,{checks:e5,onChange:e7}),e1.trim()!==eU.prompt.trim()&&(0,a.jsx)("p",{className:"notice caution small",children:eJ("task.newIntentNote")}),(0,a.jsx)(S.y,{readOnly:e9,scope:ss,onReadOnly:se,onScope:sn}),(0,a.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void(sm?sj():sd()),children:sm?eJ("task.saveAndRerun"):eJ("task.save")}),(0,a.jsx)("span",{className:"err",children:si})]}),sm&&(0,a.jsx)("p",{className:"muted small",children:eJ("task.editRanWhy")})]}):(0,a.jsxs)(a.Fragment,{children:[(null!=(ef=null==(M=eU.checks)?void 0:M.length)?ef:0)>0&&(0,a.jsxs)("details",{className:"small",style:{margin:"6px 0"},children:[(0,a.jsxs)("summary",{children:[eJ("checks.title")," — ",eJ("checks.n",{n:null!=(ek=null==(P=eU.checks)?void 0:P.length)?ek:0}),(null!=(ey=null==(L=eU.checkResults)?void 0:L.length)?ey:0)>0&&" \xb7 ".concat((null!=(eb=eU.checkResults)?eb:[]).filter(e=>e.passed).length,"/").concat(null==(R=eU.checkResults)?void 0:R.length," ").concat(eJ("checks.passed"))]}),(0,a.jsx)("ul",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(eN=eU.checks)?eN:[]).map((e,s)=>{var n;let l=(null!=(n=eU.checkResults)?n:[]).find(s=>s.name===e.name);return(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:e.name}),(0,a.jsxs)("span",{className:"muted",children:[" — ",eJ("checks.kind.".concat(e.expect)),e.value?' "'.concat(e.value,'"'):"",e.run?": ".concat(e.run):e.file?": ".concat(e.file):""]}),l&&(0,a.jsxs)("div",{className:l.passed?"muted":"reason",children:[l.passed?eJ("checks.passed"):eJ("checks.failed")," — ",l.detail]})]},"".concat(e.name,"-").concat(s))})})]}),(null!=(ew=null==(O=eU.reviewChecks)?void 0:O.length)?ew:0)>0&&(0,a.jsxs)("details",{className:"small",style:{margin:"6px 0"},children:[(0,a.jsx)("summary",{children:eJ("checks.fromReview",{n:null!=(eC=null==(W=eU.reviewChecks)?void 0:W.length)?eC:0})}),(0,a.jsx)("p",{className:"why",children:eJ("checks.fromReviewWhy")}),(0,a.jsx)("ul",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(eS=eU.reviewChecks)?eS:[]).map(e=>{var s;let n=(null!=(s=eU.checkResults)?s:[]).find(s=>s.name===e.check.name);return(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.findingId})," ",(0,a.jsx)("strong",{children:e.check.name}),"active"!==e.state&&(0,a.jsx)("span",{className:"chip",style:{marginLeft:6},children:eJ("checks.state.".concat(e.state))}),(0,a.jsx)("div",{className:"muted",children:e.what}),n&&(0,a.jsxs)("div",{className:n.passed?"muted":"reason",children:[n.passed?eJ("checks.passed"):eJ("checks.failed")," — ",n.detail]})]},e.check.name)})})]}),(0,a.jsx)(K,{review:eU.review}),eU.stopCode&&!(0,m.DG)(eU)&&(0,a.jsx)("p",{className:"small",children:(0,a.jsx)("span",{className:"chip",title:eJ("stop.why"),children:eJ("stop.".concat(eU.stopCode))})}),eU.handoff&&!(0,m.DG)(eU)&&(0,a.jsx)(B,{handoff:eU.handoff}),eU.summary&&(0,a.jsxs)("div",{className:"summary",children:[(0,a.jsx)("strong",{children:eJ("task.whatWasDone")}),(0,a.jsx)(k.s,{text:eU.summary})]}),(null!=(eF=null==(A=eU.deviations)?void 0:A.length)?eF:0)>0&&(0,a.jsx)(Z,{items:null!=(eD=eU.deviations)?eD:[]}),(null!=(eH=null==(U=eU.disputes)?void 0:U.length)?eH:0)>0&&(0,a.jsx)(_,{items:null!=(eI=eU.disputes)?eI:[]}),eU.environment&&(0,a.jsx)("div",{className:"muted small",style:{margin:"4px 0"},children:eJ("task.ranWith",{node:eU.environment.node,npm:null!=(eT=eU.environment.npm)?eT:"—",git:null!=(eM=eU.environment.git)?eM:"—",pwsh:null!=(eL=null!=(eP=eU.environment.pwsh)?eP:eU.environment.powershell)?eL:"—"})}),(null!=(eR=null==(G=eU.leftovers)?void 0:G.length)?eR:0)>0&&(0,a.jsxs)("div",{className:"err small",style:{margin:"6px 0"},children:[eJ("task.leftovers",{n:null!=(eO=null==(z=eU.leftovers)?void 0:z.length)?eO:0}),(0,a.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(eW=eU.leftovers)?eW:[]).map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.name})," pid ",e.pid,e.ports.length>0?" \xb7 ".concat(eJ("task.leftoverPorts",{ports:e.ports.join(", ")})):""," \xb7 ",e.by]},"".concat(e.by,"-").concat(e.pid)))})]}),eU.reason&&(0,a.jsx)("div",{className:"reason small",style:{margin:"6px 0"},children:eU.reason}),(null!=(eE=null==(J=eU.attempts)?void 0:J.length)?eE:0)>0&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eJ("task.attempts",{n:null!=(eA=null==(Y=eU.attempts)?void 0:Y.length)?eA:0})}),null==($=eU.attempts)?void 0:$.map((e,s)=>{var n,l,t,r;return(0,a.jsxs)("div",{className:"small",style:{margin:"8px 0 12px"},children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("strong",{children:eJ("task.attemptN",{n:s+1})}),(0,a.jsx)("span",{className:"badge ".concat(e.status),children:eJ("status.".concat(e.status))}),e.iterations>0&&(0,a.jsx)("span",{className:"muted",children:eJ("task.iterations",{n:e.iterations})}),e.runId&&(0,a.jsx)(o.u,{label:eJ("save.attemptLog"),save:()=>c.FH.saveTaskLog(eB.id,eU.id,e.runId)}),e.runId&&(0,a.jsx)(o.H,{sessionId:eB.id,taskId:eU.id,attempt:s+1}),e.runId&&(null==(n=e.vcs)?void 0:n.commit)&&e.vcs.baseCommit&&(0,a.jsx)(b.C,{sessionId:eB.id,taskId:eU.id,runId:e.runId,title:"".concat(eU.title," — ").concat(eJ("task.attemptN",{n:s+1})),files:null!=(t=null==(l=e.vcs.files)?void 0:l.length)?t:0})]}),(0,a.jsxs)("div",{className:"muted",children:[e.startedAt?eJ("task.started",{t:eZ(e.startedAt)}):"",e.finishedAt?" \xb7 ".concat(eJ("task.finished",{t:eZ(e.finishedAt)})):""]}),e.summary&&(0,a.jsx)("div",{children:e.summary}),e.reason&&(0,a.jsx)("div",{className:"err",children:e.reason}),e.prompt&&e.prompt!==eU.prompt&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eJ("task.attemptText")}),(0,a.jsx)("pre",{children:e.prompt})]})]},"".concat(null!=(r=e.runId)?r:s))})]}),"queued"===eU.status?(0,a.jsxs)("div",{style:{marginTop:8},children:[(0,a.jsx)("div",{className:"muted small",children:eJ("task.prompt")}),(0,a.jsx)("pre",{children:eU.prompt}),eU.level2.trim()?(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eJ("task.l2Show",{n:eU.level2.trim().split("\n").length})}),(0,a.jsx)("pre",{children:eU.level2})]}):(0,a.jsx)("div",{className:"muted small",children:eJ("task.noL2")})]}):(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eJ("task.promptAndL2")}),eU.level2.trim()&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"muted small",children:eJ("task.l2")}),(0,a.jsx)("pre",{children:eU.level2})]}),(0,a.jsx)("div",{className:"muted small",children:eJ("task.prompt")}),(0,a.jsx)("pre",{children:eU.prompt})]}),eU.firstMessage&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eJ("task.firstMessage")}),(0,a.jsx)("pre",{className:"tall",children:eU.firstMessage})]}),eU.runId&&(0,a.jsxs)("details",{onToggle:e=>e.currentTarget.open&&void sk(),children:[(0,a.jsx)("summary",{children:eJ("task.files")}),(0,a.jsx)("div",{className:"row small",style:{margin:"6px 0"},children:(0,a.jsx)(o.u,{label:eJ("save.log"),save:()=>c.FH.saveTaskLog(eB.id,eU.id)})}),st&&(0,a.jsxs)("div",{className:"small",children:[sy("task.reports","reports",st.reports),sy("task.artifacts","artifacts",st.artifacts),sy("task.replies","replies",st.replies)]})]}),eU.finalReply&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eJ("task.finalReply")}),(0,a.jsx)("pre",{className:"tall",children:eU.finalReply})]})]})]})}function z(e){let{events:s}=e,{t:n}=(0,d.kj)(),{appearance:t}=(0,v.KP)(),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>{!t.reduceMotion&&r.current&&(r.current.scrollTop=r.current.scrollHeight)},[s.length,t.reduceMotion]),(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsx)("h2",{children:n("live.title")}),(0,a.jsxs)("div",{className:"log",ref:r,children:[0===s.length&&(0,a.jsx)("div",{className:"muted",children:n("live.none")}),s.map((e,s)=>{var n;return(0,a.jsxs)("div",{className:e.level,children:[(0,a.jsx)("span",{className:"time",children:new Date(e.at).toLocaleTimeString(void 0,{hour12:!1})}),null!=(n=e.message)?n:e.type]},s)})]})]})}function q(e){let{checks:s,onChange:n}=e,{t:l}=(0,d.kj)(),t=(e,a)=>n(s.map((s,n)=>e===n?{...s,...a}:s));return(0,a.jsxs)("div",{style:{marginTop:12},children:[(0,a.jsx)("label",{children:l("checks.title")}),(0,a.jsx)("p",{className:"why",style:{marginTop:0},children:l("checks.why")}),0===s.length&&(0,a.jsx)("p",{className:"muted small",children:l("checks.noneWhy")}),s.map((e,r)=>{var i,d,o,m;return(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("input",{type:"text",className:"grow",value:e.name,placeholder:l("checks.namePlaceholder"),onChange:e=>t(r,{name:e.target.value}),"aria-label":l("checks.name")}),(0,a.jsx)("select",{value:e.expect,onChange:e=>t(r,{expect:e.target.value}),"aria-label":l("checks.kind"),style:{width:"auto"},children:c.FZ.map(e=>(0,a.jsx)("option",{value:e,children:l("checks.kind.".concat(e))},e))}),(0,a.jsx)("button",{className:"quiet",onClick:()=>n(s.filter((e,s)=>s!==r)),children:l("checks.remove")})]}),(0,a.jsxs)("div",{className:"row",style:{marginTop:6},children:[(0,c.rt)(e.expect)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{type:"text",className:"grow",value:null!=(i=e.run)?i:"",placeholder:l("checks.run"),onChange:e=>t(r,{run:e.target.value}),"aria-label":l("checks.run")}),(0,a.jsx)("input",{type:"text",value:null!=(d=e.cwd)?d:"",placeholder:l("checks.cwd"),onChange:e=>t(r,{cwd:e.target.value}),"aria-label":l("checks.cwd"),style:{width:220}})]}):(0,a.jsx)("input",{type:"text",className:"grow",value:null!=(o=e.file)?o:"",placeholder:l("checks.file"),onChange:e=>t(r,{file:e.target.value}),"aria-label":l("checks.file")}),(0,c.dK)(e.expect)&&(0,a.jsx)("input",{type:"text",value:null!=(m=e.value)?m:"",placeholder:"output-matches"===e.expect?l("checks.valueRegex"):l("checks.value"),onChange:e=>t(r,{value:e.target.value}),"aria-label":l("checks.value"),style:{width:240}})]})]},r)}),(0,a.jsx)("button",{onClick:()=>n([...s,{name:"",expect:"exit-zero",run:""}]),children:l("checks.add")})]})}function J(e){let{tasks:s}=e,{t:n}=(0,d.kj)(),l=(0,m.hH)(s),t=(0,h.c)(!!l&&l.tasks.some(m.DG));if(!l)return null;let r=(0,m.eZ)(l.run,l.tasks,t);return(0,a.jsx)("p",{className:"muted small",style:{margin:"4px 0 10px"},children:n(r.live?"session.runClockLive":"session.runClock",{n:r.tasks,d:(0,c.c5)(r.ms)})})}function Z(e){let{items:s}=e,{t:n}=(0,d.kj)();return(0,a.jsxs)("div",{className:"summary",children:[(0,a.jsx)("strong",{children:n("task.deviations",{n:s.length})}),(0,a.jsx)("ol",{style:{margin:"6px 0",paddingLeft:20},children:s.map((e,s)=>(0,a.jsxs)("li",{style:{marginBottom:6},children:[(0,a.jsx)("div",{children:e.instruction}),(0,a.jsxs)("div",{className:"muted",children:[n("task.deviationDid"),": ",e.did]}),(0,a.jsxs)("div",{className:"muted",children:[n("task.deviationWhy"),": ",e.why]})]},s))})]})}function _(e){let{items:s}=e,{t:n}=(0,d.kj)();return(0,a.jsxs)("div",{className:"summary",children:[(0,a.jsx)("strong",{children:n("task.disputes",{n:s.length})}),(0,a.jsx)("ol",{style:{margin:"6px 0",paddingLeft:20},children:s.map((e,s)=>(0,a.jsxs)("li",{style:{marginBottom:6},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("code",{children:e.finding})," — ",e.why]}),(0,a.jsxs)("div",{className:"muted",children:[n("review.evidence"),": ",e.evidence]})]},s))})]})}function K(e){var s,n,l,t,r;let{review:i}=e,{t:c}=(0,d.kj)();if(!i||"skipped"===i.verdict)return null;let o="pass"===i.verdict?"done":"fail"===i.verdict?"blocked":"waiting-approval";return(0,a.jsxs)("div",{className:"small",style:{margin:"8px 0"},children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("span",{className:"badge ".concat(o),children:c("review.verdict.".concat(i.verdict))}),i.stepsRun>0&&(0,a.jsx)("span",{className:"muted",children:c("review.ran",{n:i.stepsRun})}),i.rounds>1&&(0,a.jsx)("span",{className:"muted",children:c("review.rounds",{n:i.rounds})}),i.model&&(0,a.jsx)("span",{className:"chip",children:c("review.onModel",{model:i.model})})]}),i.problem&&(0,a.jsx)("p",{className:"reason",children:c("review.problem",{problem:i.problem})}),i.summary&&(0,a.jsx)(k.s,{text:i.summary}),(null!=(l=null==(s=i.findings)?void 0:s.length)?l:0)>0&&(0,a.jsxs)("details",{style:{marginTop:4},children:[(0,a.jsx)("summary",{children:c("review.findings",{n:null!=(t=null==(n=i.findings)?void 0:n.length)?t:0})}),(0,a.jsx)("ol",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(r=i.findings)?r:[]).map((e,s)=>(0,a.jsxs)("li",{style:{marginBottom:8},children:[(0,a.jsxs)("div",{children:[e.id&&(0,a.jsx)("code",{style:{marginRight:6},children:e.id}),e.what,"task"===e.about&&(0,a.jsx)("span",{className:"chip",style:{marginLeft:6},children:c("review.aboutTask")}),e.repeated&&(0,a.jsx)("span",{className:"chip",style:{marginLeft:6},children:c("review.repeated")})]}),e.where&&(0,a.jsx)("div",{className:"muted",children:e.where}),(0,a.jsxs)("div",{className:"muted",children:[c("review.evidence"),": ",e.evidence]})]},s))})]})]})}},8848:(e,s,n)=>{"use strict";n.d(s,{H4:()=>d,L:()=>o,z4:()=>m});var a=n(3365),l=n(8197),t=n.n(l),r=n(1521),i=n(5549),c=n(867);function d(e){let{current:s,onUse:n}=e,{t:l}=(0,c.kj)(),[t,d]=(0,r.useState)(null);if((0,r.useEffect)(()=>{let e=!1;return i.FH.project().then(s=>{e||d(s)}).catch(()=>void 0),()=>{e=!0}},[]),!t)return null;let o=t.rootDir.trim(),m=s.trim().toLowerCase(),h=n?t.others.filter(e=>e.rootDir.trim().toLowerCase()!==m):[];return(0,a.jsx)(u,{label:o?l("proj.defaultIs",{dir:o}):l("proj.noneShort"),offer:o&&n&&m!==o.toLowerCase()?{text:l("proj.useIt"),onUse:()=>n(o)}:void 0,more:h.map(e=>({text:l("proj.otherUse",{name:e.name}),title:e.rootDir,onUse:()=>null==n?void 0:n(e.rootDir)})),link:o?l("proj.change"):l("proj.setIt"),anchor:"project"})}function o(e){let{current:s,onUse:n}=e,l=h(),{t}=(0,c.kj)();if(!l)return null;let r=l.defaultModel.trim();return(0,a.jsx)(u,{label:r?t("def.modelDefaultIs",{name:r}):t("def.modelNoneShort"),offer:r&&n&&s.trim()!==r?{text:t("def.modelUseIt"),onUse:()=>n(r)}:void 0,link:t(r?"proj.change":"proj.setIt"),anchor:"model"})}function m(e){let{current:s,onUse:n}=e,l=h(),{t}=(0,c.kj)();if(!l)return null;let r=l.defaultReviewModel.trim();return(0,a.jsx)(u,{label:r?t("def.reviewDefaultIs",{name:r}):t("def.reviewNoneShort"),offer:r&&n&&s.trim()!==r?{text:t("def.modelUseIt"),onUse:()=>n(r)}:void 0,link:t(r?"proj.change":"proj.setIt"),anchor:"review"})}function h(){let[e,s]=(0,r.useState)(null);return(0,r.useEffect)(()=>{let e=!1;return i.FH.models().then(n=>{e||s(n)}).catch(()=>void 0),()=>{e=!0}},[]),e}function u(e){let{label:s,offer:n,more:l=[],link:r,anchor:i}=e;return(0,a.jsxs)("p",{className:"muted small",style:{marginTop:4},children:[s," ",n&&(0,a.jsxs)(a.Fragment,{children:["\xb7"," ",(0,a.jsx)("button",{type:"button",className:"linkish",onClick:n.onUse,children:n.text})," "]}),l.map(e=>(0,a.jsxs)("span",{children:["\xb7"," ",(0,a.jsx)("button",{type:"button",className:"linkish",onClick:e.onUse,title:e.title,children:e.text})," "]},e.text)),"\xb7 ",(0,a.jsx)(t(),{href:"/defaults#".concat(i),children:r})]})}}},e=>{e.O(0,[197,867,549,36,295,347,131,358],()=>e(e.s=1772)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[66],{1205:(e,s,n)=>{"use strict";n.d(s,{AppearanceProvider:()=>m,KP:()=>h,themeScript:()=>c});var a=n(3365),l=n(1521);let t=["small","normal","large","huge","giant"],r={theme:"light",textSize:"normal",highContrast:!1,reduceMotion:!1,underlineLinks:!1,strongFocus:!1},i="cop.appearance",c="\n(function () {\n try {\n var d = document.documentElement;\n var raw = localStorage.getItem('".concat(i,"');\n var a = raw ? JSON.parse(raw) : {};\n if (!a || typeof a !== 'object') a = {};\n d.dataset.theme = a.theme === 'dark' ? 'dark' : 'light';\n d.dataset.textsize = ").concat(JSON.stringify(t),".indexOf(a.textSize) >= 0 ? a.textSize : 'normal';\n d.dataset.contrast = a.highContrast ? 'high' : 'normal';\n d.dataset.motion = a.reduceMotion ? 'reduced' : 'normal';\n d.dataset.links = a.underlineLinks ? 'underline' : 'plain';\n d.dataset.focus = a.strongFocus ? 'strong' : 'normal';\n } catch (e) {}\n})();\n");function d(e){let s=document.documentElement;s.dataset.theme=e.theme,s.dataset.textsize=e.textSize,s.dataset.contrast=e.highContrast?"high":"normal",s.dataset.motion=e.reduceMotion?"reduced":"normal",s.dataset.links=e.underlineLinks?"underline":"plain",s.dataset.focus=e.strongFocus?"strong":"normal"}let o=(0,l.createContext)({appearance:r,set:()=>void 0,reset:()=>void 0,loaded:!1});function m(e){let{children:s}=e,[n,c]=(0,l.useState)(r),[m,h]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=r;try{let s=window.localStorage.getItem(i);s?e=function(e){let s=e&&"object"==typeof e?e:{},n=(e,s)=>"boolean"==typeof e?e:s;return{theme:"dark"===s.theme?"dark":"light"===s.theme?"light":r.theme,textSize:t.includes(s.textSize)?s.textSize:r.textSize,highContrast:n(s.highContrast,r.highContrast),reduceMotion:n(s.reduceMotion,r.reduceMotion),underlineLinks:n(s.underlineLinks,r.underlineLinks),strongFocus:n(s.strongFocus,r.strongFocus)}}(JSON.parse(s)):window.matchMedia("(prefers-color-scheme: dark)").matches&&(e={...e,theme:"dark"}),window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!s&&(e={...e,reduceMotion:!0})}catch(e){}c(e),d(e),h(!0)},[]);let u=(0,l.useCallback)(e=>{c(s=>{let n={...s,...e};d(n);try{window.localStorage.setItem(i,JSON.stringify(n))}catch(e){}return n})},[]),p=(0,l.useCallback)(()=>{c(r),d(r);try{window.localStorage.removeItem(i)}catch(e){}},[]);return(0,a.jsx)(o.Provider,{value:{appearance:n,set:u,reset:p,loaded:m},children:s})}function h(){return(0,l.useContext)(o)}},1702:(e,s,n)=>{"use strict";var a=n(9962);n.o(a,"usePathname")&&n.d(s,{usePathname:function(){return a.usePathname}}),n.o(a,"useSearchParams")&&n.d(s,{useSearchParams:function(){return a.useSearchParams}})},1772:(e,s,n)=>{Promise.resolve().then(n.bind(n,4269))},4269:(e,s,n)=>{"use strict";n.r(s),n.d(s,{default:()=>D});var a=n(3365),l=n(1521),t=n(1702),r=n(8197),i=n.n(r),c=n(5549),d=n(867),o=n(1910),m=n(3523),h=n(3374);function u(e){let s=e.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/+$/,"");return""===s?".":s}function p(e){return e.split("\n").map(e=>e.trim()).filter(Boolean)}var v=n(1205),x=n(8848),j=n(4784),g=n(2244),f=n(2876),k=n(5132),y=n(1035),b=n(8934),N=n(4811),w=n(3041),C=n(7527),S=n(1366),F=n(2285);function D(){return(0,a.jsx)(l.Suspense,{fallback:null,children:(0,a.jsx)(H,{})})}function H(){var e;let{t:s}=(0,d.kj)(),n=null!=(e=(0,t.useSearchParams)().get("id"))?e:"",[r,o]=(0,l.useState)(null),[m,h]=(0,l.useState)([]),[u,p]=(0,l.useState)([]),[v,x]=(0,l.useState)(null),[j,g]=(0,l.useState)(""),[f,k]=(0,l.useState)(!1),y=(0,l.useRef)(null),b=(0,l.useRef)(0),N=(0,l.useCallback)(async()=>{if(!n)return;let e=++b.current;try{let s=await c.FH.session(n);if(e!==b.current)return;o(s),g("")}catch(s){if(e!==b.current)return;g(s.message)}},[n]),w=(0,l.useCallback)(()=>{y.current||(y.current=window.setTimeout(()=>{y.current=null,N()},400))},[N]);if((0,l.useEffect)(()=>{if(!n)return;c.FH.presets().then(p).catch(()=>void 0),c.FH.level1().then(x).catch(()=>void 0);let e=new EventSource(c.FH.streamUrl(n));return e.onopen=()=>k(!1),e.onmessage=e=>{let s;try{s=JSON.parse(e.data)}catch(e){return}"ping"!==s.type&&(h(e=>[...e.slice(-400),s]),w())},e.onerror=()=>{e.readyState===EventSource.CLOSED&&k(!0)},()=>{e.close()}},[n,w]),(0,C.z)(N,8e3,!!n),!n)return(0,a.jsx)("div",{className:"panel err",children:s("session.noId")});if(j&&!r)return(0,a.jsx)("div",{className:"panel err",children:j});if(!r)return(0,a.jsx)("div",{className:"panel muted",children:s("home.loading")});let S=r.tasks.filter(e=>"queued"===e.status).length;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"crumbs",children:[(0,a.jsx)(i(),{href:"/",children:s("session.crumb")})," / ",r.name]}),j&&(0,a.jsx)("div",{className:"panel err",role:"alert",children:s("session.stale",{err:j})}),f&&!j&&(0,a.jsx)("div",{className:"panel muted small",role:"status",children:s("session.streamClosed")}),(0,a.jsx)(I,{session:r,queued:S,onChange:N}),(0,a.jsx)(J,{tasks:r.tasks}),(0,a.jsx)(M,{session:r,onChange:N}),(0,a.jsx)(T,{level1:v,sent:r.contractSent}),(0,a.jsx)(L,{session:r,onChange:N}),(0,a.jsx)(P,{session:r,onChange:N}),(0,a.jsx)(R,{session:r,onChange:N}),(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsx)("h2",{children:s("tasks.title")}),(0,a.jsx)("p",{className:"muted small",children:s("tasks.hint")}),(0,a.jsx)(O,{session:r,onChange:N}),0===r.tasks.length&&(0,a.jsx)("div",{className:"muted",children:s("tasks.none")}),r.tasks.map((e,s)=>(0,a.jsx)(G,{session:r,task:e,index:s+1,presets:u,onChange:N},e.id))]}),(0,a.jsx)(A,{session:r}),(0,a.jsx)(U,{session:r,presets:u,onAdded:N,onPresetsChanged:()=>c.FH.presets().then(p)}),(0,a.jsx)(z,{events:m})]})}function I(e){var s;let{session:n,queued:t,onChange:r}=e,{t:i}=(0,d.kj)(),[o,m]=(0,l.useState)(""),[h,u]=(0,l.useState)("");(0,l.useEffect)(()=>{c.FH.models().then(e=>{var s;return u(null!=(s=e.defaultModel)?s:"")}).catch(()=>void 0)},[]);let[p,v]=(0,l.useState)(n.name),[x,j]=(0,l.useState)(null!=(s=n.conversationGroup)?s:"");(0,l.useEffect)(()=>v(n.name),[n.name]),(0,l.useEffect)(()=>{var e;return j(null!=(e=n.conversationGroup)?e:"")},[n.conversationGroup]);let g=(0,N.p)(),[f,k]=(0,l.useState)(!1),b=(0,l.useRef)(!1),w=async e=>{if(!b.current){b.current=!0,k(!0);try{await e()}catch(e){m(e.message)}finally{b.current=!1,k(!1),r()}}},C=async e=>{("unattended"!==e||g||await (0,y.Z)(i("session.unattendedConfirm")))&&await w(async()=>{var s;let a=await c.FH.start(n.id,e,n.planName);m(a.started?i("unattended"===e?"session.startedAuto":"session.startedStep"):i("session.notStarted",{reason:null!=(s=a.reason)?s:""}))})},S=async()=>{if(n.running)return void m(i("home.deleteRunning"));if(await (0,y.Z)(i("home.deleteConfirm",{name:n.name,n:n.tasks.length})))try{await c.FH.deleteSession(n.id),window.location.href="/"}catch(e){m(e.message)}},F=async()=>{var e;if(x.trim()!==(null!=(e=n.conversationGroup)?e:""))try{await c.FH.updateSession(n.id,{conversationGroup:x.trim()}),m(i("session.groupSaved")),r()}catch(e){m(e.message)}},D=n.running?i("state.running"):i("state.".concat(n.status));return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("input",{type:"text",className:"grow","aria-label":i("home.col.name"),value:p,onChange:e=>v(e.target.value),onBlur:()=>void w(async()=>{p.trim()&&p!==n.name&&await c.FH.updateSession(n.id,{name:p})})}),(0,a.jsx)("span",{className:"badge ".concat(n.running?"running":""),children:D})]}),!n.running&&(0,a.jsxs)("div",{className:"run-choice",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void C("unattended"),disabled:f||0===t,children:i("session.run",{n:t})}),(0,a.jsx)("p",{className:"why",children:i("session.runWhy")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("button",{onClick:()=>void C("confirm"),disabled:f||0===t,children:i("session.runStep")}),(0,a.jsx)("p",{className:"why",children:i("session.runStepWhy")})]})]}),(0,a.jsxs)("div",{className:"row",style:{marginTop:10},children:[n.running&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{className:"danger",onClick:()=>void w(async()=>{await c.FH.stop(n.id),m(i("session.stopping"))}),disabled:f,children:i("session.stop")}),"unattended"===n.runMode&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"badge waiting-approval",children:i("session.modeUnattended")}),(0,a.jsx)("button",{onClick:()=>void w(async()=>{await c.FH.setRunMode(n.id,"confirm"),m(i("session.askingAgain"))}),disabled:f,children:i("session.askAgain")})]})]}),(0,a.jsx)("span",{className:"muted small",children:o}),(0,a.jsx)("span",{className:"grow"}),(0,a.jsx)("button",{className:"quiet",onClick:()=>void S(),disabled:n.running,children:i("home.delete")}),n.chat?(0,a.jsx)("a",{href:n.chat.url,target:"_blank",rel:"noreferrer",className:"small",children:i("session.openChat",{name:n.chat.name})}):(0,a.jsx)("span",{className:"muted small",children:i("session.noChat")})]}),(0,a.jsx)("label",{htmlFor:"session-group",children:i("session.group")}),(0,a.jsx)("div",{className:"row",children:(0,a.jsx)("input",{id:"session-group",type:"text",className:"grow",value:x,placeholder:i("session.groupPlaceholder"),onChange:e=>j(e.target.value),onBlur:()=>void F(),disabled:n.running})}),(0,a.jsxs)("p",{className:"why",children:[i("session.groupWhy"),n.chat&&" ".concat(i("session.groupHasChat"))]}),(0,a.jsxs)("div",{className:"muted small",style:{marginTop:10},children:[i("session.willUseModel",{name:n.model||(h?i("model.followsDefault",{name:h}):i("model.default"))})," \xb7 ",n.mirror.enabled&&n.mirror.rootDir?i("session.willUseFiles",{root:n.mirror.rootDir,dirs:n.mirror.includeDirs.length?n.mirror.includeDirs.join(", "):"."}):(0,a.jsx)("span",{className:"err",children:i("session.noFiles")})]})]})}function T(e){var s;let{level1:n,sent:l}=e,{t}=(0,d.kj)();return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("h2",{className:"grow",style:{margin:0},children:t("l1.title")}),(0,a.jsx)("span",{className:"badge",children:t(l?"l1.sent":"l1.notSent")}),(0,a.jsx)(i(),{href:"/level1",className:"small",children:t("l1.edit")})]}),(0,a.jsxs)("p",{className:"muted small",style:{marginBottom:6},children:[t("l1.hint"),(null==n?void 0:n.customised)?" ".concat(t("l1.customised")):""]}),(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:t("l1.show")}),(0,a.jsx)("pre",{className:"tall",children:null!=(s=null==n?void 0:n.content)?s:"…"})]})]})}function M(e){var s,n,t,r;let{session:i,onChange:o}=e,{t:m}=(0,d.kj)(),h=(0,d.W3)(),[u,p]=(0,l.useState)(null),[v,j]=(0,l.useState)(!1),[g,f]=(0,l.useState)("");(0,l.useEffect)(()=>{c.FH.models().then(p).catch(()=>void 0)},[]);let k=async e=>{try{await c.FH.updateSession(i.id,{model:e}),f(e?m("model.saved",{name:e}):m("model.savedDefault")),o()}catch(e){f(e.message)}},b=async()=>{try{let e=await c.FH.setDefaultModel(w);p(s=>s?{...s,defaultModel:e.defaultModel}:s),f(e.defaultModel?m("model.defaultSaved",{name:e.defaultModel}):m("model.defaultCleared"))}catch(e){f(e.message)}},N=async()=>{if(await (0,y.Z)(m("model.refreshConfirm"))){j(!0),f(m("model.refreshing"));try{var e;let s=await c.FH.refreshModels();p(s),f(0===s.options.length?null!=(e=s.note)?e:m("model.none"):m("model.refreshed",{n:s.options.length}))}catch(e){f(e.message)}finally{j(!1)}}},w=null!=(s=i.model)?s:"",C=null!=(n=null==u?void 0:u.options)?n:[],S=C.some(e=>e.name===w),F=C.filter(e=>!e.group),D=new Map;for(let e of C)e.group&&D.set(e.group,[...null!=(t=D.get(e.group))?t:[],e]);return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("h2",{className:"grow",style:{margin:0},children:m("model.title")}),i.modelInUse&&(0,a.jsx)("span",{className:"chip",children:m("model.lastUsed",{name:i.modelInUse})})]}),(0,a.jsx)("p",{className:"muted small",children:m("model.hint")}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsxs)("select",{"aria-label":m("model.title"),value:w,disabled:i.running,onChange:e=>void k(e.target.value),style:{width:"auto",minWidth:260},children:[(0,a.jsx)("option",{value:"",children:(null==u?void 0:u.defaultModel)?m("model.followsDefault",{name:u.defaultModel}):m("model.default")}),w&&!S&&(0,a.jsx)("option",{value:w,children:m("model.notInList",{name:w})}),F.map(e=>(0,a.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(m("model.unavailable")):""]},e.name)),[...D.entries()].map(e=>{let[s,n]=e;return(0,a.jsx)("optgroup",{label:s,children:n.map(e=>(0,a.jsxs)("option",{value:e.name,disabled:e.disabled,children:[e.name,e.disabled?" — ".concat(m("model.unavailable")):""]},e.name))},s)})]}),(0,a.jsx)("button",{onClick:()=>void N(),disabled:v||i.running,children:m("model.refresh")}),(0,a.jsx)("span",{className:"muted small",role:"status",children:g})]}),(0,a.jsx)(x.L,{current:w,onUse:e=>void k(e)}),(0,a.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,a.jsx)("span",{className:"muted small",children:(null==u?void 0:u.defaultModel)?m("model.defaultIs",{name:u.defaultModel}):m("model.defaultIsNone")}),(0,a.jsx)("button",{onClick:()=>void b(),disabled:w===(null!=(r=null==u?void 0:u.defaultModel)?r:""),children:w?m("model.makeDefault",{name:w}):m("model.clearDefault")})]}),(null==u?void 0:u.readAt)?(0,a.jsxs)("p",{className:"muted small",style:{marginTop:8},children:[m("model.readAt",{t:h(u.readAt),n:u.options.length}),u.current?" ".concat(m("model.chatWasOn",{name:u.current})):"",u.note?" ".concat(u.note):""]}):(0,a.jsx)("p",{className:"muted small",style:{marginTop:8},children:m("model.neverRead")}),C.length>0&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:m("model.showDetails")}),(0,a.jsx)("pre",{className:"tall",children:C.map(e=>"".concat(e.selected?"*":" "," ").concat(e.group?"".concat(e.group," > "):"").concat(e.name)+"".concat(e.disabled?" [unavailable]":"","\n ").concat(e.raw.replace(/\n/g," | "))).join("\n")})]})]})}function P(e){var s,n;let{session:t,onChange:r}=e,{t:i}=(0,d.kj)(),o=null!=(s=t.review)?s:{enabled:!0,model:""},[m,h]=(0,l.useState)(o.enabled),[u,p]=(0,l.useState)(null!=(n=o.model)?n:""),[v,g]=(0,l.useState)(""),[f,k]=(0,l.useState)(!1),[y,b]=(0,l.useState)("");(0,l.useEffect)(()=>{c.FH.models().then(e=>{var s;return b(null!=(s=e.defaultReviewModel)?s:"")}).catch(()=>void 0)},[]);let N=async()=>{k(!0),g("");try{await c.FH.updateSession(t.id,{review:{enabled:m,model:u}}),g(i("review.saved")),r()}catch(e){g(e.message)}finally{k(!1)}};return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("h2",{className:"grow",style:{margin:0},children:i("review.title")}),(0,a.jsx)("span",{className:"badge ".concat(m?"done":""),children:m?i("review.on"):i("review.off")})]}),(0,a.jsx)("p",{className:"muted small",children:i("review.hint")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:m,onChange:e=>h(e.target.checked),disabled:t.running}),(0,a.jsx)("span",{children:i("review.enable")})]}),(0,a.jsx)("p",{className:"why",children:i("review.enableWhy")})]}),(0,a.jsx)("label",{htmlFor:"review-model",children:i("review.modelField")}),(0,a.jsx)("div",{className:"row",children:(0,a.jsx)(j.Y,{id:"review-model",chosen:u,onChange:p,none:y?i("model.followsDefault",{name:y}):i("review.modelSame"),disabled:t.running||!m})}),(0,a.jsx)("p",{className:"why",children:i("review.modelWhy")}),(0,a.jsx)(x.z4,{current:u,onUse:e=>p(e)}),(0,a.jsxs)("div",{className:"row",style:{marginTop:10},children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void N(),disabled:f||t.running,children:i("review.save")}),v&&(0,a.jsx)("span",{className:"muted small",children:v})]})]})}function L(e){var s,n,t,r,i,o,m,h,u;let{session:p,onChange:v}=e,{t:j}=(0,d.kj)(),g=null!=(n=p.vcs)?n:{enabled:!0,repoDir:"",branchMode:"per-task",commitOnFinish:!0,branchPrefix:"cop/"},[f,k]=(0,l.useState)(g.repoDir),[y,b]=(0,l.useState)(null),[N,w]=(0,l.useState)(""),[C,S]=(0,l.useState)(!1),D=JSON.stringify(g),[H,I]=(0,l.useState)(null),[T,M]=(0,l.useState)(null!=(t=g.branchName)?t:"");(0,l.useEffect)(()=>{var e;return M(null!=(e=JSON.parse(D).branchName)?e:"")},[D]);let[P,L]=(0,l.useState)(null!=(r=g.baseBranch)?r:"");(0,l.useEffect)(()=>{var e;return L(null!=(e=JSON.parse(D).baseBranch)?e:"")},[D]);let R=null!=(i=g.startFrom)?i:"head";(0,l.useEffect)(()=>{k(JSON.parse(D).repoDir)},[D]);let W=JSON.parse(D).repoDir||p.mirror.rootDir||"";(0,l.useEffect)(()=>{let e=!1;return W.trim()?(c.FH.repoCheck(W).then(s=>{var n;e||I(s.ok?null:null!=(n=s.problem)?n:null)}).catch(()=>{e||I(null)}),()=>{e=!0}):void I(null)},[W]);let O=(0,l.useCallback)(()=>{c.FH.vcsStatus(p.id).then(b).catch(()=>b(null))},[p.id]);(0,l.useEffect)(O,[O,D]);let E=async e=>{try{await c.FH.updateSession(p.id,{vcs:e}),w(j("vcs.saved")),v(),O()}catch(e){w(e.message)}},A=async()=>{S(!0),w(j("mirror.browsing"));try{let s=await c.FH.browseFolder(f.trim()||p.mirror.rootDir||void 0);if(s.ok)k(s.path),await E({repoDir:s.path});else{var e;w(s.cancelled?j("mirror.browseCancelled"):null!=(e=s.reason)?e:"")}}catch(e){w(e.message)}finally{S(!1)}},B=g.repoDir||p.mirror.rootDir||"",U=""!==B.trim()&&null===H;return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("h2",{className:"grow",style:{margin:0},children:j("vcs.title")}),(0,a.jsx)("span",{className:"badge ".concat(g.enabled?"done":""),children:g.enabled?j("vcs.on"):j("vcs.off")})]}),(0,a.jsx)("p",{className:"muted small",children:j("vcs.hint")}),(0,a.jsx)("label",{htmlFor:"vcs-root",children:j("vcs.repoField")}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("input",{id:"vcs-root",type:"text",className:"grow",value:f,onChange:e=>k(e.target.value),onBlur:()=>f.trim()!==g.repoDir&&void E({repoDir:f.trim()}),placeholder:p.mirror.rootDir||"C:\\Projects\\my-app",disabled:p.running}),(0,a.jsx)("button",{onClick:()=>void A(),disabled:C||p.running,children:j("mirror.browse")})]}),(0,a.jsx)(x.H4,{current:f,onUse:e=>{k(e),E({repoDir:e})}}),H&&(0,a.jsxs)("div",{className:"notice caution",style:{marginTop:8},children:[(0,a.jsx)("strong",{children:j("vcs.noRepo")}),(0,a.jsx)("div",{className:"small",style:{marginTop:4},children:H}),(0,a.jsx)("div",{className:"muted small",style:{marginTop:6},children:j("vcs.noRepoHow")})]}),!H&&""!==B.trim()&&(0,a.jsx)("p",{className:"muted small",style:{marginTop:4},children:j("vcs.repoOk")}),""===B.trim()&&(0,a.jsx)("p",{className:"muted small",style:{marginTop:4},children:j("vcs.pickFirst")}),(0,a.jsxs)("div",{className:"option".concat(U||g.enabled?"":" warned"),children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:g.enabled,onChange:e=>void E({enabled:e.target.checked}),disabled:p.running||!U&&!g.enabled}),(0,a.jsx)("span",{children:j("vcs.enable")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.enableWhy")})]}),g.enabled&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"muted small",style:{marginTop:4},children:B?j("vcs.repoIs",{dir:B}):j("vcs.repoNone")}),B&&!H&&(0,a.jsx)(F.b,{dir:B}),(0,a.jsx)("h3",{children:j("vcs.branches")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"branchMode",checked:"per-task"===g.branchMode,onChange:()=>void E({branchMode:"per-task"}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.perTask")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.perTaskWhy")})]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"branchMode",checked:"per-session"===g.branchMode,onChange:()=>void E({branchMode:"per-session"}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.perSession")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.perSessionWhy")})]}),"per-session"===g.branchMode&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"vcs-branch-name",children:j("vcs.branchName")}),(0,a.jsx)("input",{id:"vcs-branch-name",type:"text",value:T,onChange:e=>M(e.target.value),onBlur:()=>{var e;return T.trim()!==(null!=(e=g.branchName)?e:"")&&void E({branchName:T.trim()})},placeholder:p.name,disabled:p.running}),(0,a.jsx)("p",{className:"why",children:j("vcs.branchNameWhy")})]}),(0,a.jsx)("h3",{children:j("vcs.startFrom")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"startFrom",checked:"branch"===R,onChange:()=>void E({startFrom:"branch"}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.startBranch")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.startBranchWhy")})]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"startFrom",checked:"previous-session"===R,onChange:()=>void E({startFrom:"previous-session"}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.startPrevious")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.startPreviousWhy")})]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"startFrom",checked:"head"===R,onChange:()=>void E({startFrom:"head"}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.startHead")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.startHeadWhy")})]}),"head"!==R&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"vcs-base-branch",children:j("vcs.baseBranch")}),(0,a.jsx)("input",{id:"vcs-base-branch",type:"text",value:P,onChange:e=>L(e.target.value),onBlur:()=>{var e;return P.trim()!==(null!=(e=g.baseBranch)?e:"")&&void E({baseBranch:P.trim()})},placeholder:"main",disabled:p.running}),(0,a.jsx)("p",{className:"why",children:j("vcs.baseBranchWhy")})]}),p.vcsStart&&(0,a.jsxs)("p",{className:"muted small",children:["previous-session"===p.vcsStart.kind?j("vcs.startedPrevious",{name:null!=(o=null==(s=p.vcsStart.fromSession)?void 0:s.name)?o:"",branch:null!=(m=p.vcsStart.branch)?m:"",commit:p.vcsStart.commit.slice(0,8)}):"branch"===p.vcsStart.kind?j("vcs.startedBranch",{branch:null!=(h=p.vcsStart.branch)?h:"",commit:p.vcsStart.commit.slice(0,8)}):j("vcs.startedHead",{commit:p.vcsStart.commit.slice(0,8)}),p.vcsStart.note?" — ".concat(p.vcsStart.note):""]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:g.commitOnFinish,onChange:e=>void E({commitOnFinish:e.target.checked}),disabled:p.running}),(0,a.jsx)("span",{children:j("vcs.commit")})]}),(0,a.jsx)("p",{className:"why",children:j("vcs.commitWhy")})]}),y&&!y.ok&&(0,a.jsxs)("div",{className:"notice caution",role:"status",children:[(0,a.jsx)("strong",{children:j("vcs.notReady")})," ",y.problem]}),(null==y?void 0:y.ok)&&(0,a.jsx)("div",{className:"muted small",children:j("vcs.ready",{branch:null!=(u=y.branch)?u:"—",dir:y.repoDir})}),(null==y?void 0:y.ok)&&y.work&&y.work.branches.length>0&&(0,a.jsxs)("div",{className:"muted small",children:["per-session"===y.work.mode&&y.work.complete?j("vcs.completeOn",{branch:y.work.complete}):j("vcs.noSingleBranch",{n:y.work.branches.length}),"per-task"===y.work.mode&&(0,a.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:y.work.branches.map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.branch})," — ",e.title,e.commit?"":" (".concat(j("vcs.taskNoFiles"),")")]},e.branch))})]}),(0,a.jsx)("p",{className:"muted small",children:j("vcs.pushIsYours")})]}),(0,a.jsx)("div",{className:"muted small",role:"status",children:N})]})}function R(e){var s,n,t,r;let{session:i,onChange:o}=e,{t:m}=(0,d.kj)(),[h,v]=(0,l.useState)(i.mirror.enabled),[j,f]=(0,l.useState)(i.mirror.rootDir),[k,b]=(0,l.useState)(i.mirror.includeDirs.join("\n")),[N,w]=(0,l.useState)(i.mirror.excludeDirs.join("\n")),[C,S]=(0,l.useState)(null==(s=i.mirror.respectGitignore)||s),[F,D]=(0,l.useState)(null!=(n=i.mirror.includeEnvFiles)&&n),[H,I]=(0,l.useState)(null),[T,M]=(0,l.useState)(null),[P,L]=(0,l.useState)(""),[R,O]=(0,l.useState)(""),[E,A]=(0,l.useState)([]),B=JSON.stringify(i.mirror);(0,l.useEffect)(()=>{var e,s;let n=JSON.parse(B);v(n.enabled),f(n.rootDir),b(n.includeDirs.join("\n")),w(n.excludeDirs.join("\n")),S(null==(e=n.respectGitignore)||e),D(null!=(s=n.includeEnvFiles)&&s)},[B]),(0,l.useEffect)(()=>{c.FH.doctor().then(e=>{var s;return A(null!=(s=e.alwaysIgnoredDirs)?s:[])}).catch(()=>void 0)},[]);let U=p(k),G=p(N),z=function(e,s){let n=e.map(u).filter(Boolean),a=s.map(u).filter(Boolean),l=[];for(let e of n)for(let s of a)if(e.toLowerCase()===s.toLowerCase())l.push({include:e,exclude:s,kind:"same"});else("."===s?"."!==e:e.toLowerCase().startsWith("".concat(s.toLowerCase(),"/")))&&l.push({include:e,exclude:s,kind:"excluded-parent"});return l}(U,G),q={rootDir:j.trim(),includeDirs:U,excludeDirs:G,respectGitignore:C,includeEnvFiles:F},J=h&&!q.rootDir,Z=z.length>0||J,_=JSON.stringify({enabled:i.mirror.enabled,rootDir:i.mirror.rootDir,includeDirs:i.mirror.includeDirs,excludeDirs:i.mirror.excludeDirs,respectGitignore:null==(t=i.mirror.respectGitignore)||t,includeEnvFiles:null!=(r=i.mirror.includeEnvFiles)&&r}),K=JSON.stringify({enabled:h,...q}),Y=async()=>{if(!Z)try{await c.FH.updateSession(i.id,{mirror:{enabled:h,...q}}),O(m("mirror.saved")),o()}catch(e){O(e.message)}},$=async()=>{try{I(await c.FH.dirs(j,C)),O("")}catch(e){O(e.message)}},Q=async()=>{L("browse"),O(m("mirror.browsing"));try{let s=await c.FH.browseFolder(j.trim()||void 0);if(s.ok)f(s.path),I(null),M(null),O("");else{var e;O(s.cancelled?m("mirror.browseCancelled"):null!=(e=s.reason)?e:"")}}catch(e){O(e.message)}finally{L("")}},V=async()=>{if(!q.rootDir)return void O(m("mirror.needRoot"));L("check"),O(m("mirror.checking"));try{M(await c.FH.previewMirror(q)),O("")}catch(e){M(null),O(e.message)}finally{L("")}},X=async e=>{(!e||await (0,y.Z)(m("mirror.envWarn")))&&(D(e),M(null))};return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("h2",{className:"grow",style:{margin:0},children:m("mirror.title")}),(0,a.jsx)("span",{className:"badge ".concat(i.mirror.enabled?"done":""),children:i.mirror.enabled?m("mirror.stateOn"):m("mirror.stateOff")})]}),(0,a.jsx)("p",{className:"muted small",children:m("mirror.hint",{example:"src--test--a.spec.ts.txt"})}),(0,a.jsx)("div",{className:"option",children:(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:h,onChange:e=>v(e.target.checked)}),(0,a.jsx)("span",{children:m("mirror.enable")})]})}),(0,a.jsx)("label",{htmlFor:"mirror-root",children:m("mirror.root")}),(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("input",{id:"mirror-root",type:"text",className:"grow",value:j,onChange:e=>{f(e.target.value),M(null)},placeholder:"C:\\Projects\\my-app"}),(0,a.jsx)("button",{onClick:()=>void Q(),disabled:"browse"===P,children:m("mirror.browse")}),(0,a.jsx)("button",{onClick:()=>void $(),disabled:!j.trim(),children:m("mirror.listDirs")})]}),(0,a.jsx)("div",{className:"muted small",style:{marginTop:4},children:m("mirror.rootHint")}),(0,a.jsx)(x.H4,{current:j,onUse:e=>{f(e),M(null)}}),H&&(0,a.jsx)("div",{className:"small muted",style:{margin:"6px 0"},children:0===H.length?m("mirror.noDirs"):H.join(" \xb7 ")}),(0,a.jsx)("h3",{children:m("mirror.rules")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:C,onChange:e=>{S(e.target.checked),M(null)}}),(0,a.jsx)("span",{children:m("mirror.gitignore")})]}),(0,a.jsx)("p",{className:"why",children:m("mirror.gitignoreWhy")})]}),(0,a.jsxs)("div",{className:"option".concat(F?" warned":""),children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:F,onChange:e=>X(e.target.checked)}),(0,a.jsx)("span",{children:m("mirror.env")})]}),(0,a.jsx)("p",{className:"why",children:m("mirror.envWhy")}),F&&(0,a.jsx)("p",{className:"why",children:(0,a.jsx)("strong",{children:m("mirror.envOn")})})]}),E.length>0&&(0,a.jsx)("p",{className:"muted small",children:m("mirror.alwaysOut",{dirs:E.join(", ")})}),(0,a.jsxs)("div",{className:"row",style:{alignItems:"flex-start"},children:[(0,a.jsxs)("div",{className:"grow",children:[(0,a.jsx)("label",{htmlFor:"mirror-include",children:m("mirror.include")}),(0,a.jsx)("textarea",{id:"mirror-include",value:k,onChange:e=>{b(e.target.value),M(null)},placeholder:"src\ntests",style:{minHeight:80},"aria-invalid":z.length>0})]}),(0,a.jsxs)("div",{className:"grow",children:[(0,a.jsx)("label",{htmlFor:"mirror-exclude",children:m("mirror.exclude")}),(0,a.jsx)("textarea",{id:"mirror-exclude",value:N,onChange:e=>{w(e.target.value),M(null)},placeholder:"src/generated",style:{minHeight:80},"aria-invalid":z.length>0})]})]}),(0,a.jsx)(g.k,{rootDir:j,respectGitignore:C,includeEnvFiles:F,include:k.split("\n"),exclude:N.split("\n"),onChange:(e,s)=>{b(e.join("\n")),w(s.join("\n")),M(null)}}),z.length>0&&(0,a.jsxs)("div",{className:"notice",role:"alert",children:[(0,a.jsx)("strong",{children:m("mirror.conflict")}),(0,a.jsx)("ul",{children:z.map((e,s)=>(0,a.jsx)("li",{children:"same"===e.kind?m("mirror.conflictSame",{dir:e.include}):m("mirror.conflictParent",{include:e.include,exclude:e.exclude})},s))}),(0,a.jsx)("div",{style:{marginTop:6},children:m("mirror.conflictFix")})]}),J&&(0,a.jsx)("div",{className:"notice caution",role:"alert",children:(0,a.jsx)("strong",{children:m("mirror.needRoot")})}),K!==_&&(0,a.jsxs)("div",{className:"notice caution",role:"status",children:[(0,a.jsx)("strong",{children:m("mirror.unsaved")})," ",m("mirror.unsavedWhy")]}),(0,a.jsxs)("div",{className:"row",style:{marginTop:10},children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void Y(),disabled:Z,children:m("mirror.save")}),(0,a.jsx)("button",{onClick:()=>void V(),disabled:z.length>0||"check"===P,children:m("mirror.check")}),(0,a.jsx)("span",{className:"muted small",role:"status",children:R})]}),T&&(0,a.jsx)(W,{preview:T})]})}function W(e){let{preview:s}=e,{t:n}=(0,d.kj)();return 0===s.files.length?(0,a.jsx)("div",{className:"notice caution",style:{marginTop:10},children:(0,a.jsx)("strong",{children:n("mirror.checkedNone")})}):(0,a.jsxs)("div",{className:"notice calm",style:{marginTop:10},children:[(0,a.jsx)("strong",{children:n("mirror.checked",{files:s.files.length,size:(0,c.zi)(s.totalBytes)})})," ",s.envFiles.length>0&&(0,a.jsx)("span",{className:"err",children:n("mirror.checkedEnv",{n:s.envFiles.length})})," ",s.skipped.length>0&&(0,a.jsx)("span",{className:"muted",children:n("mirror.checkedSkipped",{n:s.skipped.length})}),(0,a.jsxs)("details",{style:{marginTop:6},children:[(0,a.jsx)("summary",{children:n("mirror.showFiles")}),(0,a.jsx)("pre",{className:"tall",children:s.files.join("\n")})]}),s.skipped.length>0&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:n("mirror.showSkipped")}),(0,a.jsx)("pre",{className:"tall",children:s.skipped.map(e=>"".concat(e.relPath," — ").concat(e.reason)).join("\n")})]})]})}function O(e){var s;let{session:n,onChange:t}=e,{t:r}=(0,d.kj)(),[i,o]=(0,l.useState)(""),m=null!=(s=n.onFailure)?s:"stop",h=async e=>{if(e!==m)try{await c.FH.updateSession(n.id,{onFailure:e}),o(r("stop"===e?"chain.savedStop":"chain.savedContinue")),t()}catch(e){o(e.message)}};return(0,a.jsxs)("fieldset",{style:{border:0,padding:0,margin:"10px 0 14px"},children:[(0,a.jsx)("legend",{className:"muted small",style:{padding:0},children:r("chain.title")}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"chain",checked:"stop"===m,onChange:()=>void h("stop"),disabled:n.running}),(0,a.jsx)("span",{children:r("chain.stop")})]}),(0,a.jsx)("p",{className:"why",children:r("chain.stopWhy")})]}),(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"radio",name:"chain",checked:"continue"===m,onChange:()=>void h("continue"),disabled:n.running}),(0,a.jsx)("span",{children:r("chain.continue")})]}),(0,a.jsx)("p",{className:"why",children:r("chain.continueWhy")})]}),i&&(0,a.jsx)("div",{className:"muted small",role:"status",children:i}),n.running&&(0,a.jsx)("div",{className:"muted small",children:r("chain.locked")})]})}function E(e){let{value:s,onChange:n,presets:t,onPresetsChanged:r}=e,{t:i}=(0,d.kj)(),o=(0,l.useId)(),[m,h]=(0,l.useState)(""),u=async()=>{let e=prompt(i("l2.saveAsPrompt"));if(e)try{await c.FH.savePreset(e,s),h(i("l2.savedAs",{name:e})),null==r||r()}catch(e){h(e.message)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("label",{className:"grow",style:{margin:0},htmlFor:"".concat(o,"-text"),children:i("l2.label")}),(0,a.jsxs)("select",{value:"","aria-label":i("l2.loadPreset"),onChange:e=>{let s=t.find(s=>s.name===e.target.value);s&&n(s.content)},children:[(0,a.jsx)("option",{value:"",children:i("l2.loadPreset")}),t.map(e=>(0,a.jsx)("option",{value:e.name,children:e.name},e.name))]}),(0,a.jsx)("button",{onClick:()=>void u(),disabled:!s.trim(),children:i("l2.saveAs")})]}),(0,a.jsx)("textarea",{id:"".concat(o,"-text"),className:"prose",value:s,onChange:e=>n(e.target.value),placeholder:i("l2.placeholder"),style:{minHeight:140,marginTop:10}}),m&&(0,a.jsx)("div",{className:"muted small",children:m})]})}function A(e){let{session:s}=e,{t:n}=(0,d.kj)(),t=(0,d.W3)(),r=s.tasks.filter(e=>"queued"!==e.status),[i,o]=(0,l.useState)([]),m=i.length>0?i:r.map(e=>e.id),h=e=>(0,c.ub)("".concat(c.nC,"/sessions/").concat(s.id,"/export?variant=").concat(e)+(i.length>0?"&tasks=".concat(encodeURIComponent(i.join(","))):""));return(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsx)("h2",{children:n("export.title")}),(0,a.jsx)("p",{className:"muted small",children:n("export.hint")}),0===r.length?(0,a.jsx)("div",{className:"empty",children:n("export.nothing")}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"row",style:{marginBottom:6},children:[(0,a.jsx)("button",{className:"quiet",onClick:()=>o(r.map(e=>e.id)),children:n("export.all")}),(0,a.jsx)("button",{className:"quiet",onClick:()=>o([]),children:n("export.none")}),(0,a.jsx)("span",{className:"muted small",children:i.length>0?n("export.selected",{n:i.length}):n("export.allOf",{n:r.length})})]}),r.map(e=>{var s,l,r,c,d;return(0,a.jsx)("div",{className:"option",style:{margin:"6px 0"},children:(0,a.jsxs)("label",{children:[(0,a.jsx)("input",{type:"checkbox",checked:i.includes(e.id),onChange:()=>{let s;return s=e.id,o(e=>e.includes(s)?e.filter(e=>e!==s):[...e,s])}}),(0,a.jsxs)("span",{children:[e.title," ",(0,a.jsx)("span",{className:"badge ".concat(e.status),children:n("status.".concat(e.status))})," ",e.readOnly&&(0,a.jsx)("span",{className:"chip",children:n("task.readOnly")})," ",(null!=(l=null==(s=e.scope)?void 0:s.length)?l:0)>0&&(0,a.jsx)("span",{className:"chip",children:n("task.scope",{paths:(null!=(r=e.scope)?r:[]).join(", ")})})," ",(0,a.jsx)("span",{className:"muted small",children:t(null!=(d=null!=(c=e.finishedAt)?c:e.startedAt)?d:e.createdAt)})]})]})},e.id)}),(0,a.jsxs)("div",{className:"row",style:{marginTop:10},children:[(0,a.jsx)("a",{className:"button-link",href:h("outcome"),download:!0,children:n("export.outcome",{n:m.length})}),(0,a.jsx)("a",{className:"button-link",href:h("full"),download:!0,children:n("export.full",{n:m.length})})]}),(0,a.jsx)("p",{className:"muted small",style:{marginTop:8},children:n("export.outcomeWhy")})]})]})}function B(e){let{handoff:s}=e,{t:n}=(0,d.kj)(),l=(e,s)=>(0,a.jsxs)("div",{className:"handoff-row",children:[(0,a.jsx)("strong",{children:n(e)})," ",s]}),t=e=>(0,a.jsx)("ul",{children:e.map((e,s)=>(0,a.jsx)("li",{children:e},s))}),r=s.validation.filter(e=>e.passed).length;return(0,a.jsxs)("div",{className:"summary handoff",children:[(0,a.jsx)("strong",{children:n("handoff.title")}),l("handoff.outcome",(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"badge ".concat(s.outcome.status),children:n("status.".concat(s.outcome.status))}),s.outcome.reason?" ".concat(s.outcome.reason):""]})),l("handoff.files",0===s.changedFiles.length?(0,a.jsx)("span",{className:"muted",children:n("handoff.noFiles")}):(0,a.jsx)("code",{children:s.changedFiles.map(e=>"".concat(e.path).concat(e.added>=0?" +".concat(e.added,"/-").concat(e.removed):"")).join(", ")})),s.validation.length>0&&l("handoff.validation",(0,a.jsxs)(a.Fragment,{children:[n("handoff.passed",{n:r,of:s.validation.length}),s.review?" \xb7 ".concat(n("handoff.review",{verdict:s.review.verdict,open:s.review.open})):""]})),l("handoff.issues",0===s.knownIssues.length?(0,a.jsx)("span",{className:"muted",children:n("handoff.noIssues")}):t(s.knownIssues)),s.evidence.runId&&l("handoff.evidence",(0,a.jsx)("code",{children:s.evidence.runId})),(s.vcs.branch||s.vcs.problem)&&l("handoff.vcs",(0,a.jsxs)(a.Fragment,{children:[s.vcs.branch&&(0,a.jsx)("code",{children:s.vcs.branch}),s.vcs.commit?" @ ".concat(s.vcs.commit.slice(0,8)," \xb7 ").concat(n("handoff.notPushed")):s.vcs.branch?" \xb7 ".concat(n("handoff.noCommit")):"",s.vcs.problem?" — ".concat(s.vcs.problem):""]})),s.manual.length>0&&l("handoff.manual",t(s.manual)),s.notExecuted.length>0&&l("handoff.notRun",t(s.notExecuted))]})}function U(e){var s;let{session:n,presets:t,onAdded:r,onPresetsChanged:i}=e,{t:o}=(0,d.kj)(),m=[...n.tasks].reverse()[0],[h,u]=(0,l.useState)(""),[p,v]=(0,l.useState)(null!=(s=null==m?void 0:m.level2)?s:""),[x,j]=(0,l.useState)(""),[g,f]=(0,l.useState)(""),[k,y]=(0,l.useState)(!1),b=(0,l.useRef)(!1),N=async()=>{if(!b.current){b.current=!0,y(!0);try{await c.FH.addTask(n.id,{title:h,level2:p,prompt:x}),u(""),j(""),f(o("form.queued")),r()}catch(e){f(e.message)}finally{b.current=!1,y(!1)}}};return(0,a.jsxs)("div",{className:"panel",id:"new-task",children:[(0,a.jsx)("h2",{children:o("form.title")}),(0,a.jsx)("p",{className:"muted small",children:o("form.hint")}),(0,a.jsx)("label",{htmlFor:"new-task-title",children:o("form.titleLabel")}),(0,a.jsx)("input",{id:"new-task-title",type:"text",value:h,onChange:e=>u(e.target.value),placeholder:o("form.titlePlaceholder")}),(0,a.jsx)("div",{style:{marginTop:10},children:(0,a.jsx)(E,{value:p,onChange:v,presets:t,onPresetsChanged:i})}),(0,a.jsx)("label",{htmlFor:"new-task-prompt",children:o("form.taskLabel")}),(0,a.jsx)("textarea",{id:"new-task-prompt",className:"prose",value:x,onChange:e=>j(e.target.value),placeholder:o("form.taskPlaceholder"),style:{minHeight:140}}),(0,a.jsxs)("div",{className:"row",style:{marginTop:10},children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void N(),disabled:k||!x.trim(),children:o("form.add")}),(0,a.jsx)("span",{className:"muted small",children:g})]})]})}function G(e){var s,n,t,r,i,u,p,v,x,j,g,N,C,F,D,H,I,T,M,P,L,R,W,O,A,U,G,z,J,Y,$,Q,V,X,ee,es,en,ea,el,et,er,ei,ec,ed,eo,em,eh,eu,ep,ev,ex,ej,eg,ef,ek,ey,eb,eN,ew,eC,eS,eF,eD,eH,eI,eT,eM,eP,eL,eR,eW,eO,eE,eA;let{session:eB,task:eU,index:eG,presets:ez,onChange:eq}=e,{t:eJ}=(0,d.kj)(),eZ=(0,d.W3)(),[e_,eK]=(0,l.useState)(!1),[eY,e$]=(0,l.useState)(!1),[eQ,eV]=(0,l.useState)(eU.title),[eX,e0]=(0,l.useState)(eU.level2),[e1,e2]=(0,l.useState)(eU.prompt),[e4,e6]=(0,l.useState)(null!=(Q=null==(s=eU.vcsPlan)?void 0:s.branch)?Q:""),[e8,e3]=(0,l.useState)(null!=(V=null==(n=eU.vcsPlan)?void 0:n.commitMessage)?V:""),[e5,e7]=(0,l.useState)(null!=(X=eU.checks)?X:[]),[e9,se]=(0,l.useState)(!!eU.readOnly),[ss,sn]=(0,l.useState)((null!=(ee=eU.scope)?ee:[]).join("\n")),sa={readOnly:e9,scope:e9?[]:(0,S.w)(ss)},sl=(0,h.c)((0,m.DG)(eU)),[st,sr]=(0,l.useState)(null),[si,sc]=(0,l.useState)(""),sd=async()=>{try{await c.FH.updateTask(eB.id,eU.id,{title:eQ,level2:eX,prompt:e1,vcsPlan:{branch:e4,commitMessage:e8},checks:e5,...sa}),eK(!1),eq()}catch(e){sc(e.message)}},so="running"===eU.status||"waiting-approval"===eU.status,sm=!so&&"queued"!==eU.status,sh=!so&&"queued"!==eU.status,su=!so&&null!=(es=null==(t=eB.vcs)?void 0:t.enabled)&&es&&(!!(null==(r=eU.vcs)?void 0:r.baseCommit)||(null!=(en=eU.attempts)?en:[]).some(e=>{var s;return null==(s=e.vcs)?void 0:s.baseCommit})),sp=!so&&(0,c.Zm)(eU),sv=async()=>{if(await (0,y.Z)(eJ("task.continueConfirm",{title:eU.title})))try{await c.FH.continueTask(eB.id,eU.id),eq()}catch(e){sc(e.message)}},sx=async()=>{if(await (0,y.Z)(eJ("task.rerunConfirm",{title:eU.title})))try{await c.FH.rerunTask(eB.id,eU.id),eq()}catch(e){sc(e.message)}},sj=async()=>{if(await (0,y.Z)(eJ("task.editRanConfirm",{title:eU.title})))try{await c.FH.rerunTask(eB.id,eU.id,{title:eQ,level2:eX,prompt:e1,vcsPlan:{branch:e4,commitMessage:e8},checks:e5,...sa},{buildOnFinished:"done"===eU.status}),eK(!1),eq()}catch(e){sc(e.message)}},sg=(0,w.e)(eq),sf=async()=>{let e="queued"===eU.status?"task.deleteConfirm":"task.deleteConfirmRan";if(await (0,y.Z)(eJ(e,{title:eU.title})))try{await c.FH.deleteTask(eB.id,eU.id),eq()}catch(e){sc(e.message)}},sk=async()=>{try{sr(await c.FH.taskFiles(eB.id,eU.id))}catch(e){sc(e.message)}},sy=(e,s,n)=>n.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("span",{className:"muted",children:[eJ(e)," "]}),n.map(e=>(0,a.jsx)("span",{style:{marginRight:10},children:(0,a.jsx)(o.u,{label:e,save:()=>c.FH.saveTaskFile(eB.id,eU.id,s,e)})},e))]});return(0,a.jsxs)("div",{className:"task ".concat(eU.status),id:eU.id,children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsxs)("h4",{className:"grow",children:[eG,". ",eU.title]}),(0,a.jsx)("span",{className:"badge ".concat(eU.status),children:eJ("status.".concat(eU.status))}),eU.limit&&(0,a.jsx)("span",{className:"chip",title:eJ("reg.limitChipWhy"),children:eJ("reg.limitChip",{limit:eJ("limit.".concat(eU.limit.setting),{n:eU.limit.value})})}),(null!=(ea=eU.attempt)?ea:1)>1&&(0,a.jsx)("span",{className:"chip",children:eJ("task.attemptN",{n:null!=(el=eU.attempt)?el:1})}),eU.iterations>0&&(0,a.jsx)("span",{className:"muted small",children:eJ("task.iterations",{n:eU.iterations})}),eU.runId&&(0,a.jsxs)("button",{className:eY?"":"quiet","aria-expanded":eY,onClick:()=>e$(e=>!e),title:(0,m.DG)(eU)?eJ("story.showLiveWhy"):eJ("story.why"),children:[(0,m.DG)(eU)&&!eY&&(0,a.jsx)("span",{className:"dot","aria-hidden":"true"}),eY?eJ("story.hide"):(0,m.DG)(eU)?eJ("story.showLive"):eJ("story.show")]}),!so&&(0,a.jsx)("button",{onClick:()=>{if(!e_){var e,s,n,a,l,t;eV(eU.title),e0(eU.level2),e2(eU.prompt),e6(null!=(n=null==(e=eU.vcsPlan)?void 0:e.branch)?n:""),e3(null!=(a=null==(s=eU.vcsPlan)?void 0:s.commitMessage)?a:""),e7(null!=(l=eU.checks)?l:[]),se(!!eU.readOnly),sn((null!=(t=eU.scope)?t:[]).join("\n"))}eK(!e_)},title:eJ("task.editAll"),children:e_?eJ("task.cancel"):eJ("task.edit")}),sp&&(0,a.jsx)("button",{className:"primary",onClick:()=>void sv(),title:eJ("task.continueWhy"),children:eJ("task.continue")}),sh&&(0,a.jsx)("button",{className:sp?"":"primary",onClick:()=>void sx(),title:eJ("task.rerunWhy"),children:eJ("task.rerun")}),su&&(0,a.jsx)("button",{onClick:()=>void sg.restore({sessionId:eB.id,taskId:eU.id,title:eU.title}),disabled:""!==sg.busy||eB.running,title:eJ("restore.why"),children:"restore"===sg.busy?eJ("restore.checking"):eJ("restore.button")}),sm&&(0,a.jsx)("button",{onClick:()=>void sg.restartFrom({sessionId:eB.id,taskId:eU.id,title:eU.title}),disabled:""!==sg.busy||eB.running,title:eJ("restart.why"),children:"restart"===sg.busy?eJ("restart.checking"):eJ("restart.button")}),!so&&(0,a.jsx)("button",{className:"danger",onClick:()=>void sf(),children:eJ("task.delete")}),!e_&&(si||sg.message)&&(0,a.jsx)("span",{className:"err",role:"alert",children:si||sg.message})]}),(0,a.jsxs)("div",{className:"muted small",children:[eU.startedAt?eJ("task.started",{t:eZ(eU.startedAt)}):eJ("task.added",{t:eZ(eU.createdAt)}),eU.finishedAt?" \xb7 ".concat(eJ("task.finished",{t:eZ(eU.finishedAt)})):"",eU.startedAt&&eU.finishedAt?" \xb7 ".concat(eJ("task.took",{d:(0,c.c5)((0,m.d5)(eU.startedAt,eU.finishedAt))})):"",(0,m.DG)(eU)?" \xb7 ".concat(eJ("task.runningFor",{d:(0,c.c5)((0,m.d5)(eU.startedAt,void 0,sl))})):""]}),"queued"!==eU.status&&(null==(i=eB.vcs)?void 0:i.enabled)&&eU.vcs&&(0,a.jsx)("div",{className:"muted small",children:eU.vcs.problem&&!eU.vcs.branch?(0,a.jsx)("span",{className:"reason",children:eJ("vcs.taskProblem",{problem:eU.vcs.problem})}):(0,a.jsxs)(a.Fragment,{children:[eU.vcs.branch&&eJ("vcs.taskBranch",{branch:eU.vcs.branch}),eU.vcs.baseCommit&&" \xb7 ".concat(eJ("vcs.taskBase",{commit:eU.vcs.baseCommit.slice(0,8)})),eU.vcs.commit?" \xb7 ".concat(eJ("vcs.taskCommit",{commit:eU.vcs.commit.slice(0,8)})):" \xb7 ".concat(eJ("vcs.taskNoFiles")),(null!=(et=null==(u=eU.vcs.files)?void 0:u.length)?et:0)>0&&(0,a.jsxs)("details",{style:{display:"inline"},children:[(0,a.jsxs)("summary",{style:{display:"inline",cursor:"pointer"},children:[" \xb7 ",eJ("vcs.taskFiles",{n:null!=(er=null==(p=eU.vcs.files)?void 0:p.length)?er:0})]}),(0,a.jsx)("ul",{style:{margin:"4px 0 4px 0",paddingLeft:20},children:(null!=(ei=eU.vcs.files)?ei:[]).map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.path})," ",e.added<0||e.removed<0?eJ("vcs.taskBinary"):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{style:{color:"var(--ok)"},children:["+",e.added]})," ",(0,a.jsxs)("span",{style:{color:"var(--bad)"},children:["-",e.removed]})]})]},e.path))})]}),eU.vcs.commit&&eU.vcs.baseCommit&&(0,a.jsxs)(a.Fragment,{children:[" \xb7 ",(0,a.jsx)(b.C,{sessionId:eB.id,taskId:eU.id,title:eU.title,files:null!=(ec=null==(v=eU.vcs.files)?void 0:v.length)?ec:0})]}),(null!=(ed=null==(x=eU.vcs.suspicious)?void 0:x.length)?ed:0)>0&&(0,a.jsxs)("div",{className:"err small",style:{marginTop:4},children:[eJ("vcs.suspicious",{n:null!=(eo=null==(j=eU.vcs.suspicious)?void 0:j.length)?eo:0}),(0,a.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(em=eU.vcs.suspicious)?em:[]).map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.path})," — ",e.reason]},e.path))})]}),(null!=(eh=null==(g=eU.scopeReverted)?void 0:g.length)?eh:0)>0&&(0,a.jsx)("div",{className:"small",style:{marginTop:4},children:eJ("task.scopeReverted",{n:null!=(eu=null==(N=eU.scopeReverted)?void 0:N.length)?eu:0,paths:(null!=(ep=eU.scopeReverted)?ep:[]).join(", ")})}),(null!=(ev=null==(C=eU.vcs.foreignCommits)?void 0:C.length)?ev:0)>0&&(0,a.jsxs)("div",{className:"err small",style:{marginTop:4},children:[eJ("vcs.foreignCommits",{n:null!=(ex=null==(F=eU.vcs.foreignCommits)?void 0:F.length)?ex:0}),(0,a.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(ej=eU.vcs.foreignCommits)?ej:[]).map(e=>(0,a.jsx)("li",{children:(0,a.jsx)("code",{children:e})},e))})]})]})}),"queued"===eU.status&&(null==(D=eB.vcs)?void 0:D.enabled)&&((null==(H=eU.vcsPlan)?void 0:H.branch)||(null==(I=eU.vcsPlan)?void 0:I.commitMessage))&&(0,a.jsx)("div",{className:"muted small",children:eU.vcsPlan.branch&&eU.vcsPlan.commitMessage?eJ("task.gitNames",{branch:eU.vcsPlan.branch,subject:eU.vcsPlan.commitMessage.split("\n")[0]}):eU.vcsPlan.branch?eJ("task.gitBranchOnly",{branch:eU.vcsPlan.branch}):eJ("task.gitCommitOnly",{subject:(null!=(eg=eU.vcsPlan.commitMessage)?eg:"").split("\n")[0]})}),eY&&eU.runId&&(0,a.jsx)(f.P,{sessionId:eB.id,taskId:eU.id,live:"running"===eU.status||"waiting-approval"===eU.status}),e_?(0,a.jsxs)("div",{style:{marginTop:8},children:[(0,a.jsx)("label",{children:eJ("form.titleLabel")}),(0,a.jsx)("input",{type:"text",value:eQ,onChange:e=>eV(e.target.value)}),(0,a.jsx)("div",{style:{marginTop:8},children:(0,a.jsx)(E,{value:eX,onChange:e0,presets:ez})}),(0,a.jsx)("label",{children:eJ("form.taskLabel")}),(0,a.jsx)("textarea",{className:"prose",value:e1,onChange:e=>e2(e.target.value)}),(null==(T=eB.vcs)?void 0:T.enabled)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"branch-".concat(eU.id),children:eJ("task.branch")}),(0,a.jsx)("input",{id:"branch-".concat(eU.id),type:"text",value:e4,onChange:e=>e6(e.target.value),placeholder:eB.vcs.branchPrefix,disabled:"per-session"===eB.vcs.branchMode}),(0,a.jsx)("p",{className:"why",children:"per-session"===eB.vcs.branchMode?eJ("task.branchIgnored"):eJ("task.branchWhy")}),(0,a.jsx)("label",{htmlFor:"commit-".concat(eU.id),children:eJ("task.commitMessage")}),(0,a.jsx)("textarea",{id:"commit-".concat(eU.id),value:e8,onChange:e=>e3(e.target.value),style:{minHeight:70}}),(0,a.jsx)("p",{className:"why",children:eJ("task.commitWhy")})]}),(0,a.jsx)(q,{checks:e5,onChange:e7}),e1.trim()!==eU.prompt.trim()&&(0,a.jsx)("p",{className:"notice caution small",children:eJ("task.newIntentNote")}),(0,a.jsx)(S.y,{readOnly:e9,scope:ss,onReadOnly:se,onScope:sn}),(0,a.jsxs)("div",{className:"row",style:{marginTop:8},children:[(0,a.jsx)("button",{className:"primary",onClick:()=>void(sm?sj():sd()),children:sm?eJ("task.saveAndRerun"):eJ("task.save")}),(0,a.jsx)("span",{className:"err",children:si})]}),sm&&(0,a.jsx)("p",{className:"muted small",children:eJ("task.editRanWhy")})]}):(0,a.jsxs)(a.Fragment,{children:[(null!=(ef=null==(M=eU.checks)?void 0:M.length)?ef:0)>0&&(0,a.jsxs)("details",{className:"small",style:{margin:"6px 0"},children:[(0,a.jsxs)("summary",{children:[eJ("checks.title")," — ",eJ("checks.n",{n:null!=(ek=null==(P=eU.checks)?void 0:P.length)?ek:0}),(null!=(ey=null==(L=eU.checkResults)?void 0:L.length)?ey:0)>0&&" \xb7 ".concat((null!=(eb=eU.checkResults)?eb:[]).filter(e=>e.passed).length,"/").concat(null==(R=eU.checkResults)?void 0:R.length," ").concat(eJ("checks.passed"))]}),(0,a.jsx)("ul",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(eN=eU.checks)?eN:[]).map((e,s)=>{var n;let l=(null!=(n=eU.checkResults)?n:[]).find(s=>s.name===e.name);return(0,a.jsxs)("li",{children:[(0,a.jsx)("strong",{children:e.name}),(0,a.jsxs)("span",{className:"muted",children:[" — ",eJ("checks.kind.".concat(e.expect)),e.value?' "'.concat(e.value,'"'):"",e.run?": ".concat(e.run):e.file?": ".concat(e.file):""]}),l&&(0,a.jsxs)("div",{className:l.passed?"muted":"reason",children:[l.passed?eJ("checks.passed"):eJ("checks.failed")," — ",l.detail]})]},"".concat(e.name,"-").concat(s))})})]}),(null!=(ew=null==(W=eU.reviewChecks)?void 0:W.length)?ew:0)>0&&(0,a.jsxs)("details",{className:"small",style:{margin:"6px 0"},children:[(0,a.jsx)("summary",{children:eJ("checks.fromReview",{n:null!=(eC=null==(O=eU.reviewChecks)?void 0:O.length)?eC:0})}),(0,a.jsx)("p",{className:"why",children:eJ("checks.fromReviewWhy")}),(0,a.jsx)("ul",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(eS=eU.reviewChecks)?eS:[]).map(e=>{var s;let n=(null!=(s=eU.checkResults)?s:[]).find(s=>s.name===e.check.name);return(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.findingId})," ",(0,a.jsx)("strong",{children:e.check.name}),"active"!==e.state&&(0,a.jsx)("span",{className:"chip",style:{marginLeft:6},children:eJ("checks.state.".concat(e.state))}),(0,a.jsx)("div",{className:"muted",children:e.what}),n&&(0,a.jsxs)("div",{className:n.passed?"muted":"reason",children:[n.passed?eJ("checks.passed"):eJ("checks.failed")," — ",n.detail]})]},e.check.name)})})]}),(0,a.jsx)(K,{review:eU.review}),eU.stopCode&&!(0,m.DG)(eU)&&(0,a.jsx)("p",{className:"small",children:(0,a.jsx)("span",{className:"chip",title:eJ("stop.why"),children:eJ("stop.".concat(eU.stopCode))})}),eU.handoff&&!(0,m.DG)(eU)&&(0,a.jsx)(B,{handoff:eU.handoff}),eU.summary&&(0,a.jsxs)("div",{className:"summary",children:[(0,a.jsx)("strong",{children:eJ("task.whatWasDone")}),(0,a.jsx)(k.s,{text:eU.summary})]}),(null!=(eF=null==(A=eU.deviations)?void 0:A.length)?eF:0)>0&&(0,a.jsx)(Z,{items:null!=(eD=eU.deviations)?eD:[]}),(null!=(eH=null==(U=eU.disputes)?void 0:U.length)?eH:0)>0&&(0,a.jsx)(_,{items:null!=(eI=eU.disputes)?eI:[]}),eU.environment&&(0,a.jsx)("div",{className:"muted small",style:{margin:"4px 0"},children:eJ("task.ranWith",{node:eU.environment.node,npm:null!=(eT=eU.environment.npm)?eT:"—",git:null!=(eM=eU.environment.git)?eM:"—",pwsh:null!=(eL=null!=(eP=eU.environment.pwsh)?eP:eU.environment.powershell)?eL:"—"})}),(null!=(eR=null==(G=eU.leftovers)?void 0:G.length)?eR:0)>0&&(0,a.jsxs)("div",{className:"err small",style:{margin:"6px 0"},children:[eJ("task.leftovers",{n:null!=(eW=null==(z=eU.leftovers)?void 0:z.length)?eW:0}),(0,a.jsx)("ul",{style:{margin:"4px 0",paddingLeft:20},children:(null!=(eO=eU.leftovers)?eO:[]).map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)("code",{children:e.name})," pid ",e.pid,e.ports.length>0?" \xb7 ".concat(eJ("task.leftoverPorts",{ports:e.ports.join(", ")})):""," \xb7 ",e.by]},"".concat(e.by,"-").concat(e.pid)))})]}),eU.reason&&(0,a.jsx)("div",{className:"reason small",style:{margin:"6px 0"},children:eU.reason}),(null!=(eE=null==(J=eU.attempts)?void 0:J.length)?eE:0)>0&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eJ("task.attempts",{n:null!=(eA=null==(Y=eU.attempts)?void 0:Y.length)?eA:0})}),null==($=eU.attempts)?void 0:$.map((e,s)=>{var n,l,t,r;return(0,a.jsxs)("div",{className:"small",style:{margin:"8px 0 12px"},children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("strong",{children:eJ("task.attemptN",{n:s+1})}),(0,a.jsx)("span",{className:"badge ".concat(e.status),children:eJ("status.".concat(e.status))}),e.iterations>0&&(0,a.jsx)("span",{className:"muted",children:eJ("task.iterations",{n:e.iterations})}),e.runId&&(0,a.jsx)(o.u,{label:eJ("save.attemptLog"),save:()=>c.FH.saveTaskLog(eB.id,eU.id,e.runId)}),e.runId&&(0,a.jsx)(o.H,{sessionId:eB.id,taskId:eU.id,attempt:s+1}),e.runId&&(null==(n=e.vcs)?void 0:n.commit)&&e.vcs.baseCommit&&(0,a.jsx)(b.C,{sessionId:eB.id,taskId:eU.id,runId:e.runId,title:"".concat(eU.title," — ").concat(eJ("task.attemptN",{n:s+1})),files:null!=(t=null==(l=e.vcs.files)?void 0:l.length)?t:0})]}),(0,a.jsxs)("div",{className:"muted",children:[e.startedAt?eJ("task.started",{t:eZ(e.startedAt)}):"",e.finishedAt?" \xb7 ".concat(eJ("task.finished",{t:eZ(e.finishedAt)})):""]}),e.summary&&(0,a.jsx)("div",{children:e.summary}),e.reason&&(0,a.jsx)("div",{className:"err",children:e.reason}),e.prompt&&e.prompt!==eU.prompt&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eJ("task.attemptText")}),(0,a.jsx)("pre",{children:e.prompt})]})]},"".concat(null!=(r=e.runId)?r:s))})]}),"queued"===eU.status?(0,a.jsxs)("div",{style:{marginTop:8},children:[(0,a.jsx)("div",{className:"muted small",children:eJ("task.prompt")}),(0,a.jsx)("pre",{children:eU.prompt}),eU.level2.trim()?(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eJ("task.l2Show",{n:eU.level2.trim().split("\n").length})}),(0,a.jsx)("pre",{children:eU.level2})]}):(0,a.jsx)("div",{className:"muted small",children:eJ("task.noL2")})]}):(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eJ("task.promptAndL2")}),eU.level2.trim()&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"muted small",children:eJ("task.l2")}),(0,a.jsx)("pre",{children:eU.level2})]}),(0,a.jsx)("div",{className:"muted small",children:eJ("task.prompt")}),(0,a.jsx)("pre",{children:eU.prompt})]}),eU.firstMessage&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eJ("task.firstMessage")}),(0,a.jsx)("pre",{className:"tall",children:eU.firstMessage})]}),eU.runId&&(0,a.jsxs)("details",{onToggle:e=>e.currentTarget.open&&void sk(),children:[(0,a.jsx)("summary",{children:eJ("task.files")}),(0,a.jsx)("div",{className:"row small",style:{margin:"6px 0"},children:(0,a.jsx)(o.u,{label:eJ("save.log"),save:()=>c.FH.saveTaskLog(eB.id,eU.id)})}),st&&(0,a.jsxs)("div",{className:"small",children:[sy("task.reports","reports",st.reports),sy("task.artifacts","artifacts",st.artifacts),sy("task.replies","replies",st.replies)]})]}),eU.finalReply&&(0,a.jsxs)("details",{children:[(0,a.jsx)("summary",{children:eJ("task.finalReply")}),(0,a.jsx)("pre",{className:"tall",children:eU.finalReply})]})]})]})}function z(e){let{events:s}=e,{t:n}=(0,d.kj)(),{appearance:t}=(0,v.KP)(),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>{!t.reduceMotion&&r.current&&(r.current.scrollTop=r.current.scrollHeight)},[s.length,t.reduceMotion]),(0,a.jsxs)("div",{className:"panel",children:[(0,a.jsx)("h2",{children:n("live.title")}),(0,a.jsxs)("div",{className:"log",ref:r,children:[0===s.length&&(0,a.jsx)("div",{className:"muted",children:n("live.none")}),s.map((e,s)=>{var n;return(0,a.jsxs)("div",{className:e.level,children:[(0,a.jsx)("span",{className:"time",children:new Date(e.at).toLocaleTimeString(void 0,{hour12:!1})}),null!=(n=e.message)?n:e.type]},s)})]})]})}function q(e){let{checks:s,onChange:n}=e,{t:l}=(0,d.kj)(),t=(e,a)=>n(s.map((s,n)=>e===n?{...s,...a}:s));return(0,a.jsxs)("div",{style:{marginTop:12},children:[(0,a.jsx)("label",{children:l("checks.title")}),(0,a.jsx)("p",{className:"why",style:{marginTop:0},children:l("checks.why")}),0===s.length&&(0,a.jsx)("p",{className:"muted small",children:l("checks.noneWhy")}),s.map((e,r)=>{var i,d,o,m;return(0,a.jsxs)("div",{className:"option",children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("input",{type:"text",className:"grow",value:e.name,placeholder:l("checks.namePlaceholder"),onChange:e=>t(r,{name:e.target.value}),"aria-label":l("checks.name")}),(0,a.jsx)("select",{value:e.expect,onChange:e=>t(r,{expect:e.target.value}),"aria-label":l("checks.kind"),style:{width:"auto"},children:c.FZ.map(e=>(0,a.jsx)("option",{value:e,children:l("checks.kind.".concat(e))},e))}),(0,a.jsx)("button",{className:"quiet",onClick:()=>n(s.filter((e,s)=>s!==r)),children:l("checks.remove")})]}),(0,a.jsxs)("div",{className:"row",style:{marginTop:6},children:[(0,c.rt)(e.expect)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{type:"text",className:"grow",value:null!=(i=e.run)?i:"",placeholder:l("checks.run"),onChange:e=>t(r,{run:e.target.value}),"aria-label":l("checks.run")}),(0,a.jsx)("input",{type:"text",value:null!=(d=e.cwd)?d:"",placeholder:l("checks.cwd"),onChange:e=>t(r,{cwd:e.target.value}),"aria-label":l("checks.cwd"),style:{width:220}})]}):(0,a.jsx)("input",{type:"text",className:"grow",value:null!=(o=e.file)?o:"",placeholder:l("checks.file"),onChange:e=>t(r,{file:e.target.value}),"aria-label":l("checks.file")}),(0,c.dK)(e.expect)&&(0,a.jsx)("input",{type:"text",value:null!=(m=e.value)?m:"",placeholder:"output-matches"===e.expect?l("checks.valueRegex"):l("checks.value"),onChange:e=>t(r,{value:e.target.value}),"aria-label":l("checks.value"),style:{width:240}})]})]},r)}),(0,a.jsx)("button",{onClick:()=>n([...s,{name:"",expect:"exit-zero",run:""}]),children:l("checks.add")})]})}function J(e){let{tasks:s}=e,{t:n}=(0,d.kj)(),l=(0,m.hH)(s),t=(0,h.c)(!!l&&l.tasks.some(m.DG));if(!l)return null;let r=(0,m.eZ)(l.run,l.tasks,t);return(0,a.jsx)("p",{className:"muted small",style:{margin:"4px 0 10px"},children:n(r.live?"session.runClockLive":"session.runClock",{n:r.tasks,d:(0,c.c5)(r.ms)})})}function Z(e){let{items:s}=e,{t:n}=(0,d.kj)();return(0,a.jsxs)("div",{className:"summary",children:[(0,a.jsx)("strong",{children:n("task.deviations",{n:s.length})}),(0,a.jsx)("ol",{style:{margin:"6px 0",paddingLeft:20},children:s.map((e,s)=>(0,a.jsxs)("li",{style:{marginBottom:6},children:[(0,a.jsx)("div",{children:e.instruction}),(0,a.jsxs)("div",{className:"muted",children:[n("task.deviationDid"),": ",e.did]}),(0,a.jsxs)("div",{className:"muted",children:[n("task.deviationWhy"),": ",e.why]})]},s))})]})}function _(e){let{items:s}=e,{t:n}=(0,d.kj)();return(0,a.jsxs)("div",{className:"summary",children:[(0,a.jsx)("strong",{children:n("task.disputes",{n:s.length})}),(0,a.jsx)("ol",{style:{margin:"6px 0",paddingLeft:20},children:s.map((e,s)=>(0,a.jsxs)("li",{style:{marginBottom:6},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("code",{children:e.finding})," — ",e.why]}),(0,a.jsxs)("div",{className:"muted",children:[n("review.evidence"),": ",e.evidence]})]},s))})]})}function K(e){var s,n,l,t,r;let{review:i}=e,{t:c}=(0,d.kj)();if(!i)return null;if("skipped"===i.verdict)return i.skippedBecause?(0,a.jsx)("p",{className:"muted small",children:c("review.skippedWhy",{why:i.skippedBecause})}):null;let o="pass"===i.verdict?"done":"fail"===i.verdict?"blocked":"waiting-approval";return(0,a.jsxs)("div",{className:"small",style:{margin:"8px 0"},children:[(0,a.jsxs)("div",{className:"row",children:[(0,a.jsx)("span",{className:"badge ".concat(o),children:c("review.verdict.".concat(i.verdict))}),i.stepsRun>0&&(0,a.jsx)("span",{className:"muted",children:c("review.ran",{n:i.stepsRun})}),i.rounds>1&&(0,a.jsx)("span",{className:"muted",children:c("review.rounds",{n:i.rounds})}),i.model&&(0,a.jsx)("span",{className:"chip",children:c("review.onModel",{model:i.model})})]}),i.problem&&(0,a.jsx)("p",{className:"reason",children:c("review.problem",{problem:i.problem})}),i.summary&&(0,a.jsx)(k.s,{text:i.summary}),(null!=(l=null==(s=i.findings)?void 0:s.length)?l:0)>0&&(0,a.jsxs)("details",{style:{marginTop:4},children:[(0,a.jsx)("summary",{children:c("review.findings",{n:null!=(t=null==(n=i.findings)?void 0:n.length)?t:0})}),(0,a.jsx)("ol",{style:{margin:"6px 0",paddingLeft:20},children:(null!=(r=i.findings)?r:[]).map((e,s)=>(0,a.jsxs)("li",{style:{marginBottom:8},children:[(0,a.jsxs)("div",{children:[e.id&&(0,a.jsx)("code",{style:{marginRight:6},children:e.id}),e.what,"task"===e.about&&(0,a.jsx)("span",{className:"chip",style:{marginLeft:6},children:c("review.aboutTask")}),e.repeated&&(0,a.jsx)("span",{className:"chip",style:{marginLeft:6},children:c("review.repeated")})]}),e.where&&(0,a.jsx)("div",{className:"muted",children:e.where}),(0,a.jsxs)("div",{className:"muted",children:[c("review.evidence"),": ",e.evidence]})]},s))})]})]})}},8848:(e,s,n)=>{"use strict";n.d(s,{H4:()=>d,L:()=>o,z4:()=>m});var a=n(3365),l=n(8197),t=n.n(l),r=n(1521),i=n(5549),c=n(867);function d(e){let{current:s,onUse:n}=e,{t:l}=(0,c.kj)(),[t,d]=(0,r.useState)(null);if((0,r.useEffect)(()=>{let e=!1;return i.FH.project().then(s=>{e||d(s)}).catch(()=>void 0),()=>{e=!0}},[]),!t)return null;let o=t.rootDir.trim(),m=s.trim().toLowerCase(),h=n?t.others.filter(e=>e.rootDir.trim().toLowerCase()!==m):[];return(0,a.jsx)(u,{label:o?l("proj.defaultIs",{dir:o}):l("proj.noneShort"),offer:o&&n&&m!==o.toLowerCase()?{text:l("proj.useIt"),onUse:()=>n(o)}:void 0,more:h.map(e=>({text:l("proj.otherUse",{name:e.name}),title:e.rootDir,onUse:()=>null==n?void 0:n(e.rootDir)})),link:o?l("proj.change"):l("proj.setIt"),anchor:"project"})}function o(e){let{current:s,onUse:n}=e,l=h(),{t}=(0,c.kj)();if(!l)return null;let r=l.defaultModel.trim();return(0,a.jsx)(u,{label:r?t("def.modelDefaultIs",{name:r}):t("def.modelNoneShort"),offer:r&&n&&s.trim()!==r?{text:t("def.modelUseIt"),onUse:()=>n(r)}:void 0,link:t(r?"proj.change":"proj.setIt"),anchor:"model"})}function m(e){let{current:s,onUse:n}=e,l=h(),{t}=(0,c.kj)();if(!l)return null;let r=l.defaultReviewModel.trim();return(0,a.jsx)(u,{label:r?t("def.reviewDefaultIs",{name:r}):t("def.reviewNoneShort"),offer:r&&n&&s.trim()!==r?{text:t("def.modelUseIt"),onUse:()=>n(r)}:void 0,link:t(r?"proj.change":"proj.setIt"),anchor:"review"})}function h(){let[e,s]=(0,r.useState)(null);return(0,r.useEffect)(()=>{let e=!1;return i.FH.models().then(n=>{e||s(n)}).catch(()=>void 0),()=>{e=!0}},[]),e}function u(e){let{label:s,offer:n,more:l=[],link:r,anchor:i}=e;return(0,a.jsxs)("p",{className:"muted small",style:{marginTop:4},children:[s," ",n&&(0,a.jsxs)(a.Fragment,{children:["\xb7"," ",(0,a.jsx)("button",{type:"button",className:"linkish",onClick:n.onUse,children:n.text})," "]}),l.map(e=>(0,a.jsxs)("span",{children:["\xb7"," ",(0,a.jsx)("button",{type:"button",className:"linkish",onClick:e.onUse,title:e.title,children:e.text})," "]},e.text)),"\xb7 ",(0,a.jsx)(t(),{href:"/defaults#".concat(i),children:r})]})}}},e=>{e.O(0,[197,867,549,36,295,347,131,358],()=>e(e.s=1772)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--bg:#fdf7f0;--bg-tint:#f7ead9;--panel:#fffdfb;--ink:#241a13;--muted:#7a6656;--line:#ecdcc9;--line-strong:#d8c3a9;--accent:#b4500b;--accent-ink:#fffaf5;--accent-soft:#fbe9d8;--ok:#2a6b45;--ok-soft:#e4f1e7;--warn:#8f5500;--warn-soft:#fbedd6;--bad:#a8271c;--bad-soft:#fbe6e2;--code:#f9efe3;--shadow:0 1px 2px rgba(74,45,20,0.06),0 6px 18px rgba(74,45,20,0.05);--radius:12px;--scale:1;--mono:ui-monospace,Consolas,"Cascadia Mono",monospace;--focus-width:2px}:root[data-theme=dark]{--bg:#17120f;--bg-tint:#221a15;--panel:#221b16;--ink:#f2e8df;--muted:#b6a493;--line:#3a2e26;--line-strong:#52412f;--accent:#ff9f45;--accent-ink:#2b1705;--accent-soft:#35251a;--ok:#7ed39f;--ok-soft:#1e2b22;--warn:#f0b96e;--warn-soft:#2f2417;--bad:#ff9081;--bad-soft:#33201d;--code:#1d1713;--shadow:0 1px 2px rgba(0,0,0,0.3),0 8px 24px rgba(0,0,0,0.25)}:root[data-contrast=high]{--ink:#000000;--muted:#4a3a2c;--line:#a88d6c;--line-strong:#6b5236;--accent:#8f3c00;--panel:#ffffff;--bg:#fff9f2;--ok:#17512f;--warn:#6b3f00;--bad:#8a1a11;--shadow:none}:root[data-theme=dark][data-contrast=high]{--ink:#ffffff;--muted:#e0cfbd;--line:#7d6650;--line-strong:#a88a6a;--accent:#ffc27a;--panel:#100c09;--bg:#000000;--code:#0a0705;--ok:#9ff0bd;--warn:#ffd08f;--bad:#ffb0a2;--shadow:none}:root[data-textsize=small]{--scale:0.9}:root[data-textsize=large]{--scale:1.12}:root[data-textsize=huge]{--scale:1.28}:root[data-textsize=giant]{--scale:1.45}:root[data-focus=strong]{--focus-width:4px}*{box-sizing:border-box}body,html{margin:0;background:var(--bg);color:var(--ink);font:calc(15px * var(--scale)) /1.55 system-ui,-apple-system,Segoe UI,sans-serif}a{color:var(--accent);text-decoration:none}:root[data-links=underline] a,a:hover{text-decoration:underline}:focus-visible{outline:var(--focus-width) solid var(--accent);outline-offset:2px;border-radius:4px}:root[data-motion=reduced] *,:root[data-motion=reduced] :after,:root[data-motion=reduced] :before{transition:none!important;animation:none!important;scroll-behavior:auto!important}@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}.skip-link{position:absolute;left:-9999px;top:0;background:var(--accent);color:var(--accent-ink);padding:10px 16px;border-radius:0 0 var(--radius) 0;z-index:10}.skip-link:focus{left:0}.wrap{max-width:calc(1100px * var(--scale));margin:0 auto;padding:24px 16px 80px}.top{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:20px;padding-bottom:14px;border-bottom:1px solid var(--line)}.top h1{font-size:calc(21px * var(--scale));margin:0;letter-spacing:-.01em}.top h1 a{color:var(--accent)}.top nav{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.top nav a{color:var(--muted);padding:6px 10px;border-radius:999px;font-size:calc(14px * var(--scale))}.top nav a:hover{text-decoration:none}.top nav a:hover,.top nav a[aria-current=page]{background:var(--accent-soft);color:var(--accent)}.top nav a[aria-current=page]{font-weight:600}.top nav a .live{display:inline-flex;align-items:center;gap:4px;margin-left:6px;padding:0 6px 0 4px;border-radius:999px;background:var(--ok-soft,var(--accent-soft));color:var(--ok,var(--accent));font-size:calc(10.5px * var(--scale));font-weight:700;letter-spacing:.04em;text-transform:uppercase;vertical-align:middle}.top nav a .live .dot{width:6px;height:6px;border-radius:50%;background:currentColor;animation:live-pulse 1.6s ease-in-out infinite}@keyframes live-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.75)}}.crumbs{color:var(--muted);font-size:calc(13px * var(--scale));margin-bottom:8px}.panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:18px;margin-bottom:16px;box-shadow:var(--shadow)}.panel h2{font-size:calc(16px * var(--scale));margin:0 0 10px}.panel h3{font-size:calc(13px * var(--scale));margin:16px 0 6px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.05em}.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.grow{flex:1 1 auto}.muted{color:var(--muted)}.small{font-size:calc(13px * var(--scale))}input[type=number],input[type=text],select,textarea{width:100%;background:var(--code);color:var(--ink);border:1px solid var(--line-strong);border-radius:9px;padding:9px 11px;font:inherit}input[type=number]:focus,input[type=text]:focus,select:focus,textarea:focus{border-color:var(--accent)}textarea{min-height:110px;resize:vertical;font-family:var(--mono);font-size:calc(13px * var(--scale));line-height:1.5}textarea.prose{font-family:inherit;font-size:calc(14px * var(--scale))}label{display:block;font-size:calc(13px * var(--scale));color:var(--muted);margin:12px 0 4px}input[type=checkbox],input[type=radio]{accent-color:var(--accent);width:calc(16px * var(--scale));height:calc(16px * var(--scale))}.option{border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin:8px 0;background:var(--bg)}.option>label{display:flex;align-items:flex-start;gap:10px;margin:0;color:var(--ink);font-size:calc(14px * var(--scale));cursor:pointer}.option>label input{margin-top:3px;flex:none}.option .why{margin:6px 0 0 26px;color:var(--muted);font-size:calc(12.5px * var(--scale))}.option.warned{border-color:var(--warn);background:var(--warn-soft)}button{background:var(--panel);color:var(--ink);border:1px solid var(--line-strong);border-radius:9px;padding:8px 13px;font:inherit;cursor:pointer;transition:background .12s ease,border-color .12s ease}button:hover:not(:disabled){border-color:var(--accent);background:var(--accent-soft)}button.primary{background:var(--accent);color:var(--accent-ink);border-color:var(--accent);font-weight:600}button.primary:hover:not(:disabled){background:var(--accent);filter:brightness(1.08)}button.danger{color:var(--bad);border-color:var(--bad)}button.danger:hover:not(:disabled){background:var(--bad-soft);border-color:var(--bad)}button.quiet{border-color:transparent;background:transparent;color:var(--muted)}button.quiet:hover:not(:disabled){color:var(--accent)}button:disabled{opacity:.45;cursor:not-allowed}.badge{display:inline-block;font-size:calc(12px * var(--scale));padding:2px 9px;border-radius:999px;border:1px solid var(--line-strong);color:var(--muted);white-space:nowrap;max-width:100%;overflow-wrap:anywhere}@media (max-width:600px){.badge{white-space:normal}}.badge.running{color:var(--accent);border-color:var(--accent);background:var(--accent-soft)}.badge.waiting-approval{color:var(--warn);border-color:var(--warn);background:var(--warn-soft)}.badge.done{color:var(--ok);border-color:var(--ok);background:var(--ok-soft)}.badge.blocked{color:var(--warn);border-color:var(--warn);background:var(--warn-soft)}.badge.aborted,.badge.failed,.badge.limit-reached{color:var(--bad);border-color:var(--bad);background:var(--bad-soft)}pre{background:var(--code);border:1px solid var(--line);border-radius:9px;padding:10px 12px;overflow:auto;font-family:var(--mono);font-size:calc(12.5px * var(--scale));line-height:1.5;margin:6px 0;white-space:pre-wrap;word-break:break-word}pre.tall{max-height:420px}details>summary{cursor:pointer;color:var(--muted);font-size:calc(13px * var(--scale));-webkit-user-select:none;-moz-user-select:none;user-select:none}details>summary:hover{color:var(--accent)}details[open]>summary{margin-bottom:6px}.task{border-left:4px solid var(--line-strong);padding-left:14px;margin-bottom:18px}.task.done{border-left-color:var(--ok)}.task.running,.task.waiting-approval{border-left-color:var(--accent)}.task.blocked{border-left-color:var(--warn)}.task.aborted,.task.failed,.task.limit-reached{border-left-color:var(--bad)}.task h4{margin:0 0 4px;font-size:calc(15px * var(--scale))}.task:target{background:var(--accent-soft);border-radius:0 10px 10px 0;padding:8px 8px 8px 14px}.summary{background:var(--ok-soft);border:1px solid var(--ok);border-radius:9px;padding:10px 12px;margin:8px 0;white-space:pre-wrap}.reason{color:var(--bad)}.approval{background:var(--warn-soft);border:2px solid var(--warn);border-radius:var(--radius);padding:12px 14px;margin-bottom:14px;position:-webkit-sticky;position:sticky;top:8px;z-index:2}.approval code{font-size:calc(13px * var(--scale))}.approval code,.log{font-family:var(--mono)}.log{font-size:calc(12.5px * var(--scale));max-height:320px;overflow:auto;background:var(--code);border:1px solid var(--line);border-radius:9px;padding:8px 10px}.log div{white-space:pre-wrap;word-break:break-word}.log .warn{color:var(--warn)}.log .error{color:var(--bad)}.log .time{color:var(--muted);margin-right:8px}table{width:100%;border-collapse:collapse}td,th{text-align:left;padding:9px 6px;border-bottom:1px solid var(--line);font-size:calc(14px * var(--scale));vertical-align:top}th{color:var(--muted);font-weight:700;font-size:calc(12px * var(--scale));text-transform:uppercase;letter-spacing:.04em}.err{color:var(--bad);font-size:calc(13px * var(--scale))}.notice{border:1px solid var(--bad);background:var(--bad-soft);color:var(--ink);border-radius:10px;padding:10px 12px;margin:10px 0;font-size:calc(13.5px * var(--scale))}.notice strong{color:var(--bad)}.notice ul{margin:6px 0 0;padding-left:20px}.notice.caution{border-color:var(--warn);background:var(--warn-soft)}.notice.caution strong{color:var(--warn)}.notice.calm{border-color:var(--line-strong);background:var(--bg-tint)}.notice.calm strong{color:var(--ink)}.counts{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:4px}.count{border:1px solid var(--line);border-radius:10px;padding:10px 14px;min-width:96px;background:var(--bg)}.count .n{font-size:calc(22px * var(--scale));font-weight:700;line-height:1.2}.count .k{color:var(--muted);font-size:calc(12px * var(--scale));text-transform:uppercase;letter-spacing:.04em}.count.done .n{color:var(--ok)}.count.failed .n{color:var(--bad)}.count.running .n{color:var(--accent)}.attempts{list-style:none;margin:6px 0 0;padding:0 0 0 12px;border-left:2px solid var(--line)}.attempts>li{margin:0 0 10px}.attempts .head{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap}.attempts .when{color:var(--muted);font-size:calc(12.5px * var(--scale))}.attempts .what{margin:4px 0 0}.count.queued .n{color:var(--accent)}.flow{list-style:none;margin:8px 0 0;padding:0}.flow>li{position:relative;padding:10px 0 14px 28px;border-left:2px solid var(--line);margin-left:7px}.flow>li:last-child{border-left-color:transparent}.flow>li:before{content:"";position:absolute;left:-9px;top:16px;width:16px;height:16px;border-radius:50%;background:var(--panel);border:3px solid var(--line-strong)}.flow>li.done:before{border-color:var(--ok);background:var(--ok)}.flow>li.running:before,.flow>li.waiting-approval:before{border-color:var(--accent);background:var(--accent)}.flow>li.aborted:before,.flow>li.failed:before,.flow>li.limit-reached:before{border-color:var(--bad);background:var(--bad)}.flow>li.queued:before{border-color:var(--line-strong);background:var(--panel)}.flow>li.next:before{border-color:var(--accent);background:var(--panel);box-shadow:0 0 0 4px var(--accent-soft)}.flow .when{color:var(--muted);font-size:calc(12.5px * var(--scale))}.flow .what{margin:4px 0 0}.flow .head{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}.flow .head strong{font-size:calc(14.5px * var(--scale))}.chip{display:inline-block;border:1px solid var(--line);border-radius:999px;padding:1px 9px;font-size:calc(12px * var(--scale));color:var(--muted);background:var(--bg-tint)}.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:10px}.toolbar input[type=text],.toolbar select{width:auto;min-width:150px}.segmented{display:inline-flex;flex-wrap:wrap;max-width:100%;border:1px solid var(--line-strong);border-radius:9px;overflow:hidden}.segmented button{border:none;border-radius:0;border-right:1px solid var(--line)}.segmented button:last-child{border-right:none}.segmented button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);font-weight:600}.button-link{display:inline-block;background:var(--accent);color:var(--accent-ink);border:1px solid var(--accent);border-radius:9px;padding:8px 13px;font:inherit;font-weight:600;cursor:pointer;text-decoration:none}.button-link:hover{filter:brightness(1.08);text-decoration:none}.button-link+.button-link{background:var(--panel);color:var(--ink);border-color:var(--line-strong);font-weight:400}.button-link+.button-link:hover{background:var(--accent-soft);border-color:var(--accent);filter:none}.button-link.plain{background:var(--panel);color:var(--ink);border-color:var(--line-strong);font-weight:400}.button-link.quiet{background:transparent;color:var(--muted);border-color:transparent;font-weight:400}.button-link.plain:hover,.button-link.quiet:hover{background:var(--accent-soft);border-color:var(--accent);color:var(--accent);filter:none}.empty{color:var(--muted);padding:14px 0}.visually-hidden{position:absolute;-webkit-clip-path:inset(50%);clip-path:inset(50%);width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.dropzone{border:2px dashed var(--line-strong);border-radius:12px;padding:10px;background:var(--bg-tint)}.dropzone.active{border-color:var(--accent);background:var(--accent-soft)}.dropzone textarea{margin:0}.dropzone p{margin:8px 2px 2px}.batch-row td{vertical-align:middle}.batch-row.running{background:var(--accent-soft)}.run-order{list-style:decimal;margin:10px 0 4px;padding-left:28px}.run-order li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:3px 0}.run-order button{padding:2px 8px;margin-left:4px}.linkish{background:none;border:0;padding:0;margin:0;color:var(--accent);font:inherit;cursor:pointer;text-decoration:underline}.linkish:hover{filter:brightness(1.15)}.run-choice{display:flex;gap:20px;flex-wrap:wrap;margin:12px 0 4px}.run-choice>div{flex:1 1 280px}.run-choice .why{margin:6px 2px 0}.rich>:first-child{margin-top:0}.rich>:last-child{margin-bottom:0}.rich p{margin:0 0 8px;max-width:76ch}.rich ul{margin:0 0 8px;padding-left:20px}.rich li{margin:2px 0;max-width:74ch}.rich code{font-family:var(--mono);font-size:.92em;background:var(--bg-tint);border:1px solid var(--line);border-radius:5px;padding:0 4px;word-break:break-word}.rich pre{margin:6px 0 8px}.summary .rich{white-space:normal}select{-moz-appearance:none;appearance:none;-webkit-appearance:none;padding-right:34px;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");background-repeat:no-repeat;background-position:right 12px center;cursor:pointer}select:disabled{cursor:not-allowed;opacity:.6}select optgroup,select option{background:var(--panel);color:var(--ink)}.top nav a{display:inline-flex;align-items:center;gap:6px}.top nav a .nav-icon{flex:none;opacity:.85}.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.55);display:flex;align-items:center;justify-content:center;padding:16px;z-index:50}.modal{background:var(--panel);color:var(--ink);border:1px solid var(--line-strong);border-radius:var(--radius);box-shadow:0 20px 60px rgba(0,0,0,.35);width:min(560px,100%);max-height:calc(100vh - 32px);overflow:auto;padding:18px 20px}.modal h2{margin:0 0 10px;font-size:calc(16px * var(--scale))}.modal.danger h2{color:var(--bad)}.modal-body{white-space:pre-wrap;line-height:1.5;font-size:calc(14px * var(--scale))}.modal-actions{justify-content:flex-end;margin-top:16px}.panel{overflow-wrap:break-word}td,th{position:relative}@media (max-width:600px){.wrap{padding:12px 10px 60px}.top{gap:8px;margin-bottom:12px;padding-bottom:10px}.top h1{font-size:calc(18px * var(--scale))}.top nav{width:100%;flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;padding-bottom:4px;scrollbar-width:none}.top nav::-webkit-scrollbar{display:none}.top nav a{flex:none;padding:6px 9px;font-size:calc(13px * var(--scale))}.panel{padding:12px}.row{gap:8px}.row>input[type=text],.row>select,.row>textarea,.toolbar input[type=text],.toolbar select,.toolbar>div{width:100%;min-width:0;flex:1 1 100%}.row>button{flex:1 1 auto}select{min-width:0!important;width:100%}table{display:block;overflow-x:auto;white-space:nowrap}.counts{gap:6px}.count{flex-grow:1;flex-shrink:1;flex-basis:calc(50% - 6px)}.segmented{display:flex;width:100%}.segmented button{flex:1 1 auto}.flow>li{padding-left:18px}.modal{padding:14px}.log,pre{font-size:calc(12px * var(--scale))}}.sync-cmd{white-space:pre-wrap;overflow-wrap:anywhere}.table-scroll{overflow-x:auto}.metrics td:not(:first-child),.metrics th:not(:first-child){white-space:nowrap}.handoff .handoff-row{margin:4px 0;overflow-wrap:anywhere}.handoff .handoff-row ul{margin:2px 0 0;padding-left:20px}.run-fold{border-top:1px solid var(--line);padding:8px 0 4px}.run-fold:first-of-type{border-top:none}.run-fold>summary{cursor:pointer;list-style:none}.run-fold>summary::-webkit-details-marker{display:none}.run-fold>summary:before{content:"▸";display:inline-block;width:16px;color:var(--muted);transition:transform .15s}.run-fold[open]>summary:before{transform:rotate(90deg)}.run-fold>summary .run-heading{display:inline-block;width:calc(100% - 16px);vertical-align:top}.run-heading h2{font-size:calc(15px * var(--scale))}.exports{white-space:nowrap}@media (max-width:600px){.exports{white-space:normal}}.modal.wide{width:min(820px,100%)}.dir-tree-box{margin-top:8px}.dir-tree{list-style:none;margin:6px 0 0;padding-left:0}.dir-tree .dir-tree{padding-left:18px;border-left:1px dashed var(--line);margin-left:8px}.dir-row{display:flex;align-items:center;gap:4px;padding:1px 0}.dir-flip{width:calc(20px * var(--scale));padding:0;border:none;color:var(--muted);font-size:calc(12px * var(--scale))}.dir-flip,.dir-name{background:transparent}.dir-name{border:1px solid transparent;padding:2px 8px 2px 6px;border-radius:6px;font-family:var(--mono);font-size:calc(12.5px * var(--scale));display:inline-flex;align-items:center;gap:6px}.dir-name:hover{border-color:var(--line-strong)}.dir-mark{display:inline-block;width:12px;text-align:center;color:var(--muted)}.dir.in>.dir-row .dir-name{background:var(--ok-soft);color:var(--ok);border-color:var(--ok)}.dir.inherited>.dir-row .dir-name{color:var(--ok)}.dir.out>.dir-row .dir-name{background:var(--bad-soft);color:var(--bad);border-color:var(--bad);text-decoration:line-through}.dir.out-inherited>.dir-row .dir-name{color:var(--muted);text-decoration:line-through}.dir-out{width:calc(22px * var(--scale));height:calc(22px * var(--scale));padding:0;border-radius:6px;font-size:calc(13px * var(--scale));line-height:1;color:var(--muted)}.dir-out.on{color:var(--bad);border-color:var(--bad);background:var(--bad-soft)}.story-box{margin-top:8px;border:1px solid var(--line);border-radius:var(--radius);padding:10px 12px;background:var(--code)}.story{list-style:none;margin:6px 0;padding:0}.story>li{border-left:3px solid var(--line-strong);padding:6px 10px;margin:6px 0}.story>li.sent{border-left-color:var(--accent)}.story>li.reply{border-left-color:var(--ok)}.story>li.story-step{border-left-color:var(--muted)}.story>li.failed{border-left-color:var(--bad);background:var(--bad-soft)}.story>li.story-review{border-left-color:var(--warn)}.story-head{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:calc(13px * var(--scale))}.story-cmd{margin:4px 0;color:var(--ink)}.story-cmd,.story-out{white-space:pre-wrap;word-break:break-word;font-size:calc(12px * var(--scale))}.story-out{margin:4px 0 0;max-height:420px;overflow:auto;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:8px}.story-out.always{max-height:260px}.story-scroll.live{max-height:65vh;overflow:auto;overscroll-behavior:contain}.story-out.terminal{max-height:45vh;overscroll-behavior:contain}.diff-overlay{position:fixed;inset:0;z-index:100;background:var(--bg);display:flex;flex-direction:column}.diff-head{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:10px 16px;border-bottom:1px solid var(--line);background:var(--panel)}.diff-head h2{margin:0;font-size:calc(16px * var(--scale))}.diff-body{flex:1 1;min-height:0;display:grid;grid-template-columns:minmax(220px,300px) 1fr}.diff-files{overflow:auto;border-right:1px solid var(--line);padding:6px;background:var(--panel)}.diff-file{display:flex;gap:6px;align-items:baseline;width:100%;text-align:left;border:0;border-radius:6px;background:none;padding:5px 6px;font-size:calc(12px * var(--scale));cursor:pointer}.diff-file:hover{background:var(--bg-tint)}.diff-file.on{background:var(--accent-soft)}.diff-path{flex:1 1;min-width:0;overflow-wrap:anywhere}.diff-counts{white-space:nowrap;font-family:var(--mono);font-size:calc(11px * var(--scale))}.diff-counts .plus{color:var(--ok)}.diff-counts .minus{color:var(--bad)}.diff-status{font-family:var(--mono);font-weight:700;width:1.2em;text-align:center;border-radius:4px}.diff-status.s-A{color:var(--ok)}.diff-status.s-D{color:var(--bad)}.diff-status.s-M{color:var(--warn)}.diff-status.s-C,.diff-status.s-R{color:var(--accent)}.diff-main{display:flex;flex-direction:column;min-width:0;min-height:0}.diff-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:6px 12px;border-bottom:1px solid var(--line)}.diff-name{font-family:var(--mono);font-size:calc(12px * var(--scale));overflow-wrap:anywhere}.diff-scroll{flex:1 1;overflow:auto;overscroll-behavior:contain}.diff-table{width:100%;border-collapse:collapse;table-layout:fixed;font-family:var(--mono);font-size:calc(12px * var(--scale))}.diff-table col.num{width:calc(52px * var(--scale))}.diff-table thead th{position:-webkit-sticky;position:sticky;top:0;z-index:1;background:var(--panel);border-bottom:1px solid var(--line);text-align:left;padding:4px 8px;font-family:inherit}.diff-table td{padding:0 8px;vertical-align:top;line-height:1.5}.diff-table td.num{text-align:right;color:var(--muted);-webkit-user-select:none;-moz-user-select:none;user-select:none;border-right:1px solid var(--line)}.diff-table td.code{white-space:pre-wrap;overflow-wrap:anywhere}.diff-table.nowrap td.code{white-space:pre;overflow-wrap:normal}.diff-table.nowrap{width:max-content;min-width:100%}.diff-row.change td.l,.diff-row.del td.l{background:var(--bad-soft)}.diff-row.add td.r,.diff-row.change td.r{background:var(--ok-soft)}.diff-row mark{background:color-mix(in srgb,currentColor 22%,transparent);color:inherit;border-radius:2px}.diff-row td.empty{background:repeating-linear-gradient(135deg,transparent 0 6px,var(--bg-tint) 6px 12px)}.diff-row.current td.num{box-shadow:inset 3px 0 0 var(--accent)}.diff-gap td{background:var(--bg-tint);text-align:center;padding:2px}@media (max-width:760px){.diff-body{grid-template-columns:1fr;grid-template-rows:auto 1fr}.diff-files{max-height:30vh;border-right:0;border-bottom:1px solid var(--line)}}.scroll-jump{position:fixed;right:16px;bottom:24px;display:flex;flex-direction:column;gap:8px;z-index:40}.scroll-jump button{width:calc(42px * var(--scale));height:calc(42px * var(--scale));border-radius:50%;padding:0;font-size:calc(20px * var(--scale));line-height:1;box-shadow:0 2px 8px rgba(0,0,0,.18)}.story-notes{margin:4px 0;font-size:calc(13px * var(--scale))}.story-fixed{padding:8px 10px;border-radius:8px;background:var(--panel);border:1px solid var(--line);margin:6px 0}.story-fixed.close{border-color:var(--ok)}.story-fixed.close.failed{border-color:var(--bad);background:var(--bad-soft)}.option-inline{gap:6px}.option-inline,.story-box .live{display:inline-flex;align-items:center}.story-box .live{gap:4px;color:var(--ok);font-size:calc(11px * var(--scale));font-weight:700;text-transform:uppercase}.story-box .live .dot,button .dot{width:6px;height:6px;border-radius:50%;background:currentColor;animation:live-pulse 1.6s ease-in-out infinite}button .dot{display:inline-block;margin-right:6px;vertical-align:middle}.info-dot{width:calc(18px * var(--scale));height:calc(18px * var(--scale));min-width:calc(18px * var(--scale));padding:0;border-radius:50%;font-size:calc(11px * var(--scale));font-style:italic;font-weight:700;line-height:1}.info-panel{flex-basis:100%;margin-top:6px}.info-panel dl{margin:6px 0 0}.info-panel dt{font-weight:600;margin-top:6px}.info-panel dd{margin:0 0 0 14px;opacity:.85}.flow .head .pick{margin:0 2px 0 0;flex:0 0 auto}.chip.inside{font-size:calc(10.5px * var(--scale));opacity:.85}.chip.inside.out{color:var(--bad);border-color:var(--bad)}.approval-banner{position:-webkit-sticky;position:sticky;top:0;z-index:30;background:var(--warn-soft);border:3px solid var(--warn);border-radius:var(--radius);padding:12px 14px 2px;margin:0 0 16px;box-shadow:0 6px 18px rgba(0,0,0,.18);max-height:min(70vh,calc(30rem * var(--scale)));overflow:auto}.approval-banner h2{margin:0 0 4px;color:var(--warn)}.approval-banner .approval{position:static;background:var(--bg);margin-bottom:10px}.approval-banner .approval button{font-size:calc(15px * var(--scale));padding:8px 14px}
|
|
1
|
+
:root{--bg:#fdf7f0;--bg-tint:#f7ead9;--panel:#fffdfb;--ink:#241a13;--muted:#7a6656;--line:#ecdcc9;--line-strong:#d8c3a9;--accent:#b4500b;--accent-ink:#fffaf5;--accent-soft:#fbe9d8;--ok:#2a6b45;--ok-soft:#e4f1e7;--warn:#8f5500;--warn-soft:#fbedd6;--bad:#a8271c;--bad-soft:#fbe6e2;--code:#f9efe3;--shadow:0 1px 2px rgba(74,45,20,0.06),0 6px 18px rgba(74,45,20,0.05);--radius:12px;--scale:1;--mono:ui-monospace,Consolas,"Cascadia Mono",monospace;--focus-width:2px}:root[data-theme=dark]{--bg:#17120f;--bg-tint:#221a15;--panel:#221b16;--ink:#f2e8df;--muted:#b6a493;--line:#3a2e26;--line-strong:#52412f;--accent:#ff9f45;--accent-ink:#2b1705;--accent-soft:#35251a;--ok:#7ed39f;--ok-soft:#1e2b22;--warn:#f0b96e;--warn-soft:#2f2417;--bad:#ff9081;--bad-soft:#33201d;--code:#1d1713;--shadow:0 1px 2px rgba(0,0,0,0.3),0 8px 24px rgba(0,0,0,0.25)}:root[data-contrast=high]{--ink:#000000;--muted:#4a3a2c;--line:#a88d6c;--line-strong:#6b5236;--accent:#8f3c00;--panel:#ffffff;--bg:#fff9f2;--ok:#17512f;--warn:#6b3f00;--bad:#8a1a11;--shadow:none}:root[data-theme=dark][data-contrast=high]{--ink:#ffffff;--muted:#e0cfbd;--line:#7d6650;--line-strong:#a88a6a;--accent:#ffc27a;--panel:#100c09;--bg:#000000;--code:#0a0705;--ok:#9ff0bd;--warn:#ffd08f;--bad:#ffb0a2;--shadow:none}:root[data-textsize=small]{--scale:0.9}:root[data-textsize=large]{--scale:1.12}:root[data-textsize=huge]{--scale:1.28}:root[data-textsize=giant]{--scale:1.45}:root[data-focus=strong]{--focus-width:4px}*{box-sizing:border-box}body,html{margin:0;background:var(--bg);color:var(--ink);font:calc(15px * var(--scale)) /1.55 system-ui,-apple-system,Segoe UI,sans-serif}a{color:var(--accent);text-decoration:none}:root[data-links=underline] a,a:hover{text-decoration:underline}:focus-visible{outline:var(--focus-width) solid var(--accent);outline-offset:2px;border-radius:4px}:root[data-motion=reduced] *,:root[data-motion=reduced] :after,:root[data-motion=reduced] :before{transition:none!important;animation:none!important;scroll-behavior:auto!important}@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}.skip-link{position:absolute;left:-9999px;top:0;background:var(--accent);color:var(--accent-ink);padding:10px 16px;border-radius:0 0 var(--radius) 0;z-index:10}.skip-link:focus{left:0}.wrap{max-width:calc(1100px * var(--scale));margin:0 auto;padding:24px 16px 80px}.top{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:20px;padding-bottom:14px;border-bottom:1px solid var(--line)}.top h1{font-size:calc(21px * var(--scale));margin:0;letter-spacing:-.01em}.top h1 a{color:var(--accent)}.top nav{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.top nav a{color:var(--muted);padding:6px 10px;border-radius:999px;font-size:calc(14px * var(--scale))}.top nav a:hover{text-decoration:none}.top nav a:hover,.top nav a[aria-current=page]{background:var(--accent-soft);color:var(--accent)}.top nav a[aria-current=page]{font-weight:600}.top nav a .live{display:inline-flex;align-items:center;gap:4px;margin-left:6px;padding:0 6px 0 4px;border-radius:999px;background:var(--ok-soft,var(--accent-soft));color:var(--ok,var(--accent));font-size:calc(10.5px * var(--scale));font-weight:700;letter-spacing:.04em;text-transform:uppercase;vertical-align:middle}.top nav a .live .dot{width:6px;height:6px;border-radius:50%;background:currentColor;animation:live-pulse 1.6s ease-in-out infinite}@keyframes live-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.75)}}.crumbs{color:var(--muted);font-size:calc(13px * var(--scale));margin-bottom:8px}.panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:18px;margin-bottom:16px;box-shadow:var(--shadow)}.panel h2{font-size:calc(16px * var(--scale));margin:0 0 10px}.panel h3{font-size:calc(13px * var(--scale));margin:16px 0 6px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.05em}.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.grow{flex:1 1 auto}.muted{color:var(--muted)}.small{font-size:calc(13px * var(--scale))}input[type=number],input[type=text],select,textarea{width:100%;background:var(--code);color:var(--ink);border:1px solid var(--line-strong);border-radius:9px;padding:9px 11px;font:inherit}input[type=number]:focus,input[type=text]:focus,select:focus,textarea:focus{border-color:var(--accent)}textarea{min-height:110px;resize:vertical;font-family:var(--mono);font-size:calc(13px * var(--scale));line-height:1.5}textarea.prose{font-family:inherit;font-size:calc(14px * var(--scale))}label{display:block;font-size:calc(13px * var(--scale));color:var(--muted);margin:12px 0 4px}input[type=checkbox],input[type=radio]{accent-color:var(--accent);width:calc(16px * var(--scale));height:calc(16px * var(--scale))}.option{border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin:8px 0;background:var(--bg)}.option>label{display:flex;align-items:flex-start;gap:10px;margin:0;color:var(--ink);font-size:calc(14px * var(--scale));cursor:pointer}.option>label input{margin-top:3px;flex:none}.option .why{margin:6px 0 0 26px;color:var(--muted);font-size:calc(12.5px * var(--scale))}.option.warned{border-color:var(--warn);background:var(--warn-soft)}button{background:var(--panel);color:var(--ink);border:1px solid var(--line-strong);border-radius:9px;padding:8px 13px;font:inherit;cursor:pointer;transition:background .12s ease,border-color .12s ease}button:hover:not(:disabled){border-color:var(--accent);background:var(--accent-soft)}button.primary{background:var(--accent);color:var(--accent-ink);border-color:var(--accent);font-weight:600}button.primary:hover:not(:disabled){background:var(--accent);filter:brightness(1.08)}button.danger{color:var(--bad);border-color:var(--bad)}button.danger:hover:not(:disabled){background:var(--bad-soft);border-color:var(--bad)}button.quiet{border-color:transparent;background:transparent;color:var(--muted)}button.quiet:hover:not(:disabled){color:var(--accent)}button:disabled{opacity:.45;cursor:not-allowed}.badge{display:inline-block;font-size:calc(12px * var(--scale));padding:2px 9px;border-radius:999px;border:1px solid var(--line-strong);color:var(--muted);white-space:nowrap;max-width:100%;overflow-wrap:anywhere}@media (max-width:600px){.badge{white-space:normal}}.badge.running{color:var(--accent);border-color:var(--accent);background:var(--accent-soft)}.badge.waiting-approval{color:var(--warn);border-color:var(--warn);background:var(--warn-soft)}.badge.done{color:var(--ok);border-color:var(--ok);background:var(--ok-soft)}.badge.blocked{color:var(--warn);border-color:var(--warn);background:var(--warn-soft)}.badge.aborted,.badge.failed,.badge.limit-reached{color:var(--bad);border-color:var(--bad);background:var(--bad-soft)}pre{background:var(--code);border:1px solid var(--line);border-radius:9px;padding:10px 12px;overflow:auto;font-family:var(--mono);font-size:calc(12.5px * var(--scale));line-height:1.5;margin:6px 0;white-space:pre-wrap;word-break:break-word}pre.tall{max-height:420px}details>summary{cursor:pointer;color:var(--muted);font-size:calc(13px * var(--scale));-webkit-user-select:none;-moz-user-select:none;user-select:none}details>summary:hover{color:var(--accent)}details[open]>summary{margin-bottom:6px}.task{border-left:4px solid var(--line-strong);padding-left:14px;margin-bottom:18px}.task.done{border-left-color:var(--ok)}.task.running,.task.waiting-approval{border-left-color:var(--accent)}.task.blocked{border-left-color:var(--warn)}.task.aborted,.task.failed,.task.limit-reached{border-left-color:var(--bad)}.task h4{margin:0 0 4px;font-size:calc(15px * var(--scale))}.task:target{background:var(--accent-soft);border-radius:0 10px 10px 0;padding:8px 8px 8px 14px}.summary{background:var(--ok-soft);border:1px solid var(--ok);border-radius:9px;padding:10px 12px;margin:8px 0;white-space:pre-wrap}.reason{color:var(--bad)}.approval{background:var(--warn-soft);border:2px solid var(--warn);border-radius:var(--radius);padding:12px 14px;margin-bottom:14px;position:-webkit-sticky;position:sticky;top:8px;z-index:2}.approval code{font-size:calc(13px * var(--scale))}.approval code,.log{font-family:var(--mono)}.log{font-size:calc(12.5px * var(--scale));max-height:320px;overflow:auto;background:var(--code);border:1px solid var(--line);border-radius:9px;padding:8px 10px}.log div{white-space:pre-wrap;word-break:break-word}.log .warn{color:var(--warn)}.log .error{color:var(--bad)}.log .time{color:var(--muted);margin-right:8px}table{width:100%;border-collapse:collapse}td,th{text-align:left;padding:9px 6px;border-bottom:1px solid var(--line);font-size:calc(14px * var(--scale));vertical-align:top}th{color:var(--muted);font-weight:700;font-size:calc(12px * var(--scale));text-transform:uppercase;letter-spacing:.04em}.err{color:var(--bad);font-size:calc(13px * var(--scale))}.notice{border:1px solid var(--bad);background:var(--bad-soft);color:var(--ink);border-radius:10px;padding:10px 12px;margin:10px 0;font-size:calc(13.5px * var(--scale))}.notice strong{color:var(--bad)}.notice ul{margin:6px 0 0;padding-left:20px}.notice.caution{border-color:var(--warn);background:var(--warn-soft)}.notice.caution strong{color:var(--warn)}.notice.calm{border-color:var(--line-strong);background:var(--bg-tint)}.notice.calm strong{color:var(--ink)}.counts{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:4px}.count{border:1px solid var(--line);border-radius:10px;padding:10px 14px;min-width:96px;background:var(--bg)}.count .n{font-size:calc(22px * var(--scale));font-weight:700;line-height:1.2}.count .k{color:var(--muted);font-size:calc(12px * var(--scale));text-transform:uppercase;letter-spacing:.04em}.count.done .n{color:var(--ok)}.count.failed .n{color:var(--bad)}.count.running .n{color:var(--accent)}.attempts{list-style:none;margin:6px 0 0;padding:0 0 0 12px;border-left:2px solid var(--line)}.attempts>li{margin:0 0 10px}.attempts .head{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap}.attempts .when{color:var(--muted);font-size:calc(12.5px * var(--scale))}.attempts .what{margin:4px 0 0}.count.queued .n{color:var(--accent)}.flow{list-style:none;margin:8px 0 0;padding:0}.flow>li{position:relative;padding:10px 0 14px 28px;border-left:2px solid var(--line);margin-left:7px}.flow>li:last-child{border-left-color:transparent}.flow>li:before{content:"";position:absolute;left:-9px;top:16px;width:16px;height:16px;border-radius:50%;background:var(--panel);border:3px solid var(--line-strong)}.flow>li.done:before{border-color:var(--ok);background:var(--ok)}.flow>li.running:before,.flow>li.waiting-approval:before{border-color:var(--accent);background:var(--accent)}.flow>li.aborted:before,.flow>li.failed:before,.flow>li.limit-reached:before{border-color:var(--bad);background:var(--bad)}.flow>li.queued:before{border-color:var(--line-strong);background:var(--panel)}.flow>li.next:before{border-color:var(--accent);background:var(--panel);box-shadow:0 0 0 4px var(--accent-soft)}.flow .when{color:var(--muted);font-size:calc(12.5px * var(--scale))}.flow .what{margin:4px 0 0}.flow .head{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}.flow .head strong{font-size:calc(14.5px * var(--scale))}.chip{display:inline-block;border:1px solid var(--line);border-radius:999px;padding:1px 9px;font-size:calc(12px * var(--scale));color:var(--muted);background:var(--bg-tint)}.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:10px}.toolbar input[type=text],.toolbar select{width:auto;min-width:150px}.segmented{display:inline-flex;flex-wrap:wrap;max-width:100%;border:1px solid var(--line-strong);border-radius:9px;overflow:hidden}.segmented button{border:none;border-radius:0;border-right:1px solid var(--line)}.segmented button:last-child{border-right:none}.segmented button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);font-weight:600}.button-link{display:inline-block;background:var(--accent);color:var(--accent-ink);border:1px solid var(--accent);border-radius:9px;padding:8px 13px;font:inherit;font-weight:600;cursor:pointer;text-decoration:none}.button-link:hover{filter:brightness(1.08);text-decoration:none}.button-link+.button-link{background:var(--panel);color:var(--ink);border-color:var(--line-strong);font-weight:400}.button-link+.button-link:hover{background:var(--accent-soft);border-color:var(--accent);filter:none}.button-link.plain{background:var(--panel);color:var(--ink);border-color:var(--line-strong);font-weight:400}.button-link.quiet{background:transparent;color:var(--muted);border-color:transparent;font-weight:400}.button-link.plain:hover,.button-link.quiet:hover{background:var(--accent-soft);border-color:var(--accent);color:var(--accent);filter:none}.empty{color:var(--muted);padding:14px 0}.visually-hidden{position:absolute;-webkit-clip-path:inset(50%);clip-path:inset(50%);width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.dropzone{border:2px dashed var(--line-strong);border-radius:12px;padding:10px;background:var(--bg-tint)}.dropzone.active{border-color:var(--accent);background:var(--accent-soft)}.dropzone textarea{margin:0}.dropzone p{margin:8px 2px 2px}.batch-row td{vertical-align:middle}.batch-row.running{background:var(--accent-soft)}.run-order{list-style:decimal;margin:10px 0 4px;padding-left:28px}.run-order li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:3px 0}.run-order button{padding:2px 8px;margin-left:4px}.linkish{background:none;border:0;padding:0;margin:0;color:var(--accent);font:inherit;cursor:pointer;text-decoration:underline}.linkish:hover{filter:brightness(1.15)}.run-choice{display:flex;gap:20px;flex-wrap:wrap;margin:12px 0 4px}.run-choice>div{flex:1 1 280px}.run-choice .why{margin:6px 2px 0}.rich>:first-child{margin-top:0}.rich>:last-child{margin-bottom:0}.rich p{margin:0 0 8px;max-width:76ch}.rich ul{margin:0 0 8px;padding-left:20px}.rich li{margin:2px 0;max-width:74ch}.rich code{font-family:var(--mono);font-size:.92em;background:var(--bg-tint);border:1px solid var(--line);border-radius:5px;padding:0 4px;word-break:break-word}.rich pre{margin:6px 0 8px}.summary .rich{white-space:normal}select{-moz-appearance:none;appearance:none;-webkit-appearance:none;padding-right:34px;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");background-repeat:no-repeat;background-position:right 12px center;cursor:pointer}select:disabled{cursor:not-allowed;opacity:.6}select optgroup,select option{background:var(--panel);color:var(--ink)}.top nav a{display:inline-flex;align-items:center;gap:6px}.top nav a .nav-icon{flex:none;opacity:.85}.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.55);display:flex;align-items:center;justify-content:center;padding:16px;z-index:50}.modal{background:var(--panel);color:var(--ink);border:1px solid var(--line-strong);border-radius:var(--radius);box-shadow:0 20px 60px rgba(0,0,0,.35);width:min(560px,100%);max-height:calc(100vh - 32px);overflow:auto;padding:18px 20px}.modal h2{margin:0 0 10px;font-size:calc(16px * var(--scale))}.modal.danger h2{color:var(--bad)}.modal-body{white-space:pre-wrap;line-height:1.5;font-size:calc(14px * var(--scale))}.modal-actions{justify-content:flex-end;margin-top:16px}.panel{overflow-wrap:break-word}td,th{position:relative}@media (max-width:600px){.wrap{padding:12px 10px 60px}.top{gap:8px;margin-bottom:12px;padding-bottom:10px}.top h1{font-size:calc(18px * var(--scale))}.top nav{width:100%;flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;padding-bottom:4px;scrollbar-width:none}.top nav::-webkit-scrollbar{display:none}.top nav a{flex:none;padding:6px 9px;font-size:calc(13px * var(--scale))}.panel{padding:12px}.row{gap:8px}.row>input[type=text],.row>select,.row>textarea,.toolbar input[type=text],.toolbar select,.toolbar>div{width:100%;min-width:0;flex:1 1 100%}.row>button{flex:1 1 auto}select{min-width:0!important;width:100%}table{display:block;overflow-x:auto;white-space:nowrap}.counts{gap:6px}.count{flex-grow:1;flex-shrink:1;flex-basis:calc(50% - 6px)}.segmented{display:flex;width:100%}.segmented button{flex:1 1 auto}.flow>li{padding-left:18px}.modal{padding:14px}.log,pre{font-size:calc(12px * var(--scale))}}tr.inactive td{opacity:.6}tr.inactive td:first-child{opacity:1}.chip.inactive{color:var(--warn);border-color:var(--warn)}.story-when{color:var(--muted);font-size:calc(12px * var(--scale));font-feature-settings:"tnum";font-variant-numeric:tabular-nums;white-space:nowrap}.sync-cmd{white-space:pre-wrap;overflow-wrap:anywhere}.table-scroll{overflow-x:auto}.metrics td:not(:first-child),.metrics th:not(:first-child){white-space:nowrap}.handoff .handoff-row{margin:4px 0;overflow-wrap:anywhere}.handoff .handoff-row ul{margin:2px 0 0;padding-left:20px}.run-fold{border-top:1px solid var(--line);padding:8px 0 4px}.run-fold:first-of-type{border-top:none}.run-fold>summary{cursor:pointer;list-style:none}.run-fold>summary::-webkit-details-marker{display:none}.run-fold>summary:before{content:"▸";display:inline-block;width:16px;color:var(--muted);transition:transform .15s}.run-fold[open]>summary:before{transform:rotate(90deg)}.run-fold>summary .run-heading{display:inline-block;width:calc(100% - 16px);vertical-align:top}.run-heading h2{font-size:calc(15px * var(--scale))}.exports{white-space:nowrap}@media (max-width:600px){.exports{white-space:normal}}.modal.wide{width:min(820px,100%)}.dir-tree-box{margin-top:8px}.dir-tree{list-style:none;margin:6px 0 0;padding-left:0}.dir-tree .dir-tree{padding-left:18px;border-left:1px dashed var(--line);margin-left:8px}.dir-row{display:flex;align-items:center;gap:4px;padding:1px 0}.dir-flip{width:calc(20px * var(--scale));padding:0;border:none;color:var(--muted);font-size:calc(12px * var(--scale))}.dir-flip,.dir-name{background:transparent}.dir-name{border:1px solid transparent;padding:2px 8px 2px 6px;border-radius:6px;font-family:var(--mono);font-size:calc(12.5px * var(--scale));display:inline-flex;align-items:center;gap:6px}.dir-name:hover{border-color:var(--line-strong)}.dir-mark{display:inline-block;width:12px;text-align:center;color:var(--muted)}.dir.in>.dir-row .dir-name{background:var(--ok-soft);color:var(--ok);border-color:var(--ok)}.dir.inherited>.dir-row .dir-name{color:var(--ok)}.dir.out>.dir-row .dir-name{background:var(--bad-soft);color:var(--bad);border-color:var(--bad);text-decoration:line-through}.dir.out-inherited>.dir-row .dir-name{color:var(--muted);text-decoration:line-through}.dir-out{width:calc(22px * var(--scale));height:calc(22px * var(--scale));padding:0;border-radius:6px;font-size:calc(13px * var(--scale));line-height:1;color:var(--muted)}.dir-out.on{color:var(--bad);border-color:var(--bad);background:var(--bad-soft)}.story-box{margin-top:8px;border:1px solid var(--line);border-radius:var(--radius);padding:10px 12px;background:var(--code)}.story{list-style:none;margin:6px 0;padding:0}.story>li{border-left:3px solid var(--line-strong);padding:6px 10px;margin:6px 0}.story>li.sent{border-left-color:var(--accent)}.story>li.reply{border-left-color:var(--ok)}.story>li.story-step{border-left-color:var(--muted)}.story>li.failed{border-left-color:var(--bad);background:var(--bad-soft)}.story>li.story-review{border-left-color:var(--warn)}.story-head{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:calc(13px * var(--scale))}.story-cmd{margin:4px 0;color:var(--ink)}.story-cmd,.story-out{white-space:pre-wrap;word-break:break-word;font-size:calc(12px * var(--scale))}.story-out{margin:4px 0 0;max-height:420px;overflow:auto;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:8px}.story-out.always{max-height:260px}.story-scroll.live{max-height:65vh;overflow:auto;overscroll-behavior:contain}.story-out.terminal{max-height:45vh;overscroll-behavior:contain}.diff-overlay{position:fixed;inset:0;z-index:100;background:var(--bg);display:flex;flex-direction:column}.diff-head{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:10px 16px;border-bottom:1px solid var(--line);background:var(--panel)}.diff-head h2{margin:0;font-size:calc(16px * var(--scale))}.diff-body{flex:1 1;min-height:0;display:grid;grid-template-columns:minmax(220px,300px) 1fr}.diff-files{overflow:auto;border-right:1px solid var(--line);padding:6px;background:var(--panel)}.diff-file{display:flex;gap:6px;align-items:baseline;width:100%;text-align:left;border:0;border-radius:6px;background:none;padding:5px 6px;font-size:calc(12px * var(--scale));cursor:pointer}.diff-file:hover{background:var(--bg-tint)}.diff-file.on{background:var(--accent-soft)}.diff-path{flex:1 1;min-width:0;overflow-wrap:anywhere}.diff-counts{white-space:nowrap;font-family:var(--mono);font-size:calc(11px * var(--scale))}.diff-counts .plus{color:var(--ok)}.diff-counts .minus{color:var(--bad)}.diff-status{font-family:var(--mono);font-weight:700;width:1.2em;text-align:center;border-radius:4px}.diff-status.s-A{color:var(--ok)}.diff-status.s-D{color:var(--bad)}.diff-status.s-M{color:var(--warn)}.diff-status.s-C,.diff-status.s-R{color:var(--accent)}.diff-main{display:flex;flex-direction:column;min-width:0;min-height:0}.diff-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:6px 12px;border-bottom:1px solid var(--line)}.diff-name{font-family:var(--mono);font-size:calc(12px * var(--scale));overflow-wrap:anywhere}.diff-scroll{flex:1 1;overflow:auto;overscroll-behavior:contain}.diff-table{width:100%;border-collapse:collapse;table-layout:fixed;font-family:var(--mono);font-size:calc(12px * var(--scale))}.diff-table col.num{width:calc(52px * var(--scale))}.diff-table thead th{position:-webkit-sticky;position:sticky;top:0;z-index:1;background:var(--panel);border-bottom:1px solid var(--line);text-align:left;padding:4px 8px;font-family:inherit}.diff-table td{padding:0 8px;vertical-align:top;line-height:1.5}.diff-table td.num{text-align:right;color:var(--muted);-webkit-user-select:none;-moz-user-select:none;user-select:none;border-right:1px solid var(--line)}.diff-table td.code{white-space:pre-wrap;overflow-wrap:anywhere}.diff-table.nowrap td.code{white-space:pre;overflow-wrap:normal}.diff-table.nowrap{width:max-content;min-width:100%}.diff-row.change td.l,.diff-row.del td.l{background:var(--bad-soft)}.diff-row.add td.r,.diff-row.change td.r{background:var(--ok-soft)}.diff-row mark{background:color-mix(in srgb,currentColor 22%,transparent);color:inherit;border-radius:2px}.diff-row td.empty{background:repeating-linear-gradient(135deg,transparent 0 6px,var(--bg-tint) 6px 12px)}.diff-row.current td.num{box-shadow:inset 3px 0 0 var(--accent)}.diff-gap td{background:var(--bg-tint);text-align:center;padding:2px}@media (max-width:760px){.diff-body{grid-template-columns:1fr;grid-template-rows:auto 1fr}.diff-files{max-height:30vh;border-right:0;border-bottom:1px solid var(--line)}}.scroll-jump{position:fixed;right:16px;bottom:24px;display:flex;flex-direction:column;gap:8px;z-index:40}.scroll-jump button{width:calc(42px * var(--scale));height:calc(42px * var(--scale));border-radius:50%;padding:0;font-size:calc(20px * var(--scale));line-height:1;box-shadow:0 2px 8px rgba(0,0,0,.18)}.story-notes{margin:4px 0;font-size:calc(13px * var(--scale))}.story-fixed{padding:8px 10px;border-radius:8px;background:var(--panel);border:1px solid var(--line);margin:6px 0}.story-fixed.close{border-color:var(--ok)}.story-fixed.close.failed{border-color:var(--bad);background:var(--bad-soft)}.option-inline{gap:6px}.option-inline,.story-box .live{display:inline-flex;align-items:center}.story-box .live{gap:4px;color:var(--ok);font-size:calc(11px * var(--scale));font-weight:700;text-transform:uppercase}.story-box .live .dot,button .dot{width:6px;height:6px;border-radius:50%;background:currentColor;animation:live-pulse 1.6s ease-in-out infinite}button .dot{display:inline-block;margin-right:6px;vertical-align:middle}.info-dot{width:calc(18px * var(--scale));height:calc(18px * var(--scale));min-width:calc(18px * var(--scale));padding:0;border-radius:50%;font-size:calc(11px * var(--scale));font-style:italic;font-weight:700;line-height:1}.info-panel{flex-basis:100%;margin-top:6px}.info-panel dl{margin:6px 0 0}.info-panel dt{font-weight:600;margin-top:6px}.info-panel dd{margin:0 0 0 14px;opacity:.85}.flow .head .pick{margin:0 2px 0 0;flex:0 0 auto}.chip.inside{font-size:calc(10.5px * var(--scale));opacity:.85}.chip.inside.out{color:var(--bad);border-color:var(--bad)}.approval-banner{position:-webkit-sticky;position:sticky;top:0;z-index:30;background:var(--warn-soft);border:3px solid var(--warn);border-radius:var(--radius);padding:12px 14px 2px;margin:0 0 16px;box-shadow:0 6px 18px rgba(0,0,0,.18);max-height:min(70vh,calc(30rem * var(--scale)));overflow:auto}.approval-banner h2{margin:0 0 4px;color:var(--warn)}.approval-banner .approval{position:static;background:var(--bg);margin-bottom:10px}.approval-banner .approval button{font-size:calc(15px * var(--scale));padding:8px 14px}
|