@fern-api/replay 0.8.0 → 0.9.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.
package/dist/index.d.cts CHANGED
@@ -3,6 +3,7 @@ interface GenerationLock {
3
3
  generations: GenerationRecord[];
4
4
  current_generation: string;
5
5
  patches: StoredPatch[];
6
+ forgotten_hashes?: string[];
6
7
  replay_skipped_at?: string;
7
8
  }
8
9
  interface GenerationRecord {
@@ -109,7 +110,7 @@ declare const FERN_BOT_EMAIL = "115122769+fern-api[bot]@users.noreply.github.com
109
110
  declare const FERN_BOT_LOGIN = "fern-api[bot]";
110
111
  declare function isGenerationCommit(commit: CommitInfo): boolean;
111
112
  declare function isReplayCommit(commit: CommitInfo): boolean;
112
- /** Check if a commit message indicates a git revert */
113
+ /** Check if a commit message matches git's standard revert format: Revert "..." */
113
114
  declare function isRevertCommit(message: string): boolean;
114
115
  /** Extract the reverted commit SHA from a full commit body containing "This reverts commit SHA." */
115
116
  declare function parseRevertedSha(fullBody: string): string | undefined;
@@ -137,6 +138,7 @@ declare class LockfileManager {
137
138
  updatePatch(patchId: string, updates: Partial<Pick<StoredPatch, "base_generation" | "patch_content" | "content_hash" | "files" | "status">>): void;
138
139
  removePatch(patchId: string): void;
139
140
  clearPatches(): void;
141
+ addForgottenHash(hash: string): void;
140
142
  getUnresolvedPatches(): StoredPatch[];
141
143
  getResolvingPatches(): StoredPatch[];
142
144
  markPatchUnresolved(patchId: string): void;
@@ -426,18 +428,43 @@ declare function bootstrap(outputDir: string, options?: BootstrapOptions): Promi
426
428
  interface ForgetOptions {
427
429
  /** Don't actually remove, just show what would be removed */
428
430
  dryRun?: boolean;
431
+ /** Remove all tracked patches (keep lockfile and generation history) */
432
+ all?: boolean;
433
+ /** Specific patch IDs to remove */
434
+ patchIds?: string[];
435
+ /** Search pattern: file path, glob, or commit message substring */
436
+ pattern?: string;
437
+ }
438
+ interface DiffStat {
439
+ additions: number;
440
+ deletions: number;
441
+ }
442
+ interface MatchedPatch {
443
+ id: string;
444
+ message: string;
445
+ files: string[];
446
+ diffstat: DiffStat;
447
+ status?: "unresolved" | "resolving";
429
448
  }
430
449
  interface ForgetResult {
431
- /** Patches that were (or would be) removed */
432
- removed: Array<{
433
- id: string;
434
- message: string;
435
- files: string[];
436
- }>;
437
- /** True if no patches matched the pattern */
450
+ /** Whether replay is initialized (lockfile exists) */
451
+ initialized: boolean;
452
+ /** Patches that were (or would be in dry-run) removed */
453
+ removed: MatchedPatch[];
454
+ /** Number of patches remaining after removal */
455
+ remaining: number;
456
+ /** True if a search/pattern was given but nothing matched */
438
457
  notFound: boolean;
458
+ /** Patch IDs that were specified but don't exist (idempotent mode) */
459
+ alreadyForgotten: string[];
460
+ /** Total patches before removal */
461
+ totalPatches: number;
462
+ /** Warnings (e.g., forgetting patches with conflict markers on disk) */
463
+ warnings: string[];
464
+ /** Matching patches for interactive selection (search/no-arg mode only) */
465
+ matched?: MatchedPatch[];
439
466
  }
440
- declare function forget(outputDir: string, filePattern: string, options?: ForgetOptions): ForgetResult;
467
+ declare function forget(outputDir: string, options?: ForgetOptions): ForgetResult;
441
468
 
442
469
  interface ResetOptions {
443
470
  /** Don't actually delete, just show what would happen */
@@ -480,27 +507,45 @@ declare function resolve(outputDir: string, options?: ResolveOptions): Promise<R
480
507
  interface StatusResult {
481
508
  /** Whether replay is initialized (lockfile exists) */
482
509
  initialized: boolean;
483
- /** Tracked customization patches */
484
- patches: StatusPatch[];
510
+ /** Total number of generations tracked */
511
+ generationCount: number;
485
512
  /** Last generation info, if available */
486
513
  lastGeneration: StatusGeneration | undefined;
514
+ /** Tracked customization patches */
515
+ patches: StatusPatch[];
516
+ /** Count of patches with "unresolved" or "resolving" status */
517
+ unresolvedCount: number;
518
+ /** Exclude patterns from replay.yml */
519
+ excludePatterns: string[];
487
520
  }
488
521
  interface StatusPatch {
489
- /** Short SHA of the original commit */
490
- sha: string;
491
- /** Author name (without email) */
492
- author: string;
522
+ /** Patch ID (e.g. "patch-def45678") */
523
+ id: string;
524
+ /** "added" if patch_content contains "new file mode", otherwise "modified" */
525
+ type: "added" | "modified";
493
526
  /** Original commit message */
494
527
  message: string;
528
+ /** Author name (without email) */
529
+ author: string;
530
+ /** Short SHA of the original commit (7 chars) */
531
+ sha: string;
495
532
  /** Files touched by this patch */
496
533
  files: string[];
534
+ /** Number of files */
535
+ fileCount: number;
536
+ /** Patch resolution status, if any */
537
+ status?: "unresolved" | "resolving";
497
538
  }
498
539
  interface StatusGeneration {
499
- /** Full commit SHA */
540
+ /** Short commit SHA (7 chars) */
500
541
  sha: string;
501
542
  /** Generation timestamp */
502
543
  timestamp: string;
544
+ /** CLI version used for generation */
545
+ cliVersion: string;
546
+ /** Generator versions (e.g. { "fern-java-sdk": "3.35.0" }) */
547
+ generatorVersions: Record<string, string>;
503
548
  }
504
549
  declare function status(outputDir: string): StatusResult;
505
550
 
506
- export { type BootstrapOptions, type BootstrapResult, type CommitInfo, type CommitOptions, type ConflictDetail, type ConflictMetadata, type ConflictReason, type ConflictRegion, type CustomizationsConfig, type DetectionResult, FERN_BOT_EMAIL, FERN_BOT_LOGIN, FERN_BOT_NAME, FernignoreMigrator, type FileResult, type ForgetOptions, type ForgetResult, type GenerationLock, type GenerationRecord, GitClient, LockfileManager, type MergeResult, type MigrationAnalysis, type MigrationResult, type MoveDeclaration, ReplayApplicator, ReplayCommitter, type ReplayConfig, ReplayDetector, type ReplayOptions, type ReplayReport, type ReplayResult, ReplayService, type ResetOptions, type ResetResult, type ResolveOptions, type ResolveResult, type StatusGeneration, type StatusPatch, type StatusResult, type StoredPatch, type UnresolvedPatchInfo, bootstrap, forget, isGenerationCommit, isReplayCommit, isRevertCommit, parseRevertedMessage, parseRevertedSha, reset, resolve, status, threeWayMerge };
551
+ export { type BootstrapOptions, type BootstrapResult, type CommitInfo, type CommitOptions, type ConflictDetail, type ConflictMetadata, type ConflictReason, type ConflictRegion, type CustomizationsConfig, type DetectionResult, type DiffStat, FERN_BOT_EMAIL, FERN_BOT_LOGIN, FERN_BOT_NAME, FernignoreMigrator, type FileResult, type ForgetOptions, type ForgetResult, type GenerationLock, type GenerationRecord, GitClient, LockfileManager, type MatchedPatch, type MergeResult, type MigrationAnalysis, type MigrationResult, type MoveDeclaration, ReplayApplicator, ReplayCommitter, type ReplayConfig, ReplayDetector, type ReplayOptions, type ReplayReport, type ReplayResult, ReplayService, type ResetOptions, type ResetResult, type ResolveOptions, type ResolveResult, type StatusGeneration, type StatusPatch, type StatusResult, type StoredPatch, type UnresolvedPatchInfo, bootstrap, forget, isGenerationCommit, isReplayCommit, isRevertCommit, parseRevertedMessage, parseRevertedSha, reset, resolve, status, threeWayMerge };
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ interface GenerationLock {
3
3
  generations: GenerationRecord[];
4
4
  current_generation: string;
5
5
  patches: StoredPatch[];
6
+ forgotten_hashes?: string[];
6
7
  replay_skipped_at?: string;
7
8
  }
8
9
  interface GenerationRecord {
@@ -109,7 +110,7 @@ declare const FERN_BOT_EMAIL = "115122769+fern-api[bot]@users.noreply.github.com
109
110
  declare const FERN_BOT_LOGIN = "fern-api[bot]";
110
111
  declare function isGenerationCommit(commit: CommitInfo): boolean;
111
112
  declare function isReplayCommit(commit: CommitInfo): boolean;
112
- /** Check if a commit message indicates a git revert */
113
+ /** Check if a commit message matches git's standard revert format: Revert "..." */
113
114
  declare function isRevertCommit(message: string): boolean;
114
115
  /** Extract the reverted commit SHA from a full commit body containing "This reverts commit SHA." */
115
116
  declare function parseRevertedSha(fullBody: string): string | undefined;
@@ -137,6 +138,7 @@ declare class LockfileManager {
137
138
  updatePatch(patchId: string, updates: Partial<Pick<StoredPatch, "base_generation" | "patch_content" | "content_hash" | "files" | "status">>): void;
138
139
  removePatch(patchId: string): void;
139
140
  clearPatches(): void;
141
+ addForgottenHash(hash: string): void;
140
142
  getUnresolvedPatches(): StoredPatch[];
141
143
  getResolvingPatches(): StoredPatch[];
142
144
  markPatchUnresolved(patchId: string): void;
@@ -426,18 +428,43 @@ declare function bootstrap(outputDir: string, options?: BootstrapOptions): Promi
426
428
  interface ForgetOptions {
427
429
  /** Don't actually remove, just show what would be removed */
428
430
  dryRun?: boolean;
431
+ /** Remove all tracked patches (keep lockfile and generation history) */
432
+ all?: boolean;
433
+ /** Specific patch IDs to remove */
434
+ patchIds?: string[];
435
+ /** Search pattern: file path, glob, or commit message substring */
436
+ pattern?: string;
437
+ }
438
+ interface DiffStat {
439
+ additions: number;
440
+ deletions: number;
441
+ }
442
+ interface MatchedPatch {
443
+ id: string;
444
+ message: string;
445
+ files: string[];
446
+ diffstat: DiffStat;
447
+ status?: "unresolved" | "resolving";
429
448
  }
430
449
  interface ForgetResult {
431
- /** Patches that were (or would be) removed */
432
- removed: Array<{
433
- id: string;
434
- message: string;
435
- files: string[];
436
- }>;
437
- /** True if no patches matched the pattern */
450
+ /** Whether replay is initialized (lockfile exists) */
451
+ initialized: boolean;
452
+ /** Patches that were (or would be in dry-run) removed */
453
+ removed: MatchedPatch[];
454
+ /** Number of patches remaining after removal */
455
+ remaining: number;
456
+ /** True if a search/pattern was given but nothing matched */
438
457
  notFound: boolean;
458
+ /** Patch IDs that were specified but don't exist (idempotent mode) */
459
+ alreadyForgotten: string[];
460
+ /** Total patches before removal */
461
+ totalPatches: number;
462
+ /** Warnings (e.g., forgetting patches with conflict markers on disk) */
463
+ warnings: string[];
464
+ /** Matching patches for interactive selection (search/no-arg mode only) */
465
+ matched?: MatchedPatch[];
439
466
  }
440
- declare function forget(outputDir: string, filePattern: string, options?: ForgetOptions): ForgetResult;
467
+ declare function forget(outputDir: string, options?: ForgetOptions): ForgetResult;
441
468
 
442
469
  interface ResetOptions {
443
470
  /** Don't actually delete, just show what would happen */
@@ -480,27 +507,45 @@ declare function resolve(outputDir: string, options?: ResolveOptions): Promise<R
480
507
  interface StatusResult {
481
508
  /** Whether replay is initialized (lockfile exists) */
482
509
  initialized: boolean;
483
- /** Tracked customization patches */
484
- patches: StatusPatch[];
510
+ /** Total number of generations tracked */
511
+ generationCount: number;
485
512
  /** Last generation info, if available */
486
513
  lastGeneration: StatusGeneration | undefined;
514
+ /** Tracked customization patches */
515
+ patches: StatusPatch[];
516
+ /** Count of patches with "unresolved" or "resolving" status */
517
+ unresolvedCount: number;
518
+ /** Exclude patterns from replay.yml */
519
+ excludePatterns: string[];
487
520
  }
488
521
  interface StatusPatch {
489
- /** Short SHA of the original commit */
490
- sha: string;
491
- /** Author name (without email) */
492
- author: string;
522
+ /** Patch ID (e.g. "patch-def45678") */
523
+ id: string;
524
+ /** "added" if patch_content contains "new file mode", otherwise "modified" */
525
+ type: "added" | "modified";
493
526
  /** Original commit message */
494
527
  message: string;
528
+ /** Author name (without email) */
529
+ author: string;
530
+ /** Short SHA of the original commit (7 chars) */
531
+ sha: string;
495
532
  /** Files touched by this patch */
496
533
  files: string[];
534
+ /** Number of files */
535
+ fileCount: number;
536
+ /** Patch resolution status, if any */
537
+ status?: "unresolved" | "resolving";
497
538
  }
498
539
  interface StatusGeneration {
499
- /** Full commit SHA */
540
+ /** Short commit SHA (7 chars) */
500
541
  sha: string;
501
542
  /** Generation timestamp */
502
543
  timestamp: string;
544
+ /** CLI version used for generation */
545
+ cliVersion: string;
546
+ /** Generator versions (e.g. { "fern-java-sdk": "3.35.0" }) */
547
+ generatorVersions: Record<string, string>;
503
548
  }
504
549
  declare function status(outputDir: string): StatusResult;
505
550
 
506
- export { type BootstrapOptions, type BootstrapResult, type CommitInfo, type CommitOptions, type ConflictDetail, type ConflictMetadata, type ConflictReason, type ConflictRegion, type CustomizationsConfig, type DetectionResult, FERN_BOT_EMAIL, FERN_BOT_LOGIN, FERN_BOT_NAME, FernignoreMigrator, type FileResult, type ForgetOptions, type ForgetResult, type GenerationLock, type GenerationRecord, GitClient, LockfileManager, type MergeResult, type MigrationAnalysis, type MigrationResult, type MoveDeclaration, ReplayApplicator, ReplayCommitter, type ReplayConfig, ReplayDetector, type ReplayOptions, type ReplayReport, type ReplayResult, ReplayService, type ResetOptions, type ResetResult, type ResolveOptions, type ResolveResult, type StatusGeneration, type StatusPatch, type StatusResult, type StoredPatch, type UnresolvedPatchInfo, bootstrap, forget, isGenerationCommit, isReplayCommit, isRevertCommit, parseRevertedMessage, parseRevertedSha, reset, resolve, status, threeWayMerge };
551
+ export { type BootstrapOptions, type BootstrapResult, type CommitInfo, type CommitOptions, type ConflictDetail, type ConflictMetadata, type ConflictReason, type ConflictRegion, type CustomizationsConfig, type DetectionResult, type DiffStat, FERN_BOT_EMAIL, FERN_BOT_LOGIN, FERN_BOT_NAME, FernignoreMigrator, type FileResult, type ForgetOptions, type ForgetResult, type GenerationLock, type GenerationRecord, GitClient, LockfileManager, type MatchedPatch, type MergeResult, type MigrationAnalysis, type MigrationResult, type MoveDeclaration, ReplayApplicator, ReplayCommitter, type ReplayConfig, ReplayDetector, type ReplayOptions, type ReplayReport, type ReplayResult, ReplayService, type ResetOptions, type ResetResult, type ResolveOptions, type ResolveResult, type StatusGeneration, type StatusPatch, type StatusResult, type StoredPatch, type UnresolvedPatchInfo, bootstrap, forget, isGenerationCommit, isReplayCommit, isRevertCommit, parseRevertedMessage, parseRevertedSha, reset, resolve, status, threeWayMerge };