@hexagen-monaco/sync 0.6.0 → 0.7.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 (65) hide show
  1. package/dist/cli.js +698 -510
  2. package/dist/cli.js.map +1 -1
  3. package/dist/config.d.ts +17 -0
  4. package/dist/config.d.ts.map +1 -1
  5. package/dist/domain/types.d.ts +8 -1
  6. package/dist/domain/types.d.ts.map +1 -1
  7. package/dist/fs-utils.d.ts +4 -4
  8. package/dist/fs-utils.d.ts.map +1 -1
  9. package/dist/generators/apps-framework-templates.d.ts.map +1 -1
  10. package/dist/generators/apps.d.ts.map +1 -1
  11. package/dist/generators/architecture-files.d.ts.map +1 -1
  12. package/dist/generators/barrels/recursive.d.ts +2 -3
  13. package/dist/generators/barrels/recursive.d.ts.map +1 -1
  14. package/dist/generators/barrels.d.ts +2 -3
  15. package/dist/generators/barrels.d.ts.map +1 -1
  16. package/dist/generators/cross-context.d.ts.map +1 -1
  17. package/dist/generators/eslint.d.ts.map +1 -1
  18. package/dist/generators/layer-folders.d.ts +18 -6
  19. package/dist/generators/layer-folders.d.ts.map +1 -1
  20. package/dist/generators/package-json.d.ts +2 -3
  21. package/dist/generators/package-json.d.ts.map +1 -1
  22. package/dist/generators/reap.d.ts +7 -3
  23. package/dist/generators/reap.d.ts.map +1 -1
  24. package/dist/generators/root-file-templates.d.ts +1 -1
  25. package/dist/generators/root-file-templates.d.ts.map +1 -1
  26. package/dist/generators/root-files.d.ts.map +1 -1
  27. package/dist/generators/shared-kernel.d.ts.map +1 -1
  28. package/dist/generators/stubs.d.ts.map +1 -1
  29. package/dist/generators/tsconfig.d.ts.map +1 -1
  30. package/dist/index.js +572 -379
  31. package/dist/index.js.map +1 -1
  32. package/dist/journal.d.ts +64 -0
  33. package/dist/journal.d.ts.map +1 -0
  34. package/dist/migration-report.d.ts +13 -2
  35. package/dist/migration-report.d.ts.map +1 -1
  36. package/dist/results.d.ts +66 -0
  37. package/dist/results.d.ts.map +1 -1
  38. package/dist/sync-engine-helpers.d.ts.map +1 -1
  39. package/dist/sync-engine.d.ts +13 -1
  40. package/dist/sync-engine.d.ts.map +1 -1
  41. package/dist/toolchain-version.d.ts +14 -0
  42. package/dist/toolchain-version.d.ts.map +1 -0
  43. package/package.json +1 -1
  44. package/dist/application/use-cases/stub-generation.use-case.d.ts +0 -23
  45. package/dist/application/use-cases/stub-generation.use-case.d.ts.map +0 -1
  46. package/dist/generators/migration-assistant.d.ts +0 -7
  47. package/dist/generators/migration-assistant.d.ts.map +0 -1
  48. package/dist/generators/migration-audit.d.ts +0 -28
  49. package/dist/generators/migration-audit.d.ts.map +0 -1
  50. package/dist/generators/migration-stubs.d.ts +0 -7
  51. package/dist/generators/migration-stubs.d.ts.map +0 -1
  52. package/dist/generators/test-generator.d.ts +0 -7
  53. package/dist/generators/test-generator.d.ts.map +0 -1
  54. package/dist/generators/test-templates/data-builder.d.ts +0 -2
  55. package/dist/generators/test-templates/data-builder.d.ts.map +0 -1
  56. package/dist/generators/test-templates/enhanced-test-double.d.ts +0 -2
  57. package/dist/generators/test-templates/enhanced-test-double.d.ts.map +0 -1
  58. package/dist/generators/test-templates/index.d.ts +0 -5
  59. package/dist/generators/test-templates/index.d.ts.map +0 -1
  60. package/dist/generators/test-templates/integration-test.d.ts +0 -2
  61. package/dist/generators/test-templates/integration-test.d.ts.map +0 -1
  62. package/dist/generators/test-templates/unit-test.d.ts +0 -2
  63. package/dist/generators/test-templates/unit-test.d.ts.map +0 -1
  64. package/dist/generators/wiring.d.ts +0 -20
  65. package/dist/generators/wiring.d.ts.map +0 -1
