@kaitranntt/ccs 7.51.0-dev.1 → 7.51.0-dev.4

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.
Files changed (75) hide show
  1. package/README.md +2 -0
  2. package/dist/cliproxy/config/env-builder.d.ts.map +1 -1
  3. package/dist/cliproxy/config/env-builder.js +59 -8
  4. package/dist/cliproxy/config/env-builder.js.map +1 -1
  5. package/dist/cliproxy/config/generator.d.ts +2 -1
  6. package/dist/cliproxy/config/generator.d.ts.map +1 -1
  7. package/dist/cliproxy/config/generator.js +11 -3
  8. package/dist/cliproxy/config/generator.js.map +1 -1
  9. package/dist/cliproxy/model-catalog.d.ts.map +1 -1
  10. package/dist/cliproxy/model-catalog.js +4 -10
  11. package/dist/cliproxy/model-catalog.js.map +1 -1
  12. package/dist/cliproxy/model-config.d.ts.map +1 -1
  13. package/dist/cliproxy/model-config.js +12 -11
  14. package/dist/cliproxy/model-config.js.map +1 -1
  15. package/dist/cliproxy/model-id-normalizer.d.ts +17 -2
  16. package/dist/cliproxy/model-id-normalizer.d.ts.map +1 -1
  17. package/dist/cliproxy/model-id-normalizer.js +54 -7
  18. package/dist/cliproxy/model-id-normalizer.js.map +1 -1
  19. package/dist/cliproxy/services/variant-settings.d.ts.map +1 -1
  20. package/dist/cliproxy/services/variant-settings.js +5 -3
  21. package/dist/cliproxy/services/variant-settings.js.map +1 -1
  22. package/dist/ui/assets/accounts-Cs_Uohn7.js +1 -0
  23. package/dist/ui/assets/{alert-dialog-B_Bdo2ou.js → alert-dialog-cRwDSggu.js} +1 -1
  24. package/dist/ui/assets/api-C73W2Hb1.js +1 -0
  25. package/dist/ui/assets/auth-section-DgF431PH.js +1 -0
  26. package/dist/ui/assets/backups-section-9V2yDu_e.js +1 -0
  27. package/dist/ui/assets/{checkbox-D19h9xqD.js → checkbox-BeoeEcEZ.js} +1 -1
  28. package/dist/ui/assets/cliproxy-DAlyh7zw.js +3 -0
  29. package/dist/ui/assets/cliproxy-control-panel-CE4y4VDk.js +1 -0
  30. package/dist/ui/assets/{confirm-dialog-7-N-o1DD.js → confirm-dialog-COTT5ztZ.js} +1 -1
  31. package/dist/ui/assets/copilot-Cm5PT0v6.js +3 -0
  32. package/dist/ui/assets/cursor-DYhCaKbC.js +1 -0
  33. package/dist/ui/assets/droid-eTM2_tVh.js +2 -0
  34. package/dist/ui/assets/globalenv-section-Dzt_ECFK.js +1 -0
  35. package/dist/ui/assets/health-Bk8Cj2vi.js +1 -0
  36. package/dist/ui/assets/{icons-DrewC9c3.js → icons-kPbuhVdj.js} +1 -1
  37. package/dist/ui/assets/index-BXDW5hxG.js +1 -0
  38. package/dist/ui/assets/index-CKnNRLzv.js +1 -0
  39. package/dist/ui/assets/index-D1Gx_G_A.js +1 -0
  40. package/dist/ui/assets/index-hlYFfpDN.js +47 -0
  41. package/dist/ui/assets/index-jqDLGaO4.js +1 -0
  42. package/dist/ui/assets/proxy-status-widget-D-PfDCn1.js +1 -0
  43. package/dist/ui/assets/{radix-ui-C1Gpgz6I.js → radix-ui-BR1vy4kf.js} +3 -3
  44. package/dist/ui/assets/{separator-51ocJFnp.js → separator-CjXUYlSy.js} +1 -1
  45. package/dist/ui/assets/shared-C9EvhZ8u.js +8 -0
  46. package/dist/ui/assets/{switch-B3t2TDvW.js → switch-DFLN6xA0.js} +1 -1
  47. package/dist/ui/assets/{tanstack-DDJIhNJd.js → tanstack-e99Cjjy2.js} +1 -1
  48. package/dist/ui/assets/updates-FcpGeTFg.js +1 -0
  49. package/dist/ui/index.html +4 -4
  50. package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +1 -1
  51. package/dist/web-server/routes/cliproxy-stats-routes.js +22 -3
  52. package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
  53. package/dist/web-server/routes/settings-routes.d.ts.map +1 -1
  54. package/dist/web-server/routes/settings-routes.js +58 -27
  55. package/dist/web-server/routes/settings-routes.js.map +1 -1
  56. package/package.json +1 -1
  57. package/dist/ui/assets/accounts-p8Gb9myI.js +0 -1
  58. package/dist/ui/assets/api-Bw82I4NV.js +0 -1
  59. package/dist/ui/assets/auth-section-CswwM0bu.js +0 -1
  60. package/dist/ui/assets/backups-section-6slvPh7p.js +0 -1
  61. package/dist/ui/assets/cliproxy-BxWh_a8E.js +0 -3
  62. package/dist/ui/assets/cliproxy-control-panel-BEaTM1tV.js +0 -1
  63. package/dist/ui/assets/copilot-C2ADI_mS.js +0 -3
  64. package/dist/ui/assets/cursor-BzUnxDMC.js +0 -1
  65. package/dist/ui/assets/droid-BOC3J2_I.js +0 -2
  66. package/dist/ui/assets/globalenv-section-Caco9nNS.js +0 -1
  67. package/dist/ui/assets/health-Cn_YNAry.js +0 -1
  68. package/dist/ui/assets/index-0LBl1v7D.js +0 -1
  69. package/dist/ui/assets/index-B_ON5mBa.js +0 -1
  70. package/dist/ui/assets/index-CVKOwyBR.js +0 -1
  71. package/dist/ui/assets/index-CnAQ8t2b.js +0 -1
  72. package/dist/ui/assets/index-DNFjYwGe.js +0 -47
  73. package/dist/ui/assets/proxy-status-widget-B31OXK00.js +0 -1
  74. package/dist/ui/assets/shared-k-J_KXcM.js +0 -8
  75. package/dist/ui/assets/updates-CYChhYqV.js +0 -1
@@ -37,8 +37,9 @@ const cliproxy_1 = require("../../cliproxy");
37
37
  const config_generator_1 = require("../../cliproxy/config-generator");
38
38
  const hook_utils_1 = require("../../utils/websearch/hook-utils");
39
39
  const unified_config_loader_1 = require("../../config/unified-config-loader");
40
+ const provider_capabilities_1 = require("../../cliproxy/provider-capabilities");
41
+ const model_id_normalizer_1 = require("../../cliproxy/model-id-normalizer");
40
42
  const router = (0, express_1.Router)();
