diff --git a/internal/frontend/server/static/assets/ArtifactsReview-64Gq44h0.js b/internal/frontend/server/static/assets/ArtifactsReview-B65rCcbV.js similarity index 99% rename from internal/frontend/server/static/assets/ArtifactsReview-64Gq44h0.js rename to internal/frontend/server/static/assets/ArtifactsReview-B65rCcbV.js index 958c00e6..d66ba781 100644 --- a/internal/frontend/server/static/assets/ArtifactsReview-64Gq44h0.js +++ b/internal/frontend/server/static/assets/ArtifactsReview-B65rCcbV.js @@ -1 +1 @@ -import{r as d,b as w,j as e,S,s as $}from"./index-DcyMECWA.js";function k(a){const l=new URLSearchParams;for(const[j,c]of Object.entries(a))c!==void 0&&c!==""&&l.set(j,c);const r=l.toString();return r?`?${r}`:""}function A(a){return a?a.verified===!0||a.passed===!0?{kind:"complete",label:"verified"}:a.passed===!1?{kind:"failed",label:"failed"}:a.claimed&&!a.verified?{kind:"needs-you",label:"claimed (unverified)"}:{kind:"unknown",label:"unknown"}:{kind:"unknown",label:"unknown"}}function T({available:a,rootID:l,entity:r,onOpenFile:j}){var R;const[c,v]=d.useState([]),[s,o]=d.useState(""),[x,f]=d.useState(""),[i,n]=d.useState(null),[h,g]=d.useState(),[p,y]=d.useState(!1),b=d.useCallback(async()=>{if(a){y(!0),o("");try{const t=await w(`/v1/artifacts${k({root:l,actorRoot:l,actorSession:l,type:x||void 0,limit:"100"})}`);v(t.artifacts||[])}catch(t){o(t instanceof Error?t.message:String(t)),v([])}finally{y(!1)}}},[a,l,x]);d.useEffect(()=>{b()},[b]),d.useEffect(()=>{if(!r||!a)return;const[t,u]=r.split("@"),m=u?Number(u):void 0;w(`/v1/artifacts/${encodeURIComponent(t)}${k({root:l,actorRoot:l,actorSession:l,version:m&&Number.isFinite(m)?String(m):void 0})}`).then(N=>{n(N),g(N.version)}).catch(N=>o(N instanceof Error?N.message:String(N)))},[r,a,l]);const C=async(t,u)=>{o("");try{const m=await w(`/v1/artifacts/${encodeURIComponent(t)}${k({root:l,actorRoot:l,actorSession:l,version:u!==void 0?String(u):void 0})}`);n(m),g(m.version)}catch(m){o(m instanceof Error?m.message:String(m)),n(null)}};if(!a)return e.jsxs("section",{"aria-label":"Artifacts",children:[e.jsx("h2",{children:"Artifacts"}),e.jsx("p",{className:"muted",role:"status",children:"Artifacts capability unavailable."})]});const E=d.useMemo(()=>{const t=new Set;for(const u of c)u.type&&t.add(u.type);return[...t].sort()},[c]);return e.jsxs("section",{className:"review-panel","aria-label":"Artifacts",children:[e.jsxs("header",{className:"review-head",children:[e.jsx("h2",{children:"Artifacts"}),e.jsx("button",{type:"button",onClick:()=>void b(),disabled:p,children:"Refresh"})]}),e.jsxs("label",{className:"review-filter",children:["Type",e.jsxs("select",{value:x,onChange:t=>f(t.target.value),children:[e.jsx("option",{value:"",children:"All"}),E.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),s?e.jsx("p",{className:"muted",role:"alert",children:s}):null,p&&!c.length?e.jsx("p",{className:"muted",children:"Loading…"}):null,!p&&!c.length&&!s?e.jsx("p",{className:"muted",children:"No artifacts visible for this actor/root."}):null,e.jsx("ul",{className:"review-list","aria-label":"Artifact list",children:c.map(t=>{var u;return e.jsx("li",{children:e.jsxs("button",{type:"button",className:(i==null?void 0:i.id)===t.id?"active":"",onClick:()=>void C(t.id),children:[e.jsx("strong",{children:t.title||t.id}),e.jsx("span",{className:"muted",children:[t.type,t.scope,t.version!==void 0?`v${t.version}`:"",(u=t.ownerSession)==null?void 0:u.slice(0,8)].filter(Boolean).join(" · ")})]})},t.id)})}),i?e.jsxs("article",{className:"review-detail","aria-label":"Artifact detail",children:[e.jsxs("header",{children:[e.jsx("h3",{children:i.title||i.id}),e.jsx("button",{type:"button",className:"icon-btn","aria-label":"Close artifact detail",onClick:()=>n(null),children:"×"})]}),e.jsxs("dl",{children:[e.jsx("dt",{children:"ID"}),e.jsx("dd",{children:e.jsx("code",{children:i.id})}),e.jsx("dt",{children:"Type"}),e.jsx("dd",{children:i.type||"—"}),e.jsx("dt",{children:"Version"}),e.jsxs("dd",{children:[e.jsx("input",{type:"number",min:1,value:h??i.version??1,onChange:t=>g(Number(t.target.value)),"aria-label":"Artifact version"}),e.jsx("button",{type:"button",onClick:()=>void C(i.id,h),children:"Load version"})]}),e.jsx("dt",{children:"Scope"}),e.jsx("dd",{children:i.scope||"—"}),e.jsx("dt",{children:"Owner"}),e.jsx("dd",{children:e.jsx("code",{children:i.ownerSession||"—"})}),e.jsx("dt",{children:"Access"}),e.jsx("dd",{children:i.access||"—"}),i.expiresAt?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Expires"}),e.jsx("dd",{children:i.expiresAt})]}):null]}),i.content!==void 0?e.jsx("pre",{className:"review-content",children:i.content||"(empty)"}):e.jsx("p",{className:"muted",children:"Content unavailable or redacted."}),j&&((R=i.content)!=null&&R.includes("/"))?e.jsx("p",{className:"muted",children:"Open paths from content via Code mode file links in the transcript."}):null]}):null]})}function B({available:a,rootID:l}){const[r,j]=d.useState("active"),[c,v]=d.useState([]),[s,o]=d.useState(""),[x,f]=d.useState(!1),i=d.useCallback(async()=>{if(a){f(!0),o("");try{const h=await w(`${r==="active"?"/v1/ledger":"/v1/ledger/history"}${k({root:l,actorRoot:l,actorSession:l,limit:"100"})}`);v(h.entries||[])}catch(n){o(n instanceof Error?n.message:String(n)),v([])}finally{f(!1)}}},[a,l,r]);return d.useEffect(()=>{i()},[i]),a?e.jsxs("section",{className:"review-panel","aria-label":"Decision ledger",children:[e.jsxs("header",{className:"review-head",children:[e.jsx("h2",{children:"Decisions"}),e.jsxs("div",{className:"review-tabs",role:"tablist",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":r==="active",className:r==="active"?"active":"",onClick:()=>j("active"),children:"Active"}),e.jsx("button",{type:"button",role:"tab","aria-selected":r==="history",className:r==="history"?"active":"",onClick:()=>j("history"),children:"History"})]})]}),s?e.jsx("p",{className:"muted",role:"alert",children:s}):null,x&&!c.length?e.jsx("p",{className:"muted",children:"Loading…"}):null,!x&&!c.length&&!s?e.jsx("p",{className:"muted",children:"No ledger entries."}):null,e.jsx("ul",{className:"review-list","aria-label":"Ledger entries",children:c.map(n=>{var p,y;const h=(n.status||"active").toLowerCase(),g=h==="invalidated"||h==="superseded"?"failed":h==="active"?"complete":"unknown";return e.jsxs("li",{className:`ledger-row status-${h}`,children:[e.jsxs("div",{className:"ledger-row-head",children:[e.jsx(S,{kind:g,label:h}),e.jsx("strong",{children:n.kind||"entry"}),e.jsx("code",{className:"muted",children:n.id})]}),e.jsx("p",{children:n.statement||"(no statement)"}),e.jsx("div",{className:"muted ledger-meta",children:[n.authorAgent||((p=n.authorSession)==null?void 0:p.slice(0,8)),n.confidence,n.supersededBy?`→ ${n.supersededBy}`:"",n.supersedes?`← ${n.supersedes}`:""].filter(Boolean).join(" · ")}),(y=n.scopePaths)!=null&&y.length?e.jsx("ul",{className:"review-paths",children:n.scopePaths.map(b=>e.jsx("li",{children:e.jsx("code",{children:b})},b))}):null,n.invalidateReason?e.jsxs("p",{className:"muted",children:["Invalidated: ",n.invalidateReason]}):null]},n.id)})})]}):e.jsxs("section",{"aria-label":"Decision ledger",children:[e.jsx("h2",{children:"Decisions"}),e.jsx("p",{className:"muted",role:"status",children:"Ledger capability unavailable."})]})}function P({team:a,onSelectAgent:l,onOpenFile:r}){if(!a.available)return e.jsxs("section",{"aria-label":"Team review",children:[e.jsx("h2",{children:"Review"}),e.jsx("p",{className:"muted",children:a.unavailableReason||"Team observation unavailable"})]});const j=Object.values(a.members).filter(s=>s.terminal||s.terminalSummary),c=a.pathOverlaps||[],v=a.verifications||[];return e.jsxs("section",{className:"review-panel","aria-label":"Team review",children:[e.jsx("h2",{children:"Review"}),e.jsx("p",{className:"muted",children:"Handoffs, verification, and path conflicts from live observation (read-only)."}),e.jsx("h3",{children:"Handoffs"}),j.length?null:e.jsx("p",{className:"muted",children:"No terminal handoffs yet."}),e.jsx("ul",{className:"review-list",children:j.map(s=>{var f;const o=[...v].reverse().find(i=>i.sessionId===s.sessionId),x=A(o);return e.jsxs("li",{children:[e.jsxs("button",{type:"button",onClick:()=>l==null?void 0:l(s.sessionId),children:[e.jsx("strong",{children:s.name||s.agent||s.sessionId.slice(0,8)}),e.jsx(S,{kind:$(s.state),label:s.state||"done"}),e.jsx(S,{kind:x.kind,label:x.label})]}),s.terminalSummary?e.jsx("p",{children:s.terminalSummary}):null,s.blockReason?e.jsxs("p",{className:"muted",children:["Blocked: ",s.blockReason]}):null,e.jsxs("div",{className:"muted",children:["Budget: ",s.budget?JSON.stringify(s.budget).slice(0,120):"unknown"]}),o!=null&&o.summary?e.jsxs("p",{className:"muted",children:["Verification: ",o.summary]}):null,(f=s.filesTouched)!=null&&f.length?e.jsx("ul",{className:"review-paths",children:s.filesTouched.map(i=>e.jsx("li",{children:e.jsx("button",{type:"button",className:"linkish",onClick:()=>r==null?void 0:r(i),children:e.jsx("code",{children:i})})},i))}):null]},s.sessionId)})}),e.jsx("h3",{children:"Path overlaps"}),c.length?null:e.jsx("p",{className:"muted",children:"No path conflicts observed."}),e.jsx("ul",{className:"review-list",children:c.map(s=>e.jsxs("li",{children:[e.jsx("button",{type:"button",className:"linkish",onClick:()=>r==null?void 0:r(s.path),children:e.jsx("code",{children:s.path})}),e.jsx("span",{className:"muted",children:(s.sessions||[]).join(", ")||"unknown agents"})]},s.path))})]})}export{T as ArtifactsPanel,B as LedgerPanel,P as TeamReviewPanel,A as verificationLabel}; +import{r as d,b as w,j as e,S,s as $}from"./index-BK8GKzWA.js";function k(a){const l=new URLSearchParams;for(const[j,c]of Object.entries(a))c!==void 0&&c!==""&&l.set(j,c);const r=l.toString();return r?`?${r}`:""}function A(a){return a?a.verified===!0||a.passed===!0?{kind:"complete",label:"verified"}:a.passed===!1?{kind:"failed",label:"failed"}:a.claimed&&!a.verified?{kind:"needs-you",label:"claimed (unverified)"}:{kind:"unknown",label:"unknown"}:{kind:"unknown",label:"unknown"}}function T({available:a,rootID:l,entity:r,onOpenFile:j}){var R;const[c,v]=d.useState([]),[s,o]=d.useState(""),[x,f]=d.useState(""),[i,n]=d.useState(null),[h,g]=d.useState(),[p,y]=d.useState(!1),b=d.useCallback(async()=>{if(a){y(!0),o("");try{const t=await w(`/v1/artifacts${k({root:l,actorRoot:l,actorSession:l,type:x||void 0,limit:"100"})}`);v(t.artifacts||[])}catch(t){o(t instanceof Error?t.message:String(t)),v([])}finally{y(!1)}}},[a,l,x]);d.useEffect(()=>{b()},[b]),d.useEffect(()=>{if(!r||!a)return;const[t,u]=r.split("@"),m=u?Number(u):void 0;w(`/v1/artifacts/${encodeURIComponent(t)}${k({root:l,actorRoot:l,actorSession:l,version:m&&Number.isFinite(m)?String(m):void 0})}`).then(N=>{n(N),g(N.version)}).catch(N=>o(N instanceof Error?N.message:String(N)))},[r,a,l]);const C=async(t,u)=>{o("");try{const m=await w(`/v1/artifacts/${encodeURIComponent(t)}${k({root:l,actorRoot:l,actorSession:l,version:u!==void 0?String(u):void 0})}`);n(m),g(m.version)}catch(m){o(m instanceof Error?m.message:String(m)),n(null)}};if(!a)return e.jsxs("section",{"aria-label":"Artifacts",children:[e.jsx("h2",{children:"Artifacts"}),e.jsx("p",{className:"muted",role:"status",children:"Artifacts capability unavailable."})]});const E=d.useMemo(()=>{const t=new Set;for(const u of c)u.type&&t.add(u.type);return[...t].sort()},[c]);return e.jsxs("section",{className:"review-panel","aria-label":"Artifacts",children:[e.jsxs("header",{className:"review-head",children:[e.jsx("h2",{children:"Artifacts"}),e.jsx("button",{type:"button",onClick:()=>void b(),disabled:p,children:"Refresh"})]}),e.jsxs("label",{className:"review-filter",children:["Type",e.jsxs("select",{value:x,onChange:t=>f(t.target.value),children:[e.jsx("option",{value:"",children:"All"}),E.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),s?e.jsx("p",{className:"muted",role:"alert",children:s}):null,p&&!c.length?e.jsx("p",{className:"muted",children:"Loading…"}):null,!p&&!c.length&&!s?e.jsx("p",{className:"muted",children:"No artifacts visible for this actor/root."}):null,e.jsx("ul",{className:"review-list","aria-label":"Artifact list",children:c.map(t=>{var u;return e.jsx("li",{children:e.jsxs("button",{type:"button",className:(i==null?void 0:i.id)===t.id?"active":"",onClick:()=>void C(t.id),children:[e.jsx("strong",{children:t.title||t.id}),e.jsx("span",{className:"muted",children:[t.type,t.scope,t.version!==void 0?`v${t.version}`:"",(u=t.ownerSession)==null?void 0:u.slice(0,8)].filter(Boolean).join(" · ")})]})},t.id)})}),i?e.jsxs("article",{className:"review-detail","aria-label":"Artifact detail",children:[e.jsxs("header",{children:[e.jsx("h3",{children:i.title||i.id}),e.jsx("button",{type:"button",className:"icon-btn","aria-label":"Close artifact detail",onClick:()=>n(null),children:"×"})]}),e.jsxs("dl",{children:[e.jsx("dt",{children:"ID"}),e.jsx("dd",{children:e.jsx("code",{children:i.id})}),e.jsx("dt",{children:"Type"}),e.jsx("dd",{children:i.type||"—"}),e.jsx("dt",{children:"Version"}),e.jsxs("dd",{children:[e.jsx("input",{type:"number",min:1,value:h??i.version??1,onChange:t=>g(Number(t.target.value)),"aria-label":"Artifact version"}),e.jsx("button",{type:"button",onClick:()=>void C(i.id,h),children:"Load version"})]}),e.jsx("dt",{children:"Scope"}),e.jsx("dd",{children:i.scope||"—"}),e.jsx("dt",{children:"Owner"}),e.jsx("dd",{children:e.jsx("code",{children:i.ownerSession||"—"})}),e.jsx("dt",{children:"Access"}),e.jsx("dd",{children:i.access||"—"}),i.expiresAt?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Expires"}),e.jsx("dd",{children:i.expiresAt})]}):null]}),i.content!==void 0?e.jsx("pre",{className:"review-content",children:i.content||"(empty)"}):e.jsx("p",{className:"muted",children:"Content unavailable or redacted."}),j&&((R=i.content)!=null&&R.includes("/"))?e.jsx("p",{className:"muted",children:"Open paths from content via Code mode file links in the transcript."}):null]}):null]})}function B({available:a,rootID:l}){const[r,j]=d.useState("active"),[c,v]=d.useState([]),[s,o]=d.useState(""),[x,f]=d.useState(!1),i=d.useCallback(async()=>{if(a){f(!0),o("");try{const h=await w(`${r==="active"?"/v1/ledger":"/v1/ledger/history"}${k({root:l,actorRoot:l,actorSession:l,limit:"100"})}`);v(h.entries||[])}catch(n){o(n instanceof Error?n.message:String(n)),v([])}finally{f(!1)}}},[a,l,r]);return d.useEffect(()=>{i()},[i]),a?e.jsxs("section",{className:"review-panel","aria-label":"Decision ledger",children:[e.jsxs("header",{className:"review-head",children:[e.jsx("h2",{children:"Decisions"}),e.jsxs("div",{className:"review-tabs",role:"tablist",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":r==="active",className:r==="active"?"active":"",onClick:()=>j("active"),children:"Active"}),e.jsx("button",{type:"button",role:"tab","aria-selected":r==="history",className:r==="history"?"active":"",onClick:()=>j("history"),children:"History"})]})]}),s?e.jsx("p",{className:"muted",role:"alert",children:s}):null,x&&!c.length?e.jsx("p",{className:"muted",children:"Loading…"}):null,!x&&!c.length&&!s?e.jsx("p",{className:"muted",children:"No ledger entries."}):null,e.jsx("ul",{className:"review-list","aria-label":"Ledger entries",children:c.map(n=>{var p,y;const h=(n.status||"active").toLowerCase(),g=h==="invalidated"||h==="superseded"?"failed":h==="active"?"complete":"unknown";return e.jsxs("li",{className:`ledger-row status-${h}`,children:[e.jsxs("div",{className:"ledger-row-head",children:[e.jsx(S,{kind:g,label:h}),e.jsx("strong",{children:n.kind||"entry"}),e.jsx("code",{className:"muted",children:n.id})]}),e.jsx("p",{children:n.statement||"(no statement)"}),e.jsx("div",{className:"muted ledger-meta",children:[n.authorAgent||((p=n.authorSession)==null?void 0:p.slice(0,8)),n.confidence,n.supersededBy?`→ ${n.supersededBy}`:"",n.supersedes?`← ${n.supersedes}`:""].filter(Boolean).join(" · ")}),(y=n.scopePaths)!=null&&y.length?e.jsx("ul",{className:"review-paths",children:n.scopePaths.map(b=>e.jsx("li",{children:e.jsx("code",{children:b})},b))}):null,n.invalidateReason?e.jsxs("p",{className:"muted",children:["Invalidated: ",n.invalidateReason]}):null]},n.id)})})]}):e.jsxs("section",{"aria-label":"Decision ledger",children:[e.jsx("h2",{children:"Decisions"}),e.jsx("p",{className:"muted",role:"status",children:"Ledger capability unavailable."})]})}function P({team:a,onSelectAgent:l,onOpenFile:r}){if(!a.available)return e.jsxs("section",{"aria-label":"Team review",children:[e.jsx("h2",{children:"Review"}),e.jsx("p",{className:"muted",children:a.unavailableReason||"Team observation unavailable"})]});const j=Object.values(a.members).filter(s=>s.terminal||s.terminalSummary),c=a.pathOverlaps||[],v=a.verifications||[];return e.jsxs("section",{className:"review-panel","aria-label":"Team review",children:[e.jsx("h2",{children:"Review"}),e.jsx("p",{className:"muted",children:"Handoffs, verification, and path conflicts from live observation (read-only)."}),e.jsx("h3",{children:"Handoffs"}),j.length?null:e.jsx("p",{className:"muted",children:"No terminal handoffs yet."}),e.jsx("ul",{className:"review-list",children:j.map(s=>{var f;const o=[...v].reverse().find(i=>i.sessionId===s.sessionId),x=A(o);return e.jsxs("li",{children:[e.jsxs("button",{type:"button",onClick:()=>l==null?void 0:l(s.sessionId),children:[e.jsx("strong",{children:s.name||s.agent||s.sessionId.slice(0,8)}),e.jsx(S,{kind:$(s.state),label:s.state||"done"}),e.jsx(S,{kind:x.kind,label:x.label})]}),s.terminalSummary?e.jsx("p",{children:s.terminalSummary}):null,s.blockReason?e.jsxs("p",{className:"muted",children:["Blocked: ",s.blockReason]}):null,e.jsxs("div",{className:"muted",children:["Budget: ",s.budget?JSON.stringify(s.budget).slice(0,120):"unknown"]}),o!=null&&o.summary?e.jsxs("p",{className:"muted",children:["Verification: ",o.summary]}):null,(f=s.filesTouched)!=null&&f.length?e.jsx("ul",{className:"review-paths",children:s.filesTouched.map(i=>e.jsx("li",{children:e.jsx("button",{type:"button",className:"linkish",onClick:()=>r==null?void 0:r(i),children:e.jsx("code",{children:i})})},i))}):null]},s.sessionId)})}),e.jsx("h3",{children:"Path overlaps"}),c.length?null:e.jsx("p",{className:"muted",children:"No path conflicts observed."}),e.jsx("ul",{className:"review-list",children:c.map(s=>e.jsxs("li",{children:[e.jsx("button",{type:"button",className:"linkish",onClick:()=>r==null?void 0:r(s.path),children:e.jsx("code",{children:s.path})}),e.jsx("span",{className:"muted",children:(s.sessions||[]).join(", ")||"unknown agents"})]},s.path))})]})}export{T as ArtifactsPanel,B as LedgerPanel,P as TeamReviewPanel,A as verificationLabel}; diff --git a/internal/frontend/server/static/assets/CodeExplorer-CgIv5pzo.js b/internal/frontend/server/static/assets/CodeExplorer-CTkRy4Rl.js similarity index 99% rename from internal/frontend/server/static/assets/CodeExplorer-CgIv5pzo.js rename to internal/frontend/server/static/assets/CodeExplorer-CTkRy4Rl.js index c51c362a..2c9bc8a9 100644 --- a/internal/frontend/server/static/assets/CodeExplorer-CgIv5pzo.js +++ b/internal/frontend/server/static/assets/CodeExplorer-CTkRy4Rl.js @@ -1,4 +1,4 @@ -import{r,b as E,j as e}from"./index-DcyMECWA.js";function xe(t){return t.Name||t.name||""}function je(t){return!!(t.IsDir??t.isDir)}function ce(t){return t.Path||t.path||""}function be(t){return t.Content||t.content||""}function ge(t){return t.Notice||t.notice||""}function we(t){return!!(t.Skip??t.skip)}function Ne(t,l){const n=t.replace(/\\/g,"/").replace(/\/+$/,""),a=l.replace(/\\/g,"/").replace(/^\/+/,"");return!n||n==="."?a:`${n}/${a}`}function oe(t){const l=t.replace(/\\/g,"/").replace(/\/+$/,"");if(!l||l===".")return"";const n=l.lastIndexOf("/");return n<0?"":l.slice(0,n)}function ve(t){const l=t.replace(/\\/g,"/").replace(/^\/+|\/+$/g,""),n=[{label:"root",path:""}];if(!l)return n;let a="";for(const u of l.split("/"))u&&(a=a?`${a}/${u}`:u,n.push({label:u,path:a}));return n}function de(t){return/\.(md|mdx|markdown)$/i.test(t)}function ye(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Se(t){const n=ye(t).split(` +import{r,b as E,j as e}from"./index-BK8GKzWA.js";function xe(t){return t.Name||t.name||""}function je(t){return!!(t.IsDir??t.isDir)}function ce(t){return t.Path||t.path||""}function be(t){return t.Content||t.content||""}function ge(t){return t.Notice||t.notice||""}function we(t){return!!(t.Skip??t.skip)}function Ne(t,l){const n=t.replace(/\\/g,"/").replace(/\/+$/,""),a=l.replace(/\\/g,"/").replace(/^\/+/,"");return!n||n==="."?a:`${n}/${a}`}function oe(t){const l=t.replace(/\\/g,"/").replace(/\/+$/,"");if(!l||l===".")return"";const n=l.lastIndexOf("/");return n<0?"":l.slice(0,n)}function ve(t){const l=t.replace(/\\/g,"/").replace(/^\/+|\/+$/g,""),n=[{label:"root",path:""}];if(!l)return n;let a="";for(const u of l.split("/"))u&&(a=a?`${a}/${u}`:u,n.push({label:u,path:a}));return n}function de(t){return/\.(md|mdx|markdown)$/i.test(t)}function ye(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Se(t){const n=ye(t).split(` `),a=[];let u=!1;for(const c of n){if(c.startsWith("```")){u?(a.push(""),u=!1):(a.push('
'),u=!0);continue}if(u){a.push(c+`
 `);continue}/^### /.test(c)?a.push(`

${C(c.slice(4))}

`):/^## /.test(c)?a.push(`

${C(c.slice(3))}

`):/^# /.test(c)?a.push(`

${C(c.slice(2))}

`):/^[-*] /.test(c)?a.push(`
  • ${C(c.slice(2))}
  • `):c.trim()===""?a.push("
    "):a.push(`

    ${C(c)}

    `)}return u&&a.push("
    "),a.join("")}function C(t){return t.replace(/`([^`]+)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1")}function Ce(t){if(!t)return{path:""};const l=/^(.+):(\d+)$/.exec(t);if(l){const n=Number(l[2]);return{path:l[1],line:Number.isFinite(n)&&n>0?n:void 0}}return{path:t}}function A(t,l={}){const n=new URLSearchParams(l);t&&n.set("root",t);const a=n.toString();return a?`?${a}`:""}function ke({available:t,rootID:l,entity:n,onOpenPath:a,changedFiles:u=[],expandedDiffs:c,toggleDiff:K,readOnly:O,canApply:ue}){const[m,M]=r.useState(""),[pe,F]=r.useState([]),[X,L]=r.useState(""),[he,Y]=r.useState(!1),[b,Z]=r.useState(""),[P,$]=r.useState([]),[R,k]=r.useState(""),[I,q]=r.useState(!1),D=r.useRef(null),[d,B]=r.useState(""),[f,T]=r.useState(),[p,H]=r.useState(null),[ee,V]=r.useState(""),[me,se]=r.useState(!1),[g,W]=r.useState("preview"),[w,N]=r.useState("changed"),[x,te]=r.useState(""),[v,re]=r.useState(""),[_,le]=r.useState(!1),[ae,J]=r.useState(""),fe=r.useMemo(()=>ve(m),[m]),Q=r.useRef(null);r.useEffect(()=>{M(""),F([]),B(""),H(null),Z(""),$([]),T(void 0),L(""),V(""),k("")},[l]),r.useEffect(()=>{const{path:s,line:i}=Ce(n);s&&(B(s),T(i),M(oe(s)),N("browse"))},[n,l]);const y=r.useCallback(async s=>{if(t){Y(!0),L("");try{const i=await E(`/v1/files${A(l,s?{path:s}:{})}`);F(i.entries||[]),M(s)}catch(i){L(i instanceof Error?i.message:String(i)),F([])}finally{Y(!1)}}},[t,l]);r.useEffect(()=>{y(m)},[t,l]);const j=r.useCallback(async(s,i)=>{if(!(!t||!s)){B(s),T(i),se(!0),V(""),H(null),a==null||a(s,i);try{const o=await E(`/v1/file${A(l,{path:s})}`);H(o),de(s)&&W("preview")}catch(o){V(o instanceof Error?o.message:String(o))}finally{se(!1)}}},[t,l,a]);r.useEffect(()=>{d&&j(d,f)},[d,l]),r.useEffect(()=>{if(f&&Q.current){const s=Q.current.querySelector(`[data-line="${f}"]`);s==null||s.scrollIntoView({block:"center"})}},[f,p]);const ne=r.useCallback(async s=>{var h;(h=D.current)==null||h.abort();const i=new AbortController;D.current=i;const o=s.trim();if(!o){$([]),k(""),q(!1);return}q(!0),k("");try{const S=await E(`/v1/files/search${A(l,{q:o,limit:"40"})}`);if(i.signal.aborted)return;$(S.paths||[])}catch(S){if(i.signal.aborted)return;$([]),k(S instanceof Error?S.message:String(S))}finally{i.signal.aborted||q(!1)}},[l]);if(r.useEffect(()=>{const s=window.setTimeout(()=>void ne(b),200);return()=>window.clearTimeout(s)},[b,ne]),!t)return e.jsxs("section",{className:"code-explorer","aria-label":"Code explorer",children:[e.jsx("h2",{children:"Code"}),e.jsx("p",{className:"muted",role:"status",children:"Files capability unavailable."})]});const U=p?be(p):"",z=p?we(p):!1,G=p?ge(p):"",ie=d&&de(d)&&!z&&U;return e.jsxs("section",{className:"code-explorer","aria-label":"Code explorer",children:[e.jsxs("header",{className:"code-explorer-head",children:[e.jsx("h2",{children:"Code"}),O?e.jsx("span",{className:"muted",children:"read-only"}):null,e.jsxs("div",{className:"code-view-tabs",role:"tablist","aria-label":"Code views",children:[e.jsx("button",{type:"button",role:"tab","aria-selected":w==="browse",className:w==="browse"?"active":"",onClick:()=>N("browse"),children:"Browse"}),e.jsxs("button",{type:"button",role:"tab","aria-selected":w==="changed",className:w==="changed"?"active":"",onClick:()=>N("changed"),children:["Changed",u.length?` · ${u.length}`:""]})]})]}),w==="changed"?e.jsxs("div",{className:"changed-files","aria-label":"Changed files",children:[u.length?null:e.jsx("p",{className:"muted",children:"No changed files reported."}),u.map(s=>e.jsxs("article",{className:"changed-file",children:[e.jsxs("button",{type:"button","aria-expanded":c==null?void 0:c.has(s.path),onClick:()=>{K?K(s.path):(j(s.path),N("browse"))},children:[e.jsx("code",{children:s.path}),e.jsxs("span",{className:"diff-stat",children:[e.jsxs("b",{children:["+",s.added]}),e.jsxs("b",{children:["-",s.deleted]})]})]}),e.jsx("button",{type:"button",className:"code-open-file",onClick:()=>{j(s.path),N("browse")},children:"Open"}),c!=null&&c.has(s.path)?e.jsx("pre",{className:"diff-view",children:s.diff||"No textual diff available."}):null]},s.path))]}):e.jsxs("div",{className:"code-explorer-body",children:[e.jsxs("div",{className:"code-sidebar",children:[e.jsxs("label",{className:"code-search",children:[e.jsx("span",{className:"sr-only",children:"Search files"}),e.jsx("input",{value:b,onChange:s=>Z(s.target.value),placeholder:"Search files…","aria-label":"Search files"}),I?e.jsx("span",{className:"muted",children:"…"}):null]}),R?e.jsx("p",{className:"muted",role:"status",children:R}):null,b.trim()&&P.length>0?e.jsx("ul",{className:"code-search-hits","aria-label":"Search results",children:P.map(s=>e.jsx("li",{children:e.jsx("button",{type:"button",onClick:()=>{s.endsWith("/")?y(s.replace(/\/$/,"")):j(s)},children:e.jsx("code",{children:s})})},s))}):null,b.trim()&&!I&&!P.length&&!R?e.jsx("p",{className:"muted",children:"No matches."}):null,e.jsx("nav",{className:"code-breadcrumbs","aria-label":"Path breadcrumbs",children:fe.map((s,i)=>e.jsxs("span",{children:[i>0?" / ":null,e.jsx("button",{type:"button",onClick:()=>void y(s.path),children:s.label})]},s.path||"root"))}),he?e.jsx("p",{className:"muted",children:"Loading…"}):null,X?e.jsx("p",{className:"muted",role:"alert",children:X}):null,e.jsxs("ul",{className:"code-tree",role:"tree","aria-label":"Directory",children:[m?e.jsx("li",{children:e.jsx("button",{type:"button",onClick:()=>void y(oe(m)),children:".."})}):null,pe.map(s=>{const i=xe(s),o=je(s),h=Ne(m,i);return e.jsx("li",{role:"treeitem",children:e.jsxs("button",{type:"button",className:d===h?"active":"",onClick:()=>{o?y(h):j(h)},children:[o?"[dir] ":"",i,o?"/":""]})},h)})]})]}),e.jsx("div",{className:"code-viewer","aria-label":"File viewer",children:d?me?e.jsxs("p",{className:"muted",children:["Loading ",d,"…"]}):ee?e.jsx("p",{className:"muted",role:"alert",children:ee}):z?e.jsxs("div",{children:[e.jsx("h3",{children:e.jsx("code",{children:ce(p)||d})}),e.jsx("p",{className:"muted",role:"status",children:G||"Skipped"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("header",{className:"code-viewer-head",children:[e.jsx("h3",{children:e.jsx("code",{children:ce(p)||d})}),ie?e.jsxs("div",{className:"code-md-toggle",role:"group","aria-label":"Markdown view",children:[e.jsx("button",{type:"button","aria-pressed":g==="preview",className:g==="preview"?"active":"",onClick:()=>W("preview"),children:"Preview"}),e.jsx("button",{type:"button","aria-pressed":g==="raw",className:g==="raw"?"active":"",onClick:()=>W("raw"),children:"Raw"})]}):null,G?e.jsx("p",{className:"muted",children:G}):null]}),ie&&g==="preview"?e.jsx("div",{className:"code-md-preview",dangerouslySetInnerHTML:{__html:Se(U)}}):e.jsx("pre",{className:"code-raw",ref:Q,tabIndex:0,children:U.split(` `).map((s,i)=>{const o=i+1;return e.jsxs("div",{"data-line":o,className:f===o?"code-line focus":"code-line",children:[e.jsx("span",{className:"code-gutter","aria-hidden":!0,children:o}),e.jsx("span",{className:"code-text",children:s||" "})]},o)})}),ue&&!O&&d&&!z?e.jsxs("fieldset",{className:"code-apply","aria-label":"Reviewed apply edit",children:[e.jsx("legend",{children:"Apply edit (reviewed)"}),e.jsxs("p",{className:"muted",children:["Target ",e.jsx("code",{children:d}),". Preview the replacement, then confirm. No free-form write API."]}),e.jsxs("label",{children:["Find (oldString)",e.jsx("textarea",{value:x,onChange:s=>te(s.target.value),rows:3,disabled:_})]}),e.jsxs("label",{children:["Replace (newString)",e.jsx("textarea",{value:v,onChange:s=>re(s.target.value),rows:3,disabled:_})]}),x||v?e.jsx("pre",{className:"diff-view code-apply-preview","aria-label":"Apply preview",children:`- ${x.split(` diff --git a/internal/frontend/server/static/assets/Diagnostics-NmaV_GCL.js b/internal/frontend/server/static/assets/Diagnostics-C72nldsD.js similarity index 98% rename from internal/frontend/server/static/assets/Diagnostics-NmaV_GCL.js rename to internal/frontend/server/static/assets/Diagnostics-C72nldsD.js index 94a9f953..419d9736 100644 --- a/internal/frontend/server/static/assets/Diagnostics-NmaV_GCL.js +++ b/internal/frontend/server/static/assets/Diagnostics-C72nldsD.js @@ -1 +1 @@ -import{r as a,b as o,j as e}from"./index-DcyMECWA.js";function w({available:c}){const[r,j]=a.useState([]),[d,p]=a.useState([]),[h,b]=a.useState(""),[y,u]=a.useState(!1),[g,m]=a.useState(""),[n,l]=a.useState(""),i=a.useCallback(async()=>{if(c){u(!0),m("");try{const[s,t]=await Promise.all([o("/v1/lsp"),o("/v1/diagnostics")]);j(s.servers||[]),p(t.diagnostics||[]),b(t.note||s.note||"")}catch(s){m(s.message)}finally{u(!1)}}},[c]);a.useEffect(()=>{i()},[i]);const x=async s=>{l(s?`retry:${s}`:"retry:all");try{await o("/v1/lsp/retry",{method:"POST",body:JSON.stringify(s?{name:s}:{})}),await i()}catch(t){window.alert(t.message)}finally{l("")}},f=async s=>{if(window.confirm(`Disable language server “${s}”?`)){l(`disable:${s}`);try{await o(`/v1/lsp/${encodeURIComponent(s)}/disable`,{method:"POST"}),await i()}catch(t){window.alert(t.message)}finally{l("")}}};return c?y&&!r.length&&!d.length&&!h&&!g?e.jsx("section",{className:"unavailable",role:"status",children:e.jsx("strong",{children:"Loading diagnostics"})}):g?e.jsxs("section",{className:"unavailable",role:"status",children:[e.jsx("strong",{children:"Unable to load"}),e.jsx("p",{children:g})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"diagnostics-heading",children:[e.jsx("h2",{children:"Diagnostics"}),e.jsxs("div",{className:"diagnostics-actions",children:[e.jsx("button",{type:"button",disabled:!!n,onClick:()=>void i(),children:"Refresh"}),e.jsx("button",{type:"button",disabled:!!n,onClick:()=>void x(),children:n==="retry:all"?"Retrying…":"Retry all"})]})]}),e.jsx("h3",{className:"diagnostics-subhead",children:"Language servers"}),r.length===0?e.jsx("p",{className:"muted",role:"status",children:h||"no language servers configured (add lsp.servers in config)"}):e.jsx("div",{className:"project-list lsp-servers",children:r.map(s=>e.jsxs("article",{className:"lsp-server",children:[e.jsxs("header",{children:[e.jsx("h3",{children:s.name}),e.jsx("span",{className:`lsp-state state-${(s.state||"down").toLowerCase()}`,children:s.state})]}),e.jsxs("p",{children:[e.jsx("code",{children:s.command||"—"}),s.extensions&&s.extensions.length>0&&e.jsxs("small",{children:[" ",s.extensions.join(", ")]}),typeof s.openDocs=="number"&&s.openDocs>0&&e.jsxs("small",{children:[" docs=",s.openDocs]})]}),s.error&&s.state!=="disabled"&&e.jsx("p",{className:"lsp-error",children:s.error}),e.jsxs("div",{className:"diagnostics-actions",children:[e.jsx("button",{type:"button",disabled:!!n||s.state==="disabled",onClick:()=>void x(s.name),children:n===`retry:${s.name}`?"Retrying…":"Retry"}),e.jsx("button",{type:"button",disabled:!!n||s.state==="disabled",onClick:()=>void f(s.name),children:n===`disable:${s.name}`?"Disabling…":"Disable"})]})]},s.name))}),e.jsx("h3",{className:"diagnostics-subhead",children:"Findings"}),d.length===0?e.jsx("p",{className:"muted",role:"status",children:h||"no diagnostics"}):e.jsx("div",{className:"project-list diagnostics-list",children:d.map((s,t)=>e.jsxs("article",{className:"diagnostic-item",children:[e.jsxs("header",{children:[e.jsx("span",{className:`diag-severity sev-${(s.severity||"error").toLowerCase()}`,children:s.severity||"error"}),e.jsxs("code",{children:[s.path,":",s.line,":",s.character]})]}),e.jsx("p",{children:s.message||"(no message)"}),(s.source||s.code)&&e.jsxs("small",{children:[s.source||"",s.source&&s.code?" · ":"",s.code||""]})]},`${s.path}:${s.line}:${s.character}:${s.message}:${t}`))})]}):e.jsxs("section",{className:"unavailable",role:"status",children:[e.jsx("strong",{children:"Diagnostics unavailable"}),e.jsx("p",{children:"The configured host did not provide this capability. No action was attempted."})]})}export{w as DiagnosticsPanel}; +import{r as a,b as o,j as e}from"./index-BK8GKzWA.js";function w({available:c}){const[r,j]=a.useState([]),[d,p]=a.useState([]),[h,b]=a.useState(""),[y,u]=a.useState(!1),[g,m]=a.useState(""),[n,l]=a.useState(""),i=a.useCallback(async()=>{if(c){u(!0),m("");try{const[s,t]=await Promise.all([o("/v1/lsp"),o("/v1/diagnostics")]);j(s.servers||[]),p(t.diagnostics||[]),b(t.note||s.note||"")}catch(s){m(s.message)}finally{u(!1)}}},[c]);a.useEffect(()=>{i()},[i]);const x=async s=>{l(s?`retry:${s}`:"retry:all");try{await o("/v1/lsp/retry",{method:"POST",body:JSON.stringify(s?{name:s}:{})}),await i()}catch(t){window.alert(t.message)}finally{l("")}},f=async s=>{if(window.confirm(`Disable language server “${s}”?`)){l(`disable:${s}`);try{await o(`/v1/lsp/${encodeURIComponent(s)}/disable`,{method:"POST"}),await i()}catch(t){window.alert(t.message)}finally{l("")}}};return c?y&&!r.length&&!d.length&&!h&&!g?e.jsx("section",{className:"unavailable",role:"status",children:e.jsx("strong",{children:"Loading diagnostics"})}):g?e.jsxs("section",{className:"unavailable",role:"status",children:[e.jsx("strong",{children:"Unable to load"}),e.jsx("p",{children:g})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"diagnostics-heading",children:[e.jsx("h2",{children:"Diagnostics"}),e.jsxs("div",{className:"diagnostics-actions",children:[e.jsx("button",{type:"button",disabled:!!n,onClick:()=>void i(),children:"Refresh"}),e.jsx("button",{type:"button",disabled:!!n,onClick:()=>void x(),children:n==="retry:all"?"Retrying…":"Retry all"})]})]}),e.jsx("h3",{className:"diagnostics-subhead",children:"Language servers"}),r.length===0?e.jsx("p",{className:"muted",role:"status",children:h||"no language servers configured (add lsp.servers in config)"}):e.jsx("div",{className:"project-list lsp-servers",children:r.map(s=>e.jsxs("article",{className:"lsp-server",children:[e.jsxs("header",{children:[e.jsx("h3",{children:s.name}),e.jsx("span",{className:`lsp-state state-${(s.state||"down").toLowerCase()}`,children:s.state})]}),e.jsxs("p",{children:[e.jsx("code",{children:s.command||"—"}),s.extensions&&s.extensions.length>0&&e.jsxs("small",{children:[" ",s.extensions.join(", ")]}),typeof s.openDocs=="number"&&s.openDocs>0&&e.jsxs("small",{children:[" docs=",s.openDocs]})]}),s.error&&s.state!=="disabled"&&e.jsx("p",{className:"lsp-error",children:s.error}),e.jsxs("div",{className:"diagnostics-actions",children:[e.jsx("button",{type:"button",disabled:!!n||s.state==="disabled",onClick:()=>void x(s.name),children:n===`retry:${s.name}`?"Retrying…":"Retry"}),e.jsx("button",{type:"button",disabled:!!n||s.state==="disabled",onClick:()=>void f(s.name),children:n===`disable:${s.name}`?"Disabling…":"Disable"})]})]},s.name))}),e.jsx("h3",{className:"diagnostics-subhead",children:"Findings"}),d.length===0?e.jsx("p",{className:"muted",role:"status",children:h||"no diagnostics"}):e.jsx("div",{className:"project-list diagnostics-list",children:d.map((s,t)=>e.jsxs("article",{className:"diagnostic-item",children:[e.jsxs("header",{children:[e.jsx("span",{className:`diag-severity sev-${(s.severity||"error").toLowerCase()}`,children:s.severity||"error"}),e.jsxs("code",{children:[s.path,":",s.line,":",s.character]})]}),e.jsx("p",{children:s.message||"(no message)"}),(s.source||s.code)&&e.jsxs("small",{children:[s.source||"",s.source&&s.code?" · ":"",s.code||""]})]},`${s.path}:${s.line}:${s.character}:${s.message}:${t}`))})]}):e.jsxs("section",{className:"unavailable",role:"status",children:[e.jsx("strong",{children:"Diagnostics unavailable"}),e.jsx("p",{children:"The configured host did not provide this capability. No action was attempted."})]})}export{w as DiagnosticsPanel}; diff --git a/internal/frontend/server/static/assets/Goals-DDLXnGhH.js b/internal/frontend/server/static/assets/Goals-0kpFGULK.js similarity index 99% rename from internal/frontend/server/static/assets/Goals-DDLXnGhH.js rename to internal/frontend/server/static/assets/Goals-0kpFGULK.js index 50d387c8..86051a6c 100644 --- a/internal/frontend/server/static/assets/Goals-DDLXnGhH.js +++ b/internal/frontend/server/static/assets/Goals-0kpFGULK.js @@ -1,3 +1,3 @@ -import{b as m,r as i,j as e}from"./index-DcyMECWA.js";const T=()=>m("/v1/goals"),P=s=>m(`/v1/goals/${encodeURIComponent(s)}`),F=s=>m("/v1/goals",{method:"POST",body:JSON.stringify(s)}),O=s=>m(`/v1/goals/${encodeURIComponent(s)}/run`,{method:"POST",body:"{}"}),q=s=>m(`/v1/goals/${encodeURIComponent(s)}/pause`,{method:"POST",body:"{}"}),E=s=>m(`/v1/goals/${encodeURIComponent(s)}/resume`,{method:"POST",body:"{}"}),A=s=>m(`/v1/goals/${encodeURIComponent(s)}/abort`,{method:"POST",body:"{}"}),I=(s,d)=>m(`/v1/goals/${encodeURIComponent(s)}/log`);function L(s){return s==="pending"||s==="active"||s==="paused"}function $(s){return s==="pending"||s==="paused"||s==="active"}function D(s){return s==="active"}function G(s){return s==="pending"||s==="paused"}function U(s){return L(s)}function J({available:s,live:d}){const[h,p]=i.useState([]),[c,x]=i.useState(!1),[j,a]=i.useState(""),[o,b]=i.useState(null),[C,f]=i.useState([]),[g,r]=i.useState(""),[v,u]=i.useState(!1),[N,k]=i.useState(""),S=async()=>{if(s){x(!0),a("");try{const l=(await T()).goals||[];if(p(l),o){const n=l.find(w=>w.id===o.id);n&&b(n)}}catch(t){a(t.message)}finally{x(!1)}}};if(i.useEffect(()=>{S()},[s]),!s)return e.jsxs("section",{className:"unavailable",role:"status",children:[e.jsx("strong",{children:"Goals unavailable"}),e.jsx("p",{children:"The configured host did not provide this capability. No action was attempted."})]});const R=async t=>{a(""),k("");try{const[l,n]=await Promise.all([P(t),I(t)]);b(l),f(n.iterations||[])}catch(l){a(l.message)}},y=async(t,l)=>{if(d){r(t),a(""),k("");try{let n;if(l==="run"?n=await O(t):l==="pause"?n=await q(t):l==="resume"?n=await E(t):n=await A(t),k(`${l}: ${n.status}${n.failReason?` — ${n.failReason}`:""}`),(o==null?void 0:o.id)===t){b(n);const w=await I(t).catch(()=>({iterations:[]}));f(w.iterations||[])}await S()}catch(n){a(n.message)}finally{r("")}}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"workflow-head",children:[e.jsx("h2",{children:"Goals"}),e.jsxs("div",{className:"workflow-actions",children:[e.jsx("button",{type:"button",onClick:()=>void S(),disabled:c,children:"Refresh"}),e.jsx("button",{type:"button",onClick:()=>u(!0),children:"New"})]})]}),!d&&e.jsx("p",{className:"muted",role:"status",children:"Attach-only: list and inspect only. Run/pause/resume/abort require a live session."}),N&&e.jsx("p",{className:"muted",role:"status",children:N}),j&&e.jsxs("section",{className:"unavailable",role:"alert",children:[e.jsx("strong",{children:"Unable to load"}),e.jsx("p",{children:j})]}),c&&!h.length?e.jsx("p",{className:"muted",children:"Loading goals…"}):null,!c&&!h.length&&!j?e.jsx("p",{className:"muted",children:"No goals yet. Create one to drive the loop harness."}):null,e.jsx("div",{className:"workflow-list",children:h.map(t=>{var l;return e.jsxs("article",{className:"workflow-card",children:[e.jsxs("header",{children:[e.jsx("h3",{children:t.description||t.id}),e.jsxs("small",{children:[t.status," · iter ",t.lastIteration,"/",t.maxIterations," · $",t.costUsd.toFixed(4)]})]}),(l=t.criteria)!=null&&l.length?e.jsxs("p",{className:"workflow-grants",children:[e.jsx("span",{children:"Criteria"}),t.criteria.map((n,w)=>e.jsxs("code",{children:[n.satisfied?"OK":"…"," ",n.check||n.description]},w))]}):null,t.failReason&&e.jsx("p",{className:"workflow-error",role:"status",children:t.failReason}),e.jsxs("div",{className:"workflow-card-actions",children:[e.jsx("button",{type:"button",onClick:()=>void R(t.id),children:"Details"}),e.jsx("button",{type:"button",disabled:!d||g===t.id||!$(t.status),onClick:()=>void y(t.id,"run"),children:"Run"}),e.jsx("button",{type:"button",disabled:!d||g===t.id||!D(t.status),onClick:()=>void y(t.id,"pause"),children:"Pause"}),e.jsx("button",{type:"button",disabled:!d||g===t.id||!G(t.status),onClick:()=>void y(t.id,"resume"),children:"Resume"}),e.jsx("button",{type:"button",disabled:!d||g===t.id||!U(t.status),onClick:()=>void y(t.id,"abort"),children:"Abort"})]})]},t.id)})}),o&&e.jsx(B,{goal:o,log:C,onClose:()=>{b(null),f([])},live:d,busy:g===o.id,onControl:t=>void y(o.id,t)}),v&&e.jsx(K,{onClose:()=>u(!1),onCreated:async t=>{u(!1),k(`Created ${t.id}`),await S(),await R(t.id)}})]})}function B({goal:s,log:d,onClose:h,live:p,busy:c,onControl:x}){var j;return e.jsxs("dialog",{className:"workflow-dialog",open:!0,"aria-labelledby":"goal-detail-title",children:[e.jsx("div",{className:"dialog-rule"}),e.jsx("h2",{id:"goal-detail-title",children:s.description}),e.jsxs("dl",{className:"goal-meta",children:[e.jsx("dt",{children:"ID"}),e.jsx("dd",{children:e.jsx("code",{children:s.id})}),e.jsx("dt",{children:"Status"}),e.jsx("dd",{children:s.status}),e.jsx("dt",{children:"Iteration"}),e.jsxs("dd",{children:[s.lastIteration," / ",s.maxIterations]}),e.jsx("dt",{children:"Cost"}),e.jsxs("dd",{children:["$",s.costUsd.toFixed(4),s.maxCostUsd>0?` / $${s.maxCostUsd.toFixed(2)}`:""]}),(j=s.allowedTools)!=null&&j.length?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Tools"}),e.jsx("dd",{children:s.allowedTools.join(", ")})]}):null,s.failReason?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Reason"}),e.jsx("dd",{className:"workflow-error",children:s.failReason})]}):null]}),e.jsx("h3",{children:"Criteria"}),e.jsx("ul",{className:"goal-criteria",children:(s.criteria||[]).map((a,o)=>e.jsxs("li",{children:[e.jsx("strong",{children:a.satisfied?"OK":"FAIL"})," ",a.check||a.description]},o))}),e.jsx("h3",{children:"Iteration log"}),d.length?e.jsx("ol",{className:"goal-log",children:d.map(a=>e.jsxs("li",{children:[e.jsxs("strong",{children:["#",a.n]}),e.jsxs("span",{children:["$",a.costUsd.toFixed(4)]}),e.jsx("p",{children:a.summary||a.plan||"(empty)"})]},a.n))}):e.jsx("p",{className:"muted",children:"No iterations committed yet."}),e.jsxs("div",{className:"dialog-actions",children:[e.jsx("button",{type:"button",onClick:h,children:"Close"}),e.jsx("button",{type:"button",disabled:!p||c||!$(s.status),onClick:()=>x("run"),children:"Run"}),e.jsx("button",{type:"button",disabled:!p||c||!D(s.status),onClick:()=>x("pause"),children:"Pause"}),e.jsx("button",{type:"button",disabled:!p||c||!G(s.status),onClick:()=>x("resume"),children:"Resume"}),e.jsx("button",{type:"button",disabled:!p||c||!U(s.status),onClick:()=>x("abort"),children:"Abort"})]})]})}function K({onClose:s,onCreated:d}){const[h,p]=i.useState(""),[c,x]=i.useState("cmd: true"),[j,a]=i.useState("5"),[o,b]=i.useState(!1),[C,f]=i.useState(""),g=async r=>{r.preventDefault();const v=c.split(` +import{b as m,r as i,j as e}from"./index-BK8GKzWA.js";const T=()=>m("/v1/goals"),P=s=>m(`/v1/goals/${encodeURIComponent(s)}`),F=s=>m("/v1/goals",{method:"POST",body:JSON.stringify(s)}),O=s=>m(`/v1/goals/${encodeURIComponent(s)}/run`,{method:"POST",body:"{}"}),q=s=>m(`/v1/goals/${encodeURIComponent(s)}/pause`,{method:"POST",body:"{}"}),E=s=>m(`/v1/goals/${encodeURIComponent(s)}/resume`,{method:"POST",body:"{}"}),A=s=>m(`/v1/goals/${encodeURIComponent(s)}/abort`,{method:"POST",body:"{}"}),I=(s,d)=>m(`/v1/goals/${encodeURIComponent(s)}/log`);function L(s){return s==="pending"||s==="active"||s==="paused"}function $(s){return s==="pending"||s==="paused"||s==="active"}function D(s){return s==="active"}function G(s){return s==="pending"||s==="paused"}function U(s){return L(s)}function J({available:s,live:d}){const[h,p]=i.useState([]),[c,x]=i.useState(!1),[j,a]=i.useState(""),[o,b]=i.useState(null),[C,f]=i.useState([]),[g,r]=i.useState(""),[v,u]=i.useState(!1),[N,k]=i.useState(""),S=async()=>{if(s){x(!0),a("");try{const l=(await T()).goals||[];if(p(l),o){const n=l.find(w=>w.id===o.id);n&&b(n)}}catch(t){a(t.message)}finally{x(!1)}}};if(i.useEffect(()=>{S()},[s]),!s)return e.jsxs("section",{className:"unavailable",role:"status",children:[e.jsx("strong",{children:"Goals unavailable"}),e.jsx("p",{children:"The configured host did not provide this capability. No action was attempted."})]});const R=async t=>{a(""),k("");try{const[l,n]=await Promise.all([P(t),I(t)]);b(l),f(n.iterations||[])}catch(l){a(l.message)}},y=async(t,l)=>{if(d){r(t),a(""),k("");try{let n;if(l==="run"?n=await O(t):l==="pause"?n=await q(t):l==="resume"?n=await E(t):n=await A(t),k(`${l}: ${n.status}${n.failReason?` — ${n.failReason}`:""}`),(o==null?void 0:o.id)===t){b(n);const w=await I(t).catch(()=>({iterations:[]}));f(w.iterations||[])}await S()}catch(n){a(n.message)}finally{r("")}}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"workflow-head",children:[e.jsx("h2",{children:"Goals"}),e.jsxs("div",{className:"workflow-actions",children:[e.jsx("button",{type:"button",onClick:()=>void S(),disabled:c,children:"Refresh"}),e.jsx("button",{type:"button",onClick:()=>u(!0),children:"New"})]})]}),!d&&e.jsx("p",{className:"muted",role:"status",children:"Attach-only: list and inspect only. Run/pause/resume/abort require a live session."}),N&&e.jsx("p",{className:"muted",role:"status",children:N}),j&&e.jsxs("section",{className:"unavailable",role:"alert",children:[e.jsx("strong",{children:"Unable to load"}),e.jsx("p",{children:j})]}),c&&!h.length?e.jsx("p",{className:"muted",children:"Loading goals…"}):null,!c&&!h.length&&!j?e.jsx("p",{className:"muted",children:"No goals yet. Create one to drive the loop harness."}):null,e.jsx("div",{className:"workflow-list",children:h.map(t=>{var l;return e.jsxs("article",{className:"workflow-card",children:[e.jsxs("header",{children:[e.jsx("h3",{children:t.description||t.id}),e.jsxs("small",{children:[t.status," · iter ",t.lastIteration,"/",t.maxIterations," · $",t.costUsd.toFixed(4)]})]}),(l=t.criteria)!=null&&l.length?e.jsxs("p",{className:"workflow-grants",children:[e.jsx("span",{children:"Criteria"}),t.criteria.map((n,w)=>e.jsxs("code",{children:[n.satisfied?"OK":"…"," ",n.check||n.description]},w))]}):null,t.failReason&&e.jsx("p",{className:"workflow-error",role:"status",children:t.failReason}),e.jsxs("div",{className:"workflow-card-actions",children:[e.jsx("button",{type:"button",onClick:()=>void R(t.id),children:"Details"}),e.jsx("button",{type:"button",disabled:!d||g===t.id||!$(t.status),onClick:()=>void y(t.id,"run"),children:"Run"}),e.jsx("button",{type:"button",disabled:!d||g===t.id||!D(t.status),onClick:()=>void y(t.id,"pause"),children:"Pause"}),e.jsx("button",{type:"button",disabled:!d||g===t.id||!G(t.status),onClick:()=>void y(t.id,"resume"),children:"Resume"}),e.jsx("button",{type:"button",disabled:!d||g===t.id||!U(t.status),onClick:()=>void y(t.id,"abort"),children:"Abort"})]})]},t.id)})}),o&&e.jsx(B,{goal:o,log:C,onClose:()=>{b(null),f([])},live:d,busy:g===o.id,onControl:t=>void y(o.id,t)}),v&&e.jsx(K,{onClose:()=>u(!1),onCreated:async t=>{u(!1),k(`Created ${t.id}`),await S(),await R(t.id)}})]})}function B({goal:s,log:d,onClose:h,live:p,busy:c,onControl:x}){var j;return e.jsxs("dialog",{className:"workflow-dialog",open:!0,"aria-labelledby":"goal-detail-title",children:[e.jsx("div",{className:"dialog-rule"}),e.jsx("h2",{id:"goal-detail-title",children:s.description}),e.jsxs("dl",{className:"goal-meta",children:[e.jsx("dt",{children:"ID"}),e.jsx("dd",{children:e.jsx("code",{children:s.id})}),e.jsx("dt",{children:"Status"}),e.jsx("dd",{children:s.status}),e.jsx("dt",{children:"Iteration"}),e.jsxs("dd",{children:[s.lastIteration," / ",s.maxIterations]}),e.jsx("dt",{children:"Cost"}),e.jsxs("dd",{children:["$",s.costUsd.toFixed(4),s.maxCostUsd>0?` / $${s.maxCostUsd.toFixed(2)}`:""]}),(j=s.allowedTools)!=null&&j.length?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Tools"}),e.jsx("dd",{children:s.allowedTools.join(", ")})]}):null,s.failReason?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Reason"}),e.jsx("dd",{className:"workflow-error",children:s.failReason})]}):null]}),e.jsx("h3",{children:"Criteria"}),e.jsx("ul",{className:"goal-criteria",children:(s.criteria||[]).map((a,o)=>e.jsxs("li",{children:[e.jsx("strong",{children:a.satisfied?"OK":"FAIL"})," ",a.check||a.description]},o))}),e.jsx("h3",{children:"Iteration log"}),d.length?e.jsx("ol",{className:"goal-log",children:d.map(a=>e.jsxs("li",{children:[e.jsxs("strong",{children:["#",a.n]}),e.jsxs("span",{children:["$",a.costUsd.toFixed(4)]}),e.jsx("p",{children:a.summary||a.plan||"(empty)"})]},a.n))}):e.jsx("p",{className:"muted",children:"No iterations committed yet."}),e.jsxs("div",{className:"dialog-actions",children:[e.jsx("button",{type:"button",onClick:h,children:"Close"}),e.jsx("button",{type:"button",disabled:!p||c||!$(s.status),onClick:()=>x("run"),children:"Run"}),e.jsx("button",{type:"button",disabled:!p||c||!D(s.status),onClick:()=>x("pause"),children:"Pause"}),e.jsx("button",{type:"button",disabled:!p||c||!G(s.status),onClick:()=>x("resume"),children:"Resume"}),e.jsx("button",{type:"button",disabled:!p||c||!U(s.status),onClick:()=>x("abort"),children:"Abort"})]})]})}function K({onClose:s,onCreated:d}){const[h,p]=i.useState(""),[c,x]=i.useState("cmd: true"),[j,a]=i.useState("5"),[o,b]=i.useState(!1),[C,f]=i.useState(""),g=async r=>{r.preventDefault();const v=c.split(` `).map(u=>u.trim()).filter(Boolean);if(!h.trim()||!v.length){f("Description and at least one criterion are required.");return}b(!0),f("");try{const u=Number(j),N=await F({description:h.trim(),criteria:v,maxIterations:Number.isFinite(u)&&u>0?u:void 0});await d(N)}catch(u){f(u.message)}finally{b(!1)}};return e.jsxs("dialog",{className:"workflow-dialog",open:!0,"aria-labelledby":"goal-create-title",onCancel:r=>{r.preventDefault(),s()},children:[e.jsx("div",{className:"dialog-rule"}),e.jsx("h2",{id:"goal-create-title",children:"New goal"}),e.jsxs("form",{className:"workflow-builder",onSubmit:r=>void g(r),children:[e.jsxs("fieldset",{children:[e.jsx("legend",{children:"Definition"}),e.jsxs("label",{children:["Description",e.jsx("input",{value:h,onChange:r=>p(r.target.value),placeholder:"What should succeed?",required:!0})]}),e.jsxs("label",{children:["Criteria",e.jsx("textarea",{value:c,onChange:r=>x(r.target.value),rows:4,placeholder:`cmd: pytest -q cmd: go test ./...`,"aria-label":"Criteria (one CheckSpec per line)"})]}),e.jsxs("label",{children:["Max iterations",e.jsx("input",{type:"number",min:1,max:1e4,value:j,onChange:r=>a(r.target.value)})]})]}),e.jsxs("p",{className:"muted",children:["Criteria use CheckSpec form: ",e.jsx("code",{children:"cmd:"}),", ",e.jsx("code",{children:"predicate:"}),", or ",e.jsx("code",{children:"judge:"}),". Empty tool allowlist = evaluate-only (no side effects)."]}),C&&e.jsx("p",{className:"workflow-error",role:"alert",children:C}),e.jsxs("div",{className:"dialog-actions",children:[e.jsx("button",{type:"button",onClick:s,children:"Cancel"}),e.jsx("button",{type:"submit",disabled:o,children:o?"Saving…":"Create"})]})]})]})}export{J as GoalsPanel}; diff --git a/internal/frontend/server/static/assets/MCP-Cu_3_mNj.js b/internal/frontend/server/static/assets/MCP-CoXRwoSS.js similarity index 97% rename from internal/frontend/server/static/assets/MCP-Cu_3_mNj.js rename to internal/frontend/server/static/assets/MCP-CoXRwoSS.js index 02c89a7a..c36691a4 100644 --- a/internal/frontend/server/static/assets/MCP-Cu_3_mNj.js +++ b/internal/frontend/server/static/assets/MCP-CoXRwoSS.js @@ -1 +1 @@ -import{b as p,r as a,j as s,C as N,c as S,S as P,s as m}from"./index-DcyMECWA.js";const w=()=>p("/v1/mcp"),M=e=>p("/v1/mcp/retry",{method:"POST",body:JSON.stringify(e?{name:e}:{})}),k=e=>p("/v1/mcp/disable",{method:"POST",body:JSON.stringify({name:e})});function R(e){switch(e){case"up":return m("complete");case"disabled":return m("canceled");case"error":return m("failed");default:return m("blocked")}}function B({available:e}){const[n,g]=a.useState([]),[l,b]=a.useState(!1),[h,x]=a.useState(""),[i,c]=a.useState(""),[j,o]=a.useState(""),r=async()=>{if(e){b(!0),x("");try{const t=await w();g(t.servers||[])}catch(t){x(t.message)}finally{b(!1)}}};if(a.useEffect(()=>{r()},[e]),!e)return s.jsx(N,{name:"MCP"});const y=async t=>{c(t||"*"),o("");try{await M(t),o(t?`Retried ${t}.`:"Retry complete for non-up servers."),await r()}catch(u){window.alert(u.message)}finally{c("")}},C=async t=>{if(window.confirm(`Disable MCP server “${t}” and unregister its tools?`)){c(t),o("");try{await k(t),o(`Disabled ${t}.`),await r()}catch(d){window.alert(d.message)}finally{c("")}}};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mcp-head",children:[s.jsx("h2",{children:"MCP servers"}),s.jsxs("div",{className:"mcp-actions",children:[s.jsx("button",{type:"button",onClick:()=>void r(),disabled:l||!!i,children:"Refresh"}),s.jsx("button",{type:"button",onClick:()=>void y(),disabled:l||!!i||!n.length,children:"Retry all"})]})]}),j&&s.jsx("p",{className:"muted",role:"status",children:j}),h&&s.jsxs("section",{className:"unavailable",role:"alert",children:[s.jsx("strong",{children:"Unable to load"}),s.jsx("p",{children:h})]}),l&&!n.length?s.jsx(S,{label:"Loading MCP status…"}):null,!l&&!n.length&&!h?s.jsx("p",{className:"muted",children:"No MCP servers configured. Add servers in ~/.strike/mcp.jsonc."}):null,s.jsx("div",{className:"mcp-list",role:"list","aria-label":"MCP servers",children:n.map(t=>{const d=t.transport||"stdio",u=i===t.name||i==="*";return s.jsxs("article",{className:"mcp-card",role:"listitem",children:[s.jsxs("header",{children:[s.jsx("h3",{children:t.name}),s.jsx(P,{kind:R(t.state),label:t.state,className:`mcp-state ${t.state}`})]}),s.jsxs("p",{children:[s.jsx("span",{children:d}),t.command?s.jsxs(s.Fragment,{children:[" · ",s.jsx("code",{children:t.command})]}):null," · ","tools=",t.toolCount??0]}),t.error&&t.state!=="disabled"?s.jsx("p",{className:"mcp-error",children:t.error}):null,t.tools&&t.tools.length>0?s.jsx("div",{className:"mcp-tools","aria-label":`${t.name} tools`,children:t.tools.map(f=>s.jsx("code",{children:f},f))}):null,s.jsxs("div",{className:"mcp-card-actions",children:[s.jsx("button",{type:"button",disabled:u||t.state==="up",onClick:()=>void y(t.name),title:t.state==="up"?"Server is already up":"Reconnect (also re-enables disabled)",children:"Retry"}),s.jsx("button",{type:"button",disabled:u||t.state==="disabled",onClick:()=>void C(t.name),children:"Disable"})]})]},t.name)})})]})}export{B as MCPPanel}; +import{b as p,r as a,j as s,C as N,c as S,S as P,s as m}from"./index-BK8GKzWA.js";const w=()=>p("/v1/mcp"),M=e=>p("/v1/mcp/retry",{method:"POST",body:JSON.stringify(e?{name:e}:{})}),k=e=>p("/v1/mcp/disable",{method:"POST",body:JSON.stringify({name:e})});function R(e){switch(e){case"up":return m("complete");case"disabled":return m("canceled");case"error":return m("failed");default:return m("blocked")}}function B({available:e}){const[n,g]=a.useState([]),[l,b]=a.useState(!1),[h,x]=a.useState(""),[i,c]=a.useState(""),[j,o]=a.useState(""),r=async()=>{if(e){b(!0),x("");try{const t=await w();g(t.servers||[])}catch(t){x(t.message)}finally{b(!1)}}};if(a.useEffect(()=>{r()},[e]),!e)return s.jsx(N,{name:"MCP"});const y=async t=>{c(t||"*"),o("");try{await M(t),o(t?`Retried ${t}.`:"Retry complete for non-up servers."),await r()}catch(u){window.alert(u.message)}finally{c("")}},C=async t=>{if(window.confirm(`Disable MCP server “${t}” and unregister its tools?`)){c(t),o("");try{await k(t),o(`Disabled ${t}.`),await r()}catch(d){window.alert(d.message)}finally{c("")}}};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mcp-head",children:[s.jsx("h2",{children:"MCP servers"}),s.jsxs("div",{className:"mcp-actions",children:[s.jsx("button",{type:"button",onClick:()=>void r(),disabled:l||!!i,children:"Refresh"}),s.jsx("button",{type:"button",onClick:()=>void y(),disabled:l||!!i||!n.length,children:"Retry all"})]})]}),j&&s.jsx("p",{className:"muted",role:"status",children:j}),h&&s.jsxs("section",{className:"unavailable",role:"alert",children:[s.jsx("strong",{children:"Unable to load"}),s.jsx("p",{children:h})]}),l&&!n.length?s.jsx(S,{label:"Loading MCP status…"}):null,!l&&!n.length&&!h?s.jsx("p",{className:"muted",children:"No MCP servers configured. Add servers in ~/.strike/mcp.jsonc."}):null,s.jsx("div",{className:"mcp-list",role:"list","aria-label":"MCP servers",children:n.map(t=>{const d=t.transport||"stdio",u=i===t.name||i==="*";return s.jsxs("article",{className:"mcp-card",role:"listitem",children:[s.jsxs("header",{children:[s.jsx("h3",{children:t.name}),s.jsx(P,{kind:R(t.state),label:t.state,className:`mcp-state ${t.state}`})]}),s.jsxs("p",{children:[s.jsx("span",{children:d}),t.command?s.jsxs(s.Fragment,{children:[" · ",s.jsx("code",{children:t.command})]}):null," · ","tools=",t.toolCount??0]}),t.error&&t.state!=="disabled"?s.jsx("p",{className:"mcp-error",children:t.error}):null,t.tools&&t.tools.length>0?s.jsx("div",{className:"mcp-tools","aria-label":`${t.name} tools`,children:t.tools.map(f=>s.jsx("code",{children:f},f))}):null,s.jsxs("div",{className:"mcp-card-actions",children:[s.jsx("button",{type:"button",disabled:u||t.state==="up",onClick:()=>void y(t.name),title:t.state==="up"?"Server is already up":"Reconnect (also re-enables disabled)",children:"Retry"}),s.jsx("button",{type:"button",disabled:u||t.state==="disabled",onClick:()=>void C(t.name),children:"Disable"})]})]},t.name)})})]})}export{B as MCPPanel}; diff --git a/internal/frontend/server/static/assets/PaneView-CEVTmQCp.js b/internal/frontend/server/static/assets/PaneView-CmrtsIj-.js similarity index 97% rename from internal/frontend/server/static/assets/PaneView-CEVTmQCp.js rename to internal/frontend/server/static/assets/PaneView-CmrtsIj-.js index fd5d6202..f387f3e0 100644 --- a/internal/frontend/server/static/assets/PaneView-CEVTmQCp.js +++ b/internal/frontend/server/static/assets/PaneView-CmrtsIj-.js @@ -1 +1 @@ -import{j as a}from"./index-DcyMECWA.js";import{resolveFrom as u}from"./panesApi-DZ879dGA.js";const w=80;function N(e){switch((e||"body").toLowerCase()){case"title":return"pane-role title";case"muted":return"pane-role muted";case"accent":return"pane-role accent";case"success":return"pane-role success";case"warning":return"pane-role warning";case"error":case"danger":return"pane-role error";default:return"pane-role body"}}function x(e,s){if(e.textFrom){const c=u(s,e.textFrom);if(c)return c}return e.text||""}function b(e){if(e)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0}}function f(e){switch((e||"").trim().toLowerCase()){case"check":case"ok":return"✓";case"warn":case"warning":return"◦";case"error":case"err":return"✗";case"agent":return"◆";case"folder":case"file":return"·";default:return""}}function g(e){const s={};return e.flex!=null&&e.flex>0&&(s.flexGrow=e.flex),e.min!=null&&e.min>0&&(s.minWidth=`${e.min}ch`),s}function h(e){const s=f(e.icon);return a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[s?a.jsxs("span",{"aria-hidden":"true",children:[s," "]}):null,a.jsx("strong",{children:e.label||e.id})]}),e.detail?a.jsxs("span",{className:"muted",children:[" ",e.detail]}):null]})}function j({node:e,feeds:s,depth:c=0,onSelect:i}){if(!e||c>16)return a.jsx("p",{className:"muted",children:"view truncated"});const p=(e.type||"").toLowerCase();switch(p){case"column":return a.jsx("div",{className:"pane-column",style:{gap:e.gap?`${e.gap*4}px`:void 0},children:(e.children||[]).map((r,t)=>a.jsx(j,{node:r,feeds:s,depth:c+1,onSelect:i},t))});case"row":{const r=e.children||[],t=r.length,l=e.gap?e.gap*4:0,n=!!e.wrap,m=t>1?l*(t-1):0,o={gap:l||void 0};return!n&&t>0&&(o["--stack-at"]=`${t*w+m}px`),a.jsx("div",{className:n?"pane-row wrap":"pane-row",style:o,children:r.map((d,v)=>a.jsx("div",{className:"pane-row-cell",style:g(d),children:a.jsx(j,{node:d,feeds:s,depth:c+1,onSelect:i})},v))})}case"text":case"markdown":return a.jsx("p",{className:N(e.style),style:b(e.truncate),children:x(e,s)});case"kv":return a.jsx("dl",{className:"pane-kv",children:(e.entries||[]).map((r,t)=>a.jsxs("div",{className:"pane-kv-row",children:[a.jsx("dt",{children:r.key||""}),a.jsx("dd",{children:r.valueFrom?u(s,r.valueFrom)||r.value||"—":r.value||"—"})]},t))});case"list":return a.jsx("ul",{className:"pane-list",role:e.selectable?"listbox":"list",children:(e.items||[]).map((r,t)=>{const l=e.selectedId&&r.id===e.selectedId;return a.jsx("li",{className:l?"selected":void 0,role:e.selectable?"option":void 0,"aria-selected":e.selectable?!!l:void 0,children:e.selectable&&r.id?a.jsx("button",{type:"button",className:"pane-list-btn",onClick:()=>i==null?void 0:i(r.id),children:h(r)}):h(r)},r.id||t)})});case"table":return a.jsxs("table",{className:"pane-table",children:[a.jsx("thead",{children:a.jsx("tr",{children:(e.columns||[]).map(r=>a.jsx("th",{children:r.header||r.id},r.id||r.header))})}),a.jsx("tbody",{children:(e.rows||[]).map((r,t)=>a.jsx("tr",{children:(e.columns||[]).map(l=>{var n;return a.jsx("td",{children:((n=r.cells)==null?void 0:n[l.id||""])||""},l.id||l.header)})},t))})]});case"meter":{const r=e.valueFrom?u(s,e.valueFrom):String(e.value??""),t=e.maxFrom?u(s,e.maxFrom):String(e.max??""),l=Number(r)||0,n=Number(t)||0,m=n>0?Math.min(100,Math.round(l/n*100)):0;return a.jsxs("div",{className:"pane-meter",role:"meter","aria-valuenow":l,"aria-valuemin":0,"aria-valuemax":n||void 0,children:[e.label?a.jsx("span",{className:"muted",children:e.label}):null,a.jsx("div",{className:"pane-meter-track",children:a.jsx("div",{className:`pane-meter-fill tone-${e.tone||"accent"}`,style:{width:`${m}%`}})}),a.jsx("span",{className:"muted",children:n>0?`${l} / ${n}`:String(l)})]})}case"badge":return a.jsx("span",{className:`pane-badge tone-${e.tone||"accent"}`,children:e.label||x(e,s)});case"spacer":return a.jsx("div",{className:"pane-spacer",style:{height:`${Math.min(8,Math.max(1,e.min||1))*8}px`}});case"divider":return a.jsx("hr",{className:"pane-divider"});case"empty":return a.jsxs("div",{className:"pane-empty",children:[a.jsx("p",{className:"muted",children:e.text||"Empty"}),e.hint?a.jsx("p",{className:"muted",children:e.hint}):null]});default:return a.jsxs("p",{className:"muted",children:["unsupported node: ",p||"?"]})}}export{j as P}; +import{j as a}from"./index-BK8GKzWA.js";import{resolveFrom as u}from"./panesApi-Gdyy8rqS.js";const w=80;function N(e){switch((e||"body").toLowerCase()){case"title":return"pane-role title";case"muted":return"pane-role muted";case"accent":return"pane-role accent";case"success":return"pane-role success";case"warning":return"pane-role warning";case"error":case"danger":return"pane-role error";default:return"pane-role body"}}function x(e,s){if(e.textFrom){const c=u(s,e.textFrom);if(c)return c}return e.text||""}function b(e){if(e)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0}}function f(e){switch((e||"").trim().toLowerCase()){case"check":case"ok":return"✓";case"warn":case"warning":return"◦";case"error":case"err":return"✗";case"agent":return"◆";case"folder":case"file":return"·";default:return""}}function g(e){const s={};return e.flex!=null&&e.flex>0&&(s.flexGrow=e.flex),e.min!=null&&e.min>0&&(s.minWidth=`${e.min}ch`),s}function h(e){const s=f(e.icon);return a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[s?a.jsxs("span",{"aria-hidden":"true",children:[s," "]}):null,a.jsx("strong",{children:e.label||e.id})]}),e.detail?a.jsxs("span",{className:"muted",children:[" ",e.detail]}):null]})}function j({node:e,feeds:s,depth:c=0,onSelect:i}){if(!e||c>16)return a.jsx("p",{className:"muted",children:"view truncated"});const p=(e.type||"").toLowerCase();switch(p){case"column":return a.jsx("div",{className:"pane-column",style:{gap:e.gap?`${e.gap*4}px`:void 0},children:(e.children||[]).map((r,t)=>a.jsx(j,{node:r,feeds:s,depth:c+1,onSelect:i},t))});case"row":{const r=e.children||[],t=r.length,l=e.gap?e.gap*4:0,n=!!e.wrap,m=t>1?l*(t-1):0,o={gap:l||void 0};return!n&&t>0&&(o["--stack-at"]=`${t*w+m}px`),a.jsx("div",{className:n?"pane-row wrap":"pane-row",style:o,children:r.map((d,v)=>a.jsx("div",{className:"pane-row-cell",style:g(d),children:a.jsx(j,{node:d,feeds:s,depth:c+1,onSelect:i})},v))})}case"text":case"markdown":return a.jsx("p",{className:N(e.style),style:b(e.truncate),children:x(e,s)});case"kv":return a.jsx("dl",{className:"pane-kv",children:(e.entries||[]).map((r,t)=>a.jsxs("div",{className:"pane-kv-row",children:[a.jsx("dt",{children:r.key||""}),a.jsx("dd",{children:r.valueFrom?u(s,r.valueFrom)||r.value||"—":r.value||"—"})]},t))});case"list":return a.jsx("ul",{className:"pane-list",role:e.selectable?"listbox":"list",children:(e.items||[]).map((r,t)=>{const l=e.selectedId&&r.id===e.selectedId;return a.jsx("li",{className:l?"selected":void 0,role:e.selectable?"option":void 0,"aria-selected":e.selectable?!!l:void 0,children:e.selectable&&r.id?a.jsx("button",{type:"button",className:"pane-list-btn",onClick:()=>i==null?void 0:i(r.id),children:h(r)}):h(r)},r.id||t)})});case"table":return a.jsxs("table",{className:"pane-table",children:[a.jsx("thead",{children:a.jsx("tr",{children:(e.columns||[]).map(r=>a.jsx("th",{children:r.header||r.id},r.id||r.header))})}),a.jsx("tbody",{children:(e.rows||[]).map((r,t)=>a.jsx("tr",{children:(e.columns||[]).map(l=>{var n;return a.jsx("td",{children:((n=r.cells)==null?void 0:n[l.id||""])||""},l.id||l.header)})},t))})]});case"meter":{const r=e.valueFrom?u(s,e.valueFrom):String(e.value??""),t=e.maxFrom?u(s,e.maxFrom):String(e.max??""),l=Number(r)||0,n=Number(t)||0,m=n>0?Math.min(100,Math.round(l/n*100)):0;return a.jsxs("div",{className:"pane-meter",role:"meter","aria-valuenow":l,"aria-valuemin":0,"aria-valuemax":n||void 0,children:[e.label?a.jsx("span",{className:"muted",children:e.label}):null,a.jsx("div",{className:"pane-meter-track",children:a.jsx("div",{className:`pane-meter-fill tone-${e.tone||"accent"}`,style:{width:`${m}%`}})}),a.jsx("span",{className:"muted",children:n>0?`${l} / ${n}`:String(l)})]})}case"badge":return a.jsx("span",{className:`pane-badge tone-${e.tone||"accent"}`,children:e.label||x(e,s)});case"spacer":return a.jsx("div",{className:"pane-spacer",style:{height:`${Math.min(8,Math.max(1,e.min||1))*8}px`}});case"divider":return a.jsx("hr",{className:"pane-divider"});case"empty":return a.jsxs("div",{className:"pane-empty",children:[a.jsx("p",{className:"muted",children:e.text||"Empty"}),e.hint?a.jsx("p",{className:"muted",children:e.hint}):null]});default:return a.jsxs("p",{className:"muted",children:["unsupported node: ",p||"?"]})}}export{j as P}; diff --git a/internal/frontend/server/static/assets/Panes-yF2n2wzV.js b/internal/frontend/server/static/assets/Panes-CWuiX4Ys.js similarity index 94% rename from internal/frontend/server/static/assets/Panes-yF2n2wzV.js rename to internal/frontend/server/static/assets/Panes-CWuiX4Ys.js index 1a31a1c9..41e777ee 100644 --- a/internal/frontend/server/static/assets/Panes-yF2n2wzV.js +++ b/internal/frontend/server/static/assets/Panes-CWuiX4Ys.js @@ -1 +1 @@ -import{r,j as s}from"./index-DcyMECWA.js";import{P}from"./PaneView-CEVTmQCp.js";import{listPanes as S,paneSnapshot as N,mountPane as D,unmountPane as C,paneInput as A}from"./panesApi-DZ879dGA.js";function K({available:h,focusId:d,readOnly:u}){const[i,b]=r.useState([]),[x,j]=r.useState(!1),[v,c]=r.useState(""),[a,p]=r.useState(""),[t,l]=r.useState(null),[f,m]=r.useState(!1),g=async()=>{if(h){j(!0),c("");try{const e=await S();b(e.panes||[])}catch(e){c(e.message)}finally{j(!1)}}};if(r.useEffect(()=>{g()},[h]),r.useEffect(()=>{if(!a){l(null);return}let e=!1;const n=async()=>{try{const k=await N(a);e||l(k)}catch{}};n();const E=window.setInterval(()=>void n(),500);return()=>{e=!0,window.clearInterval(E)}},[a]),!h)return s.jsxs("section",{className:"unavailable",role:"status",children:[s.jsx("strong",{children:"Plugin panes unavailable"}),s.jsx("p",{children:"The configured host did not provide this capability. No action was attempted."})]});const y=async e=>{m(!0),c("");try{const n=await D(e.id);p(e.id),l(n)}catch(n){c(n.message),p(e.id),l({id:e.id,mode:e.mode,title:e.title,error:e.loadError||n.message})}finally{m(!1)}};r.useEffect(()=>{if(!d||!i.length)return;const e=i.find(n=>n.id===d);e&&a!==d&&y(e)},[d,i]);const w=async()=>{if(a){m(!0);try{await C(a)}catch{}finally{p(""),l(null),m(!1)}}},o=async e=>{if(!(u||!a||!t||t.mode!=="process"))try{await A(a,{kind:"key",key:e,mods:[]});const n=await N(a);l(n)}catch(n){c(n.message)}};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mcp-head",children:[s.jsx("h2",{children:"Plugin panes"}),s.jsxs("div",{className:"mcp-actions",children:[s.jsx("button",{type:"button",onClick:()=>void g(),disabled:x||f,children:"Refresh"}),a&&s.jsx("button",{type:"button",onClick:()=>void w(),disabled:f,children:"Close pane"})]})]}),v&&s.jsxs("section",{className:"unavailable",role:"alert",children:[s.jsx("strong",{children:"Error"}),s.jsx("p",{children:v})]}),!a&&s.jsx(s.Fragment,{children:x&&!i.length?s.jsx("p",{className:"muted",children:"Loading…"}):i.length===0?s.jsx("p",{className:"muted",children:"No enabled plugin panes. Install/enable a pane plugin via the plugins tab."}):s.jsx("div",{className:"mcp-list",children:i.map(e=>s.jsxs("article",{className:"mcp-card",children:[s.jsxs("header",{children:[s.jsx("h3",{children:e.title||e.id}),s.jsx("span",{className:"mcp-state",children:e.mode})]}),s.jsx("p",{className:"muted",children:e.provenance}),e.loadError&&s.jsx("p",{className:"mcp-error",children:e.loadError}),s.jsx("div",{className:"mcp-card-actions",children:s.jsx("button",{type:"button",disabled:f||!!(e.loadError&&e.mode==="process"&&!e.trusted),onClick:()=>void y(e),children:"Open"})})]},e.id))})}),a&&t&&s.jsxs("section",{className:"plugin-pane-surface",tabIndex:u?void 0:0,"aria-label":t.title||t.id,onKeyDown:u?void 0:e=>{e.key==="Enter"?(e.preventDefault(),o("enter")):e.key==="Escape"?(e.preventDefault(),o("esc")):e.key==="ArrowUp"?(e.preventDefault(),o("up")):e.key==="ArrowDown"?(e.preventDefault(),o("down")):e.key.length===1&&o(e.key)},children:[s.jsxs("header",{className:"plugin-pane-chrome",children:[s.jsx("strong",{children:t.title||t.id}),t.status&&s.jsx("span",{className:"muted",children:t.status}),s.jsx("span",{className:"muted",children:t.mode}),u&&s.jsx("span",{className:"muted",children:"read-only"})]}),t.error?s.jsxs("div",{className:"pane-error",role:"alert",children:[s.jsx("strong",{children:"pane error"}),s.jsx("p",{children:t.error}),s.jsx("p",{className:"muted",children:"disable via plugins tab · trust process panes before mount"})]}):s.jsx("div",{className:"plugin-pane-body",children:s.jsx(P,{node:t.view,feeds:t.feeds})})]})]})}export{K as PanesPanel}; +import{r,j as s}from"./index-BK8GKzWA.js";import{P}from"./PaneView-CmrtsIj-.js";import{listPanes as S,paneSnapshot as N,mountPane as D,unmountPane as C,paneInput as A}from"./panesApi-Gdyy8rqS.js";function K({available:h,focusId:d,readOnly:u}){const[i,b]=r.useState([]),[x,j]=r.useState(!1),[v,c]=r.useState(""),[a,p]=r.useState(""),[t,l]=r.useState(null),[f,m]=r.useState(!1),g=async()=>{if(h){j(!0),c("");try{const e=await S();b(e.panes||[])}catch(e){c(e.message)}finally{j(!1)}}};if(r.useEffect(()=>{g()},[h]),r.useEffect(()=>{if(!a){l(null);return}let e=!1;const n=async()=>{try{const k=await N(a);e||l(k)}catch{}};n();const E=window.setInterval(()=>void n(),500);return()=>{e=!0,window.clearInterval(E)}},[a]),!h)return s.jsxs("section",{className:"unavailable",role:"status",children:[s.jsx("strong",{children:"Plugin panes unavailable"}),s.jsx("p",{children:"The configured host did not provide this capability. No action was attempted."})]});const y=async e=>{m(!0),c("");try{const n=await D(e.id);p(e.id),l(n)}catch(n){c(n.message),p(e.id),l({id:e.id,mode:e.mode,title:e.title,error:e.loadError||n.message})}finally{m(!1)}};r.useEffect(()=>{if(!d||!i.length)return;const e=i.find(n=>n.id===d);e&&a!==d&&y(e)},[d,i]);const w=async()=>{if(a){m(!0);try{await C(a)}catch{}finally{p(""),l(null),m(!1)}}},o=async e=>{if(!(u||!a||!t||t.mode!=="process"))try{await A(a,{kind:"key",key:e,mods:[]});const n=await N(a);l(n)}catch(n){c(n.message)}};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mcp-head",children:[s.jsx("h2",{children:"Plugin panes"}),s.jsxs("div",{className:"mcp-actions",children:[s.jsx("button",{type:"button",onClick:()=>void g(),disabled:x||f,children:"Refresh"}),a&&s.jsx("button",{type:"button",onClick:()=>void w(),disabled:f,children:"Close pane"})]})]}),v&&s.jsxs("section",{className:"unavailable",role:"alert",children:[s.jsx("strong",{children:"Error"}),s.jsx("p",{children:v})]}),!a&&s.jsx(s.Fragment,{children:x&&!i.length?s.jsx("p",{className:"muted",children:"Loading…"}):i.length===0?s.jsx("p",{className:"muted",children:"No enabled plugin panes. Install/enable a pane plugin via the plugins tab."}):s.jsx("div",{className:"mcp-list",children:i.map(e=>s.jsxs("article",{className:"mcp-card",children:[s.jsxs("header",{children:[s.jsx("h3",{children:e.title||e.id}),s.jsx("span",{className:"mcp-state",children:e.mode})]}),s.jsx("p",{className:"muted",children:e.provenance}),e.loadError&&s.jsx("p",{className:"mcp-error",children:e.loadError}),s.jsx("div",{className:"mcp-card-actions",children:s.jsx("button",{type:"button",disabled:f||!!(e.loadError&&e.mode==="process"&&!e.trusted),onClick:()=>void y(e),children:"Open"})})]},e.id))})}),a&&t&&s.jsxs("section",{className:"plugin-pane-surface",tabIndex:u?void 0:0,"aria-label":t.title||t.id,onKeyDown:u?void 0:e=>{e.key==="Enter"?(e.preventDefault(),o("enter")):e.key==="Escape"?(e.preventDefault(),o("esc")):e.key==="ArrowUp"?(e.preventDefault(),o("up")):e.key==="ArrowDown"?(e.preventDefault(),o("down")):e.key.length===1&&o(e.key)},children:[s.jsxs("header",{className:"plugin-pane-chrome",children:[s.jsx("strong",{children:t.title||t.id}),t.status&&s.jsx("span",{className:"muted",children:t.status}),s.jsx("span",{className:"muted",children:t.mode}),u&&s.jsx("span",{className:"muted",children:"read-only"})]}),t.error?s.jsxs("div",{className:"pane-error",role:"alert",children:[s.jsx("strong",{children:"pane error"}),s.jsx("p",{children:t.error}),s.jsx("p",{className:"muted",children:"disable via plugins tab · trust process panes before mount"})]}):s.jsx("div",{className:"plugin-pane-body",children:s.jsx(P,{node:t.view,feeds:t.feeds})})]})]})}export{K as PanesPanel}; diff --git a/internal/frontend/server/static/assets/Plans-BAlvUQ-t.js b/internal/frontend/server/static/assets/Plans-CQoFK1S6.js similarity index 99% rename from internal/frontend/server/static/assets/Plans-BAlvUQ-t.js rename to internal/frontend/server/static/assets/Plans-CQoFK1S6.js index 037f7ef3..3dfd39cb 100644 --- a/internal/frontend/server/static/assets/Plans-BAlvUQ-t.js +++ b/internal/frontend/server/static/assets/Plans-CQoFK1S6.js @@ -1 +1 @@ -import{b as p,r as u,j as e}from"./index-DcyMECWA.js";const h=t=>t.ID||t.id||"",k=t=>t.Title||t.title||"Untitled plan",m=t=>t.Status||t.status||"draft",x=t=>t.Version??t.version??0,P=t=>t.OwnerRoot||t.ownerRoot||"",G=t=>t.Sections||t.sections||[],H=t=>t.ID||t.id||"",R=t=>t.Title||t.title||"",$=t=>t.Body||t.body||"",K=()=>p("/v1/plans"),Q=t=>p(`/v1/plans/${encodeURIComponent(t)}`),W=(t,l,o)=>p("/v1/plans",{method:"POST",body:JSON.stringify({ownerRoot:t,title:l,sections:o})}),X=(t,l,o,c)=>p(`/v1/plans/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({ownerRoot:l,title:o,expectedVersion:c})}),Y=(t,l,o,c,w)=>p(`/v1/plans/${encodeURIComponent(t)}/sections/${encodeURIComponent(l)}`,{method:"PATCH",body:JSON.stringify({ownerRoot:o,...c,expectedVersion:w})}),Z=(t,l,o,c,w)=>p(`/v1/plans/${encodeURIComponent(t)}/sections`,{method:"POST",body:JSON.stringify({ownerRoot:l,title:o,body:c,expectedVersion:w})}),_=(t,l,o,c)=>p(`/v1/plans/${encodeURIComponent(t)}/status`,{method:"POST",body:JSON.stringify({ownerRoot:l,status:o,expectedVersion:c})}),ee=(t,l,o)=>p(`/v1/plans/${encodeURIComponent(t)}/reopen`,{method:"POST",body:JSON.stringify({ownerRoot:l,expectedVersion:o})});function ne({available:t,live:l,rootID:o}){const[c,w]=u.useState([]),[T,E]=u.useState(!1),[j,S]=u.useState(""),[a,y]=u.useState(null),[D,J]=u.useState(!1),[g,N]=u.useState(""),[V,A]=u.useState(!1),[O,B]=u.useState(""),v=async()=>{if(t){E(!0),S("");try{const n=await K();w(n.plans||[])}catch(n){S(n.message)}finally{E(!1)}}};if(u.useEffect(()=>{v()},[t]),!t)return e.jsxs("section",{className:"unavailable",role:"status",children:[e.jsx("strong",{children:"Plans unavailable"}),e.jsx("p",{children:"The configured host did not provide this capability. No action was attempted."})]});const L=async n=>{J(!0),S(""),N("");try{const s=await Q(n);y(s)}catch(s){S(s.message),y(null)}finally{J(!1)}},d=l&&!!o&&a&&P(a)===o&&m(a)!=="closed",f=!!(a&&o&&P(a)===o),C=a?m(a)==="closed":!1,q=async n=>{if(n.preventDefault(),!l||!o){window.alert("Select a live workspace root to create a plan.");return}const s=O.trim();if(s)try{const i=await W(o,s);B(""),A(!1),N(`Created ${k(i)}`),await v(),y(i)}catch(i){window.alert(i.message)}},b=async(n,s)=>{y(n),N(s),await v()},F=async()=>{if(!a||!d)return;const n=window.prompt("Plan title",k(a));if(n===null)return;const s=n.trim();if(s)try{const i=await X(h(a),o,s,x(a));await b(i,"Title updated")}catch(i){window.alert(i.message)}},U=async n=>{if(!(!a||!f||C))try{const s=await _(h(a),o,n,x(a));await b(s,`Status → ${n}`)}catch(s){window.alert(s.message)}},I=async()=>{if(!(!a||!f||!C))try{const n=await ee(h(a),o,x(a));await b(n,"Reopened as draft")}catch(n){window.alert(n.message)}},M=async()=>{if(!a||!d)return;const n=window.prompt("Section title");if(n===null)return;const s=n.trim();if(!s)return;const i=window.prompt("Section body (optional)","")??"";try{const r=await Z(h(a),o,s,i,x(a));await b(r,"Section added")}catch(r){window.alert(r.message)}},z=async n=>{if(!a||!d)return;const s=window.prompt("Section title",R(n));if(s===null)return;const i=window.prompt("Section body",$(n));if(i!==null)try{const r=await Y(h(a),H(n),o,{title:s.trim()||R(n),body:i},x(a));await b(r,"Section updated")}catch(r){window.alert(r.message)}};if(a){const n=G(a);return e.jsxs("div",{className:"plans-panel",children:[e.jsxs("div",{className:"workflow-head",children:[e.jsx("h2",{children:k(a)}),e.jsxs("div",{className:"workflow-actions",children:[e.jsx("button",{type:"button",onClick:()=>{y(null),N("")},children:"Back"}),e.jsx("button",{type:"button",onClick:()=>void L(h(a)),disabled:D,children:"Refresh"})]})]}),e.jsxs("p",{className:"plans-meta",children:[e.jsx("small",{children:m(a)}),e.jsxs("span",{children:["v",x(a)]}),e.jsxs("span",{title:P(a),children:["owner ",P(a).slice(0,12)||"—"]})]}),!f&&l&&e.jsx("p",{className:"muted",role:"status",children:"Read-only: this plan is owned by another root."}),C&&f&&e.jsx("p",{className:"muted",role:"status",children:"Closed — reopen to edit content."}),!l&&e.jsx("p",{className:"muted",role:"status",children:"Historical session — read only."}),g&&e.jsx("p",{className:"muted",role:"status",children:g}),j&&e.jsxs("section",{className:"unavailable",role:"alert",children:[e.jsx("strong",{children:"Unable to load"}),e.jsx("p",{children:j})]}),e.jsxs("div",{className:"workflow-card-actions plans-actions",children:[d&&e.jsx("button",{type:"button",onClick:()=>void F(),children:"Edit title"}),d&&m(a)==="draft"&&e.jsx("button",{type:"button",onClick:()=>void U("approved"),children:"Approve"}),d&&m(a)==="approved"&&e.jsx("button",{type:"button",onClick:()=>void U("closed"),children:"Close"}),d&&m(a)==="draft"&&e.jsx("button",{type:"button",onClick:()=>void U("closed"),children:"Close"}),f&&C&&l&&e.jsx("button",{type:"button",onClick:()=>void I(),children:"Reopen"}),d&&e.jsx("button",{type:"button",onClick:()=>void M(),children:"Add section"})]}),e.jsx("div",{className:"project-list plans-sections",children:n.length?n.map(s=>{const i=H(s),r=s.DelegateStatus||s.delegateStatus;return e.jsxs("article",{children:[e.jsxs("header",{className:"plans-section-head",children:[e.jsx("h3",{children:R(s)||i||"Section"}),d&&e.jsx("button",{type:"button",onClick:()=>void z(s),children:"Edit"})]}),r&&e.jsxs("small",{children:["delegate: ",r,s.DelegateDetail||s.delegateDetail?` — ${s.DelegateDetail||s.delegateDetail}`:""]}),$(s)?e.jsx("p",{children:$(s)}):e.jsx("p",{className:"muted",children:"Empty section body."})]},i||R(s))}):e.jsx("p",{className:"muted",children:"No sections yet."})})]})}return e.jsxs("div",{className:"plans-panel",children:[e.jsxs("div",{className:"workflow-head",children:[e.jsx("h2",{children:"Plans"}),e.jsxs("div",{className:"workflow-actions",children:[e.jsx("button",{type:"button",onClick:()=>void v(),disabled:T,children:"Refresh"}),l&&e.jsx("button",{type:"button",onClick:()=>A(n=>!n),disabled:!o,children:"New"})]})]}),g&&e.jsx("p",{className:"muted",role:"status",children:g}),j&&e.jsxs("section",{className:"unavailable",role:"alert",children:[e.jsx("strong",{children:"Unable to load"}),e.jsx("p",{children:j})]}),V&&e.jsxs("form",{className:"plans-create",onSubmit:n=>void q(n),children:[e.jsxs("label",{children:["Title",e.jsx("input",{"aria-label":"New plan title",value:O,onChange:n=>B(n.target.value),placeholder:"Plan title",autoFocus:!0})]}),e.jsx("button",{type:"submit",disabled:!O.trim(),children:"Create"})]}),T&&!c.length?e.jsx("p",{className:"muted",children:"Loading plans…"}):null,!T&&!c.length&&!j?e.jsx("p",{className:"muted",children:"No project plans."}):null,e.jsx("div",{className:"workflow-list",children:c.map(n=>{const s=h(n);return e.jsxs("article",{className:"workflow-card",children:[e.jsxs("header",{children:[e.jsx("h3",{children:k(n)}),e.jsx("small",{children:m(n)})]}),e.jsxs("p",{children:[n.SectionCount??n.sectionCount??0," sections · v",x(n)]}),e.jsx("div",{className:"workflow-card-actions",children:e.jsx("button",{type:"button",onClick:()=>void L(s),children:"Open"})})]},s)})})]})}export{ne as PlansPanel}; +import{b as p,r as u,j as e}from"./index-BK8GKzWA.js";const h=t=>t.ID||t.id||"",k=t=>t.Title||t.title||"Untitled plan",m=t=>t.Status||t.status||"draft",x=t=>t.Version??t.version??0,P=t=>t.OwnerRoot||t.ownerRoot||"",G=t=>t.Sections||t.sections||[],H=t=>t.ID||t.id||"",R=t=>t.Title||t.title||"",$=t=>t.Body||t.body||"",K=()=>p("/v1/plans"),Q=t=>p(`/v1/plans/${encodeURIComponent(t)}`),W=(t,l,o)=>p("/v1/plans",{method:"POST",body:JSON.stringify({ownerRoot:t,title:l,sections:o})}),X=(t,l,o,c)=>p(`/v1/plans/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({ownerRoot:l,title:o,expectedVersion:c})}),Y=(t,l,o,c,w)=>p(`/v1/plans/${encodeURIComponent(t)}/sections/${encodeURIComponent(l)}`,{method:"PATCH",body:JSON.stringify({ownerRoot:o,...c,expectedVersion:w})}),Z=(t,l,o,c,w)=>p(`/v1/plans/${encodeURIComponent(t)}/sections`,{method:"POST",body:JSON.stringify({ownerRoot:l,title:o,body:c,expectedVersion:w})}),_=(t,l,o,c)=>p(`/v1/plans/${encodeURIComponent(t)}/status`,{method:"POST",body:JSON.stringify({ownerRoot:l,status:o,expectedVersion:c})}),ee=(t,l,o)=>p(`/v1/plans/${encodeURIComponent(t)}/reopen`,{method:"POST",body:JSON.stringify({ownerRoot:l,expectedVersion:o})});function ne({available:t,live:l,rootID:o}){const[c,w]=u.useState([]),[T,E]=u.useState(!1),[j,S]=u.useState(""),[a,y]=u.useState(null),[D,J]=u.useState(!1),[g,N]=u.useState(""),[V,A]=u.useState(!1),[O,B]=u.useState(""),v=async()=>{if(t){E(!0),S("");try{const n=await K();w(n.plans||[])}catch(n){S(n.message)}finally{E(!1)}}};if(u.useEffect(()=>{v()},[t]),!t)return e.jsxs("section",{className:"unavailable",role:"status",children:[e.jsx("strong",{children:"Plans unavailable"}),e.jsx("p",{children:"The configured host did not provide this capability. No action was attempted."})]});const L=async n=>{J(!0),S(""),N("");try{const s=await Q(n);y(s)}catch(s){S(s.message),y(null)}finally{J(!1)}},d=l&&!!o&&a&&P(a)===o&&m(a)!=="closed",f=!!(a&&o&&P(a)===o),C=a?m(a)==="closed":!1,q=async n=>{if(n.preventDefault(),!l||!o){window.alert("Select a live workspace root to create a plan.");return}const s=O.trim();if(s)try{const i=await W(o,s);B(""),A(!1),N(`Created ${k(i)}`),await v(),y(i)}catch(i){window.alert(i.message)}},b=async(n,s)=>{y(n),N(s),await v()},F=async()=>{if(!a||!d)return;const n=window.prompt("Plan title",k(a));if(n===null)return;const s=n.trim();if(s)try{const i=await X(h(a),o,s,x(a));await b(i,"Title updated")}catch(i){window.alert(i.message)}},U=async n=>{if(!(!a||!f||C))try{const s=await _(h(a),o,n,x(a));await b(s,`Status → ${n}`)}catch(s){window.alert(s.message)}},I=async()=>{if(!(!a||!f||!C))try{const n=await ee(h(a),o,x(a));await b(n,"Reopened as draft")}catch(n){window.alert(n.message)}},M=async()=>{if(!a||!d)return;const n=window.prompt("Section title");if(n===null)return;const s=n.trim();if(!s)return;const i=window.prompt("Section body (optional)","")??"";try{const r=await Z(h(a),o,s,i,x(a));await b(r,"Section added")}catch(r){window.alert(r.message)}},z=async n=>{if(!a||!d)return;const s=window.prompt("Section title",R(n));if(s===null)return;const i=window.prompt("Section body",$(n));if(i!==null)try{const r=await Y(h(a),H(n),o,{title:s.trim()||R(n),body:i},x(a));await b(r,"Section updated")}catch(r){window.alert(r.message)}};if(a){const n=G(a);return e.jsxs("div",{className:"plans-panel",children:[e.jsxs("div",{className:"workflow-head",children:[e.jsx("h2",{children:k(a)}),e.jsxs("div",{className:"workflow-actions",children:[e.jsx("button",{type:"button",onClick:()=>{y(null),N("")},children:"Back"}),e.jsx("button",{type:"button",onClick:()=>void L(h(a)),disabled:D,children:"Refresh"})]})]}),e.jsxs("p",{className:"plans-meta",children:[e.jsx("small",{children:m(a)}),e.jsxs("span",{children:["v",x(a)]}),e.jsxs("span",{title:P(a),children:["owner ",P(a).slice(0,12)||"—"]})]}),!f&&l&&e.jsx("p",{className:"muted",role:"status",children:"Read-only: this plan is owned by another root."}),C&&f&&e.jsx("p",{className:"muted",role:"status",children:"Closed — reopen to edit content."}),!l&&e.jsx("p",{className:"muted",role:"status",children:"Historical session — read only."}),g&&e.jsx("p",{className:"muted",role:"status",children:g}),j&&e.jsxs("section",{className:"unavailable",role:"alert",children:[e.jsx("strong",{children:"Unable to load"}),e.jsx("p",{children:j})]}),e.jsxs("div",{className:"workflow-card-actions plans-actions",children:[d&&e.jsx("button",{type:"button",onClick:()=>void F(),children:"Edit title"}),d&&m(a)==="draft"&&e.jsx("button",{type:"button",onClick:()=>void U("approved"),children:"Approve"}),d&&m(a)==="approved"&&e.jsx("button",{type:"button",onClick:()=>void U("closed"),children:"Close"}),d&&m(a)==="draft"&&e.jsx("button",{type:"button",onClick:()=>void U("closed"),children:"Close"}),f&&C&&l&&e.jsx("button",{type:"button",onClick:()=>void I(),children:"Reopen"}),d&&e.jsx("button",{type:"button",onClick:()=>void M(),children:"Add section"})]}),e.jsx("div",{className:"project-list plans-sections",children:n.length?n.map(s=>{const i=H(s),r=s.DelegateStatus||s.delegateStatus;return e.jsxs("article",{children:[e.jsxs("header",{className:"plans-section-head",children:[e.jsx("h3",{children:R(s)||i||"Section"}),d&&e.jsx("button",{type:"button",onClick:()=>void z(s),children:"Edit"})]}),r&&e.jsxs("small",{children:["delegate: ",r,s.DelegateDetail||s.delegateDetail?` — ${s.DelegateDetail||s.delegateDetail}`:""]}),$(s)?e.jsx("p",{children:$(s)}):e.jsx("p",{className:"muted",children:"Empty section body."})]},i||R(s))}):e.jsx("p",{className:"muted",children:"No sections yet."})})]})}return e.jsxs("div",{className:"plans-panel",children:[e.jsxs("div",{className:"workflow-head",children:[e.jsx("h2",{children:"Plans"}),e.jsxs("div",{className:"workflow-actions",children:[e.jsx("button",{type:"button",onClick:()=>void v(),disabled:T,children:"Refresh"}),l&&e.jsx("button",{type:"button",onClick:()=>A(n=>!n),disabled:!o,children:"New"})]})]}),g&&e.jsx("p",{className:"muted",role:"status",children:g}),j&&e.jsxs("section",{className:"unavailable",role:"alert",children:[e.jsx("strong",{children:"Unable to load"}),e.jsx("p",{children:j})]}),V&&e.jsxs("form",{className:"plans-create",onSubmit:n=>void q(n),children:[e.jsxs("label",{children:["Title",e.jsx("input",{"aria-label":"New plan title",value:O,onChange:n=>B(n.target.value),placeholder:"Plan title",autoFocus:!0})]}),e.jsx("button",{type:"submit",disabled:!O.trim(),children:"Create"})]}),T&&!c.length?e.jsx("p",{className:"muted",children:"Loading plans…"}):null,!T&&!c.length&&!j?e.jsx("p",{className:"muted",children:"No project plans."}):null,e.jsx("div",{className:"workflow-list",children:c.map(n=>{const s=h(n);return e.jsxs("article",{className:"workflow-card",children:[e.jsxs("header",{children:[e.jsx("h3",{children:k(n)}),e.jsx("small",{children:m(n)})]}),e.jsxs("p",{children:[n.SectionCount??n.sectionCount??0," sections · v",x(n)]}),e.jsx("div",{className:"workflow-card-actions",children:e.jsx("button",{type:"button",onClick:()=>void L(s),children:"Open"})})]},s)})})]})}export{ne as PlansPanel}; diff --git a/internal/frontend/server/static/assets/Plugins-pp6LQvUY.js b/internal/frontend/server/static/assets/Plugins-CJ0dCX91.js similarity index 98% rename from internal/frontend/server/static/assets/Plugins-pp6LQvUY.js rename to internal/frontend/server/static/assets/Plugins-CJ0dCX91.js index 19c21196..2b037d4d 100644 --- a/internal/frontend/server/static/assets/Plugins-pp6LQvUY.js +++ b/internal/frontend/server/static/assets/Plugins-CJ0dCX91.js @@ -1 +1 @@ -import{b as c,r as l,j as s}from"./index-DcyMECWA.js";import{unmountPane as L,listPanes as W,mountPane as X}from"./panesApi-DZ879dGA.js";import{P as Y}from"./PaneView-CEVTmQCp.js";const Z=()=>c("/v1/plugins"),ee=(n,i)=>c("/v1/plugins/enable",{method:"POST",body:JSON.stringify({id:n,scope:i||void 0})}),se=(n,i)=>c("/v1/plugins/disable",{method:"POST",body:JSON.stringify({id:n,scope:i||void 0})}),te=(n,i,a)=>c("/v1/plugins/remove",{method:"POST",body:JSON.stringify({id:n,scope:i||void 0,confirm:a})}),ne=(n,i)=>{const a=i?`?scope=${encodeURIComponent(i)}`:"";return c(`/v1/plugins/${encodeURIComponent(n)}/trust-preview${a}`)},ie=(n,i)=>c("/v1/plugins/trust",{method:"POST",body:JSON.stringify({id:n,scope:i||void 0})}),le=(n,i)=>c("/v1/plugins/untrust",{method:"POST",body:JSON.stringify({id:n,scope:i||void 0})}),ae=(n,i)=>c("/v1/plugins/search",{method:"POST",body:JSON.stringify({registry:n,query:i})}),V=(n,i,a)=>c("/v1/plugins/install",{method:"POST",body:JSON.stringify({source:n,scope:i,registry:a||void 0})}),re=(n,i,a)=>c("/v1/plugins/preview-update",{method:"POST",body:JSON.stringify({id:n,scope:i||void 0,registry:a||void 0})}),de=(n,i,a,b)=>c("/v1/plugins/update",{method:"POST",body:JSON.stringify({id:n,scope:i||void 0,registry:a||void 0,confirm:b})});function oe(n){switch(n){case"trusted":return"plugin-trust trusted";case"stale":return"plugin-trust stale";case"none":return"plugin-trust none";default:return"plugin-trust passive"}}function ce(n){switch(n){case"enabled":return"plugin-status enabled";case"disabled":return"plugin-status disabled";case"invalid":return"plugin-status invalid";default:return"plugin-status"}}function me({available:n,live:i=!0,panesAvailable:a=!0,rootID:b}){const[j,q]=l.useState([]),[A,K]=l.useState([]),[$,C]=l.useState(!1),[k,T]=l.useState(""),[r,m]=l.useState(""),[O,d]=l.useState(""),[o,U]=l.useState(null),[v,y]=l.useState(null),[h,w]=l.useState(null),[f,B]=l.useState(""),[p,D]=l.useState(""),[E,Q]=l.useState(""),[I,F]=l.useState([]),[u,N]=l.useState(null),[x,R]=l.useState(""),S=async()=>{if(n){C(!0),T("");try{const e=await Z();if(q(e.plugins||[]),a){const t=await W().catch(()=>({panes:[]}));K(t.panes||[])}}catch(e){T(e.message)}finally{C(!1)}}};if(l.useEffect(()=>{S()},[n,a]),!n)return s.jsxs("section",{className:"unavailable",role:"status",children:[s.jsx("strong",{children:"Plugins unavailable"}),s.jsx("p",{children:"The configured host did not provide this capability. No action was attempted."})]});const g=async(e,t)=>{m(e),d("");try{await t(),await S()}catch(P){window.alert(P.message)}finally{m("")}},G=async e=>{m(`trust:${e.id}`),d("");try{const t=await ne(e.id,e.scope);y(t),U(e)}catch(t){window.alert(t.message)}finally{m("")}},H=async()=>{!o||!v||await g(`trust:${o.id}`,async()=>{await ie(o.id,o.scope),d(`Trusted ${o.id}.`),y(null)})},M=async e=>{m(`update:${e.id}`);try{const t=await re(e.id,e.scope,p||void 0);w(t),U(e)}catch(t){window.alert(t.message)}finally{m("")}},_=async()=>{!o||!h||window.confirm(`Apply update ${h.oldVersion} → ${h.newVersion} for ${o.id}?`)&&await g(`update:${o.id}`,async()=>{await de(o.id,o.scope,p||void 0,!0),d(`Updated ${o.id}.`),w(null)})},z=async e=>{m(`pane:${e.id}`),d("");try{x&&x!==e.id&&await L(x).catch(()=>{});const t=await X(e.id,40,14,b);N(t),R(e.id)}catch(t){window.alert(t.message),N(null)}finally{m("")}},J=e=>A.filter(t=>t.pluginId===e);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"plugin-head",children:[s.jsx("h2",{children:"Plugins"}),s.jsx("div",{className:"plugin-actions",children:s.jsx("button",{type:"button",onClick:()=>void S(),disabled:$||!!r,children:"Refresh"})})]}),O&&s.jsx("p",{className:"muted",role:"status",children:O}),k&&s.jsxs("section",{className:"unavailable",role:"alert",children:[s.jsx("strong",{children:"Error"}),s.jsx("p",{children:k})]}),s.jsxs("details",{className:"plugin-install",children:[s.jsx("summary",{children:"Install / catalog"}),s.jsxs("label",{children:["Source (path, git URL, or catalog:pkg)",s.jsx("input",{value:f,onChange:e=>B(e.target.value),placeholder:"./my-plugin or catalog:acme.pack"})]}),s.jsxs("label",{children:["Registry (catalog installs)",s.jsx("input",{value:p,onChange:e=>D(e.target.value),placeholder:"https://…"})]}),s.jsx("div",{className:"plugin-actions",children:s.jsx("button",{type:"button",disabled:!f.trim()||!!r,onClick:()=>void g("install",async()=>{const e=await V(f.trim(),"global",p||void 0);d(`Installed ${e.id}@${e.version||"?"}.`),B("")}),children:"Install"})}),s.jsxs("label",{children:["Search catalog",s.jsx("input",{value:E,onChange:e=>Q(e.target.value),placeholder:"query"})]}),s.jsx("button",{type:"button",disabled:!p.trim()||!!r,onClick:()=>void g("search",async()=>{const e=await ae(p.trim(),E);F(e.hits||[])}),children:"Search"}),I.length>0&&s.jsx("ul",{className:"plugin-hits",children:I.map(e=>s.jsxs("li",{children:[s.jsx("strong",{children:e.id})," ",e.version&&s.jsxs("span",{className:"muted",children:["v",e.version]}),e.description&&s.jsx("p",{className:"muted",children:e.description}),s.jsx("button",{type:"button",onClick:()=>void g(`install:${e.id}`,async()=>{const t=await V(`catalog:${e.id}`,"global",p||e.registry);d(`Installed ${t.id}.`)}),children:"Install"})]},e.id))})]}),v&&s.jsxs("section",{className:"plugin-review",role:"dialog","aria-label":"Trust review",children:[s.jsxs("h3",{children:["Trust review — ",v.id]}),v.digest&&s.jsxs("p",{className:"muted",children:["digest: ",v.digest]}),s.jsx("ul",{children:(v.reviewLines||[]).map((e,t)=>s.jsx("li",{children:s.jsx("code",{children:e})},t))}),s.jsxs("div",{className:"plugin-actions",children:[s.jsx("button",{type:"button",onClick:()=>void H(),disabled:!!r,children:"Grant trust"}),s.jsx("button",{type:"button",onClick:()=>y(null),children:"Cancel"})]})]}),h&&s.jsxs("section",{className:"plugin-review",role:"dialog","aria-label":"Update review",children:[s.jsxs("h3",{children:["Update ",h.id,": ",h.oldVersion," → ",h.newVersion]}),s.jsx("pre",{className:"plugin-summary",children:h.summary||"(no summary)"}),h.trustInvalidated&&s.jsx("p",{className:"warning-text",children:"Trust will be invalidated."}),s.jsxs("div",{className:"plugin-actions",children:[s.jsx("button",{type:"button",onClick:()=>void _(),disabled:!!r,children:"Apply update"}),s.jsx("button",{type:"button",onClick:()=>w(null),children:"Cancel"})]})]}),$&&!j.length?s.jsx("p",{className:"muted",children:"Loading plugins…"}):j.length?s.jsx("div",{className:"plugin-list","aria-label":"Installed plugins",children:j.map(e=>s.jsxs("article",{className:"plugin-card",children:[s.jsxs("header",{children:[s.jsx("h3",{children:e.name||e.id}),s.jsx("span",{className:ce(e.status),children:e.status||(e.enabled?"enabled":"disabled")}),s.jsx("span",{className:oe(e.trustState),children:e.trustState||"—"})]}),s.jsxs("p",{className:"muted",children:[s.jsx("code",{children:e.id}),e.version?` @ ${e.version}`:"",e.scope?` · ${e.scope}`:""]}),e.sourceLabel&&s.jsx("p",{className:"muted",children:e.sourceLabel}),e.loadError&&s.jsx("p",{className:"error-text",children:e.loadError}),s.jsxs("p",{className:"plugin-counts muted",children:["agents ",e.agents||0," · skills ",e.skills||0," · workflows ",e.workflows||0," · themes ",e.themes||0," · panes ",e.panes||0," · hooks ",e.hooks||0]}),e.capabilities&&e.capabilities.length>0&&s.jsxs("p",{className:"muted",children:["caps: ",e.capabilities.join(", ")]}),e.mcp&&e.mcp.length>0&&s.jsx("ul",{className:"plugin-mcp",children:e.mcp.map(t=>s.jsxs("li",{children:["MCP ",s.jsx("code",{children:t.name}),t.command?` ${t.command}`:"",t.envKeys&&t.envKeys.length?` (env: ${t.envKeys.join(", ")})`:""]},t.name))}),e.findings&&e.findings.length>0&&s.jsx("ul",{className:"plugin-findings",children:e.findings.map((t,P)=>s.jsx("li",{children:t},P))}),s.jsxs("div",{className:"plugin-card-actions",children:[e.enabled?s.jsx("button",{type:"button",disabled:!!r,onClick:()=>void g(`dis:${e.id}`,async()=>{await se(e.id,e.scope),d(`Disabled ${e.id}.`)}),children:"Disable"}):s.jsx("button",{type:"button",disabled:!!r,onClick:()=>void g(`en:${e.id}`,async()=>{await ee(e.id,e.scope),d(`Enabled ${e.id}.`)}),children:"Enable"}),e.hasExecutable&&e.trustState!=="trusted"&&s.jsx("button",{type:"button",disabled:!!r,onClick:()=>void G(e),children:"Trust…"}),e.hasExecutable&&e.trustState==="trusted"&&s.jsx("button",{type:"button",disabled:!!r,onClick:()=>void g(`untrust:${e.id}`,async()=>{await le(e.id,e.scope),d(`Untrusted ${e.id}.`)}),children:"Untrust"}),e.updateAvailable&&s.jsxs("button",{type:"button",disabled:!!r,onClick:()=>void M(e),children:["Update ",e.updateAvailable]}),s.jsx("button",{type:"button",className:"danger",disabled:!!r,onClick:()=>{window.confirm(`Remove plugin “${e.id}”? This deletes the install.`)&&g(`rm:${e.id}`,async()=>{await te(e.id,e.scope,!0),d(`Removed ${e.id}.`)})},children:"Remove"})]}),a&&J(e.id).length>0&&s.jsxs("div",{className:"plugin-panes",children:[s.jsx("strong",{children:"Panes"}),s.jsx("ul",{children:J(e.id).map(t=>s.jsxs("li",{children:[s.jsx("button",{type:"button",disabled:!!r,onClick:()=>void z(t),children:t.title||t.id}),s.jsxs("span",{className:"muted",children:[" ",t.mode,t.trusted?"":" · blocked",t.loadError?` · ${t.loadError}`:""]}),s.jsxs("span",{className:"muted",children:[" · ",t.provenance]})]},t.id))})]})]},`${e.scope||""}:${e.id}`))}):s.jsxs("p",{className:"muted",children:["No plugins installed. Use Install above or ",s.jsx("code",{children:"strike plugin install"}),"."]}),u&&s.jsxs("section",{className:"plugin-pane-host","aria-label":`Plugin pane ${u.id}`,children:[s.jsxs("header",{className:"plugin-pane-head",children:[s.jsxs("h3",{children:[u.title||u.id,u.status?` · ${u.status}`:""]}),s.jsx("button",{type:"button",onClick:()=>{x&&L(x).catch(()=>{}),N(null),R("")},children:"Close pane"})]}),u.error?s.jsxs("section",{className:"unavailable",role:"alert",children:[s.jsx("strong",{children:"Pane error"}),s.jsx("p",{children:u.error})]}):s.jsx("div",{className:"plugin-pane-body",children:s.jsx(Y,{node:u.view||null,feeds:u.feeds})})]})]})}export{me as PluginsPanel}; +import{b as c,r as l,j as s}from"./index-BK8GKzWA.js";import{unmountPane as L,listPanes as W,mountPane as X}from"./panesApi-Gdyy8rqS.js";import{P as Y}from"./PaneView-CmrtsIj-.js";const Z=()=>c("/v1/plugins"),ee=(n,i)=>c("/v1/plugins/enable",{method:"POST",body:JSON.stringify({id:n,scope:i||void 0})}),se=(n,i)=>c("/v1/plugins/disable",{method:"POST",body:JSON.stringify({id:n,scope:i||void 0})}),te=(n,i,a)=>c("/v1/plugins/remove",{method:"POST",body:JSON.stringify({id:n,scope:i||void 0,confirm:a})}),ne=(n,i)=>{const a=i?`?scope=${encodeURIComponent(i)}`:"";return c(`/v1/plugins/${encodeURIComponent(n)}/trust-preview${a}`)},ie=(n,i)=>c("/v1/plugins/trust",{method:"POST",body:JSON.stringify({id:n,scope:i||void 0})}),le=(n,i)=>c("/v1/plugins/untrust",{method:"POST",body:JSON.stringify({id:n,scope:i||void 0})}),ae=(n,i)=>c("/v1/plugins/search",{method:"POST",body:JSON.stringify({registry:n,query:i})}),V=(n,i,a)=>c("/v1/plugins/install",{method:"POST",body:JSON.stringify({source:n,scope:i,registry:a||void 0})}),re=(n,i,a)=>c("/v1/plugins/preview-update",{method:"POST",body:JSON.stringify({id:n,scope:i||void 0,registry:a||void 0})}),de=(n,i,a,b)=>c("/v1/plugins/update",{method:"POST",body:JSON.stringify({id:n,scope:i||void 0,registry:a||void 0,confirm:b})});function oe(n){switch(n){case"trusted":return"plugin-trust trusted";case"stale":return"plugin-trust stale";case"none":return"plugin-trust none";default:return"plugin-trust passive"}}function ce(n){switch(n){case"enabled":return"plugin-status enabled";case"disabled":return"plugin-status disabled";case"invalid":return"plugin-status invalid";default:return"plugin-status"}}function me({available:n,live:i=!0,panesAvailable:a=!0,rootID:b}){const[j,q]=l.useState([]),[A,K]=l.useState([]),[$,C]=l.useState(!1),[k,T]=l.useState(""),[r,m]=l.useState(""),[O,d]=l.useState(""),[o,U]=l.useState(null),[v,y]=l.useState(null),[h,w]=l.useState(null),[f,B]=l.useState(""),[p,D]=l.useState(""),[E,Q]=l.useState(""),[I,F]=l.useState([]),[u,N]=l.useState(null),[x,R]=l.useState(""),S=async()=>{if(n){C(!0),T("");try{const e=await Z();if(q(e.plugins||[]),a){const t=await W().catch(()=>({panes:[]}));K(t.panes||[])}}catch(e){T(e.message)}finally{C(!1)}}};if(l.useEffect(()=>{S()},[n,a]),!n)return s.jsxs("section",{className:"unavailable",role:"status",children:[s.jsx("strong",{children:"Plugins unavailable"}),s.jsx("p",{children:"The configured host did not provide this capability. No action was attempted."})]});const g=async(e,t)=>{m(e),d("");try{await t(),await S()}catch(P){window.alert(P.message)}finally{m("")}},G=async e=>{m(`trust:${e.id}`),d("");try{const t=await ne(e.id,e.scope);y(t),U(e)}catch(t){window.alert(t.message)}finally{m("")}},H=async()=>{!o||!v||await g(`trust:${o.id}`,async()=>{await ie(o.id,o.scope),d(`Trusted ${o.id}.`),y(null)})},M=async e=>{m(`update:${e.id}`);try{const t=await re(e.id,e.scope,p||void 0);w(t),U(e)}catch(t){window.alert(t.message)}finally{m("")}},_=async()=>{!o||!h||window.confirm(`Apply update ${h.oldVersion} → ${h.newVersion} for ${o.id}?`)&&await g(`update:${o.id}`,async()=>{await de(o.id,o.scope,p||void 0,!0),d(`Updated ${o.id}.`),w(null)})},z=async e=>{m(`pane:${e.id}`),d("");try{x&&x!==e.id&&await L(x).catch(()=>{});const t=await X(e.id,40,14,b);N(t),R(e.id)}catch(t){window.alert(t.message),N(null)}finally{m("")}},J=e=>A.filter(t=>t.pluginId===e);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"plugin-head",children:[s.jsx("h2",{children:"Plugins"}),s.jsx("div",{className:"plugin-actions",children:s.jsx("button",{type:"button",onClick:()=>void S(),disabled:$||!!r,children:"Refresh"})})]}),O&&s.jsx("p",{className:"muted",role:"status",children:O}),k&&s.jsxs("section",{className:"unavailable",role:"alert",children:[s.jsx("strong",{children:"Error"}),s.jsx("p",{children:k})]}),s.jsxs("details",{className:"plugin-install",children:[s.jsx("summary",{children:"Install / catalog"}),s.jsxs("label",{children:["Source (path, git URL, or catalog:pkg)",s.jsx("input",{value:f,onChange:e=>B(e.target.value),placeholder:"./my-plugin or catalog:acme.pack"})]}),s.jsxs("label",{children:["Registry (catalog installs)",s.jsx("input",{value:p,onChange:e=>D(e.target.value),placeholder:"https://…"})]}),s.jsx("div",{className:"plugin-actions",children:s.jsx("button",{type:"button",disabled:!f.trim()||!!r,onClick:()=>void g("install",async()=>{const e=await V(f.trim(),"global",p||void 0);d(`Installed ${e.id}@${e.version||"?"}.`),B("")}),children:"Install"})}),s.jsxs("label",{children:["Search catalog",s.jsx("input",{value:E,onChange:e=>Q(e.target.value),placeholder:"query"})]}),s.jsx("button",{type:"button",disabled:!p.trim()||!!r,onClick:()=>void g("search",async()=>{const e=await ae(p.trim(),E);F(e.hits||[])}),children:"Search"}),I.length>0&&s.jsx("ul",{className:"plugin-hits",children:I.map(e=>s.jsxs("li",{children:[s.jsx("strong",{children:e.id})," ",e.version&&s.jsxs("span",{className:"muted",children:["v",e.version]}),e.description&&s.jsx("p",{className:"muted",children:e.description}),s.jsx("button",{type:"button",onClick:()=>void g(`install:${e.id}`,async()=>{const t=await V(`catalog:${e.id}`,"global",p||e.registry);d(`Installed ${t.id}.`)}),children:"Install"})]},e.id))})]}),v&&s.jsxs("section",{className:"plugin-review",role:"dialog","aria-label":"Trust review",children:[s.jsxs("h3",{children:["Trust review — ",v.id]}),v.digest&&s.jsxs("p",{className:"muted",children:["digest: ",v.digest]}),s.jsx("ul",{children:(v.reviewLines||[]).map((e,t)=>s.jsx("li",{children:s.jsx("code",{children:e})},t))}),s.jsxs("div",{className:"plugin-actions",children:[s.jsx("button",{type:"button",onClick:()=>void H(),disabled:!!r,children:"Grant trust"}),s.jsx("button",{type:"button",onClick:()=>y(null),children:"Cancel"})]})]}),h&&s.jsxs("section",{className:"plugin-review",role:"dialog","aria-label":"Update review",children:[s.jsxs("h3",{children:["Update ",h.id,": ",h.oldVersion," → ",h.newVersion]}),s.jsx("pre",{className:"plugin-summary",children:h.summary||"(no summary)"}),h.trustInvalidated&&s.jsx("p",{className:"warning-text",children:"Trust will be invalidated."}),s.jsxs("div",{className:"plugin-actions",children:[s.jsx("button",{type:"button",onClick:()=>void _(),disabled:!!r,children:"Apply update"}),s.jsx("button",{type:"button",onClick:()=>w(null),children:"Cancel"})]})]}),$&&!j.length?s.jsx("p",{className:"muted",children:"Loading plugins…"}):j.length?s.jsx("div",{className:"plugin-list","aria-label":"Installed plugins",children:j.map(e=>s.jsxs("article",{className:"plugin-card",children:[s.jsxs("header",{children:[s.jsx("h3",{children:e.name||e.id}),s.jsx("span",{className:ce(e.status),children:e.status||(e.enabled?"enabled":"disabled")}),s.jsx("span",{className:oe(e.trustState),children:e.trustState||"—"})]}),s.jsxs("p",{className:"muted",children:[s.jsx("code",{children:e.id}),e.version?` @ ${e.version}`:"",e.scope?` · ${e.scope}`:""]}),e.sourceLabel&&s.jsx("p",{className:"muted",children:e.sourceLabel}),e.loadError&&s.jsx("p",{className:"error-text",children:e.loadError}),s.jsxs("p",{className:"plugin-counts muted",children:["agents ",e.agents||0," · skills ",e.skills||0," · workflows ",e.workflows||0," · themes ",e.themes||0," · panes ",e.panes||0," · hooks ",e.hooks||0]}),e.capabilities&&e.capabilities.length>0&&s.jsxs("p",{className:"muted",children:["caps: ",e.capabilities.join(", ")]}),e.mcp&&e.mcp.length>0&&s.jsx("ul",{className:"plugin-mcp",children:e.mcp.map(t=>s.jsxs("li",{children:["MCP ",s.jsx("code",{children:t.name}),t.command?` ${t.command}`:"",t.envKeys&&t.envKeys.length?` (env: ${t.envKeys.join(", ")})`:""]},t.name))}),e.findings&&e.findings.length>0&&s.jsx("ul",{className:"plugin-findings",children:e.findings.map((t,P)=>s.jsx("li",{children:t},P))}),s.jsxs("div",{className:"plugin-card-actions",children:[e.enabled?s.jsx("button",{type:"button",disabled:!!r,onClick:()=>void g(`dis:${e.id}`,async()=>{await se(e.id,e.scope),d(`Disabled ${e.id}.`)}),children:"Disable"}):s.jsx("button",{type:"button",disabled:!!r,onClick:()=>void g(`en:${e.id}`,async()=>{await ee(e.id,e.scope),d(`Enabled ${e.id}.`)}),children:"Enable"}),e.hasExecutable&&e.trustState!=="trusted"&&s.jsx("button",{type:"button",disabled:!!r,onClick:()=>void G(e),children:"Trust…"}),e.hasExecutable&&e.trustState==="trusted"&&s.jsx("button",{type:"button",disabled:!!r,onClick:()=>void g(`untrust:${e.id}`,async()=>{await le(e.id,e.scope),d(`Untrusted ${e.id}.`)}),children:"Untrust"}),e.updateAvailable&&s.jsxs("button",{type:"button",disabled:!!r,onClick:()=>void M(e),children:["Update ",e.updateAvailable]}),s.jsx("button",{type:"button",className:"danger",disabled:!!r,onClick:()=>{window.confirm(`Remove plugin “${e.id}”? This deletes the install.`)&&g(`rm:${e.id}`,async()=>{await te(e.id,e.scope,!0),d(`Removed ${e.id}.`)})},children:"Remove"})]}),a&&J(e.id).length>0&&s.jsxs("div",{className:"plugin-panes",children:[s.jsx("strong",{children:"Panes"}),s.jsx("ul",{children:J(e.id).map(t=>s.jsxs("li",{children:[s.jsx("button",{type:"button",disabled:!!r,onClick:()=>void z(t),children:t.title||t.id}),s.jsxs("span",{className:"muted",children:[" ",t.mode,t.trusted?"":" · blocked",t.loadError?` · ${t.loadError}`:""]}),s.jsxs("span",{className:"muted",children:[" · ",t.provenance]})]},t.id))})]})]},`${e.scope||""}:${e.id}`))}):s.jsxs("p",{className:"muted",children:["No plugins installed. Use Install above or ",s.jsx("code",{children:"strike plugin install"}),"."]}),u&&s.jsxs("section",{className:"plugin-pane-host","aria-label":`Plugin pane ${u.id}`,children:[s.jsxs("header",{className:"plugin-pane-head",children:[s.jsxs("h3",{children:[u.title||u.id,u.status?` · ${u.status}`:""]}),s.jsx("button",{type:"button",onClick:()=>{x&&L(x).catch(()=>{}),N(null),R("")},children:"Close pane"})]}),u.error?s.jsxs("section",{className:"unavailable",role:"alert",children:[s.jsx("strong",{children:"Pane error"}),s.jsx("p",{children:u.error})]}):s.jsx("div",{className:"plugin-pane-body",children:s.jsx(Y,{node:u.view||null,feeds:u.feeds})})]})]})}export{me as PluginsPanel}; diff --git a/internal/frontend/server/static/assets/Team-B3wUXmUE.js b/internal/frontend/server/static/assets/Team-DUnnZtWp.js similarity index 99% rename from internal/frontend/server/static/assets/Team-B3wUXmUE.js rename to internal/frontend/server/static/assets/Team-DUnnZtWp.js index 520e023c..d37f7c81 100644 --- a/internal/frontend/server/static/assets/Team-B3wUXmUE.js +++ b/internal/frontend/server/static/assets/Team-DUnnZtWp.js @@ -1 +1 @@ -import{r as u,j as e,S as _,a as ne,s as le,L as ge,O as ve}from"./index-DcyMECWA.js";const ke=["team.spawn","team.message","team.broadcast","team.child_interrupt","team.task_transition","team.board_create","team.board_claim","team.board_complete"];function ye(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`tc-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function ie(n,a){return!!(n!=null&&n.includes(a))}function we(n){if(n.attachOnly)return"attach-only";if(n.teamControl===!1)return"no-capability";if(!ke.some(a=>ie(n.protocolOps,a)))return"no-ops"}function te(n){switch(n){case"attach-only":return"Attach-only / historical session — team controls are disabled.";case"no-capability":return"This server does not advertise teamControl.";case"no-ops":return"No team-control Ops are available on this connection.";default:return""}}function Ce(n,a,i,t=1){return n.some(o=>o.id===a)?n:[...n,{id:a,title:i,version:t,status:"pending"}]}function Ne(n,a,i){return n.map(t=>t.id===a?{...t,version:i||t.version+1,status:"claimed"}:t)}function Ie(n,a,i){return n.map(t=>t.id===a?{...t,version:i||t.version+1,status:"completed"}:t)}const Se=[{id:"all",label:"All"},{id:"working",label:"Working"},{id:"needs-you",label:"Needs you"},{id:"blocked",label:"Blocked"},{id:"completed",label:"Completed"},{id:"failed",label:"Failed"},{id:"hidden",label:"Terminal"}],ae=["queued","starting","working","blocked","needs_attention","completed","failed","canceled"];function k(n){return n.name||n.agent||n.sessionId.slice(0,8)}function M(n){return(n||"unknown").toLowerCase().replace(/-/g,"_")}function $e(n,a,i){const t=M(n.state),o=!!n.terminal||["completed","failed","canceled","cancelled"].includes(t);switch(a){case"all":return!o;case"working":return["running","working","starting","finalizing"].includes(t);case"needs-you":return t==="needs_attention"||t==="escalating"||!!(n.blockReason&&t.includes("need"));case"blocked":return t==="blocked"||!!n.blockReason;case"completed":return t==="completed";case"failed":return t==="failed"||t==="interrupted";case"hidden":return o;default:return!0}}function Be(n){const a=Object.values(n.members),i=n.leadId;return a.sort((t,o)=>{if(i&&t.sessionId===i)return-1;if(i&&o.sessionId===i)return 1;const p=!!t.terminal,v=!!o.terminal;return p!==v?p?1:-1:k(t).localeCompare(k(o))})}function Te(n){var i;const a=[];for(const t of Object.values(n.members)){const o=M(t.state);(o==="escalating"||o==="needs_attention")&&a.push({id:`esc-${t.sessionId}`,kind:"escalation",label:`${k(t)} needs attention`,detail:t.blockReason||t.lastAction,sessionId:t.sessionId}),(o==="blocked"||t.blockReason)&&a.push({id:`blk-${t.sessionId}`,kind:"blocked",label:`${k(t)} blocked`,detail:t.blockReason,sessionId:t.sessionId})}for(const t of n.verifications)t.passed===!1&&a.push({id:`ver-${t.sessionId||a.length}`,kind:"verification",label:"Verification failed",detail:t.summary,sessionId:t.sessionId});for(const t of n.pathOverlaps)a.push({id:`ov-${t.path}`,kind:"conflict",label:`Path overlap: ${t.path}`,detail:(i=t.sessions)==null?void 0:i.join(", ")});for(const t of n.messages)(t.urgency==="high"||t.urgency==="blocker"||t.kind==="escalation")&&a.push({id:`msg-${t.messageId||t.time||a.length}`,kind:"message",label:t.summary||t.body||"Urgent team message",detail:t.from?`from ${t.from}`:void 0,sessionId:t.to});return a.slice(0,40)}function Ae(n){const a=n.budget;if(!a||typeof a!="object")return"unknown";const i=[];for(const t of["costUSD","tokens","turns","maxCostUSD","maxTokens","stopReason"])a[t]!==void 0&&a[t]!==null&&a[t]!==""&&i.push(`${t}=${String(a[t])}`);return i.length?i.join(" · "):"unknown"}function _e({member:n,isLead:a,onOpenTranscript:i,onClose:t,verification:o,controls:p}){var w;const v=le(n.state);return e.jsxs("section",{className:"team-detail","aria-label":"Agent detail",children:[e.jsxs("header",{children:[e.jsxs("h3",{children:[k(n),a?" (lead)":""]}),e.jsx("button",{type:"button",className:"icon-btn","aria-label":"Close agent detail",onClick:t,children:"×"})]}),e.jsxs("dl",{children:[e.jsx("dt",{children:"Status"}),e.jsx("dd",{children:e.jsx(_,{kind:v,label:n.state||v})}),n.agent?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Agent"}),e.jsx("dd",{children:n.agent})]}):null,n.objective?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Objective"}),e.jsx("dd",{children:n.objective})]}):null,n.lastAction?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Latest action"}),e.jsx("dd",{children:n.lastAction})]}):null,n.queueLabel?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Queue"}),e.jsx("dd",{children:n.queueLabel})]}):null,n.blockReason?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Blocked"}),e.jsx("dd",{children:n.blockReason})]}):null,n.terminalSummary?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Summary"}),e.jsx("dd",{children:n.terminalSummary})]}):null,e.jsx("dt",{children:"Budget / stop"}),e.jsx("dd",{children:Ae(n)}),o?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Verification"}),e.jsxs("dd",{children:[o.passed===!0?"passed":o.passed===!1?"failed":"unknown",o.summary?` — ${o.summary}`:""]})]}):e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Verification"}),e.jsx("dd",{children:"unknown"})]}),(w=n.filesTouched)!=null&&w.length?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Files"}),e.jsx("dd",{children:e.jsx("ul",{className:"team-files",children:n.filesTouched.map(c=>e.jsx("li",{children:e.jsx("code",{children:c})},c))})})]}):null,e.jsx("dt",{children:"Session"}),e.jsx("dd",{children:e.jsx("code",{children:n.sessionId})})]}),i&&e.jsx("div",{className:"team-detail-actions",children:e.jsx("button",{type:"button",onClick:()=>i(n.sessionId),children:"Open transcript (RO)"})}),p]})}function Me({delegations:n,members:a,onSelectOwner:i,onTransition:t,canTransition:o,busy:p}){const w=[...u.useMemo(()=>{const c=new Map;for(const j of ae)c.set(j,[]);c.set("other",[]);for(const j of Object.values(n)){const r=M(j.state),h=ae.includes(r)?r:"other";c.get(h).push(j)}return c},[n]).entries()].filter(([,c])=>c.length>0);return w.length?e.jsx("div",{className:"team-board","aria-label":"Task board",children:w.map(([c,j])=>e.jsxs("section",{className:"team-board-col","aria-label":`${c} column`,children:[e.jsxs("h4",{children:[c.replace(/_/g," ")," ",e.jsx("span",{className:"muted",children:j.length})]}),e.jsx("ul",{children:j.map(r=>{const h=r.ownerSessionId||r.sessionId,R=h&&a[h]?k(a[h]):h==null?void 0:h.slice(0,8);return e.jsx("li",{children:e.jsxs("div",{className:"team-board-card",children:[e.jsxs("button",{type:"button",className:"team-board-card-main",onClick:()=>h&&(i==null?void 0:i(h)),children:[e.jsx("strong",{children:r.name||r.id.slice(0,10)}),e.jsx("span",{className:"muted",children:R||"unassigned"}),r.reason?e.jsx("span",{className:"team-board-reason",children:r.reason}):null,r.version!==void 0?e.jsxs("small",{children:["v",r.version]}):null]}),o&&t&&!["done","completed","failed","canceled","cancelled"].includes(M(r.state))?e.jsxs("div",{className:"team-board-actions",children:[e.jsx("button",{type:"button",disabled:p,onClick:()=>t(r,"blocked"),children:"Block"}),e.jsx("button",{type:"button",disabled:p,onClick:()=>{window.confirm(`Mark ${r.name||r.id} completed?`)&&t(r,"completed")},children:"Complete"}),e.jsx("button",{type:"button",disabled:p,onClick:()=>{window.confirm(`Cancel ${r.name||r.id}?`)&&t(r,"canceled")},children:"Cancel"})]}):null]})},r.id)})})]},c))}):e.jsx("p",{className:"muted",children:"No delegation / team-task rows yet."})}function Re({messages:n}){return n.length?e.jsx("ul",{className:"team-messages","aria-label":"Recent team messages",children:[...n].reverse().slice(0,20).map((a,i)=>e.jsxs("li",{children:[e.jsxs("strong",{children:[a.from||"?"," → ",a.to||"*"]}),a.urgency&&a.urgency!=="normal"?e.jsx(_,{kind:"needs-you",label:a.urgency}):null,e.jsx("span",{children:a.summary||a.body||"(empty)"})]},a.messageId||`${a.time}-${i}`))}):e.jsx("p",{className:"muted",children:"No team messages yet."})}function Fe(n){return n instanceof ve?n.code==="conflict"&&n.currentVersion!==void 0?`Conflict (current v${n.currentVersion}). Refresh and retry.`:n.code==="idempotency_conflict"?"Duplicate action with different payload.":n.code==="attach_only"?"Attach-only — mutations disabled.":n.code==="permission_denied"?"Permission denied.":n.message||n.code||"Operation failed":n instanceof Error?n.message:String(n)}function Oe({team:n,selectedId:a,onSelect:i,onOpenTranscript:t,readOnly:o,compact:p,protocolOps:v,teamControl:w,agents:c,rootSessionId:j,sendOp:r}){const[h,R]=u.useState("all"),[C,S]=u.useState("roster"),[F,x]=u.useState(""),[m,W]=u.useState(!1),[L,z]=u.useState(""),[K,oe]=u.useState((c==null?void 0:c[0])||"build"),[O,H]=u.useState(""),[D,re]=u.useState(!1),[U,de]=u.useState(""),[$,Q]=u.useState(""),[G,J]=u.useState(""),[V,X]=u.useState(""),[Y,q]=u.useState([]),E=u.useRef(new Set),B=u.useMemo(()=>Be(n),[n]),Z=u.useMemo(()=>B.filter(s=>$e(s,h,n.leadId)),[B,h,n.leadId]),P=u.useMemo(()=>Te(n),[n]),f=a?n.members[a]:void 0,ce=f?[...n.verifications].reverse().find(s=>s.sessionId===f.sessionId):void 0,N=we({attachOnly:o,teamControl:w,protocolOps:v}),T=!!(r&&!N&&!o),b=u.useCallback(s=>T&&ie(v,s),[T,v]),y=u.useCallback(async(s,l,d)=>{if(!r||!b(l))return x(te(N)||"Control unavailable"),null;if(E.current.has(s))return x("Already in flight — wait for the previous request."),null;E.current.add(s),W(!0),x("");const g=ye(),A={...d,idempotencyKey:g,...j?{rootSessionId:j}:{}};try{const I=await r(l,A);return x(I.ok?"OK":I.error||"done"),I}catch(I){return x(Fe(I)),null}finally{E.current.delete(s),W(!1)}},[r,b,N,j]),ue=async()=>{const s=L.trim();if(!s){x("Objective is required");return}const l={objective:s,agent:K||void 0};if(O.trim()&&(l.name=O.trim()),D&&U.trim()){const g=Number(U);Number.isFinite(g)&&g>0&&(l.budget={maxTurns:g})}const d=await y("spawn","team.spawn",l);d!=null&&d.ok&&(z(""),H(""),x(d.childSessionId?`Spawned ${d.childSessionId.slice(0,8)}`:"Spawned"))},ee=async s=>{const l=$.trim();if(!l){x("Message body is required");return}if(s)await y("broadcast","team.broadcast",{body:l});else{const d=(G||a||"").trim();if(!d){x("Select a target agent");return}await y(`msg-${d}`,"team.message",{to:d,body:l,kind:"message"})}Q("")},me=async s=>{const l=n.members[s],d=l?k(l):s.slice(0,8);window.confirm(`Interrupt ${d}? Active work will be canceled.`)&&await y(`intr-${s}`,"team.child_interrupt",{childSessionId:s,reason:"human interrupt"})},he=async(s,l)=>{!await y(`tr-${s.id}-${l}`,"team.task_transition",{delegationId:s.id,expectedVersion:s.version??0,toState:l})&&F.includes("Conflict")&&x(g=>`${g} — reload team snapshot.`)},be=async()=>{const s=V.trim();if(!s){x("Board title is required");return}const l=await y("board-create","team.board_create",{title:s});l!=null&&l.ok&&l.taskId&&(q(d=>Ce(d,l.taskId,s,l.version||1)),X(""))},je=async s=>{const l=await y(`claim-${s.id}`,"team.board_claim",{taskId:s.id,expectedVersion:s.version});l!=null&&l.ok&&q(d=>Ne(d,s.id,l.version||s.version+1))},pe=async s=>{if(!window.confirm(`Complete board task ${s.title}?`))return;const l=await y(`complete-${s.id}`,"team.board_complete",{taskId:s.id,expectedVersion:s.version});l!=null&&l.ok&&q(d=>Ie(d,s.id,l.version||s.version+1))};if(!n.available)return e.jsxs("section",{className:"team-workspace","aria-label":"Team workspace",children:[e.jsx("h2",{children:"Team"}),e.jsx("p",{className:"muted",role:"status",children:n.unavailableReason||"Team observation unavailable"}),o?e.jsx("p",{className:"muted",children:"Read-only — historical / attach-only best replayable state when present."}):null]});const se=B.length>0||Object.keys(n.delegations).length>0,xe=["roster","board","messages",...T||N?["controls"]:[]],fe=f&&!f.terminal&&f.sessionId!==n.leadId&&b("team.child_interrupt")?e.jsxs("div",{className:"team-detail-actions team-controls-inline","aria-label":"Agent controls",children:[e.jsx("button",{type:"button",disabled:m,onClick:()=>void me(f.sessionId),children:"Interrupt"}),b("team.message")?e.jsx("button",{type:"button",disabled:m,onClick:()=>{J(f.sessionId),S("controls")},children:"Message"}):null]}):null;return e.jsxs("section",{className:`team-workspace ${p?"compact":""}`,"aria-label":"Team workspace",children:[e.jsxs("header",{className:"team-workspace-head",children:[e.jsx("h2",{children:"Team"}),o?e.jsx(_,{kind:"idle",label:"read-only"}):null,T?e.jsx(_,{kind:"busy",label:"controls"}):null]}),F?e.jsx("p",{className:"team-control-status",role:"status",children:F}):null,P.length>0&&e.jsxs("div",{className:"team-attention","aria-label":"Team attention",children:[e.jsxs("button",{type:"button",className:"team-attention-entry",onClick:()=>S("attention"),children:["Attention · ",P.length]}),C==="attention"&&e.jsx("ul",{children:P.map(s=>e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>{s.sessionId&&i(s.sessionId)},children:[e.jsx(ne,{kind:s.kind==="verification"||s.kind==="conflict"?"failed":"needs-you",label:s.kind}),e.jsxs("span",{children:[e.jsx("strong",{children:s.label}),s.detail?e.jsx("small",{children:s.detail}):null]})]})},s.id))})]}),e.jsx("div",{className:"team-view-tabs",role:"toolbar","aria-label":"Team views",children:xe.map(s=>e.jsx("button",{type:"button","aria-pressed":C===s,className:C===s?"active":"",onClick:()=>S(s),children:s},s))}),se?null:e.jsx("p",{className:"muted",children:"No child or team activity yet. Team stays available for explicit navigation."}),C==="roster"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"team-filters",role:"toolbar","aria-label":"Roster filters",children:Se.map(s=>e.jsx("button",{type:"button","aria-pressed":h===s.id,className:h===s.id?"active":"",onClick:()=>R(s.id),children:s.label},s.id))}),e.jsx("ul",{className:"team-roster",role:"list","aria-label":"Agent roster",children:Z.map(s=>{var A;const l=s.sessionId===a,d=s.sessionId===n.leadId||s.role==="lead",g=le(s.state);return e.jsx("li",{children:e.jsx(ge,{active:l,onClick:()=>i(l?void 0:s.sessionId),leading:e.jsx(ne,{kind:g,label:s.state||g}),title:`${k(s)}${d?" · lead":""}`,meta:[s.state,s.lastAction||s.queueLabel||s.blockReason,(A=s.filesTouched)!=null&&A.length?`${s.filesTouched.length} files`:""].filter(Boolean).join(" · ")})},s.sessionId)})}),!Z.length&&se?e.jsx("p",{className:"muted",children:"No agents match this filter."}):null]}),C==="board"&&e.jsx(Me,{delegations:n.delegations,members:n.members,canTransition:b("team.task_transition"),busy:m,onTransition:(s,l)=>void he(s,l),onSelectOwner:s=>{i(s),S("roster")}}),C==="messages"&&e.jsx(Re,{messages:n.messages}),C==="controls"&&e.jsx("section",{className:"team-controls","aria-label":"Team controls",children:N?e.jsx("p",{className:"muted",role:"status",children:te(N)}):e.jsxs(e.Fragment,{children:[b("team.spawn")&&e.jsxs("fieldset",{className:"team-control-block",children:[e.jsx("legend",{children:"Spawn agent"}),e.jsxs("label",{children:["Objective",e.jsx("textarea",{value:L,onChange:s=>z(s.target.value),rows:p?2:3,placeholder:"What should the child do?",disabled:m})]}),e.jsxs("label",{children:["Agent",e.jsx("select",{value:K,onChange:s=>oe(s.target.value),disabled:m,children:(c!=null&&c.length?c:["build","explore","general"]).map(s=>e.jsx("option",{value:s,children:s},s))})]}),e.jsx("button",{type:"button",className:"linkish",onClick:()=>re(s=>!s),children:D?"Hide advanced":"Advanced…"}),D&&e.jsxs("div",{className:"team-control-advanced",children:[e.jsxs("label",{children:["Alias",e.jsx("input",{value:O,onChange:s=>H(s.target.value),disabled:m})]}),e.jsxs("label",{children:["Max turns",e.jsx("input",{value:U,onChange:s=>de(s.target.value),inputMode:"numeric",disabled:m})]})]}),e.jsx("button",{type:"button",className:"primary",disabled:m||!L.trim(),onClick:()=>void ue(),children:"Spawn"})]}),(b("team.message")||b("team.broadcast"))&&e.jsxs("fieldset",{className:"team-control-block",children:[e.jsx("legend",{children:"Message"}),e.jsxs("label",{children:["To (session id)",e.jsx("input",{value:G,onChange:s=>J(s.target.value),placeholder:a||"child session id",disabled:m,list:"team-member-ids"}),e.jsx("datalist",{id:"team-member-ids",children:B.map(s=>e.jsx("option",{value:s.sessionId,children:k(s)},s.sessionId))})]}),e.jsxs("label",{children:["Body",e.jsx("textarea",{value:$,onChange:s=>Q(s.target.value),rows:2,disabled:m})]}),e.jsxs("div",{className:"team-control-row",children:[b("team.message")?e.jsx("button",{type:"button",disabled:m||!$.trim(),onClick:()=>void ee(!1),children:"Send"}):null,b("team.broadcast")?e.jsx("button",{type:"button",disabled:m||!$.trim(),onClick:()=>void ee(!0),children:"Broadcast"}):null]})]}),b("team.board_create")&&e.jsxs("fieldset",{className:"team-control-block",children:[e.jsx("legend",{children:"Board task"}),e.jsxs("label",{children:["Title",e.jsx("input",{value:V,onChange:s=>X(s.target.value),disabled:m})]}),e.jsx("button",{type:"button",disabled:m||!V.trim(),onClick:()=>void be(),children:"Create"}),Y.length>0&&e.jsx("ul",{className:"team-local-board","aria-label":"Local board tasks",children:Y.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:s.title}),e.jsxs("span",{className:"muted",children:[s.status," · v",s.version," · ",s.id]}),e.jsxs("div",{className:"team-control-row",children:[b("team.board_claim")&&s.status==="pending"?e.jsx("button",{type:"button",disabled:m,onClick:()=>void je(s),children:"Claim"}):null,b("team.board_complete")&&s.status!=="completed"?e.jsx("button",{type:"button",disabled:m,onClick:()=>void pe(s),children:"Complete"}):null]})]},s.id))})]}),e.jsxs("p",{className:"muted",children:["Root ",e.jsx("code",{children:j||n.leadId||"—"}),". Outcomes apply via live events; no second client store."]})]})}),f&&e.jsx(_e,{member:f,isLead:f.sessionId===n.leadId,onClose:()=>i(void 0),onOpenTranscript:t,verification:ce,controls:fe})]})}export{Oe as TeamWorkspace,Be as orderedMembers,Te as teamAttentionItems}; +import{r as u,j as e,S as _,a as ne,s as le,L as ge,O as ve}from"./index-BK8GKzWA.js";const ke=["team.spawn","team.message","team.broadcast","team.child_interrupt","team.task_transition","team.board_create","team.board_claim","team.board_complete"];function ye(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`tc-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function ie(n,a){return!!(n!=null&&n.includes(a))}function we(n){if(n.attachOnly)return"attach-only";if(n.teamControl===!1)return"no-capability";if(!ke.some(a=>ie(n.protocolOps,a)))return"no-ops"}function te(n){switch(n){case"attach-only":return"Attach-only / historical session — team controls are disabled.";case"no-capability":return"This server does not advertise teamControl.";case"no-ops":return"No team-control Ops are available on this connection.";default:return""}}function Ce(n,a,i,t=1){return n.some(o=>o.id===a)?n:[...n,{id:a,title:i,version:t,status:"pending"}]}function Ne(n,a,i){return n.map(t=>t.id===a?{...t,version:i||t.version+1,status:"claimed"}:t)}function Ie(n,a,i){return n.map(t=>t.id===a?{...t,version:i||t.version+1,status:"completed"}:t)}const Se=[{id:"all",label:"All"},{id:"working",label:"Working"},{id:"needs-you",label:"Needs you"},{id:"blocked",label:"Blocked"},{id:"completed",label:"Completed"},{id:"failed",label:"Failed"},{id:"hidden",label:"Terminal"}],ae=["queued","starting","working","blocked","needs_attention","completed","failed","canceled"];function k(n){return n.name||n.agent||n.sessionId.slice(0,8)}function M(n){return(n||"unknown").toLowerCase().replace(/-/g,"_")}function $e(n,a,i){const t=M(n.state),o=!!n.terminal||["completed","failed","canceled","cancelled"].includes(t);switch(a){case"all":return!o;case"working":return["running","working","starting","finalizing"].includes(t);case"needs-you":return t==="needs_attention"||t==="escalating"||!!(n.blockReason&&t.includes("need"));case"blocked":return t==="blocked"||!!n.blockReason;case"completed":return t==="completed";case"failed":return t==="failed"||t==="interrupted";case"hidden":return o;default:return!0}}function Be(n){const a=Object.values(n.members),i=n.leadId;return a.sort((t,o)=>{if(i&&t.sessionId===i)return-1;if(i&&o.sessionId===i)return 1;const p=!!t.terminal,v=!!o.terminal;return p!==v?p?1:-1:k(t).localeCompare(k(o))})}function Te(n){var i;const a=[];for(const t of Object.values(n.members)){const o=M(t.state);(o==="escalating"||o==="needs_attention")&&a.push({id:`esc-${t.sessionId}`,kind:"escalation",label:`${k(t)} needs attention`,detail:t.blockReason||t.lastAction,sessionId:t.sessionId}),(o==="blocked"||t.blockReason)&&a.push({id:`blk-${t.sessionId}`,kind:"blocked",label:`${k(t)} blocked`,detail:t.blockReason,sessionId:t.sessionId})}for(const t of n.verifications)t.passed===!1&&a.push({id:`ver-${t.sessionId||a.length}`,kind:"verification",label:"Verification failed",detail:t.summary,sessionId:t.sessionId});for(const t of n.pathOverlaps)a.push({id:`ov-${t.path}`,kind:"conflict",label:`Path overlap: ${t.path}`,detail:(i=t.sessions)==null?void 0:i.join(", ")});for(const t of n.messages)(t.urgency==="high"||t.urgency==="blocker"||t.kind==="escalation")&&a.push({id:`msg-${t.messageId||t.time||a.length}`,kind:"message",label:t.summary||t.body||"Urgent team message",detail:t.from?`from ${t.from}`:void 0,sessionId:t.to});return a.slice(0,40)}function Ae(n){const a=n.budget;if(!a||typeof a!="object")return"unknown";const i=[];for(const t of["costUSD","tokens","turns","maxCostUSD","maxTokens","stopReason"])a[t]!==void 0&&a[t]!==null&&a[t]!==""&&i.push(`${t}=${String(a[t])}`);return i.length?i.join(" · "):"unknown"}function _e({member:n,isLead:a,onOpenTranscript:i,onClose:t,verification:o,controls:p}){var w;const v=le(n.state);return e.jsxs("section",{className:"team-detail","aria-label":"Agent detail",children:[e.jsxs("header",{children:[e.jsxs("h3",{children:[k(n),a?" (lead)":""]}),e.jsx("button",{type:"button",className:"icon-btn","aria-label":"Close agent detail",onClick:t,children:"×"})]}),e.jsxs("dl",{children:[e.jsx("dt",{children:"Status"}),e.jsx("dd",{children:e.jsx(_,{kind:v,label:n.state||v})}),n.agent?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Agent"}),e.jsx("dd",{children:n.agent})]}):null,n.objective?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Objective"}),e.jsx("dd",{children:n.objective})]}):null,n.lastAction?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Latest action"}),e.jsx("dd",{children:n.lastAction})]}):null,n.queueLabel?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Queue"}),e.jsx("dd",{children:n.queueLabel})]}):null,n.blockReason?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Blocked"}),e.jsx("dd",{children:n.blockReason})]}):null,n.terminalSummary?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Summary"}),e.jsx("dd",{children:n.terminalSummary})]}):null,e.jsx("dt",{children:"Budget / stop"}),e.jsx("dd",{children:Ae(n)}),o?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Verification"}),e.jsxs("dd",{children:[o.passed===!0?"passed":o.passed===!1?"failed":"unknown",o.summary?` — ${o.summary}`:""]})]}):e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Verification"}),e.jsx("dd",{children:"unknown"})]}),(w=n.filesTouched)!=null&&w.length?e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Files"}),e.jsx("dd",{children:e.jsx("ul",{className:"team-files",children:n.filesTouched.map(c=>e.jsx("li",{children:e.jsx("code",{children:c})},c))})})]}):null,e.jsx("dt",{children:"Session"}),e.jsx("dd",{children:e.jsx("code",{children:n.sessionId})})]}),i&&e.jsx("div",{className:"team-detail-actions",children:e.jsx("button",{type:"button",onClick:()=>i(n.sessionId),children:"Open transcript (RO)"})}),p]})}function Me({delegations:n,members:a,onSelectOwner:i,onTransition:t,canTransition:o,busy:p}){const w=[...u.useMemo(()=>{const c=new Map;for(const j of ae)c.set(j,[]);c.set("other",[]);for(const j of Object.values(n)){const r=M(j.state),h=ae.includes(r)?r:"other";c.get(h).push(j)}return c},[n]).entries()].filter(([,c])=>c.length>0);return w.length?e.jsx("div",{className:"team-board","aria-label":"Task board",children:w.map(([c,j])=>e.jsxs("section",{className:"team-board-col","aria-label":`${c} column`,children:[e.jsxs("h4",{children:[c.replace(/_/g," ")," ",e.jsx("span",{className:"muted",children:j.length})]}),e.jsx("ul",{children:j.map(r=>{const h=r.ownerSessionId||r.sessionId,R=h&&a[h]?k(a[h]):h==null?void 0:h.slice(0,8);return e.jsx("li",{children:e.jsxs("div",{className:"team-board-card",children:[e.jsxs("button",{type:"button",className:"team-board-card-main",onClick:()=>h&&(i==null?void 0:i(h)),children:[e.jsx("strong",{children:r.name||r.id.slice(0,10)}),e.jsx("span",{className:"muted",children:R||"unassigned"}),r.reason?e.jsx("span",{className:"team-board-reason",children:r.reason}):null,r.version!==void 0?e.jsxs("small",{children:["v",r.version]}):null]}),o&&t&&!["done","completed","failed","canceled","cancelled"].includes(M(r.state))?e.jsxs("div",{className:"team-board-actions",children:[e.jsx("button",{type:"button",disabled:p,onClick:()=>t(r,"blocked"),children:"Block"}),e.jsx("button",{type:"button",disabled:p,onClick:()=>{window.confirm(`Mark ${r.name||r.id} completed?`)&&t(r,"completed")},children:"Complete"}),e.jsx("button",{type:"button",disabled:p,onClick:()=>{window.confirm(`Cancel ${r.name||r.id}?`)&&t(r,"canceled")},children:"Cancel"})]}):null]})},r.id)})})]},c))}):e.jsx("p",{className:"muted",children:"No delegation / team-task rows yet."})}function Re({messages:n}){return n.length?e.jsx("ul",{className:"team-messages","aria-label":"Recent team messages",children:[...n].reverse().slice(0,20).map((a,i)=>e.jsxs("li",{children:[e.jsxs("strong",{children:[a.from||"?"," → ",a.to||"*"]}),a.urgency&&a.urgency!=="normal"?e.jsx(_,{kind:"needs-you",label:a.urgency}):null,e.jsx("span",{children:a.summary||a.body||"(empty)"})]},a.messageId||`${a.time}-${i}`))}):e.jsx("p",{className:"muted",children:"No team messages yet."})}function Fe(n){return n instanceof ve?n.code==="conflict"&&n.currentVersion!==void 0?`Conflict (current v${n.currentVersion}). Refresh and retry.`:n.code==="idempotency_conflict"?"Duplicate action with different payload.":n.code==="attach_only"?"Attach-only — mutations disabled.":n.code==="permission_denied"?"Permission denied.":n.message||n.code||"Operation failed":n instanceof Error?n.message:String(n)}function Oe({team:n,selectedId:a,onSelect:i,onOpenTranscript:t,readOnly:o,compact:p,protocolOps:v,teamControl:w,agents:c,rootSessionId:j,sendOp:r}){const[h,R]=u.useState("all"),[C,S]=u.useState("roster"),[F,x]=u.useState(""),[m,W]=u.useState(!1),[L,z]=u.useState(""),[K,oe]=u.useState((c==null?void 0:c[0])||"build"),[O,H]=u.useState(""),[D,re]=u.useState(!1),[U,de]=u.useState(""),[$,Q]=u.useState(""),[G,J]=u.useState(""),[V,X]=u.useState(""),[Y,q]=u.useState([]),E=u.useRef(new Set),B=u.useMemo(()=>Be(n),[n]),Z=u.useMemo(()=>B.filter(s=>$e(s,h,n.leadId)),[B,h,n.leadId]),P=u.useMemo(()=>Te(n),[n]),f=a?n.members[a]:void 0,ce=f?[...n.verifications].reverse().find(s=>s.sessionId===f.sessionId):void 0,N=we({attachOnly:o,teamControl:w,protocolOps:v}),T=!!(r&&!N&&!o),b=u.useCallback(s=>T&&ie(v,s),[T,v]),y=u.useCallback(async(s,l,d)=>{if(!r||!b(l))return x(te(N)||"Control unavailable"),null;if(E.current.has(s))return x("Already in flight — wait for the previous request."),null;E.current.add(s),W(!0),x("");const g=ye(),A={...d,idempotencyKey:g,...j?{rootSessionId:j}:{}};try{const I=await r(l,A);return x(I.ok?"OK":I.error||"done"),I}catch(I){return x(Fe(I)),null}finally{E.current.delete(s),W(!1)}},[r,b,N,j]),ue=async()=>{const s=L.trim();if(!s){x("Objective is required");return}const l={objective:s,agent:K||void 0};if(O.trim()&&(l.name=O.trim()),D&&U.trim()){const g=Number(U);Number.isFinite(g)&&g>0&&(l.budget={maxTurns:g})}const d=await y("spawn","team.spawn",l);d!=null&&d.ok&&(z(""),H(""),x(d.childSessionId?`Spawned ${d.childSessionId.slice(0,8)}`:"Spawned"))},ee=async s=>{const l=$.trim();if(!l){x("Message body is required");return}if(s)await y("broadcast","team.broadcast",{body:l});else{const d=(G||a||"").trim();if(!d){x("Select a target agent");return}await y(`msg-${d}`,"team.message",{to:d,body:l,kind:"message"})}Q("")},me=async s=>{const l=n.members[s],d=l?k(l):s.slice(0,8);window.confirm(`Interrupt ${d}? Active work will be canceled.`)&&await y(`intr-${s}`,"team.child_interrupt",{childSessionId:s,reason:"human interrupt"})},he=async(s,l)=>{!await y(`tr-${s.id}-${l}`,"team.task_transition",{delegationId:s.id,expectedVersion:s.version??0,toState:l})&&F.includes("Conflict")&&x(g=>`${g} — reload team snapshot.`)},be=async()=>{const s=V.trim();if(!s){x("Board title is required");return}const l=await y("board-create","team.board_create",{title:s});l!=null&&l.ok&&l.taskId&&(q(d=>Ce(d,l.taskId,s,l.version||1)),X(""))},je=async s=>{const l=await y(`claim-${s.id}`,"team.board_claim",{taskId:s.id,expectedVersion:s.version});l!=null&&l.ok&&q(d=>Ne(d,s.id,l.version||s.version+1))},pe=async s=>{if(!window.confirm(`Complete board task ${s.title}?`))return;const l=await y(`complete-${s.id}`,"team.board_complete",{taskId:s.id,expectedVersion:s.version});l!=null&&l.ok&&q(d=>Ie(d,s.id,l.version||s.version+1))};if(!n.available)return e.jsxs("section",{className:"team-workspace","aria-label":"Team workspace",children:[e.jsx("h2",{children:"Team"}),e.jsx("p",{className:"muted",role:"status",children:n.unavailableReason||"Team observation unavailable"}),o?e.jsx("p",{className:"muted",children:"Read-only — historical / attach-only best replayable state when present."}):null]});const se=B.length>0||Object.keys(n.delegations).length>0,xe=["roster","board","messages",...T||N?["controls"]:[]],fe=f&&!f.terminal&&f.sessionId!==n.leadId&&b("team.child_interrupt")?e.jsxs("div",{className:"team-detail-actions team-controls-inline","aria-label":"Agent controls",children:[e.jsx("button",{type:"button",disabled:m,onClick:()=>void me(f.sessionId),children:"Interrupt"}),b("team.message")?e.jsx("button",{type:"button",disabled:m,onClick:()=>{J(f.sessionId),S("controls")},children:"Message"}):null]}):null;return e.jsxs("section",{className:`team-workspace ${p?"compact":""}`,"aria-label":"Team workspace",children:[e.jsxs("header",{className:"team-workspace-head",children:[e.jsx("h2",{children:"Team"}),o?e.jsx(_,{kind:"idle",label:"read-only"}):null,T?e.jsx(_,{kind:"busy",label:"controls"}):null]}),F?e.jsx("p",{className:"team-control-status",role:"status",children:F}):null,P.length>0&&e.jsxs("div",{className:"team-attention","aria-label":"Team attention",children:[e.jsxs("button",{type:"button",className:"team-attention-entry",onClick:()=>S("attention"),children:["Attention · ",P.length]}),C==="attention"&&e.jsx("ul",{children:P.map(s=>e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>{s.sessionId&&i(s.sessionId)},children:[e.jsx(ne,{kind:s.kind==="verification"||s.kind==="conflict"?"failed":"needs-you",label:s.kind}),e.jsxs("span",{children:[e.jsx("strong",{children:s.label}),s.detail?e.jsx("small",{children:s.detail}):null]})]})},s.id))})]}),e.jsx("div",{className:"team-view-tabs",role:"toolbar","aria-label":"Team views",children:xe.map(s=>e.jsx("button",{type:"button","aria-pressed":C===s,className:C===s?"active":"",onClick:()=>S(s),children:s},s))}),se?null:e.jsx("p",{className:"muted",children:"No child or team activity yet. Team stays available for explicit navigation."}),C==="roster"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"team-filters",role:"toolbar","aria-label":"Roster filters",children:Se.map(s=>e.jsx("button",{type:"button","aria-pressed":h===s.id,className:h===s.id?"active":"",onClick:()=>R(s.id),children:s.label},s.id))}),e.jsx("ul",{className:"team-roster",role:"list","aria-label":"Agent roster",children:Z.map(s=>{var A;const l=s.sessionId===a,d=s.sessionId===n.leadId||s.role==="lead",g=le(s.state);return e.jsx("li",{children:e.jsx(ge,{active:l,onClick:()=>i(l?void 0:s.sessionId),leading:e.jsx(ne,{kind:g,label:s.state||g}),title:`${k(s)}${d?" · lead":""}`,meta:[s.state,s.lastAction||s.queueLabel||s.blockReason,(A=s.filesTouched)!=null&&A.length?`${s.filesTouched.length} files`:""].filter(Boolean).join(" · ")})},s.sessionId)})}),!Z.length&&se?e.jsx("p",{className:"muted",children:"No agents match this filter."}):null]}),C==="board"&&e.jsx(Me,{delegations:n.delegations,members:n.members,canTransition:b("team.task_transition"),busy:m,onTransition:(s,l)=>void he(s,l),onSelectOwner:s=>{i(s),S("roster")}}),C==="messages"&&e.jsx(Re,{messages:n.messages}),C==="controls"&&e.jsx("section",{className:"team-controls","aria-label":"Team controls",children:N?e.jsx("p",{className:"muted",role:"status",children:te(N)}):e.jsxs(e.Fragment,{children:[b("team.spawn")&&e.jsxs("fieldset",{className:"team-control-block",children:[e.jsx("legend",{children:"Spawn agent"}),e.jsxs("label",{children:["Objective",e.jsx("textarea",{value:L,onChange:s=>z(s.target.value),rows:p?2:3,placeholder:"What should the child do?",disabled:m})]}),e.jsxs("label",{children:["Agent",e.jsx("select",{value:K,onChange:s=>oe(s.target.value),disabled:m,children:(c!=null&&c.length?c:["build","explore","general"]).map(s=>e.jsx("option",{value:s,children:s},s))})]}),e.jsx("button",{type:"button",className:"linkish",onClick:()=>re(s=>!s),children:D?"Hide advanced":"Advanced…"}),D&&e.jsxs("div",{className:"team-control-advanced",children:[e.jsxs("label",{children:["Alias",e.jsx("input",{value:O,onChange:s=>H(s.target.value),disabled:m})]}),e.jsxs("label",{children:["Max turns",e.jsx("input",{value:U,onChange:s=>de(s.target.value),inputMode:"numeric",disabled:m})]})]}),e.jsx("button",{type:"button",className:"primary",disabled:m||!L.trim(),onClick:()=>void ue(),children:"Spawn"})]}),(b("team.message")||b("team.broadcast"))&&e.jsxs("fieldset",{className:"team-control-block",children:[e.jsx("legend",{children:"Message"}),e.jsxs("label",{children:["To (session id)",e.jsx("input",{value:G,onChange:s=>J(s.target.value),placeholder:a||"child session id",disabled:m,list:"team-member-ids"}),e.jsx("datalist",{id:"team-member-ids",children:B.map(s=>e.jsx("option",{value:s.sessionId,children:k(s)},s.sessionId))})]}),e.jsxs("label",{children:["Body",e.jsx("textarea",{value:$,onChange:s=>Q(s.target.value),rows:2,disabled:m})]}),e.jsxs("div",{className:"team-control-row",children:[b("team.message")?e.jsx("button",{type:"button",disabled:m||!$.trim(),onClick:()=>void ee(!1),children:"Send"}):null,b("team.broadcast")?e.jsx("button",{type:"button",disabled:m||!$.trim(),onClick:()=>void ee(!0),children:"Broadcast"}):null]})]}),b("team.board_create")&&e.jsxs("fieldset",{className:"team-control-block",children:[e.jsx("legend",{children:"Board task"}),e.jsxs("label",{children:["Title",e.jsx("input",{value:V,onChange:s=>X(s.target.value),disabled:m})]}),e.jsx("button",{type:"button",disabled:m||!V.trim(),onClick:()=>void be(),children:"Create"}),Y.length>0&&e.jsx("ul",{className:"team-local-board","aria-label":"Local board tasks",children:Y.map(s=>e.jsxs("li",{children:[e.jsx("strong",{children:s.title}),e.jsxs("span",{className:"muted",children:[s.status," · v",s.version," · ",s.id]}),e.jsxs("div",{className:"team-control-row",children:[b("team.board_claim")&&s.status==="pending"?e.jsx("button",{type:"button",disabled:m,onClick:()=>void je(s),children:"Claim"}):null,b("team.board_complete")&&s.status!=="completed"?e.jsx("button",{type:"button",disabled:m,onClick:()=>void pe(s),children:"Complete"}):null]})]},s.id))})]}),e.jsxs("p",{className:"muted",children:["Root ",e.jsx("code",{children:j||n.leadId||"—"}),". Outcomes apply via live events; no second client store."]})]})}),f&&e.jsx(_e,{member:f,isLead:f.sessionId===n.leadId,onClose:()=>i(void 0),onOpenTranscript:t,verification:ce,controls:fe})]})}export{Oe as TeamWorkspace,Be as orderedMembers,Te as teamAttentionItems}; diff --git a/internal/frontend/server/static/assets/Timeline-pMCBJIX_.js b/internal/frontend/server/static/assets/Timeline-BA5GlsNC.js similarity index 98% rename from internal/frontend/server/static/assets/Timeline-pMCBJIX_.js rename to internal/frontend/server/static/assets/Timeline-BA5GlsNC.js index df80b9a4..4bd6215e 100644 --- a/internal/frontend/server/static/assets/Timeline-pMCBJIX_.js +++ b/internal/frontend/server/static/assets/Timeline-BA5GlsNC.js @@ -1 +1 @@ -import{b as y,r as h,j as e}from"./index-DcyMECWA.js";const g=n=>y(`/v1/sessions/${encodeURIComponent(n)}/timeline`);async function k(n,t="json"){const r=`/v1/sessions/${encodeURIComponent(n)}/timeline/export?format=${t}`,a=await fetch(r,{credentials:"same-origin"});if(!a.ok){const i=await a.json().catch(()=>null);throw new Error((i==null?void 0:i.error)||`${a.status} ${a.statusText}`)}const m=await a.blob(),x=a.headers.get("Content-Disposition")||"",d=/filename="([^"]+)"/.exec(x),o=(d==null?void 0:d[1])||`strike-timeline.${t==="jsonl"?"jsonl":"json"}`,c=URL.createObjectURL(m);try{const i=document.createElement("a");i.href=c,i.download=o,i.rel="noopener",document.body.appendChild(i),i.click(),i.remove()}finally{URL.revokeObjectURL(c)}}function b(n){return n==null||Number.isNaN(n)?"":n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${(n/6e4).toFixed(1)}m`}function u(n){const t=(n||"").trim();return t?t.length<=10?t:t.slice(0,10):"—"}function N(n){return n.name?`${n.kind}:${n.name}`:n.kind}function w(n){switch(n.kind){case"turn":return u(n.turnId);case"tool":return u(n.callId);case"provider":return u(n.providerRequestId);case"child":return u(n.childSessionId);case"permission":return u(n.callId);case"verify":return u(n.turnId||n.id);default:return u(n.id)}}function C({available:n,sessionID:t}){const[r,a]=h.useState(),[m,x]=h.useState(!1),[d,o]=h.useState(""),[c,i]=h.useState(""),j=h.useCallback(async()=>{if(!(!n||!t)){x(!0),o("");try{a(await g(t))}catch(s){a(void 0),o(s.message||"timeline unavailable")}finally{x(!1)}}},[n,t]);h.useEffect(()=>{a(void 0),o(""),!(!n||!t)&&j()},[n,t,j]);const p=async s=>{if(t){i(s),o("");try{await k(t,s)}catch(v){o(v.message||"export failed")}finally{i("")}}};if(!n)return e.jsxs("section",{className:"unavailable",role:"status",children:[e.jsx("strong",{children:"Timeline unavailable"}),e.jsx("p",{children:"The configured host did not provide this capability. No action was attempted."})]});if(!t)return e.jsx("p",{className:"muted",children:"Select a session to inspect its run timeline."});const l=r==null?void 0:r.summary,f=(r==null?void 0:r.entries)||[];return e.jsxs("div",{className:"timeline-panel",children:[e.jsxs("div",{className:"timeline-head",children:[e.jsx("h2",{children:"Run timeline"}),e.jsxs("div",{className:"timeline-actions",children:[e.jsx("button",{type:"button",onClick:()=>void j(),disabled:m,children:m?"Loading…":r?"Refresh":"Load"}),e.jsx("button",{type:"button",onClick:()=>void p("json"),disabled:!t||c!=="",children:c==="json"?"…":"Export JSON"}),e.jsx("button",{type:"button",onClick:()=>void p("jsonl"),disabled:!t||c!=="",children:c==="jsonl"?"…":"Export JSONL"})]})]}),e.jsx("p",{className:"muted",children:"Collapsed harness spans (turns/tools/provider/children). Complements the transcript; exports are secret-redacted."}),d&&e.jsxs("section",{className:"unavailable",role:"status",children:[e.jsx("strong",{children:"Unable to load"}),e.jsx("p",{children:d})]}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:"timeline-summary","aria-label":"Timeline summary",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Turns"}),e.jsx("dd",{children:(l==null?void 0:l.turns)??0})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Tools"}),e.jsx("dd",{children:(l==null?void 0:l.tools)??0})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Failed"}),e.jsx("dd",{children:(l==null?void 0:l.failed)??0})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Duration"}),e.jsx("dd",{children:b(l==null?void 0:l.durationMs)||"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Redacted"}),e.jsx("dd",{children:r.redacted?"yes":"no"})]})]}),f.length===0?e.jsx("p",{className:"muted",children:"No timeline entries yet — run a turn first."}):e.jsx("ol",{className:"timeline-list","aria-label":"Timeline entries",children:f.map(s=>e.jsxs("li",{className:`timeline-entry state-${s.state||"unknown"}`,children:[e.jsx("span",{className:`timeline-state state-${s.state||"unknown"}`,children:s.state||"?"}),e.jsx("span",{className:"timeline-label",title:N(s),children:N(s)}),e.jsx("code",{className:"timeline-id",children:w(s)}),e.jsx("span",{className:"timeline-dur",children:b(s.durationMs)}),s.errorCode&&e.jsx("span",{className:"timeline-code",children:s.errorCode}),s.error&&e.jsx("span",{className:"timeline-err",title:s.error,children:s.error})]},s.id))})]}),!r&&!m&&!d&&e.jsx("p",{className:"muted",children:"Load the collapsed run timeline for the selected session."})]})}export{C as TimelinePanel}; +import{b as y,r as h,j as e}from"./index-BK8GKzWA.js";const g=n=>y(`/v1/sessions/${encodeURIComponent(n)}/timeline`);async function k(n,t="json"){const r=`/v1/sessions/${encodeURIComponent(n)}/timeline/export?format=${t}`,a=await fetch(r,{credentials:"same-origin"});if(!a.ok){const i=await a.json().catch(()=>null);throw new Error((i==null?void 0:i.error)||`${a.status} ${a.statusText}`)}const m=await a.blob(),x=a.headers.get("Content-Disposition")||"",d=/filename="([^"]+)"/.exec(x),o=(d==null?void 0:d[1])||`strike-timeline.${t==="jsonl"?"jsonl":"json"}`,c=URL.createObjectURL(m);try{const i=document.createElement("a");i.href=c,i.download=o,i.rel="noopener",document.body.appendChild(i),i.click(),i.remove()}finally{URL.revokeObjectURL(c)}}function b(n){return n==null||Number.isNaN(n)?"":n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:`${(n/6e4).toFixed(1)}m`}function u(n){const t=(n||"").trim();return t?t.length<=10?t:t.slice(0,10):"—"}function N(n){return n.name?`${n.kind}:${n.name}`:n.kind}function w(n){switch(n.kind){case"turn":return u(n.turnId);case"tool":return u(n.callId);case"provider":return u(n.providerRequestId);case"child":return u(n.childSessionId);case"permission":return u(n.callId);case"verify":return u(n.turnId||n.id);default:return u(n.id)}}function C({available:n,sessionID:t}){const[r,a]=h.useState(),[m,x]=h.useState(!1),[d,o]=h.useState(""),[c,i]=h.useState(""),j=h.useCallback(async()=>{if(!(!n||!t)){x(!0),o("");try{a(await g(t))}catch(s){a(void 0),o(s.message||"timeline unavailable")}finally{x(!1)}}},[n,t]);h.useEffect(()=>{a(void 0),o(""),!(!n||!t)&&j()},[n,t,j]);const p=async s=>{if(t){i(s),o("");try{await k(t,s)}catch(v){o(v.message||"export failed")}finally{i("")}}};if(!n)return e.jsxs("section",{className:"unavailable",role:"status",children:[e.jsx("strong",{children:"Timeline unavailable"}),e.jsx("p",{children:"The configured host did not provide this capability. No action was attempted."})]});if(!t)return e.jsx("p",{className:"muted",children:"Select a session to inspect its run timeline."});const l=r==null?void 0:r.summary,f=(r==null?void 0:r.entries)||[];return e.jsxs("div",{className:"timeline-panel",children:[e.jsxs("div",{className:"timeline-head",children:[e.jsx("h2",{children:"Run timeline"}),e.jsxs("div",{className:"timeline-actions",children:[e.jsx("button",{type:"button",onClick:()=>void j(),disabled:m,children:m?"Loading…":r?"Refresh":"Load"}),e.jsx("button",{type:"button",onClick:()=>void p("json"),disabled:!t||c!=="",children:c==="json"?"…":"Export JSON"}),e.jsx("button",{type:"button",onClick:()=>void p("jsonl"),disabled:!t||c!=="",children:c==="jsonl"?"…":"Export JSONL"})]})]}),e.jsx("p",{className:"muted",children:"Collapsed harness spans (turns/tools/provider/children). Complements the transcript; exports are secret-redacted."}),d&&e.jsxs("section",{className:"unavailable",role:"status",children:[e.jsx("strong",{children:"Unable to load"}),e.jsx("p",{children:d})]}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:"timeline-summary","aria-label":"Timeline summary",children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Turns"}),e.jsx("dd",{children:(l==null?void 0:l.turns)??0})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Tools"}),e.jsx("dd",{children:(l==null?void 0:l.tools)??0})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Failed"}),e.jsx("dd",{children:(l==null?void 0:l.failed)??0})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Duration"}),e.jsx("dd",{children:b(l==null?void 0:l.durationMs)||"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Redacted"}),e.jsx("dd",{children:r.redacted?"yes":"no"})]})]}),f.length===0?e.jsx("p",{className:"muted",children:"No timeline entries yet — run a turn first."}):e.jsx("ol",{className:"timeline-list","aria-label":"Timeline entries",children:f.map(s=>e.jsxs("li",{className:`timeline-entry state-${s.state||"unknown"}`,children:[e.jsx("span",{className:`timeline-state state-${s.state||"unknown"}`,children:s.state||"?"}),e.jsx("span",{className:"timeline-label",title:N(s),children:N(s)}),e.jsx("code",{className:"timeline-id",children:w(s)}),e.jsx("span",{className:"timeline-dur",children:b(s.durationMs)}),s.errorCode&&e.jsx("span",{className:"timeline-code",children:s.errorCode}),s.error&&e.jsx("span",{className:"timeline-err",title:s.error,children:s.error})]},s.id))})]}),!r&&!m&&!d&&e.jsx("p",{className:"muted",children:"Load the collapsed run timeline for the selected session."})]})}export{C as TimelinePanel}; diff --git a/internal/frontend/server/static/assets/Workflows-eI79xfEe.js b/internal/frontend/server/static/assets/Workflows-BFSMWcFc.js similarity index 99% rename from internal/frontend/server/static/assets/Workflows-eI79xfEe.js rename to internal/frontend/server/static/assets/Workflows-BFSMWcFc.js index 1dbe5a1a..a508380e 100644 --- a/internal/frontend/server/static/assets/Workflows-eI79xfEe.js +++ b/internal/frontend/server/static/assets/Workflows-BFSMWcFc.js @@ -1,3 +1,3 @@ -import{b as k,r as c,j as e}from"./index-DcyMECWA.js";const Z=()=>k("/v1/workflows"),ee=a=>k(`/v1/workflows/${encodeURIComponent(a)}/document`),se=a=>k("/v1/workflows/scaffold",{method:"POST",body:JSON.stringify({name:a})}),_=a=>k("/v1/workflows/validate",{method:"POST",body:JSON.stringify({document:a})}),A=a=>k("/v1/workflows/format",{method:"POST",body:JSON.stringify({document:a})}),ae=(a,u)=>k("/v1/workflows/phase-grants",{method:"POST",body:JSON.stringify({document:a,phaseIndex:u})}),te=(a,u,p)=>k("/v1/workflows/save",{method:"POST",body:JSON.stringify({document:a,scope:u,force:p})}),ne=(a,u)=>{const p=u?`?root=${encodeURIComponent(u)}`:"";return k(`/v1/workflows/${encodeURIComponent(a)}/start${p}`,{method:"POST",body:JSON.stringify({confirm:!0})})},oe=a=>{const u=a?`?root=${encodeURIComponent(a)}`:"";return k(`/v1/workflows/stop${u}`,{method:"POST",body:JSON.stringify({})})},H=a=>k("/v1/workflow-drafts/review",{method:"POST",body:JSON.stringify({json:a})}),z=()=>({name:"phase-1",gate:"agent",permissions:[]}),K=a=>JSON.parse(JSON.stringify(a)),le=["agent","user","check"],re=["allow","ask","deny"],ie=["project","global"];function U(a){return`${a.action} ${a.permission}${a.pattern?` ${a.pattern}`:""}`}function ue({available:a,draftsAvailable:u,live:p,rootID:O,activeWorkflow:y,agents:W,busy:N}){const[d,l]=c.useState([]),[m,S]=c.useState(!1),[C,r]=c.useState(""),[x,P]=c.useState(null),[h,D]=c.useState(null),[w,$]=c.useState(""),E=async()=>{if(a){S(!0),r("");try{const n=await Z();l(n.workflows||[])}catch(n){r(n.message)}finally{S(!1)}}};if(c.useEffect(()=>{E()},[a]),!a)return e.jsxs("section",{className:"unavailable",role:"status",children:[e.jsx("strong",{children:"Workflows unavailable"}),e.jsx("p",{children:"The configured host did not provide this capability. No action was attempted."})]});const T=async()=>{try{const n=await se("my-workflow");P({doc:n,scope:"project",creating:!0})}catch(n){window.alert(n.message)}},q=async n=>{try{const j=await ee(n),v=d.find(J=>J.name===n),R=(v==null?void 0:v.source)==="global"?"global":"project";P({doc:K(j),scope:R,creating:!1})}catch(j){window.alert(j.message)}},g=async()=>{if(!(!p||N))try{await oe(O),$("Workflow stopped (session history kept).")}catch(n){window.alert(n.message)}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"workflow-head",children:[e.jsx("h2",{children:"Workflows"}),e.jsxs("div",{className:"workflow-actions",children:[e.jsx("button",{type:"button",onClick:()=>void E(),disabled:m,children:"Refresh"}),e.jsx("button",{type:"button",onClick:()=>void T(),children:"New"}),p&&e.jsx("button",{type:"button",onClick:()=>void g(),disabled:N||!y,children:"Stop"})]})]}),y&&e.jsxs("p",{className:"workflow-active",role:"status",children:["Active: ",e.jsx("strong",{children:y})]}),w&&e.jsx("p",{className:"muted",role:"status",children:w}),C&&e.jsxs("section",{className:"unavailable",role:"alert",children:[e.jsx("strong",{children:"Unable to load"}),e.jsx("p",{children:C})]}),m&&!d.length?e.jsx("p",{className:"muted",children:"Loading catalog…"}):null,!m&&!d.length&&!C?e.jsx("p",{className:"muted",children:"No workflows loaded."}):null,e.jsx("div",{className:"workflow-list",children:d.map(n=>{var j,v,R,J,i;return e.jsxs("article",{className:`workflow-card ${n.valid?"":"invalid"}`,children:[e.jsxs("header",{children:[e.jsx("h3",{children:n.name}),e.jsxs("small",{children:[n.source||"unknown"," · ",((j=n.phases)==null?void 0:j.length)||0," phase(s)",n.valid?"":" · invalid"]})]}),n.description&&e.jsx("p",{children:n.description}),!n.valid&&n.validationError&&e.jsx("p",{className:"workflow-error",role:"status",children:n.validationError}),(J=(R=(v=n.phases)==null?void 0:v[0])==null?void 0:R.permissions)!=null&&J.length?e.jsxs("p",{className:"workflow-grants",children:[e.jsx("span",{children:"Phase 0 grants"}),n.phases[0].permissions.map((b,G)=>e.jsx("code",{children:U(b)},G))]}):null,e.jsxs("div",{className:"workflow-card-actions",children:[e.jsx("button",{type:"button",onClick:()=>void q(n.name),children:"Edit"}),e.jsx("button",{type:"button",disabled:!p||N||!n.valid||!((i=n.phases)!=null&&i.length),title:n.valid?void 0:"Invalid workflows cannot be activated",onClick:()=>D(n),children:"Start"})]})]},n.name)})}),x&&e.jsx(de,{initial:x.doc,scope:x.scope,creating:x.creating,agents:W,draftsAvailable:u,onClose:()=>P(null),onSaved:async n=>{P(null),$(`Saved ${n} (not activated).`),await E()}}),h&&e.jsx(ce,{summary:h,rootID:O,onClose:()=>D(null),onStarted:()=>{$(`Starting ${h.name}…`),D(null)}})]})}function ce({summary:a,rootID:u,onClose:p,onStarted:O}){var S,C;const y=c.useRef(null),[W,N]=c.useState(!1);c.useEffect(()=>{var r;(r=y.current)==null||r.showModal()},[]);const d=(S=a.phases)==null?void 0:S[0],l=(d==null?void 0:d.permissions)||[],m=async()=>{N(!0);try{await ne(a.name,u),O()}catch(r){window.alert(r.message),N(!1)}};return e.jsxs("dialog",{ref:y,className:"workflow-dialog","aria-labelledby":"wf-start-title",onClose:p,onCancel:r=>{r.preventDefault(),p()},children:[e.jsx("div",{className:"dialog-rule"}),e.jsxs("h2",{id:"wf-start-title",children:["Start ",a.name]}),e.jsxs("p",{className:"muted",children:["source ",a.source||"unknown"," · ",((C=a.phases)==null?void 0:C.length)||0," phase(s)"]}),a.description&&e.jsx("p",{children:a.description}),e.jsxs("section",{className:"workflow-review","aria-label":"Phase 0 grant review",children:[e.jsx("h3",{children:"Phase 0 grant review"}),e.jsx("p",{children:d?e.jsxs(e.Fragment,{children:[d.name,d.agent?` @${d.agent}`:""," · gate ",d.gate||"agent",d.gateCommand?` \`${d.gateCommand}\``:""]}):"No phases"}),l.length?e.jsx("ul",{children:l.map((r,x)=>e.jsx("li",{children:e.jsx("code",{children:U(r)})},x))}):e.jsx("p",{className:"muted",children:"No phase permission overrides."}),e.jsx("p",{className:"workflow-warn",children:"Starting applies phase permissions and may pin the phase agent. Session history is kept. Confirm only after reviewing grants."})]}),e.jsxs("div",{className:"dialog-actions",children:[e.jsx("button",{type:"button",onClick:p,disabled:W,children:"Cancel"}),e.jsx("button",{type:"button",autoFocus:!0,disabled:W||!a.valid,onClick:()=>void m(),children:"Confirm start"})]})]})}function de({initial:a,scope:u,creating:p,agents:O,draftsAvailable:y,onClose:W,onSaved:N}){var L;const d=c.useRef(null),[l,m]=c.useState(()=>K(a)),[S,C]=c.useState(u),[r,x]=c.useState(0),[P,h]=c.useState(""),[D,w]=c.useState(!1),[$,E]=c.useState(""),[T,q]=c.useState([]),[g,n]=c.useState(null),[j,v]=c.useState(!1),R=c.useMemo(()=>JSON.stringify(a),[a]),J=JSON.stringify(l)!==R;c.useEffect(()=>{var s;(s=d.current)==null||s.showModal()},[]);const i=l.phases[r]||z(),b=s=>{m(t=>{const o=t.phases.slice();return o[r]=s,{...t,phases:o}})},G=async()=>{try{const s=await _(l);s.ok?(h("Valid"),w(!1)):(h(s.error||"Invalid"),w(!0))}catch(s){h(s.message),w(!0)}},Q=async()=>{try{const[s,t]=await Promise.all([A(l),ae(l,r)]);if(E(s.json),q(t.grants||[]),y){const o=await H(s.json);n(o),o.valid?o.hasWidening||o.hasChecks?(h(o.hasWidening?"Review widening grants before save":"Review executable checks before save"),w(!1)):(h("Preview ready"),w(!1)):(h(o.validationError||"Draft invalid"),w(!0))}else n(null),h("Preview ready"),w(!1)}catch(s){h(s.message),w(!0)}},B=async s=>{v(!0);try{const t=await _(l);if(!t.ok){h(t.error||"Cannot save invalid workflow"),w(!0),v(!1);return}if(y){const f=await A(l),I=await H(f.json);if(n(I),E(f.json),!I.valid){h(I.validationError||"Cannot save invalid draft"),w(!0),v(!1);return}}(await te(l,S,s)).activated&&window.alert("Unexpected: save reported activation. Workflow was not started by the client."),await N(l.name)}catch(t){const o=t.message;if(!s&&/already exists/i.test(o)&&window.confirm(`${o} +import{b as k,r as c,j as e}from"./index-BK8GKzWA.js";const Z=()=>k("/v1/workflows"),ee=a=>k(`/v1/workflows/${encodeURIComponent(a)}/document`),se=a=>k("/v1/workflows/scaffold",{method:"POST",body:JSON.stringify({name:a})}),_=a=>k("/v1/workflows/validate",{method:"POST",body:JSON.stringify({document:a})}),A=a=>k("/v1/workflows/format",{method:"POST",body:JSON.stringify({document:a})}),ae=(a,u)=>k("/v1/workflows/phase-grants",{method:"POST",body:JSON.stringify({document:a,phaseIndex:u})}),te=(a,u,p)=>k("/v1/workflows/save",{method:"POST",body:JSON.stringify({document:a,scope:u,force:p})}),ne=(a,u)=>{const p=u?`?root=${encodeURIComponent(u)}`:"";return k(`/v1/workflows/${encodeURIComponent(a)}/start${p}`,{method:"POST",body:JSON.stringify({confirm:!0})})},oe=a=>{const u=a?`?root=${encodeURIComponent(a)}`:"";return k(`/v1/workflows/stop${u}`,{method:"POST",body:JSON.stringify({})})},H=a=>k("/v1/workflow-drafts/review",{method:"POST",body:JSON.stringify({json:a})}),z=()=>({name:"phase-1",gate:"agent",permissions:[]}),K=a=>JSON.parse(JSON.stringify(a)),le=["agent","user","check"],re=["allow","ask","deny"],ie=["project","global"];function U(a){return`${a.action} ${a.permission}${a.pattern?` ${a.pattern}`:""}`}function ue({available:a,draftsAvailable:u,live:p,rootID:O,activeWorkflow:y,agents:W,busy:N}){const[d,l]=c.useState([]),[m,S]=c.useState(!1),[C,r]=c.useState(""),[x,P]=c.useState(null),[h,D]=c.useState(null),[w,$]=c.useState(""),E=async()=>{if(a){S(!0),r("");try{const n=await Z();l(n.workflows||[])}catch(n){r(n.message)}finally{S(!1)}}};if(c.useEffect(()=>{E()},[a]),!a)return e.jsxs("section",{className:"unavailable",role:"status",children:[e.jsx("strong",{children:"Workflows unavailable"}),e.jsx("p",{children:"The configured host did not provide this capability. No action was attempted."})]});const T=async()=>{try{const n=await se("my-workflow");P({doc:n,scope:"project",creating:!0})}catch(n){window.alert(n.message)}},q=async n=>{try{const j=await ee(n),v=d.find(J=>J.name===n),R=(v==null?void 0:v.source)==="global"?"global":"project";P({doc:K(j),scope:R,creating:!1})}catch(j){window.alert(j.message)}},g=async()=>{if(!(!p||N))try{await oe(O),$("Workflow stopped (session history kept).")}catch(n){window.alert(n.message)}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"workflow-head",children:[e.jsx("h2",{children:"Workflows"}),e.jsxs("div",{className:"workflow-actions",children:[e.jsx("button",{type:"button",onClick:()=>void E(),disabled:m,children:"Refresh"}),e.jsx("button",{type:"button",onClick:()=>void T(),children:"New"}),p&&e.jsx("button",{type:"button",onClick:()=>void g(),disabled:N||!y,children:"Stop"})]})]}),y&&e.jsxs("p",{className:"workflow-active",role:"status",children:["Active: ",e.jsx("strong",{children:y})]}),w&&e.jsx("p",{className:"muted",role:"status",children:w}),C&&e.jsxs("section",{className:"unavailable",role:"alert",children:[e.jsx("strong",{children:"Unable to load"}),e.jsx("p",{children:C})]}),m&&!d.length?e.jsx("p",{className:"muted",children:"Loading catalog…"}):null,!m&&!d.length&&!C?e.jsx("p",{className:"muted",children:"No workflows loaded."}):null,e.jsx("div",{className:"workflow-list",children:d.map(n=>{var j,v,R,J,i;return e.jsxs("article",{className:`workflow-card ${n.valid?"":"invalid"}`,children:[e.jsxs("header",{children:[e.jsx("h3",{children:n.name}),e.jsxs("small",{children:[n.source||"unknown"," · ",((j=n.phases)==null?void 0:j.length)||0," phase(s)",n.valid?"":" · invalid"]})]}),n.description&&e.jsx("p",{children:n.description}),!n.valid&&n.validationError&&e.jsx("p",{className:"workflow-error",role:"status",children:n.validationError}),(J=(R=(v=n.phases)==null?void 0:v[0])==null?void 0:R.permissions)!=null&&J.length?e.jsxs("p",{className:"workflow-grants",children:[e.jsx("span",{children:"Phase 0 grants"}),n.phases[0].permissions.map((b,G)=>e.jsx("code",{children:U(b)},G))]}):null,e.jsxs("div",{className:"workflow-card-actions",children:[e.jsx("button",{type:"button",onClick:()=>void q(n.name),children:"Edit"}),e.jsx("button",{type:"button",disabled:!p||N||!n.valid||!((i=n.phases)!=null&&i.length),title:n.valid?void 0:"Invalid workflows cannot be activated",onClick:()=>D(n),children:"Start"})]})]},n.name)})}),x&&e.jsx(de,{initial:x.doc,scope:x.scope,creating:x.creating,agents:W,draftsAvailable:u,onClose:()=>P(null),onSaved:async n=>{P(null),$(`Saved ${n} (not activated).`),await E()}}),h&&e.jsx(ce,{summary:h,rootID:O,onClose:()=>D(null),onStarted:()=>{$(`Starting ${h.name}…`),D(null)}})]})}function ce({summary:a,rootID:u,onClose:p,onStarted:O}){var S,C;const y=c.useRef(null),[W,N]=c.useState(!1);c.useEffect(()=>{var r;(r=y.current)==null||r.showModal()},[]);const d=(S=a.phases)==null?void 0:S[0],l=(d==null?void 0:d.permissions)||[],m=async()=>{N(!0);try{await ne(a.name,u),O()}catch(r){window.alert(r.message),N(!1)}};return e.jsxs("dialog",{ref:y,className:"workflow-dialog","aria-labelledby":"wf-start-title",onClose:p,onCancel:r=>{r.preventDefault(),p()},children:[e.jsx("div",{className:"dialog-rule"}),e.jsxs("h2",{id:"wf-start-title",children:["Start ",a.name]}),e.jsxs("p",{className:"muted",children:["source ",a.source||"unknown"," · ",((C=a.phases)==null?void 0:C.length)||0," phase(s)"]}),a.description&&e.jsx("p",{children:a.description}),e.jsxs("section",{className:"workflow-review","aria-label":"Phase 0 grant review",children:[e.jsx("h3",{children:"Phase 0 grant review"}),e.jsx("p",{children:d?e.jsxs(e.Fragment,{children:[d.name,d.agent?` @${d.agent}`:""," · gate ",d.gate||"agent",d.gateCommand?` \`${d.gateCommand}\``:""]}):"No phases"}),l.length?e.jsx("ul",{children:l.map((r,x)=>e.jsx("li",{children:e.jsx("code",{children:U(r)})},x))}):e.jsx("p",{className:"muted",children:"No phase permission overrides."}),e.jsx("p",{className:"workflow-warn",children:"Starting applies phase permissions and may pin the phase agent. Session history is kept. Confirm only after reviewing grants."})]}),e.jsxs("div",{className:"dialog-actions",children:[e.jsx("button",{type:"button",onClick:p,disabled:W,children:"Cancel"}),e.jsx("button",{type:"button",autoFocus:!0,disabled:W||!a.valid,onClick:()=>void m(),children:"Confirm start"})]})]})}function de({initial:a,scope:u,creating:p,agents:O,draftsAvailable:y,onClose:W,onSaved:N}){var L;const d=c.useRef(null),[l,m]=c.useState(()=>K(a)),[S,C]=c.useState(u),[r,x]=c.useState(0),[P,h]=c.useState(""),[D,w]=c.useState(!1),[$,E]=c.useState(""),[T,q]=c.useState([]),[g,n]=c.useState(null),[j,v]=c.useState(!1),R=c.useMemo(()=>JSON.stringify(a),[a]),J=JSON.stringify(l)!==R;c.useEffect(()=>{var s;(s=d.current)==null||s.showModal()},[]);const i=l.phases[r]||z(),b=s=>{m(t=>{const o=t.phases.slice();return o[r]=s,{...t,phases:o}})},G=async()=>{try{const s=await _(l);s.ok?(h("Valid"),w(!1)):(h(s.error||"Invalid"),w(!0))}catch(s){h(s.message),w(!0)}},Q=async()=>{try{const[s,t]=await Promise.all([A(l),ae(l,r)]);if(E(s.json),q(t.grants||[]),y){const o=await H(s.json);n(o),o.valid?o.hasWidening||o.hasChecks?(h(o.hasWidening?"Review widening grants before save":"Review executable checks before save"),w(!1)):(h("Preview ready"),w(!1)):(h(o.validationError||"Draft invalid"),w(!0))}else n(null),h("Preview ready"),w(!1)}catch(s){h(s.message),w(!0)}},B=async s=>{v(!0);try{const t=await _(l);if(!t.ok){h(t.error||"Cannot save invalid workflow"),w(!0),v(!1);return}if(y){const f=await A(l),I=await H(f.json);if(n(I),E(f.json),!I.valid){h(I.validationError||"Cannot save invalid draft"),w(!0),v(!1);return}}(await te(l,S,s)).activated&&window.alert("Unexpected: save reported activation. Workflow was not started by the client."),await N(l.name)}catch(t){const o=t.message;if(!s&&/already exists/i.test(o)&&window.confirm(`${o} Overwrite existing file?`)){v(!1),await B(!0);return}h(o),w(!0)}finally{v(!1)}},M=()=>{J&&!window.confirm("Discard unsaved workflow edits?")||W()},X=()=>{m(s=>({...s,phases:[...s.phases,{...z(),name:`phase-${s.phases.length+1}`}]})),x(l.phases.length)},Y=()=>{l.phases.length<=1||(m(s=>{const t=s.phases.filter((o,f)=>f!==r);return{...s,phases:t}}),x(s=>Math.max(0,Math.min(s,l.phases.length-2))))},F=s=>{const t=r+s;t<0||t>=l.phases.length||(m(o=>{const f=o.phases.slice();return[f[r],f[t]]=[f[t],f[r]],{...o,phases:f}}),x(t))},V=(s,t)=>{const o=(i.permissions||[]).slice();o[s]={...o[s],...t},b({...i,permissions:o})};return e.jsxs("dialog",{ref:d,className:"workflow-dialog wide","aria-labelledby":"wf-builder-title",onClose:M,onCancel:s=>{s.preventDefault(),M()},children:[e.jsx("div",{className:"dialog-rule"}),e.jsx("h2",{id:"wf-builder-title",children:p?"New workflow":`Edit ${a.name}`}),e.jsxs("form",{className:"workflow-builder",onSubmit:s=>{s.preventDefault(),B(!1)},children:[e.jsxs("fieldset",{className:"workflow-meta",children:[e.jsx("legend",{children:"Document"}),e.jsxs("label",{children:["Name",e.jsx("input",{"aria-label":"Workflow name",value:l.name,disabled:!p,onChange:s=>m({...l,name:s.target.value})})]}),e.jsxs("label",{children:["Description",e.jsx("input",{"aria-label":"Workflow description",value:l.description||"",onChange:s=>m({...l,description:s.target.value})})]}),e.jsxs("label",{children:["Scope",e.jsx("select",{"aria-label":"Save scope",value:S,onChange:s=>C(s.target.value),children:ie.map(s=>e.jsx("option",{value:s,children:s},s))})]})]}),e.jsxs("div",{className:"workflow-phases",role:"list","aria-label":"Phases",children:[l.phases.map((s,t)=>e.jsxs("button",{type:"button",role:"listitem",className:t===r?"active":"",onClick:()=>x(t),children:[t,". ",s.name||"(unnamed)"]},`${s.name}-${t}`)),e.jsxs("div",{className:"workflow-phase-tools",children:[e.jsx("button",{type:"button",onClick:X,children:"+ Phase"}),e.jsx("button",{type:"button",onClick:Y,disabled:l.phases.length<=1,children:"Remove"}),e.jsx("button",{type:"button",onClick:()=>F(-1),disabled:r===0,children:"↑"}),e.jsx("button",{type:"button",onClick:()=>F(1),disabled:r>=l.phases.length-1,children:"↓"})]})]}),e.jsxs("fieldset",{className:"workflow-phase-fields",children:[e.jsxs("legend",{children:["Phase ",r]}),e.jsxs("label",{children:["Name",e.jsx("input",{"aria-label":"Phase name",value:i.name,onChange:s=>b({...i,name:s.target.value})})]}),e.jsxs("label",{children:["Description",e.jsx("input",{"aria-label":"Phase description",value:i.description||"",onChange:s=>b({...i,description:s.target.value})})]}),e.jsxs("label",{children:["Agent",e.jsxs("select",{"aria-label":"Phase agent",value:i.agent||"",onChange:s=>b({...i,agent:s.target.value}),children:[e.jsx("option",{value:"",children:"(default)"}),O.map(s=>e.jsx("option",{value:s,children:s},s))]})]}),e.jsxs("label",{children:["Gate",e.jsx("select",{"aria-label":"Phase gate",value:i.gate||"agent",onChange:s=>b({...i,gate:s.target.value}),children:le.map(s=>e.jsx("option",{value:s,children:s},s))})]}),(i.gate||"agent")==="check"&&e.jsxs("label",{children:["Check command",e.jsx("input",{"aria-label":"Gate check command",value:i.gateCommand||"",onChange:s=>b({...i,gateCommand:s.target.value}),placeholder:"make test"})]}),e.jsxs("label",{children:["Context",e.jsx("textarea",{"aria-label":"Phase context",value:i.context||"",onChange:s=>b({...i,context:s.target.value}),rows:3})]})]}),e.jsxs("fieldset",{className:"workflow-perms",children:[e.jsx("legend",{children:"Permissions (phase grants)"}),(i.permissions||[]).map((s,t)=>e.jsxs("div",{className:"perm-row",children:[e.jsx("input",{"aria-label":`Permission name ${t+1}`,value:s.permission,onChange:o=>V(t,{permission:o.target.value}),placeholder:"bash"}),e.jsx("input",{"aria-label":`Permission pattern ${t+1}`,value:s.pattern||"",onChange:o=>V(t,{pattern:o.target.value}),placeholder:"*"}),e.jsx("select",{"aria-label":`Permission action ${t+1}`,value:s.action,onChange:o=>V(t,{action:o.target.value}),children:re.map(o=>e.jsx("option",{value:o,children:o},o))}),e.jsx("button",{type:"button","aria-label":`Remove permission ${t+1}`,onClick:()=>b({...i,permissions:(i.permissions||[]).filter((o,f)=>f!==t)}),children:"×"})]},t)),e.jsx("button",{type:"button",onClick:()=>b({...i,permissions:[...i.permissions||[],{permission:"bash",pattern:"*",action:"ask"}]}),children:"+ Grant"})]}),($||g||T.length>0)&&e.jsxs("section",{className:"workflow-review","aria-label":"Validation and grant preview",children:[e.jsx("h3",{children:"Review"}),T.length>0&&e.jsxs("p",{className:"workflow-grants",children:[e.jsxs("span",{children:["Phase ",r," grants"]}),T.map((s,t)=>e.jsx("code",{children:U(s)},t))]}),(g==null?void 0:g.hasChecks)&&e.jsx("p",{className:"workflow-warn",children:"Executable check gates require review before save."}),(g==null?void 0:g.hasWidening)&&e.jsx("p",{className:"workflow-warn",children:"Permission widening vs baseline — review carefully."}),(L=g==null?void 0:g.phases)==null?void 0:L.map((s,t)=>{var o;return e.jsxs("div",{className:"workflow-review-phase",children:[e.jsx("strong",{children:s.name}),s.checkHighlighted&&s.gateCommand&&e.jsx("code",{className:"check-cmd",children:s.gateCommand}),(o=s.widening)!=null&&o.length?e.jsx("ul",{children:s.widening.map((f,I)=>e.jsxs("li",{children:[e.jsx("code",{children:U(f)})," (widening)"]},I))}):null]},t)}),$&&e.jsx("pre",{className:"workflow-json","aria-label":"Canonical JSON preview",children:$})]}),P&&e.jsx("p",{className:D?"workflow-error":"muted",role:"status",children:P}),e.jsx("p",{className:"muted",children:"Save writes the workflow file only — it never starts the workflow."}),e.jsxs("div",{className:"dialog-actions",children:[e.jsx("button",{type:"button",onClick:M,disabled:j,children:"Cancel"}),e.jsx("button",{type:"button",onClick:()=>void G(),disabled:j,children:"Validate"}),e.jsx("button",{type:"button",onClick:()=>void Q(),disabled:j,children:"Preview / review"}),e.jsx("button",{type:"submit",disabled:j,children:"Save"})]})]})]})}export{ue as WorkflowsPanel}; diff --git a/internal/frontend/server/static/assets/index-DcyMECWA.js b/internal/frontend/server/static/assets/index-BK8GKzWA.js similarity index 99% rename from internal/frontend/server/static/assets/index-DcyMECWA.js rename to internal/frontend/server/static/assets/index-BK8GKzWA.js index 9c4b1f78..13708898 100644 --- a/internal/frontend/server/static/assets/index-DcyMECWA.js +++ b/internal/frontend/server/static/assets/index-BK8GKzWA.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Plugins-pp6LQvUY.js","assets/panesApi-DZ879dGA.js","assets/PaneView-CEVTmQCp.js","assets/Panes-yF2n2wzV.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Plugins-CJ0dCX91.js","assets/panesApi-Gdyy8rqS.js","assets/PaneView-CmrtsIj-.js","assets/Panes-CWuiX4Ys.js"])))=>i.map(i=>d[i]); var pg=Object.defineProperty;var yg=(a,u,r)=>u in a?pg(a,u,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[u]=r;var ao=(a,u,r)=>yg(a,typeof u!="symbol"?u+"":u,r);(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const h of d)if(h.type==="childList")for(const y of h.addedNodes)y.tagName==="LINK"&&y.rel==="modulepreload"&&o(y)}).observe(document,{childList:!0,subtree:!0});function r(d){const h={};return d.integrity&&(h.integrity=d.integrity),d.referrerPolicy&&(h.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?h.credentials="include":d.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function o(d){if(d.ep)return;d.ep=!0;const h=r(d);fetch(d.href,h)}})();function Im(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var io={exports:{}},As={};/** * @license React * react-jsx-runtime.production.js @@ -90,6 +90,6 @@ ${h} … truncated (${a.length.toLocaleString()} chars; full text retained in session memory)`,truncated:!0}}function I0(a){const u=a.split(` `);return u.length<=xo?a:`… ${u.length-xo} earlier lines … ${u.slice(-xo).join(` -`)}`}function P0({item:a,onFileRef:u}){var d;const r=a.data||{},o=String(r.eventKind||r.kind||a.title||"").toLowerCase();if(o.includes("verification")||(d=a.title)!=null&&d.toLowerCase().includes("verification")){const h=r.passed===!0||r.verified===!0;return c.jsxs("article",{className:"message system semantic-event",children:[c.jsx("div",{className:"message-label",children:"Verification"}),c.jsxs("p",{children:[h?"Passed":r.passed===!1?"Failed":"Completed",r.summary?` — ${String(r.summary)}`:a.text?` — ${a.text}`:""]})]})}if(o.includes("overlap")||o.includes("path.overlap")){const h=String(r.path||"");return c.jsxs("article",{className:"message system semantic-event",children:[c.jsx("div",{className:"message-label",children:"Path overlap"}),c.jsxs("p",{children:[u&&h?c.jsx("button",{type:"button",className:"file-ref",onClick:()=>u(h),children:h}):h||"paths",Array.isArray(r.sessions)?` · ${r.sessions.length} sessions`:""]})]})}return o.includes("denied")||o.includes("permission")?c.jsxs("article",{className:"message system semantic-event",children:[c.jsx("div",{className:"message-label",children:"Permission denied"}),c.jsx("p",{children:a.text||String(r.message||r.permission||"Permission denied")})]}):o.includes("handoff")||o.includes("agent.message")?c.jsxs("article",{className:"message system semantic-event",children:[c.jsx("div",{className:"message-label",children:o.includes("handoff")?"Handoff":"Agent message"}),c.jsxs("p",{children:[r.from?`${String(r.from)} → `:"",r.to?String(r.to):"",r.summary||r.body||a.text?` — ${String(r.summary||r.body||a.text)}`:""]})]}):null}function jp({item:a,onFileRef:u}){const r=Us(a),o=Z0(a),d=J0(a),h=a.text.trim(),{text:y,truncated:b}=Sp(h);let v;try{v=JSON.parse(h)}catch{v=void 0}const g=$0.has(r)||F0(h),z=typeof(a.data||{}).path=="string"?String((a.data||{}).path):W0(h),C=(a.data||{}).args??(a.data||{}).input,O=o.kind==="running"?I0(y):y;return c.jsxs("details",{className:`tool-card state-${o.kind}`,children:[c.jsxs("summary",{children:[c.jsx("span",{className:"tool-name",children:r}),c.jsx("span",{className:`tool-state tool-state-${o.kind}`,children:o.label}),d&&c.jsx("small",{className:"tool-duration",children:d}),c.jsx("small",{children:g?"diff":v?"structured":b?"bounded":"output"})]}),C!==void 0&&c.jsxs("div",{className:"tool-args",children:[c.jsx("strong",{children:"Arguments"}),c.jsx("pre",{children:typeof C=="string"?C:JSON.stringify(C,null,2)})]}),g?c.jsx(V0,{text:O,path:z,onFileRef:u}):c.jsx("pre",{className:"tool-output",children:v?JSON.stringify(v,null,2):O})]})}function eb(a){const u=[];let r=0;for(;r=2?u.push({kind:"exploration",items:d,id:`explore-${d[0].id}`}):u.push({kind:"single",item:d[0]});continue}u.push({kind:"single",item:o}),r+=1}return u}function tb({items:a,onFileRef:u}){const r=T.useMemo(()=>{const o=new Map;for(const d of a){const h=Us(d);o.set(h,(o.get(h)||0)+1)}return[...o.entries()].map(([d,h])=>h>1?`${d}×${h}`:d).join(", ")},[a]);return c.jsxs("details",{className:"exploration-group",children:[c.jsxs("summary",{children:[c.jsx("span",{children:"Exploration"}),c.jsxs("small",{children:[a.length," steps · ",r]})]}),c.jsx("div",{className:"exploration-body",children:a.map(o=>c.jsx(jp,{item:o,onFileRef:u},o.id))})]})}function nb(a){if(a.kind!=="system"&&a.kind!=="tool")return!1;const u=`${a.title||""} ${JSON.stringify(a.data||{})}`.toLowerCase();return/verification|path\.overlap|overlap|permission|denied|handoff|agent\.message/.test(u)}function lb({item:a,showThinking:u=!0,onFileRef:r}){if(a.kind==="reasoning"&&!u)return null;if(nb(a)){const o=c.jsx(P0,{item:a,onFileRef:r});if(o)return o}return a.kind==="tool"?c.jsxs("article",{className:"message tool",children:[c.jsx("div",{className:"message-label",children:a.title||Us(a)}),c.jsx(jp,{item:a,onFileRef:r})]}):c.jsxs("article",{className:`message ${a.kind}`,children:[c.jsx("div",{className:"message-label",children:a.title||a.kind}),c.jsx(Q0,{text:a.text,onFileRef:r})]})}function Vm(a,u,r){return a.kind==="exploration"?c.jsxs("article",{className:"message tool exploration","aria-label":`Exploration ${a.items.length} steps`,children:[c.jsx("div",{className:"message-label",children:"Exploration"}),c.jsx(tb,{items:a.items,onFileRef:r})]}):c.jsx(lb,{item:a.item,showThinking:u,onFileRef:r})}function ab({items:a,showThinking:u=!0,onFileRef:r,scrollRef:o,stickToBottom:d=!1,virtualize:h}){const y=T.useMemo(()=>eb(a),[a]),b=h??y.length>40,v=T.useCallback(z=>z.kind==="exploration"?z.id:z.item.id,[]),g=T.useCallback(z=>Vm(z,u,r),[u,r]);return b?c.jsx(G0,{className:"transcript-list",items:y,itemKey:v,renderItem:g,scrollRef:o,stickToBottom:d,estimateHeight:120,overscan:8,maxMounted:80,"aria-label":"Conversation messages"}):c.jsx("div",{className:"transcript-list",role:"log","aria-label":"Conversation messages","data-virtual-mounted":y.length,"data-virtual-total":y.length,children:y.map(z=>c.jsx("div",{children:Vm(z,u,r)},v(z)))})}const ib=T.memo(ab);var So={};function sb(a,u={}){const r=typeof process<"u"&&!!(So!=null&&So.VITEST),o=u.schedule??(O=>r?(O(),-1):typeof requestAnimationFrame=="function"?requestAnimationFrame(O):setTimeout(O,16)),d=u.cancel??(O=>{O<0||(typeof cancelAnimationFrame=="function"?cancelAnimationFrame(O):clearTimeout(O))});let h=[],y,b=!1;const v=()=>{if(b=!1,y=void 0,!h.length)return;const O=h;h=[],a(O)};return{push:O=>{h.push(O),!b&&(b=!0,y=o(v))},flush:()=>{if(y!==void 0&&(d(y),y=void 0),b=!1,!h.length)return;const O=h;h=[],a(O)},clear:()=>{y!==void 0&&(d(y),y=void 0),b=!1,h=[]},pending:()=>h.length}}const ub=["shared","tools","provider","config_system","persona","phase","plan","lean_code","environment","instruction","project_memory","decision_ledger"];function cb({modeLabel:a,surfaces:u,activeId:r,profile:o,onChange:d,panelIdPrefix:h="inspector-panel"}){return u.length?o==="phone"?c.jsx("nav",{className:"surface-nav-sheet","aria-label":`${a} surfaces`,children:c.jsx("ul",{className:"surface-nav-list",role:"listbox","aria-label":`${a} surfaces`,children:u.map(y=>{const b=y.id===r;return c.jsx("li",{role:"option","aria-selected":b,children:c.jsx("button",{type:"button",className:b?"surface-nav-item active":"surface-nav-item","aria-current":b?"page":void 0,onClick:()=>d(y.id),children:c.jsx("span",{className:"surface-nav-label",children:y.label})})},y.id)})})}):c.jsx(Zg,{className:"inspector-tabs",label:`${a} surfaces`,value:r,items:u.map(y=>({id:y.id,label:y.label})),onChange:d,panelIdPrefix:h}):null}function xa(a){return(a||"").trim()}function Tp(a){const u=a.startsWith("?")||a.startsWith("#")?a.slice(1):a;return new URLSearchParams(u)}function Uo(a){const u=Tp(a),r=xa(u.get("root")),o=xa(u.get("session")),d=xa(u.get("mode")).toLowerCase(),h=d!=="",y=ko(d)?d:"chat";return{raw:{root:r,session:o,mode:y,surface:xa(u.get("surface")),entity:xa(u.get("entity")),path:xa(u.get("path")),pane:xa(u.get("pane")),agent:xa(u.get("agent"))},modePresent:h,modeRaw:d,workspaceID:r||o}}function rb(a,u=""){const r=Tp(u);r.delete("token");const o=(d,h,y)=>{y||!h?r.delete(d):r.set(d,h)};if("root"in a&&o("root",a.root||""),"session"in a&&o("session",a.session||""),"mode"in a){const d=a.mode||"";o("mode",d,!d||d==="chat")}return"surface"in a&&o("surface",a.surface||""),"entity"in a&&o("entity",a.entity||""),"path"in a&&o("path",a.path||""),"pane"in a&&o("pane",a.pane||""),"agent"in a&&o("agent",a.agent||""),r.toString()}function Va(a){try{const u=rb(a,location.search),r=`${location.pathname}${u?`?${u}`:""}${location.hash||""}`,o=`${location.pathname}${location.search}${location.hash||""}`;r!==o&&history.replaceState(null,"",r)}catch{}}function ob(a,u,r){const o=Uo(a),{raw:d,modePresent:h,modeRaw:y}=o;let b;h&&(b=ko(y)?y:"chat");const v=Yv({mode:b,surface:d.surface,path:d.path,pane:d.pane,agent:d.agent,caps:u,attachOnly:r==null?void 0:r.attachOnly,isLive:r==null?void 0:r.isLive});return{workspaceID:o.workspaceID,mode:v.mode,surface:v.surface,entity:d.entity,path:d.path,pane:d.pane,agent:d.agent,openDrawer:v.openDrawer,unavailable:v.unavailable}}function fb(a=typeof location<"u"?location.search:""){return Uo(a).workspaceID}const Zm={phoneMax:599,tabletMax:1023};function jo(a){return!Number.isFinite(a)||a<=0?"desktop":a<=Zm.phoneMax?"phone":a<=Zm.tabletMax?"tablet":"desktop"}function db(a){return a==="phone"}const hb=T.lazy(()=>en(()=>import("./Team-B3wUXmUE.js"),[]).then(a=>({default:a.TeamWorkspace}))),mb=T.lazy(()=>en(()=>import("./CodeExplorer-CgIv5pzo.js"),[]).then(a=>({default:a.CodeExplorer}))),pb=T.lazy(()=>en(()=>import("./ArtifactsReview-64Gq44h0.js"),[]).then(a=>({default:a.ArtifactsPanel}))),yb=T.lazy(()=>en(()=>import("./ArtifactsReview-64Gq44h0.js"),[]).then(a=>({default:a.LedgerPanel}))),gb=T.lazy(()=>en(()=>import("./ArtifactsReview-64Gq44h0.js"),[]).then(a=>({default:a.TeamReviewPanel}))),vb=T.lazy(()=>en(()=>import("./MCP-Cu_3_mNj.js"),[]).then(a=>({default:a.MCPPanel}))),bb=T.lazy(()=>en(()=>import("./Plugins-pp6LQvUY.js"),__vite__mapDeps([0,1,2])).then(a=>({default:a.PluginsPanel}))),Jm=T.lazy(()=>en(()=>import("./Panes-yF2n2wzV.js"),__vite__mapDeps([3,2,1])).then(a=>({default:a.PanesPanel}))),xb=T.lazy(()=>en(()=>import("./Timeline-pMCBJIX_.js"),[]).then(a=>({default:a.TimelinePanel}))),Sb=T.lazy(()=>en(()=>import("./Diagnostics-NmaV_GCL.js"),[]).then(a=>({default:a.DiagnosticsPanel}))),jb=T.lazy(()=>en(()=>import("./Plans-BAlvUQ-t.js"),[]).then(a=>({default:a.PlansPanel}))),Tb=T.lazy(()=>en(()=>import("./Goals-DDLXnGhH.js"),[]).then(a=>({default:a.GoalsPanel}))),Eb=T.lazy(()=>en(()=>import("./Workflows-eI79xfEe.js"),[]).then(a=>({default:a.WorkflowsPanel})));function Ab({label:a}){return c.jsx("section",{className:"unavailable",role:"status",children:c.jsxs("strong",{children:["Loading ",a,"…"]})})}const ic={effort:["low","medium","high","xhigh"],autonomy:["supervised","agent","checks","skip-all"],permission:["default","plan","soft-approve","accept-edits","yolo"],sandbox:["off","read-only","workspace-write"]},Ep="strike.web.showThinking",Cb=()=>{try{const a=sessionStorage.getItem(Ep);return a===null?!0:a==="1"||a==="true"}catch{return!0}},Nb=a=>{try{sessionStorage.setItem(Ep,a?"1":"0")}catch{}};function Ap(a){return a.contextUsed!==void 0&&a.contextLimit!==void 0?`${a.contextUsed.toLocaleString()} / ${a.contextLimit.toLocaleString()}`:a.contextUsed!==void 0?`${a.contextUsed.toLocaleString()} used`:"not reported"}const Ob=rc,xt=(a,u,r)=>Pm(a,u,r).catch(o=>window.alert(o.message)),Ui=a=>a.slice(0,12),zb=2e3,Wm=a=>!!(a.permissionPending||a.questionPending),Db=(a,u)=>{var r;return a.title||((r=u.find(o=>o.id===a.id))==null?void 0:r.title)||Ui(a.id)},Mo=a=>{if(!a)return"";const u=a<1e12?a*1e3:a,r=Math.max(0,Math.floor((Date.now()-u)/1e3));return r<60?"just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:`${Math.floor(r/86400)}d ago`},Mb=()=>{try{return fb(location.search)}catch{return""}};function Ka({label:a,value:u,values:r,disabled:o,onChange:d}){return c.jsxs("label",{className:"runtime-field",children:[c.jsx("span",{children:a}),c.jsxs("select",{"aria-label":a,value:u||"",disabled:o,onChange:h=>d(h.target.value),children:[c.jsx("option",{value:"",children:"—"}),r.map(h=>c.jsx("option",{children:h},h))]})]})}function Cp({title:a,children:u}){const r=T.useRef(null);return T.useEffect(()=>{var o;(o=r.current)==null||o.showModal()},[]),c.jsxs("dialog",{ref:r,"aria-labelledby":"blocking-title",onCancel:o=>o.preventDefault(),children:[c.jsx("div",{className:"dialog-rule"}),c.jsx("h2",{id:"blocking-title",children:a}),u]})}const wb=a=>new Promise((u,r)=>{if(!a.type.startsWith("image/"))return r(new Error(`${a.name}: only image attachments are supported by the engine`));const o=new FileReader;o.onerror=()=>r(new Error(`${a.name}: read failed`)),o.onload=()=>u({name:a.name,mime:a.type,data:String(o.result).split(",")[1]||""}),o.readAsDataURL(a)});function _b(){const[a,u]=T.useState(),[r,o]=T.useState([]),[d,h]=T.useState([]),[y,b]=T.useState(""),[v,g]=T.useState(""),[z,C]=T.useState(!1),[O,$]=T.useState("active"),[Q,le]=T.useState(""),[ye,ee]=T.useReducer(zv,void 0,Ov),B=ye.selectedID,k=Dv(ye),pe=k.draft,W=k.queue,me=k.images,P=k.fast,[J,se]=T.useState("connecting"),[ue,ie]=T.useState(null),Se=T.useRef(null),Ge=T.useRef(!1),[St,st]=T.useState(null),[U,K]=T.useState("chat"),[I,te]=T.useState("context"),[fe,S]=T.useState(!1),[R,X]=T.useState(""),[V,de]=T.useState(),[ge,Ee]=T.useState(0),ut=T.useRef(!1),[ze,sl]=T.useState(()=>typeof window<"u"?jo(window.innerWidth):"desktop"),[tn,Rt]=T.useState(()=>typeof window<"u"?jo(window.innerWidth)==="desktop":!0),[Hn,Mn]=T.useState(240),[Yn,pn]=T.useState(340),[Li,Gn]=T.useState(),[kl,Lt]=T.useState(!1),[ul,qt]=T.useState(new Set),[wn,gt]=T.useState([]),[Ul,$n]=T.useState([]),[Bt,_n]=T.useState([]),[vt,nn]=T.useState(null),[cl,Xn]=T.useState(!1),[yn,Je]=T.useState([]),[Ht,We]=T.useState(""),[gn,kn]=T.useState(0),[Za,$t]=T.useState(0),[Kn,vn]=T.useState(!1),[bn,Qn]=T.useState(()=>{try{return localStorage.getItem("strike.web.onboard.v1")!=="1"}catch{return!1}}),[xn,Ja]=T.useState(!1),[Sa,Vn]=T.useState(!1),ln=T.useRef(null),Zn=T.useRef(null),rl=T.useRef(null),[ol,ja]=T.useState(Cb),[Jn,Sn]=T.useState(),[$e,fl]=T.useState(),[Xt,Fe]=T.useState(!1),[tt,jt]=T.useState(),Un=T.useRef(null),Rl=T.useRef(null),Dt=T.useRef(!0),[Wn,Kt]=T.useState(!1),[Fn,Yt]=T.useState(0),Mt=T.useRef(0),[Qe,Tt]=T.useState(""),Ie=T.useRef(null),Et=p=>{if(!B)return;const j=typeof p=="function"?p(pe):p;ee({type:"client.composer",id:B,patch:{draft:j}})},Ll=p=>{if(!B)return;const j=typeof p=="function"?p(me):p;ee({type:"client.composer",id:B,patch:{images:j}})},an=p=>{if(!B)return;const j=typeof p=="function"?p(W):p;ee({type:"client.composer",id:B,patch:{queue:j}})},jn=p=>{if(!B)return;const j=typeof p=="function"?p(P):p;ee({type:"client.composer",id:B,patch:{fast:j}})},dl=()=>xm().then(p=>(o(p.sessions||[]),b(p.liveId||""),p)),Qt=()=>jm().then(p=>(h(p.roots||[]),g(p.activeId||""),p)).catch(()=>{});T.useEffect(()=>{bp(Do())},[]),T.useEffect(()=>{const p=()=>{const j=jo(window.innerWidth);sl(L=>(L!==j&&(Rt(j==="desktop"),j!=="desktop"&&S(!1)),j))};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]),T.useEffect(()=>{const p=j=>{if((j.metaKey||j.ctrlKey)&&j.key.toLowerCase()==="k"){j.preventDefault(),rl.current=document.activeElement instanceof HTMLElement?document.activeElement:null,Xn(!0);return}if(j.key==="Escape"&&!document.querySelector("dialog[open]")){if(cl){j.preventDefault(),Xn(!1);return}if(fe){j.preventDefault(),S(!1);return}tn&&ze!=="desktop"&&(j.preventDefault(),Rt(!1))}};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[fe,tn,ze,cl]),T.useEffect(()=>{Promise.all([Mg(),xm(),jm().catch(()=>({roots:[],activeId:""}))]).then(([p,j,L])=>{var Oa,$s,Xs,li,Ks;u(p),se("connected"),o(j.sessions||[]);const Z=!!(p.capabilities.roots&&((Oa=L.roots)!=null&&Oa.length));b(j.liveId||(($s=p.status)==null?void 0:$s.sessionId)||"");const F=Z?L.roots||[]:[];h(F),g(L.activeId||j.liveId||((Xs=p.status)==null?void 0:Xs.sessionId)||"");const Ue=j.sessions||[],Ne=Mb(),_e=new Set(F.map(gl=>gl.id));let et=((li=F[0])==null?void 0:li.id)||(p.capabilities.roots?"":j.liveId)||"",Zt=et||((Ks=Ue[0])==null?void 0:Ks.id)||"",Rn=!!(et&&Zt===et);Ne&&(_e.has(Ne)||!p.capabilities.roots&&Ne===(j.liveId||"")?(Zt=Ne,et=Ne,Rn=!0):Ue.some(gl=>gl.id===Ne)&&(Zt=Ne,Rn=!1)),Zt&&(ee({type:"client.ensure",id:Zt}),p.status&&Rn&&ee({type:"client.event",id:Zt,envelope:{type:"status",data:p.status}})),C(Rn),$(Rn?"active":"history"),Rn&&Ne&&p.capabilities.roots&&!p.attachOnly&&Tm(Ne).then(()=>Qt()).catch(()=>{}),p.capabilities.auth&&oe("/v1/providers").then(gl=>gt(gl.providers.map(Qs=>Qs.Name||Qs.name||"").filter(Boolean))).catch(()=>{}),p.capabilities.history&&oe("/v1/history").then(gl=>_n(gl.entries||[])).catch(()=>{}),p.capabilities.sandbox&&Sm().then(fl).catch(()=>{})}).catch(p=>se(p.message))},[]),T.useEffect(()=>{if(!(a!=null&&a.capabilities.roots)||a.attachOnly)return;const p=()=>{Qt()},j=window.setInterval(p,zb);return()=>window.clearInterval(j)},[a==null?void 0:a.capabilities.roots,a==null?void 0:a.attachOnly]),T.useEffect(()=>{if(!B)return;ee({type:"client.ensure",id:B}),jt(void 0);const p=B,j=sb(F=>{ee({type:"client.events",id:p,envelopes:F})}),L=F=>j.push(F);if(!z){const F=$g(p,L,Ue=>se(Ue));return()=>{j.flush(),j.clear(),F()}}const Z=Gg(p,L,se);return()=>{j.flush(),j.clear(),Z.close()}},[B,z]),T.useEffect(()=>{if(!B||!(a!=null&&a.capabilities.sessions))return;let p=!1;return Xg(B).then(j=>{p||ee({type:"client.event",id:B,envelope:{type:"children.seed",time:`seed:${B}`,data:{sessions:j.sessions||[]}}})}).catch(()=>{}),()=>{p=!0}},[B,a==null?void 0:a.capabilities.sessions]),T.useEffect(()=>{const p=Rl.current;if(!p)return;const j=()=>{const Z=p.scrollHeight-p.scrollTop-p.clientHeight<80;Dt.current=Z,Z&&(Yt(0),Mt.current=k.items.length),Kt(!Z&&k.items.length>0)};return p.addEventListener("scroll",j,{passive:!0}),()=>p.removeEventListener("scroll",j)},[k.items.length]),T.useEffect(()=>{var p;if(!Dt.current){const j=k.items.length-Mt.current;j>0&&Yt(L=>L+j),Kt(k.items.length>0),Mt.current=k.items.length;return}Yt(0),Mt.current=k.items.length,(p=Un.current)==null||p.scrollIntoView({block:"end"}),Kt(!1)},[k.items]),T.useEffect(()=>{const p=[];k.status.busy?p.push("Agent working"):k.items.length&&p.push("Agent idle"),k.permission&&p.push("Permission required"),k.question&&p.push("Question pending");const j=p.join(". "),L=window.setTimeout(()=>Tt(j),400);return()=>window.clearTimeout(L)},[k.status.busy,k.permission,k.question,k.items.length]);const Ta=(p,j)=>{de(void 0),X(p),Va({mode:"code",surface:"files",entity:p}),K("code"),te("files"),S(!0),el("files")},Wa=T.useRef(Ta);Wa.current=Ta;const ql=T.useCallback((p,j)=>{Wa.current(p,j)},[]),hl=()=>{var p;Dt.current=!0,Kt(!1),Yt(0),Mt.current=k.items.length,(p=Un.current)==null||p.scrollIntoView({block:"end",behavior:"smooth"})};T.useEffect(()=>{if(!B||k.status.busy||!W.length||!z)return;const[p,...j]=W;ee({type:"client.composer",id:B,patch:{queue:j}}),xt("user.input",{text:p.text,images:p.images.map(({mime:L,data:Z})=>({mime:L,data:Z}))},B)},[k.status.busy,W,z,B]);const nt=!!(z&&B&&!(a!=null&&a.attachOnly)),Pe=!nt||k.status.busy,Bl=[k.status.effort,k.status.autonomy,k.status.permissionMode,P?"fast":""].filter(Boolean).join(" · "),E=T.useMemo(()=>Object.entries(k.children),[k.children]),G=T.useMemo(()=>Co(U,a==null?void 0:a.capabilities,{attachOnly:a==null?void 0:a.attachOnly,isLive:z,forceIds:V?[V.id]:[]}),[a,U,z,V,ge]),De=T.useMemo(()=>G.map(p=>p.id),[G]),pt=T.useMemo(()=>{var p,j;return{changedFiles:((p=k.changedFiles)==null?void 0:p.length)||0,teamMembers:Math.max(Object.keys(k.children||{}).length,Object.keys(((j=k.team)==null?void 0:j.members)||{}).length),permissionPending:!!k.permission||d.some(L=>L.permissionPending),questionPending:!!k.question||d.some(L=>L.questionPending),fitWarning:!!k.fitWarning}},[k.changedFiles,k.children,k.permission,k.question,k.fitWarning,d]),Vt=De.includes(I)?I:De[0]||"",wt={"--nav-width":ze==="desktop"?tn?`${Hn}px`:"0px":`${Hn}px`,"--inspector-width":ze==="desktop"?fe?`${Yn}px`:"0px":`${Yn}px`},Hl=db(ze),Rs=ze!=="desktop"&&(tn||fe),Ea=fe&&U==="chat";T.useLayoutEffect(()=>{var j;const p=Zn.current;p!=null&&(Zn.current=null,(j=ln.current)==null||j.setSelectionRange(p,p))});const Yl=T.useMemo(()=>$v({skills:a==null?void 0:a.skills,attachOnly:a==null?void 0:a.attachOnly,capabilities:a==null?void 0:a.capabilities}),[a]),In=T.useMemo(()=>{const p=Qv(pe,gn);return p.active?{start:p.start,query:p.query}:null},[pe,gn]),Fa=!!(In&&(a!=null&&a.capabilities.files)),Gl=T.useMemo(()=>{if(Fa)return yn.map(L=>({label:L,detail:"workspace file",insert:L}));const p=km(pe,gn);if(!p)return[];const j=[...Ob,...((a==null?void 0:a.skills)||[]).map(L=>({label:`/${L.name}`,detail:L.description||"Skill",insert:`/${L.name}`}))];return kv(j,p.query)},[pe,a,Fa,yn,gn]),_t=Kn||vt?[]:Gl,qi=Fa&&!Kn&&!vt&&_t.length===0&&Ht!=="",Ls=_t.length>0||qi,$l=Math.min(Za,Math.max(0,_t.length-1)),qs=T.useRef(!1),Bs=T.useRef(null);T.useEffect(()=>{const p=_t.length>0;p&&!qs.current?$t(0):$t(j=>Math.min(j,Math.max(0,_t.length-1))),qs.current=p},[_t.length]),T.useEffect(()=>{var p,j;(j=(p=Bs.current)==null?void 0:p.querySelector('[aria-selected="true"]'))==null||j.scrollIntoView({block:"nearest"})},[$l,_t.length]),T.useEffect(()=>{if(!In||!(a!=null&&a.capabilities.files)){Je([]),We("");return}const p=In.query,j=window.setTimeout(()=>{oe(`/v1/files/search?q=${encodeURIComponent(p)}&limit=12`).then(L=>{const Z=L.paths||[];Je(Z),We(Z.length?"":qm(p))}).catch(()=>{Je([]),We(qm(p,!0))})},120);return()=>window.clearTimeout(j)},[In,a==null?void 0:a.capabilities.files]);const Aa=p=>{!(a!=null&&a.capabilities.history)||!p.trim()||oe("/v1/history",{method:"POST",body:JSON.stringify({prompt:p})}).then(()=>oe("/v1/history")).then(j=>_n(j.entries||[])).catch(()=>{})},Ve=(p,j)=>{B&&ee({type:"client.event",id:B,envelope:{type:"local.system",time:String(Date.now()),data:{title:p,text:j}}})},Xl=()=>{var j;const p=ev(k.items,{sessionId:B||k.status.sessionId,title:(j=r.find(L=>L.id===B))==null?void 0:j.title,provider:k.status.provider,model:k.status.model,agent:k.status.agent});nv(tv(B||k.status.sessionId),p)},Ia=(p,j)=>{var Ue,Ne;const L=p.trim(),Z=((a==null?void 0:a.skills)||[]).map(_e=>_e.name),F=Uv(L,Z);switch(F.kind){case"pass":Aa(L),xt("user.input",{text:L,images:j.map(({mime:_e,data:et})=>({mime:_e,data:et}))},B);return;case"unknown":Ve("Unknown command",`${F.command} is not available in the web cockpit. Type /help for the list.`);return;case"usage":Ve("Usage",F.message);return;case"help":Ve("Help",Um((a==null?void 0:a.skills)||[]));return;case"export":Xl();return;case"queue":(Ue=Se.current)==null||Ue.scrollIntoView({block:"nearest",behavior:"smooth"}),Ve("Queue",W.length?`${W.length} prompt(s) queued — reorder, edit, or clear.`:"Queue is empty. Prompts sent while the agent is busy land here.");return;case"cost":Ve("Cost",_m(k.status,Jn));return;case"copy":{const _e=[...k.items].reverse().find(et=>et.kind==="assistant"&&et.text.trim());if(!_e){Ve("Copy","No assistant reply to copy.");return}(Ne=navigator.clipboard)==null||Ne.writeText(_e.text).then(()=>Ve("Copy","Last assistant reply copied to clipboard."),()=>Ve("Copy","Clipboard unavailable in this browser."));return}case"fork":Zl("fork");return;case"rename":{if(F.title){if(!(a!=null&&a.capabilities.sessions)){Ve("Rename","Sessions capability unavailable.");return}oe(`/v1/sessions/${encodeURIComponent(B)}`,{method:"PATCH",body:JSON.stringify({title:F.title})}).then(()=>dl()).catch(_e=>window.alert(_e.message));return}Zl("rename");return}case"fast":{const _e=F.enabled===void 0?!P:F.enabled;jn(_e),xt("set.fast",{enabled:_e},B);return}case"op":{let _e=F.data;if(F.type==="select.model"&&_e&&typeof _e=="object"){const et={..._e};et.provider||(et.provider=k.status.provider),_e=et}if(F.type==="rewind"){const et=!!(_e&&typeof _e=="object"&&_e.restoreFiles);st({preferFiles:et});return}xt(F.type,_e,B);return}}},Kl=k.undoStack.at(-1)||ov(),Ql=p=>{st(null),xt("rewind",p?{restoreFiles:!0}:{},B)},Hs=p=>{p.preventDefault();const j=pe.trim();!j||!nt||(k.status.busy?(Aa(j),an(L=>[...L,{text:j,images:me}])):Ia(j,me),nn(null),Et(""),Ll([]),Je([]),We(""),kn(0))},Pa=p=>{var et;if(vn(!0),In){const Zt=((et=ln.current)==null?void 0:et.selectionStart)??gn,Rn=Zv(pe,In.start,Zt,p.insert),Oa=Jv(In.start,p.insert,Rn);Zn.current=Oa,Et(Rn),kn(Oa),Je([]),We("");return}const j=km(pe,gn),L=(j==null?void 0:j.start)??0,Z=j?pe.slice(j.end):"",F=p.insert.replace(/\s+$/,""),Ue=/^\s/.test(Z)?"":" ",Ne=`${pe.slice(0,L)}${F}${Ue}${Z}`,_e=L+F.length+Ue.length;Zn.current=_e,Et(Ne),kn(_e)},Ys=p=>{var L;const j=p.action;if(p.requiresLive&&(!nt||a!=null&&a.attachOnly)){Ve("Unavailable",a!=null&&a.attachOnly?"Attach-only: this action requires a live workspace.":"Not available without a live session.");return}if(p.requiresCapability&&a&&!a.capabilities[p.requiresCapability]){Ve("Unavailable",`${p.requiresCapability} capability is not available on this host.`);return}switch(j.type){case"mode":Vl(j.mode,{openDrawer:j.mode!=="chat"});return;case"surface":Vl(j.mode,{openDrawer:!0,surface:j.surface});return;case"slash":j.run?Ia(j.insert.trim(),[]):(Et(j.insert),(L=ln.current)==null||L.focus());return;case"session":j.action==="export"?Xl():j.action==="help"?Ve("Help",Um((a==null?void 0:a.skills)||[])):j.action==="settings"?Vn(!0):j.action==="cost"?Ve("Cost",_m(k.status)):j.action==="fork"?Zl("fork"):j.action==="interrupt"&&xt("interrupt");return;case"notice":Ve(j.title,j.body);return}},Ca=p=>{var Z;const j=p.currentTarget;if(Ls){const F=p.key==="ArrowDown"||p.ctrlKey&&!p.metaKey&&!p.altKey&&p.key.toLowerCase()==="n",Ue=p.key==="ArrowUp";if(F||Ue){p.preventDefault(),_t.length>0&&$t(Ne=>F?Math.min(_t.length-1,Ne+1):Math.max(0,Ne-1));return}if(p.key==="Enter"&&!p.shiftKey||p.key==="Tab"&&!p.shiftKey){p.preventDefault();const Ne=_t[$l]||_t[0];Ne&&Pa(Ne);return}if(p.key==="Escape"){p.preventDefault(),p.stopPropagation(),vn(!0);return}}if(p.key==="Enter"&&!p.shiftKey){p.preventDefault(),(Z=j.form)==null||Z.requestSubmit();return}const L=j.selectionStart===0&&j.selectionEnd===0;if((p.key==="ArrowUp"||p.key==="ArrowDown")&&Bt.length&&(vt||pe===""&&L)){if(p.preventDefault(),p.key==="ArrowUp")if(!vt)nn({index:Bt.length-1,draft:pe}),Et(Bt[Bt.length-1]||"");else{const F=Math.max(0,vt.index-1);nn({...vt,index:F}),Et(Bt[F]||"")}else if(vt)if(vt.index>=Bt.length-1)Et(vt.draft),nn(null);else{const F=vt.index+1;nn({...vt,index:F}),Et(Bt[F]||"")}return}},sn=p=>{kn(p.selectionStart??p.value.length)},Bi=(p,j)=>{vt&&nn(null),vn(!1),$t(0),Et(p),kn(j)},ml=async p=>{if(p)try{const j=await Promise.all([...p].map(wb));Ll(L=>[...L,...j])}catch(j){window.alert(j.message)}},Pn=async p=>{xt("select.model",{provider:p},B),a!=null&&a.capabilities.catalog&&oe(`/v1/models?provider=${encodeURIComponent(p)}`).then(j=>{const L=j.models||[];$n(L.map(Ue=>String(Ue.ID||Ue.id||"")).filter(Boolean));const Z=k.status.model,F=L.find(Ue=>String(Ue.ID||Ue.id||"")===Z)||L[0];Sn(F?{inputPerM:Number(F.InputCost??F.inputCost??0),outputPerM:Number(F.OutputCost??F.outputCost??0),hasCost:!!(F.HasCost??F.hasCost),context:Number(F.Context??F.context??0)||void 0}:void 0)}).catch(()=>{$n([]),Sn(void 0)})};T.useEffect(()=>{!(a!=null&&a.capabilities.catalog)||!k.status.provider||oe(`/v1/models?provider=${encodeURIComponent(k.status.provider)}`).then(p=>{const j=p.models||[];$n(j.map(Z=>String(Z.ID||Z.id||"")).filter(Boolean));const L=j.find(Z=>String(Z.ID||Z.id||"")===k.status.model);L&&Sn({inputPerM:Number(L.InputCost??L.inputCost??0),outputPerM:Number(L.OutputCost??L.outputCost??0),hasCost:!!(L.HasCost??L.hasCost),context:Number(L.Context??L.context??0)||void 0})}).catch(()=>{})},[a==null?void 0:a.capabilities.catalog,k.status.provider,k.status.model]);const el=async(p,j)=>{te(p);const L=ks(p),Z=(()=>{if(!(!L||!a)&&!(L.capability==="always"||L.capability==="team"||L.capability==="live"||L.capability==="sessions")){if(L.capability==="lsp"&&!a.capabilities.lsp)return{id:p,reason:"capability lsp unavailable"};if(typeof L.capability=="string"&&L.capability!=="lsp"&&!a.capabilities[L.capability])return{id:p,reason:`capability ${L.capability} unavailable`}}})();de(Z),(j==null?void 0:j.open)!==!1&&S(!0),Lt(!0),Gn(void 0);try{if(Z)return;Gn(p==="files"?a!=null&&a.capabilities.files?await oe(`/v1/changed-files${B?`?root=${encodeURIComponent(B)}`:""}`).catch(F=>({error:F.message})):void 0:p==="memory"?a!=null&&a.capabilities.memory?await oe("/v1/memory").catch(F=>({error:F.message})):void 0:p==="issues"&&a!=null&&a.capabilities.issues?await oe("/v1/issues").catch(F=>({error:F.message})):void 0)}finally{Lt(!1)}},Vl=(p,j)=>{if(K(p),(j==null?void 0:j.entity)!==void 0&&X(j.entity),p==="chat"&&!(j!=null&&j.surface)){(j==null?void 0:j.openDrawer)===!1||(j==null||j.openDrawer),Va({mode:"chat",surface:"",entity:(j==null?void 0:j.entity)||""});return}const L=(j==null?void 0:j.surface)||No(p,a==null?void 0:a.capabilities,{attachOnly:a==null?void 0:a.attachOnly,isLive:z});L&&el(L,{open:(j==null?void 0:j.openDrawer)!==!1}),Va({mode:p,surface:L||"",entity:(j==null?void 0:j.entity)||R})};T.useEffect(()=>{if(!a)return;if(!a.capabilities.panes){go(),Ee(j=>j+1);return}let p=!1;return en(async()=>{const{listPanes:j}=await import("./panesApi-DZ879dGA.js");return{listPanes:j}},[]).then(({listPanes:j})=>j()).then(j=>{if(!p){go();for(const L of j.panes||[]){const Z=Lv(L);Z&&Rv(Z)}Ee(L=>L+1)}}).catch(()=>{p||Ee(j=>j+1)}),()=>{p=!0,go()}},[a]),T.useEffect(()=>{var L;if(!a||ut.current||Uo(location.search).raw.surface.startsWith("pane:")&&ge===0)return;ut.current=!0;const j=ob(location.search,a.capabilities,{attachOnly:a.attachOnly,isLive:z||!!a.capabilities.live});if(K(j.mode),j.entity&&X(j.entity),j.agent&&jt(j.agent),j.unavailable&&de(j.unavailable),j.surface)el(j.surface,{open:j.openDrawer});else{const Z=Co("chat",a.capabilities,{attachOnly:a.attachOnly});if(Z.length){const F=((L=Z.find(Ue=>Ue.id==="files"))==null?void 0:L.id)||Z[0].id;el(F,{open:!1})}}},[a,ge]);const Zl=async p=>{var L;if(!(a!=null&&a.capabilities.sessions)||!B)return;const j=B;try{if(p==="fork"){await oe(`/v1/sessions/${encodeURIComponent(j)}/fork`,{method:"POST"}),await Promise.all([dl(),Qt()]);return}if(p==="rename"){const Z=window.prompt("Session title");if(Z===null)return;await oe(`/v1/sessions/${encodeURIComponent(j)}`,{method:"PATCH",body:JSON.stringify({title:Z})})}if(p==="delete"){if(!window.confirm("Delete this durable session?"))return;await oe(`/v1/sessions/${encodeURIComponent(j)}`,{method:"DELETE"}),ee({type:"client.drop",id:j});const Z=await dl();await Qt();const F=((L=((Z==null?void 0:Z.sessions)||[]).find(Ue=>Ue.id!==j))==null?void 0:L.id)||"";if(F){ee({type:"client.ensure",id:F});const Ue=!!(Z!=null&&Z.liveId&&F===Z.liveId||d.some(Ne=>Ne.id===F));C(Ue),$(Ue?"active":"history")}return}await Promise.all([dl(),Qt()])}catch(Z){window.alert(Z.message)}},ei=async()=>{if(!(!(a!=null&&a.capabilities.roots)||a.attachOnly))try{const p=await Ug();await Qt(),ee({type:"client.ensure",id:p.id}),C(!0),$("active")}catch(p){window.alert(p.message)}},ti=async p=>{if(!(!(a!=null&&a.capabilities.roots)||a.attachOnly))try{const j=await Rg(p);await Qt(),ee({type:"client.ensure",id:j.id}),C(!0),$("active")}catch(j){window.alert(j.message)}},pl=async(p,j)=>{if(ee({type:"client.ensure",id:p}),C(j),Sn(void 0),X(""),jt(void 0),!(!j||!(a!=null&&a.capabilities.roots)||a.attachOnly))try{if(await Tm(p),await Qt(),a!=null&&a.capabilities.team){const L=await wg(p).catch(()=>null);L&&ee({type:"client.event",id:p,envelope:{type:"team.snapshot",time:`snap:${p}`,data:L}})}}catch(L){window.alert(L.message)}},kt=async()=>{var L,Z,F,Ue;if(!(a!=null&&a.capabilities.roots)||a.attachOnly||!z||!B)return;const p=d.find(Ne=>Ne.id===B),j=p!=null&&p.busy?"This workspace is busy. Close/stop it anyway?":"Close this workspace?";if(window.confirm(j))try{await Lg(B);const[Ne,_e]=await Promise.all([Qt(),dl()]),et=(Ne==null?void 0:Ne.activeId)||((Z=(L=Ne==null?void 0:Ne.roots)==null?void 0:L[0])==null?void 0:Z.id)||"";if(et)ee({type:"client.ensure",id:et}),C(!0),$("active");else{const Zt=((Ue=(F=_e==null?void 0:_e.sessions)==null?void 0:F[0])==null?void 0:Ue.id)||"";Zt&&ee({type:"client.ensure",id:Zt}),C(!1),$("history")}}catch(Ne){window.alert(Ne.message)}},tl=p=>{if(!(a!=null&&a.capabilities.roots)){if(!r.length)return;const j=Math.max(0,r.findIndex(Z=>Z.id===B)),L=r[(j+p+r.length)%r.length];L&&(ee({type:"client.ensure",id:L.id}),C(L.id===y&&!(a!=null&&a.attachOnly)));return}if(O==="active"&&d.length){const j=Math.max(0,d.findIndex(Z=>Z.id===B&&z)),L=d[(j+p+d.length)%d.length];L&&pl(L.id,!0);return}if(r.length){const j=Math.max(0,r.findIndex(Z=>Z.id===B)),L=r[(j+p+r.length)%r.length];if(L){const Z=d.some(F=>F.id===L.id);pl(L.id,Z)}}},Jl=p=>{jt(void 0),pl(p,!1),$("history")},Na=async p=>{if(!(a!=null&&a.capabilities.sandbox)||!($e!=null&&$e.canChangeDefault))return;const j=String(k.status.permissionMode||$e.permissionMode||"");let L=!1;if(p==="off"&&j==="yolo"){if(L=window.confirm("permissionMode is yolo and sandbox off disables OS isolation. Continue only if you understand the risk (equivalent to --i-know)."),!L)return}else if(p!==($e.defaultMode||k.status.sandbox)&&!window.confirm(`Save sandbox default "${p}" for new sessions? Active session stays "${k.status.sandbox||$e.mode||"workspace-write"}".`))return;try{const Z=await _g(p,L,B||void 0);fl(Z),window.alert(`Sandbox default saved as ${Z.defaultMode||p}. Active session mode is unchanged until a new session starts.`)}catch(Z){window.alert(Z.message)}},Gs=async()=>{if(a!=null&&a.capabilities.sandbox)try{const p=await Sm(B||void 0);fl(p),Fe(!0)}catch(p){window.alert(p.message)}},Hi=p=>qt(j=>{const L=new Set(j);return L.has(p)?L.delete(p):L.add(p),L}),ni=d.filter(p=>Wm(p)&&!(p.id===B&&z)),yl=ni.length,Wl=yl>0?`${yl} need${yl===1?"s":""} you`:"",Yi=p=>c.jsx("nav",{className:p,"aria-label":"Workspace mode",children:_o.map(j=>{const L=ki[j],Z=Hv(j,pt),F=U===j;return c.jsxs("button",{type:"button",className:F?"mode-btn active":"mode-btn","aria-pressed":F,"aria-current":F?"page":void 0,"aria-label":`${L.label}: ${L.description}${Z==="needs-you"?", needs attention":Z==="badge"?", activity":""}`,onClick:()=>{Hl&&Rt(!1),Vl(j,{openDrawer:j!=="chat"})},children:[c.jsx("span",{children:L.label}),Z!=="none"&&c.jsx("span",{className:Z==="needs-you"?"mode-attn needs-you":"mode-attn","aria-hidden":!0})]},j)})});return c.jsxs("div",{className:"app-shell",style:wt,"data-shell":ze,children:[c.jsxs("header",{children:[c.jsx("button",{className:"icon-button","aria-label":"Toggle agents panel","aria-pressed":tn,onClick:()=>{S(!1),Rt(p=>!p)},children:"☰"}),c.jsxs("div",{className:"wordmark",children:[c.jsx("span",{className:"mark",children:"S"}),c.jsx("strong",{children:"STRIKE"}),c.jsx("small",{children:"workspace"})]}),c.jsxs("button",{type:"button",className:"palette-trigger","aria-label":"Open command palette",onClick:()=>{rl.current=document.activeElement instanceof HTMLElement?document.activeElement:null,Xn(!0)},children:["Commands ",c.jsx("kbd",{children:"⌘K"})]}),!Hl&&Yi("mode-switch header-mode-switch"),c.jsxs("div",{className:"session-line","aria-live":"polite",children:[c.jsx("span",{className:k.status.busy?"pulse busy":"pulse"}),!Hl&&(k.status.busy?"agent working":J),Wl&&c.jsx("button",{type:"button",className:"attention-summary","aria-label":Wl,onClick:()=>{const p=ni[0];p&&pl(p.id,!0)},children:Wl})]}),c.jsx("button",{className:"icon-button","aria-label":"Export markdown",title:"Export markdown",onClick:()=>Xl(),children:"↓"}),c.jsx("button",{className:"icon-button","aria-label":"Open settings",onClick:()=>Vn(!0),children:"⚙"}),c.jsx("button",{className:"icon-button","aria-label":"Toggle inspector","aria-pressed":fe,onClick:()=>{ze!=="desktop"&&Rt(!1),S(p=>!p)},children:"◫"})]}),Rs&&c.jsx("button",{type:"button",className:"shell-backdrop visible","aria-label":"Close panel",onClick:()=>{Rt(!1),S(!1)}}),c.jsxs("aside",{className:`navigation ${tn?"open":"collapsed"}`,"aria-label":"Agents panel",tabIndex:0,onKeyDown:p=>{p.target instanceof HTMLInputElement||p.target instanceof HTMLTextAreaElement||((p.key==="ArrowDown"||p.key==="j")&&(p.preventDefault(),tl(1)),(p.key==="ArrowUp"||p.key==="k")&&(p.preventDefault(),tl(-1)))},children:[c.jsx(Fm,{label:"Resize agents panel",value:Hn,min:180,max:420,onChange:Mn,side:"nav"}),a!=null&&a.capabilities.roots?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"aside-heading",children:[c.jsx("button",{className:`nav-tab ${O==="active"?"active":""}`,onClick:()=>$("active"),children:"ACTIVE"}),c.jsx("button",{className:`nav-tab ${O==="history"?"active":""}`,onClick:()=>$("history"),children:"HISTORY"})]}),O==="active"&&c.jsxs(c.Fragment,{children:[c.jsx("nav",{children:d.map(p=>{const j=Db(p,r),L=Mo(p.activeAt),Z=Wm(p);return c.jsxs("button",{type:"button",className:p.id===B&&z?"session active":"session",onClick:()=>void pl(p.id,!0),title:p.id,"aria-label":`${j}${Z?", needs attention":""}`,children:[c.jsx("span",{className:Z?"root-attention":p.busy?"root-busy":"root-idle","aria-hidden":!0}),c.jsxs("span",{className:"session-main",children:[c.jsx("span",{className:"session-title",children:j}),c.jsxs("span",{className:"session-meta",children:[p.agent||"—",L?` · ${L}`:"",p.hasRecentEvent&&!p.busy&&!Z?" · recent":""]})]}),c.jsxs("span",{className:"session-flags",children:[p.id===v&&c.jsx("small",{children:"ACTIVE"}),Z?c.jsx("small",{className:"needs-you",children:"NEEDS YOU"}):c.jsx("small",{children:p.busy?"BUSY":"IDLE"})]})]},p.id)})}),!(a!=null&&a.attachOnly)&&c.jsxs("div",{className:"session-actions",children:[c.jsx("button",{type:"button",onClick:()=>void ei(),children:"+ New workspace"}),c.jsx("button",{type:"button",disabled:!z||!B,onClick:()=>void kt(),children:"Close workspace"})]})]}),O==="history"&&c.jsx(qb,{sessions:r,activeRoots:d,selectedID:B,selectedIsLive:z,historySearch:Q,setHistorySearch:le,selectWorkspace:pl,handleResume:ti,boot:a,sessionAction:Zl})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"aside-heading",children:c.jsx("span",{children:"SESSIONS"})}),c.jsx("nav",{children:r.map(p=>{const j=p.id===y&&!(a!=null&&a.attachOnly),L=Mo(p.mtime);return c.jsxs("button",{type:"button",className:p.id===B?"session active history-row":"session history-row",onClick:()=>{ee({type:"client.ensure",id:p.id}),C(j)},title:p.id,children:[c.jsxs("span",{className:"session-main",children:[c.jsx("span",{className:"session-title",children:p.title||Ui(p.id)}),c.jsx("span",{className:"session-meta",children:[Ui(p.id),L].filter(Boolean).join(" · ")})]}),c.jsx("span",{className:"session-flags",children:j&&c.jsx("small",{className:"live-badge",children:"LIVE"})})]},p.id)})}),(a==null?void 0:a.capabilities.sessions)&&B&&c.jsx("div",{className:"session-actions","aria-label":"Session actions",children:c.jsx(Np,{onAction:p=>void Zl(p)})})]}),!Ea&&c.jsx(op,{children:E,selectedId:tt,onSelect:jt,onOpenTranscript:Jl}),c.jsxs("details",{className:"workspace-meta",children:[c.jsx("summary",{children:"Workspace"}),c.jsx("span",{children:"ROOT"}),c.jsx("code",{children:k.status.cwd||"unavailable"}),c.jsx("span",{children:"BUILD"}),c.jsx("code",{children:(a==null?void 0:a.version)||"…"})]})]}),c.jsxs("main",{children:[c.jsxs("div",{className:"runtime-stack",children:[c.jsxs("section",{className:"runtime","aria-label":"Runtime controls",children:[c.jsx(Ka,{label:"Provider",value:k.status.provider,values:wn.length?wn:k.status.provider?[k.status.provider]:[],disabled:Pe||!(a!=null&&a.capabilities.auth),onChange:p=>void Pn(p)}),c.jsx(Ka,{label:"Model",value:k.status.model,values:Ul.length?Ul:k.status.model?[k.status.model]:[],disabled:Pe||!(a!=null&&a.capabilities.catalog),onChange:p=>void xt("select.model",{provider:k.status.provider,model:p},B)}),c.jsx(Ka,{label:"Agent",value:k.status.agent,values:((a==null?void 0:a.agents)||[]).map(p=>p.name),disabled:Pe,onChange:p=>void xt("select.agent",{name:p},B)}),c.jsxs("div",{className:"runtime-more",children:[c.jsxs("button",{type:"button",className:"runtime-disclosure","aria-expanded":xn,"aria-controls":"runtime-secondary",onClick:()=>Ja(p=>!p),children:[c.jsx("span",{children:"Runtime…"}),!xn&&Bl&&c.jsx("span",{className:"runtime-summary",children:Bl})]}),xn&&c.jsxs("div",{id:"runtime-secondary",className:"runtime-secondary",role:"group","aria-label":"Secondary runtime controls",children:[c.jsx(Ka,{label:"Effort",value:k.status.effort,values:ic.effort,disabled:Pe,onChange:p=>void xt("set.effort",{level:p},B)}),c.jsx(Ka,{label:"Autonomy",value:k.status.autonomy,values:ic.autonomy,disabled:Pe,onChange:p=>void xt("set.autonomy",{mode:p},B)}),c.jsx(Ka,{label:"Permission",value:k.status.permissionMode,values:ic.permission,disabled:Pe,onChange:p=>void xt("set.permission_mode",{mode:p},B)}),(a==null?void 0:a.capabilities.sandbox)&&c.jsx(Ka,{label:"Sandbox",value:k.status.sandbox||($e==null?void 0:$e.mode),values:($e==null?void 0:$e.modes)||ic.sandbox,disabled:!nt||k.status.busy||!($e!=null&&$e.canChangeDefault),onChange:p=>void Na(p)}),(a==null?void 0:a.capabilities.sandbox)&&c.jsx("button",{type:"button",className:"runtime-explain",onClick:()=>void Gs(),children:"Explain"}),c.jsxs("label",{className:"fast-toggle",children:[c.jsx("input",{type:"checkbox",checked:P,disabled:Pe,onChange:p=>{jn(p.target.checked),xt("set.fast",{enabled:p.target.checked},B)}}),"FAST"]}),c.jsxs("label",{className:"fast-toggle",children:[c.jsx("input",{type:"checkbox","aria-label":"Show thinking",checked:ol,onChange:p=>{const j=p.target.checked;ja(j),Nb(j)}}),"THINK"]})]})]})]}),c.jsx(Bb,{status:k.status,modelRates:Jn})]}),c.jsx("div",{className:"sr-only","aria-live":"polite","aria-atomic":"true",children:Qe}),c.jsxs("section",{ref:Rl,className:"transcript","aria-label":"Conversation transcript",children:[!a&&J!=="connecting"?c.jsxs("div",{className:"empty-state",role:"alert",children:[c.jsx("span",{children:"ERROR"}),c.jsx("h1",{children:J}),c.jsxs("p",{children:["Failed to load cockpit. Open the URL printed by ",c.jsx("code",{children:"strike serve"})," (one-time ",c.jsx("code",{children:"?token="})," handoff sets a cookie), or send ",c.jsx("code",{children:"Authorization: Bearer"}),"."]})]}):!k.items.length&&c.jsxs("div",{className:"empty-state",children:[c.jsx("span",{children:"01 / READY"}),c.jsx("h1",{children:a!=null&&a.attachOnly?"Inspect the record.":"Direct the work."}),c.jsx("p",{children:a!=null&&a.attachOnly?"Select a durable session from the rail.":"Describe an outcome. Strike will plan, act, and report through the live engine seam."})]}),c.jsx(ib,{items:k.items,showThinking:ol,onFileRef:ql,scrollRef:Rl,stickToBottom:Dt.current}),c.jsx("div",{ref:Un}),Wn&&c.jsx("button",{type:"button",className:"jump-latest",onClick:hl,children:Fn>0?`${Fn} new — jump to latest`:"New activity — jump to latest"})]}),bn&&c.jsxs("div",{className:"onboard-hint",role:"status",children:[c.jsxs("p",{children:["Tip: ",c.jsx("kbd",{children:"⌘K"})," command palette · ",c.jsx("code",{children:"/"})," slash commands · ",c.jsx("code",{children:"@"})," mention files"]}),c.jsx("button",{type:"button",onClick:()=>{try{localStorage.setItem("strike.web.onboard.v1","1")}catch{}Qn(!1)},children:"Dismiss"})]}),c.jsxs("form",{className:"composer",onSubmit:Hs,children:[c.jsxs("label",{htmlFor:"prompt",children:["Instruction ",k.status.busy&&"— send to queue"]}),c.jsxs("div",{className:"composer-field",children:[(_t.length>0||qi)&&c.jsx("div",{ref:Bs,className:"completion",role:"listbox","aria-label":"Composer completions",children:_t.length===0?c.jsx("div",{children:Ht}):_t.map((p,j)=>c.jsxs("button",{type:"button",role:"option","aria-selected":j===$l,className:j===$l?"active":"",onMouseEnter:()=>$t(j),onClick:()=>Pa(p),children:[c.jsx("strong",{children:p.label}),c.jsx("span",{children:p.detail})]},p.label))}),c.jsx("textarea",{ref:ln,"aria-label":"Instruction",id:"prompt",value:pe,disabled:!nt,placeholder:nt?"Describe the next outcome… / command · @file":"Historical session — read only",onPaste:p=>void ml(p.clipboardData.files),onDrop:p=>{p.preventDefault(),ml(p.dataTransfer.files)},onDragOver:p=>p.preventDefault(),onChange:p=>Bi(p.currentTarget.value,p.currentTarget.selectionStart??p.currentTarget.value.length),onSelect:p=>sn(p.currentTarget),onKeyUp:p=>sn(p.currentTarget),onClick:p=>sn(p.currentTarget),onKeyDown:Ca})]}),me.length>0&&c.jsx("div",{className:"attachments",children:me.map((p,j)=>c.jsxs("button",{type:"button",onClick:()=>Ll(L=>L.filter((Z,F)=>F!==j)),children:[p.name," ×"]},`${p.name}-${j}`))}),!Ea&&c.jsx(fp,{queue:W,queueEdit:ue,setQueueEdit:ie,queueEditCancel:Ge,queueRef:Se,setQueue:an}),c.jsxs("div",{className:"composer-bar",children:[c.jsxs("span",{children:[c.jsx("kbd",{children:"↵"})," send · ",c.jsx("kbd",{children:"⇧↵"})," newline · ",c.jsx("kbd",{children:"↑"})," history"]}),c.jsxs("span",{children:[c.jsx("input",{ref:Ie,hidden:!0,type:"file",accept:"image/*",multiple:!0,onChange:p=>void ml(p.target.files)}),c.jsx("button",{type:"button",className:"composer-secondary",onClick:()=>{var p;return(p=Ie.current)==null?void 0:p.click()},children:"Attach"}),Bt.length>0&&c.jsx("button",{type:"button",className:"composer-secondary",onClick:()=>Et(Bt.at(-1)||""),children:"History"}),c.jsx("button",{type:"button",className:"composer-secondary",onClick:()=>Xl(),disabled:!k.items.length,children:"Export"}),k.status.busy&&c.jsx("button",{type:"button",className:"stop",onClick:()=>void xt("interrupt"),children:"Interrupt"}),c.jsx("button",{type:"submit",className:"composer-send",disabled:!pe.trim()||!nt,children:k.status.busy?"Queue":"Send"})]})]})]}),c.jsx(Wv,{open:cl,commands:Yl,onClose:()=>{Xn(!1);const p=rl.current;if(p&&document.contains(p))try{p.focus()}catch{}},onRun:Ys})]}),c.jsxs("aside",{className:`inspector ${fe?"open":"collapsed"}`,"aria-label":"Inspector",children:[c.jsx(Fm,{label:"Resize inspector panel",value:Yn,min:240,max:520,onChange:pn,side:"inspector"}),Ea&&c.jsx(rv,{contextLabel:Ap(k.status),provider:k.status.provider,model:k.status.model,phase:k.status.phase,fitWarning:k.fitWarning,childrenEntries:E,selectedChildId:tt,onSelectChild:jt,onOpenChildTranscript:Jl,queue:W,queueEdit:ue,setQueueEdit:ie,queueEditCancel:Ge,queueRef:Se,setQueue:an}),c.jsx(cb,{modeLabel:ki[U].label,surfaces:G,activeId:Vt,profile:ze,onChange:p=>{de(void 0),Va({mode:U,surface:p,entity:R}),el(p)}}),c.jsx("div",{className:"inspector-body",id:Vt?`inspector-panel-${Vt}`:void 0,role:"tabpanel",children:De.length?c.jsx(T.Suspense,{fallback:c.jsx(Ab,{label:Vt||"surface"}),children:c.jsx(Kb,{tab:Vt,boot:a,workspace:k,data:Li,loading:kl,expandedDiffs:ul,toggleDiff:Hi,isLive:nt,selectedID:B,onRefresh:()=>void el(Vt),sandbox:$e,onExplainSandbox:()=>void Gs(),unavailable:(V==null?void 0:V.id)===Vt?V:void 0,childrenEntries:E,selectedChildId:tt,onSelectChild:jt,onOpenChildTranscript:Jl,entity:R,onOpenSettings:()=>Vn(!0)})}):c.jsxs("p",{className:"muted",children:["No surfaces available for ",ki[U].label," on this host."]})})]}),Sa&&c.jsx(L0,{boot:a,status:k.status,providers:wn,rootID:B,isLive:nt,onClose:()=>Vn(!1)}),Xt&&$e&&c.jsx(Rb,{info:$e,status:k.status,onClose:()=>Fe(!1)}),St&&c.jsx(Jb,{preview:Kl,preferFiles:St.preferFiles,onCancel:()=>st(null),onConfirm:Ql}),k.permission&&c.jsx(Lb,{permission:k.permission,rootID:B,canExplain:!!(a!=null&&a.capabilities.permissions)}),k.question&&c.jsx(Zb,{question:k.question,rootID:B}),Hl&&Yi("mode-bottom-bar")]})}function kb(a){return String(a.permission||a.tool||a.name||"tool")}function Ub(a){const u=a.patterns;return Array.isArray(u)?u.map(r=>String(r)).filter(Boolean):typeof u=="string"&&u.trim()?[u]:[]}function Rb({info:a,status:u,onClose:r}){const o=T.useRef(null);T.useEffect(()=>{var h;(h=o.current)==null||h.showModal()},[]);const d=u.networkAllow||a.networkAllow||[];return c.jsxs("dialog",{ref:o,className:"sandbox-explain-dialog","aria-labelledby":"sandbox-explain-title",onClose:r,children:[c.jsx("div",{className:"dialog-rule"}),c.jsx("h2",{id:"sandbox-explain-title",children:"Sandbox explain"}),c.jsxs("dl",{className:"sandbox-summary",children:[c.jsx("dt",{children:"Active mode"}),c.jsx("dd",{children:u.sandbox||a.mode}),c.jsx("dt",{children:"Default mode"}),c.jsx("dd",{children:a.defaultMode||"—"}),c.jsx("dt",{children:"Backend"}),c.jsx("dd",{children:u.sandboxBackend||a.backend||(a.available?"available":"unavailable")}),c.jsx("dt",{children:"Network allow"}),c.jsx("dd",{children:d.length?d.join(", "):"(none — unrestricted public)"}),c.jsx("dt",{children:"Permission mode"}),c.jsx("dd",{children:u.permissionMode||a.permissionMode||"—"})]}),c.jsx("pre",{className:"sandbox-explain",children:a.explain||"No profile text."}),a.note&&c.jsx("p",{className:"muted",children:a.note}),c.jsx("div",{className:"dialog-actions",children:c.jsx("button",{autoFocus:!0,onClick:r,children:"Close"})})]})}function Lb({permission:a,rootID:u,canExplain:r}){const o=kb(a),d=Ub(a),h=d[0]||"*",[y,b]=T.useState(null),[v,g]=T.useState(""),[z,C]=T.useState(!1),O=ee=>void xt("permission.reply",{requestId:a.requestId,decision:ee},u),$=async()=>{if(!(!r||z)){C(!0),g("");try{const ee=new URLSearchParams({permission:o,pattern:h});b(await oe(`/v1/permissions/explain?${ee}`))}catch(ee){g(ee.message),b(null)}finally{C(!1)}}},Q=(y==null?void 0:y.Summary)||(y==null?void 0:y.summary)||"",le=(y==null?void 0:y.Action)||(y==null?void 0:y.action)||"",ye=(y==null?void 0:y.Layer)||(y==null?void 0:y.layer)||"";return c.jsxs(Cp,{title:"Permission required",children:[c.jsx("p",{className:"permission-tool",children:c.jsx("strong",{children:o})}),d.length>0?c.jsx("ul",{className:"permission-patterns","aria-label":"Permission patterns",children:d.map(ee=>c.jsx("li",{children:c.jsx("code",{children:ee})},ee))}):c.jsx("p",{className:"muted",children:"No pattern detail provided for this request."}),r&&c.jsxs("div",{className:"permission-explain",children:[c.jsx("button",{type:"button",onClick:()=>void $(),disabled:z,children:z?"Explaining…":"Why is this asked?"}),v&&c.jsx("p",{className:"permission-explain-error",role:"status",children:v}),Q&&c.jsxs("pre",{className:"permission-explain-body","aria-label":"Permission explanation",children:[Q,(le||ye)&&` +`)}`}function P0({item:a,onFileRef:u}){var d;const r=a.data||{},o=String(r.eventKind||r.kind||a.title||"").toLowerCase();if(o.includes("verification")||(d=a.title)!=null&&d.toLowerCase().includes("verification")){const h=r.passed===!0||r.verified===!0;return c.jsxs("article",{className:"message system semantic-event",children:[c.jsx("div",{className:"message-label",children:"Verification"}),c.jsxs("p",{children:[h?"Passed":r.passed===!1?"Failed":"Completed",r.summary?` — ${String(r.summary)}`:a.text?` — ${a.text}`:""]})]})}if(o.includes("overlap")||o.includes("path.overlap")){const h=String(r.path||"");return c.jsxs("article",{className:"message system semantic-event",children:[c.jsx("div",{className:"message-label",children:"Path overlap"}),c.jsxs("p",{children:[u&&h?c.jsx("button",{type:"button",className:"file-ref",onClick:()=>u(h),children:h}):h||"paths",Array.isArray(r.sessions)?` · ${r.sessions.length} sessions`:""]})]})}return o.includes("denied")||o.includes("permission")?c.jsxs("article",{className:"message system semantic-event",children:[c.jsx("div",{className:"message-label",children:"Permission denied"}),c.jsx("p",{children:a.text||String(r.message||r.permission||"Permission denied")})]}):o.includes("handoff")||o.includes("agent.message")?c.jsxs("article",{className:"message system semantic-event",children:[c.jsx("div",{className:"message-label",children:o.includes("handoff")?"Handoff":"Agent message"}),c.jsxs("p",{children:[r.from?`${String(r.from)} → `:"",r.to?String(r.to):"",r.summary||r.body||a.text?` — ${String(r.summary||r.body||a.text)}`:""]})]}):null}function jp({item:a,onFileRef:u}){const r=Us(a),o=Z0(a),d=J0(a),h=a.text.trim(),{text:y,truncated:b}=Sp(h);let v;try{v=JSON.parse(h)}catch{v=void 0}const g=$0.has(r)||F0(h),z=typeof(a.data||{}).path=="string"?String((a.data||{}).path):W0(h),C=(a.data||{}).args??(a.data||{}).input,O=o.kind==="running"?I0(y):y;return c.jsxs("details",{className:`tool-card state-${o.kind}`,children:[c.jsxs("summary",{children:[c.jsx("span",{className:"tool-name",children:r}),c.jsx("span",{className:`tool-state tool-state-${o.kind}`,children:o.label}),d&&c.jsx("small",{className:"tool-duration",children:d}),c.jsx("small",{children:g?"diff":v?"structured":b?"bounded":"output"})]}),C!==void 0&&c.jsxs("div",{className:"tool-args",children:[c.jsx("strong",{children:"Arguments"}),c.jsx("pre",{children:typeof C=="string"?C:JSON.stringify(C,null,2)})]}),g?c.jsx(V0,{text:O,path:z,onFileRef:u}):c.jsx("pre",{className:"tool-output",children:v?JSON.stringify(v,null,2):O})]})}function eb(a){const u=[];let r=0;for(;r=2?u.push({kind:"exploration",items:d,id:`explore-${d[0].id}`}):u.push({kind:"single",item:d[0]});continue}u.push({kind:"single",item:o}),r+=1}return u}function tb({items:a,onFileRef:u}){const r=T.useMemo(()=>{const o=new Map;for(const d of a){const h=Us(d);o.set(h,(o.get(h)||0)+1)}return[...o.entries()].map(([d,h])=>h>1?`${d}×${h}`:d).join(", ")},[a]);return c.jsxs("details",{className:"exploration-group",children:[c.jsxs("summary",{children:[c.jsx("span",{children:"Exploration"}),c.jsxs("small",{children:[a.length," steps · ",r]})]}),c.jsx("div",{className:"exploration-body",children:a.map(o=>c.jsx(jp,{item:o,onFileRef:u},o.id))})]})}function nb(a){if(a.kind!=="system"&&a.kind!=="tool")return!1;const u=`${a.title||""} ${JSON.stringify(a.data||{})}`.toLowerCase();return/verification|path\.overlap|overlap|permission|denied|handoff|agent\.message/.test(u)}function lb({item:a,showThinking:u=!0,onFileRef:r}){if(a.kind==="reasoning"&&!u)return null;if(nb(a)){const o=c.jsx(P0,{item:a,onFileRef:r});if(o)return o}return a.kind==="tool"?c.jsxs("article",{className:"message tool",children:[c.jsx("div",{className:"message-label",children:a.title||Us(a)}),c.jsx(jp,{item:a,onFileRef:r})]}):c.jsxs("article",{className:`message ${a.kind}`,children:[c.jsx("div",{className:"message-label",children:a.title||a.kind}),c.jsx(Q0,{text:a.text,onFileRef:r})]})}function Vm(a,u,r){return a.kind==="exploration"?c.jsxs("article",{className:"message tool exploration","aria-label":`Exploration ${a.items.length} steps`,children:[c.jsx("div",{className:"message-label",children:"Exploration"}),c.jsx(tb,{items:a.items,onFileRef:r})]}):c.jsx(lb,{item:a.item,showThinking:u,onFileRef:r})}function ab({items:a,showThinking:u=!0,onFileRef:r,scrollRef:o,stickToBottom:d=!1,virtualize:h}){const y=T.useMemo(()=>eb(a),[a]),b=h??y.length>40,v=T.useCallback(z=>z.kind==="exploration"?z.id:z.item.id,[]),g=T.useCallback(z=>Vm(z,u,r),[u,r]);return b?c.jsx(G0,{className:"transcript-list",items:y,itemKey:v,renderItem:g,scrollRef:o,stickToBottom:d,estimateHeight:120,overscan:8,maxMounted:80,"aria-label":"Conversation messages"}):c.jsx("div",{className:"transcript-list",role:"log","aria-label":"Conversation messages","data-virtual-mounted":y.length,"data-virtual-total":y.length,children:y.map(z=>c.jsx("div",{children:Vm(z,u,r)},v(z)))})}const ib=T.memo(ab);var So={};function sb(a,u={}){const r=typeof process<"u"&&!!(So!=null&&So.VITEST),o=u.schedule??(O=>r?(O(),-1):typeof requestAnimationFrame=="function"?requestAnimationFrame(O):setTimeout(O,16)),d=u.cancel??(O=>{O<0||(typeof cancelAnimationFrame=="function"?cancelAnimationFrame(O):clearTimeout(O))});let h=[],y,b=!1;const v=()=>{if(b=!1,y=void 0,!h.length)return;const O=h;h=[],a(O)};return{push:O=>{h.push(O),!b&&(b=!0,y=o(v))},flush:()=>{if(y!==void 0&&(d(y),y=void 0),b=!1,!h.length)return;const O=h;h=[],a(O)},clear:()=>{y!==void 0&&(d(y),y=void 0),b=!1,h=[]},pending:()=>h.length}}const ub=["shared","tools","provider","config_system","persona","phase","plan","lean_code","environment","instruction","project_memory","decision_ledger"];function cb({modeLabel:a,surfaces:u,activeId:r,profile:o,onChange:d,panelIdPrefix:h="inspector-panel"}){return u.length?o==="phone"?c.jsx("nav",{className:"surface-nav-sheet","aria-label":`${a} surfaces`,children:c.jsx("ul",{className:"surface-nav-list",role:"listbox","aria-label":`${a} surfaces`,children:u.map(y=>{const b=y.id===r;return c.jsx("li",{role:"option","aria-selected":b,children:c.jsx("button",{type:"button",className:b?"surface-nav-item active":"surface-nav-item","aria-current":b?"page":void 0,onClick:()=>d(y.id),children:c.jsx("span",{className:"surface-nav-label",children:y.label})})},y.id)})})}):c.jsx(Zg,{className:"inspector-tabs",label:`${a} surfaces`,value:r,items:u.map(y=>({id:y.id,label:y.label})),onChange:d,panelIdPrefix:h}):null}function xa(a){return(a||"").trim()}function Tp(a){const u=a.startsWith("?")||a.startsWith("#")?a.slice(1):a;return new URLSearchParams(u)}function Uo(a){const u=Tp(a),r=xa(u.get("root")),o=xa(u.get("session")),d=xa(u.get("mode")).toLowerCase(),h=d!=="",y=ko(d)?d:"chat";return{raw:{root:r,session:o,mode:y,surface:xa(u.get("surface")),entity:xa(u.get("entity")),path:xa(u.get("path")),pane:xa(u.get("pane")),agent:xa(u.get("agent"))},modePresent:h,modeRaw:d,workspaceID:r||o}}function rb(a,u=""){const r=Tp(u);r.delete("token");const o=(d,h,y)=>{y||!h?r.delete(d):r.set(d,h)};if("root"in a&&o("root",a.root||""),"session"in a&&o("session",a.session||""),"mode"in a){const d=a.mode||"";o("mode",d,!d||d==="chat")}return"surface"in a&&o("surface",a.surface||""),"entity"in a&&o("entity",a.entity||""),"path"in a&&o("path",a.path||""),"pane"in a&&o("pane",a.pane||""),"agent"in a&&o("agent",a.agent||""),r.toString()}function Va(a){try{const u=rb(a,location.search),r=`${location.pathname}${u?`?${u}`:""}${location.hash||""}`,o=`${location.pathname}${location.search}${location.hash||""}`;r!==o&&history.replaceState(null,"",r)}catch{}}function ob(a,u,r){const o=Uo(a),{raw:d,modePresent:h,modeRaw:y}=o;let b;h&&(b=ko(y)?y:"chat");const v=Yv({mode:b,surface:d.surface,path:d.path,pane:d.pane,agent:d.agent,caps:u,attachOnly:r==null?void 0:r.attachOnly,isLive:r==null?void 0:r.isLive});return{workspaceID:o.workspaceID,mode:v.mode,surface:v.surface,entity:d.entity,path:d.path,pane:d.pane,agent:d.agent,openDrawer:v.openDrawer,unavailable:v.unavailable}}function fb(a=typeof location<"u"?location.search:""){return Uo(a).workspaceID}const Zm={phoneMax:599,tabletMax:1023};function jo(a){return!Number.isFinite(a)||a<=0?"desktop":a<=Zm.phoneMax?"phone":a<=Zm.tabletMax?"tablet":"desktop"}function db(a){return a==="phone"}const hb=T.lazy(()=>en(()=>import("./Team-DUnnZtWp.js"),[]).then(a=>({default:a.TeamWorkspace}))),mb=T.lazy(()=>en(()=>import("./CodeExplorer-CTkRy4Rl.js"),[]).then(a=>({default:a.CodeExplorer}))),pb=T.lazy(()=>en(()=>import("./ArtifactsReview-B65rCcbV.js"),[]).then(a=>({default:a.ArtifactsPanel}))),yb=T.lazy(()=>en(()=>import("./ArtifactsReview-B65rCcbV.js"),[]).then(a=>({default:a.LedgerPanel}))),gb=T.lazy(()=>en(()=>import("./ArtifactsReview-B65rCcbV.js"),[]).then(a=>({default:a.TeamReviewPanel}))),vb=T.lazy(()=>en(()=>import("./MCP-CoXRwoSS.js"),[]).then(a=>({default:a.MCPPanel}))),bb=T.lazy(()=>en(()=>import("./Plugins-CJ0dCX91.js"),__vite__mapDeps([0,1,2])).then(a=>({default:a.PluginsPanel}))),Jm=T.lazy(()=>en(()=>import("./Panes-CWuiX4Ys.js"),__vite__mapDeps([3,2,1])).then(a=>({default:a.PanesPanel}))),xb=T.lazy(()=>en(()=>import("./Timeline-BA5GlsNC.js"),[]).then(a=>({default:a.TimelinePanel}))),Sb=T.lazy(()=>en(()=>import("./Diagnostics-C72nldsD.js"),[]).then(a=>({default:a.DiagnosticsPanel}))),jb=T.lazy(()=>en(()=>import("./Plans-CQoFK1S6.js"),[]).then(a=>({default:a.PlansPanel}))),Tb=T.lazy(()=>en(()=>import("./Goals-0kpFGULK.js"),[]).then(a=>({default:a.GoalsPanel}))),Eb=T.lazy(()=>en(()=>import("./Workflows-BFSMWcFc.js"),[]).then(a=>({default:a.WorkflowsPanel})));function Ab({label:a}){return c.jsx("section",{className:"unavailable",role:"status",children:c.jsxs("strong",{children:["Loading ",a,"…"]})})}const ic={effort:["low","medium","high","xhigh"],autonomy:["supervised","agent","checks","skip-all"],permission:["default","plan","soft-approve","accept-edits","yolo"],sandbox:["off","read-only","workspace-write"]},Ep="strike.web.showThinking",Cb=()=>{try{const a=sessionStorage.getItem(Ep);return a===null?!0:a==="1"||a==="true"}catch{return!0}},Nb=a=>{try{sessionStorage.setItem(Ep,a?"1":"0")}catch{}};function Ap(a){return a.contextUsed!==void 0&&a.contextLimit!==void 0?`${a.contextUsed.toLocaleString()} / ${a.contextLimit.toLocaleString()}`:a.contextUsed!==void 0?`${a.contextUsed.toLocaleString()} used`:"not reported"}const Ob=rc,xt=(a,u,r)=>Pm(a,u,r).catch(o=>window.alert(o.message)),Ui=a=>a.slice(0,12),zb=2e3,Wm=a=>!!(a.permissionPending||a.questionPending),Db=(a,u)=>{var r;return a.title||((r=u.find(o=>o.id===a.id))==null?void 0:r.title)||Ui(a.id)},Mo=a=>{if(!a)return"";const u=a<1e12?a*1e3:a,r=Math.max(0,Math.floor((Date.now()-u)/1e3));return r<60?"just now":r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:`${Math.floor(r/86400)}d ago`},Mb=()=>{try{return fb(location.search)}catch{return""}};function Ka({label:a,value:u,values:r,disabled:o,onChange:d}){return c.jsxs("label",{className:"runtime-field",children:[c.jsx("span",{children:a}),c.jsxs("select",{"aria-label":a,value:u||"",disabled:o,onChange:h=>d(h.target.value),children:[c.jsx("option",{value:"",children:"—"}),r.map(h=>c.jsx("option",{children:h},h))]})]})}function Cp({title:a,children:u}){const r=T.useRef(null);return T.useEffect(()=>{var o;(o=r.current)==null||o.showModal()},[]),c.jsxs("dialog",{ref:r,"aria-labelledby":"blocking-title",onCancel:o=>o.preventDefault(),children:[c.jsx("div",{className:"dialog-rule"}),c.jsx("h2",{id:"blocking-title",children:a}),u]})}const wb=a=>new Promise((u,r)=>{if(!a.type.startsWith("image/"))return r(new Error(`${a.name}: only image attachments are supported by the engine`));const o=new FileReader;o.onerror=()=>r(new Error(`${a.name}: read failed`)),o.onload=()=>u({name:a.name,mime:a.type,data:String(o.result).split(",")[1]||""}),o.readAsDataURL(a)});function _b(){const[a,u]=T.useState(),[r,o]=T.useState([]),[d,h]=T.useState([]),[y,b]=T.useState(""),[v,g]=T.useState(""),[z,C]=T.useState(!1),[O,$]=T.useState("active"),[Q,le]=T.useState(""),[ye,ee]=T.useReducer(zv,void 0,Ov),B=ye.selectedID,k=Dv(ye),pe=k.draft,W=k.queue,me=k.images,P=k.fast,[J,se]=T.useState("connecting"),[ue,ie]=T.useState(null),Se=T.useRef(null),Ge=T.useRef(!1),[St,st]=T.useState(null),[U,K]=T.useState("chat"),[I,te]=T.useState("context"),[fe,S]=T.useState(!1),[R,X]=T.useState(""),[V,de]=T.useState(),[ge,Ee]=T.useState(0),ut=T.useRef(!1),[ze,sl]=T.useState(()=>typeof window<"u"?jo(window.innerWidth):"desktop"),[tn,Rt]=T.useState(()=>typeof window<"u"?jo(window.innerWidth)==="desktop":!0),[Hn,Mn]=T.useState(240),[Yn,pn]=T.useState(340),[Li,Gn]=T.useState(),[kl,Lt]=T.useState(!1),[ul,qt]=T.useState(new Set),[wn,gt]=T.useState([]),[Ul,$n]=T.useState([]),[Bt,_n]=T.useState([]),[vt,nn]=T.useState(null),[cl,Xn]=T.useState(!1),[yn,Je]=T.useState([]),[Ht,We]=T.useState(""),[gn,kn]=T.useState(0),[Za,$t]=T.useState(0),[Kn,vn]=T.useState(!1),[bn,Qn]=T.useState(()=>{try{return localStorage.getItem("strike.web.onboard.v1")!=="1"}catch{return!1}}),[xn,Ja]=T.useState(!1),[Sa,Vn]=T.useState(!1),ln=T.useRef(null),Zn=T.useRef(null),rl=T.useRef(null),[ol,ja]=T.useState(Cb),[Jn,Sn]=T.useState(),[$e,fl]=T.useState(),[Xt,Fe]=T.useState(!1),[tt,jt]=T.useState(),Un=T.useRef(null),Rl=T.useRef(null),Dt=T.useRef(!0),[Wn,Kt]=T.useState(!1),[Fn,Yt]=T.useState(0),Mt=T.useRef(0),[Qe,Tt]=T.useState(""),Ie=T.useRef(null),Et=p=>{if(!B)return;const j=typeof p=="function"?p(pe):p;ee({type:"client.composer",id:B,patch:{draft:j}})},Ll=p=>{if(!B)return;const j=typeof p=="function"?p(me):p;ee({type:"client.composer",id:B,patch:{images:j}})},an=p=>{if(!B)return;const j=typeof p=="function"?p(W):p;ee({type:"client.composer",id:B,patch:{queue:j}})},jn=p=>{if(!B)return;const j=typeof p=="function"?p(P):p;ee({type:"client.composer",id:B,patch:{fast:j}})},dl=()=>xm().then(p=>(o(p.sessions||[]),b(p.liveId||""),p)),Qt=()=>jm().then(p=>(h(p.roots||[]),g(p.activeId||""),p)).catch(()=>{});T.useEffect(()=>{bp(Do())},[]),T.useEffect(()=>{const p=()=>{const j=jo(window.innerWidth);sl(L=>(L!==j&&(Rt(j==="desktop"),j!=="desktop"&&S(!1)),j))};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]),T.useEffect(()=>{const p=j=>{if((j.metaKey||j.ctrlKey)&&j.key.toLowerCase()==="k"){j.preventDefault(),rl.current=document.activeElement instanceof HTMLElement?document.activeElement:null,Xn(!0);return}if(j.key==="Escape"&&!document.querySelector("dialog[open]")){if(cl){j.preventDefault(),Xn(!1);return}if(fe){j.preventDefault(),S(!1);return}tn&&ze!=="desktop"&&(j.preventDefault(),Rt(!1))}};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[fe,tn,ze,cl]),T.useEffect(()=>{Promise.all([Mg(),xm(),jm().catch(()=>({roots:[],activeId:""}))]).then(([p,j,L])=>{var Oa,$s,Xs,li,Ks;u(p),se("connected"),o(j.sessions||[]);const Z=!!(p.capabilities.roots&&((Oa=L.roots)!=null&&Oa.length));b(j.liveId||(($s=p.status)==null?void 0:$s.sessionId)||"");const F=Z?L.roots||[]:[];h(F),g(L.activeId||j.liveId||((Xs=p.status)==null?void 0:Xs.sessionId)||"");const Ue=j.sessions||[],Ne=Mb(),_e=new Set(F.map(gl=>gl.id));let et=((li=F[0])==null?void 0:li.id)||(p.capabilities.roots?"":j.liveId)||"",Zt=et||((Ks=Ue[0])==null?void 0:Ks.id)||"",Rn=!!(et&&Zt===et);Ne&&(_e.has(Ne)||!p.capabilities.roots&&Ne===(j.liveId||"")?(Zt=Ne,et=Ne,Rn=!0):Ue.some(gl=>gl.id===Ne)&&(Zt=Ne,Rn=!1)),Zt&&(ee({type:"client.ensure",id:Zt}),p.status&&Rn&&ee({type:"client.event",id:Zt,envelope:{type:"status",data:p.status}})),C(Rn),$(Rn?"active":"history"),Rn&&Ne&&p.capabilities.roots&&!p.attachOnly&&Tm(Ne).then(()=>Qt()).catch(()=>{}),p.capabilities.auth&&oe("/v1/providers").then(gl=>gt(gl.providers.map(Qs=>Qs.Name||Qs.name||"").filter(Boolean))).catch(()=>{}),p.capabilities.history&&oe("/v1/history").then(gl=>_n(gl.entries||[])).catch(()=>{}),p.capabilities.sandbox&&Sm().then(fl).catch(()=>{})}).catch(p=>se(p.message))},[]),T.useEffect(()=>{if(!(a!=null&&a.capabilities.roots)||a.attachOnly)return;const p=()=>{Qt()},j=window.setInterval(p,zb);return()=>window.clearInterval(j)},[a==null?void 0:a.capabilities.roots,a==null?void 0:a.attachOnly]),T.useEffect(()=>{if(!B)return;ee({type:"client.ensure",id:B}),jt(void 0);const p=B,j=sb(F=>{ee({type:"client.events",id:p,envelopes:F})}),L=F=>j.push(F);if(!z){const F=$g(p,L,Ue=>se(Ue));return()=>{j.flush(),j.clear(),F()}}const Z=Gg(p,L,se);return()=>{j.flush(),j.clear(),Z.close()}},[B,z]),T.useEffect(()=>{if(!B||!(a!=null&&a.capabilities.sessions))return;let p=!1;return Xg(B).then(j=>{p||ee({type:"client.event",id:B,envelope:{type:"children.seed",time:`seed:${B}`,data:{sessions:j.sessions||[]}}})}).catch(()=>{}),()=>{p=!0}},[B,a==null?void 0:a.capabilities.sessions]),T.useEffect(()=>{const p=Rl.current;if(!p)return;const j=()=>{const Z=p.scrollHeight-p.scrollTop-p.clientHeight<80;Dt.current=Z,Z&&(Yt(0),Mt.current=k.items.length),Kt(!Z&&k.items.length>0)};return p.addEventListener("scroll",j,{passive:!0}),()=>p.removeEventListener("scroll",j)},[k.items.length]),T.useEffect(()=>{var p;if(!Dt.current){const j=k.items.length-Mt.current;j>0&&Yt(L=>L+j),Kt(k.items.length>0),Mt.current=k.items.length;return}Yt(0),Mt.current=k.items.length,(p=Un.current)==null||p.scrollIntoView({block:"end"}),Kt(!1)},[k.items]),T.useEffect(()=>{const p=[];k.status.busy?p.push("Agent working"):k.items.length&&p.push("Agent idle"),k.permission&&p.push("Permission required"),k.question&&p.push("Question pending");const j=p.join(". "),L=window.setTimeout(()=>Tt(j),400);return()=>window.clearTimeout(L)},[k.status.busy,k.permission,k.question,k.items.length]);const Ta=(p,j)=>{de(void 0),X(p),Va({mode:"code",surface:"files",entity:p}),K("code"),te("files"),S(!0),el("files")},Wa=T.useRef(Ta);Wa.current=Ta;const ql=T.useCallback((p,j)=>{Wa.current(p,j)},[]),hl=()=>{var p;Dt.current=!0,Kt(!1),Yt(0),Mt.current=k.items.length,(p=Un.current)==null||p.scrollIntoView({block:"end",behavior:"smooth"})};T.useEffect(()=>{if(!B||k.status.busy||!W.length||!z)return;const[p,...j]=W;ee({type:"client.composer",id:B,patch:{queue:j}}),xt("user.input",{text:p.text,images:p.images.map(({mime:L,data:Z})=>({mime:L,data:Z}))},B)},[k.status.busy,W,z,B]);const nt=!!(z&&B&&!(a!=null&&a.attachOnly)),Pe=!nt||k.status.busy,Bl=[k.status.effort,k.status.autonomy,k.status.permissionMode,P?"fast":""].filter(Boolean).join(" · "),E=T.useMemo(()=>Object.entries(k.children),[k.children]),G=T.useMemo(()=>Co(U,a==null?void 0:a.capabilities,{attachOnly:a==null?void 0:a.attachOnly,isLive:z,forceIds:V?[V.id]:[]}),[a,U,z,V,ge]),De=T.useMemo(()=>G.map(p=>p.id),[G]),pt=T.useMemo(()=>{var p,j;return{changedFiles:((p=k.changedFiles)==null?void 0:p.length)||0,teamMembers:Math.max(Object.keys(k.children||{}).length,Object.keys(((j=k.team)==null?void 0:j.members)||{}).length),permissionPending:!!k.permission||d.some(L=>L.permissionPending),questionPending:!!k.question||d.some(L=>L.questionPending),fitWarning:!!k.fitWarning}},[k.changedFiles,k.children,k.permission,k.question,k.fitWarning,d]),Vt=De.includes(I)?I:De[0]||"",wt={"--nav-width":ze==="desktop"?tn?`${Hn}px`:"0px":`${Hn}px`,"--inspector-width":ze==="desktop"?fe?`${Yn}px`:"0px":`${Yn}px`},Hl=db(ze),Rs=ze!=="desktop"&&(tn||fe),Ea=fe&&U==="chat";T.useLayoutEffect(()=>{var j;const p=Zn.current;p!=null&&(Zn.current=null,(j=ln.current)==null||j.setSelectionRange(p,p))});const Yl=T.useMemo(()=>$v({skills:a==null?void 0:a.skills,attachOnly:a==null?void 0:a.attachOnly,capabilities:a==null?void 0:a.capabilities}),[a]),In=T.useMemo(()=>{const p=Qv(pe,gn);return p.active?{start:p.start,query:p.query}:null},[pe,gn]),Fa=!!(In&&(a!=null&&a.capabilities.files)),Gl=T.useMemo(()=>{if(Fa)return yn.map(L=>({label:L,detail:"workspace file",insert:L}));const p=km(pe,gn);if(!p)return[];const j=[...Ob,...((a==null?void 0:a.skills)||[]).map(L=>({label:`/${L.name}`,detail:L.description||"Skill",insert:`/${L.name}`}))];return kv(j,p.query)},[pe,a,Fa,yn,gn]),_t=Kn||vt?[]:Gl,qi=Fa&&!Kn&&!vt&&_t.length===0&&Ht!=="",Ls=_t.length>0||qi,$l=Math.min(Za,Math.max(0,_t.length-1)),qs=T.useRef(!1),Bs=T.useRef(null);T.useEffect(()=>{const p=_t.length>0;p&&!qs.current?$t(0):$t(j=>Math.min(j,Math.max(0,_t.length-1))),qs.current=p},[_t.length]),T.useEffect(()=>{var p,j;(j=(p=Bs.current)==null?void 0:p.querySelector('[aria-selected="true"]'))==null||j.scrollIntoView({block:"nearest"})},[$l,_t.length]),T.useEffect(()=>{if(!In||!(a!=null&&a.capabilities.files)){Je([]),We("");return}const p=In.query,j=window.setTimeout(()=>{oe(`/v1/files/search?q=${encodeURIComponent(p)}&limit=12`).then(L=>{const Z=L.paths||[];Je(Z),We(Z.length?"":qm(p))}).catch(()=>{Je([]),We(qm(p,!0))})},120);return()=>window.clearTimeout(j)},[In,a==null?void 0:a.capabilities.files]);const Aa=p=>{!(a!=null&&a.capabilities.history)||!p.trim()||oe("/v1/history",{method:"POST",body:JSON.stringify({prompt:p})}).then(()=>oe("/v1/history")).then(j=>_n(j.entries||[])).catch(()=>{})},Ve=(p,j)=>{B&&ee({type:"client.event",id:B,envelope:{type:"local.system",time:String(Date.now()),data:{title:p,text:j}}})},Xl=()=>{var j;const p=ev(k.items,{sessionId:B||k.status.sessionId,title:(j=r.find(L=>L.id===B))==null?void 0:j.title,provider:k.status.provider,model:k.status.model,agent:k.status.agent});nv(tv(B||k.status.sessionId),p)},Ia=(p,j)=>{var Ue,Ne;const L=p.trim(),Z=((a==null?void 0:a.skills)||[]).map(_e=>_e.name),F=Uv(L,Z);switch(F.kind){case"pass":Aa(L),xt("user.input",{text:L,images:j.map(({mime:_e,data:et})=>({mime:_e,data:et}))},B);return;case"unknown":Ve("Unknown command",`${F.command} is not available in the web cockpit. Type /help for the list.`);return;case"usage":Ve("Usage",F.message);return;case"help":Ve("Help",Um((a==null?void 0:a.skills)||[]));return;case"export":Xl();return;case"queue":(Ue=Se.current)==null||Ue.scrollIntoView({block:"nearest",behavior:"smooth"}),Ve("Queue",W.length?`${W.length} prompt(s) queued — reorder, edit, or clear.`:"Queue is empty. Prompts sent while the agent is busy land here.");return;case"cost":Ve("Cost",_m(k.status,Jn));return;case"copy":{const _e=[...k.items].reverse().find(et=>et.kind==="assistant"&&et.text.trim());if(!_e){Ve("Copy","No assistant reply to copy.");return}(Ne=navigator.clipboard)==null||Ne.writeText(_e.text).then(()=>Ve("Copy","Last assistant reply copied to clipboard."),()=>Ve("Copy","Clipboard unavailable in this browser."));return}case"fork":Zl("fork");return;case"rename":{if(F.title){if(!(a!=null&&a.capabilities.sessions)){Ve("Rename","Sessions capability unavailable.");return}oe(`/v1/sessions/${encodeURIComponent(B)}`,{method:"PATCH",body:JSON.stringify({title:F.title})}).then(()=>dl()).catch(_e=>window.alert(_e.message));return}Zl("rename");return}case"fast":{const _e=F.enabled===void 0?!P:F.enabled;jn(_e),xt("set.fast",{enabled:_e},B);return}case"op":{let _e=F.data;if(F.type==="select.model"&&_e&&typeof _e=="object"){const et={..._e};et.provider||(et.provider=k.status.provider),_e=et}if(F.type==="rewind"){const et=!!(_e&&typeof _e=="object"&&_e.restoreFiles);st({preferFiles:et});return}xt(F.type,_e,B);return}}},Kl=k.undoStack.at(-1)||ov(),Ql=p=>{st(null),xt("rewind",p?{restoreFiles:!0}:{},B)},Hs=p=>{p.preventDefault();const j=pe.trim();!j||!nt||(k.status.busy?(Aa(j),an(L=>[...L,{text:j,images:me}])):Ia(j,me),nn(null),Et(""),Ll([]),Je([]),We(""),kn(0))},Pa=p=>{var et;if(vn(!0),In){const Zt=((et=ln.current)==null?void 0:et.selectionStart)??gn,Rn=Zv(pe,In.start,Zt,p.insert),Oa=Jv(In.start,p.insert,Rn);Zn.current=Oa,Et(Rn),kn(Oa),Je([]),We("");return}const j=km(pe,gn),L=(j==null?void 0:j.start)??0,Z=j?pe.slice(j.end):"",F=p.insert.replace(/\s+$/,""),Ue=/^\s/.test(Z)?"":" ",Ne=`${pe.slice(0,L)}${F}${Ue}${Z}`,_e=L+F.length+Ue.length;Zn.current=_e,Et(Ne),kn(_e)},Ys=p=>{var L;const j=p.action;if(p.requiresLive&&(!nt||a!=null&&a.attachOnly)){Ve("Unavailable",a!=null&&a.attachOnly?"Attach-only: this action requires a live workspace.":"Not available without a live session.");return}if(p.requiresCapability&&a&&!a.capabilities[p.requiresCapability]){Ve("Unavailable",`${p.requiresCapability} capability is not available on this host.`);return}switch(j.type){case"mode":Vl(j.mode,{openDrawer:j.mode!=="chat"});return;case"surface":Vl(j.mode,{openDrawer:!0,surface:j.surface});return;case"slash":j.run?Ia(j.insert.trim(),[]):(Et(j.insert),(L=ln.current)==null||L.focus());return;case"session":j.action==="export"?Xl():j.action==="help"?Ve("Help",Um((a==null?void 0:a.skills)||[])):j.action==="settings"?Vn(!0):j.action==="cost"?Ve("Cost",_m(k.status)):j.action==="fork"?Zl("fork"):j.action==="interrupt"&&xt("interrupt");return;case"notice":Ve(j.title,j.body);return}},Ca=p=>{var Z;const j=p.currentTarget;if(Ls){const F=p.key==="ArrowDown"||p.ctrlKey&&!p.metaKey&&!p.altKey&&p.key.toLowerCase()==="n",Ue=p.key==="ArrowUp";if(F||Ue){p.preventDefault(),_t.length>0&&$t(Ne=>F?Math.min(_t.length-1,Ne+1):Math.max(0,Ne-1));return}if(p.key==="Enter"&&!p.shiftKey||p.key==="Tab"&&!p.shiftKey){p.preventDefault();const Ne=_t[$l]||_t[0];Ne&&Pa(Ne);return}if(p.key==="Escape"){p.preventDefault(),p.stopPropagation(),vn(!0);return}}if(p.key==="Enter"&&!p.shiftKey){p.preventDefault(),(Z=j.form)==null||Z.requestSubmit();return}const L=j.selectionStart===0&&j.selectionEnd===0;if((p.key==="ArrowUp"||p.key==="ArrowDown")&&Bt.length&&(vt||pe===""&&L)){if(p.preventDefault(),p.key==="ArrowUp")if(!vt)nn({index:Bt.length-1,draft:pe}),Et(Bt[Bt.length-1]||"");else{const F=Math.max(0,vt.index-1);nn({...vt,index:F}),Et(Bt[F]||"")}else if(vt)if(vt.index>=Bt.length-1)Et(vt.draft),nn(null);else{const F=vt.index+1;nn({...vt,index:F}),Et(Bt[F]||"")}return}},sn=p=>{kn(p.selectionStart??p.value.length)},Bi=(p,j)=>{vt&&nn(null),vn(!1),$t(0),Et(p),kn(j)},ml=async p=>{if(p)try{const j=await Promise.all([...p].map(wb));Ll(L=>[...L,...j])}catch(j){window.alert(j.message)}},Pn=async p=>{xt("select.model",{provider:p},B),a!=null&&a.capabilities.catalog&&oe(`/v1/models?provider=${encodeURIComponent(p)}`).then(j=>{const L=j.models||[];$n(L.map(Ue=>String(Ue.ID||Ue.id||"")).filter(Boolean));const Z=k.status.model,F=L.find(Ue=>String(Ue.ID||Ue.id||"")===Z)||L[0];Sn(F?{inputPerM:Number(F.InputCost??F.inputCost??0),outputPerM:Number(F.OutputCost??F.outputCost??0),hasCost:!!(F.HasCost??F.hasCost),context:Number(F.Context??F.context??0)||void 0}:void 0)}).catch(()=>{$n([]),Sn(void 0)})};T.useEffect(()=>{!(a!=null&&a.capabilities.catalog)||!k.status.provider||oe(`/v1/models?provider=${encodeURIComponent(k.status.provider)}`).then(p=>{const j=p.models||[];$n(j.map(Z=>String(Z.ID||Z.id||"")).filter(Boolean));const L=j.find(Z=>String(Z.ID||Z.id||"")===k.status.model);L&&Sn({inputPerM:Number(L.InputCost??L.inputCost??0),outputPerM:Number(L.OutputCost??L.outputCost??0),hasCost:!!(L.HasCost??L.hasCost),context:Number(L.Context??L.context??0)||void 0})}).catch(()=>{})},[a==null?void 0:a.capabilities.catalog,k.status.provider,k.status.model]);const el=async(p,j)=>{te(p);const L=ks(p),Z=(()=>{if(!(!L||!a)&&!(L.capability==="always"||L.capability==="team"||L.capability==="live"||L.capability==="sessions")){if(L.capability==="lsp"&&!a.capabilities.lsp)return{id:p,reason:"capability lsp unavailable"};if(typeof L.capability=="string"&&L.capability!=="lsp"&&!a.capabilities[L.capability])return{id:p,reason:`capability ${L.capability} unavailable`}}})();de(Z),(j==null?void 0:j.open)!==!1&&S(!0),Lt(!0),Gn(void 0);try{if(Z)return;Gn(p==="files"?a!=null&&a.capabilities.files?await oe(`/v1/changed-files${B?`?root=${encodeURIComponent(B)}`:""}`).catch(F=>({error:F.message})):void 0:p==="memory"?a!=null&&a.capabilities.memory?await oe("/v1/memory").catch(F=>({error:F.message})):void 0:p==="issues"&&a!=null&&a.capabilities.issues?await oe("/v1/issues").catch(F=>({error:F.message})):void 0)}finally{Lt(!1)}},Vl=(p,j)=>{if(K(p),(j==null?void 0:j.entity)!==void 0&&X(j.entity),p==="chat"&&!(j!=null&&j.surface)){(j==null?void 0:j.openDrawer)===!1||(j==null||j.openDrawer),Va({mode:"chat",surface:"",entity:(j==null?void 0:j.entity)||""});return}const L=(j==null?void 0:j.surface)||No(p,a==null?void 0:a.capabilities,{attachOnly:a==null?void 0:a.attachOnly,isLive:z});L&&el(L,{open:(j==null?void 0:j.openDrawer)!==!1}),Va({mode:p,surface:L||"",entity:(j==null?void 0:j.entity)||R})};T.useEffect(()=>{if(!a)return;if(!a.capabilities.panes){go(),Ee(j=>j+1);return}let p=!1;return en(async()=>{const{listPanes:j}=await import("./panesApi-Gdyy8rqS.js");return{listPanes:j}},[]).then(({listPanes:j})=>j()).then(j=>{if(!p){go();for(const L of j.panes||[]){const Z=Lv(L);Z&&Rv(Z)}Ee(L=>L+1)}}).catch(()=>{p||Ee(j=>j+1)}),()=>{p=!0,go()}},[a]),T.useEffect(()=>{var L;if(!a||ut.current||Uo(location.search).raw.surface.startsWith("pane:")&&ge===0)return;ut.current=!0;const j=ob(location.search,a.capabilities,{attachOnly:a.attachOnly,isLive:z||!!a.capabilities.live});if(K(j.mode),j.entity&&X(j.entity),j.agent&&jt(j.agent),j.unavailable&&de(j.unavailable),j.surface)el(j.surface,{open:j.openDrawer});else{const Z=Co("chat",a.capabilities,{attachOnly:a.attachOnly});if(Z.length){const F=((L=Z.find(Ue=>Ue.id==="files"))==null?void 0:L.id)||Z[0].id;el(F,{open:!1})}}},[a,ge]);const Zl=async p=>{var L;if(!(a!=null&&a.capabilities.sessions)||!B)return;const j=B;try{if(p==="fork"){await oe(`/v1/sessions/${encodeURIComponent(j)}/fork`,{method:"POST"}),await Promise.all([dl(),Qt()]);return}if(p==="rename"){const Z=window.prompt("Session title");if(Z===null)return;await oe(`/v1/sessions/${encodeURIComponent(j)}`,{method:"PATCH",body:JSON.stringify({title:Z})})}if(p==="delete"){if(!window.confirm("Delete this durable session?"))return;await oe(`/v1/sessions/${encodeURIComponent(j)}`,{method:"DELETE"}),ee({type:"client.drop",id:j});const Z=await dl();await Qt();const F=((L=((Z==null?void 0:Z.sessions)||[]).find(Ue=>Ue.id!==j))==null?void 0:L.id)||"";if(F){ee({type:"client.ensure",id:F});const Ue=!!(Z!=null&&Z.liveId&&F===Z.liveId||d.some(Ne=>Ne.id===F));C(Ue),$(Ue?"active":"history")}return}await Promise.all([dl(),Qt()])}catch(Z){window.alert(Z.message)}},ei=async()=>{if(!(!(a!=null&&a.capabilities.roots)||a.attachOnly))try{const p=await Ug();await Qt(),ee({type:"client.ensure",id:p.id}),C(!0),$("active")}catch(p){window.alert(p.message)}},ti=async p=>{if(!(!(a!=null&&a.capabilities.roots)||a.attachOnly))try{const j=await Rg(p);await Qt(),ee({type:"client.ensure",id:j.id}),C(!0),$("active")}catch(j){window.alert(j.message)}},pl=async(p,j)=>{if(ee({type:"client.ensure",id:p}),C(j),Sn(void 0),X(""),jt(void 0),!(!j||!(a!=null&&a.capabilities.roots)||a.attachOnly))try{if(await Tm(p),await Qt(),a!=null&&a.capabilities.team){const L=await wg(p).catch(()=>null);L&&ee({type:"client.event",id:p,envelope:{type:"team.snapshot",time:`snap:${p}`,data:L}})}}catch(L){window.alert(L.message)}},kt=async()=>{var L,Z,F,Ue;if(!(a!=null&&a.capabilities.roots)||a.attachOnly||!z||!B)return;const p=d.find(Ne=>Ne.id===B),j=p!=null&&p.busy?"This workspace is busy. Close/stop it anyway?":"Close this workspace?";if(window.confirm(j))try{await Lg(B);const[Ne,_e]=await Promise.all([Qt(),dl()]),et=(Ne==null?void 0:Ne.activeId)||((Z=(L=Ne==null?void 0:Ne.roots)==null?void 0:L[0])==null?void 0:Z.id)||"";if(et)ee({type:"client.ensure",id:et}),C(!0),$("active");else{const Zt=((Ue=(F=_e==null?void 0:_e.sessions)==null?void 0:F[0])==null?void 0:Ue.id)||"";Zt&&ee({type:"client.ensure",id:Zt}),C(!1),$("history")}}catch(Ne){window.alert(Ne.message)}},tl=p=>{if(!(a!=null&&a.capabilities.roots)){if(!r.length)return;const j=Math.max(0,r.findIndex(Z=>Z.id===B)),L=r[(j+p+r.length)%r.length];L&&(ee({type:"client.ensure",id:L.id}),C(L.id===y&&!(a!=null&&a.attachOnly)));return}if(O==="active"&&d.length){const j=Math.max(0,d.findIndex(Z=>Z.id===B&&z)),L=d[(j+p+d.length)%d.length];L&&pl(L.id,!0);return}if(r.length){const j=Math.max(0,r.findIndex(Z=>Z.id===B)),L=r[(j+p+r.length)%r.length];if(L){const Z=d.some(F=>F.id===L.id);pl(L.id,Z)}}},Jl=p=>{jt(void 0),pl(p,!1),$("history")},Na=async p=>{if(!(a!=null&&a.capabilities.sandbox)||!($e!=null&&$e.canChangeDefault))return;const j=String(k.status.permissionMode||$e.permissionMode||"");let L=!1;if(p==="off"&&j==="yolo"){if(L=window.confirm("permissionMode is yolo and sandbox off disables OS isolation. Continue only if you understand the risk (equivalent to --i-know)."),!L)return}else if(p!==($e.defaultMode||k.status.sandbox)&&!window.confirm(`Save sandbox default "${p}" for new sessions? Active session stays "${k.status.sandbox||$e.mode||"workspace-write"}".`))return;try{const Z=await _g(p,L,B||void 0);fl(Z),window.alert(`Sandbox default saved as ${Z.defaultMode||p}. Active session mode is unchanged until a new session starts.`)}catch(Z){window.alert(Z.message)}},Gs=async()=>{if(a!=null&&a.capabilities.sandbox)try{const p=await Sm(B||void 0);fl(p),Fe(!0)}catch(p){window.alert(p.message)}},Hi=p=>qt(j=>{const L=new Set(j);return L.has(p)?L.delete(p):L.add(p),L}),ni=d.filter(p=>Wm(p)&&!(p.id===B&&z)),yl=ni.length,Wl=yl>0?`${yl} need${yl===1?"s":""} you`:"",Yi=p=>c.jsx("nav",{className:p,"aria-label":"Workspace mode",children:_o.map(j=>{const L=ki[j],Z=Hv(j,pt),F=U===j;return c.jsxs("button",{type:"button",className:F?"mode-btn active":"mode-btn","aria-pressed":F,"aria-current":F?"page":void 0,"aria-label":`${L.label}: ${L.description}${Z==="needs-you"?", needs attention":Z==="badge"?", activity":""}`,onClick:()=>{Hl&&Rt(!1),Vl(j,{openDrawer:j!=="chat"})},children:[c.jsx("span",{children:L.label}),Z!=="none"&&c.jsx("span",{className:Z==="needs-you"?"mode-attn needs-you":"mode-attn","aria-hidden":!0})]},j)})});return c.jsxs("div",{className:"app-shell",style:wt,"data-shell":ze,children:[c.jsxs("header",{children:[c.jsx("button",{className:"icon-button","aria-label":"Toggle agents panel","aria-pressed":tn,onClick:()=>{S(!1),Rt(p=>!p)},children:"☰"}),c.jsxs("div",{className:"wordmark",children:[c.jsx("span",{className:"mark",children:"S"}),c.jsx("strong",{children:"STRIKE"}),c.jsx("small",{children:"workspace"})]}),c.jsxs("button",{type:"button",className:"palette-trigger","aria-label":"Open command palette",onClick:()=>{rl.current=document.activeElement instanceof HTMLElement?document.activeElement:null,Xn(!0)},children:["Commands ",c.jsx("kbd",{children:"⌘K"})]}),!Hl&&Yi("mode-switch header-mode-switch"),c.jsxs("div",{className:"session-line","aria-live":"polite",children:[c.jsx("span",{className:k.status.busy?"pulse busy":"pulse"}),!Hl&&(k.status.busy?"agent working":J),Wl&&c.jsx("button",{type:"button",className:"attention-summary","aria-label":Wl,onClick:()=>{const p=ni[0];p&&pl(p.id,!0)},children:Wl})]}),c.jsx("button",{className:"icon-button","aria-label":"Export markdown",title:"Export markdown",onClick:()=>Xl(),children:"↓"}),c.jsx("button",{className:"icon-button","aria-label":"Open settings",onClick:()=>Vn(!0),children:"⚙"}),c.jsx("button",{className:"icon-button","aria-label":"Toggle inspector","aria-pressed":fe,onClick:()=>{ze!=="desktop"&&Rt(!1),S(p=>!p)},children:"◫"})]}),Rs&&c.jsx("button",{type:"button",className:"shell-backdrop visible","aria-label":"Close panel",onClick:()=>{Rt(!1),S(!1)}}),c.jsxs("aside",{className:`navigation ${tn?"open":"collapsed"}`,"aria-label":"Agents panel",tabIndex:0,onKeyDown:p=>{p.target instanceof HTMLInputElement||p.target instanceof HTMLTextAreaElement||((p.key==="ArrowDown"||p.key==="j")&&(p.preventDefault(),tl(1)),(p.key==="ArrowUp"||p.key==="k")&&(p.preventDefault(),tl(-1)))},children:[c.jsx(Fm,{label:"Resize agents panel",value:Hn,min:180,max:420,onChange:Mn,side:"nav"}),a!=null&&a.capabilities.roots?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"aside-heading",children:[c.jsx("button",{className:`nav-tab ${O==="active"?"active":""}`,onClick:()=>$("active"),children:"ACTIVE"}),c.jsx("button",{className:`nav-tab ${O==="history"?"active":""}`,onClick:()=>$("history"),children:"HISTORY"})]}),O==="active"&&c.jsxs(c.Fragment,{children:[c.jsx("nav",{children:d.map(p=>{const j=Db(p,r),L=Mo(p.activeAt),Z=Wm(p);return c.jsxs("button",{type:"button",className:p.id===B&&z?"session active":"session",onClick:()=>void pl(p.id,!0),title:p.id,"aria-label":`${j}${Z?", needs attention":""}`,children:[c.jsx("span",{className:Z?"root-attention":p.busy?"root-busy":"root-idle","aria-hidden":!0}),c.jsxs("span",{className:"session-main",children:[c.jsx("span",{className:"session-title",children:j}),c.jsxs("span",{className:"session-meta",children:[p.agent||"—",L?` · ${L}`:"",p.hasRecentEvent&&!p.busy&&!Z?" · recent":""]})]}),c.jsxs("span",{className:"session-flags",children:[p.id===v&&c.jsx("small",{children:"ACTIVE"}),Z?c.jsx("small",{className:"needs-you",children:"NEEDS YOU"}):c.jsx("small",{children:p.busy?"BUSY":"IDLE"})]})]},p.id)})}),!(a!=null&&a.attachOnly)&&c.jsxs("div",{className:"session-actions",children:[c.jsx("button",{type:"button",onClick:()=>void ei(),children:"+ New workspace"}),c.jsx("button",{type:"button",disabled:!z||!B,onClick:()=>void kt(),children:"Close workspace"})]})]}),O==="history"&&c.jsx(qb,{sessions:r,activeRoots:d,selectedID:B,selectedIsLive:z,historySearch:Q,setHistorySearch:le,selectWorkspace:pl,handleResume:ti,boot:a,sessionAction:Zl})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"aside-heading",children:c.jsx("span",{children:"SESSIONS"})}),c.jsx("nav",{children:r.map(p=>{const j=p.id===y&&!(a!=null&&a.attachOnly),L=Mo(p.mtime);return c.jsxs("button",{type:"button",className:p.id===B?"session active history-row":"session history-row",onClick:()=>{ee({type:"client.ensure",id:p.id}),C(j)},title:p.id,children:[c.jsxs("span",{className:"session-main",children:[c.jsx("span",{className:"session-title",children:p.title||Ui(p.id)}),c.jsx("span",{className:"session-meta",children:[Ui(p.id),L].filter(Boolean).join(" · ")})]}),c.jsx("span",{className:"session-flags",children:j&&c.jsx("small",{className:"live-badge",children:"LIVE"})})]},p.id)})}),(a==null?void 0:a.capabilities.sessions)&&B&&c.jsx("div",{className:"session-actions","aria-label":"Session actions",children:c.jsx(Np,{onAction:p=>void Zl(p)})})]}),!Ea&&c.jsx(op,{children:E,selectedId:tt,onSelect:jt,onOpenTranscript:Jl}),c.jsxs("details",{className:"workspace-meta",children:[c.jsx("summary",{children:"Workspace"}),c.jsx("span",{children:"ROOT"}),c.jsx("code",{children:k.status.cwd||"unavailable"}),c.jsx("span",{children:"BUILD"}),c.jsx("code",{children:(a==null?void 0:a.version)||"…"})]})]}),c.jsxs("main",{children:[c.jsxs("div",{className:"runtime-stack",children:[c.jsxs("section",{className:"runtime","aria-label":"Runtime controls",children:[c.jsx(Ka,{label:"Provider",value:k.status.provider,values:wn.length?wn:k.status.provider?[k.status.provider]:[],disabled:Pe||!(a!=null&&a.capabilities.auth),onChange:p=>void Pn(p)}),c.jsx(Ka,{label:"Model",value:k.status.model,values:Ul.length?Ul:k.status.model?[k.status.model]:[],disabled:Pe||!(a!=null&&a.capabilities.catalog),onChange:p=>void xt("select.model",{provider:k.status.provider,model:p},B)}),c.jsx(Ka,{label:"Agent",value:k.status.agent,values:((a==null?void 0:a.agents)||[]).map(p=>p.name),disabled:Pe,onChange:p=>void xt("select.agent",{name:p},B)}),c.jsxs("div",{className:"runtime-more",children:[c.jsxs("button",{type:"button",className:"runtime-disclosure","aria-expanded":xn,"aria-controls":"runtime-secondary",onClick:()=>Ja(p=>!p),children:[c.jsx("span",{children:"Runtime…"}),!xn&&Bl&&c.jsx("span",{className:"runtime-summary",children:Bl})]}),xn&&c.jsxs("div",{id:"runtime-secondary",className:"runtime-secondary",role:"group","aria-label":"Secondary runtime controls",children:[c.jsx(Ka,{label:"Effort",value:k.status.effort,values:ic.effort,disabled:Pe,onChange:p=>void xt("set.effort",{level:p},B)}),c.jsx(Ka,{label:"Autonomy",value:k.status.autonomy,values:ic.autonomy,disabled:Pe,onChange:p=>void xt("set.autonomy",{mode:p},B)}),c.jsx(Ka,{label:"Permission",value:k.status.permissionMode,values:ic.permission,disabled:Pe,onChange:p=>void xt("set.permission_mode",{mode:p},B)}),(a==null?void 0:a.capabilities.sandbox)&&c.jsx(Ka,{label:"Sandbox",value:k.status.sandbox||($e==null?void 0:$e.mode),values:($e==null?void 0:$e.modes)||ic.sandbox,disabled:!nt||k.status.busy||!($e!=null&&$e.canChangeDefault),onChange:p=>void Na(p)}),(a==null?void 0:a.capabilities.sandbox)&&c.jsx("button",{type:"button",className:"runtime-explain",onClick:()=>void Gs(),children:"Explain"}),c.jsxs("label",{className:"fast-toggle",children:[c.jsx("input",{type:"checkbox",checked:P,disabled:Pe,onChange:p=>{jn(p.target.checked),xt("set.fast",{enabled:p.target.checked},B)}}),"FAST"]}),c.jsxs("label",{className:"fast-toggle",children:[c.jsx("input",{type:"checkbox","aria-label":"Show thinking",checked:ol,onChange:p=>{const j=p.target.checked;ja(j),Nb(j)}}),"THINK"]})]})]})]}),c.jsx(Bb,{status:k.status,modelRates:Jn})]}),c.jsx("div",{className:"sr-only","aria-live":"polite","aria-atomic":"true",children:Qe}),c.jsxs("section",{ref:Rl,className:"transcript","aria-label":"Conversation transcript",children:[!a&&J!=="connecting"?c.jsxs("div",{className:"empty-state",role:"alert",children:[c.jsx("span",{children:"ERROR"}),c.jsx("h1",{children:J}),c.jsxs("p",{children:["Failed to load cockpit. Open the URL printed by ",c.jsx("code",{children:"strike serve"})," (one-time ",c.jsx("code",{children:"?token="})," handoff sets a cookie), or send ",c.jsx("code",{children:"Authorization: Bearer"}),"."]})]}):!k.items.length&&c.jsxs("div",{className:"empty-state",children:[c.jsx("span",{children:"01 / READY"}),c.jsx("h1",{children:a!=null&&a.attachOnly?"Inspect the record.":"Direct the work."}),c.jsx("p",{children:a!=null&&a.attachOnly?"Select a durable session from the rail.":"Describe an outcome. Strike will plan, act, and report through the live engine seam."})]}),c.jsx(ib,{items:k.items,showThinking:ol,onFileRef:ql,scrollRef:Rl,stickToBottom:Dt.current}),c.jsx("div",{ref:Un}),Wn&&c.jsx("button",{type:"button",className:"jump-latest",onClick:hl,children:Fn>0?`${Fn} new — jump to latest`:"New activity — jump to latest"})]}),bn&&c.jsxs("div",{className:"onboard-hint",role:"status",children:[c.jsxs("p",{children:["Tip: ",c.jsx("kbd",{children:"⌘K"})," command palette · ",c.jsx("code",{children:"/"})," slash commands · ",c.jsx("code",{children:"@"})," mention files"]}),c.jsx("button",{type:"button",onClick:()=>{try{localStorage.setItem("strike.web.onboard.v1","1")}catch{}Qn(!1)},children:"Dismiss"})]}),c.jsxs("form",{className:"composer",onSubmit:Hs,children:[c.jsxs("label",{htmlFor:"prompt",children:["Instruction ",k.status.busy&&"— send to queue"]}),c.jsxs("div",{className:"composer-field",children:[(_t.length>0||qi)&&c.jsx("div",{ref:Bs,className:"completion",role:"listbox","aria-label":"Composer completions",children:_t.length===0?c.jsx("div",{children:Ht}):_t.map((p,j)=>c.jsxs("button",{type:"button",role:"option","aria-selected":j===$l,className:j===$l?"active":"",onMouseEnter:()=>$t(j),onClick:()=>Pa(p),children:[c.jsx("strong",{children:p.label}),c.jsx("span",{children:p.detail})]},p.label))}),c.jsx("textarea",{ref:ln,"aria-label":"Instruction",id:"prompt",value:pe,disabled:!nt,placeholder:nt?"Describe the next outcome… / command · @file":"Historical session — read only",onPaste:p=>void ml(p.clipboardData.files),onDrop:p=>{p.preventDefault(),ml(p.dataTransfer.files)},onDragOver:p=>p.preventDefault(),onChange:p=>Bi(p.currentTarget.value,p.currentTarget.selectionStart??p.currentTarget.value.length),onSelect:p=>sn(p.currentTarget),onKeyUp:p=>sn(p.currentTarget),onClick:p=>sn(p.currentTarget),onKeyDown:Ca})]}),me.length>0&&c.jsx("div",{className:"attachments",children:me.map((p,j)=>c.jsxs("button",{type:"button",onClick:()=>Ll(L=>L.filter((Z,F)=>F!==j)),children:[p.name," ×"]},`${p.name}-${j}`))}),!Ea&&c.jsx(fp,{queue:W,queueEdit:ue,setQueueEdit:ie,queueEditCancel:Ge,queueRef:Se,setQueue:an}),c.jsxs("div",{className:"composer-bar",children:[c.jsxs("span",{children:[c.jsx("kbd",{children:"↵"})," send · ",c.jsx("kbd",{children:"⇧↵"})," newline · ",c.jsx("kbd",{children:"↑"})," history"]}),c.jsxs("span",{children:[c.jsx("input",{ref:Ie,hidden:!0,type:"file",accept:"image/*",multiple:!0,onChange:p=>void ml(p.target.files)}),c.jsx("button",{type:"button",className:"composer-secondary",onClick:()=>{var p;return(p=Ie.current)==null?void 0:p.click()},children:"Attach"}),Bt.length>0&&c.jsx("button",{type:"button",className:"composer-secondary",onClick:()=>Et(Bt.at(-1)||""),children:"History"}),c.jsx("button",{type:"button",className:"composer-secondary",onClick:()=>Xl(),disabled:!k.items.length,children:"Export"}),k.status.busy&&c.jsx("button",{type:"button",className:"stop",onClick:()=>void xt("interrupt"),children:"Interrupt"}),c.jsx("button",{type:"submit",className:"composer-send",disabled:!pe.trim()||!nt,children:k.status.busy?"Queue":"Send"})]})]})]}),c.jsx(Wv,{open:cl,commands:Yl,onClose:()=>{Xn(!1);const p=rl.current;if(p&&document.contains(p))try{p.focus()}catch{}},onRun:Ys})]}),c.jsxs("aside",{className:`inspector ${fe?"open":"collapsed"}`,"aria-label":"Inspector",children:[c.jsx(Fm,{label:"Resize inspector panel",value:Yn,min:240,max:520,onChange:pn,side:"inspector"}),Ea&&c.jsx(rv,{contextLabel:Ap(k.status),provider:k.status.provider,model:k.status.model,phase:k.status.phase,fitWarning:k.fitWarning,childrenEntries:E,selectedChildId:tt,onSelectChild:jt,onOpenChildTranscript:Jl,queue:W,queueEdit:ue,setQueueEdit:ie,queueEditCancel:Ge,queueRef:Se,setQueue:an}),c.jsx(cb,{modeLabel:ki[U].label,surfaces:G,activeId:Vt,profile:ze,onChange:p=>{de(void 0),Va({mode:U,surface:p,entity:R}),el(p)}}),c.jsx("div",{className:"inspector-body",id:Vt?`inspector-panel-${Vt}`:void 0,role:"tabpanel",children:De.length?c.jsx(T.Suspense,{fallback:c.jsx(Ab,{label:Vt||"surface"}),children:c.jsx(Kb,{tab:Vt,boot:a,workspace:k,data:Li,loading:kl,expandedDiffs:ul,toggleDiff:Hi,isLive:nt,selectedID:B,onRefresh:()=>void el(Vt),sandbox:$e,onExplainSandbox:()=>void Gs(),unavailable:(V==null?void 0:V.id)===Vt?V:void 0,childrenEntries:E,selectedChildId:tt,onSelectChild:jt,onOpenChildTranscript:Jl,entity:R,onOpenSettings:()=>Vn(!0)})}):c.jsxs("p",{className:"muted",children:["No surfaces available for ",ki[U].label," on this host."]})})]}),Sa&&c.jsx(L0,{boot:a,status:k.status,providers:wn,rootID:B,isLive:nt,onClose:()=>Vn(!1)}),Xt&&$e&&c.jsx(Rb,{info:$e,status:k.status,onClose:()=>Fe(!1)}),St&&c.jsx(Jb,{preview:Kl,preferFiles:St.preferFiles,onCancel:()=>st(null),onConfirm:Ql}),k.permission&&c.jsx(Lb,{permission:k.permission,rootID:B,canExplain:!!(a!=null&&a.capabilities.permissions)}),k.question&&c.jsx(Zb,{question:k.question,rootID:B}),Hl&&Yi("mode-bottom-bar")]})}function kb(a){return String(a.permission||a.tool||a.name||"tool")}function Ub(a){const u=a.patterns;return Array.isArray(u)?u.map(r=>String(r)).filter(Boolean):typeof u=="string"&&u.trim()?[u]:[]}function Rb({info:a,status:u,onClose:r}){const o=T.useRef(null);T.useEffect(()=>{var h;(h=o.current)==null||h.showModal()},[]);const d=u.networkAllow||a.networkAllow||[];return c.jsxs("dialog",{ref:o,className:"sandbox-explain-dialog","aria-labelledby":"sandbox-explain-title",onClose:r,children:[c.jsx("div",{className:"dialog-rule"}),c.jsx("h2",{id:"sandbox-explain-title",children:"Sandbox explain"}),c.jsxs("dl",{className:"sandbox-summary",children:[c.jsx("dt",{children:"Active mode"}),c.jsx("dd",{children:u.sandbox||a.mode}),c.jsx("dt",{children:"Default mode"}),c.jsx("dd",{children:a.defaultMode||"—"}),c.jsx("dt",{children:"Backend"}),c.jsx("dd",{children:u.sandboxBackend||a.backend||(a.available?"available":"unavailable")}),c.jsx("dt",{children:"Network allow"}),c.jsx("dd",{children:d.length?d.join(", "):"(none — unrestricted public)"}),c.jsx("dt",{children:"Permission mode"}),c.jsx("dd",{children:u.permissionMode||a.permissionMode||"—"})]}),c.jsx("pre",{className:"sandbox-explain",children:a.explain||"No profile text."}),a.note&&c.jsx("p",{className:"muted",children:a.note}),c.jsx("div",{className:"dialog-actions",children:c.jsx("button",{autoFocus:!0,onClick:r,children:"Close"})})]})}function Lb({permission:a,rootID:u,canExplain:r}){const o=kb(a),d=Ub(a),h=d[0]||"*",[y,b]=T.useState(null),[v,g]=T.useState(""),[z,C]=T.useState(!1),O=ee=>void xt("permission.reply",{requestId:a.requestId,decision:ee},u),$=async()=>{if(!(!r||z)){C(!0),g("");try{const ee=new URLSearchParams({permission:o,pattern:h});b(await oe(`/v1/permissions/explain?${ee}`))}catch(ee){g(ee.message),b(null)}finally{C(!1)}}},Q=(y==null?void 0:y.Summary)||(y==null?void 0:y.summary)||"",le=(y==null?void 0:y.Action)||(y==null?void 0:y.action)||"",ye=(y==null?void 0:y.Layer)||(y==null?void 0:y.layer)||"";return c.jsxs(Cp,{title:"Permission required",children:[c.jsx("p",{className:"permission-tool",children:c.jsx("strong",{children:o})}),d.length>0?c.jsx("ul",{className:"permission-patterns","aria-label":"Permission patterns",children:d.map(ee=>c.jsx("li",{children:c.jsx("code",{children:ee})},ee))}):c.jsx("p",{className:"muted",children:"No pattern detail provided for this request."}),r&&c.jsxs("div",{className:"permission-explain",children:[c.jsx("button",{type:"button",onClick:()=>void $(),disabled:z,children:z?"Explaining…":"Why is this asked?"}),v&&c.jsx("p",{className:"permission-explain-error",role:"status",children:v}),Q&&c.jsxs("pre",{className:"permission-explain-body","aria-label":"Permission explanation",children:[Q,(le||ye)&&` Effective: ${le||"unknown"}${ye?` (${ye})`:""}`]})]}),c.jsxs("div",{className:"dialog-actions",children:[c.jsx("button",{type:"button",onClick:()=>O("reject"),children:"Reject"}),c.jsx("button",{type:"button",onClick:()=>O("project"),children:"Allow for project"}),c.jsx("button",{type:"button",onClick:()=>O("always"),children:"Allow session"}),c.jsx("button",{type:"button",autoFocus:!0,onClick:()=>O("once"),children:"Allow once"})]})]})}function Fm({label:a,value:u,min:r,max:o,onChange:d,side:h}){const y=T.useRef(null),b=O=>Math.min(o,Math.max(r,Math.round(O))),v=O=>{O.preventDefault(),y.current={x:O.clientX,width:u},O.currentTarget.setPointerCapture(O.pointerId)},g=O=>{if(!y.current)return;const $=O.clientX-y.current.x;d(b(h==="nav"?y.current.width+$:y.current.width-$))},z=O=>{y.current=null,O.currentTarget.hasPointerCapture(O.pointerId)&&O.currentTarget.releasePointerCapture(O.pointerId)},C=O=>{const $=O.shiftKey?20:10;O.key==="ArrowLeft"&&(O.preventDefault(),d(b(u-$))),O.key==="ArrowRight"&&(O.preventDefault(),d(b(u+$))),O.key==="Home"&&(O.preventDefault(),d(r)),O.key==="End"&&(O.preventDefault(),d(o))};return c.jsx("div",{className:`panel-resize panel-resize-${h}`,children:c.jsx("div",{className:"panel-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":a,"aria-valuenow":u,"aria-valuemin":r,"aria-valuemax":o,tabIndex:0,onPointerDown:v,onPointerMove:g,onPointerUp:z,onPointerCancel:z,onKeyDown:C})})}function Np({onAction:a}){return c.jsxs("details",{className:"session-overflow",children:[c.jsx("summary",{children:"Session…"}),c.jsxs("div",{className:"session-overflow-menu",role:"menu",children:[c.jsx("button",{type:"button",role:"menuitem",onClick:()=>a("fork"),children:"Fork"}),c.jsx("button",{type:"button",role:"menuitem",onClick:()=>a("rename"),children:"Rename"}),c.jsx("button",{type:"button",role:"menuitem",onClick:()=>a("delete"),children:"Delete"})]})]})}function qb({sessions:a,activeRoots:u,selectedID:r,selectedIsLive:o,historySearch:d,setHistorySearch:h,selectWorkspace:y,handleResume:b,boot:v,sessionAction:g}){const z=!!(v!=null&&v.capabilities.sessions),C=!!r,O=a.filter($=>{var Q;return!d||((Q=$.title)==null?void 0:Q.toLowerCase().includes(d.toLowerCase()))||$.id.toLowerCase().includes(d.toLowerCase())});return c.jsxs(c.Fragment,{children:[c.jsx("input",{className:"history-search",type:"search",placeholder:"Search sessions…","aria-label":"Search sessions",value:d,onChange:$=>h($.target.value)}),c.jsx("nav",{"aria-label":"Session history",children:O.map($=>{const Q=u.some(B=>B.id===$.id),le=Mo($.mtime),ye=$.forkedFrom?`fork of ${Ui($.forkedFrom)}`:"",ee=[Ui($.id),le,ye].filter(Boolean).join(" · ");return c.jsxs("button",{type:"button",className:$.id===r?"session active history-row":"session history-row",onClick:()=>void y($.id,Q),title:$.id,children:[c.jsxs("span",{className:"session-main",children:[c.jsx("span",{className:"session-title",children:$.title||Ui($.id)}),c.jsx("span",{className:"session-meta",children:ee})]}),c.jsx("span",{className:"session-flags",children:Q&&c.jsx("small",{className:"live-badge",children:"LIVE"})})]},$.id)})}),c.jsxs("div",{className:"session-actions",children:[!o&&!(v!=null&&v.attachOnly)&&c.jsx("button",{type:"button",disabled:!C||!(v!=null&&v.capabilities.roots),onClick:()=>void b(r),children:"Resume as workspace"}),z&&C&&c.jsx(Np,{onAction:$=>void g($)})]})]})}function Bb({status:a,modelRates:u}){const r=a.contextLimit===void 0&&(u!=null&&u.context)?{...a,contextLimit:u.context}:a,o=[];a.agent&&o.push(`Agent ${a.agent}`),a.effort&&o.push(`Effort ${a.effort}`),a.autonomy&&o.push(`Autonomy ${a.autonomy}`),a.permissionMode&&o.push(`Permission ${a.permissionMode}`),a.phase&&o.push(`Phase ${a.phase}`),a.workflow&&o.push(`Workflow ${a.workflow}`),a.cwd&&o.push(`CWD ${a.cwd}`);const d=Ap(r);d!=="not reported"&&o.push(`Context ${d}`);const h=Mv(a,u);return h!=="not reported"&&o.push(`Cost ${h}`),o.length?c.jsx("div",{className:"runtime-status","aria-label":"Session status",children:o.map(y=>c.jsx("span",{children:y},y))}):null}function Hb(a){return a!=null&&a.known?`~${(a.n??0).toLocaleString()}`:"—"}function Yb(a){return a.contextUsed!==void 0&&a.contextLimit!==void 0?`${a.contextUsed.toLocaleString()} / ${a.contextLimit.toLocaleString()}`:a.contextUsed!==void 0?`${a.contextUsed.toLocaleString()} / —`:a.contextLimit!==void 0?`— / ${a.contextLimit.toLocaleString()}`:"not reported"}function Gb({workspace:a,isLive:u,selectedID:r}){const{status:o,attribution:d,layers:h,pinnedKinds:y,excludedKinds:b,shedKinds:v,fitWarning:g,promptScope:z,systemChars:C,messageCount:O}=a,$=(W,me)=>{u&&xt("context.controls",{pinKinds:W,setPin:!0,excludeKinds:me,setExclude:!0},r)},Q=W=>$(Mm(y,W),Pu(b,W)),le=W=>$(Pu(y,W),b),ye=W=>$(Pu(y,W),Mm(b,W)),ee=W=>$(y,Pu(b,W)),B=()=>$([],[]),k=()=>{u&&xt("inspect.prompt",void 0,r)},pe=Array.from(new Set([...ub,...y,...b,...h.map(W=>W.kind)])).filter(Boolean);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"context-doctor-head",children:[c.jsx("h2",{children:"Context doctor"}),c.jsxs("div",{className:"context-doctor-actions",children:[c.jsx("button",{type:"button",disabled:!u,onClick:k,children:"Refresh"}),c.jsx("button",{type:"button",disabled:!u||!y.length&&!b.length,onClick:B,children:"Clear pin/exclude"})]})]}),g&&c.jsx($b,{warning:g}),c.jsxs("dl",{children:[c.jsx("dt",{children:"Provider"}),c.jsx("dd",{children:o.provider||"unknown"}),c.jsx("dt",{children:"Model"}),c.jsx("dd",{children:o.model||"unknown"}),c.jsx("dt",{children:"Phase"}),c.jsx("dd",{children:o.phase||"idle"}),c.jsx("dt",{children:"Workflow"}),c.jsx("dd",{children:o.workflow||"none"}),c.jsx("dt",{children:"Context"}),c.jsx("dd",{children:Yb(o)}),o.usageSource&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:"Usage source"}),c.jsx("dd",{children:o.usageSource})]}),z&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:"Prompt scope"}),c.jsx("dd",{children:z==="last"?"last request":"current composition"})]}),C!==void 0&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:"System chars"}),c.jsx("dd",{children:C.toLocaleString()})]}),O!==void 0&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:"History"}),c.jsxs("dd",{children:[O.toLocaleString()," msgs"]})]})]}),c.jsx(Xb,{attribution:d}),(y.length>0||b.length>0||v.length>0)&&c.jsxs("section",{className:"context-sets","aria-label":"Context control sets",children:[c.jsx("h3",{children:"Controls"}),y.length>0&&c.jsxs("p",{children:[c.jsx("strong",{children:"Pinned"})," ",y.join(", ")]}),b.length>0&&c.jsxs("p",{children:[c.jsx("strong",{children:"Excluded"})," ",b.join(", ")]}),v.length>0&&c.jsxs("p",{children:[c.jsx("strong",{children:"Shed"})," ",v.join(", ")]})]}),c.jsxs("section",{className:"context-layers","aria-label":"Prompt layers",children:[c.jsx("h3",{children:"Layers"}),h.length===0?c.jsx("p",{className:"muted",children:u?"No layer breakdown yet. Refresh to inspect the effective prompt.":"No layer breakdown in this session log."}):c.jsxs("table",{className:"context-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Kind"}),c.jsx("th",{children:"~tok"}),c.jsx("th",{children:"Chars"}),c.jsx("th",{children:"Source"}),c.jsx("th",{children:"Actions"})]})}),c.jsx("tbody",{children:h.map(W=>{const me=W.pinned||y.includes(W.kind),P=b.includes(W.kind),J=W.estTokens??(W.chars?Math.ceil(W.chars/4):void 0);return c.jsxs("tr",{children:[c.jsxs("td",{children:[c.jsx("code",{children:W.kind}),me?" · pin":"",P?" · excl":""]}),c.jsx("td",{children:J!==void 0?`~${J.toLocaleString()}`:"—"}),c.jsx("td",{children:W.chars!==void 0?W.chars.toLocaleString():"—"}),c.jsx("td",{className:"muted",children:W.source||"—"}),c.jsxs("td",{className:"context-layer-actions",children:[me?c.jsx("button",{type:"button",disabled:!u,onClick:()=>le(W.kind),children:"Unpin"}):c.jsx("button",{type:"button",disabled:!u||P,onClick:()=>Q(W.kind),children:"Pin"}),P?c.jsx("button",{type:"button",disabled:!u,onClick:()=>ee(W.kind),children:"Include"}):c.jsx("button",{type:"button",disabled:!u,onClick:()=>ye(W.kind),children:"Exclude"})]})]},`${W.kind}:${W.source||""}`)})})]})]}),u&&c.jsxs("section",{className:"context-kind-picker","aria-label":"Pin or exclude layer kinds",children:[c.jsx("h3",{children:"Layer kinds"}),c.jsx("p",{className:"muted",children:"Pin retains a kind under fit pressure; exclude omits it from composition."}),c.jsx("div",{className:"context-kind-list",children:pe.map(W=>{const me=y.includes(W),P=b.includes(W);return c.jsxs("div",{className:"context-kind-row",children:[c.jsx("code",{children:W}),c.jsxs("span",{children:[me?c.jsx("button",{type:"button",onClick:()=>le(W),children:"Unpin"}):c.jsx("button",{type:"button",disabled:P,onClick:()=>Q(W),children:"Pin"}),P?c.jsx("button",{type:"button",onClick:()=>ee(W),children:"Include"}):c.jsx("button",{type:"button",onClick:()=>ye(W),children:"Exclude"})]})]},W)})})]})]})}function $b({warning:a}){const u=a.level==="critical"?"critical":"warn";return c.jsxs("div",{className:`context-fit-warning ${u}`,role:"alert","aria-label":"Context fit warning",children:[c.jsx("strong",{children:a.level==="critical"?"Critical fit":"Fit warning"}),c.jsx("p",{children:a.message}),(a.estimatedTokens!==void 0||a.contextLimit!==void 0)&&c.jsxs("small",{children:[a.estimatedTokens!==void 0?`~${a.estimatedTokens.toLocaleString()} tok`:"—"," / ",a.contextLimit!==void 0?a.contextLimit.toLocaleString():"—",a.source?` (${a.source})`:""]})]})}function Xb({attribution:a}){if(!a)return null;const u=[["system",a.system],["tools",a.tools],["messages",a.messages],["tool_results",a.toolResults],["total",a.total]];return c.jsxs("section",{className:"context-attribution","aria-label":"Token breakdown by source",children:[c.jsx("h3",{children:"Tokens by source"}),c.jsxs("table",{className:"context-table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Source"}),c.jsx("th",{children:"~Tokens"})]})}),c.jsx("tbody",{children:u.map(([r,o])=>c.jsxs("tr",{children:[c.jsx("td",{children:r}),c.jsx("td",{children:Hb(o)})]},r))})]}),c.jsxs("p",{className:"muted",children:["Local ~4 chars/token estimates",a.source?` · source ${a.source}`:"",". Not provider-measured billing."]})]})}function Kb({tab:a,boot:u,workspace:r,data:o,loading:d,expandedDiffs:h,toggleDiff:y,isLive:b,selectedID:v,onRefresh:g,sandbox:z,onExplainSandbox:C,unavailable:O,childrenEntries:$,selectedChildId:Q,onSelectChild:le,onOpenChildTranscript:ye,entity:ee,onOpenSettings:B}){var W,me,P;const k=r.status;if(O){const J=((W=ks(a))==null?void 0:W.label)||a;return c.jsxs("section",{className:"unavailable",role:"status",children:[c.jsxs("strong",{children:[J," unavailable"]}),c.jsxs("p",{children:[O.reason,". The surface was opened from a deep link or explicit navigation; no action was attempted."]})]})}if(a==="roster")return c.jsx(hb,{team:r.team,selectedId:Q||ee,onSelect:le||(()=>{}),onOpenTranscript:ye,readOnly:!b||!!(u!=null&&u.attachOnly),compact:typeof window<"u"&&window.innerWidth<720,protocolOps:u==null?void 0:u.protocolOps,teamControl:(me=u==null?void 0:u.capabilities)==null?void 0:me.teamControl,agents:((u==null?void 0:u.agents)||[]).map(J=>J.name),rootSessionId:v,sendOp:b&&!(u!=null&&u.attachOnly)?(J,se)=>Pm(J,se,v):void 0});if(a==="artifacts")return c.jsx(pb,{available:!!(u!=null&&u.capabilities.artifacts),rootID:v,entity:ee,onOpenFile:J=>{Va({mode:"code",surface:"files",entity:J,root:v||void 0})}});if(a==="ledger")return c.jsx(yb,{available:!!(u!=null&&u.capabilities.ledger),rootID:v});if(a==="review")return c.jsx(gb,{team:r.team,onSelectAgent:le,onOpenFile:J=>{Va({mode:"code",surface:"files",entity:J,root:v||void 0})}});if(a==="context")return c.jsx(Gb,{workspace:r,isLive:b,selectedID:v});if(a==="workflows")return c.jsx(Eb,{available:!!(u!=null&&u.capabilities.workflows),draftsAvailable:!!(u!=null&&u.capabilities.workflowDrafts),live:b,rootID:v,activeWorkflow:k.workflow,agents:((u==null?void 0:u.agents)||[]).map(J=>J.name),busy:!!k.busy});if(a==="goals")return c.jsx(Tb,{available:!!(u!=null&&u.capabilities.goals),live:b});if(a==="plans")return c.jsx(jb,{available:!!(u!=null&&u.capabilities.plans),live:b,rootID:v});if(a==="mcp")return c.jsx(vb,{available:!!(u!=null&&u.capabilities.mcp)});if(a==="plugins")return c.jsx(bb,{available:!!(u!=null&&u.capabilities.plugins),live:b&&!(u!=null&&u.attachOnly),panesAvailable:!!(u!=null&&u.capabilities.panes),rootID:v});if(a==="panes")return c.jsx(Jm,{available:!!(u!=null&&u.capabilities.panes),readOnly:!b||!!(u!=null&&u.attachOnly)});if(a==="timeline")return c.jsx(xb,{available:!!(u!=null&&u.capabilities.timeline),sessionID:v});if(a==="diagnostics")return c.jsx(Sb,{available:!!(u!=null&&u.capabilities.lsp)});if(a==="settings"||a==="theme"||a==="providers"||a==="auth")return c.jsxs("section",{className:"ops-settings-hint","aria-label":"Settings",children:[c.jsx("h2",{children:a==="theme"?"Theme":a==="providers"||a==="auth"?"Providers & auth":"Settings"}),c.jsx("p",{className:"muted",children:a==="theme"?"Theme catalog and appearance live in the settings dialog.":a==="providers"||a==="auth"?"Provider authentication and API keys live in the settings dialog.":"Workspace defaults, sandbox, and support tools live in the settings dialog."}),c.jsx("p",{className:"muted",children:"Use the header gear or open the dialog from this surface. Inspector tabs stay in the drawer."}),B&&c.jsx("button",{type:"button",onClick:B,children:"Open settings dialog"})]});if(a==="permissions")return c.jsxs("section",{"aria-label":"Permissions",children:[c.jsx("h2",{children:"Permissions"}),c.jsx("p",{className:"muted",children:"Explain and presets are available from permission asks and host APIs. Browse presets via the live permission dialog when the engine requests approval."}),!(u!=null&&u.capabilities.permissions)&&c.jsx(cc,{name:"Permissions"})]});if(a==="sandbox")return c.jsxs("section",{"aria-label":"Sandbox",children:[c.jsx("h2",{children:"Sandbox"}),z?c.jsxs("dl",{className:"sandbox-summary",children:[c.jsx("dt",{children:"Active"}),c.jsx("dd",{children:z.mode}),c.jsx("dt",{children:"Default"}),c.jsx("dd",{children:z.defaultMode||"—"}),c.jsx("dt",{children:"Backend"}),c.jsx("dd",{children:z.backend||(z.available?"available":"unavailable")})]}):c.jsx("p",{className:"muted",children:"No sandbox snapshot loaded."}),C&&c.jsx("button",{type:"button",onClick:()=>C(),children:"Explain sandbox"}),!(u!=null&&u.capabilities.sandbox)&&c.jsx(cc,{name:"Sandbox"})]});if(a==="diag-export")return c.jsxs("section",{"aria-label":"Diagnostics export",children:[c.jsx("h2",{children:"Diagnostics export"}),c.jsxs("p",{className:"muted",children:["Redacted prompt/config bundle (same scrubbing as TUI ",c.jsx("code",{children:"/diag"}),")."]}),c.jsx("button",{type:"button",disabled:!(u!=null&&u.capabilities.diag&&b),onClick:()=>void ep(v).catch(J=>window.alert(J.message)),children:"Download diagnostics"}),!(u!=null&&u.capabilities.diag)&&c.jsx("p",{className:"muted",children:"Unavailable without a live engine."})]});if(a==="project-export")return c.jsxs("section",{"aria-label":"Project exports",children:[c.jsx("h2",{children:"Project exports"}),c.jsx("p",{className:"muted",children:"Portable memory and issues exports (TUI parity)."}),c.jsxs("div",{className:"panel-actions",children:[c.jsx("button",{type:"button",disabled:!(u!=null&&u.capabilities.memory),onClick:()=>void np().catch(J=>window.alert(J.message)),children:"Export memory"}),c.jsx("button",{type:"button",disabled:!(u!=null&&u.capabilities.issues),onClick:()=>void lp().catch(J=>window.alert(J.message)),children:"Export issues"})]}),c.jsx("p",{className:"muted",children:Gv})]});if(a.startsWith("pane:")){const J=a.slice(5);return c.jsx(Jm,{available:!!(u!=null&&u.capabilities.panes),focusId:J,readOnly:!b||!!(u!=null&&u.attachOnly)})}if(d)return c.jsx("section",{className:"unavailable",role:"status",children:c.jsxs("strong",{children:["Loading ",a]})});if(a==="files"){const J=(o==null?void 0:o.files)||[],se=o==null?void 0:o.error;return c.jsx(mb,{available:!!(u!=null&&u.capabilities.files),rootID:v,entity:ee,readOnly:!!(u!=null&&u.attachOnly)||!b,canApply:!!(u!=null&&u.capabilities.fileApply)&&b&&!(u!=null&&u.attachOnly),changedFiles:se?[]:J,expandedDiffs:h,toggleDiff:y,onOpenPath:(ue,ie)=>{Va({mode:"code",surface:"files",entity:ie?`${ue}:${ie}`:ue,root:v||void 0})}})}if(a==="memory")return c.jsx(Qb,{boot:u,data:o,onRefresh:g||(()=>{})});if(a==="issues")return c.jsx(Vb,{boot:u,data:o,onRefresh:g||(()=>{})});const pe=((P=ks(a))==null?void 0:P.label)||a||"surface";return c.jsxs("section",{className:"unavailable",role:"status",children:[c.jsx("strong",{children:pe}),c.jsx("p",{children:"This surface is registered but has no mount in this build yet."})]})}function Qb({boot:a,data:u,onRefresh:r}){const o=!!(a!=null&&a.capabilities.memory&&!a.attachOnly),[d,h]=T.useState(""),[y,b]=T.useState(""),[v,g]=T.useState(""),[z,C]=T.useState(!1),[O,$]=T.useState(null);if(!(a!=null&&a.capabilities.memory))return c.jsx(cc,{name:"Memory"});if(u!=null&&u.error)return c.jsx(Op,{error:u.error});const Q=(u==null?void 0:u.entries)||[],le=async B=>{C(!0);try{await B(),r()}catch(k){window.alert(k.message)}finally{C(!1)}},ye=B=>{const k=B.Key||B.key||"";$(k),h(k),b(B.Value||B.value||""),g((B.Tags||B.tags||[]).join(", "))},ee=()=>{const B=d.trim();if(!B)return window.alert("Key is required");const k=v.split(",").map(pe=>pe.trim()).filter(Boolean);le(async()=>{await qg(B,y,k),h(""),b(""),g(""),$(null)})};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"panel-heading",children:[c.jsx("h2",{children:"Memory"}),c.jsx("div",{className:"panel-actions",children:c.jsx("button",{type:"button",disabled:z,"aria-label":"Export memory",onClick:()=>void le(()=>np()),children:"Export"})})]}),o&&c.jsxs("form",{className:"project-form","aria-label":O?"Edit memory entry":"Add memory entry",onSubmit:B=>{B.preventDefault(),ee()},children:[c.jsxs("label",{children:["Key",c.jsx("input",{"aria-label":"Memory key",value:d,disabled:z||!!O,onChange:B=>h(B.target.value),placeholder:"convention"})]}),c.jsxs("label",{children:["Value",c.jsx("textarea",{"aria-label":"Memory value",value:y,disabled:z,onChange:B=>b(B.target.value),placeholder:"Prefer table-driven tests",rows:3})]}),c.jsxs("label",{children:["Tags",c.jsx("input",{"aria-label":"Memory tags",value:v,disabled:z,onChange:B=>g(B.target.value),placeholder:"project, style"})]}),c.jsxs("div",{className:"panel-actions",children:[O&&c.jsx("button",{type:"button",disabled:z,onClick:()=>{$(null),h(""),b(""),g("")},children:"Cancel"}),c.jsx("button",{type:"submit",disabled:z,children:O?"Save":"Add"})]})]}),!o&&c.jsx("p",{className:"muted",children:"Attach-only mode is read-only. Export remains available."}),Q.length?c.jsx("div",{className:"project-list",children:Q.map(B=>{const k=B.Key||B.key||"",pe=B.Value||B.value||"",W=B.Tags||B.tags||[];return c.jsxs("article",{children:[c.jsx("h3",{children:k}),c.jsx("p",{children:pe}),W.length>0&&c.jsx("small",{children:W.join(", ")}),o&&c.jsxs("div",{className:"panel-actions",children:[c.jsx("button",{type:"button",disabled:z,onClick:()=>ye(B),children:"Edit"}),c.jsx("button",{type:"button",disabled:z,onClick:()=>{window.confirm(`Delete memory key “${k}”?`)&&le(()=>Bg(k))},children:"Delete"})]})]},k)})}):c.jsx("p",{className:"muted",children:"No project memory entries."})]})}function Vb({boot:a,data:u,onRefresh:r}){const o=!!(a!=null&&a.capabilities.issues&&!a.attachOnly),[d,h]=T.useState(""),[y,b]=T.useState(""),[v,g]=T.useState(!1);if(!(a!=null&&a.capabilities.issues))return c.jsx(cc,{name:"Issues"});if(u!=null&&u.error)return c.jsx(Op,{error:u.error});const z=(u==null?void 0:u.issues)||[],C=async O=>{g(!0);try{await O(),r()}catch($){window.alert($.message)}finally{g(!1)}};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"panel-heading",children:[c.jsx("h2",{children:"Issues"}),c.jsx("div",{className:"panel-actions",children:c.jsx("button",{type:"button",disabled:v,"aria-label":"Export issues",onClick:()=>void C(()=>lp()),children:"Export"})})]}),o&&c.jsxs("form",{className:"project-form","aria-label":"Add issue",onSubmit:O=>{O.preventDefault();const $=d.trim();if(!$)return window.alert("Title is required");C(async()=>{await Hg($,y),h(""),b("")})},children:[c.jsxs("label",{children:["Title",c.jsx("input",{"aria-label":"Issue title",value:d,disabled:v,onChange:O=>h(O.target.value),placeholder:"Fix inspector resize"})]}),c.jsxs("label",{children:["Body",c.jsx("textarea",{"aria-label":"Issue body",value:y,disabled:v,onChange:O=>b(O.target.value),placeholder:"Optional details",rows:3})]}),c.jsx("div",{className:"panel-actions",children:c.jsx("button",{type:"submit",disabled:v,children:"Add"})})]}),!o&&c.jsx("p",{className:"muted",children:"Attach-only mode is read-only. Export remains available."}),z.length?c.jsx("div",{className:"project-list",children:z.map(O=>{const $=O.ID??O.id??0,Q=O.Title||O.title||"Untitled issue",le=O.Body||O.body||"",ye=O.Status||O.status||"open";return c.jsxs("article",{children:[c.jsxs("h3",{children:["#",$," ",Q]}),c.jsx("small",{children:ye}),le&&c.jsx("p",{children:le}),o&&ye==="open"&&c.jsx("div",{className:"panel-actions",children:c.jsx("button",{type:"button",disabled:v,onClick:()=>void C(()=>Yg($)),children:"Close"})})]},$)})}):c.jsx("p",{className:"muted",children:"No project issues."})]})}function cc({name:a}){return c.jsxs("section",{className:"unavailable",role:"status",children:[c.jsxs("strong",{children:[a," unavailable"]}),c.jsx("p",{children:"The configured host did not provide this capability. No action was attempted."})]})}function Op({error:a}){return c.jsxs("section",{className:"unavailable",role:"status",children:[c.jsx("strong",{children:"Unable to load"}),c.jsx("p",{children:a})]})}function Zb({question:a,rootID:u}){const[r,o]=T.useState([]),d=Array.isArray(a.questions)?a.questions:[{question:a.question}],h=(y,b)=>o(v=>{const g=[...v];return g[y]=b,g});return c.jsxs(Cp,{title:String(a.title||"Agent question"),children:[d.map((y,b)=>{const v=Array.isArray(y.options)?y.options:[];return c.jsxs("fieldset",{children:[c.jsx("legend",{children:String(y.question||"A response is required to continue.")}),v.length?v.map(g=>c.jsxs("label",{children:[c.jsx("input",{type:"radio",name:`question-${b}`,value:String(g.label),checked:r[b]===String(g.label),onChange:z=>h(b,z.target.value)}),String(g.label),c.jsx("span",{children:String(g.description||"")})]},String(g.label))):c.jsx("textarea",{"aria-label":`Answer ${b+1}`,value:r[b]||"",onChange:g=>h(b,g.target.value)})]},b)}),c.jsx("div",{className:"dialog-actions",children:c.jsx("button",{autoFocus:!0,onClick:()=>void xt("question.reply",{requestId:a.requestId,answers:r},u),children:"Continue"})})]})}function Jb({preview:a,preferFiles:u,onCancel:r,onConfirm:o}){const d=T.useRef(null),[h,y]=T.useState(()=>mv(a,u));T.useEffect(()=>{const g=d.current;if(g)if(typeof g.showModal=="function"&&!g.open)try{g.showModal()}catch{g.setAttribute("open","")}else g.open||g.setAttribute("open","")},[]);const b=dv(a),v=[{id:"chat",label:"chat only",detail:"drop the last turn from history; keep disk changes",value:!1},{id:"files",label:"chat and files",detail:hv(a),value:!0}];return c.jsxs("dialog",{ref:d,className:"undo-dialog","aria-labelledby":"undo-title",onClose:r,onCancel:g=>{g.preventDefault(),r()},children:[c.jsx("div",{className:"dialog-rule"}),c.jsx("h2",{id:"undo-title",children:"Undo last turn"}),b.length>0&&c.jsx("div",{className:"undo-preview",role:"region","aria-label":"Undo preview",children:b.map((g,z)=>c.jsx("p",{className:g.tone==="warn"?"undo-warn":void 0,children:g.text},z))}),c.jsx("div",{className:"undo-choices",role:"radiogroup","aria-label":"Undo mode",children:v.map(g=>c.jsxs("label",{className:h===g.value?"undo-choice active":"undo-choice",children:[c.jsx("input",{type:"radio",name:"undo-mode",value:g.id,checked:h===g.value,onChange:()=>y(g.value)}),c.jsxs("span",{children:[c.jsx("strong",{children:g.label}),c.jsx("small",{children:g.detail})]})]},g.id))}),c.jsxs("div",{className:"dialog-actions",children:[c.jsx("button",{type:"button",onClick:r,children:"Cancel"}),c.jsx("button",{type:"button",autoFocus:!0,onClick:()=>o(h),children:"Confirm undo"})]})]})}Og.createRoot(document.getElementById("root")).render(c.jsx(xg.StrictMode,{children:c.jsx(_b,{})}));export{fo as C,Ig as L,kg as O,Jg as S,Wg as a,oe as b,Em as c,c as j,T as r,up as s}; diff --git a/internal/frontend/server/static/assets/index-CGmIsvaq.css b/internal/frontend/server/static/assets/index-CGmIsvaq.css new file mode 100644 index 00000000..be144339 --- /dev/null +++ b/internal/frontend/server/static/assets/index-CGmIsvaq.css @@ -0,0 +1 @@ +:root{color-scheme:dark light;--ink: #f3f1fa;--muted: #9b99b0;--acid: #7c3aed;--accent-alt: #22d3ee;--highlight: #ddd6fe;--success: #4ade80;--warning: #fbbf24;--signal: #fb7185;--danger: #fb923c;--ground: #14131c;--surface: #232230;--raised: #2e2c3e;--surface-muted: #1a1924;--rule: #4f4d63;--border-focus: #7c3aed;--border-muted: #2c2a3a;--user: #22d3ee;--tool: #7dd3fc;--diff-add: #4ade80;--diff-del: #fb7185;--overlay: #7c7a90;--code-bg: #1a1924;--mark-ink: #14131c;--header-bg: #14131ce8;--glow: #7c3aed66;--idle: #4f4d63;--cap-border: #4f4d63;--shadow: #00000088;--diff-add-bg: #1a2a22;--diff-del-bg: #2a1a1c;--unavailable-bg: #2a1a1c;--text: var(--ink);--bg: var(--ground);--border: var(--rule);--panel: var(--surface);--accent: var(--acid);--warn: var(--warning);font-family:SFMono-Regular,Cascadia Code,Liberation Mono,monospace;background:var(--ground);color:var(--ink)}:root[data-appearance=dark]{color-scheme:dark;--ink: #f3f1fa;--muted: #9b99b0;--acid: #7c3aed;--accent-alt: #22d3ee;--highlight: #ddd6fe;--success: #4ade80;--warning: #fbbf24;--signal: #fb7185;--danger: #fb923c;--ground: #14131c;--surface: #232230;--raised: #2e2c3e;--surface-muted: #1a1924;--rule: #4f4d63;--border-focus: #7c3aed;--border-muted: #2c2a3a;--user: #22d3ee;--tool: #7dd3fc;--diff-add: #4ade80;--diff-del: #fb7185;--overlay: #7c7a90;--code-bg: #1a1924;--mark-ink: #14131c;--header-bg: #14131ce8;--glow: #7c3aed66;--idle: #4f4d63;--cap-border: #4f4d63;--shadow: #00000088;--diff-add-bg: #1a2a22;--diff-del-bg: #2a1a1c;--unavailable-bg: #2a1a1c}:root[data-appearance=light]{color-scheme:light;--ink: #1a1528;--muted: #5c586e;--acid: #5b21b6;--accent-alt: #0e7490;--highlight: #4c1d95;--success: #15803d;--warning: #b45309;--signal: #e11d48;--danger: #ea580c;--ground: #ffffff;--surface: #f3eef9;--raised: #e9e0f7;--surface-muted: #f8f5fc;--rule: #c4bfd4;--border-focus: #5b21b6;--border-muted: #ddd8ea;--user: #0e7490;--tool: #2563eb;--diff-add: #15803d;--diff-del: #e11d48;--overlay: #a8a3b8;--code-bg: #f8f5fc;--mark-ink: #ffffff;--header-bg: #fffffff0;--glow: #5b21b666;--idle: #c4bfd4;--cap-border: #c4bfd4;--shadow: #1a152833;--diff-add-bg: #e8f5ec;--diff-del-bg: #f8e8e8;--unavailable-bg: #f8e8e8}@media(prefers-color-scheme:light){:root{--ink: #1a1528;--muted: #5c586e;--acid: #5b21b6;--accent-alt: #0e7490;--highlight: #4c1d95;--success: #15803d;--warning: #b45309;--signal: #e11d48;--danger: #ea580c;--ground: #ffffff;--surface: #f3eef9;--raised: #e9e0f7;--surface-muted: #f8f5fc;--rule: #c4bfd4;--border-focus: #5b21b6;--border-muted: #ddd8ea;--user: #0e7490;--tool: #2563eb;--diff-add: #15803d;--diff-del: #e11d48;--overlay: #a8a3b8;--code-bg: #f8f5fc;--mark-ink: #ffffff;--header-bg: #fffffff0;--glow: #5b21b666;--idle: #c4bfd4;--cap-border: #c4bfd4;--shadow: #1a152833;--diff-add-bg: #e8f5ec;--diff-del-bg: #f8e8e8;--unavailable-bg: #f8e8e8}:root[data-appearance=dark]{color-scheme:dark;--ink: #f3f1fa;--muted: #9b99b0;--acid: #7c3aed;--accent-alt: #22d3ee;--highlight: #ddd6fe;--success: #4ade80;--warning: #fbbf24;--signal: #fb7185;--danger: #fb923c;--ground: #14131c;--surface: #232230;--raised: #2e2c3e;--surface-muted: #1a1924;--rule: #4f4d63;--border-focus: #7c3aed;--border-muted: #2c2a3a;--user: #22d3ee;--tool: #7dd3fc;--diff-add: #4ade80;--diff-del: #fb7185;--overlay: #7c7a90;--code-bg: #1a1924;--mark-ink: #14131c;--header-bg: #14131ce8;--glow: #7c3aed66;--idle: #4f4d63;--cap-border: #4f4d63;--shadow: #00000088;--diff-add-bg: #1a2a22;--diff-del-bg: #2a1a1c;--unavailable-bg: #2a1a1c}}:root{--control-pad-y: 7px;--control-pad-x: 12px;--control-min-h: 28px;--touch-min: 44px;--focus-ring: 2px solid var(--acid);--focus-offset: 2px;--radius: 2px;--header-height: 52px;--gutter: 12px;--pane-min: 180px;--mode-bar-height: 56px}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh;background:var(--ground)}button,select,textarea,input{font:inherit;color:inherit}button,select,input,textarea{border:1px solid var(--rule);background:var(--surface);border-radius:var(--radius)}button{cursor:pointer;min-height:var(--control-min-h)}button:hover:not(:disabled),button:focus-visible{border-color:var(--acid);color:var(--acid)}button:disabled,select:disabled,input:disabled,textarea:disabled{opacity:.45;cursor:not-allowed}:focus-visible{outline:var(--focus-ring);outline-offset:var(--focus-offset)}.ui-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:var(--control-pad-y) var(--control-pad-x);border:1px solid var(--rule);background:var(--surface);color:var(--ink);font-size:11px;line-height:1.2;border-radius:var(--radius)}.ui-btn:hover:not(:disabled),.ui-btn:focus-visible{border-color:var(--border-focus);color:var(--acid)}.ui-btn-primary{background:var(--acid);border-color:var(--acid);color:var(--mark-ink);font-weight:600;text-transform:uppercase;letter-spacing:.04em;font-size:10px}.ui-btn-primary:hover:not(:disabled),.ui-btn-primary:focus-visible{color:var(--mark-ink);filter:brightness(1.05);border-color:var(--border-focus)}.ui-btn-danger{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 45%,var(--rule))}.ui-btn-ghost,.ui-btn-icon{border-color:transparent;background:transparent}.ui-btn-icon,.icon-button{border:0;background:transparent;font-size:18px;padding:8px;min-width:var(--control-min-h);min-height:var(--control-min-h);line-height:1;flex-shrink:0}.ui-btn-sm{padding:4px 8px;font-size:10px;min-height:24px}.ui-btn-touch{min-height:var(--touch-min);min-width:var(--touch-min);padding:10px 14px}.ui-dialog{width:min(560px,calc(100vw - 32px));max-height:min(88vh,900px);overflow:auto;border:1px solid var(--rule);background:var(--surface);padding:28px;color:var(--ink);position:relative;border-radius:var(--radius)}.ui-dialog-wide{width:min(720px,calc(100vw - 24px))}.ui-dialog::backdrop{background:color-mix(in srgb,var(--overlay) 85%,#000)}.ui-dialog-blocking{border-color:var(--warning)}.ui-dialog h2{font-size:30px;margin:0 0 20px}.ui-dialog-body{min-width:0}.settings-dialog,.workflow-dialog,.sandbox-explain-dialog,.undo-dialog{position:relative}.ui-tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;border-bottom:1px solid var(--rule);gap:0;scrollbar-width:thin}.ui-tab{flex:0 0 auto;min-width:max-content;white-space:nowrap;border:0;border-bottom:2px solid transparent;background:transparent;padding:10px 12px;text-transform:uppercase;font-size:11px;letter-spacing:.04em;color:var(--muted);border-radius:0;min-height:var(--control-min-h)}.ui-tab[aria-selected=true]{border-bottom-color:var(--acid);color:var(--acid)}.ui-tab:disabled{opacity:.35}.ui-tabpanel{min-width:0}.inspector-tabs{display:flex;flex-wrap:wrap;align-content:flex-start;flex:0 0 auto;width:100%;min-width:0;overflow-x:hidden;overflow-y:auto;max-height:40vh;border-bottom:1px solid var(--rule);scrollbar-width:thin}.inspector-tabs .ui-tab,.inspector-tabs button{flex:0 0 auto;min-width:max-content;white-space:nowrap;border:0;border-bottom:2px solid transparent;background:transparent;padding:10px 12px;text-transform:uppercase;font-size:11px;color:var(--muted)}.inspector-tabs .ui-tab[aria-selected=true],.inspector-tabs button[aria-selected=true]{border-bottom-color:var(--acid);color:var(--acid)}.ui-status{display:inline-flex;align-items:center;gap:6px;font-size:10px;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}.ui-status-dot,.ui-status-dot-alone{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--idle);flex-shrink:0}.ui-status-busy .ui-status-dot,.ui-status-dot-alone.ui-status-busy{background:var(--accent-alt)}.ui-status-blocked .ui-status-dot,.ui-status-dot-alone.ui-status-blocked,.ui-status-needs-you .ui-status-dot,.ui-status-dot-alone.ui-status-needs-you{background:var(--warning)}.ui-status-failed .ui-status-dot,.ui-status-dot-alone.ui-status-failed{background:var(--signal)}.ui-status-complete .ui-status-dot,.ui-status-dot-alone.ui-status-complete{background:var(--success)}.ui-status-canceled .ui-status-dot,.ui-status-unknown .ui-status-dot,.ui-status-dot-alone.ui-status-canceled,.ui-status-dot-alone.ui-status-unknown{background:var(--muted)}.ui-status-label{color:inherit}.ui-status-busy{color:var(--accent-alt)}.ui-status-blocked,.ui-status-needs-you{color:var(--warning)}.ui-status-failed{color:var(--signal)}.ui-status-complete{color:var(--success)}.ui-notice{border-left:3px solid var(--acid);padding:12px;background:var(--surface-muted);display:grid;gap:6px}.ui-notice-title{font-size:12px}.ui-notice-body{color:var(--muted);font-size:11px;line-height:1.5}.ui-notice-body p{margin:0}.ui-notice-success{border-left-color:var(--success)}.ui-notice-warning{border-left-color:var(--warning)}.ui-notice-error{border-left-color:var(--signal);background:var(--unavailable-bg)}.ui-notice-unavailable,.unavailable{border-left:3px solid var(--signal);padding:12px;background:var(--unavailable-bg)}.ui-notice-unavailable strong,.unavailable strong{color:var(--signal)}.ui-loading-indicator{display:inline-block;width:10px;height:10px;border-radius:50%;background:var(--accent-alt);animation:pulse 1.2s infinite}.ui-list-row,.palette-list button,.completion button{width:100%;display:flex;align-items:baseline;gap:8px;text-align:left;border:0;padding:6px 10px;background:transparent;font-size:12px;font-weight:inherit;color:inherit;cursor:pointer;border-radius:0;text-transform:none}.ui-list-row:hover,.ui-list-row.active,.ui-list-row[aria-selected=true],.palette-list button:hover,.palette-list button.active,.palette-list button[aria-selected=true],.completion button:hover,.completion button.active,.completion button[aria-selected=true]{background:var(--raised);box-shadow:inset 2px 0 0 var(--acid)}.ui-list-row-main{flex:1;min-width:0;display:flex;flex-direction:row;align-items:baseline;gap:8px;overflow:hidden}.ui-list-row-title,.completion button strong{flex:0 1 auto;min-width:0;font-weight:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-list-row-meta,.completion span{flex:1 1 auto;min-width:0;font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-list-row-trailing{display:flex;flex-direction:column;align-items:flex-end;gap:2px;flex-shrink:0}@media(max-width:720px){:root{--control-min-h: var(--touch-min);--control-pad-y: 10px;--control-pad-x: 14px}.ui-btn:not(.ui-btn-sm):not(.ui-btn-icon):not(.icon-button){min-height:var(--touch-min)}.ui-tab{min-height:40px;padding:12px;font-size:12px}}.app-shell{display:grid;grid-template:var(--header-height) minmax(0,1fr) / minmax(0,var(--nav-width, 240px)) minmax(0,1fr) minmax(0,var(--inspector-width, 340px));height:100vh;height:100dvh;max-width:100vw;overflow:hidden;padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}.app-shell[data-shell=phone]{grid-template:auto minmax(0,1fr) auto / minmax(0,1fr);padding-bottom:env(safe-area-inset-bottom,0px)}.app-shell[data-shell=tablet]{grid-template-columns:minmax(0,1fr);grid-template-rows:var(--header-height) minmax(0,1fr)}header{grid-column:1 / -1;z-index:10;display:flex;align-items:center;gap:var(--gutter);border-bottom:1px solid var(--rule);background:var(--header-bg);padding:0 var(--gutter);padding-top:env(safe-area-inset-top,0px);min-height:calc(var(--header-height) + env(safe-area-inset-top,0px));min-width:0;z-index:4;position:sticky;top:0}.app-shell>header{overflow:hidden}.wordmark{display:flex;align-items:baseline;gap:9px;flex:0 1 202px;min-width:0;overflow:hidden;letter-spacing:.1em}.wordmark strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wordmark .mark{display:grid;place-items:center;width:27px;height:27px;background:var(--acid);color:var(--mark-ink);font-weight:700;transform:skew(-7deg)}.wordmark small{color:var(--muted);font-size:9px}.session-line{margin-left:auto;text-transform:uppercase;font-size:10px;color:var(--muted);flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mode-switch{display:flex;align-items:stretch;gap:0;margin-left:var(--gutter);padding:0;border:1px solid var(--rule);border-radius:var(--radius);background:var(--surface-muted);flex:0 1 auto;flex-shrink:1;min-width:0;overflow:auto}.mode-btn{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;border-right:1px solid var(--rule);background:transparent;color:var(--muted);font-size:10px;letter-spacing:.06em;text-transform:uppercase;padding:6px 10px;min-height:32px;border-radius:0;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;cursor:pointer}.mode-btn:last-child{border-right:0}.mode-btn:hover,.mode-btn:focus-visible{color:var(--ink);outline:none;background:var(--surface)}.mode-btn.active{background:var(--acid);color:var(--mark-ink);font-weight:600}.mode-attn{width:6px;height:6px;border-radius:50%;background:var(--accent-alt);flex-shrink:0}.mode-attn.needs-you{background:var(--warning)}.surface-roster h2{font-size:12px;text-transform:uppercase;letter-spacing:.08em;margin:0 0 12px;color:var(--muted)}.pulse{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--idle);margin-right:8px}.pulse.busy{background:var(--accent-alt);animation:pulse 1.2s infinite}.navigation,.inspector{min-height:0;min-width:0;background:var(--surface);transition:width .16s ease,opacity .16s ease}.navigation{border-right:1px solid var(--rule);min-width:0;overflow:hidden;padding:18px var(--gutter);display:flex;flex-direction:column;gap:var(--gutter)}.aside-heading{display:flex;justify-content:space-between;font-size:10px;letter-spacing:.16em;color:var(--muted);padding:7px 8px}.session{width:100%;display:flex;align-items:center;gap:6px;text-align:left;border:0;border-left:2px solid transparent;padding:10px 9px;background:transparent;font-size:12px}.session.active{border-left-color:var(--acid);background:var(--raised);color:var(--acid)}.session small{font-size:8px;color:var(--acid)}.session-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.session-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-meta{font-size:9px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-flags{display:flex;flex-direction:column;align-items:flex-end;gap:2px;flex-shrink:0}.child-agents{display:grid;gap:0;min-height:0}.children{font-size:11px;padding:0 9px;display:grid;gap:2px}.child-row{display:flex;align-items:center;gap:6px;padding:4px 6px;border-radius:var(--radius);border:1px solid transparent;background:transparent;color:inherit;width:100%;text-align:left;cursor:pointer;font:inherit}.child-row:hover,.child-row.active{border-color:var(--rule);background:color-mix(in srgb,var(--surface) 80%,transparent)}.child-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.child-meta{display:flex;gap:4px;align-items:center;flex-shrink:0}.children small,.children p{color:var(--muted)}.child-state{width:6px;height:6px;border-radius:50%;background:var(--accent-alt);flex-shrink:0}.child-state.completed,.child-state.running{background:var(--success)}.child-state.failed,.child-state.interrupted{background:var(--signal)}.child-state.blocked,.child-state.finalizing,.child-state.escalating{background:var(--warning)}.child-state.canceled,.child-state.unknown{background:var(--muted)}.quality{font-size:9px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}.quality.complete{color:var(--success)}.quality.partial{color:var(--warning)}.quality.unavailable{color:var(--signal)}.child-detail{margin:6px 9px 10px;padding:8px;border:1px solid var(--rule);border-radius:var(--radius);display:grid;gap:6px;font-size:11px}.child-detail header{display:flex;justify-content:space-between;gap:8px;align-items:baseline}.child-detail h3{margin:0;font-size:12px;font-weight:600}.child-detail dl{display:grid;grid-template-columns:auto 1fr;gap:2px 8px;margin:0}.child-detail dt{color:var(--muted);font-size:9px;text-transform:uppercase}.child-detail dd{margin:0;overflow-wrap:anywhere}.child-detail code{font-size:10px}.child-prompt{margin:0;white-space:pre-wrap;font-size:10px}.child-detail-actions{display:flex;gap:6px}.child-detail-actions button{font:inherit;font-size:10px;padding:3px 8px;border-radius:var(--radius);border:1px solid var(--rule);background:transparent;color:inherit;cursor:pointer}.child-detail-actions button:hover{border-color:var(--border-focus);color:var(--acid)}.child-detail-note{margin:0;font-size:9px}.workspace-meta{margin-top:auto;border-top:1px solid var(--rule);padding:8px 8px 0;overflow:hidden;color:var(--muted);font-size:9px}.workspace-meta summary{cursor:pointer;list-style:none;letter-spacing:.14em;text-transform:uppercase;padding:6px 0;-webkit-user-select:none;user-select:none}.workspace-meta summary::-webkit-details-marker{display:none}.workspace-meta[open] summary{margin-bottom:6px}.workspace-meta span{display:block;color:var(--muted);font-size:9px;margin-top:6px}.workspace-meta code{display:block;font-size:10px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}main{min-width:0;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden}.runtime{display:flex;gap:1px;border-bottom:1px solid var(--rule);background:var(--rule);overflow:auto;min-width:0}.runtime-explain{align-self:end;padding:6px 10px;font-size:10px;letter-spacing:.04em;text-transform:uppercase}.sandbox-explain-dialog{width:min(640px,calc(100vw - 24px))}.sandbox-summary{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;margin:0 0 14px;font-size:12px}.sandbox-summary dt{color:var(--muted);margin:0}.sandbox-summary dd{margin:0;color:var(--ink)}.sandbox-explain{max-height:min(50vh,360px);overflow:auto;white-space:pre-wrap;word-break:break-word}.runtime-field{display:grid;gap:3px;min-width:130px;background:var(--surface);padding:7px 10px}.runtime-field span{color:var(--muted);text-transform:uppercase;font-size:8px;letter-spacing:.14em}.runtime-field select{border:0;padding:0;background:transparent;font-size:11px}.runtime-more{display:flex;align-items:stretch;flex:1 1 auto;min-width:0;background:var(--surface)}.runtime-disclosure{display:flex;flex-direction:column;justify-content:center;gap:2px;border:0;background:transparent;padding:7px 12px;min-width:110px;text-align:left;cursor:pointer;color:var(--ink);font:inherit}.runtime-disclosure>span:first-child{color:var(--muted);text-transform:uppercase;font-size:8px;letter-spacing:.14em}.runtime-summary{color:var(--ink);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}.runtime-secondary{display:flex;gap:1px;flex:1 1 auto;min-width:0;background:var(--rule);border-left:1px solid var(--rule)}.runtime-status{display:flex;flex-wrap:wrap;gap:12px 18px;padding:6px 12px;background:var(--surface);border-top:1px solid var(--rule);color:var(--muted);font-size:10px;letter-spacing:.04em}.runtime-status span:before{content:"";display:inline-block;width:4px;height:4px;margin-right:8px;border-radius:50%;background:var(--acid);vertical-align:middle}.transcript{min-width:0;min-height:0;overflow:auto;padding:42px clamp(var(--gutter),6vw,80px);scrollbar-color:var(--rule) transparent}.empty-state{max-width:620px;margin:12vh auto 0}.empty-state span{color:var(--acid);font-size:10px;letter-spacing:.18em}.empty-state h1{font-size:clamp(42px,7vw,78px);line-height:.9;margin:18px 0;letter-spacing:-.04em}.empty-state p{color:var(--muted);max-width:530px;line-height:1.7;font-size:12px}.message{max-width:780px;margin:0 auto 28px;border-left:2px solid var(--rule);padding:0 0 0 18px}.message.user{border-color:var(--user)}.message.assistant{border-color:var(--acid)}.message.tool{border-color:var(--tool)}.message.reasoning{color:var(--muted)}.message.error{border-color:var(--signal)}.message-label{color:var(--muted);text-transform:uppercase;letter-spacing:.16em;font-size:9px;margin-bottom:8px}.message.user .message-label{color:var(--user)}.message.assistant .message-label{color:var(--acid)}.message.tool .message-label{color:var(--tool)}.message p{white-space:pre-wrap;line-height:1.7;margin:0;font-family:ui-monospace,monospace;font-size:13px}.message pre,.inspector pre,dialog pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px;line-height:1.55;background:var(--code-bg);padding:12px;border:1px solid var(--rule)}.composer{margin:0 clamp(var(--gutter),4vw,56px) 22px;border:1px solid var(--rule);background:var(--surface);position:relative;min-width:0}.composer label{display:block;padding:8px 12px;color:var(--muted);font-size:9px;text-transform:uppercase;letter-spacing:.16em;border-bottom:1px solid var(--rule)}.composer textarea{display:block;width:100%;min-height:88px;max-height:220px;resize:vertical;border:0;background:transparent;padding:14px;line-height:1.5}.composer-bar{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;padding:8px;border-top:1px solid var(--rule);color:var(--muted);font-size:9px;min-width:0}.composer-bar>span{display:inline-flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:0}.composer-send{background:var(--acid);color:var(--mark-ink);border-color:var(--acid);padding:7px 18px;text-transform:uppercase;font-size:10px;font-weight:600;flex-shrink:0}.composer-send:hover:not(:disabled),.composer-send:focus-visible{color:var(--mark-ink);border-color:var(--border-focus);filter:brightness(1.05)}.composer-bar .stop{background:var(--signal);border-color:var(--signal);color:var(--mark-ink)}.composer-send:disabled{opacity:.35;cursor:not-allowed}.composer-secondary{background:var(--surface);color:var(--ink);border-color:var(--rule);padding:7px 12px;text-transform:none;font-size:10px;font-weight:500}.composer-secondary:hover:not(:disabled),.composer-secondary:focus-visible{color:var(--acid);border-color:var(--acid);filter:none}.inspector{border-left:1px solid var(--rule);min-width:0;overflow:hidden;position:relative;display:flex;flex-direction:column}.session-group{flex:0 1 auto;max-height:55%;overflow:auto;padding:12px 16px 8px;border-bottom:1px solid var(--rule);display:flex;flex-direction:column;gap:12px;min-height:0}.session-group-pane{min-height:0}.session-group-facts{display:grid;grid-template-columns:auto 1fr;gap:2px 10px;margin:0;font-size:10px}.inspector .session-group-facts{margin:0;grid-template-columns:auto 1fr}.inspector .session-group-facts dt,.inspector .session-group-facts dd{margin:0;padding:2px 0;border:0}.session-group-facts dt{color:var(--muted);margin:0;padding:2px 0;border:0}.session-group-facts dd{margin:0;padding:2px 0;text-align:right;border:0;overflow-wrap:anywhere}.session-group-fit{font-size:10px;margin:8px 0 0;color:var(--warning)}.session-group-fit.critical{color:var(--signal)}.session-group-queue{margin:0}.session-group-queue .prompt-queue{padding-left:22px}.navigation.collapsed,.inspector.collapsed{opacity:0;pointer-events:none}.panel-resize{position:absolute;top:0;bottom:0;width:10px;z-index:2;display:flex;align-items:stretch;padding:0;margin:0;border:0;background:transparent}.panel-resize-nav{right:-5px;cursor:col-resize}.panel-resize-inspector{left:-5px;cursor:col-resize}.panel-resize-handle{flex:1;min-width:4px;background:transparent;transition:background .12s ease}.panel-resize:hover .panel-resize-handle,.panel-resize:focus-within .panel-resize-handle{background:color-mix(in srgb,var(--acid) 55%,transparent)}.inspector-body{flex:1;min-width:0;min-height:0;height:auto;overflow:auto;padding:20px var(--gutter)}.inspector h2{margin:8px 0 16px;font-family:Georgia,Times New Roman,serif;font-size:20px;font-weight:500}.inspector dl{display:grid;grid-template-columns:1fr 1fr;margin:0 0 30px;font-size:10px}.inspector dt,.inspector dd{margin:0;padding:8px 0;border-bottom:1px solid var(--rule)}.inspector dt{color:var(--muted)}.inspector dd{text-align:right;overflow-wrap:anywhere}.capabilities{display:flex;flex-wrap:wrap;gap:5px}.capabilities span{padding:4px 6px;border:1px solid var(--rule);color:var(--muted);font-size:8px;text-transform:uppercase}.capabilities span.enabled{color:var(--acid);border-color:var(--border-focus)}.muted{color:var(--muted);font-size:11px;line-height:1.5}.context-doctor-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.context-doctor-head h2{margin:0}.context-doctor-actions{display:flex;gap:6px;flex-wrap:wrap}.context-doctor-actions button,.context-layer-actions button,.context-kind-row button{font-size:10px;padding:4px 8px;border:1px solid var(--rule);background:var(--surface-muted);color:var(--ink);cursor:pointer}.context-doctor-actions button:disabled,.context-layer-actions button:disabled,.context-kind-row button:disabled{opacity:.45;cursor:not-allowed}.context-fit-warning{border:1px solid var(--warning);background:color-mix(in srgb,var(--warning) 12%,var(--surface-muted));padding:10px;margin:0 0 12px;display:grid;gap:4px}.context-fit-warning.critical{border-color:var(--danger);background:color-mix(in srgb,var(--danger) 12%,var(--surface-muted))}.context-fit-warning strong{font-size:11px;text-transform:uppercase;letter-spacing:.08em}.context-fit-warning p{margin:0;font-size:12px;line-height:1.45}.context-fit-warning small{color:var(--muted);font-size:10px}.context-attribution,.context-layers,.context-sets,.context-kind-picker{margin-top:16px}.context-attribution h3,.context-layers h3,.context-sets h3,.context-kind-picker h3{margin:0 0 8px;font-size:11px;text-transform:uppercase;letter-spacing:.1em;color:var(--muted)}.context-table{width:100%;border-collapse:collapse;font-size:11px}.context-table th,.context-table td{text-align:left;padding:6px 4px;border-bottom:1px solid var(--rule);vertical-align:top}.context-table th{color:var(--muted);font-weight:500;font-size:10px;text-transform:uppercase;letter-spacing:.08em}.context-layer-actions{display:flex;flex-wrap:wrap;gap:4px}.context-sets p{margin:0 0 6px;font-size:11px;line-height:1.45}.context-kind-list{display:grid;gap:4px}.context-kind-row{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:6px 0;border-bottom:1px solid var(--rule);font-size:11px}.context-kind-row span{display:flex;gap:4px}.changed-files,.project-list{display:grid;gap:10px}.changed-file,.project-list article{border:1px solid var(--rule);background:var(--surface-muted);padding:10px}.changed-file>button{width:100%;display:flex;justify-content:space-between;align-items:center;gap:12px;border:0;background:transparent;padding:0;text-align:left}.diff-stat{display:flex;gap:8px;font-size:10px}.diff-stat b:first-child{color:var(--diff-add)}.diff-stat b:last-child{color:var(--diff-del)}.diff-view{margin:10px 0 0;max-height:360px;overflow:auto;background:var(--code-bg);border:1px solid var(--rule);padding:10px;font-size:10px;white-space:pre-wrap}.project-list h3{margin:0 0 8px;font-size:12px;overflow-wrap:anywhere}.project-list p{margin:0 0 8px;color:var(--muted);font-size:11px;line-height:1.5;white-space:pre-wrap}.project-list small{color:var(--acid);text-transform:uppercase;font-size:8px;letter-spacing:.12em}.diagnostics-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:4px}.diagnostics-heading h2{margin:8px 0 16px}.diagnostics-subhead{margin:18px 0 10px;font-size:9px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}.diagnostics-actions{display:flex;flex-wrap:wrap;gap:6px}.diagnostics-actions button{border:1px solid var(--rule);background:var(--surface-muted);color:var(--ink);padding:5px 8px;font-size:10px;text-transform:uppercase;letter-spacing:.08em}.diagnostics-actions button:disabled{opacity:.45}.lsp-server header,.diagnostic-item header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}.lsp-server header h3,.diagnostic-item header code{margin:0}.lsp-state,.diag-severity{flex-shrink:0;padding:2px 6px;border:1px solid var(--rule);font-size:8px;letter-spacing:.12em;text-transform:uppercase}.lsp-state.state-up,.diag-severity.sev-info{color:var(--success);border-color:color-mix(in srgb,var(--success) 50%,var(--rule))}.lsp-state.state-error,.diag-severity.sev-error{color:var(--signal);border-color:color-mix(in srgb,var(--signal) 50%,var(--rule))}.lsp-state.state-down,.diag-severity.sev-warning{color:var(--warning);border-color:color-mix(in srgb,var(--warning) 50%,var(--rule))}.lsp-state.state-disabled,.diag-severity.sev-hint{color:var(--muted)}.lsp-error{color:var(--signal)!important}.diagnostic-item header code{font-size:11px;overflow-wrap:anywhere}.diagnostics-list .diagnostic-item p{margin-bottom:4px;color:var(--ink)}dialog{width:min(560px,calc(100vw - 32px));border:1px solid var(--rule);background:var(--surface);padding:28px;color:var(--ink)}.dialog-rule{position:absolute;left:0;top:0;width:7px;height:100%;background:var(--acid)}dialog::backdrop{background:color-mix(in srgb,var(--overlay) 85%,#000)}dialog h2{font-size:30px;margin:0 0 20px}dialog label{display:grid;gap:7px;color:var(--muted);font-size:10px}dialog input{padding:12px;color:var(--ink)}.dialog-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-top:22px}.dialog-actions button{padding:9px 14px}.permission-tool{margin:0 0 10px;font-size:15px}.permission-patterns{margin:0 0 14px;padding-left:1.2em;display:grid;gap:6px}.permission-patterns code{display:inline-block;padding:2px 6px;border-radius:var(--radius);background:var(--code-bg);color:var(--tool);font-size:12px;word-break:break-all}.permission-explain{display:grid;gap:10px;margin:12px 0 4px}.permission-explain button{justify-self:start;padding:7px 12px;font-size:12px;color:var(--muted);border:1px solid var(--rule);background:var(--surface-muted)}.permission-explain-body{margin:0;padding:12px;border-radius:var(--radius);background:var(--code-bg);color:var(--ink);font-size:12px;white-space:pre-wrap;max-height:180px;overflow:auto}.permission-explain-error{margin:0;color:var(--signal);font-size:12px}.undo-dialog{width:min(560px,calc(100vw - 32px))}.undo-preview{display:grid;gap:6px;margin:0 0 18px;padding:12px 14px;border:1px solid var(--rule);background:color-mix(in srgb,var(--surface) 88%,var(--ink));font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere}.undo-preview p{margin:0;color:var(--muted)}.undo-preview .undo-warn{color:var(--acid)}.undo-choices{display:grid;gap:8px}.undo-choice{display:grid;grid-template-columns:auto 1fr;gap:10px;align-items:start;margin:0;padding:12px 14px;border:1px solid var(--rule);cursor:pointer;color:var(--ink);font-size:12px}.undo-choice.active{border-color:var(--acid);background:color-mix(in srgb,var(--acid) 8%,transparent)}.undo-choice strong{display:block;text-transform:lowercase;letter-spacing:.02em}.undo-choice small{display:block;margin-top:4px;color:var(--muted);font-size:11px;line-height:1.4;font-weight:400}.undo-choice input{margin-top:3px}.mobile-only{display:none}@keyframes pulse{50%{opacity:.4}}@media(max-width:1023px){.app-shell{grid-template-columns:minmax(0,1fr);grid-template-rows:var(--header-height) minmax(0,1fr)}.app-shell main{min-width:0}.navigation{position:fixed;z-index:5;top:calc(var(--header-height) + env(safe-area-inset-top,0px));bottom:0;left:0;width:min(var(--nav-width, 280px),88vw);max-width:100vw;transform:translate(-100%);transition:transform .2s ease;box-shadow:none;padding-bottom:env(safe-area-inset-bottom,0px)}.navigation.open{transform:translate(0)}.inspector{position:fixed;right:0;top:calc(var(--header-height) + env(safe-area-inset-top,0px));bottom:0;width:min(var(--inspector-width, 360px),92vw);max-width:100vw;z-index:6;transform:translate(100%);transition:transform .2s ease;box-shadow:none;padding-bottom:env(safe-area-inset-bottom,0px)}.inspector.open{transform:translate(0)}.panel-resize{display:none}.shell-backdrop{display:none;position:fixed;top:0;right:0;bottom:0;left:0;top:calc(var(--header-height) + env(safe-area-inset-top,0px));background:color-mix(in srgb,var(--overlay) 55%,transparent);z-index:4;border:0;padding:0;cursor:pointer}.shell-backdrop.visible{display:block}}@media(max-width:599px){.app-shell{display:grid;grid-template:auto minmax(0,1fr) auto / minmax(0,1fr)}.mobile-only{display:block}.wordmark{flex-basis:auto;width:auto}.wordmark strong{font-size:12px}.wordmark small{display:none}header{flex-wrap:nowrap;gap:6px;padding:0 8px;padding-top:env(safe-area-inset-top,0px);overflow:hidden}.header-mode-switch{display:none!important}.palette-trigger{max-width:5.5rem}.palette-trigger kbd{display:none}header .icon-button[aria-label="Export markdown"]{display:none}.session-line{font-size:0;margin-left:auto;display:flex;align-items:center;gap:6px;min-width:0;flex:0 1 auto}.session-line .pulse{margin:0}.session-line .attention-summary{font-size:9px;max-width:9em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:4px 8px;min-height:32px}.runtime{max-width:100%}.runtime-stack{padding:0 4px}.transcript{padding:16px 12px 12px}.composer{margin:0;border-radius:0;border-left:0;border-right:0;padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px));position:sticky;bottom:0;background:var(--surface);z-index:2}.composer textarea{min-height:44px;font-size:16px}.composer-bar button,.composer .queue-toolbar button{min-height:44px;min-width:44px;padding:10px 12px}.empty-state{margin-top:4vh;padding:0 8px}.icon-button{min-width:44px;min-height:44px}.navigation,.inspector{top:auto;bottom:calc(var(--mode-bar-height) + env(safe-area-inset-bottom,0px));left:0;right:0;width:100%;max-height:min(78dvh,640px);border-top:1px solid var(--rule);border-radius:var(--radius) var(--radius) 0 0;transform:translateY(105%);box-shadow:none;padding-bottom:8px;z-index:8}.navigation.open,.inspector.open{transform:translateY(0)}.shell-backdrop{top:calc(var(--header-height) + env(safe-area-inset-top,0px));z-index:7}header{z-index:10}.mode-bottom-bar{display:flex;align-items:stretch;justify-content:space-around;gap:2px;border-top:1px solid var(--rule);background:var(--header-bg);padding:4px 4px calc(4px + env(safe-area-inset-bottom,0px));z-index:3}.mode-bottom-bar .mode-btn{flex:1;flex-direction:column;justify-content:center;gap:2px;min-height:48px;padding:6px 4px;font-size:9px;border-radius:var(--radius)}.mode-bottom-bar .mode-btn span:first-child{max-width:none}}.mode-bottom-bar{display:none}.app-shell[data-shell=phone] .mode-bottom-bar{display:flex;z-index:9}.surface-nav-sheet{flex:0 0 auto;border-bottom:1px solid var(--rule);max-height:40vh;overflow:auto;background:var(--surface-muted);min-width:0}.surface-nav-list{list-style:none;margin:0;padding:.35rem .5rem;display:flex;flex-direction:column;gap:.25rem}.surface-nav-item{display:flex;width:100%;min-height:44px;align-items:center;justify-content:flex-start;text-align:left;padding:.5rem .75rem;border:1px solid transparent;border-radius:var(--radius);background:transparent;color:var(--ink);font:inherit;cursor:pointer}.surface-nav-item:hover,.surface-nav-item:focus-visible{border-color:var(--border-focus);outline:none;background:var(--raised)}.surface-nav-item.active{background:var(--surface);border-color:var(--rule);font-weight:600}.surface-nav-label{text-transform:lowercase}.app-shell[data-shell=phone] main{min-width:0}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}.navigation,.inspector,.shell-backdrop{transition:none!important}}.fast-toggle{display:flex;align-items:center;gap:6px;padding:0 10px;background:var(--surface);font-size:9px;color:var(--muted)}.fast-toggle input{accent-color:var(--acid)}.session-actions{display:flex;flex-direction:column;gap:6px;padding:0 8px}.session-actions>button{padding:6px 8px;font-size:9px;text-transform:uppercase;width:100%}.session-actions button:disabled{opacity:.4}.session-overflow{position:relative;width:100%}.session-overflow>summary{list-style:none;cursor:pointer;padding:6px 8px;border:1px solid var(--rule);background:var(--surface);font-size:9px;text-transform:uppercase;letter-spacing:.08em;text-align:center;-webkit-user-select:none;user-select:none}.session-overflow>summary::-webkit-details-marker{display:none}.session-overflow>summary:hover,.session-overflow>summary:focus-visible{border-color:var(--acid);color:var(--acid)}.session-overflow-menu{display:grid;gap:2px;margin-top:4px;border:1px solid var(--rule);background:var(--raised);padding:4px}.session-overflow-menu button{width:100%;border:0;background:transparent;padding:7px 8px;font-size:9px;text-transform:uppercase;text-align:left}.session-overflow-menu button:hover,.session-overflow-menu button:focus-visible{background:var(--surface);color:var(--acid)}.nav-tab{border:0;border-bottom:2px solid transparent;background:transparent;padding:7px 12px;font-size:10px;letter-spacing:.16em;color:var(--muted)}.nav-tab.active{border-bottom-color:var(--acid);color:var(--acid)}.history-search{width:100%;margin:0 0 6px;padding:7px 10px;border:1px solid var(--rule);background:var(--ground);font-size:11px}.root-idle{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--idle);margin-right:8px}.root-busy{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--accent-alt);animation:pulse 1.2s infinite;margin-right:8px}.live-badge{font-size:8px;color:var(--accent-alt)}.session.history-row{gap:6px}.session.history-row .live-badge{color:var(--accent-alt)}.markdown h2,.markdown h3{font-family:Georgia,Times New Roman,serif;margin:16px 0 8px}.markdown h2{font-size:22px}.markdown h3{font-size:17px}.markdown p{margin:5px 0}.markdown a,.file-ref{color:var(--acid)}.markdown code{background:var(--code-bg);border:1px solid var(--rule);padding:1px 4px}.list-line{padding:3px 0 3px 12px;line-height:1.6}.code-block{margin:12px 0;border:1px solid var(--rule);background:var(--code-bg)}.code-block figcaption{padding:6px 10px;border-bottom:1px solid var(--rule);color:var(--muted);font-size:9px;text-transform:uppercase}.code-block pre{border:0;margin:0}.tool-card{border:1px solid var(--rule);background:var(--code-bg)}.tool-card summary{display:flex;justify-content:space-between;padding:9px 12px;cursor:pointer;color:var(--tool)}.tool-card summary small{color:var(--muted)}.tool-card pre{margin:0;border-width:1px 0 0}.diff span{display:block}.diff .add{color:var(--diff-add);background:var(--diff-add-bg)}.diff .del{color:var(--diff-del);background:var(--diff-del-bg)}.composer-field{position:relative;display:flex;flex-direction:column;min-width:0}.completion{--completion-max-rows: 6;--completion-row-height: 28px;display:flex;flex-direction:column;background:var(--raised);border-bottom:1px solid var(--rule);max-height:calc(var(--completion-max-rows) * var(--completion-row-height));overflow:auto}.completion button{box-sizing:border-box;min-height:var(--completion-row-height);padding:4px 12px;line-height:1.35;white-space:nowrap;overflow:hidden}.ui-list-row-meta:before,.completion span:before{content:"— "}.attachments{display:flex;gap:6px;padding:7px 10px;border-top:1px solid var(--rule)}.attachments button{padding:5px 8px;font-size:9px}.prompt-queue-wrap{border-top:1px solid var(--rule)}.prompt-queue{margin:0;padding:8px 12px 8px 34px;font-size:10px;color:var(--muted);list-style:decimal}.prompt-queue li{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:start;padding:4px 0}.prompt-queue li span:first-child{overflow-wrap:anywhere}.queue-actions{display:inline-flex;gap:2px;flex-shrink:0}.queue-actions button{border:0;background:transparent;color:var(--muted);padding:0 4px;min-width:1.4em;cursor:pointer}.queue-actions button:disabled{opacity:.35;cursor:default}.queue-edit{width:100%;font:inherit;color:var(--ink);background:var(--raised);border:1px solid var(--rule);padding:4px 6px}.queue-toolbar{display:flex;justify-content:flex-end;padding:0 12px 8px}.queue-toolbar button{font-size:9px;padding:4px 8px}.unavailable p{color:var(--muted);font-size:10px;line-height:1.5}.capability-list{display:grid;gap:1px;background:var(--rule)}.capability-list div{display:flex;justify-content:space-between;gap:10px;padding:9px;background:var(--surface);font-size:9px}.capability-list strong{text-align:right}.available{color:var(--success)}.unavailable-label{color:var(--signal)}dialog fieldset{border:1px solid var(--rule);margin:10px 0;padding:12px}dialog legend{color:var(--ink);padding:0 5px;font-size:11px}dialog fieldset label{display:flex;grid-template-columns:auto 1fr auto;align-items:start;margin:8px 0}dialog fieldset small{color:var(--muted)}.mcp-head{display:flex;justify-content:space-between;gap:8px;align-items:baseline;margin-bottom:8px}.mcp-head h2{margin:0;font-size:13px}.mcp-actions,.mcp-card-actions{display:flex;gap:6px;flex-wrap:wrap}.mcp-list{display:grid;gap:8px}.mcp-card{border:1px solid var(--rule);background:var(--surface-muted);padding:10px;display:grid;gap:6px}.mcp-card header{display:flex;justify-content:space-between;gap:8px;align-items:baseline}.mcp-card h3{margin:0;font-size:12px}.mcp-card p{margin:0;color:var(--muted);font-size:10px}.mcp-card code{background:var(--code-bg);border:1px solid var(--border-muted);padding:1px 4px;font-size:9px}.mcp-state{text-transform:uppercase;font-size:8px;letter-spacing:.12em;color:var(--muted)}.mcp-state.up{color:var(--success)}.mcp-state.error{color:var(--signal)}.mcp-state.down{color:var(--warning)}.mcp-state.disabled{color:var(--overlay)}.mcp-error{color:var(--signal)!important;font-size:10px}.mcp-tools{display:flex;flex-wrap:wrap;gap:4px}.workflow-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.workflow-head h2{margin:0;font-size:13px}.workflow-actions{display:flex;gap:6px;flex-wrap:wrap}.workflow-actions button,.workflow-card-actions button,.workflow-phase-tools button{font-size:10px;padding:4px 8px}.workflow-active{font-size:11px;color:var(--accent-alt);margin:0 0 8px}.workflow-list{display:grid;gap:8px}.workflow-card{border:1px solid var(--rule);background:var(--surface);padding:10px;display:grid;gap:6px}.workflow-card.invalid{border-color:var(--signal)}.workflow-card header{display:flex;justify-content:space-between;gap:8px;align-items:baseline}.workflow-card h3{margin:0;font-size:12px}.workflow-card small,.workflow-card p{margin:0;color:var(--muted);font-size:10px}.workflow-error{color:var(--signal)!important;font-size:10px}.workflow-warn{color:var(--warning);font-size:10px;margin:6px 0}.workflow-grants{display:flex;flex-wrap:wrap;gap:4px;align-items:center;font-size:10px}.workflow-grants span{color:var(--muted);margin-right:4px}.workflow-grants code,.check-cmd{background:var(--code-bg);border:1px solid var(--border-muted);padding:2px 5px;font-size:9px}.workflow-card-actions{display:flex;gap:6px}.workflow-dialog{width:min(520px,calc(100vw - 24px));max-height:calc(100vh - 48px);overflow:auto;border:1px solid var(--rule);background:var(--surface);color:var(--ink);padding:16px}.workflow-dialog.wide{width:min(720px,calc(100vw - 24px))}.workflow-dialog::backdrop{background:color-mix(in srgb,var(--overlay) 55%,transparent)}.workflow-builder{display:grid;gap:10px}.workflow-builder fieldset label{display:grid;grid-template-columns:110px 1fr;gap:8px;align-items:center;margin:6px 0}.workflow-builder input,.workflow-builder select,.workflow-builder textarea{width:100%;background:var(--ground);color:var(--ink);border:1px solid var(--rule);padding:6px 8px;font:inherit;font-size:11px}.workflow-phases{display:flex;flex-wrap:wrap;gap:4px;align-items:center}.workflow-phases>button{font-size:10px;padding:4px 8px;border:1px solid var(--rule);background:var(--surface-muted);color:var(--ink)}.workflow-phases>button.active{border-color:var(--border-focus);background:var(--raised);color:var(--highlight)}.workflow-phase-tools{display:flex;gap:4px;margin-left:auto}.perm-row{display:grid;grid-template-columns:1fr 1fr 90px auto;gap:6px;margin:4px 0}.workflow-review{border:1px solid var(--rule);background:var(--surface-muted);padding:10px;display:grid;gap:6px}.workflow-review h3{margin:0;font-size:11px}.workflow-review-phase{font-size:10px}.workflow-json{margin:0;max-height:180px;overflow:auto;background:var(--code-bg);border:1px solid var(--border-muted);padding:8px;font-size:10px;white-space:pre-wrap}@media(max-width:720px){.workflow-builder fieldset label,.perm-row{grid-template-columns:1fr}.workflow-dialog.wide{width:calc(100vw - 16px)}}.plans-panel{display:grid;gap:8px}.plans-meta{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0;font-size:10px;color:var(--muted)}.plans-meta small{color:var(--acid);text-transform:uppercase;letter-spacing:.12em;font-size:8px}.plans-actions{flex-wrap:wrap;margin:4px 0 8px}.plans-section-head{display:flex;justify-content:space-between;gap:8px;align-items:baseline}.plans-section-head h3{margin:0}.plans-section-head button{font-size:10px;padding:2px 6px}.plans-create{display:grid;gap:6px;border:1px solid var(--rule);background:var(--surface-muted);padding:10px;margin-bottom:8px}.plans-create label{display:grid;gap:4px;font-size:10px;color:var(--muted)}.plans-create input{background:var(--ground);color:var(--ink);border:1px solid var(--rule);padding:6px 8px;font:inherit;font-size:11px}.plans-create button{justify-self:start;font-size:10px;padding:4px 8px}.plans-sections{margin-top:4px}.timeline-panel{display:grid;gap:10px}.timeline-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.timeline-head h2{margin:0;font-size:13px}.timeline-actions{display:flex;gap:6px;flex-wrap:wrap}.timeline-actions button{font-size:10px;padding:4px 8px}.timeline-summary{display:grid;grid-template-columns:repeat(auto-fill,minmax(72px,1fr));gap:8px;margin:0}.timeline-summary div{border:1px solid var(--rule);background:var(--surface-muted);padding:8px}.timeline-summary dt{margin:0 0 4px;color:var(--muted);font-size:8px;letter-spacing:.1em;text-transform:uppercase}.timeline-summary dd{margin:0;font-size:12px}.timeline-list{list-style:none;margin:0;padding:0;display:grid;gap:4px;max-height:min(60vh,480px);overflow:auto}.timeline-entry{display:grid;grid-template-columns:72px minmax(0,1.4fr) 72px 48px;gap:6px 8px;align-items:baseline;border:1px solid var(--border-muted);background:var(--surface-muted);padding:6px 8px;font-size:10px}.timeline-state{font-size:9px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}.timeline-state.state-completed{color:var(--success)}.timeline-state.state-failed{color:var(--signal)}.timeline-state.state-canceled{color:var(--warning)}.timeline-state.state-running,.timeline-state.state-waiting,.timeline-state.state-queued{color:var(--accent-alt)}.timeline-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink)}.timeline-id{color:var(--muted);font-size:9px;overflow:hidden;text-overflow:ellipsis}.timeline-dur{color:var(--muted);text-align:right}.timeline-code{grid-column:1 / -1;color:var(--warning);font-size:9px}.timeline-err{grid-column:1 / -1;color:var(--signal);font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.root-attention{width:8px;height:8px;border-radius:50%;background:var(--warning);flex-shrink:0}.needs-you{color:var(--warning)!important;font-weight:700}.attention-summary{margin-left:8px;border:1px solid var(--warning);background:color-mix(in srgb,var(--warning) 12%,transparent);color:var(--warning);font-size:9px;text-transform:uppercase;letter-spacing:.04em;padding:2px 6px;border-radius:var(--radius);cursor:pointer}.attention-summary:hover{filter:brightness(1.1)}.settings-dialog{width:min(560px,calc(100vw - 24px));max-width:calc(100vw - 24px);min-width:0;max-height:min(88vh,900px);overflow:auto;border:1px solid var(--rule);background:var(--surface);color:var(--ink);padding:18px 20px 16px}.settings-dialog.wide{width:min(640px,calc(100vw - 24px))}.settings-dialog::backdrop{background:color-mix(in srgb,var(--overlay) 55%,transparent)}.settings-form fieldset label{display:grid;grid-template-columns:minmax(0,140px) minmax(0,1fr);gap:8px 12px;align-items:center;margin:6px 0;min-width:0}.settings-form fieldset label select,.settings-form fieldset label input{width:100%;min-width:0;padding:8px 10px;background:var(--ground);border:1px solid var(--rule);color:var(--ink)}.settings-form fieldset button[type=button]{margin-top:6px;font-size:10px;padding:6px 10px}.settings-form .muted,.settings-dialog .muted{color:var(--muted);font-size:10px;margin:4px 0 8px;line-height:1.45}.exclude-list{display:flex;flex-wrap:wrap;gap:8px 14px;margin-top:8px;align-items:center}.exclude-label{width:100%;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.04em}.exclude-item{display:inline-flex!important;align-items:center;gap:6px;margin:0!important;color:var(--ink);font-size:11px;grid-template-columns:none!important}.settings-error{color:var(--signal);font-size:11px;margin:8px 0 0}.goal-meta{display:grid;grid-template-columns:100px 1fr;gap:4px 8px;margin:0 0 12px;font-size:11px}.goal-meta dt{color:var(--muted);margin:0}.goal-meta dd{margin:0;overflow-wrap:anywhere}.goal-criteria{margin:0 0 12px;padding-left:18px;font-size:11px;color:var(--muted)}.goal-criteria strong{color:var(--acid);margin-right:6px}.goal-log{margin:0 0 12px;padding-left:18px;display:grid;gap:8px;font-size:11px}.goal-log li{display:grid;gap:2px}.goal-log span{color:var(--muted);font-size:10px}.goal-log p{margin:0;color:var(--muted);white-space:pre-wrap}.project-form{display:grid;gap:10px;margin-bottom:16px;padding:12px;border:1px solid var(--rule);background:var(--surface-muted)}.project-form label{display:grid;gap:6px;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.08em}.project-form input,.project-form textarea{width:100%;border:1px solid var(--rule);background:var(--surface);color:var(--ink);padding:8px 10px;font:inherit;font-size:12px;text-transform:none;letter-spacing:normal}.project-form textarea{resize:vertical;min-height:64px}.plugin-card .plugin-trust{font-size:10px;text-transform:uppercase;letter-spacing:.04em}.plugin-trust.trusted{color:var(--success)}.plugin-trust.stale{color:var(--warning)}.plugin-trust.none{color:var(--signal)}.plugin-trust.passive{color:var(--muted)}.plugin-findings{margin:4px 0 0;padding-left:16px;font-size:10px;color:var(--muted)}.plugin-install{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:end;margin:0 0 10px}.plugin-install label{display:grid;gap:4px;font-size:10px;color:var(--muted)}.plugin-install input{width:100%;background:var(--ground);color:var(--ink);border:1px solid var(--rule);padding:6px 8px;font:inherit;font-size:11px}.plugin-trust-preview{border:1px solid var(--border-focus);background:var(--surface-muted);padding:10px;margin:0 0 10px;display:grid;gap:6px}.plugin-trust-preview h3{margin:0;font-size:12px}.plugin-trust-preview ul{margin:0;padding-left:16px;font-size:10px}.plugin-pane-surface{border:1px solid var(--rule);background:var(--surface);outline:none;min-height:120px}.plugin-pane-surface:focus{border-color:var(--border-focus)}.plugin-pane-chrome{display:flex;gap:8px;align-items:baseline;padding:8px 10px;border-bottom:1px solid var(--rule);background:var(--surface-muted);font-size:11px}.plugin-pane-body{padding:10px;font-size:11px}.pane-column{display:grid}.pane-row{display:flex;flex-wrap:wrap;min-width:0}.pane-row.wrap{flex-direction:column;flex-wrap:nowrap}.pane-row-cell{flex-grow:1;flex-shrink:1;flex-basis:calc((var(--stack-at, 0px) - 100%) * 999);min-width:0;max-width:100%}.pane-row.wrap .pane-row-cell{flex:1 1 auto;width:100%}.pane-role{margin:0}.pane-role.title{font-weight:600;color:var(--ink)}.pane-role.muted{color:var(--muted)}.pane-role.accent{color:var(--acid)}.pane-role.success{color:var(--success)}.pane-role.warning{color:var(--warning)}.pane-role.error{color:var(--signal)}.pane-role.body{color:var(--ink)}.pane-kv{margin:0;display:grid;gap:2px}.pane-kv-row{display:grid;grid-template-columns:minmax(48px,30%) 1fr;gap:8px}.pane-kv dt,.pane-kv dd{margin:0}.pane-list{list-style:none;margin:0;padding:0;display:grid;gap:2px}.pane-list li{display:flex;justify-content:space-between;gap:8px;padding:2px 4px}.pane-list li.selected{background:var(--surface-muted);color:var(--highlight)}.pane-table{width:100%;border-collapse:collapse;font-size:10px}.pane-table th,.pane-table td{text-align:left;padding:2px 4px;border-bottom:1px solid var(--border-muted)}.pane-table th{color:var(--muted);font-weight:500}.pane-meter{display:flex;align-items:center;gap:8px}.pane-badge{display:inline-block;padding:1px 6px;border-radius:var(--radius);background:var(--surface-muted);font-size:10px}.pane-badge.tone-success{color:var(--success)}.pane-badge.tone-warning{color:var(--warning)}.pane-badge.tone-error{color:var(--signal)}.pane-badge.tone-accent{color:var(--acid)}.pane-divider{border:0;border-top:1px solid var(--border-muted);margin:6px 0}.pane-error{padding:10px;background:var(--unavailable-bg);color:var(--signal);font-size:11px}.pane-error p{margin:4px 0 0;color:var(--muted)}.pane-empty{padding:8px 0}@media(max-width:720px){.plugin-install{grid-template-columns:1fr}.settings-form fieldset label{grid-template-columns:minmax(0,1fr)}}.plugin-head,.plugin-pane-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.plugin-head h2,.plugin-pane-head h3{margin:0;font-size:13px}.plugin-actions,.plugin-card-actions{display:flex;gap:6px;flex-wrap:wrap}.plugin-list{display:grid;gap:8px}.plugin-card{border:1px solid var(--rule);background:var(--surface-muted);padding:10px;display:grid;gap:6px}.plugin-card header{display:flex;flex-wrap:wrap;gap:6px;align-items:center}.plugin-card h3{margin:0;font-size:12px;flex:1}.plugin-status,.plugin-trust{font-size:10px;text-transform:uppercase;letter-spacing:.04em}.plugin-status.enabled{color:var(--success)}.plugin-status.disabled{color:var(--muted)}.plugin-status.invalid{color:var(--signal)}.plugin-counts{font-size:10px}.plugin-mcp,.plugin-findings,.plugin-hits,.plugin-panes ul{margin:0;padding-left:16px;font-size:10px}.plugin-review{border:1px solid var(--border-focus);background:var(--surface);padding:10px;display:grid;gap:6px;margin-bottom:10px}.plugin-review h3{margin:0;font-size:12px}.plugin-summary{margin:0;max-height:160px;overflow:auto;background:var(--code-bg);border:1px solid var(--border-muted);padding:8px;font-size:10px;white-space:pre-wrap}.plugin-pane-host{margin-top:12px;border:1px solid var(--rule);background:var(--surface)}.plugin-pane-body{padding:10px}.plugin-card-actions .danger{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 40%,var(--rule))}.error-text{color:var(--signal);margin:0;font-size:11px}.warning-text{color:var(--warning);margin:0;font-size:11px}.pane-list-btn{background:none;border:0;color:inherit;font:inherit;text-align:left;padding:0;cursor:pointer}.pane-meter-track{flex:1;height:6px;background:var(--ground);border-radius:var(--radius);overflow:hidden}.pane-meter-fill{height:100%;background:var(--acid)}.pane-meter-fill.tone-success{background:var(--success)}.pane-meter-fill.tone-warning{background:var(--warning)}.pane-meter-fill.tone-error,.pane-meter-fill.tone-danger{background:var(--signal)}.pane-divider{border:0;border-top:1px solid var(--rule);margin:6px 0}.pane-spacer{width:100%}.palette-trigger{margin-left:auto;display:inline-flex;align-items:center;gap:6px;border:1px solid var(--rule);background:transparent;padding:4px 10px;border-radius:var(--radius);cursor:pointer;font-size:12px;color:var(--muted);flex:0 1 auto;min-width:0;overflow:hidden}.palette-trigger kbd{font-size:10px}.palette-input{width:100%;padding:10px 12px;border:1px solid var(--rule);background:var(--code-bg);color:var(--ink);border-radius:var(--radius);margin-bottom:10px}.palette-list{list-style:none;margin:0;padding:0;max-height:360px;overflow:auto;display:grid;gap:0}.palette-hint{margin:8px 0 0;font-size:11px}.onboard-hint{display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;align-items:center;padding:8px 12px;border:1px solid var(--rule);border-radius:var(--radius);background:color-mix(in srgb,var(--acid) 8%,transparent);margin:0 0 8px;font-size:12px;min-width:0}.onboard-hint p{margin:0}.team-workspace{display:grid;gap:var(--gutter);min-width:0}.team-workspace-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0}.team-workspace-head h2{margin:0;min-width:0}.team-attention-entry{width:100%;text-align:left;padding:8px 10px;border:1px solid var(--rule);background:color-mix(in srgb,var(--acid) 8%,transparent);cursor:pointer;border-radius:var(--radius);font-weight:600}.team-attention ul{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:4px}.team-attention li button{width:100%;display:flex;gap:8px;align-items:flex-start;text-align:left;padding:8px;border:1px solid var(--rule);background:var(--code-bg);cursor:pointer;border-radius:var(--radius)}.team-attention li strong{display:block}.team-attention li small{display:block;color:var(--muted)}.team-view-tabs,.team-filters{display:inline-flex;flex-wrap:wrap;gap:0;max-width:100%;border:1px solid var(--rule);background:var(--surface-muted)}.team-view-tabs button,.team-filters button{border:0;border-right:1px solid var(--rule);background:transparent;padding:4px 10px;border-radius:0;cursor:pointer;font-size:12px;text-transform:capitalize}.team-view-tabs button:last-child,.team-filters button:last-child{border-right:0}.team-view-tabs button.active,.team-filters button.active,.team-view-tabs button[aria-selected=true],.team-filters button[aria-pressed=true]{background:var(--acid);color:var(--mark-ink);border-color:var(--ink)}.team-roster{list-style:none;margin:0;padding:0;display:grid;gap:4px}.team-detail{border:1px solid var(--rule);padding:10px;border-radius:var(--radius);background:var(--code-bg)}.team-detail header{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;min-width:0}.team-detail h3{margin:0}.team-detail dl{display:grid;grid-template-columns:auto 1fr;gap:4px 10px;margin:8px 0;font-size:12px}.team-detail dt{color:var(--muted)}.team-detail dd{margin:0}.team-files{margin:0;padding-left:16px}.team-detail-actions{display:flex;gap:8px}.team-board{display:flex;gap:10px;overflow-x:auto;padding-bottom:8px;scroll-snap-type:x mandatory}.team-board-col{min-width:160px;max-width:220px;flex:0 0 auto;border:1px solid var(--rule);border-radius:var(--radius);padding:8px;scroll-snap-align:start;background:var(--code-bg)}.team-board-col h4{margin:0 0 8px;font-size:12px;text-transform:capitalize}.team-board-col ul{list-style:none;margin:0;padding:0;display:grid;gap:6px}.team-board-card{width:100%;text-align:left;display:grid;gap:4px;border:1px solid var(--rule);background:var(--ground);padding:8px;border-radius:var(--radius)}.team-board-card-main{width:100%;text-align:left;display:grid;gap:2px;border:0;background:transparent;padding:0;cursor:pointer;color:inherit}.team-board-actions,.team-control-row{display:flex;flex-wrap:wrap;gap:6px}.team-board-actions button,.team-control-row button,.team-controls-inline button{border:1px solid var(--rule);background:transparent;padding:4px 8px;border-radius:var(--radius);cursor:pointer;font-size:12px}.team-board-actions button:disabled,.team-control-row button:disabled{opacity:.5;cursor:not-allowed}.team-board-reason{font-size:11px;color:var(--muted)}.team-messages{list-style:none;margin:0;padding:0;display:grid;gap:8px}.team-messages li{display:grid;gap:2px;padding:8px;border:1px solid var(--rule);border-radius:var(--radius)}.team-control-status{margin:0;padding:8px 10px;border-radius:var(--radius);font-size:12px;border:1px solid var(--rule);background:color-mix(in srgb,var(--acid) 10%,transparent)}.team-controls{display:grid;gap:12px}.team-control-block{border:1px solid var(--rule);border-radius:var(--radius);padding:10px;display:grid;gap:8px;margin:0;background:var(--code-bg)}.team-control-block legend{padding:0 4px;font-weight:600}.team-control-block label{display:grid;gap:4px;font-size:12px;color:var(--muted)}.team-control-block input,.team-control-block textarea,.team-control-block select{width:100%;border:1px solid var(--rule);border-radius:var(--radius);background:var(--ground);color:var(--ink);padding:6px 8px;font:inherit}.team-control-block button.primary{justify-self:start;background:var(--acid);color:var(--mark-ink);border-color:var(--ink);padding:6px 12px;border-radius:var(--radius);cursor:pointer}.team-control-block button.linkish{justify-self:start;border:0;background:transparent;color:var(--acid);cursor:pointer;padding:0;text-align:left}.team-control-advanced{display:grid;gap:8px}.team-local-board{list-style:none;margin:0;padding:0;display:grid;gap:8px}.team-local-board li{display:grid;gap:4px;padding:8px;border:1px solid var(--rule);border-radius:var(--radius);background:var(--ground)}.team-controls-inline{margin-top:8px}@media(max-width:720px){.team-board{flex-direction:column;overflow-x:visible}.team-board-col{min-width:0;max-width:none;width:100%}.team-control-block{padding:8px}}.tool-card summary{display:flex;flex-wrap:wrap;gap:8px;align-items:center;cursor:pointer;padding:8px 10px}.tool-name{font-weight:600;font-family:var(--mono, ui-monospace, monospace)}.tool-state{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}.tool-state-running{color:var(--acid)}.tool-state-error{color:var(--diff-del)}.tool-state-denied{color:var(--warning)}.tool-duration{color:var(--muted)}.tool-args{padding:8px 10px;border-top:1px solid var(--rule)}.tool-args pre,.tool-output{margin:0;max-height:280px;overflow:auto;font-size:11px}.diff-viewer{border-top:1px solid var(--rule)}.diff-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:6px 10px;font-size:11px}.diff-wrap{display:inline-flex;gap:4px;align-items:center;color:var(--muted)}.diff.wrap{white-space:pre-wrap;word-break:break-word}.diff .hunk{color:var(--muted)}.copy-btn{font-size:10px;padding:2px 6px}button.file-ref{background:none;border:0;padding:0;color:var(--acid);cursor:pointer;text-decoration:underline;font:inherit}.exploration-group summary{cursor:pointer;padding:8px 10px;display:flex;gap:8px;align-items:center}.exploration-body{display:grid;gap:6px;padding:0 8px 8px}.semantic-event p{margin:0;color:var(--text)}.jump-latest{position:sticky;bottom:12px;margin:0 auto;display:block;z-index:2;padding:8px 14px;border-radius:var(--radius);border:1px solid var(--rule);background:var(--panel, var(--bg));cursor:pointer}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.code-block figcaption{display:flex;justify-content:space-between;align-items:center;gap:8px}.provider-rows{display:flex;flex-direction:column;gap:.5rem;margin-bottom:.75rem}.provider-row{border:1px solid var(--rule);border-radius:var(--radius);padding:.5rem .75rem;background:var(--surface-muted)}.provider-row header{display:flex;justify-content:space-between;align-items:center;gap:.5rem}.provider-row .badge{font-size:.75rem;padding:.1rem .4rem;border-radius:var(--radius);background:var(--surface);border:1px solid var(--rule)}.provider-row .badge.ok{border-color:var(--success);color:var(--success)}.model-meta ul{margin:.25rem 0 0;padding-left:1.1rem}.device-flow,.oauth-flow{margin-top:.5rem;padding:.5rem;border:1px dashed var(--rule);border-radius:var(--radius)}.custom-provider-list{list-style:none;padding:0;margin:0 0 .5rem}.custom-provider-list li{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-bottom:.35rem}.code-explorer{display:grid;gap:10px;min-width:0}.code-explorer-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0}.code-explorer-head h2{margin:0;min-width:0}.code-view-tabs,.code-md-toggle{display:inline-flex;gap:0;border:1px solid var(--rule);background:var(--surface-muted)}.code-view-tabs{margin-left:auto}.code-view-tabs button,.code-md-toggle button{border:0;border-right:1px solid var(--rule);background:transparent;padding:4px 10px;border-radius:0;cursor:pointer;font-size:12px}.code-view-tabs button:last-child,.code-md-toggle button:last-child{border-right:0}.code-view-tabs button.active,.code-md-toggle button.active{background:var(--acid);color:var(--mark-ink);border-color:var(--ink)}.code-explorer-body{display:grid;grid-template-columns:minmax(0,240px) minmax(0,1fr);gap:var(--gutter);min-height:280px;min-width:0}.code-sidebar{display:grid;gap:8px;align-content:start;min-width:0}.code-search{display:flex;gap:6px;align-items:center;min-width:0}.code-search input{flex:1;min-width:0;border:1px solid var(--rule);border-radius:var(--radius);background:var(--ground);color:var(--ink);padding:6px 8px;font:inherit}.code-breadcrumbs{font-size:12px;color:var(--muted)}.code-breadcrumbs button{border:0;background:transparent;color:var(--acid);cursor:pointer;padding:0}.code-tree,.code-search-hits{list-style:none;margin:0;padding:0;display:grid;gap:2px;max-height:360px;overflow:auto}.code-tree button,.code-search-hits button{width:100%;text-align:left;border:1px solid transparent;background:transparent;padding:4px 6px;border-radius:var(--radius);cursor:pointer;color:inherit;font:inherit}.code-tree button:hover,.code-search-hits button:hover,.code-tree button.active{border-color:var(--rule);background:var(--code-bg)}.code-viewer{border:1px solid var(--rule);border-radius:var(--radius);padding:10px;background:var(--code-bg);min-width:0;overflow:auto}.code-viewer-head{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:8px}.code-viewer-head h3{margin:0;font-size:13px;word-break:break-all}.code-raw{margin:0;font-family:var(--mono, ui-monospace, monospace);font-size:12px;line-height:1.45}.code-line{display:grid;grid-template-columns:3em 1fr;gap:8px}.code-line.focus{background:color-mix(in srgb,var(--acid) 18%,transparent)}.code-gutter{color:var(--muted);text-align:right;-webkit-user-select:none;user-select:none}.code-text{white-space:pre-wrap;word-break:break-word}.code-md-preview{font-size:13px;line-height:1.5}.code-md-preview h2,.code-md-preview h3,.code-md-preview h4{margin:.8em 0 .3em}.code-md-preview p{margin:.4em 0}.code-md-preview pre.md-code{overflow:auto;padding:8px;border-radius:var(--radius);background:var(--ground);border:1px solid var(--rule)}@media(max-width:720px){.code-explorer-body{grid-template-columns:1fr}.code-tree,.code-search-hits{max-height:200px}}.code-apply{margin-top:12px;border:1px solid var(--rule);border-radius:var(--radius);padding:10px;display:grid;gap:8px;background:var(--ground)}.code-apply legend{font-weight:600;padding:0 4px}.code-apply label{display:grid;gap:4px;font-size:12px;color:var(--muted)}.code-apply textarea{width:100%;border:1px solid var(--rule);border-radius:var(--radius);background:var(--code-bg);color:var(--ink);padding:6px 8px;font:inherit}.code-apply button.primary{justify-self:start;background:var(--acid);color:var(--mark-ink);border:1px solid var(--ink);border-radius:var(--radius);padding:6px 12px;cursor:pointer}.code-apply button.primary:disabled{opacity:.5;cursor:not-allowed}.code-apply-preview{max-height:160px;overflow:auto}.review-panel{display:grid;gap:10px}.review-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.review-head h2{margin:0}.review-tabs{display:inline-flex;gap:0;margin-left:auto;border:1px solid var(--rule);background:var(--surface-muted)}.review-tabs button,.review-filter select,.review-head button{border:1px solid var(--rule);background:transparent;padding:4px 10px;border-radius:var(--radius);cursor:pointer;font-size:12px;color:inherit}.review-tabs button{border:0;border-right:1px solid var(--rule);border-radius:0}.review-tabs button:last-child{border-right:0}.review-tabs button.active{background:var(--acid);color:var(--mark-ink);border-color:var(--ink)}.review-filter{display:flex;gap:8px;align-items:center;font-size:12px;color:var(--muted)}.review-list{list-style:none;margin:0;padding:0;display:grid;gap:6px}.review-list>li>button{width:100%;text-align:left;display:grid;gap:2px;border:1px solid var(--rule);background:var(--code-bg);padding:8px;border-radius:var(--radius);cursor:pointer;color:inherit}.review-list>li>button.active{border-color:var(--acid)}.review-detail{border:1px solid var(--rule);border-radius:var(--radius);padding:10px;background:var(--code-bg)}.review-detail header{display:flex;justify-content:space-between;align-items:center}.review-detail h3{margin:0}.review-detail dl{display:grid;grid-template-columns:auto 1fr;gap:4px 10px;font-size:12px}.review-detail dt{color:var(--muted)}.review-detail dd{margin:0}.review-content{max-height:280px;overflow:auto;padding:8px;border-radius:var(--radius);background:var(--ground);border:1px solid var(--rule);font-size:12px;white-space:pre-wrap}.review-paths{margin:4px 0 0;padding-left:16px}.ledger-row{border:1px solid var(--rule);border-radius:var(--radius);padding:8px;background:var(--code-bg)}.ledger-row-head{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-bottom:4px}.ledger-meta{font-size:11px}button.linkish{border:0;background:transparent;color:var(--acid);cursor:pointer;padding:0;font:inherit}@media(max-width:720px){.review-content{max-height:200px}}.virtual-list{position:relative;min-height:0}.virtual-list-spacer{width:100%}.transcript-list{min-height:0}.team-roster{max-height:min(60vh,520px);overflow:auto} diff --git a/internal/frontend/server/static/assets/index-DMdHWuX7.css b/internal/frontend/server/static/assets/index-DMdHWuX7.css deleted file mode 100644 index 2156cc80..00000000 --- a/internal/frontend/server/static/assets/index-DMdHWuX7.css +++ /dev/null @@ -1 +0,0 @@ -:root{color-scheme:dark light;--ink: #f3f1fa;--muted: #9b99b0;--acid: #7c3aed;--accent-alt: #22d3ee;--highlight: #ddd6fe;--success: #4ade80;--warning: #fbbf24;--signal: #fb7185;--danger: #fb923c;--ground: #14131c;--surface: #232230;--raised: #2e2c3e;--surface-muted: #1a1924;--rule: #4f4d63;--border-focus: #7c3aed;--border-muted: #2c2a3a;--user: #22d3ee;--tool: #7dd3fc;--diff-add: #4ade80;--diff-del: #fb7185;--overlay: #7c7a90;--code-bg: #1a1924;--mark-ink: #14131c;--header-bg: #14131ce8;--glow: #7c3aed66;--idle: #4f4d63;--cap-border: #4f4d63;--shadow: #00000088;--diff-add-bg: #1a2a22;--diff-del-bg: #2a1a1c;--unavailable-bg: #2a1a1c;--text: var(--ink);--bg: var(--ground);--border: var(--rule);--panel: var(--surface);--accent: var(--acid);--warn: var(--warning);font-family:SFMono-Regular,Cascadia Code,Liberation Mono,monospace;background:var(--ground);color:var(--ink)}:root[data-appearance=dark]{color-scheme:dark;--ink: #f3f1fa;--muted: #9b99b0;--acid: #7c3aed;--accent-alt: #22d3ee;--highlight: #ddd6fe;--success: #4ade80;--warning: #fbbf24;--signal: #fb7185;--danger: #fb923c;--ground: #14131c;--surface: #232230;--raised: #2e2c3e;--surface-muted: #1a1924;--rule: #4f4d63;--border-focus: #7c3aed;--border-muted: #2c2a3a;--user: #22d3ee;--tool: #7dd3fc;--diff-add: #4ade80;--diff-del: #fb7185;--overlay: #7c7a90;--code-bg: #1a1924;--mark-ink: #14131c;--header-bg: #14131ce8;--glow: #7c3aed66;--idle: #4f4d63;--cap-border: #4f4d63;--shadow: #00000088;--diff-add-bg: #1a2a22;--diff-del-bg: #2a1a1c;--unavailable-bg: #2a1a1c}:root[data-appearance=light]{color-scheme:light;--ink: #1a1528;--muted: #5c586e;--acid: #5b21b6;--accent-alt: #0e7490;--highlight: #4c1d95;--success: #15803d;--warning: #b45309;--signal: #e11d48;--danger: #ea580c;--ground: #ffffff;--surface: #f3eef9;--raised: #e9e0f7;--surface-muted: #f8f5fc;--rule: #c4bfd4;--border-focus: #5b21b6;--border-muted: #ddd8ea;--user: #0e7490;--tool: #2563eb;--diff-add: #15803d;--diff-del: #e11d48;--overlay: #a8a3b8;--code-bg: #f8f5fc;--mark-ink: #ffffff;--header-bg: #fffffff0;--glow: #5b21b666;--idle: #c4bfd4;--cap-border: #c4bfd4;--shadow: #1a152833;--diff-add-bg: #e8f5ec;--diff-del-bg: #f8e8e8;--unavailable-bg: #f8e8e8}@media(prefers-color-scheme:light){:root{--ink: #1a1528;--muted: #5c586e;--acid: #5b21b6;--accent-alt: #0e7490;--highlight: #4c1d95;--success: #15803d;--warning: #b45309;--signal: #e11d48;--danger: #ea580c;--ground: #ffffff;--surface: #f3eef9;--raised: #e9e0f7;--surface-muted: #f8f5fc;--rule: #c4bfd4;--border-focus: #5b21b6;--border-muted: #ddd8ea;--user: #0e7490;--tool: #2563eb;--diff-add: #15803d;--diff-del: #e11d48;--overlay: #a8a3b8;--code-bg: #f8f5fc;--mark-ink: #ffffff;--header-bg: #fffffff0;--glow: #5b21b666;--idle: #c4bfd4;--cap-border: #c4bfd4;--shadow: #1a152833;--diff-add-bg: #e8f5ec;--diff-del-bg: #f8e8e8;--unavailable-bg: #f8e8e8}:root[data-appearance=dark]{color-scheme:dark;--ink: #f3f1fa;--muted: #9b99b0;--acid: #7c3aed;--accent-alt: #22d3ee;--highlight: #ddd6fe;--success: #4ade80;--warning: #fbbf24;--signal: #fb7185;--danger: #fb923c;--ground: #14131c;--surface: #232230;--raised: #2e2c3e;--surface-muted: #1a1924;--rule: #4f4d63;--border-focus: #7c3aed;--border-muted: #2c2a3a;--user: #22d3ee;--tool: #7dd3fc;--diff-add: #4ade80;--diff-del: #fb7185;--overlay: #7c7a90;--code-bg: #1a1924;--mark-ink: #14131c;--header-bg: #14131ce8;--glow: #7c3aed66;--idle: #4f4d63;--cap-border: #4f4d63;--shadow: #00000088;--diff-add-bg: #1a2a22;--diff-del-bg: #2a1a1c;--unavailable-bg: #2a1a1c}}:root{--control-pad-y: 7px;--control-pad-x: 12px;--control-min-h: 28px;--touch-min: 44px;--focus-ring: 2px solid var(--acid);--focus-offset: 2px;--radius: 2px}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh;background:var(--ground)}button,select,textarea,input{font:inherit;color:inherit}button,select,input,textarea{border:1px solid var(--rule);background:var(--surface);border-radius:var(--radius)}button{cursor:pointer;min-height:var(--control-min-h)}button:hover:not(:disabled),button:focus-visible{border-color:var(--acid);color:var(--acid)}button:disabled,select:disabled,input:disabled,textarea:disabled{opacity:.45;cursor:not-allowed}:focus-visible{outline:var(--focus-ring);outline-offset:var(--focus-offset)}.ui-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:var(--control-pad-y) var(--control-pad-x);border:1px solid var(--rule);background:var(--surface);color:var(--ink);font-size:11px;line-height:1.2;border-radius:var(--radius)}.ui-btn:hover:not(:disabled),.ui-btn:focus-visible{border-color:var(--border-focus);color:var(--acid)}.ui-btn-primary{background:var(--acid);border-color:var(--acid);color:var(--mark-ink);font-weight:600;text-transform:uppercase;letter-spacing:.04em;font-size:10px}.ui-btn-primary:hover:not(:disabled),.ui-btn-primary:focus-visible{color:var(--mark-ink);filter:brightness(1.05);border-color:var(--border-focus)}.ui-btn-danger{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 45%,var(--rule))}.ui-btn-ghost,.ui-btn-icon{border-color:transparent;background:transparent}.ui-btn-icon,.icon-button{border:0;background:transparent;font-size:18px;padding:8px;min-width:var(--control-min-h);min-height:var(--control-min-h);line-height:1}.ui-btn-sm{padding:4px 8px;font-size:10px;min-height:24px}.ui-btn-touch{min-height:var(--touch-min);min-width:var(--touch-min);padding:10px 14px}.ui-dialog{width:min(560px,calc(100vw - 32px));max-height:min(88vh,900px);overflow:auto;border:1px solid var(--rule);background:var(--surface);padding:28px;color:var(--ink);position:relative;border-radius:var(--radius)}.ui-dialog-wide{width:min(720px,calc(100vw - 24px))}.ui-dialog::backdrop{background:color-mix(in srgb,var(--overlay) 85%,#000)}.ui-dialog-blocking{border-color:var(--warning)}.ui-dialog h2{font-size:30px;margin:0 0 20px}.ui-dialog-body{min-width:0}.settings-dialog,.workflow-dialog,.sandbox-explain-dialog,.undo-dialog{position:relative}.ui-tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;border-bottom:1px solid var(--rule);gap:0;scrollbar-width:thin}.ui-tab{flex:0 0 auto;min-width:max-content;white-space:nowrap;border:0;border-bottom:2px solid transparent;background:transparent;padding:10px 12px;text-transform:uppercase;font-size:11px;letter-spacing:.04em;color:var(--muted);border-radius:0;min-height:var(--control-min-h)}.ui-tab[aria-selected=true]{border-bottom-color:var(--acid);color:var(--acid)}.ui-tab:disabled{opacity:.35}.ui-tabpanel{min-width:0}.inspector-tabs{display:flex;flex-wrap:wrap;align-content:flex-start;flex:0 0 auto;width:100%;min-width:0;overflow-x:hidden;overflow-y:auto;max-height:40vh;border-bottom:1px solid var(--rule);scrollbar-width:thin}.inspector-tabs .ui-tab,.inspector-tabs button{flex:0 0 auto;min-width:max-content;white-space:nowrap;border:0;border-bottom:2px solid transparent;background:transparent;padding:10px 12px;text-transform:uppercase;font-size:11px;color:var(--muted)}.inspector-tabs .ui-tab[aria-selected=true],.inspector-tabs button[aria-selected=true]{border-bottom-color:var(--acid);color:var(--acid)}.ui-status{display:inline-flex;align-items:center;gap:6px;font-size:10px;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}.ui-status-dot,.ui-status-dot-alone{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--idle);flex-shrink:0}.ui-status-busy .ui-status-dot,.ui-status-dot-alone.ui-status-busy{background:var(--accent-alt)}.ui-status-blocked .ui-status-dot,.ui-status-dot-alone.ui-status-blocked,.ui-status-needs-you .ui-status-dot,.ui-status-dot-alone.ui-status-needs-you{background:var(--warning)}.ui-status-failed .ui-status-dot,.ui-status-dot-alone.ui-status-failed{background:var(--signal)}.ui-status-complete .ui-status-dot,.ui-status-dot-alone.ui-status-complete{background:var(--success)}.ui-status-canceled .ui-status-dot,.ui-status-unknown .ui-status-dot,.ui-status-dot-alone.ui-status-canceled,.ui-status-dot-alone.ui-status-unknown{background:var(--muted)}.ui-status-label{color:inherit}.ui-status-busy{color:var(--accent-alt)}.ui-status-blocked,.ui-status-needs-you{color:var(--warning)}.ui-status-failed{color:var(--signal)}.ui-status-complete{color:var(--success)}.ui-notice{border-left:3px solid var(--acid);padding:12px;background:var(--surface-muted);display:grid;gap:6px}.ui-notice-title{font-size:12px}.ui-notice-body{color:var(--muted);font-size:11px;line-height:1.5}.ui-notice-body p{margin:0}.ui-notice-success{border-left-color:var(--success)}.ui-notice-warning{border-left-color:var(--warning)}.ui-notice-error{border-left-color:var(--signal);background:var(--unavailable-bg)}.ui-notice-unavailable,.unavailable{border-left:3px solid var(--signal);padding:12px;background:var(--unavailable-bg)}.ui-notice-unavailable strong,.unavailable strong{color:var(--signal)}.ui-loading-indicator{display:inline-block;width:10px;height:10px;border-radius:50%;background:var(--accent-alt);animation:pulse 1.2s infinite}.ui-list-row,.palette-list button,.completion button{width:100%;display:flex;align-items:baseline;gap:8px;text-align:left;border:0;padding:6px 10px;background:transparent;font-size:12px;font-weight:inherit;color:inherit;cursor:pointer;border-radius:0;text-transform:none}.ui-list-row:hover,.ui-list-row.active,.ui-list-row[aria-selected=true],.palette-list button:hover,.palette-list button.active,.palette-list button[aria-selected=true],.completion button:hover,.completion button.active,.completion button[aria-selected=true]{background:var(--raised);box-shadow:inset 2px 0 0 var(--acid)}.ui-list-row-main{flex:1;min-width:0;display:flex;flex-direction:row;align-items:baseline;gap:8px;overflow:hidden}.ui-list-row-title,.completion button strong{flex:0 1 auto;min-width:0;font-weight:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-list-row-meta,.completion span{flex:1 1 auto;min-width:0;font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-list-row-trailing{display:flex;flex-direction:column;align-items:flex-end;gap:2px;flex-shrink:0}@media(max-width:720px){:root{--control-min-h: var(--touch-min);--control-pad-y: 10px;--control-pad-x: 14px}.ui-btn:not(.ui-btn-sm):not(.ui-btn-icon):not(.icon-button){min-height:var(--touch-min)}.ui-tab{min-height:40px;padding:12px;font-size:12px}}.app-shell{display:grid;grid-template:52px minmax(0,1fr) / var(--nav-width, 240px) minmax(420px,1fr) var(--inspector-width, 340px);height:100vh;height:100dvh;max-width:100vw;overflow:hidden;padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}.app-shell[data-shell=phone]{grid-template:52px minmax(0,1fr) auto / 1fr;padding-bottom:env(safe-area-inset-bottom,0px)}.app-shell[data-shell=tablet]{grid-template-columns:minmax(0,1fr);grid-template-rows:52px minmax(0,1fr)}header{grid-column:1 / -1;z-index:10;display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--rule);background:var(--header-bg);padding:0 14px;padding-top:env(safe-area-inset-top,0px);min-height:calc(52px + env(safe-area-inset-top,0px));z-index:4;position:sticky;top:0}.wordmark{display:flex;align-items:baseline;gap:9px;width:202px;letter-spacing:.1em}.wordmark .mark{display:grid;place-items:center;width:27px;height:27px;background:var(--acid);color:var(--mark-ink);font-weight:700;transform:skew(-7deg)}.wordmark small{color:var(--muted);font-size:9px}.session-line{margin-left:auto;text-transform:uppercase;font-size:10px;color:var(--muted)}.mode-switch{display:flex;align-items:stretch;gap:0;margin-left:12px;padding:0;border:1px solid var(--rule);border-radius:var(--radius);background:var(--surface-muted);flex-shrink:1;min-width:0;overflow:auto}.mode-btn{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;border-right:1px solid var(--rule);background:transparent;color:var(--muted);font-size:10px;letter-spacing:.06em;text-transform:uppercase;padding:6px 10px;min-height:32px;border-radius:0;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;cursor:pointer}.mode-btn:last-child{border-right:0}.mode-btn:hover,.mode-btn:focus-visible{color:var(--ink);outline:none;background:var(--surface)}.mode-btn.active{background:var(--acid);color:var(--mark-ink);font-weight:600}.mode-attn{width:6px;height:6px;border-radius:50%;background:var(--accent-alt);flex-shrink:0}.mode-attn.needs-you{background:var(--warning)}.surface-roster h2{font-size:12px;text-transform:uppercase;letter-spacing:.08em;margin:0 0 12px;color:var(--muted)}.pulse{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--idle);margin-right:8px}.pulse.busy{background:var(--accent-alt);animation:pulse 1.2s infinite}.navigation,.inspector{min-height:0;background:var(--surface);transition:width .16s ease,opacity .16s ease}.navigation{border-right:1px solid var(--rule);min-width:0;overflow:hidden;padding:18px 12px;display:flex;flex-direction:column;gap:12px}.aside-heading{display:flex;justify-content:space-between;font-size:10px;letter-spacing:.16em;color:var(--muted);padding:7px 8px}.session{width:100%;display:flex;align-items:center;gap:6px;text-align:left;border:0;border-left:2px solid transparent;padding:10px 9px;background:transparent;font-size:12px}.session.active{border-left-color:var(--acid);background:var(--raised);color:var(--acid)}.session small{font-size:8px;color:var(--acid)}.session-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.session-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-meta{font-size:9px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-flags{display:flex;flex-direction:column;align-items:flex-end;gap:2px;flex-shrink:0}.child-agents{display:grid;gap:0;min-height:0}.children{font-size:11px;padding:0 9px;display:grid;gap:2px}.child-row{display:flex;align-items:center;gap:6px;padding:4px 6px;border-radius:var(--radius);border:1px solid transparent;background:transparent;color:inherit;width:100%;text-align:left;cursor:pointer;font:inherit}.child-row:hover,.child-row.active{border-color:var(--rule);background:color-mix(in srgb,var(--surface) 80%,transparent)}.child-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.child-meta{display:flex;gap:4px;align-items:center;flex-shrink:0}.children small,.children p{color:var(--muted)}.child-state{width:6px;height:6px;border-radius:50%;background:var(--accent-alt);flex-shrink:0}.child-state.completed,.child-state.running{background:var(--success)}.child-state.failed,.child-state.interrupted{background:var(--signal)}.child-state.blocked,.child-state.finalizing,.child-state.escalating{background:var(--warning)}.child-state.canceled,.child-state.unknown{background:var(--muted)}.quality{font-size:9px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}.quality.complete{color:var(--success)}.quality.partial{color:var(--warning)}.quality.unavailable{color:var(--signal)}.child-detail{margin:6px 9px 10px;padding:8px;border:1px solid var(--rule);border-radius:var(--radius);display:grid;gap:6px;font-size:11px}.child-detail header{display:flex;justify-content:space-between;gap:8px;align-items:baseline}.child-detail h3{margin:0;font-size:12px;font-weight:600}.child-detail dl{display:grid;grid-template-columns:auto 1fr;gap:2px 8px;margin:0}.child-detail dt{color:var(--muted);font-size:9px;text-transform:uppercase}.child-detail dd{margin:0;overflow-wrap:anywhere}.child-detail code{font-size:10px}.child-prompt{margin:0;white-space:pre-wrap;font-size:10px}.child-detail-actions{display:flex;gap:6px}.child-detail-actions button{font:inherit;font-size:10px;padding:3px 8px;border-radius:var(--radius);border:1px solid var(--rule);background:transparent;color:inherit;cursor:pointer}.child-detail-actions button:hover{border-color:var(--border-focus);color:var(--acid)}.child-detail-note{margin:0;font-size:9px}.workspace-meta{margin-top:auto;border-top:1px solid var(--rule);padding:8px 8px 0;overflow:hidden;color:var(--muted);font-size:9px}.workspace-meta summary{cursor:pointer;list-style:none;letter-spacing:.14em;text-transform:uppercase;padding:6px 0;-webkit-user-select:none;user-select:none}.workspace-meta summary::-webkit-details-marker{display:none}.workspace-meta[open] summary{margin-bottom:6px}.workspace-meta span{display:block;color:var(--muted);font-size:9px;margin-top:6px}.workspace-meta code{display:block;font-size:10px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}main{min-width:0;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto}.runtime{display:flex;gap:1px;border-bottom:1px solid var(--rule);background:var(--rule);overflow:auto}.runtime-explain{align-self:end;padding:6px 10px;font-size:10px;letter-spacing:.04em;text-transform:uppercase}.sandbox-explain-dialog{width:min(640px,calc(100vw - 24px))}.sandbox-summary{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;margin:0 0 14px;font-size:12px}.sandbox-summary dt{color:var(--muted);margin:0}.sandbox-summary dd{margin:0;color:var(--ink)}.sandbox-explain{max-height:min(50vh,360px);overflow:auto;white-space:pre-wrap;word-break:break-word}.runtime-field{display:grid;gap:3px;min-width:130px;background:var(--surface);padding:7px 10px}.runtime-field span{color:var(--muted);text-transform:uppercase;font-size:8px;letter-spacing:.14em}.runtime-field select{border:0;padding:0;background:transparent;font-size:11px}.runtime-more{display:flex;align-items:stretch;flex:1 1 auto;min-width:0;background:var(--surface)}.runtime-disclosure{display:flex;flex-direction:column;justify-content:center;gap:2px;border:0;background:transparent;padding:7px 12px;min-width:110px;text-align:left;cursor:pointer;color:var(--ink);font:inherit}.runtime-disclosure>span:first-child{color:var(--muted);text-transform:uppercase;font-size:8px;letter-spacing:.14em}.runtime-summary{color:var(--ink);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}.runtime-secondary{display:flex;gap:1px;flex:1 1 auto;min-width:0;background:var(--rule);border-left:1px solid var(--rule)}.runtime-status{display:flex;flex-wrap:wrap;gap:12px 18px;padding:6px 12px;background:var(--surface);border-top:1px solid var(--rule);color:var(--muted);font-size:10px;letter-spacing:.04em}.runtime-status span:before{content:"";display:inline-block;width:4px;height:4px;margin-right:8px;border-radius:50%;background:var(--acid);vertical-align:middle}.transcript{min-height:0;overflow:auto;padding:42px clamp(22px,6vw,80px);scrollbar-color:var(--rule) transparent}.empty-state{max-width:620px;margin:12vh auto 0}.empty-state span{color:var(--acid);font-size:10px;letter-spacing:.18em}.empty-state h1{font-size:clamp(42px,7vw,78px);line-height:.9;margin:18px 0;letter-spacing:-.04em}.empty-state p{color:var(--muted);max-width:530px;line-height:1.7;font-size:12px}.message{max-width:780px;margin:0 auto 28px;border-left:2px solid var(--rule);padding:0 0 0 18px}.message.user{border-color:var(--user)}.message.assistant{border-color:var(--acid)}.message.tool{border-color:var(--tool)}.message.reasoning{color:var(--muted)}.message.error{border-color:var(--signal)}.message-label{color:var(--muted);text-transform:uppercase;letter-spacing:.16em;font-size:9px;margin-bottom:8px}.message.user .message-label{color:var(--user)}.message.assistant .message-label{color:var(--acid)}.message.tool .message-label{color:var(--tool)}.message p{white-space:pre-wrap;line-height:1.7;margin:0;font-family:ui-monospace,monospace;font-size:13px}.message pre,.inspector pre,dialog pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px;line-height:1.55;background:var(--code-bg);padding:12px;border:1px solid var(--rule)}.composer{margin:0 clamp(14px,4vw,56px) 22px;border:1px solid var(--rule);background:var(--surface);position:relative}.composer label{display:block;padding:8px 12px;color:var(--muted);font-size:9px;text-transform:uppercase;letter-spacing:.16em;border-bottom:1px solid var(--rule)}.composer textarea{display:block;width:100%;min-height:88px;max-height:220px;resize:vertical;border:0;background:transparent;padding:14px;line-height:1.5}.composer-bar{display:flex;justify-content:space-between;align-items:center;padding:8px;border-top:1px solid var(--rule);color:var(--muted);font-size:9px}.composer-send{background:var(--acid);color:var(--mark-ink);border-color:var(--acid);padding:7px 18px;text-transform:uppercase;font-size:10px;font-weight:600}.composer-send:hover:not(:disabled),.composer-send:focus-visible{color:var(--mark-ink);border-color:var(--border-focus);filter:brightness(1.05)}.composer-bar .stop{background:var(--signal);border-color:var(--signal);color:var(--mark-ink)}.composer-send:disabled{opacity:.35;cursor:not-allowed}.composer-secondary{background:var(--surface);color:var(--ink);border-color:var(--rule);padding:7px 12px;text-transform:none;font-size:10px;font-weight:500}.composer-secondary:hover:not(:disabled),.composer-secondary:focus-visible{color:var(--acid);border-color:var(--acid);filter:none}.inspector{border-left:1px solid var(--rule);min-width:0;overflow:hidden;position:relative;display:flex;flex-direction:column}.session-group{flex:0 1 auto;max-height:55%;overflow:auto;padding:12px 16px 8px;border-bottom:1px solid var(--rule);display:flex;flex-direction:column;gap:12px;min-height:0}.session-group-pane{min-height:0}.session-group-facts{display:grid;grid-template-columns:auto 1fr;gap:2px 10px;margin:0;font-size:10px}.inspector .session-group-facts{margin:0;grid-template-columns:auto 1fr}.inspector .session-group-facts dt,.inspector .session-group-facts dd{margin:0;padding:2px 0;border:0}.session-group-facts dt{color:var(--muted);margin:0;padding:2px 0;border:0}.session-group-facts dd{margin:0;padding:2px 0;text-align:right;border:0;overflow-wrap:anywhere}.session-group-fit{font-size:10px;margin:8px 0 0;color:var(--warning)}.session-group-fit.critical{color:var(--signal)}.session-group-queue{margin:0}.session-group-queue .prompt-queue{padding-left:22px}.navigation.collapsed,.inspector.collapsed{opacity:0;pointer-events:none}.panel-resize{position:absolute;top:0;bottom:0;width:10px;z-index:2;display:flex;align-items:stretch;padding:0;margin:0;border:0;background:transparent}.panel-resize-nav{right:-5px;cursor:col-resize}.panel-resize-inspector{left:-5px;cursor:col-resize}.panel-resize-handle{flex:1;min-width:4px;background:transparent;transition:background .12s ease}.panel-resize:hover .panel-resize-handle,.panel-resize:focus-within .panel-resize-handle{background:color-mix(in srgb,var(--acid) 55%,transparent)}.inspector-body{flex:1;min-height:0;height:auto;overflow:auto;padding:20px 16px}.inspector h2{margin:8px 0 16px;font-family:Georgia,Times New Roman,serif;font-size:20px;font-weight:500}.inspector dl{display:grid;grid-template-columns:1fr 1fr;margin:0 0 30px;font-size:10px}.inspector dt,.inspector dd{margin:0;padding:8px 0;border-bottom:1px solid var(--rule)}.inspector dt{color:var(--muted)}.inspector dd{text-align:right;overflow-wrap:anywhere}.capabilities{display:flex;flex-wrap:wrap;gap:5px}.capabilities span{padding:4px 6px;border:1px solid var(--rule);color:var(--muted);font-size:8px;text-transform:uppercase}.capabilities span.enabled{color:var(--acid);border-color:var(--border-focus)}.muted{color:var(--muted);font-size:11px;line-height:1.5}.context-doctor-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.context-doctor-head h2{margin:0}.context-doctor-actions{display:flex;gap:6px;flex-wrap:wrap}.context-doctor-actions button,.context-layer-actions button,.context-kind-row button{font-size:10px;padding:4px 8px;border:1px solid var(--rule);background:var(--surface-muted);color:var(--ink);cursor:pointer}.context-doctor-actions button:disabled,.context-layer-actions button:disabled,.context-kind-row button:disabled{opacity:.45;cursor:not-allowed}.context-fit-warning{border:1px solid var(--warning);background:color-mix(in srgb,var(--warning) 12%,var(--surface-muted));padding:10px;margin:0 0 12px;display:grid;gap:4px}.context-fit-warning.critical{border-color:var(--danger);background:color-mix(in srgb,var(--danger) 12%,var(--surface-muted))}.context-fit-warning strong{font-size:11px;text-transform:uppercase;letter-spacing:.08em}.context-fit-warning p{margin:0;font-size:12px;line-height:1.45}.context-fit-warning small{color:var(--muted);font-size:10px}.context-attribution,.context-layers,.context-sets,.context-kind-picker{margin-top:16px}.context-attribution h3,.context-layers h3,.context-sets h3,.context-kind-picker h3{margin:0 0 8px;font-size:11px;text-transform:uppercase;letter-spacing:.1em;color:var(--muted)}.context-table{width:100%;border-collapse:collapse;font-size:11px}.context-table th,.context-table td{text-align:left;padding:6px 4px;border-bottom:1px solid var(--rule);vertical-align:top}.context-table th{color:var(--muted);font-weight:500;font-size:10px;text-transform:uppercase;letter-spacing:.08em}.context-layer-actions{display:flex;flex-wrap:wrap;gap:4px}.context-sets p{margin:0 0 6px;font-size:11px;line-height:1.45}.context-kind-list{display:grid;gap:4px}.context-kind-row{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:6px 0;border-bottom:1px solid var(--rule);font-size:11px}.context-kind-row span{display:flex;gap:4px}.changed-files,.project-list{display:grid;gap:10px}.changed-file,.project-list article{border:1px solid var(--rule);background:var(--surface-muted);padding:10px}.changed-file>button{width:100%;display:flex;justify-content:space-between;align-items:center;gap:12px;border:0;background:transparent;padding:0;text-align:left}.diff-stat{display:flex;gap:8px;font-size:10px}.diff-stat b:first-child{color:var(--diff-add)}.diff-stat b:last-child{color:var(--diff-del)}.diff-view{margin:10px 0 0;max-height:360px;overflow:auto;background:var(--code-bg);border:1px solid var(--rule);padding:10px;font-size:10px;white-space:pre-wrap}.project-list h3{margin:0 0 8px;font-size:12px;overflow-wrap:anywhere}.project-list p{margin:0 0 8px;color:var(--muted);font-size:11px;line-height:1.5;white-space:pre-wrap}.project-list small{color:var(--acid);text-transform:uppercase;font-size:8px;letter-spacing:.12em}.diagnostics-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:4px}.diagnostics-heading h2{margin:8px 0 16px}.diagnostics-subhead{margin:18px 0 10px;font-size:9px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}.diagnostics-actions{display:flex;flex-wrap:wrap;gap:6px}.diagnostics-actions button{border:1px solid var(--rule);background:var(--surface-muted);color:var(--ink);padding:5px 8px;font-size:10px;text-transform:uppercase;letter-spacing:.08em}.diagnostics-actions button:disabled{opacity:.45}.lsp-server header,.diagnostic-item header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}.lsp-server header h3,.diagnostic-item header code{margin:0}.lsp-state,.diag-severity{flex-shrink:0;padding:2px 6px;border:1px solid var(--rule);font-size:8px;letter-spacing:.12em;text-transform:uppercase}.lsp-state.state-up,.diag-severity.sev-info{color:var(--success);border-color:color-mix(in srgb,var(--success) 50%,var(--rule))}.lsp-state.state-error,.diag-severity.sev-error{color:var(--signal);border-color:color-mix(in srgb,var(--signal) 50%,var(--rule))}.lsp-state.state-down,.diag-severity.sev-warning{color:var(--warning);border-color:color-mix(in srgb,var(--warning) 50%,var(--rule))}.lsp-state.state-disabled,.diag-severity.sev-hint{color:var(--muted)}.lsp-error{color:var(--signal)!important}.diagnostic-item header code{font-size:11px;overflow-wrap:anywhere}.diagnostics-list .diagnostic-item p{margin-bottom:4px;color:var(--ink)}dialog{width:min(560px,calc(100vw - 32px));border:1px solid var(--rule);background:var(--surface);padding:28px;color:var(--ink)}.dialog-rule{position:absolute;left:0;top:0;width:7px;height:100%;background:var(--acid)}dialog::backdrop{background:color-mix(in srgb,var(--overlay) 85%,#000)}dialog h2{font-size:30px;margin:0 0 20px}dialog label{display:grid;gap:7px;color:var(--muted);font-size:10px}dialog input{padding:12px;color:var(--ink)}.dialog-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-top:22px}.dialog-actions button{padding:9px 14px}.permission-tool{margin:0 0 10px;font-size:15px}.permission-patterns{margin:0 0 14px;padding-left:1.2em;display:grid;gap:6px}.permission-patterns code{display:inline-block;padding:2px 6px;border-radius:var(--radius);background:var(--code-bg);color:var(--tool);font-size:12px;word-break:break-all}.permission-explain{display:grid;gap:10px;margin:12px 0 4px}.permission-explain button{justify-self:start;padding:7px 12px;font-size:12px;color:var(--muted);border:1px solid var(--rule);background:var(--surface-muted)}.permission-explain-body{margin:0;padding:12px;border-radius:var(--radius);background:var(--code-bg);color:var(--ink);font-size:12px;white-space:pre-wrap;max-height:180px;overflow:auto}.permission-explain-error{margin:0;color:var(--signal);font-size:12px}.undo-dialog{width:min(560px,calc(100vw - 32px))}.undo-preview{display:grid;gap:6px;margin:0 0 18px;padding:12px 14px;border:1px solid var(--rule);background:color-mix(in srgb,var(--surface) 88%,var(--ink));font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere}.undo-preview p{margin:0;color:var(--muted)}.undo-preview .undo-warn{color:var(--acid)}.undo-choices{display:grid;gap:8px}.undo-choice{display:grid;grid-template-columns:auto 1fr;gap:10px;align-items:start;margin:0;padding:12px 14px;border:1px solid var(--rule);cursor:pointer;color:var(--ink);font-size:12px}.undo-choice.active{border-color:var(--acid);background:color-mix(in srgb,var(--acid) 8%,transparent)}.undo-choice strong{display:block;text-transform:lowercase;letter-spacing:.02em}.undo-choice small{display:block;margin-top:4px;color:var(--muted);font-size:11px;line-height:1.4;font-weight:400}.undo-choice input{margin-top:3px}.mobile-only{display:none}@keyframes pulse{50%{opacity:.4}}@media(max-width:1023px){.app-shell{grid-template-columns:minmax(0,1fr);grid-template-rows:52px minmax(0,1fr)}.app-shell main{min-width:0}.navigation{position:fixed;z-index:5;top:calc(52px + env(safe-area-inset-top,0px));bottom:0;left:0;width:min(var(--nav-width, 280px),88vw);max-width:100vw;transform:translate(-100%);transition:transform .2s ease;box-shadow:none;padding-bottom:env(safe-area-inset-bottom,0px)}.navigation.open{transform:translate(0)}.inspector{position:fixed;right:0;top:calc(52px + env(safe-area-inset-top,0px));bottom:0;width:min(var(--inspector-width, 360px),92vw);max-width:100vw;z-index:6;transform:translate(100%);transition:transform .2s ease;box-shadow:none;padding-bottom:env(safe-area-inset-bottom,0px)}.inspector.open{transform:translate(0)}.panel-resize{display:none}.shell-backdrop{display:none;position:fixed;top:0;right:0;bottom:0;left:0;top:calc(52px + env(safe-area-inset-top,0px));background:color-mix(in srgb,var(--overlay) 55%,transparent);z-index:4;border:0;padding:0;cursor:pointer}.shell-backdrop.visible{display:block}}@media(max-width:599px){.app-shell{display:grid;grid-template:52px minmax(0,1fr) auto / 1fr}.mobile-only{display:block}.wordmark{width:auto}.wordmark strong{font-size:12px}.wordmark small{display:none}header{gap:6px;padding:0 8px;padding-top:env(safe-area-inset-top,0px)}.header-mode-switch{display:none!important}.session-line{font-size:0;margin-left:auto;display:flex;align-items:center;gap:6px;min-width:0}.session-line .pulse{margin:0}.session-line .attention-summary{font-size:9px;max-width:9em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:4px 8px;min-height:32px}.runtime{max-width:100%}.runtime-stack{padding:0 4px}.transcript{padding:16px 12px 12px}.composer{margin:0;border-radius:0;border-left:0;border-right:0;padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px));position:sticky;bottom:0;background:var(--surface);z-index:2}.composer textarea{min-height:44px;font-size:16px}.composer-bar button,.composer .queue-toolbar button{min-height:44px;min-width:44px;padding:10px 12px}.empty-state{margin-top:4vh;padding:0 8px}.icon-button{min-width:44px;min-height:44px}.navigation,.inspector{top:auto;bottom:0;left:0;right:0;width:100%;max-height:min(78dvh,640px);border-top:1px solid var(--rule);border-radius:var(--radius) var(--radius) 0 0;transform:translateY(105%);box-shadow:none;padding-bottom:calc(8px + env(safe-area-inset-bottom,0px));z-index:8}.navigation.open,.inspector.open{transform:translateY(0)}.shell-backdrop{top:calc(52px + env(safe-area-inset-top,0px));z-index:7}header{z-index:10}.mode-bottom-bar{display:flex;align-items:stretch;justify-content:space-around;gap:2px;border-top:1px solid var(--rule);background:var(--header-bg);padding:4px 4px calc(4px + env(safe-area-inset-bottom,0px));z-index:3}.mode-bottom-bar .mode-btn{flex:1;flex-direction:column;justify-content:center;gap:2px;min-height:48px;padding:6px 4px;font-size:9px;border-radius:var(--radius)}.mode-bottom-bar .mode-btn span:first-child{max-width:none}}.mode-bottom-bar{display:none}.surface-nav-sheet{flex:0 0 auto;border-bottom:1px solid var(--rule);max-height:40vh;overflow:auto;background:var(--surface-muted)}.surface-nav-list{list-style:none;margin:0;padding:.35rem .5rem;display:flex;flex-direction:column;gap:.25rem}.surface-nav-item{display:flex;width:100%;min-height:44px;align-items:center;justify-content:flex-start;text-align:left;padding:.5rem .75rem;border:1px solid transparent;border-radius:var(--radius);background:transparent;color:var(--ink);font:inherit;cursor:pointer}.surface-nav-item:hover,.surface-nav-item:focus-visible{border-color:var(--border-focus);outline:none;background:var(--raised)}.surface-nav-item.active{background:var(--surface);border-color:var(--rule);font-weight:600}.surface-nav-label{text-transform:lowercase}.app-shell[data-shell=phone] main{min-width:0}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}.navigation,.inspector,.shell-backdrop{transition:none!important}}.fast-toggle{display:flex;align-items:center;gap:6px;padding:0 10px;background:var(--surface);font-size:9px;color:var(--muted)}.fast-toggle input{accent-color:var(--acid)}.session-actions{display:flex;flex-direction:column;gap:6px;padding:0 8px}.session-actions>button{padding:6px 8px;font-size:9px;text-transform:uppercase;width:100%}.session-actions button:disabled{opacity:.4}.session-overflow{position:relative;width:100%}.session-overflow>summary{list-style:none;cursor:pointer;padding:6px 8px;border:1px solid var(--rule);background:var(--surface);font-size:9px;text-transform:uppercase;letter-spacing:.08em;text-align:center;-webkit-user-select:none;user-select:none}.session-overflow>summary::-webkit-details-marker{display:none}.session-overflow>summary:hover,.session-overflow>summary:focus-visible{border-color:var(--acid);color:var(--acid)}.session-overflow-menu{display:grid;gap:2px;margin-top:4px;border:1px solid var(--rule);background:var(--raised);padding:4px}.session-overflow-menu button{width:100%;border:0;background:transparent;padding:7px 8px;font-size:9px;text-transform:uppercase;text-align:left}.session-overflow-menu button:hover,.session-overflow-menu button:focus-visible{background:var(--surface);color:var(--acid)}.nav-tab{border:0;border-bottom:2px solid transparent;background:transparent;padding:7px 12px;font-size:10px;letter-spacing:.16em;color:var(--muted)}.nav-tab.active{border-bottom-color:var(--acid);color:var(--acid)}.history-search{width:100%;margin:0 0 6px;padding:7px 10px;border:1px solid var(--rule);background:var(--ground);font-size:11px}.root-idle{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--idle);margin-right:8px}.root-busy{display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--accent-alt);animation:pulse 1.2s infinite;margin-right:8px}.live-badge{font-size:8px;color:var(--accent-alt)}.session.history-row{gap:6px}.session.history-row .live-badge{color:var(--accent-alt)}.markdown h2,.markdown h3{font-family:Georgia,Times New Roman,serif;margin:16px 0 8px}.markdown h2{font-size:22px}.markdown h3{font-size:17px}.markdown p{margin:5px 0}.markdown a,.file-ref{color:var(--acid)}.markdown code{background:var(--code-bg);border:1px solid var(--rule);padding:1px 4px}.list-line{padding:3px 0 3px 12px;line-height:1.6}.code-block{margin:12px 0;border:1px solid var(--rule);background:var(--code-bg)}.code-block figcaption{padding:6px 10px;border-bottom:1px solid var(--rule);color:var(--muted);font-size:9px;text-transform:uppercase}.code-block pre{border:0;margin:0}.tool-card{border:1px solid var(--rule);background:var(--code-bg)}.tool-card summary{display:flex;justify-content:space-between;padding:9px 12px;cursor:pointer;color:var(--tool)}.tool-card summary small{color:var(--muted)}.tool-card pre{margin:0;border-width:1px 0 0}.diff span{display:block}.diff .add{color:var(--diff-add);background:var(--diff-add-bg)}.diff .del{color:var(--diff-del);background:var(--diff-del-bg)}.composer-field{position:relative;display:flex;flex-direction:column;min-width:0}.completion{--completion-max-rows: 6;--completion-row-height: 28px;display:flex;flex-direction:column;background:var(--raised);border-bottom:1px solid var(--rule);max-height:calc(var(--completion-max-rows) * var(--completion-row-height));overflow:auto}.completion button{box-sizing:border-box;min-height:var(--completion-row-height);padding:4px 12px;line-height:1.35;white-space:nowrap;overflow:hidden}.ui-list-row-meta:before,.completion span:before{content:"— "}.attachments{display:flex;gap:6px;padding:7px 10px;border-top:1px solid var(--rule)}.attachments button{padding:5px 8px;font-size:9px}.prompt-queue-wrap{border-top:1px solid var(--rule)}.prompt-queue{margin:0;padding:8px 12px 8px 34px;font-size:10px;color:var(--muted);list-style:decimal}.prompt-queue li{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:start;padding:4px 0}.prompt-queue li span:first-child{overflow-wrap:anywhere}.queue-actions{display:inline-flex;gap:2px;flex-shrink:0}.queue-actions button{border:0;background:transparent;color:var(--muted);padding:0 4px;min-width:1.4em;cursor:pointer}.queue-actions button:disabled{opacity:.35;cursor:default}.queue-edit{width:100%;font:inherit;color:var(--ink);background:var(--raised);border:1px solid var(--rule);padding:4px 6px}.queue-toolbar{display:flex;justify-content:flex-end;padding:0 12px 8px}.queue-toolbar button{font-size:9px;padding:4px 8px}.unavailable p{color:var(--muted);font-size:10px;line-height:1.5}.capability-list{display:grid;gap:1px;background:var(--rule)}.capability-list div{display:flex;justify-content:space-between;gap:10px;padding:9px;background:var(--surface);font-size:9px}.capability-list strong{text-align:right}.available{color:var(--success)}.unavailable-label{color:var(--signal)}dialog fieldset{border:1px solid var(--rule);margin:10px 0;padding:12px}dialog legend{color:var(--ink);padding:0 5px;font-size:11px}dialog fieldset label{display:flex;grid-template-columns:auto 1fr auto;align-items:start;margin:8px 0}dialog fieldset small{color:var(--muted)}.mcp-head{display:flex;justify-content:space-between;gap:8px;align-items:baseline;margin-bottom:8px}.mcp-head h2{margin:0;font-size:13px}.mcp-actions,.mcp-card-actions{display:flex;gap:6px;flex-wrap:wrap}.mcp-list{display:grid;gap:8px}.mcp-card{border:1px solid var(--rule);background:var(--surface-muted);padding:10px;display:grid;gap:6px}.mcp-card header{display:flex;justify-content:space-between;gap:8px;align-items:baseline}.mcp-card h3{margin:0;font-size:12px}.mcp-card p{margin:0;color:var(--muted);font-size:10px}.mcp-card code{background:var(--code-bg);border:1px solid var(--border-muted);padding:1px 4px;font-size:9px}.mcp-state{text-transform:uppercase;font-size:8px;letter-spacing:.12em;color:var(--muted)}.mcp-state.up{color:var(--success)}.mcp-state.error{color:var(--signal)}.mcp-state.down{color:var(--warning)}.mcp-state.disabled{color:var(--overlay)}.mcp-error{color:var(--signal)!important;font-size:10px}.mcp-tools{display:flex;flex-wrap:wrap;gap:4px}.workflow-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.workflow-head h2{margin:0;font-size:13px}.workflow-actions{display:flex;gap:6px;flex-wrap:wrap}.workflow-actions button,.workflow-card-actions button,.workflow-phase-tools button{font-size:10px;padding:4px 8px}.workflow-active{font-size:11px;color:var(--accent-alt);margin:0 0 8px}.workflow-list{display:grid;gap:8px}.workflow-card{border:1px solid var(--rule);background:var(--surface);padding:10px;display:grid;gap:6px}.workflow-card.invalid{border-color:var(--signal)}.workflow-card header{display:flex;justify-content:space-between;gap:8px;align-items:baseline}.workflow-card h3{margin:0;font-size:12px}.workflow-card small,.workflow-card p{margin:0;color:var(--muted);font-size:10px}.workflow-error{color:var(--signal)!important;font-size:10px}.workflow-warn{color:var(--warning);font-size:10px;margin:6px 0}.workflow-grants{display:flex;flex-wrap:wrap;gap:4px;align-items:center;font-size:10px}.workflow-grants span{color:var(--muted);margin-right:4px}.workflow-grants code,.check-cmd{background:var(--code-bg);border:1px solid var(--border-muted);padding:2px 5px;font-size:9px}.workflow-card-actions{display:flex;gap:6px}.workflow-dialog{width:min(520px,calc(100vw - 24px));max-height:calc(100vh - 48px);overflow:auto;border:1px solid var(--rule);background:var(--surface);color:var(--ink);padding:16px}.workflow-dialog.wide{width:min(720px,calc(100vw - 24px))}.workflow-dialog::backdrop{background:color-mix(in srgb,var(--overlay) 55%,transparent)}.workflow-builder{display:grid;gap:10px}.workflow-builder fieldset label{display:grid;grid-template-columns:110px 1fr;gap:8px;align-items:center;margin:6px 0}.workflow-builder input,.workflow-builder select,.workflow-builder textarea{width:100%;background:var(--ground);color:var(--ink);border:1px solid var(--rule);padding:6px 8px;font:inherit;font-size:11px}.workflow-phases{display:flex;flex-wrap:wrap;gap:4px;align-items:center}.workflow-phases>button{font-size:10px;padding:4px 8px;border:1px solid var(--rule);background:var(--surface-muted);color:var(--ink)}.workflow-phases>button.active{border-color:var(--border-focus);background:var(--raised);color:var(--highlight)}.workflow-phase-tools{display:flex;gap:4px;margin-left:auto}.perm-row{display:grid;grid-template-columns:1fr 1fr 90px auto;gap:6px;margin:4px 0}.workflow-review{border:1px solid var(--rule);background:var(--surface-muted);padding:10px;display:grid;gap:6px}.workflow-review h3{margin:0;font-size:11px}.workflow-review-phase{font-size:10px}.workflow-json{margin:0;max-height:180px;overflow:auto;background:var(--code-bg);border:1px solid var(--border-muted);padding:8px;font-size:10px;white-space:pre-wrap}@media(max-width:720px){.workflow-builder fieldset label,.perm-row{grid-template-columns:1fr}.workflow-dialog.wide{width:calc(100vw - 16px)}}.plans-panel{display:grid;gap:8px}.plans-meta{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0;font-size:10px;color:var(--muted)}.plans-meta small{color:var(--acid);text-transform:uppercase;letter-spacing:.12em;font-size:8px}.plans-actions{flex-wrap:wrap;margin:4px 0 8px}.plans-section-head{display:flex;justify-content:space-between;gap:8px;align-items:baseline}.plans-section-head h3{margin:0}.plans-section-head button{font-size:10px;padding:2px 6px}.plans-create{display:grid;gap:6px;border:1px solid var(--rule);background:var(--surface-muted);padding:10px;margin-bottom:8px}.plans-create label{display:grid;gap:4px;font-size:10px;color:var(--muted)}.plans-create input{background:var(--ground);color:var(--ink);border:1px solid var(--rule);padding:6px 8px;font:inherit;font-size:11px}.plans-create button{justify-self:start;font-size:10px;padding:4px 8px}.plans-sections{margin-top:4px}.timeline-panel{display:grid;gap:10px}.timeline-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.timeline-head h2{margin:0;font-size:13px}.timeline-actions{display:flex;gap:6px;flex-wrap:wrap}.timeline-actions button{font-size:10px;padding:4px 8px}.timeline-summary{display:grid;grid-template-columns:repeat(auto-fill,minmax(72px,1fr));gap:8px;margin:0}.timeline-summary div{border:1px solid var(--rule);background:var(--surface-muted);padding:8px}.timeline-summary dt{margin:0 0 4px;color:var(--muted);font-size:8px;letter-spacing:.1em;text-transform:uppercase}.timeline-summary dd{margin:0;font-size:12px}.timeline-list{list-style:none;margin:0;padding:0;display:grid;gap:4px;max-height:min(60vh,480px);overflow:auto}.timeline-entry{display:grid;grid-template-columns:72px minmax(0,1.4fr) 72px 48px;gap:6px 8px;align-items:baseline;border:1px solid var(--border-muted);background:var(--surface-muted);padding:6px 8px;font-size:10px}.timeline-state{font-size:9px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}.timeline-state.state-completed{color:var(--success)}.timeline-state.state-failed{color:var(--signal)}.timeline-state.state-canceled{color:var(--warning)}.timeline-state.state-running,.timeline-state.state-waiting,.timeline-state.state-queued{color:var(--accent-alt)}.timeline-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink)}.timeline-id{color:var(--muted);font-size:9px;overflow:hidden;text-overflow:ellipsis}.timeline-dur{color:var(--muted);text-align:right}.timeline-code{grid-column:1 / -1;color:var(--warning);font-size:9px}.timeline-err{grid-column:1 / -1;color:var(--signal);font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.root-attention{width:8px;height:8px;border-radius:50%;background:var(--warning);flex-shrink:0}.needs-you{color:var(--warning)!important;font-weight:700}.attention-summary{margin-left:8px;border:1px solid var(--warning);background:color-mix(in srgb,var(--warning) 12%,transparent);color:var(--warning);font-size:9px;text-transform:uppercase;letter-spacing:.04em;padding:2px 6px;border-radius:var(--radius);cursor:pointer}.attention-summary:hover{filter:brightness(1.1)}.settings-dialog{width:min(560px,calc(100vw - 24px));max-height:min(88vh,900px);overflow:auto;border:1px solid var(--rule);background:var(--surface);color:var(--ink);padding:18px 20px 16px}.settings-dialog.wide{width:min(640px,calc(100vw - 24px))}.settings-dialog::backdrop{background:color-mix(in srgb,var(--overlay) 55%,transparent)}.settings-form fieldset label{display:grid;grid-template-columns:140px 1fr;gap:8px 12px;align-items:center;margin:6px 0}.settings-form fieldset label select,.settings-form fieldset label input{width:100%;padding:8px 10px;background:var(--ground);border:1px solid var(--rule);color:var(--ink)}.settings-form fieldset button[type=button]{margin-top:6px;font-size:10px;padding:6px 10px}.settings-form .muted,.settings-dialog .muted{color:var(--muted);font-size:10px;margin:4px 0 8px;line-height:1.45}.exclude-list{display:flex;flex-wrap:wrap;gap:8px 14px;margin-top:8px;align-items:center}.exclude-label{width:100%;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.04em}.exclude-item{display:inline-flex!important;align-items:center;gap:6px;margin:0!important;color:var(--ink);font-size:11px;grid-template-columns:none!important}.settings-error{color:var(--signal);font-size:11px;margin:8px 0 0}.goal-meta{display:grid;grid-template-columns:100px 1fr;gap:4px 8px;margin:0 0 12px;font-size:11px}.goal-meta dt{color:var(--muted);margin:0}.goal-meta dd{margin:0;overflow-wrap:anywhere}.goal-criteria{margin:0 0 12px;padding-left:18px;font-size:11px;color:var(--muted)}.goal-criteria strong{color:var(--acid);margin-right:6px}.goal-log{margin:0 0 12px;padding-left:18px;display:grid;gap:8px;font-size:11px}.goal-log li{display:grid;gap:2px}.goal-log span{color:var(--muted);font-size:10px}.goal-log p{margin:0;color:var(--muted);white-space:pre-wrap}.project-form{display:grid;gap:10px;margin-bottom:16px;padding:12px;border:1px solid var(--rule);background:var(--surface-muted)}.project-form label{display:grid;gap:6px;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.08em}.project-form input,.project-form textarea{width:100%;border:1px solid var(--rule);background:var(--surface);color:var(--ink);padding:8px 10px;font:inherit;font-size:12px;text-transform:none;letter-spacing:normal}.project-form textarea{resize:vertical;min-height:64px}.plugin-card .plugin-trust{font-size:10px;text-transform:uppercase;letter-spacing:.04em}.plugin-trust.trusted{color:var(--success)}.plugin-trust.stale{color:var(--warning)}.plugin-trust.none{color:var(--signal)}.plugin-trust.passive{color:var(--muted)}.plugin-findings{margin:4px 0 0;padding-left:16px;font-size:10px;color:var(--muted)}.plugin-install{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:end;margin:0 0 10px}.plugin-install label{display:grid;gap:4px;font-size:10px;color:var(--muted)}.plugin-install input{width:100%;background:var(--ground);color:var(--ink);border:1px solid var(--rule);padding:6px 8px;font:inherit;font-size:11px}.plugin-trust-preview{border:1px solid var(--border-focus);background:var(--surface-muted);padding:10px;margin:0 0 10px;display:grid;gap:6px}.plugin-trust-preview h3{margin:0;font-size:12px}.plugin-trust-preview ul{margin:0;padding-left:16px;font-size:10px}.plugin-pane-surface{border:1px solid var(--rule);background:var(--surface);outline:none;min-height:120px}.plugin-pane-surface:focus{border-color:var(--border-focus)}.plugin-pane-chrome{display:flex;gap:8px;align-items:baseline;padding:8px 10px;border-bottom:1px solid var(--rule);background:var(--surface-muted);font-size:11px}.plugin-pane-body{padding:10px;font-size:11px}.pane-column{display:grid}.pane-row{display:flex;flex-wrap:wrap;min-width:0}.pane-row.wrap{flex-direction:column;flex-wrap:nowrap}.pane-row-cell{flex-grow:1;flex-shrink:1;flex-basis:calc((var(--stack-at, 0px) - 100%) * 999);min-width:0;max-width:100%}.pane-row.wrap .pane-row-cell{flex:1 1 auto;width:100%}.pane-role{margin:0}.pane-role.title{font-weight:600;color:var(--ink)}.pane-role.muted{color:var(--muted)}.pane-role.accent{color:var(--acid)}.pane-role.success{color:var(--success)}.pane-role.warning{color:var(--warning)}.pane-role.error{color:var(--signal)}.pane-role.body{color:var(--ink)}.pane-kv{margin:0;display:grid;gap:2px}.pane-kv-row{display:grid;grid-template-columns:minmax(48px,30%) 1fr;gap:8px}.pane-kv dt,.pane-kv dd{margin:0}.pane-list{list-style:none;margin:0;padding:0;display:grid;gap:2px}.pane-list li{display:flex;justify-content:space-between;gap:8px;padding:2px 4px}.pane-list li.selected{background:var(--surface-muted);color:var(--highlight)}.pane-table{width:100%;border-collapse:collapse;font-size:10px}.pane-table th,.pane-table td{text-align:left;padding:2px 4px;border-bottom:1px solid var(--border-muted)}.pane-table th{color:var(--muted);font-weight:500}.pane-meter{display:flex;align-items:center;gap:8px}.pane-badge{display:inline-block;padding:1px 6px;border-radius:var(--radius);background:var(--surface-muted);font-size:10px}.pane-badge.tone-success{color:var(--success)}.pane-badge.tone-warning{color:var(--warning)}.pane-badge.tone-error{color:var(--signal)}.pane-badge.tone-accent{color:var(--acid)}.pane-divider{border:0;border-top:1px solid var(--border-muted);margin:6px 0}.pane-error{padding:10px;background:var(--unavailable-bg);color:var(--signal);font-size:11px}.pane-error p{margin:4px 0 0;color:var(--muted)}.pane-empty{padding:8px 0}@media(max-width:720px){.plugin-install{grid-template-columns:1fr}}.plugin-head,.plugin-pane-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}.plugin-head h2,.plugin-pane-head h3{margin:0;font-size:13px}.plugin-actions,.plugin-card-actions{display:flex;gap:6px;flex-wrap:wrap}.plugin-list{display:grid;gap:8px}.plugin-card{border:1px solid var(--rule);background:var(--surface-muted);padding:10px;display:grid;gap:6px}.plugin-card header{display:flex;flex-wrap:wrap;gap:6px;align-items:center}.plugin-card h3{margin:0;font-size:12px;flex:1}.plugin-status,.plugin-trust{font-size:10px;text-transform:uppercase;letter-spacing:.04em}.plugin-status.enabled{color:var(--success)}.plugin-status.disabled{color:var(--muted)}.plugin-status.invalid{color:var(--signal)}.plugin-counts{font-size:10px}.plugin-mcp,.plugin-findings,.plugin-hits,.plugin-panes ul{margin:0;padding-left:16px;font-size:10px}.plugin-review{border:1px solid var(--border-focus);background:var(--surface);padding:10px;display:grid;gap:6px;margin-bottom:10px}.plugin-review h3{margin:0;font-size:12px}.plugin-summary{margin:0;max-height:160px;overflow:auto;background:var(--code-bg);border:1px solid var(--border-muted);padding:8px;font-size:10px;white-space:pre-wrap}.plugin-pane-host{margin-top:12px;border:1px solid var(--rule);background:var(--surface)}.plugin-pane-body{padding:10px}.plugin-card-actions .danger{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 40%,var(--rule))}.error-text{color:var(--signal);margin:0;font-size:11px}.warning-text{color:var(--warning);margin:0;font-size:11px}.pane-list-btn{background:none;border:0;color:inherit;font:inherit;text-align:left;padding:0;cursor:pointer}.pane-meter-track{flex:1;height:6px;background:var(--ground);border-radius:var(--radius);overflow:hidden}.pane-meter-fill{height:100%;background:var(--acid)}.pane-meter-fill.tone-success{background:var(--success)}.pane-meter-fill.tone-warning{background:var(--warning)}.pane-meter-fill.tone-error,.pane-meter-fill.tone-danger{background:var(--signal)}.pane-divider{border:0;border-top:1px solid var(--rule);margin:6px 0}.pane-spacer{width:100%}.palette-trigger{margin-left:auto;display:inline-flex;align-items:center;gap:6px;border:1px solid var(--rule);background:transparent;padding:4px 10px;border-radius:var(--radius);cursor:pointer;font-size:12px;color:var(--muted)}.palette-trigger kbd{font-size:10px}.palette-input{width:100%;padding:10px 12px;border:1px solid var(--rule);background:var(--code-bg);color:var(--ink);border-radius:var(--radius);margin-bottom:10px}.palette-list{list-style:none;margin:0;padding:0;max-height:360px;overflow:auto;display:grid;gap:0}.palette-hint{margin:8px 0 0;font-size:11px}.onboard-hint{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:8px 12px;border:1px solid var(--rule);border-radius:var(--radius);background:color-mix(in srgb,var(--acid) 8%,transparent);margin:0 0 8px;font-size:12px}.onboard-hint p{margin:0}.team-workspace{display:grid;gap:12px}.team-workspace-head{display:flex;align-items:center;gap:8px}.team-workspace-head h2{margin:0}.team-attention-entry{width:100%;text-align:left;padding:8px 10px;border:1px solid var(--rule);background:color-mix(in srgb,var(--acid) 8%,transparent);cursor:pointer;border-radius:var(--radius);font-weight:600}.team-attention ul{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:4px}.team-attention li button{width:100%;display:flex;gap:8px;align-items:flex-start;text-align:left;padding:8px;border:1px solid var(--rule);background:var(--code-bg);cursor:pointer;border-radius:var(--radius)}.team-attention li strong{display:block}.team-attention li small{display:block;color:var(--muted)}.team-view-tabs,.team-filters{display:inline-flex;flex-wrap:wrap;gap:0;border:1px solid var(--rule);background:var(--surface-muted)}.team-view-tabs button,.team-filters button{border:0;border-right:1px solid var(--rule);background:transparent;padding:4px 10px;border-radius:0;cursor:pointer;font-size:12px;text-transform:capitalize}.team-view-tabs button:last-child,.team-filters button:last-child{border-right:0}.team-view-tabs button.active,.team-filters button.active,.team-view-tabs button[aria-selected=true],.team-filters button[aria-pressed=true]{background:var(--acid);color:var(--mark-ink);border-color:var(--ink)}.team-roster{list-style:none;margin:0;padding:0;display:grid;gap:4px}.team-detail{border:1px solid var(--rule);padding:10px;border-radius:var(--radius);background:var(--code-bg)}.team-detail header{display:flex;justify-content:space-between;align-items:center}.team-detail h3{margin:0}.team-detail dl{display:grid;grid-template-columns:auto 1fr;gap:4px 10px;margin:8px 0;font-size:12px}.team-detail dt{color:var(--muted)}.team-detail dd{margin:0}.team-files{margin:0;padding-left:16px}.team-detail-actions{display:flex;gap:8px}.team-board{display:flex;gap:10px;overflow-x:auto;padding-bottom:8px;scroll-snap-type:x mandatory}.team-board-col{min-width:160px;max-width:220px;flex:0 0 auto;border:1px solid var(--rule);border-radius:var(--radius);padding:8px;scroll-snap-align:start;background:var(--code-bg)}.team-board-col h4{margin:0 0 8px;font-size:12px;text-transform:capitalize}.team-board-col ul{list-style:none;margin:0;padding:0;display:grid;gap:6px}.team-board-card{width:100%;text-align:left;display:grid;gap:4px;border:1px solid var(--rule);background:var(--ground);padding:8px;border-radius:var(--radius)}.team-board-card-main{width:100%;text-align:left;display:grid;gap:2px;border:0;background:transparent;padding:0;cursor:pointer;color:inherit}.team-board-actions,.team-control-row{display:flex;flex-wrap:wrap;gap:6px}.team-board-actions button,.team-control-row button,.team-controls-inline button{border:1px solid var(--rule);background:transparent;padding:4px 8px;border-radius:var(--radius);cursor:pointer;font-size:12px}.team-board-actions button:disabled,.team-control-row button:disabled{opacity:.5;cursor:not-allowed}.team-board-reason{font-size:11px;color:var(--muted)}.team-messages{list-style:none;margin:0;padding:0;display:grid;gap:8px}.team-messages li{display:grid;gap:2px;padding:8px;border:1px solid var(--rule);border-radius:var(--radius)}.team-control-status{margin:0;padding:8px 10px;border-radius:var(--radius);font-size:12px;border:1px solid var(--rule);background:color-mix(in srgb,var(--acid) 10%,transparent)}.team-controls{display:grid;gap:12px}.team-control-block{border:1px solid var(--rule);border-radius:var(--radius);padding:10px;display:grid;gap:8px;margin:0;background:var(--code-bg)}.team-control-block legend{padding:0 4px;font-weight:600}.team-control-block label{display:grid;gap:4px;font-size:12px;color:var(--muted)}.team-control-block input,.team-control-block textarea,.team-control-block select{width:100%;border:1px solid var(--rule);border-radius:var(--radius);background:var(--ground);color:var(--ink);padding:6px 8px;font:inherit}.team-control-block button.primary{justify-self:start;background:var(--acid);color:var(--mark-ink);border-color:var(--ink);padding:6px 12px;border-radius:var(--radius);cursor:pointer}.team-control-block button.linkish{justify-self:start;border:0;background:transparent;color:var(--acid);cursor:pointer;padding:0;text-align:left}.team-control-advanced{display:grid;gap:8px}.team-local-board{list-style:none;margin:0;padding:0;display:grid;gap:8px}.team-local-board li{display:grid;gap:4px;padding:8px;border:1px solid var(--rule);border-radius:var(--radius);background:var(--ground)}.team-controls-inline{margin-top:8px}@media(max-width:720px){.team-board{flex-direction:column;overflow-x:visible}.team-board-col{min-width:0;max-width:none;width:100%}.team-control-block{padding:8px}}.tool-card summary{display:flex;flex-wrap:wrap;gap:8px;align-items:center;cursor:pointer;padding:8px 10px}.tool-name{font-weight:600;font-family:var(--mono, ui-monospace, monospace)}.tool-state{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}.tool-state-running{color:var(--acid)}.tool-state-error{color:var(--diff-del)}.tool-state-denied{color:var(--warning)}.tool-duration{color:var(--muted)}.tool-args{padding:8px 10px;border-top:1px solid var(--rule)}.tool-args pre,.tool-output{margin:0;max-height:280px;overflow:auto;font-size:11px}.diff-viewer{border-top:1px solid var(--rule)}.diff-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:6px 10px;font-size:11px}.diff-wrap{display:inline-flex;gap:4px;align-items:center;color:var(--muted)}.diff.wrap{white-space:pre-wrap;word-break:break-word}.diff .hunk{color:var(--muted)}.copy-btn{font-size:10px;padding:2px 6px}button.file-ref{background:none;border:0;padding:0;color:var(--acid);cursor:pointer;text-decoration:underline;font:inherit}.exploration-group summary{cursor:pointer;padding:8px 10px;display:flex;gap:8px;align-items:center}.exploration-body{display:grid;gap:6px;padding:0 8px 8px}.semantic-event p{margin:0;color:var(--text)}.jump-latest{position:sticky;bottom:12px;margin:0 auto;display:block;z-index:2;padding:8px 14px;border-radius:var(--radius);border:1px solid var(--rule);background:var(--panel, var(--bg));cursor:pointer}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.code-block figcaption{display:flex;justify-content:space-between;align-items:center;gap:8px}.provider-rows{display:flex;flex-direction:column;gap:.5rem;margin-bottom:.75rem}.provider-row{border:1px solid var(--rule);border-radius:var(--radius);padding:.5rem .75rem;background:var(--surface-muted)}.provider-row header{display:flex;justify-content:space-between;align-items:center;gap:.5rem}.provider-row .badge{font-size:.75rem;padding:.1rem .4rem;border-radius:var(--radius);background:var(--surface);border:1px solid var(--rule)}.provider-row .badge.ok{border-color:var(--success);color:var(--success)}.model-meta ul{margin:.25rem 0 0;padding-left:1.1rem}.device-flow,.oauth-flow{margin-top:.5rem;padding:.5rem;border:1px dashed var(--rule);border-radius:var(--radius)}.custom-provider-list{list-style:none;padding:0;margin:0 0 .5rem}.custom-provider-list li{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-bottom:.35rem}.code-explorer{display:grid;gap:10px}.code-explorer-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.code-explorer-head h2{margin:0}.code-view-tabs,.code-md-toggle{display:inline-flex;gap:0;border:1px solid var(--rule);background:var(--surface-muted)}.code-view-tabs{margin-left:auto}.code-view-tabs button,.code-md-toggle button{border:0;border-right:1px solid var(--rule);background:transparent;padding:4px 10px;border-radius:0;cursor:pointer;font-size:12px}.code-view-tabs button:last-child,.code-md-toggle button:last-child{border-right:0}.code-view-tabs button.active,.code-md-toggle button.active{background:var(--acid);color:var(--mark-ink);border-color:var(--ink)}.code-explorer-body{display:grid;grid-template-columns:minmax(160px,240px) 1fr;gap:12px;min-height:280px}.code-sidebar{display:grid;gap:8px;align-content:start}.code-search{display:flex;gap:6px;align-items:center}.code-search input{flex:1;border:1px solid var(--rule);border-radius:var(--radius);background:var(--ground);color:var(--ink);padding:6px 8px;font:inherit}.code-breadcrumbs{font-size:12px;color:var(--muted)}.code-breadcrumbs button{border:0;background:transparent;color:var(--acid);cursor:pointer;padding:0}.code-tree,.code-search-hits{list-style:none;margin:0;padding:0;display:grid;gap:2px;max-height:360px;overflow:auto}.code-tree button,.code-search-hits button{width:100%;text-align:left;border:1px solid transparent;background:transparent;padding:4px 6px;border-radius:var(--radius);cursor:pointer;color:inherit;font:inherit}.code-tree button:hover,.code-search-hits button:hover,.code-tree button.active{border-color:var(--rule);background:var(--code-bg)}.code-viewer{border:1px solid var(--rule);border-radius:var(--radius);padding:10px;background:var(--code-bg);min-width:0;overflow:auto}.code-viewer-head{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:8px}.code-viewer-head h3{margin:0;font-size:13px;word-break:break-all}.code-raw{margin:0;font-family:var(--mono, ui-monospace, monospace);font-size:12px;line-height:1.45}.code-line{display:grid;grid-template-columns:3em 1fr;gap:8px}.code-line.focus{background:color-mix(in srgb,var(--acid) 18%,transparent)}.code-gutter{color:var(--muted);text-align:right;-webkit-user-select:none;user-select:none}.code-text{white-space:pre-wrap;word-break:break-word}.code-md-preview{font-size:13px;line-height:1.5}.code-md-preview h2,.code-md-preview h3,.code-md-preview h4{margin:.8em 0 .3em}.code-md-preview p{margin:.4em 0}.code-md-preview pre.md-code{overflow:auto;padding:8px;border-radius:var(--radius);background:var(--ground);border:1px solid var(--rule)}@media(max-width:720px){.code-explorer-body{grid-template-columns:1fr}.code-tree,.code-search-hits{max-height:200px}}.code-apply{margin-top:12px;border:1px solid var(--rule);border-radius:var(--radius);padding:10px;display:grid;gap:8px;background:var(--ground)}.code-apply legend{font-weight:600;padding:0 4px}.code-apply label{display:grid;gap:4px;font-size:12px;color:var(--muted)}.code-apply textarea{width:100%;border:1px solid var(--rule);border-radius:var(--radius);background:var(--code-bg);color:var(--ink);padding:6px 8px;font:inherit}.code-apply button.primary{justify-self:start;background:var(--acid);color:var(--mark-ink);border:1px solid var(--ink);border-radius:var(--radius);padding:6px 12px;cursor:pointer}.code-apply button.primary:disabled{opacity:.5;cursor:not-allowed}.code-apply-preview{max-height:160px;overflow:auto}.review-panel{display:grid;gap:10px}.review-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.review-head h2{margin:0}.review-tabs{display:inline-flex;gap:0;margin-left:auto;border:1px solid var(--rule);background:var(--surface-muted)}.review-tabs button,.review-filter select,.review-head button{border:1px solid var(--rule);background:transparent;padding:4px 10px;border-radius:var(--radius);cursor:pointer;font-size:12px;color:inherit}.review-tabs button{border:0;border-right:1px solid var(--rule);border-radius:0}.review-tabs button:last-child{border-right:0}.review-tabs button.active{background:var(--acid);color:var(--mark-ink);border-color:var(--ink)}.review-filter{display:flex;gap:8px;align-items:center;font-size:12px;color:var(--muted)}.review-list{list-style:none;margin:0;padding:0;display:grid;gap:6px}.review-list>li>button{width:100%;text-align:left;display:grid;gap:2px;border:1px solid var(--rule);background:var(--code-bg);padding:8px;border-radius:var(--radius);cursor:pointer;color:inherit}.review-list>li>button.active{border-color:var(--acid)}.review-detail{border:1px solid var(--rule);border-radius:var(--radius);padding:10px;background:var(--code-bg)}.review-detail header{display:flex;justify-content:space-between;align-items:center}.review-detail h3{margin:0}.review-detail dl{display:grid;grid-template-columns:auto 1fr;gap:4px 10px;font-size:12px}.review-detail dt{color:var(--muted)}.review-detail dd{margin:0}.review-content{max-height:280px;overflow:auto;padding:8px;border-radius:var(--radius);background:var(--ground);border:1px solid var(--rule);font-size:12px;white-space:pre-wrap}.review-paths{margin:4px 0 0;padding-left:16px}.ledger-row{border:1px solid var(--rule);border-radius:var(--radius);padding:8px;background:var(--code-bg)}.ledger-row-head{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-bottom:4px}.ledger-meta{font-size:11px}button.linkish{border:0;background:transparent;color:var(--acid);cursor:pointer;padding:0;font:inherit}@media(max-width:720px){.review-content{max-height:200px}}.virtual-list{position:relative;min-height:0}.virtual-list-spacer{width:100%}.transcript-list{min-height:0}.team-roster{max-height:min(60vh,520px);overflow:auto} diff --git a/internal/frontend/server/static/assets/panesApi-DZ879dGA.js b/internal/frontend/server/static/assets/panesApi-Gdyy8rqS.js similarity index 94% rename from internal/frontend/server/static/assets/panesApi-DZ879dGA.js rename to internal/frontend/server/static/assets/panesApi-Gdyy8rqS.js index e0f989ca..bb8b9c80 100644 --- a/internal/frontend/server/static/assets/panesApi-DZ879dGA.js +++ b/internal/frontend/server/static/assets/panesApi-Gdyy8rqS.js @@ -1 +1 @@ -import{b as i}from"./index-DcyMECWA.js";const c=()=>i("/v1/panes"),l=(t,o)=>i(`/v1/panes/${encodeURIComponent(t)}/snapshot`),f=(t,o=40,n=14,r)=>{const s=r?`?root=${encodeURIComponent(r)}`:"";return i(`/v1/panes/${encodeURIComponent(t)}/mount${s}`,{method:"POST",body:JSON.stringify({width:o,height:n})})},a=t=>i(`/v1/panes/${encodeURIComponent(t)}/unmount`,{method:"POST",body:JSON.stringify({})}),m=(t,o)=>i(`/v1/panes/${encodeURIComponent(t)}/input`,{method:"POST",body:JSON.stringify({event:o})});function y(t,o){if(!o||!t)return"";const n=o.split(".").filter(Boolean);if(!n.length)return"";let r="",s=n;if(n.length>=2&&t[`${n[0]}.${n[1]}`]!==void 0)r=`${n[0]}.${n[1]}`,s=n.slice(2);else if(t[n[0]]!==void 0)r=n[0],s=n.slice(1);else return"";let e=t[r];for(const p of s){if(e==null||typeof e!="object")return"";e=e[p]}if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return""}}export{c as listPanes,f as mountPane,m as paneInput,l as paneSnapshot,y as resolveFrom,a as unmountPane}; +import{b as i}from"./index-BK8GKzWA.js";const c=()=>i("/v1/panes"),l=(t,o)=>i(`/v1/panes/${encodeURIComponent(t)}/snapshot`),f=(t,o=40,n=14,r)=>{const s=r?`?root=${encodeURIComponent(r)}`:"";return i(`/v1/panes/${encodeURIComponent(t)}/mount${s}`,{method:"POST",body:JSON.stringify({width:o,height:n})})},a=t=>i(`/v1/panes/${encodeURIComponent(t)}/unmount`,{method:"POST",body:JSON.stringify({})}),m=(t,o)=>i(`/v1/panes/${encodeURIComponent(t)}/input`,{method:"POST",body:JSON.stringify({event:o})});function y(t,o){if(!o||!t)return"";const n=o.split(".").filter(Boolean);if(!n.length)return"";let r="",s=n;if(n.length>=2&&t[`${n[0]}.${n[1]}`]!==void 0)r=`${n[0]}.${n[1]}`,s=n.slice(2);else if(t[n[0]]!==void 0)r=n[0],s=n.slice(1);else return"";let e=t[r];for(const p of s){if(e==null||typeof e!="object")return"";e=e[p]}if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return""}}export{c as listPanes,f as mountPane,m as paneInput,l as paneSnapshot,y as resolveFrom,a as unmountPane}; diff --git a/internal/frontend/server/static/index.html b/internal/frontend/server/static/index.html index 4fc1bf0c..9492df17 100644 --- a/internal/frontend/server/static/index.html +++ b/internal/frontend/server/static/index.html @@ -5,8 +5,8 @@ Strike Workspace - - + +
    diff --git a/web/e2e/cockpit.spec.ts b/web/e2e/cockpit.spec.ts index 55f84f48..18d76db2 100644 --- a/web/e2e/cockpit.spec.ts +++ b/web/e2e/cockpit.spec.ts @@ -205,9 +205,11 @@ test.describe("live echo cockpit", () => { test.describe("responsive viewports", () => { for (const [name, size] of [ + ["desktop-1280", { width: 1280, height: 800 }], ["desktop", { width: 1440, height: 900 }], ["tablet", { width: 900, height: 700 }], ["720", { width: 720, height: 800 }], + ["narrow-360", { width: 360, height: 640 }], ["320", { width: 320, height: 640 }], ] as const) { test(`${name} has no page-level horizontal overflow`, async ({ page }) => { @@ -218,6 +220,39 @@ test.describe("responsive viewports", () => { await expectNoPageHScroll(page); await expect(page.getByRole("button", { name: "Open settings" })).toBeVisible(); await expect(page.getByLabel("Instruction")).toBeVisible(); + await expect(page.getByRole("button", { name: "Send" })).toBeVisible(); + }); + } + + for (const [name, size] of [ + ["desktop-1280", { width: 1280, height: 800 }], + ["narrow-360", { width: 360, height: 640 }], + ] as const) { + test(`${name} inspector + Code surface stay in-viewport`, async ({ page }) => { + await page.setViewportSize(size); + await page.goto("/attach"); + await expect(page.locator(".wordmark")).toBeVisible({ timeout: 30_000 }); + await dismissBlockingDialogs(page); + + const inspectorToggle = page.getByRole("button", { name: "Toggle inspector" }); + await expect(inspectorToggle).toBeVisible(); + if ((await inspectorToggle.getAttribute("aria-pressed")) !== "true") { + await inspectorToggle.click(); + } + await expectNoPageHScroll(page); + + const modes = page.getByRole("navigation", { name: "Workspace mode" }); + const codeMode = modes.getByRole("button", { name: /^Code/ }); + await expect(codeMode).toBeVisible(); + await codeMode.click(); + await expect(codeMode).toHaveAttribute("aria-pressed", "true"); + await expectNoPageHScroll(page); + + const teamMode = modes.getByRole("button", { name: /^Team/ }); + await expect(teamMode).toBeVisible(); + await teamMode.click(); + await expect(teamMode).toHaveAttribute("aria-pressed", "true"); + await expectNoPageHScroll(page); }); } }); diff --git a/web/e2e/helpers.ts b/web/e2e/helpers.ts index 56d216bb..55131680 100644 --- a/web/e2e/helpers.ts +++ b/web/e2e/helpers.ts @@ -45,11 +45,11 @@ export async function expectNoPageHScroll(page: Page) { bodyScrollWidth: document.body.scrollWidth, }; }); - // Page-level (document) overflow only. Shell min-width polish is WEBUI.4; - // allow modest gutter/subpixel slack so essential chrome can still be asserted. - const slack = overflow.clientWidth <= 360 ? 140 : 24; - expect(overflow.scrollWidth).toBeLessThanOrEqual(overflow.clientWidth + slack); - expect(overflow.bodyScrollWidth).toBeLessThanOrEqual(overflow.clientWidth + slack); + // Page-level (document) overflow only. Subpixel / scrollbar slack — the + // shell itself must shrink (min-width: 0) rather than force a page scroll. + const slack = 8; + expect(overflow.scrollWidth, `page scrollWidth ${overflow.scrollWidth} > client ${overflow.clientWidth}`).toBeLessThanOrEqual(overflow.clientWidth + slack); + expect(overflow.bodyScrollWidth, `body scrollWidth ${overflow.bodyScrollWidth} > client ${overflow.clientWidth}`).toBeLessThanOrEqual(overflow.clientWidth + slack); } export async function openSettings(page: Page) { diff --git a/web/src/App.test.tsx b/web/src/App.test.tsx index d5525087..b5551c4e 100644 --- a/web/src/App.test.tsx +++ b/web/src/App.test.tsx @@ -1447,6 +1447,35 @@ describe("App", () => { window.dispatchEvent(new Event("resize")); }); + it("keeps primary chrome reachable at desktop 1280 and narrow 360", async () => { + const prev = window.innerWidth; + Object.defineProperty(window, "innerWidth", { configurable: true, value: 1280 }); + window.dispatchEvent(new Event("resize")); + const { unmount } = render(); + await screen.findByText("Current"); + expect(document.querySelector(".app-shell")).toHaveAttribute("data-shell", "desktop"); + expect(document.querySelector(".header-mode-switch")).not.toBeNull(); + expect(screen.getByRole("button", { name: "Open settings" })).toBeTruthy(); + expect(screen.getByRole("button", { name: "Toggle inspector" })).toBeTruthy(); + expect(screen.getByLabelText("Instruction")).toBeTruthy(); + expect(screen.getByRole("button", { name: "Send" })).toBeTruthy(); + unmount(); + + Object.defineProperty(window, "innerWidth", { configurable: true, value: 360 }); + window.dispatchEvent(new Event("resize")); + render(); + await screen.findByText("Current"); + expect(document.querySelector(".app-shell")).toHaveAttribute("data-shell", "phone"); + expect(document.querySelector(".header-mode-switch")).toBeNull(); + expect(screen.getByRole("button", { name: "Open settings" })).toBeTruthy(); + expect(screen.getByRole("button", { name: "Toggle inspector" })).toBeTruthy(); + expect(screen.getByLabelText("Instruction")).toBeTruthy(); + expect(screen.getByRole("button", { name: "Send" })).toBeTruthy(); + expect(screen.getByRole("navigation", { name: "Workspace mode" }).className).toContain("mode-bottom-bar"); + Object.defineProperty(window, "innerWidth", { configurable: true, value: prev || 1280 }); + window.dispatchEvent(new Event("resize")); + }); + it("restores mode and surface from deep link after bootstrap", async () => { Object.defineProperty(window, "innerWidth", { configurable: true, value: 1280 }); window.dispatchEvent(new Event("resize")); diff --git a/web/src/shellProfile.test.ts b/web/src/shellProfile.test.ts index 1b812fe2..cd05c944 100644 --- a/web/src/shellProfile.test.ts +++ b/web/src/shellProfile.test.ts @@ -10,12 +10,14 @@ import { describe("shellProfile", () => { it("classifies desktop / tablet / phone by width", () => { expect(shellProfileFromWidth(1440)).toBe("desktop"); + expect(shellProfileFromWidth(1280)).toBe("desktop"); expect(shellProfileFromWidth(1024)).toBe("desktop"); expect(shellProfileFromWidth(SHELL_BREAKPOINTS.tabletMax)).toBe("tablet"); expect(shellProfileFromWidth(900)).toBe("tablet"); expect(shellProfileFromWidth(600)).toBe("tablet"); expect(shellProfileFromWidth(SHELL_BREAKPOINTS.phoneMax)).toBe("phone"); expect(shellProfileFromWidth(390)).toBe("phone"); + expect(shellProfileFromWidth(360)).toBe("phone"); expect(shellProfileFromWidth(320)).toBe("phone"); }); diff --git a/web/src/styles.css b/web/src/styles.css index aa275533..d6ba0241 100644 --- a/web/src/styles.css +++ b/web/src/styles.css @@ -27,6 +27,7 @@ * --overlay OverlayScrim (dialog backdrop tint) * --mark-ink wordmark glyph on Accent fill * --radius token chrome.radiusWebPx (2px sharp chrome) + * --header-height / --gutter / --pane-min layout tokens (#1236) * --text/--bg/--border/--panel/--accent/--warn aliases */ :root { @@ -63,7 +64,7 @@ } } -/* Density tokens (compact desktop vs touch). */ +/* Density + layout tokens (compact desktop vs touch). */ :root { --control-pad-y: 7px; --control-pad-x: 12px; @@ -72,6 +73,11 @@ --focus-ring: 2px solid var(--acid); --focus-offset: 2px; --radius: 2px; + /* Shell geometry — keep in step with TUI XS/SM gutters (docs/theme.md). */ + --header-height: 52px; + --gutter: 12px; + --pane-min: 180px; + --mode-bar-height: 56px; } * { box-sizing: border-box; } @@ -143,6 +149,7 @@ button:disabled, select:disabled, input:disabled, textarea:disabled { min-width: var(--control-min-h); min-height: var(--control-min-h); line-height: 1; + flex-shrink: 0; } .ui-btn-sm { padding: 4px 8px; font-size: 10px; min-height: 24px; } .ui-btn-touch { min-height: var(--touch-min); min-width: var(--touch-min); padding: 10px 14px; } @@ -390,7 +397,9 @@ button:disabled, select:disabled, input:disabled, textarea:disabled { .app-shell { display: grid; - grid-template: 52px minmax(0, 1fr) / var(--nav-width, 240px) minmax(420px, 1fr) var(--inspector-width, 340px); + /* Side tracks may shrink below their preferred width so the shell never + forces page-level overflow when both rails are open (#1236). */ + grid-template: var(--header-height) minmax(0, 1fr) / minmax(0, var(--nav-width, 240px)) minmax(0, 1fr) minmax(0, var(--inspector-width, 340px)); height: 100vh; height: 100dvh; max-width: 100vw; @@ -399,12 +408,12 @@ button:disabled, select:disabled, input:disabled, textarea:disabled { padding-right: env(safe-area-inset-right, 0px); } .app-shell[data-shell="phone"] { - grid-template: 52px minmax(0, 1fr) auto / 1fr; + grid-template: auto minmax(0, 1fr) auto / minmax(0, 1fr); padding-bottom: env(safe-area-inset-bottom, 0px); } .app-shell[data-shell="tablet"] { grid-template-columns: minmax(0, 1fr); - grid-template-rows: 52px minmax(0, 1fr); + grid-template-rows: var(--header-height) minmax(0, 1fr); } header { grid-column: 1 / -1; @@ -412,17 +421,32 @@ header { z-index: 10; display: flex; align-items: center; - gap: 12px; + gap: var(--gutter); border-bottom: 1px solid var(--rule); background: var(--header-bg); - padding: 0 14px; + padding: 0 var(--gutter); padding-top: env(safe-area-inset-top, 0px); - min-height: calc(52px + env(safe-area-inset-top, 0px)); + min-height: calc(var(--header-height) + env(safe-area-inset-top, 0px)); + min-width: 0; z-index: 4; position: sticky; top: 0; } -.wordmark { display: flex; align-items: baseline; gap: 9px; width: 202px; letter-spacing: .1em; } +.app-shell > header { overflow: hidden; } +.wordmark { + display: flex; + align-items: baseline; + gap: 9px; + flex: 0 1 202px; + min-width: 0; + overflow: hidden; + letter-spacing: .1em; +} +.wordmark strong { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} .wordmark .mark { display: grid; place-items: center; @@ -434,17 +458,28 @@ header { transform: skew(-7deg); } .wordmark small { color: var(--muted); font-size: 9px; } -.session-line { margin-left: auto; text-transform: uppercase; font-size: 10px; color: var(--muted); } +.session-line { + margin-left: auto; + text-transform: uppercase; + font-size: 10px; + color: var(--muted); + flex: 1 1 auto; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} .mode-switch { display: flex; align-items: stretch; gap: 0; - margin-left: 12px; + margin-left: var(--gutter); padding: 0; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface-muted); + flex: 0 1 auto; flex-shrink: 1; min-width: 0; overflow: auto; @@ -510,15 +545,15 @@ header { } /* .icon-button styles live with .ui-btn-icon above */ -.navigation, .inspector { min-height: 0; background: var(--surface); transition: width .16s ease, opacity .16s ease; } +.navigation, .inspector { min-height: 0; min-width: 0; background: var(--surface); transition: width .16s ease, opacity .16s ease; } .navigation { border-right: 1px solid var(--rule); min-width: 0; overflow: hidden; - padding: 18px 12px; + padding: 18px var(--gutter); display: flex; flex-direction: column; - gap: 12px; + gap: var(--gutter); } .aside-heading { display: flex; @@ -634,6 +669,7 @@ main { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; + overflow: hidden; } .runtime { display: flex; @@ -641,6 +677,7 @@ main { border-bottom: 1px solid var(--rule); background: var(--rule); overflow: auto; + min-width: 0; } .runtime-explain { align-self: end; @@ -747,9 +784,10 @@ main { } .transcript { + min-width: 0; min-height: 0; overflow: auto; - padding: 42px clamp(22px, 6vw, 80px); + padding: 42px clamp(var(--gutter), 6vw, 80px); scrollbar-color: var(--rule) transparent; } .empty-state { max-width: 620px; margin: 12vh auto 0; } @@ -799,10 +837,11 @@ main { border: 1px solid var(--rule); } .composer { - margin: 0 clamp(14px, 4vw, 56px) 22px; + margin: 0 clamp(var(--gutter), 4vw, 56px) 22px; border: 1px solid var(--rule); background: var(--surface); position: relative; + min-width: 0; } .composer label { display: block; @@ -826,12 +865,22 @@ main { } .composer-bar { display: flex; + flex-wrap: wrap; justify-content: space-between; align-items: center; + gap: 8px; padding: 8px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 9px; + min-width: 0; +} +.composer-bar > span { + display: inline-flex; + flex-wrap: wrap; + align-items: center; + gap: 6px; + min-width: 0; } .composer-send { background: var(--acid); @@ -841,6 +890,7 @@ main { text-transform: uppercase; font-size: 10px; font-weight: 600; + flex-shrink: 0; } .composer-send:hover:not(:disabled), .composer-send:focus-visible { @@ -942,10 +992,11 @@ main { .inspector-body { flex: 1; + min-width: 0; min-height: 0; height: auto; overflow: auto; - padding: 20px 16px; + padding: 20px var(--gutter); } /* Inspector titles keep serif as a pane-chrome exception (#1159 scoped empty-state/dialog). */ .inspector h2 { @@ -1210,7 +1261,7 @@ dialog input { padding: 12px; color: var(--ink); } @media (max-width: 1023px) { .app-shell { grid-template-columns: minmax(0, 1fr); - grid-template-rows: 52px minmax(0, 1fr); + grid-template-rows: var(--header-height) minmax(0, 1fr); } .app-shell main { min-width: 0; @@ -1218,7 +1269,7 @@ dialog input { padding: 12px; color: var(--ink); } .navigation { position: fixed; z-index: 5; - top: calc(52px + env(safe-area-inset-top, 0px)); + top: calc(var(--header-height) + env(safe-area-inset-top, 0px)); bottom: 0; left: 0; width: min(var(--nav-width, 280px), 88vw); @@ -1233,7 +1284,7 @@ dialog input { padding: 12px; color: var(--ink); } .inspector { position: fixed; right: 0; - top: calc(52px + env(safe-area-inset-top, 0px)); + top: calc(var(--header-height) + env(safe-area-inset-top, 0px)); bottom: 0; width: min(var(--inspector-width, 360px), 92vw); max-width: 100vw; @@ -1249,7 +1300,7 @@ dialog input { padding: 12px; color: var(--ink); } display: none; position: fixed; inset: 0; - top: calc(52px + env(safe-area-inset-top, 0px)); + top: calc(var(--header-height) + env(safe-area-inset-top, 0px)); background: color-mix(in srgb, var(--overlay) 55%, transparent); z-index: 4; border: 0; @@ -1263,18 +1314,23 @@ dialog input { padding: 12px; color: var(--ink); } @media (max-width: 599px) { .app-shell { display: grid; - grid-template: 52px minmax(0, 1fr) auto / 1fr; + grid-template: auto minmax(0, 1fr) auto / minmax(0, 1fr); } .mobile-only { display: block; } - .wordmark { width: auto; } + .wordmark { flex-basis: auto; width: auto; } .wordmark strong { font-size: 12px; } .wordmark small { display: none; } header { + flex-wrap: nowrap; gap: 6px; padding: 0 8px; padding-top: env(safe-area-inset-top, 0px); + overflow: hidden; } .header-mode-switch { display: none !important; } + .palette-trigger { max-width: 5.5rem; } + .palette-trigger kbd { display: none; } + header .icon-button[aria-label="Export markdown"] { display: none; } .session-line { font-size: 0; margin-left: auto; @@ -1282,6 +1338,7 @@ dialog input { padding: 12px; color: var(--ink); } align-items: center; gap: 6px; min-width: 0; + flex: 0 1 auto; } .session-line .pulse { margin: 0; } .session-line .attention-summary { @@ -1324,7 +1381,7 @@ dialog input { padding: 12px; color: var(--ink); } } .navigation, .inspector { top: auto; - bottom: 0; + bottom: calc(var(--mode-bar-height) + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; width: 100%; @@ -1333,12 +1390,12 @@ dialog input { padding: 12px; color: var(--ink); } border-radius: var(--radius) var(--radius) 0 0; transform: translateY(105%); box-shadow: none; - padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); + padding-bottom: 8px; z-index: 8; } .navigation.open, .inspector.open { transform: translateY(0); } .shell-backdrop { - top: calc(52px + env(safe-area-inset-top, 0px)); + top: calc(var(--header-height) + env(safe-area-inset-top, 0px)); z-index: 7; } header { z-index: 10; } @@ -1367,8 +1424,12 @@ dialog input { padding: 12px; color: var(--ink); } } } -/* Desktop keeps header modes; hide bottom bar */ +/* Desktop/tablet keep header modes; phone shows the bottom bar above sheets. */ .mode-bottom-bar { display: none; } +.app-shell[data-shell="phone"] .mode-bottom-bar { + display: flex; + z-index: 9; +} /* Phone surface subnav: accessible list/sheet (WEBUI.12) — not a compressed tab strip. */ .surface-nav-sheet { @@ -1377,6 +1438,7 @@ dialog input { padding: 12px; color: var(--ink); } max-height: 40vh; overflow: auto; background: var(--surface-muted); + min-width: 0; } .surface-nav-list { list-style: none; @@ -2025,6 +2087,8 @@ dialog fieldset small { color: var(--muted); } .attention-summary:hover { filter: brightness(1.1); } .settings-dialog { width: min(560px, calc(100vw - 24px)); + max-width: calc(100vw - 24px); + min-width: 0; max-height: min(88vh, 900px); overflow: auto; border: 1px solid var(--rule); @@ -2036,14 +2100,16 @@ dialog fieldset small { color: var(--muted); } .settings-dialog::backdrop { background: color-mix(in srgb, var(--overlay) 55%, transparent); } .settings-form fieldset label { display: grid; - grid-template-columns: 140px 1fr; + grid-template-columns: minmax(0, 140px) minmax(0, 1fr); gap: 8px 12px; align-items: center; margin: 6px 0; + min-width: 0; } .settings-form fieldset label select, .settings-form fieldset label input { width: 100%; + min-width: 0; padding: 8px 10px; background: var(--ground); border: 1px solid var(--rule); @@ -2276,6 +2342,9 @@ dialog fieldset small { color: var(--muted); } .pane-empty { padding: 8px 0; } @media (max-width: 720px) { .plugin-install { grid-template-columns: 1fr; } + .settings-form fieldset label { + grid-template-columns: minmax(0, 1fr); + } } /* Plugin manager (#732) */ @@ -2379,6 +2448,7 @@ dialog fieldset small { color: var(--muted); } margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); background: transparent; padding: 4px 10px; border-radius: var(--radius); cursor: pointer; font-size: 12px; color: var(--muted); + flex: 0 1 auto; min-width: 0; overflow: hidden; } .palette-trigger kbd { font-size: 10px; } .palette-input { @@ -2389,15 +2459,16 @@ dialog fieldset small { color: var(--muted); } /* Row chrome lives with .ui-list-row (compact single-line family). */ .palette-hint { margin: 8px 0 0; font-size: 11px; } .onboard-hint { - display: flex; justify-content: space-between; gap: 12px; align-items: center; + display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: color-mix(in srgb, var(--acid) 8%, transparent); margin: 0 0 8px; font-size: 12px; + min-width: 0; } .onboard-hint p { margin: 0; } /* WEBUI.14 Team workspace */ -.team-workspace { display: grid; gap: 12px; } -.team-workspace-head { display: flex; align-items: center; gap: 8px; } -.team-workspace-head h2 { margin: 0; } +.team-workspace { display: grid; gap: var(--gutter); min-width: 0; } +.team-workspace-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; } +.team-workspace-head h2 { margin: 0; min-width: 0; } .team-attention-entry { width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--rule); background: color-mix(in srgb, var(--acid) 8%, transparent); @@ -2413,6 +2484,7 @@ dialog fieldset small { color: var(--muted); } .team-attention li small { display: block; color: var(--muted); } .team-view-tabs, .team-filters { display: inline-flex; flex-wrap: wrap; gap: 0; + max-width: 100%; border: 1px solid var(--rule); background: var(--surface-muted); } .team-view-tabs button, .team-filters button { @@ -2426,7 +2498,7 @@ dialog fieldset small { color: var(--muted); } } .team-roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; } .team-detail { border: 1px solid var(--rule); padding: 10px; border-radius: var(--radius); background: var(--code-bg); } -.team-detail header { display: flex; justify-content: space-between; align-items: center; } +.team-detail header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; } .team-detail h3 { margin: 0; } .team-detail dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 8px 0; font-size: 12px; } .team-detail dt { color: var(--muted); } @@ -2552,9 +2624,9 @@ button.file-ref { background: none; border: 0; padding: 0; color: var(--acid); c .custom-provider-list { list-style: none; padding: 0; margin: 0 0 0.5rem; } .custom-provider-list li { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.35rem; } /* WEBUI.8 Code explorer */ -.code-explorer { display: grid; gap: 10px; } -.code-explorer-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; } -.code-explorer-head h2 { margin: 0; } +.code-explorer { display: grid; gap: 10px; min-width: 0; } +.code-explorer-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; } +.code-explorer-head h2 { margin: 0; min-width: 0; } .code-view-tabs, .code-md-toggle { display: inline-flex; gap: 0; border: 1px solid var(--rule); background: var(--surface-muted); @@ -2569,12 +2641,12 @@ button.file-ref { background: none; border: 0; padding: 0; color: var(--acid); c background: var(--acid); color: var(--mark-ink); border-color: var(--ink); } .code-explorer-body { - display: grid; grid-template-columns: minmax(160px, 240px) 1fr; gap: 12px; min-height: 280px; + display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: var(--gutter); min-height: 280px; min-width: 0; } -.code-sidebar { display: grid; gap: 8px; align-content: start; } -.code-search { display: flex; gap: 6px; align-items: center; } +.code-sidebar { display: grid; gap: 8px; align-content: start; min-width: 0; } +.code-search { display: flex; gap: 6px; align-items: center; min-width: 0; } .code-search input { - flex: 1; border: 1px solid var(--rule); border-radius: var(--radius); + flex: 1; min-width: 0; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--ground); color: var(--ink); padding: 6px 8px; font: inherit; } .code-breadcrumbs { font-size: 12px; color: var(--muted); } diff --git a/web/src/styles.layout.test.ts b/web/src/styles.layout.test.ts new file mode 100644 index 00000000..10cab74f --- /dev/null +++ b/web/src/styles.layout.test.ts @@ -0,0 +1,107 @@ +import { readFileSync } from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import { describe, expect, it } from "vitest"; +import { SHELL_BREAKPOINTS } from "./shellProfile"; + +const css = readFileSync(path.join(path.dirname(fileURLToPath(import.meta.url)), "styles.css"), "utf8"); + +function rule(selector: string): string { + const escaped = selector.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + const match = css.match(new RegExp(`(?:^|\\n)${escaped}\\s*\\{([^}]*)\\}`)); + expect(match, `missing rule ${selector}`).toBeTruthy(); + return match![1]; +} + +describe("shell flex layout tokens (#1236)", () => { + it("defines header/gutter/pane layout tokens next to density tokens", () => { + expect(css).toMatch(/--header-height:\s*52px/); + expect(css).toMatch(/--gutter:\s*12px/); + expect(css).toMatch(/--pane-min:\s*180px/); + expect(css).toMatch(/--header-height\s*\/\s*--gutter\s*\/\s*--pane-min/); + }); + + it("sizes the desktop shell from tokens and lets columns shrink", () => { + const shell = rule(".app-shell"); + expect(shell).toMatch(/grid-template:\s*var\(--header-height\)\s+minmax\(0,\s*1fr\)/); + expect(shell).toMatch(/minmax\(0,\s*var\(--nav-width/); + expect(shell).toMatch(/minmax\(0,\s*1fr\)/); + expect(shell).toMatch(/minmax\(0,\s*var\(--inspector-width/); + expect(shell).not.toMatch(/minmax\(420px/); + expect(shell).toMatch(/overflow:\s*hidden/); + expect(shell).toMatch(/max-width:\s*100vw/); + }); + + it("does not hard-code the 52px header row outside the token", () => { + const withoutToken = css.replace(/--header-height:\s*52px;/, ""); + expect(withoutToken).not.toMatch(/grid-template[^;]*52px/); + expect(withoutToken).not.toMatch(/min-height:\s*calc\(52px/); + expect(css).toMatch(/min-height:\s*calc\(var\(--header-height\)/); + }); + + it("lets header chrome, wordmark, and palette shrink instead of overflowing", () => { + expect(rule("header")).toMatch(/min-width:\s*0/); + expect(rule("header")).toMatch(/gap:\s*var\(--gutter\)/); + expect(rule(".wordmark")).toMatch(/min-width:\s*0/); + expect(rule(".wordmark")).toMatch(/flex:\s*0\s+1\s+202px/); + expect(rule(".wordmark")).toMatch(/overflow:\s*hidden/); + expect(rule(".wordmark")).not.toMatch(/width:\s*202px/); + expect(rule(".wordmark strong")).toMatch(/text-overflow:\s*ellipsis/); + expect(rule(".session-line")).toMatch(/min-width:\s*0/); + expect(rule(".session-line")).toMatch(/overflow:\s*hidden/); + expect(rule(".mode-switch")).toMatch(/min-width:\s*0/); + expect(rule(".palette-trigger")).toMatch(/min-width:\s*0/); + expect(rule(".ui-btn-icon, .icon-button")).toMatch(/flex-shrink:\s*0/); + }); + + it("keeps rails, inspector, transcript, and composer shrinkable", () => { + expect(rule(".navigation, .inspector")).toMatch(/min-width:\s*0/); + expect(rule(".navigation")).toMatch(/min-width:\s*0/); + expect(rule(".navigation")).toMatch(/overflow:\s*hidden/); + expect(rule(".inspector")).toMatch(/min-width:\s*0/); + expect(rule(".inspector")).toMatch(/overflow:\s*hidden/); + expect(rule(".inspector-body")).toMatch(/min-width:\s*0/); + expect(rule(".inspector-body")).toMatch(/min-height:\s*0/); + expect(rule("main")).toMatch(/min-width:\s*0/); + expect(rule("main")).toMatch(/overflow:\s*hidden/); + expect(rule(".transcript")).toMatch(/min-width:\s*0/); + expect(rule(".transcript")).toMatch(/overflow:\s*auto/); + expect(rule(".composer")).toMatch(/min-width:\s*0/); + expect(rule(".composer-bar")).toMatch(/flex-wrap:\s*wrap/); + expect(rule(".composer-bar")).toMatch(/min-width:\s*0/); + expect(rule(".composer-bar > span")).toMatch(/flex-wrap:\s*wrap/); + expect(rule(".composer-send")).toMatch(/flex-shrink:\s*0/); + }); + + it("lets Code explorer, Team, and settings dialogs shrink or wrap", () => { + expect(rule(".code-explorer")).toMatch(/min-width:\s*0/); + expect(rule(".code-explorer-body")).toMatch(/minmax\(0,\s*240px\)\s+minmax\(0,\s*1fr\)/); + expect(rule(".code-explorer-body")).toMatch(/min-width:\s*0/); + expect(rule(".code-sidebar")).toMatch(/min-width:\s*0/); + expect(rule(".code-search")).toMatch(/min-width:\s*0/); + expect(rule(".code-search input")).toMatch(/min-width:\s*0/); + expect(rule(".team-workspace")).toMatch(/min-width:\s*0/); + expect(rule(".team-workspace-head")).toMatch(/flex-wrap:\s*wrap/); + expect(rule(".team-workspace-head")).toMatch(/min-width:\s*0/); + expect(rule(".team-detail header")).toMatch(/flex-wrap:\s*wrap/); + expect(rule(".settings-dialog")).toMatch(/min-width:\s*0/); + expect(rule(".settings-form fieldset label")).toMatch(/minmax\(0,\s*140px\)\s+minmax\(0,\s*1fr\)/); + expect(rule(".settings-form fieldset label")).toMatch(/min-width:\s*0/); + expect(css).toMatch(/\.settings-form fieldset label\s*\{\s*grid-template-columns:\s*minmax\(0,\s*1fr\)/); + }); + + it("keeps the phone mode bar visible after the desktop hide rule", () => { + expect(rule('.app-shell[data-shell="phone"]')).toMatch(/grid-template:\s*auto\s+minmax\(0,\s*1fr\)\s+auto/); + expect(css).toMatch(/@media \(max-width: 599px\)[\s\S]*\.palette-trigger kbd\s*\{\s*display:\s*none/); + const hide = css.lastIndexOf(".mode-bottom-bar { display: none; }"); + const show = css.lastIndexOf('.app-shell[data-shell="phone"] .mode-bottom-bar'); + expect(hide).toBeGreaterThan(-1); + expect(show).toBeGreaterThan(hide); + expect(rule('.app-shell[data-shell="phone"] .mode-bottom-bar')).toMatch(/display:\s*flex/); + }); + + it("keeps desktop 1280 and phone 360 on opposite sides of the shell breakpoints", () => { + expect(1280).toBeGreaterThan(SHELL_BREAKPOINTS.tabletMax); + expect(360).toBeLessThanOrEqual(SHELL_BREAKPOINTS.phoneMax); + }); +});