@i14ks/ccv 0.38.0 → 0.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/ccv.mjs +111 -28
- package/package.json +1 -1
- package/web/assets/{codemirror-B0NAQjxW.js → codemirror-DxtGDGFk.js} +1 -1
- package/web/assets/{index-XwIPGsoL.js → index-7ePJH0ro.js} +1 -1
- package/web/assets/{index-Cv6bq7Bb.js → index-B37sMj0O.js} +1 -1
- package/web/assets/{index-fSIv5wMF.js → index-BFDq9QAB.js} +1 -1
- package/web/assets/{index-Cg_JGWuj.js → index-BVT3q-Tt.js} +1 -1
- package/web/assets/{index-CO577SPK.css → index-BwKT4Ywt.css} +1 -1
- package/web/assets/{index-CHbY4Q8q.js → index-ByfO4I3S.js} +1 -1
- package/web/assets/{index-CF_pC8Hx.js → index-C2I0tlZW.js} +1 -1
- package/web/assets/{index-1MYdpgaD.js → index-C8qIDcIc.js} +1 -1
- package/web/assets/{index-DiyYHRov.js → index-CUvAPVSk.js} +1 -1
- package/web/assets/{index-DhdpnWaP.js → index-CYTeESKp.js} +1 -1
- package/web/assets/{index-pL68uIyG.js → index-Ce3CzqV9.js} +1 -1
- package/web/assets/{index-D24xx07T.js → index-CeQc1DVq.js} +1 -1
- package/web/assets/{index-LOhDu6-9.js → index-CkyUKgI0.js} +1 -1
- package/web/assets/{index-CA0PxYkA.js → index-CotBHbkI.js} +1 -1
- package/web/assets/index-CpfHiTlz.js +134 -0
- package/web/assets/{index-CswcCN2I.js → index-D6EEDkTZ.js} +1 -1
- package/web/assets/{index-BoyP7MYO.js → index-DpOYCClV.js} +1 -1
- package/web/assets/{index-B5iRbk6K.js → index-m4coFts1.js} +1 -1
- package/web/assets/{index-D71l3zbz.js → index-o26-Q-i0.js} +1 -1
- package/web/assets/{index-C7I7Qrgh.js → index-szPJRpmr.js} +1 -1
- package/web/assets/{index-DMq1FoW-.js → index-vBfnpOGr.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/index-wKK666LV.js +0 -134
package/bundle/ccv.mjs
CHANGED
|
@@ -189,7 +189,7 @@ function hashText(text) {
|
|
|
189
189
|
|
|
190
190
|
// ../host/dist/accounts.js
|
|
191
191
|
import { randomUUID } from "node:crypto";
|
|
192
|
-
import { lstat, mkdir, readFile as readFile2, rename, symlink, writeFile } from "node:fs/promises";
|
|
192
|
+
import { lstat, mkdir, readFile as readFile2, readdir, rename, stat, symlink, writeFile } from "node:fs/promises";
|
|
193
193
|
import { homedir as homedir2 } from "node:os";
|
|
194
194
|
import path3 from "node:path";
|
|
195
195
|
var MAIN_DEFAULT = {
|
|
@@ -210,7 +210,10 @@ var AccountStore = class {
|
|
|
210
210
|
const stored = (parsed.accounts ?? []).filter(isStored);
|
|
211
211
|
const main = stored.find((a) => a.id === MAIN_ACCOUNT_ID);
|
|
212
212
|
this.#accounts = [
|
|
213
|
-
{
|
|
213
|
+
{
|
|
214
|
+
...MAIN_DEFAULT,
|
|
215
|
+
...main ? { name: main.name, color: main.color, configDir: main.configDir } : {}
|
|
216
|
+
},
|
|
214
217
|
...stored.filter((a) => a.id !== MAIN_ACCOUNT_ID && a.configDir)
|
|
215
218
|
];
|
|
216
219
|
} catch {
|
|
@@ -222,22 +225,26 @@ var AccountStore = class {
|
|
|
222
225
|
find(id) {
|
|
223
226
|
return this.#accounts.find((a) => a.id === (id ?? MAIN_ACCOUNT_ID));
|
|
224
227
|
}
|
|
225
|
-
/** Каталог конфигурации
|
|
228
|
+
/** Каталог конфигурации аккаунта, заданный явно; null — унаследованный. */
|
|
226
229
|
configDir(id) {
|
|
227
230
|
return this.find(id)?.configDir ?? null;
|
|
228
231
|
}
|
|
232
|
+
/** Каталог, в который аккаунт смотрит на самом деле. */
|
|
233
|
+
effectiveDir(id) {
|
|
234
|
+
return this.find(id)?.configDir ?? inheritedDir();
|
|
235
|
+
}
|
|
229
236
|
async add(input) {
|
|
230
237
|
const name = cleanName(input.name);
|
|
231
238
|
const id = randomUUID().slice(0, 8);
|
|
232
239
|
const configDir = input.configDir?.trim() ? path3.resolve(input.configDir.trim()) : path3.join(homedir2(), `.claude-ccv-${id}`);
|
|
233
|
-
if (this.#accounts.some((a) => sameDir(a.
|
|
240
|
+
if (this.#accounts.some((a) => sameDir(this.effectiveDir(a.id), configDir))) {
|
|
234
241
|
throw new Error("\u042D\u0442\u043E\u0442 \u043A\u0430\u0442\u0430\u043B\u043E\u0433 \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0443\u0436\u0435 \u0437\u0430\u043D\u044F\u0442 \u0434\u0440\u0443\u0433\u0438\u043C \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u043E\u043C");
|
|
235
242
|
}
|
|
236
243
|
const color = input.color ?? this.#freeColor();
|
|
237
244
|
const account = { id, name, color, configDir };
|
|
238
245
|
await mkdir(configDir, { recursive: true });
|
|
239
246
|
if (input.shareConfig)
|
|
240
|
-
await linkSharedConfig(configDir);
|
|
247
|
+
await linkSharedConfig(configDir, this.effectiveDir(MAIN_ACCOUNT_ID));
|
|
241
248
|
this.#accounts = [...this.#accounts, account];
|
|
242
249
|
await this.#save();
|
|
243
250
|
return account;
|
|
@@ -246,6 +253,21 @@ var AccountStore = class {
|
|
|
246
253
|
const account = this.find(id);
|
|
247
254
|
if (!account)
|
|
248
255
|
throw new Error("\u0410\u043A\u043A\u0430\u0443\u043D\u0442 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D");
|
|
256
|
+
if (patch.configDir !== void 0) {
|
|
257
|
+
if (patch.configDir === null) {
|
|
258
|
+
if (account.id !== MAIN_ACCOUNT_ID)
|
|
259
|
+
throw new Error("\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u043A\u0430\u0442\u0430\u043B\u043E\u0433 \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438");
|
|
260
|
+
account.configDir = null;
|
|
261
|
+
} else {
|
|
262
|
+
const dir = path3.resolve(patch.configDir.trim());
|
|
263
|
+
if (!await isDirectory(dir))
|
|
264
|
+
throw new Error(`\u041A\u0430\u0442\u0430\u043B\u043E\u0433 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D: ${dir}`);
|
|
265
|
+
const taken = this.#accounts.find((a) => a.id !== account.id && sameDir(this.effectiveDir(a.id), dir));
|
|
266
|
+
if (taken)
|
|
267
|
+
throw new Error(`\u042D\u0442\u043E\u0442 \u043A\u0430\u0442\u0430\u043B\u043E\u0433 \u0443\u0436\u0435 \u0437\u0430\u043D\u044F\u0442 \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u043E\u043C \xAB${taken.name}\xBB`);
|
|
268
|
+
account.configDir = dir;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
249
271
|
if (patch.name !== void 0)
|
|
250
272
|
account.name = cleanName(patch.name);
|
|
251
273
|
if (patch.color !== void 0 && ACCOUNT_COLORS.includes(patch.color))
|
|
@@ -319,9 +341,8 @@ var SHARED_FILES = ["CLAUDE.md", "settings.json"];
|
|
|
319
341
|
function sharedConfigDir() {
|
|
320
342
|
return process.env.CCV_SHARED_CONFIG_DIR?.trim() || path3.join(homedir2(), ".claude-shared");
|
|
321
343
|
}
|
|
322
|
-
async function linkSharedConfig(configDir) {
|
|
344
|
+
async function linkSharedConfig(configDir, main = inheritedDir()) {
|
|
323
345
|
const shared = sharedConfigDir();
|
|
324
|
-
const main = inheritedDir();
|
|
325
346
|
await mkdir(shared, { recursive: true });
|
|
326
347
|
for (const name of [...SHARED_DIRS, ...SHARED_FILES]) {
|
|
327
348
|
const isDir = SHARED_DIRS.includes(name);
|
|
@@ -353,7 +374,29 @@ async function exists(file) {
|
|
|
353
374
|
return lstat(file).then(() => true, () => false);
|
|
354
375
|
}
|
|
355
376
|
async function isRealEntry(file) {
|
|
356
|
-
return lstat(file).then((
|
|
377
|
+
return lstat(file).then((stat3) => !stat3.isSymbolicLink(), () => false);
|
|
378
|
+
}
|
|
379
|
+
async function candidateConfigDirs() {
|
|
380
|
+
const home = homedir2();
|
|
381
|
+
const found = /* @__PURE__ */ new Set();
|
|
382
|
+
const add = async (dir) => {
|
|
383
|
+
if (!await isDirectory(dir))
|
|
384
|
+
return;
|
|
385
|
+
const marked = await exists(path3.join(dir, ".credentials.json")) || await exists(path3.join(dir, ".claude.json"));
|
|
386
|
+
if (marked)
|
|
387
|
+
found.add(path3.resolve(dir));
|
|
388
|
+
};
|
|
389
|
+
const skip = /* @__PURE__ */ new Set([".claude-shared", ".claude-code-visual", ".claude-code"]);
|
|
390
|
+
for (const name of await readdir(home).catch(() => [])) {
|
|
391
|
+
if (!/^\.claude(-.+)?$/.test(name) || skip.has(name))
|
|
392
|
+
continue;
|
|
393
|
+
await add(path3.join(home, name));
|
|
394
|
+
}
|
|
395
|
+
await add(inheritedDir());
|
|
396
|
+
return [...found];
|
|
397
|
+
}
|
|
398
|
+
async function isDirectory(file) {
|
|
399
|
+
return stat(file).then((s) => s.isDirectory(), () => false);
|
|
357
400
|
}
|
|
358
401
|
|
|
359
402
|
// ../host/dist/workspace-ids.js
|
|
@@ -448,7 +491,7 @@ var AsyncQueue = class {
|
|
|
448
491
|
};
|
|
449
492
|
|
|
450
493
|
// ../host/dist/files.js
|
|
451
|
-
import { cp, lstat as lstat2, mkdir as mkdir2, readFile as readFile3, readdir, realpath, rename as renamePath, rm, stat, writeFile as writeFile2 } from "node:fs/promises";
|
|
494
|
+
import { cp, lstat as lstat2, mkdir as mkdir2, readFile as readFile3, readdir as readdir2, realpath, rename as renamePath, rm, stat as stat2, writeFile as writeFile2 } from "node:fs/promises";
|
|
452
495
|
import path4 from "node:path";
|
|
453
496
|
var MAX_FILE = 4 * 1024 * 1024;
|
|
454
497
|
var MAX_MEDIA = 64 * 1024 * 1024;
|
|
@@ -482,14 +525,14 @@ var ProjectFiles = class {
|
|
|
482
525
|
}
|
|
483
526
|
async list(relative) {
|
|
484
527
|
const dir = await this.#resolve(relative);
|
|
485
|
-
const names2 = await
|
|
528
|
+
const names2 = await readdir2(dir, { withFileTypes: true });
|
|
486
529
|
const entries = [];
|
|
487
530
|
for (const dirent of names2) {
|
|
488
531
|
if (HIDDEN.has(dirent.name))
|
|
489
532
|
continue;
|
|
490
533
|
const full = path4.join(dir, dirent.name);
|
|
491
534
|
const link2 = dirent.isSymbolicLink();
|
|
492
|
-
const info = await
|
|
535
|
+
const info = await stat2(full).catch(() => null);
|
|
493
536
|
if (!info)
|
|
494
537
|
continue;
|
|
495
538
|
entries.push({
|
|
@@ -529,7 +572,7 @@ var ProjectFiles = class {
|
|
|
529
572
|
const walk = async (dir, relative) => {
|
|
530
573
|
if (truncated)
|
|
531
574
|
return;
|
|
532
|
-
const names2 = await
|
|
575
|
+
const names2 = await readdir2(dir, { withFileTypes: true }).catch(() => []);
|
|
533
576
|
for (const dirent of names2) {
|
|
534
577
|
if (truncated)
|
|
535
578
|
return;
|
|
@@ -537,7 +580,7 @@ var ProjectFiles = class {
|
|
|
537
580
|
continue;
|
|
538
581
|
const full = path4.join(dir, dirent.name);
|
|
539
582
|
const rel = join(relative, dirent.name);
|
|
540
|
-
const info = await
|
|
583
|
+
const info = await stat2(full).catch(() => null);
|
|
541
584
|
if (!info)
|
|
542
585
|
continue;
|
|
543
586
|
const isDir = info.isDirectory();
|
|
@@ -584,7 +627,7 @@ var ProjectFiles = class {
|
|
|
584
627
|
const walk = async (dir, relative) => {
|
|
585
628
|
if (truncated)
|
|
586
629
|
return;
|
|
587
|
-
const names2 = await
|
|
630
|
+
const names2 = await readdir2(dir, { withFileTypes: true }).catch(() => []);
|
|
588
631
|
for (const dirent of names2) {
|
|
589
632
|
if (truncated)
|
|
590
633
|
return;
|
|
@@ -598,7 +641,7 @@ var ProjectFiles = class {
|
|
|
598
641
|
}
|
|
599
642
|
if (!dirent.isFile())
|
|
600
643
|
continue;
|
|
601
|
-
const info = await
|
|
644
|
+
const info = await stat2(full).catch(() => null);
|
|
602
645
|
if (!info || info.size > MAX_FILE)
|
|
603
646
|
continue;
|
|
604
647
|
const buffer = await readFile3(full).catch(() => null);
|
|
@@ -645,7 +688,7 @@ var ProjectFiles = class {
|
|
|
645
688
|
}
|
|
646
689
|
async read(relative) {
|
|
647
690
|
const file = await this.#resolve(relative);
|
|
648
|
-
const info = await
|
|
691
|
+
const info = await stat2(file);
|
|
649
692
|
if (info.isDirectory())
|
|
650
693
|
throw new Error("\u042D\u0442\u043E \u043A\u0430\u0442\u0430\u043B\u043E\u0433, \u0430 \u043D\u0435 \u0444\u0430\u0439\u043B");
|
|
651
694
|
const blank = {
|
|
@@ -692,7 +735,7 @@ var ProjectFiles = class {
|
|
|
692
735
|
const mime = MEDIA_MIME[path4.extname(file).toLowerCase()];
|
|
693
736
|
if (!mime)
|
|
694
737
|
throw new Error("\u0424\u0430\u0439\u043B \u043D\u0435 \u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D \u043A\u0430\u043A \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 \u0438\u043B\u0438 \u0432\u0438\u0434\u0435\u043E");
|
|
695
|
-
const info = await
|
|
738
|
+
const info = await stat2(file);
|
|
696
739
|
if (info.isDirectory())
|
|
697
740
|
throw new Error("\u042D\u0442\u043E \u043A\u0430\u0442\u0430\u043B\u043E\u0433, \u0430 \u043D\u0435 \u0444\u0430\u0439\u043B");
|
|
698
741
|
if (info.size > MAX_MEDIA)
|
|
@@ -710,7 +753,7 @@ var ProjectFiles = class {
|
|
|
710
753
|
*/
|
|
711
754
|
async write(relative, content, eol, encoding, baseMtime, force = false) {
|
|
712
755
|
const file = await this.#resolve(relative);
|
|
713
|
-
const info = await
|
|
756
|
+
const info = await stat2(file).catch(() => null);
|
|
714
757
|
if (info?.isDirectory())
|
|
715
758
|
throw new Error("\u042D\u0442\u043E \u043A\u0430\u0442\u0430\u043B\u043E\u0433, \u0430 \u043D\u0435 \u0444\u0430\u0439\u043B");
|
|
716
759
|
if (!force) {
|
|
@@ -720,7 +763,7 @@ var ProjectFiles = class {
|
|
|
720
763
|
}
|
|
721
764
|
}
|
|
722
765
|
await writeFile2(file, encode(content, eol, encoding));
|
|
723
|
-
const saved = await
|
|
766
|
+
const saved = await stat2(file);
|
|
724
767
|
return { mtime: Math.round(saved.mtimeMs), size: saved.size };
|
|
725
768
|
}
|
|
726
769
|
async create(relative, kind) {
|
|
@@ -758,7 +801,7 @@ var ProjectFiles = class {
|
|
|
758
801
|
if (!source)
|
|
759
802
|
throw new Error("\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A\u043E\u0440\u0435\u043D\u044C \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u043D\u0435\u043B\u044C\u0437\u044F");
|
|
760
803
|
const from = await this.#resolve(source);
|
|
761
|
-
const info = await
|
|
804
|
+
const info = await stat2(from);
|
|
762
805
|
const dir = normalize(toDir);
|
|
763
806
|
if (info.isDirectory() && (dir === source || dir.startsWith(`${source}/`))) {
|
|
764
807
|
throw new Error("\u041A\u0430\u0442\u0430\u043B\u043E\u0433 \u043D\u0435\u043B\u044C\u0437\u044F \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u043D\u0443\u0442\u0440\u044C \u0441\u0430\u043C\u043E\u0433\u043E \u0441\u0435\u0431\u044F");
|
|
@@ -5364,7 +5407,7 @@ function describe4(error) {
|
|
|
5364
5407
|
|
|
5365
5408
|
// ../host/dist/finder.js
|
|
5366
5409
|
import { existsSync as existsSync2, statSync } from "node:fs";
|
|
5367
|
-
import { readdir as
|
|
5410
|
+
import { readdir as readdir3 } from "node:fs/promises";
|
|
5368
5411
|
import os2 from "node:os";
|
|
5369
5412
|
import path12 from "node:path";
|
|
5370
5413
|
import { listSessions } from "@anthropic-ai/claude-agent-sdk";
|
|
@@ -5455,7 +5498,7 @@ var ProjectFinder = class {
|
|
|
5455
5498
|
const key = absolute.toLowerCase();
|
|
5456
5499
|
if (seen.has(key))
|
|
5457
5500
|
continue;
|
|
5458
|
-
if (!
|
|
5501
|
+
if (!isDirectory2(absolute))
|
|
5459
5502
|
continue;
|
|
5460
5503
|
seen.add(key);
|
|
5461
5504
|
const record = known.get(key);
|
|
@@ -5513,7 +5556,7 @@ var ProjectFinder = class {
|
|
|
5513
5556
|
dirs.set(key, { path: cwd, sessions: 1, lastUsedAt: info.lastModified });
|
|
5514
5557
|
}
|
|
5515
5558
|
for (const parent of this.#parents(dirs.values())) {
|
|
5516
|
-
const names2 = await
|
|
5559
|
+
const names2 = await readdir3(parent, { withFileTypes: true }).catch(() => []);
|
|
5517
5560
|
for (const dirent of names2) {
|
|
5518
5561
|
if (!dirent.isDirectory() || SKIP_NAMES.has(dirent.name) || dirent.name.startsWith(".")) {
|
|
5519
5562
|
continue;
|
|
@@ -5562,7 +5605,7 @@ function matches(value, needles) {
|
|
|
5562
5605
|
const flat = value.toLowerCase().replace(/[^a-z0-9а-яё]+/gi, "");
|
|
5563
5606
|
return needles.every((needle) => flat.includes(needle));
|
|
5564
5607
|
}
|
|
5565
|
-
function
|
|
5608
|
+
function isDirectory2(dir) {
|
|
5566
5609
|
try {
|
|
5567
5610
|
return statSync(dir).isDirectory();
|
|
5568
5611
|
} catch {
|
|
@@ -6784,7 +6827,7 @@ function writableRoots(mode, cwd, workspacePaths) {
|
|
|
6784
6827
|
}
|
|
6785
6828
|
|
|
6786
6829
|
// ../host/dist/handoff-store.js
|
|
6787
|
-
import { mkdir as mkdir12, readFile as readFile14, readdir as
|
|
6830
|
+
import { mkdir as mkdir12, readFile as readFile14, readdir as readdir4, rm as rm4, writeFile as writeFile13 } from "node:fs/promises";
|
|
6788
6831
|
import path19 from "node:path";
|
|
6789
6832
|
var HandoffStore = class {
|
|
6790
6833
|
#dir;
|
|
@@ -6817,7 +6860,7 @@ var HandoffStore = class {
|
|
|
6817
6860
|
/** id всех сохранённых хэндоффов. */
|
|
6818
6861
|
async list() {
|
|
6819
6862
|
try {
|
|
6820
|
-
return (await
|
|
6863
|
+
return (await readdir4(this.#dir)).filter((name) => name.endsWith(".json")).map((name) => name.slice(0, -".json".length));
|
|
6821
6864
|
} catch {
|
|
6822
6865
|
return [];
|
|
6823
6866
|
}
|
|
@@ -8189,6 +8232,7 @@ var HostServer = class {
|
|
|
8189
8232
|
name: a.name,
|
|
8190
8233
|
color: a.color,
|
|
8191
8234
|
configDir: a.configDir,
|
|
8235
|
+
dir: this.#accounts.effectiveDir(a.id),
|
|
8192
8236
|
main: a.id === MAIN_ACCOUNT_ID,
|
|
8193
8237
|
liveSessions: live.filter((s) => s.accountId === a.id).length
|
|
8194
8238
|
}));
|
|
@@ -8202,6 +8246,27 @@ var HostServer = class {
|
|
|
8202
8246
|
}));
|
|
8203
8247
|
return { type: "accounts.state", accounts, auth: Object.fromEntries(entries) };
|
|
8204
8248
|
}
|
|
8249
|
+
/**
|
|
8250
|
+
* Каталоги с входом, найденные на устройстве, и кто в них вошёл.
|
|
8251
|
+
* Кто вошёл — отвечает CLI; каталоги без входа в предложение не идут.
|
|
8252
|
+
*/
|
|
8253
|
+
async #discoverAccounts() {
|
|
8254
|
+
const dirs = await candidateConfigDirs();
|
|
8255
|
+
const results = await Promise.all(dirs.map(async (configDir) => {
|
|
8256
|
+
const status = await new AuthCli(configDir).status().catch(() => null);
|
|
8257
|
+
if (!status?.loggedIn)
|
|
8258
|
+
return null;
|
|
8259
|
+
const used = this.#accounts.all.find((a) => path24.resolve(this.#accounts.effectiveDir(a.id)).toLowerCase() === configDir.toLowerCase());
|
|
8260
|
+
return {
|
|
8261
|
+
configDir,
|
|
8262
|
+
email: status.email,
|
|
8263
|
+
plan: status.plan,
|
|
8264
|
+
organization: status.organization,
|
|
8265
|
+
accountId: used?.id ?? null
|
|
8266
|
+
};
|
|
8267
|
+
}));
|
|
8268
|
+
return results.filter((c) => c !== null);
|
|
8269
|
+
}
|
|
8205
8270
|
async #sendAccounts() {
|
|
8206
8271
|
this.#broadcast(await this.#accountsFrame());
|
|
8207
8272
|
}
|
|
@@ -9198,13 +9263,31 @@ var HostServer = class {
|
|
|
9198
9263
|
});
|
|
9199
9264
|
await this.#sendAccounts();
|
|
9200
9265
|
return;
|
|
9201
|
-
case "accounts.update":
|
|
9266
|
+
case "accounts.update": {
|
|
9267
|
+
if (frame.configDir !== void 0) {
|
|
9268
|
+
const live = this.#accountList().find((a) => a.id === frame.accountId)?.liveSessions ?? 0;
|
|
9269
|
+
if (live > 0) {
|
|
9270
|
+
throw new Error("\u041F\u043E\u0434 \u044D\u0442\u0438\u043C \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u043E\u043C \u0438\u0434\u0443\u0442 \u0441\u0435\u0441\u0441\u0438\u0438 \u2014 \u0437\u0430\u043A\u0440\u043E\u0439\u0442\u0435 \u0438\u0445, \u043F\u043E\u0442\u043E\u043C \u043C\u0435\u043D\u044F\u0439\u0442\u0435 \u043A\u0430\u0442\u0430\u043B\u043E\u0433");
|
|
9271
|
+
}
|
|
9272
|
+
}
|
|
9202
9273
|
await this.#accounts.update(frame.accountId, {
|
|
9203
9274
|
...frame.name !== void 0 ? { name: frame.name } : {},
|
|
9204
|
-
...frame.color ? { color: frame.color } : {}
|
|
9275
|
+
...frame.color ? { color: frame.color } : {},
|
|
9276
|
+
...frame.configDir !== void 0 ? { configDir: frame.configDir } : {}
|
|
9205
9277
|
});
|
|
9278
|
+
if (frame.configDir !== void 0) {
|
|
9279
|
+
this.#authFor(frame.accountId).cancel();
|
|
9280
|
+
this.#auths.delete(frame.accountId);
|
|
9281
|
+
}
|
|
9206
9282
|
await this.#sendAccounts();
|
|
9207
9283
|
return;
|
|
9284
|
+
}
|
|
9285
|
+
case "accounts.discover":
|
|
9286
|
+
this.#send(socket, {
|
|
9287
|
+
type: "accounts.candidates",
|
|
9288
|
+
candidates: await this.#discoverAccounts()
|
|
9289
|
+
});
|
|
9290
|
+
return;
|
|
9208
9291
|
case "accounts.remove": {
|
|
9209
9292
|
const account = this.#accountList().find((a) => a.id === frame.accountId);
|
|
9210
9293
|
if (!account)
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as r,H as a}from"./index-
|
|
1
|
+
import{s as r,H as a}from"./index-C2I0tlZW.js";import{E as e}from"./index-891wE-Rj.js";import{t as o}from"./index-CpfHiTlz.js";import"./index-BHot-lnj.js";const m=e.theme({"&":{height:"100%",color:"var(--text)",backgroundColor:"var(--bg)",fontSize:"13px"},".cm-scroller":{fontFamily:"var(--mono)",lineHeight:"1.6"},".cm-content":{caretColor:"var(--accent)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--accent)"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--cm-selection)"},".cm-gutters":{backgroundColor:"var(--bg)",color:"var(--muted)",borderRight:"1px solid var(--border-soft)"},".cm-activeLineGutter":{backgroundColor:"var(--surface-2)",color:"var(--text-2)"},".cm-activeLine":{backgroundColor:"var(--cm-active)"},".cm-selectionMatch":{backgroundColor:"var(--cm-match)"},"&.cm-focused .cm-matchingBracket":{backgroundColor:"var(--cm-match)",outline:"1px solid var(--accent-line)"},".cm-foldPlaceholder":{backgroundColor:"var(--surface-2)",border:"1px solid var(--border)",color:"var(--muted)"},".cm-panels":{backgroundColor:"var(--surface)",color:"var(--text)",border:"1px solid var(--border)"},".cm-panels input, .cm-panels button, .cm-panels select":{fontFamily:"var(--sans)",fontSize:"12px",background:"var(--surface-2)",color:"var(--text)",border:"1px solid var(--border)",borderRadius:"6px",padding:"3px 6px"},".cm-searchMatch":{backgroundColor:"var(--cm-match)"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"var(--accent-soft)"},".cm-tooltip":{background:"var(--surface)",border:"1px solid var(--border)",borderRadius:"8px",boxShadow:"var(--shadow-md)",color:"var(--text)"},".cm-tooltip-autocomplete ul li[aria-selected]":{background:"var(--surface-2)",color:"var(--text)"}}),i=r(a.define([{tag:[o.keyword,o.modifier,o.controlKeyword,o.moduleKeyword],color:"var(--cm-key)"},{tag:[o.name,o.deleted,o.character,o.macroName],color:"var(--text)"},{tag:[o.propertyName],color:"var(--cm-prop)"},{tag:[o.function(o.variableName),o.labelName],color:"var(--cm-fn)"},{tag:[o.color,o.constant(o.name),o.standard(o.name),o.bool],color:"var(--cm-const)"},{tag:[o.definition(o.name),o.separator],color:"var(--text)"},{tag:[o.typeName,o.className,o.changed,o.annotation,o.self,o.namespace],color:"var(--cm-type)"},{tag:[o.number,o.integer,o.float],color:"var(--cm-num)"},{tag:[o.string,o.special(o.string),o.regexp],color:"var(--cm-str)"},{tag:[o.operator,o.operatorKeyword,o.escape],color:"var(--cm-op)"},{tag:[o.meta,o.comment],color:"var(--cm-comment)",fontStyle:"italic"},{tag:o.strong,fontWeight:"650"},{tag:o.emphasis,fontStyle:"italic"},{tag:o.strikethrough,textDecoration:"line-through"},{tag:o.link,color:"var(--cm-str)",textDecoration:"underline"},{tag:o.heading,fontWeight:"650",color:"var(--cm-key)"},{tag:o.invalid,color:"var(--danger)"}]));export{i as editorHighlight,m as editorTheme};
|