@kaitranntt/ccs 7.50.0-dev.9 → 7.51.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/ccs.js +22 -6
- package/dist/ccs.js.map +1 -1
- package/dist/commands/help-command.d.ts.map +1 -1
- package/dist/commands/help-command.js +14 -0
- package/dist/commands/help-command.js.map +1 -1
- package/dist/delegation/headless-executor.d.ts.map +1 -1
- package/dist/delegation/headless-executor.js +4 -1
- package/dist/delegation/headless-executor.js.map +1 -1
- package/dist/targets/droid-command-router.d.ts +26 -0
- package/dist/targets/droid-command-router.d.ts.map +1 -0
- package/dist/targets/droid-command-router.js +240 -0
- package/dist/targets/droid-command-router.js.map +1 -0
- package/dist/ui/assets/{accounts-y2u0CVK8.js → accounts-p8Gb9myI.js} +1 -1
- package/dist/ui/assets/{alert-dialog-CetY4Iww.js → alert-dialog-B_Bdo2ou.js} +1 -1
- package/dist/ui/assets/{api-5q1FT1uL.js → api-Bw82I4NV.js} +1 -1
- package/dist/ui/assets/{auth-section-CaQeee-F.js → auth-section-CswwM0bu.js} +1 -1
- package/dist/ui/assets/{backups-section-hF88BjYJ.js → backups-section-6slvPh7p.js} +1 -1
- package/dist/ui/assets/{checkbox-Dhm5Fzkb.js → checkbox-D19h9xqD.js} +1 -1
- package/dist/ui/assets/{cliproxy-BeYNWmY_.js → cliproxy-BxWh_a8E.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-CJELeI80.js → cliproxy-control-panel-BEaTM1tV.js} +1 -1
- package/dist/ui/assets/{confirm-dialog-Dn3SrwNV.js → confirm-dialog-7-N-o1DD.js} +1 -1
- package/dist/ui/assets/{copilot-vwT-4_V4.js → copilot-C2ADI_mS.js} +1 -1
- package/dist/ui/assets/{cursor-CN3lIX63.js → cursor-BzUnxDMC.js} +1 -1
- package/dist/ui/assets/{droid-DBP2yCY7.js → droid-BOC3J2_I.js} +1 -1
- package/dist/ui/assets/{globalenv-section-DNKAJasL.js → globalenv-section-Caco9nNS.js} +1 -1
- package/dist/ui/assets/{health-C7tNiLzc.js → health-Cn_YNAry.js} +1 -1
- package/dist/ui/assets/{index-MGh88HoC.js → index-0LBl1v7D.js} +1 -1
- package/dist/ui/assets/{index-C8-ef-r7.js → index-B_ON5mBa.js} +1 -1
- package/dist/ui/assets/{index-QBUSDLTx.js → index-CVKOwyBR.js} +1 -1
- package/dist/ui/assets/index-Ck953xpy.css +1 -0
- package/dist/ui/assets/{index-uYnNU6Ut.js → index-CnAQ8t2b.js} +1 -1
- package/dist/ui/assets/{index-k-HuyjpO.js → index-DNFjYwGe.js} +9 -9
- package/dist/ui/assets/{proxy-status-widget-CIm5vKY7.js → proxy-status-widget-B31OXK00.js} +1 -1
- package/dist/ui/assets/{separator-BLVyAGAm.js → separator-51ocJFnp.js} +1 -1
- package/dist/ui/assets/{shared-CHH09ZNi.js → shared-k-J_KXcM.js} +1 -1
- package/dist/ui/assets/{switch-CwLyB4JK.js → switch-B3t2TDvW.js} +1 -1
- package/dist/ui/assets/{updates-VlxL3aum.js → updates-CYChhYqV.js} +1 -1
- package/dist/ui/index.html +2 -2
- package/dist/utils/shell-executor.d.ts +5 -0
- package/dist/utils/shell-executor.d.ts.map +1 -1
- package/dist/utils/shell-executor.js +22 -3
- package/dist/utils/shell-executor.js.map +1 -1
- package/lib/hooks/websearch-transformer.cjs +78 -52
- package/package.json +1 -1
- package/dist/ui/assets/index-s-oTl3hW.css +0 -1
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Droid command router
|
|
4
|
+
*
|
|
5
|
+
* Determines whether profile args should launch Droid interactive mode
|
|
6
|
+
* (`droid [prompt...]`) or command mode (`droid <subcommand> ...`).
|
|
7
|
+
*
|
|
8
|
+
* Also normalizes CCS legacy reasoning aliases for `droid exec`:
|
|
9
|
+
* - --effort / --thinking -> --reasoning-effort
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.routeDroidCommandArgs = exports.DroidCommandRouterError = void 0;
|
|
13
|
+
class DroidCommandRouterError extends Error {
|
|
14
|
+
constructor(message, flag) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.flag = flag;
|
|
17
|
+
this.name = 'DroidCommandRouterError';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.DroidCommandRouterError = DroidCommandRouterError;
|
|
21
|
+
const DROID_SUBCOMMANDS = new Set([
|
|
22
|
+
'exec',
|
|
23
|
+
'mcp',
|
|
24
|
+
'plugin',
|
|
25
|
+
'daemon',
|
|
26
|
+
'search',
|
|
27
|
+
'find',
|
|
28
|
+
'ssh',
|
|
29
|
+
'computer',
|
|
30
|
+
'update',
|
|
31
|
+
'help',
|
|
32
|
+
]);
|
|
33
|
+
// Exec-only long flags from Factory Droid CLI help.
|
|
34
|
+
const DROID_EXEC_ONLY_LONG_FLAGS = new Set([
|
|
35
|
+
'--output-format',
|
|
36
|
+
'--input-format',
|
|
37
|
+
'--file',
|
|
38
|
+
'--auto',
|
|
39
|
+
'--skip-permissions-unsafe',
|
|
40
|
+
'--session-id',
|
|
41
|
+
'--model',
|
|
42
|
+
'--reasoning-effort',
|
|
43
|
+
'--enabled-tools',
|
|
44
|
+
'--disabled-tools',
|
|
45
|
+
'--cwd',
|
|
46
|
+
'--tag',
|
|
47
|
+
'--log-group-id',
|
|
48
|
+
'--list-tools',
|
|
49
|
+
]);
|
|
50
|
+
const DROID_EXEC_ONLY_SHORT_FLAGS = new Set(['-o', '-f', '-s', '-m']);
|
|
51
|
+
const DROID_REASONING_EFFORT_VALUES = new Set([
|
|
52
|
+
'none',
|
|
53
|
+
'off',
|
|
54
|
+
'minimal',
|
|
55
|
+
'low',
|
|
56
|
+
'medium',
|
|
57
|
+
'high',
|
|
58
|
+
'max',
|
|
59
|
+
'xhigh',
|
|
60
|
+
'auto',
|
|
61
|
+
]);
|
|
62
|
+
function getLongFlagToken(arg) {
|
|
63
|
+
const eqIndex = arg.indexOf('=');
|
|
64
|
+
return eqIndex >= 0 ? arg.slice(0, eqIndex) : arg;
|
|
65
|
+
}
|
|
66
|
+
function isExplicitSubcommand(arg) {
|
|
67
|
+
return !!arg && DROID_SUBCOMMANDS.has(arg);
|
|
68
|
+
}
|
|
69
|
+
function isLikelyReasoningEffortValue(value) {
|
|
70
|
+
if (!value || value.startsWith('-'))
|
|
71
|
+
return false;
|
|
72
|
+
return DROID_REASONING_EFFORT_VALUES.has(value.toLowerCase());
|
|
73
|
+
}
|
|
74
|
+
function hasExecOnlyFlagsAtFront(args) {
|
|
75
|
+
for (let i = 0; i < args.length; i++) {
|
|
76
|
+
const arg = args[i];
|
|
77
|
+
if (arg === '--')
|
|
78
|
+
return false;
|
|
79
|
+
// CCS legacy aliases may appear before exec-only flags; skip their values when present.
|
|
80
|
+
if (arg === '--effort' || arg === '--thinking') {
|
|
81
|
+
const possibleValue = args[i + 1];
|
|
82
|
+
if (possibleValue && !possibleValue.startsWith('-')) {
|
|
83
|
+
i += 1;
|
|
84
|
+
}
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
if (arg.startsWith('--effort=') || arg.startsWith('--thinking=')) {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (!arg.startsWith('-'))
|
|
91
|
+
return false;
|
|
92
|
+
if (!arg.startsWith('--')) {
|
|
93
|
+
// Short flags:
|
|
94
|
+
// - `-r` is ambiguous (root resume vs exec reasoning-effort), so only route
|
|
95
|
+
// when value looks like a reasoning effort level.
|
|
96
|
+
if (DROID_EXEC_ONLY_SHORT_FLAGS.has(arg)) {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
if (arg === '-r') {
|
|
100
|
+
const value = args[i + 1];
|
|
101
|
+
return isLikelyReasoningEffortValue(value);
|
|
102
|
+
}
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
const flagToken = getLongFlagToken(arg);
|
|
106
|
+
if (DROID_EXEC_ONLY_LONG_FLAGS.has(flagToken)) {
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
function normalizeExecReasoningFlags(args) {
|
|
113
|
+
const normalized = [];
|
|
114
|
+
const duplicateDisplays = [];
|
|
115
|
+
let sourceDisplay;
|
|
116
|
+
let hasReasoning = false;
|
|
117
|
+
const applyReasoning = (value, display) => {
|
|
118
|
+
if (!hasReasoning) {
|
|
119
|
+
normalized.push('--reasoning-effort', value);
|
|
120
|
+
hasReasoning = true;
|
|
121
|
+
sourceDisplay = display;
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
duplicateDisplays.push(display);
|
|
125
|
+
};
|
|
126
|
+
const handleMissingValue = (flag, missingDisplay) => {
|
|
127
|
+
if (!hasReasoning) {
|
|
128
|
+
throw new DroidCommandRouterError(`${flag} requires a value`, flag);
|
|
129
|
+
}
|
|
130
|
+
duplicateDisplays.push(missingDisplay);
|
|
131
|
+
return undefined;
|
|
132
|
+
};
|
|
133
|
+
// Preserve leading command token for explicit auto-prepended command mode.
|
|
134
|
+
const startsWithExec = args[0] === 'exec';
|
|
135
|
+
let startIndex = 0;
|
|
136
|
+
if (startsWithExec) {
|
|
137
|
+
normalized.push('exec');
|
|
138
|
+
startIndex = 1;
|
|
139
|
+
}
|
|
140
|
+
for (let i = startIndex; i < args.length; i++) {
|
|
141
|
+
const arg = args[i];
|
|
142
|
+
if (arg === '--') {
|
|
143
|
+
normalized.push(...args.slice(i));
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
if (arg === '--reasoning-effort' ||
|
|
147
|
+
arg === '--effort' ||
|
|
148
|
+
arg === '--thinking' ||
|
|
149
|
+
arg === '-r') {
|
|
150
|
+
const value = args[i + 1];
|
|
151
|
+
if (!value || value.startsWith('-')) {
|
|
152
|
+
handleMissingValue(arg, `${arg} <missing-value>`);
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
applyReasoning(value, `${arg} ${value}`);
|
|
156
|
+
i += 1;
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
if (arg.startsWith('--reasoning-effort=')) {
|
|
160
|
+
const value = arg.slice('--reasoning-effort='.length);
|
|
161
|
+
if (!value) {
|
|
162
|
+
handleMissingValue('--reasoning-effort', '--reasoning-effort=<missing-value>');
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
applyReasoning(value, `--reasoning-effort=${value}`);
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
if (arg.startsWith('--effort=')) {
|
|
169
|
+
const value = arg.slice('--effort='.length);
|
|
170
|
+
if (!value) {
|
|
171
|
+
handleMissingValue('--effort', '--effort=<missing-value>');
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
applyReasoning(value, `--effort=${value}`);
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
if (arg.startsWith('--thinking=')) {
|
|
178
|
+
const value = arg.slice('--thinking='.length);
|
|
179
|
+
if (!value) {
|
|
180
|
+
handleMissingValue('--thinking', '--thinking=<missing-value>');
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
applyReasoning(value, `--thinking=${value}`);
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
normalized.push(arg);
|
|
187
|
+
}
|
|
188
|
+
return {
|
|
189
|
+
args: normalized,
|
|
190
|
+
sourceDisplay,
|
|
191
|
+
duplicateDisplays,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
function routeDroidCommandArgs(args) {
|
|
195
|
+
if (args.length === 0) {
|
|
196
|
+
return {
|
|
197
|
+
mode: 'interactive',
|
|
198
|
+
argsForDroid: [],
|
|
199
|
+
autoPrependedExec: false,
|
|
200
|
+
duplicateReasoningDisplays: [],
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
if (isExplicitSubcommand(args[0])) {
|
|
204
|
+
const command = args[0];
|
|
205
|
+
const normalized = command === 'exec'
|
|
206
|
+
? normalizeExecReasoningFlags(args)
|
|
207
|
+
: {
|
|
208
|
+
args: [...args],
|
|
209
|
+
duplicateDisplays: [],
|
|
210
|
+
};
|
|
211
|
+
return {
|
|
212
|
+
mode: 'command',
|
|
213
|
+
command,
|
|
214
|
+
argsForDroid: normalized.args,
|
|
215
|
+
autoPrependedExec: false,
|
|
216
|
+
reasoningSourceDisplay: normalized.sourceDisplay,
|
|
217
|
+
duplicateReasoningDisplays: normalized.duplicateDisplays,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
if (hasExecOnlyFlagsAtFront(args)) {
|
|
221
|
+
const argsWithExec = ['exec', ...args];
|
|
222
|
+
const normalized = normalizeExecReasoningFlags(argsWithExec);
|
|
223
|
+
return {
|
|
224
|
+
mode: 'command',
|
|
225
|
+
command: 'exec',
|
|
226
|
+
argsForDroid: normalized.args,
|
|
227
|
+
autoPrependedExec: true,
|
|
228
|
+
reasoningSourceDisplay: normalized.sourceDisplay,
|
|
229
|
+
duplicateReasoningDisplays: normalized.duplicateDisplays,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
return {
|
|
233
|
+
mode: 'interactive',
|
|
234
|
+
argsForDroid: [...args],
|
|
235
|
+
autoPrependedExec: false,
|
|
236
|
+
duplicateReasoningDisplays: [],
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
exports.routeDroidCommandArgs = routeDroidCommandArgs;
|
|
240
|
+
//# sourceMappingURL=droid-command-router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"droid-command-router.js","sourceRoot":"","sources":["../../src/targets/droid-command-router.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAeH,MAAa,uBAAwB,SAAQ,KAAK;IAChD,YACE,OAAe,EACC,IAAwB;QAExC,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,SAAI,GAAJ,IAAI,CAAoB;QAGxC,IAAI,CAAC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AE,SAAS;YACf,OAAO;YACP,YAAY,EAAE,UAAU,CAAC,IAAI;YAC7B,iBAAiB,EAAE,KAAK;YACxB,sBAAsB,EAAE,UAAU,CAAC,aAAa;YAChD,0BAA0B,EAAE,UAAU,CAAC,iBAAiB;SACzD,CAAC;IACJ,CAAC;IAED,IAAI,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;QACvC,MAAM,UAAU,GAAG,2BAA2B,CAAC,YAAY,CAAC,CAAC;QAC7D,OAAO;YACL,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,UAAU,CAAC,IAAI;YAC7B,iBAAiB,EAAE,IAAI;YACvB,sBAAsB,EAAE,UAAU,CAAC,aAAa;YAChD,0BAA0B,EAAE,UAAU,CAAC,iBAAiB;SACzD,CAAC;IACJ,CAAC;IAED,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,YAAY,EAAE,CAAC,GAAG,IAAI,CAAC;QACvB,iBAAiB,EAAE,KAAK;QACxB,0BAA0B,EAAE,EAAE;KAC/B,CAAC;AACJ,CAAC;AAhDD,sDAgDC"}
|
|
@@ -1 +1 @@
|
|
|
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-k-HuyjpO.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-CetY4Iww.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-Dhm5Fzkb.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
|
+
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 +1 @@
|
|
|
1
|
-
import{j as e,a4 as s,a5 as r,a6 as n,a7 as i,a8 as d,a9 as c,aa as u,ab as f}from"./radix-ui-C1Gpgz6I.js";import"./react-vendor-CNOkPC89.js";import{c as o,bl as l}from"./index-
|
|
1
|
+
import{j as e,a4 as s,a5 as r,a6 as n,a7 as i,a8 as d,a9 as c,aa as u,ab as f}from"./radix-ui-C1Gpgz6I.js";import"./react-vendor-CNOkPC89.js";import{c as o,bl as l}from"./index-DNFjYwGe.js";function A({...a}){return e.jsx(s,{"data-slot":"alert-dialog",...a})}function g({...a}){return e.jsx(u,{"data-slot":"alert-dialog-portal",...a})}function m({className:a,...t}){return e.jsx(f,{"data-slot":"alert-dialog-overlay",className:o("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",a),...t})}function D({className:a,...t}){return e.jsxs(g,{children:[e.jsx(m,{}),e.jsx(r,{"data-slot":"alert-dialog-content",className:o("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",a),...t})]})}function b({className:a,...t}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:o("flex flex-col gap-2 text-center sm:text-left",a),...t})}function N({className:a,...t}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:o("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",a),...t})}function v({className:a,...t}){return e.jsx(n,{"data-slot":"alert-dialog-title",className:o("text-lg font-semibold",a),...t})}function w({className:a,...t}){return e.jsx(i,{"data-slot":"alert-dialog-description",className:o("text-muted-foreground text-sm",a),...t})}function y({className:a,...t}){return e.jsx(c,{className:o(l(),a),...t})}function z({className:a,...t}){return e.jsx(d,{className:o(l({variant:"outline"}),a),...t})}export{A,D as a,b,v as c,w as d,N as e,z as f,y as g};
|