pushwork 2.0.0-preview.4 → 2.0.0-preview.6

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 (122) hide show
  1. package/dist/branches.d.ts +2 -1
  2. package/dist/branches.d.ts.map +1 -1
  3. package/dist/branches.js +23 -4
  4. package/dist/branches.js.map +1 -1
  5. package/dist/checkpoints.d.ts +41 -0
  6. package/dist/checkpoints.d.ts.map +1 -0
  7. package/dist/checkpoints.js +210 -0
  8. package/dist/checkpoints.js.map +1 -0
  9. package/dist/stash.d.ts +2 -0
  10. package/dist/stash.d.ts.map +1 -1
  11. package/dist/stash.js +1 -0
  12. package/dist/stash.js.map +1 -1
  13. package/package.json +5 -5
  14. package/dist/cli/commands.d.ts +0 -71
  15. package/dist/cli/commands.d.ts.map +0 -1
  16. package/dist/cli/commands.js +0 -794
  17. package/dist/cli/commands.js.map +0 -1
  18. package/dist/cli/index.d.ts +0 -2
  19. package/dist/cli/index.d.ts.map +0 -1
  20. package/dist/cli/index.js +0 -19
  21. package/dist/cli/index.js.map +0 -1
  22. package/dist/commands.d.ts +0 -58
  23. package/dist/commands.d.ts.map +0 -1
  24. package/dist/commands.js +0 -975
  25. package/dist/commands.js.map +0 -1
  26. package/dist/config/index.d.ts +0 -71
  27. package/dist/config/index.d.ts.map +0 -1
  28. package/dist/config/index.js +0 -314
  29. package/dist/config/index.js.map +0 -1
  30. package/dist/core/change-detection.d.ts +0 -80
  31. package/dist/core/change-detection.d.ts.map +0 -1
  32. package/dist/core/change-detection.js +0 -560
  33. package/dist/core/change-detection.js.map +0 -1
  34. package/dist/core/config.d.ts +0 -81
  35. package/dist/core/config.d.ts.map +0 -1
  36. package/dist/core/config.js +0 -304
  37. package/dist/core/config.js.map +0 -1
  38. package/dist/core/index.d.ts +0 -6
  39. package/dist/core/index.d.ts.map +0 -1
  40. package/dist/core/index.js +0 -22
  41. package/dist/core/index.js.map +0 -1
  42. package/dist/core/move-detection.d.ts +0 -34
  43. package/dist/core/move-detection.d.ts.map +0 -1
  44. package/dist/core/move-detection.js +0 -128
  45. package/dist/core/move-detection.js.map +0 -1
  46. package/dist/core/snapshot.d.ts +0 -105
  47. package/dist/core/snapshot.d.ts.map +0 -1
  48. package/dist/core/snapshot.js +0 -254
  49. package/dist/core/snapshot.js.map +0 -1
  50. package/dist/core/sync-engine.d.ts +0 -177
  51. package/dist/core/sync-engine.d.ts.map +0 -1
  52. package/dist/core/sync-engine.js +0 -1471
  53. package/dist/core/sync-engine.js.map +0 -1
  54. package/dist/types/config.d.ts +0 -102
  55. package/dist/types/config.d.ts.map +0 -1
  56. package/dist/types/config.js +0 -10
  57. package/dist/types/config.js.map +0 -1
  58. package/dist/types/documents.d.ts +0 -88
  59. package/dist/types/documents.d.ts.map +0 -1
  60. package/dist/types/documents.js +0 -23
  61. package/dist/types/documents.js.map +0 -1
  62. package/dist/types/index.d.ts +0 -4
  63. package/dist/types/index.d.ts.map +0 -1
  64. package/dist/types/index.js +0 -20
  65. package/dist/types/index.js.map +0 -1
  66. package/dist/types/snapshot.d.ts +0 -64
  67. package/dist/types/snapshot.d.ts.map +0 -1
  68. package/dist/types/snapshot.js +0 -3
  69. package/dist/types/snapshot.js.map +0 -1
  70. package/dist/utils/content-similarity.d.ts +0 -53
  71. package/dist/utils/content-similarity.d.ts.map +0 -1
  72. package/dist/utils/content-similarity.js +0 -155
  73. package/dist/utils/content-similarity.js.map +0 -1
  74. package/dist/utils/content.d.ts +0 -10
  75. package/dist/utils/content.d.ts.map +0 -1
  76. package/dist/utils/content.js +0 -35
  77. package/dist/utils/content.js.map +0 -1
  78. package/dist/utils/directory.d.ts +0 -24
  79. package/dist/utils/directory.d.ts.map +0 -1
  80. package/dist/utils/directory.js +0 -56
  81. package/dist/utils/directory.js.map +0 -1
  82. package/dist/utils/fs.d.ts +0 -74
  83. package/dist/utils/fs.d.ts.map +0 -1
  84. package/dist/utils/fs.js +0 -298
  85. package/dist/utils/fs.js.map +0 -1
  86. package/dist/utils/index.d.ts +0 -5
  87. package/dist/utils/index.d.ts.map +0 -1
  88. package/dist/utils/index.js +0 -21
  89. package/dist/utils/index.js.map +0 -1
  90. package/dist/utils/mime-types.d.ts +0 -13
  91. package/dist/utils/mime-types.d.ts.map +0 -1
  92. package/dist/utils/mime-types.js +0 -247
  93. package/dist/utils/mime-types.js.map +0 -1
  94. package/dist/utils/network-sync.d.ts +0 -30
  95. package/dist/utils/network-sync.d.ts.map +0 -1
  96. package/dist/utils/network-sync.js +0 -391
  97. package/dist/utils/network-sync.js.map +0 -1
  98. package/dist/utils/node-polyfills.d.ts +0 -9
  99. package/dist/utils/node-polyfills.d.ts.map +0 -1
  100. package/dist/utils/node-polyfills.js +0 -9
  101. package/dist/utils/node-polyfills.js.map +0 -1
  102. package/dist/utils/output.d.ts +0 -129
  103. package/dist/utils/output.d.ts.map +0 -1
  104. package/dist/utils/output.js +0 -375
  105. package/dist/utils/output.js.map +0 -1
  106. package/dist/utils/repo-factory.d.ts +0 -15
  107. package/dist/utils/repo-factory.d.ts.map +0 -1
  108. package/dist/utils/repo-factory.js +0 -156
  109. package/dist/utils/repo-factory.js.map +0 -1
  110. package/dist/utils/string-similarity.d.ts +0 -14
  111. package/dist/utils/string-similarity.d.ts.map +0 -1
  112. package/dist/utils/string-similarity.js +0 -43
  113. package/dist/utils/string-similarity.js.map +0 -1
  114. package/dist/utils/text-diff.d.ts +0 -37
  115. package/dist/utils/text-diff.d.ts.map +0 -1
  116. package/dist/utils/text-diff.js +0 -131
  117. package/dist/utils/text-diff.js.map +0 -1
  118. package/dist/utils/trace.d.ts +0 -19
  119. package/dist/utils/trace.d.ts.map +0 -1
  120. package/dist/utils/trace.js +0 -68
  121. package/dist/utils/trace.js.map +0 -1
  122. package/patches/@automerge__automerge-repo@2.6.0-subduction.15.patch +0 -26
