@goldenlustre/agent-studio 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +5 -5
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.js +1 -1
- package/.next/required-server-files.json +1 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/app-update/route.js +1 -1
- package/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
- package/.next/server/app/dashboard.html +1 -1
- package/.next/server/app/dashboard.rsc +3 -3
- package/.next/server/app/dashboard.segments/_full.segment.rsc +3 -3
- package/.next/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/dashboard.segments/dashboard/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +4 -4
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +2 -2
- package/.next/server/app/login.segments/_full.segment.rsc +2 -2
- package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/page.js +2 -2
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +5 -5
- package/.next/server/chunks/6763.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/6210-25387318cf08f9ac.js +1 -0
- package/.next/static/chunks/app/{layout-1c894a9ed80f6c37.js → layout-122ba415116b228a.js} +1 -1
- package/.next/static/chunks/app/{page-87a6d3433302904d.js → page-e6777d803bacfae9.js} +2 -2
- package/.next/trace +39 -41
- package/.next/trace-build +1 -1
- package/package.json +1 -1
- package/.next/static/chunks/6210-c32a36a8be764701.js +0 -1
- /package/.next/static/{4P8ZaTlYayjQDjQClWJy6 → Q5qAKqQm7gIeAZrKS_iN_}/_buildManifest.js +0 -0
- /package/.next/static/{4P8ZaTlYayjQDjQClWJy6 → Q5qAKqQm7gIeAZrKS_iN_}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6210],{17709:(e,t,r)=>{r.d(t,{OW:()=>i,QZ:()=>a,TU:()=>s,wy:()=>n});var o=r(65215);function n(e,t=new Set,r=new Set){let i=new Map;for(let n of e){let e=(0,o._A)(n);if(!e)continue;let a=n.projectRoot??n.cwd;if(!a)continue;let s=i.get(e);s||(s={id:e,name:function(e){let t=e.replace(/[\\/]+$/,""),r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return(r>=0?t.slice(r+1):t)||t||e}(a),path:a,createdAt:n.created,lastAccessed:n.modified,sessionCount:0,runningCount:0,unreadCount:0,status:"idle",gitBranch:n.branch,isFavorite:!1,messageTotal:0,worktreeCount:0,worktrees:[],subagentCount:0,earliestCreated:n.created,lastTitleAt:"",lastTitleIsSubagent:!1},i.set(e,s));let l=n.relation?.kind==="subagent";s.sessionCount+=1,s.messageTotal+=Number.isFinite(n.messageCount)?n.messageCount:0,n.modified>s.lastAccessed&&(s.lastAccessed=n.modified),n.created<s.earliestCreated&&(s.earliestCreated=n.created),l&&(s.subagentCount+=1),t.has(n.id)&&(s.runningCount+=1),r.has(n.id)&&(s.unreadCount+=1),!s.gitBranch&&n.branch&&(s.gitBranch=n.branch),n.cwd&&!s.worktrees.includes(n.cwd)&&s.worktrees.push(n.cwd);let d=function(e){let t=e.name?.trim();if(t)return t;let r=e.firstMessage?.trim().replace(/\s+/g," ");if(r)return r.length>80?`${r.slice(0,80)}…`:r}(n);d&&(!s.lastSessionTitle||s.lastTitleIsSubagent&&!l||s.lastTitleIsSubagent===l&&n.modified>s.lastTitleAt)&&(s.lastSessionTitle=d,s.lastTitleAt=n.modified,s.lastTitleIsSubagent=l)}return[...i.values()].map(e=>{let t=e.worktrees.filter(t=>t!==e.path).sort(),r={id:e.id,name:e.name,path:e.path,createdAt:e.earliestCreated,lastAccessed:e.lastAccessed,sessionCount:e.sessionCount,runningCount:e.runningCount,unreadCount:e.unreadCount,status:e.runningCount>0?"active":"idle",isFavorite:e.isFavorite,messageTotal:e.messageTotal,worktreeCount:t.length+1,worktrees:t,subagentCount:e.subagentCount};return e.gitBranch&&(r.gitBranch=e.gitBranch),e.lastSessionTitle&&(r.lastSessionTitle=e.lastSessionTitle),r}).sort((e,t)=>t.lastAccessed.localeCompare(e.lastAccessed))}function i(e,t){switch(t){case"active":return e.filter(e=>e.runningCount>0);case"unread":return e.filter(e=>e.unreadCount>0);default:return[...e]}}function a(e,t){let r=t.trim().toLowerCase();return r?e.filter(e=>e.name.toLowerCase().includes(r)||(e.alias?.toLowerCase().includes(r)??!1)||(e.note?.toLowerCase().includes(r)??!1)||e.path.toLowerCase().includes(r)||(e.lastSessionTitle?.toLowerCase().includes(r)??!1)):[...e]}function s(e,t,r){let o=[...e];return o.sort((e,o)=>{let n;switch(t){case"name":n=l(e).localeCompare(l(o));break;case"sessionCount":n=e.sessionCount-o.sessionCount;break;case"runningCount":n=e.runningCount-o.runningCount;break;case"messageTotal":n=e.messageTotal-o.messageTotal;break;default:n=e.lastAccessed.localeCompare(o.lastAccessed)}return"desc"===r?-n:n}),o}function l(e){return(e.alias?.trim()||e.name).toLowerCase()}},19190:(e,t,r)=>{r.d(t,{HL:()=>g,Jn:()=>d,QJ:()=>v,as:()=>p,b2:()=>b,eG:()=>h,m5:()=>c,qs:()=>f,wx:()=>x});var o=r(79617),n=r.n(o),i=r(41463);let a=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\..*)?$/i,s=/[<>:"|?*]/,l=/[\u0000-\u001f\u007f]/;function d(e){let t=e.trim();return!!t&&(t.startsWith("/")||t.startsWith("~")||t.startsWith("./")||t.startsWith("../")||t.includes("/")||t.includes("\\")||/^[a-zA-Z]:/.test(t))}function c(e){let t=e.replace(/[\\/]+$/,""),r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return(r>=0?t.slice(r+1):t)||e}function u(e){return/^[a-zA-Z]:[\\/]/.test(e)||e.startsWith("\\\\")}function p(e,t){return(u(e)?n().win32:n().posix).join(e,t)}function h(e,t=i.platform){let r=e.trim();if(!r)return{ok:!1,error:"empty"};if(r.includes("/")||r.includes("\\"))return{ok:!1,error:"separator"};if("."===r||".."===r)return{ok:!1,error:"relative"};if(l.test(r))return{ok:!1,error:"control"};if(r.length>255)return{ok:!1,error:"tooLong"};if("win32"===t){if(s.test(r))return{ok:!1,error:"windowsChars"};if(a.test(r))return{ok:!1,error:"windowsReserved"};if(/[. ]$/.test(r))return{ok:!1,error:"windowsChars"}}return{ok:!0,name:r}}function x(e,t,r=8){let o=new Set(t),n=new Map;for(let t of e){let e=t.modified??"";for(let r of[t.projectRoot??void 0,t.cwd]){if(!r||o.has(r))continue;let t=n.get(r);t?(t.count+=1,e>t.modified&&(t.modified=e)):n.set(r,{modified:e,count:1})}}return[...n.entries()].sort((e,t)=>t[1].modified.localeCompare(e[1].modified)).slice(0,r).map(([e,t])=>({path:e,label:c(e),hint:String(t.count),kind:"recent"}))}function g(e,t=3){let r=new Set,o=[];for(let i of e){if(!i)continue;let e=u(i)?n().win32.dirname(i):n().posix.dirname(i);if(e&&e!==i&&"."!==e&&"/"!==e&&!r.has(e)&&(r.add(e),o.push(e),o.length>=t))break}return o}function b(e){return!!(!e||e.startsWith("."))||"node_modules"===e||"__pycache__"===e||"dist"===e||"build"===e}function f(e,t){let r=t.trim().toLowerCase();return r?e.filter(e=>e.label.toLowerCase().includes(r)||e.path.toLowerCase().includes(r)):[...e]}function v(e,t=[]){let r=new Set(t),o=new Set,n=[];for(let t of e)!t.path||r.has(t.path)||o.has(t.path)||(o.add(t.path),n.push(t));return n}},65215:(e,t,r)=>{r.d(t,{O$:()=>l,Vi:()=>a,_A:()=>d,tu:()=>s});let o="pi-web:last-open-by-workspace";function n(){try{return window.localStorage}catch{return null}}function i(e){let t=e.getItem(o);if(!t)return{};try{let e=JSON.parse(t);return null===e||"object"!=typeof e||Array.isArray(e)?{}:e}catch{return{}}}function a(e,t=n()){if(!t)return null;try{let r=i(t)[e];return"string"==typeof r&&r.length>0?r:null}catch{return null}}function s(e,t,r=n()){if(r)try{let n=i(r);n[e]=t,r.setItem(o,JSON.stringify(n))}catch{}}function l(e,t=n()){if(t)try{let r=i(t);if(!(e in r))return;delete r[e],0===Object.keys(r).length?t.removeItem(o):t.setItem(o,JSON.stringify(r))}catch{}}function d(e){return e.projectKey??e.projectRoot??e.cwd}},96210:(e,t,r)=>{r.d(t,{wo:()=>R,JE:()=>O,wy:()=>T.wy});var o=r(95155),n=r(12115);let i="agent-studio:project-meta",a="agent-studio:project-favorites";function s(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function l(e){return"string"==typeof e&&e.trim().length>0?e:void 0}function d(e,t,r){let o={...e},n={...o[t]};for(let e of["alias","note","color"]){if(!(e in r))continue;let t=l(r[e]);void 0===t?delete n[e]:n[e]=t}return"favorite"in r&&(r.favorite?n.favorite=!0:delete n.favorite),0===Object.keys(n).length?delete o[t]:o[t]=n,o}function c(e){return e.alias?.trim()||e.name}function u(){try{return window.localStorage}catch{return null}}function p(e){let t=u();if(t)try{t.setItem(i,JSON.stringify(e)),t.removeItem(a)}catch{}}var h=r(21278),x=r(2730);let g={display:"flex",alignItems:"center",justifyContent:"center",width:22,height:22,padding:0,background:"none",border:"none",borderRadius:5,cursor:"pointer"};function b({label:e,value:t}){return(0,o.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,whiteSpace:"nowrap"},children:[(0,o.jsx)("span",{style:{color:"var(--text-dim)"},children:e}),(0,o.jsx)("span",{style:{color:"var(--text-muted)",fontVariantNumeric:"tabular-nums"},children:t})]})}function f({projects:e,selectedProjects:t,onSelectProject:r,onToggleFavorite:i,onSelectionChange:a,onEditProject:s,onContextMenu:l}){let{locale:d,t:u}=(0,h.s)(),[p,v]=(0,n.useState)(null),[j,m]=(0,n.useState)(null);return(0,o.jsx)("div",{"data-testid":"project-grid",style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(230px, 1fr))",gap:10},children:e.map(e=>{let n=t.includes(e.id),h=p===e.id,f=c(e),y=e.note||e.lastSessionTitle;return(0,o.jsxs)("div",{"data-testid":"project-card","data-project-id":e.id,role:"button",tabIndex:0,"aria-label":u("projectDashboard.ctxOpen")+": "+f,onMouseEnter:()=>v(e.id),onMouseLeave:()=>v(null),onClick:()=>r(e),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||t.target===t.currentTarget&&(t.preventDefault(),r(e))},onContextMenu:t=>l(e,t),style:{position:"relative",padding:11,background:"var(--bg-panel)",border:`1px solid ${n?"var(--accent)":"var(--border)"}`,borderRadius:9,cursor:"pointer",transition:"transform 0.15s, box-shadow 0.15s",transform:h?"translateY(-1px)":"none",boxShadow:h?"0 6px 16px rgba(0,0,0,0.14)":"none"},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,o.jsx)("input",{type:"checkbox",checked:n,title:u("projectDashboard.selectProject"),"aria-label":u("projectDashboard.selectProject"),onClick:e=>e.stopPropagation(),onChange:r=>{a(r.target.checked?[...t,e.id]:t.filter(t=>t!==e.id))},style:{width:14,height:14,marginTop:9,flexShrink:0,cursor:"pointer",opacity:h||n?1:.45}}),(0,o.jsx)("div",{style:{width:32,height:32,borderRadius:7,flexShrink:0,background:e.color||(e.runningCount>0?"var(--accent)":"var(--bg-subtle)"),color:e.color||e.runningCount>0?"white":"var(--text-muted)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:600},children:f.charAt(0).toUpperCase()}),(0,o.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4},children:[(0,o.jsx)("h3",{title:f,style:{margin:0,fontSize:13,fontWeight:600,color:"var(--text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:f}),e.alias&&(0,o.jsxs)("span",{style:{fontSize:10,color:"var(--text-dim)",flexShrink:0},children:["(",e.name,")"]})]}),(0,o.jsx)("p",{title:e.path,style:{margin:"1px 0 0",fontSize:10.5,color:"var(--text-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.path})]}),(0,o.jsxs)("div",{style:{display:"flex",gap:1,flexShrink:0},children:[(0,o.jsx)("button",{onClick:t=>{t.stopPropagation(),s(e)},"data-testid":"project-edit",title:u("projectDashboard.editProject"),"aria-label":u("projectDashboard.editProject"),style:{...g,color:"var(--text-muted)",opacity:+!!h},children:(0,o.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,o.jsx)("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})}),(0,o.jsx)("button",{onClick:t=>{t.stopPropagation(),i(e.id)},title:e.isFavorite?u("projectDashboard.removeFavorite"):u("projectDashboard.addFavorite"),"aria-label":e.isFavorite?u("projectDashboard.removeFavorite"):u("projectDashboard.addFavorite"),style:{...g,color:e.isFavorite?"#F59E0B":"var(--text-muted)",fontSize:14,lineHeight:1,opacity:e.isFavorite||h?1:0},children:e.isFavorite?"★":"☆"})]})]}),(y||e.gitBranch)&&(0,o.jsxs)("div",{style:{marginTop:8,display:"flex",flexDirection:"column",gap:4},children:[y&&(0,o.jsx)("p",{title:y,style:{margin:0,fontSize:11.5,color:"var(--text-muted)",lineHeight:1.35,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.note?y:`${u("projectDashboard.lastSession")}: ${y}`}),e.gitBranch&&(0,o.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10.5,color:"var(--text-dim)",minWidth:0},children:[(0,o.jsxs)("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[(0,o.jsx)("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),(0,o.jsx)("circle",{cx:"18",cy:"6",r:"3"}),(0,o.jsx)("circle",{cx:"6",cy:"18",r:"3"}),(0,o.jsx)("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),(0,o.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.gitBranch})]})]}),(0,o.jsxs)("div",{style:{marginTop:8,display:"flex",alignItems:"center",gap:5,flexWrap:"wrap"},children:[(0,o.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"1px 7px",borderRadius:999,fontSize:10.5,fontWeight:500,background:e.runningCount>0?"rgba(16,185,129,0.14)":"var(--bg-subtle)",color:e.runningCount>0?"#10B981":"var(--text-muted)"},children:[(0,o.jsx)("span",{style:{width:5,height:5,borderRadius:"50%",background:e.runningCount>0?"#10B981":"#6B7280"}}),e.runningCount>0?`${e.runningCount} ${u("projectDashboard.running")}`:u("projectDashboard.status.idle")]}),e.unreadCount>0&&(0,o.jsxs)("span",{style:{padding:"1px 7px",borderRadius:999,fontSize:10.5,fontWeight:500,background:"var(--bg-selected)",color:"var(--accent)"},children:[e.unreadCount," ",u("projectDashboard.unread")]})]}),(0,o.jsxs)("div",{style:{marginTop:8,paddingTop:8,borderTop:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,fontSize:10.5,flexWrap:"wrap"},children:[(0,o.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,o.jsx)(b,{label:u("projectDashboard.statSessions"),value:e.sessionCount}),(0,o.jsx)(b,{label:u("projectDashboard.statMessages"),value:e.messageTotal}),e.worktreeCount>1&&(0,o.jsxs)("button",{onClick:t=>{t.stopPropagation(),m(j===e.id?null:e.id)},style:{display:"inline-flex",alignItems:"center",gap:3,background:"none",border:"none",padding:0,cursor:"pointer",color:"var(--accent)",fontSize:10.5},children:[(0,o.jsx)(b,{label:u("projectDashboard.statWorktrees"),value:e.worktreeCount}),(0,o.jsx)("span",{style:{color:"var(--text-dim)"},children:j===e.id?"▾":"▸"})]}),e.subagentCount>0&&(0,o.jsx)(b,{label:u("projectDashboard.statSubagents"),value:e.subagentCount})]}),(0,o.jsx)("span",{title:e.lastAccessed,style:{color:"var(--text-dim)",whiteSpace:"nowrap"},children:(0,x.fw)(e.lastAccessed,d)})]}),j===e.id&&e.worktrees.length>0&&(0,o.jsx)("div",{style:{marginTop:6,display:"flex",flexDirection:"column",gap:2},children:e.worktrees.map(e=>(0,o.jsx)("div",{title:e,style:{fontSize:10.5,color:"var(--text-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingLeft:8,borderLeft:"2px solid var(--border)"},children:e},e))})]},e.id)})})}function v({projects:e,selectedProjects:t,onSelectProject:r,onToggleFavorite:i,onSelectionChange:a,onEditProject:s,onContextMenu:l}){let{locale:d,t:u}=(0,h.s)(),{ref:p,width:g}=function(){let e=(0,n.useRef)(null),[t,r]=(0,n.useState)(0);return(0,n.useEffect)(()=>{let t=e.current;if(!t||(r(t.getBoundingClientRect().width),"u"<typeof ResizeObserver))return;let o=new ResizeObserver(e=>{let t=e[0];t&&r(t.contentRect.width)});return o.observe(t),()=>o.disconnect()},[]),{ref:e,width:t}}(),[b,f]=(0,n.useState)(null),[j,m]=(0,n.useState)(null),y=0===g||g>=460,w=y?"28px minmax(0,1.4fr) minmax(0,1fr) 84px 48px 54px 44px 74px 30px":"28px minmax(0,1fr) 84px 44px 30px",k=e.length>0&&t.length===e.length,C={fontSize:10.5,fontWeight:600,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:.4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};return(0,o.jsxs)("div",{ref:p,"data-testid":"project-list",style:{background:"var(--bg-panel)",borderRadius:9,border:"1px solid var(--border)",overflow:"hidden"},children:[(0,o.jsxs)("div",{style:{display:"grid",gridTemplateColumns:w,gap:8,padding:"8px 12px",background:"var(--bg-subtle)",borderBottom:"1px solid var(--border)",alignItems:"center"},children:[(0,o.jsx)("div",{children:(0,o.jsx)("input",{type:"checkbox",checked:k,"aria-label":u("projectDashboard.selectAll"),onChange:t=>a(t.target.checked?e.map(e=>e.id):[]),style:{width:14,height:14,cursor:"pointer"}})}),(0,o.jsx)("div",{style:C,children:u("projectDashboard.project")}),y&&(0,o.jsx)("div",{style:C,children:u("projectDashboard.lastSession")}),(0,o.jsx)("div",{style:C,children:u("projectDashboard.statusLabel")}),(0,o.jsx)("div",{style:C,children:u("projectDashboard.statSessions")}),y&&(0,o.jsx)("div",{style:C,children:u("projectDashboard.statMessages")}),y&&(0,o.jsx)("div",{style:C,children:u("projectDashboard.statWorktrees")}),y&&(0,o.jsx)("div",{style:C,children:u("projectDashboard.lastAccessed")}),(0,o.jsx)("div",{})]}),e.map((n,p)=>{let h=t.includes(n.id),g=c(n),v=n.note||n.lastSessionTitle;return(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{"data-testid":"project-card","data-project-id":n.id,role:"button",tabIndex:0,"aria-label":u("projectDashboard.ctxOpen")+": "+g,onMouseEnter:()=>f(n.id),onMouseLeave:()=>f(null),onClick:()=>r(n),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||e.target===e.currentTarget&&(e.preventDefault(),r(n))},onContextMenu:e=>l(n,e),style:{display:"grid",gridTemplateColumns:w,gap:8,padding:"8px 12px",alignItems:"center",borderBottom:p<e.length-1||j===n.id?"1px solid var(--border)":"none",background:h?"var(--bg-selected)":b===n.id?"var(--bg-hover)":"transparent",cursor:"pointer",transition:"background 0.12s"},children:[(0,o.jsx)("div",{children:(0,o.jsx)("input",{type:"checkbox",checked:h,onClick:e=>e.stopPropagation(),onChange:e=>{a(e.target.checked?[...t,n.id]:t.filter(e=>e!==n.id))},style:{width:14,height:14,cursor:"pointer"}})}),(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[(0,o.jsx)("div",{style:{width:24,height:24,borderRadius:6,flexShrink:0,background:n.color||(n.runningCount>0?"var(--accent)":"var(--bg-subtle)"),color:n.color||n.runningCount>0?"white":"var(--text-muted)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:600},children:g.charAt(0).toUpperCase()}),(0,o.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4},children:[(0,o.jsx)("span",{style:{fontSize:12.5,fontWeight:500,color:"var(--text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g}),(0,o.jsx)("button",{onClick:e=>{e.stopPropagation(),s(n)},title:u("projectDashboard.editProject"),"aria-label":u("projectDashboard.editProject"),style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"var(--text-dim)",display:"flex",flexShrink:0,opacity:+(b===n.id)},children:(0,o.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,o.jsx)("path",{d:"M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"})})})]}),(0,o.jsx)("div",{title:n.path,style:{fontSize:10.5,color:"var(--text-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.path}),!y&&v&&(0,o.jsx)("div",{title:v,style:{fontSize:10.5,color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.note?v:`${u("projectDashboard.lastSession")}: ${v}`})]})]}),y&&(0,o.jsx)("div",{title:v,style:{fontSize:11.5,color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:v||"—"}),(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,fontSize:11,color:n.runningCount>0?"#10B981":"var(--text-muted)",minWidth:0},children:[(0,o.jsx)("span",{style:{width:5,height:5,borderRadius:"50%",background:n.runningCount>0?"#10B981":"#6B7280",flexShrink:0}}),(0,o.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.runningCount>0?`${n.runningCount} ${u("projectDashboard.running")}`:u("projectDashboard.status.idle")}),n.unreadCount>0&&(0,o.jsx)("span",{style:{color:"var(--accent)"},title:`${n.unreadCount} ${u("projectDashboard.unread")}`,children:"•"})]}),(0,o.jsx)("div",{style:{fontSize:11.5,color:"var(--text)",fontVariantNumeric:"tabular-nums"},children:n.sessionCount}),y&&(0,o.jsx)("div",{style:{fontSize:11.5,color:"var(--text)",fontVariantNumeric:"tabular-nums"},children:n.messageTotal}),y&&(0,o.jsxs)("div",{style:{fontSize:11.5,color:"var(--text-muted)",fontVariantNumeric:"tabular-nums",display:"flex",alignItems:"center",gap:3},children:[n.worktreeCount,n.worktreeCount>1&&(0,o.jsx)("button",{onClick:e=>{e.stopPropagation(),m(j===n.id?null:n.id)},"aria-label":u("projectDashboard.toggleWorktrees"),style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"var(--accent)",fontSize:10},children:j===n.id?"▾":"▸"})]}),y&&(0,o.jsx)("div",{title:n.lastAccessed,style:{fontSize:10.5,color:"var(--text-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(0,x.fw)(n.lastAccessed,d)}),(0,o.jsx)("div",{children:(0,o.jsx)("button",{onClick:e=>{e.stopPropagation(),i(n.id)},title:n.isFavorite?u("projectDashboard.removeFavorite"):u("projectDashboard.addFavorite"),"aria-label":n.isFavorite?u("projectDashboard.removeFavorite"):u("projectDashboard.addFavorite"),style:{background:"none",border:"none",cursor:"pointer",padding:0,color:n.isFavorite?"#F59E0B":"var(--text-muted)",fontSize:13,lineHeight:1},children:n.isFavorite?"★":"☆"})})]}),j===n.id&&n.worktrees.length>0&&(0,o.jsx)("div",{style:{padding:"6px 12px 8px 48px",background:"var(--bg-subtle)",display:"flex",flexDirection:"column",gap:2},children:n.worktrees.map(e=>(0,o.jsx)("div",{title:e,style:{fontSize:10.5,color:"var(--text-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e},e))})]},n.id)})]})}function j({stats:e,quickFilter:t,sortBy:r,sortOrder:n,onQuickFilterChange:i,onSortToggle:a}){let{t:s}=(0,h.s)(),l=e=>r===e?"desc"===n?"↓":"↑":void 0,d=[{key:"all",label:s("projectDashboard.chipProjects"),count:e.totalProjects,title:s("projectDashboard.chipProjectsHint"),active:"all"===t,onClick:()=>i("all")},{key:"active",label:s("projectDashboard.chipActive"),count:e.activeProjects,title:s("projectDashboard.chipActiveHint"),active:"active"===t,onClick:()=>i("active"===t?"all":"active")},{key:"unread",label:s("projectDashboard.chipUnread"),count:e.totalUnread,title:s("projectDashboard.chipUnreadHint"),active:"unread"===t,onClick:()=>i("unread"===t?"all":"unread")},{key:"sessions",label:s("projectDashboard.chipSessions"),count:e.totalSessions,title:s("projectDashboard.chipSessionsHint"),active:"all"===t&&"sessionCount"===r,onClick:()=>a("sessionCount"),sortIndicator:l("sessionCount")},{key:"messages",label:s("projectDashboard.chipMessages"),count:e.totalMessages,title:s("projectDashboard.chipMessagesHint"),active:"all"===t&&"messageTotal"===r,onClick:()=>a("messageTotal"),sortIndicator:l("messageTotal")}];return(0,o.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 16px",borderBottom:"1px solid var(--border)",overflowX:"auto",overflowY:"hidden",flexShrink:0,scrollbarWidth:"thin"},children:d.map(e=>(0,o.jsxs)("button",{onClick:e.onClick,"data-testid":`dashboard-chip-${e.key}`,title:e.title,"aria-pressed":e.active,style:{display:"inline-flex",alignItems:"center",gap:4,flexShrink:0,padding:"3px 9px",borderRadius:999,border:`1px solid ${e.active?"var(--accent)":"var(--border)"}`,background:e.active?"var(--bg-selected)":"var(--bg-panel)",color:e.active?"var(--accent)":"var(--text-muted)",fontSize:11,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap",transition:"background 0.12s, color 0.12s, border-color 0.12s"},children:[(0,o.jsx)("span",{children:e.label}),(0,o.jsx)("span",{style:{fontVariantNumeric:"tabular-nums"},children:e.count}),e.sortIndicator&&(0,o.jsx)("span",{"aria-hidden":!0,children:e.sortIndicator})]},e.key))})}function m({viewMode:e,sortBy:t,sortOrder:r,searchQuery:n,onViewModeChange:i,onSortChange:a,onSearchChange:s}){let{t:l}=(0,h.s)();return(0,o.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",padding:"8px 16px",borderBottom:"1px solid var(--border)",flexShrink:0,overflowX:"auto",overflowY:"hidden",scrollbarWidth:"thin"},children:[(0,o.jsxs)("div",{style:{position:"relative",width:148,flexShrink:0},children:[(0,o.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{position:"absolute",left:10,top:"50%",transform:"translateY(-50%)",color:"var(--text-muted)",pointerEvents:"none"},children:[(0,o.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,o.jsx)("path",{d:"M21 21l-4.35-4.35"})]}),(0,o.jsx)("input",{type:"text",placeholder:l("projectDashboard.searchPlaceholder"),value:n,onChange:e=>s(e.target.value),style:{width:"100%",padding:"7px 10px 7px 32px",background:"var(--bg-panel)",border:"1px solid var(--border)",borderRadius:7,fontSize:13,color:"var(--text)",outline:"none"}})]}),(0,o.jsxs)("select",{value:t,onChange:e=>a(e.target.value,r),title:l("projectDashboard.sortBy"),style:{padding:"7px 8px",background:"var(--bg-panel)",border:"1px solid var(--border)",borderRadius:7,fontSize:13,color:"var(--text)",cursor:"pointer",outline:"none",flexShrink:0},children:[(0,o.jsx)("option",{value:"lastAccessed",children:l("projectDashboard.sortLastAccessed")}),(0,o.jsx)("option",{value:"name",children:l("projectDashboard.sortName")}),(0,o.jsx)("option",{value:"sessionCount",children:l("projectDashboard.sortSessions")}),(0,o.jsx)("option",{value:"runningCount",children:l("projectDashboard.sortRunning")}),(0,o.jsx)("option",{value:"messageTotal",children:l("projectDashboard.sortMessages")})]}),(0,o.jsx)("button",{onClick:()=>a(t,"asc"===r?"desc":"asc"),title:l("asc"===r?"projectDashboard.ascending":"projectDashboard.descending"),style:{padding:7,background:"var(--bg-panel)",border:"1px solid var(--border)",borderRadius:7,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-muted)",flexShrink:0},children:(0,o.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:"asc"===r?"rotate(180deg)":"none",transition:"transform 0.2s"},children:(0,o.jsx)("path",{d:"M12 5v14M19 12l-7 7-7-7"})})}),(0,o.jsxs)("div",{style:{display:"flex",background:"var(--bg-panel)",border:"1px solid var(--border)",borderRadius:7,overflow:"hidden",flexShrink:0},children:[(0,o.jsx)("button",{onClick:()=>i("grid"),"data-testid":"view-mode-grid",title:l("projectDashboard.gridView"),style:{padding:"7px 9px",background:"grid"===e?"var(--accent)":"transparent",border:"none",cursor:"pointer",display:"flex",alignItems:"center",color:"grid"===e?"white":"var(--text-muted)"},children:(0,o.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,o.jsx)("rect",{x:"3",y:"3",width:"7",height:"7"}),(0,o.jsx)("rect",{x:"14",y:"3",width:"7",height:"7"}),(0,o.jsx)("rect",{x:"14",y:"14",width:"7",height:"7"}),(0,o.jsx)("rect",{x:"3",y:"14",width:"7",height:"7"})]})}),(0,o.jsx)("button",{onClick:()=>i("list"),"data-testid":"view-mode-list",title:l("projectDashboard.listView"),style:{padding:"7px 9px",background:"list"===e?"var(--accent)":"transparent",border:"none",borderLeft:"1px solid var(--border)",cursor:"pointer",display:"flex",alignItems:"center",color:"list"===e?"white":"var(--text-muted)"},children:(0,o.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,o.jsx)("line",{x1:"8",y1:"6",x2:"21",y2:"6"}),(0,o.jsx)("line",{x1:"8",y1:"12",x2:"21",y2:"12"}),(0,o.jsx)("line",{x1:"8",y1:"18",x2:"21",y2:"18"}),(0,o.jsx)("line",{x1:"3",y1:"6",x2:"3.01",y2:"6"}),(0,o.jsx)("line",{x1:"3",y1:"12",x2:"3.01",y2:"12"}),(0,o.jsx)("line",{x1:"3",y1:"18",x2:"3.01",y2:"18"})]})})]})]})}function y({x:e,y:t,items:r,onClose:i}){let a=(0,n.useRef)(null),[s,l]=(0,n.useState)({left:e,top:t});return(0,n.useLayoutEffect)(()=>{let r=a.current;if(!r)return;let o=r.getBoundingClientRect();l({left:Math.max(8,Math.min(e,Math.max(8,window.innerWidth-o.width-8))),top:Math.max(8,Math.min(t,Math.max(8,window.innerHeight-o.height-8)))})},[e,t]),(0,n.useEffect)(()=>{let e=()=>i(),t=e=>{"Escape"===e.key&&i()},r=e=>{a.current?.contains(e.target)||i()};return document.addEventListener("keydown",t),document.addEventListener("pointerdown",r,!0),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),window.addEventListener("blur",e),()=>{document.removeEventListener("keydown",t),document.removeEventListener("pointerdown",r,!0),window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e),window.removeEventListener("blur",e)}},[i]),(0,o.jsx)("div",{ref:a,"data-testid":"project-context-menu",role:"menu",style:{position:"fixed",left:s.left,top:s.top,zIndex:3200,minWidth:168,padding:4,background:"var(--bg-panel)",border:"1px solid var(--border)",borderRadius:8,boxShadow:"0 12px 32px rgba(0,0,0,0.32)",display:"flex",flexDirection:"column",gap:1},children:r.map(e=>(0,o.jsx)("button",{role:"menuitem",disabled:e.disabled,onClick:()=>{e.disabled||(e.onSelect(),i())},style:{display:"flex",alignItems:"center",gap:8,padding:"7px 10px",background:"none",border:"none",borderRadius:6,textAlign:"left",fontSize:13,color:e.disabled?"var(--text-dim)":e.danger?"#ef4444":"var(--text)",cursor:e.disabled?"default":"pointer",width:"100%"},onMouseEnter:t=>{e.disabled||(t.currentTarget.style.background=e.danger?"rgba(239,68,68,0.1)":"var(--bg-hover)")},onMouseLeave:e=>{e.currentTarget.style.background="none"},children:e.label},e.key))})}let w=["#3B82F6","#10B981","#F59E0B","#8B5CF6","#EC4899","#EF4444","#14B8A6","#6B7280"],k=globalThis;function C({title:e,onClose:t,children:r,wide:i,testId:a}){let[s]=(0,n.useState)(()=>Symbol("modal"));return(0,n.useEffect)(()=>{let e=(k.__agentStudioModalStack??=[],k.__agentStudioModalStack);e.push(s);let r=r=>{"Escape"!==r.key||e[e.length-1]===s&&t()};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r);let t=e.indexOf(s);t>=0&&e.splice(t,1)}},[s,t]),(0,o.jsx)("div",{onClick:t,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:3e3,padding:16},children:(0,o.jsxs)("div",{onClick:e=>e.stopPropagation(),"data-testid":a,role:"dialog","aria-modal":"true","aria-label":e,style:{background:"var(--bg-panel)",border:"1px solid var(--border)",borderRadius:12,width:"100%",maxWidth:i?560:420,maxHeight:"85vh",display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"0 18px 48px rgba(0,0,0,0.35)"},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid var(--border)",flexShrink:0},children:[(0,o.jsx)("h2",{style:{margin:0,fontSize:15,fontWeight:600,color:"var(--text)"},children:e}),(0,o.jsx)("button",{onClick:t,"aria-label":"Close",style:{background:"none",border:"none",cursor:"pointer",color:"var(--text-muted)",fontSize:20,lineHeight:1,padding:4},children:"\xd7"})]}),(0,o.jsx)("div",{style:{padding:16,overflowY:"auto"},children:r})]})})}let S={width:"100%",padding:"8px 10px",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:7,fontSize:13,color:"var(--text)",outline:"none",fontFamily:"inherit"},D={display:"block",fontSize:12,fontWeight:500,color:"var(--text-muted)",marginBottom:6};function z({project:e,meta:t,onSave:r,onClose:i}){let{t:a}=(0,h.s)(),[s,l]=(0,n.useState)(t.alias??""),[d,c]=(0,n.useState)(t.note??""),[u,p]=(0,n.useState)(t.color??"");return(0,o.jsxs)(C,{title:a("projectDashboard.editProject"),onClose:i,testId:"project-note-editor",children:[(0,o.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:14,wordBreak:"break-all"},children:e.path}),(0,o.jsxs)("div",{style:{marginBottom:14},children:[(0,o.jsx)("label",{style:D,htmlFor:"project-alias",children:a("projectDashboard.alias")}),(0,o.jsx)("input",{id:"project-alias","data-testid":"project-alias-input",value:s,onChange:e=>l(e.target.value),placeholder:e.name,style:S,autoFocus:!0}),(0,o.jsx)("div",{style:{fontSize:11,color:"var(--text-dim)",marginTop:4},children:a("projectDashboard.aliasHint")})]}),(0,o.jsxs)("div",{style:{marginBottom:14},children:[(0,o.jsx)("label",{style:D,htmlFor:"project-note",children:a("projectDashboard.note")}),(0,o.jsx)("textarea",{id:"project-note","data-testid":"project-note-input",value:d,onChange:e=>c(e.target.value),placeholder:a("projectDashboard.notePlaceholder"),rows:4,style:{...S,resize:"vertical",minHeight:80}})]}),(0,o.jsxs)("div",{style:{marginBottom:18},children:[(0,o.jsx)("span",{style:D,children:a("projectDashboard.color")}),(0,o.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[(0,o.jsx)("button",{onClick:()=>p(""),title:a("projectDashboard.colorDefault"),style:{width:26,height:26,borderRadius:6,cursor:"pointer",background:"var(--bg-subtle)",border:""===u?"2px solid var(--accent)":"1px solid var(--border)"}}),w.map(e=>(0,o.jsx)("button",{onClick:()=>p(e),title:e,style:{width:26,height:26,borderRadius:6,cursor:"pointer",background:e,border:u===e?"2px solid var(--text)":"1px solid var(--border)"}},e))]})]}),(0,o.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:8},children:[(0,o.jsx)("button",{onClick:()=>{r({alias:void 0,note:void 0,color:void 0}),i()},style:{padding:"7px 12px",background:"none",border:"1px solid var(--border)",borderRadius:7,color:"var(--text-muted)",fontSize:13,cursor:"pointer"},children:a("projectDashboard.clearMeta")}),(0,o.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,o.jsx)("button",{onClick:i,style:{padding:"7px 14px",background:"var(--bg-hover)",border:"1px solid var(--border)",borderRadius:7,color:"var(--text)",fontSize:13,cursor:"pointer"},children:a("projectDashboard.cancel")}),(0,o.jsx)("button",{onClick:()=>{r({alias:s.trim()||void 0,note:d.trim()||void 0,color:u||void 0}),i()},"data-testid":"project-save",style:{padding:"7px 14px",background:"var(--accent)",border:"none",borderRadius:7,color:"white",fontSize:13,fontWeight:500,cursor:"pointer"},children:a("projectDashboard.save")})]})]})]})}function I({projects:e,metaMap:t,onSave:r,onClose:i}){let{t:a}=(0,h.s)(),[s,l]=(0,n.useState)(null),d=e.filter(e=>t[e.id]?.note||t[e.id]?.alias||t[e.id]?.color).length;return(0,o.jsxs)(C,{title:a("projectDashboard.manageTitle"),onClose:i,wide:!0,testId:"project-settings-panel",children:[(0,o.jsx)("p",{style:{margin:"0 0 14px",fontSize:12,color:"var(--text-muted)"},children:a("projectDashboard.manageHint",{total:e.length,annotated:d})}),0===e.length?(0,o.jsx)("div",{style:{padding:"24px 0",textAlign:"center",color:"var(--text-muted)",fontSize:13},children:a("projectDashboard.noProjectsFound")}):(0,o.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:e.map(e=>{let r=t[e.id]??{};return(0,o.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:10,padding:10,border:"1px solid var(--border)",borderRadius:8,background:"var(--bg)"},children:[(0,o.jsx)("span",{style:{width:10,height:10,borderRadius:3,marginTop:4,flexShrink:0,background:r.color||"var(--accent)"}}),(0,o.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,o.jsx)("div",{style:{fontSize:13,fontWeight:500,color:"var(--text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c({...e,...r})}),(0,o.jsx)("div",{style:{fontSize:11,color:"var(--text-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e.path,children:e.path}),r.note&&(0,o.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)",marginTop:4,whiteSpace:"pre-wrap"},children:r.note})]}),(0,o.jsx)("button",{onClick:()=>l(e),style:{flexShrink:0,padding:"4px 10px",background:"var(--bg-hover)",border:"1px solid var(--border)",borderRadius:6,color:"var(--text)",fontSize:12,cursor:"pointer"},children:a("projectDashboard.edit")})]},e.id)})}),s&&(0,o.jsx)(z,{project:s,meta:t[s.id]??{},onSave:e=>r(s.id,e),onClose:()=>l(null)})]})}var T=r(17709);function M(e,t){try{window.localStorage.setItem(e,String(t))}catch{}}function R({projects:e,onSelectProject:t,onNewSessionInProject:r,onRequestCreateProject:c}){let{t:x}=(0,h.s)(),[g,b]=(0,n.useState)("grid"),[w,k]=(0,n.useState)("lastAccessed"),[C,S]=(0,n.useState)("desc"),[D,B]=(0,n.useState)(""),[W,A]=(0,n.useState)("all"),[L,E]=(0,n.useState)([]),[P,O]=(0,n.useState)(null),[F,H]=(0,n.useState)({});(0,n.useEffect)(()=>{H(function(){let e=u();if(!e)return{};let t=function(e){let t;if(!e)return{};try{t=JSON.parse(e)}catch{return{}}if(!s(t))return{};let r={};for(let[e,o]of Object.entries(t)){if(!s(o))continue;let t={},n=l(o.alias),i=l(o.note),a=l(o.color);void 0!==n&&(t.alias=n),void 0!==i&&(t.note=i),void 0!==a&&(t.color=a),"boolean"==typeof o.favorite&&(t.favorite=o.favorite),Object.keys(t).length>0&&(r[e]=t)}return r}(e.getItem(i)),r=function(e,t){let r;if(!t)return e;try{r=JSON.parse(t)}catch{return e}if(!Array.isArray(r))return e;let o=e;for(let e of r)"string"==typeof e&&0!==e.length&&(o[e]?.favorite||(o=d(o,e,{favorite:!0})));return o}(t,e.getItem(a));return r!==t&&p(r),r}())},[]);let N=(0,n.useRef)(null);(0,n.useEffect)(()=>()=>{null!==N.current&&window.clearTimeout(N.current)},[]);let[$,q]=(0,n.useState)(null),[_,J]=(0,n.useState)(!1),[U,Y]=(0,n.useState)(null),V=function({storageKey:e,defaultHeight:t,minTop:r,minBottom:o,maxTop:i,keyboardStep:a=16}){let s=(0,n.useRef)(null),l=(0,n.useRef)(null),d=(0,n.useRef)(t),c=(0,n.useRef)(!1),[u,p]=(0,n.useState)(t),[h,x]=(0,n.useState)(!1),g=(0,n.useCallback)(()=>{let e=s.current;return e?e.getBoundingClientRect().height:0},[]),b=(0,n.useCallback)(e=>(function(e,t){let{containerHeight:r,minTop:o,minBottom:n,maxTop:i}=t,a=Number.isFinite(e)?Math.round(e):o;if(!Number.isFinite(r)||r<=0)return Math.max(o,a);let s=Math.min(i??1/0,Math.max(o,r-n));return Math.round(Math.max(o,Math.min(s,a)))})(e,{containerHeight:g(),minTop:r,minBottom:o,maxTop:i}),[i,g,o,r]),f=(0,n.useCallback)((t,r=!0)=>{let o=b(t);return d.current=o,p(o),r&&M(e,o),o},[b,e]),v=(0,n.useCallback)(()=>{f(t)},[f,t]),j=(0,n.useCallback)(e=>{document.body.style.cursor=e.previousCursor,document.body.style.userSelect=e.previousUserSelect},[]),m=(0,n.useCallback)(t=>{let r=l.current;if(r&&r.pointerId===t){l.current=null,j(r),x(!1),M(e,d.current);try{r.target.hasPointerCapture(t)&&r.target.releasePointerCapture(t)}catch{}}},[j,e]),y=(0,n.useCallback)(e=>{if("mouse"===e.pointerType&&0!==e.button)return;e.preventDefault();let t=l.current;t&&m(t.pointerId);let r=e.currentTarget;r.focus({preventScroll:!0}),r.setPointerCapture(e.pointerId),l.current={pointerId:e.pointerId,startY:e.clientY,startHeight:d.current,target:r,previousCursor:document.body.style.cursor,previousUserSelect:document.body.style.userSelect},document.body.style.cursor="row-resize",document.body.style.userSelect="none",x(!0)},[m]),w=(0,n.useCallback)(e=>{let t=l.current;if(!t||t.pointerId!==e.pointerId)return;if("mouse"===e.pointerType&&0===e.buttons)return void m(e.pointerId);e.preventDefault();let r=b(t.startHeight+(e.clientY-t.startY));d.current=r,p(r),e.currentTarget.setAttribute("aria-valuenow",String(r)),e.currentTarget.setAttribute("aria-valuetext",`${r} px`)},[b,m]),k=(0,n.useCallback)(e=>{m(e.pointerId)},[m]),C=(0,n.useCallback)(e=>{let t=e.shiftKey?2*a:a;"ArrowDown"===e.key?(e.preventDefault(),f(d.current+t)):"ArrowUp"===e.key?(e.preventDefault(),f(d.current-t)):"Home"===e.key?(e.preventDefault(),f(r)):"End"===e.key?(e.preventDefault(),f(i??1/0)):"Enter"===e.key&&(e.preventDefault(),v())},[f,a,i,r,v]);(0,n.useEffect)(()=>{c.current||(c.current=!0,f(function(e){try{let t=window.localStorage.getItem(e);if(null===t)return null;let r=Number.parseInt(t,10);return Number.isFinite(r)?r:null}catch{return null}}(e)??t))},[f,t,e]),(0,n.useEffect)(()=>{let e=s.current;if(!e||"u"<typeof ResizeObserver)return;let t=new ResizeObserver(()=>{let e=b(d.current);e!==d.current&&(d.current=e,p(e))});return t.observe(e),()=>t.disconnect()},[b]),(0,n.useEffect)(()=>{if(!h)return;let e=()=>{let e=l.current;e&&m(e.pointerId)},t=()=>{"visible"!==document.visibilityState&&e()};return window.addEventListener("blur",e),document.addEventListener("visibilitychange",t),()=>{window.removeEventListener("blur",e),document.removeEventListener("visibilitychange",t)}},[m,h]),(0,n.useEffect)(()=>()=>{let e=l.current;e&&(l.current=null,j(e))},[j]);let S=Math.max(r,g()-o);return{containerRef:s,height:u,isResizing:h,setHeight:e=>{f(e)},resetHeight:v,separatorProps:{role:"separator",tabIndex:0,"aria-label":"Resize project details","aria-orientation":"horizontal","aria-valuemin":r,"aria-valuemax":S,"aria-valuenow":u,"aria-valuetext":`${u} px`,onDoubleClick:v,onKeyDown:C,onLostPointerCapture:k,onPointerCancel:k,onPointerDown:y,onPointerMove:w,onPointerUp:k}}}({storageKey:"agent-studio:project-dashboard-split",defaultHeight:132,minTop:40,minBottom:180}),K=V.height<=42,Q=(0,n.useCallback)((e,t)=>{let r=d(F,e,t);H(r),p(r)},[F]),X=(0,n.useCallback)(e=>{Q(e,{favorite:!F[e]?.favorite})},[Q,F]),Z=(0,n.useMemo)(()=>e.map(e=>{let t=F[e.id],r={...e,isFavorite:!!t?.favorite};return t?.alias&&(r.alias=t.alias),t?.note&&(r.note=t.note),t?.color&&(r.color=t.color),r}),[e,F]),G=(0,n.useMemo)(()=>{let e=Z.reduce((e,t)=>e+t.sessionCount,0),t=Z.reduce((e,t)=>e+t.messageTotal,0);return{totalProjects:Z.length,activeProjects:Z.filter(e=>e.runningCount>0).length,totalSessions:e,totalRunning:Z.reduce((e,t)=>e+t.runningCount,0),totalUnread:Z.reduce((e,t)=>e+t.unreadCount,0),totalMessages:t,averageSessionsPerProject:Z.length>0?e/Z.length:0,mostActiveProject:[...Z].sort((e,t)=>t.sessionCount-e.sessionCount)[0]}},[Z]),ee=(0,n.useMemo)(()=>(0,T.TU)((0,T.QZ)((0,T.OW)(Z,W),D),w,C),[Z,W,D,w,C]),et=(0,n.useMemo)(()=>new Map(Z.map(e=>[e.id,e])),[Z]),er=(0,n.useCallback)(e=>{A("all"),w===e?S(e=>"desc"===e?"asc":"desc"):(k(e),S("desc"))},[w]),eo=(0,n.useCallback)(e=>{O(e),null!==N.current&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>{N.current=null,O(null)},1600)},[]),en=(0,n.useCallback)(async e=>{try{if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(e),eo(x("projectDashboard.copied"));return}let t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let r=document.execCommand("copy");document.body.removeChild(t),eo(x(r?"projectDashboard.copied":"projectDashboard.copyFailed"))}catch{eo(x("projectDashboard.copyFailed"))}},[eo,x]),ei=U?et.get(U.projectId):void 0,ea=ei?[{key:"open",label:x("projectDashboard.ctxOpen"),onSelect:()=>t(ei)},{key:"new",label:x("projectDashboard.ctxNewSession"),disabled:!r,onSelect:()=>r?.(ei)},{key:"copy",label:x("projectDashboard.ctxCopyPath"),onSelect:()=>void en(ei.path)},{key:"edit",label:x("projectDashboard.ctxEdit"),onSelect:()=>q(ei.id)},{key:"fav",label:ei.isFavorite?x("projectDashboard.removeFavorite"):x("projectDashboard.addFavorite"),onSelect:()=>X(ei.id)}]:[],es=(0,n.useCallback)((e,t)=>{t.preventDefault(),t.stopPropagation(),Y({projectId:e.id,x:t.clientX,y:t.clientY})},[]),el=$?et.get($):void 0;return(0,o.jsxs)("div",{ref:V.containerRef,"data-testid":"project-dashboard",style:{display:"flex",flexDirection:"column",height:"100%",minHeight:0,overflow:"hidden"},children:[(0,o.jsxs)("div",{"data-testid":"dashboard-top-pane",style:{height:V.height,flexShrink:0,minHeight:0,overflowY:"auto",overflowX:"hidden",display:"flex",flexDirection:"column"},children:[(0,o.jsxs)("div",{style:{padding:"12px 16px 10px",display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8},children:[(0,o.jsxs)("div",{style:{minWidth:0},children:[(0,o.jsx)("h2",{style:{margin:0,fontSize:15,fontWeight:600,color:"var(--text)"},children:x("projectDashboard.title")}),(0,o.jsx)("p",{style:{margin:"2px 0 0",fontSize:12,color:"var(--text-muted)"},children:x("projectDashboard.subtitle")})]}),(0,o.jsxs)("div",{style:{display:"flex",gap:6,flexShrink:0},children:[(0,o.jsxs)("button",{onClick:c,"data-testid":"new-project-button",title:x("projectDashboard.newProject"),style:{display:"flex",alignItems:"center",gap:4,padding:"5px 9px",background:"var(--accent)",color:"white",border:"none",borderRadius:6,fontSize:12,fontWeight:500,cursor:"pointer"},children:[(0,o.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:(0,o.jsx)("path",{d:"M12 5v14M5 12h14"})}),x("projectDashboard.newProject")]}),(0,o.jsx)("button",{onClick:()=>J(!0),"data-testid":"project-settings-open",title:x("projectDashboard.manage"),"aria-label":x("projectDashboard.manage"),style:{display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,padding:0,background:"var(--bg-hover)",color:"var(--text-muted)",border:"1px solid var(--border)",borderRadius:6,cursor:"pointer"},children:(0,o.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,o.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,o.jsx)("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.6h.09A1.65 1.65 0 0 0 10.6 3.09V3a2 2 0 0 1 4 0v.09A1.65 1.65 0 0 0 16.11 4.6h.09a1.65 1.65 0 0 0 1.51-1.51l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 20.4 9v.09a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1Z"})]})}),(0,o.jsx)("button",{onClick:()=>V.setHeight(K?132:40),"data-testid":"dashboard-toggle-details",title:K?x("projectDashboard.expandDetails"):x("projectDashboard.collapseDetails"),"aria-label":K?x("projectDashboard.expandDetails"):x("projectDashboard.collapseDetails"),style:{display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,padding:0,background:"var(--bg-hover)",color:"var(--text-muted)",border:"1px solid var(--border)",borderRadius:6,cursor:"pointer"},children:(0,o.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:K?"rotate(180deg)":"none",transition:"transform 0.15s"},children:(0,o.jsx)("path",{d:"m6 15 6-6 6 6"})})})]})]}),(0,o.jsx)(j,{stats:G,quickFilter:W,sortBy:w,sortOrder:C,onQuickFilterChange:A,onSortToggle:er}),(0,o.jsx)(m,{viewMode:g,sortBy:w,sortOrder:C,searchQuery:D,onViewModeChange:b,onSortChange:(e,t)=>{k(e),S(t)},onSearchChange:B})]}),(0,o.jsx)("div",{...V.separatorProps,"data-testid":"dashboard-split-handle",title:x("projectDashboard.splitHint"),style:{height:10,flexShrink:0,cursor:"row-resize",display:"flex",alignItems:"center",justifyContent:"center",background:V.isResizing?"var(--bg-selected)":"transparent",borderTop:"1px solid var(--border)",borderBottom:"1px solid var(--border)",outline:"none",touchAction:"none"},children:(0,o.jsx)("div",{style:{width:44,height:3,borderRadius:2,background:V.isResizing?"var(--accent)":"var(--text-dim)",opacity:V.isResizing?1:.5,transition:"background 0.12s, opacity 0.12s"}})}),(0,o.jsxs)("div",{"data-testid":"dashboard-bottom-pane",style:{flex:1,minHeight:0,overflowY:"auto",padding:"12px 16px"},children:[(0,o.jsxs)("button",{type:"button","data-testid":"add-project-row",onClick:c,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:6,width:"100%",padding:"8px 10px",marginBottom:10,background:"none",border:"1px dashed var(--border)",borderRadius:8,color:"var(--text-muted)",fontSize:12.5,fontWeight:500,cursor:"pointer"},children:[(0,o.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:(0,o.jsx)("path",{d:"M12 5v14M5 12h14"})}),x("projectDashboard.addProjectRow")]}),"grid"===g?(0,o.jsx)(f,{projects:ee,selectedProjects:L,onSelectProject:t,onToggleFavorite:X,onSelectionChange:E,onEditProject:e=>q(e.id),onContextMenu:es}):(0,o.jsx)(v,{projects:ee,selectedProjects:L,onSelectProject:t,onToggleFavorite:X,onSelectionChange:E,onEditProject:e=>q(e.id),onContextMenu:es}),0===ee.length&&(0,o.jsxs)("div",{style:{textAlign:"center",padding:"32px 16px",color:"var(--text-muted)"},children:[(0,o.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",style:{marginBottom:10,opacity:.5},children:(0,o.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),(0,o.jsx)("h3",{style:{margin:"0 0 6px",fontSize:14,fontWeight:500},children:x("projectDashboard.noProjectsFound")}),(0,o.jsx)("p",{style:{margin:0,fontSize:12},children:x("projectDashboard.noProjectsHint")})]})]}),el&&(0,o.jsx)(z,{project:el,meta:F[el.id]??{},onSave:e=>Q(el.id,e),onClose:()=>q(null)}),_&&(0,o.jsx)(I,{projects:Z,metaMap:F,onSave:Q,onClose:()=>J(!1)}),ei&&(0,o.jsx)(y,{x:U?.x??0,y:U?.y??0,items:ea,onClose:()=>Y(null)}),P&&(0,o.jsx)("div",{role:"status",style:{position:"fixed",bottom:18,left:"50%",transform:"translateX(-50%)",padding:"7px 14px",background:"var(--bg-panel)",border:"1px solid var(--border)",borderRadius:999,fontSize:12,color:"var(--text)",boxShadow:"0 8px 24px rgba(0,0,0,0.28)",zIndex:3400,pointerEvents:"none"},children:P})]})}var B=r(19190);let W={padding:"7px 14px",background:"var(--accent)",border:"none",borderRadius:7,color:"white",fontSize:13,fontWeight:500,cursor:"pointer"},A={display:"inline-flex",alignItems:"center",gap:6,padding:"6px 10px",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:7,color:"var(--text)",fontSize:12.5,cursor:"pointer"},L={width:"100%",padding:"7px 10px",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:7,fontSize:13,color:"var(--text)",outline:"none",fontFamily:"inherit"},E={fontSize:10.5,fontWeight:600,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:.5,padding:"6px 9px 4px"},P={display:"flex",alignItems:"center",gap:8,width:"100%",padding:"7px 9px",background:"none",border:"1px solid transparent",borderRadius:7,cursor:"pointer",textAlign:"left"};function O({open:e,onClose:t,onSubmit:r,onBrowse:i,existingPaths:a,recentDirectories:s,startDirectory:l}){let{t:d}=(0,h.s)(),[c,u]=(0,n.useState)(""),[p,x]=(0,n.useState)([]),[g,b]=(0,n.useState)(!1),[f,v]=(0,n.useState)(0),[j,m]=(0,n.useState)(!1),[y,w]=(0,n.useState)(null),[k,S]=(0,n.useState)(null),[D,z]=(0,n.useState)(!1),[I,T]=(0,n.useState)(l),[M,R]=(0,n.useState)(""),F=(0,n.useRef)(null),H=(0,n.useMemo)(()=>(0,B.HL)([...a,...s.map(e=>e.path)],3),[a,s]),N=H.join("\0");(0,n.useEffect)(()=>{if(!e)return;u(""),v(0),w(null),S(null),z(!1),R(""),x([]),b(!1),T(l);let t=window.setTimeout(()=>F.current?.focus(),30);return()=>window.clearTimeout(t)},[e,l]);let $=(0,n.useRef)(a);$.current=a,(0,n.useEffect)(()=>{if(!e||0===N.length){x([]),b(!1);return}let t=!1;b(!0);let r=N.split("\0");return(async()=>{let e=new Set($.current),o=[];await Promise.all(r.map(async t=>{try{let r=await fetch(`/api/cwd/browse?path=${encodeURIComponent(t)}`);if(!r.ok)return;for(let t of(await r.json()).directories??[])!e.has(t.path)&&((0,B.b2)(t.name)||o.push({path:t.path,label:t.name,kind:"sibling"}))}catch{}})),t||(o.sort((e,t)=>e.label.localeCompare(t.label)),x(o),b(!1))})(),()=>{t=!0}},[e,N]);let q=(0,n.useMemo)(()=>(0,B.QJ)([{path:l,label:(0,B.m5)(l),kind:"recent"},...s,...H.map(e=>({path:e,label:(0,B.m5)(e),kind:"sibling"}))]),[l,s,H]),_=I||q[0]?.path||"",J=(0,n.useMemo)(()=>(0,B.qs)((0,B.QJ)([...s,...p],a),c),[s,p,a,c]),U=J.filter(e=>"recent"===e.kind),Y=J.filter(e=>"sibling"===e.kind),V=(0,B.Jn)(c)?c.trim():"",K=!!V&&0===J.length,Q=(0,n.useCallback)(async e=>{m(!0),w(null);try{let o=await fetch("/api/cwd/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e})}),n=await o.json().catch(()=>({}));if(o.ok&&n.cwd){r(n.cwd),t();return}let i=e.replace(/[\\/]+$/,""),a=Math.max(i.lastIndexOf("/"),i.lastIndexOf("\\"));if(a>0){let t=i.slice(0,a),r=i.slice(a+1);if((0,B.eG)(r).ok)return void S({parent:t,name:r,path:e})}w(n.error??d("projectDashboard.pathInvalid"))}catch(e){w(e instanceof Error?e.message:String(e))}finally{m(!1)}},[t,r,d]),X=(0,n.useCallback)(async(e,o)=>{let n=(0,B.eG)(o);if(!n.ok)return void w(d(function(e){switch(e){case"empty":return"projectDashboard.folderNameEmpty";case"separator":case"relative":return"projectDashboard.folderNameSeparator";default:return"projectDashboard.folderNameInvalid"}}(n.error)));m(!0),w(null);try{let o=await fetch("/api/cwd/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parent:e,name:n.name})}),i=await o.json().catch(()=>({}));if(!o.ok||!i.cwd)return void w(i.error??d("projectDashboard.folderCreateFailed"));r(i.cwd),t()}catch(e){w(e instanceof Error?e.message:String(e))}finally{m(!1)}},[t,r,d]),Z=(0,n.useCallback)(e=>{let t=J[e];t&&Q(t.path)},[J,Q]),G=(0,n.useCallback)(e=>{if("ArrowDown"===e.key)e.preventDefault(),v(e=>Math.min(e+1,Math.max(J.length-1,0)));else if("ArrowUp"===e.key)e.preventDefault(),v(e=>Math.max(e-1,0));else if("Enter"===e.key){if(e.preventDefault(),j)return;k?X(k.parent,k.name):J.length>0?Z(Math.min(f,J.length-1)):V?Q(V):D&&M.trim()&&X(_,M)}},[Z,f,j,X,_,J,D,M,V,k,Q]);if(!e)return null;let ee=(e,t)=>{let r=t===f;return(0,o.jsxs)("button",{type:"button","data-testid":"quick-create-candidate","data-candidate-path":e.path,onMouseEnter:()=>v(t),onClick:()=>Z(t),style:{...P,background:r?"var(--bg-selected)":"none",borderColor:r?"var(--accent)":"transparent"},children:[(0,o.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.3",style:{flexShrink:0,color:"var(--text-muted)"},children:(0,o.jsx)("path",{d:"M1.5 3h4l1.5 2h7.5v7.5h-13z"})}),(0,o.jsxs)("span",{style:{flex:1,minWidth:0},children:[(0,o.jsx)("span",{style:{display:"block",fontSize:13,color:"var(--text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),(0,o.jsx)("span",{style:{display:"block",fontSize:10.5,color:"var(--text-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.path})]}),e.hint&&(0,o.jsxs)("span",{style:{flexShrink:0,fontSize:10.5,color:"var(--text-dim)"},children:[e.hint," ",d("projectDashboard.sessions")]})]},e.path)};return(0,o.jsxs)(C,{title:d("projectDashboard.newProjectTitle"),onClose:t,wide:!0,testId:"quick-create-panel",children:[(0,o.jsx)("input",{ref:F,"data-testid":"quick-create-input",value:c,onChange:e=>{u(e.target.value),v(0),S(null)},onKeyDown:G,placeholder:d("projectDashboard.searchOrPath"),style:{...L,marginBottom:10}}),k&&(0,o.jsxs)("div",{"data-testid":"quick-create-confirm",style:{display:"flex",alignItems:"center",gap:8,padding:10,marginBottom:10,background:"var(--bg-subtle)",border:"1px solid var(--border)",borderRadius:8},children:[(0,o.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,o.jsx)("div",{style:{fontSize:12.5,color:"var(--text)"},children:d("projectDashboard.pathNotFound")}),(0,o.jsx)("div",{style:{fontSize:11,color:"var(--text-dim)",wordBreak:"break-all"},children:k.path})]}),(0,o.jsx)("button",{type:"button","data-testid":"quick-create-confirm-create",disabled:j,onClick:()=>void X(k.parent,k.name),style:{...W,opacity:j?.6:1},children:d("projectDashboard.createThisFolder")}),(0,o.jsx)("button",{type:"button",onClick:()=>S(null),style:A,children:d("projectDashboard.cancel")})]}),K&&!k&&(0,o.jsxs)("button",{type:"button","data-testid":"quick-create-use-path",onClick:()=>void Q(V),disabled:j,style:{...P,background:"var(--bg-selected)",borderColor:"var(--accent)",marginBottom:10},children:[(0,o.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.3",style:{flexShrink:0},children:(0,o.jsx)("path",{d:"M1.5 3h4l1.5 2h7.5v7.5h-13z"})}),(0,o.jsxs)("span",{style:{flex:1,minWidth:0},children:[(0,o.jsx)("span",{style:{display:"block",fontSize:12,color:"var(--text-muted)"},children:d("projectDashboard.useThisPath")}),(0,o.jsx)("span",{style:{display:"block",fontSize:12.5,color:"var(--text)",wordBreak:"break-all"},children:V})]}),(0,o.jsx)("span",{style:{flexShrink:0,fontSize:11,color:"var(--text-dim)"},children:"⏎"})]}),(0,o.jsxs)("div",{style:{maxHeight:300,overflowY:"auto"},children:[U.length>0&&(0,o.jsxs)("div",{style:{marginBottom:8},children:[(0,o.jsx)("div",{style:E,children:d("projectDashboard.recentUsed")}),U.map(e=>ee(e,J.indexOf(e)))]}),(Y.length>0||g)&&(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{style:E,children:d("projectDashboard.siblingDirs")}),g&&0===Y.length&&(0,o.jsx)("div",{style:{padding:"6px 9px",fontSize:12,color:"var(--text-dim)"},children:d("projectDashboard.scanning")}),Y.map(e=>ee(e,J.indexOf(e)))]}),0===J.length&&!K&&!k&&(0,o.jsx)("div",{style:{padding:"18px 8px",textAlign:"center",fontSize:12.5,color:"var(--text-muted)"},children:d("projectDashboard.noMatches")})]}),D&&(0,o.jsxs)("div",{"data-testid":"quick-create-folder-form",style:{marginTop:10,padding:10,background:"var(--bg-subtle)",border:"1px solid var(--border)",borderRadius:8,display:"flex",flexDirection:"column",gap:8},children:[(0,o.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,o.jsx)("select",{value:_,onChange:e=>T(e.target.value),"aria-label":d("projectDashboard.parentDir"),style:{...L,flex:1,cursor:"pointer"},children:q.map(e=>(0,o.jsx)("option",{value:e.path,children:e.path},e.path))}),(0,o.jsx)("input",{"data-testid":"quick-create-folder-name",value:M,onChange:e=>R(e.target.value),onKeyDown:G,placeholder:d("projectDashboard.folderName"),style:{...L,flex:1}})]}),(0,o.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:[(0,o.jsx)("button",{type:"button",onClick:()=>z(!1),style:A,children:d("projectDashboard.cancel")}),(0,o.jsx)("button",{type:"button","data-testid":"quick-create-folder-submit",disabled:j||!M.trim()||!_,onClick:()=>void X(_,M),style:{...W,opacity:j||!M.trim()?.6:1},children:d("projectDashboard.create")})]}),(0,o.jsx)("div",{style:{fontSize:11,color:"var(--text-dim)"},children:(0,B.as)(_,M.trim()||"…")})]}),y&&(0,o.jsx)("div",{"data-testid":"quick-create-error",style:{marginTop:10,fontSize:12,color:"#ef4444"},children:y}),(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,marginTop:12},children:[(0,o.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,o.jsxs)("button",{type:"button","data-testid":"quick-create-browse",onClick:i,style:A,children:[(0,o.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.3",children:(0,o.jsx)("path",{d:"M1.5 3h4l1.5 2h7.5v7.5h-13z"})}),d("projectDashboard.browse")]}),(0,o.jsxs)("button",{type:"button","data-testid":"quick-create-new-folder",onClick:()=>z(e=>!e),style:A,children:[(0,o.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:(0,o.jsx)("path",{d:"M12 5v14M5 12h14"})}),d("projectDashboard.newFolder")]})]}),(0,o.jsx)("span",{style:{fontSize:11,color:"var(--text-dim)",whiteSpace:"nowrap"},children:d("projectDashboard.keyboardHint")})]})]})}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{39979:()=>{},57788:(e,o,t)=>{"use strict";t.d(o,{PwaRegistration:()=>n});var r=t(12115);function n(){return(0,r.useEffect)(()=>{if(!("serviceWorker"in navigator))return;let e=()=>{let e=`/sw.js?v=${encodeURIComponent("1.0.
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{39979:()=>{},57788:(e,o,t)=>{"use strict";t.d(o,{PwaRegistration:()=>n});var r=t(12115);function n(){return(0,r.useEffect)(()=>{if(!("serviceWorker"in navigator))return;let e=()=>{let e=`/sw.js?v=${encodeURIComponent("1.0.2")}`;navigator.serviceWorker.register(e,{scope:"/",updateViaCache:"none"}).catch(e=>{console.error("Failed to register the AgentStudio service worker:",e)})};return"complete"===document.readyState?void e():(window.addEventListener("load",e,{once:!0}),()=>window.removeEventListener("load",e))},[]),null}},66872:()=>{},74924:(e,o,t)=>{Promise.resolve().then(t.bind(t,57788)),Promise.resolve().then(t.t.bind(t,83683,23)),Promise.resolve().then(t.t.bind(t,84559,23)),Promise.resolve().then(t.t.bind(t,66872,23)),Promise.resolve().then(t.t.bind(t,39979,23))},83683:e=>{e.exports={style:{fontFamily:"'Noto Sans Mono', 'Noto Sans Mono Fallback'",fontStyle:"normal"},className:"__className_66b8ca",variable:"__variable_66b8ca"}},84559:()=>{}},e=>{e.O(0,[7389,7513,8906,8441,3794,7358],()=>e(e.s=74924)),_N_E=e.O()}]);
|