@kaitranntt/ccs 7.63.0-dev.6 → 7.63.0-dev.7
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/targets/codex-adapter.d.ts.map +1 -1
- package/dist/targets/codex-adapter.js +78 -3
- package/dist/targets/codex-adapter.js.map +1 -1
- package/dist/targets/codex-detector.d.ts.map +1 -1
- package/dist/targets/codex-detector.js +28 -7
- package/dist/targets/codex-detector.js.map +1 -1
- package/dist/ui/assets/{accounts-RgxB4_Mz.js → accounts-Bb4ZC6iX.js} +1 -1
- package/dist/ui/assets/{alert-dialog-DknvSyUi.js → alert-dialog-BccV4d47.js} +1 -1
- package/dist/ui/assets/{api-CByMTAOs.js → api-CnuJMI2P.js} +1 -1
- package/dist/ui/assets/{auth-section-oTT6XIgS.js → auth-section-DWMeHuZn.js} +1 -1
- package/dist/ui/assets/{backups-section-ButWhLEW.js → backups-section-DzOTBzov.js} +1 -1
- package/dist/ui/assets/{channels-Bmdjyd0o.js → channels-C_QsUPaa.js} +1 -1
- package/dist/ui/assets/{checkbox-PghVUPQr.js → checkbox-COTOX3_P.js} +1 -1
- package/dist/ui/assets/{claude-extension-a91oTYvI.js → claude-extension-BKgES9ir.js} +1 -1
- package/dist/ui/assets/{cliproxy-zuw7J4RN.js → cliproxy-B8jBZC8E.js} +1 -1
- package/dist/ui/assets/{cliproxy-ai-providers-De_e3Oqj.js → cliproxy-ai-providers-Czhq3vt3.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-Bjmr_Krt.js → cliproxy-control-panel-DzstZyF6.js} +1 -1
- package/dist/ui/assets/{codex-j-efoXKc.js → codex-C1b8Yucp.js} +12 -12
- package/dist/ui/assets/{confirm-dialog-D4LZ7x16.js → confirm-dialog-DwifoskR.js} +1 -1
- package/dist/ui/assets/{copilot-ChTrOuer.js → copilot-QbGpus-c.js} +1 -1
- package/dist/ui/assets/{cursor-B0HOrWLe.js → cursor-BDH018EF.js} +1 -1
- package/dist/ui/assets/{droid-DEudkdqh.js → droid-CB2ZeR_a.js} +1 -1
- package/dist/ui/assets/{globalenv-section-BvClWrfq.js → globalenv-section-CDNfg7po.js} +1 -1
- package/dist/ui/assets/{health-yM9cvgPG.js → health-_0PPIS9I.js} +1 -1
- package/dist/ui/assets/{index-7sLOzcZ6.js → index-9n65djxT.js} +2 -2
- package/dist/ui/assets/{index-C1jeSF7b.js → index-B-mfCEJu.js} +1 -1
- package/dist/ui/assets/{index-BbXVKRV9.js → index-B9ASF2zA.js} +1 -1
- package/dist/ui/assets/{index-kmqnwdw5.js → index-BGM0xJbE.js} +1 -1
- package/dist/ui/assets/{index-BN_Jwbvm.js → index-CMTYtR7f.js} +1 -1
- package/dist/ui/assets/{masked-input-9yQOjHSY.js → masked-input-C26LthiF.js} +1 -1
- package/dist/ui/assets/{proxy-status-widget-DVVEt-sB.js → proxy-status-widget-DrgqkFJD.js} +1 -1
- package/dist/ui/assets/{raw-json-settings-editor-panel-CH-9fDW0.js → raw-json-settings-editor-panel-C_WtPZBe.js} +1 -1
- package/dist/ui/assets/{searchable-select-CnG9Q7t-.js → searchable-select-YPaam7sI.js} +1 -1
- package/dist/ui/assets/{separator-DVykV9Dm.js → separator-Ngrm2kkO.js} +1 -1
- package/dist/ui/assets/{shared-Dd1sopEV.js → shared-zRGZSa2E.js} +1 -1
- package/dist/ui/assets/{switch-bQLPdZhG.js → switch-D-o_cThE.js} +1 -1
- package/dist/ui/assets/{table-Ebx2msdy.js → table-Cgs3dk4P.js} +1 -1
- package/dist/ui/assets/{updates-BvxUUZAL.js → updates-BAPfBHN3.js} +1 -1
- package/dist/ui/index.html +1 -1
- package/dist/web-server/services/codex-dashboard-service.d.ts.map +1 -1
- package/dist/web-server/services/codex-dashboard-service.js +13 -8
- package/dist/web-server/services/codex-dashboard-service.js.map +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-adapter.d.ts","sourceRoot":"","sources":["../../src/targets/codex-adapter.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"codex-adapter.d.ts","sourceRoot":"","sources":["../../src/targets/codex-adapter.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAKpD,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACX,MAAM,kBAAkB,CAAC;AA0J1B,qBAAa,YAAa,YAAW,aAAa;IAChD,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAW;IACpC,QAAQ,CAAC,WAAW,eAAe;IAEnC,YAAY,IAAI,gBAAgB,GAAG,IAAI;IAIjC,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIlE,SAAS,CACP,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAAE,EAClB,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,iBAAiB,CAAC;QAC1B,WAAW,CAAC,EAAE,WAAW,CAAC;QAC1B,UAAU,CAAC,EAAE,gBAAgB,CAAC;KAC/B,GACA,MAAM,EAAE;IAwDX,QAAQ,CAAC,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU;IAc/E,IAAI,CACF,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,gBAAgB,CAAA;KAAE,GACxD,IAAI;IA+EP,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO;CAKvD"}
|
|
@@ -27,12 +27,14 @@ exports.CodexAdapter = void 0;
|
|
|
27
27
|
const child_process_1 = require("child_process");
|
|
28
28
|
const fs = __importStar(require("fs"));
|
|
29
29
|
const errors_1 = require("../errors");
|
|
30
|
+
const helpers_1 = require("../utils/helpers");
|
|
30
31
|
const signal_forwarder_1 = require("../utils/signal-forwarder");
|
|
31
32
|
const shell_executor_1 = require("../utils/shell-executor");
|
|
32
33
|
const codex_detector_1 = require("./codex-detector");
|
|
33
34
|
const CODEX_RUNTIME_PROVIDER_ID = 'ccs_runtime';
|
|
34
35
|
const CODEX_RUNTIME_ENV_KEY = 'CCS_CODEX_API_KEY';
|
|
35
36
|
const CODEX_REASONING_LEVELS = new Set(['minimal', 'low', 'medium', 'high', 'xhigh']);
|
|
37
|
+
const CODEX_INFO_FLAGS = new Set(['--help', '-h', '--version', '-v']);
|
|
36
38
|
function formatTomlString(value) {
|
|
37
39
|
return JSON.stringify(value);
|
|
38
40
|
}
|
|
@@ -82,6 +84,73 @@ function normalizeCodexReasoningOverride(value) {
|
|
|
82
84
|
}
|
|
83
85
|
throw new Error('Codex target supports reasoning levels only: minimal, low, medium, high, xhigh.');
|
|
84
86
|
}
|
|
87
|
+
function isInformationalCodexInvocation(args) {
|
|
88
|
+
if (args.length === 1) {
|
|
89
|
+
return CODEX_INFO_FLAGS.has(args[0] || '');
|
|
90
|
+
}
|
|
91
|
+
if (args.length === 2) {
|
|
92
|
+
return CODEX_INFO_FLAGS.has(args[1] || '');
|
|
93
|
+
}
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
function normalizeExplicitCodexHomeEnv(env) {
|
|
97
|
+
const rawCodexHome = env.CODEX_HOME;
|
|
98
|
+
if (rawCodexHome === undefined) {
|
|
99
|
+
return env;
|
|
100
|
+
}
|
|
101
|
+
const trimmedCodexHome = rawCodexHome.trim();
|
|
102
|
+
if (!trimmedCodexHome) {
|
|
103
|
+
const nextEnv = { ...env };
|
|
104
|
+
delete nextEnv.CODEX_HOME;
|
|
105
|
+
return nextEnv;
|
|
106
|
+
}
|
|
107
|
+
const normalizedCodexHome = (0, helpers_1.expandPath)(trimmedCodexHome);
|
|
108
|
+
if (normalizedCodexHome === rawCodexHome) {
|
|
109
|
+
return env;
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
...env,
|
|
113
|
+
CODEX_HOME: normalizedCodexHome,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function prepareExplicitCodexHome(env, args) {
|
|
117
|
+
const normalizedEnv = normalizeExplicitCodexHomeEnv(env);
|
|
118
|
+
const codexHome = normalizedEnv.CODEX_HOME;
|
|
119
|
+
if (!codexHome) {
|
|
120
|
+
return { env: normalizedEnv };
|
|
121
|
+
}
|
|
122
|
+
if (isInformationalCodexInvocation(args)) {
|
|
123
|
+
return { env: normalizedEnv };
|
|
124
|
+
}
|
|
125
|
+
try {
|
|
126
|
+
fs.mkdirSync(codexHome, { recursive: true });
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
const error = err;
|
|
130
|
+
if (error.code !== 'EEXIST') {
|
|
131
|
+
return {
|
|
132
|
+
env: normalizedEnv,
|
|
133
|
+
error: `[X] Unable to initialize CODEX_HOME (${error.code || 'unknown'}): ${codexHome}`,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
if (!fs.statSync(codexHome).isDirectory()) {
|
|
139
|
+
return {
|
|
140
|
+
env: normalizedEnv,
|
|
141
|
+
error: `[X] CODEX_HOME path is not a directory: ${codexHome}`,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
return { env: normalizedEnv };
|
|
145
|
+
}
|
|
146
|
+
catch (err) {
|
|
147
|
+
const error = err;
|
|
148
|
+
return {
|
|
149
|
+
env: normalizedEnv,
|
|
150
|
+
error: `[X] Unable to access CODEX_HOME (${error.code || 'unknown'}): ${codexHome}`,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
85
154
|
class CodexAdapter {
|
|
86
155
|
constructor() {
|
|
87
156
|
this.type = 'codex';
|
|
@@ -176,12 +245,18 @@ class CodexAdapter {
|
|
|
176
245
|
console.error(`[X] Codex CLI path is not accessible (${error.code || 'unknown'}): ${codexPath}`);
|
|
177
246
|
return exitWithCleanup(1);
|
|
178
247
|
}
|
|
248
|
+
const codexHomePreparation = prepareExplicitCodexHome(env, args);
|
|
249
|
+
if (codexHomePreparation.error) {
|
|
250
|
+
console.error(codexHomePreparation.error);
|
|
251
|
+
return exitWithCleanup(1);
|
|
252
|
+
}
|
|
253
|
+
const launchEnv = codexHomePreparation.env;
|
|
179
254
|
const isWindows = process.platform === 'win32';
|
|
180
255
|
const isPowerShellScript = isWindows && /\.ps1$/i.test(codexPath);
|
|
181
256
|
const needsShell = isWindows && /\.(cmd|bat)$/i.test(codexPath);
|
|
182
257
|
let child;
|
|
183
258
|
if (isPowerShellScript) {
|
|
184
|
-
child = (0, child_process_1.spawn)('powershell.exe', ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', codexPath, ...args], { stdio: 'inherit', windowsHide: true, env });
|
|
259
|
+
child = (0, child_process_1.spawn)('powershell.exe', ['-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', codexPath, ...args], { stdio: 'inherit', windowsHide: true, env: launchEnv });
|
|
185
260
|
}
|
|
186
261
|
else if (needsShell) {
|
|
187
262
|
const cmdString = [codexPath, ...args].map(shell_executor_1.escapeShellArg).join(' ');
|
|
@@ -189,11 +264,11 @@ class CodexAdapter {
|
|
|
189
264
|
stdio: 'inherit',
|
|
190
265
|
windowsHide: true,
|
|
191
266
|
shell: true,
|
|
192
|
-
env,
|
|
267
|
+
env: launchEnv,
|
|
193
268
|
});
|
|
194
269
|
}
|
|
195
270
|
else {
|
|
196
|
-
child = (0, child_process_1.spawn)(codexPath, args, { stdio: 'inherit', windowsHide: true, env });
|
|
271
|
+
child = (0, child_process_1.spawn)(codexPath, args, { stdio: 'inherit', windowsHide: true, env: launchEnv });
|
|
197
272
|
}
|
|
198
273
|
(0, signal_forwarder_1.wireChildProcessSignals)(child, (err) => {
|
|
199
274
|
if (err.code === 'EACCES') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-adapter.js","sourceRoot":"","sources":["../../src/targets/codex-adapter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAoD;AACpD,uCAAyB;AAEzB,sCAAuC;AACvC,gEAAoE;AACpE,4DAAkG;AAOlG,qDAK0B;AAE1B,MAAM,yBAAyB,GAAG,aAAa,CAAC;AAChD,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AAClD,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"codex-adapter.js","sourceRoot":"","sources":["../../src/targets/codex-adapter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAoD;AACpD,uCAAyB;AAEzB,sCAAuC;AACvC,8CAA8C;AAC9C,gEAAoE;AACpE,4DAAkG;AAOlG,qDAK0B;AAE1B,MAAM,yBAAyB,GAAG,aAAa,CAAC;AAChD,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AAClD,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACtF,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC;AAEtE,SAAS,gBAAgB,CAAC,KAAa;IACrC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,uBAAuB,CAAC,SAAmB;IAClD,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,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ets/codex-detector.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"codex-detector.d.ts","sourceRoot":"","sources":["../../src/targets/codex-detector.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AA4DzD,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEtE;AAuBD,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAyD9C;AAED,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,gBAAgB,GAAG,IAAI,CAW1B;AAED,wBAAgB,kCAAkC,CAChD,UAAU,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,GAC9C,OAAO,CAUT"}
|
|
@@ -29,6 +29,20 @@ const childProcess = __importStar(require("child_process"));
|
|
|
29
29
|
const helpers_1 = require("../utils/helpers");
|
|
30
30
|
const shell_executor_1 = require("../utils/shell-executor");
|
|
31
31
|
const CODEX_CONFIG_OVERRIDE_FEATURE = 'config-overrides';
|
|
32
|
+
const CODEX_CONFIG_OVERRIDE_PROBE_ARGS = ['-c', 'model="gpt-5"', '--version'];
|
|
33
|
+
function buildWindowsCodexCandidates(matches) {
|
|
34
|
+
const shellCandidates = matches.filter((entry) => /\.(exe|cmd|bat|ps1)$/i.test(entry));
|
|
35
|
+
const bareCandidates = matches.filter((entry) => !/\.(exe|cmd|bat|ps1)$/i.test(entry));
|
|
36
|
+
const prioritized = [];
|
|
37
|
+
for (const entry of shellCandidates) {
|
|
38
|
+
if (/\.(cmd|bat)$/i.test(entry)) {
|
|
39
|
+
prioritized.push(entry.replace(/\.(cmd|bat)$/i, '.ps1'));
|
|
40
|
+
}
|
|
41
|
+
prioritized.push(entry);
|
|
42
|
+
}
|
|
43
|
+
prioritized.push(...bareCandidates);
|
|
44
|
+
return [...new Set(prioritized)];
|
|
45
|
+
}
|
|
32
46
|
function runCodexProbe(codexPath, args) {
|
|
33
47
|
const isWindows = process.platform === 'win32';
|
|
34
48
|
const isPowerShellScript = isWindows && /\.ps1$/i.test(codexPath);
|
|
@@ -65,9 +79,21 @@ function readCodexVersion(codexPath) {
|
|
|
65
79
|
return runCodexProbe(codexPath, ['--version'])?.trim();
|
|
66
80
|
}
|
|
67
81
|
exports.readCodexVersion = readCodexVersion;
|
|
82
|
+
function codexHelpAdvertisesConfigOverrides(helpText) {
|
|
83
|
+
if (!helpText) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
return /(^|\n)\s*-c,\s*--config\b/m.test(helpText) || helpText.includes('--config <key=value>');
|
|
87
|
+
}
|
|
88
|
+
function codexSupportsConfigOverrideProbe(codexPath) {
|
|
89
|
+
return !!runCodexProbe(codexPath, CODEX_CONFIG_OVERRIDE_PROBE_ARGS)?.trim();
|
|
90
|
+
}
|
|
68
91
|
function detectCodexFeatures(codexPath) {
|
|
92
|
+
if (codexSupportsConfigOverrideProbe(codexPath)) {
|
|
93
|
+
return [CODEX_CONFIG_OVERRIDE_FEATURE];
|
|
94
|
+
}
|
|
69
95
|
const helpText = runCodexProbe(codexPath, ['--help']);
|
|
70
|
-
return helpText
|
|
96
|
+
return codexHelpAdvertisesConfigOverrides(helpText) ? [CODEX_CONFIG_OVERRIDE_FEATURE] : [];
|
|
71
97
|
}
|
|
72
98
|
function detectCodexCli() {
|
|
73
99
|
if (process.env.CCS_CODEX_PATH) {
|
|
@@ -106,12 +132,7 @@ function detectCodexCli() {
|
|
|
106
132
|
.split('\n')
|
|
107
133
|
.map((entry) => entry.trim())
|
|
108
134
|
.filter(Boolean);
|
|
109
|
-
const candidates = isWindows
|
|
110
|
-
? [
|
|
111
|
-
...matches.filter((entry) => /\.(exe|cmd|bat|ps1)$/i.test(entry)),
|
|
112
|
-
...matches.filter((entry) => !/\.(exe|cmd|bat|ps1)$/i.test(entry)),
|
|
113
|
-
]
|
|
114
|
-
: matches;
|
|
135
|
+
const candidates = isWindows ? buildWindowsCodexCandidates(matches) : matches;
|
|
115
136
|
for (const candidate of candidates) {
|
|
116
137
|
try {
|
|
117
138
|
if (fs.statSync(candidate).isFile()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex-detector.js","sourceRoot":"","sources":["../../src/targets/codex-detector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,4DAA8C;AAC9C,8CAA8C;AAC9C,4DAAyD;AAGzD,MAAM,6BAA6B,GAAG,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"codex-detector.js","sourceRoot":"","sources":["../../src/targets/codex-detector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,4DAA8C;AAC9C,8CAA8C;AAC9C,4DAAyD;AAGzD,MAAM,6BAA6B,GAAG,kBAAkB,CAAC;AACzD,MAAM,gCAAgC,GAAG,CAAC,IAAI,EAAE,eAAe,EAAE,WAAW,CAAC,CAAC;AAE9E,SAAS,2BAA2B,CAAC,OAAiB;IACpD,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACvF,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACvF,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC,KAAK,MAAM,KAAK,IAAI,eAAe,EAAE,CAAC;QACpC,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAChC,WAAW,CAAC,IAAI,CAAC,KAAK,C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AC;IACf,CAAC;IAED,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;QACxB,OAAO,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,6BAA6B,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,mBAAmB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC,CAAC;AACtF,CAAC;AAZD,gFAYC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-Dt3edmE5.js";import{r as j,h as fe}from"./react-vendor-CNOkPC89.js";import{u as ye,a as M,b as z,e as be,f as B,g as Ne}from"./tanstack-CkjseTWE.js";import{T as Ce,a as ve,b as Q,c as Pe,d as Ae,e as Se}from"./table-Ebx2msdy.js";import{Y as T,a as G,af as oe,ag as re,ah as ie,ai as le,aj as de,L as v,r as V,s as Z,t as I,v as X,w as O,I as $,ax as De,d as u,C as A,j as S,k as D,_ as w,B as F,b as k,M as ue,N as xe,c as L,O as me,n as ke,x as W}from"./index-7sLOzcZ6.js";import{A as Te,a as _e,b as we,c as Le,d as Me,e as ze,f as Ge,g as Oe}from"./alert-dialog-DknvSyUi.js";import{t as y}from"./notifications-B2HqRBj7.js";import{aQ as Fe,aR as Re,l as q,al as He,N as $e,Y as qe,n as Y,aS as Ee,as as R,aT as Ue,aU as Ke,r as he,aV as Be,aL as Qe,U as Ve,a5 as J,Z as ee,T as Ze}from"./icons-Cn04FDSc.js";import{C as te}from"./checkbox-PghVUPQr.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";function Ie(){return ye({queryKey:["accounts"],queryFn:()=>T.accounts.list(),select:s=>{const a=s.accounts.filter(i=>i.type!=="cliproxy"),t=s.accounts.length-a.length,c=a.filter(i=>i.context_mode==="shared").length,o=a.filter(i=>i.context_mode==="shared"&&i.continuity_mode==="deeper").length,x=Math.max(c-o,0),l=a.length-c,m=a.filter(i=>i.context_inferred).length,g=a.filter(i=>i.context_mode==="shared"&&i.continuity_mode!=="deeper"&&i.continuity_inferred).length,p=a.some(i=>i.name===s.default)?s.default:null;return{accounts:a,default:p,cliproxyCount:t,legacyContextCount:m,legacyContinuityCount:g,sharedCount:c,sharedStandardCount:x,deeperSharedCount:o,isolatedCount:l}}})}function Xe(){const s=M();return z({mutationFn:a=>T.accounts.setDefault(a),onSuccess:(a,t)=>{s.invalidateQueries({queryKey:["accounts"]}),y.success(`Default account set to "${t}"`)},onError:a=>{y.error(a.message)}})}function We(){const s=M();return z({mutationFn:()=>T.accounts.resetDefault(),onSuccess:()=>{s.invalidateQueries({queryKey:["accounts"]}),y.success("Default account reset to CCS")},onError:a=>{y.error(a.message)}})}function Ye(){const s=M();return z({mutationFn:a=>T.accounts.delete(a),onSuccess:(a,t)=>{s.invalidateQueries({queryKey:["accounts"]}),y.success(`Account "${t}" deleted`)},onError:a=>{y.error(a.message)}})}function ge(){const s=M();return z({mutationFn:({name:a,context_mode:t,context_group:c,continuity_mode:o})=>T.accounts.updateContext(a,{context_mode:t,context_group:c,continuity_mode:o}),onSuccess:(a,t)=>{s.invalidateQueries({queryKey:["accounts"]});const c=t.context_mode==="shared"?t.continuity_mode==="deeper"?`shared (${(t.context_group||"default").trim().toLowerCase().replace(/\s+/g,"-")}, deeper continuity)`:`shared (${(t.context_group||"default").trim().toLowerCase().replace(/\s+/g,"-")}, standard)`:"isolated";y.success(`Updated "${t.name}" context to ${c}`)},onError:a=>{y.error(a.message)}})}function Je(){const s=M();return z({mutationFn:async a=>{const t=a.filter(c=>c.context_inferred||c.continuity_inferred);for(const c of t){const o=c.context_mode==="shared";await T.accounts.updateContext(c.name,{context_mode:o?"shared":"isolated",context_group:o?c.context_group||"default":void 0,continuity_mode:o?c.continuity_mode==="deeper"?"deeper":"standard":void 0})}return{updatedCount:t.length}},onSuccess:({updatedCount:a})=>{if(s.invalidateQueries({queryKey:["accounts"]}),a>0){y.success(`Confirmed explicit sync mode for ${a} legacy account${a>1?"s":""}`);return}y.info("No legacy accounts need confirmation")},onError:a=>{y.error(a.message)}})}const se=64,et=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function tt({account:s,onClose:a}){const{t}=G(),c=ge(),[o,x]=j.useState(s.context_mode==="shared"?"shared":"isolated"),[l,m]=j.useState(s.context_group||"default"),[g,p]=j.useState(s.continuity_mode==="deeper"?"deeper":"standard"),i=j.useMemo(()=>l.trim().toLowerCase().replace(/\s+/g,"-"),[l]),b=i.length>0&&i.length<=se&&et.test(i),f=o==="isolated"||b,n=()=>{f&&c.mutate({name:s.name,context_mode:o,context_group:o==="shared"?i:void 0,continuity_mode:o==="shared"?g:void 0},{onSuccess:()=>{a()}})},r=d=>{d||a()};return e.jsx(oe,{open:!0,onOpenChange:r,children:e.jsxs(re,{className:"sm:max-w-md",children:[e.jsxs(ie,{children:[e.jsx(le,{children:t("editAccountContext.title")}),e.jsx(de,{children:t("editAccountContext.description",{name:s.name})})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"context-mode",children:t("editAccountContext.syncMode")}),e.jsxs(V,{value:o,onValueChange:d=>x(d),children:[e.jsx(Z,{id:"context-mode",children:e.jsx(I,{placeholder:t("editAccountContext.selectContextMode")})}),e.jsxs(X,{children:[e.jsx(O,{value:"isolated",children:t("editAccountContext.isolatedOption")}),e.jsx(O,{value:"shared",children:t("editAccountContext.sharedOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t(o==="shared"?"editAccountContext.sharedModeHint":"editAccountContext.isolatedModeHint")})]}),o==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"context-group",children:t("editAccountContext.historySyncGroup")}),e.jsx($,{id:"context-group",value:l,onChange:d=>m(d.target.value),placeholder:t("editAccountContext.groupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("editAccountContext.groupHint",{max:se})}),!b&&e.jsx("p",{className:"text-xs text-destructive",children:t("editAccountContext.invalidGroup")})]}),o==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"continuity-mode",children:t("editAccountContext.continuityDepth")}),e.jsxs(V,{value:g,onValueChange:d=>p(d),children:[e.jsx(Z,{id:"continuity-mode",children:e.jsx(I,{placeholder:t("editAccountContext.selectContinuityDepth")})}),e.jsxs(X,{children:[e.jsx(O,{value:"standard",children:t("editAccountContext.standardOption")}),e.jsx(O,{value:"deeper",children:t("editAccountContext.deeperOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t(g==="deeper"?"editAccountContext.deeperHint":"editAccountContext.standardHint")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("editAccountContext.credentialsIsolated")})]}),e.jsxs(De,{children:[e.jsx(u,{variant:"outline",onClick:a,disabled:c.isPending,children:t("editAccountContext.cancel")}),e.jsx(u,{onClick:n,disabled:!f||c.isPending,children:c.isPending?t("editAccountContext.saving"):t("editAccountContext.save")})]})]})})}function ae({data:s,defaultAccount:a}){const{t}=G(),c=Xe(),o=Ye(),x=We(),l=ge(),[m,g]=j.useState(null),[p,i]=j.useState(null),b=[{accessorKey:"name",header:t("accountsTable.name"),size:200,cell:({row:n})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:n.original.name}),n.original.name===a&&e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded border border-primary/20",children:t("accountsTable.defaultBadge")})]})},{accessorKey:"type",header:t("accountsTable.type"),size:100,cell:({row:n})=>e.jsx("span",{className:"capitalize text-muted-foreground",children:n.original.type||"oauth"})},{accessorKey:"created",header:t("accountsTable.created"),size:150,cell:({row:n})=>{const r=new Date(n.original.created);return e.jsx("span",{className:"text-muted-foreground",children:r.toLocaleDateString()})}},{accessorKey:"last_used",header:t("accountsTable.lastUsed"),size:150,cell:({row:n})=>{if(!n.original.last_used)return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const r=new Date(n.original.last_used);return e.jsx("span",{className:"text-muted-foreground",children:r.toLocaleDateString()})}},{id:"context",header:t("accountsTable.historySync"),size:170,cell:({row:n})=>{if(n.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});if((n.original.context_mode||"isolated")==="shared"){const d=n.original.context_group||"default";return n.original.continuity_mode==="deeper"?e.jsx("span",{className:"text-muted-foreground",children:t("accountsTable.sharedGroupDeeper",{group:d})}):n.original.continuity_inferred?e.jsx("span",{className:"text-amber-700 dark:text-amber-400",children:t("accountsTable.sharedGroupLegacy",{group:d})}):e.jsx("span",{className:"text-muted-foreground",children:t("accountsTable.sharedGroupStandard",{group:d})})}return n.original.context_inferred?e.jsx("span",{className:"text-amber-700 dark:text-amber-400",children:t("accountsTable.isolatedLegacy")}):e.jsx("span",{className:"text-muted-foreground",children:t("accountsTable.isolated")})}},{id:"actions",header:t("accountsTable.actions"),size:220,cell:({row:n})=>{const r=n.original.name===a,d=c.isPending||o.isPending||l.isPending,N=n.original.type==="cliproxy",P=n.original.context_inferred||n.original.continuity_inferred;return e.jsxs("div",{className:"flex items-center gap-1",children:[!N&&e.jsxs(u,{variant:"outline",size:"sm",className:"h-8 px-2",disabled:d,onClick:()=>i(n.original),title:t("accountsTable.syncTitle"),children:[e.jsx(Fe,{className:"w-3.5 h-3.5 mr-1"}),t("accountsTable.sync")]}),!N&&P&&e.jsxs(u,{variant:"ghost",size:"sm",className:"h-8 px-2 text-amber-700 hover:text-amber-700 hover:bg-amber-500/10 dark:text-amber-400 dark:hover:text-amber-400",disabled:d,onClick:()=>l.mutate({name:n.original.name,context_mode:n.original.context_mode==="shared"?"shared":"isolated",context_group:n.original.context_mode==="shared"?n.original.context_group||"default":void 0,continuity_mode:n.original.context_mode==="shared"?n.original.continuity_mode==="deeper"?"deeper":"standard":void 0}),title:t("accountsTable.confirmLegacyTitle"),children:[e.jsx(Re,{className:"w-3 h-3 mr-1"}),t("accountsTable.confirm")]}),e.jsxs(u,{variant:r?"secondary":"default",size:"sm",className:"h-8 px-2",disabled:r||d,onClick:()=>c.mutate(n.original.name),children:[e.jsx(q,{className:`w-3 h-3 mr-1 ${r?"opacity-50":""}`}),t(r?"accountsTable.active":"accountsTable.setDefault")]}),e.jsx(u,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive hover:bg-destructive/10",disabled:r||d,onClick:()=>g(n.original.name),title:t(r?"accountsTable.cannotDeleteDefault":"accountsTable.deleteAccount"),children:e.jsx(He,{className:"w-4 h-4"})})]})}}],f=be({data:s,columns:b,getCoreRowModel:Ne()});return s.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:t("accountsTable.noAccounts")}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"border rounded-md",children:e.jsxs(Ce,{children:[e.jsx(ve,{children:f.getHeaderGroups().map(n=>e.jsx(Q,{children:n.headers.map(r=>{const d={name:"w-[200px]",type:"w-[100px]",created:"w-[150px]",last_used:"w-[150px]",context:"w-[170px]",actions:"w-[290px]"}[r.id]||"w-auto";return e.jsx(Pe,{className:d,children:r.isPlaceholder?null:B(r.column.columnDef.header,r.getContext())},r.id)})},n.id))}),e.jsx(Ae,{children:f.getRowModel().rows.map(n=>e.jsx(Q,{children:n.getVisibleCells().map(r=>e.jsx(Se,{children:B(r.column.columnDef.cell,r.getContext())},r.id))},n.id))})]})}),a&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(u,{variant:"outline",size:"sm",onClick:()=>x.mutate(),disabled:x.isPending,children:[e.jsx($e,{className:"w-4 h-4 mr-2"}),t("accountsTable.resetToDefault")]})})]}),p&&e.jsx(tt,{account:p,onClose:()=>i(null)}),e.jsx(Te,{open:!!m,onOpenChange:n=>!n&&g(null),children:e.jsxs(_e,{children:[e.jsxs(we,{children:[e.jsx(Le,{children:t("accountsTable.deleteDialogTitle")}),e.jsx(Me,{children:t("accountsTable.deleteDialogDesc",{name:m??""})})]}),e.jsxs(ze,{children:[e.jsx(Ge,{children:t("accountsTable.cancel")}),e.jsx(Oe,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{m&&(o.mutate(m),g(null))},children:t("accountsTable.delete")})]})]})})]})}const ne=64;function st({open:s,onClose:a}){const{t}=G(),[c,o]=j.useState(""),[x,l]=j.useState(!1),[m,g]=j.useState(""),[p,i]=j.useState(!1),[b,f]=j.useState(!1),n=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(c),r=m.trim().toLowerCase().replace(/\s+/g,"-"),d=r.length===0||r.length<=ne&&/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(r),N=c&&n?[`ccs auth create ${c}`,x?r.length>0?`--context-group ${r}`:"--share-context":"",x&&p?"--deeper-continuity":""].filter(Boolean).join(" "):t("createAuthProfileDialog.commandFallback"),P=async()=>{!n||x&&!d||(await navigator.clipboard.writeText(N),f(!0),setTimeout(()=>f(!1),2e3))},_=()=>{o(""),l(!1),g(""),i(!1),f(!1),a()};return e.jsx(oe,{open:s,onOpenChange:h=>!h&&_(),children:e.jsxs(re,{className:"sm:max-w-md",children:[e.jsxs(ie,{children:[e.jsx(le,{children:t("createAuthProfileDialog.title")}),e.jsx(de,{children:t("createAuthProfileDialog.description")})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"profile-name",children:t("createAuthProfileDialog.profileName")}),e.jsx($,{id:"profile-name",value:c,onChange:h=>o(h.target.value),placeholder:t("createAuthProfileDialog.profileNamePlaceholder"),autoComplete:"off"}),c&&!n&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidProfileName")})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(te,{id:"share-context",checked:x,onCheckedChange:h=>l(h===!0)}),e.jsx(v,{htmlFor:"share-context",className:"cursor-pointer",children:t("createAuthProfileDialog.enableSharedHistory")})]}),x&&e.jsxs("div",{className:"space-y-2 pl-6",children:[e.jsx(v,{htmlFor:"context-group",children:t("createAuthProfileDialog.historySyncGroupOptional")}),e.jsx($,{id:"context-group",value:m,onChange:h=>g(h.target.value),placeholder:t("createAuthProfileDialog.historySyncGroupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.historySyncGroupHint")}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(te,{id:"deeper-continuity",checked:p,onCheckedChange:h=>i(h===!0)}),e.jsx(v,{htmlFor:"deeper-continuity",className:"cursor-pointer",children:t("createAuthProfileDialog.deeperContinuity")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.deeperContinuityHint")}),m.trim().length>0&&!d&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidContextGroup",{max:ne})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{children:t("createAuthProfileDialog.command")}),e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md font-mono text-sm",children:[e.jsx(qe,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("code",{className:"flex-1 break-all",children:N}),e.jsx(u,{variant:"ghost",size:"sm",className:"shrink-0 h-8 px-2",onClick:P,disabled:!n||x&&!d,children:b?e.jsx(q,{className:"w-4 h-4 text-green-500"}):e.jsx(Y,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsx("p",{children:t("createAuthProfileDialog.afterRunPrefix")}),e.jsxs("ol",{className:"list-decimal list-inside pl-2 space-y-0.5",children:[e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep1")}),e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep2")})]}),e.jsx("p",{className:"pt-1",children:t("createAuthProfileDialog.poolingHint")})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(u,{variant:"ghost",onClick:_,children:t("createAuthProfileDialog.close")}),e.jsx(u,{onClick:P,disabled:!n||x&&!d,children:b?e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copyCommand")]})})]})]})]})})}function H({title:s,count:a,icon:t,tone:c}){const o={isolated:{border:"border-blue-300/60 bg-blue-50/40 dark:border-blue-900/40 dark:bg-blue-900/10",icon:"text-blue-700 dark:text-blue-400",count:"text-blue-700 dark:text-blue-400"},shared:{border:"border-emerald-300/60 bg-emerald-50/40 dark:border-emerald-900/40 dark:bg-emerald-900/10",icon:"text-emerald-700 dark:text-emerald-400",count:"text-emerald-700 dark:text-emerald-400"},deeper:{border:"border-indigo-300/60 bg-indigo-50/40 dark:border-indigo-900/40 dark:bg-indigo-900/10",icon:"text-indigo-700 dark:text-indigo-400",count:"text-indigo-700 dark:text-indigo-400"}};return e.jsxs("div",{className:L("rounded-md border p-2.5",o[c].border),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs font-semibold",children:s}),e.jsx(t,{className:L("h-3.5 w-3.5",o[c].icon)})]}),e.jsx("p",{className:L("mt-1 text-lg font-mono font-semibold",o[c].count),children:a})]})}function ce({isolatedCount:s,sharedStandardCount:a,deeperSharedCount:t,sharedGroups:c,legacyTargetCount:o,cliproxyCount:x}){const{t:l}=G(),[m,g]=j.useState(!1),p=c.length>0?c:["default"];return e.jsxs(A,{className:"border-dashed",children:[e.jsx(S,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx(D,{className:"text-base",children:l("historySyncLearningMap.title")}),e.jsx(w,{className:"mt-1",children:l("historySyncLearningMap.description")})]}),e.jsx(F,{variant:"outline",children:l("historySyncLearningMap.learningMap")})]})}),e.jsxs(k,{className:"space-y-3",children:[x>0&&e.jsx("div",{className:"rounded-md border border-blue-300/60 bg-blue-50/40 px-3 py-2 text-xs text-blue-800 dark:border-blue-900/40 dark:bg-blue-900/10 dark:text-blue-300",children:l("historySyncLearningMap.cliproxyManaged",{count:x})}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto_1fr_auto_1fr] sm:items-center",children:[e.jsx(H,{title:l("historySyncLearningMap.isolated"),count:s,icon:Ee,tone:"isolated"}),e.jsx("div",{className:"hidden sm:flex justify-center text-muted-foreground",children:e.jsx(R,{className:"h-4 w-4"})}),e.jsx(H,{title:l("historySyncLearningMap.shared"),count:a,icon:Ue,tone:"shared"}),e.jsx("div",{className:"hidden sm:flex justify-center text-muted-foreground",children:e.jsx(R,{className:"h-4 w-4"})}),e.jsx(H,{title:l("historySyncLearningMap.deeper"),count:t,icon:Ke,tone:"deeper"})]}),e.jsxs(ue,{open:m,onOpenChange:g,children:[e.jsx(xe,{asChild:!0,children:e.jsxs(u,{variant:"ghost",className:"h-8 w-full justify-between rounded-md px-2 text-xs text-muted-foreground hover:bg-muted/40 hover:text-foreground",children:[e.jsx("span",{children:l("historySyncLearningMap.showDetails")}),e.jsx(he,{className:L("h-4 w-4 transition-transform",m&&"rotate-180")})]})}),e.jsxs(me,{className:"pt-2",children:[e.jsxs("div",{className:"grid gap-2 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Be,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("p",{className:"font-semibold",children:l("historySyncLearningMap.modeSwitch")})]}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:l("historySyncLearningMap.modeSwitchDesc")})]}),e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qe,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("p",{className:"font-semibold",children:l("historySyncLearningMap.historySyncGroup")})]}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:l("historySyncLearningMap.historySyncGroupDesc")}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:p.map(i=>e.jsx(F,{variant:"outline",className:"font-mono text-[10px]",children:i},i))})]})]}),o>0&&e.jsx("div",{className:"mt-2 rounded-md border border-amber-500/50 bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-300",children:l("historySyncLearningMap.legacyConfirmation",{count:o})})]})]})]})]})}function gt(){const{t:s}=G(),a=fe(),{data:t,isLoading:c}=Ie(),o=Je(),[x,l]=j.useState(!1),[m,g]=j.useState(!1),p=t?.accounts||[],i=t?.cliproxyCount||0,b=t?.legacyContextCount||0,f=t?.legacyContinuityCount||0,n=t?.sharedCount||0,r=t?.sharedStandardCount||0,d=t?.deeperSharedCount||0,N=t?.isolatedCount||0,P=Array.from(new Set(p.filter(C=>C.context_mode==="shared").map(C=>C.context_group||"default"))).sort((C,je)=>C.localeCompare(je)),_=p.filter(C=>C.context_inferred||C.continuity_inferred),h=_.length,pe=h>0,E=()=>a("/cliproxy?provider=claude"),U=()=>a("/cliproxy?provider=claude&action=auth"),K=()=>o.mutate(_);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden h-full min-h-0 lg:flex",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/20 shrink-0",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:s("accountsPage.title")})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),s("accountsPage.manageSuffix")]})]}),e.jsx(ke,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:s("accountsPage.primaryActions")}),e.jsxs(u,{size:"sm",className:"w-full justify-start",onClick:()=>l(!0),children:[e.jsx(J,{className:"w-4 h-4 mr-2"}),s("accountsPage.createAccount")]}),e.jsxs(u,{size:"sm",className:"w-full justify-start",onClick:U,children:[e.jsx(ee,{className:"w-4 h-4 mr-2"}),s("accountsPage.authClaudeInPool")]}),e.jsxs(u,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:E,children:[s("accountsPage.openClaudePoolSettings"),e.jsx(R,{className:"w-4 h-4 ml-auto"})]})]}),pe?e.jsxs("section",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:s("accountsPage.migrationFollowup")}),e.jsxs("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ze,{className:"h-4 w-4 mt-0.5 text-amber-700 dark:text-amber-400 shrink-0"}),e.jsxs("div",{className:"space-y-1 text-xs",children:[b>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:s("accountsPage.legacyContextPending",{count:b})}),f>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:s("accountsPage.legacyContinuityPending",{count:f})})]})]}),e.jsx(u,{variant:"secondary",size:"sm",className:"w-full justify-start",onClick:K,disabled:o.isPending||h===0,children:o.isPending?s("accountsPage.confirmingLegacy"):s("accountsPage.confirmLegacy",{count:h})})]})]}):e.jsx("div",{className:"rounded-md border bg-background px-3 py-2 text-xs text-muted-foreground",children:s("accountsPage.noLegacyFollowup")}),e.jsx(ue,{open:m,onOpenChange:g,children:e.jsxs(A,{children:[e.jsx(S,{className:"pb-2",children:e.jsx(xe,{asChild:!0,children:e.jsxs(u,{variant:"ghost",className:"h-auto w-full justify-between px-0 py-0",children:[e.jsxs("div",{className:"text-left",children:[e.jsx(D,{className:"text-sm",children:s("accountsPage.continuityGuide")}),e.jsx(w,{className:"mt-1",children:s("accountsPage.expandWhenNeeded")})]}),e.jsx(he,{className:L("h-4 w-4 transition-transform",m&&"rotate-180")})]})})}),e.jsx(me,{children:e.jsxs(k,{className:"space-y-3 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"rounded-md border p-2.5",children:[e.jsx("p",{className:"font-semibold text-foreground",children:s("accountsPage.sharedStandard")}),e.jsx("p",{className:"mt-1",children:s("accountsPage.sharedStandardDesc")})]}),e.jsxs("div",{className:"rounded-md border p-2.5",children:[e.jsx("p",{className:"font-semibold text-foreground",children:s("accountsPage.sharedDeeper")}),e.jsxs("p",{className:"mt-1",children:[s("accountsPage.sharedDeeperPrefix")," ",e.jsx("code",{children:"session-env"}),","," ",e.jsx("code",{children:"file-history"}),", ",e.jsx("code",{children:"shell-snapshots"}),","," ",e.jsx("code",{children:"todos"}),"."]})]}),e.jsxs("div",{className:"rounded-md border p-2.5",children:[e.jsx("p",{className:"font-semibold text-foreground",children:s("accountsPage.isolated")}),e.jsx("p",{className:"mt-1",children:s("accountsPage.isolatedDesc")})]})]})})]})}),e.jsxs(A,{children:[e.jsxs(S,{className:"pb-2",children:[e.jsx(D,{className:"text-sm",children:s("accountsPage.quickCommands")}),e.jsx(w,{children:s("accountsPage.quickCommandsDesc")})]}),e.jsxs(k,{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth create work --context-group sprint-a --deeper-continuity"}),e.jsx(W,{value:"ccs auth create work --context-group sprint-a --deeper-continuity",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs cliproxy auth claude"}),e.jsx(W,{value:"ccs cliproxy auth claude",size:"icon"})]})]})]})]})})]}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col bg-background",children:[e.jsxs("div",{className:"px-5 py-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{variant:"outline",children:s("accountsPage.workspaceBadge")}),e.jsx(F,{variant:"secondary",children:s("accountsPage.historySyncBadge")})]}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:s("accountsPage.authAccounts")}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[s("accountsPage.tableScopePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),s("accountsPage.tableScopeMiddle"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:s("accountsTable.sync")}),s("accountsPage.tableScopeSuffix")]})]}),e.jsxs("div",{className:"flex-1 min-h-0 p-5 space-y-4 overflow-y-auto",children:[e.jsx(ce,{isolatedCount:N,sharedStandardCount:r,deeperSharedCount:d,sharedGroups:P,legacyTargetCount:h,cliproxyCount:i}),e.jsxs(A,{className:"flex flex-col",children:[e.jsxs(S,{className:"pb-3",children:[e.jsx(D,{className:"text-lg",children:s("accountsPage.accountMatrix")}),e.jsx(w,{children:s("accountsPage.sharedTotalDesc",{count:n})})]}),e.jsx(k,{children:c?e.jsx("div",{className:"text-muted-foreground",children:s("accountsPage.loadingAccounts")}):e.jsx(ae,{data:p,defaultAccount:t?.default??null})})]})]})]})]}),e.jsxs("div",{className:"p-4 space-y-4 lg:hidden",children:[e.jsxs(A,{children:[e.jsxs(S,{children:[e.jsx(D,{className:"text-lg",children:s("accountsPage.title")}),e.jsxs(w,{children:[s("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),s("accountsPage.mobileManageSuffix")]})]}),e.jsxs(k,{className:"space-y-2",children:[e.jsxs(u,{className:"w-full",onClick:()=>l(!0),children:[e.jsx(J,{className:"w-4 h-4 mr-2"}),s("accountsPage.createAccount")]}),e.jsxs(u,{variant:"outline",className:"w-full",onClick:E,children:[s("accountsPage.openCliProxyClaudePool"),e.jsx(R,{className:"w-4 h-4 ml-2"})]}),e.jsxs(u,{variant:"outline",className:"w-full",onClick:U,children:[s("accountsPage.authClaudeInPool"),e.jsx(ee,{className:"w-4 h-4 ml-2"})]}),e.jsx(u,{variant:"outline",className:"w-full",onClick:K,disabled:o.isPending||h===0,children:o.isPending?s("accountsPage.confirmingLegacy"):s("accountsPage.confirmLegacy",{count:h})})]})]}),e.jsx(ce,{isolatedCount:N,sharedStandardCount:r,deeperSharedCount:d,sharedGroups:P,legacyTargetCount:h,cliproxyCount:i}),e.jsxs(A,{children:[e.jsx(S,{className:"pb-3",children:e.jsx(D,{className:"text-base",children:s("accountsPage.accountMatrix")})}),e.jsx(k,{children:c?e.jsx("div",{className:"text-muted-foreground",children:s("accountsPage.loadingAccounts")}):e.jsx(ae,{data:p,defaultAccount:t?.default??null})})]})]}),e.jsx(st,{open:x,onClose:()=>l(!1)})]})}export{gt as AccountsPage};
|
|
1
|
+
import{j as e}from"./radix-ui-Dt3edmE5.js";import{r as j,h as fe}from"./react-vendor-CNOkPC89.js";import{u as ye,a as M,b as z,e as be,f as B,g as Ne}from"./tanstack-CkjseTWE.js";import{T as Ce,a as ve,b as Q,c as Pe,d as Ae,e as Se}from"./table-Cgs3dk4P.js";import{Y as T,a as G,af as oe,ag as re,ah as ie,ai as le,aj as de,L as v,r as V,s as Z,t as I,v as X,w as O,I as $,ax as De,d as u,C as A,j as S,k as D,_ as w,B as F,b as k,M as ue,N as xe,c as L,O as me,n as ke,x as W}from"./index-9n65djxT.js";import{A as Te,a as _e,b as we,c as Le,d as Me,e as ze,f as Ge,g as Oe}from"./alert-dialog-BccV4d47.js";import{t as y}from"./notifications-B2HqRBj7.js";import{aQ as Fe,aR as Re,l as q,al as He,N as $e,Y as qe,n as Y,aS as Ee,as as R,aT as Ue,aU as Ke,r as he,aV as Be,aL as Qe,U as Ve,a5 as J,Z as ee,T as Ze}from"./icons-Cn04FDSc.js";import{C as te}from"./checkbox-COTOX3_P.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";function Ie(){return ye({queryKey:["accounts"],queryFn:()=>T.accounts.list(),select:s=>{const a=s.accounts.filter(i=>i.type!=="cliproxy"),t=s.accounts.length-a.length,c=a.filter(i=>i.context_mode==="shared").length,o=a.filter(i=>i.context_mode==="shared"&&i.continuity_mode==="deeper").length,x=Math.max(c-o,0),l=a.length-c,m=a.filter(i=>i.context_inferred).length,g=a.filter(i=>i.context_mode==="shared"&&i.continuity_mode!=="deeper"&&i.continuity_inferred).length,p=a.some(i=>i.name===s.default)?s.default:null;return{accounts:a,default:p,cliproxyCount:t,legacyContextCount:m,legacyContinuityCount:g,sharedCount:c,sharedStandardCount:x,deeperSharedCount:o,isolatedCount:l}}})}function Xe(){const s=M();return z({mutationFn:a=>T.accounts.setDefault(a),onSuccess:(a,t)=>{s.invalidateQueries({queryKey:["accounts"]}),y.success(`Default account set to "${t}"`)},onError:a=>{y.error(a.message)}})}function We(){const s=M();return z({mutationFn:()=>T.accounts.resetDefault(),onSuccess:()=>{s.invalidateQueries({queryKey:["accounts"]}),y.success("Default account reset to CCS")},onError:a=>{y.error(a.message)}})}function Ye(){const s=M();return z({mutationFn:a=>T.accounts.delete(a),onSuccess:(a,t)=>{s.invalidateQueries({queryKey:["accounts"]}),y.success(`Account "${t}" deleted`)},onError:a=>{y.error(a.message)}})}function ge(){const s=M();return z({mutationFn:({name:a,context_mode:t,context_group:c,continuity_mode:o})=>T.accounts.updateContext(a,{context_mode:t,context_group:c,continuity_mode:o}),onSuccess:(a,t)=>{s.invalidateQueries({queryKey:["accounts"]});const c=t.context_mode==="shared"?t.continuity_mode==="deeper"?`shared (${(t.context_group||"default").trim().toLowerCase().replace(/\s+/g,"-")}, deeper continuity)`:`shared (${(t.context_group||"default").trim().toLowerCase().replace(/\s+/g,"-")}, standard)`:"isolated";y.success(`Updated "${t.name}" context to ${c}`)},onError:a=>{y.error(a.message)}})}function Je(){const s=M();return z({mutationFn:async a=>{const t=a.filter(c=>c.context_inferred||c.continuity_inferred);for(const c of t){const o=c.context_mode==="shared";await T.accounts.updateContext(c.name,{context_mode:o?"shared":"isolated",context_group:o?c.context_group||"default":void 0,continuity_mode:o?c.continuity_mode==="deeper"?"deeper":"standard":void 0})}return{updatedCount:t.length}},onSuccess:({updatedCount:a})=>{if(s.invalidateQueries({queryKey:["accounts"]}),a>0){y.success(`Confirmed explicit sync mode for ${a} legacy account${a>1?"s":""}`);return}y.info("No legacy accounts need confirmation")},onError:a=>{y.error(a.message)}})}const se=64,et=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function tt({account:s,onClose:a}){const{t}=G(),c=ge(),[o,x]=j.useState(s.context_mode==="shared"?"shared":"isolated"),[l,m]=j.useState(s.context_group||"default"),[g,p]=j.useState(s.continuity_mode==="deeper"?"deeper":"standard"),i=j.useMemo(()=>l.trim().toLowerCase().replace(/\s+/g,"-"),[l]),b=i.length>0&&i.length<=se&&et.test(i),f=o==="isolated"||b,n=()=>{f&&c.mutate({name:s.name,context_mode:o,context_group:o==="shared"?i:void 0,continuity_mode:o==="shared"?g:void 0},{onSuccess:()=>{a()}})},r=d=>{d||a()};return e.jsx(oe,{open:!0,onOpenChange:r,children:e.jsxs(re,{className:"sm:max-w-md",children:[e.jsxs(ie,{children:[e.jsx(le,{children:t("editAccountContext.title")}),e.jsx(de,{children:t("editAccountContext.description",{name:s.name})})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"context-mode",children:t("editAccountContext.syncMode")}),e.jsxs(V,{value:o,onValueChange:d=>x(d),children:[e.jsx(Z,{id:"context-mode",children:e.jsx(I,{placeholder:t("editAccountContext.selectContextMode")})}),e.jsxs(X,{children:[e.jsx(O,{value:"isolated",children:t("editAccountContext.isolatedOption")}),e.jsx(O,{value:"shared",children:t("editAccountContext.sharedOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t(o==="shared"?"editAccountContext.sharedModeHint":"editAccountContext.isolatedModeHint")})]}),o==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"context-group",children:t("editAccountContext.historySyncGroup")}),e.jsx($,{id:"context-group",value:l,onChange:d=>m(d.target.value),placeholder:t("editAccountContext.groupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("editAccountContext.groupHint",{max:se})}),!b&&e.jsx("p",{className:"text-xs text-destructive",children:t("editAccountContext.invalidGroup")})]}),o==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"continuity-mode",children:t("editAccountContext.continuityDepth")}),e.jsxs(V,{value:g,onValueChange:d=>p(d),children:[e.jsx(Z,{id:"continuity-mode",children:e.jsx(I,{placeholder:t("editAccountContext.selectContinuityDepth")})}),e.jsxs(X,{children:[e.jsx(O,{value:"standard",children:t("editAccountContext.standardOption")}),e.jsx(O,{value:"deeper",children:t("editAccountContext.deeperOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t(g==="deeper"?"editAccountContext.deeperHint":"editAccountContext.standardHint")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("editAccountContext.credentialsIsolated")})]}),e.jsxs(De,{children:[e.jsx(u,{variant:"outline",onClick:a,disabled:c.isPending,children:t("editAccountContext.cancel")}),e.jsx(u,{onClick:n,disabled:!f||c.isPending,children:c.isPending?t("editAccountContext.saving"):t("editAccountContext.save")})]})]})})}function ae({data:s,defaultAccount:a}){const{t}=G(),c=Xe(),o=Ye(),x=We(),l=ge(),[m,g]=j.useState(null),[p,i]=j.useState(null),b=[{accessorKey:"name",header:t("accountsTable.name"),size:200,cell:({row:n})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:n.original.name}),n.original.name===a&&e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded border border-primary/20",children:t("accountsTable.defaultBadge")})]})},{accessorKey:"type",header:t("accountsTable.type"),size:100,cell:({row:n})=>e.jsx("span",{className:"capitalize text-muted-foreground",children:n.original.type||"oauth"})},{accessorKey:"created",header:t("accountsTable.created"),size:150,cell:({row:n})=>{const r=new Date(n.original.created);return e.jsx("span",{className:"text-muted-foreground",children:r.toLocaleDateString()})}},{accessorKey:"last_used",header:t("accountsTable.lastUsed"),size:150,cell:({row:n})=>{if(!n.original.last_used)return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const r=new Date(n.original.last_used);return e.jsx("span",{className:"text-muted-foreground",children:r.toLocaleDateString()})}},{id:"context",header:t("accountsTable.historySync"),size:170,cell:({row:n})=>{if(n.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});if((n.original.context_mode||"isolated")==="shared"){const d=n.original.context_group||"default";return n.original.continuity_mode==="deeper"?e.jsx("span",{className:"text-muted-foreground",children:t("accountsTable.sharedGroupDeeper",{group:d})}):n.original.continuity_inferred?e.jsx("span",{className:"text-amber-700 dark:text-amber-400",children:t("accountsTable.sharedGroupLegacy",{group:d})}):e.jsx("span",{className:"text-muted-foreground",children:t("accountsTable.sharedGroupStandard",{group:d})})}return n.original.context_inferred?e.jsx("span",{className:"text-amber-700 dark:text-amber-400",children:t("accountsTable.isolatedLegacy")}):e.jsx("span",{className:"text-muted-foreground",children:t("accountsTable.isolated")})}},{id:"actions",header:t("accountsTable.actions"),size:220,cell:({row:n})=>{const r=n.original.name===a,d=c.isPending||o.isPending||l.isPending,N=n.original.type==="cliproxy",P=n.original.context_inferred||n.original.continuity_inferred;return e.jsxs("div",{className:"flex items-center gap-1",children:[!N&&e.jsxs(u,{variant:"outline",size:"sm",className:"h-8 px-2",disabled:d,onClick:()=>i(n.original),title:t("accountsTable.syncTitle"),children:[e.jsx(Fe,{className:"w-3.5 h-3.5 mr-1"}),t("accountsTable.sync")]}),!N&&P&&e.jsxs(u,{variant:"ghost",size:"sm",className:"h-8 px-2 text-amber-700 hover:text-amber-700 hover:bg-amber-500/10 dark:text-amber-400 dark:hover:text-amber-400",disabled:d,onClick:()=>l.mutate({name:n.original.name,context_mode:n.original.context_mode==="shared"?"shared":"isolated",context_group:n.original.context_mode==="shared"?n.original.context_group||"default":void 0,continuity_mode:n.original.context_mode==="shared"?n.original.continuity_mode==="deeper"?"deeper":"standard":void 0}),title:t("accountsTable.confirmLegacyTitle"),children:[e.jsx(Re,{className:"w-3 h-3 mr-1"}),t("accountsTable.confirm")]}),e.jsxs(u,{variant:r?"secondary":"default",size:"sm",className:"h-8 px-2",disabled:r||d,onClick:()=>c.mutate(n.original.name),children:[e.jsx(q,{className:`w-3 h-3 mr-1 ${r?"opacity-50":""}`}),t(r?"accountsTable.active":"accountsTable.setDefault")]}),e.jsx(u,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive hover:bg-destructive/10",disabled:r||d,onClick:()=>g(n.original.name),title:t(r?"accountsTable.cannotDeleteDefault":"accountsTable.deleteAccount"),children:e.jsx(He,{className:"w-4 h-4"})})]})}}],f=be({data:s,columns:b,getCoreRowModel:Ne()});return s.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:t("accountsTable.noAccounts")}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"border rounded-md",children:e.jsxs(Ce,{children:[e.jsx(ve,{children:f.getHeaderGroups().map(n=>e.jsx(Q,{children:n.headers.map(r=>{const d={name:"w-[200px]",type:"w-[100px]",created:"w-[150px]",last_used:"w-[150px]",context:"w-[170px]",actions:"w-[290px]"}[r.id]||"w-auto";return e.jsx(Pe,{className:d,children:r.isPlaceholder?null:B(r.column.columnDef.header,r.getContext())},r.id)})},n.id))}),e.jsx(Ae,{children:f.getRowModel().rows.map(n=>e.jsx(Q,{children:n.getVisibleCells().map(r=>e.jsx(Se,{children:B(r.column.columnDef.cell,r.getContext())},r.id))},n.id))})]})}),a&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(u,{variant:"outline",size:"sm",onClick:()=>x.mutate(),disabled:x.isPending,children:[e.jsx($e,{className:"w-4 h-4 mr-2"}),t("accountsTable.resetToDefault")]})})]}),p&&e.jsx(tt,{account:p,onClose:()=>i(null)}),e.jsx(Te,{open:!!m,onOpenChange:n=>!n&&g(null),children:e.jsxs(_e,{children:[e.jsxs(we,{children:[e.jsx(Le,{children:t("accountsTable.deleteDialogTitle")}),e.jsx(Me,{children:t("accountsTable.deleteDialogDesc",{name:m??""})})]}),e.jsxs(ze,{children:[e.jsx(Ge,{children:t("accountsTable.cancel")}),e.jsx(Oe,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{m&&(o.mutate(m),g(null))},children:t("accountsTable.delete")})]})]})})]})}const ne=64;function st({open:s,onClose:a}){const{t}=G(),[c,o]=j.useState(""),[x,l]=j.useState(!1),[m,g]=j.useState(""),[p,i]=j.useState(!1),[b,f]=j.useState(!1),n=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(c),r=m.trim().toLowerCase().replace(/\s+/g,"-"),d=r.length===0||r.length<=ne&&/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(r),N=c&&n?[`ccs auth create ${c}`,x?r.length>0?`--context-group ${r}`:"--share-context":"",x&&p?"--deeper-continuity":""].filter(Boolean).join(" "):t("createAuthProfileDialog.commandFallback"),P=async()=>{!n||x&&!d||(await navigator.clipboard.writeText(N),f(!0),setTimeout(()=>f(!1),2e3))},_=()=>{o(""),l(!1),g(""),i(!1),f(!1),a()};return e.jsx(oe,{open:s,onOpenChange:h=>!h&&_(),children:e.jsxs(re,{className:"sm:max-w-md",children:[e.jsxs(ie,{children:[e.jsx(le,{children:t("createAuthProfileDialog.title")}),e.jsx(de,{children:t("createAuthProfileDialog.description")})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"profile-name",children:t("createAuthProfileDialog.profileName")}),e.jsx($,{id:"profile-name",value:c,onChange:h=>o(h.target.value),placeholder:t("createAuthProfileDialog.profileNamePlaceholder"),autoComplete:"off"}),c&&!n&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidProfileName")})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(te,{id:"share-context",checked:x,onCheckedChange:h=>l(h===!0)}),e.jsx(v,{htmlFor:"share-context",className:"cursor-pointer",children:t("createAuthProfileDialog.enableSharedHistory")})]}),x&&e.jsxs("div",{className:"space-y-2 pl-6",children:[e.jsx(v,{htmlFor:"context-group",children:t("createAuthProfileDialog.historySyncGroupOptional")}),e.jsx($,{id:"context-group",value:m,onChange:h=>g(h.target.value),placeholder:t("createAuthProfileDialog.historySyncGroupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.historySyncGroupHint")}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(te,{id:"deeper-continuity",checked:p,onCheckedChange:h=>i(h===!0)}),e.jsx(v,{htmlFor:"deeper-continuity",className:"cursor-pointer",children:t("createAuthProfileDialog.deeperContinuity")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.deeperContinuityHint")}),m.trim().length>0&&!d&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidContextGroup",{max:ne})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{children:t("createAuthProfileDialog.command")}),e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md font-mono text-sm",children:[e.jsx(qe,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("code",{className:"flex-1 break-all",children:N}),e.jsx(u,{variant:"ghost",size:"sm",className:"shrink-0 h-8 px-2",onClick:P,disabled:!n||x&&!d,children:b?e.jsx(q,{className:"w-4 h-4 text-green-500"}):e.jsx(Y,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsx("p",{children:t("createAuthProfileDialog.afterRunPrefix")}),e.jsxs("ol",{className:"list-decimal list-inside pl-2 space-y-0.5",children:[e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep1")}),e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep2")})]}),e.jsx("p",{className:"pt-1",children:t("createAuthProfileDialog.poolingHint")})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(u,{variant:"ghost",onClick:_,children:t("createAuthProfileDialog.close")}),e.jsx(u,{onClick:P,disabled:!n||x&&!d,children:b?e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copyCommand")]})})]})]})]})})}function H({title:s,count:a,icon:t,tone:c}){const o={isolated:{border:"border-blue-300/60 bg-blue-50/40 dark:border-blue-900/40 dark:bg-blue-900/10",icon:"text-blue-700 dark:text-blue-400",count:"text-blue-700 dark:text-blue-400"},shared:{border:"border-emerald-300/60 bg-emerald-50/40 dark:border-emerald-900/40 dark:bg-emerald-900/10",icon:"text-emerald-700 dark:text-emerald-400",count:"text-emerald-700 dark:text-emerald-400"},deeper:{border:"border-indigo-300/60 bg-indigo-50/40 dark:border-indigo-900/40 dark:bg-indigo-900/10",icon:"text-indigo-700 dark:text-indigo-400",count:"text-indigo-700 dark:text-indigo-400"}};return e.jsxs("div",{className:L("rounded-md border p-2.5",o[c].border),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs font-semibold",children:s}),e.jsx(t,{className:L("h-3.5 w-3.5",o[c].icon)})]}),e.jsx("p",{className:L("mt-1 text-lg font-mono font-semibold",o[c].count),children:a})]})}function ce({isolatedCount:s,sharedStandardCount:a,deeperSharedCount:t,sharedGroups:c,legacyTargetCount:o,cliproxyCount:x}){const{t:l}=G(),[m,g]=j.useState(!1),p=c.length>0?c:["default"];return e.jsxs(A,{className:"border-dashed",children:[e.jsx(S,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx(D,{className:"text-base",children:l("historySyncLearningMap.title")}),e.jsx(w,{className:"mt-1",children:l("historySyncLearningMap.description")})]}),e.jsx(F,{variant:"outline",children:l("historySyncLearningMap.learningMap")})]})}),e.jsxs(k,{className:"space-y-3",children:[x>0&&e.jsx("div",{className:"rounded-md border border-blue-300/60 bg-blue-50/40 px-3 py-2 text-xs text-blue-800 dark:border-blue-900/40 dark:bg-blue-900/10 dark:text-blue-300",children:l("historySyncLearningMap.cliproxyManaged",{count:x})}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto_1fr_auto_1fr] sm:items-center",children:[e.jsx(H,{title:l("historySyncLearningMap.isolated"),count:s,icon:Ee,tone:"isolated"}),e.jsx("div",{className:"hidden sm:flex justify-center text-muted-foreground",children:e.jsx(R,{className:"h-4 w-4"})}),e.jsx(H,{title:l("historySyncLearningMap.shared"),count:a,icon:Ue,tone:"shared"}),e.jsx("div",{className:"hidden sm:flex justify-center text-muted-foreground",children:e.jsx(R,{className:"h-4 w-4"})}),e.jsx(H,{title:l("historySyncLearningMap.deeper"),count:t,icon:Ke,tone:"deeper"})]}),e.jsxs(ue,{open:m,onOpenChange:g,children:[e.jsx(xe,{asChild:!0,children:e.jsxs(u,{variant:"ghost",className:"h-8 w-full justify-between rounded-md px-2 text-xs text-muted-foreground hover:bg-muted/40 hover:text-foreground",children:[e.jsx("span",{children:l("historySyncLearningMap.showDetails")}),e.jsx(he,{className:L("h-4 w-4 transition-transform",m&&"rotate-180")})]})}),e.jsxs(me,{className:"pt-2",children:[e.jsxs("div",{className:"grid gap-2 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Be,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("p",{className:"font-semibold",children:l("historySyncLearningMap.modeSwitch")})]}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:l("historySyncLearningMap.modeSwitchDesc")})]}),e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qe,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("p",{className:"font-semibold",children:l("historySyncLearningMap.historySyncGroup")})]}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:l("historySyncLearningMap.historySyncGroupDesc")}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:p.map(i=>e.jsx(F,{variant:"outline",className:"font-mono text-[10px]",children:i},i))})]})]}),o>0&&e.jsx("div",{className:"mt-2 rounded-md border border-amber-500/50 bg-amber-500/10 px-3 py-2 text-xs text-amber-800 dark:text-amber-300",children:l("historySyncLearningMap.legacyConfirmation",{count:o})})]})]})]})]})}function gt(){const{t:s}=G(),a=fe(),{data:t,isLoading:c}=Ie(),o=Je(),[x,l]=j.useState(!1),[m,g]=j.useState(!1),p=t?.accounts||[],i=t?.cliproxyCount||0,b=t?.legacyContextCount||0,f=t?.legacyContinuityCount||0,n=t?.sharedCount||0,r=t?.sharedStandardCount||0,d=t?.deeperSharedCount||0,N=t?.isolatedCount||0,P=Array.from(new Set(p.filter(C=>C.context_mode==="shared").map(C=>C.context_group||"default"))).sort((C,je)=>C.localeCompare(je)),_=p.filter(C=>C.context_inferred||C.continuity_inferred),h=_.length,pe=h>0,E=()=>a("/cliproxy?provider=claude"),U=()=>a("/cliproxy?provider=claude&action=auth"),K=()=>o.mutate(_);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden h-full min-h-0 lg:flex",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/20 shrink-0",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ve,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:s("accountsPage.title")})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),s("accountsPage.manageSuffix")]})]}),e.jsx(ke,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:s("accountsPage.primaryActions")}),e.jsxs(u,{size:"sm",className:"w-full justify-start",onClick:()=>l(!0),children:[e.jsx(J,{className:"w-4 h-4 mr-2"}),s("accountsPage.createAccount")]}),e.jsxs(u,{size:"sm",className:"w-full justify-start",onClick:U,children:[e.jsx(ee,{className:"w-4 h-4 mr-2"}),s("accountsPage.authClaudeInPool")]}),e.jsxs(u,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:E,children:[s("accountsPage.openClaudePoolSettings"),e.jsx(R,{className:"w-4 h-4 ml-auto"})]})]}),pe?e.jsxs("section",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:s("accountsPage.migrationFollowup")}),e.jsxs("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Ze,{className:"h-4 w-4 mt-0.5 text-amber-700 dark:text-amber-400 shrink-0"}),e.jsxs("div",{className:"space-y-1 text-xs",children:[b>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:s("accountsPage.legacyContextPending",{count:b})}),f>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:s("accountsPage.legacyContinuityPending",{count:f})})]})]}),e.jsx(u,{variant:"secondary",size:"sm",className:"w-full justify-start",onClick:K,disabled:o.isPending||h===0,children:o.isPending?s("accountsPage.confirmingLegacy"):s("accountsPage.confirmLegacy",{count:h})})]})]}):e.jsx("div",{className:"rounded-md border bg-background px-3 py-2 text-xs text-muted-foreground",children:s("accountsPage.noLegacyFollowup")}),e.jsx(ue,{open:m,onOpenChange:g,children:e.jsxs(A,{children:[e.jsx(S,{className:"pb-2",children:e.jsx(xe,{asChild:!0,children:e.jsxs(u,{variant:"ghost",className:"h-auto w-full justify-between px-0 py-0",children:[e.jsxs("div",{className:"text-left",children:[e.jsx(D,{className:"text-sm",children:s("accountsPage.continuityGuide")}),e.jsx(w,{className:"mt-1",children:s("accountsPage.expandWhenNeeded")})]}),e.jsx(he,{className:L("h-4 w-4 transition-transform",m&&"rotate-180")})]})})}),e.jsx(me,{children:e.jsxs(k,{className:"space-y-3 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"rounded-md border p-2.5",children:[e.jsx("p",{className:"font-semibold text-foreground",children:s("accountsPage.sharedStandard")}),e.jsx("p",{className:"mt-1",children:s("accountsPage.sharedStandardDesc")})]}),e.jsxs("div",{className:"rounded-md border p-2.5",children:[e.jsx("p",{className:"font-semibold text-foreground",children:s("accountsPage.sharedDeeper")}),e.jsxs("p",{className:"mt-1",children:[s("accountsPage.sharedDeeperPrefix")," ",e.jsx("code",{children:"session-env"}),","," ",e.jsx("code",{children:"file-history"}),", ",e.jsx("code",{children:"shell-snapshots"}),","," ",e.jsx("code",{children:"todos"}),"."]})]}),e.jsxs("div",{className:"rounded-md border p-2.5",children:[e.jsx("p",{className:"font-semibold text-foreground",children:s("accountsPage.isolated")}),e.jsx("p",{className:"mt-1",children:s("accountsPage.isolatedDesc")})]})]})})]})}),e.jsxs(A,{children:[e.jsxs(S,{className:"pb-2",children:[e.jsx(D,{className:"text-sm",children:s("accountsPage.quickCommands")}),e.jsx(w,{children:s("accountsPage.quickCommandsDesc")})]}),e.jsxs(k,{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth create work --context-group sprint-a --deeper-continuity"}),e.jsx(W,{value:"ccs auth create work --context-group sprint-a --deeper-continuity",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs cliproxy auth claude"}),e.jsx(W,{value:"ccs cliproxy auth claude",size:"icon"})]})]})]})]})})]}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col bg-background",children:[e.jsxs("div",{className:"px-5 py-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{variant:"outline",children:s("accountsPage.workspaceBadge")}),e.jsx(F,{variant:"secondary",children:s("accountsPage.historySyncBadge")})]}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:s("accountsPage.authAccounts")}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[s("accountsPage.tableScopePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),s("accountsPage.tableScopeMiddle"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:s("accountsTable.sync")}),s("accountsPage.tableScopeSuffix")]})]}),e.jsxs("div",{className:"flex-1 min-h-0 p-5 space-y-4 overflow-y-auto",children:[e.jsx(ce,{isolatedCount:N,sharedStandardCount:r,deeperSharedCount:d,sharedGroups:P,legacyTargetCount:h,cliproxyCount:i}),e.jsxs(A,{className:"flex flex-col",children:[e.jsxs(S,{className:"pb-3",children:[e.jsx(D,{className:"text-lg",children:s("accountsPage.accountMatrix")}),e.jsx(w,{children:s("accountsPage.sharedTotalDesc",{count:n})})]}),e.jsx(k,{children:c?e.jsx("div",{className:"text-muted-foreground",children:s("accountsPage.loadingAccounts")}):e.jsx(ae,{data:p,defaultAccount:t?.default??null})})]})]})]})]}),e.jsxs("div",{className:"p-4 space-y-4 lg:hidden",children:[e.jsxs(A,{children:[e.jsxs(S,{children:[e.jsx(D,{className:"text-lg",children:s("accountsPage.title")}),e.jsxs(w,{children:[s("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),s("accountsPage.mobileManageSuffix")]})]}),e.jsxs(k,{className:"space-y-2",children:[e.jsxs(u,{className:"w-full",onClick:()=>l(!0),children:[e.jsx(J,{className:"w-4 h-4 mr-2"}),s("accountsPage.createAccount")]}),e.jsxs(u,{variant:"outline",className:"w-full",onClick:E,children:[s("accountsPage.openCliProxyClaudePool"),e.jsx(R,{className:"w-4 h-4 ml-2"})]}),e.jsxs(u,{variant:"outline",className:"w-full",onClick:U,children:[s("accountsPage.authClaudeInPool"),e.jsx(ee,{className:"w-4 h-4 ml-2"})]}),e.jsx(u,{variant:"outline",className:"w-full",onClick:K,disabled:o.isPending||h===0,children:o.isPending?s("accountsPage.confirmingLegacy"):s("accountsPage.confirmLegacy",{count:h})})]})]}),e.jsx(ce,{isolatedCount:N,sharedStandardCount:r,deeperSharedCount:d,sharedGroups:P,legacyTargetCount:h,cliproxyCount:i}),e.jsxs(A,{children:[e.jsx(S,{className:"pb-3",children:e.jsx(D,{className:"text-base",children:s("accountsPage.accountMatrix")})}),e.jsx(k,{children:c?e.jsx("div",{className:"text-muted-foreground",children:s("accountsPage.loadingAccounts")}):e.jsx(ae,{data:p,defaultAccount:t?.default??null})})]})]}),e.jsx(st,{open:x,onClose:()=>l(!1)})]})}export{gt as AccountsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,a3 as s,a4 as r,a5 as n,a6 as i,a7 as d,a8 as c,a9 as u,aa as f}from"./radix-ui-Dt3edmE5.js";import"./react-vendor-CNOkPC89.js";import{c as o,bB as l}from"./index-
|
|
1
|
+
import{j as e,a3 as s,a4 as r,a5 as n,a6 as i,a7 as d,a8 as c,a9 as u,aa as f}from"./radix-ui-Dt3edmE5.js";import"./react-vendor-CNOkPC89.js";import{c as o,bB as l}from"./index-9n65djxT.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};
|