wangchuan 5.5.0 → 5.6.0

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 (46) hide show
  1. package/dist/bin/wangchuan.js +1 -1
  2. package/dist/src/commands/init.d.ts.map +1 -1
  3. package/dist/src/commands/init.js +67 -22
  4. package/dist/src/commands/init.js.map +1 -1
  5. package/dist/src/core/config.js +1 -1
  6. package/dist/src/core/config.js.map +1 -1
  7. package/dist/src/core/crypto.d.ts.map +1 -1
  8. package/dist/src/core/crypto.js +3 -2
  9. package/dist/src/core/crypto.js.map +1 -1
  10. package/dist/src/core/migrate.d.ts.map +1 -1
  11. package/dist/src/core/migrate.js +1 -0
  12. package/dist/src/core/migrate.js.map +1 -1
  13. package/dist/src/core/sync-restore.d.ts +19 -0
  14. package/dist/src/core/sync-restore.d.ts.map +1 -0
  15. package/dist/src/core/sync-restore.js +339 -0
  16. package/dist/src/core/sync-restore.js.map +1 -0
  17. package/dist/src/core/sync-shared.d.ts +30 -0
  18. package/dist/src/core/sync-shared.d.ts.map +1 -0
  19. package/dist/src/core/sync-shared.js +397 -0
  20. package/dist/src/core/sync-shared.js.map +1 -0
  21. package/dist/src/core/sync-stage.d.ts +57 -0
  22. package/dist/src/core/sync-stage.d.ts.map +1 -0
  23. package/dist/src/core/sync-stage.js +429 -0
  24. package/dist/src/core/sync-stage.js.map +1 -0
  25. package/dist/src/core/sync.d.ts +22 -46
  26. package/dist/src/core/sync.d.ts.map +1 -1
  27. package/dist/src/core/sync.js +64 -1267
  28. package/dist/src/core/sync.js.map +1 -1
  29. package/dist/src/i18n.d.ts.map +1 -1
  30. package/dist/src/i18n.js +27 -2
  31. package/dist/src/i18n.js.map +1 -1
  32. package/dist/test/crypto.test.js +2 -2
  33. package/dist/test/crypto.test.js.map +1 -1
  34. package/dist/test/git.test.d.ts +5 -0
  35. package/dist/test/git.test.d.ts.map +1 -0
  36. package/dist/test/git.test.js +90 -0
  37. package/dist/test/git.test.js.map +1 -0
  38. package/dist/test/migrate.test.d.ts +9 -0
  39. package/dist/test/migrate.test.d.ts.map +1 -0
  40. package/dist/test/migrate.test.js +133 -0
  41. package/dist/test/migrate.test.js.map +1 -0
  42. package/dist/test/sync-lock.test.d.ts +5 -0
  43. package/dist/test/sync-lock.test.d.ts.map +1 -0
  44. package/dist/test/sync-lock.test.js +94 -0
  45. package/dist/test/sync-lock.test.js.map +1 -0
  46. package/package.json +2 -2
