@fern-api/replay 0.5.0 → 0.6.1

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 (78) hide show
  1. package/dist/cli.cjs +16642 -0
  2. package/dist/cli.cjs.map +1 -0
  3. package/dist/index.cjs +2014 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +463 -0
  6. package/dist/index.d.ts +463 -12
  7. package/dist/index.js +1968 -10
  8. package/dist/index.js.map +1 -1
  9. package/package.json +16 -6
  10. package/dist/FernignoreMigrator.d.ts +0 -65
  11. package/dist/FernignoreMigrator.d.ts.map +0 -1
  12. package/dist/FernignoreMigrator.js +0 -237
  13. package/dist/FernignoreMigrator.js.map +0 -1
  14. package/dist/LockfileManager.d.ts +0 -31
  15. package/dist/LockfileManager.d.ts.map +0 -1
  16. package/dist/LockfileManager.js +0 -124
  17. package/dist/LockfileManager.js.map +0 -1
  18. package/dist/ReplayApplicator.d.ts +0 -62
  19. package/dist/ReplayApplicator.d.ts.map +0 -1
  20. package/dist/ReplayApplicator.js +0 -533
  21. package/dist/ReplayApplicator.js.map +0 -1
  22. package/dist/ReplayCommitter.d.ts +0 -39
  23. package/dist/ReplayCommitter.d.ts.map +0 -1
  24. package/dist/ReplayCommitter.js +0 -84
  25. package/dist/ReplayCommitter.js.map +0 -1
  26. package/dist/ReplayDetector.d.ts +0 -27
  27. package/dist/ReplayDetector.d.ts.map +0 -1
  28. package/dist/ReplayDetector.js +0 -150
  29. package/dist/ReplayDetector.js.map +0 -1
  30. package/dist/ReplayService.d.ts +0 -113
  31. package/dist/ReplayService.d.ts.map +0 -1
  32. package/dist/ReplayService.js +0 -579
  33. package/dist/ReplayService.js.map +0 -1
  34. package/dist/ThreeWayMerge.d.ts +0 -11
  35. package/dist/ThreeWayMerge.d.ts.map +0 -1
  36. package/dist/ThreeWayMerge.js +0 -48
  37. package/dist/ThreeWayMerge.js.map +0 -1
  38. package/dist/cli.d.ts +0 -3
  39. package/dist/cli.d.ts.map +0 -1
  40. package/dist/cli.js +0 -462
  41. package/dist/cli.js.map +0 -1
  42. package/dist/commands/bootstrap.d.ts +0 -46
  43. package/dist/commands/bootstrap.d.ts.map +0 -1
  44. package/dist/commands/bootstrap.js +0 -262
  45. package/dist/commands/bootstrap.js.map +0 -1
  46. package/dist/commands/forget.d.ts +0 -26
  47. package/dist/commands/forget.d.ts.map +0 -1
  48. package/dist/commands/forget.js +0 -37
  49. package/dist/commands/forget.js.map +0 -1
  50. package/dist/commands/index.d.ts +0 -6
  51. package/dist/commands/index.d.ts.map +0 -1
  52. package/dist/commands/index.js +0 -6
  53. package/dist/commands/index.js.map +0 -1
  54. package/dist/commands/reset.d.ts +0 -28
  55. package/dist/commands/reset.d.ts.map +0 -1
  56. package/dist/commands/reset.js +0 -37
  57. package/dist/commands/reset.js.map +0 -1
  58. package/dist/commands/resolve.d.ts +0 -16
  59. package/dist/commands/resolve.d.ts.map +0 -1
  60. package/dist/commands/resolve.js +0 -28
  61. package/dist/commands/resolve.js.map +0 -1
  62. package/dist/commands/status.d.ts +0 -34
  63. package/dist/commands/status.d.ts.map +0 -1
  64. package/dist/commands/status.js +0 -32
  65. package/dist/commands/status.js.map +0 -1
  66. package/dist/git/CommitDetection.d.ts +0 -11
  67. package/dist/git/CommitDetection.d.ts.map +0 -1
  68. package/dist/git/CommitDetection.js +0 -25
  69. package/dist/git/CommitDetection.js.map +0 -1
  70. package/dist/git/GitClient.d.ts +0 -33
  71. package/dist/git/GitClient.d.ts.map +0 -1
  72. package/dist/git/GitClient.js +0 -118
  73. package/dist/git/GitClient.js.map +0 -1
  74. package/dist/index.d.ts.map +0 -1
  75. package/dist/types.d.ts +0 -78
  76. package/dist/types.d.ts.map +0 -1
  77. package/dist/types.js +0 -3
  78. package/dist/types.js.map +0 -1
