pushwork 1.2.2 → 1.2.3
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/cli/commands.d.ts +71 -0
- package/dist/cli/commands.d.ts.map +1 -0
- package/dist/cli/commands.js +794 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +19 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli.js +0 -0
- package/dist/config/index.d.ts +71 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +314 -0
- package/dist/config/index.js.map +1 -0
- package/dist/utils/content-similarity.d.ts +53 -0
- package/dist/utils/content-similarity.d.ts.map +1 -0
- package/dist/utils/content-similarity.js +155 -0
- package/dist/utils/content-similarity.js.map +1 -0
- package/dist/utils/node-polyfills.d.ts +9 -0
- package/dist/utils/node-polyfills.d.ts.map +1 -0
- package/dist/utils/node-polyfills.js +9 -0
- package/dist/utils/node-polyfills.js.map +1 -0
- package/dist/utils/repo-factory.d.ts.map +1 -1
- package/dist/utils/repo-factory.js +1 -0
- package/dist/utils/repo-factory.js.map +1 -1
- package/package.json +96 -98
- package/scripts/roundtrip-test.sh +0 -0
- package/src/utils/repo-factory.ts +85 -78
- package/test/integration/clone-test.sh +0 -0
- package/test/integration/conflict-resolution-test.sh +0 -0
- package/test/integration/deletion-behavior-test.sh +0 -0
- package/test/integration/deletion-sync-test-simple.sh +0 -0
- package/test/integration/deletion-sync-test.sh +0 -0
- package/test/integration/full-integration-test.sh +0 -0
- package/test/integration/manual-sync-test.sh +0 -0
- package/test/run-tests.sh +0 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContentSimilarity = void 0;
|
|
4
|
+
const fs_1 = require("./fs");
|
|
5
|
+
/**
|
|
6
|
+
* Content similarity calculation for move detection
|
|
7
|
+
*/
|
|
8
|
+
class ContentSimilarity {
|
|
9
|
+
/**
|
|
10
|
+
* Calculate similarity between two content pieces
|
|
11
|
+
*/
|
|
12
|
+
static async calculateSimilarity(content1, content2) {
|
|
13
|
+
// Quick early exit for identical content
|
|
14
|
+
if (await this.areIdentical(content1, content2)) {
|
|
15
|
+
return 1.0;
|
|
16
|
+
}
|
|
17
|
+
// Size-based quick rejection
|
|
18
|
+
const size1 = typeof content1 === "string" ? content1.length : content1.length;
|
|
19
|
+
const size2 = typeof content2 === "string" ? content2.length : content2.length;
|
|
20
|
+
const sizeDiff = Math.abs(size1 - size2) / Math.max(size1, size2);
|
|
21
|
+
if (sizeDiff > 0.5) {
|
|
22
|
+
return 0.0; // Too different in size
|
|
23
|
+
}
|
|
24
|
+
// For small files, use full content comparison
|
|
25
|
+
if (size1 < this.CHUNK_SIZE * 4 && size2 < this.CHUNK_SIZE * 4) {
|
|
26
|
+
return this.calculateFullSimilarity(content1, content2);
|
|
27
|
+
}
|
|
28
|
+
// For large files, use sampling
|
|
29
|
+
return this.calculateSampledSimilarity(content1, content2);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Check if two content pieces are identical
|
|
33
|
+
*/
|
|
34
|
+
static async areIdentical(content1, content2) {
|
|
35
|
+
const hash1 = await (0, fs_1.calculateContentHash)(content1);
|
|
36
|
+
const hash2 = await (0, fs_1.calculateContentHash)(content2);
|
|
37
|
+
return hash1 === hash2;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Calculate similarity for small files using full content
|
|
41
|
+
*/
|
|
42
|
+
static calculateFullSimilarity(content1, content2) {
|
|
43
|
+
const str1 = typeof content1 === "string" ? content1 : this.bufferToString(content1);
|
|
44
|
+
const str2 = typeof content2 === "string" ? content2 : this.bufferToString(content2);
|
|
45
|
+
return this.levenshteinSimilarity(str1, str2);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Calculate similarity for large files using sampling
|
|
49
|
+
*/
|
|
50
|
+
static calculateSampledSimilarity(content1, content2) {
|
|
51
|
+
const samples1 = this.getSamples(content1);
|
|
52
|
+
const samples2 = this.getSamples(content2);
|
|
53
|
+
let totalSimilarity = 0;
|
|
54
|
+
let comparisons = 0;
|
|
55
|
+
for (let i = 0; i < Math.min(samples1.length, samples2.length); i++) {
|
|
56
|
+
totalSimilarity += this.levenshteinSimilarity(samples1[i], samples2[i]);
|
|
57
|
+
comparisons++;
|
|
58
|
+
}
|
|
59
|
+
return comparisons > 0 ? totalSimilarity / comparisons : 0;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get representative samples from content
|
|
63
|
+
*/
|
|
64
|
+
static getSamples(content) {
|
|
65
|
+
const str = typeof content === "string" ? content : this.bufferToString(content);
|
|
66
|
+
const length = str.length;
|
|
67
|
+
const samples = [];
|
|
68
|
+
if (length <= this.CHUNK_SIZE) {
|
|
69
|
+
samples.push(str);
|
|
70
|
+
return samples;
|
|
71
|
+
}
|
|
72
|
+
// Beginning
|
|
73
|
+
samples.push(str.slice(0, this.CHUNK_SIZE));
|
|
74
|
+
// Middle
|
|
75
|
+
const midStart = Math.floor(length / 2) - Math.floor(this.CHUNK_SIZE / 2);
|
|
76
|
+
samples.push(str.slice(midStart, midStart + this.CHUNK_SIZE));
|
|
77
|
+
// End
|
|
78
|
+
samples.push(str.slice(-this.CHUNK_SIZE));
|
|
79
|
+
return samples;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Calculate Levenshtein similarity (0-1 scale)
|
|
83
|
+
*/
|
|
84
|
+
static levenshteinSimilarity(str1, str2) {
|
|
85
|
+
if (str1 === str2)
|
|
86
|
+
return 1.0;
|
|
87
|
+
if (str1.length === 0 || str2.length === 0)
|
|
88
|
+
return 0.0;
|
|
89
|
+
const distance = this.levenshteinDistance(str1, str2);
|
|
90
|
+
const maxLength = Math.max(str1.length, str2.length);
|
|
91
|
+
return 1 - distance / maxLength;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Calculate Levenshtein distance
|
|
95
|
+
*/
|
|
96
|
+
static levenshteinDistance(str1, str2) {
|
|
97
|
+
const matrix = Array(str2.length + 1)
|
|
98
|
+
.fill(null)
|
|
99
|
+
.map(() => Array(str1.length + 1).fill(null));
|
|
100
|
+
for (let i = 0; i <= str1.length; i++)
|
|
101
|
+
matrix[0][i] = i;
|
|
102
|
+
for (let j = 0; j <= str2.length; j++)
|
|
103
|
+
matrix[j][0] = j;
|
|
104
|
+
for (let j = 1; j <= str2.length; j++) {
|
|
105
|
+
for (let i = 1; i <= str1.length; i++) {
|
|
106
|
+
const indicator = str1[i - 1] === str2[j - 1] ? 0 : 1;
|
|
107
|
+
matrix[j][i] = Math.min(matrix[j][i - 1] + 1, // deletion
|
|
108
|
+
matrix[j - 1][i] + 1, // insertion
|
|
109
|
+
matrix[j - 1][i - 1] + indicator // substitution
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return matrix[str2.length][str1.length];
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Convert buffer to string for comparison
|
|
117
|
+
*/
|
|
118
|
+
static bufferToString(buffer) {
|
|
119
|
+
// For binary content, use hex representation for comparison
|
|
120
|
+
return Array.from(buffer)
|
|
121
|
+
.map((b) => b.toString(16).padStart(2, "0"))
|
|
122
|
+
.join("");
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Determine confidence level based on similarity score
|
|
126
|
+
*/
|
|
127
|
+
static getConfidenceLevel(similarity) {
|
|
128
|
+
if (similarity >= this.AUTO_THRESHOLD) {
|
|
129
|
+
return "auto";
|
|
130
|
+
}
|
|
131
|
+
else if (similarity >= this.PROMPT_THRESHOLD) {
|
|
132
|
+
return "prompt";
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
return "low";
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Should auto-apply move based on similarity
|
|
140
|
+
*/
|
|
141
|
+
static shouldAutoApply(similarity) {
|
|
142
|
+
return similarity >= this.AUTO_THRESHOLD;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Should prompt user for move confirmation
|
|
146
|
+
*/
|
|
147
|
+
static shouldPromptUser(similarity) {
|
|
148
|
+
return (similarity >= this.PROMPT_THRESHOLD && similarity < this.AUTO_THRESHOLD);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
exports.ContentSimilarity = ContentSimilarity;
|
|
152
|
+
ContentSimilarity.CHUNK_SIZE = 1024; // 1KB chunks for sampling
|
|
153
|
+
ContentSimilarity.AUTO_THRESHOLD = 0.8;
|
|
154
|
+
ContentSimilarity.PROMPT_THRESHOLD = 0.5;
|
|
155
|
+
//# sourceMappingURL=content-similarity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-similarity.js","sourceRoot":"","sources":["../../src/utils/content-similarity.ts"],"names":[],"mappings":";;;AAAA,6BAA4C;AAE5C;;GAEG;AACH,MAAa,iBAAiB;IAK5B;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAC9B,QAA6B,EAC7B,QAA6B;QAE7B,yCAAyC;QACzC,IAAI,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC;YAChD,OAAO,GAAG,CAAC;QACb,CAAC;QAED,6BAA6B;QAC7B,MAAM,KAAK,GACT,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;QACnE,MAAM,KAAK,GACT,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;QACnE,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,IAAI,CAA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C3C,IAAI,CAAC,EAAE,CAAC,CAAC;IACd,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAkB;QAC1C,IAAI,UAAU,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACtC,OAAO,MAAM,CAAC;QAChB,CAAC;aAAM,IAAI,UAAU,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC/C,OAAO,QAAQ,CAAC;QAClB,CAAC;aAAM,CAAC;YACN,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,UAAkB;QACvC,OAAO,UAAU,IAAI,IAAI,CAAC,cAAc,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,UAAkB;QACxC,OAAO,CACL,UAAU,IAAI,IAAI,CAAC,gBAAgB,IAAI,UAAU,GAAG,IAAI,CAAC,cAAc,CACxE,CAAC;IACJ,CAAC;;AA3LH,8CA4LC;AA3LyB,4BAAU,GAAG,IAAI,CAAC,CAAC,0BAA0B;AAC7C,gCAAc,GAAG,GAAG,CAAC;AACrB,kCAAgB,GAAG,GAAG,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polyfills for browser APIs required by @automerge/automerge-subduction.
|
|
3
|
+
* Must be imported before any subduction code.
|
|
4
|
+
*
|
|
5
|
+
* The Subduction WASM module uses IndexedDB for key persistence
|
|
6
|
+
* (via WebCryptoSigner). In Node.js we provide a fake-indexeddb polyfill.
|
|
7
|
+
*/
|
|
8
|
+
import "fake-indexeddb/auto";
|
|
9
|
+
//# sourceMappingURL=node-polyfills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-polyfills.d.ts","sourceRoot":"","sources":["../../src/utils/node-polyfills.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polyfills for browser APIs required by @automerge/automerge-subduction.
|
|
3
|
+
* Must be imported before any subduction code.
|
|
4
|
+
*
|
|
5
|
+
* The Subduction WASM module uses IndexedDB for key persistence
|
|
6
|
+
* (via WebCryptoSigner). In Node.js we provide a fake-indexeddb polyfill.
|
|
7
|
+
*/
|
|
8
|
+
import "fake-indexeddb/auto";
|
|
9
|
+
//# sourceMappingURL=node-polyfills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-polyfills.js","sourceRoot":"","sources":["../../src/utils/node-polyfills.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo-factory.d.ts","sourceRoot":"","sources":["../../src/utils/repo-factory.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"repo-factory.d.ts","sourceRoot":"","sources":["../../src/utils/repo-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,IAAI,EAGT,MAAM,2BAA2B,CAAA;AAIlC,OAAO,EAAC,eAAe,EAAC,MAAM,UAAU,CAAA;AA0ExC;;;;;;;;;;GAUG;AACH,wBAAsB,UAAU,CAC/B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,eAAe,EACvB,GAAG,GAAE,OAAe,GAClB,OAAO,CAAC,IAAI,CAAC,CAmDf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo-factory.js","sourceRoot":"","sources":["../../src/utils/repo-factory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"repo-factory.js","sourceRoot":"","sources":["../../src/utils/repo-factory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6FA,gCAuDC;AA/ID,4FAA6E;AAC7E,gD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|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
}
|
|
2
|
+
"name": "pushwork",
|
|
3
|
+
"version": "1.2.3",
|
|
4
|
+
"description": "Bidirectional directory synchronization using Automerge CRDTs",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"bin": {
|
|
10
|
+
"pushwork": "./dist/cli.js"
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=24.0.0",
|
|
14
|
+
"pnpm": ">=8.0.0"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"automerge",
|
|
18
|
+
"sync",
|
|
19
|
+
"crdt",
|
|
20
|
+
"collaboration",
|
|
21
|
+
"filesystem"
|
|
22
|
+
],
|
|
23
|
+
"author": "Peter van Hardenberg",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@automerge/automerge": "^3.2.6",
|
|
27
|
+
"@automerge/automerge-repo": "2.6.0-subduction.15",
|
|
28
|
+
"@automerge/automerge-repo-network-websocket": "2.6.0-subduction.15",
|
|
29
|
+
"@automerge/automerge-repo-storage-nodefs": "2.6.0-subduction.15",
|
|
30
|
+
"@automerge/automerge-subduction": "0.8.1",
|
|
31
|
+
"@commander-js/extra-typings": "^14.0.0",
|
|
32
|
+
"chalk": "^5.3.0",
|
|
33
|
+
"commander": "^14.0.2",
|
|
34
|
+
"diff": "^8.0.2",
|
|
35
|
+
"glob": "^10.3.0",
|
|
36
|
+
"ignore": "^5.3.0",
|
|
37
|
+
"mime-types": "^2.1.35",
|
|
38
|
+
"ora": "^7.0.1"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@babel/core": "^7.28.6",
|
|
42
|
+
"@babel/preset-env": "^7.28.6",
|
|
43
|
+
"@types/diff": "^5.0.3",
|
|
44
|
+
"@types/jest": "^29.5.0",
|
|
45
|
+
"@types/mime-types": "^2.1.1",
|
|
46
|
+
"@types/node": "^20.0.0",
|
|
47
|
+
"@types/tmp": "^0.2.4",
|
|
48
|
+
"babel-jest": "^30.2.0",
|
|
49
|
+
"fast-check": "^4.3.0",
|
|
50
|
+
"jest": "^29.7.0",
|
|
51
|
+
"tmp": "^0.2.1",
|
|
52
|
+
"ts-jest": "^29.1.0",
|
|
53
|
+
"tsx": "^4.19.2",
|
|
54
|
+
"typescript": "^5.2.0"
|
|
55
|
+
},
|
|
56
|
+
"jest": {
|
|
57
|
+
"preset": "ts-jest",
|
|
58
|
+
"testEnvironment": "node",
|
|
59
|
+
"roots": [
|
|
60
|
+
"<rootDir>/src",
|
|
61
|
+
"<rootDir>/test"
|
|
62
|
+
],
|
|
63
|
+
"testMatch": [
|
|
64
|
+
"**/__tests__/**/*.ts",
|
|
65
|
+
"**/*.(test|spec).ts"
|
|
66
|
+
],
|
|
67
|
+
"collectCoverageFrom": [
|
|
68
|
+
"src/**/*.ts",
|
|
69
|
+
"!src/**/*.d.ts"
|
|
70
|
+
],
|
|
71
|
+
"setupFilesAfterEnv": [
|
|
72
|
+
"<rootDir>/test/jest.setup.ts"
|
|
73
|
+
],
|
|
74
|
+
"maxWorkers": "75%",
|
|
75
|
+
"maxConcurrency": 10,
|
|
76
|
+
"transformIgnorePatterns": [
|
|
77
|
+
"node_modules/(?!.*@automerge)"
|
|
78
|
+
],
|
|
79
|
+
"transform": {
|
|
80
|
+
"^.+\\.tsx?$": "ts-jest",
|
|
81
|
+
"^.+\\.jsx?$": "babel-jest"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"scripts": {
|
|
85
|
+
"build": "tsc",
|
|
86
|
+
"dev": "tsc --watch",
|
|
87
|
+
"test": "jest",
|
|
88
|
+
"test:bail": "jest --bail",
|
|
89
|
+
"test:watch": "jest --watch",
|
|
90
|
+
"test:coverage": "jest --coverage",
|
|
91
|
+
"lint": "eslint src --ext .ts",
|
|
92
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
93
|
+
"clean": "rm -rf dist",
|
|
94
|
+
"start": "node dist/cli.js",
|
|
95
|
+
"typecheck": "tsc --noEmit"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
File without changes
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import {
|
|
2
|
+
type Repo,
|
|
3
|
+
type RepoConfig,
|
|
4
|
+
type NetworkAdapterInterface,
|
|
5
|
+
} from "@automerge/automerge-repo"
|
|
6
|
+
import {NodeFSStorageAdapter} from "@automerge/automerge-repo-storage-nodefs"
|
|
7
|
+
import * as fs from "fs/promises"
|
|
8
|
+
import * as path from "path"
|
|
9
|
+
import {DirectoryConfig} from "../types"
|
|
6
10
|
|
|
7
11
|
/**
|
|
8
12
|
* Perform a real ESM dynamic import that tsc won't rewrite to require().
|
|
@@ -18,8 +22,8 @@ import { DirectoryConfig } from "../types";
|
|
|
18
22
|
* Repo's internal imports.
|
|
19
23
|
*/
|
|
20
24
|
const dynamicImport = new Function("specifier", "return import(specifier)") as (
|
|
21
|
-
|
|
22
|
-
) => Promise<any
|
|
25
|
+
specifier: string
|
|
26
|
+
) => Promise<any>
|
|
23
27
|
|
|
24
28
|
/**
|
|
25
29
|
* Initialize the Subduction Wasm module and return the Repo constructor.
|
|
@@ -33,22 +37,22 @@ const dynamicImport = new Function("specifier", "return import(specifier)") as (
|
|
|
33
37
|
* Both the Repo and initSubduction must be loaded via ESM dynamic import()
|
|
34
38
|
* so they share the same module graph as the Repo's internal /slim imports.
|
|
35
39
|
*/
|
|
36
|
-
let cachedRepoClass: typeof Repo | undefined
|
|
40
|
+
let cachedRepoClass: typeof Repo | undefined
|
|
37
41
|
|
|
38
42
|
async function getRepoClass(): Promise<typeof Repo> {
|
|
39
|
-
|
|
43
|
+
if (cachedRepoClass) return cachedRepoClass
|
|
40
44
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
// Import Repo and initialize Subduction Wasm via automerge-repo's
|
|
46
|
+
// initSubduction() helper. This must happen before new Repo() because
|
|
47
|
+
// the constructor calls set_subduction_logger() and new MemorySigner()
|
|
48
|
+
// which require the Wasm module to be ready.
|
|
49
|
+
//
|
|
50
|
+
// Both imports use the ESM dynamic import wrapper so they share the
|
|
51
|
+
// same module graph as the Repo's internal /slim imports.
|
|
52
|
+
const repoMod = await dynamicImport("@automerge/automerge-repo")
|
|
53
|
+
await repoMod.initSubduction()
|
|
54
|
+
cachedRepoClass = repoMod.Repo as typeof Repo
|
|
55
|
+
return cachedRepoClass
|
|
52
56
|
}
|
|
53
57
|
|
|
54
58
|
/**
|
|
@@ -57,23 +61,23 @@ async function getRepoClass(): Promise<typeof Repo> {
|
|
|
57
61
|
* if any are found.
|
|
58
62
|
*/
|
|
59
63
|
async function hasCorruptStorage(dir: string): Promise<boolean> {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
try {
|
|
65
|
+
await fs.access(dir)
|
|
66
|
+
} catch {
|
|
67
|
+
return false
|
|
68
|
+
}
|
|
65
69
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
const entries = await fs.readdir(dir, {withFileTypes: true})
|
|
71
|
+
for (const entry of entries) {
|
|
72
|
+
const fullPath = path.join(dir, entry.name)
|
|
73
|
+
if (entry.isDirectory()) {
|
|
74
|
+
if (await hasCorruptStorage(fullPath)) return true
|
|
75
|
+
} else if (entry.isFile()) {
|
|
76
|
+
const stat = await fs.stat(fullPath)
|
|
77
|
+
if (stat.size === 0) return true
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return false
|
|
77
81
|
}
|
|
78
82
|
|
|
79
83
|
/**
|
|
@@ -88,55 +92,58 @@ async function hasCorruptStorage(dir: string): Promise<boolean> {
|
|
|
88
92
|
* adapter for sync via the automerge sync server.
|
|
89
93
|
*/
|
|
90
94
|
export async function createRepo(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
workingDir: string,
|
|
96
|
+
config: DirectoryConfig,
|
|
97
|
+
sub: boolean = false
|
|
94
98
|
): Promise<Repo> {
|
|
95
|
-
|
|
99
|
+
const RepoClass = await getRepoClass()
|
|
96
100
|
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
const syncToolDir = path.join(workingDir, ".pushwork")
|
|
102
|
+
const automergeDir = path.join(syncToolDir, "automerge")
|
|
99
103
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
// Detect and recover from corrupt local storage (0-byte files left by
|
|
105
|
+
// incomplete writes from a previous run). Wipe the cache so the Repo
|
|
106
|
+
// hydrates cleanly from the sync server.
|
|
107
|
+
if (await hasCorruptStorage(automergeDir)) {
|
|
108
|
+
console.warn("[pushwork] Corrupt local storage detected, clearing cache...")
|
|
109
|
+
await fs.rm(automergeDir, {recursive: true, force: true})
|
|
110
|
+
await fs.mkdir(automergeDir, {recursive: true})
|
|
111
|
+
}
|
|
108
112
|
|
|
109
|
-
|
|
113
|
+
const storage = new NodeFSStorageAdapter(automergeDir)
|
|
110
114
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
if (sub) {
|
|
116
|
+
const endpoints: string[] = []
|
|
117
|
+
if (config.sync_enabled && config.sync_server) {
|
|
118
|
+
endpoints.push(config.sync_server)
|
|
119
|
+
}
|
|
116
120
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
return new RepoClass({
|
|
122
|
+
storage,
|
|
123
|
+
// @ts-expect-error i don't know why
|
|
124
|
+
subductionWebsocketEndpoints: endpoints,
|
|
125
|
+
})
|
|
126
|
+
}
|
|
122
127
|
|
|
123
|
-
|
|
124
|
-
|
|
128
|
+
// Default: WebSocket sync adapter
|
|
129
|
+
const repoConfig: RepoConfig = {storage}
|
|
125
130
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
131
|
+
if (config.sync_enabled && config.sync_server) {
|
|
132
|
+
// Load the WebSocket adapter via ESM dynamic import to stay in the
|
|
133
|
+
// same module graph as the Repo.
|
|
134
|
+
const wsMod = await dynamicImport(
|
|
135
|
+
"@automerge/automerge-repo-network-websocket"
|
|
136
|
+
)
|
|
137
|
+
// The websocket adapter package (subduction.8) hasn't updated its
|
|
138
|
+
// NetworkAdapter base-class types to match the repo's new
|
|
139
|
+
// NetworkAdapterInterface (which added state() and stricter
|
|
140
|
+
// EventEmitter generics). At runtime the adapter has all required
|
|
141
|
+
// methods; this is purely a declaration mismatch.
|
|
142
|
+
const networkAdapter = new wsMod.BrowserWebSocketClientAdapter(
|
|
143
|
+
config.sync_server
|
|
144
|
+
) as unknown as NetworkAdapterInterface
|
|
145
|
+
repoConfig.network = [networkAdapter]
|
|
146
|
+
}
|
|
140
147
|
|
|
141
|
-
|
|
148
|
+
return new RepoClass(repoConfig)
|
|
142
149
|
}
|
|
File without changes
|
|
File without changes
|