@@ -0,0 +1,429 @@
1
+ /**
2
+ * sync-stage.ts — Push direction: workspace → local repo directory
3
+ *
4
+ * Handles file staging, encryption change detection, integrity checksums,
5
+ * key fingerprint validation, sync metadata, and stale file detection.
6
+ */
7
+ import fs from 'fs';
8
+ import path from 'path';
9
+ import os from 'os';
10
+ import crypto from 'crypto';
11
+ import { cryptoEngine } from './crypto.js';
12
+ import { keyFingerprint } from './crypto.js';
13
+ import { jsonField } from './json-field.js';
14
+ import { validator } from '../utils/validator.js';
15
+ import { logger } from '../utils/logger.js';
16
+ import { walkDir } from './sync.js';
17
+ import { t } from '../i18n.js';
18
+ import chalk from 'chalk';
19
+ import { expandHome, buildFileEntries } from './sync.js';
20
+ import { distributeShared, savePendingDeletions } from './sync-shared.js';
21
+ const SYNC_META_FILE = 'sync-meta.json';
22
+ export function writeSyncMeta(repoPath, cfg) {
23
+ const meta = {
24
+ lastSyncAt: new Date().toISOString(),
25
+ hostname: cfg.hostname || os.hostname(),
26
+ environment: cfg.environment ?? 'default',
27
+ };
28
+ fs.writeFileSync(path.join(repoPath, SYNC_META_FILE), JSON.stringify(meta, null, 2), 'utf-8');
29
+ }
30
+ export function readSyncMeta(repoPath) {
31
+ const metaPath = path.join(repoPath, SYNC_META_FILE);
32
+ if (!fs.existsSync(metaPath))
33
+ return null;
34
+ try {
35
+ return JSON.parse(fs.readFileSync(metaPath, 'utf-8'));
36
+ }
37
+ catch {
38
+ return null;
39
+ }
40
+ }
41
+ // ── Integrity checksum ─────────────────────────────────────────────
42
+ const INTEGRITY_FILE = 'integrity.json';
43
+ /** Compute SHA-256 hash of a file */
44
+ function sha256File(filePath) {
45
+ const content = fs.readFileSync(filePath);
46
+ return crypto.createHash('sha256').update(content).digest('hex');
47
+ }
48
+ /** Write integrity.json to repo root after staging */
49
+ export function writeIntegrity(repoPath, syncedFiles, plaintextHashes) {
50
+ const checksums = {};
51
+ for (const repoRel of syncedFiles) {
52
+ const absPath = path.join(repoPath, repoRel);
53
+ if (fs.existsSync(absPath)) {
54
+ checksums[repoRel] = sha256File(absPath);
55
+ }
56
+ }
57
+ const manifest = {
58
+ generatedAt: new Date().toISOString(),
59
+ checksums,
60
+ ...(plaintextHashes && plaintextHashes.size > 0
61
+ ? { plaintextHashes: Object.fromEntries(plaintextHashes) }
62
+ : {}),
63
+ };
64
+ fs.writeFileSync(path.join(repoPath, INTEGRITY_FILE), JSON.stringify(manifest, null, 2), 'utf-8');
65
+ logger.debug(t('integrity.writing'));
66
+ }
67
+ /** Verify integrity.json checksums against repo files, return mismatched file list */
68
+ export function verifyIntegrity(repoPath) {
69
+ const manifestPath = path.join(repoPath, INTEGRITY_FILE);
70
+ if (!fs.existsSync(manifestPath)) {
71
+ logger.debug(t('integrity.missingChecksum'));
72
+ return [];
73
+ }
74
+ let manifest;
75
+ try {
76
+ manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
77
+ }
78
+ catch {
79
+ return [];
80
+ }
81
+ const mismatched = [];
82
+ for (const [repoRel, expectedHash] of Object.entries(manifest.checksums)) {
83
+ const absPath = path.join(repoPath, repoRel);
84
+ if (!fs.existsSync(absPath))
85
+ continue;
86
+ const actualHash = sha256File(absPath);
87
+ if (actualHash !== expectedHash) {
88
+ mismatched.push(repoRel);
89
+ logger.warn(t('integrity.mismatch', { file: repoRel }));
90
+ }
91
+ }
92
+ if (mismatched.length === 0) {
93
+ const count = Object.keys(manifest.checksums).length;
94
+ logger.debug(t('integrity.verified', { count }));
95
+ }
96
+ else {
97
+ logger.warn(t('integrity.mismatchCount', { count: mismatched.length }));
98
+ }
99
+ return mismatched;
100
+ }
101
+ /** Read stored plaintext hashes from integrity.json (for fast change detection) */
102
+ export function readPlaintextHashes(repoPath) {
103
+ const manifestPath = path.join(repoPath, INTEGRITY_FILE);
104
+ if (!fs.existsSync(manifestPath))
105
+ return new Map();
106
+ try {
107
+ const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
108
+ return new Map(Object.entries(manifest.plaintextHashes ?? {}));
109
+ }
110
+ catch {
111
+ return new Map();
112
+ }
113
+ }
114
+ // ── Key fingerprint validation ─────────────────────────────────────
115
+ const KEY_FINGERPRINT_FILE = 'key-fingerprint.json';
116
+ /** Write the local key's SHA-256 fingerprint to the repo */
117
+ export function writeKeyFingerprint(repoPath, keyPath) {
118
+ const fp = keyFingerprint(keyPath);
119
+ const manifest = {
120
+ fingerprint: fp,
121
+ updatedAt: new Date().toISOString(),
122
+ };
123
+ fs.writeFileSync(path.join(repoPath, KEY_FINGERPRINT_FILE), JSON.stringify(manifest, null, 2), 'utf-8');
124
+ }
125
+ /** Verify the local key matches the fingerprint stored in the repo */
126
+ export function verifyKeyFingerprint(repoPath, keyPath) {
127
+ const fpPath = path.join(repoPath, KEY_FINGERPRINT_FILE);
128
+ if (!fs.existsSync(fpPath)) {
129
+ logger.debug(t('keyFingerprint.notFound'));
130
+ return;
131
+ }
132
+ let manifest;
133
+ try {
134
+ manifest = JSON.parse(fs.readFileSync(fpPath, 'utf-8'));
135
+ }
136
+ catch {
137
+ return;
138
+ }
139
+ const localFp = keyFingerprint(keyPath);
140
+ if (localFp !== manifest.fingerprint) {
141
+ throw new Error(t('keyFingerprint.mismatchWithHint'));
142
+ }
143
+ logger.debug(t('keyFingerprint.verified'));
144
+ }
145
+ // ── Stale file detection ───────────────────────────────────────────
146
+ /**
147
+ * Detect stale files in repo (present in repo but absent from current entries).
148
+ * Returns the list of stale repoRel paths WITHOUT deleting them.
149
+ */
150
+ export function detectStaleFiles(repoPath, entries) {
151
+ const activeRepoRels = new Set(entries.map(e => e.repoRel));
152
+ const stale = [];
153
+ for (const topDir of ['agents', 'shared']) {
154
+ const scanRoot = path.join(repoPath, topDir);
155
+ if (!fs.existsSync(scanRoot))
156
+ continue;
157
+ for (const relFile of walkDir(scanRoot)) {
158
+ if (path.basename(relFile).startsWith('.'))
159
+ continue;
160
+ const repoRel = path.join(topDir, relFile);
161
+ if (!activeRepoRels.has(repoRel)) {
162
+ stale.push(repoRel);
163
+ }
164
+ }
165
+ }
166
+ return stale;
167
+ }
168
+ /**
169
+ * Actually delete stale files from repo (after user confirmation).
170
+ */
171
+ export function deleteStaleFiles(repoPath, staleFiles) {
172
+ for (const repoRel of staleFiles) {
173
+ const abs = path.join(repoPath, repoRel);
174
+ if (!fs.existsSync(abs))
175
+ continue;
176
+ fs.unlinkSync(abs);
177
+ logger.debug(` ${t('sync.pruneStale', { file: repoRel })}`);
178
+ const topDir = repoRel.split(path.sep)[0];
179
+ const scanRoot = path.join(repoPath, topDir);
180
+ let dir = path.dirname(abs);
181
+ while (dir !== scanRoot && dir.startsWith(scanRoot)) {
182
+ const remaining = fs.readdirSync(dir);
183
+ if (remaining.length === 0) {
184
+ fs.rmdirSync(dir);
185
+ dir = path.dirname(dir);
186
+ }
187
+ else {
188
+ break;
189
+ }
190
+ }
191
+ }
192
+ }
193
+ // ── Progress display ───────────────────────────────────────────────
194
+ /** Log a colorized progress line for stage/restore operations */
195
+ export function logProgress(index, total, tag, filePath) {
196
+ const counter = chalk.gray(`[${index}/${total}]`);
197
+ const tagColors = {
198
+ enc: chalk.magenta(t('sync.progress.enc')),
199
+ field: chalk.yellow(t('sync.progress.field')),
200
+ decrypted: chalk.cyan(t('sync.progress.decrypted')),
201
+ copy: chalk.white(t('sync.progress.copy')),
202
+ };
203
+ const coloredTag = tagColors[tag] ?? tag;
204
+ logger.info(` ${counter} ${coloredTag} ${chalk.white(filePath)}`);
205
+ }
206
+ // ── Change detection ───────────────────────────────────────────────
207
+ /** Check if a file's content matches a buffer (byte-equal for <64KB, SHA-256 for larger) */
208
+ export function contentUnchanged(existingPath, newContent) {
209
+ if (!fs.existsSync(existingPath))
210
+ return false;
211
+ const existingBuf = fs.readFileSync(existingPath);
212
+ if (existingBuf.length !== newContent.length)
213
+ return false;
214
+ if (newContent.length < 65536)
215
+ return existingBuf.equals(newContent);
216
+ const h1 = crypto.createHash('sha256').update(existingBuf).digest('hex');
217
+ const h2 = crypto.createHash('sha256').update(newContent).digest('hex');
218
+ return h1 === h2;
219
+ }
220
+ /**
221
+ * Check if an encrypted file's plaintext matches new plaintext content.
222
+ * Uses stored plaintext hashes for fast comparison (no decryption needed).
223
+ * Falls back to decrypt-compare when hashes are unavailable (backward compat).
224
+ */
225
+ export function encryptedPlaintextUnchanged(existingEncPath, newPlaintext, keyPath, repoRel, storedHashes) {
226
+ // Fast path: hash-based comparison (no decryption needed)
227
+ if (repoRel && storedHashes) {
228
+ const storedHash = storedHashes.get(repoRel);
229
+ if (storedHash) {
230
+ const newHash = crypto.createHash('sha256').update(newPlaintext).digest('hex');
231
+ return newHash === storedHash;
232
+ }
233
+ }
234
+ // Fallback: decrypt-compare (backward compat for repos without plaintextHashes)
235
+ if (!fs.existsSync(existingEncPath))
236
+ return false;
237
+ try {
238
+ const existingEnc = fs.readFileSync(existingEncPath, 'utf-8').trim();
239
+ const existingPlain = cryptoEngine.decryptString(existingEnc, keyPath);
240
+ return Buffer.from(existingPlain, 'utf-8').equals(newPlaintext);
241
+ }
242
+ catch {
243
+ return false;
244
+ }
245
+ }
246
+ // ── Stage progress (crash recovery) ────────────────────────────────
247
+ const STAGE_PROGRESS_PATH = path.join(os.homedir(), '.wangchuan', 'stage-progress.json');
248
+ /** Load stage progress from previous interrupted push */
249
+ export function loadStageProgress() {
250
+ if (!fs.existsSync(STAGE_PROGRESS_PATH))
251
+ return new Set();
252
+ try {
253
+ const prog = JSON.parse(fs.readFileSync(STAGE_PROGRESS_PATH, 'utf-8'));
254
+ return new Set(prog.completedRels);
255
+ }
256
+ catch {
257
+ return new Set();
258
+ }
259
+ }
260
+ /** Append a successfully staged file to the progress marker */
261
+ function appendStageProgress(repoRel) {
262
+ let prog;
263
+ try {
264
+ prog = JSON.parse(fs.readFileSync(STAGE_PROGRESS_PATH, 'utf-8'));
265
+ }
266
+ catch {
267
+ prog = { startedAt: new Date().toISOString(), completedRels: [] };
268
+ }
269
+ prog.completedRels.push(repoRel);
270
+ fs.mkdirSync(path.dirname(STAGE_PROGRESS_PATH), { recursive: true });
271
+ fs.writeFileSync(STAGE_PROGRESS_PATH, JSON.stringify(prog), 'utf-8');
272
+ }
273
+ /** Clear stage progress on successful completion */
274
+ export function clearStageProgress() {
275
+ if (fs.existsSync(STAGE_PROGRESS_PATH))
276
+ fs.unlinkSync(STAGE_PROGRESS_PATH);
277
+ }
278
+ // ── Main push function ─────────────────────────────────────────────
279
+ /**
280
+ * Push: distribute shared content to all agents, then collect files to repo.
281
+ */
282
+ export async function stageToRepo(cfg, agent, filter) {
283
+ // Distribute shared resources to all agents before full push
284
+ if (!agent) {
285
+ distributeShared(cfg);
286
+ }
287
+ const repoPath = expandHome(cfg.localRepoPath);
288
+ const keyPath = expandHome(cfg.keyPath);
289
+ // Verify key fingerprint before pushing
290
+ verifyKeyFingerprint(repoPath, keyPath);
291
+ const entries = buildFileEntries(cfg, undefined, agent, filter);
292
+ const result = { synced: [], skipped: [], encrypted: [], deleted: [], unchanged: [] };
293
+ let progressIdx = 0;
294
+ const totalEntries = entries.length;
295
+ // Load stored plaintext hashes for fast encrypted change detection
296
+ const storedHashes = readPlaintextHashes(repoPath);
297
+ const plaintextHashMap = new Map();
298
+ // Load stage progress for crash recovery
299
+ const previousProgress = loadStageProgress();
300
+ if (previousProgress.size > 0) {
301
+ logger.info(t('sync.resuming', { count: previousProgress.size }));
302
+ }
303
+ for (const entry of entries) {
304
+ // Skip files already staged in a previous interrupted push
305
+ if (previousProgress.has(entry.repoRel)) {
306
+ result.synced.push(entry.repoRel);
307
+ logger.debug(t('sync.resumeSkip', { file: entry.repoRel }));
308
+ continue;
309
+ }
310
+ if (!fs.existsSync(entry.srcAbs)) {
311
+ logger.debug(t('sync.skipNotFound', { path: entry.srcAbs }));
312
+ result.skipped.push(entry.srcAbs);
313
+ continue;
314
+ }
315
+ const destAbs = path.join(repoPath, entry.repoRel);
316
+ fs.mkdirSync(path.dirname(destAbs), { recursive: true });
317
+ // ── JSON field-level extraction ────────────────────────────
318
+ if (entry.jsonExtract) {
319
+ try {
320
+ const fullJson = JSON.parse(fs.readFileSync(entry.srcAbs, 'utf-8'));
321
+ const partial = jsonField.extractFields(fullJson, entry.jsonExtract.fields);
322
+ const content = JSON.stringify(partial, null, 2);
323
+ if (entry.encrypt) {
324
+ const contentBuf = Buffer.from(content, 'utf-8');
325
+ if (encryptedPlaintextUnchanged(destAbs, contentBuf, keyPath, entry.repoRel, storedHashes)) {
326
+ result.unchanged.push(entry.repoRel);
327
+ continue;
328
+ }
329
+ const encrypted = cryptoEngine.encryptString(content, keyPath);
330
+ fs.writeFileSync(destAbs, encrypted, 'utf-8');
331
+ result.encrypted.push(entry.repoRel);
332
+ // Store plaintext hash
333
+ plaintextHashMap.set(entry.repoRel, crypto.createHash('sha256').update(contentBuf).digest('hex'));
334
+ }
335
+ else {
336
+ const newBuf = Buffer.from(content, 'utf-8');
337
+ if (contentUnchanged(destAbs, newBuf)) {
338
+ result.unchanged.push(entry.repoRel);
339
+ continue;
340
+ }
341
+ fs.writeFileSync(destAbs, content, 'utf-8');
342
+ }
343
+ result.synced.push(entry.repoRel);
344
+ progressIdx++;
345
+ logProgress(progressIdx, totalEntries, 'field', entry.repoRel);
346
+ appendStageProgress(entry.repoRel);
347
+ }
348
+ catch (err) {
349
+ logger.warn(t('sync.skipJsonParse', { path: entry.srcAbs, error: err.message }));
350
+ result.skipped.push(entry.repoRel);
351
+ }
352
+ continue;
353
+ }
354
+ // ── Whole-file sync ────────────────────────────────────────
355
+ if (!entry.encrypt) {
356
+ const srcBuf = fs.readFileSync(entry.srcAbs);
357
+ if (contentUnchanged(destAbs, srcBuf)) {
358
+ result.unchanged.push(entry.repoRel);
359
+ continue;
360
+ }
361
+ const content = srcBuf.toString('utf-8');
362
+ if (validator.containsSensitiveData(content)) {
363
+ logger.warn(` ${t('sync.sensitiveData', { path: entry.srcAbs })}`);
364
+ logger.warn(` ${t('sync.suggestEncrypt')}`);
365
+ }
366
+ }
367
+ if (entry.encrypt) {
368
+ const srcBuf = fs.readFileSync(entry.srcAbs);
369
+ if (encryptedPlaintextUnchanged(destAbs, srcBuf, keyPath, entry.repoRel, storedHashes)) {
370
+ result.unchanged.push(entry.repoRel);
371
+ continue;
372
+ }
373
+ cryptoEngine.encryptFile(entry.srcAbs, destAbs, keyPath);
374
+ result.encrypted.push(entry.repoRel);
375
+ // Store plaintext hash
376
+ plaintextHashMap.set(entry.repoRel, crypto.createHash('sha256').update(srcBuf).digest('hex'));
377
+ progressIdx++;
378
+ logProgress(progressIdx, totalEntries, 'enc', entry.repoRel);
379
+ }
380
+ else {
381
+ fs.copyFileSync(entry.srcAbs, destAbs);
382
+ progressIdx++;
383
+ logProgress(progressIdx, totalEntries, 'copy', entry.repoRel);
384
+ }
385
+ result.synced.push(entry.repoRel);
386
+ appendStageProgress(entry.repoRel);
387
+ }
388
+ // ── Detect stale files in repo (full push only, skip when filtering) ──
389
+ if (!agent && !filter) {
390
+ const syncedEntries = entries.filter(e => fs.existsSync(e.srcAbs));
391
+ const stale = detectStaleFiles(repoPath, syncedEntries);
392
+ if (stale.length > 0) {
393
+ const isTTY = process.stdin.isTTY === true;
394
+ if (isTTY) {
395
+ logger.warn(t('sync.pendingDeletions', { count: stale.length }));
396
+ for (const f of stale)
397
+ logger.warn(` ${t('sync.pruneCandidate', { file: f })}`);
398
+ const rl = await import('readline');
399
+ const iface = rl.createInterface({ input: process.stdin, output: process.stdout });
400
+ const answer = await new Promise(resolve => {
401
+ iface.question(t('sync.confirmDelete'), (ans) => { iface.close(); resolve(ans.trim().toLowerCase()); });
402
+ });
403
+ if (answer === 'y' || answer === 'yes' || answer === '') {
404
+ deleteStaleFiles(repoPath, stale);
405
+ result.deleted.push(...stale);
406
+ }
407
+ else {
408
+ logger.info(t('sync.deletionSkipped'));
409
+ }
410
+ }
411
+ else {
412
+ savePendingDeletions(stale);
413
+ logger.info(t('sync.deletionDeferred', { count: stale.length }));
414
+ }
415
+ }
416
+ }
417
+ // Write sync metadata to repo root
418
+ writeSyncMeta(repoPath, cfg);
419
+ // Write integrity checksums for all synced files (with plaintext hashes)
420
+ if (result.synced.length > 0) {
421
+ writeIntegrity(repoPath, result.synced, plaintextHashMap);
422
+ }
423
+ // Write key fingerprint
424
+ writeKeyFingerprint(repoPath, keyPath);
425
+ // Clear stage progress on successful completion
426
+ clearStageProgress();
427
+ return result;
428
+ }
429
+ //# sourceMappingURL=sync-stage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-stage.js","sourceRoot":"","sources":["../../../src/core/sync-stage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAQ,IAAI,CAAC;AACtB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAQ,IAAI,CAAC;AACtB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAS,iBAAiB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAS,uBAAuB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAY,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAW,WAAW,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAiB,YAAY,CAAC;AAC1C,OAAO,KAAK,MAAiB,OAAO,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACzD,OA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B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,uBAAuB,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YACnE,CAAC;QACH,CAAC;IACH,CAAC;IAED,mCAAmC;IACnC,aAAa,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAE7B,yEAAyE;IACzE,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC5D,CAAC;IAED,wBAAwB;IACxB,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAEvC,gDAAgD;IAChD,kBAAkB,EAAE,CAAC;IAErB,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,18 +1,18 @@
1
1
  /**
2
- * sync.ts — Core sync engine
2
+ * sync.ts — Core sync engine barrel module
3
3
  *
4
- * Three directions:
5
- * stageToRepo workspace local repo directory (pre-push staging)
6
- * restoreFromRepo local repo directory workspace (post-pull restore)
7
- * diff compare both sides, return diff summary
4
+ * Re-exports from sub-modules:
5
+ * sync-shared.ts — cross-agent sharing distribution
6
+ * sync-stage.ts — push direction (workspace repo)
7
+ * sync-restore.ts — pull direction (repo workspace)
8
8
  *
9
- * Supports two-tier sync:
10
- * shared — cross-agent sharing (skills, MCP templates, shared memory)
11
- * agents/* — per-agent cross-environment sync
12
- *
13
- * All methods accept an optional agent filter parameter to operate on a specific agent's files only.
9
+ * Keeps shared utilities: expandHome, ignore patterns, file entry building, diff.
14
10
  */
