@kaitranntt/ccs 7.1.1-dev.4 → 7.2.0-dev.1
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 +8 -3
- package/config/base-ghcp.settings.json +10 -0
- package/config/base-kiro.settings.json +10 -0
- package/dist/auth/profile-detector.d.ts +1 -1
- package/dist/auth/profile-detector.d.ts.map +1 -1
- package/dist/auth/profile-detector.js +9 -1
- package/dist/auth/profile-detector.js.map +1 -1
- package/dist/cliproxy/account-manager.js +1 -1
- package/dist/cliproxy/account-manager.js.map +1 -1
- package/dist/cliproxy/auth/auth-types.d.ts +2 -0
- package/dist/cliproxy/auth/auth-types.d.ts.map +1 -1
- package/dist/cliproxy/auth/auth-types.js +22 -0
- package/dist/cliproxy/auth/auth-types.js.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.d.ts +3 -1
- package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.js +23 -13
- package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
- package/dist/cliproxy/auth/oauth-process.js +1 -1
- package/dist/cliproxy/auth/oauth-process.js.map +1 -1
- package/dist/cliproxy/auth/token-manager.js +1 -1
- package/dist/cliproxy/auth/token-manager.js.map +1 -1
- package/dist/cliproxy/binary/downloader.js +1 -1
- package/dist/cliproxy/binary/downloader.js.map +1 -1
- package/dist/cliproxy/binary/installer.js +3 -3
- package/dist/cliproxy/binary/installer.js.map +1 -1
- package/dist/cliproxy/binary/lifecycle.js +3 -3
- package/dist/cliproxy/binary/lifecycle.js.map +1 -1
- package/dist/cliproxy/binary/types.d.ts +2 -2
- package/dist/cliproxy/binary/types.d.ts.map +1 -1
- package/dist/cliproxy/binary/types.js +2 -2
- package/dist/cliproxy/binary/types.js.map +1 -1
- package/dist/cliproxy/binary/version-checker.d.ts +1 -0
- package/dist/cliproxy/binary/version-checker.d.ts.map +1 -1
- package/dist/cliproxy/binary/version-checker.js +6 -2
- package/dist/cliproxy/binary/version-checker.js.map +1 -1
- package/dist/cliproxy/binary-manager.js +3 -3
- package/dist/cliproxy/binary-manager.js.map +1 -1
- package/dist/cliproxy/cliproxy-executor.js +2 -2
- package/dist/cliproxy/cliproxy-executor.js.map +1 -1
- package/dist/cliproxy/config-generator.d.ts +2 -1
- package/dist/cliproxy/config-generator.d.ts.map +1 -1
- package/dist/cliproxy/config-generator.js +4 -1
- package/dist/cliproxy/config-generator.js.map +1 -1
- package/dist/cliproxy/platform-detector.d.ts +5 -4
- package/dist/cliproxy/platform-detector.d.ts.map +1 -1
- package/dist/cliproxy/platform-detector.js +9 -8
- package/dist/cliproxy/platform-detector.js.map +1 -1
- package/dist/cliproxy/service-manager.js +1 -1
- package/dist/cliproxy/service-manager.js.map +1 -1
- package/dist/cliproxy/services/variant-config-adapter.js +1 -1
- package/dist/cliproxy/services/variant-config-adapter.js.map +1 -1
- package/dist/cliproxy/types.d.ts +3 -1
- package/dist/cliproxy/types.d.ts.map +1 -1
- package/dist/commands/cliproxy-command.js +10 -10
- package/dist/commands/cliproxy-command.js.map +1 -1
- package/dist/commands/help-command.d.ts.map +1 -1
- package/dist/commands/help-command.js +14 -11
- package/dist/commands/help-command.js.map +1 -1
- package/dist/config/unified-config-types.d.ts +1 -1
- package/dist/config/unified-config-types.d.ts.map +1 -1
- package/dist/config/unified-config-types.js +1 -1
- package/dist/config/unified-config-types.js.map +1 -1
- package/dist/management/checks/cliproxy-check.d.ts +2 -2
- package/dist/management/checks/cliproxy-check.d.ts.map +1 -1
- package/dist/management/checks/cliproxy-check.js +6 -6
- package/dist/management/checks/cliproxy-check.js.map +1 -1
- package/dist/management/doctor.js +2 -2
- package/dist/management/doctor.js.map +1 -1
- package/dist/management/oauth-port-diagnostics.d.ts.map +1 -1
- package/dist/management/oauth-port-diagnostics.js +6 -2
- package/dist/management/oauth-port-diagnostics.js.map +1 -1
- package/dist/ui/assets/{accounts-JQk7OQkj.js → accounts-9wlVHCXo.js} +1 -1
- package/dist/ui/assets/{api-CEth-wUS.js → api-Bw4cCi2F.js} +1 -1
- package/dist/ui/assets/{card-z3bzNTGJ.js → card-CZPfLugs.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-34IxcHmp.js → cliproxy-control-panel-BevrgGCM.js} +1 -1
- package/dist/ui/assets/cliproxy-kr96BfuU.js +3 -0
- package/dist/ui/assets/{confirm-dialog-CCbqijOM.js → confirm-dialog-BorjRTzd.js} +1 -1
- package/dist/ui/assets/{copilot-1CHarUGE.js → copilot-DaUIqV9s.js} +2 -2
- package/dist/ui/assets/globalenv-section-BbyVgaks.js +1 -0
- package/dist/ui/assets/{health-8_V4IkPC.js → health-CLCy1vtn.js} +1 -1
- package/dist/ui/assets/{index-DX0uFN7k.js → index-BAwXrb1q.js} +1 -1
- package/dist/ui/assets/{index-DJ3WO1pE.js → index-CL-YtA46.js} +1 -1
- package/dist/ui/assets/index-DAT_KnOX.css +1 -0
- package/dist/ui/assets/{index-DMAAsR-c.js → index-L1UvJmph.js} +1 -1
- package/dist/ui/assets/{index-BhG5iXmB.js → index-V1EeWpdZ.js} +3 -3
- package/dist/ui/assets/providers/copilot.svg +1 -0
- package/dist/ui/assets/providers/kiro.png +0 -0
- package/dist/ui/assets/{shared-kOmZ3MPL.js → shared-Dh4Z3YSA.js} +1 -1
- package/dist/ui/assets/{switch-BNmIV8Xs.js → switch-MmOrKX9y.js} +1 -1
- package/dist/ui/index.html +2 -2
- package/dist/utils/platform-commands.d.ts +2 -2
- package/dist/utils/platform-commands.js +7 -7
- package/dist/utils/platform-commands.js.map +1 -1
- package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-auth-routes.js +11 -1
- package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
- package/dist/web-server/routes/cliproxy-stats-routes.js +7 -7
- package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/cliproxy-D8Xj8822.js +0 -3
- package/dist/ui/assets/globalenv-section-DSZ-SvbT.js +0 -1
- package/dist/ui/assets/index-CgFCsfWr.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>GithubCopilot</title><path d="M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z"></path></svg>
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./radix-ui-CrW4rUOS.js";import{r as d}from"./react-vendor-B_CU-WTZ.js";import{C as l,a as m}from"./card-
|
|
1
|
+
import{j as s}from"./radix-ui-CrW4rUOS.js";import{r as d}from"./react-vendor-B_CU-WTZ.js";import{C as l,a as m}from"./card-CZPfLugs.js";import{an as c,ao as x,ap as u,aq as p,ar as h,a as g}from"./index-V1EeWpdZ.js";import{p as j,N as f,as as N,u as b}from"./icons-ChQ4a4K4.js";import"./tanstack-Dbfprw6o.js";import"./notifications-dJQY2-U6.js";import"./utils-CzKF5WmX.js";import"./form-utils-kUVlZZAO.js";import"./code-highlight-DKN39ySy.js";function B(){const[t,r]=d.useState("commands"),{data:e}=c(),{data:n,isLoading:i}=x(t),o=[{id:"commands",label:"Commands",icon:j,count:e?.commands??0},{id:"skills",label:"Skills",icon:f,count:e?.skills??0},{id:"agents",label:"Agents",icon:N,count:e?.agents??0}];return s.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-8",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Shared Data"}),s.jsx("p",{className:"text-muted-foreground",children:"Commands, skills, and agents shared across Claude instances"})]}),e&&!e.symlinkStatus.valid&&s.jsxs(u,{variant:"warning",children:[s.jsx(b,{className:"h-4 w-4"}),s.jsx(p,{children:"Configuration Required"}),s.jsxs(h,{children:[e.symlinkStatus.message,". Run `ccs sync` to configure."]})]}),s.jsx("div",{className:"flex gap-2 border-b pb-2",children:o.map(a=>s.jsxs(g,{variant:t===a.id?"default":"ghost",size:"sm",onClick:()=>r(a.id),className:"flex items-center gap-2",children:[s.jsx(a.icon,{className:"w-4 h-4"}),a.label," (",a.count,")"]},a.id))}),s.jsx("div",{className:"mt-4",children:i?s.jsx("div",{className:"text-muted-foreground",children:"Loading..."}):n?.items.length===0?s.jsxs("div",{className:"text-muted-foreground",children:["No ",t," found"]}):s.jsx("div",{className:"grid gap-3",children:n?.items.map(a=>s.jsx(l,{children:s.jsxs(m,{children:[s.jsx("div",{className:"font-medium",children:a.name}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:a.description}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2 font-mono truncate",children:a.path})]})},a.name))})})]})}export{B as SharedPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a,a8 as s,a9 as n}from"./radix-ui-CrW4rUOS.js";import"./react-vendor-B_CU-WTZ.js";import{c as e}from"./index-
|
|
1
|
+
import{j as a,a8 as s,a9 as n}from"./radix-ui-CrW4rUOS.js";import"./react-vendor-B_CU-WTZ.js";import{c as e}from"./index-V1EeWpdZ.js";function c({className:t,...r}){return a.jsx(s,{"data-slot":"switch",className:e("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:a.jsx(n,{"data-slot":"switch-thumb",className:e("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}export{c as S};
|
package/dist/ui/index.html
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap"
|
|
25
25
|
rel="stylesheet"
|
|
26
26
|
/>
|
|
27
|
-
<script type="module" crossorigin src="/assets/index-
|
|
27
|
+
<script type="module" crossorigin src="/assets/index-V1EeWpdZ.js"></script>
|
|
28
28
|
<link rel="modulepreload" crossorigin href="/assets/react-vendor-B_CU-WTZ.js">
|
|
29
29
|
<link rel="modulepreload" crossorigin href="/assets/radix-ui-CrW4rUOS.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/tanstack-Dbfprw6o.js">
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<link rel="modulepreload" crossorigin href="/assets/icons-ChQ4a4K4.js">
|
|
34
34
|
<link rel="modulepreload" crossorigin href="/assets/form-utils-kUVlZZAO.js">
|
|
35
35
|
<link rel="modulepreload" crossorigin href="/assets/code-highlight-DKN39ySy.js">
|
|
36
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
36
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DAT_KnOX.css">
|
|
37
37
|
</head>
|
|
38
38
|
<body>
|
|
39
39
|
<div id="root"></div>
|
|
@@ -13,7 +13,7 @@ export declare function getPortCheckCommand(port: number): string;
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function getCatCommand(filePath: string): string;
|
|
15
15
|
/**
|
|
16
|
-
* Get platform-specific command to kill CLIProxy processes
|
|
16
|
+
* Get platform-specific command to kill CLIProxy Plus processes
|
|
17
17
|
*/
|
|
18
18
|
export declare function getKillCLIProxyCommand(): string;
|
|
19
19
|
/**
|
|
@@ -30,7 +30,7 @@ export declare function getPlatformName(): string;
|
|
|
30
30
|
*/
|
|
31
31
|
export declare function killProcessByPid(pid: number, verbose?: boolean): boolean;
|
|
32
32
|
/**
|
|
33
|
-
* Kill all CLIProxy processes (cross-platform)
|
|
33
|
+
* Kill all CLIProxy Plus processes (cross-platform)
|
|
34
34
|
* @returns number of processes killed
|
|
35
35
|
*/
|
|
36
36
|
export declare function killAllCLIProxyProcesses(verbose?: boolean): number;
|
|
@@ -32,13 +32,13 @@ function getCatCommand(filePath) {
|
|
|
32
32
|
}
|
|
33
33
|
exports.getCatCommand = getCatCommand;
|
|
34
34
|
/**
|
|
35
|
-
* Get platform-specific command to kill CLIProxy processes
|
|
35
|
+
* Get platform-specific command to kill CLIProxy Plus processes
|
|
36
36
|
*/
|
|
37
37
|
function getKillCLIProxyCommand() {
|
|
38
38
|
if (isWindows) {
|
|
39
|
-
return 'taskkill /F /IM cli-proxy-api.exe';
|
|
39
|
+
return 'taskkill /F /IM cli-proxy-api-plus.exe';
|
|
40
40
|
}
|
|
41
|
-
return 'pkill -f cli-proxy-api';
|
|
41
|
+
return 'pkill -f cli-proxy-api-plus';
|
|
42
42
|
}
|
|
43
43
|
exports.getKillCLIProxyCommand = getKillCLIProxyCommand;
|
|
44
44
|
/**
|
|
@@ -85,7 +85,7 @@ function killProcessByPid(pid, verbose = false) {
|
|
|
85
85
|
}
|
|
86
86
|
exports.killProcessByPid = killProcessByPid;
|
|
87
87
|
/**
|
|
88
|
-
* Kill all CLIProxy processes (cross-platform)
|
|
88
|
+
* Kill all CLIProxy Plus processes (cross-platform)
|
|
89
89
|
* @returns number of processes killed
|
|
90
90
|
*/
|
|
91
91
|
function killAllCLIProxyProcesses(verbose = false) {
|
|
@@ -94,13 +94,13 @@ function killAllCLIProxyProcesses(verbose = false) {
|
|
|
94
94
|
if (isWindows) {
|
|
95
95
|
// Windows: taskkill by image name
|
|
96
96
|
// Use /T to kill child processes too
|
|
97
|
-
(0, child_process_1.execSync)('taskkill /F /IM cli-proxy-api.exe /T 2>nul', { stdio: 'pipe' });
|
|
97
|
+
(0, child_process_1.execSync)('taskkill /F /IM cli-proxy-api-plus.exe /T 2>nul', { stdio: 'pipe' });
|
|
98
98
|
killed++;
|
|
99
99
|
}
|
|
100
100
|
else {
|
|
101
101
|
// Unix: pkill with pattern matching
|
|
102
102
|
try {
|
|
103
|
-
(0, child_process_1.execSync)('pkill -9 -f cli-proxy-api', { stdio: 'pipe' });
|
|
103
|
+
(0, child_process_1.execSync)('pkill -9 -f cli-proxy-api-plus', { stdio: 'pipe' });
|
|
104
104
|
killed++;
|
|
105
105
|
}
|
|
106
106
|
catch {
|
|
@@ -112,7 +112,7 @@ function killAllCLIProxyProcesses(verbose = false) {
|
|
|
112
112
|
// No processes to kill or command failed
|
|
113
113
|
}
|
|
114
114
|
if (verbose && killed > 0) {
|
|
115
|
-
console.error(`[cleanup] Killed ${killed} CLIProxy process(es)`);
|
|
115
|
+
console.error(`[cleanup] Killed ${killed} CLIProxy Plus process(es)`);
|
|
116
116
|
}
|
|
117
117
|
return killed;
|
|
118
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-commands.js","sourceRoot":"","sources":["../../src/utils/platform-commands.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iDAAyC;AAEzC,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AAC/C,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC;AAE5C;;GAEG;AACH,SAAgB,mBAAmB,CAAC,IAAY;IAC9C,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,2BAA2B,IAAI,EAAE,CAAC;IAC3C,CAAC;IACD,OAAO,YAAY,IAAI,EAAE,CAAC;AAC5B,CAAC;AALD,kDAKC;AAED;;GAEG;AACH,SAAgB,aAAa,CAAC,QAAgB;IAC5C,IAAI,SAAS,EAAE,CAAC;QACd,+CAA+C;QAC/C,OAAO,SAAS,QAAQ,GAAG,CAAC;IAC9B,CAAC;IACD,OAAO,QAAQ,QAAQ,GAAG,CAAC;AAC7B,CAAC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AO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;YAClF,MAAM,IAAI,GAAG,MAAM;iBAChB,IAAI,EAAE;iBACN,KAAK,CAAC,IAAI,CAAC;iBACX,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;YACpB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;gBACvB,IAAI,CAAC;oBACH,IAAA,wBAAQ,EAAC,WAAW,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;oBAC9C,IAAI,OAAO,EAAE,CAAC;wBACZ,OAAO,CAAC,KAAK,CAAC,4BAA4B,GAAG,YAAY,IAAI,EAAE,CAAC,CAAC;oBACnE,CAAC;gBACH,CAAC;gBAAC,MAAM,CAAC;oBACP,kCAAkC;gBACpC,CAAC;YACH,CAAC;YACD,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,uCAAuC;QACvC,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAjDD,8CAiDC;AAED,kBAAe;IACb,mBAAmB;IACnB,aAAa;IACb,sBAAsB;IACtB,iBAAiB;IACjB,eAAe;IACf,gBAAgB;IAChB,wBAAwB;IACxB,iBAAiB;CAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cliproxy-auth-routes.d.ts","sourceRoot":"","sources":["../../../src/web-server/routes/cliproxy-auth-routes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAyBH,QAAA,MAAM,MAAM,4CAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"cliproxy-auth-routes.d.ts","sourceRoot":"","sources":["../../../src/web-server/routes/cliproxy-auth-routes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAyBH,QAAA,MAAM,MAAM,4CAAW,CAAC;AA2TxB,eAAe,MAAM,CAAC"}
|
|
@@ -12,7 +12,15 @@ const proxy_target_resolver_1 = require("../../cliproxy/proxy-target-resolver");
|
|
|
12
12
|
const remote_auth_fetcher_1 = require("../../cliproxy/remote-auth-fetcher");
|
|
13
13
|
const router = (0, express_1.Router)();
|
|
14
14
|
// Valid providers list
|
|
15
|
-
const validProviders = [
|
|
15
|
+
const validProviders = [
|
|
16
|
+
'gemini',
|
|
17
|
+
'codex',
|
|
18
|
+
'agy',
|
|
19
|
+
'qwen',
|
|
20
|
+
'iflow',
|
|
21
|
+
'kiro',
|
|
22
|
+
'ghcp',
|
|
23
|
+
];
|
|
16
24
|
/**
|
|
17
25
|
* GET /api/cliproxy/auth - Get auth status for built-in CLIProxy profiles
|
|
18
26
|
* Also fetches CLIProxyAPI stats to update lastUsedAt for active providers
|
|
@@ -37,6 +45,8 @@ router.get('/', async (_req, res) => {
|
|
|
37
45
|
codex: 'codex',
|
|
38
46
|
qwen: 'qwen',
|
|
39
47
|
iflow: 'iflow',
|
|
48
|
+
kiro: 'kiro',
|
|
49
|
+
copilot: 'ghcp', // CLIProxyAPI returns 'copilot', we map to 'ghcp'
|
|
40
50
|
};
|
|
41
51
|
// Update lastUsedAt for providers with recent activity
|
|
42
52
|
if (stats?.requestsByProvider) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cliproxy-auth-routes.js","sourceRoot":"","sources":["../../../src/web-server/routes/cliproxy-auth-routes.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAEH,qCAAoD;AACpD,8DAKqC;AACrC,wFAGkD;AAClD,gEAAkE;AAClE,oEAMwC;AACxC,gFAAsE;AACtE,4EAA2E;AAG3E,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AAExB,uBAAuB;AACvB,MAAM,cAAc,GAAuB,
|
|
1
|
+
{"version":3,"file":"cliproxy-auth-routes.js","sourceRoot":"","sources":["../../../src/web-server/routes/cliproxy-auth-routes.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAEH,qCAAoD;AACpD,8DAKqC;AACrC,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AI,CAAC;IAEhC,IAAI,CAAC,UAAU,IAAI,UAAU,KAAK,EAAE,EAAE,CAAC;QACrC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,uDAAuD,EAAE,CAAC,CAAC;QACzF,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,kDAAsB,EAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;IAClE,IAAI,OAAO,EAAE,CAAC;QACZ,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9B,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,+CAA+C,EAAE,CAAC,CAAC;IACnF,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,kBAAe,MAAM,CAAC"}
|
|
@@ -44,7 +44,7 @@ const handleStatsRequest = async (_req, res) => {
|
|
|
44
44
|
const running = await (0, stats_fetcher_1.isCliproxyRunning)();
|
|
45
45
|
if (!running) {
|
|
46
46
|
res.status(503).json({
|
|
47
|
-
error: '
|
|
47
|
+
error: 'CLIProxy Plus not running',
|
|
48
48
|
message: 'Start a CLIProxy session (gemini, codex, agy) to collect stats',
|
|
49
49
|
});
|
|
50
50
|
return;
|
|
@@ -54,7 +54,7 @@ const handleStatsRequest = async (_req, res) => {
|
|
|
54
54
|
if (!stats) {
|
|
55
55
|
res.status(503).json({
|
|
56
56
|
error: 'Stats unavailable',
|
|
57
|
-
message: '
|
|
57
|
+
message: 'CLIProxy Plus is running but stats endpoint not responding',
|
|
58
58
|
});
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
@@ -170,7 +170,7 @@ router.get('/models', async (_req, res) => {
|
|
|
170
170
|
const running = await (0, stats_fetcher_1.isCliproxyRunning)();
|
|
171
171
|
if (!running) {
|
|
172
172
|
res.status(503).json({
|
|
173
|
-
error: '
|
|
173
|
+
error: 'CLIProxy Plus not running',
|
|
174
174
|
message: 'Start a CLIProxy session (gemini, codex, agy) to fetch available models',
|
|
175
175
|
});
|
|
176
176
|
return;
|
|
@@ -180,7 +180,7 @@ router.get('/models', async (_req, res) => {
|
|
|
180
180
|
if (!modelsResponse) {
|
|
181
181
|
res.status(503).json({
|
|
182
182
|
error: 'Models unavailable',
|
|
183
|
-
message: '
|
|
183
|
+
message: 'CLIProxy Plus is running but /v1/models endpoint not responding',
|
|
184
184
|
});
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
@@ -200,7 +200,7 @@ router.get('/error-logs', async (_req, res) => {
|
|
|
200
200
|
const running = await (0, stats_fetcher_1.isCliproxyRunning)();
|
|
201
201
|
if (!running) {
|
|
202
202
|
res.status(503).json({
|
|
203
|
-
error: '
|
|
203
|
+
error: 'CLIProxy Plus not running',
|
|
204
204
|
message: 'Start a CLIProxy session to view error logs',
|
|
205
205
|
});
|
|
206
206
|
return;
|
|
@@ -209,7 +209,7 @@ router.get('/error-logs', async (_req, res) => {
|
|
|
209
209
|
if (files === null) {
|
|
210
210
|
res.status(503).json({
|
|
211
211
|
error: 'Error logs unavailable',
|
|
212
|
-
message: '
|
|
212
|
+
message: 'CLIProxy Plus is running but error logs endpoint not responding',
|
|
213
213
|
});
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
@@ -244,7 +244,7 @@ router.get('/error-logs/:name', async (req, res) => {
|
|
|
244
244
|
try {
|
|
245
245
|
const running = await (0, stats_fetcher_1.isCliproxyRunning)();
|
|
246
246
|
if (!running) {
|
|
247
|
-
res.status(503).json({ error: '
|
|
247
|
+
res.status(503).json({ error: 'CLIProxy Plus not running' });
|
|
248
248
|
return;
|
|
249
249
|
}
|
|
250
250
|
const content = await (0, stats_fetcher_1.fetchCliproxyErrorLogContent)(name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cliproxy-stats-routes.js","sourceRoot":"","sources":["../../../src/web-server/routes/cliproxy-stats-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;QAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;QACnE,QAAQ,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,IAAI,EAAE,CAAC;QAClC,QAAQ,CAAC,GAAG,CAAC,eAAe,GAAG,KAAK,CAAC;QAErC,mBAAmB;QACnB,MAAM,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC;QACvC,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;QACrE,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QAEtC,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,kBAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{j as e,W as Ye,X as Ze,Y as es,Z as ss,_ as ts}from"./radix-ui-CrW4rUOS.js";import{r as p}from"./react-vendor-B_CU-WTZ.js";import{u as Ae,a as Se,b as as}from"./tanstack-Dbfprw6o.js";import{a as g,c as C,P as te,L as K,I as ae,O as Pe,Q as ke,U as Oe,V as Me,W as ee,X as De,Y as ns,Z as Te,u as _e,_ as ne,$ as ie,a0 as re,a1 as oe,a2 as Le,a3 as pe,a4 as ge,B as T,a5 as is,m as Ee,i as le,a6 as rs,a7 as os,a8 as ls,a9 as cs,D as ds,E as ms,F as fe,G as je,aa as us,ab as xs,ac as hs,ad as ps,ae as gs,af as fs,ag as js,ah as vs,ai as Ns,aj as ws,S as bs}from"./index-BhG5iXmB.js";import{t as L}from"./notifications-dJQY2-U6.js";import{b as Re,L as q,D as ce,T as ys,j as U,q as Cs,af as de,_ as F,ag as V,N as G,ah as W,Z as X,I as As,f as Ss,Q as Ie,a9 as Ps,X as me,J as Fe,o as Ue,ai as ks,a8 as He,ac as Os,A as ve,aj as Ne,ak as we,U as Ms,al as Ds,am as Ts,an as $e}from"./icons-ChQ4a4K4.js";import{C as Ve,a as ze}from"./card-z3bzNTGJ.js";import{S as ue,C as _s}from"./confirm-dialog-CCbqijOM.js";import"./utils-CzKF5WmX.js";import"./form-utils-kUVlZZAO.js";import"./code-highlight-DKN39ySy.js";const z={agy:{provider:"agy",displayName:"Antigravity",defaultModel:"gemini-claude-opus-4-5-thinking",models:[{id:"gemini-claude-opus-4-5-thinking",name:"Claude Opus 4.5 Thinking",description:"Most capable, extended thinking",presetMapping:{default:"gemini-claude-opus-4-5-thinking",opus:"gemini-claude-opus-4-5-thinking",sonnet:"gemini-claude-sonnet-4-5-thinking",haiku:"gemini-claude-sonnet-4-5"}},{id:"gemini-claude-sonnet-4-5-thinking",name:"Claude Sonnet 4.5 Thinking",description:"Balanced with extended thinking",presetMapping:{default:"gemini-claude-sonnet-4-5-thinking",opus:"gemini-claude-opus-4-5-thinking",sonnet:"gemini-claude-sonnet-4-5-thinking",haiku:"gemini-claude-sonnet-4-5"}},{id:"gemini-claude-sonnet-4-5",name:"Claude Sonnet 4.5",description:"Fast and capable",presetMapping:{default:"gemini-claude-sonnet-4-5",opus:"gemini-claude-opus-4-5-thinking",sonnet:"gemini-claude-sonnet-4-5",haiku:"gemini-claude-sonnet-4-5"}},{id:"gemini-3-pro-preview",name:"Gemini 3 Pro",description:"Google latest model via Antigravity",presetMapping:{default:"gemini-3-pro-preview",opus:"gemini-3-pro-preview",sonnet:"gemini-3-pro-preview",haiku:"gemini-2.5-flash"}}]},gemini:{provider:"gemini",displayName:"Gemini",defaultModel:"gemini-2.5-pro",models:[{id:"gemini-3-pro-preview",name:"Gemini 3 Pro",tier:"paid",description:"Latest model, requires paid Google account",presetMapping:{default:"gemini-3-pro-preview",opus:"gemini-3-pro-preview",sonnet:"gemini-3-pro-preview",haiku:"gemini-2.5-flash"}},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro",description:"Stable, works with free Google account",presetMapping:{default:"gemini-2.5-pro",opus:"gemini-2.5-pro",sonnet:"gemini-2.5-pro",haiku:"gemini-2.5-flash"}}]},codex:{provider:"codex",displayName:"Codex",defaultModel:"gpt-5.1-codex-max",models:[{id:"gpt-5.1-codex-max",name:"Codex Max (5.1)",description:"Most capable Codex model",presetMapping:{default:"gpt-5.1-codex-max",opus:"gpt-5.1-codex-max-high",sonnet:"gpt-5.1-codex-max",haiku:"gpt-5.1-codex-mini-high"}},{id:"gpt-5.2",name:"GPT 5.2",description:"Latest GPT model",presetMapping:{default:"gpt-5.2",opus:"gpt-5.2",sonnet:"gpt-5.2",haiku:"gpt-5.2"}},{id:"gpt-5.1-codex-mini",name:"Codex Mini",description:"Fast and efficient Codex model"}]},qwen:{provider:"qwen",displayName:"Qwen",defaultModel:"qwen-coder-plus",models:[{id:"qwen-coder-plus",name:"Qwen Coder Plus",description:"Alibaba code-focused model"},{id:"qwen-max",name:"Qwen Max",description:"Most capable Qwen model"}]},iflow:{provider:"iflow",displayName:"iFlow",defaultModel:"iflow-default",models:[{id:"iflow-default",name:"iFlow Default",description:"Default iFlow model"}]}},se=8317;async function qe(s){const a=z[s];if(!a)return{success:!1};const t=a.models[0],n=t?.presetMapping||{default:a.defaultModel,opus:a.defaultModel,sonnet:a.defaultModel,haiku:a.defaultModel},i={env:{ANTHROPIC_BASE_URL:`http://127.0.0.1:${se}/api/provider/${s}`,ANTHROPIC_AUTH_TOKEN:"ccs-internal-managed",ANTHROPIC_MODEL:n.default,ANTHROPIC_DEFAULT_OPUS_MODEL:n.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:n.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:n.haiku}};try{return{success:(await fetch(`/api/settings/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:i})})).ok,presetName:t?.name||a.defaultModel}}catch{return{success:!1}}}const be=[{id:"gemini",name:"Google Gemini",description:"Gemini Pro/Flash models"},{id:"codex",name:"OpenAI Codex",description:"GPT-4 and codex models"},{id:"agy",name:"Antigravity",description:"Antigravity AI models"},{id:"qwen",name:"Alibaba Qwen",description:"Qwen Code models"},{id:"iflow",name:"iFlow",description:"iFlow AI models"}],Ge=["provider","auth","variant","success"];function Ls(s){return s==="account"?1:Ge.indexOf(s)}function Es({currentProgress:s,allSteps:a}){return e.jsx("div",{className:"flex justify-center gap-1 pt-2",children:a.map((t,n)=>e.jsx("div",{className:`w-2 h-2 rounded-full transition-colors ${s>=n?"bg-primary":"bg-muted"}`},t))})}function Rs({providers:s,onSelect:a}){return e.jsx("div",{className:"grid gap-2",children:s.map(t=>e.jsxs("button",{onClick:()=>a(t.id),className:"flex items-center justify-between p-3 border rounded-lg hover:bg-muted/50 transition-colors text-left",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:t.name}),e.jsx("div",{className:"text-xs text-muted-foreground",children:t.description})]}),e.jsx(Re,{className:"w-4 h-4 text-muted-foreground"})]},t.id))})}function Is({selectedProvider:s,providers:a,authCommand:t,isRefreshing:n,isPending:i,onBack:c,onStartAuth:l,onRefresh:u}){const[r,x]=p.useState(!1),d=async h=>{await navigator.clipboard.writeText(h),x(!0),setTimeout(()=>x(!1),2e3)};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"text-center space-y-3",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Authenticate with ",a.find(h=>h.id===s)?.name," to add an account"]}),e.jsx(g,{onClick:l,disabled:i,className:"w-full gap-2",size:"lg",children:i?e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"w-4 h-4 animate-spin"}),"Authenticating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ce,{className:"w-4 h-4"}),"Authenticate in Browser"]})}),i&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"Complete the OAuth flow in your browser..."})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or use terminal"})})]}),e.jsx(Ve,{children:e.jsxs(ze,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(ys,{className:"w-4 h-4"}),"Run this command in your terminal:"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 px-3 py-2 bg-muted rounded-md font-mono text-sm",children:t}),e.jsx(g,{variant:"outline",size:"icon",onClick:()=>d(t),children:r?e.jsx(U,{className:"w-4 h-4 text-green-500"}):e.jsx(Cs,{className:"w-4 h-4"})})]})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(g,{variant:"ghost",onClick:c,disabled:i,children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),"Back"]}),e.jsxs(g,{variant:"outline",onClick:u,disabled:n||i,children:[e.jsx(F,{className:`w-4 h-4 mr-2 ${n?"animate-spin":""}`}),n?"Checking...":"Refresh Status"]})]})]})}function Fs({accounts:s,privacyMode:a,onSelect:t,onAddNew:n,onBack:i}){return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:["Select an account (",s.length,")"]}),e.jsx("div",{className:"grid gap-2",children:s.map(c=>e.jsxs("button",{type:"button",onClick:()=>t(c),className:"flex items-center justify-between p-3 border rounded-lg hover:bg-muted/50 transition-colors text-left",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex items-center justify-center",children:e.jsx(V,{className:"w-4 h-4 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsx("div",{className:C("font-medium",a&&te),children:c.email||c.id}),c.isDefault&&e.jsx("div",{className:"text-xs text-muted-foreground",children:"Default account"})]})]}),e.jsx(Re,{className:"w-4 h-4 text-muted-foreground"})]},c.id))}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or"})})]}),e.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 p-3 border-2 border-dashed border-primary/50 rounded-lg hover:border-primary hover:bg-primary/5 transition-colors text-left",onClick:n,children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center shrink-0",children:e.jsx(ce,{className:"w-4 h-4 text-primary"})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-primary",children:"Add new account"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"Authenticate with a different account"})]})]}),e.jsx("div",{className:"flex items-center justify-between pt-2",children:e.jsxs(g,{variant:"ghost",onClick:i,children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),"Back"]})})]})}function Us({selectedProvider:s,selectedAccount:a,variantName:t,modelName:n,isPending:i,privacyMode:c,onVariantNameChange:l,onModelChange:u,onBack:r,onSkip:x,onCreate:d}){return e.jsxs("div",{className:"space-y-4",children:[a&&e.jsxs("div",{className:"flex items-center gap-2 p-2 bg-muted/50 rounded-md text-sm",children:[e.jsx(V,{className:"w-4 h-4"}),e.jsxs("span",{children:["Using:"," ",e.jsx("span",{className:C(c&&te),children:a.email||a.id})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{htmlFor:"variant-name",children:"Variant Name *"}),e.jsx(ae,{id:"variant-name",value:t,onChange:h=>l(h.target.value),placeholder:"e.g., my-gemini, g3, flash"}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Use this name to invoke: ccs ",t||"<name>",' "prompt"']})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{children:"Model"}),e.jsxs(Pe,{value:n,onValueChange:u,children:[e.jsx(ke,{children:e.jsx(Oe,{placeholder:"Select a model"})}),e.jsx(Me,{children:z[s]?.models.map(h=>e.jsx(ee,{value:h.id,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:h.name}),h.description&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:["- ",h.description]})]})},h.id))})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Default: ",z[s]?.defaultModel||"provider default"]})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2",children:[e.jsxs(g,{variant:"ghost",onClick:r,children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),"Back"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{variant:"ghost",onClick:x,children:"Skip"}),e.jsx(g,{onClick:d,disabled:!t||i,children:i?"Creating...":"Create Variant"})]})]}),e.jsx("p",{className:"text-xs text-center text-muted-foreground",children:"Skip if you just wanted to add an account without creating a variant"})]})}function Hs({variantName:s,onClose:a}){return e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"w-16 h-16 bg-green-100 dark:bg-green-900/30 rounded-full flex items-center justify-center",children:e.jsx(U,{className:"w-8 h-8 text-green-600 dark:text-green-400"})})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-lg",children:"Variant Created!"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Your custom variant is ready to use"})]}),e.jsx(Ve,{children:e.jsxs(ze,{className:"p-4 space-y-2",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Usage:"}),e.jsxs("code",{className:"block px-3 py-2 bg-muted rounded-md font-mono text-sm",children:["ccs ",s,' "your prompt here"']})]})}),e.jsx(g,{onClick:a,className:"w-full",children:"Done"})]})}function $s({open:s,onClose:a}){const[t,n]=p.useState("provider"),[i,c]=p.useState(""),[l,u]=p.useState(null),[r,x]=p.useState(""),[d,h]=p.useState(""),[f,o]=p.useState(!1),[j,A]=p.useState(!1),{data:N,refetch:D}=De(),k=ns(),O=Te(),{privacyMode:y}=_e(),w=N?.authStatus.find(v=>v.provider===i),P=p.useMemo(()=>w?.accounts||[],[w?.accounts]);p.useEffect(()=>{if(!s){const v=setTimeout(()=>{n("provider"),c(""),u(null),x(""),h(""),A(!1)},0);return()=>clearTimeout(v)}},[s]),p.useEffect(()=>{if(t==="auth"&&P.length>0&&!j){const v=setTimeout(()=>{n("account")},0);return()=>clearTimeout(v)}},[t,P,j]);const b=async()=>{o(!0),await D(),o(!1)},S=()=>{const v=(w?.accounts?.length||0)===0;O.mutate({provider:i},{onSuccess:async $=>{if(v){const E=await qe(i);E.success&&E.presetName?L.success(`Applied "${E.presetName}" preset`):E.success||L.warning("Account added, but failed to apply default preset")}$.account&&(u($.account),n("variant")),D()}})},_=v=>{c(v),(N?.authStatus.find(Z=>Z.provider===v)?.accounts||[]).length===0?n("auth"):n("account")},m=v=>{u(v),n("variant")},H=async()=>{if(!(!r||!i))try{await k.mutateAsync({name:r,provider:i,model:d||void 0,account:l?.id}),n("success")}catch(v){console.error("Failed to create variant:",v)}},B=`ccs ${i} --auth --add`,J=Ls(t),Y=v=>{if(!v&&(t==="success"||t==="provider")){a();return}};return e.jsx(ne,{open:s,onOpenChange:Y,children:e.jsxs(ie,{className:"sm:max-w-lg",onPointerDownOutside:v=>{t!=="success"&&t!=="provider"&&v.preventDefault()},onEscapeKeyDown:v=>{(O.isPending||k.isPending)&&v.preventDefault()},children:[e.jsxs(re,{children:[e.jsxs(oe,{className:"flex items-center gap-2",children:[e.jsx(G,{className:"w-5 h-5 text-primary"}),"Quick Setup Wizard"]}),e.jsxs(Le,{children:[t==="provider"&&"Select a provider to get started",t==="auth"&&"Authenticate with your provider",t==="account"&&"Select which account to use",t==="variant"&&"Create your custom variant",t==="success"&&"Setup complete!"]})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[t==="provider"&&e.jsx(Rs,{providers:be,onSelect:_}),t==="auth"&&e.jsx(Is,{selectedProvider:i,providers:be,authCommand:B,isRefreshing:f,isPending:O.isPending,onBack:()=>n("provider"),onStartAuth:S,onRefresh:b}),t==="account"&&e.jsx(Fs,{accounts:P,privacyMode:y,onSelect:m,onAddNew:()=>{A(!0),n("auth")},onBack:()=>n("provider")}),t==="variant"&&e.jsx(Us,{selectedProvider:i,selectedAccount:l,variantName:r,modelName:d,isPending:k.isPending,privacyMode:y,onVariantNameChange:x,onModelChange:h,onBack:()=>P.length>0?n("account"):n("provider"),onSkip:a,onCreate:H}),t==="success"&&e.jsx(Hs,{variantName:r,onClose:a})]}),e.jsx(Es,{currentProgress:J,allSteps:Ge})]})})}function Vs({open:s,onClose:a,provider:t,displayName:n,isFirstAccount:i=!1}){const[c,l]=p.useState(""),u=Te(),r=()=>{u.mutate({provider:t,nickname:c.trim()||void 0},{onSuccess:async()=>{if(i){const d=await qe(t);d.success&&d.presetName?L.success(`Applied "${d.presetName}" preset`):d.success||L.warning("Account added, but failed to apply default preset")}l(""),a()}})},x=d=>{!d&&!u.isPending&&(l(""),a())};return e.jsx(ne,{open:s,onOpenChange:x,children:e.jsxs(ie,{className:"sm:max-w-md",children:[e.jsxs(re,{children:[e.jsxs(oe,{children:["Add ",n," Account"]}),e.jsx(Le,{children:"Click the button below to authenticate a new account. A browser window will open for OAuth."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{htmlFor:"nickname",children:"Nickname (optional)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{className:"w-4 h-4 text-muted-foreground"}),e.jsx(ae,{id:"nickname",value:c,onChange:d=>l(d.target.value),placeholder:"e.g., work, personal",disabled:u.isPending,className:"flex-1"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"A friendly name to identify this account. Auto-generated from email if left empty."})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[e.jsx(g,{variant:"ghost",onClick:a,disabled:u.isPending,children:"Cancel"}),e.jsx(g,{onClick:r,disabled:u.isPending,children:u.isPending?e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"w-4 h-4 mr-2 animate-spin"}),"Authenticating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ce,{className:"w-4 h-4 mr-2"}),"Authenticate"]})})]}),u.isPending&&e.jsx("p",{className:"text-sm text-center text-muted-foreground",children:"Complete the OAuth flow in your browser..."})]})]})})}function zs(s){const[a,t]=p.useState(null),[n,i]=p.useState(!1),c=Ae(),{data:l,isLoading:u,refetch:r}=Se({queryKey:["settings",s],queryFn:async()=>{const b=await fetch(`/api/settings/${s}/raw`);return b.ok?b.json():{profile:s,settings:{env:{}},mtime:Date.now(),path:`~/.ccs/profiles/${s}/settings.json`}}}),x=l?.settings,d=p.useMemo(()=>a!==null?a:x?JSON.stringify(x,null,2):`{
|
|
2
|
-
"env": {}
|
|
3
|
-
}`,[a,x]),h=p.useCallback(b=>{t(b)},[]),f=p.useMemo(()=>{try{return JSON.parse(d)}catch{return x||{env:{}}}},[d,x]),o=f?.env?.ANTHROPIC_MODEL,j=f?.env?.ANTHROPIC_DEFAULT_OPUS_MODEL,A=f?.env?.ANTHROPIC_DEFAULT_SONNET_MODEL,N=f?.env?.ANTHROPIC_DEFAULT_HAIKU_MODEL,D=p.useCallback((b,S)=>{const _={...f?.env||{},[b]:S},m={...f,env:_};t(JSON.stringify(m,null,2))},[f]),k=p.useCallback(b=>{const S={...f?.env||{},...b},_={...f,env:S};t(JSON.stringify(_,null,2))},[f]),O=p.useMemo(()=>{try{return JSON.parse(d),!0}catch{return!1}},[d]),y=p.useMemo(()=>a===null?!1:a!==JSON.stringify(x,null,2),[a,x]),w=as({mutationFn:async()=>{const b=JSON.parse(d),S=await fetch(`/api/settings/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:b,expectedMtime:l?.mtime})});if(S.status===409)throw new Error("CONFLICT");if(!S.ok)throw new Error("Failed to save");return S.json()},onSuccess:()=>{c.invalidateQueries({queryKey:["settings",s]}),t(null),L.success("Settings saved")},onError:b=>{b.message==="CONFLICT"?i(!0):L.error(b.message)}}),P=async b=>{i(!1),b?(await r(),w.mutate()):t(null)};return{data:l,isLoading:u,refetch:r,rawJsonContent:d,rawJsonEdits:a,isRawJsonValid:O,hasChanges:y,currentSettings:f,currentModel:o,opusModel:j,sonnetModel:A,haikuModel:N,handleRawJsonChange:h,updateEnvValue:D,updateEnvValues:k,saveMutation:{mutate:()=>w.mutate(),isPending:w.isPending},conflictDialog:n,setConflictDialog:i,handleConflictResolve:P}}function R({label:s,description:a,value:t,onChange:n,catalog:i,allModels:c,disabled:l}){const u=new Set(i?.models.map(r=>r.id)||[]);return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium",children:s}),a&&e.jsx("p",{className:"text-[10px] text-muted-foreground",children:a})]}),e.jsxs(Pe,{value:t||"",onValueChange:n,disabled:l,children:[e.jsx(ke,{className:"h-9",children:e.jsx(Oe,{placeholder:"Select model",children:t&&e.jsx("span",{className:"truncate font-mono text-xs",children:t})})}),e.jsxs(Me,{className:"max-h-[300px]",children:[i&&i.models.length>0&&e.jsxs(pe,{children:[e.jsx(ge,{className:"text-xs text-primary",children:"Recommended"}),i.models.map(r=>e.jsx(ee,{value:r.id,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:r.id}),r.tier==="paid"&&e.jsx(T,{variant:"outline",className:"text-[9px] h-4 px-1",children:"PAID"}),t===r.id&&e.jsx(U,{className:"w-3 h-3 text-primary ml-auto"})]})},r.id))]}),c.length>0&&e.jsxs(pe,{children:[e.jsxs(ge,{className:"text-xs text-muted-foreground",children:["All Models (",c.length,")"]}),c.filter(r=>!u.has(r.id)).map(r=>e.jsx(ee,{value:r.id,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:r.id}),t===r.id&&e.jsx(U,{className:"w-3 h-3 text-primary ml-auto"})]})},r.id))]}),(!i||i.models.length===0)&&c.length===0&&e.jsx("div",{className:"py-2 px-3 text-xs text-muted-foreground",children:"No models available"})]})]})]})}function qs({open:s,onClose:a,currentValues:t,onApply:n,onSave:i,isSaving:c,catalog:l,allModels:u}){const[r,x]=p.useState(t),[d,h]=p.useState(""),f=o=>{o?(x(t),h("")):a()};return e.jsx(ne,{open:s,onOpenChange:f,children:e.jsxs(ie,{className:"sm:max-w-md",children:[e.jsx(re,{children:e.jsxs(oe,{className:"flex items-center gap-2",children:[e.jsx(G,{className:"w-4 h-4"}),"Custom Preset"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(K,{htmlFor:"preset-name",children:"Preset Name (optional)"}),e.jsx(ae,{id:"preset-name",value:d,onChange:o=>h(o.target.value),placeholder:"e.g., My Custom Config",className:"text-sm"})]}),e.jsx(ue,{}),e.jsx(R,{label:"Default Model",description:"Used when no specific tier is requested",value:r.default,onChange:o=>x({...r,default:o}),catalog:l,allModels:u}),e.jsx(R,{label:"Opus (Most capable)",description:"For complex reasoning tasks",value:r.opus,onChange:o=>x({...r,opus:o}),catalog:l,allModels:u}),e.jsx(R,{label:"Sonnet (Balanced)",description:"Balance of speed and capability",value:r.sonnet,onChange:o=>x({...r,sonnet:o}),catalog:l,allModels:u}),e.jsx(R,{label:"Haiku (Fast)",description:"Quick responses for simple tasks",value:r.haiku,onChange:o=>x({...r,haiku:o}),catalog:l,allModels:u})]}),e.jsxs(is,{className:"gap-2 sm:gap-0",children:[e.jsx(g,{variant:"outline",onClick:a,children:"Cancel"}),i&&e.jsxs(g,{variant:"secondary",onClick:()=>i(r,d||void 0),disabled:c||!d.trim(),children:[c?e.jsx(q,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx(W,{className:"w-4 h-4 mr-1"}),"Save Preset"]}),e.jsxs(g,{onClick:()=>n(r,d||void 0),children:[e.jsx(X,{className:"w-4 h-4 mr-1"}),"Apply Preset"]})]})]})})}function Q({label:s,command:a}){return e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground",children:s}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsx("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:a}),e.jsx(Ee,{value:a,size:"icon",className:"h-6 w-6"})]})]})}function Gs({provider:s,displayName:a,data:t,authStatus:n}){return e.jsx(le,{className:"h-full",children:e.jsxs("div",{className:"p-4 space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2 mb-3",children:[e.jsx(As,{className:"w-4 h-4"}),"Provider Information"]}),e.jsxs("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:[e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Provider"}),e.jsx("span",{className:"font-mono",children:a})]}),t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"File Path"}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs break-all",children:t.path}),e.jsx(Ee,{value:t.path,size:"icon",className:"h-5 w-5"})]})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Last Modified"}),e.jsx("span",{className:"text-xs",children:new Date(t.mtime).toLocaleString()})]})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Status"}),n.authenticated?e.jsxs(T,{variant:"outline",className:"w-fit text-green-600 border-green-200 bg-green-50",children:[e.jsx(Ss,{className:"w-3 h-3 mr-1"}),"Authenticated"]}):e.jsx(T,{variant:"outline",className:"w-fit text-muted-foreground",children:"Not connected"})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-3",children:"Quick Usage"}),e.jsxs("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:[e.jsx(Q,{label:"Run with prompt",command:`ccs ${s} "your prompt"`}),e.jsx(Q,{label:"Change model",command:`ccs ${s} --config`}),e.jsx(Q,{label:"Add account",command:`ccs ${s} --add`}),e.jsx(Q,{label:"List accounts",command:`ccs ${s} --accounts`})]})]})]})})}const Bs={gemini:"/assets/providers/gemini-color.svg",codex:"/assets/providers/openai.svg",agy:"/assets/providers/agy.png",qwen:"/assets/providers/qwen-color.svg",iflow:"/assets/providers/iflow.png"},Js={gemini:{text:"text-blue-600",letter:"G"},claude:{text:"text-orange-600",letter:"C"},codex:{text:"text-emerald-600",letter:"X"},agy:{text:"text-violet-600",letter:"A"},qwen:{text:"text-cyan-600",letter:"Q"},iflow:{text:"text-indigo-600",letter:"i"}},Qs={sm:{container:"w-6 h-6",icon:"w-4 h-4",text:"text-xs"},md:{container:"w-8 h-8",icon:"w-5 h-5",text:"text-sm"},lg:{container:"w-12 h-12",icon:"w-8 h-8",text:"text-lg"}};function xe({provider:s,className:a,size:t="md"}){const n=s.toLowerCase(),i=Js[n]||{text:"text-gray-600",letter:s[0]?.toUpperCase()||"?"},c=Qs[t],l=Bs[n];return e.jsx("div",{className:C("flex items-center justify-center rounded-md",l&&"bg-white p-1",c.container,a),children:l?e.jsx("img",{src:l,alt:`${s} logo`,className:C(c.icon,"object-contain")}):e.jsx("span",{className:C("font-semibold",i.text,c.text),children:i.letter})})}function Ks({displayName:s,logoProvider:a,provider:t,data:n,isLoading:i,hasChanges:c,isRawJsonValid:l,isSaving:u,isRemoteMode:r,onRefetch:x,onSave:d}){return e.jsxs("div",{className:"px-6 py-4 border-b bg-background flex items-center justify-between shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(xe,{provider:a||t,size:"lg"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold",children:s}),r&&e.jsxs(T,{variant:"secondary",className:"text-xs gap-1 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:[e.jsx(Ie,{className:"w-3 h-3"}),"Remote"]}),!r&&n?.path&&e.jsx(T,{variant:"outline",className:"text-xs",children:n.path.replace(/^.*[\\/]/,"")})]}),r?e.jsx("p",{className:"text-xs text-blue-600 dark:text-blue-400 mt-0.5",children:"Traffic auto-routed to remote server"}):n&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Last modified: ",new Date(n.mtime).toLocaleString()]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{variant:"ghost",size:"sm",onClick:x,disabled:i,children:e.jsx(F,{className:`w-4 h-4 ${i?"animate-spin":""}`})}),e.jsx(g,{size:"sm",onClick:d,disabled:u||!c||!l,children:u?e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"w-4 h-4 mr-1 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ps,{className:"w-4 h-4 mr-1"}),"Save"]})})]})]})}function Ws({catalog:s,savedPresets:a,currentModel:t,opusModel:n,sonnetModel:i,haikuModel:c,providerModels:l,onApplyPreset:u,onUpdateEnvValue:r,onOpenCustomPreset:x,onDeletePreset:d,isDeletePending:h}){const f=s&&s.models.length>0||a.length>0;return e.jsxs(e.Fragment,{children:[f&&e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium mb-2 flex items-center gap-2",children:[e.jsx(G,{className:"w-4 h-4"}),"Presets"]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Apply pre-configured model mappings"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[s?.models.slice(0,3).map(o=>e.jsxs(g,{variant:"outline",size:"sm",className:"text-xs h-7 gap-1",onClick:()=>{const j=o.presetMapping||{default:o.id,opus:o.id,sonnet:o.id,haiku:o.id};u({ANTHROPIC_MODEL:j.default,ANTHROPIC_DEFAULT_OPUS_MODEL:j.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:j.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:j.haiku})},children:[e.jsx(X,{className:"w-3 h-3"}),o.name]},o.id)),a.map(o=>e.jsxs("div",{className:"group relative",children:[e.jsxs(g,{variant:"secondary",size:"sm",className:"text-xs h-7 gap-1 pr-6",onClick:()=>{u({ANTHROPIC_MODEL:o.default,ANTHROPIC_DEFAULT_OPUS_MODEL:o.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:o.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:o.haiku})},children:[e.jsx(W,{className:"w-3 h-3 fill-current"}),o.name]}),e.jsx(g,{variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-7 w-5 opacity-0 group-hover:opacity-100 hover:text-destructive",onClick:j=>{j.stopPropagation(),d(o.name)},disabled:h,children:e.jsx(me,{className:"w-3 h-3"})})]},o.name)),e.jsxs(g,{variant:"outline",size:"sm",className:"text-xs h-7 gap-1 border-primary/50 text-primary hover:bg-primary/10 hover:border-primary",onClick:x,children:[e.jsx(Fe,{className:"w-3 h-3"}),"Custom"]})]})]}),e.jsx(ue,{}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-2",children:"Model Mapping"}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Configure which models to use for each tier"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(R,{label:"Default Model",description:"Used when no specific tier is requested",value:t,onChange:o=>r("ANTHROPIC_MODEL",o),catalog:s,allModels:l}),e.jsx(R,{label:"Opus (Most capable)",description:"For complex reasoning tasks",value:n,onChange:o=>r("ANTHROPIC_DEFAULT_OPUS_MODEL",o),catalog:s,allModels:l}),e.jsx(R,{label:"Sonnet (Balanced)",description:"Balance of speed and capability",value:i,onChange:o=>r("ANTHROPIC_DEFAULT_SONNET_MODEL",o),catalog:s,allModels:l}),e.jsx(R,{label:"Haiku (Fast)",description:"Quick responses for simple tasks",value:c,onChange:o=>r("ANTHROPIC_DEFAULT_HAIKU_MODEL",o),catalog:s,allModels:l})]})]})]})}function Xs({...s}){return e.jsx(Ye,{"data-slot":"dropdown-menu",...s})}function Ys({...s}){return e.jsx(Ze,{"data-slot":"dropdown-menu-trigger",...s})}function Zs({className:s,sideOffset:a=4,...t}){return e.jsx(es,{children:e.jsx(ss,{"data-slot":"dropdown-menu-content",sideOffset:a,className:C("bg-popover text-popover-foreground 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md bg-white dark:bg-zinc-950",s),...t})})}function ye({className:s,inset:a,variant:t="default",...n}){return e.jsx(ts,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":t,className:C("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-current relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),...n})}function et({account:s,onSetDefault:a,onRemove:t,isRemoving:n,privacyMode:i}){return e.jsxs("div",{className:C("flex items-center justify-between p-3 rounded-lg border transition-colors",s.isDefault?"border-primary/30 bg-primary/5":"border-border hover:bg-muted/30"),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:C("flex items-center justify-center w-8 h-8 rounded-full",s.isDefault?"bg-primary/10":"bg-muted"),children:e.jsx(V,{className:"w-4 h-4"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:C("font-medium text-sm",i&&te),children:s.email||s.id}),s.isDefault&&e.jsxs(T,{variant:"secondary",className:"text-[10px] h-4 px-1.5 gap-0.5",children:[e.jsx(W,{className:"w-2.5 h-2.5 fill-current"}),"Default"]})]}),s.lastUsedAt&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground mt-0.5",children:[e.jsx(Ue,{className:"w-3 h-3"}),"Last used: ",new Date(s.lastUsedAt).toLocaleDateString()]})]})]}),e.jsxs(Xs,{children:[e.jsx(Ys,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"icon",className:"h-7 w-7",children:e.jsx(ks,{className:"w-4 h-4"})})}),e.jsxs(Zs,{align:"end",children:[!s.isDefault&&e.jsxs(ye,{onClick:a,children:[e.jsx(W,{className:"w-4 h-4 mr-2"}),"Set as default"]}),e.jsxs(ye,{className:"text-destructive focus:text-destructive",onClick:t,disabled:n,children:[e.jsx(He,{className:"w-4 h-4 mr-2"}),n?"Removing...":"Remove account"]})]})]})]})}function st({accounts:s,onAddAccount:a,onSetDefault:t,onRemoveAccount:n,isRemovingAccount:i,privacyMode:c}){return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(V,{className:"w-4 h-4"}),"Accounts",s.length>0&&e.jsx(T,{variant:"secondary",className:"text-xs",children:s.length})]}),e.jsxs(g,{variant:"default",size:"sm",className:"h-7 text-xs gap-1",onClick:a,children:[e.jsx(Fe,{className:"w-3 h-3"}),"Add"]})]}),s.length>0?e.jsx("div",{className:"space-y-2",children:s.map(l=>e.jsx(et,{account:l,onSetDefault:()=>t(l.id),onRemove:()=>n(l.id),isRemoving:i,privacyMode:c},l.id))}):e.jsxs("div",{className:"py-6 text-center text-muted-foreground bg-muted/30 rounded-lg border border-dashed",children:[e.jsx(V,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No accounts connected"}),e.jsx("p",{className:"text-xs opacity-70",children:"Add an account to get started"})]})]})}function tt({catalog:s,savedPresets:a,currentModel:t,opusModel:n,sonnetModel:i,haikuModel:c,providerModels:l,onApplyPreset:u,onUpdateEnvValue:r,onOpenCustomPreset:x,onDeletePreset:d,isDeletePending:h,accounts:f,onAddAccount:o,onSetDefault:j,onRemoveAccount:A,isRemovingAccount:N,privacyMode:D}){return e.jsx(le,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-6",children:[e.jsx(Ws,{catalog:s,savedPresets:a,currentModel:t,opusModel:n,sonnetModel:i,haikuModel:c,providerModels:l,onApplyPreset:u,onUpdateEnvValue:r,onOpenCustomPreset:x,onDeletePreset:d,isDeletePending:h}),e.jsx(ue,{}),e.jsx(st,{accounts:f,onAddAccount:o,onSetDefault:j,onRemoveAccount:A,isRemovingAccount:N,privacyMode:D})]})})}function Ce({provider:s,displayName:a,authStatus:t,catalog:n,logoProvider:i,isRemoteMode:c,onAddAccount:l,onSetDefault:u,onRemoveAccount:r,isRemovingAccount:x}){const[d,h]=p.useState(!1),{privacyMode:f}=_e(),{data:o}=rs(),{data:j}=os(s),A=ls(),N=cs(),D=j?.presets||[],k=p.useMemo(()=>{if(!o?.models)return[];const I={gemini:["google"],agy:["antigravity"],codex:["openai"],qwen:["alibaba","qwen"],iflow:["iflow"]}[s.toLowerCase()]||[s.toLowerCase()];return o.models.filter(We=>I.some(Xe=>We.owned_by.toLowerCase().includes(Xe)))},[o,s]),{data:O,isLoading:y,refetch:w,rawJsonContent:P,rawJsonEdits:b,isRawJsonValid:S,hasChanges:_,currentModel:m,opusModel:H,sonnetModel:B,haikuModel:J,handleRawJsonChange:Y,updateEnvValue:v,updateEnvValues:$,saveMutation:E,conflictDialog:Z,handleConflictResolve:he}=zs(s),Be=t.accounts||[],Je=M=>{$({ANTHROPIC_BASE_URL:`http://127.0.0.1:${se}/api/provider/${s}`,ANTHROPIC_AUTH_TOKEN:"ccs-internal-managed",...M}),L.success(`Applied "${M.ANTHROPIC_MODEL?.split("/").pop()||"preset"}" preset`)},Qe=(M,I)=>{$({ANTHROPIC_BASE_URL:`http://127.0.0.1:${se}/api/provider/${s}`,ANTHROPIC_AUTH_TOKEN:"ccs-internal-managed",ANTHROPIC_MODEL:M.default,ANTHROPIC_DEFAULT_OPUS_MODEL:M.opus,ANTHROPIC_DEFAULT_SONNET_MODEL:M.sonnet,ANTHROPIC_DEFAULT_HAIKU_MODEL:M.haiku}),L.success(`Applied ${I?`"${I}"`:"custom"} preset`),h(!1)},Ke=(M,I)=>{if(!I){L.error("Please enter a preset name to save");return}A.mutate({profile:s,data:{name:I,...M}}),h(!1)};return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx(Ks,{provider:s,displayName:a,logoProvider:i,data:O,isLoading:y,hasChanges:_,isRawJsonValid:S,isSaving:E.isPending,isRemoteMode:c,onRefetch:w,onSave:()=>E.mutate()}),y?e.jsxs("div",{className:"flex-1 flex items-center justify-center",children:[e.jsx(q,{className:"w-8 h-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"Loading settings..."})]}):e.jsxs("div",{className:"flex-1 grid grid-cols-[40%_60%] divide-x overflow-hidden",children:[e.jsx("div",{className:"flex flex-col overflow-hidden bg-muted/5",children:e.jsxs(ds,{defaultValue:"config",className:"h-full flex flex-col",children:[e.jsx("div",{className:"px-4 pt-4 shrink-0",children:e.jsxs(ms,{className:"w-full",children:[e.jsx(fe,{value:"config",className:"flex-1",children:"Model Config"}),e.jsx(fe,{value:"info",className:"flex-1",children:"Info & Usage"})]})}),e.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[e.jsx(je,{value:"config",className:"flex-1 mt-0 border-0 p-0 data-[state=inactive]:hidden flex flex-col overflow-hidden",children:e.jsx(tt,{catalog:n,savedPresets:D,currentModel:m,opusModel:H,sonnetModel:B,haikuModel:J,providerModels:k,onApplyPreset:Je,onUpdateEnvValue:v,onOpenCustomPreset:()=>h(!0),onDeletePreset:M=>N.mutate({profile:s,name:M}),isDeletePending:N.isPending,accounts:Be,onAddAccount:l,onSetDefault:u,onRemoveAccount:r,isRemovingAccount:x,privacyMode:f})}),e.jsx(je,{value:"info",className:"h-full mt-0 border-0 p-0 data-[state=inactive]:hidden",children:e.jsx(Gs,{provider:s,displayName:a,data:O,authStatus:t})})]})]})}),e.jsxs("div",{className:"flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"px-6 py-2 bg-muted/30 border-b flex items-center gap-2 shrink-0 h-[45px]",children:[e.jsx(Os,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Raw Configuration (JSON)"})]}),e.jsx(us,{rawJsonContent:P,isRawJsonValid:S,rawJsonEdits:b,onRawJsonChange:Y,profileEnv:O?.settings?.env})]})]}),e.jsx(_s,{open:Z,title:"File Modified Externally",description:"This settings file was modified by another process. Overwrite with your changes or discard?",confirmText:"Overwrite",variant:"destructive",onConfirm:()=>he(!0),onCancel:()=>he(!1)}),e.jsx(qs,{open:d,onClose:()=>h(!1),currentValues:{default:m||"",opus:H||"",sonnet:B||"",haiku:J||""},onApply:Qe,onSave:Ke,isSaving:A.isPending,catalog:n,allModels:k})]})}function at(s){if(!s)return"";const a=new Date(s).getTime(),n=Date.now()-a,i=Math.floor(n/(1e3*60*60)),c=Math.floor(n%(1e3*60*60)/(1e3*60));return i>0?`${i}h ${c}m`:`${c}m`}function nt(s){if(!s)return"";const a=Date.now()-s,t=Math.floor(a/(1e3*60)),n=Math.floor(a/(1e3*60*60));return t<1?"just now":t<60?`${t}m ago`:`${n}h ago`}function it(){const{data:s,isLoading:a}=xs(),{data:t}=hs(),n=ps(),i=gs(),{data:c}=Se({queryKey:["cliproxy-server-config"],queryFn:()=>fs.cliproxyServer.get(),staleTime:3e4}),l=c?.remote,u=l?.enabled&&l?.host,r=s?.running??!1,x=n.isPending||i.isPending,d=t?.hasUpdate??!1,h=u?(()=>{const o=l.protocol||"http",j=l.port||(o==="https"?443:80);return o==="https"&&j===443||o==="http"&&j===80?l.host:`${l.host}:${j}`})():null,f=async()=>{await i.mutateAsync(),await new Promise(o=>setTimeout(o,500)),n.mutate()};return u?e.jsxs("div",{className:C("rounded-lg border p-3 transition-colors","border-blue-500/30 bg-blue-500/5"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ie,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-medium",children:"Remote Proxy"}),e.jsx(T,{variant:"secondary",className:"text-[10px] h-4 px-1.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:"Active"})]}),e.jsx(ve,{className:"w-3 h-3 text-blue-600"})]}),e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[e.jsx("div",{className:"flex items-center gap-1 mb-1",children:e.jsx("span",{className:"font-mono",children:h})}),e.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:"Traffic auto-routed to remote server"})]})]}):e.jsxs("div",{className:C("rounded-lg border p-3 transition-colors",r?"border-green-500/30 bg-green-500/5":"border-muted bg-muted/30"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:C("w-2 h-2 rounded-full",r?"bg-green-500 animate-pulse":"bg-muted-foreground/30")}),e.jsx("span",{className:"text-sm font-medium",children:"CLIProxy Service"}),d&&e.jsxs(T,{variant:"secondary",className:"text-[10px] h-4 px-1.5 gap-0.5 bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400",title:`Update: v${t?.currentVersion} -> v${t?.latestVersion}`,children:[e.jsx(Ne,{className:"w-2.5 h-2.5"}),"Update"]})]}),e.jsx("div",{className:"flex items-center gap-1",children:a?e.jsx(F,{className:"w-3 h-3 animate-spin text-muted-foreground"}):r?e.jsx(ve,{className:"w-3 h-3 text-green-600"}):e.jsx(we,{className:"w-3 h-3 text-muted-foreground"})})]}),r&&s?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:["Port ",s.port]}),s.sessionCount!==void 0&&s.sessionCount>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ms,{className:"w-3 h-3"}),s.sessionCount," session",s.sessionCount!==1?"s":""]}),s.startedAt&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ue,{className:"w-3 h-3"}),at(s.startedAt)]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[e.jsxs(g,{variant:d?"default":"outline",size:"sm",className:C("h-7 text-xs gap-1 flex-1",d&&"bg-sidebar-accent hover:bg-sidebar-accent/90 text-sidebar-accent-foreground"),onClick:f,disabled:x,title:d?`Restart to update: v${t?.currentVersion} -> v${t?.latestVersion}`:"Restart CLIProxy service",children:[x?e.jsx(F,{className:"w-3 h-3 animate-spin"}):d?e.jsx(Ne,{className:"w-3 h-3"}):e.jsx(Ds,{className:"w-3 h-3"}),d?"Update":"Restart"]}),e.jsxs(g,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1 hover:bg-destructive/10 hover:text-destructive hover:border-destructive/30",onClick:()=>i.mutate(),disabled:x,title:"Stop CLIProxy service",children:[i.isPending?e.jsx(F,{className:"w-3 h-3 animate-spin"}):e.jsx(Ts,{className:"w-3 h-3"}),"Stop"]})]})]}):e.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not running"}),e.jsxs(g,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>n.mutate(),disabled:n.isPending,children:[n.isPending?e.jsx(F,{className:"w-3 h-3 animate-spin"}):e.jsx(we,{className:"w-3 h-3"}),"Start"]})]}),t?.currentVersion&&e.jsxs("div",{className:"mt-2 pt-2 border-t border-muted flex items-center justify-between text-[10px] text-muted-foreground/70",children:[e.jsxs("span",{children:["v",t.currentVersion]}),t.checkedAt&&e.jsxs("span",{title:new Date(t.checkedAt).toLocaleString(),children:["Synced ",nt(t.checkedAt)]})]})]})}function rt({status:s,isSelected:a,onSelect:t}){const n=s.accounts?.length||0;return e.jsxs("button",{className:C("w-full flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors cursor-pointer text-left",a?"bg-primary/10 border border-primary/20":"hover:bg-muted border border-transparent"),onClick:t,children:[e.jsx(xe,{provider:s.provider,size:"md"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-sm truncate",children:s.displayName}),n>0&&e.jsx(T,{variant:"secondary",className:"text-[10px] h-4 px-1",children:n})]}),e.jsx("div",{className:"flex items-center gap-1.5 mt-0.5",children:s.authenticated?e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"w-3 h-3 text-green-600"}),e.jsx("span",{className:"text-xs text-green-600",children:"Connected"})]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Not connected"})]})})]})]})}function ot({variant:s,parentAuth:a,isSelected:t,onSelect:n,onDelete:i,isDeleting:c}){return e.jsxs("button",{className:C("group w-full flex items-center gap-3 px-3 py-2 rounded-lg transition-colors cursor-pointer text-left pl-6",t?"bg-primary/10 border border-primary/20":"hover:bg-muted border border-transparent"),onClick:n,children:[e.jsxs("div",{className:"relative",children:[e.jsx(xe,{provider:s.provider,size:"sm"}),e.jsx($e,{className:"w-2.5 h-2.5 absolute -bottom-0.5 -right-0.5 text-muted-foreground"})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-sm truncate",children:s.name}),e.jsx(T,{variant:"outline",className:"text-[9px] h-4 px-1",children:"variant"})]}),e.jsx("div",{className:"flex items-center gap-1.5 mt-0.5",children:a?.authenticated?e.jsxs(e.Fragment,{children:[e.jsx(U,{className:"w-3 h-3 text-green-600"}),e.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["via ",s.provider]})]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"w-3 h-3 text-muted-foreground"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Parent not connected"})]})})]}),e.jsx(g,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 hover:text-destructive",onClick:l=>{l.stopPropagation(),i()},disabled:c,children:e.jsx(He,{className:"w-3 h-3"})})]})}function lt({onSetup:s}){return e.jsx("div",{className:"flex-1 flex items-center justify-center bg-muted/20",children:e.jsxs("div",{className:"text-center max-w-md px-8",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-muted flex items-center justify-center mx-auto mb-6",children:e.jsx(X,{className:"w-8 h-8 text-muted-foreground"})}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:"CCS Profile Manager"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"Manage OAuth authentication, account preferences, and model selection for CLIProxy providers. Configure how CCS routes requests to different AI backends."}),e.jsxs("p",{className:"text-xs text-muted-foreground mb-6",children:["For live usage stats and real-time monitoring, visit the"," ",e.jsx("a",{href:"/cliproxy/control-panel",className:"text-primary hover:underline",children:"Control Panel"}),"."]}),e.jsxs(g,{onClick:s,className:"gap-2",children:[e.jsx(G,{className:"w-4 h-4"}),"Quick Setup"]})]})})}function Nt(){const s=Ae(),{data:a,isLoading:t}=De(),{data:n,isFetching:i}=js(),c=vs(),l=Ns(),u=ws(),[r,x]=p.useState(null),[d,h]=p.useState(null),[f,o]=p.useState(!1),[j,A]=p.useState(null),N=p.useMemo(()=>a?.authStatus||[],[a?.authStatus]),D=a?.source==="remote",k=p.useMemo(()=>n?.variants||[],[n?.variants]),O=p.useMemo(()=>d?null:r&&N.some(m=>m.provider===r)?r:N.length>0?N[0].provider:null,[r,d,N]),y=N.find(m=>m.provider===O),w=k.find(m=>m.name===d),P=w?N.find(m=>m.provider===w.provider):void 0,b=()=>{s.invalidateQueries({queryKey:["cliproxy"]}),s.invalidateQueries({queryKey:["cliproxy-auth"]})},S=m=>{x(m),h(null)},_=m=>{h(m),x(null)};return e.jsxs("div",{className:"h-[calc(100vh-100px)] flex",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/30",children:[e.jsxs("div",{className:"p-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(X,{className:"w-5 h-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:"CLIProxy"})]}),e.jsx(g,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:b,disabled:i,children:e.jsx(F,{className:C("w-4 h-4",i&&"animate-spin")})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"CCS-level account management"}),e.jsxs(g,{variant:"default",size:"sm",className:"w-full gap-2",onClick:()=>o(!0),children:[e.jsx(G,{className:"w-4 h-4"}),"Quick Setup"]})]}),e.jsx(le,{className:"flex-1",children:e.jsxs("div",{className:"p-2",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide px-3 py-2",children:"Providers"}),t?e.jsx("div",{className:"space-y-2 px-2",children:[1,2,3,4].map(m=>e.jsx(bs,{className:"h-14 w-full rounded-lg"},m))}):e.jsx("div",{className:"space-y-1",children:N.map(m=>e.jsx(rt,{status:m,isSelected:O===m.provider,onSelect:()=>S(m.provider)},m.provider))}),k.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide px-3 py-2 mt-4 flex items-center gap-1.5",children:[e.jsx($e,{className:"w-3 h-3"}),"Variants"]}),e.jsx("div",{className:"space-y-1",children:k.map(m=>e.jsx(ot,{variant:m,parentAuth:N.find(H=>H.provider===m.provider),isSelected:d===m.name,onSelect:()=>_(m.name),onDelete:()=>u.mutate(m.name),isDeleting:u.isPending},m.name))})]})]})}),e.jsx("div",{className:"p-3 border-t",children:e.jsx(it,{})}),e.jsx("div",{className:"p-3 border-t bg-background text-xs text-muted-foreground",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{children:[N.length," provider",N.length!==1?"s":""]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(U,{className:"w-3 h-3 text-green-600"}),N.filter(m=>m.authenticated).length," connected"]})]})})]}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background",children:w&&P?e.jsx(Ce,{provider:w.name,displayName:`${w.name} (${w.provider} variant)`,authStatus:P,catalog:z[w.provider],logoProvider:w.provider,isRemoteMode:D,onAddAccount:()=>A({provider:w.provider,displayName:P.displayName,isFirstAccount:(P.accounts?.length||0)===0}),onSetDefault:m=>c.mutate({provider:w.provider,accountId:m}),onRemoveAccount:m=>l.mutate({provider:w.provider,accountId:m}),isRemovingAccount:l.isPending}):y?e.jsx(Ce,{provider:y.provider,displayName:y.displayName,authStatus:y,catalog:z[y.provider],isRemoteMode:D,onAddAccount:()=>A({provider:y.provider,displayName:y.displayName,isFirstAccount:(y.accounts?.length||0)===0}),onSetDefault:m=>c.mutate({provider:y.provider,accountId:m}),onRemoveAccount:m=>l.mutate({provider:y.provider,accountId:m}),isRemovingAccount:l.isPending}):e.jsx(lt,{onSetup:()=>o(!0)})}),e.jsx($s,{open:f,onClose:()=>o(!1)}),e.jsx(Vs,{open:j!==null,onClose:()=>A(null),provider:j?.provider||"",displayName:j?.displayName||"",isFirstAccount:j?.isFirstAccount||!1})]})}export{Nt as CliproxyPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-CrW4rUOS.js";import{r as c}from"./react-vendor-B_CU-WTZ.js";import{as as N,at as C,au as w,ap as y,ar as G,i as S,a as b,I as p}from"./index-BhG5iXmB.js";import{S as k}from"./switch-BNmIV8Xs.js";import{_ as j,O as A,k as R,a8 as L,J as _}from"./icons-ChQ4a4K4.js";import"./tanstack-Dbfprw6o.js";import"./notifications-dJQY2-U6.js";import"./utils-CzKF5WmX.js";import"./form-utils-kUVlZZAO.js";import"./code-highlight-DKN39ySy.js";function V(){const{state:s}=N(),a=C(),[l,d]=c.useState(""),[m,v]=c.useState(""),u=c.useCallback(async()=>{try{a.setGlobalEnvLoading(!0),a.setGlobalEnvError(null);const t=await fetch("/api/global-env");if(!t.ok)throw new Error("Failed to load Global Env config");const o=await t.json();a.setGlobalEnvConfig(o)}catch(t){a.setGlobalEnvError(t.message)}finally{a.setGlobalEnvLoading(!1)}},[a]),i=c.useCallback(async t=>{const o=s.globalEnvConfig;if(!o)return;const x={...o,...t};a.setGlobalEnvConfig(x);try{a.setGlobalEnvSaving(!0),a.setGlobalEnvError(null);const r=await fetch("/api/global-env",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)});if(!r.ok){const n=await r.json();throw new Error(n.error||"Failed to save")}const h=await r.json();a.setGlobalEnvConfig(h.config),a.setGlobalEnvSuccess(!0),setTimeout(()=>a.setGlobalEnvSuccess(!1),1500)}catch(r){a.setGlobalEnvConfig(o),a.setGlobalEnvError(r.message)}finally{a.setGlobalEnvSaving(!1)}},[s.globalEnvConfig,a]),f=c.useCallback(()=>{if(!l.trim()||!s.globalEnvConfig)return;const t={...s.globalEnvConfig.env,[l.trim()]:m};i({env:t}),d(""),v("")},[l,m,s.globalEnvConfig,i]),g=c.useCallback(t=>{if(!s.globalEnvConfig)return;const o={...s.globalEnvConfig.env};delete o[t],i({env:o})},[s.globalEnvConfig,i]);return{config:s.globalEnvConfig,loading:s.globalEnvLoading,saving:s.globalEnvSaving,error:s.globalEnvError,success:s.globalEnvSuccess,newEnvKey:l,setNewEnvKey:d,newEnvValue:m,setNewEnvValue:v,fetchConfig:u,saveConfig:i,addEnvVar:f,removeEnvVar:g}}function F(){const{config:s,loading:a,saving:l,error:d,success:m,newEnvKey:v,setNewEnvKey:u,newEnvValue:i,setNewEnvValue:f,fetchConfig:g,saveConfig:t,addEnvVar:o,removeEnvVar:x}=V(),{fetchRawConfig:r}=w();c.useEffect(()=>{g(),r()},[g,r]);const h=()=>{t({enabled:!s?.enabled})};return a?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[e.jsx(j,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:"Loading..."})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${d||m?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[d&&e.jsxs(y,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(A,{className:"h-4 w-4"}),e.jsx(G,{children:d})]}),m&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md border border-green-200 bg-green-50 text-green-700 shadow-lg dark:border-green-900/50 dark:bg-green-900/90 dark:text-green-300",children:[e.jsx(R,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:"Saved"})]})]}),e.jsx(S,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Environment variables injected into all non-Claude subscription profiles (gemini, codex, agy, copilot, etc.)"}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-muted/50",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s?.enabled?"Global Env enabled":"Global Env disabled"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s?.enabled?"Env vars will be injected into third-party profiles":"Env vars will not be injected"})]}),e.jsx(k,{checked:s?.enabled??!0,onCheckedChange:h})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-base font-medium",children:"Environment Variables"}),s?.env&&Object.keys(s.env).length>0?e.jsx("div",{className:"space-y-2",children:Object.entries(s.env).map(([n,E])=>e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg border bg-background",children:[e.jsx("code",{className:"flex-1 font-mono text-sm truncate",children:n}),e.jsx("span",{className:"text-muted-foreground",children:"="}),e.jsx("code",{className:"font-mono text-sm px-2 py-1 bg-muted rounded",children:E}),e.jsx(b,{variant:"ghost",size:"sm",onClick:()=>x(n),disabled:l,className:"h-8 w-8 p-0 text-destructive hover:text-destructive hover:bg-destructive/10",children:e.jsx(L,{className:"w-4 h-4"})})]},n))}):e.jsx("div",{className:"p-4 rounded-lg border border-dashed text-center text-muted-foreground",children:e.jsx("p",{children:"No environment variables configured"})}),e.jsxs("div",{className:"p-4 rounded-lg border bg-muted/30",children:[e.jsx("h4",{className:"text-sm font-medium mb-3",children:"Add New Variable"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(p,{value:v,onChange:n=>u(n.target.value.toUpperCase()),placeholder:"KEY_NAME",className:"flex-1 font-mono text-sm h-9",disabled:l}),e.jsx("span",{className:"flex items-center text-muted-foreground",children:"="}),e.jsx(p,{value:i,onChange:n=>f(n.target.value),placeholder:"value",className:"flex-1 font-mono text-sm h-9",disabled:l}),e.jsxs(b,{size:"sm",onClick:o,disabled:l||!v.trim(),className:"h-9",children:[e.jsx(_,{className:"w-4 h-4 mr-1"}),"Add"]})]})]}),e.jsxs("div",{className:"p-4 rounded-lg border bg-muted/30",children:[e.jsx("h4",{className:"text-sm font-medium mb-3",children:"Quick Add Common Variables"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[[{key:"DISABLE_BUG_COMMAND",value:"1"},{key:"DISABLE_ERROR_REPORTING",value:"1"},{key:"DISABLE_TELEMETRY",value:"1"}].map(({key:n,value:E})=>!s?.env?.[n]&&e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>{u(n),f(E)},className:"text-xs font-mono",children:["+ ",n]},n)),s?.env&&["DISABLE_BUG_COMMAND","DISABLE_ERROR_REPORTING","DISABLE_TELEMETRY"].every(n=>s.env[n])&&e.jsx("span",{className:"text-sm text-muted-foreground",children:"All common variables are configured"})]})]})]})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>{g(),r()},disabled:a||l,className:"w-full",children:[e.jsx(j,{className:`w-4 h-4 mr-2 ${a?"animate-spin":""}`}),"Refresh"]})})]})}export{F as default};
|