@cc-claw/code 0.6.164 → 0.6.166
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/install.js +11 -11
- package/install.test.js +1 -1
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -193,7 +193,7 @@ async function verifyChecksum(buffer, fileName) {
|
|
|
193
193
|
console.log(" Checksum OK.");
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
// 从
|
|
196
|
+
// 从 CC env 推导应迁移的 provider 列表(含各档模型别名)
|
|
197
197
|
function detectProvidersFromEnv(env) {
|
|
198
198
|
const providers = [];
|
|
199
199
|
|
|
@@ -277,11 +277,11 @@ function backfillModels(ccCodeSettingsPath, detected) {
|
|
|
277
277
|
return true;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
// 统一项目记忆目录:
|
|
280
|
+
// 统一项目记忆目录:CC 与 cc-code 各维护一份 projects/<slug>/memory,一旦两侧
|
|
281
281
|
// 都落过盘,记忆就会写散(系统提示对外呈现的 ~/.cc-code 路径,与实际读写的 ~/.claude
|
|
282
|
-
// 目录并不是同一份)。安装时把
|
|
282
|
+
// 目录并不是同一份)。安装时把 CC 侧已有的记忆目录在 cc-code 侧以链接接过来,
|
|
283
283
|
// 使两侧读写同一份物理目录:Windows 用 junction(免管理员权限),Unix 用目录符号链接。
|
|
284
|
-
// 只做 .claude -> .cc-code 单向,不往用户的
|
|
284
|
+
// 只做 .claude -> .cc-code 单向,不往用户的 CC 目录里添东西;
|
|
285
285
|
// 目标已存在(用户自己的数据或已建好的链接)一律不碰,任何失败只跳过、不影响安装。
|
|
286
286
|
function linkProjectMemories(home = homedir()) {
|
|
287
287
|
const linkType = process.platform === "win32" ? "junction" : "dir";
|
|
@@ -292,7 +292,7 @@ function linkProjectMemories(home = homedir()) {
|
|
|
292
292
|
try {
|
|
293
293
|
entries = readdirSync(from, { withFileTypes: true });
|
|
294
294
|
} catch {
|
|
295
|
-
return 0; // 没用过
|
|
295
|
+
return 0; // 没用过 CC,没有可承接的记忆
|
|
296
296
|
}
|
|
297
297
|
|
|
298
298
|
let linked = 0;
|
|
@@ -310,7 +310,7 @@ function linkProjectMemories(home = homedir()) {
|
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
if (linked > 0) {
|
|
313
|
-
console.log(` Linked ${linked}
|
|
313
|
+
console.log(` Linked ${linked} .claude project memory dir(s) into ~/.cc-code/projects/`);
|
|
314
314
|
}
|
|
315
315
|
return linked;
|
|
316
316
|
}
|
|
@@ -322,7 +322,7 @@ function migrateFromClaudeCode(home = homedir()) {
|
|
|
322
322
|
|
|
323
323
|
const hasCcCode = existsSync(ccCodeSettingsPath);
|
|
324
324
|
|
|
325
|
-
// 无
|
|
325
|
+
// 无 CC 配置:已有 cc-code 视为成功(无需 Quick Start),否则失败
|
|
326
326
|
if (!existsSync(claudeSettingsPath)) {
|
|
327
327
|
return hasCcCode;
|
|
328
328
|
}
|
|
@@ -368,7 +368,7 @@ function migrateFromClaudeCode(home = homedir()) {
|
|
|
368
368
|
};
|
|
369
369
|
writeFileSync(ccCodeSettingsPath, JSON.stringify(ccCodeSettings, null, 2) + "\n");
|
|
370
370
|
console.log("");
|
|
371
|
-
console.log(" Detected
|
|
371
|
+
console.log(" Detected .claude configuration (compatible with cc-code).");
|
|
372
372
|
console.log(" Migrated ~/.claude/settings.json -> ~/.cc-code/settings.json");
|
|
373
373
|
console.log(` Found ${providers.length} provider(s): ${providers.map(p => p.type).join(", ")}`);
|
|
374
374
|
console.log(" NOTE: API keys were copied into ~/.cc-code/settings.json (plain text).");
|
|
@@ -411,7 +411,7 @@ async function maybeMigrateFromClaudeCode(home = homedir()) {
|
|
|
411
411
|
return migrateFromClaudeCode(home);
|
|
412
412
|
}
|
|
413
413
|
if (process.env.CC_CODE_NO_MIGRATE === "1" || process.argv.includes("--no-migrate")) {
|
|
414
|
-
console.log(" 已跳过
|
|
414
|
+
console.log(" 已跳过 .claude 密钥迁移 (CC_CODE_NO_MIGRATE=1 / --no-migrate)。");
|
|
415
415
|
return false;
|
|
416
416
|
}
|
|
417
417
|
if (!process.stdin.isTTY) {
|
|
@@ -421,7 +421,7 @@ async function maybeMigrateFromClaudeCode(home = homedir()) {
|
|
|
421
421
|
return false;
|
|
422
422
|
}
|
|
423
423
|
console.log("");
|
|
424
|
-
const ok = await promptYesNo(" 检测到
|
|
424
|
+
const ok = await promptYesNo(" 检测到 .claude 配置,是否将 API 密钥迁移到 ~/.cc-code/settings.json?[y/N] ");
|
|
425
425
|
if (!ok) {
|
|
426
426
|
console.log(" 已跳过密钥迁移。");
|
|
427
427
|
return false;
|
|
@@ -622,7 +622,7 @@ async function main() {
|
|
|
622
622
|
// #290:密钥迁移需显式确认,不再静默复制
|
|
623
623
|
const migrated = await maybeMigrateFromClaudeCode();
|
|
624
624
|
|
|
625
|
-
// 让
|
|
625
|
+
// 让 CC 与 cc-code 共用同一份项目记忆目录(避免记忆写散到两侧)
|
|
626
626
|
linkProjectMemories();
|
|
627
627
|
|
|
628
628
|
if (!migrated) {
|
package/install.test.js
CHANGED
|
@@ -362,7 +362,7 @@ test("linkProjectMemories links Claude Code project memory into the cc-code side
|
|
|
362
362
|
const ccMem = join(home, ".cc-code", "projects", "D--code-demo", "memory");
|
|
363
363
|
if (!fs.existsSync(join(ccMem, "MEMORY.md"))) throw new Error("memory not reachable via cc-code path");
|
|
364
364
|
|
|
365
|
-
// 写穿透:经 cc-code 侧写入必须落到
|
|
365
|
+
// 写穿透:经 cc-code 侧写入必须落到 CC 侧同一份
|
|
366
366
|
fs.writeFileSync(join(ccMem, "user_role.md"), "shared");
|
|
367
367
|
if (!fs.existsSync(join(claudeMem, "user_role.md"))) {
|
|
368
368
|
throw new Error("cc-code path is a separate physical directory, not a link");
|