@tom2012/cc-web 1.5.14 → 1.5.15
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/README.md +1 -1
- package/backend/dist/routes/sounds.d.ts.map +1 -1
- package/backend/dist/routes/sounds.js +7 -5
- package/backend/dist/routes/sounds.js.map +1 -1
- package/frontend/dist/assets/{index-Dg1NcsQH.js → index-Cr99sgtQ.js} +1 -1
- package/frontend/dist/index.html +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A self-hosted web application (and macOS Electron desktop app) that provides a browser-based interface for [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI sessions. Create projects, each with a persistent terminal running Claude Code, and interact with them through a real-time terminal UI.
|
|
4
4
|
|
|
5
|
-
**Current version**: v1.5.
|
|
5
|
+
**Current version**: v1.5.15 | [GitHub](https://github.com/zbc0315/cc-web) | MIT License
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sounds.d.ts","sourceRoot":"","sources":["../../src/routes/sounds.ts"],"names":[],"mappings":"AASA,QAAA,MAAM,MAAM,4CAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"sounds.d.ts","sourceRoot":"","sources":["../../src/routes/sounds.ts"],"names":[],"mappings":"AASA,QAAA,MAAM,MAAM,4CAAW,CAAC;AAsRxB,eAAe,MAAM,CAAC"}
|
|
@@ -273,11 +273,13 @@ router.get('/list', (req, res) => {
|
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
276
|
+
// Return flat array with source strings matching frontend format (e.g. "preset:rain", "global:file.mp3", "project:file.mp3")
|
|
277
|
+
const all = [
|
|
278
|
+
...downloadedPresets.map((p) => ({ ...p, source: `preset:${p.id}` })),
|
|
279
|
+
...globalCustoms.map((g) => ({ ...g, source: `global:${g.id}` })),
|
|
280
|
+
...projectSounds.map((ps) => ({ ...ps, source: `project:${ps.id}` })),
|
|
281
|
+
];
|
|
282
|
+
res.json(all);
|
|
281
283
|
});
|
|
282
284
|
exports.default = router;
|
|
283
285
|
//# sourceMappingURL=sounds.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sounds.js","sourceRoot":"","sources":["../../src/routes/sounds.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAoD;AACpD,uCAAyB;AACzB,2CAA6B;AAC7B,6CAA+B;AAC/B,2CAA6B;AAC7B,oDAA4B;AAE5B,sCAAkD;AAElD,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AASxB,MAAM,OAAO,GAAa;IACxB,EAAE,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE;IAC3E,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE;IAC1E,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE;IAChE,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE;IAChE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE;IACrE,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE;CACnE,CAAC;AAEF,MAAM,gBAAgB,GAAG,4DAA4D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AC,EAAE,EAAE,EAAE,CAAC,CAAC;QACrE,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACjE,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;KACtE,CAAC;IACF,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChB,CAAC,CAAC,CAAC;AAEH,kBAAe,MAAM,CAAC"}
|
|
@@ -393,7 +393,7 @@ Error generating stack: `+s.message+`
|
|
|
393
393
|
|
|
394
394
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
395
395
|
|
|
396
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},XB="DialogDescriptionWarning",ZB=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${fA(XB).contentName}}.`;return y.useEffect(()=>{var s;const i=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},QB=tA,JB=iA,gA=sA,mA=aA,bA=lA,_A=uA,e3=hA;const cl=QB,t3=JB,yA=y.forwardRef(({className:e,...t},n)=>h.jsx(gA,{ref:n,className:Q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));yA.displayName=gA.displayName;const ha=y.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(t3,{children:[h.jsx(yA,{}),h.jsxs(mA,{ref:r,className:Q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,h.jsxs(e3,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(rs,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ha.displayName=mA.displayName;const pa=({className:e,...t})=>h.jsx("div",{className:Q("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});pa.displayName="DialogHeader";const fa=({className:e,...t})=>h.jsx("div",{className:Q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});fa.displayName="DialogFooter";const ga=y.forwardRef(({className:e,...t},n)=>h.jsx(bA,{ref:n,className:Q("text-lg font-semibold leading-none tracking-tight",e),...t}));ga.displayName=bA.displayName;const ma=y.forwardRef(({className:e,...t},n)=>h.jsx(_A,{ref:n,className:Q("text-sm text-muted-foreground",e),...t}));ma.displayName=_A.displayName;function vA({onSelect:e}){const[t,n]=y.useState(""),[r,i]=y.useState(null),[s,a]=y.useState([]),[o,l]=y.useState(!0),[c,d]=y.useState(null),[u,p]=y.useState(!1),[f,g]=y.useState(""),[b,v]=y.useState(null),[m,_]=y.useState(!1),S=y.useRef(null),w=async L=>{l(!0),d(null);try{const A=await OT(L);n(A.path),i(A.parent),a(A.entries)}catch(A){d(A instanceof Error?A.message:"Failed to load directory")}finally{l(!1)}};y.useEffect(()=>{w()},[]),y.useEffect(()=>{u&&setTimeout(()=>{var L;return(L=S.current)==null?void 0:L.focus()},0)},[u]);const k=()=>{g(""),v(null),p(!0)},E=()=>{p(!1),g(""),v(null)},C=async()=>{const L=f.trim();if(L){_(!0),v(null);try{const{path:A}=await wP(t,L);p(!1),g(""),await w(t),w(A)}catch(A){v(A instanceof Error?A.message:"Failed to create folder")}finally{_(!1)}}},R=L=>{L.key==="Enter"?(L.preventDefault(),C()):L.key==="Escape"&&E()},F=t.split("/").filter(Boolean),N=L=>{const A="/"+F.slice(0,L+1).join("/");w(A)};return h.jsxs("div",{className:"flex flex-col h-64 border rounded-md overflow-hidden",children:[h.jsxs("div",{className:"flex items-center gap-1 px-2 py-2 bg-muted border-b flex-shrink-0",children:[h.jsx(te,{variant:"ghost",size:"sm",className:"h-6 px-1 flex-shrink-0",onClick:()=>void w(),title:"Home",children:h.jsx(JP,{className:"h-3 w-3"})}),h.jsx("div",{className:"flex items-center gap-1 flex-1 overflow-x-auto min-w-0",children:F.map((L,A)=>h.jsxs(ft.Fragment,{children:[h.jsx(wm,{className:"h-3 w-3 text-muted-foreground flex-shrink-0"}),h.jsx("button",{className:"text-xs hover:text-foreground text-muted-foreground whitespace-nowrap",onClick:()=>N(A),children:L})]},A))}),h.jsxs(te,{variant:"ghost",size:"sm",className:"h-6 px-1.5 flex-shrink-0 gap-1 text-xs",onClick:k,disabled:u||o||!!c,title:"New folder",children:[h.jsx(QP,{className:"h-3.5 w-3.5"}),h.jsx("span",{className:"hidden sm:inline",children:"New folder"})]})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto",children:[o&&h.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading..."}),c&&h.jsx("div",{className:"flex items-center justify-center h-full text-sm text-destructive px-4 text-center",children:c}),!o&&!c&&h.jsxs("div",{className:"p-1",children:[r&&h.jsxs("button",{className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded hover:bg-accent hover:text-accent-foreground",onClick:()=>void w(r),children:[h.jsx(uu,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("span",{children:".."})]}),u&&h.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5",children:[h.jsx(cf,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}),h.jsx("input",{ref:S,className:Q("flex-1 text-sm bg-background border rounded px-1.5 py-0.5 outline-none","focus:ring-1 focus:ring-ring",b&&"border-destructive"),placeholder:"Folder name",value:f,onChange:L=>{g(L.target.value),v(null)},onKeyDown:R,disabled:m}),h.jsx("button",{className:"p-1 rounded hover:bg-accent disabled:opacity-50",onClick:()=>void C(),disabled:!f.trim()||m,title:"Create",children:h.jsx(FT,{className:"h-3.5 w-3.5 text-green-600"})}),h.jsx("button",{className:"p-1 rounded hover:bg-accent",onClick:E,disabled:m,title:"Cancel",children:h.jsx(rs,{className:"h-3.5 w-3.5 text-muted-foreground"})})]}),b&&h.jsx("p",{className:"px-3 pb-1 text-xs text-destructive",children:b}),s.length===0&&!u&&h.jsx("div",{className:"text-sm text-muted-foreground px-2 py-4 text-center",children:"Empty directory"}),s.map(L=>h.jsxs("button",{className:Q("flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded text-left",L.type==="dir"?"hover:bg-accent hover:text-accent-foreground cursor-pointer":"opacity-40 cursor-not-allowed"),onClick:()=>{L.type==="dir"&&w(L.path)},disabled:L.type==="file",children:[L.type==="dir"?h.jsx(cf,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}):h.jsx(ZP,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),h.jsx("span",{className:"truncate",children:L.name})]},L.path))]})]}),h.jsxs("div",{className:"border-t px-3 py-2 flex items-center justify-between gap-2 flex-shrink-0 bg-background",children:[h.jsx("span",{className:"text-xs text-muted-foreground truncate flex-1",children:t}),h.jsx(te,{size:"sm",onClick:()=>e(t),disabled:!t,children:"Select this folder"})]})]})}const n3=[{value:"claude",label:"Claude",desc:"Anthropic Claude Code CLI"},{value:"opencode",label:"OpenCode",desc:"OpenCode CLI (sst/opencode)"},{value:"codex",label:"Codex",desc:"OpenAI Codex CLI"},{value:"qwen",label:"Qwen",desc:"Qwen Code CLI (QwenLM)"}],hx={claude:{limited:"claude",unlimited:"claude --dangerously-skip-permissions"},opencode:{limited:"opencode",unlimited:"opencode --dangerously-skip-permissions"},codex:{limited:"codex",unlimited:"codex --ask-for-approval never --sandbox danger-full-access"},qwen:{limited:"qwen-code",unlimited:"qwen-code --yolo"}};function r3({open:e,onOpenChange:t,onCreated:n}){const[r,i]=y.useState("name"),[s,a]=y.useState(""),[o,l]=y.useState(""),[c,d]=y.useState("claude"),[u,p]=y.useState("limited"),[f,g]=y.useState(!1),[b,v]=y.useState(null),m=()=>{i("name"),a(""),l(""),d("claude"),p("limited"),v(null),g(!1)},_=R=>{R||m(),t(R)},S=()=>{if(!s.trim()){v("Please enter a project name");return}v(null),i("folder")},w=R=>{l(R),i("settings")},k=async()=>{g(!0),v(null);try{const R=await cP({name:s.trim(),folderPath:o,permissionMode:u,cliTool:c});n(R),_(!1)}catch(R){v(R instanceof Error?R.message:"Failed to create project")}finally{g(!1)}},E={name:"New Project — Name",folder:"New Project — Select Folder",settings:"New Project — Settings"},C=["name","folder","settings"];return h.jsx(cl,{open:e,onOpenChange:_,children:h.jsxs(ha,{className:"sm:max-w-lg",children:[h.jsxs(pa,{children:[h.jsx(ga,{children:E[r]}),h.jsxs(ma,{children:[r==="name"&&"Give your project a name.",r==="folder"&&"Choose the working directory for this project.",r==="settings"&&"Choose the AI coding tool and run mode."]})]}),h.jsx("div",{className:"flex gap-2 mb-2",children:C.map((R,F)=>h.jsx("div",{className:`h-1.5 flex-1 rounded-full ${r===R?"bg-primary":C.indexOf(r)>F?"bg-primary/40":"bg-muted"}`},R))}),r==="name"&&h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Xe,{htmlFor:"project-name",children:"Project Name"}),h.jsx(gr,{id:"project-name",placeholder:"My Project",value:s,onChange:R=>a(R.target.value),onKeyDown:R=>{R.key==="Enter"&&S()},autoFocus:!0})]}),b&&h.jsx("p",{className:"text-sm text-destructive",children:b})]}),r==="folder"&&h.jsxs("div",{className:"space-y-2",children:[h.jsx(Xe,{children:"Working Directory"}),h.jsx(vA,{onSelect:w})]}),r==="settings"&&h.jsxs("div",{className:"space-y-5",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Xe,{children:"AI Coding Tool"}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:n3.map(R=>h.jsxs("label",{className:`flex items-center gap-2.5 cursor-pointer p-3 rounded-md border transition-colors ${c===R.value?"border-primary bg-primary/5":"hover:bg-accent"}`,children:[h.jsx("input",{type:"radio",name:"cliTool",value:R.value,checked:c===R.value,onChange:()=>d(R.value),className:"accent-primary"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:R.label}),h.jsx("div",{className:"text-xs text-muted-foreground",children:R.desc})]})]},R.value))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Xe,{children:"Permission Mode"}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-3 rounded-md border hover:bg-accent transition-colors",children:[h.jsx("input",{type:"radio",name:"permissionMode",value:"limited",checked:u==="limited",onChange:()=>p("limited"),className:"mt-0.5"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:"Limited"}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:["Runs ",h.jsx("code",{className:"bg-muted px-1 rounded",children:hx[c].limited})," — asks for permission before file changes."]})]})]}),h.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-3 rounded-md border hover:bg-accent transition-colors",children:[h.jsx("input",{type:"radio",name:"permissionMode",value:"unlimited",checked:u==="unlimited",onChange:()=>p("unlimited"),className:"mt-0.5"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:"Unlimited"}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:["Runs ",h.jsx("code",{className:"bg-muted px-1 rounded",children:hx[c].unlimited})," — acts autonomously."]})]})]})]})]}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:[h.jsx("span",{className:"font-medium",children:"Folder:"})," ",h.jsx("span",{className:"font-mono",children:o})]}),b&&h.jsx("p",{className:"text-sm text-destructive",children:b})]}),h.jsxs(fa,{children:[r!=="name"&&h.jsx(te,{variant:"outline",onClick:()=>i(r==="settings"?"folder":"name"),disabled:f,children:"Back"}),r==="name"&&h.jsx(te,{onClick:S,children:"Next"}),r==="folder"&&h.jsx(te,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),r==="settings"&&h.jsx(te,{onClick:()=>void k(),disabled:f,children:f?"Creating...":"Create Project"})]})]})})}function i3({open:e,onOpenChange:t,onOpened:n}){const[r,i]=y.useState(""),[s,a]=y.useState(!1),[o,l]=y.useState(null),c=()=>{i(""),l(null),a(!1)},d=p=>{p||c(),t(p)},u=async p=>{i(p),a(!0),l(null);try{const f=await uP(p);n(f),d(!1)}catch(f){l(f instanceof Error?f.message:"Failed to open project"),a(!1)}};return h.jsx(cl,{open:e,onOpenChange:d,children:h.jsxs(ha,{className:"sm:max-w-lg",children:[h.jsxs(pa,{children:[h.jsx(ga,{children:"Open Existing Project"}),h.jsxs(ma,{children:["Select a folder that contains a ",h.jsx("code",{className:"bg-muted px-1 rounded text-xs",children:".ccweb/"})," configuration. The project's history and settings will be restored."]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Xe,{children:"Project Folder"}),h.jsx(vA,{onSelect:p=>void u(p)})]}),o&&h.jsx("p",{className:"text-sm text-destructive",children:o}),r&&!o&&s&&h.jsxs("p",{className:"text-sm text-muted-foreground",children:["Opening project from ",r,"..."]}),h.jsx(fa,{children:h.jsx(te,{variant:"outline",onClick:()=>d(!1),disabled:s,children:"Cancel"})})]})})}function s3(e){if(!e)return"";const t=new Date(e).getTime()-Date.now();if(t<=0)return"即将重置";const n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return n>0?`${n}h${r}m`:`${r}m`}function Kl({label:e,bucket:t}){if(!t||t.utilization===void 0)return null;const n=t.utilization,r=n<50?"text-green-400":n<80?"text-yellow-400":"text-red-400",i=s3(t.resetAt);return h.jsxs("span",{className:"text-muted-foreground whitespace-nowrap",children:[e," ",h.jsxs("span",{className:Q("font-medium",r),children:[n,"%"]}),i&&h.jsxs("span",{className:"text-muted-foreground/70 ml-0.5",children:["(",i,")"]})]})}function SA({className:e}){const[t,n]=y.useState("loading"),[r,i]=y.useState(!1);y.useEffect(()=>{const u=async()=>{try{n(await vP())}catch{n(null)}};u();const p=setInterval(()=>void u(),5*60*1e3);return()=>clearInterval(p)},[]);const s=async()=>{i(!0);try{n(await SP())}catch{n(null)}finally{i(!1)}};if(t==="loading"||!t)return null;const a=!!t.fiveHour,o=!!t.sevenDay,l=!!t.sevenDaySonnet,c=!!t.sevenDayOpus,d=a||o||l||c;return h.jsxs("div",{className:Q("flex items-center gap-1.5 text-xs",e),children:[t.planName&&h.jsx("span",{className:"font-medium text-foreground bg-muted border border-border px-2 py-0.5 rounded-full",children:t.planName}),d&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"|"}),h.jsx(Kl,{label:"5h",bucket:t.fiveHour}),o&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(Kl,{label:"7d",bucket:t.sevenDay})]}),l&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(Kl,{label:"7d Sonnet",bucket:t.sevenDaySonnet})]}),c&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(Kl,{label:"7d Opus",bucket:t.sevenDayOpus})]})]}),h.jsx("button",{onClick:()=>void s(),className:"text-muted-foreground hover:text-foreground transition-colors",title:"刷新用量信息",children:h.jsx(Wi,{className:Q("h-3 w-3",r&&"animate-spin")})})]})}const px="v1.5.14",Yl=!!window.electronUpdater;function a3(e,t){const n=e.split(".").map(Number),r=t.split(".").map(Number);for(let i=0;i<Math.max(n.length,r.length);i++){const s=n[i]||0,a=r[i]||0;if(s!==a)return s-a}return 0}function o3(){const[e,t]=y.useState("idle"),[n,r]=y.useState(!1),[i,s]=y.useState(""),[a,o]=y.useState(0),[l,c]=y.useState([]),[d,u]=y.useState([]),[p,f]=y.useState(null),[g,b]=y.useState(null);y.useEffect(()=>window.electronUpdater?window.electronUpdater.onUpdateStatus(E=>{switch(E.type){case"progress":{const C=E.info;o(Math.round((C==null?void 0:C.percent)??0));break}case"downloaded":t("downloaded");break;case"error":f(E.info||"Download failed"),t("error");break}}):void 0,[]);const v=y.useCallback(async()=>{t("checking"),f(null),r(!0);try{if(Yl){const E=await window.electronUpdater.checkForUpdate();if(E.error)throw new Error(E.error);if(!E.available){t("no_update");return}s(E.version?`v${E.version}`:"new version")}else{const E=await fetch("https://api.github.com/repos/zbc0315/cc-web/releases/latest");if(E.status===404){t("no_update");return}if(!E.ok)throw new Error(`GitHub API ${E.status}`);const C=await E.json(),R=C.tag_name.replace(/^v/,""),F=px.replace(/^v/,"");if(a3(R,F)<=0){t("no_update");return}s(C.tag_name)}const k=await xP();c(k.projects),t(k.runningCount>0?"confirm_prepare":"update_available")}catch(k){f(k instanceof Error?k.message:"Check failed"),t("error")}},[]),m=async()=>{t("preparing");try{const k=await kP();u(k.results),t("update_available")}catch(k){f(k instanceof Error?k.message:"Prepare failed"),t("error")}},_=async()=>{if(Yl){t("downloading"),o(0);const k=await window.electronUpdater.downloadUpdate();k.success?k.path&&b(k.path):(f(k.error||"Download failed"),t("error"))}else window.open("https://github.com/zbc0315/cc-web/releases/latest","_blank")},S=()=>{var k;(k=window.electronUpdater)==null||k.quitAndInstall(g||void 0)},w=()=>{r(!1),setTimeout(()=>{t("idle"),s(""),c([]),u([]),f(null),o(0)},200)};return h.jsxs(h.Fragment,{children:[h.jsxs(te,{variant:"ghost",size:"sm",onClick:()=>void v(),disabled:e==="checking"||e==="preparing"||e==="downloading",children:[e==="checking"||e==="preparing"||e==="downloading"?h.jsx(Fi,{className:"h-4 w-4 mr-2 animate-spin"}):h.jsx(BT,{className:"h-4 w-4 mr-2"}),"Update"]}),h.jsx(cl,{open:n,onOpenChange:k=>{k||w()},children:h.jsxs(ha,{className:"sm:max-w-md",children:[h.jsxs(pa,{children:[h.jsxs(ga,{children:[e==="checking"&&"Checking for updates...",e==="no_update"&&"Up to date",e==="update_available"&&`Update ${i} available`,e==="confirm_prepare"&&"Save project memory first",e==="preparing"&&"Saving project memory...",e==="downloading"&&"Downloading update...",e==="downloaded"&&"Update ready to install",e==="error"&&"Update error"]}),h.jsxs(ma,{children:[e==="checking"&&"Checking for the latest version...",e==="no_update"&&`Current version ${px} is the latest.`,e==="update_available"&&(d.length>0?"All projects saved and stopped. Ready to update.":`A new version is available. ${Yl?"Click download to update automatically.":""}`),e==="confirm_prepare"&&`${l.length} project(s) running. Each Claude will be asked to save memory, then terminals will stop.`,e==="preparing"&&"Sending save commands and waiting for Claude to finish...",e==="downloading"&&`Downloading... ${a}%`,e==="downloaded"&&"The update has been downloaded. Click install to restart and apply.",e==="error"&&(p||"An error occurred.")]})]}),e==="downloading"&&h.jsx("div",{className:"w-full bg-muted rounded-full h-2 overflow-hidden",children:h.jsx("div",{className:"bg-primary h-full transition-all duration-300",style:{width:`${a}%`}})}),e==="confirm_prepare"&&l.length>0&&h.jsx("div",{className:"space-y-1 text-sm",children:l.map(k=>h.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded bg-muted",children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-green-500 shrink-0"}),h.jsx("span",{className:"truncate",children:k.name})]},k.id))}),e==="preparing"&&h.jsx("div",{className:"flex items-center justify-center py-6",children:h.jsx(Fi,{className:"h-8 w-8 animate-spin text-muted-foreground"})}),e==="update_available"&&d.length>0&&h.jsx("div",{className:"space-y-1 text-sm",children:d.map(k=>h.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded bg-muted",children:[k.status==="stopped"?h.jsx(VP,{className:"h-4 w-4 text-green-500 shrink-0"}):h.jsx($P,{className:"h-4 w-4 text-yellow-500 shrink-0"}),h.jsx("span",{className:"truncate",children:k.name}),h.jsx("span",{className:"text-xs text-muted-foreground ml-auto shrink-0",children:k.message})]},k.id))}),h.jsxs(fa,{children:[e==="no_update"&&h.jsx(te,{onClick:w,children:"OK"}),e==="update_available"&&h.jsxs(h.Fragment,{children:[h.jsx(te,{variant:"outline",onClick:w,children:"Later"}),h.jsx(te,{onClick:()=>void _(),children:Yl?"Download & Install":`Download ${i}`})]}),e==="confirm_prepare"&&h.jsxs(h.Fragment,{children:[h.jsx(te,{variant:"outline",onClick:w,children:"Cancel"}),h.jsx(te,{onClick:()=>void m(),children:"Save Memory & Stop All"})]}),e==="downloaded"&&h.jsxs(h.Fragment,{children:[h.jsx(te,{variant:"outline",onClick:w,children:"Later"}),h.jsx(te,{onClick:S,children:"Restart & Install"})]}),e==="error"&&h.jsx(te,{onClick:w,children:"Close"})]})]})})]})}function l3(){const[e,t]=y.useState([]),[n,r]=y.useState(!1),[i,s]=y.useState(""),[a,o]=y.useState(""),[l,c]=y.useState(""),[d,u]=y.useState(null),[p,f]=y.useState(""),[g,b]=y.useState(""),[v,m]=y.useState(""),_=y.useRef(null),S=y.useRef(null);y.useEffect(()=>{IT().then(t).catch(()=>t([]))},[]),y.useEffect(()=>{n&&setTimeout(()=>{var C;return(C=_.current)==null?void 0:C.focus()},0)},[n]),y.useEffect(()=>{d&&setTimeout(()=>{var C;return(C=S.current)==null?void 0:C.focus()},0)},[d]);const w=async()=>{const C=a.trim();if(C)try{const R=await bP({label:i.trim()||C,command:C,...l?{parentId:l}:{}});t(F=>[...F,R]),s(""),o(""),c(""),r(!1)}catch(R){console.error("[GlobalShortcuts] Failed to add:",R)}},k=async C=>{try{await yP(C),t(R=>R.filter(F=>F.id!==C)),d===C&&u(null)}catch(R){console.error("[GlobalShortcuts] Failed to delete:",R)}},E=async()=>{const C=g.trim();if(!(!C||!d))try{const R=await _P(d,{label:p.trim()||C,command:C,parentId:v||null});t(F=>F.map(N=>N.id===d?R:N)),u(null)}catch(R){console.error("[GlobalShortcuts] Failed to save:",R)}};return h.jsxs("section",{className:"mt-10",children:[h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(du,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("h2",{className:"text-lg font-semibold",children:"全局快捷命令"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"在所有项目的终端中可用"})]}),h.jsxs("button",{onClick:()=>{r(C=>!C),u(null)},className:Q("flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-md border transition-colors",n?"border-border text-foreground bg-muted":"border-border text-muted-foreground hover:text-foreground hover:bg-muted"),children:[h.jsx(zo,{className:"h-3.5 w-3.5"}),"新建"]})]}),n&&h.jsxs("div",{className:"mb-4 p-4 rounded-lg border border-border bg-background space-y-3",children:[h.jsx("input",{ref:_,placeholder:"名称(可选)",value:i,onChange:C=>s(C.target.value),className:"w-full text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground placeholder:text-muted-foreground outline-none focus:border-border transition-colors"}),h.jsx("textarea",{placeholder:"命令内容…",value:a,onChange:C=>o(C.target.value),rows:3,className:"w-full text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground placeholder:text-muted-foreground font-mono outline-none focus:border-border transition-colors resize-none",onKeyDown:C=>{C.key==="Enter"&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),w()),C.key==="Escape"&&(r(!1),s(""),o(""),c(""))}}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Sc,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),h.jsxs("select",{value:l,onChange:C=>c(C.target.value),className:"flex-1 text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground outline-none focus:border-border transition-colors",children:[h.jsx("option",{value:"",children:"无继承"}),e.map(C=>h.jsx("option",{value:C.id,children:C.label},C.id))]})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-xs text-muted-foreground",children:"⌘↩ 保存 · Esc 取消"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{onClick:()=>{r(!1),s(""),o("")},className:"text-sm px-3 py-1 rounded bg-secondary hover:bg-accent text-foreground transition-colors",children:"取消"}),h.jsx("button",{onClick:()=>void w(),disabled:!a.trim(),className:Q("text-sm px-3 py-1 rounded transition-colors text-white",a.trim()?"bg-blue-600 hover:bg-blue-500":"bg-secondary opacity-40 cursor-not-allowed"),children:"保存"})]})]})]}),e.length===0&&!n?h.jsxs("div",{className:"flex flex-col items-center gap-2 py-10 text-muted-foreground/50 border border-dashed border-border rounded-lg",children:[h.jsx(du,{className:"h-6 w-6"}),h.jsx("p",{className:"text-sm",children:"还没有全局快捷命令"})]}):h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:e.map(C=>d===C.id?h.jsxs("div",{className:"rounded-lg border border-border bg-background p-3 space-y-2",children:[h.jsx("input",{ref:S,value:p,onChange:R=>f(R.target.value),placeholder:"名称(可选)",className:"w-full text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground placeholder:text-muted-foreground outline-none focus:border-border transition-colors"}),h.jsx("textarea",{value:g,onChange:R=>b(R.target.value),rows:3,className:"w-full text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground font-mono outline-none focus:border-border transition-colors resize-none",onKeyDown:R=>{R.key==="Enter"&&(R.metaKey||R.ctrlKey)&&(R.preventDefault(),E()),R.key==="Escape"&&u(null)}}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Sc,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),h.jsxs("select",{value:v,onChange:R=>m(R.target.value),className:"flex-1 text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground outline-none focus:border-border transition-colors",children:[h.jsx("option",{value:"",children:"无继承"}),e.filter(R=>R.id!==C.id).map(R=>h.jsx("option",{value:R.id,children:R.label},R.id))]})]}),h.jsxs("div",{className:"flex gap-2 justify-end",children:[h.jsx("button",{onClick:()=>u(null),className:"text-xs px-2.5 py-1 rounded bg-secondary hover:bg-accent text-foreground transition-colors",children:"取消"}),h.jsx("button",{onClick:()=>void E(),disabled:!g.trim(),className:Q("text-xs px-2.5 py-1 rounded transition-colors text-white",g.trim()?"bg-blue-600 hover:bg-blue-500":"bg-secondary opacity-40 cursor-not-allowed"),children:"保存"})]})]},C.id):h.jsxs("div",{className:"group relative rounded-lg border border-border bg-background hover:border-muted-foreground/30 transition-colors p-3",children:[h.jsx("div",{className:"text-sm font-medium text-foreground truncate pr-14",children:C.label}),C.parentId&&(()=>{const R=e.find(F=>F.id===C.parentId);return R?h.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[h.jsx(Sc,{className:"h-3 w-3 text-muted-foreground"}),h.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["继承: ",R.label]})]}):null})(),!C.parentId&&C.label!==C.command&&h.jsx("div",{className:"text-xs text-muted-foreground font-mono truncate mt-1 pr-14",children:C.command}),h.jsxs("div",{className:"absolute top-2.5 right-2.5 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[h.jsx("button",{onClick:()=>{u(C.id),f(C.label),b(C.command),m(C.parentId||""),r(!1)},className:"p-1 rounded text-muted-foreground hover:text-blue-400 transition-colors",title:"编辑",children:h.jsx(km,{className:"h-3.5 w-3.5"})}),h.jsx("button",{onClick:()=>void k(C.id),className:"p-1 rounded text-muted-foreground hover:text-red-400 transition-colors",title:"删除",children:h.jsx(rs,{className:"h-3.5 w-3.5"})})]})]},C.id))})]})}const wA=y.createContext({theme:"system",resolved:"dark",setTheme:()=>{}}),fx="cc_web_theme";function c3(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function u3(){return y.useSyncExternalStore(e=>{const t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},()=>c3())}function d3({children:e}){const[t,n]=y.useState(()=>{try{return localStorage.getItem(fx)||"system"}catch{return"system"}}),r=u3(),i=t==="system"?r:t;y.useEffect(()=>{const a=document.documentElement;a.classList.remove("light","dark"),a.classList.add(i)},[i]);const s=a=>{n(a);try{localStorage.setItem(fx,a)}catch{}};return h.jsx(wA.Provider,{value:{theme:t,resolved:i,setTheme:s},children:e})}function Im(){return y.useContext(wA)}function EA(){const{theme:e,setTheme:t}=Im(),n=[{value:"light",icon:dF,label:"浅色"},{value:"dark",icon:rF,label:"深色"},{value:"system",icon:nF,label:"系统"}];return h.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5",children:n.map(({value:r,icon:i,label:s})=>h.jsx("button",{onClick:()=>t(r),className:Q("p-1 rounded-sm transition-colors",e===r?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),title:s,children:h.jsx(i,{className:"h-3.5 w-3.5"})},r))})}function h3(){const e=ua(),[t,n]=y.useState([]),[r,i]=y.useState(!0),[s,a]=y.useState(null),[o,l]=y.useState(!1),[c,d]=y.useState(!1),[u,p]=y.useState(new Set),[f,g]=y.useState(!!document.fullscreenElement),[b,v]=y.useState(!1),m=()=>{document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen()};y.useEffect(()=>{const A=()=>g(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",A),()=>document.removeEventListener("fullscreenchange",A)},[]);const _=async()=>{try{const A=await RT();n(A)}catch(A){a(A instanceof Error?A.message:"Failed to load projects")}finally{i(!1)}};y.useEffect(()=>{_()},[]),y.useEffect(()=>{let I=null;const M=async()=>{if(!document.hidden)try{const D=await mP(),j=Date.now(),x=new Set(Object.entries(D).filter(([,$])=>typeof $=="number"&&j-$<2e3).map(([$])=>$));p(x)}catch{}},P=()=>{M(),I=setInterval(()=>void M(),2e3)},B=()=>{I&&(clearInterval(I),I=null)},U=()=>{document.hidden?B():P()};return P(),document.addEventListener("visibilitychange",U),()=>{B(),document.removeEventListener("visibilitychange",U)}},[]);const S=()=>{AT(),e("/login")},w=A=>{n(I=>[...I,A])},k=A=>{n(I=>[...I,A])},E=async A=>{try{await dP(A),n(I=>I.filter(M=>M.id!==A))}catch(I){alert(I instanceof Error?I.message:"Failed to delete project")}},C=async A=>{try{const I=await fP(A);n(M=>M.map(P=>P.id===A?I:P))}catch(I){alert(I instanceof Error?I.message:"Failed to archive project")}},R=async A=>{try{const I=await gP(A);n(M=>M.map(P=>P.id===A?I:P))}catch(I){alert(I instanceof Error?I.message:"Failed to restore project")}},F=t.filter(A=>!A.archived),N=t.filter(A=>A.archived),L={onDelete:A=>void E(A),onArchive:A=>void C(A),onUnarchive:A=>void R(A)};return h.jsxs("div",{className:"min-h-screen bg-background",children:[h.jsx("header",{className:"border-b sticky top-0 bg-background z-10",children:h.jsxs("div",{className:"max-w-6xl mx-auto px-4 h-14 flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(ZE,{className:"h-5 w-5"}),h.jsx("span",{className:"font-semibold text-lg",children:"CC Web"})]}),h.jsx(SA,{}),h.jsx(te,{variant:"ghost",size:"sm",onClick:()=>e("/settings"),title:"设置",children:h.jsx(cF,{className:"h-4 w-4"})}),h.jsx(o3,{}),h.jsx(te,{variant:"ghost",size:"sm",onClick:m,title:f?"Exit fullscreen":"Fullscreen",children:f?h.jsx(xm,{className:"h-4 w-4"}):h.jsx(Em,{className:"h-4 w-4"})}),h.jsx(EA,{}),h.jsxs(te,{variant:"ghost",size:"sm",onClick:S,children:[h.jsx(eF,{className:"h-4 w-4 mr-2"}),"Logout"]})]})}),h.jsxs("main",{className:"max-w-6xl mx-auto px-4 py-8",children:[h.jsxs("div",{className:"flex items-center justify-between mb-6",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Projects"}),h.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Each project runs Claude CLI in a dedicated terminal session."})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs(te,{variant:"outline",onClick:()=>d(!0),children:[h.jsx($o,{className:"h-4 w-4 mr-2"}),"Open Project"]}),h.jsxs(te,{onClick:()=>l(!0),children:[h.jsx(zo,{className:"h-4 w-4 mr-2"}),"New Project"]})]})]}),r&&h.jsx("div",{className:"text-center text-muted-foreground py-12",children:"Loading projects..."}),s&&h.jsx("div",{className:"text-center text-destructive py-12",children:s}),!r&&!s&&t.length===0&&h.jsxs("div",{className:"text-center py-20",children:[h.jsx(ZE,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),h.jsx("h2",{className:"text-lg font-semibold mb-2",children:"No projects yet"}),h.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Create a new project or open an existing one."}),h.jsxs("div",{className:"flex gap-2 justify-center",children:[h.jsxs(te,{variant:"outline",onClick:()=>d(!0),children:[h.jsx($o,{className:"h-4 w-4 mr-2"}),"Open Project"]}),h.jsxs(te,{onClick:()=>l(!0),children:[h.jsx(zo,{className:"h-4 w-4 mr-2"}),"New Project"]})]})]}),!r&&!s&&F.length>0&&h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:F.map(A=>h.jsx(JE,{project:A,active:u.has(A.id),...L},A.id))}),!r&&!s&&N.length>0&&h.jsxs("div",{className:"mt-10",children:[h.jsxs("button",{className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors mb-4 group",onClick:()=>v(A=>!A),children:[b?h.jsx(rd,{className:"h-4 w-4"}):h.jsx(wm,{className:"h-4 w-4"}),h.jsx("span",{className:"font-medium",children:"Archived"}),h.jsx("span",{className:"text-xs bg-muted rounded-full px-2 py-0.5",children:N.length})]}),b&&h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:N.map(A=>h.jsx(JE,{project:A,active:!1,...L},A.id))})]}),h.jsx(l3,{})]}),h.jsx(r3,{open:o,onOpenChange:l,onCreated:w}),h.jsx(i3,{open:c,onOpenChange:d,onOpened:k})]})}/**
|
|
396
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},XB="DialogDescriptionWarning",ZB=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${fA(XB).contentName}}.`;return y.useEffect(()=>{var s;const i=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},QB=tA,JB=iA,gA=sA,mA=aA,bA=lA,_A=uA,e3=hA;const cl=QB,t3=JB,yA=y.forwardRef(({className:e,...t},n)=>h.jsx(gA,{ref:n,className:Q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));yA.displayName=gA.displayName;const ha=y.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(t3,{children:[h.jsx(yA,{}),h.jsxs(mA,{ref:r,className:Q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,h.jsxs(e3,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(rs,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ha.displayName=mA.displayName;const pa=({className:e,...t})=>h.jsx("div",{className:Q("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});pa.displayName="DialogHeader";const fa=({className:e,...t})=>h.jsx("div",{className:Q("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});fa.displayName="DialogFooter";const ga=y.forwardRef(({className:e,...t},n)=>h.jsx(bA,{ref:n,className:Q("text-lg font-semibold leading-none tracking-tight",e),...t}));ga.displayName=bA.displayName;const ma=y.forwardRef(({className:e,...t},n)=>h.jsx(_A,{ref:n,className:Q("text-sm text-muted-foreground",e),...t}));ma.displayName=_A.displayName;function vA({onSelect:e}){const[t,n]=y.useState(""),[r,i]=y.useState(null),[s,a]=y.useState([]),[o,l]=y.useState(!0),[c,d]=y.useState(null),[u,p]=y.useState(!1),[f,g]=y.useState(""),[b,v]=y.useState(null),[m,_]=y.useState(!1),S=y.useRef(null),w=async L=>{l(!0),d(null);try{const A=await OT(L);n(A.path),i(A.parent),a(A.entries)}catch(A){d(A instanceof Error?A.message:"Failed to load directory")}finally{l(!1)}};y.useEffect(()=>{w()},[]),y.useEffect(()=>{u&&setTimeout(()=>{var L;return(L=S.current)==null?void 0:L.focus()},0)},[u]);const k=()=>{g(""),v(null),p(!0)},E=()=>{p(!1),g(""),v(null)},C=async()=>{const L=f.trim();if(L){_(!0),v(null);try{const{path:A}=await wP(t,L);p(!1),g(""),await w(t),w(A)}catch(A){v(A instanceof Error?A.message:"Failed to create folder")}finally{_(!1)}}},R=L=>{L.key==="Enter"?(L.preventDefault(),C()):L.key==="Escape"&&E()},F=t.split("/").filter(Boolean),N=L=>{const A="/"+F.slice(0,L+1).join("/");w(A)};return h.jsxs("div",{className:"flex flex-col h-64 border rounded-md overflow-hidden",children:[h.jsxs("div",{className:"flex items-center gap-1 px-2 py-2 bg-muted border-b flex-shrink-0",children:[h.jsx(te,{variant:"ghost",size:"sm",className:"h-6 px-1 flex-shrink-0",onClick:()=>void w(),title:"Home",children:h.jsx(JP,{className:"h-3 w-3"})}),h.jsx("div",{className:"flex items-center gap-1 flex-1 overflow-x-auto min-w-0",children:F.map((L,A)=>h.jsxs(ft.Fragment,{children:[h.jsx(wm,{className:"h-3 w-3 text-muted-foreground flex-shrink-0"}),h.jsx("button",{className:"text-xs hover:text-foreground text-muted-foreground whitespace-nowrap",onClick:()=>N(A),children:L})]},A))}),h.jsxs(te,{variant:"ghost",size:"sm",className:"h-6 px-1.5 flex-shrink-0 gap-1 text-xs",onClick:k,disabled:u||o||!!c,title:"New folder",children:[h.jsx(QP,{className:"h-3.5 w-3.5"}),h.jsx("span",{className:"hidden sm:inline",children:"New folder"})]})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto",children:[o&&h.jsx("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Loading..."}),c&&h.jsx("div",{className:"flex items-center justify-center h-full text-sm text-destructive px-4 text-center",children:c}),!o&&!c&&h.jsxs("div",{className:"p-1",children:[r&&h.jsxs("button",{className:"flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded hover:bg-accent hover:text-accent-foreground",onClick:()=>void w(r),children:[h.jsx(uu,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("span",{children:".."})]}),u&&h.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5",children:[h.jsx(cf,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}),h.jsx("input",{ref:S,className:Q("flex-1 text-sm bg-background border rounded px-1.5 py-0.5 outline-none","focus:ring-1 focus:ring-ring",b&&"border-destructive"),placeholder:"Folder name",value:f,onChange:L=>{g(L.target.value),v(null)},onKeyDown:R,disabled:m}),h.jsx("button",{className:"p-1 rounded hover:bg-accent disabled:opacity-50",onClick:()=>void C(),disabled:!f.trim()||m,title:"Create",children:h.jsx(FT,{className:"h-3.5 w-3.5 text-green-600"})}),h.jsx("button",{className:"p-1 rounded hover:bg-accent",onClick:E,disabled:m,title:"Cancel",children:h.jsx(rs,{className:"h-3.5 w-3.5 text-muted-foreground"})})]}),b&&h.jsx("p",{className:"px-3 pb-1 text-xs text-destructive",children:b}),s.length===0&&!u&&h.jsx("div",{className:"text-sm text-muted-foreground px-2 py-4 text-center",children:"Empty directory"}),s.map(L=>h.jsxs("button",{className:Q("flex items-center gap-2 w-full px-2 py-1.5 text-sm rounded text-left",L.type==="dir"?"hover:bg-accent hover:text-accent-foreground cursor-pointer":"opacity-40 cursor-not-allowed"),onClick:()=>{L.type==="dir"&&w(L.path)},disabled:L.type==="file",children:[L.type==="dir"?h.jsx(cf,{className:"h-4 w-4 text-blue-500 flex-shrink-0"}):h.jsx(ZP,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),h.jsx("span",{className:"truncate",children:L.name})]},L.path))]})]}),h.jsxs("div",{className:"border-t px-3 py-2 flex items-center justify-between gap-2 flex-shrink-0 bg-background",children:[h.jsx("span",{className:"text-xs text-muted-foreground truncate flex-1",children:t}),h.jsx(te,{size:"sm",onClick:()=>e(t),disabled:!t,children:"Select this folder"})]})]})}const n3=[{value:"claude",label:"Claude",desc:"Anthropic Claude Code CLI"},{value:"opencode",label:"OpenCode",desc:"OpenCode CLI (sst/opencode)"},{value:"codex",label:"Codex",desc:"OpenAI Codex CLI"},{value:"qwen",label:"Qwen",desc:"Qwen Code CLI (QwenLM)"}],hx={claude:{limited:"claude",unlimited:"claude --dangerously-skip-permissions"},opencode:{limited:"opencode",unlimited:"opencode --dangerously-skip-permissions"},codex:{limited:"codex",unlimited:"codex --ask-for-approval never --sandbox danger-full-access"},qwen:{limited:"qwen-code",unlimited:"qwen-code --yolo"}};function r3({open:e,onOpenChange:t,onCreated:n}){const[r,i]=y.useState("name"),[s,a]=y.useState(""),[o,l]=y.useState(""),[c,d]=y.useState("claude"),[u,p]=y.useState("limited"),[f,g]=y.useState(!1),[b,v]=y.useState(null),m=()=>{i("name"),a(""),l(""),d("claude"),p("limited"),v(null),g(!1)},_=R=>{R||m(),t(R)},S=()=>{if(!s.trim()){v("Please enter a project name");return}v(null),i("folder")},w=R=>{l(R),i("settings")},k=async()=>{g(!0),v(null);try{const R=await cP({name:s.trim(),folderPath:o,permissionMode:u,cliTool:c});n(R),_(!1)}catch(R){v(R instanceof Error?R.message:"Failed to create project")}finally{g(!1)}},E={name:"New Project — Name",folder:"New Project — Select Folder",settings:"New Project — Settings"},C=["name","folder","settings"];return h.jsx(cl,{open:e,onOpenChange:_,children:h.jsxs(ha,{className:"sm:max-w-lg",children:[h.jsxs(pa,{children:[h.jsx(ga,{children:E[r]}),h.jsxs(ma,{children:[r==="name"&&"Give your project a name.",r==="folder"&&"Choose the working directory for this project.",r==="settings"&&"Choose the AI coding tool and run mode."]})]}),h.jsx("div",{className:"flex gap-2 mb-2",children:C.map((R,F)=>h.jsx("div",{className:`h-1.5 flex-1 rounded-full ${r===R?"bg-primary":C.indexOf(r)>F?"bg-primary/40":"bg-muted"}`},R))}),r==="name"&&h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Xe,{htmlFor:"project-name",children:"Project Name"}),h.jsx(gr,{id:"project-name",placeholder:"My Project",value:s,onChange:R=>a(R.target.value),onKeyDown:R=>{R.key==="Enter"&&S()},autoFocus:!0})]}),b&&h.jsx("p",{className:"text-sm text-destructive",children:b})]}),r==="folder"&&h.jsxs("div",{className:"space-y-2",children:[h.jsx(Xe,{children:"Working Directory"}),h.jsx(vA,{onSelect:w})]}),r==="settings"&&h.jsxs("div",{className:"space-y-5",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Xe,{children:"AI Coding Tool"}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:n3.map(R=>h.jsxs("label",{className:`flex items-center gap-2.5 cursor-pointer p-3 rounded-md border transition-colors ${c===R.value?"border-primary bg-primary/5":"hover:bg-accent"}`,children:[h.jsx("input",{type:"radio",name:"cliTool",value:R.value,checked:c===R.value,onChange:()=>d(R.value),className:"accent-primary"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:R.label}),h.jsx("div",{className:"text-xs text-muted-foreground",children:R.desc})]})]},R.value))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Xe,{children:"Permission Mode"}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-3 rounded-md border hover:bg-accent transition-colors",children:[h.jsx("input",{type:"radio",name:"permissionMode",value:"limited",checked:u==="limited",onChange:()=>p("limited"),className:"mt-0.5"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:"Limited"}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:["Runs ",h.jsx("code",{className:"bg-muted px-1 rounded",children:hx[c].limited})," — asks for permission before file changes."]})]})]}),h.jsxs("label",{className:"flex items-start gap-3 cursor-pointer p-3 rounded-md border hover:bg-accent transition-colors",children:[h.jsx("input",{type:"radio",name:"permissionMode",value:"unlimited",checked:u==="unlimited",onChange:()=>p("unlimited"),className:"mt-0.5"}),h.jsxs("div",{children:[h.jsx("div",{className:"font-medium text-sm",children:"Unlimited"}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:["Runs ",h.jsx("code",{className:"bg-muted px-1 rounded",children:hx[c].unlimited})," — acts autonomously."]})]})]})]})]}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:[h.jsx("span",{className:"font-medium",children:"Folder:"})," ",h.jsx("span",{className:"font-mono",children:o})]}),b&&h.jsx("p",{className:"text-sm text-destructive",children:b})]}),h.jsxs(fa,{children:[r!=="name"&&h.jsx(te,{variant:"outline",onClick:()=>i(r==="settings"?"folder":"name"),disabled:f,children:"Back"}),r==="name"&&h.jsx(te,{onClick:S,children:"Next"}),r==="folder"&&h.jsx(te,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),r==="settings"&&h.jsx(te,{onClick:()=>void k(),disabled:f,children:f?"Creating...":"Create Project"})]})]})})}function i3({open:e,onOpenChange:t,onOpened:n}){const[r,i]=y.useState(""),[s,a]=y.useState(!1),[o,l]=y.useState(null),c=()=>{i(""),l(null),a(!1)},d=p=>{p||c(),t(p)},u=async p=>{i(p),a(!0),l(null);try{const f=await uP(p);n(f),d(!1)}catch(f){l(f instanceof Error?f.message:"Failed to open project"),a(!1)}};return h.jsx(cl,{open:e,onOpenChange:d,children:h.jsxs(ha,{className:"sm:max-w-lg",children:[h.jsxs(pa,{children:[h.jsx(ga,{children:"Open Existing Project"}),h.jsxs(ma,{children:["Select a folder that contains a ",h.jsx("code",{className:"bg-muted px-1 rounded text-xs",children:".ccweb/"})," configuration. The project's history and settings will be restored."]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Xe,{children:"Project Folder"}),h.jsx(vA,{onSelect:p=>void u(p)})]}),o&&h.jsx("p",{className:"text-sm text-destructive",children:o}),r&&!o&&s&&h.jsxs("p",{className:"text-sm text-muted-foreground",children:["Opening project from ",r,"..."]}),h.jsx(fa,{children:h.jsx(te,{variant:"outline",onClick:()=>d(!1),disabled:s,children:"Cancel"})})]})})}function s3(e){if(!e)return"";const t=new Date(e).getTime()-Date.now();if(t<=0)return"即将重置";const n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return n>0?`${n}h${r}m`:`${r}m`}function Kl({label:e,bucket:t}){if(!t||t.utilization===void 0)return null;const n=t.utilization,r=n<50?"text-green-400":n<80?"text-yellow-400":"text-red-400",i=s3(t.resetAt);return h.jsxs("span",{className:"text-muted-foreground whitespace-nowrap",children:[e," ",h.jsxs("span",{className:Q("font-medium",r),children:[n,"%"]}),i&&h.jsxs("span",{className:"text-muted-foreground/70 ml-0.5",children:["(",i,")"]})]})}function SA({className:e}){const[t,n]=y.useState("loading"),[r,i]=y.useState(!1);y.useEffect(()=>{const u=async()=>{try{n(await vP())}catch{n(null)}};u();const p=setInterval(()=>void u(),5*60*1e3);return()=>clearInterval(p)},[]);const s=async()=>{i(!0);try{n(await SP())}catch{n(null)}finally{i(!1)}};if(t==="loading"||!t)return null;const a=!!t.fiveHour,o=!!t.sevenDay,l=!!t.sevenDaySonnet,c=!!t.sevenDayOpus,d=a||o||l||c;return h.jsxs("div",{className:Q("flex items-center gap-1.5 text-xs",e),children:[t.planName&&h.jsx("span",{className:"font-medium text-foreground bg-muted border border-border px-2 py-0.5 rounded-full",children:t.planName}),d&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"|"}),h.jsx(Kl,{label:"5h",bucket:t.fiveHour}),o&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(Kl,{label:"7d",bucket:t.sevenDay})]}),l&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(Kl,{label:"7d Sonnet",bucket:t.sevenDaySonnet})]}),c&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx(Kl,{label:"7d Opus",bucket:t.sevenDayOpus})]})]}),h.jsx("button",{onClick:()=>void s(),className:"text-muted-foreground hover:text-foreground transition-colors",title:"刷新用量信息",children:h.jsx(Wi,{className:Q("h-3 w-3",r&&"animate-spin")})})]})}const px="v1.5.15",Yl=!!window.electronUpdater;function a3(e,t){const n=e.split(".").map(Number),r=t.split(".").map(Number);for(let i=0;i<Math.max(n.length,r.length);i++){const s=n[i]||0,a=r[i]||0;if(s!==a)return s-a}return 0}function o3(){const[e,t]=y.useState("idle"),[n,r]=y.useState(!1),[i,s]=y.useState(""),[a,o]=y.useState(0),[l,c]=y.useState([]),[d,u]=y.useState([]),[p,f]=y.useState(null),[g,b]=y.useState(null);y.useEffect(()=>window.electronUpdater?window.electronUpdater.onUpdateStatus(E=>{switch(E.type){case"progress":{const C=E.info;o(Math.round((C==null?void 0:C.percent)??0));break}case"downloaded":t("downloaded");break;case"error":f(E.info||"Download failed"),t("error");break}}):void 0,[]);const v=y.useCallback(async()=>{t("checking"),f(null),r(!0);try{if(Yl){const E=await window.electronUpdater.checkForUpdate();if(E.error)throw new Error(E.error);if(!E.available){t("no_update");return}s(E.version?`v${E.version}`:"new version")}else{const E=await fetch("https://api.github.com/repos/zbc0315/cc-web/releases/latest");if(E.status===404){t("no_update");return}if(!E.ok)throw new Error(`GitHub API ${E.status}`);const C=await E.json(),R=C.tag_name.replace(/^v/,""),F=px.replace(/^v/,"");if(a3(R,F)<=0){t("no_update");return}s(C.tag_name)}const k=await xP();c(k.projects),t(k.runningCount>0?"confirm_prepare":"update_available")}catch(k){f(k instanceof Error?k.message:"Check failed"),t("error")}},[]),m=async()=>{t("preparing");try{const k=await kP();u(k.results),t("update_available")}catch(k){f(k instanceof Error?k.message:"Prepare failed"),t("error")}},_=async()=>{if(Yl){t("downloading"),o(0);const k=await window.electronUpdater.downloadUpdate();k.success?k.path&&b(k.path):(f(k.error||"Download failed"),t("error"))}else window.open("https://github.com/zbc0315/cc-web/releases/latest","_blank")},S=()=>{var k;(k=window.electronUpdater)==null||k.quitAndInstall(g||void 0)},w=()=>{r(!1),setTimeout(()=>{t("idle"),s(""),c([]),u([]),f(null),o(0)},200)};return h.jsxs(h.Fragment,{children:[h.jsxs(te,{variant:"ghost",size:"sm",onClick:()=>void v(),disabled:e==="checking"||e==="preparing"||e==="downloading",children:[e==="checking"||e==="preparing"||e==="downloading"?h.jsx(Fi,{className:"h-4 w-4 mr-2 animate-spin"}):h.jsx(BT,{className:"h-4 w-4 mr-2"}),"Update"]}),h.jsx(cl,{open:n,onOpenChange:k=>{k||w()},children:h.jsxs(ha,{className:"sm:max-w-md",children:[h.jsxs(pa,{children:[h.jsxs(ga,{children:[e==="checking"&&"Checking for updates...",e==="no_update"&&"Up to date",e==="update_available"&&`Update ${i} available`,e==="confirm_prepare"&&"Save project memory first",e==="preparing"&&"Saving project memory...",e==="downloading"&&"Downloading update...",e==="downloaded"&&"Update ready to install",e==="error"&&"Update error"]}),h.jsxs(ma,{children:[e==="checking"&&"Checking for the latest version...",e==="no_update"&&`Current version ${px} is the latest.`,e==="update_available"&&(d.length>0?"All projects saved and stopped. Ready to update.":`A new version is available. ${Yl?"Click download to update automatically.":""}`),e==="confirm_prepare"&&`${l.length} project(s) running. Each Claude will be asked to save memory, then terminals will stop.`,e==="preparing"&&"Sending save commands and waiting for Claude to finish...",e==="downloading"&&`Downloading... ${a}%`,e==="downloaded"&&"The update has been downloaded. Click install to restart and apply.",e==="error"&&(p||"An error occurred.")]})]}),e==="downloading"&&h.jsx("div",{className:"w-full bg-muted rounded-full h-2 overflow-hidden",children:h.jsx("div",{className:"bg-primary h-full transition-all duration-300",style:{width:`${a}%`}})}),e==="confirm_prepare"&&l.length>0&&h.jsx("div",{className:"space-y-1 text-sm",children:l.map(k=>h.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded bg-muted",children:[h.jsx("span",{className:"h-2 w-2 rounded-full bg-green-500 shrink-0"}),h.jsx("span",{className:"truncate",children:k.name})]},k.id))}),e==="preparing"&&h.jsx("div",{className:"flex items-center justify-center py-6",children:h.jsx(Fi,{className:"h-8 w-8 animate-spin text-muted-foreground"})}),e==="update_available"&&d.length>0&&h.jsx("div",{className:"space-y-1 text-sm",children:d.map(k=>h.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded bg-muted",children:[k.status==="stopped"?h.jsx(VP,{className:"h-4 w-4 text-green-500 shrink-0"}):h.jsx($P,{className:"h-4 w-4 text-yellow-500 shrink-0"}),h.jsx("span",{className:"truncate",children:k.name}),h.jsx("span",{className:"text-xs text-muted-foreground ml-auto shrink-0",children:k.message})]},k.id))}),h.jsxs(fa,{children:[e==="no_update"&&h.jsx(te,{onClick:w,children:"OK"}),e==="update_available"&&h.jsxs(h.Fragment,{children:[h.jsx(te,{variant:"outline",onClick:w,children:"Later"}),h.jsx(te,{onClick:()=>void _(),children:Yl?"Download & Install":`Download ${i}`})]}),e==="confirm_prepare"&&h.jsxs(h.Fragment,{children:[h.jsx(te,{variant:"outline",onClick:w,children:"Cancel"}),h.jsx(te,{onClick:()=>void m(),children:"Save Memory & Stop All"})]}),e==="downloaded"&&h.jsxs(h.Fragment,{children:[h.jsx(te,{variant:"outline",onClick:w,children:"Later"}),h.jsx(te,{onClick:S,children:"Restart & Install"})]}),e==="error"&&h.jsx(te,{onClick:w,children:"Close"})]})]})})]})}function l3(){const[e,t]=y.useState([]),[n,r]=y.useState(!1),[i,s]=y.useState(""),[a,o]=y.useState(""),[l,c]=y.useState(""),[d,u]=y.useState(null),[p,f]=y.useState(""),[g,b]=y.useState(""),[v,m]=y.useState(""),_=y.useRef(null),S=y.useRef(null);y.useEffect(()=>{IT().then(t).catch(()=>t([]))},[]),y.useEffect(()=>{n&&setTimeout(()=>{var C;return(C=_.current)==null?void 0:C.focus()},0)},[n]),y.useEffect(()=>{d&&setTimeout(()=>{var C;return(C=S.current)==null?void 0:C.focus()},0)},[d]);const w=async()=>{const C=a.trim();if(C)try{const R=await bP({label:i.trim()||C,command:C,...l?{parentId:l}:{}});t(F=>[...F,R]),s(""),o(""),c(""),r(!1)}catch(R){console.error("[GlobalShortcuts] Failed to add:",R)}},k=async C=>{try{await yP(C),t(R=>R.filter(F=>F.id!==C)),d===C&&u(null)}catch(R){console.error("[GlobalShortcuts] Failed to delete:",R)}},E=async()=>{const C=g.trim();if(!(!C||!d))try{const R=await _P(d,{label:p.trim()||C,command:C,parentId:v||null});t(F=>F.map(N=>N.id===d?R:N)),u(null)}catch(R){console.error("[GlobalShortcuts] Failed to save:",R)}};return h.jsxs("section",{className:"mt-10",children:[h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(du,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("h2",{className:"text-lg font-semibold",children:"全局快捷命令"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"在所有项目的终端中可用"})]}),h.jsxs("button",{onClick:()=>{r(C=>!C),u(null)},className:Q("flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-md border transition-colors",n?"border-border text-foreground bg-muted":"border-border text-muted-foreground hover:text-foreground hover:bg-muted"),children:[h.jsx(zo,{className:"h-3.5 w-3.5"}),"新建"]})]}),n&&h.jsxs("div",{className:"mb-4 p-4 rounded-lg border border-border bg-background space-y-3",children:[h.jsx("input",{ref:_,placeholder:"名称(可选)",value:i,onChange:C=>s(C.target.value),className:"w-full text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground placeholder:text-muted-foreground outline-none focus:border-border transition-colors"}),h.jsx("textarea",{placeholder:"命令内容…",value:a,onChange:C=>o(C.target.value),rows:3,className:"w-full text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground placeholder:text-muted-foreground font-mono outline-none focus:border-border transition-colors resize-none",onKeyDown:C=>{C.key==="Enter"&&(C.metaKey||C.ctrlKey)&&(C.preventDefault(),w()),C.key==="Escape"&&(r(!1),s(""),o(""),c(""))}}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Sc,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),h.jsxs("select",{value:l,onChange:C=>c(C.target.value),className:"flex-1 text-sm bg-muted border border-border rounded px-3 py-1.5 text-foreground outline-none focus:border-border transition-colors",children:[h.jsx("option",{value:"",children:"无继承"}),e.map(C=>h.jsx("option",{value:C.id,children:C.label},C.id))]})]}),h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-xs text-muted-foreground",children:"⌘↩ 保存 · Esc 取消"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("button",{onClick:()=>{r(!1),s(""),o("")},className:"text-sm px-3 py-1 rounded bg-secondary hover:bg-accent text-foreground transition-colors",children:"取消"}),h.jsx("button",{onClick:()=>void w(),disabled:!a.trim(),className:Q("text-sm px-3 py-1 rounded transition-colors text-white",a.trim()?"bg-blue-600 hover:bg-blue-500":"bg-secondary opacity-40 cursor-not-allowed"),children:"保存"})]})]})]}),e.length===0&&!n?h.jsxs("div",{className:"flex flex-col items-center gap-2 py-10 text-muted-foreground/50 border border-dashed border-border rounded-lg",children:[h.jsx(du,{className:"h-6 w-6"}),h.jsx("p",{className:"text-sm",children:"还没有全局快捷命令"})]}):h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:e.map(C=>d===C.id?h.jsxs("div",{className:"rounded-lg border border-border bg-background p-3 space-y-2",children:[h.jsx("input",{ref:S,value:p,onChange:R=>f(R.target.value),placeholder:"名称(可选)",className:"w-full text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground placeholder:text-muted-foreground outline-none focus:border-border transition-colors"}),h.jsx("textarea",{value:g,onChange:R=>b(R.target.value),rows:3,className:"w-full text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground font-mono outline-none focus:border-border transition-colors resize-none",onKeyDown:R=>{R.key==="Enter"&&(R.metaKey||R.ctrlKey)&&(R.preventDefault(),E()),R.key==="Escape"&&u(null)}}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Sc,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),h.jsxs("select",{value:v,onChange:R=>m(R.target.value),className:"flex-1 text-sm bg-muted border border-border rounded px-2.5 py-1 text-foreground outline-none focus:border-border transition-colors",children:[h.jsx("option",{value:"",children:"无继承"}),e.filter(R=>R.id!==C.id).map(R=>h.jsx("option",{value:R.id,children:R.label},R.id))]})]}),h.jsxs("div",{className:"flex gap-2 justify-end",children:[h.jsx("button",{onClick:()=>u(null),className:"text-xs px-2.5 py-1 rounded bg-secondary hover:bg-accent text-foreground transition-colors",children:"取消"}),h.jsx("button",{onClick:()=>void E(),disabled:!g.trim(),className:Q("text-xs px-2.5 py-1 rounded transition-colors text-white",g.trim()?"bg-blue-600 hover:bg-blue-500":"bg-secondary opacity-40 cursor-not-allowed"),children:"保存"})]})]},C.id):h.jsxs("div",{className:"group relative rounded-lg border border-border bg-background hover:border-muted-foreground/30 transition-colors p-3",children:[h.jsx("div",{className:"text-sm font-medium text-foreground truncate pr-14",children:C.label}),C.parentId&&(()=>{const R=e.find(F=>F.id===C.parentId);return R?h.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[h.jsx(Sc,{className:"h-3 w-3 text-muted-foreground"}),h.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["继承: ",R.label]})]}):null})(),!C.parentId&&C.label!==C.command&&h.jsx("div",{className:"text-xs text-muted-foreground font-mono truncate mt-1 pr-14",children:C.command}),h.jsxs("div",{className:"absolute top-2.5 right-2.5 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[h.jsx("button",{onClick:()=>{u(C.id),f(C.label),b(C.command),m(C.parentId||""),r(!1)},className:"p-1 rounded text-muted-foreground hover:text-blue-400 transition-colors",title:"编辑",children:h.jsx(km,{className:"h-3.5 w-3.5"})}),h.jsx("button",{onClick:()=>void k(C.id),className:"p-1 rounded text-muted-foreground hover:text-red-400 transition-colors",title:"删除",children:h.jsx(rs,{className:"h-3.5 w-3.5"})})]})]},C.id))})]})}const wA=y.createContext({theme:"system",resolved:"dark",setTheme:()=>{}}),fx="cc_web_theme";function c3(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function u3(){return y.useSyncExternalStore(e=>{const t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},()=>c3())}function d3({children:e}){const[t,n]=y.useState(()=>{try{return localStorage.getItem(fx)||"system"}catch{return"system"}}),r=u3(),i=t==="system"?r:t;y.useEffect(()=>{const a=document.documentElement;a.classList.remove("light","dark"),a.classList.add(i)},[i]);const s=a=>{n(a);try{localStorage.setItem(fx,a)}catch{}};return h.jsx(wA.Provider,{value:{theme:t,resolved:i,setTheme:s},children:e})}function Im(){return y.useContext(wA)}function EA(){const{theme:e,setTheme:t}=Im(),n=[{value:"light",icon:dF,label:"浅色"},{value:"dark",icon:rF,label:"深色"},{value:"system",icon:nF,label:"系统"}];return h.jsx("div",{className:"flex items-center rounded-md border border-border bg-muted/50 p-0.5",children:n.map(({value:r,icon:i,label:s})=>h.jsx("button",{onClick:()=>t(r),className:Q("p-1 rounded-sm transition-colors",e===r?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),title:s,children:h.jsx(i,{className:"h-3.5 w-3.5"})},r))})}function h3(){const e=ua(),[t,n]=y.useState([]),[r,i]=y.useState(!0),[s,a]=y.useState(null),[o,l]=y.useState(!1),[c,d]=y.useState(!1),[u,p]=y.useState(new Set),[f,g]=y.useState(!!document.fullscreenElement),[b,v]=y.useState(!1),m=()=>{document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen()};y.useEffect(()=>{const A=()=>g(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",A),()=>document.removeEventListener("fullscreenchange",A)},[]);const _=async()=>{try{const A=await RT();n(A)}catch(A){a(A instanceof Error?A.message:"Failed to load projects")}finally{i(!1)}};y.useEffect(()=>{_()},[]),y.useEffect(()=>{let I=null;const M=async()=>{if(!document.hidden)try{const D=await mP(),j=Date.now(),x=new Set(Object.entries(D).filter(([,$])=>typeof $=="number"&&j-$<2e3).map(([$])=>$));p(x)}catch{}},P=()=>{M(),I=setInterval(()=>void M(),2e3)},B=()=>{I&&(clearInterval(I),I=null)},U=()=>{document.hidden?B():P()};return P(),document.addEventListener("visibilitychange",U),()=>{B(),document.removeEventListener("visibilitychange",U)}},[]);const S=()=>{AT(),e("/login")},w=A=>{n(I=>[...I,A])},k=A=>{n(I=>[...I,A])},E=async A=>{try{await dP(A),n(I=>I.filter(M=>M.id!==A))}catch(I){alert(I instanceof Error?I.message:"Failed to delete project")}},C=async A=>{try{const I=await fP(A);n(M=>M.map(P=>P.id===A?I:P))}catch(I){alert(I instanceof Error?I.message:"Failed to archive project")}},R=async A=>{try{const I=await gP(A);n(M=>M.map(P=>P.id===A?I:P))}catch(I){alert(I instanceof Error?I.message:"Failed to restore project")}},F=t.filter(A=>!A.archived),N=t.filter(A=>A.archived),L={onDelete:A=>void E(A),onArchive:A=>void C(A),onUnarchive:A=>void R(A)};return h.jsxs("div",{className:"min-h-screen bg-background",children:[h.jsx("header",{className:"border-b sticky top-0 bg-background z-10",children:h.jsxs("div",{className:"max-w-6xl mx-auto px-4 h-14 flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(ZE,{className:"h-5 w-5"}),h.jsx("span",{className:"font-semibold text-lg",children:"CC Web"})]}),h.jsx(SA,{}),h.jsx(te,{variant:"ghost",size:"sm",onClick:()=>e("/settings"),title:"设置",children:h.jsx(cF,{className:"h-4 w-4"})}),h.jsx(o3,{}),h.jsx(te,{variant:"ghost",size:"sm",onClick:m,title:f?"Exit fullscreen":"Fullscreen",children:f?h.jsx(xm,{className:"h-4 w-4"}):h.jsx(Em,{className:"h-4 w-4"})}),h.jsx(EA,{}),h.jsxs(te,{variant:"ghost",size:"sm",onClick:S,children:[h.jsx(eF,{className:"h-4 w-4 mr-2"}),"Logout"]})]})}),h.jsxs("main",{className:"max-w-6xl mx-auto px-4 py-8",children:[h.jsxs("div",{className:"flex items-center justify-between mb-6",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl font-bold",children:"Projects"}),h.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Each project runs Claude CLI in a dedicated terminal session."})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs(te,{variant:"outline",onClick:()=>d(!0),children:[h.jsx($o,{className:"h-4 w-4 mr-2"}),"Open Project"]}),h.jsxs(te,{onClick:()=>l(!0),children:[h.jsx(zo,{className:"h-4 w-4 mr-2"}),"New Project"]})]})]}),r&&h.jsx("div",{className:"text-center text-muted-foreground py-12",children:"Loading projects..."}),s&&h.jsx("div",{className:"text-center text-destructive py-12",children:s}),!r&&!s&&t.length===0&&h.jsxs("div",{className:"text-center py-20",children:[h.jsx(ZE,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),h.jsx("h2",{className:"text-lg font-semibold mb-2",children:"No projects yet"}),h.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"Create a new project or open an existing one."}),h.jsxs("div",{className:"flex gap-2 justify-center",children:[h.jsxs(te,{variant:"outline",onClick:()=>d(!0),children:[h.jsx($o,{className:"h-4 w-4 mr-2"}),"Open Project"]}),h.jsxs(te,{onClick:()=>l(!0),children:[h.jsx(zo,{className:"h-4 w-4 mr-2"}),"New Project"]})]})]}),!r&&!s&&F.length>0&&h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:F.map(A=>h.jsx(JE,{project:A,active:u.has(A.id),...L},A.id))}),!r&&!s&&N.length>0&&h.jsxs("div",{className:"mt-10",children:[h.jsxs("button",{className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors mb-4 group",onClick:()=>v(A=>!A),children:[b?h.jsx(rd,{className:"h-4 w-4"}):h.jsx(wm,{className:"h-4 w-4"}),h.jsx("span",{className:"font-medium",children:"Archived"}),h.jsx("span",{className:"text-xs bg-muted rounded-full px-2 py-0.5",children:N.length})]}),b&&h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:N.map(A=>h.jsx(JE,{project:A,active:!1,...L},A.id))})]}),h.jsx(l3,{})]}),h.jsx(r3,{open:o,onOpenChange:l,onCreated:w}),h.jsx(i3,{open:c,onOpenChange:d,onOpened:k})]})}/**
|
|
397
397
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
398
398
|
* @license MIT
|
|
399
399
|
*
|
package/frontend/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/terminal.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>CC Web</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-Cr99sgtQ.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-D7gjxQKB.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|