15
- import type { WangchuanConfig, FileEntry, StageResult, RestoreResult, DiffResult, AgentName, FilterOptions, PendingDistribution } from '../types.js';
11
+ import type { WangchuanConfig, FileEntry, DiffResult, AgentName, FilterOptions } from '../types.js';
12
+ export { distributeShared, loadPendingDeletions, clearPendingDeletions, loadPendingDistributions, clearPendingDistributions, processPendingDistributions, } from './sync-shared.js';
13
+ export { stageToRepo, writeSyncMeta, readSyncMeta, writeIntegrity, verifyIntegrity, writeKeyFingerprint, verifyKeyFingerprint, detectStaleFiles, deleteStaleFiles, logProgress, contentUnchanged, encryptedPlaintextUnchanged, readPlaintextHashes, loadStageProgress, clearStageProgress, } from './sync-stage.js';
14
+ export type { SyncMeta, IntegrityManifest } from './sync-stage.js';
15
+ export { restoreFromRepo, backupBeforeRestore, rotateBackups, } from './sync-restore.js';
16
16
  export declare function expandHome(p: string): string;
17
17
  /**
18
18
  * Load ignore patterns from ~/.wangchuan/.wangchuanignore.
@@ -29,38 +29,18 @@ export declare function resetIgnoreCache(): void;
29
29
  * - Basename-only patterns (no `/`) match against the filename
30
30
  */