@@ -1,579 +0,0 @@
1
- import { existsSync, readFileSync } from "node:fs";
2
- import { join } from "node:path";
3
- import { minimatch } from "minimatch";
4
- import { GitClient } from "./git/GitClient.js";
5
- import { LockfileManager } from "./LockfileManager.js";
6
- import { ReplayDetector } from "./ReplayDetector.js";
7
- import { ReplayApplicator } from "./ReplayApplicator.js";
8
- import { ReplayCommitter } from "./ReplayCommitter.js";
9
- export class ReplayService {
10
- git;
11
- detector;
12
- applicator;
13
- committer;
14
- lockManager;
15
- outputDir;
16
- constructor(outputDir, _config) {
17
- const git = new GitClient(outputDir);
18
- this.git = git;
19
- this.outputDir = outputDir;
20
- this.lockManager = new LockfileManager(outputDir);
21
- this.detector = new ReplayDetector(git, this.lockManager, outputDir);
22
- this.applicator = new ReplayApplicator(git, this.lockManager, outputDir);
23
- this.committer = new ReplayCommitter(git, outputDir);
24
- }
25
- /**
26
- * Run the full replay flow.
27
- */
28
- async runReplay(options) {
29
- if (options?.skipApplication) {
30
- return this.handleSkipApplication(options);
31
- }
32
- const flow = this.determineFlow();
33
- switch (flow) {
34
- case "first-generation":
35
- return this.handleFirstGeneration(options);
36
- case "no-patches":
37
- return this.handleNoPatchesRegeneration(options);
38
- case "normal-regeneration":
39
- return this.handleNormalRegeneration(options);
40
- }
41
- }
42
- /**
43
- * Sync the lockfile after a divergent PR was squash-merged.
44
- * Call this BEFORE runReplay() when the CLI detects a merged divergent PR.
45
- */
46
- async syncFromDivergentMerge(generationCommitSha, options) {
47
- const treeHash = await this.git.getTreeHash(generationCommitSha);
48
- const timestamp = (await this.git.exec(["log", "-1", "--format=%aI", generationCommitSha])).trim();
49
- const record = {
50
- commit_sha: generationCommitSha,
51
- tree_hash: treeHash,
52
- timestamp,
53
- cli_version: options?.cliVersion ?? "unknown",
54
- generator_versions: options?.generatorVersions ?? {},
55
- };
56
- if (!this.lockManager.exists()) {
57
- this.lockManager.initializeInMemory(record);
58
- }
59
- else {
60
- this.lockManager.read();
61
- this.lockManager.addGeneration(record);
62
- this.lockManager.clearPatches();
63
- }
64
- this.lockManager.save();
65
- }
66
- /**
67
- * Determine which flow to use based on lockfile state.
68
- */
69
- determineFlow() {
70
- if (!this.lockManager.exists()) {
71
- return "first-generation";
72
- }
73
- const lock = this.lockManager.read();
74
- if (lock.patches.length === 0) {
75
- return "no-patches";
76
- }
77
- return "normal-regeneration";
78
- }
79
- /**
80
- * First generation - just create lockfile, no patches to apply.
81
- */
82
- async handleFirstGeneration(options) {
83
- if (options?.dryRun) {
84
- return {
85
- flow: "first-generation",
86
- patchesDetected: 0,
87
- patchesApplied: 0,
88
- patchesWithConflicts: 0,
89
- patchesSkipped: 0,
90
- conflicts: [],
91
- };
92
- }
93
- const commitOpts = options ? {
94
- cliVersion: options.cliVersion ?? "unknown",
95
- generatorVersions: options.generatorVersions ?? {},
96
- } : undefined;
97
- await this.committer.commitGeneration("Initial SDK generation", commitOpts);
98
- const genRecord = await this.committer.createGenerationRecord(commitOpts);
99
- this.lockManager.initialize(genRecord);
100
- return {
101
- flow: "first-generation",
102
- patchesDetected: 0,
103
- patchesApplied: 0,
104
- patchesWithConflicts: 0,
105
- patchesSkipped: 0,
106
- conflicts: [],
107
- };
108
- }
109
- /**
110
- * Skip-application mode: commit the generation and update the lockfile
111
- * but don't detect or apply patches. Sets a marker so the next normal
112
- * run skips revert detection in preGenerationRebase().
113
- */
114
- async handleSkipApplication(options) {
115
- const commitOpts = options ? {
116
- cliVersion: options.cliVersion ?? "unknown",
117
- generatorVersions: options.generatorVersions ?? {},
118
- } : undefined;
119
- await this.committer.commitGeneration("Update SDK (replay skipped)", commitOpts);
120
- const genRecord = await this.committer.createGenerationRecord(commitOpts);
121
- if (this.lockManager.exists()) {
122
- this.lockManager.read();
123
- this.lockManager.addGeneration(genRecord);
124
- }
125
- else {
126
- this.lockManager.initializeInMemory(genRecord);
127
- }
128
- this.lockManager.setReplaySkippedAt(new Date().toISOString());
129
- this.lockManager.save();
130
- // Commit the lockfile update so it's pushed with the branch.
131
- // Without this, the marker and generation record stay in the
132
- // working tree and are lost when GithubStep pushes.
133
- if (!options?.stageOnly) {
134
- await this.committer.commitReplay(0);
135
- }
136
- else {
137
- await this.committer.stageAll();
138
- }
139
- return {
140
- flow: "skip-application",
141
- patchesDetected: 0,
142
- patchesApplied: 0,
143
- patchesWithConflicts: 0,
144
- patchesSkipped: 0,
145
- conflicts: [],
146
- };
147
- }
148
- /**
149
- * No existing patches - detect new ones and apply if any.
150
- */
151
- async handleNoPatchesRegeneration(options) {
152
- const newPatches = await this.detector.detectNewPatches();
153
- const warnings = [...this.detector.warnings];
154
- if (options?.dryRun) {
155
- return {
156
- flow: "no-patches",
157
- patchesDetected: newPatches.length,
158
- patchesApplied: 0,
159
- patchesWithConflicts: 0,
160
- patchesSkipped: 0,
161
- conflicts: [],
162
- wouldApply: newPatches,
163
- warnings: warnings.length > 0 ? warnings : undefined,
164
- };
165
- }
166
- const commitOpts = options ? {
167
- cliVersion: options.cliVersion ?? "unknown",
168
- generatorVersions: options.generatorVersions ?? {},
169
- } : undefined;
170
- await this.committer.commitGeneration("Update SDK", commitOpts);
171
- const genRecord = await this.committer.createGenerationRecord(commitOpts);
172
- // Add generation to lockfile BEFORE applying patches so the applicator
173
- // can read the current generation's tree hash for rename detection.
174
- this.lockManager.addGeneration(genRecord);
175
- let results = [];
176
- if (newPatches.length > 0) {
177
- results = await this.applicator.applyPatches(newPatches);
178
- }
179
- // Rebase cleanly applied patches to the current generation.
180
- // This prevents recurring conflicts on subsequent regenerations.
181
- const rebaseCounts = await this.rebasePatches(results, genRecord.commit_sha);
182
- // Save lockfile BEFORE commit — lockfile is source of truth.
183
- for (const patch of newPatches) {
184
- if (!rebaseCounts.absorbedPatchIds.has(patch.id)) {
185
- this.lockManager.addPatch(patch);
186
- }
187
- }
188
- this.lockManager.save();
189
- if (newPatches.length > 0) {
190
- if (!options?.stageOnly) {
191
- const appliedCount = results.filter((r) => r.status === "applied" || r.status === "conflict").length;
192
- if (appliedCount > 0) {
193
- await this.committer.commitReplay(appliedCount, newPatches);
194
- }
195
- }
196
- else {
197
- await this.committer.stageAll();
198
- }
199
- }
200
- return this.buildReport("no-patches", newPatches, results, options, warnings, rebaseCounts);
201
- }
202
- /**
203
- * Normal flow - apply existing patches + detect new ones.
204
- */
205
- async handleNormalRegeneration(options) {
206
- if (options?.dryRun) {
207
- const existingPatches = this.lockManager.getPatches();
208
- const newPatches = await this.detector.detectNewPatches();
209
- const warnings = [...this.detector.warnings];
210
- const allPatches = [...existingPatches, ...newPatches];
211
- return {
212
- flow: "normal-regeneration",
213
- patchesDetected: allPatches.length,
214
- patchesApplied: 0,
215
- patchesWithConflicts: 0,
216
- patchesSkipped: 0,
217
- conflicts: [],
218
- wouldApply: allPatches,
219
- warnings: warnings.length > 0 ? warnings : undefined,
220
- };
221
- }
222
- // Pre-generation rebase: update stale/modified patches while HEAD has customer code.
223
- let existingPatches = this.lockManager.getPatches();
224
- const preRebaseCounts = await this.preGenerationRebase(existingPatches);
225
- // Dedup patches by content hash after pre-generation rebase.
226
- existingPatches = this.lockManager.getPatches();
227
- const seenHashes = new Set();
228
- for (const p of existingPatches) {
229
- if (seenHashes.has(p.content_hash)) {
230
- this.lockManager.removePatch(p.id);
231
- }
232
- else {
233
- seenHashes.add(p.content_hash);
234
- }
235
- }
236
- existingPatches = this.lockManager.getPatches();
237
- const newPatches = await this.detector.detectNewPatches();
238
- const warnings = [...this.detector.warnings];
239
- const allPatches = [...existingPatches, ...newPatches];
240
- const commitOpts = options ? {
241
- cliVersion: options.cliVersion ?? "unknown",
242
- generatorVersions: options.generatorVersions ?? {},
243
- } : undefined;
244
- await this.committer.commitGeneration("Update SDK", commitOpts);
245
- const genRecord = await this.committer.createGenerationRecord(commitOpts);
246
- // Add generation to lockfile BEFORE applying patches so the applicator
247
- // can read the current generation's tree hash for rename detection.
248
- this.lockManager.addGeneration(genRecord);
249
- const results = await this.applicator.applyPatches(allPatches);
250
- // Rebase cleanly applied patches to the current generation.
251
- const rebaseCounts = await this.rebasePatches(results, genRecord.commit_sha);
252
- // Save lockfile BEFORE commit — lockfile is source of truth.
253
- for (const patch of newPatches) {
254
- if (!rebaseCounts.absorbedPatchIds.has(patch.id)) {
255
- this.lockManager.addPatch(patch);
256
- }
257
- }
258
- this.lockManager.save();
259
- if (options?.stageOnly) {
260
- await this.committer.stageAll();
261
- }
262
- else {
263
- const appliedCount = results.filter((r) => r.status === "applied" || r.status === "conflict").length;
264
- if (appliedCount > 0) {
265
- await this.committer.commitReplay(appliedCount, allPatches);
266
- }
267
- }
268
- return this.buildReport("normal-regeneration", allPatches, results, options, warnings, rebaseCounts, preRebaseCounts);
269
- }
270
- /**
271
- * Rebase cleanly applied patches so they are relative to the current generation.
272
- * This prevents recurring conflicts on subsequent regenerations.
273
- * Returns the number of patches rebased.
274
- */
275
- async rebasePatches(results, currentGenSha) {
276
- let absorbed = 0;
277
- let repointed = 0;
278
- let contentRebased = 0;
279
- let keptAsUserOwned = 0;
280
- // Track content hashes to deduplicate converging incremental patches.
281
- const seenContentHashes = new Set();
282
- const absorbedPatchIds = new Set();
283
- // Pre-pass: Update patch.files with resolved (renamed) paths from application.
284
- // This ensures downstream operations (user-owned check, git diff, git show)
285
- // use the current file paths rather than stale pre-rename paths.
286
- for (const result of results) {
287
- if (result.resolvedFiles && Object.keys(result.resolvedFiles).length > 0) {
288
- const patch = result.patch;
289
- const updatedFiles = patch.files.map(f => result.resolvedFiles[f] ?? f);
290
- patch.files = updatedFiles;
291
- try {
292
- this.lockManager.updatePatch(patch.id, { files: updatedFiles });
293
- }
294
- catch {
295
- // New patches aren't in lockfile yet — in-memory update sufficient
296
- }
297
- }
298
- }
299
- for (const result of results) {
300
- if (result.status === "conflict" && result.fileResults) {
301
- // For conflict patches with mixed results, trim any clean files
302
- // that were absorbed by the generator. This prevents absorbed files
303
- // from poisoning the pre-generation rebase conflict marker check.
304
- await this.trimAbsorbedFiles(result, currentGenSha);
305
- continue;
306
- }
307
- // Only rebase cleanly applied patches.
308
- // Conflicted patches keep their old base_generation so they retry.
309
- if (result.status !== "applied")
310
- continue;
311
- const patch = result.patch;
312
- // Skip if already based on the current generation
313
- if (patch.base_generation === currentGenSha)
314
- continue;
315
- try {
316
- // Check if any files are user-owned (new, .fernignore-protected, or .fernignore itself).
317
- const fernignorePatterns = this.readFernignorePatterns();
318
- const isUserOwned = await Promise.all(patch.files.map(async (file) => {
319
- // .fernignore itself is always user-owned
320
- if (file === ".fernignore") {
321
- return true;
322
- }
323
- // Check .fernignore patterns (cheaper than git)
324
- if (fernignorePatterns.some((p) => file === p || minimatch(file, p))) {
325
- return true;
326
- }
327
- // Check if file exists in the generation commit tree
328
- const content = await this.git.showFile(currentGenSha, file);
329
- return content === null;
330
- }));
331
- const hasUserOwnedFiles = isUserOwned.some(Boolean);
332
- if (hasUserOwnedFiles) {
333
- // Patch contains user-owned files — just update base_generation
334
- // to prevent re-evaluation. Keep patch_content as-is since
335
- // these files aren't produced by the generator.
336
- this.lockManager.updatePatch(patch.id, {
337
- base_generation: currentGenSha,
338
- });
339
- keptAsUserOwned++;
340
- continue;
341
- }
342
- // All files exist in generation — safe to use git diff for
343
- // absorption check and patch rebasing.
344
- const diff = await this.git.exec([
345
- "diff", currentGenSha, "--", ...patch.files,
346
- ]).catch(() => null);
347
- if (!diff || !diff.trim()) {
348
- // Patch is now empty — customization was absorbed by the generator.
349
- this.lockManager.removePatch(patch.id);
350
- absorbedPatchIds.add(patch.id);
351
- absorbed++;
352
- continue;
353
- }
354
- const newContentHash = this.detector.computeContentHash(diff);
355
- // If another patch already captured this exact diff, this patch
356
- // is redundant (e.g., incremental patches that both resolve to
357
- // the same cumulative state after rebase).
358
- if (seenContentHashes.has(newContentHash)) {
359
- this.lockManager.removePatch(patch.id);
360
- absorbedPatchIds.add(patch.id);
361
- absorbed++;
362
- continue;
363
- }
364
- seenContentHashes.add(newContentHash);
365
- this.lockManager.updatePatch(patch.id, {
366
- base_generation: currentGenSha,
367
- patch_content: diff,
368
- content_hash: newContentHash,
369
- });
370
- contentRebased++;
371
- }
372
- catch {
373
- // If rebasing fails for any reason, keep the original patch unchanged
374
- }
375
- }
376
- return { absorbed, repointed, contentRebased, keptAsUserOwned, absorbedPatchIds };
377
- }
378
- /**
379
- * For conflict patches with mixed results (some files merged, some conflicted),
380
- * check if the cleanly merged files were absorbed by the generator (empty diff).
381
- * If so, remove them from patch.files so they don't pollute the pre-generation
382
- * rebase conflict marker check (`git grep <<<<<<< -- ...patch.files`).
383
- *
384
- * Non-absorbed clean files stay in patch.files — removing them would lose
385
- * the customization on the next generation.
386
- */
387
- async trimAbsorbedFiles(result, currentGenSha) {
388
- const cleanFiles = result.fileResults
389
- .filter((f) => f.status === "merged")
390
- .map((f) => f.file);
391
- if (cleanFiles.length === 0)
392
- return;
393
- const patch = result.patch;
394
- const fernignorePatterns = this.readFernignorePatterns();
395
- // Filter to only generator-produced clean files (not user-owned)
396
- const generatorCleanFiles = [];
397
- for (const file of cleanFiles) {
398
- if (file === ".fernignore")
399
- continue;
400
- if (fernignorePatterns.some((p) => file === p || minimatch(file, p)))
401
- continue;
402
- const content = await this.git.showFile(currentGenSha, file);
403
- if (content === null)
404
- continue; // user-owned new file
405
- generatorCleanFiles.push(file);
406
- }
407
- if (generatorCleanFiles.length === 0)
408
- return;
409
- // Check which clean files have an empty diff (absorbed by generator)
410
- const absorbedFiles = new Set();
411
- for (const file of generatorCleanFiles) {
412
- try {
413
- const diff = await this.git.exec(["diff", currentGenSha, "--", file]).catch(() => null);
414
- if (!diff || !diff.trim()) {
415
- absorbedFiles.add(file);
416
- }
417
- }
418
- catch {
419
- // If diff fails, leave the file in the patch
420
- }
421
- }
422
- if (absorbedFiles.size === 0)
423
- return;
424
- // Remove absorbed files from the patch's file list
425
- const remainingFiles = patch.files.filter((f) => !absorbedFiles.has(f));
426
- if (remainingFiles.length === patch.files.length)
427
- return; // nothing changed
428
- try {
429
- this.lockManager.updatePatch(patch.id, { files: remainingFiles });
430
- }
431
- catch {
432
- // New patches aren't in lockfile yet — update in-memory only
433
- patch.files = remainingFiles;
434
- }
435
- }
436
- /**
437
- * Pre-generation rebase: update patches using the customer's current state.
438
- * Called BEFORE commitGeneration() while HEAD has customer code.
439
- */
440
- async preGenerationRebase(patches) {
441
- const lock = this.lockManager.read();
442
- const currentGen = lock.current_generation;
443
- // If the previous run was skip-application, clear the marker and
444
- // skip all revert detection. Patches are preserved as-is.
445
- if (this.lockManager.isReplaySkipped()) {
446
- this.lockManager.clearReplaySkippedAt();
447
- return { conflictResolved: 0, conflictAbsorbed: 0, contentRefreshed: 0 };
448
- }
449
- let conflictResolved = 0;
450
- let conflictAbsorbed = 0;
451
- let contentRefreshed = 0;
452
- for (const patch of patches) {
453
- if (patch.base_generation === currentGen) {
454
- // Content refresh: check if user modified their customization
455
- // since the last replay commit.
456
- try {
457
- const diff = await this.git.exec(["diff", currentGen, "HEAD", "--", ...patch.files]).catch(() => null);
458
- if (diff === null)
459
- continue;
460
- if (!diff.trim()) {
461
- // User reverted all customizations in this patch
462
- this.lockManager.removePatch(patch.id);
463
- contentRefreshed++;
464
- continue;
465
- }
466
- const newContentHash = this.detector.computeContentHash(diff);
467
- if (newContentHash !== patch.content_hash) {
468
- // User changed their customization — update patch content
469
- // and recalculate the files list (some files may no longer differ)
470
- const filesOutput = await this.git.exec(["diff", "--name-only", currentGen, "HEAD", "--", ...patch.files]).catch(() => null);
471
- const newFiles = filesOutput
472
- ? filesOutput.trim().split("\n").filter(Boolean)
473
- .filter((f) => !f.startsWith(".fern/"))
474
- : patch.files;
475
- if (newFiles.length === 0) {
476
- this.lockManager.removePatch(patch.id);
477
- }
478
- else {
479
- this.lockManager.updatePatch(patch.id, {
480
- patch_content: diff,
481
- content_hash: newContentHash,
482
- files: newFiles,
483
- });
484
- }
485
- contentRefreshed++;
486
- }
487
- }
488
- catch {
489
- // If anything fails, leave the patch unchanged
490
- }
491
- continue;
492
- }
493
- try {
494
- // Check for unresolved conflict markers in HEAD
495
- const markerFiles = await this.git.exec(["grep", "-l", "<<<<<<<", "HEAD", "--", ...patch.files]).catch(() => "");
496
- if (markerFiles.trim())
497
- continue;
498
- // Compute customer's resolved state relative to current generation
499
- const diff = await this.git.exec(["diff", currentGen, "HEAD", "--", ...patch.files]).catch(() => null);
500
- // Diff command failed (e.g., invalid SHA) — skip this patch
501
- if (diff === null)
502
- continue;
503
- if (!diff.trim()) {
504
- // Empty diff — customer reverted their customization
505
- this.lockManager.removePatch(patch.id);
506
- conflictAbsorbed++;
507
- continue;
508
- }
509
- // Update the patch with the resolved content
510
- const newContentHash = this.detector.computeContentHash(diff);
511
- this.lockManager.updatePatch(patch.id, {
512
- base_generation: currentGen,
513
- patch_content: diff,
514
- content_hash: newContentHash,
515
- });
516
- conflictResolved++;
517
- }
518
- catch {
519
- // If anything fails, leave the patch unchanged
520
- }
521
- }
522
- return { conflictResolved, conflictAbsorbed, contentRefreshed };
523
- }
524
- /**
525
- * Read .fernignore patterns from the output directory.
526
- * Returns an empty array if .fernignore doesn't exist.
527
- */
528
- readFernignorePatterns() {
529
- const fernignorePath = join(this.outputDir, ".fernignore");
530
- if (!existsSync(fernignorePath))
531
- return [];
532
- return readFileSync(fernignorePath, "utf-8")
533
- .split("\n")
534
- .map((line) => line.trim())
535
- .filter((line) => line && !line.startsWith("#"));
536
- }
537
- /**
538
- * Build the final report from results.
539
- */
540
- buildReport(flow, patches, results, options, warnings, rebaseCounts, preRebaseCounts) {
541
- const conflictResults = results.filter((r) => r.status === "conflict");
542
- const conflictDetails = conflictResults
543
- .map((r) => {
544
- const conflictFiles = r.fileResults?.filter((f) => f.status === "conflict") ?? [];
545
- const cleanFiles = r.fileResults?.filter((f) => f.status === "merged").map((f) => f.file) ?? [];
546
- return {
547
- patchId: r.patch.id,
548
- patchMessage: r.patch.original_message,
549
- reason: r.conflictReason,
550
- files: conflictFiles,
551
- cleanFiles: cleanFiles.length > 0 ? cleanFiles : undefined,
552
- };
553
- })
554
- .filter((d) => d.files.length > 0);
555
- const partialCount = conflictDetails.filter((d) => d.cleanFiles && d.cleanFiles.length > 0).length;
556
- return {
557
- flow,
558
- patchesDetected: patches.length,
559
- patchesApplied: results.filter((r) => r.status === "applied").length,
560
- patchesWithConflicts: conflictResults.length,
561
- patchesSkipped: results.filter((r) => r.status === "skipped").length,
562
- patchesPartiallyApplied: partialCount > 0 ? partialCount : undefined,
563
- patchesAbsorbed: rebaseCounts && rebaseCounts.absorbed > 0 ? rebaseCounts.absorbed : undefined,
564
- patchesRepointed: rebaseCounts && rebaseCounts.repointed > 0 ? rebaseCounts.repointed : undefined,
565
- patchesContentRebased: rebaseCounts && rebaseCounts.contentRebased > 0 ? rebaseCounts.contentRebased : undefined,
566
- patchesKeptAsUserOwned: rebaseCounts && rebaseCounts.keptAsUserOwned > 0 ? rebaseCounts.keptAsUserOwned : undefined,
567
- patchesConflictResolved: preRebaseCounts && (preRebaseCounts.conflictResolved + preRebaseCounts.conflictAbsorbed) > 0
568
- ? preRebaseCounts.conflictResolved + preRebaseCounts.conflictAbsorbed : undefined,
569
- patchesRefreshed: preRebaseCounts && preRebaseCounts.contentRefreshed > 0
570
- ? preRebaseCounts.contentRefreshed : undefined,
571
- conflicts: conflictResults
572
- .flatMap((r) => r.fileResults?.filter((f) => f.status === "conflict") ?? []),
573
- conflictDetails: conflictDetails.length > 0 ? conflictDetails : undefined,
574
- wouldApply: options?.dryRun ? patches : undefined,
575
- warnings: warnings && warnings.length > 0 ? warnings : undefined,
576
- };
577
- }
578
- }
579
- //# sourceMappingURL=ReplayService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReplayService.js","sourceRoot":"","sources":["../src/ReplayService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAA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,CAAC,CAAC,CAAC,SAAS;YACrF,gBAAgB,EAAE,eAAe,IAAI,eAAe,CAAC,gBAAgB,GAAG,CAAC;gBACrE,CAAC,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS;YAClD,SAAS,EAAE,eAAe;iBACrB,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,UAAU,CAAC,IAAI,EAAE,CAAC;YAChF,eAAe,EAAE,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS;YACzE,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;YACjD,QAAQ,EAAE,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;SACnE,CAAC;IACN,CAAC;CACJ"}
@@ -1,11 +0,0 @@
1
- import type { MergeResult } from "./types.js";
2
- /**
3
- * Performs a 3-way merge using the diff3 algorithm.
4
- *
5
- * @param base - The common ancestor (pristine generated state user edited against)
6
- * @param ours - The new generated version
7
- * @param theirs - The user's customized version
8
- * @returns MergeResult with content, conflict flag, and conflict regions
9
- */
10
- export declare function threeWayMerge(base: string, ours: string, theirs: string): MergeResult;
11
- //# sourceMappingURL=ThreeWayMerge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ThreeWayMerge.d.ts","sourceRoot":"","sources":["../src/ThreeWayMerge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,YAAY,CAAC;AAE9D;;;;;;;GAOG;AACH,wBAAgB,aAAa,CACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACf,WAAW,CA2Cb"}