@@ -0,0 +1,64 @@
1
+ import type { LoggerPort } from "@hexagen/shared";
2
+ /** What sync did to the file — determines the inverse op on rollback. */
3
+ export type JournalEntryKind = "created" | "overwritten" | "deleted";
4
+ export interface JournalEntry {
5
+ /** Absolute path of the mutated file. */
6
+ path: string;
7
+ kind: JournalEntryKind;
8
+ /**
9
+ * Full pre-mutation content; `null` iff the file did not exist (kind
10
+ * "created"). Held in memory for the run's lifetime — generated artifacts
11
+ * are small text files, and a journal that spills to disk could itself
12
+ * fail on the same broken substrate it exists to recover from.
13
+ */
14
+ preContent: string | null;
15
+ }
16
+ export interface RollbackFailure {
17
+ path: string;
18
+ /** The inverse op that was attempted, for the operator-facing print. */
19
+ intended: string;
20
+ error: string;
21
+ }
22
+ export interface RollbackOutcome {
23
+ attempted: number;
24
+ restored: number;
25
+ failures: RollbackFailure[];
26
+ }
27
+ export declare class SyncJournal {
28
+ private entries;
29
+ /**
30
+ * Record a write BEFORE it is attempted. `preContent: null` means the file
31
+ * did not exist (a create); a string is the full pre-image of an overwrite.
32
+ * Over-recording is safe: rolling back a write that never happened either
33
+ * restores identical content or unlinks a file that is not there (ENOENT
34
+ * tolerated below). Under-recording loses user data — so mutation sites
35
+ * record first, mutate second.
36
+ */
37
+ recordWrite(filePath: string, preContent: string | null): void;
38
+ /** Record a deletion BEFORE the unlink, with the full pre-image. */
39
+ recordDelete(filePath: string, preContent: string): void;
40
+ get size(): number;
41
+ /**
42
+ * Human-readable journal lines (workspace-relative), oldest first — printed
43
+ * verbatim when a failed run must NOT roll back (--allow-dirty).
44
+ */
45
+ describeEntries(workspaceRoot: string): string[];
46
+ /**
47
+ * Replay the journal in REVERSE order: restore pre-images, unlink created
48
+ * files. Reverse order makes repeated writes to the same path converge on
49
+ * the OLDEST pre-image (pass-1 barrel pre-image is restored last), i.e. the
50
+ * true pre-sync state.
51
+ *
52
+ * Per-entry best-effort: a failing inverse op is collected and replay
53
+ * CONTINUES — restoring nine of ten files beats aborting at the first
54
+ * error. The caller prints the failures; nothing here (or anywhere) falls
55
+ * back to a git-wide reset/clean.
56
+ *
57
+ * Restores use a plain writeFile, not the atomic tmp+rename protocol: the
58
+ * rollback may be running on the same broken substrate that failed the
59
+ * sync, and the simplest possible write maximizes the odds of getting the
60
+ * user's bytes back on disk.
61
+ */
62
+ rollback(logger: LoggerPort, workspaceRoot: string): Promise<RollbackOutcome>;
63
+ }
64
+ //# sourceMappingURL=journal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journal.d.ts","sourceRoot":"","sources":["../src/journal.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,yEAAyE;AACzE,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAAC;AAErE,MAAM,WAAW,YAAY;IAC3B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,gBAAgB,CAAC;IACvB;;;;;OAKG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAAsB;IAErC;;;;;;;OAOG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAQ9D,oEAAoE;IACpE,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAIxD,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;OAGG;IACH,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE;IAMhD;;;;;;;;;;;;;;;OAeG;IACG,QAAQ,CACZ,MAAM,EAAE,UAAU,EAClB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,eAAe,CAAC;CAmD5B"}
@@ -1,12 +1,23 @@
1
1
  import type { SyncConfig } from "./config.js";
