@i14ks/ccv 0.39.0 → 0.40.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 +65 -7
- package/package.json +1 -1
- package/web/assets/{codemirror-DxtGDGFk.js → codemirror-BFhD_Qok.js} +1 -1
- package/web/assets/{index-CYTeESKp.js → index-BKQ3S7R4.js} +1 -1
- package/web/assets/{index-7ePJH0ro.js → index-BeqGzcF4.js} +1 -1
- package/web/assets/{index-m4coFts1.js → index-BfM9EE1E.js} +1 -1
- package/web/assets/{index-BFDq9QAB.js → index-Bng1dR8P.js} +1 -1
- package/web/assets/{index-C8qIDcIc.js → index-BqphMi4s.js} +1 -1
- package/web/assets/{index-DpOYCClV.js → index-C--xwv_c.js} +1 -1
- package/web/assets/{index-o26-Q-i0.js → index-C0UJgxDk.js} +1 -1
- package/web/assets/{index-ByfO4I3S.js → index-CO8tJjX2.js} +1 -1
- package/web/assets/{index-CeQc1DVq.js → index-CTd3OD36.js} +1 -1
- package/web/assets/{index-D6EEDkTZ.js → index-Cp-Vx5md.js} +1 -1
- package/web/assets/index-D48z24MD.js +134 -0
- package/web/assets/{index-CkyUKgI0.js → index-D6n8Nr5h.js} +1 -1
- package/web/assets/{index-Ce3CzqV9.js → index-DGvQxxdB.js} +1 -1
- package/web/assets/{index-B37sMj0O.js → index-DkREaKVS.js} +1 -1
- package/web/assets/{index-BwKT4Ywt.css → index-DmlVq6mR.css} +1 -1
- package/web/assets/{index-CotBHbkI.js → index-DswRCrFR.js} +1 -1
- package/web/assets/{index-BVT3q-Tt.js → index-DwvMx-lF.js} +1 -1
- package/web/assets/{index-szPJRpmr.js → index-H0NO4iIy.js} +1 -1
- package/web/assets/{index-vBfnpOGr.js → index-Jk59gidx.js} +1 -1
- package/web/assets/{index-CUvAPVSk.js → index-MdNspwJW.js} +1 -1
- package/web/assets/{index-C2I0tlZW.js → index-Sbrdg0Zd.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/index-CpfHiTlz.js +0 -134
package/bundle/ccv.mjs
CHANGED
|
@@ -156,6 +156,17 @@ import { renameSession as renameSession2 } from "@anthropic-ai/claude-agent-sdk"
|
|
|
156
156
|
// ../protocol/dist/index.js
|
|
157
157
|
var PROTOCOL_VERSION = 1;
|
|
158
158
|
var MAIN_ACCOUNT_ID = "main";
|
|
159
|
+
var SHARED_CONFIG_ITEMS = [
|
|
160
|
+
"skills",
|
|
161
|
+
"agents",
|
|
162
|
+
"hooks",
|
|
163
|
+
"commands",
|
|
164
|
+
"plugins",
|
|
165
|
+
"output-styles",
|
|
166
|
+
"CLAUDE.md",
|
|
167
|
+
"settings.json",
|
|
168
|
+
"keybindings.json"
|
|
169
|
+
];
|
|
159
170
|
var ACCOUNT_COLORS = ["orange", "blue", "green", "purple", "pink", "teal"];
|
|
160
171
|
function isClientFrame(value) {
|
|
161
172
|
return typeof value === "object" && value !== null && typeof value.type === "string";
|
|
@@ -244,7 +255,7 @@ var AccountStore = class {
|
|
|
244
255
|
const account = { id, name, color, configDir };
|
|
245
256
|
await mkdir(configDir, { recursive: true });
|
|
246
257
|
if (input.shareConfig)
|
|
247
|
-
await linkSharedConfig(configDir, this.effectiveDir(MAIN_ACCOUNT_ID));
|
|
258
|
+
await linkSharedConfig(configDir, this.effectiveDir(MAIN_ACCOUNT_ID), input.sharedItems);
|
|
248
259
|
this.#accounts = [...this.#accounts, account];
|
|
249
260
|
await this.#save();
|
|
250
261
|
return account;
|
|
@@ -274,6 +285,27 @@ var AccountStore = class {
|
|
|
274
285
|
account.color = patch.color;
|
|
275
286
|
await this.#save();
|
|
276
287
|
}
|
|
288
|
+
/**
|
|
289
|
+
* Поменять местами основной и `id`: каталог, имя и цвет переезжают вместе,
|
|
290
|
+
* чтобы личность входа не потеряла своего названия. Файлов не двигает.
|
|
291
|
+
*/
|
|
292
|
+
async swapMain(id) {
|
|
293
|
+
if (id === MAIN_ACCOUNT_ID)
|
|
294
|
+
return;
|
|
295
|
+
const main = this.find(MAIN_ACCOUNT_ID);
|
|
296
|
+
const other = this.find(id);
|
|
297
|
+
if (!main || !other)
|
|
298
|
+
throw new Error("\u0410\u043A\u043A\u0430\u0443\u043D\u0442 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D");
|
|
299
|
+
const mainDir = this.effectiveDir(MAIN_ACCOUNT_ID);
|
|
300
|
+
const otherDir = other.configDir;
|
|
301
|
+
if (!otherDir)
|
|
302
|
+
throw new Error("\u0423 \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u0430 \u043D\u0435\u0442 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0430 \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438");
|
|
303
|
+
[main.name, other.name] = [other.name, main.name];
|
|
304
|
+
[main.color, other.color] = [other.color, main.color];
|
|
305
|
+
main.configDir = otherDir;
|
|
306
|
+
other.configDir = mainDir;
|
|
307
|
+
await this.#save();
|
|
308
|
+
}
|
|
277
309
|
async remove(id) {
|
|
278
310
|
if (id === MAIN_ACCOUNT_ID)
|
|
279
311
|
throw new Error("\u041E\u0441\u043D\u043E\u0432\u043D\u043E\u0439 \u0430\u043A\u043A\u0430\u0443\u043D\u0442 \u0443\u0434\u0430\u043B\u0438\u0442\u044C \u043D\u0435\u043B\u044C\u0437\u044F");
|
|
@@ -336,16 +368,15 @@ function isStored(value) {
|
|
|
336
368
|
const v = value;
|
|
337
369
|
return typeof v.id === "string" && typeof v.name === "string" && typeof v.color === "string" && ACCOUNT_COLORS.includes(v.color) && (v.configDir === null || typeof v.configDir === "string");
|
|
338
370
|
}
|
|
339
|
-
var
|
|
340
|
-
var SHARED_FILES = ["CLAUDE.md", "settings.json"];
|
|
371
|
+
var DIR_ITEMS = /* @__PURE__ */ new Set(["skills", "agents", "hooks", "commands", "plugins", "output-styles"]);
|
|
341
372
|
function sharedConfigDir() {
|
|
342
373
|
return process.env.CCV_SHARED_CONFIG_DIR?.trim() || path3.join(homedir2(), ".claude-shared");
|
|
343
374
|
}
|
|
344
|
-
async function linkSharedConfig(configDir, main = inheritedDir()) {
|
|
375
|
+
async function linkSharedConfig(configDir, main = inheritedDir(), items = SHARED_CONFIG_ITEMS) {
|
|
345
376
|
const shared = sharedConfigDir();
|
|
346
377
|
await mkdir(shared, { recursive: true });
|
|
347
|
-
for (const name of
|
|
348
|
-
const isDir =
|
|
378
|
+
for (const name of items) {
|
|
379
|
+
const isDir = DIR_ITEMS.has(name);
|
|
349
380
|
const target = path3.join(shared, name);
|
|
350
381
|
const origin = path3.join(main, name);
|
|
351
382
|
if (!await exists(target)) {
|
|
@@ -6683,6 +6714,9 @@ var PERMISSION_MODES = [
|
|
|
6683
6714
|
"auto"
|
|
6684
6715
|
];
|
|
6685
6716
|
var DEFAULT_APP_SETTINGS = {
|
|
6717
|
+
// Всё, что можно делить: так новый аккаунт получает ту же обстановку, что и
|
|
6718
|
+
// основной, а лишнее человек выключает сам.
|
|
6719
|
+
sharedConfigItems: [...SHARED_CONFIG_ITEMS],
|
|
6686
6720
|
autoArchiveAfterMs: DEFAULT_AUTO_ARCHIVE_AFTER_MS,
|
|
6687
6721
|
autoStopAfterMs: DEFAULT_AUTO_STOP_AFTER_MS,
|
|
6688
6722
|
// Строгий режим по умолчанию: молча писать в чужой проект приложение начнёт
|
|
@@ -6791,6 +6825,10 @@ function sanitize2(value, fallback) {
|
|
|
6791
6825
|
result[key] = pct <= 0 ? 0 : Math.min(Math.max(Math.round(pct), 1), 100);
|
|
6792
6826
|
}
|
|
6793
6827
|
}
|
|
6828
|
+
const shared = record.sharedConfigItems;
|
|
6829
|
+
if (Array.isArray(shared)) {
|
|
6830
|
+
result.sharedConfigItems = SHARED_CONFIG_ITEMS.filter((item) => shared.includes(item));
|
|
6831
|
+
}
|
|
6794
6832
|
const providers = record.enabledProviders;
|
|
6795
6833
|
if (Array.isArray(providers)) {
|
|
6796
6834
|
const picked = PROVIDERS.filter((p) => providers.includes(p));
|
|
@@ -9259,7 +9297,7 @@ var HostServer = class {
|
|
|
9259
9297
|
name: frame.name,
|
|
9260
9298
|
...frame.color ? { color: frame.color } : {},
|
|
9261
9299
|
...frame.configDir ? { configDir: frame.configDir } : {},
|
|
9262
|
-
...frame.shareConfig ? { shareConfig: true } : {}
|
|
9300
|
+
...frame.shareConfig ? { shareConfig: true, sharedItems: this.#settings.current.sharedConfigItems } : {}
|
|
9263
9301
|
});
|
|
9264
9302
|
await this.#sendAccounts();
|
|
9265
9303
|
return;
|
|
@@ -9282,6 +9320,26 @@ var HostServer = class {
|
|
|
9282
9320
|
await this.#sendAccounts();
|
|
9283
9321
|
return;
|
|
9284
9322
|
}
|
|
9323
|
+
case "accounts.makeMain": {
|
|
9324
|
+
const accounts = this.#accountList();
|
|
9325
|
+
const main = accounts.find((a) => a.main);
|
|
9326
|
+
const target = accounts.find((a) => a.id === frame.accountId);
|
|
9327
|
+
if (!main || !target || target.main)
|
|
9328
|
+
return;
|
|
9329
|
+
if (main.liveSessions > 0 || target.liveSessions > 0) {
|
|
9330
|
+
throw new Error("\u041F\u043E\u0434 \u043E\u0434\u043D\u0438\u043C \u0438\u0437 \u044D\u0442\u0438\u0445 \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u043E\u0432 \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 \u043E\u0441\u043D\u043E\u0432\u043D\u043E\u0439");
|
|
9331
|
+
}
|
|
9332
|
+
await this.#accounts.swapMain(target.id);
|
|
9333
|
+
for (const id of [main.id, target.id]) {
|
|
9334
|
+
this.#auths.get(id)?.cancel();
|
|
9335
|
+
this.#auths.delete(id);
|
|
9336
|
+
}
|
|
9337
|
+
this.#diskAccounts.clear();
|
|
9338
|
+
await this.#sendAccounts();
|
|
9339
|
+
for (const workspace of this.#workspaces.list())
|
|
9340
|
+
await this.#sendSessionList(workspace.id);
|
|
9341
|
+
return;
|
|
9342
|
+
}
|
|
9285
9343
|
case "accounts.discover":
|
|
9286
9344
|
this.#send(socket, {
|
|
9287
9345
|
type: "accounts.candidates",
|
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-Sbrdg0Zd.js";import{E as e}from"./index-891wE-Rj.js";import{t as o}from"./index-D48z24MD.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as r}from"./index-
|
|
1
|
+
import{L as r}from"./index-D6n8Nr5h.js";import{s as a,t as O}from"./index-D48z24MD.js";import{L as P,k as o,l as s,n as e,o as t,p as Q}from"./index-Sbrdg0Zd.js";import"./index-BHot-lnj.js";import"./index-891wE-Rj.js";const n=a({String:O.string,Number:O.number,"True False":O.bool,PropertyName:O.propertyName,Null:O.null,", :":O.separator,"[ ]":O.squareBracket,"{ }":O.brace}),i=r.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[n],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),p=o.define({name:"json",parser:i.configure({props:[s.add({Object:e({except:/^\s*\}/}),Array:e({except:/^\s*\]/})}),t.add({"Object Array":Q})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function u(){return new P(p)}export{u as json,p as jsonLanguage};
|