ccsini 0.1.32 → 0.1.34
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/dist/index.js +18 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27917,7 +27917,11 @@ var init_constants = __esm(() => {
|
|
|
27917
27917
|
"tasks/**",
|
|
27918
27918
|
"transcripts/**",
|
|
27919
27919
|
"**/*.lock",
|
|
27920
|
-
"**/dist/**"
|
|
27920
|
+
"**/dist/**",
|
|
27921
|
+
"**/.git/**",
|
|
27922
|
+
"**/*.bak",
|
|
27923
|
+
"settings.*.json",
|
|
27924
|
+
"history.jsonl"
|
|
27921
27925
|
];
|
|
27922
27926
|
});
|
|
27923
27927
|
|
|
@@ -28000,7 +28004,7 @@ var {
|
|
|
28000
28004
|
} = import__.default;
|
|
28001
28005
|
|
|
28002
28006
|
// src/version.ts
|
|
28003
|
-
var VERSION = "0.1.
|
|
28007
|
+
var VERSION = "0.1.34";
|
|
28004
28008
|
|
|
28005
28009
|
// src/commands/init.ts
|
|
28006
28010
|
init_source();
|
|
@@ -29036,6 +29040,7 @@ class CcsiniClient {
|
|
|
29036
29040
|
import { readFile as readFile6, writeFile as writeFile5, mkdir as mkdir2 } from "fs/promises";
|
|
29037
29041
|
import { join as join6, dirname } from "path";
|
|
29038
29042
|
import { homedir as homedir2 } from "os";
|
|
29043
|
+
import { createHash as createHash2 } from "crypto";
|
|
29039
29044
|
|
|
29040
29045
|
// src/core/manifest.ts
|
|
29041
29046
|
import { readFile as readFile5, writeFile as writeFile4 } from "fs/promises";
|
|
@@ -29057,7 +29062,7 @@ function categorizeFile(relativePath) {
|
|
|
29057
29062
|
return "unknown";
|
|
29058
29063
|
}
|
|
29059
29064
|
function matchGlobPattern(path2, pattern) {
|
|
29060
|
-
const regex2 = pattern.replace(
|
|
29065
|
+
const regex2 = pattern.replace(/\*\*\//g, "\x00DIR\x00").replace(/\*\*/g, "\x00STAR\x00").replace(/\./g, "\\.").replace(/\*/g, "[^/]*").replace(/\0DIR\0/g, "(.+/)?").replace(/\0STAR\0/g, ".*");
|
|
29061
29066
|
return new RegExp(`^${regex2}$`).test(path2);
|
|
29062
29067
|
}
|
|
29063
29068
|
function isExcluded(relativePath) {
|
|
@@ -29212,6 +29217,9 @@ function mergeLastWriteWins(localContent, remoteContent, localModified, remoteMo
|
|
|
29212
29217
|
|
|
29213
29218
|
// src/core/sync.ts
|
|
29214
29219
|
init_src();
|
|
29220
|
+
function blobKey(filePath, contentHash) {
|
|
29221
|
+
return createHash2("sha256").update(`${filePath}:${contentHash}`).digest("hex");
|
|
29222
|
+
}
|
|
29215
29223
|
function getClaudeDir() {
|
|
29216
29224
|
return join6(homedir2(), ".claude");
|
|
29217
29225
|
}
|
|
@@ -29250,7 +29258,7 @@ async function pushSync(client, masterKey, deviceName, configDir, onProgress) {
|
|
|
29250
29258
|
const filePath = join6(claudeDir, diff.path);
|
|
29251
29259
|
const content = await readFile6(filePath);
|
|
29252
29260
|
const encrypted = encryptFile(masterKey, diff.path, content);
|
|
29253
|
-
await client.uploadBlob(diff.localHash, encrypted);
|
|
29261
|
+
await client.uploadBlob(blobKey(diff.path, diff.localHash), encrypted);
|
|
29254
29262
|
bytesTransferred += encrypted.length;
|
|
29255
29263
|
uploaded++;
|
|
29256
29264
|
progress(`Uploading ${uploaded}/${toPush.length}: ${diff.path}`);
|
|
@@ -29335,7 +29343,12 @@ async function pullSync(client, masterKey, deviceName, configDir, onProgress) {
|
|
|
29335
29343
|
for (const chunk of chunks) {
|
|
29336
29344
|
await Promise.all(chunk.map(async (diff) => {
|
|
29337
29345
|
try {
|
|
29338
|
-
|
|
29346
|
+
let encrypted;
|
|
29347
|
+
try {
|
|
29348
|
+
encrypted = await client.downloadBlob(blobKey(diff.path, diff.remoteHash));
|
|
29349
|
+
} catch {
|
|
29350
|
+
encrypted = await client.downloadBlob(diff.remoteHash);
|
|
29351
|
+
}
|
|
29339
29352
|
bytesTransferred += encrypted.length;
|
|
29340
29353
|
const decrypted = decryptFile(masterKey, diff.path, encrypted);
|
|
29341
29354
|
if (diff.action === "merge" && diff.localHash) {
|