pushwork 2.0.0-a.sub.1 → 2.0.0-preview

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.
Files changed (251) hide show
  1. package/dist/branches.d.ts +19 -0
  2. package/dist/branches.d.ts.map +1 -0
  3. package/dist/branches.js +111 -0
  4. package/dist/branches.js.map +1 -0
  5. package/dist/cli.d.ts +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +238 -272
  8. package/dist/cli.js.map +1 -1
  9. package/dist/config.d.ts +17 -0
  10. package/dist/config.d.ts.map +1 -0
  11. package/dist/config.js +84 -0
  12. package/dist/config.js.map +1 -0
  13. package/dist/fs-tree.d.ts +6 -0
  14. package/dist/fs-tree.d.ts.map +1 -0
  15. package/dist/fs-tree.js +99 -0
  16. package/dist/fs-tree.js.map +1 -0
  17. package/dist/ignore.d.ts +6 -0
  18. package/dist/ignore.d.ts.map +1 -0
  19. package/dist/ignore.js +74 -0
  20. package/dist/ignore.js.map +1 -0
  21. package/dist/index.d.ts +8 -4
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +34 -4
  24. package/dist/index.js.map +1 -1
  25. package/dist/log.d.ts +3 -0
  26. package/dist/log.d.ts.map +1 -0
  27. package/dist/log.js +14 -0
  28. package/dist/log.js.map +1 -0
  29. package/dist/pushwork.d.ts +115 -0
  30. package/dist/pushwork.d.ts.map +1 -0
  31. package/dist/pushwork.js +918 -0
  32. package/dist/pushwork.js.map +1 -0
  33. package/dist/repo.d.ts +14 -0
  34. package/dist/repo.d.ts.map +1 -0
  35. package/dist/repo.js +60 -0
  36. package/dist/repo.js.map +1 -0
  37. package/dist/shapes/custom.d.ts +3 -0
  38. package/dist/shapes/custom.d.ts.map +1 -0
  39. package/dist/shapes/custom.js +57 -0
  40. package/dist/shapes/custom.js.map +1 -0
  41. package/dist/shapes/file.d.ts +20 -0
  42. package/dist/shapes/file.d.ts.map +1 -0
  43. package/dist/shapes/file.js +140 -0
  44. package/dist/shapes/file.js.map +1 -0
  45. package/dist/shapes/index.d.ts +10 -0
  46. package/dist/shapes/index.d.ts.map +1 -0
  47. package/dist/shapes/index.js +35 -0
  48. package/dist/shapes/index.js.map +1 -0
  49. package/dist/shapes/patchwork-folder.d.ts +3 -0
  50. package/dist/shapes/patchwork-folder.d.ts.map +1 -0
  51. package/dist/shapes/patchwork-folder.js +160 -0
  52. package/dist/shapes/patchwork-folder.js.map +1 -0
  53. package/dist/shapes/types.d.ts +37 -0
  54. package/dist/shapes/types.d.ts.map +1 -0
  55. package/dist/shapes/types.js +52 -0
  56. package/dist/shapes/types.js.map +1 -0
  57. package/dist/shapes/vfs.d.ts +3 -0
  58. package/dist/shapes/vfs.d.ts.map +1 -0
  59. package/dist/shapes/vfs.js +88 -0
  60. package/dist/shapes/vfs.js.map +1 -0
  61. package/dist/stash.d.ts +23 -0
  62. package/dist/stash.d.ts.map +1 -0
  63. package/dist/stash.js +118 -0
  64. package/dist/stash.js.map +1 -0
  65. package/flake.lock +128 -0
  66. package/flake.nix +66 -0
  67. package/package.json +15 -48
  68. package/patches/@automerge__automerge-repo@2.6.0-subduction.15.patch +26 -0
  69. package/pnpm-workspace.yaml +5 -0
  70. package/src/branches.ts +93 -0
  71. package/src/cli.ts +258 -408
  72. package/src/config.ts +64 -0
  73. package/src/fs-tree.ts +70 -0
  74. package/src/ignore.ts +33 -0
  75. package/src/index.ts +38 -4
  76. package/src/log.ts +8 -0
  77. package/src/pushwork.ts +1055 -0
  78. package/src/repo.ts +76 -0
  79. package/src/shapes/custom.ts +29 -0
  80. package/src/shapes/file.ts +115 -0
  81. package/src/shapes/index.ts +19 -0
  82. package/src/shapes/patchwork-folder.ts +156 -0
  83. package/src/shapes/types.ts +79 -0
  84. package/src/shapes/vfs.ts +93 -0
  85. package/src/stash.ts +106 -0
  86. package/test/integration/branches.test.ts +389 -0
  87. package/test/integration/pushwork.test.ts +547 -0
  88. package/test/setup.ts +29 -0
  89. package/test/unit/doc-shape.test.ts +612 -0
  90. package/tsconfig.json +2 -3
  91. package/vitest.config.ts +14 -0
  92. package/ARCHITECTURE-ACCORDING-TO-CLAUDE.md +0 -248
  93. package/CLAUDE.md +0 -141
  94. package/README.md +0 -221
  95. package/babel.config.js +0 -5
  96. package/dist/cli/commands.d.ts +0 -71
  97. package/dist/cli/commands.d.ts.map +0 -1
  98. package/dist/cli/commands.js +0 -794
  99. package/dist/cli/commands.js.map +0 -1
  100. package/dist/cli/index.d.ts +0 -2
  101. package/dist/cli/index.d.ts.map +0 -1
  102. package/dist/cli/index.js +0 -19
  103. package/dist/cli/index.js.map +0 -1
  104. package/dist/commands.d.ts +0 -61
  105. package/dist/commands.d.ts.map +0 -1
  106. package/dist/commands.js +0 -861
  107. package/dist/commands.js.map +0 -1
  108. package/dist/config/index.d.ts +0 -71
  109. package/dist/config/index.d.ts.map +0 -1
  110. package/dist/config/index.js +0 -314
  111. package/dist/config/index.js.map +0 -1
  112. package/dist/core/change-detection.d.ts +0 -80
  113. package/dist/core/change-detection.d.ts.map +0 -1
  114. package/dist/core/change-detection.js +0 -523
  115. package/dist/core/change-detection.js.map +0 -1
  116. package/dist/core/config.d.ts +0 -81
  117. package/dist/core/config.d.ts.map +0 -1
  118. package/dist/core/config.js +0 -258
  119. package/dist/core/config.js.map +0 -1
  120. package/dist/core/index.d.ts +0 -6
  121. package/dist/core/index.d.ts.map +0 -1
  122. package/dist/core/index.js +0 -6
  123. package/dist/core/index.js.map +0 -1
  124. package/dist/core/move-detection.d.ts +0 -34
  125. package/dist/core/move-detection.d.ts.map +0 -1
  126. package/dist/core/move-detection.js +0 -121
  127. package/dist/core/move-detection.js.map +0 -1
  128. package/dist/core/snapshot.d.ts +0 -105
  129. package/dist/core/snapshot.d.ts.map +0 -1
  130. package/dist/core/snapshot.js +0 -217
  131. package/dist/core/snapshot.js.map +0 -1
  132. package/dist/core/sync-engine.d.ts +0 -157
  133. package/dist/core/sync-engine.d.ts.map +0 -1
  134. package/dist/core/sync-engine.js +0 -1379
  135. package/dist/core/sync-engine.js.map +0 -1
  136. package/dist/types/config.d.ts +0 -99
  137. package/dist/types/config.d.ts.map +0 -1
  138. package/dist/types/config.js +0 -5
  139. package/dist/types/config.js.map +0 -1
  140. package/dist/types/documents.d.ts +0 -88
  141. package/dist/types/documents.d.ts.map +0 -1
  142. package/dist/types/documents.js +0 -20
  143. package/dist/types/documents.js.map +0 -1
  144. package/dist/types/index.d.ts +0 -4
  145. package/dist/types/index.d.ts.map +0 -1
  146. package/dist/types/index.js +0 -4
  147. package/dist/types/index.js.map +0 -1
  148. package/dist/types/snapshot.d.ts +0 -64
  149. package/dist/types/snapshot.d.ts.map +0 -1
  150. package/dist/types/snapshot.js +0 -2
  151. package/dist/types/snapshot.js.map +0 -1
  152. package/dist/utils/content-similarity.d.ts +0 -53
  153. package/dist/utils/content-similarity.d.ts.map +0 -1
  154. package/dist/utils/content-similarity.js +0 -155
  155. package/dist/utils/content-similarity.js.map +0 -1
  156. package/dist/utils/content.d.ts +0 -10
  157. package/dist/utils/content.d.ts.map +0 -1
  158. package/dist/utils/content.js +0 -31
  159. package/dist/utils/content.js.map +0 -1
  160. package/dist/utils/directory.d.ts +0 -24
  161. package/dist/utils/directory.d.ts.map +0 -1
  162. package/dist/utils/directory.js +0 -52
  163. package/dist/utils/directory.js.map +0 -1
  164. package/dist/utils/fs.d.ts +0 -74
  165. package/dist/utils/fs.d.ts.map +0 -1
  166. package/dist/utils/fs.js +0 -248
  167. package/dist/utils/fs.js.map +0 -1
  168. package/dist/utils/index.d.ts +0 -5
  169. package/dist/utils/index.d.ts.map +0 -1
  170. package/dist/utils/index.js +0 -5
  171. package/dist/utils/index.js.map +0 -1
  172. package/dist/utils/mime-types.d.ts +0 -13
  173. package/dist/utils/mime-types.d.ts.map +0 -1
  174. package/dist/utils/mime-types.js +0 -209
  175. package/dist/utils/mime-types.js.map +0 -1
  176. package/dist/utils/network-sync.d.ts +0 -36
  177. package/dist/utils/network-sync.d.ts.map +0 -1
  178. package/dist/utils/network-sync.js +0 -250
  179. package/dist/utils/network-sync.js.map +0 -1
  180. package/dist/utils/node-polyfills.d.ts +0 -9
  181. package/dist/utils/node-polyfills.d.ts.map +0 -1
  182. package/dist/utils/node-polyfills.js +0 -9
  183. package/dist/utils/node-polyfills.js.map +0 -1
  184. package/dist/utils/output.d.ts +0 -129
  185. package/dist/utils/output.d.ts.map +0 -1
  186. package/dist/utils/output.js +0 -368
  187. package/dist/utils/output.js.map +0 -1
  188. package/dist/utils/repo-factory.d.ts +0 -13
  189. package/dist/utils/repo-factory.d.ts.map +0 -1
  190. package/dist/utils/repo-factory.js +0 -46
  191. package/dist/utils/repo-factory.js.map +0 -1
  192. package/dist/utils/string-similarity.d.ts +0 -14
  193. package/dist/utils/string-similarity.d.ts.map +0 -1
  194. package/dist/utils/string-similarity.js +0 -39
  195. package/dist/utils/string-similarity.js.map +0 -1
  196. package/dist/utils/text-diff.d.ts +0 -37
  197. package/dist/utils/text-diff.d.ts.map +0 -1
  198. package/dist/utils/text-diff.js +0 -93
  199. package/dist/utils/text-diff.js.map +0 -1
  200. package/dist/utils/trace.d.ts +0 -19
  201. package/dist/utils/trace.d.ts.map +0 -1
  202. package/dist/utils/trace.js +0 -63
  203. package/dist/utils/trace.js.map +0 -1
  204. package/src/commands.ts +0 -1134
  205. package/src/core/change-detection.ts +0 -712
  206. package/src/core/config.ts +0 -313
  207. package/src/core/index.ts +0 -5
  208. package/src/core/move-detection.ts +0 -169
  209. package/src/core/snapshot.ts +0 -275
  210. package/src/core/sync-engine.ts +0 -1795
  211. package/src/types/config.ts +0 -111
  212. package/src/types/documents.ts +0 -91
  213. package/src/types/index.ts +0 -3
  214. package/src/types/snapshot.ts +0 -67
  215. package/src/utils/content.ts +0 -34
  216. package/src/utils/directory.ts +0 -73
  217. package/src/utils/fs.ts +0 -297
  218. package/src/utils/index.ts +0 -4
  219. package/src/utils/mime-types.ts +0 -244
  220. package/src/utils/network-sync.ts +0 -319
  221. package/src/utils/node-polyfills.ts +0 -8
  222. package/src/utils/output.ts +0 -450
  223. package/src/utils/repo-factory.ts +0 -73
  224. package/src/utils/string-similarity.ts +0 -54
  225. package/src/utils/text-diff.ts +0 -101
  226. package/src/utils/trace.ts +0 -70
  227. package/test/integration/README.md +0 -328
  228. package/test/integration/clone-test.sh +0 -310
  229. package/test/integration/conflict-resolution-test.sh +0 -309
  230. package/test/integration/debug-both-nested.sh +0 -74
  231. package/test/integration/debug-concurrent-nested.sh +0 -87
  232. package/test/integration/debug-nested.sh +0 -73
  233. package/test/integration/deletion-behavior-test.sh +0 -487
  234. package/test/integration/deletion-sync-test-simple.sh +0 -193
  235. package/test/integration/deletion-sync-test.sh +0 -297
  236. package/test/integration/exclude-patterns.test.ts +0 -144
  237. package/test/integration/full-integration-test.sh +0 -363
  238. package/test/integration/fuzzer.test.ts +0 -818
  239. package/test/integration/in-memory-sync.test.ts +0 -830
  240. package/test/integration/init-sync.test.ts +0 -89
  241. package/test/integration/manual-sync-test.sh +0 -84
  242. package/test/integration/sync-deletion.test.ts +0 -280
  243. package/test/integration/sync-flow.test.ts +0 -291
  244. package/test/jest.setup.ts +0 -34
  245. package/test/run-tests.sh +0 -225
  246. package/test/unit/deletion-behavior.test.ts +0 -249
  247. package/test/unit/enhanced-mime-detection.test.ts +0 -244
  248. package/test/unit/snapshot.test.ts +0 -404
  249. package/test/unit/sync-convergence.test.ts +0 -298
  250. package/test/unit/sync-timing.test.ts +0 -134
  251. package/test/unit/utils.test.ts +0 -366