@@ -1,391 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.waitForBidirectionalSync = waitForBidirectionalSync;
37
- exports.waitForSync = waitForSync;
38
- const A = __importStar(require("@automerge/automerge"));
39
- const output_1 = require("./output");
40
- const directory_1 = require("./directory");
41
- const isDebug = !!process.env.DEBUG;
42
- function debug(...args) {
43
- if (isDebug)
44
- console.error("[pushwork:sync]", ...args);
45
- }
46
- /**
47
- * Wait for bidirectional sync to stabilize.
48
- * This function waits until document heads stop changing, indicating that
49
- * both outgoing and incoming sync has completed.
50
- *
51
- * @param repo - The Automerge repository
52
- * @param rootDirectoryUrl - The root directory URL to start traversal from
53
- * @param options - Configuration options
54
- */
55
- async function waitForBidirectionalSync(repo, rootDirectoryUrl, options = {}) {
56
- const { timeoutMs = 10000, pollIntervalMs = 100, stableChecksRequired = 3, handles, } = options;
57
- if (!rootDirectoryUrl) {
58
- return;
59
- }
60
- const startTime = Date.now();
61
- let lastSeenHeads = new Map();
62
- let stableCount = 0;
63
- let pollCount = 0;
64
- let dynamicTimeoutMs = timeoutMs;
65
- debug(`waitForBidirectionalSync: starting (timeout=${timeoutMs}ms, stableChecks=${stableChecksRequired}${handles ? `, tracking ${handles.length} handles` : ', full tree scan'})`);
66
- while (Date.now() - startTime < dynamicTimeoutMs) {
67
- pollCount++;
68
- // Get current heads: use provided handles if available, otherwise full tree scan
69
- const currentHeads = handles
70
- ? getHandleHeads(handles)
71
- : await getAllDocumentHeads(repo, rootDirectoryUrl);
72
- // After first scan: scale timeout to tree size and reset the clock.
73
- // The first scan is just establishing a baseline — its duration
74
- // shouldn't count against the stability-wait timeout.
75
- if (pollCount === 1) {
76
- const scanDuration = Date.now() - startTime;
77
- dynamicTimeoutMs = Math.max(timeoutMs, 5000 + currentHeads.size * 50) + scanDuration;
78
- debug(`waitForBidirectionalSync: first scan took ${scanDuration}ms, timeout now ${dynamicTimeoutMs}ms for ${currentHeads.size} docs`);
79
- }
80
- // Check if heads are stable (no changes since last check)
81
- const isStable = headsMapEqual(lastSeenHeads, currentHeads);
82
- if (isStable) {
83
- stableCount++;
84
- debug(`waitForBidirectionalSync: stable check ${stableCount}/${stableChecksRequired} (${currentHeads.size} docs, poll #${pollCount})`);
85
- if (stableCount >= stableChecksRequired) {
86
- const elapsed = Date.now() - startTime;
87
- debug(`waitForBidirectionalSync: converged in ${elapsed}ms after ${pollCount} polls (${currentHeads.size} docs)`);
88
- output_1.out.taskLine(`Bidirectional sync converged (${currentHeads.size} docs, ${elapsed}ms)`);
89
- return; // Converged!
90
- }
91
- }
92
- else {
93
- // Find which docs changed
94
- if (lastSeenHeads.size > 0) {
95
- const changedDocs = [];
96
- for (const [url, heads] of currentHeads) {
97
- if (lastSeenHeads.get(url) !== heads) {
98
- changedDocs.push(url);
99
- }
100
- }
101
- const newDocs = currentHeads.size - lastSeenHeads.size;
102
- if (newDocs > 0) {
103
- debug(`waitForBidirectionalSync: ${newDocs} new docs discovered, ${changedDocs.length} docs changed heads (poll #${pollCount})`);
104
- }
105
- else if (changedDocs.length > 0) {
106
- debug(`waitForBidirectionalSync: ${changedDocs.length} docs changed heads: ${changedDocs.slice(0, 5).join(", ")}${changedDocs.length > 5 ? ` ...and ${changedDocs.length - 5} more` : ""} (poll #${pollCount})`);
107
- }
108
- }
109
- else {
110
- debug(`waitForBidirectionalSync: initial scan found ${currentHeads.size} docs (poll #${pollCount})`);
111
- }
112
- if (stableCount > 0) {
113
- debug(`waitForBidirectionalSync: heads changed after ${stableCount} stable checks, resetting`);
114
- }
115
- stableCount = 0;
116
- lastSeenHeads = currentHeads;
117
- }
118
- await new Promise((r) => setTimeout(r, pollIntervalMs));
119
- }
120
- // Timeout - but don't throw, just log a warning
121
- // The sync may still work, we just couldn't confirm stability
122
- const elapsed = Date.now() - startTime;
123
- debug(`waitForBidirectionalSync: timed out after ${elapsed}ms (${pollCount} polls, ${lastSeenHeads.size} docs tracked, reached ${stableCount}/${stableChecksRequired} stable checks)`);
124
- output_1.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);
125
- }
126
- /**
127
- * Get heads from a pre-collected set of handles (cheap, synchronous reads).
128
- * Used for post-push stabilization where we already know which documents changed.
129
- */
130
- function getHandleHeads(handles) {
131
- const heads = new Map();
132
- for (const handle of handles) {
133
- heads.set((0, directory_1.getPlainUrl)(handle.url), JSON.stringify(handle.heads()));
134
- }
135
- return heads;
136
- }
137
- /**
138
- * Get all document heads in the directory hierarchy.
139
- * Returns a map of document URL -> serialized heads.
140
- * Uses plain URLs (without heads) to ensure we see current document state.
141
- */
142
- async function getAllDocumentHeads(repo, rootDirectoryUrl) {
143
- const heads = new Map();
144
- // Pass URL as-is; collectHeadsRecursive will strip heads
145
- await collectHeadsRecursive(repo, rootDirectoryUrl, heads);
146
- return heads;
147
- }
148
- /**
149
- * Recursively collect document heads from the directory hierarchy.
150
- * Uses getPlainUrl to strip heads and always see the CURRENT state of documents.
151
- */
152
- async function collectHeadsRecursive(repo, directoryUrl, heads) {
153
- try {
154
- const plainUrl = (0, directory_1.getPlainUrl)(directoryUrl);
155
- const handle = await repo.find(plainUrl);
156
- const doc = await handle.doc();
157
- // Record this directory's heads (use plain URL as key for consistency)
158
- heads.set(plainUrl, JSON.stringify(handle.heads()));
159
- if (!doc || !doc.docs) {
160
- return;
161
- }
162
- // Process all entries in the directory concurrently
163
- await Promise.all(doc.docs.map(async (entry) => {
164
- if (entry.type === "folder") {
165
- // Recurse into subdirectory (entry.url may have stale heads)
166
- await collectHeadsRecursive(repo, entry.url, heads);
167
- }
168
- else if (entry.type === "file") {
169
- // Get file document heads (strip heads from entry.url)
170
- try {
171
- const fileUrl = (0, directory_1.getPlainUrl)(entry.url);
172
- const fileHandle = await repo.find(fileUrl);
173
- heads.set(fileUrl, JSON.stringify(fileHandle.heads()));
174
- }
175
- catch {
176
- // File document may not exist yet
177
- }
178
- }
179
- }));
180
- }
181
- catch {
182
- // Directory may not exist yet
183
- }
184
- }
185
- /**
186
- * Compare two heads maps for equality.
187
- */
188
- function headsMapEqual(a, b) {
189
- if (a.size !== b.size) {
190
- return false;
191
- }
192
- for (const [key, value] of a) {
193
- if (b.get(key) !== value) {
194
- return false;
195
- }
196
- }
197
- return true;
198
- }
199
- /** Maximum documents to sync concurrently to avoid flooding the server */
200
- const SYNC_BATCH_SIZE = 10;
201
- /**
202
- * Wait for a single document handle to sync to the server.
203
- * Resolves with the handle on success, rejects with the handle on timeout.
204
- */
205
- function waitForHandleSync(handle, syncServerStorageId, timeoutMs, startTime) {
206
- return new Promise((resolve, reject) => {
207
- let pollInterval;
208
- const cleanup = () => {
209
- clearTimeout(timeout);
210
- clearInterval(pollInterval);
211
- handle.off("remote-heads", onRemoteHeads);
212
- };
213
- const onConverged = () => {
214
- debug(`waitForSync: ${handle.url}... converged in ${Date.now() - startTime}ms`);
215
- cleanup();
216
- resolve(handle);
217
- };
218
- const timeout = setTimeout(() => {
219
- debug(`waitForSync: ${handle.url}... timed out after ${timeoutMs}ms`);
220
- cleanup();
221
- reject(handle);
222
- }, timeoutMs);
223
- const isConverged = () => {
224
- const localHeads = handle.heads();
225
- const info = handle.getSyncInfo(syncServerStorageId);
226
- return A.equals(localHeads, info?.lastHeads);
227
- };
228
- const onRemoteHeads = ({ storageId, }) => {
229
- if (storageId === syncServerStorageId && isConverged()) {
230
- onConverged();
231
- }
232
- };
233
- // Initial check
234
- if (isConverged()) {
235
- cleanup();
236
- resolve(handle);
237
- return;
238
- }
239
- // Start polling and event listening
240
- pollInterval = setInterval(() => {
241
- if (isConverged()) {
242
- onConverged();
243
- }
244
- }, 100);
245
- handle.on("remote-heads", onRemoteHeads);
246
- });
247
- }
248
- /**
249
- * Wait for documents to sync to the remote server.
250
- * Processes handles in batches to avoid flooding the server.
251
- * Returns a result with any failed handles instead of throwing,
252
- * so callers can attempt recovery (e.g. recreating documents).
253
- */
254
- async function waitForSync(handlesToWaitOn, syncServerStorageId, timeoutMs = 60000) {
255
- const startTime = Date.now();
256
- if (handlesToWaitOn.length === 0) {
257
- debug("waitForSync: no documents to sync");
258
- return { failed: [] };
259
- }
260
- // When no StorageId is available (Subduction mode), use head-stability
261
- // polling. The SubductionSource handles sync internally — we just wait
262
- // for each handle's heads to stop changing.
263
- if (!syncServerStorageId) {
264
- debug(`waitForSync: no storage ID, using head-stability polling for ${handlesToWaitOn.length} documents`);
265
- output_1.out.taskLine(`Waiting for ${handlesToWaitOn.length} documents to sync`);
266
- return waitForSyncViaHeadStability(handlesToWaitOn, timeoutMs, startTime);
267
- }
268
- debug(`waitForSync: waiting for ${handlesToWaitOn.length} documents (timeout=${timeoutMs}ms, batchSize=${SYNC_BATCH_SIZE})`);
269
- // Separate already-synced from needs-sync
270
- const needsSync = [];
271
- let alreadySynced = 0;
272
- for (const handle of handlesToWaitOn) {
273
- const heads = handle.heads();
274
- const syncInfo = handle.getSyncInfo(syncServerStorageId);
275
- const remoteHeads = syncInfo?.lastHeads;
276
- if (A.equals(heads, remoteHeads)) {
277
- alreadySynced++;
278
- debug(`waitForSync: ${handle.url}... already synced`);
279
- }
280
- else {
281
- debug(`waitForSync: ${handle.url}... needs sync (remoteHeads=${remoteHeads ? 'present' : 'missing'})`);
282
- needsSync.push(handle);
283
- }
284
- }
285
- if (needsSync.length > 0) {
286
- debug(`waitForSync: ${alreadySynced} already synced, ${needsSync.length} need sync`);
287
- output_1.out.taskLine(`Uploading: ${alreadySynced}/${handlesToWaitOn.length} already synced, waiting for ${needsSync.length} more`);
288
- }
289
- else {
290
- debug(`waitForSync: all ${handlesToWaitOn.length} already synced`);
291
- return { failed: [] };
292
- }
293
- // Process in batches to avoid flooding the server
294
- const failed = [];
295
- let synced = alreadySynced;
296
- for (let i = 0; i < needsSync.length; i += SYNC_BATCH_SIZE) {
297
- const batch = needsSync.slice(i, i + SYNC_BATCH_SIZE);
298
- const batchNum = Math.floor(i / SYNC_BATCH_SIZE) + 1;
299
- const totalBatches = Math.ceil(needsSync.length / SYNC_BATCH_SIZE);
300
- if (totalBatches > 1) {
301
- debug(`waitForSync: batch ${batchNum}/${totalBatches} (${batch.length} docs)`);
302
- output_1.out.update(`Uploading batch ${batchNum}/${totalBatches} (${synced}/${handlesToWaitOn.length} done)`);
303
- }
304
- const results = await Promise.allSettled(batch.map(handle => waitForHandleSync(handle, syncServerStorageId, timeoutMs, startTime)));
305
- for (const result of results) {
306
- if (result.status === "rejected") {
307
- failed.push(result.reason);
308
- }
309
- else {
310
- synced++;
311
- }
312
- }
313
- }
314
- const elapsed = Date.now() - startTime;
315
- if (failed.length > 0) {
316
- debug(`waitForSync: ${failed.length} documents failed after ${elapsed}ms`);
317
- output_1.out.taskLine(`Upload: ${synced} synced, ${failed.length} failed after ${(elapsed / 1000).toFixed(1)}s`, true);
318
- }
319
- else {
320
- debug(`waitForSync: all ${handlesToWaitOn.length} documents synced in ${elapsed}ms (${alreadySynced} were already synced)`);
321
- output_1.out.taskLine(`All ${handlesToWaitOn.length} documents uploaded to server (${(elapsed / 1000).toFixed(1)}s)`);
322
- }
323
- return { failed };
324
- }
325
- /**
326
- * Wait for sync by polling head stability (Subduction mode).
327
- * Each handle's heads are polled until they remain unchanged for
328
- * several consecutive checks, indicating the SubductionSource has
329
- * finished syncing.
330
- */
331
- async function waitForSyncViaHeadStability(handles, timeoutMs, startTime) {
332
- const failed = [];
333
- let synced = 0;
334
- // Process in batches
335
- for (let i = 0; i < handles.length; i += SYNC_BATCH_SIZE) {
336
- const batch = handles.slice(i, i + SYNC_BATCH_SIZE);
337
- const results = await Promise.allSettled(batch.map(handle => waitForHandleHeadStability(handle, timeoutMs, startTime)));
338
- for (const result of results) {
339
- if (result.status === "rejected") {
340
- failed.push(result.reason);
341
- }
342
- else {
343
- synced++;
344
- }
345
- }
346
- }
347
- const elapsed = Date.now() - startTime;
348
- if (failed.length > 0) {
349
- debug(`waitForSync(heads): ${failed.length} documents failed after ${elapsed}ms`);
350
- output_1.out.taskLine(`Sync: ${synced} synced, ${failed.length} timed out after ${(elapsed / 1000).toFixed(1)}s`, true);
351
- }
352
- else {
353
- debug(`waitForSync(heads): all ${handles.length} documents synced in ${elapsed}ms`);
354
- output_1.out.taskLine(`All ${handles.length} documents synced (${(elapsed / 1000).toFixed(1)}s)`);
355
- }
356
- return { failed };
357
- }
358
- /**
359
- * Wait for a single handle's heads to stabilize.
360
- * Polls heads at 100ms intervals; resolves after 3 consecutive stable
361
- * checks, rejects on timeout.
362
- */
363
- function waitForHandleHeadStability(handle, timeoutMs, startTime) {
364
- return new Promise((resolve, reject) => {
365
- let lastHeads = JSON.stringify(handle.heads());
366
- let stableCount = 0;
367
- const stableRequired = 3;
368
- const pollInterval = setInterval(() => {
369
- const currentHeads = JSON.stringify(handle.heads());
370
- if (currentHeads === lastHeads) {
371
- stableCount++;
372
- if (stableCount >= stableRequired) {
373
- clearInterval(pollInterval);
374
- clearTimeout(timeout);
375
- debug(`waitForSync(heads): ${handle.url}... converged in ${Date.now() - startTime}ms`);
376
- resolve(handle);
377
- }
378
- }
379
- else {
380
- stableCount = 0;
381
- lastHeads = currentHeads;
382
- }
383
- }, 100);
384
- const timeout = setTimeout(() => {
385
- clearInterval(pollInterval);
386
- debug(`waitForSync(heads): ${handle.url}... timed out after ${timeoutMs}ms`);
387
- reject(handle);
388
- }, timeoutMs);
389
- });
390
- }
391
- //# sourceMappingURL=network-sync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"network-sync.js","sourceRoot":"","sources":["../../src/utils/network-sync.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,4DA0FC;AA6KD,kCAqFC;AA/WD,wDAA0C;AAC1C,qCAA+B;AAE/B,2CAA0C;AAE1C,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;;;;;;;;GAQG;AACI,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,C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I,OAAO,CAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACzD,IAAI,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QAC/C,IAAI,WAAW,GAAG,CAAC,CAAC;QACpB,MAAM,cAAc,GAAG,CAAC,CAAC;QAEzB,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;YACpC,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YACpD,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;gBAC/B,WAAW,EAAE,CAAC;gBACd,IAAI,WAAW,IAAI,cAAc,EAAE,CAAC;oBAClC,aAAa,CAAC,YAAY,CAAC,CAAC;oBAC5B,YAAY,CAAC,OAAO,CAAC,CAAC;oBACtB,KAAK,CAAC,uBAAuB,MAAM,CAAC,GAAG,oBAAoB,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,IAAI,CAAC,CAAC;oBACvF,OAAO,CAAC,MAAM,CAAC,CAAC;gBAClB,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,WAAW,GAAG,CAAC,CAAC;gBAChB,SAAS,GAAG,YAAY,CAAC;YAC3B,CAAC;QACH,CAAC,EAAE,GAAG,CAAC,CAAC;QAER,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;YAC9B,aAAa,CAAC,YAAY,CAAC,CAAC;YAC5B,KAAK,CAAC,uBAAuB,MAAM,CAAC,GAAG,uBAAuB,SAAS,IAAI,CAAC,CAAC;YAC7E,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"}
@@ -1,129 +0,0 @@
1
- /**
2
- * Clean terminal output manager (Singleton)
3
- * - Progress stays on one line (spinner updates in place)
4
- * - No emojis
5
- * - Background colors for section headers
6
- * - Minimal output
7
- * - Supports scrolling task lines (max-lines)
8
- */
9
- export declare class Output {
10
- #private;
11
- private static instance;
12
- private spinner;
13
- private taskStartTime;
14
- private taskOriginalMessage;
15
- private taskCurrentMessage;
16
- private taskLines;
17
- private taskMaxLines;
18
- private constructor();
19
- /**
20
- * Get the singleton instance
21
- */
22
- static getInstance(): Output;
23
- /**
24
- * Reset the singleton (useful for testing)
25
- */
26
- static reset(): void;
27
- /**
28
- * Start a task with spinner - updates in place
29
- * Completes any previous task before starting the new one
30
- * @param message - The task message
31
- * @param maxLines - Maximum number of task lines to show (0 = unlimited, lines scroll)
32
- */
33
- task(message: string, maxLines?: number): void;
34
- /**
35
- * Update spinner text (stays on same line)
36
- */
37
- update(message: string): void;
38
- /**
39
- * Add a line to the active task (appears below spinner, scrolls if max-lines set)
40
- * Lines are dimmed and temporary - they disappear when task completes unless kept
41
- * If no task is active, displays as a regular log message
42
- */
43
- taskLine(message: string, keepOnComplete?: boolean): void;
44
- /**
45
- * Clear all task lines (useful when you want to reset the scrolling window)
46
- */
47
- clearTaskLines(): void;
48
- /**
49
- * Complete task with optional duration display
50
- * Defaults to showing the original task message with duration
51
- * Task lines marked with keepOnComplete will be preserved, others are cleared
52
- */
53
- done(message?: string, showTime?: boolean): void;
54
- /**
55
- * Show an object as a table of key-value pairs
56
- * Filters out undefined values and applies optional transforms
57
- * Automatically calculates key padding from max key length
58
- */
59
- obj(obj: Record<string, any>, keyTransform?: (key: string) => string, valueTransform?: (value: any, key: string) => string): void;
60
- /**
61
- * Display array as bulleted list
62
- * Each item shown with dim bullet and white text
63
- */
64
- arr(items: any[]): void;
65
- /**
66
- * Show plain message with optional color
67
- */
68
- log(message: string, color?: "red" | "green" | "yellow" | "blue" | "cyan" | "magenta" | "gray" | "dim"): void;
69
- /**
70
- * Show success message (green text)
71
- */
72
- success(message: string): void;
73
- /**
74
- * Show success block (green background label + optional message)
75
- */
76
- successBlock(label: string, message?: string): void;
77
- /**
78
- * Show success message (green text)
79
- */
80
- spicy(message: string): void;
81
- /**
82
- * Show success block (green background label + optional message)
83
- */
84
- spicyBlock(label: string, message?: string): void;
85
- /**
86
- * Show message with rainbow gradient
87
- */
88
- rainbow(message: string): void;
89
- /**
90
- * Show info message (dim text)
91
- */
92
- info(message: string): void;
93
- /**
94
- * Show info block (grey background label + optional message)
95
- */
96
- infoBlock(label: string, message?: string): void;
97
- /**
98
- * Show error message (red text) - fails spinner if running
99
- */
100
- error(message: string | Error | unknown): void;
101
- /**
102
- * Show error block (red background label + optional message) - fails spinner if running
103
- */
104
- errorBlock(label: string, message?: string): void;
105
- /**
106
- * Show warning message (yellow text)
107
- */
108
- warn(message: string): void;
109
- /**
110
- * Show warning block (yellow background label + optional message)
111
- */
112
- warnBlock(label: string, message?: string): void;
113
- /**
114
- * Show detailed error information and exit the program
115
- * Use this when an unexpected/unrecoverable error occurs
116
- * Shows error message and stack trace, then exits
117
- */
118
- crash(error: unknown, exitCode?: number): never;
119
- /**
120
- * Exit with code
121
- */
122
- exit(code?: number): never;
123
- }
124
- /**
125
- * Global singleton output instance
126
- * Import and use this anywhere in your code
127
- */
128
- export declare const out: Output;
129
- //# sourceMappingURL=output.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,qBAAa,MAAM;;IACjB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAuB;IAC9C,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,mBAAmB,CAAuB;IAClD,OAAO,CAAC,kBAAkB,CAAuB;IACjD,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,YAAY,CAAa;IAEjC,OAAO;IAEP;;OAEG;IACH,MAAM,CAAC,WAAW,IAAI,MAAM;IAO5B;;OAEG;IACH,MAAM,CAAC,KAAK,IAAI,IAAI;IAQpB;;;;;OAKG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAU,GAAG,IAAI;IAcjD;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAO7B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,GAAE,OAAe,GAAG,IAAI;IAkBhE;;OAEG;IACH,cAAc,IAAI,IAAI;IAiCtB;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAE,OAAc,GAAG,IAAI;IAuCtD;;;;OAIG;IACH,GAAG,CACD,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACxB,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,EACtC,cAAc,CAAC,EAAE,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