2
+ /**
3
+ * Closed audit vocabulary (PR-B1, promised in the PR-A2 review): every tag a
4
+ * generator may record, enforced at the call sites through ReportRecorder
5
+ * (domain/types.ts) and at the sink through `record()` below. The previous
6
+ * shape was an honest-but-open `string` after review #315 showed a
7
+ * five-member union silently laundering the rest through a cast. PR-B2 (D6)
8
+ * deleted the dead generator family (wiring, test-generator, the migration-*
9
+ * trio) that owned every "info" recorder, and "warn" had no recorder at all —
10
+ * both dropped here as promised; "warning" is the live spelling (eslint.ts).
11
+ */
12
+ export type ReportEntryType = "created" | "updated" | "deleted" | "skipped" | "blocked" | "warning" | "error";
2
13
  export interface ReportEntry {
3
- type: "created" | "updated" | "skipped" | "blocked";
14
+ type: ReportEntryType;
4
15
  target: string;
5
16
  message?: string;
6
17
  }
7
18
  export declare class MigrationReport {
8
19
  private entries;
9
- record(type: string, target: string, message?: string): void;
20
+ record(type: ReportEntryType, target: string, message?: string): void;
10
21
  writeReport(config: SyncConfig): Promise<void>;
11
22
  }
12
23
  //# sourceMappingURL=migration-report.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migration-report.d.ts","sourceRoot":"","sources":["../src/migration-report.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,eAAe;IAC1B,OAAO,CAAC,OAAO,CAAqB;IACpC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;IAG/C,WAAW,CAAC,MAAM,EAAE,UAAU;CAcrC"}