@@ -1,209 +0,0 @@
1
- import * as mimeTypes from "mime-types";
2
- /**
3
- * Custom MIME type definitions for developer files
4
- * Based on patchwork-cli's approach
5
- */
6
- const CUSTOM_MIME_TYPES = {
7
- // TypeScript files - override the incorrect video/mp2t detection
8
- ".ts": "text/typescript",
9
- ".tsx": "text/tsx",
10
- // Config file formats
11
- ".json": "application/json",
12
- ".yaml": "text/yaml",
13
- ".yml": "text/yaml",
14
- ".toml": "application/toml",
15
- ".ini": "text/plain",
16
- ".conf": "text/plain",
17
- ".config": "text/plain",
18
- // Vue.js single file components
19
- ".vue": "text/vue",
20
- // Modern CSS preprocessors
21
- ".scss": "text/scss",
22
- ".sass": "text/sass",
23
- ".less": "text/less",
24
- ".styl": "text/stylus",
25
- // Modern JavaScript variants
26
- ".mjs": "application/javascript",
27
- ".cjs": "application/javascript",
28
- // React JSX
29
- ".jsx": "text/jsx",
30
- // Svelte components
31
- ".svelte": "text/svelte",
32
- // Web assembly
33
- ".wasm": "application/wasm",
34
- // Other common dev files
35
- ".d.ts": "text/typescript",
36
- ".map": "application/json", // Source maps
37
- ".env": "text/plain",
38
- ".gitignore": "text/plain",
39
- ".gitattributes": "text/plain",
40
- ".editorconfig": "text/plain",
41
- ".prettierrc": "application/json",
42
- ".eslintrc": "application/json",
43
- ".babelrc": "application/json",
44
- // Documentation formats
45
- ".mdx": "text/markdown",
46
- ".rst": "text/x-rst",
47
- // Docker files
48
- Dockerfile: "text/plain",
49
- ".dockerignore": "text/plain",
50
- // Package manager files
51
- "package.json": "application/json",
52
- "package-lock.json": "application/json",
53
- "yarn.lock": "text/plain",
54
- "pnpm-lock.yaml": "text/yaml",
55
- "composer.json": "application/json",
56
- Pipfile: "text/plain",
57
- "requirements.txt": "text/plain",
58
- // Build tool configs
59
- "webpack.config.js": "application/javascript",
60
- "vite.config.js": "application/javascript",
61
- "rollup.config.js": "application/javascript",
62
- "tsconfig.json": "application/json",
63
- "jsconfig.json": "application/json",
64
- };
65
- /**
66
- * File extensions that should always be treated as text
67
- * regardless of MIME type detection
68
- */
69
- const FORCE_TEXT_EXTENSIONS = new Set([
70
- ".ts",
71
- ".tsx",
72
- ".jsx",
73
- ".vue",
74
- ".svelte",
75
- ".scss",
76
- ".sass",
77
- ".less",
78
- ".styl",
79
- ".env",
80
- ".gitignore",
81
- ".gitattributes",
82
- ".editorconfig",
83
- ".d.ts",
84
- ".map",
85
- ".mdx",
86
- ".rst",
87
- ".toml",
88
- ".ini",
89
- ".conf",
90
- ".config",
91
- ".lock",
92
- ]);
93
- /**
94
- * Get enhanced MIME type for file with custom dev file support
95
- */
96
- export function getEnhancedMimeType(filePath) {
97
- const normalized = normalizePathSeparators(filePath);
98
- const filename = normalized.split("/").pop() || "";
99
- const extension = getFileExtension(normalized);
100
- // Check custom definitions first (by extension)
101
- if (extension && CUSTOM_MIME_TYPES[extension]) {
102
- return CUSTOM_MIME_TYPES[extension];
103
- }
104
- // Check custom definitions by full filename
105
- if (CUSTOM_MIME_TYPES[filename]) {
106
- return CUSTOM_MIME_TYPES[filename];
107
- }
108
- // Fall back to standard mime-types library
109
- const standardMime = mimeTypes.lookup(normalized);
110
- if (standardMime) {
111
- return standardMime;
112
- }
113
- // Final fallback
114
- return "application/octet-stream";
115
- }
116
- /**
117
- * Check if file extension should be forced to text type
118
- */
119
- export function shouldForceAsText(filePath) {
120
- const extension = getFileExtension(filePath);
121
- return extension ? FORCE_TEXT_EXTENSIONS.has(extension) : false;
122
- }
123
- /**
124
- * Get file extension including the dot (internal helper)
125
- */
126
- function getFileExtension(filePath) {
127
- const match = filePath.match(/\.[^.]*$/);
128
- return match ? match[0].toLowerCase() : "";
129
- }
130
- /**
131
- * Normalize path separators to forward slashes for cross-platform consistency
132
- */
133
- function normalizePathSeparators(p) {
134
- return p.replace(/\\/g, "/");
135
- }
136
- /**
137
- * Enhanced text file detection with developer file support
138
- */
139
- export async function isEnhancedTextFile(filePath) {
140
- // Force certain extensions to be treated as text
141
- if (shouldForceAsText(filePath)) {
142
- return true;
143
- }
144
- // Check MIME type
145
- const mimeType = getEnhancedMimeType(filePath);
146
- if (isTextMimeType(mimeType)) {
147
- return true;
148
- }
149
- // If it's a known binary type (but not the generic fallback), don't fall back to content detection
150
- if (isBinaryMimeType(mimeType) && mimeType !== "application/octet-stream") {
151
- return false;
152
- }
153
- // For generic octet-stream or unknown types, use content-based detection
154
- return isTextByContent(filePath);
155
- }
156
- /**
157
- * Check if MIME type indicates text content
158
- */
159
- function isTextMimeType(mimeType) {
160
- return (mimeType.startsWith("text/") ||
161
- mimeType === "application/json" ||
162
- mimeType === "application/xml" ||
163
- mimeType === "application/javascript" ||
164
- mimeType === "application/typescript" ||
165
- mimeType === "application/toml" ||
166
- mimeType.includes("javascript") ||
167
- mimeType.includes("typescript") ||
168
- mimeType.includes("json") ||
169
- mimeType.includes("xml"));
170
- }
171
- /**
172
- * Check if MIME type indicates binary content
173
- */
174
- function isBinaryMimeType(mimeType) {
175
- return (mimeType.startsWith("image/") ||
176
- mimeType.startsWith("video/") ||
177
- mimeType.startsWith("audio/") ||
178
- mimeType.startsWith("font/") ||
179
- mimeType === "application/zip" ||
180
- mimeType === "application/pdf" ||
181
- mimeType === "application/octet-stream" ||
182
- mimeType === "application/wasm" ||
183
- mimeType.includes("binary"));
184
- }
185
- /**
186
- * Content-based text detection (fallback method)
187
- */
188
- async function isTextByContent(filePath) {
189
- try {
190
- const fs = await import("fs/promises");
191
- // Sample first 8KB to detect binary content
192
- const handle = await fs.open(filePath, "r");
193
- const stats = await handle.stat();
194
- const sampleSize = Math.min(8192, stats.size);
195
- if (sampleSize === 0) {
196
- await handle.close();
197
- return true; // Empty file is text
198
- }
199
- const buffer = Buffer.alloc(sampleSize);
200
- await handle.read(buffer, 0, sampleSize, 0);
201
- await handle.close();
202
- // Check for null bytes which indicate binary content
203
- return !buffer.includes(0);
204
- }
205
- catch {
206
- return false;
207
- }
208
- }
209
- //# sourceMappingURL=mime-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mime-types.js","sourceRoot":"","sources":["../../src/utils/mime-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAExC;;;GAGG;AACH,MAAM,iBAAiB,GAA2B;IAChD,iEAAiE;IACjE,KAAK,EAAE,iBAAiB;IACxB,MAAM,EAAE,UAAU;IAElB,sBAAsB;IACtB,OAAO,EAAE,kBAAkB;IAC3B,OAAO,EAAE,WAAW;IACpB,MAAM,EAAE,WAAW;IACnB,OAAO,E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AO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -1,36 +0,0 @@
1
- import { DocHandle, Repo, AutomergeUrl } from "@automerge/automerge-repo";
2
- /**
3
- * Wait for bidirectional sync to stabilize.
4
- * This function waits until document heads stop changing, indicating that
5
- * both outgoing and incoming sync has completed.
6
- *
7
- * With Subduction, sync is handled automatically by the transport layer.
8
- * We poll heads until they stabilize to confirm sync completion.
9
- *
10
- * @param repo - The Automerge repository
11
- * @param rootDirectoryUrl - The root directory URL to start traversal from
12
- * @param options - Configuration options
13
- */
14
- export declare function waitForBidirectionalSync(repo: Repo, rootDirectoryUrl: AutomergeUrl | undefined, options?: {
15
- timeoutMs?: number;
16
- pollIntervalMs?: number;
17
- stableChecksRequired?: number;
18
- handles?: DocHandle<unknown>[];
19
- }): Promise<void>;
20
- /**
21
- * Result of waitForSync — lists which handles failed to sync.
22
- */
23
- export interface SyncWaitResult {
24
- failed: DocHandle<unknown>[];
25
- }
26
- /**
27
- * Wait for documents to sync by polling head stability.
28
- *
29
- * With Subduction, sync is automatic via the transport layer.
30
- * We wait for each handle's heads to stabilize (stop changing),
31
- * which indicates the sync layer has finished processing.
32
- *
33
- * Processes handles in batches to avoid overwhelming the system.
34
- */
35
- export declare function waitForSync(handlesToWaitOn: DocHandle<unknown>[], timeoutMs?: number): Promise<SyncWaitResult>;
36
- //# sourceMappingURL=network-sync.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"network-sync.d.ts","sourceRoot":"","sources":["../../src/utils/network-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,YAAY,EACb,MAAM,2BAA2B,CAAC;AAUnC;;;;;;;;;;;GAWG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,IAAI,EACV,gBAAgB,EAAE,YAAY,GAAG,SAAS,EAC1C,OAAO,GAAE;IACP,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,OAAO,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;CAC3B,GACL,OAAO,CAAC,IAAI,CAAC,CAiFf;AA2FD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;CAC9B;AAKD;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAC/B,eAAe,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,EACrC,SAAS,GAAE,MAAc,GACxB,OAAO,CAAC,cAAc,CAAC,CAgDzB"}
@@ -1,250 +0,0 @@
1
- import { out } from "./output.js";
2
- import { getPlainUrl } from "./directory.js";
3
- const isDebug = !!process.env.DEBUG;
4
- function debug(...args) {
5
- if (isDebug)
6
- console.error("[pushwork:sync]", ...args);
7
- }
8
- /**
9
- * Wait for bidirectional sync to stabilize.
10
- * This function waits until document heads stop changing, indicating that
11
- * both outgoing and incoming sync has completed.
12
- *
13
- * With Subduction, sync is handled automatically by the transport layer.
14
- * We poll heads until they stabilize to confirm sync completion.
15
- *
16
- * @param repo - The Automerge repository
17
- * @param rootDirectoryUrl - The root directory URL to start traversal from
18
- * @param options - Configuration options
19
- */
20
- export async function waitForBidirectionalSync(repo, rootDirectoryUrl, options = {}) {
21
- const { timeoutMs = 10000, pollIntervalMs = 100, stableChecksRequired = 3, handles, } = options;
22
- if (!rootDirectoryUrl) {
23
- return;
24
- }
25
- const startTime = Date.now();
26
- let lastSeenHeads = new Map();
27
- let stableCount = 0;
28
- let pollCount = 0;
29
- let dynamicTimeoutMs = timeoutMs;
30
- debug(`waitForBidirectionalSync: starting (timeout=${timeoutMs}ms, stableChecks=${stableChecksRequired}${handles ? `, tracking ${handles.length} handles` : ', full tree scan'})`);
31
- while (Date.now() - startTime < dynamicTimeoutMs) {
32
- pollCount++;
33
- // Get current heads: use provided handles if available, otherwise full tree scan
34
- const currentHeads = handles
35
- ? getHandleHeads(handles)
36
- : await getAllDocumentHeads(repo, rootDirectoryUrl);
37
- // After first scan: scale timeout to tree size and reset the clock.
38
- // The first scan is just establishing a baseline — its duration
39
- // shouldn't count against the stability-wait timeout.
40
- if (pollCount === 1) {
41
- const scanDuration = Date.now() - startTime;
42
- dynamicTimeoutMs = Math.max(timeoutMs, 5000 + currentHeads.size * 50) + scanDuration;
43
- debug(`waitForBidirectionalSync: first scan took ${scanDuration}ms, timeout now ${dynamicTimeoutMs}ms for ${currentHeads.size} docs`);
44
- }
45
- // Check if heads are stable (no changes since last check)
46
- const isStable = headsMapEqual(lastSeenHeads, currentHeads);
47
- if (isStable) {
48
- stableCount++;
49
- debug(`waitForBidirectionalSync: stable check ${stableCount}/${stableChecksRequired} (${currentHeads.size} docs, poll #${pollCount})`);
50
- if (stableCount >= stableChecksRequired) {
51
- const elapsed = Date.now() - startTime;
52
- debug(`waitForBidirectionalSync: converged in ${elapsed}ms after ${pollCount} polls (${currentHeads.size} docs)`);
53
- out.taskLine(`Bidirectional sync converged (${currentHeads.size} docs, ${elapsed}ms)`);
54
- return; // Converged!
55
- }
56
- }
57
- else {
58
- // Find which docs changed
59
- if (lastSeenHeads.size > 0) {
60
- const changedDocs = [];
61
- for (const [url, heads] of currentHeads) {
62
- if (lastSeenHeads.get(url) !== heads) {
63
- changedDocs.push(url);
64
- }
65
- }
66
- const newDocs = currentHeads.size - lastSeenHeads.size;
67
- if (newDocs > 0) {
68
- debug(`waitForBidirectionalSync: ${newDocs} new docs discovered, ${changedDocs.length} docs changed heads (poll #${pollCount})`);
69
- }
70
- else if (changedDocs.length > 0) {
71
- debug(`waitForBidirectionalSync: ${changedDocs.length} docs changed heads: ${changedDocs.slice(0, 5).join(", ")}${changedDocs.length > 5 ? ` ...and ${changedDocs.length - 5} more` : ""} (poll #${pollCount})`);
72
- }
73
- }
74
- else {
75
- debug(`waitForBidirectionalSync: initial scan found ${currentHeads.size} docs (poll #${pollCount})`);
76
- }
77
- if (stableCount > 0) {
78
- debug(`waitForBidirectionalSync: heads changed after ${stableCount} stable checks, resetting`);
79
- }
80
- stableCount = 0;
81
- lastSeenHeads = currentHeads;
82
- }
83
- await new Promise((r) => setTimeout(r, pollIntervalMs));
84
- }
85
- // Timeout - but don't throw, just log a warning
86
- // The sync may still work, we just couldn't confirm stability
87
- const elapsed = Date.now() - startTime;
88
- debug(`waitForBidirectionalSync: timed out after ${elapsed}ms (${pollCount} polls, ${lastSeenHeads.size} docs tracked, reached ${stableCount}/${stableChecksRequired} stable checks)`);
89
- out.taskLine(`Bidirectional sync timed out after ${(elapsed / 1000).toFixed(1)}s - document heads were still changing after ${pollCount} checks across ${lastSeenHeads.size} docs (reached ${stableCount}/${stableChecksRequired} stability checks). This may mean another peer is actively editing, or the sync server is slow to relay changes. The sync will continue but some remote changes may not be reflected yet.`, true);
90
- }
91
- /**
92
- * Get heads from a pre-collected set of handles (cheap, synchronous reads).
93
- * Used for post-push stabilization where we already know which documents changed.
94
- */
95
- function getHandleHeads(handles) {
96
- const heads = new Map();
97
- for (const handle of handles) {
98
- heads.set(getPlainUrl(handle.url), JSON.stringify(handle.heads()));
99
- }
100
- return heads;
101
- }
102
- /**
103
- * Get all document heads in the directory hierarchy.
104
- * Returns a map of document URL -> serialized heads.
105
- * Uses plain URLs (without heads) to ensure we see current document state.
106
- */
107
- async function getAllDocumentHeads(repo, rootDirectoryUrl) {
108
- const heads = new Map();
109
- // Pass URL as-is; collectHeadsRecursive will strip heads
110
- await collectHeadsRecursive(repo, rootDirectoryUrl, heads);
111
- return heads;
112
- }
113
- /**
114
- * Recursively collect document heads from the directory hierarchy.
115
- * Uses getPlainUrl to strip heads and always see the CURRENT state of documents.
116
- */
117
- async function collectHeadsRecursive(repo, directoryUrl, heads) {
118
- try {
119
- const plainUrl = getPlainUrl(directoryUrl);
120
- const handle = await repo.find(plainUrl);
121
- const doc = await handle.doc();
122
- // Record this directory's heads (use plain URL as key for consistency)
123
- heads.set(plainUrl, JSON.stringify(handle.heads()));
124
- if (!doc || !doc.docs) {
125
- return;
126
- }
127
- // Process all entries in the directory concurrently
128
- await Promise.all(doc.docs.map(async (entry) => {
129
- if (entry.type === "folder") {
130
- // Recurse into subdirectory (entry.url may have stale heads)
131
- await collectHeadsRecursive(repo, entry.url, heads);
132
- }
133
- else if (entry.type === "file") {
134
- // Get file document heads (strip heads from entry.url)
135
- try {
136
- const fileUrl = getPlainUrl(entry.url);
137
- const fileHandle = await repo.find(fileUrl);
138
- heads.set(fileUrl, JSON.stringify(fileHandle.heads()));
139
- }
140
- catch {
141
- // File document may not exist yet
142
- }
143
- }
144
- }));
145
- }
146
- catch {
147
- // Directory may not exist yet
148
- }
149
- }
150
- /**
151
- * Compare two heads maps for equality.
152
- */
153
- function headsMapEqual(a, b) {
154
- if (a.size !== b.size) {
155
- return false;
156
- }
157
- for (const [key, value] of a) {
158
- if (b.get(key) !== value) {
159
- return false;
160
- }
161
- }
162
- return true;
163
- }
164
- /** Maximum documents to sync concurrently to avoid flooding the server */
165
- const SYNC_BATCH_SIZE = 10;
166
- /**
167
- * Wait for documents to sync by polling head stability.
168
- *
169
- * With Subduction, sync is automatic via the transport layer.
170
- * We wait for each handle's heads to stabilize (stop changing),
171
- * which indicates the sync layer has finished processing.
172
- *
173
- * Processes handles in batches to avoid overwhelming the system.
174
- */
175
- export async function waitForSync(handlesToWaitOn, timeoutMs = 60000) {
176
- const startTime = Date.now();
177
- if (handlesToWaitOn.length === 0) {
178
- debug("waitForSync: no documents to sync");
179
- return { failed: [] };
180
- }
181
- debug(`waitForSync: waiting for ${handlesToWaitOn.length} documents (timeout=${timeoutMs}ms, batchSize=${SYNC_BATCH_SIZE})`);
182
- out.taskLine(`Uploading: waiting for ${handlesToWaitOn.length} documents to sync`);
183
- // Process in batches to avoid flooding the server
184
- const failed = [];
185
- let synced = 0;
186
- for (let i = 0; i < handlesToWaitOn.length; i += SYNC_BATCH_SIZE) {
187
- const batch = handlesToWaitOn.slice(i, i + SYNC_BATCH_SIZE);
188
- const batchNum = Math.floor(i / SYNC_BATCH_SIZE) + 1;
189
- const totalBatches = Math.ceil(handlesToWaitOn.length / SYNC_BATCH_SIZE);
190
- if (totalBatches > 1) {
191
- debug(`waitForSync: batch ${batchNum}/${totalBatches} (${batch.length} docs)`);
192
- out.update(`Uploading batch ${batchNum}/${totalBatches} (${synced}/${handlesToWaitOn.length} done)`);
193
- }
194
- const results = await Promise.allSettled(batch.map(handle => waitForHandleHeadStability(handle, timeoutMs, startTime)));
195
- for (const result of results) {
196
- if (result.status === "rejected") {
197
- failed.push(result.reason);
198
- }
199
- else {
200
- synced++;
201
- }
202
- }
203
- }
204
- const elapsed = Date.now() - startTime;
205
- if (failed.length > 0) {
206
- debug(`waitForSync: ${failed.length} documents failed after ${elapsed}ms`);
207
- out.taskLine(`Upload: ${synced} synced, ${failed.length} failed after ${(elapsed / 1000).toFixed(1)}s`, true);
208
- }
209
- else {
210
- debug(`waitForSync: all ${handlesToWaitOn.length} documents synced in ${elapsed}ms`);
211
- out.taskLine(`All ${handlesToWaitOn.length} documents uploaded to server (${(elapsed / 1000).toFixed(1)}s)`);
212
- }
213
- return { failed };
214
- }
215
- /**
216
- * Wait for a single document handle's heads to stabilize.
217
- * Polls the handle's heads and waits until they remain unchanged
218
- * for several consecutive checks, indicating sync completion.
219
- *
220
- * Resolves with the handle on success, rejects with the handle on timeout.
221
- */
222
- function waitForHandleHeadStability(handle, timeoutMs, startTime) {
223
- return new Promise((resolve, reject) => {
224
- let lastHeads = JSON.stringify(handle.heads());
225
- let stableCount = 0;
226
- const stableRequired = 3;
227
- const pollInterval = setInterval(() => {
228
- const currentHeads = JSON.stringify(handle.heads());
229
- if (currentHeads === lastHeads) {
230
- stableCount++;
231
- if (stableCount >= stableRequired) {
232
- clearInterval(pollInterval);
233
- clearTimeout(timeout);
234
- debug(`waitForSync: ${handle.url}... converged in ${Date.now() - startTime}ms`);
235
- resolve(handle);
236
- }
237
- }
238
- else {
239
- stableCount = 0;
240
- lastHeads = currentHeads;
241
- }
242
- }, 100);
243
- const timeout = setTimeout(() => {
244
- clearInterval(pollInterval);
245
- debug(`waitForSync: ${handle.url}... timed out after ${timeoutMs}ms`);
246
- reject(handle);
247
- }, timeoutMs);
248
- });
249
- }
250
- //# sourceMappingURL=network-sync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"network-sync.js","sourceRoot":"","sources":["../../src/utils/network-sync.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;AACpC,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,IAAI,OAAO;QAAE,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,IAAI,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,IAAU,EACV,gBAA0C,EAC1C,UAKI,EAAE;IAEN,MAAM,EACJ,SAAS,GAAG,KAAK,EACjB,cAAc,GAAG,GAAG,EACpB,oBAAoB,GAAG,CAAC,EACxB,OAAO,GACR,GAAG,OAAO,CAAC;IAEZ,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,OAAO;IACT,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7B,IAAI,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC9C,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,gBAAgB,GAAG,SAAS,CAAC;IAEjC,KAAK,CAAC,+CAA+C,SAAS,oBAAoB,oBAAoB,GAAG,OAAO,CAAC,C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;YAC5B,KAAK,CAAC,gBAAgB,MAAM,CAAC,GAAG,uBAAuB,SAAS,IAAI,CAAC,CAAC;YACtE,MAAM,CAAC,MAAM,CAAC,CAAC;QACjB,CAAC,EAAE,SAAS,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,9 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"node-polyfills.d.ts","sourceRoot":"","sources":["../../src/utils/node-polyfills.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,qBAAqB,CAAC"}
@@ -1,9 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"node-polyfills.js","sourceRoot":"","sources":["../../src/utils/node-polyfills.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,qBAAqB,CAAC"}