31
31
  export declare function matchesIgnore(relPath: string, patterns: readonly string[]): boolean;
32
+ /** Walk directory with .wangchuanignore filtering */
33
+ export declare function walkDir(dirAbs: string): string[];
32
34
  /**
33
35
  * Build the list of file entries to sync (single source of truth for all sync directions).
34
- *
35
- * @param repoDirBase Pass local repo root to scan syncDirs from repo side (pull direction)
36
- * @param agent Only return entries for specified agent, undefined = all
37
- * @param filter Optional --only / --exclude filtering
38
36
  */
39
37
  export declare function buildFileEntries(cfg: WangchuanConfig, repoDirBase?: string, agent?: AgentName | string, filter?: FilterOptions): FileEntry[];
40
- /**
41
- * Actually delete stale files from repo (after user confirmation).
42
- */
43
- export declare function deleteStaleFiles(repoPath: string, staleFiles: string[]): void;
44
- /** Load pending deletions */
45
- export declare function loadPendingDeletions(): string[];
46
- /** Clear pending deletions after confirmation */
47
- export declare function clearPendingDeletions(): void;
48
- /** Load pending distributions */
49
- export declare function loadPendingDistributions(): PendingDistribution[];
50
- /** Clear pending distributions after processing */
51
- export declare function clearPendingDistributions(): void;
52
- /**
53
- * Process pending distributions interactively.
54
- * Groups by relFile, prompts user for each, executes the chosen actions.
55
- */
56
- export declare function processPendingDistributions(cfg: WangchuanConfig): Promise<void>;
57
- /** Sync metadata stored in repo root */
58
- export interface SyncMeta {
59
- readonly lastSyncAt: string;
60
- readonly hostname: string;
61
- readonly environment: string;
62
- }
63
- declare function readSyncMeta(repoPath: string): SyncMeta | null;
38
+ declare function diff(cfg: WangchuanConfig, agent?: AgentName | string, filter?: FilterOptions): Promise<DiffResult>;
39
+ import { stageToRepo } from './sync-stage.js';
40
+ import { readSyncMeta } from './sync-stage.js';
41
+ import { deleteStaleFiles } from './sync-stage.js';
42
+ import { restoreFromRepo } from './sync-restore.js';
43
+ import { loadPendingDeletions, clearPendingDeletions, loadPendingDistributions, clearPendingDistributions, processPendingDistributions } from './sync-shared.js';
64
44
  export declare const syncEngine: {
65
45
  readonly expandHome: typeof expandHome;
66
46
  readonly buildFileEntries: typeof buildFileEntries;
@@ -71,12 +51,8 @@ export declare const syncEngine: {
71
51
  readonly loadPendingDistributions: typeof loadPendingDistributions;
72
52
  readonly clearPendingDistributions: typeof clearPendingDistributions;
73
53
  readonly processPendingDistributions: typeof processPendingDistributions;
74
- /**
75
- * Push: distribute shared content to all agents, then collect files to repo.
76
- */
77
- readonly stageToRepo: (cfg: WangchuanConfig, agent?: AgentName | string, filter?: FilterOptions) => Promise<StageResult>;
78
- readonly restoreFromRepo: (cfg: WangchuanConfig, agent?: AgentName | string, filter?: FilterOptions) => Promise<RestoreResult>;
79
- readonly diff: (cfg: WangchuanConfig, agent?: AgentName | string, filter?: FilterOptions) => Promise<DiffResult>;
54
+ readonly stageToRepo: typeof stageToRepo;
55
+ readonly restoreFromRepo: typeof restoreFromRepo;
56
+ readonly diff: typeof diff;
80
57
  };
81
- export {};
82
58
  //# sourceMappingURL=sync.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../src/core/sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAiBH,OAAO,KAAK,EACV,eAAe,EACf,SAAS,EACT,WAAW,EACX,aAAa,EACb,UAAU,EACV,SAAS,EAGT,aAAa,EACb,mBAAmB,EACpB,MAAM,aAAa,CA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