ccsini 0.1.32 → 0.1.33
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 +11 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27917,7 +27917,10 @@ var init_constants = __esm(() => {
|
|
|
27917
27917
|
"tasks/**",
|
|
27918
27918
|
"transcripts/**",
|
|
27919
27919
|
"**/*.lock",
|
|
27920
|
-
"**/dist/**"
|
|
27920
|
+
"**/dist/**",
|
|
27921
|
+
"**/.git/**",
|
|
27922
|
+
"**/*.bak",
|
|
27923
|
+
"settings.*.json"
|
|
27921
27924
|
];
|
|
27922
27925
|
});
|
|
27923
27926
|
|
|
@@ -28000,7 +28003,7 @@ var {
|
|
|
28000
28003
|
} = import__.default;
|
|
28001
28004
|
|
|
28002
28005
|
// src/version.ts
|
|
28003
|
-
var VERSION = "0.1.
|
|
28006
|
+
var VERSION = "0.1.33";
|
|
28004
28007
|
|
|
28005
28008
|
// src/commands/init.ts
|
|
28006
28009
|
init_source();
|
|
@@ -29036,6 +29039,7 @@ class CcsiniClient {
|
|
|
29036
29039
|
import { readFile as readFile6, writeFile as writeFile5, mkdir as mkdir2 } from "fs/promises";
|
|
29037
29040
|
import { join as join6, dirname } from "path";
|
|
29038
29041
|
import { homedir as homedir2 } from "os";
|
|
29042
|
+
import { createHash as createHash2 } from "crypto";
|
|
29039
29043
|
|
|
29040
29044
|
// src/core/manifest.ts
|
|
29041
29045
|
import { readFile as readFile5, writeFile as writeFile4 } from "fs/promises";
|
|
@@ -29212,6 +29216,9 @@ function mergeLastWriteWins(localContent, remoteContent, localModified, remoteMo
|
|
|
29212
29216
|
|
|
29213
29217
|
// src/core/sync.ts
|
|
29214
29218
|
init_src();
|
|
29219
|
+
function blobKey(filePath, contentHash) {
|
|
29220
|
+
return createHash2("sha256").update(`${filePath}:${contentHash}`).digest("hex");
|
|
29221
|
+
}
|
|
29215
29222
|
function getClaudeDir() {
|
|
29216
29223
|
return join6(homedir2(), ".claude");
|
|
29217
29224
|
}
|
|
@@ -29250,7 +29257,7 @@ async function pushSync(client, masterKey, deviceName, configDir, onProgress) {
|
|
|
29250
29257
|
const filePath = join6(claudeDir, diff.path);
|
|
29251
29258
|
const content = await readFile6(filePath);
|
|
29252
29259
|
const encrypted = encryptFile(masterKey, diff.path, content);
|
|
29253
|
-
await client.uploadBlob(diff.localHash, encrypted);
|
|
29260
|
+
await client.uploadBlob(blobKey(diff.path, diff.localHash), encrypted);
|
|
29254
29261
|
bytesTransferred += encrypted.length;
|
|
29255
29262
|
uploaded++;
|
|
29256
29263
|
progress(`Uploading ${uploaded}/${toPush.length}: ${diff.path}`);
|
|
@@ -29335,7 +29342,7 @@ async function pullSync(client, masterKey, deviceName, configDir, onProgress) {
|
|
|
29335
29342
|
for (const chunk of chunks) {
|
|
29336
29343
|
await Promise.all(chunk.map(async (diff) => {
|
|
29337
29344
|
try {
|
|
29338
|
-
const encrypted = await client.downloadBlob(diff.remoteHash);
|
|
29345
|
+
const encrypted = await client.downloadBlob(blobKey(diff.path, diff.remoteHash));
|
|
29339
29346
|
bytesTransferred += encrypted.length;
|
|
29340
29347
|
const decrypted = decryptFile(masterKey, diff.path, encrypted);
|
|
29341
29348
|
if (diff.action === "merge" && diff.localHash) {
|