@kaitranntt/ccs 7.8.0 → 7.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/services/profile-reader.js +3 -3
- package/dist/api/services/profile-reader.js.map +1 -1
- package/dist/api/services/profile-writer.js +1 -1
- package/dist/api/services/profile-writer.js.map +1 -1
- package/dist/ccs.js +17 -8
- package/dist/ccs.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/kiro-import.d.ts +23 -0
- package/dist/cliproxy/auth/kiro-import.d.ts.map +1 -0
- package/dist/cliproxy/auth/kiro-import.js +140 -0
- package/dist/cliproxy/auth/kiro-import.js.map +1 -0
- package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.js +10 -0
- package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
- package/dist/cliproxy/auth/oauth-process.d.ts.map +1 -1
- package/dist/cliproxy/auth/oauth-process.js +25 -4
- package/dist/cliproxy/auth/oauth-process.js.map +1 -1
- package/dist/cliproxy/binary-manager.d.ts.map +1 -1
- package/dist/cliproxy/binary-manager.js +21 -0
- package/dist/cliproxy/binary-manager.js.map +1 -1
- package/dist/cliproxy/cliproxy-executor.d.ts.map +1 -1
- package/dist/cliproxy/cliproxy-executor.js +59 -4
- package/dist/cliproxy/cliproxy-executor.js.map +1 -1
- package/dist/cliproxy/config-generator.d.ts +3 -2
- package/dist/cliproxy/config-generator.d.ts.map +1 -1
- package/dist/cliproxy/config-generator.js +6 -5
- package/dist/cliproxy/config-generator.js.map +1 -1
- package/dist/cliproxy/index.d.ts +1 -1
- package/dist/cliproxy/index.d.ts.map +1 -1
- package/dist/cliproxy/index.js +2 -2
- package/dist/cliproxy/index.js.map +1 -1
- package/dist/cliproxy/openai-compat-manager.js +2 -2
- package/dist/cliproxy/openai-compat-manager.js.map +1 -1
- package/dist/cliproxy/proxy-detector.d.ts +2 -0
- package/dist/cliproxy/proxy-detector.d.ts.map +1 -1
- package/dist/cliproxy/proxy-detector.js +7 -2
- package/dist/cliproxy/proxy-detector.js.map +1 -1
- package/dist/cliproxy/services/variant-config-adapter.js +2 -2
- package/dist/cliproxy/services/variant-config-adapter.js.map +1 -1
- package/dist/cliproxy/session-tracker.d.ts +13 -1
- package/dist/cliproxy/session-tracker.d.ts.map +1 -1
- package/dist/cliproxy/session-tracker.js +65 -2
- package/dist/cliproxy/session-tracker.js.map +1 -1
- package/dist/commands/help-command.d.ts.map +1 -1
- package/dist/commands/help-command.js +3 -1
- package/dist/commands/help-command.js.map +1 -1
- package/dist/management/checks/cliproxy-check.js +1 -1
- package/dist/management/checks/cliproxy-check.js.map +1 -1
- package/dist/types/config.d.ts +4 -4
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/ui/assets/accounts-CZms_PBW.js +1 -0
- package/dist/ui/assets/alert-dialog-sKmXLtjs.js +1 -0
- package/dist/ui/assets/api-TANgowVA.js +1 -0
- package/dist/ui/assets/{auth-section-c488oSia.js → auth-section-Ddg5Cdd6.js} +1 -1
- package/dist/ui/assets/{card-BrSGmssG.js → card-CfgEo_Fi.js} +1 -1
- package/dist/ui/assets/cliproxy-BpCuX751.js +3 -0
- package/dist/ui/assets/{cliproxy-control-panel-CqFvwaNM.js → cliproxy-control-panel-Cp0Tweyl.js} +1 -1
- package/dist/ui/assets/confirm-dialog-Dut98zdb.js +1 -0
- package/dist/ui/assets/copilot-DvOZJmtw.js +4 -0
- package/dist/ui/assets/{globalenv-section-Bli-EFPP.js → globalenv-section-DlnizwvB.js} +1 -1
- package/dist/ui/assets/{health-mnF1gWAc.js → health-D1M4owiM.js} +1 -1
- package/dist/ui/assets/{icons-DBie6Tez.js → icons-CMYcel9O.js} +1 -1
- package/dist/ui/assets/{index-B38yaYR3.js → index-BCBypoXT.js} +1 -1
- package/dist/ui/assets/{index-mn6heIpP.js → index-BXkzlgVE.js} +1 -1
- package/dist/ui/assets/{index-Buv2h9oP.js → index-Bdp0Hpgh.js} +1 -1
- package/dist/ui/assets/{index-t5yDkLoB.js → index-D-LYJymx.js} +14 -14
- package/dist/ui/assets/index-DQAJ1wqP.css +1 -0
- package/dist/ui/assets/{shared-B9w3h6Sd.js → shared-Dgmje0CZ.js} +1 -1
- package/dist/ui/assets/{switch-CRxPpAN8.js → switch-MkSHHW1_.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/dist/utils/config-manager.d.ts +15 -1
- package/dist/utils/config-manager.d.ts.map +1 -1
- package/dist/utils/config-manager.js +87 -13
- package/dist/utils/config-manager.js.map +1 -1
- package/dist/utils/port-utils.d.ts +8 -0
- package/dist/utils/port-utils.d.ts.map +1 -1
- package/dist/utils/port-utils.js +21 -1
- package/dist/utils/port-utils.js.map +1 -1
- package/dist/web-server/health/cliproxy-checks.js +1 -1
- package/dist/web-server/health/cliproxy-checks.js.map +1 -1
- package/dist/web-server/overview-routes.js +1 -1
- package/dist/web-server/overview-routes.js.map +1 -1
- package/dist/web-server/routes/account-routes.d.ts.map +1 -1
- package/dist/web-server/routes/account-routes.js +43 -0
- package/dist/web-server/routes/account-routes.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 +47 -0
- package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
- package/dist/web-server/routes/cliproxy-stats-routes.js +2 -2
- package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
- package/dist/web-server/routes/route-helpers.d.ts +2 -1
- package/dist/web-server/routes/route-helpers.d.ts.map +1 -1
- package/dist/web-server/routes/route-helpers.js +3 -2
- package/dist/web-server/routes/route-helpers.js.map +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/accounts-SAhf2aVn.js +0 -1
- package/dist/ui/assets/api-DgjYmgeK.js +0 -1
- package/dist/ui/assets/cliproxy-DagVtdBM.js +0 -3
- package/dist/ui/assets/confirm-dialog-B0FsZkP6.js +0 -1
- package/dist/ui/assets/copilot-Bccuuvux.js +0 -4
- package/dist/ui/assets/index-CytnH70K.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variant-config-adapter.js","sourceRoot":"","sources":["../../../src/cliproxy/services/variant-config-adapter.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,+
|
|
1
|
+
{"version":3,"file":"variant-config-adapter.js","sourceRoot":"","sources":["../../../src/cliproxy/services/variant-config-adapter.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,+DAA2E;AAE3E,8EAI4C;AAC5C,0DAA4D;AAE5D,2DAA2D;AAC9C,QAAA,iBAAiB,GAAG,wCAAqB,GAAG,CAAC,CAAC;AAE3D,8DAA8D;AACjD,QAAA,uBAAuB,GAAG,GAAG,CAAC;AAW3C;;GAEG;AACH,SAAgB,qBAAqB,CAAC,IAAY;IAChD,IAAI,CAAC;QACH,IAAI,IAAA,qCAAa,GAAE,EAAE,CAAC;YACpB,MAAM,MAAM,GAAG,IAAA,iDAAyB,GAAE,CAAC;YAC3C,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,IAAI,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC3E,CAAC;QACD,MAAM,MAAM,GAAG,IAAA,+BAAc,GAAE,CAAC;QAChC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,IAAI,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAXD,sDAWC;AAED;;;GAGG;A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CAAC;IACd,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAA0D,CAAC;IAC/F,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE7B,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9C,OAAO,MAAM,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED,MAAM,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;IACrC,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC;IAC3E,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAEpC,OAAO,OAAO,CAAC;AACjB,CAAC;AA1BD,sEA0BC"}
|
|
@@ -19,6 +19,8 @@ interface SessionLock {
|
|
|
19
19
|
pid: number;
|
|
20
20
|
sessions: string[];
|
|
21
21
|
startedAt: string;
|
|
22
|
+
/** CLIProxy version running (added for version mismatch detection) */
|
|
23
|
+
version?: string;
|
|
22
24
|
}
|
|
23
25
|
/** Get path to session lock file (default port) - kept for future use */
|
|
24
26
|
declare function _getSessionLockPath(): string;
|
|
@@ -34,9 +36,12 @@ export declare function getExistingProxy(port: number): SessionLock | null;
|
|
|
34
36
|
/**
|
|
35
37
|
* Register a new session with the proxy.
|
|
36
38
|
* Call this when starting a new CCS session that will use an existing proxy.
|
|
39
|
+
* @param port Port the proxy is running on
|
|
40
|
+
* @param proxyPid PID of the proxy process
|
|
41
|
+
* @param version Optional CLIProxy version (stored when spawning new proxy)
|
|
37
42
|
* @returns Session ID for this session
|
|
38
43
|
*/
|
|
39
|
-
export declare function registerSession(port: number, proxyPid: number): string;
|
|
44
|
+
export declare function registerSession(port: number, proxyPid: number, version?: string): string;
|
|
40
45
|
/**
|
|
41
46
|
* Unregister a session from the proxy.
|
|
42
47
|
* @param sessionId Session ID to unregister
|
|
@@ -81,5 +86,12 @@ export declare function getProxyStatus(port?: number): {
|
|
|
81
86
|
pid?: number;
|
|
82
87
|
sessionCount?: number;
|
|
83
88
|
startedAt?: string;
|
|
89
|
+
version?: string;
|
|
84
90
|
};
|
|
91
|
+
/**
|
|
92
|
+
* Get the version of the running proxy from session lock.
|
|
93
|
+
* @param port Port to check (defaults to CLIPROXY_DEFAULT_PORT)
|
|
94
|
+
* @returns Version string if available, null otherwise
|
|
95
|
+
*/
|
|
96
|
+
export declare function getRunningProxyVersion(port?: number): string | null;
|
|
85
97
|
//# sourceMappingURL=session-tracker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-tracker.d.ts","sourceRoot":"","sources":["../../src/cliproxy/session-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,kCAAkC;AAClC,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"session-tracker.d.ts","sourceRoot":"","sources":["../../src/cliproxy/session-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,kCAAkC;AAClC,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAeD,yEAAyE;AACzE,iBAAS,mBAAmB,IAAI,MAAM,CAErC;AAGD,OAAO,EAAE,mBAAmB,IAAI,kBAAkB,EAAE,CAAC;AAGrD,OAAO,EAAE,wBAAwB,EAAE,CAAC;AAwCpC,iDAAi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MAAM,GAAG,IAAI,CAa1F"}
|
|
@@ -38,7 +38,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
38
38
|
return result;
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.getProxyStatus = exports.stopProxy = exports.cleanupOrphanedSessions = exports.hasActiveSessions = exports.getSessionCount = exports.unregisterSession = exports.registerSession = exports.getExistingProxy = exports.deleteSessionLockForPort = exports.getSessionLockPath = void 0;
|
|
41
|
+
exports.getRunningProxyVersion = exports.getProxyStatus = exports.stopProxy = exports.cleanupOrphanedSessions = exports.hasActiveSessions = exports.getSessionCount = exports.unregisterSession = exports.registerSession = exports.getExistingProxy = exports.deleteSessionLockForPort = exports.getSessionLockPath = void 0;
|
|
42
42
|
const fs = __importStar(require("fs"));
|
|
43
43
|
const path = __importStar(require("path"));
|
|
44
44
|
const crypto = __importStar(require("crypto"));
|
|
@@ -129,6 +129,22 @@ function isProcessRunning(pid) {
|
|
|
129
129
|
return false;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* Wait for a process to exit within a timeout.
|
|
134
|
+
* @param pid Process ID to wait for
|
|
135
|
+
* @param timeoutMs Maximum time to wait in milliseconds
|
|
136
|
+
* @returns true if process exited, false if timeout
|
|
137
|
+
*/
|
|
138
|
+
async function waitForProcessExit(pid, timeoutMs) {
|
|
139
|
+
const start = Date.now();
|
|
140
|
+
while (Date.now() - start < timeoutMs) {
|
|
141
|
+
if (!isProcessRunning(pid)) {
|
|
142
|
+
return true; // Process exited
|
|
143
|
+
}
|
|
144
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
145
|
+
}
|
|
146
|
+
return false; // Timeout
|
|
147
|
+
}
|
|
132
148
|
/**
|
|
133
149
|
* Check if there's an existing proxy running that we can reuse.
|
|
134
150
|
* Returns the existing lock if proxy is healthy, null otherwise.
|
|
@@ -154,9 +170,12 @@ exports.getExistingProxy = getExistingProxy;
|
|
|
154
170
|
/**
|
|
155
171
|
* Register a new session with the proxy.
|
|
156
172
|
* Call this when starting a new CCS session that will use an existing proxy.
|
|
173
|
+
* @param port Port the proxy is running on
|
|
174
|
+
* @param proxyPid PID of the proxy process
|
|
175
|
+
* @param version Optional CLIProxy version (stored when spawning new proxy)
|
|
157
176
|
* @returns Session ID for this session
|
|
158
177
|
*/
|
|
159
|
-
function registerSession(port, proxyPid) {
|
|
178
|
+
function registerSession(port, proxyPid, version) {
|
|
160
179
|
const sessionId = generateSessionId();
|
|
161
180
|
const existingLock = readSessionLockForPort(port);
|
|
162
181
|
if (existingLock && existingLock.port === port && existingLock.pid === proxyPid) {
|
|
@@ -171,6 +190,7 @@ function registerSession(port, proxyPid) {
|
|
|
171
190
|
pid: proxyPid,
|
|
172
191
|
sessions: [sessionId],
|
|
173
192
|
startedAt: new Date().toISOString(),
|
|
193
|
+
version,
|
|
174
194
|
};
|
|
175
195
|
writeSessionLockForPort(newLock);
|
|
176
196
|
}
|
|
@@ -295,6 +315,18 @@ async function stopProxy(port = config_generator_2.CLIPROXY_DEFAULT_PORT) {
|
|
|
295
315
|
// Found CLIProxy running without session lock - kill it
|
|
296
316
|
try {
|
|
297
317
|
process.kill(portProcess.pid, 'SIGTERM');
|
|
318
|
+
// Wait for graceful shutdown
|
|
319
|
+
const exited = await waitForProcessExit(portProcess.pid, 3000);
|
|
320
|
+
if (!exited) {
|
|
321
|
+
// Escalate to SIGKILL
|
|
322
|
+
try {
|
|
323
|
+
process.kill(portProcess.pid, 'SIGKILL');
|
|
324
|
+
await waitForProcessExit(portProcess.pid, 1000);
|
|
325
|
+
}
|
|
326
|
+
catch {
|
|
327
|
+
// Process may have exited between check and kill
|
|
328
|
+
}
|
|
329
|
+
}
|
|
298
330
|
return { stopped: true, pid: portProcess.pid, sessionCount: 0 };
|
|
299
331
|
}
|
|
300
332
|
catch (err) {
|
|
@@ -315,6 +347,18 @@ async function stopProxy(port = config_generator_2.CLIPROXY_DEFAULT_PORT) {
|
|
|
315
347
|
try {
|
|
316
348
|
// Kill the proxy process
|
|
317
349
|
process.kill(pid, 'SIGTERM');
|
|
350
|
+
// Wait for graceful shutdown
|
|
351
|
+
const exited = await waitForProcessExit(pid, 3000);
|
|
352
|
+
if (!exited) {
|
|
353
|
+
// Escalate to SIGKILL
|
|
354
|
+
try {
|
|
355
|
+
process.kill(pid, 'SIGKILL');
|
|
356
|
+
await waitForProcessExit(pid, 1000);
|
|
357
|
+
}
|
|
358
|
+
catch {
|
|
359
|
+
// Process may have exited between check and kill
|
|
360
|
+
}
|
|
361
|
+
}
|
|
318
362
|
// Clean up session lock
|
|
319
363
|
deleteSessionLockForPort(port);
|
|
320
364
|
return { stopped: true, pid, sessionCount };
|
|
@@ -349,7 +393,26 @@ function getProxyStatus(port = config_generator_2.CLIPROXY_DEFAULT_PORT) {
|
|
|
349
393
|
pid: lock.pid,
|
|
350
394
|
sessionCount: lock.sessions.length,
|
|
351
395
|
startedAt: lock.startedAt,
|
|
396
|
+
version: lock.version,
|
|
352
397
|
};
|
|
353
398
|
}
|
|
354
399
|
exports.getProxyStatus = getProxyStatus;
|
|
400
|
+
/**
|
|
401
|
+
* Get the version of the running proxy from session lock.
|
|
402
|
+
* @param port Port to check (defaults to CLIPROXY_DEFAULT_PORT)
|
|
403
|
+
* @returns Version string if available, null otherwise
|
|
404
|
+
*/
|
|
405
|
+
function getRunningProxyVersion(port = config_generator_2.CLIPROXY_DEFAULT_PORT) {
|
|
406
|
+
const lock = readSessionLockForPort(port);
|
|
407
|
+
if (!lock) {
|
|
408
|
+
return null;
|
|
409
|
+
}
|
|
410
|
+
// Verify proxy is still running
|
|
411
|
+
if (!isProcessRunning(lock.pid)) {
|
|
412
|
+
deleteSessionLockForPort(port);
|
|
413
|
+
return null;
|
|
414
|
+
}
|
|
415
|
+
return lock.version ?? null;
|
|
416
|
+
}
|
|
417
|
+
exports.getRunningProxyVersion = getRunningProxyVersion;
|
|
355
418
|
//# sourceMappingURL=session-tracker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-tracker.js","sourceRoot":"","sources":["../../src/cliproxy/session-tracker.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AACjC,yDAAoD;AACpD,oDAAwE;AACxE,yDAA2D;
|
|
1
|
+
{"version":3,"file":"session-tracker.js","sourceRoot":"","sources":["../../src/cliproxy/session-tracker.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AACjC,yDAAoD;AACpD,oDAAwE;AACxE,yDAA2D;AAY3D,iCAAiC;AACjC,SAAS,iBAAiB;IACxB,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC/C,CAAC;AAED,sDAAsD;AACtD,SAAS,yBAAyB,CAAC,IAAY;IAC7C,IAAI,IAAI,KAAK,wCAAqB,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAA,iCAAc,GAAE,EAAE,eAAe,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAA,iCAAc,GAAE,EAAE,YAAY,IAAI,OAAO,CAAC,CAAC;AAC9D,CAAC;AAED,yEAAyE;AACzE,SAAS,mBAAmB;IAC1B,OAAO,yBAAyB,CAAC,wCAAqB,CAAC,CAAC;AAC1D,CAAC;AAG+B,iDAAkB;AAKlD,uFAAuF;AACvF,SAAS,sBAAsB,CAAC,IAAY;IAC1C,MAAM,QAAQ,GAAG,yBAAyB,CAAC,IAAI,CAAC,CAAC;IACjD,IAAI,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,OAAO,IAA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IAAI,CAAC;AAC9B,CAAC;AAbD,wDAaC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help-command.d.ts","sourceRoot":"","sources":["../../src/commands/help-command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"help-command.d.ts","sourceRoot":"","sources":["../../src/commands/help-command.ts"],"names":[],"mappings":"AAqFA;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CA0OvD"}
|
|
@@ -27,6 +27,7 @@ exports.handleHelpCommand = void 0;
|
|
|
27
27
|
const fs = __importStar(require("fs"));
|
|
28
28
|
const path = __importStar(require("path"));
|
|
29
29
|
const ui_1 = require("../utils/ui");
|
|
30
|
+
const unified_config_loader_1 = require("../config/unified-config-loader");
|
|
30
31
|
// Get version from package.json (same as version-command.ts)
|
|
31
32
|
const VERSION = JSON.parse(fs.readFileSync(path.join(__dirname, '../../package.json'), 'utf8')).version;
|
|
32
33
|
/**
|
|
@@ -162,6 +163,7 @@ Run ${(0, ui_1.color)('ccs config', 'command')} for web dashboard`.trim();
|
|
|
162
163
|
['ccs <provider> --config', 'Change model (agy, gemini)'],
|
|
163
164
|
['ccs <provider> --logout', 'Clear authentication'],
|
|
164
165
|
['ccs <provider> --headless', 'Headless auth (for SSH)'],
|
|
166
|
+
['ccs kiro --import', 'Import token from Kiro IDE'],
|
|
165
167
|
['ccs kiro --incognito', 'Use incognito browser (default: normal)'],
|
|
166
168
|
['ccs codex "explain code"', 'Use with prompt'],
|
|
167
169
|
]);
|
|
@@ -212,7 +214,7 @@ Run ${(0, ui_1.color)('ccs config', 'command')} for web dashboard`.trim();
|
|
|
212
214
|
]);
|
|
213
215
|
// Configuration
|
|
214
216
|
printConfigSection('Configuration', [
|
|
215
|
-
['Config File:', '~/.ccs/config.json'],
|
|
217
|
+
['Config File:', (0, unified_config_loader_1.isUnifiedMode)() ? '~/.ccs/config.yaml' : '~/.ccs/config.json'],
|
|
216
218
|
['Profiles:', '~/.ccs/profiles.json'],
|
|
217
219
|
['Instances:', '~/.ccs/instances/'],
|
|
218
220
|
['Settings:', '~/.ccs/*.settings.json'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help-command.js","sourceRoot":"","sources":["../../src/commands/help-command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,oCAAgF;
|
|
1
|
+
{"version":3,"file":"help-command.js","sourceRoot":"","sources":["../../src/commands/help-command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,oCAAgF;AAChF,2EAAgE;AAEhE,6DAA6D;AAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CACxB,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,MAAM,CAAC,CACpE,CAAC,OAAO,CAAC;AAEV;;;;;;;;GAQG;AACH,SAAS,iBAAiB,CAAC,KAAa,EAAE,SAAmB,EAAE,KAAyB;IACtF,kCAAkC;IAClC,OAAO,CAAC,GAAG,CAAC,IAAA,kBAAa,EAAC,KAAK,CAAC,CAAC,CAAC;IAElC,oCAAoC;IACpC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,OAAO,CAAC,GAAG,CAAC,KAAK,IAAA,QAAG,EAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,0BAA0B;IAC1B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,6CAA6C;IAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAEhE,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,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IAAA,QAAG,EAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IAClG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,YAAY;IACZ,OAAO,CAAC,GAAG,CAAC,KAAK,IAAA,QAAG,EAAC,yCAAyC,CAAC,EAAE,CAAC,CAAC;IACnE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,YAAY;IACZ,OAAO,CAAC,GAAG,CAAC,IAAA,cAAS,EAAC,YAAY,CAAC,CAAC,CAAC;IACrC,OAAO,CAAC,GAAG,CAAC,KAAK,IAAA,UAAK,EAAC,kCAAkC,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;IACzE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,UAAU;IACV,OAAO,CAAC,GAAG,CAAC,IAAA,QAAG,EAAC,cAAc,CAAC,CAAC,CAAC;IACjC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AA1OD,8CA0OC"}
|
|
@@ -69,7 +69,7 @@ class CLIProxyConfigChecker {
|
|
|
69
69
|
}
|
|
70
70
|
run(results) {
|
|
71
71
|
const spinner = ora('Checking CLIProxy config').start();
|
|
72
|
-
const configPath = (0, cliproxy_1.
|
|
72
|
+
const configPath = (0, cliproxy_1.getCliproxyConfigPath)();
|
|
73
73
|
if (fs.existsSync(configPath)) {
|
|
74
74
|
// Check if config needs regeneration (version mismatch or missing features)
|
|
75
75
|
if ((0, cliproxy_1.configNeedsRegeneration)()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cliproxy-check.js","sourceRoot":"","sources":["../../../src/management/checks/cliproxy-check.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,uCAAgD;AAChD,6CAUwB;AACxB,uDAA2E;AAC3E,mCAA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,IAAI,qBAAqB,EAAE,CAAC;IAClD,MAAM,aAAa,GAAG,IAAI,qBAAqB,EAAE,CAAC;IAClD,MAAM,WAAW,GAAG,IAAI,mBAAmB,EAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,IAAI,mBAAmB,EAAE,CAAC;IAE9C,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC3B,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC3B,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,MAAM,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAVD,8CAUC"}
|
package/dist/types/config.d.ts
CHANGED
|
@@ -15,10 +15,10 @@ export interface ProfilesConfig {
|
|
|
15
15
|
* Example: "flash" → gemini provider with gemini-2.5-flash model
|
|
16
16
|
*/
|
|
17
17
|
export interface CLIProxyVariantConfig {
|
|
18
|
-
/** CLIProxy provider to use
|
|
19
|
-
provider: 'gemini' | 'codex' | 'agy' | 'qwen';
|
|
20
|
-
/** Path to settings.json with custom model configuration */
|
|
21
|
-
settings
|
|
18
|
+
/** CLIProxy provider to use */
|
|
19
|
+
provider: 'gemini' | 'codex' | 'agy' | 'qwen' | 'iflow' | 'kiro' | 'ghcp';
|
|
20
|
+
/** Path to settings.json with custom model configuration (optional) */
|
|
21
|
+
settings?: string;
|
|
22
22
|
/** Account identifier for multi-account support (optional, defaults to 'default') */
|
|
23
23
|
account?: string;
|
|
24
24
|
/** Unique port for variant isolation (8318-8417) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC
|
|
1
|
+
{"version":3,"file":"config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GG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAC3C;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAIpD;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,QAAQ,CAMxD"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* CCS Type Definitions
|
|
3
3
|
* Single entry point for all types
|
|
4
4
|
*/
|
|
5
|
-
export type { Config, ProfilesConfig, Settings, EnvVars, EnvValue, ProfileMetadata, ProfilesRegistry, } from './config';
|
|
5
|
+
export type { Config, ProfilesConfig, Settings, EnvVars, EnvValue, ProfileMetadata, ProfilesRegistry, CLIProxyVariantsConfig, } from './config';
|
|
6
6
|
export { isConfig, isSettings } from './config';
|
|
7
7
|
export type { ParsedArgs, ClaudeSpawnOptions, Platform, ClaudeCliInfo } from './cli';
|
|
8
8
|
export { ExitCode } from './cli';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EACV,MAAM,EACN,cAAc,EACd,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,eAAe,EACf,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EACV,MAAM,EACN,cAAc,EACd,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAGhD,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,0BAA0B,EAC1B,eAAe,EACf,SAAS,EACT,WAAW,EACX,eAAe,GAChB,MAAM,cAAc,CAAC;AAGtB,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,cAAc,EACd,aAAa,EACb,UAAU,EACV,QAAQ,EACR,UAAU,EACV,qBAAqB,GACtB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAaH,mCAAgD;AAAvC,kGAAA,QAAQ,OAAA;AAAE,oGAAA,UAAU,OAAA;AAI7B,6BAAiC;AAAxB,+FAAA,QAAQ,OAAA;AA4BjB,gBAAgB;AAChB,iCAAmC;AAA1B,iGAAA,QAAQ,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./radix-ui-uXQB-q0u.js";import{r as p}from"./react-vendor-B_CU-WTZ.js";import{a as D,u as N,b,d as A,f as y,g as T}from"./tanstack-Coed0rqz.js";import{c as m,a7 as f,a as d,_ as k,$ as R,a0 as S,a1 as z,a2 as P,L as C,I as _}from"./index-D-LYJymx.js";import{A as q,a as F,b as K,c as L,d as M,e as $,f as E,g as H}from"./alert-dialog-sKmXLtjs.js";import{t as u}from"./notifications-dJQY2-U6.js";import{R as Q,j,a9 as O,T as I,l as v,N as B}from"./icons-CMYcel9O.js";import"./utils-CzKF5WmX.js";import"./form-utils-kUVlZZAO.js";import"./code-highlight-DKN39ySy.js";function U({className:t,...s}){return e.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:e.jsx("table",{"data-slot":"table",className:m("w-full caption-bottom text-sm",t),...s})})}function V({className:t,...s}){return e.jsx("thead",{"data-slot":"table-header",className:m("[&_tr]:border-b",t),...s})}function Z({className:t,...s}){return e.jsx("tbody",{"data-slot":"table-body",className:m("[&_tr:last-child]:border-0",t),...s})}function w({className:t,...s}){return e.jsx("tr",{"data-slot":"table-row",className:m("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...s})}function G({className:t,...s}){return e.jsx("th",{"data-slot":"table-head",className:m("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...s})}function J({className:t,...s}){return e.jsx("td",{"data-slot":"table-cell",className:m("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...s})}function W(){return D({queryKey:["accounts"],queryFn:()=>f.accounts.list()})}function X(){const t=N();return b({mutationFn:s=>f.accounts.setDefault(s),onSuccess:(s,l)=>{t.invalidateQueries({queryKey:["accounts"]}),u.success(`Default account set to "${l}"`)},onError:s=>{u.error(s.message)}})}function Y(){const t=N();return b({mutationFn:()=>f.accounts.resetDefault(),onSuccess:()=>{t.invalidateQueries({queryKey:["accounts"]}),u.success("Default account reset to CCS")},onError:s=>{u.error(s.message)}})}function ee(){const t=N();return b({mutationFn:s=>f.accounts.delete(s),onSuccess:(s,l)=>{t.invalidateQueries({queryKey:["accounts"]}),u.success(`Account "${l}" deleted`)},onError:s=>{u.error(s.message)}})}function se({data:t,defaultAccount:s}){const l=X(),i=ee(),r=Y(),[c,o]=p.useState(null),x=A({data:t,columns:[{accessorKey:"name",header:"Name",size:200,cell:({row:a})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:a.original.name}),a.original.name===s&&e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded border border-primary/20",children:"default"})]})},{accessorKey:"type",header:"Type",size:100,cell:({row:a})=>e.jsx("span",{className:"capitalize text-muted-foreground",children:a.original.type||"oauth"})},{accessorKey:"created",header:"Created",size:150,cell:({row:a})=>{const n=new Date(a.original.created);return e.jsx("span",{className:"text-muted-foreground",children:n.toLocaleDateString()})}},{accessorKey:"last_used",header:"Last Used",size:150,cell:({row:a})=>{if(!a.original.last_used)return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const n=new Date(a.original.last_used);return e.jsx("span",{className:"text-muted-foreground",children:n.toLocaleDateString()})}},{id:"actions",header:"Actions",size:180,cell:({row:a})=>{const n=a.original.name===s,h=l.isPending||i.isPending;return e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs(d,{variant:n?"secondary":"default",size:"sm",className:"h-8 px-2",disabled:n||h,onClick:()=>l.mutate(a.original.name),children:[e.jsx(j,{className:`w-3 h-3 mr-1 ${n?"opacity-50":""}`}),n?"Active":"Set Default"]}),e.jsx(d,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive hover:bg-destructive/10",disabled:n||h,onClick:()=>o(a.original.name),title:n?"Cannot delete default account":"Delete account",children:e.jsx(O,{className:"w-4 h-4"})})]})}}],getCoreRowModel:T()});return t.length===0?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:["No accounts found. Use"," ",e.jsx("code",{className:"text-sm bg-muted px-1 rounded",children:"ccs auth create"})," to add accounts."]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"border rounded-md",children:e.jsxs(U,{children:[e.jsx(V,{children:x.getHeaderGroups().map(a=>e.jsx(w,{children:a.headers.map(n=>{const h={name:"w-[200px]",type:"w-[100px]",created:"w-[150px]",last_used:"w-[150px]",actions:"w-[180px]"}[n.id]||"w-auto";return e.jsx(G,{className:h,children:n.isPlaceholder?null:y(n.column.columnDef.header,n.getContext())},n.id)})},a.id))}),e.jsx(Z,{children:x.getRowModel().rows.map(a=>e.jsx(w,{children:a.getVisibleCells().map(n=>e.jsx(J,{children:y(n.column.columnDef.cell,n.getContext())},n.id))},a.id))})]})}),s&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(d,{variant:"outline",size:"sm",onClick:()=>r.mutate(),disabled:r.isPending,children:[e.jsx(Q,{className:"w-4 h-4 mr-2"}),"Reset to CCS Default"]})})]}),e.jsx(q,{open:!!c,onOpenChange:a=>!a&&o(null),children:e.jsxs(F,{children:[e.jsxs(K,{children:[e.jsx(L,{children:"Delete Account"}),e.jsxs(M,{children:['Are you sure you want to delete the account "',c,'"? This will remove the profile and all its session data. This action cannot be undone.']})]}),e.jsxs($,{children:[e.jsx(E,{children:"Cancel"}),e.jsx(H,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{c&&(i.mutate(c),o(null))},children:"Delete"})]})]})})]})}function te({open:t,onClose:s}){const[l,i]=p.useState(""),[r,c]=p.useState(!1),o=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(l),g=l?`ccs auth create ${l}`:"ccs auth create <name>",x=async()=>{o&&(await navigator.clipboard.writeText(g),c(!0),setTimeout(()=>c(!1),2e3))},a=()=>{i(""),c(!1),s()};return e.jsx(k,{open:t,onOpenChange:n=>!n&&a(),children:e.jsxs(R,{className:"sm:max-w-md",children:[e.jsxs(S,{children:[e.jsx(z,{children:"Create New Account"}),e.jsx(P,{children:"Auth profiles require Claude CLI login. Run the command below in your terminal."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{htmlFor:"profile-name",children:"Profile Name"}),e.jsx(_,{id:"profile-name",value:l,onChange:n=>i(n.target.value),placeholder:"e.g., work, personal, client",autoComplete:"off"}),l&&!o&&e.jsx("p",{className:"text-xs text-destructive",children:"Name must start with a letter and contain only letters, numbers, dashes, or underscores."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{children:"Command"}),e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md font-mono text-sm",children:[e.jsx(I,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("code",{className:"flex-1 break-all",children:g}),e.jsx(d,{variant:"ghost",size:"sm",className:"shrink-0 h-8 px-2",onClick:x,disabled:!o,children:r?e.jsx(j,{className:"w-4 h-4 text-green-500"}):e.jsx(v,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsx("p",{children:"After running the command:"}),e.jsxs("ol",{className:"list-decimal list-inside pl-2 space-y-0.5",children:[e.jsx("li",{children:"Complete the Claude login in your browser"}),e.jsx("li",{children:"Return here and refresh to see the new account"})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(d,{variant:"ghost",onClick:a,children:"Close"}),e.jsx(d,{onClick:x,disabled:!o,children:r?e.jsxs(e.Fragment,{children:[e.jsx(j,{className:"w-4 h-4 mr-2"}),"Copied!"]}):e.jsxs(e.Fragment,{children:[e.jsx(v,{className:"w-4 h-4 mr-2"}),"Copy Command"]})})]})]})]})})}function xe(){const{data:t,isLoading:s,refetch:l}=W(),[i,r]=p.useState(!1);return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Accounts"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage multi-account Claude sessions (profiles.json)"})]}),e.jsxs(d,{onClick:()=>r(!0),children:[e.jsx(B,{className:"w-4 h-4 mr-2"}),"Create Account"]})]}),s?e.jsx("div",{className:"text-muted-foreground",children:"Loading accounts..."}):e.jsx(se,{data:t?.accounts||[],defaultAccount:t?.default??null,onRefresh:l}),e.jsx(te,{open:i,onClose:()=>r(!1)})]})}export{xe as AccountsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,a0 as s,a1 as r,a2 as n,a3 as i,a4 as d,a5 as c,a6 as u,a7 as f}from"./radix-ui-uXQB-q0u.js";import"./react-vendor-B_CU-WTZ.js";import{c as o,an as l}from"./index-D-LYJymx.js";function A({...a}){return e.jsx(s,{"data-slot":"alert-dialog",...a})}function g({...a}){return e.jsx(u,{"data-slot":"alert-dialog-portal",...a})}function m({className:a,...t}){return e.jsx(f,{"data-slot":"alert-dialog-overlay",className:o("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",a),...t})}function D({className:a,...t}){return e.jsxs(g,{children:[e.jsx(m,{}),e.jsx(r,{"data-slot":"alert-dialog-content",className:o("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",a),...t})]})}function b({className:a,...t}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:o("flex flex-col gap-2 text-center sm:text-left",a),...t})}function N({className:a,...t}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:o("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",a),...t})}function v({className:a,...t}){return e.jsx(n,{"data-slot":"alert-dialog-title",className:o("text-lg font-semibold",a),...t})}function w({className:a,...t}){return e.jsx(i,{"data-slot":"alert-dialog-description",className:o("text-muted-foreground text-sm",a),...t})}function y({className:a,...t}){return e.jsx(c,{className:o(l(),a),...t})}function z({className:a,...t}){return e.jsx(d,{className:o(l({variant:"outline"}),a),...t})}export{A,D as a,b,v as c,w as d,N as e,z as f,y as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./radix-ui-uXQB-q0u.js";import{r as c}from"./react-vendor-B_CU-WTZ.js";import{B as S,c as E,T as je,k as Ne,l as ve,a as g,I as C,i as I,L as T,m as M,n as ne,o as be,s as we,p as Ce,q as ye,S as W,r as L,t as $,v as re,w as Oe,x as Ae,y as le,z as ie,A as ce,D as Ee,E as Te,F as X,G as Z,R as ke,H as q,J as _e,K as Se,M as Pe,N as Re}from"./index-D-LYJymx.js";import{u as Le,a as Me,b as De}from"./tanstack-Coed0rqz.js";import{C as B,S as ee}from"./confirm-dialog-Dut98zdb.js";import{t as Q}from"./notifications-dJQY2-U6.js";import{$ as U,a9 as oe,L as G,aa as Ie,E as Ue,d as He,N as D,I as Fe,ab as de,O as Y,b as xe,ac as ze,J as Ke,ad as Je,m as me,X as $e,Z as ue,ae as Be,Y as Qe,Q as he,af as qe,n as fe}from"./icons-CMYcel9O.js";import{C as Ge,b as Ye,c as Ve,d as We,a as Xe}from"./card-CfgEo_Fi.js";import"./utils-CzKF5WmX.js";import"./form-utils-kUVlZZAO.js";import"./code-highlight-DKN39ySy.js";import"./alert-dialog-sKmXLtjs.js";function Ze({className:s,showTooltip:t=!0}){const l=e.jsxs(S,{variant:"outline",className:E("bg-accent/10 border-accent/30 text-accent","dark:bg-accent/20 dark:border-accent/40 dark:text-accent-foreground",s),children:[e.jsx("img",{src:"/icons/openrouter.svg",alt:"OpenRouter",className:"mr-1 h-3 w-3"}),"OpenRouter"]});return t?e.jsxs(je,{children:[e.jsx(Ne,{asChild:!0,children:l}),e.jsx(ve,{children:e.jsx("p",{children:"Access 349+ models via OpenRouter"})})]}):l}function se(s){return[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/^API_KEY$/,/^AUTH_TOKEN$/,/_SECRET$/,/^SECRET$/].some(l=>l.test(s))}function pe(s){return s?.env?(s.env.ANTHROPIC_BASE_URL||"").toLowerCase().includes("openrouter.ai"):!1}function es(s){return{opus:s.ANTHROPIC_DEFAULT_OPUS_MODEL||void 0,sonnet:s.ANTHROPIC_DEFAULT_SONNET_MODEL||void 0,haiku:s.ANTHROPIC_DEFAULT_HAIKU_MODEL||void 0}}function ss(s,t){const l={...s};return t.opus?l.ANTHROPIC_DEFAULT_OPUS_MODEL=t.opus:delete l.ANTHROPIC_DEFAULT_OPUS_MODEL,t.sonnet?l.ANTHROPIC_DEFAULT_SONNET_MODEL=t.sonnet:delete l.ANTHROPIC_DEFAULT_SONNET_MODEL,t.haiku?l.ANTHROPIC_DEFAULT_HAIKU_MODEL=t.haiku:delete l.ANTHROPIC_DEFAULT_HAIKU_MODEL,l}function ts({profileName:s,data:t,settings:l,isLoading:i,isSaving:d,hasChanges:h,isRawJsonValid:x,onRefresh:n,onDelete:o,onSave:m}){return e.jsxs("div",{className:"px-6 py-4 border-b bg-background flex items-center justify-between shrink-0",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold",children:s}),t?.path&&e.jsx(S,{variant:"outline",className:"text-xs",children:t.path.replace(/^.*\//,"")}),pe(l)&&e.jsx(Ze,{className:"ml-1"})]}),t&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Last modified: ",new Date(t.mtime).toLocaleString()]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{variant:"ghost",size:"sm",onClick:n,disabled:i,children:e.jsx(U,{className:`w-4 h-4 ${i?"animate-spin":""}`})}),o&&e.jsx(g,{variant:"ghost",size:"sm",onClick:o,children:e.jsx(oe,{className:"w-4 h-4 text-destructive"})}),e.jsx(g,{size:"sm",onClick:m,disabled:d||!h||!x,children:d?e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ie,{className:"w-4 h-4 mr-1"}),"Save"]})})]})]})}function ge({label:s,...t}){const[l,i]=c.useState(!1);return e.jsxs("div",{className:"space-y-1",children:[s&&e.jsx("label",{className:"text-sm font-medium",children:s}),e.jsxs("div",{className:"relative",children:[e.jsx(C,{type:l?"text":"password",className:"pr-10 font-mono",...t}),e.jsx(g,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3",onClick:()=>i(!l),tabIndex:-1,children:l?e.jsx(Ue,{className:"w-4 h-4"}):e.jsx(He,{className:"w-4 h-4"})})]})]})}function as({currentSettings:s,newEnvKey:t,newEnvValue:l,onNewEnvKeyChange:i,onNewEnvValueChange:d,onEnvValueChange:h,onAddEnvVar:x}){return e.jsxs(e.Fragment,{children:[e.jsx(I,{className:"flex-1",children:e.jsx("div",{className:"p-4 space-y-4",children:s?.env&&Object.keys(s.env).length>0?e.jsx(e.Fragment,{children:Object.entries(s.env).map(([n,o])=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(T,{className:"text-xs font-medium flex items-center gap-2 text-muted-foreground",children:[n,se(n)&&e.jsx(S,{variant:"secondary",className:"text-[10px] px-1 py-0 h-4",children:"sensitive"})]}),se(n)?e.jsx(ge,{value:o,onChange:m=>h(n,m.target.value),className:"font-mono text-sm h-8"}):e.jsx(C,{value:o,onChange:m=>h(n,m.target.value),className:"font-mono text-sm h-8"})]},n))}):e.jsxs("div",{className:"py-8 text-center text-muted-foreground bg-muted/30 rounded-lg border border-dashed text-sm",children:[e.jsx("p",{children:"No environment variables configured."}),e.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Add variables using the input below or edit the JSON directly."})]})})}),e.jsxs("div",{className:"p-4 border-t bg-background shrink-0",children:[e.jsx(T,{className:"text-xs font-medium text-muted-foreground",children:"Add Environment Variable"}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(C,{placeholder:"VARIABLE_NAME",value:t,onChange:n=>i(n.target.value.toUpperCase()),className:"font-mono text-sm h-8 w-2/5",onKeyDown:n=>n.key==="Enter"&&t.trim()&&x()}),e.jsx(C,{placeholder:"value",value:l,onChange:n=>d(n.target.value),className:"font-mono text-sm h-8 flex-1",onKeyDown:n=>n.key==="Enter"&&t.trim()&&x()}),e.jsx(g,{variant:"outline",size:"sm",className:"h-8",onClick:x,disabled:!t.trim(),children:e.jsx(D,{className:"w-4 h-4"})})]})]})]})}function ns({profileName:s,data:t}){return e.jsx(I,{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(Fe,{className:"w-4 h-4"}),"Profile Information"]}),e.jsx("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children: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:"Profile Name"}),e.jsx("span",{className:"font-mono",children:t.profile})]}),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(M,{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",{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.jsxs("div",{children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"Run with profile"}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsxs("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:["ccs ",s,' "prompt"']}),e.jsx(M,{value:`ccs ${s} "prompt"`,size:"icon",className:"h-6 w-6"})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:"Set as default"}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsxs("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:["ccs default ",s]}),e.jsx(M,{value:`ccs default ${s}`,size:"icon",className:"h-6 w-6"})]})]})]})]})]})})}function rs({value:s,onChange:t,placeholder:l="Search models...",className:i}){const[d,h]=c.useState(""),[x,n]=c.useState(null),{models:o,isLoading:m,isError:j,isFetching:y}=ne(),O=be(),N=c.useMemo(()=>we(o,d,{category:x??void 0}),[o,d,x]),b=c.useMemo(()=>Ce(o,2),[o]),_=!d.trim()&&!x,k=c.useMemo(()=>{const r={anthropic:[],openai:[],google:[],meta:[],mistral:[],opensource:[],other:[]};N.forEach(a=>{r[a.category].push(a)});for(const a of Object.keys(r))r[a]=ye(r[a]);return r},[N]),w=c.useCallback(()=>{O()},[O]),p=o.find(r=>r.id===s);return m&&o.length===0?e.jsxs("div",{className:E("space-y-2",i),children:[e.jsx(W,{className:"h-10 w-full"}),e.jsx(W,{className:"h-32 w-full"})]}):e.jsxs("div",{className:E("space-y-2 w-full min-w-0 overflow-hidden",i),children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(de,{className:"text-muted-foreground absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2"}),e.jsx(C,{value:d,onChange:r=>h(r.target.value),placeholder:l,className:"pl-9"})]}),e.jsx(g,{variant:"outline",size:"icon",onClick:w,disabled:y,title:"Refresh models",children:y?e.jsx(G,{className:"h-4 w-4 animate-spin"}):e.jsx(U,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsxs(S,{variant:x===null?"default":"outline",className:"cursor-pointer",onClick:()=>n(null),children:["All (",o.length,")"]}),Object.keys(L).map(r=>{const a=k[r].length;return a===0?null:e.jsxs(S,{variant:x===r?"default":"outline",className:"cursor-pointer",onClick:()=>n(r),children:[L[r]," (",a,")"]},r)})]}),p&&e.jsxs("div",{className:"bg-muted rounded-md p-2 text-sm",children:[e.jsx("span",{className:"font-medium",children:p.name}),e.jsxs("span",{className:"text-muted-foreground ml-2",children:[$(p.pricing)," |"," ",re(p.context_length)]})]}),e.jsx(I,{className:"h-72 w-full rounded-md border",children:j?e.jsxs("div",{className:"text-destructive p-4 text-center",children:["Failed to load models."," ",e.jsx(g,{variant:"link",onClick:w,children:"Retry"})]}):N.length===0?e.jsxs("div",{className:"text-muted-foreground p-4 text-center",children:['No models found matching "',d,'"']}):e.jsxs("div",{className:"space-y-6 p-3",children:[_&&b.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"text-muted-foreground bg-background sticky top-0 mb-2 flex items-center gap-1.5 py-1.5 text-xs font-semibold border-b pb-2",children:[e.jsx(Y,{className:"h-3 w-3 text-accent"}),e.jsx("span",{children:"Newest Models"})]}),e.jsx("div",{className:"space-y-1",children:b.map(r=>e.jsx(te,{model:r,isSelected:r.id===s,onClick:()=>t(r.id),showAge:!0},r.id))})]}),Object.keys(L).map(r=>{const a=k[r];return a.length===0?null:e.jsxs("div",{children:[e.jsx("div",{className:"text-muted-foreground bg-background sticky top-0 mb-2 py-1.5 text-xs font-semibold border-b pb-2",children:L[r]}),e.jsx("div",{className:"space-y-1",children:a.map(v=>e.jsx(te,{model:v,isSelected:v.id===s,onClick:()=>t(v.id)},v.id))})]},r)})]})})]})}function te({model:s,isSelected:t,onClick:l,showAge:i=!1}){return e.jsxs("button",{type:"button",onClick:l,className:E("group flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm transition-colors","hover:bg-accent hover:text-accent-foreground",t&&"bg-accent text-accent-foreground"),children:[e.jsx("span",{className:"flex-1 min-w-0 truncate font-medium",children:s.name}),e.jsxs("span",{className:E("flex shrink-0 items-center gap-1 text-xs whitespace-nowrap",t?"text-accent-foreground/80":"text-muted-foreground group-hover:text-accent-foreground/80"),children:[i&&s.created&&e.jsx(S,{variant:"outline",className:E("text-[10px] px-1",t?"border-accent-foreground/30 text-accent-foreground/80":"text-accent border-accent/30 group-hover:text-accent-foreground/80 group-hover:border-accent-foreground/30"),children:Oe(s.created)}),s.isFree?e.jsx(S,{variant:"secondary",className:E("text-[10px] px-1",t?"bg-accent-foreground/20 text-accent-foreground":"group-hover:bg-accent-foreground/20 group-hover:text-accent-foreground"),children:"Free"}):s.isExacto?e.jsxs(e.Fragment,{children:[e.jsx(S,{variant:"outline",className:E("text-[10px] px-1 border-emerald-500/50 text-emerald-600",t?"border-accent-foreground/30 text-accent-foreground/80":"group-hover:border-accent-foreground/30 group-hover:text-accent-foreground/80"),children:"Exacto"}),e.jsx("span",{className:"tabular-nums",children:$(s.pricing)})]}):e.jsx("span",{className:"tabular-nums",children:$(s.pricing)}),e.jsx("span",{className:"tabular-nums",children:re(s.context_length)})]})]})}function ls({selectedModel:s,value:t,onChange:l,className:i}){const{models:d}=ne(),h=c.useMemo(()=>s?Ae(s,d):{},[s,d]),x=()=>{l(h)},n=(m,j)=>{l({...t,[m]:j||void 0})},o=s&&Object.keys(h).length>0;return e.jsxs(le,{className:E("group",i),children:[e.jsxs(ie,{className:"flex items-center gap-2 text-sm font-medium hover:underline",children:[e.jsx(xe,{className:"h-4 w-4 transition-transform group-data-[state=open]:rotate-90"}),"Model Tier Mapping",e.jsx("span",{className:"text-muted-foreground font-normal",children:"(Advanced)"})]}),e.jsxs(ce,{className:"space-y-3 pt-3",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Configure different models for Claude Code's opus/sonnet/haiku tiers."}),o&&e.jsxs(g,{type:"button",variant:"outline",size:"sm",onClick:x,children:[e.jsx(ze,{className:"mr-1 h-4 w-4"}),"Auto-suggest based on ",s?.split("/")[0]]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid grid-cols-[80px_1fr] items-center gap-2",children:[e.jsx(T,{htmlFor:"tier-opus",className:"text-right",children:"Opus"}),e.jsx(C,{id:"tier-opus",value:t.opus??"",onChange:m=>n("opus",m.target.value),placeholder:"e.g., anthropic/claude-opus-4"})]}),e.jsxs("div",{className:"grid grid-cols-[80px_1fr] items-center gap-2",children:[e.jsx(T,{htmlFor:"tier-sonnet",className:"text-right",children:"Sonnet"}),e.jsx(C,{id:"tier-sonnet",value:t.sonnet??"",onChange:m=>n("sonnet",m.target.value),placeholder:"e.g., anthropic/claude-sonnet-4"})]}),e.jsxs("div",{className:"grid grid-cols-[80px_1fr] items-center gap-2",children:[e.jsx(T,{htmlFor:"tier-haiku",className:"text-right",children:"Haiku"}),e.jsx(C,{id:"tier-haiku",value:t.haiku??"",onChange:m=>n("haiku",m.target.value),placeholder:"e.g., anthropic/claude-3.5-haiku"})]})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"These set ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL."})]})]})}function is({profileName:s,data:t,currentSettings:l,newEnvKey:i,newEnvValue:d,onNewEnvKeyChange:h,onNewEnvValueChange:x,onEnvValueChange:n,onAddEnvVar:o,onEnvBulkChange:m}){const j=pe(l),y=l?.env,O=c.useMemo(()=>es(y??{}),[y]),N=y??{},b=a=>{if(m){const v={...N,ANTHROPIC_MODEL:a,ANTHROPIC_DEFAULT_OPUS_MODEL:a,ANTHROPIC_DEFAULT_SONNET_MODEL:a,ANTHROPIC_DEFAULT_HAIKU_MODEL:a};m(v)}else n("ANTHROPIC_MODEL",a),n("ANTHROPIC_DEFAULT_OPUS_MODEL",a),n("ANTHROPIC_DEFAULT_SONNET_MODEL",a),n("ANTHROPIC_DEFAULT_HAIKU_MODEL",a);Q.success("Applied model to all tiers",{duration:2e3})},_=a=>{if(m){const v=ss(N,a);m(v)}else a.opus!==void 0&&n("ANTHROPIC_DEFAULT_OPUS_MODEL",a.opus||""),a.sonnet!==void 0&&n("ANTHROPIC_DEFAULT_SONNET_MODEL",a.sonnet||""),a.haiku!==void 0&&n("ANTHROPIC_DEFAULT_HAIKU_MODEL",a.haiku||"")},[k,w]=c.useState(!1),p=new Set(["ANTHROPIC_AUTH_TOKEN"]),r=Object.entries(N).filter(([a])=>!p.has(a));return e.jsx("div",{className:"h-full w-full min-w-0 flex flex-col",children:e.jsxs(Ee,{defaultValue:"env",className:"h-full w-full min-w-0 flex flex-col",children:[e.jsx("div",{className:"px-4 pt-4 shrink-0",children:e.jsxs(Te,{className:"w-full",children:[e.jsx(X,{value:"env",className:"flex-1",children:j?"Configuration":"Environment Variables"}),e.jsx(X,{value:"info",className:"flex-1",children:"Info & Usage"})]})}),e.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col min-w-0",children:[e.jsx(Z,{value:"env",className:"flex-1 mt-0 border-0 p-0 data-[state=inactive]:hidden flex flex-col overflow-hidden min-w-0",children:j?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsxs("div",{className:"h-full overflow-y-auto overflow-x-hidden p-4 space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(T,{className:"text-sm font-medium",children:"Model Selection"}),e.jsx(rs,{value:N.ANTHROPIC_MODEL,onChange:b,placeholder:"Search OpenRouter models..."})]}),e.jsx(ls,{selectedModel:N.ANTHROPIC_MODEL,value:O,onChange:_}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"API Key"}),e.jsx(ge,{value:N.ANTHROPIC_AUTH_TOKEN||"",onChange:a=>n("ANTHROPIC_AUTH_TOKEN",a.target.value),placeholder:"sk-or-v1-...",className:"font-mono text-sm"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Get your API key from"," ",e.jsx("a",{href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"openrouter.ai/keys"})]})]}),r.length>0&&e.jsxs(le,{open:k,onOpenChange:w,children:[e.jsxs(ie,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors group",children:[e.jsx(xe,{className:E("h-4 w-4 transition-transform",k&&"rotate-90")}),e.jsx(Ke,{className:"h-4 w-4"}),e.jsx("span",{children:"Additional Variables"}),e.jsxs("span",{className:"text-xs font-normal opacity-70",children:["(",r.length,")"]})]}),e.jsx(ce,{className:"pt-4",children:e.jsx("div",{className:"space-y-3 border rounded-lg p-3 bg-muted/30",children:r.map(([a,v])=>e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:a}),e.jsx(C,{value:v,onChange:P=>n(a,P.target.value),className:"font-mono text-xs h-8"})]},a))})})]})]})}),e.jsxs("div",{className:"p-4 border-t bg-background shrink-0",children:[e.jsx(T,{className:"text-xs font-medium text-muted-foreground",children:"Add Environment Variable"}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(C,{placeholder:"VARIABLE_NAME",value:i,onChange:a=>h(a.target.value.toUpperCase()),className:"font-mono text-sm h-8 w-2/5",onKeyDown:a=>a.key==="Enter"&&i.trim()&&o()}),e.jsx(C,{placeholder:"value",value:d,onChange:a=>x(a.target.value),className:"font-mono text-sm h-8 flex-1",onKeyDown:a=>a.key==="Enter"&&i.trim()&&o()}),e.jsx(g,{variant:"outline",size:"sm",className:"h-8",onClick:o,disabled:!i.trim(),children:e.jsx(D,{className:"w-4 h-4"})})]})]})]}):e.jsx(as,{currentSettings:l,newEnvKey:i,newEnvValue:d,onNewEnvKeyChange:h,onNewEnvValueChange:x,onEnvValueChange:n,onAddEnvVar:o})}),e.jsx(Z,{value:"info",className:"h-full mt-0 border-0 p-0 data-[state=inactive]:hidden",children:e.jsx(ns,{profileName:s,data:t})})]})]})})}function cs({profileName:s,onDelete:t,onHasChangesUpdate:l}){const[i,d]=c.useState({}),[h,x]=c.useState(!1),[n,o]=c.useState(null),[m,j]=c.useState(""),[y,O]=c.useState(""),N=Le(),{data:b,isLoading:_,isError:k,refetch:w}=Me({queryKey:["settings",s],queryFn:async()=>{const f=await fetch(`/api/settings/${s}/raw`);if(!f.ok)throw new Error(`Failed to load settings: ${f.status}`);return f.json()}}),p=b?.settings,r=c.useMemo(()=>{if(n!==null)try{return JSON.parse(n)}catch{}if(p)return{...p,env:{...p.env,...i}}},[p,i,n]),a=c.useMemo(()=>n!==null?n:p?JSON.stringify(p,null,2):"",[n,p]),v=c.useCallback(f=>{o(f)},[]),P=(f,A)=>{const R={...r?.env||{},[f]:A};d(J=>({...J,[f]:A})),o(JSON.stringify({...r,env:R},null,2))},H=f=>{const A={...r?.env||{},...f};d(R=>({...R,...f})),o(JSON.stringify({...r,env:A},null,2))},F=()=>{if(!m.trim())return;const f=m.trim(),A=y,R={...r?.env||{},[f]:A};d(J=>({...J,[f]:A})),o(JSON.stringify({...r,env:R},null,2)),j(""),O("")},u=c.useMemo(()=>{try{return JSON.parse(a),!0}catch{return!1}},[a]),z=c.useMemo(()=>n!==null?n!==JSON.stringify(p,null,2):Object.keys(i).length>0,[n,i,p]);c.useEffect(()=>{l?.(z)},[z,l]);const K=De({mutationFn:async()=>{let f;try{f=JSON.parse(a)}catch{f={...b?.settings,env:{...b?.settings?.env,...i}}}const A=await fetch(`/api/settings/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:f,expectedMtime:b?.mtime})});if(A.status===409)throw new Error("CONFLICT");if(!A.ok)throw new Error("Failed to save");return A.json()},onSuccess:()=>{N.invalidateQueries({queryKey:["settings",s]}),N.invalidateQueries({queryKey:["profiles"]}),d({}),o(null),Q.success("Settings saved")},onError:f=>{f.message==="CONFLICT"?x(!0):Q.error(f.message)}}),V=async f=>{x(!1),f?(await w(),K.mutate()):(d({}),o(null))};return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx(ts,{profileName:s,data:b,settings:r,isLoading:_,isSaving:K.isPending,hasChanges:z,isRawJsonValid:u,onRefresh:()=>w(),onDelete:t,onSave:()=>K.mutate()}),_?e.jsxs("div",{className:"flex-1 flex items-center justify-center",children:[e.jsx(G,{className:"w-8 h-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"Loading settings..."})]}):k?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Failed to load settings."}),e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>w(),children:[e.jsx(U,{className:"w-4 h-4 mr-1"}),"Retry"]})]})}):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 min-w-0",children:e.jsx(is,{profileName:s,data:b,currentSettings:r,newEnvKey:m,newEnvValue:y,onNewEnvKeyChange:j,onNewEnvValueChange:O,onEnvValueChange:P,onEnvBulkChange:H,onAddEnvVar:F})}),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(Je,{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(ke,{rawJsonContent:a,isRawJsonValid:u,rawJsonEdits:n,settings:p,onChange:v})]})]}),e.jsx(B,{open:h,title:"File Modified Externally",description:"Overwrite with your changes or discard?",confirmText:"Overwrite",variant:"destructive",onConfirm:()=>V(!0),onCancel:()=>V(!1)})]},s)}const ae="ccs:openrouter-banner-dismissed";function os({onCreateClick:s}){const[t,l]=c.useState(!0),{modelCount:i,isLoading:d}=q();c.useEffect(()=>{const x=localStorage.getItem(ae)==="true";l(x)},[]);const h=()=>{localStorage.setItem(ae,"true"),l(!0)};return t?null:e.jsx("div",{className:"bg-gradient-to-r from-accent to-accent/90 text-white px-4 py-3 relative shrink-0",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 max-w-screen-xl mx-auto",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("div",{className:"p-1.5 bg-white/20 rounded-md shrink-0",children:e.jsx(Y,{className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium text-sm",children:"NEW: OpenRouter Integration"}),e.jsxs("p",{className:"text-xs text-white/80 truncate",children:["Browse ",d?"300+":`${i}+`," models from OpenAI, Anthropic, Google, Meta and more."]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s&&e.jsx(g,{size:"sm",variant:"secondary",onClick:s,className:"bg-white text-accent hover:bg-white/90 h-8",children:"Try it now"}),e.jsxs("a",{href:"https://openrouter.ai",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-white/80 hover:text-white hidden sm:flex items-center gap-1",children:["Learn more",e.jsx(me,{className:"w-3 h-3"})]}),e.jsxs(g,{size:"icon",variant:"ghost",onClick:h,className:"h-7 w-7 text-white/70 hover:text-white hover:bg-white/20",children:[e.jsx($e,{className:"w-4 h-4"}),e.jsx("span",{className:"sr-only",children:"Dismiss"})]})]})]})})}function ds({onOpenRouterClick:s,onCustomClick:t}){const{modelCount:l,isLoading:i}=q();return e.jsx("div",{className:"flex-1 flex items-center justify-center bg-muted/20 p-8",children:e.jsxs("div",{className:"max-w-lg w-full space-y-6",children:[e.jsxs(Ge,{className:"border-accent/30 dark:border-accent/40 bg-gradient-to-br from-accent/5 to-background dark:from-accent/10",children:[e.jsxs(Ye,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"p-2 rounded-lg bg-accent/10 dark:bg-accent/20",children:e.jsx("img",{src:"/icons/openrouter.svg",alt:"OpenRouter",className:"w-6 h-6"})}),e.jsx(S,{variant:"secondary",className:"bg-accent/10 text-accent dark:bg-accent/20 dark:text-accent-foreground",children:"Recommended"})]}),e.jsx(Ve,{className:"text-xl",children:"Start with OpenRouter"}),e.jsxs(We,{className:"text-base",children:["Access ",i?"300+":`${l}+`," models from OpenAI, Anthropic, Google, Meta and more - all through one API."]})]}),e.jsxs(Xe,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(ue,{className:"w-4 h-4 text-accent"}),e.jsx("span",{children:"One API, all providers"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(Y,{className:"w-4 h-4 text-accent"}),e.jsx("span",{children:"Model tier mapping"})]})]}),e.jsxs(g,{onClick:s,className:"w-full bg-accent hover:bg-accent/90 text-white",size:"lg",children:["Create OpenRouter Profile",e.jsx(Be,{className:"w-4 h-4 ml-2"})]}),e.jsxs("p",{className:"text-xs text-center text-muted-foreground",children:["Get your API key at"," ",e.jsxs("a",{href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline inline-flex items-center gap-1",children:["openrouter.ai/keys",e.jsx(me,{className:"w-3 h-3"})]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(ee,{className:"flex-1"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),e.jsx(ee,{className:"flex-1"})]}),e.jsx(g,{variant:"outline",onClick:t,className:"w-full",children:"Create Custom API Profile"})]})})}function xs({onCreateClick:s}){const{modelCount:t,isLoading:l}=q();return e.jsx("div",{className:"p-3 border-t bg-gradient-to-r from-accent/5 to-accent/10 dark:from-accent/10 dark:to-accent/15",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"p-1.5 bg-accent/10 dark:bg-accent/20 rounded shrink-0",children:e.jsx("img",{src:"/icons/openrouter.svg",alt:"",className:"w-4 h-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-accent dark:text-accent-foreground",children:"OpenRouter"}),e.jsxs("p",{className:"text-[10px] text-muted-foreground truncate",children:[l?"300+":`${t}+`," models available"]})]}),e.jsxs(g,{size:"sm",variant:"ghost",onClick:s,className:"h-7 px-2 text-accent hover:text-accent hover:bg-accent/10 dark:hover:bg-accent/20",children:[e.jsx(ue,{className:"w-3 h-3 mr-1"}),e.jsx("span",{className:"text-xs",children:"Add"})]})]})})}function Os(){const{data:s,isLoading:t,isError:l,refetch:i}=_e(),d=Se(),[h,x]=c.useState(null),[n,o]=c.useState(""),[m,j]=c.useState(!1),[y,O]=c.useState("normal"),[N,b]=c.useState(null),[_,k]=c.useState(!1),[w,p]=c.useState(null);Pe();const r=c.useMemo(()=>s?.profiles||[],[s?.profiles]),a=c.useMemo(()=>r.filter(u=>u.name.toLowerCase().includes(n.toLowerCase())),[r,n]),v=h?r.find(u=>u.name===h):null,P=u=>{d.mutate(u,{onSuccess:()=>{h===u&&x(null),b(null)}})},H=u=>{j(!1),_&&h!==null?p(u):x(u)},F=u=>{_&&h!==u?p(u):x(u)};return e.jsxs("div",{className:"h-[calc(100vh-100px)] flex flex-col",children:[e.jsx(os,{onCreateClick:()=>j(!0)}),e.jsxs("div",{className:"flex-1 flex min-h-0",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-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qe,{className:"w-5 h-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:"API Profiles"})]}),e.jsxs(g,{size:"sm",onClick:()=>{j(!0)},children:[e.jsx(D,{className:"w-4 h-4 mr-1"}),"New"]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(de,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(C,{placeholder:"Search profiles...",className:"pl-8 h-9",value:n,onChange:u=>o(u.target.value)})]})]}),e.jsx(I,{className:"flex-1",children:t?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Loading profiles..."}):l?e.jsx("div",{className:"p-4 text-center",children:e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(he,{className:"w-12 h-12 mx-auto text-destructive/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Failed to load profiles"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Unable to fetch API profiles. Please try again."})]}),e.jsxs(g,{size:"sm",variant:"outline",onClick:()=>i(),children:[e.jsx(U,{className:"w-4 h-4 mr-1"}),"Retry"]})]})}):a.length===0?e.jsx("div",{className:"p-4 text-center",children:r.length===0?e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(qe,{className:"w-12 h-12 mx-auto text-muted-foreground/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"No API profiles yet"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Create your first profile to connect to custom API endpoints"})]}),e.jsxs(g,{size:"sm",variant:"outline",onClick:()=>{j(!0)},children:[e.jsx(D,{className:"w-4 h-4 mr-1"}),"Create Profile"]})]}):e.jsxs("p",{className:"text-sm text-muted-foreground py-4",children:['No profiles match "',n,'"']})}):e.jsx("div",{className:"p-2 space-y-1",children:a.map(u=>e.jsx(ms,{profile:u,isSelected:h===u.name,onSelect:()=>F(u.name),onDelete:()=>b(u.name)},u.name))})}),r.length>0&&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:[r.length," profile",r.length!==1?"s":""]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(fe,{className:"w-3 h-3 text-green-600"}),r.filter(u=>u.configured).length," configured"]})]})}),e.jsx(xs,{onCreateClick:()=>{O("openrouter"),j(!0)}})]}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0",children:v?e.jsx(cs,{profileName:v.name,onDelete:()=>b(v.name),onHasChangesUpdate:k},v.name):e.jsx(ds,{onOpenRouterClick:()=>{O("openrouter"),j(!0)},onCustomClick:()=>{O("normal"),j(!0)}})})]}),e.jsx(Re,{open:m,onOpenChange:j,onSuccess:H,initialMode:y}),e.jsx(B,{open:!!N,title:"Delete Profile",description:`Are you sure you want to delete "${N}"? This will remove the settings file and cannot be undone.`,confirmText:"Delete",variant:"destructive",onConfirm:()=>N&&P(N),onCancel:()=>b(null)}),e.jsx(B,{open:!!w,title:"Unsaved Changes",description:`You have unsaved changes in "${h}". Discard and switch to "${w}"?`,confirmText:"Discard & Switch",variant:"destructive",onConfirm:()=>{k(!1),x(w),p(null)},onCancel:()=>p(null)})]})}function ms({profile:s,isSelected:t,onSelect:l,onDelete:i}){return e.jsxs("div",{className:E("group flex items-center gap-2 px-3 py-2.5 rounded-md cursor-pointer transition-colors",t?"bg-primary/10 border border-primary/20":"hover:bg-muted border border-transparent"),onClick:l,children:[s.configured?e.jsx(fe,{className:"w-4 h-4 text-green-600 shrink-0"}):e.jsx(he,{className:"w-4 h-4 text-yellow-600 shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:s.name}),e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("div",{className:"text-xs text-muted-foreground truncate flex-1",children:s.settingsPath}),e.jsx(M,{value:s.settingsPath,size:"icon",className:"h-5 w-5 opacity-0 group-hover:opacity-100 transition-opacity"})]})]}),e.jsx(g,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:d=>{d.stopPropagation(),i()},children:e.jsx(oe,{className:"w-3.5 h-3.5 text-destructive"})})]})}export{Os as ApiPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-uXQB-q0u.js";import{r as t}from"./react-vendor-B_CU-WTZ.js";import{
|
|
1
|
+
import{j as e}from"./radix-ui-uXQB-q0u.js";import{r as t}from"./react-vendor-B_CU-WTZ.js";import{av as Q,aq as H,as as V,i as W,I as b,a as i}from"./index-D-LYJymx.js";import{$ as E,Q as X,n as Y,k as Z,E as K,d as A,j as T,l as P,ax as _,O as ee,R as se,aa as ae}from"./icons-CMYcel9O.js";import"./tanstack-Coed0rqz.js";import"./notifications-dJQY2-U6.js";import"./utils-CzKF5WmX.js";import"./form-utils-kUVlZZAO.js";import"./code-highlight-DKN39ySy.js";function ue(){const{fetchRawConfig:o}=Q(),[a,I]=t.useState(null),[g,v]=t.useState(!0),[n,c]=t.useState(!1),[x,r]=t.useState(null),[p,f]=t.useState(null),[y,R]=t.useState(!1),[j,z]=t.useState(!1),[d,w]=t.useState(null),[m,N]=t.useState(null),[L,C]=t.useState(!1),[U,k]=t.useState(!1),u=t.useCallback(async()=>{try{v(!0),r(null);const s=await fetch("/api/settings/auth/tokens/raw");if(!s.ok)throw new Error("Failed to fetch auth tokens");const l=await s.json();I(l)}catch(s){r(s instanceof Error?s.message:"Unknown error")}finally{v(!1)}},[]);t.useEffect(()=>{u(),o()},[u,o]),t.useEffect(()=>{if(p){const s=setTimeout(()=>f(null),3e3);return()=>clearTimeout(s)}},[p]),t.useEffect(()=>{if(x){const s=setTimeout(()=>r(null),5e3);return()=>clearTimeout(s)}},[x]);const F=async()=>{const s=d!==null&&d!==a?.apiKey.value,l=m!==null&&m!==a?.managementSecret.value;if(!(!s&&!l))try{c(!0),r(null);const h={};s&&(h.apiKey=d),l&&(h.managementSecret=m);const S=await fetch("/api/settings/auth/tokens",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(h)});if(!S.ok){const J=await S.json();throw new Error(J.error||"Failed to save tokens")}f("Tokens updated. Restart CLIProxy to apply."),w(null),N(null),await u(),await o()}catch(h){r(h instanceof Error?h.message:"Unknown error")}finally{c(!1)}},O=async()=>{try{c(!0),r(null);const s=await fetch("/api/settings/auth/tokens/regenerate-secret",{method:"POST"});if(!s.ok){const l=await s.json();throw new Error(l.error||"Failed to regenerate secret")}f("New management secret generated. Restart CLIProxy to apply."),await u(),await o()}catch(s){r(s instanceof Error?s.message:"Unknown error")}finally{c(!1)}},$=async()=>{try{c(!0),r(null);const s=await fetch("/api/settings/auth/tokens/reset",{method:"POST"});if(!s.ok){const l=await s.json();throw new Error(l.error||"Failed to reset tokens")}f("Tokens reset to defaults. Restart CLIProxy to apply."),w(null),N(null),await u(),await o()}catch(s){r(s instanceof Error?s.message:"Unknown error")}finally{c(!1)}},D=async()=>{a&&(await navigator.clipboard.writeText(a.apiKey.value),C(!0),setTimeout(()=>C(!1),2e3))},q=async()=>{a&&(await navigator.clipboard.writeText(a.managementSecret.value),k(!0),setTimeout(()=>k(!1),2e3))};if(g||!a)return 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(E,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:"Loading..."})]})});const M=d??a.apiKey.value,B=m??a.managementSecret.value,G=d!==null&&d!==a.apiKey.value||m!==null&&m!==a.managementSecret.value;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${x||p?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[x&&e.jsxs(H,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(X,{className:"h-4 w-4"}),e.jsx(V,{children:x})]}),p&&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(Y,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:p})]})]}),e.jsx(W,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Configure CLIProxy authentication tokens. Changes require CLIProxy restart."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Z,{className:"w-4 h-4 text-primary"}),e.jsx("h3",{className:"text-base font-medium",children:"API Key"}),a.apiKey.isCustom&&e.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",children:"Custom"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Used by Claude Code to authenticate with CLIProxy"}),e.jsx("div",{className:"flex gap-2",children:e.jsxs("div",{className:"relative flex-1",children:[e.jsx(b,{type:y?"text":"password",value:M,onChange:s=>w(s.target.value),placeholder:"API key",disabled:n,className:"pr-20 font-mono text-sm"}),e.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex gap-1",children:[e.jsx(i,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>R(!y),children:y?e.jsx(K,{className:"w-4 h-4"}):e.jsx(A,{className:"w-4 h-4"})}),e.jsx(i,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:D,disabled:!a.apiKey.value,children:L?e.jsx(T,{className:"w-4 h-4 text-green-600"}):e.jsx(P,{className:"w-4 h-4"})})]})]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{className:"w-4 h-4 text-primary"}),e.jsx("h3",{className:"text-base font-medium",children:"Management Secret"}),a.managementSecret.isCustom&&e.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",children:"Custom"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Used by CCS dashboard to access CLIProxy management APIs"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(b,{type:j?"text":"password",value:B,onChange:s=>N(s.target.value),placeholder:"Management secret",disabled:n,className:"pr-20 font-mono text-sm"}),e.jsxs("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex gap-1",children:[e.jsx(i,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>z(!j),children:j?e.jsx(K,{className:"w-4 h-4"}):e.jsx(A,{className:"w-4 h-4"})}),e.jsx(i,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:q,disabled:!a.managementSecret.value,children:U?e.jsx(T,{className:"w-4 h-4 text-green-600"}):e.jsx(P,{className:"w-4 h-4"})})]})]}),e.jsx(i,{variant:"outline",size:"sm",onClick:O,disabled:n,title:"Generate new secure secret",children:e.jsx(ee,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"pt-4 border-t",children:[e.jsxs(i,{variant:"outline",size:"sm",onClick:$,disabled:n||!a.apiKey.isCustom&&!a.managementSecret.isCustom,className:"gap-2",children:[e.jsx(se,{className:"w-4 h-4"}),"Reset to Defaults"]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Resets both API key and management secret to their default values."})]})]})}),e.jsxs("div",{className:"p-4 border-t bg-background flex gap-2",children:[e.jsxs(i,{variant:"outline",size:"sm",onClick:()=>{u(),o()},disabled:g||n,className:"flex-1",children:[e.jsx(E,{className:`w-4 h-4 mr-2 ${g?"animate-spin":""}`}),"Refresh"]}),e.jsxs(i,{variant:"default",size:"sm",onClick:F,disabled:!G||n,className:"flex-1",children:[e.jsx(ae,{className:`w-4 h-4 mr-2 ${n?"animate-pulse":""}`}),n?"Saving...":"Save"]})]})]})}export{ue as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./radix-ui-uXQB-q0u.js";import"./react-vendor-B_CU-WTZ.js";import{c as d}from"./index-
|
|
1
|
+
import{j as r}from"./radix-ui-uXQB-q0u.js";import"./react-vendor-B_CU-WTZ.js";import{c as d}from"./index-D-LYJymx.js";function n({className:a,...t}){return r.jsx("div",{"data-slot":"card",className:d("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",a),...t})}function c({className:a,...t}){return r.jsx("div",{"data-slot":"card-header",className:d("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",a),...t})}function i({className:a,...t}){return r.jsx("div",{"data-slot":"card-title",className:d("leading-none font-semibold",a),...t})}function l({className:a,...t}){return r.jsx("div",{"data-slot":"card-description",className:d("text-muted-foreground text-sm",a),...t})}function u({className:a,...t}){return r.jsx("div",{"data-slot":"card-content",className:d("px-6",a),...t})}export{n as C,u as a,c as b,i as c,l as d};
|