41
- const CODEX_EFFORT_SUFFIX_REGEX = /-(xhigh|high|medium)$/i;
42
43
  const MODEL_ENV_KEYS = [
43
44
  'ANTHROPIC_MODEL',
44
45
  'ANTHROPIC_DEFAULT_OPUS_MODEL',
@@ -112,17 +113,27 @@ function resolveSettingsPath(profileOrVariant) {
112
113
  // Regular profile settings
113
114
  return path.join(ccsDir, `${profileOrVariant}.settings.json`);
114
115
  }
115
- function isCodexProfile(profileOrVariant) {
116
- if (profileOrVariant.toLowerCase() === 'codex')
117
- return true;
116
+ function resolveProviderForProfile(profileOrVariant) {
117
+ const directProvider = (0, provider_capabilities_1.mapExternalProviderName)(profileOrVariant);
118
+ if (directProvider) {
119
+ return directProvider;
120
+ }
118
121
  const variants = (0, variant_service_1.listVariants)();
119
- return variants[profileOrVariant]?.provider === 'codex';
122
+ const variantProvider = variants[profileOrVariant]?.provider;
123
+ if (typeof variantProvider === 'string') {
124
+ return (0, provider_capabilities_1.mapExternalProviderName)(variantProvider);
125
+ }
126
+ return null;
120
127
  }
121
- function stripCodexEffortSuffix(modelId) {
122
- return modelId.replace(CODEX_EFFORT_SUFFIX_REGEX, '');
128
+ function canonicalizeProfileModelId(profileOrVariant, modelId) {
129
+ const provider = resolveProviderForProfile(profileOrVariant);
130
+ if (!provider)
131
+ return modelId;
132
+ return (0, model_id_normalizer_1.canonicalizeModelIdForProvider)(modelId, provider);
123
133
  }
124
- function canonicalizeCodexSettings(profileOrVariant, settings) {
125
- if (!isCodexProfile(profileOrVariant))
134
+ function canonicalizeProfileSettings(profileOrVariant, settings) {
135
+ const provider = resolveProviderForProfile(profileOrVariant);
136
+ if (!provider)
126
137
  return settings;
127
138
  let changed = false;
128
139
  const next = { ...settings };
@@ -132,7 +143,7 @@ function canonicalizeCodexSettings(profileOrVariant, settings) {
132
143
  const value = env[key];
133
144
  if (typeof value !== 'string')
134
145
  continue;
135
- const canonical = stripCodexEffortSuffix(value);
146
+ const canonical = (0, model_id_normalizer_1.canonicalizeModelIdForProvider)(value, provider);
136
147
  if (canonical !== value) {
137
148
  env[key] = canonical;
138
149
  changed = true;
@@ -146,7 +157,9 @@ function canonicalizeCodexSettings(profileOrVariant, settings) {
146
157
  let presetChanged = false;
147
158
  for (const key of PRESET_MODEL_KEYS) {
148
159
  const value = normalizedPreset[key];
149
- const canonical = stripCodexEffortSuffix(value);
160
+ if (typeof value !== 'string')
161
+ continue;
162
+ const canonical = (0, model_id_normalizer_1.canonicalizeModelIdForProvider)(value, provider);
150
163
  if (canonical !== value) {
151
164
  normalizedPreset[key] = canonical;
152
165
  presetChanged = true;
@@ -160,6 +173,27 @@ function canonicalizeCodexSettings(profileOrVariant, settings) {
160
173
  }
161
174
  return changed ? next : settings;
162
175
  }
176
+ function writeSettingsAtomically(settingsPath, settings) {
177
+ const tempPath = settingsPath + '.tmp';
178
+ fs.writeFileSync(tempPath, JSON.stringify(settings, null, 2) + '\n');
179
+ fs.renameSync(tempPath, settingsPath);
180
+ }
181
+ function loadCanonicalProfileSettings(profileOrVariant, settingsPath, persist = false, strictPersist = false) {
182
+ const loaded = (0, config_manager_1.loadSettings)(settingsPath);
183
+ const canonicalized = canonicalizeProfileSettings(profileOrVariant, loaded);
184
+ if (persist && canonicalized !== loaded) {
185
+ try {
186
+ writeSettingsAtomically(settingsPath, canonicalized);
187
+ }
188
+ catch (error) {
189
+ if (strictPersist) {
190
+ throw error;
191
+ }
192
+ logRouteError(`Failed to persist canonicalized settings for ${profileOrVariant}`, error);
193
+ }
194
+ }
195
+ return canonicalized;
196
+ }
163
197
  /**
164
198
  * Helper: Mask API keys in settings
165
199
  */
@@ -185,8 +219,8 @@ router.get('/:profile', (req, res) => {
185
219
  res.status(404).json({ error: 'Settings not found' });
186
220
  return;
187
221
  }
222
+ const settings = loadCanonicalProfileSettings(profile, settingsPath, true);
188
223
  const stat = fs.statSync(settingsPath);
189
- const settings = canonicalizeCodexSettings(profile, (0, config_manager_1.loadSettings)(settingsPath));
190
224
  const masked = maskApiKeys(settings);
191
225
  res.json({
192
226
  profile,
@@ -210,8 +244,8 @@ router.get('/:profile/raw', (req, res) => {
210
244
  res.status(404).json({ error: 'Settings not found' });
211
245
  return;
212
246
  }
247
+ const settings = loadCanonicalProfileSettings(profile, settingsPath, true);
213
248
  const stat = fs.statSync(settingsPath);
214
- const settings = canonicalizeCodexSettings(profile, (0, config_manager_1.loadSettings)(settingsPath));
215
249
  res.json({
216
250
  profile,
217
251
  settings,
@@ -242,7 +276,7 @@ router.put('/:profile', (req, res) => {
242
276
  res.status(400).json({ error: 'settings object is required in request body' });
243
277
  return;
244
278
  }
245
- const normalizedSettings = canonicalizeCodexSettings(profile, settings);
279
+ const normalizedSettings = canonicalizeProfileSettings(profile, settings);
246
280
  // Deduplicate CCS hooks to prevent accumulation (fixes #450)
247
281
  // This handles cases where duplicate hooks were added by previous versions
248
282
  (0, hook_utils_1.deduplicateCcsHooks)(normalizedSettings);
@@ -315,7 +349,7 @@ router.get('/:profile/presets', (req, res) => {
315
349
  res.json({ presets: [] });
316
350
  return;
317
351
  }
318
- const settings = canonicalizeCodexSettings(profile, (0, config_manager_1.loadSettings)(settingsPath));
352
+ const settings = loadCanonicalProfileSettings(profile, settingsPath, true);
319
353
  res.json({ presets: settings.presets || [] });
320
354
  }
321
355
  catch (error) {
@@ -339,14 +373,14 @@ router.post('/:profile/presets', (req, res) => {
339
373
  fs.mkdirSync(path.dirname(settingsPath), { recursive: true });
340
374
  fs.writeFileSync(settingsPath, JSON.stringify({ env: {}, presets: [] }, null, 2) + '\n');
341
375
  }
342
- const settings = (0, config_manager_1.loadSettings)(settingsPath);
376
+ const settings = loadCanonicalProfileSettings(profile, settingsPath, false);
343
377
  settings.presets = settings.presets || [];
344
378
  // Check for duplicate name
345
379
  if (settings.presets.some((p) => p.name === name)) {
346
380
  res.status(409).json({ error: 'Preset with this name already exists' });
347
381
  return;
348
382
  }
349
- const normalizePresetModel = (modelId) => isCodexProfile(profile) ? stripCodexEffortSuffix(modelId) : modelId;
383
+ const normalizePresetModel = (modelId) => canonicalizeProfileModelId(profile, modelId);
350
384
  const normalizedDefaultModel = normalizePresetModel(defaultModel);
351
385
  const normalizedOpusModel = normalizePresetModel(opus || defaultModel);
352
386
  const normalizedSonnetModel = normalizePresetModel(sonnet || defaultModel);
@@ -359,11 +393,10 @@ router.post('/:profile/presets', (req, res) => {
359
393
  haiku: normalizedHaikuModel,
360
394
  };
361
395
  settings.presets.push(preset);
362
- // Atomic write: temp file + rename
363
- const tempPath = settingsPath + '.tmp';
364
- fs.writeFileSync(tempPath, JSON.stringify(settings, null, 2) + '\n');
365
- fs.renameSync(tempPath, settingsPath);
366
- res.status(201).json({ preset });
396
+ const canonicalizedSettings = canonicalizeProfileSettings(profile, settings);
397
+ writeSettingsAtomically(settingsPath, canonicalizedSettings);
398
+ const persistedPreset = canonicalizedSettings.presets?.find((entry) => entry.name === name) || preset;
399
+ res.status(201).json({ preset: persistedPreset });
367
400
  }
368
401
  catch (error) {
369
402
  respondInternalError(res, error, 'Internal server error.');
@@ -380,16 +413,14 @@ router.delete('/:profile/presets/:name', (req, res) => {
380
413
  res.status(404).json({ error: 'Settings not found' });
381
414
  return;
382
415
  }
383
- const settings = (0, config_manager_1.loadSettings)(settingsPath);
416
+ const settings = loadCanonicalProfileSettings(profile, settingsPath, false);
384
417
  if (!settings.presets || !settings.presets.some((p) => p.name === name)) {
385
418
  res.status(404).json({ error: 'Preset not found' });
386
419
  return;
387
420
  }
388
421
  settings.presets = settings.presets.filter((p) => p.name !== name);
389
- // Atomic write: temp file + rename
390
- const tempPath = settingsPath + '.tmp';
391
- fs.writeFileSync(tempPath, JSON.stringify(settings, null, 2) + '\n');
392
- fs.renameSync(tempPath, settingsPath);
422
+ const canonicalizedSettings = canonicalizeProfileSettings(profile, settings);
423
+ writeSettingsAtomically(settingsPath, canonicalizedSettings);
393
424
  res.json({ success: true });
394
425
  }
395
426
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"settings-routes.js","sourceRoot":"","sources":["../../../src/web-server/routes/settings-routes.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,qCAAoD;AACpD,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAC7B,+DAAqE;AACrE,+DAAgF;AAChF,6EAAuE;AACvE,6CAOwB;AACxB,sEAAmE;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EAAE,wBAAwB,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,kBAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"settings-routes.js","sourceRoot":"","sources":["../../../src/web-server/routes/settings-routes.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,qCAAoD;AACpD,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAC7B,+DAAqE;AACrE,+DAAgF;AAChF,6EAAuE;AACvE,6CAOwB;AACxB,sEAAmE;AACnE,iEAAuE;AACvE,8EAI4C;AAG5C,gFAA+E;AAC/E,4EAAoF;AAEpF,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AACxB,MAAM,cAAc,GAAG;IACrB,iBAAiB;IACjB,8BAA8B;IAC9B,gCAAgC;IAChC,+BAA+B;CACvB,CAAC;AACX,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AAE1E,SAAS,aAAa,CAAC,OAAe,EAAE,KAAc;IACpD,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,CAAC,KAAK,CAAC,qBAAqB,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAChE,OAAO;IACT,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,qBAAqB,OAAO,iBAAiB,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,oBAAoB,CAC3B,GAAa,EACb,KAAc,EACd,eAAuB,EACvB,UAAU,GAAG,GAAG;IAEhB,aAAa,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAyB;IAClD,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CA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gBAAgB,EAAE;gBAChB,KAAK,EAAE,IAAA,oBAAS,EAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC;gBAChD,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,QAAQ;aAC5C;YACD,OAAO,EAAE,sDAAsD;SAChE,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,oBAAoB,CAAC,GAAG,EAAE,KAAK,EAAE,wBAAwB,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,kBAAe,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaitranntt/ccs",
3
- "version": "7.51.0-dev.1",
3
+ "version": "7.51.0-dev.4",
4
4
  "description": "Claude Code Switch - Instant profile switching between Claude Sonnet 4.5 and GLM 4.6",
5
5
  "keywords": [
6
6
  "cli",
@@ -1 +0,0 @@
1
- import{j as e}from"./radix-ui-C1Gpgz6I.js";import{r as j,h as ge}from"./react-vendor-CNOkPC89.js";import{u as je,a as L,b as z,d as fe,f as I,g as ye}from"./tanstack-DDJIhNJd.js";import{c as y,W as D,a5 as ne,a6 as re,a7 as oe,a8 as ce,a9 as le,L as v,q as U,r as K,s as B,t as Q,v as M,I as G,an as Ne,b as d,C as k,i as S,j as _,Y as T,B as F,a as A,K as ie,M as de,N as ue,m as be,w as Z}from"./index-DNFjYwGe.js";import{A as Ce,a as ve,b as we,c as ke,d as Se,e as _e,f as Ae,g as De}from"./alert-dialog-B_Bdo2ou.js";import{t as N}from"./notifications-B2HqRBj7.js";import{w as Pe,aE as Te,aF as Le,k as H,ah as ze,z as Me,m as V,aG as Fe,am as O,aH as Oe,aI as Ee,Y as xe,aJ as Ge,aK as He,U as Re,a0 as X,Z as W,T as $e}from"./icons-DrewC9c3.js";import{C as Y}from"./checkbox-D19h9xqD.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";function qe({className:a,...s}){return e.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:e.jsx("table",{"data-slot":"table",className:y("w-full caption-bottom text-sm",a),...s})})}function Ie({className:a,...s}){return e.jsx("thead",{"data-slot":"table-header",className:y("[&_tr]:border-b",a),...s})}function Ue({className:a,...s}){return e.jsx("tbody",{"data-slot":"table-body",className:y("[&_tr:last-child]:border-0",a),...s})}function J({className:a,...s}){return e.jsx("tr",{"data-slot":"table-row",className:y("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",a),...s})}function Ke({className:a,...s}){return e.jsx("th",{"data-slot":"table-head",className:y("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...s})}function Be({className:a,...s}){return e.jsx("td",{"data-slot":"table-cell",className:y("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...s})}function Qe(){return je({queryKey:["accounts"],queryFn:()=>D.accounts.list(),select:a=>{const s=a.accounts.filter(i=>i.type!=="cliproxy"),r=a.accounts.length-s.length,n=s.filter(i=>i.context_mode==="shared").length,c=s.filter(i=>i.context_mode==="shared"&&i.continuity_mode==="deeper").length,u=Math.max(n-c,0),x=s.length-n,p=s.filter(i=>i.context_inferred).length,g=s.filter(i=>i.context_mode==="shared"&&i.continuity_mode!=="deeper"&&i.continuity_inferred).length,m=s.some(i=>i.name===a.default)?a.default:null;return{accounts:s,default:m,cliproxyCount:r,legacyContextCount:p,legacyContinuityCount:g,sharedCount:n,sharedStandardCount:u,deeperSharedCount:c,isolatedCount:x}}})}function Ze(){const a=L();return z({mutationFn:s=>D.accounts.setDefault(s),onSuccess:(s,r)=>{a.invalidateQueries({queryKey:["accounts"]}),N.success(`Default account set to "${r}"`)},onError:s=>{N.error(s.message)}})}function Ve(){const a=L();return z({mutationFn:()=>D.accounts.resetDefault(),onSuccess:()=>{a.invalidateQueries({queryKey:["accounts"]}),N.success("Default account reset to CCS")},onError:s=>{N.error(s.message)}})}function Xe(){const a=L();return z({mutationFn:s=>D.accounts.delete(s),onSuccess:(s,r)=>{a.invalidateQueries({queryKey:["accounts"]}),N.success(`Account "${r}" deleted`)},onError:s=>{N.error(s.message)}})}function me(){const a=L();return z({mutationFn:({name:s,context_mode:r,context_group:n,continuity_mode:c})=>D.accounts.updateContext(s,{context_mode:r,context_group:n,continuity_mode:c}),onSuccess:(s,r)=>{a.invalidateQueries({queryKey:["accounts"]});const n=r.context_mode==="shared"?r.continuity_mode==="deeper"?`shared (${(r.context_group||"default").trim().toLowerCase().replace(/\s+/g,"-")}, deeper continuity)`:`shared (${(r.context_group||"default").trim().toLowerCase().replace(/\s+/g,"-")}, standard)`:"isolated";N.success(`Updated "${r.name}" context to ${n}`)},onError:s=>{N.error(s.message)}})}function We(){const a=L();return z({mutationFn:async s=>{const r=s.filter(n=>n.context_inferred||n.continuity_inferred);for(const n of r){const c=n.context_mode==="shared";await D.accounts.updateContext(n.name,{context_mode:c?"shared":"isolated",context_group:c?n.context_group||"default":void 0,continuity_mode:c?n.continuity_mode==="deeper"?"deeper":"standard":void 0})}return{updatedCount:r.length}},onSuccess:({updatedCount:s})=>{if(a.invalidateQueries({queryKey:["accounts"]}),s>0){N.success(`Confirmed explicit sync mode for ${s} legacy account${s>1?"s":""}`);return}N.info("No legacy accounts need confirmation")},onError:s=>{N.error(s.message)}})}const ee=64,Ye=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function Je({account:a,onClose:s}){const r=me(),[n,c]=j.useState(a.context_mode==="shared"?"shared":"isolated"),[u,x]=j.useState(a.context_group||"default"),[p,g]=j.useState(a.continuity_mode==="deeper"?"deeper":"standard"),m=j.useMemo(()=>u.trim().toLowerCase().replace(/\s+/g,"-"),[u]),i=m.length>0&&m.length<=ee&&Ye.test(m),f=n==="isolated"||i,t=()=>{f&&r.mutate({name:a.name,context_mode:n,context_group:n==="shared"?m:void 0,continuity_mode:n==="shared"?p:void 0},{onSuccess:()=>{s()}})},o=l=>{l||s()};return e.jsx(ne,{open:!0,onOpenChange:o,children:e.jsxs(re,{className:"sm:max-w-md",children:[e.jsxs(oe,{children:[e.jsx(ce,{children:"Edit History Sync"}),e.jsxs(le,{children:['Configure how "',a.name,'" shares history and continuity with other',e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),"accounts."]})]}),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:"Sync Mode"}),e.jsxs(U,{value:n,onValueChange:l=>c(l),children:[e.jsx(K,{id:"context-mode",children:e.jsx(B,{placeholder:"Select context mode"})}),e.jsxs(Q,{children:[e.jsx(M,{value:"isolated",children:"isolated (no sync)"}),e.jsx(M,{value:"shared",children:"shared (sync enabled)"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n==="shared"?"Shared mode reuses workspace context for accounts in the same history sync group.":"Isolated mode keeps this account fully separate from other ccs auth accounts."})]}),n==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"context-group",children:"History Sync Group"}),e.jsx(G,{id:"context-group",value:u,onChange:l=>x(l.target.value),placeholder:"default",autoComplete:"off"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Normalized to lowercase (spaces become dashes). Allowed: letters, numbers, `_`, `-` (max ",ee," chars)."]}),!i&&e.jsx("p",{className:"text-xs text-destructive",children:"Enter a valid group name that starts with a letter."})]}),n==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"continuity-mode",children:"Continuity Depth"}),e.jsxs(U,{value:p,onValueChange:l=>g(l),children:[e.jsx(K,{id:"continuity-mode",children:e.jsx(B,{placeholder:"Select continuity depth"})}),e.jsxs(Q,{children:[e.jsx(M,{value:"standard",children:"standard (projects only)"}),e.jsx(M,{value:"deeper",children:"deeper continuity (advanced)"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:p==="deeper"?"Advanced mode also syncs session-env, file-history, shell-snapshots, and todos.":"Standard mode syncs project workspace context only."})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Credentials and `.anthropic` remain isolated per account in all modes."})]}),e.jsxs(Ne,{children:[e.jsx(d,{variant:"outline",onClick:s,disabled:r.isPending,children:"Cancel"}),e.jsx(d,{onClick:t,disabled:!f||r.isPending,children:r.isPending?"Saving...":"Save"})]})]})})}function se({data:a,defaultAccount:s}){const r=Ze(),n=Xe(),c=Ve(),u=me(),[x,p]=j.useState(null),[g,m]=j.useState(null),f=fe({data:a,columns:[{accessorKey:"name",header:"Name",size:200,cell:({row:t})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:t.original.name}),t.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:t})=>e.jsx("span",{className:"capitalize text-muted-foreground",children:t.original.type||"oauth"})},{accessorKey:"created",header:"Created",size:150,cell:({row:t})=>{const o=new Date(t.original.created);return e.jsx("span",{className:"text-muted-foreground",children:o.toLocaleDateString()})}},{accessorKey:"last_used",header:"Last Used",size:150,cell:({row:t})=>{if(!t.original.last_used)return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const o=new Date(t.original.last_used);return e.jsx("span",{className:"text-muted-foreground",children:o.toLocaleDateString()})}},{id:"context",header:"History Sync",size:170,cell:({row:t})=>{if(t.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});if((t.original.context_mode||"isolated")==="shared"){const l=t.original.context_group||"default";return t.original.continuity_mode==="deeper"?e.jsxs("span",{className:"text-muted-foreground",children:["shared (",l,", deeper)"]}):t.original.continuity_inferred?e.jsxs("span",{className:"text-amber-700 dark:text-amber-400",children:["shared (",l,", standard legacy)"]}):e.jsxs("span",{className:"text-muted-foreground",children:["shared (",l,", standard)"]})}return t.original.context_inferred?e.jsx("span",{className:"text-amber-700 dark:text-amber-400",children:"isolated (legacy default)"}):e.jsx("span",{className:"text-muted-foreground",children:"isolated"})}},{id:"actions",header:"Actions",size:220,cell:({row:t})=>{const o=t.original.name===s,l=r.isPending||n.isPending||u.isPending,b=t.original.type==="cliproxy",w=t.original.context_inferred||t.original.continuity_inferred;return e.jsxs("div",{className:"flex items-center gap-1",children:[!b&&e.jsxs(d,{variant:"outline",size:"sm",className:"h-8 px-2",disabled:l,onClick:()=>m(t.original),title:"Edit sync mode, group, and continuity depth",children:[e.jsx(Te,{className:"w-3.5 h-3.5 mr-1"}),"Sync"]}),!b&&w&&e.jsxs(d,{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:l,onClick:()=>u.mutate({name:t.original.name,context_mode:t.original.context_mode==="shared"?"shared":"isolated",context_group:t.original.context_mode==="shared"?t.original.context_group||"default":void 0,continuity_mode:t.original.context_mode==="shared"?t.original.continuity_mode==="deeper"?"deeper":"standard":void 0}),title:"Confirm this legacy account's current mode as explicit",children:[e.jsx(Le,{className:"w-3 h-3 mr-1"}),"Confirm"]}),e.jsxs(d,{variant:o?"secondary":"default",size:"sm",className:"h-8 px-2",disabled:o||l,onClick:()=>r.mutate(t.original.name),children:[e.jsx(H,{className:`w-3 h-3 mr-1 ${o?"opacity-50":""}`}),o?"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:o||l,onClick:()=>p(t.original.name),title:o?"Cannot delete default account":"Delete account",children:e.jsx(ze,{className:"w-4 h-4"})})]})}}],getCoreRowModel:ye()});return a.length===0?e.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:["No CCS auth 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(qe,{children:[e.jsx(Ie,{children:f.getHeaderGroups().map(t=>e.jsx(J,{children:t.headers.map(o=>{const l={name:"w-[200px]",type:"w-[100px]",created:"w-[150px]",last_used:"w-[150px]",context:"w-[170px]",actions:"w-[290px]"}[o.id]||"w-auto";return e.jsx(Ke,{className:l,children:o.isPlaceholder?null:I(o.column.columnDef.header,o.getContext())},o.id)})},t.id))}),e.jsx(Ue,{children:f.getRowModel().rows.map(t=>e.jsx(J,{children:t.getVisibleCells().map(o=>e.jsx(Be,{children:I(o.column.columnDef.cell,o.getContext())},o.id))},t.id))})]})}),s&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(d,{variant:"outline",size:"sm",onClick:()=>c.mutate(),disabled:c.isPending,children:[e.jsx(Pe,{className:"w-4 h-4 mr-2"}),"Reset to CCS Default"]})})]}),g&&e.jsx(Je,{account:g,onClose:()=>m(null)}),e.jsx(Ce,{open:!!x,onOpenChange:t=>!t&&p(null),children:e.jsxs(ve,{children:[e.jsxs(we,{children:[e.jsx(ke,{children:"Delete Account"}),e.jsxs(Se,{children:['Are you sure you want to delete the account "',x,'"? This will remove the profile and all its session data. This action cannot be undone.']})]}),e.jsxs(_e,{children:[e.jsx(Ae,{children:"Cancel"}),e.jsx(De,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{x&&(n.mutate(x),p(null))},children:"Delete"})]})]})})]})}const te=64;function es({open:a,onClose:s}){const[r,n]=j.useState(""),[c,u]=j.useState(!1),[x,p]=j.useState(""),[g,m]=j.useState(!1),[i,f]=j.useState(!1),t=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(r),o=x.trim().toLowerCase().replace(/\s+/g,"-"),l=o.length===0||o.length<=te&&/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(o),b=r&&t?[`ccs auth create ${r}`,c?o.length>0?`--context-group ${o}`:"--share-context":"",c&&g?"--deeper-continuity":""].filter(Boolean).join(" "):"ccs auth create <name>",w=async()=>{!t||c&&!l||(await navigator.clipboard.writeText(b),f(!0),setTimeout(()=>f(!1),2e3))},P=()=>{n(""),u(!1),p(""),m(!1),f(!1),s()};return e.jsx(ne,{open:a,onOpenChange:h=>!h&&P(),children:e.jsxs(re,{className:"sm:max-w-md",children:[e.jsxs(oe,{children:[e.jsx(ce,{children:"Create New Account"}),e.jsx(le,{children:"Auth profiles require Claude CLI login. Run the command below in your terminal. You can edit sync mode, group, and continuity depth later from the Accounts table."})]}),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:"Profile Name"}),e.jsx(G,{id:"profile-name",value:r,onChange:h=>n(h.target.value),placeholder:"e.g., work, personal, client",autoComplete:"off"}),r&&!t&&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-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Y,{id:"share-context",checked:c,onCheckedChange:h=>u(h===!0)}),e.jsx(v,{htmlFor:"share-context",className:"cursor-pointer",children:"Enable shared history sync with other ccs auth accounts"})]}),c&&e.jsxs("div",{className:"space-y-2 pl-6",children:[e.jsx(v,{htmlFor:"context-group",children:"History Sync Group (optional)"}),e.jsx(G,{id:"context-group",value:x,onChange:h=>p(h.target.value),placeholder:"default, sprint-a, client-x",autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Leave empty to use the default shared group. Spaces are normalized to dashes."}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(Y,{id:"deeper-continuity",checked:g,onCheckedChange:h=>m(h===!0)}),e.jsx(v,{htmlFor:"deeper-continuity",className:"cursor-pointer",children:"Advanced: deeper continuity mode"})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Adds sync for ",e.jsx("code",{children:"session-env"}),", ",e.jsx("code",{children:"file-history"}),","," ",e.jsx("code",{children:"shell-snapshots"}),", and ",e.jsx("code",{children:"todos"}),". Credentials stay isolated."]}),x.trim().length>0&&!l&&e.jsxs("p",{className:"text-xs text-destructive",children:["Group must start with a letter and use only letters, numbers, dashes, or underscores (max ",te," chars)."]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{children:"Command"}),e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md font-mono text-sm",children:[e.jsx(Me,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("code",{className:"flex-1 break-all",children:b}),e.jsx(d,{variant:"ghost",size:"sm",className:"shrink-0 h-8 px-2",onClick:w,disabled:!t||c&&!l,children:i?e.jsx(H,{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.jsx("p",{className:"pt-1",children:"Prefer pooled Claude OAuth routing instead? Use CLIProxy Claude pool from the Accounts page action button."})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(d,{variant:"ghost",onClick:P,children:"Close"}),e.jsx(d,{onClick:w,disabled:!t||c&&!l,children:i?e.jsxs(e.Fragment,{children:[e.jsx(H,{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 E({title:a,count:s,icon:r,tone:n}){const c={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:y("rounded-md border p-2.5",c[n].border),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("p",{className:"text-xs font-semibold",children:a}),e.jsx(r,{className:y("h-3.5 w-3.5",c[n].icon)})]}),e.jsx("p",{className:y("mt-1 text-lg font-mono font-semibold",c[n].count),children:s})]})}function ae({isolatedCount:a,sharedStandardCount:s,deeperSharedCount:r,sharedGroups:n,legacyTargetCount:c,cliproxyCount:u}){const[x,p]=j.useState(!1),g=n.length>0?n:["default"];return e.jsxs(k,{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(_,{className:"text-base",children:"How History Sync Works"}),e.jsxs(T,{className:"mt-1",children:["Isolated -> Shared -> Deeper. Use ",e.jsx("code",{children:"Sync"})," per row for all changes."]})]}),e.jsx(F,{variant:"outline",children:"Learning Map"})]})}),e.jsxs(A,{className:"space-y-3",children:[u>0&&e.jsxs("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:[u," CLIProxy Claude pool account",u>1?"s are":" is","managed in Action Center / CLIProxy page."]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto_1fr_auto_1fr] sm:items-center",children:[e.jsx(E,{title:"Isolated",count:a,icon:Fe,tone:"isolated"}),e.jsx("div",{className:"hidden sm:flex justify-center text-muted-foreground",children:e.jsx(O,{className:"h-4 w-4"})}),e.jsx(E,{title:"Shared",count:s,icon:Oe,tone:"shared"}),e.jsx("div",{className:"hidden sm:flex justify-center text-muted-foreground",children:e.jsx(O,{className:"h-4 w-4"})}),e.jsx(E,{title:"Deeper",count:r,icon:Ee,tone:"deeper"})]}),e.jsxs(ie,{open:x,onOpenChange:p,children:[e.jsx(de,{asChild:!0,children:e.jsxs(d,{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:"Show details: groups, switching, and legacy policy"}),e.jsx(xe,{className:y("h-4 w-4 transition-transform",x&&"rotate-180")})]})}),e.jsxs(ue,{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(Ge,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("p",{className:"font-semibold",children:"Mode Switch"})]}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:"Sync dialog lets users move between isolated/shared and choose deeper continuity."})]}),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(He,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("p",{className:"font-semibold",children:"History Sync Group"})]}),e.jsxs("p",{className:"mt-1 text-muted-foreground",children:["Same group means shared project context lane. Default fallback is"," ",e.jsx("code",{children:"default"}),"."]}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:g.map(m=>e.jsx(F,{variant:"outline",className:"font-mono text-[10px]",children:m},m))})]})]}),c>0&&e.jsxs("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:[c," legacy account",c>1?"s still need":" still needs"," explicit confirmation."]})]})]})]})]})}function xs(){const a=ge(),{data:s,isLoading:r}=Qe(),n=We(),[c,u]=j.useState(!1),[x,p]=j.useState(!1),g=s?.accounts||[],m=s?.cliproxyCount||0,i=s?.legacyContextCount||0,f=s?.legacyContinuityCount||0,t=s?.sharedCount||0,o=s?.sharedStandardCount||0,l=s?.deeperSharedCount||0,b=s?.isolatedCount||0,w=Array.from(new Set(g.filter(C=>C.context_mode==="shared").map(C=>C.context_group||"default"))).sort((C,pe)=>C.localeCompare(pe)),P=g.filter(C=>C.context_inferred||C.continuity_inferred),h=P.length,he=h>0,R=()=>a("/cliproxy?provider=claude"),$=()=>a("/cliproxy?provider=claude&action=auth"),q=()=>n.mutate(P);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"h-[calc(100vh-100px)] hidden 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(Re,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:"Accounts"})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Manage",e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),"accounts and pool onboarding from one panel."]})]}),e.jsx(be,{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:"Primary Actions"}),e.jsxs(d,{size:"sm",className:"w-full justify-start",onClick:()=>u(!0),children:[e.jsx(X,{className:"w-4 h-4 mr-2"}),"Create Account"]}),e.jsxs(d,{size:"sm",className:"w-full justify-start",onClick:$,children:[e.jsx(W,{className:"w-4 h-4 mr-2"}),"Authenticate Claude in Pool"]}),e.jsxs(d,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:R,children:["Open Claude Pool Settings",e.jsx(O,{className:"w-4 h-4 ml-auto"})]})]}),he?e.jsxs("section",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:"Migration Follow-up"}),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($e,{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:[i>0&&e.jsxs("p",{className:"text-amber-800 dark:text-amber-300",children:[i," account",i>1?"s still need":" still needs"," first-time mode confirmation."]}),f>0&&e.jsxs("p",{className:"text-amber-800 dark:text-amber-300",children:[f," shared account",f>1?"s remain":" remains"," on standard legacy continuity depth."]})]})]}),e.jsx(d,{variant:"secondary",size:"sm",className:"w-full justify-start",onClick:q,disabled:n.isPending||h===0,children:n.isPending?"Confirming Legacy Policies...":`Confirm Legacy Policies (${h})`})]})]}):e.jsx("div",{className:"rounded-md border bg-background px-3 py-2 text-xs text-muted-foreground",children:"No legacy follow-up pending."}),e.jsx(ie,{open:x,onOpenChange:p,children:e.jsxs(k,{children:[e.jsx(S,{className:"pb-2",children:e.jsx(de,{asChild:!0,children:e.jsxs(d,{variant:"ghost",className:"h-auto w-full justify-between px-0 py-0",children:[e.jsxs("div",{className:"text-left",children:[e.jsx(_,{className:"text-sm",children:"Continuity Guide"}),e.jsx(T,{className:"mt-1",children:"Expand only when needed."})]}),e.jsx(xe,{className:y("h-4 w-4 transition-transform",x&&"rotate-180")})]})})}),e.jsx(ue,{children:e.jsxs(A,{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:"Shared Standard"}),e.jsx("p",{className:"mt-1",children:"Project workspace sync only. Best default for most teams."})]}),e.jsxs("div",{className:"rounded-md border p-2.5",children:[e.jsx("p",{className:"font-semibold text-foreground",children:"Shared Deeper"}),e.jsxs("p",{className:"mt-1",children:["Adds ",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:"Isolated"}),e.jsx("p",{className:"mt-1",children:"No link. Best for strict separation."})]})]})})]})}),e.jsxs(k,{children:[e.jsxs(S,{className:"pb-2",children:[e.jsx(_,{className:"text-sm",children:"Quick Commands"}),e.jsx(T,{children:"Copy and run in terminal."})]}),e.jsxs(A,{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(Z,{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(Z,{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:"ccs auth Workspace"}),e.jsx(F,{variant:"secondary",children:"History Sync Controls"})]}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:"Auth Accounts"}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["This table is intentionally scoped to",e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),"accounts. Use",e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"Sync"}),"for mode/group/depth changes."]})]}),e.jsxs("div",{className:"flex-1 min-h-0 p-5 space-y-4 overflow-y-auto",children:[e.jsx(ae,{isolatedCount:b,sharedStandardCount:o,deeperSharedCount:l,sharedGroups:w,legacyTargetCount:h,cliproxyCount:m}),e.jsxs(k,{className:"flex flex-col",children:[e.jsxs(S,{className:"pb-3",children:[e.jsx(_,{className:"text-lg",children:"Account Matrix"}),e.jsxs(T,{children:["Shared total: ",t,". Actions include Sync settings and legacy confirmation."]})]}),e.jsx(A,{children:r?e.jsx("div",{className:"text-muted-foreground",children:"Loading accounts..."}):e.jsx(se,{data:g,defaultAccount:s?.default??null})})]})]})]})]}),e.jsxs("div",{className:"p-4 space-y-4 lg:hidden",children:[e.jsxs(k,{children:[e.jsxs(S,{children:[e.jsx(_,{className:"text-lg",children:"Accounts"}),e.jsxs(T,{children:["Manage",e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),"continuity per account."]})]}),e.jsxs(A,{className:"space-y-2",children:[e.jsxs(d,{className:"w-full",onClick:()=>u(!0),children:[e.jsx(X,{className:"w-4 h-4 mr-2"}),"Create Account"]}),e.jsxs(d,{variant:"outline",className:"w-full",onClick:R,children:["Open CLIProxy Claude Pool",e.jsx(O,{className:"w-4 h-4 ml-2"})]}),e.jsxs(d,{variant:"outline",className:"w-full",onClick:$,children:["Authenticate Claude in Pool",e.jsx(W,{className:"w-4 h-4 ml-2"})]}),e.jsx(d,{variant:"outline",className:"w-full",onClick:q,disabled:n.isPending||h===0,children:n.isPending?"Confirming Legacy Policies...":`Confirm Legacy Policies (${h})`})]})]}),e.jsx(ae,{isolatedCount:b,sharedStandardCount:o,deeperSharedCount:l,sharedGroups:w,legacyTargetCount:h,cliproxyCount:m}),e.jsxs(k,{children:[e.jsx(S,{className:"pb-3",children:e.jsx(_,{className:"text-base",children:"Account Matrix"})}),e.jsx(A,{children:r?e.jsx("div",{className:"text-muted-foreground",children:"Loading accounts..."}):e.jsx(se,{data:g,defaultAccount:s?.default??null})})]})]}),e.jsx(es,{open:c,onClose:()=>u(!1)})]})}export{xs as AccountsPage};
@@ -1 +0,0 @@
1
- import{j as e}from"./radix-ui-C1Gpgz6I.js";import{r as o}from"./react-vendor-CNOkPC89.js";import{B as k,c as _,T as Oe,o as Te,p as Ae,q as Ee,r as _e,s as Se,t as ke,v as se,b as N,I as A,m as K,L as T,w as D,x as de,y as Pe,z as Re,A as De,D as Me,S as te,E as H,F as Y,G as xe,H as Le,J as Ie,K as me,M as ue,N as he,O as Ue,Q as He,R as ae,U as ne,V as Fe,W as $e,X as W,C as Ke,i as ze,j as Je,Y as Be,a as Qe,Z as qe,_ as Ve,$ as Ye,a0 as Ge}from"./index-DNFjYwGe.js";import{a as We,u as Xe,b as re}from"./tanstack-DDJIhNJd.js";import{C as G}from"./confirm-dialog-7-N-o1DD.js";import{t as I}from"./notifications-B2HqRBj7.js";import{L as F,R as z,ah as fe,ai as Ze,E as es,e as ss,a0 as $,I as ts,aj as pe,a1 as X,c as ge,ak as as,$ as ns,al as rs,n as je,X as is,Z as Ne,am as ls,a5 as cs,a2 as ve,an as os,r as be}from"./icons-DrewC9c3.js";import{S as ie}from"./separator-51ocJFnp.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";import"./alert-dialog-B_Bdo2ou.js";function ds({className:s,showTooltip:a=!0}){const t=e.jsxs(k,{variant:"outline",className:_("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 a?e.jsxs(Oe,{children:[e.jsx(Te,{asChild:!0,children:t}),e.jsx(Ae,{children:e.jsx("p",{children:"Access 349+ models via OpenRouter"})})]}):t}function le(s){return[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/^API_KEY$/,/^AUTH_TOKEN$/,/_SECRET$/,/^SECRET$/].some(t=>t.test(s))}function we(s){return s?.env?(s.env.ANTHROPIC_BASE_URL||"").toLowerCase().includes("openrouter.ai"):!1}function xs(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 ms(s,a){const t={...s};return a.opus?t.ANTHROPIC_DEFAULT_OPUS_MODEL=a.opus:delete t.ANTHROPIC_DEFAULT_OPUS_MODEL,a.sonnet?t.ANTHROPIC_DEFAULT_SONNET_MODEL=a.sonnet:delete t.ANTHROPIC_DEFAULT_SONNET_MODEL,a.haiku?t.ANTHROPIC_DEFAULT_HAIKU_MODEL=a.haiku:delete t.ANTHROPIC_DEFAULT_HAIKU_MODEL,t}function us({profileName:s,target:a,data:t,settings:d,isLoading:x,isSaving:m,isTargetSaving:f,hasChanges:l,isRawJsonValid:i,onTargetChange:u,onRefresh:g,onDelete:O,onSave:b}){const v=m||f,j=x||v;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(k,{variant:"outline",className:"text-xs",children:t.path.replace(/^.*\//,"")}),we(d)&&e.jsx(ds,{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:"mt-2 flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Default target:"}),e.jsxs(Ee,{value:a,onValueChange:w=>{j||u(w)},disabled:j,children:[e.jsx(_e,{className:"h-7 w-[170px] text-xs",disabled:j,children:e.jsx(Se,{})}),e.jsxs(ke,{children:[e.jsx(se,{value:"claude",children:"Claude Code"}),e.jsx(se,{value:"droid",children:"Factory Droid"})]})]}),f&&e.jsx(F,{className:"w-3.5 h-3.5 animate-spin text-muted-foreground"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{variant:"ghost",size:"sm",onClick:g,disabled:j,children:e.jsx(z,{className:`w-4 h-4 ${x?"animate-spin":""}`})}),O&&e.jsx(N,{variant:"ghost",size:"sm",onClick:O,disabled:v,children:e.jsx(fe,{className:"w-4 h-4 text-destructive"})}),e.jsx(N,{size:"sm",onClick:b,disabled:v||!l||!i,children:m?e.jsxs(e.Fragment,{children:[e.jsx(F,{className:"w-4 h-4 mr-1 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ze,{className:"w-4 h-4 mr-1"}),"Save"]})})]})]})}function Ce({label:s,...a}){const[t,d]=o.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(A,{type:t?"text":"password",className:"pr-10 font-mono",...a}),e.jsx(N,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3",onClick:()=>d(!t),tabIndex:-1,children:t?e.jsx(es,{className:"w-4 h-4"}):e.jsx(ss,{className:"w-4 h-4"})})]})]})}function hs({currentSettings:s,newEnvKey:a,newEnvValue:t,onNewEnvKeyChange:d,onNewEnvValueChange:x,onEnvValueChange:m,onAddEnvVar:f}){return e.jsxs(e.Fragment,{children:[e.jsx(K,{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(([l,i])=>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:[l,le(l)&&e.jsx(k,{variant:"secondary",className:"text-[10px] px-1 py-0 h-4",children:"sensitive"})]}),le(l)?e.jsx(Ce,{value:i,onChange:u=>m(l,u.target.value),className:"font-mono text-sm h-8"}):e.jsx(A,{value:i,onChange:u=>m(l,u.target.value),className:"font-mono text-sm h-8"})]},l))}):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(A,{placeholder:"VARIABLE_NAME",value:a,onChange:l=>d(l.target.value.toUpperCase()),className:"font-mono text-sm h-8 w-2/5",onKeyDown:l=>l.key==="Enter"&&a.trim()&&f()}),e.jsx(A,{placeholder:"value",value:t,onChange:l=>x(l.target.value),className:"font-mono text-sm h-8 flex-1",onKeyDown:l=>l.key==="Enter"&&a.trim()&&f()}),e.jsx(N,{variant:"outline",size:"sm",className:"h-8",onClick:f,disabled:!a.trim(),children:e.jsx($,{className:"w-4 h-4"})})]})]})]})}function fs({profileName:s,target:a,data:t}){const d=a==="droid";return e.jsx(K,{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(ts,{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(D,{value:t.path,size:"icon",className:"h-5 w-5"})]})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Last Modified"}),e.jsx("span",{className:"text-xs",children:new Date(t.mtime).toLocaleString()})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Default Target"}),e.jsx("span",{className:"font-mono",children:a})]})]})})]}),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(D,{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:d?"Droid alias (explicit)":"Run on Droid"}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsx("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:d?`ccsd ${s} "prompt"`:`ccs ${s} --target droid "prompt"`}),e.jsx(D,{value:d?`ccsd ${s} "prompt"`:`ccs ${s} --target droid "prompt"`,size:"icon",className:"h-6 w-6"})]})]}),e.jsxs("div",{children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:d?"Override to Claude":"Override to Claude (explicit)"}),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,' --target claude "prompt"']}),e.jsx(D,{value:`ccs ${s} --target claude "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(D,{value:`ccs default ${s}`,size:"icon",className:"h-6 w-6"})]})]})]})]})]})})}function ps({value:s,onChange:a,placeholder:t="Search models...",className:d}){const[x,m]=o.useState(""),[f,l]=o.useState(null),{models:i,isLoading:u,isError:g,isFetching:O}=de(),b=Pe(),v=o.useMemo(()=>Re(i,x,{category:f??void 0}),[i,x,f]),j=o.useMemo(()=>De(i,2),[i]),w=!x.trim()&&!f,S=o.useMemo(()=>{const r={anthropic:[],openai:[],google:[],meta:[],mistral:[],opensource:[],other:[]};v.forEach(h=>{r[h.category].push(h)});for(const h of Object.keys(r))r[h]=Me(r[h]);return r},[v]),E=o.useCallback(()=>{b()},[b]),C=i.find(r=>r.id===s);return u&&i.length===0?e.jsxs("div",{className:_("space-y-2",d),children:[e.jsx(te,{className:"h-10 w-full"}),e.jsx(te,{className:"h-32 w-full"})]}):e.jsxs("div",{className:_("space-y-2 w-full min-w-0 overflow-hidden",d),children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(pe,{className:"text-muted-foreground absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2"}),e.jsx(A,{value:x,onChange:r=>m(r.target.value),placeholder:t,className:"pl-9"})]}),e.jsx(N,{variant:"outline",size:"icon",onClick:E,disabled:O,title:"Refresh models",children:O?e.jsx(F,{className:"h-4 w-4 animate-spin"}):e.jsx(z,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsxs(k,{variant:f===null?"default":"outline",className:"cursor-pointer",onClick:()=>l(null),children:["All (",i.length,")"]}),Object.keys(H).map(r=>{const h=S[r].length;return h===0?null:e.jsxs(k,{variant:f===r?"default":"outline",className:"cursor-pointer",onClick:()=>l(r),children:[H[r]," (",h,")"]},r)})]}),C&&e.jsxs("div",{className:"bg-muted rounded-md p-2 text-sm",children:[e.jsx("span",{className:"font-medium",children:C.name}),e.jsxs("span",{className:"text-muted-foreground ml-2",children:[Y(C.pricing)," |"," ",xe(C.context_length)]})]}),e.jsx(K,{className:"h-72 w-full rounded-md border",children:g?e.jsxs("div",{className:"text-destructive p-4 text-center",children:["Failed to load models."," ",e.jsx(N,{variant:"link",onClick:E,children:"Retry"})]}):v.length===0?e.jsxs("div",{className:"text-muted-foreground p-4 text-center",children:['No models found matching "',x,'"']}):e.jsxs("div",{className:"space-y-6 p-3",children:[w&&j.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(X,{className:"h-3 w-3 text-accent"}),e.jsx("span",{children:"Newest Models"})]}),e.jsx("div",{className:"space-y-1",children:j.map(r=>e.jsx(ce,{model:r,isSelected:r.id===s,onClick:()=>a(r.id),showAge:!0},r.id))})]}),Object.keys(H).map(r=>{const h=S[r];return h.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:H[r]}),e.jsx("div",{className:"space-y-1",children:h.map(n=>e.jsx(ce,{model:n,isSelected:n.id===s,onClick:()=>a(n.id)},n.id))})]},r)})]})})]})}function ce({model:s,isSelected:a,onClick:t,showAge:d=!1}){return e.jsxs("button",{type:"button",onClick:t,className:_("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",a&&"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:_("flex shrink-0 items-center gap-1 text-xs whitespace-nowrap",a?"text-accent-foreground/80":"text-muted-foreground group-hover:text-accent-foreground/80"),children:[d&&s.created&&e.jsx(k,{variant:"outline",className:_("text-[10px] px-1",a?"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:Le(s.created)}),s.isFree?e.jsx(k,{variant:"secondary",className:_("text-[10px] px-1",a?"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(k,{variant:"outline",className:_("text-[10px] px-1 border-emerald-500/50 text-emerald-600",a?"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:Y(s.pricing)})]}):e.jsx("span",{className:"tabular-nums",children:Y(s.pricing)}),e.jsx("span",{className:"tabular-nums",children:xe(s.context_length)})]})]})}function gs({selectedModel:s,value:a,onChange:t,className:d}){const{models:x}=de(),m=o.useMemo(()=>s?Ie(s,x):{},[s,x]),f=()=>{t(m)},l=(u,g)=>{t({...a,[u]:g||void 0})},i=s&&Object.keys(m).length>0;return e.jsxs(me,{className:_("group",d),children:[e.jsxs(ue,{className:"flex items-center gap-2 text-sm font-medium hover:underline",children:[e.jsx(ge,{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(he,{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."}),i&&e.jsxs(N,{type:"button",variant:"outline",size:"sm",onClick:f,children:[e.jsx(as,{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(A,{id:"tier-opus",value:a.opus??"",onChange:u=>l("opus",u.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(A,{id:"tier-sonnet",value:a.sonnet??"",onChange:u=>l("sonnet",u.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(A,{id:"tier-haiku",value:a.haiku??"",onChange:u=>l("haiku",u.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 js({profileName:s,target:a,data:t,currentSettings:d,newEnvKey:x,newEnvValue:m,onNewEnvKeyChange:f,onNewEnvValueChange:l,onEnvValueChange:i,onAddEnvVar:u,onEnvBulkChange:g}){const O=we(d),b=d?.env,v=o.useMemo(()=>xs(b??{}),[b]),j=b??{},w=n=>{if(g){const P={...j,ANTHROPIC_MODEL:n,ANTHROPIC_DEFAULT_OPUS_MODEL:n,ANTHROPIC_DEFAULT_SONNET_MODEL:n,ANTHROPIC_DEFAULT_HAIKU_MODEL:n};g(P)}else i("ANTHROPIC_MODEL",n),i("ANTHROPIC_DEFAULT_OPUS_MODEL",n),i("ANTHROPIC_DEFAULT_SONNET_MODEL",n),i("ANTHROPIC_DEFAULT_HAIKU_MODEL",n);I.success("Applied model to all tiers",{duration:2e3})},S=n=>{if(g){const P=ms(j,n);g(P)}else n.opus!==void 0&&i("ANTHROPIC_DEFAULT_OPUS_MODEL",n.opus||""),n.sonnet!==void 0&&i("ANTHROPIC_DEFAULT_SONNET_MODEL",n.sonnet||""),n.haiku!==void 0&&i("ANTHROPIC_DEFAULT_HAIKU_MODEL",n.haiku||"")},[E,C]=o.useState(!1),r=new Set(["ANTHROPIC_AUTH_TOKEN"]),h=Object.entries(j).filter(([n])=>!r.has(n));return e.jsx("div",{className:"h-full w-full min-w-0 flex flex-col",children:e.jsxs(Ue,{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(He,{className:"w-full",children:[e.jsx(ae,{value:"env",className:"flex-1",children:O?"Configuration":"Environment Variables"}),e.jsx(ae,{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(ne,{value:"env",className:"flex-1 mt-0 border-0 p-0 data-[state=inactive]:hidden flex flex-col overflow-hidden min-w-0",children:O?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(ps,{value:j.ANTHROPIC_MODEL,onChange:w,placeholder:"Search OpenRouter models..."})]}),e.jsx(gs,{selectedModel:j.ANTHROPIC_MODEL,value:v,onChange:S}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(T,{className:"text-sm font-medium",children:"API Key"}),e.jsx(Ce,{value:j.ANTHROPIC_AUTH_TOKEN||"",onChange:n=>i("ANTHROPIC_AUTH_TOKEN",n.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"})]})]}),h.length>0&&e.jsxs(me,{open:E,onOpenChange:C,children:[e.jsxs(ue,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors group",children:[e.jsx(ge,{className:_("h-4 w-4 transition-transform",E&&"rotate-90")}),e.jsx(ns,{className:"h-4 w-4"}),e.jsx("span",{children:"Additional Variables"}),e.jsxs("span",{className:"text-xs font-normal opacity-70",children:["(",h.length,")"]})]}),e.jsx(he,{className:"pt-4",children:e.jsx("div",{className:"space-y-3 border rounded-lg p-3 bg-muted/30",children:h.map(([n,P])=>e.jsxs("div",{className:"space-y-1",children:[e.jsx(T,{className:"text-xs text-muted-foreground",children:n}),e.jsx(A,{value:P,onChange:M=>i(n,M.target.value),className:"font-mono text-xs h-8"})]},n))})})]})]})}),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(A,{placeholder:"VARIABLE_NAME",value:x,onChange:n=>f(n.target.value.toUpperCase()),className:"font-mono text-sm h-8 w-2/5",onKeyDown:n=>n.key==="Enter"&&x.trim()&&u()}),e.jsx(A,{placeholder:"value",value:m,onChange:n=>l(n.target.value),className:"font-mono text-sm h-8 flex-1",onKeyDown:n=>n.key==="Enter"&&x.trim()&&u()}),e.jsx(N,{variant:"outline",size:"sm",className:"h-8",onClick:u,disabled:!x.trim(),children:e.jsx($,{className:"w-4 h-4"})})]})]})]}):e.jsx(hs,{currentSettings:d,newEnvKey:x,newEnvValue:m,onNewEnvKeyChange:f,onNewEnvValueChange:l,onEnvValueChange:i,onAddEnvVar:u})}),e.jsx(ne,{value:"info",className:"h-full mt-0 border-0 p-0 data-[state=inactive]:hidden",children:e.jsx(fs,{profileName:s,target:a,data:t})})]})]})})}function Ns({profileName:s,profileTarget:a,onDelete:t,onHasChangesUpdate:d}){const[x,m]=o.useState({}),[f,l]=o.useState(!1),[i,u]=o.useState(null),[g,O]=o.useState(""),[b,v]=o.useState(""),j=We(),{data:w,isLoading:S,isError:E,refetch:C}=Xe({queryKey:["settings",s],queryFn:async()=>{const c=await fetch(`/api/settings/${s}/raw`);if(!c.ok)throw new Error(`Failed to load settings: ${c.status}`);return c.json()}}),r=w?.settings,h=o.useMemo(()=>{if(i!==null)try{return JSON.parse(i)}catch{}if(r)return{...r,env:{...r.env,...x}}},[r,x,i]),n=o.useMemo(()=>i!==null?i:r?JSON.stringify(r,null,2):"",[i,r]),P=o.useCallback(c=>{u(c)},[]),M=(c,y)=>{const R={...h?.env||{},[c]:y};m(L=>({...L,[c]:y})),u(JSON.stringify({...h,env:R},null,2))},J=c=>{const y={...h?.env||{},...c};m(R=>({...R,...c})),u(JSON.stringify({...h,env:y},null,2))},p=()=>{if(!g.trim())return;const c=g.trim(),y=b,R={...h?.env||{},[c]:y};m(L=>({...L,[c]:y})),u(JSON.stringify({...h,env:R},null,2)),O(""),v("")},Z=o.useMemo(()=>{try{return JSON.parse(n),!0}catch{return!1}},[n]),B=o.useMemo(()=>i!==null?i!==JSON.stringify(r,null,2):Object.keys(x).length>0,[i,x,r]),ye=o.useMemo(()=>{const c=["ANTHROPIC_BASE_URL","ANTHROPIC_AUTH_TOKEN"],y=h?.env||{};return c.filter(R=>!y[R]?.trim())},[h]);o.useEffect(()=>{d?.(B)},[B,d]);const U=re({mutationFn:async()=>{let c;try{c=JSON.parse(n)}catch{c={...w?.settings,env:{...w?.settings?.env,...x}}}const y=await fetch(`/api/settings/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:c,expectedMtime:w?.mtime})});if(y.status===409)throw new Error("CONFLICT");if(!y.ok)throw new Error("Failed to save");return y.json()},onSuccess:()=>{j.invalidateQueries({queryKey:["settings",s]}),j.invalidateQueries({queryKey:["profiles"]}),m({}),u(null),I.success("Settings saved")},onError:c=>{c.message==="CONFLICT"?l(!0):I.error(c.message)}}),Q=re({mutationFn:async c=>(await $e.profiles.update(s,{target:c}),c),onSuccess:()=>{j.invalidateQueries({queryKey:["profiles"]}),I.success("Default target updated")},onError:(c,y)=>{const R=y==="droid"?"Factory Droid":"Claude Code",L=c.message.trim()?`: ${c.message}`:"";I.error(`Failed to update default target to ${R}${L}`)}}),q=a||"claude",V=U.isPending||Q.isPending,ee=async c=>{l(!1),c?(await C(),U.mutate()):(m({}),u(null))};return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx(us,{profileName:s,target:q,data:w,settings:h,isLoading:S,isSaving:U.isPending,isTargetSaving:Q.isPending,hasChanges:B,isRawJsonValid:Z,onTargetChange:c=>{V||c!==q&&Q.mutate(c)},onRefresh:()=>{V||C()},onDelete:t,onSave:()=>{V||U.mutate()}}),S?e.jsxs("div",{className:"flex-1 flex items-center justify-center",children:[e.jsx(F,{className:"w-8 h-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"Loading settings..."})]}):E?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(N,{variant:"outline",size:"sm",onClick:()=>C(),children:[e.jsx(z,{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(js,{profileName:s,target:q,data:w,currentSettings:h,newEnvKey:g,newEnvValue:b,onNewEnvKeyChange:O,onNewEnvValueChange:v,onEnvValueChange:M,onEnvBulkChange:J,onAddEnvVar:p})}),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(rs,{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(Fe,{rawJsonContent:n,isRawJsonValid:Z,rawJsonEdits:i,settings:r,onChange:P,missingRequiredFields:ye})]})]}),e.jsx(G,{open:f,title:"File Modified Externally",description:"Overwrite with your changes or discard?",confirmText:"Overwrite",variant:"destructive",onConfirm:()=>ee(!0),onCancel:()=>ee(!1)})]},s)}const oe="ccs:openrouter-banner-dismissed";function vs({onCreateClick:s}){const[a,t]=o.useState(!0),{modelCount:d,isLoading:x}=W();o.useEffect(()=>{const f=localStorage.getItem(oe)==="true";t(f)},[]);const m=()=>{localStorage.setItem(oe,"true"),t(!0)};return a?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(X,{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 ",x?"300+":`${d}+`," models from OpenAI, Anthropic, Google, Meta and more."]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s&&e.jsx(N,{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(je,{className:"w-3 h-3"})]}),e.jsxs(N,{size:"icon",variant:"ghost",onClick:m,className:"h-7 w-7 text-white/70 hover:text-white hover:bg-white/20",children:[e.jsx(is,{className:"w-4 h-4"}),e.jsx("span",{className:"sr-only",children:"Dismiss"})]})]})]})})}function bs({onOpenRouterClick:s,onCustomClick:a}){const{modelCount:t,isLoading:d}=W();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(Ke,{className:"border-accent/30 dark:border-accent/40 bg-gradient-to-br from-accent/5 to-background dark:from-accent/10",children:[e.jsxs(ze,{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(k,{variant:"secondary",className:"bg-accent/10 text-accent dark:bg-accent/20 dark:text-accent-foreground",children:"Recommended"})]}),e.jsx(Je,{className:"text-xl",children:"Start with OpenRouter"}),e.jsxs(Be,{className:"text-base",children:["Access ",d?"300+":`${t}+`," models from OpenAI, Anthropic, Google, Meta and more - all through one API."]})]}),e.jsxs(Qe,{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(Ne,{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(X,{className:"w-4 h-4 text-accent"}),e.jsx("span",{children:"Model tier mapping"})]})]}),e.jsxs(N,{onClick:s,className:"w-full bg-accent hover:bg-accent/90 text-white",size:"lg",children:["Create OpenRouter Profile",e.jsx(ls,{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(je,{className:"w-3 h-3"})]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(ie,{className:"flex-1"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"or"}),e.jsx(ie,{className:"flex-1"})]}),e.jsx(N,{variant:"outline",onClick:a,className:"w-full",children:"Create Custom API Profile"})]})})}function ws({onCreateClick:s}){const{modelCount:a,isLoading:t}=W();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:[t?"300+":`${a}+`," models available"]})]}),e.jsxs(N,{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(Ne,{className:"w-3 h-3 mr-1"}),e.jsx("span",{className:"text-xs",children:"Add"})]})]})})}function Ls(){const{data:s,isLoading:a,isError:t,refetch:d}=qe(),x=Ve(),[m,f]=o.useState(null),[l,i]=o.useState(""),[u,g]=o.useState(!1),[O,b]=o.useState("normal"),[v,j]=o.useState(null),[w,S]=o.useState(!1),[E,C]=o.useState(null);Ye();const r=o.useMemo(()=>s?.profiles||[],[s?.profiles]),h=o.useMemo(()=>r.filter(p=>p.name.toLowerCase().includes(l.toLowerCase())),[r,l]),n=m?r.find(p=>p.name===m):null,P=p=>{x.mutate(p,{onSuccess:()=>{m===p&&f(null),j(null)}})},M=p=>{g(!1),w&&m!==null?C(p):f(p)},J=p=>{w&&m!==p?C(p):f(p)};return e.jsxs("div",{className:"h-[calc(100vh-100px)] flex flex-col",children:[e.jsx(vs,{onCreateClick:()=>g(!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(cs,{className:"w-5 h-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:"API Profiles"})]}),e.jsxs(N,{size:"sm",onClick:()=>{g(!0)},children:[e.jsx($,{className:"w-4 h-4 mr-1"}),"New"]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(pe,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(A,{placeholder:"Search profiles...",className:"pl-8 h-9",value:l,onChange:p=>i(p.target.value)})]})]}),e.jsx(K,{className:"flex-1",children:a?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Loading profiles..."}):t?e.jsx("div",{className:"p-4 text-center",children:e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(ve,{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(N,{size:"sm",variant:"outline",onClick:()=>d(),children:[e.jsx(z,{className:"w-4 h-4 mr-1"}),"Retry"]})]})}):h.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(os,{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(N,{size:"sm",variant:"outline",onClick:()=>{g(!0)},children:[e.jsx($,{className:"w-4 h-4 mr-1"}),"Create Profile"]})]}):e.jsxs("p",{className:"text-sm text-muted-foreground py-4",children:['No profiles match "',l,'"']})}):e.jsx("div",{className:"p-2 space-y-1",children:h.map(p=>e.jsx(Cs,{profile:p,isSelected:m===p.name,onSelect:()=>J(p.name),onDelete:()=>j(p.name)},p.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(be,{className:"w-3 h-3 text-green-600"}),r.filter(p=>p.configured).length," configured"]})]})}),e.jsx(ws,{onCreateClick:()=>{b("openrouter"),g(!0)}})]}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0",children:n?e.jsx(Ns,{profileName:n.name,profileTarget:n.target,onDelete:()=>j(n.name),onHasChangesUpdate:S},n.name):e.jsx(bs,{onOpenRouterClick:()=>{b("openrouter"),g(!0)},onCustomClick:()=>{b("normal"),g(!0)}})})]}),e.jsx(Ge,{open:u,onOpenChange:g,onSuccess:M,initialMode:O}),e.jsx(G,{open:!!v,title:"Delete Profile",description:`Are you sure you want to delete "${v}"? This will remove the settings file and cannot be undone.`,confirmText:"Delete",variant:"destructive",onConfirm:()=>v&&P(v),onCancel:()=>j(null)}),e.jsx(G,{open:!!E,title:"Unsaved Changes",description:`You have unsaved changes in "${m}". Discard and switch to "${E}"?`,confirmText:"Discard & Switch",variant:"destructive",onConfirm:()=>{S(!1),f(E),C(null)},onCancel:()=>C(null)})]})}function Cs({profile:s,isSelected:a,onSelect:t,onDelete:d}){return e.jsxs("div",{className:_("group flex items-center gap-2 px-3 py-2.5 rounded-md cursor-pointer transition-colors",a?"bg-primary/10 border border-primary/20":"hover:bg-muted border border-transparent"),onClick:t,children:[s.configured?e.jsx(be,{className:"w-4 h-4 text-green-600 shrink-0"}):e.jsx(ve,{className:"w-4 h-4 text-yellow-600 shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:s.name}),e.jsx(k,{variant:"outline",className:"text-[10px] h-4 px-1.5 uppercase",children:s.target||"claude"})]}),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(D,{value:s.settingsPath,size:"icon",className:"h-5 w-5 opacity-0 group-hover:opacity-100 transition-opacity"})]})]}),e.jsx(N,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:x=>{x.stopPropagation(),d()},children:e.jsx(fe,{className:"w-3.5 h-3.5 text-destructive"})})]})}export{Ls as ApiPage};
@@ -1 +0,0 @@
1
- import{j as e}from"./radix-ui-C1Gpgz6I.js";import{r as t}from"./react-vendor-CNOkPC89.js";import{bd as Q,b4 as V,b6 as W,m as X,I as S,b as i}from"./index-DNFjYwGe.js";import{R as A,a2 as Y,r as Z,l as _,E,e as K,k as T,m as P,az as ee,a1 as se,w as ae,ai as te}from"./icons-DrewC9c3.js";import"./tanstack-DDJIhNJd.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";function he(){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),[w,z]=t.useState(!1),[m,j]=t.useState(null),[d,N]=t.useState(null),[L,C]=t.useState(!1),[U,b]=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=m!==null&&m!==a?.apiKey.value,l=d!==null&&d!==a?.managementSecret.value;if(!(!s&&!l))try{c(!0),r(null);const h={};s&&(h.apiKey=m),l&&(h.managementSecret=d);const k=await fetch("/api/settings/auth/tokens",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(h)});if(!k.ok){const H=await k.json();throw new Error(H.error||"Failed to save tokens")}f("Tokens updated. Restart CLIProxy to apply."),j(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)}},D=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."),j(null),N(null),await u(),await o()}catch(s){r(s instanceof Error?s.message:"Unknown error")}finally{c(!1)}},$=async()=>{a&&(await navigator.clipboard.writeText(a.apiKey.value),C(!0),setTimeout(()=>C(!1),2e3))},M=async()=>{a&&(await navigator.clipboard.writeText(a.managementSecret.value),b(!0),setTimeout(()=>b(!1),2e3))},q=async()=>{g||n||(r(null),f(null),await Promise.all([u(),o()]))};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(A,{className:"w-5 h-5 animate-spin"}),e.jsx("span",{children:"Loading..."})]})});const B=m??a.apiKey.value,G=d??a.managementSecret.value,J=m!==null&&m!==a.apiKey.value||d!==null&&d!==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(V,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(Y,{className:"h-4 w-4"}),e.jsx(W,{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(Z,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:p})]})]}),e.jsx(X,{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(_,{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(S,{type:y?"text":"password",value:B,onChange:s=>j(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(E,{className:"w-4 h-4"}):e.jsx(K,{className:"w-4 h-4"})}),e.jsx(i,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:$,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(ee,{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(S,{type:w?"text":"password",value:G,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(!w),children:w?e.jsx(E,{className:"w-4 h-4"}):e.jsx(K,{className:"w-4 h-4"})}),e.jsx(i,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:M,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(se,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"pt-4 border-t",children:[e.jsxs(i,{variant:"outline",size:"sm",onClick:D,disabled:n||!a.apiKey.isCustom&&!a.managementSecret.isCustom,className:"gap-2",children:[e.jsx(ae,{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:q,disabled:g||n,className:"flex-1",children:[e.jsx(A,{className:`w-4 h-4 mr-2 ${g?"animate-spin":""}`}),"Refresh"]}),e.jsxs(i,{variant:"default",size:"sm",onClick:F,disabled:!J||n,className:"flex-1",children:[e.jsx(te,{className:`w-4 h-4 mr-2 ${n?"animate-pulse":""}`}),n?"Saving...":"Save"]})]})]})}export{he as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./radix-ui-C1Gpgz6I.js";import{r as t}from"./react-vendor-CNOkPC89.js";import{bd as R,m as w,S as a,C as f,b4 as S,b6 as E,B as D,b as y}from"./index-DNFjYwGe.js";import{A as B,a as T,b as O,c as _,d as F,e as U,f as I,g as L}from"./alert-dialog-B_Bdo2ou.js";import{a2 as z,r as P,a6 as k,q as $,w as M,R as Y}from"./icons-DrewC9c3.js";import"./tanstack-DDJIhNJd.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Cn_Uld6y.js";import"./code-highlight-BRUf_pqB.js";const q=3e3,H=5e3;function te(){const{fetchRawConfig:x}=R(),c=t.useRef(null),m=t.useRef(null),[j,v]=t.useState([]),[h,g]=t.useState(!0),[d,N]=t.useState(null),[n,l]=t.useState(null),[i,b]=t.useState(null),[u,p]=t.useState(null),o=t.useCallback(async()=>{c.current?.abort(),c.current=new AbortController;try{g(!0),l(null);const s=await fetch("/api/persist/backups",{signal:c.current.signal});if(!s.ok)throw new Error("Failed to fetch backups");const r=await s.json();v(r.backups||[])}catch(s){if(s instanceof Error&&s.name==="AbortError")return;l(s instanceof Error?s.message:"Unknown error")}finally{g(!1)}},[]),C=t.useCallback(async s=>{m.current?.abort(),m.current=new AbortController;try{N(s),l(null);const r=await fetch("/api/persist/restore",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({timestamp:s}),signal:m.current.signal});if(!r.ok){const A=await r.json();throw new Error(A.error||"Failed to restore backup")}b("Backup restored successfully"),await o(),await x()}catch(r){if(r instanceof Error&&r.name==="AbortError")return;l(r instanceof Error?r.message:"Unknown error")}finally{N(null)}},[o,x]);return t.useEffect(()=>{o()},[o]),t.useEffect(()=>()=>{c.current?.abort(),m.current?.abort()},[]),t.useEffect(()=>{if(i){const s=setTimeout(()=>b(null),q);return()=>clearTimeout(s)}},[i]),t.useEffect(()=>{if(n){const s=setTimeout(()=>l(null),H);return()=>clearTimeout(s)}},[n]),h?e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{className:"h-6 w-40"}),e.jsx(a,{className:"h-4 w-full"})]}),[1,2,3].map(s=>e.jsx(f,{className:"p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(a,{className:"h-4 w-32"}),e.jsx(a,{className:"h-3 w-48"})]}),e.jsx(a,{className:"h-8 w-20"})]})},s))]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsx(a,{className:"h-9 w-full"})})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`absolute left-5 right-5 top-20 z-10 transition-all duration-200 ease-out ${n||i?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,children:[n&&e.jsxs(S,{variant:"destructive",className:"py-2 shadow-lg",children:[e.jsx(z,{className:"h-4 w-4"}),e.jsx(E,{children:n})]}),i&&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(P,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"text-sm font-medium",children:i})]})]}),e.jsx(w,{className:"flex-1",children:e.jsxs("div",{className:"p-5 space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(k,{className:"w-5 h-5 text-primary"}),e.jsx("h2",{className:"text-lg font-semibold",children:"Settings Backups"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Restore previous versions of your settings.json file. Backups are created automatically when settings are modified."})]}),j.length===0?e.jsx(f,{className:"p-8",children:e.jsxs("div",{className:"text-center",children:[e.jsx(k,{className:"w-12 h-12 mx-auto mb-3 opacity-30 text-muted-foreground"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No backups available"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Backups will appear here when you modify settings"})]})}):e.jsx("div",{className:"space-y-2",children:j.map((s,r)=>e.jsx(f,{className:"p-4 hover:bg-muted/50 transition-colors",children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[e.jsx($,{className:"w-4 h-4 text-muted-foreground mt-0.5 shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("p",{className:"text-sm font-medium font-mono",children:s.timestamp}),r===0&&e.jsx(D,{variant:"secondary",className:"text-xs",children:"Latest"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.date})]})]}),e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>p(s.timestamp),disabled:d!==null,className:"gap-2 shrink-0",children:[e.jsx(M,{className:`w-4 h-4 ${d===s.timestamp?"animate-spin":""}`}),d===s.timestamp?"Restoring...":"Restore"]})]})},s.timestamp))})]})}),e.jsx("div",{className:"p-4 border-t bg-background",children:e.jsxs(y,{variant:"outline",size:"sm",onClick:()=>{o(),x()},disabled:h||d!==null,className:"w-full",children:[e.jsx(Y,{className:`w-4 h-4 mr-2 ${h?"animate-spin":""}`}),"Refresh"]})}),e.jsx(B,{open:!!u,onOpenChange:()=>p(null),children:e.jsxs(T,{children:[e.jsxs(O,{children:[e.jsx(_,{children:"Restore Backup?"}),e.jsxs(F,{children:["This will replace your current settings with backup from"," ",e.jsx("code",{className:"font-mono bg-muted px-1.5 py-0.5 rounded text-foreground",children:u}),". This action cannot be undone."]})]}),e.jsxs(U,{children:[e.jsx(I,{children:"Cancel"}),e.jsx(L,{onClick:()=>{u&&C(u),p(null)},children:"Restore"})]})]})})]})}export{te as default};