1
+ {"version":3,"file":"migration-report.d.ts","sourceRoot":"","sources":["../src/migration-report.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;;;GASG;AACH,MAAM,MAAM,eAAe,GACvB,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,SAAS,GACT,OAAO,CAAC;AAEZ,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,eAAe;IAC1B,OAAO,CAAC,OAAO,CAAqB;IACpC,MAAM,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;IAGxD,WAAW,CAAC,MAAM,EAAE,UAAU;CAuErC"}
package/dist/results.d.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * Outcome vocabulary of `safeWriteFileAtomic` (fs-utils.ts). Declared here so
3
+ * every generator routes the same closed set through `recordWriteStatus`
4
+ * below instead of re-spelling the union (pre-B2, every generator hand-rolled
5
+ * its own copy of the routing if-chain and two of them miscounted — see the
6
+ * helper's doc).
7
+ */
8
+ export type WriteStatus = "created" | "updated" | "unchanged" | "skipped" | "protected";
1
9
  /**
2
10
  * Result shape returned by each individual generator function.
3
11
  */
@@ -5,6 +13,20 @@ export interface GeneratorResult {
5
13
  created: string[];
6
14
  skipped: string[];
7
15
  updated: string[];
16
+ /**
17
+ * Paths removed (or, under --dry-run, that WOULD be removed) by a generator.
18
+ * Introduced in PR-A2 for the empty-barrel unlink path — deletions were
19
+ * previously miscounted into `created`; surfaced in the engine summary since
20
+ * PR-B2 (truthful counts).
21
+ */
22
+ deleted: string[];
23
+ /**
24
+ * Paths whose generated content already matched on disk byte-for-byte
25
+ * (PR-B2, RCA #5). A converged tree lands everything here — `created`/
26
+ * `updated`/`deleted` mean an actual (or, under --dry-run, a planned)
27
+ * mutation, which is what `sync --check` gates on.
28
+ */
29
+ unchanged: string[];
8
30
  totalOps: number;
9
31
  summary?: string;
10
32
  error?: Error;
@@ -13,4 +35,48 @@ export interface GeneratorResult {
13
35
  * Factory for empty result.
14
36
  */
15
37
  export declare function createEmptyResult(): GeneratorResult;
38
+ /**
39
+ * Run-level aggregate returned by `SyncEngine.run()` (PR-B2). Counts sum every
40
+ * generator's buckets; `totalOps` is the number of actual (real run) or planned
41
+ * (--dry-run) mutations — creates + updates + deletes. A converged tree
42
+ * reports `totalOps: 0`, which is exactly what `sync --check` gates on (the
43
+ * CLI exits non-zero iff `totalOps > 0`; the exit-code decision stays in
44
+ * cli.ts per the A1 doctrine — the engine only reports).
45
+ *
46
+ * `errors` counts generators that failed-soft — caught their own exception
47
+ * into `result.error` (the Wave-2e "skip this package, do not abort" contract:
48
+ * tsconfig, eslint, apps, root-files) instead of throwing. A failed generator
49
+ * contributes ZERO ops, so without this count a run that could not even plan a
50
+ * file still printed `Total ops : 0` and exited 0 — errors masqueraded as
51
+ * convergence (PR-B2 review, B-1). The CLI exits non-zero whenever
52
+ * `errors > 0`, on real runs and previews alike; `totalOps` deliberately does
53
+ * NOT include errors (it means "planned mutations", and a failure plans
54
+ * nothing — the two are separate facts and separate exit reasons).
55
+ */
56
+ export interface SyncRunSummary {
57
+ created: number;
58
+ updated: number;
59
+ deleted: number;
60
+ unchanged: number;
61
+ skipped: number;
62
+ totalOps: number;
63
+ /** Generators that caught a failure into `result.error` this run. */
64
+ errors: number;
65
+ durationMs: number;
66
+ }
67
+ /**
68
+ * The single routing truth from a write status to the result buckets
69
+ * (PR-B2, RCA #5). Before this helper each generator hand-rolled the same
70
+ * if-chain, and two of them lied: shared-kernel counted updates as `created`
71
+ * and `unchanged` as `skipped`; layer-folders counted directory mkdirs as
72
+ * `created` on every run. Routing rules:
73
+ *
74
+ * created / updated → their bucket, +1 totalOps (a real or planned change)
75
+ * unchanged → `unchanged`, NOT an op (nothing was or would be written)
76
+ * skipped / protected → `skipped`, NOT an op (deliberately left alone)
77
+ *
78
+ * Deletions don't flow through here — they are not a `safeWriteFileAtomic`
79
+ * outcome; the deleting generator pushes `result.deleted` itself (recursive.ts).
80
+ */
81
+ export declare function recordWriteStatus(result: GeneratorResult, filePath: string, status: WriteStatus): void;
16
82
  //# sourceMappingURL=results.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../src/results.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,eAAe,CAOnD"}
1
+ {"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../src/results.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,SAAS,GACT,WAAW,GACX,SAAS,GACT,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;;;;OAKG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;;;;OAKG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,eAAe,CASnD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,WAAW,GAClB,IAAI,CAaN"}
@@ -1 +1 @@
1
- {"version":3,"file":"sync-engine-helpers.d.ts","sourceRoot":"","sources":["../src/sync-engine-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAEvE,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,eAAe,CAAC;IAC3B,SAAS,EAAE,eAAe,CAAC;IAC3B,OAAO,EAAE,eAAe,CAAC;IACzB,IAAI,EAAE,eAAe,CAAC;IACtB,SAAS,EAAE,eAAe,CAAC;IAC3B,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,eAAe,CAAC;IACvB,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAK7E;AAED,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,eAAe,EAC1B,UAAU,EAAE,eAAe,GAC1B,eAAe,CAqBjB"}
1
+ {"version":3,"file":"sync-engine-helpers.d.ts","sourceRoot":"","sources":["../src/sync-engine-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAEvE,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,eAAe,CAAC;IAC3B,SAAS,EAAE,eAAe,CAAC;IAC3B,OAAO,EAAE,eAAe,CAAC;IACzB,IAAI,EAAE,eAAe,CAAC;IACtB,SAAS,EAAE,eAAe,CAAC;IAC3B,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,EAAE,eAAe,CAAC;IACvB,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,eAAe,GAAG,IAAI,CAgB7E;AAED,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,eAAe,EAC1B,UAAU,EAAE,eAAe,GAC1B,eAAe,CAuEjB"}
@@ -1,4 +1,5 @@
1
1
  import { SyncFlags } from "./config.js";
2
+ import { type SyncRunSummary } from "./results.js";
2
3
  import type { Manifest } from "./types/manifest.js";
3
4
  export interface SyncEngineOptions {
4
5
  targetRoot?: string;
@@ -6,6 +7,8 @@ export interface SyncEngineOptions {
6
7
  }
7
8
  export declare class SyncEngine {
8
9
  private report;
10
+ private journal;
11
+ private failures;
9
12
  private partialConfig;
10
13
  private fullConfig;
11
14
  private manifest;
@@ -14,8 +17,17 @@ export declare class SyncEngine {
14
17
  constructor(flags: SyncFlags, options?: SyncEngineOptions);
15
18
  private getInitOptions;
16
19
  private getConfig;
20
+ /**
21
+ * Record a failed-soft generator result (B-1). Called at every site that
22
+ * receives a GeneratorResult, including the ones that never set `error`
23
+ * today — the check is one truthy test, and a future generator adopting the
24
+ * catch-into-result contract is then surfaced without anyone remembering
25
+ * this seam. `row` matches the summary-table label so the FAILED line and
26
+ * the table read as one report.
27
+ */
28
+ private noteFailure;
17
29
  private ensureDirectories;
18
30
  private generateCoreArtifacts;
19
- run(): Promise<void>;
31
+ run(): Promise<SyncRunSummary>;
20
32
  }
21
33
  //# sourceMappingURL=sync-engine.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sync-engine.d.ts","sourceRoot":"","sources":["../src/sync-engine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAc,MAAM,aAAa,CAAC;AAkBpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAkBpD,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,aAAa,CAAY;IACjC,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,aAAa,CAAc;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAoB;gBAEjC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,iBAAiB;IAKzD,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,SAAS;YAOH,iBAAiB;YAyCjB,qBAAqB;IAuF7B,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAkO3B"}
1
+ {"version":3,"file":"sync-engine.d.ts","sourceRoot":"","sources":["../src/sync-engine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAc,MAAM,aAAa,CAAC;AAkBpD,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAkBpD,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAyB;IAKvC,OAAO,CAAC,OAAO,CAAqB;IAYpC,OAAO,CAAC,QAAQ,CAA+C;IAC/D,OAAO,CAAC,aAAa,CAAY;IACjC,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,aAAa,CAAc;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAoB;gBAEjC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,iBAAiB;IAKzD,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,SAAS;IAOjB;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW;YAML,iBAAiB;YAmCjB,qBAAqB;IAiG7B,GAAG,IAAI,OAAO,CAAC,cAAc,CAAC;CA+SrC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Validate a candidate toolchain version: must be a FULL SemVer 2.0.0 version
3
+ * string and must not be the degenerate `0.0.0` that the old silent fallback
4
+ * produced. Returns the version on success, throws with the offending source
5
+ * on failure. Shared by the runtime resolver below AND the tsup build gate
6
+ * (tsup.config.ts imports it), so the two cannot drift apart.
7
+ */
8
+ export declare function assertValidToolchainVersion(version: unknown, source: string): string;
9
+ /**
10
+ * Resolve the engine's own version (e.g. `0.7.0`). Throws instead of
11
+ * returning a fallback — callers that scaffold pins must abort loudly.
12
+ */
13
+ export declare function resolveToolchainVersion(): string;
14
+ //# sourceMappingURL=toolchain-version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolchain-version.d.ts","sourceRoot":"","sources":["../src/toolchain-version.ts"],"names":[],"mappings":"AA2CA;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,GACb,MAAM,CAcR;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CA6BhD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexagen-monaco/sync",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "description": "HexaGen Sync Engine — Generate and sync modular monorepos",
6
6
  "keywords": [
@@ -1,23 +0,0 @@
1
- /**
2
- * Stub Generation Use Case
3
- *
4
- * Orchestrates the stub file generation process for a bounded context.
5
- * Handles template resolution, naming cascade, emission planning,
6
- * and file emission.
7
- */
8
- import type { BoundedContext, StubsConfig } from "../../types/manifest.js";
9
- import { type GeneratorResult } from "../../results.js";
10
- import type { FileSystemPort } from "../ports/out/file-system.port.js";
11
- import type { LoggerPort } from "@hexagen/shared";
12
- export interface StubGenerationOptions {
13
- moduleDir: string;
14
- moduleName: string;
15
- stubsConfig: StubsConfig | undefined;
16
- context: BoundedContext;
17
- }
18
- export interface StubGenerationResult {
19
- result: GeneratorResult;
20
- skippedCount: number;
21
- }
22
- export declare function generateStubs(options: StubGenerationOptions, fsPort: FileSystemPort, logger: LoggerPort): Promise<StubGenerationResult>;
23
- //# sourceMappingURL=stub-generation.use-case.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stub-generation.use-case.d.ts","sourceRoot":"","sources":["../../../src/application/use-cases/stub-generation.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EAGZ,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAalD,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,eAAe,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACtB;AA8BD,wBAAsB,aAAa,CACjC,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC,oBAAoB,CAAC,CAwE/B"}
@@ -1,7 +0,0 @@
1
- import { type GeneratorResult } from "../results.js";
2
- import { type PackageAudit, type MigrationConfig, type ReportRecorder } from "./migration-audit.js";
3
- export { auditPackages, generateMigrationReport } from "./migration-audit.js";
4
- export type { PackageAudit, MigrationConfig } from "./migration-audit.js";
5
- declare function migratePackage(audit: PackageAudit, config: MigrationConfig, reporter: ReportRecorder): Promise<GeneratorResult>;
6
- export { migratePackage };
7
- //# sourceMappingURL=migration-assistant.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migration-assistant.d.ts","sourceRoot":"","sources":["../../src/generators/migration-assistant.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAQ9B,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE1E,iBAAe,cAAc,CAC3B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,eAAe,CAAC,CAsG1B;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1,28 +0,0 @@
1
- import type { SyncConfig } from "../config.js";
2
- import type { ReportRecorder } from "../domain/types.js";
3
- interface PackageAudit {
4
- packageName: string;
5
- packagePath: string;
6
- missingAdapters: string[];
7
- missingWiring: string[];
8
- missingTestDoubles: string[];
9
- missingMcpTools: string[];
10
- missingTests: string[];
11
- }
12
- interface MigrationConfig {
13
- enabled?: boolean;
14
- dryRun?: boolean;
15
- packages?: string[];
16
- generateAdapters?: boolean;
17
- generateWiring?: boolean;
18
- generateTestDoubles?: boolean;
19
- generateMcpTools?: boolean;
20
- generateTests?: boolean;
21
- }
22
- declare function auditPackages(config: SyncConfig, reporter: ReportRecorder): Promise<PackageAudit[]>;
23
- declare function generateMigrationReport(audits: PackageAudit[]): string;
24
- declare function hasIssues(audit: PackageAudit): boolean;
25
- export { auditPackages, generateMigrationReport, hasIssues };
26
- export type { PackageAudit, MigrationConfig };
27
- export type { ReportRecorder } from "../domain/types.js";
28
- //# sourceMappingURL=migration-audit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migration-audit.d.ts","sourceRoot":"","sources":["../../src/generators/migration-audit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,UAAU,YAAY;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,UAAU,eAAe;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,iBAAe,aAAa,CAC1B,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,YAAY,EAAE,CAAC,CAuBzB;AAiGD,iBAAS,uBAAuB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CA0D/D;AAED,iBAAS,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAQ/C;AAED,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,SAAS,EAAE,CAAC;AAC7D,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;AAC9C,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,7 +0,0 @@
1
- declare function generateAdapterStub(adapterName: string): string;
2
- declare function generateWiringStub(packageName: string): string;
3
- declare function generateTestDoubleStub(testDoubleName: string): string;
4
- declare function generateMcpToolsStub(packageName: string): string;
5
- declare function toPascalCase(str: string): string;
6
- export { generateAdapterStub, generateWiringStub, generateTestDoubleStub, generateMcpToolsStub, toPascalCase, };
7
- //# sourceMappingURL=migration-stubs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migration-stubs.d.ts","sourceRoot":"","sources":["../../src/generators/migration-stubs.ts"],"names":[],"mappings":"AAAA,iBAAS,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAexD;AAED,iBAAS,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAkBvD;AAED,iBAAS,sBAAsB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAa9D;AAED,iBAAS,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAYzD;AAED,iBAAS,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKzC;AAED,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,YAAY,GACb,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { SyncConfig } from "../config.js";
2
- import { type GeneratorResult } from "../results.js";
3
- import { generateEnhancedTestDouble } from "./test-templates/index.js";
4
- import type { ReportRecorder } from "../domain/types.js";
5
- export { generateEnhancedTestDouble };
6
- export declare function generateTests(moduleDir: string, moduleName: string, config: SyncConfig, report?: ReportRecorder): Promise<GeneratorResult>;
7
- //# sourceMappingURL=test-generator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-generator.d.ts","sourceRoot":"","sources":["../../src/generators/test-generator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAIL,0BAA0B,EAC3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAmBzD,OAAO,EAAE,0BAA0B,EAAE,CAAC;AAEtC,wBAAsB,aAAa,CACjC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC,CAkI1B"}
@@ -1,2 +0,0 @@
1
- export declare function generateDataBuilder(entity: string): string;
2
- //# sourceMappingURL=data-builder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-builder.d.ts","sourceRoot":"","sources":["../../../src/generators/test-templates/data-builder.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAyD1D"}
@@ -1,2 +0,0 @@
1
- export declare function generateEnhancedTestDouble(port: string, methods: string[], scope: string): string;
2
- //# sourceMappingURL=enhanced-test-double.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enhanced-test-double.d.ts","sourceRoot":"","sources":["../../../src/generators/test-templates/enhanced-test-double.ts"],"names":[],"mappings":"AAAA,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EAAE,EACjB,KAAK,EAAE,MAAM,GACZ,MAAM,CAqFR"}
@@ -1,5 +0,0 @@
1
- export { generateUnitTest } from "./unit-test.js";
2
- export { generateIntegrationTest } from "./integration-test.js";
3
- export { generateDataBuilder } from "./data-builder.js";
4
- export { generateEnhancedTestDouble } from "./enhanced-test-double.js";
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/test-templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare function generateIntegrationTest(useCase: string): string;
2
- //# sourceMappingURL=integration-test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration-test.d.ts","sourceRoot":"","sources":["../../../src/generators/test-templates/integration-test.ts"],"names":[],"mappings":"AAAA,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAmE/D"}
@@ -1,2 +0,0 @@
1
- export declare function generateUnitTest(useCase: string, outPorts: string[]): string;
2
- //# sourceMappingURL=unit-test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unit-test.d.ts","sourceRoot":"","sources":["../../../src/generators/test-templates/unit-test.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAmG5E"}
@@ -1,20 +0,0 @@
1
- import type { SyncConfig } from "../config.js";
2
- import { type GeneratorResult } from "../results.js";
3
- import type { ReportRecorder } from "../domain/types.js";
4
- /**
5
- * Generate wiring code for a bounded context.
6
- *
7
- * This is the main entry point for the wiring generator. It:
8
- * 1. Reads use case declarations from the manifest
9
- * 2. Generates composition root bindings
10
- * 3. Generates test doubles for ports
11
- * 4. Generates MCP tool registrations
12
- *
13
- * @param moduleDir - Package root directory
14
- * @param moduleName - Bounded context name
15
- * @param config - Sync configuration
16
- * @param report - Optional diagnostic recorder
17
- * @returns Generator result with created/updated files
18
- */
19
- export declare function generateWiring(moduleDir: string, moduleName: string, config: SyncConfig, report?: ReportRecorder): Promise<GeneratorResult>;
20
- //# sourceMappingURL=wiring.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../src/generators/wiring.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA2JzD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,cAAc,CAClC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC,CAmK1B"}