@hexagen-monaco/sync 0.15.0 → 0.17.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 (39) hide show
  1. package/dist/__tests__/drift-files.test.d.ts +2 -0
  2. package/dist/__tests__/drift-files.test.d.ts.map +1 -0
  3. package/dist/cli.js +4437 -966
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/sync/check-json-files.test.d.ts +2 -0
  6. package/dist/commands/sync/check-json-files.test.d.ts.map +1 -0
  7. package/dist/commands/sync/check-json.d.ts +25 -5
  8. package/dist/commands/sync/check-json.d.ts.map +1 -1
  9. package/dist/domain/services/codec-sample-synthesizer.d.ts +75 -0
  10. package/dist/domain/services/codec-sample-synthesizer.d.ts.map +1 -0
  11. package/dist/domain/services/codec-schema-builder.d.ts +112 -0
  12. package/dist/domain/services/codec-schema-builder.d.ts.map +1 -0
  13. package/dist/domain/services/index.d.ts +2 -0
  14. package/dist/domain/services/index.d.ts.map +1 -1
  15. package/dist/generators/codec-test.d.ts +19 -0
  16. package/dist/generators/codec-test.d.ts.map +1 -0
  17. package/dist/generators/codecs.d.ts +8 -0
  18. package/dist/generators/codecs.d.ts.map +1 -0
  19. package/dist/generators/port-analyzer.d.ts +2 -0
  20. package/dist/generators/port-analyzer.d.ts.map +1 -1
  21. package/dist/index.js +3857 -402
  22. package/dist/index.js.map +1 -1
  23. package/dist/preflight.d.ts +4 -1
  24. package/dist/preflight.d.ts.map +1 -1
  25. package/dist/results.d.ts +40 -0
  26. package/dist/results.d.ts.map +1 -1
  27. package/dist/sync-engine-helpers.d.ts +1 -0
  28. package/dist/sync-engine-helpers.d.ts.map +1 -1
  29. package/dist/sync-engine.d.ts +9 -0
  30. package/dist/sync-engine.d.ts.map +1 -1
  31. package/dist/types/manifest/generator.d.ts +5 -0
  32. package/dist/types/manifest/generator.d.ts.map +1 -1
  33. package/dist/types/manifest/helpers.d.ts +5 -2
  34. package/dist/types/manifest/helpers.d.ts.map +1 -1
  35. package/dist/types/manifest/index.d.ts +2 -2
  36. package/dist/types/manifest/index.d.ts.map +1 -1
  37. package/dist/types/manifest/layers.d.ts +45 -0
  38. package/dist/types/manifest/layers.d.ts.map +1 -1
  39. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=check-json-files.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-json-files.test.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/check-json-files.test.ts"],"names":[],"mappings":""}
@@ -1,15 +1,18 @@
1
- import type { SyncRunSummary } from "../../results.js";
1
+ import type { DriftFile, SyncRunSummary } from "../../results.js";
2
2
  /**
3
3
  * Schema version of the machine-readable line `hexagen sync --check --json`
4
- * prints (lane H2b). Bump when the shape changes.
4
+ * prints (lane H2b). Bump on a breaking change. An added key is additive under the
5
+ * compatibility policy (consumer-contract plan, H3), so it keeps the version.
5
6
  */
6
7
  export declare const SYNC_CHECK_JSON_SCHEMA_VERSION = 1;
7
8
  /** Machine-readable status of a `sync --check` run. */
8
9
  export type SyncCheckStatus = "converged" | "drift" | "could-not-run";
9
10
  /**
10
- * The one JSON line `hexagen sync --check --json` writes to stdout. Keys are
11
- * documented in this order; `pending`, `errors` and `manifestMissing` are
12
- * `null` only on the fatal path, where no summary exists to report.
11
+ * The one JSON line `hexagen sync --check --json` writes to stdout. Ten
12
+ * keys, `files` last, documented in this order; `pending`, `errors`,
13
+ * `manifestMissing`, `timingsMs` and `files` are `null` only on the fatal
14
+ * path, where no summary exists to report. On the non-fatal paths `files`
15
+ * is an array (empty when converged), sorted and workspace-relative.
13
16
  */
14
17
  export interface SyncCheckJson {
15
18
  schemaVersion: number;
@@ -25,6 +28,23 @@ export interface SyncCheckJson {
25
28
  errors: number | null;
26
29
  manifestMissing: boolean | null;
27
30
  reason: string | null;
31
+ /**
32
+ * Per-phase timings, or `null` on the fatal path or when the summary has no
33
+ * `phaseTimingsMs`. `total` is the run's overall duration
34
+ * (`summary.durationMs`).
35
+ */
36
+ timingsMs: {
37
+ gitStatus: number | null;
38
+ preflight: number | null;
39
+ generators: number;
40
+ linter: number | null;
41
+ total: number;
42
+ } | null;
43
+ /**
44
+ * Per-file drift, sorted and workspace-relative, or `null` on the fatal
45
+ * path. `[]` when converged.
46
+ */
47
+ files: DriftFile[] | null;
28
48
  }
29
49
  /**
30
50
  * Build the JSON payload for `sync --check --json`. Exactly one of `summary` /
@@ -1 +1 @@
1
- {"version":3,"file":"check-json.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/check-json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAEhD,uDAAuD;AACvD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,OAAO,GAAG,eAAe,CAAC;AAEtE;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,IAAI,CAAC;IACT,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,cAAc,GAAG,SAAS,EACnC,YAAY,EAAE,MAAM,GAAG,SAAS,GAC/B,aAAa,CAsEf"}
1
+ {"version":3,"file":"check-json.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/check-json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAEhD,uDAAuD;AACvD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,OAAO,GAAG,eAAe,CAAC;AAEtE;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;IAChB,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,IAAI,CAAC;IACT,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;;;OAIG;IACH,SAAS,EAAE;QACT,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,IAAI,CAAC;IACT;;;OAGG;IACH,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,cAAc,GAAG,SAAS,EACnC,YAAY,EAAE,MAAM,GAAG,SAAS,GAC/B,aAAa,CAoFf"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Proxy-detection port (arch-lint `node-builtin-in-layer`): the domain layer
3
+ * must not import Node builtins, so `util.types.isProxy` is injected here by
4
+ * the composition seam — `src/generators/codec-test.ts` imports it from
5
+ * "node:util" and installs it at module load. Until installed, the fallback
6
+ * relies on the reflection/trap-throw checks below, which still refuse any
7
+ * Proxy whose traps throw; detectable-but-non-throwing Proxies are only
8
+ * refused once the detector is installed (production always installs it).
9
+ */
10
+ type IsProxyDetector = (value: unknown) => boolean;
11
+ export declare function installIsProxyDetector(fn: IsProxyDetector): void;
12
+ export declare function looksLikeProxy(value: unknown): boolean;
13
+ /** Typed refusal reasons for the codec-test generator's trust boundary. */
14
+ export type CodecTestGeneratorErrorCode = "MALFORMED_CONTRACT" | "UNKNOWN_TYPE" | "MISSING_BOUND" | "UNSUPPORTED_NESTED_SHAPE" | "MISSING_PATTERN_EXAMPLE" | "HOSTILE_INPUT" | "IO_FAILURE" | "TIMEOUT_OR_BUDGET";
15
+ /** Typed error carried by every refusal in this lane. */
16
+ export declare class CodecTestGeneratorError extends Error {
17
+ readonly code: CodecTestGeneratorErrorCode;
18
+ readonly path: string | null;
19
+ constructor(code: CodecTestGeneratorErrorCode, path: string | null, message: string);
20
+ }
21
+ /** Hard traversal bounds (see the module-header cost bounds). */
22
+ export declare const MAX_PORTS_PER_CONTEXT = 64;
23
+ export declare const MAX_BOUNDED_CONTEXTS = 64;
24
+ export declare const MAX_SAMPLE_CONTRACT_DEPTH = 8;
25
+ export declare const MAX_CONTRACT_FIELDS = 64;
26
+ export declare const MAX_CONTRACT_NODES = 512;
27
+ export declare const MAX_SAMPLE_BYTES = 8192;
28
+ export declare const MAX_ARRAY_ITEMS_BOUND = 10000;
29
+ export declare const MAX_STRING_LENGTH_BOUND = 65536;
30
+ /** Pattern-size budget: patterns longer than this are refused outright. */
31
+ export declare const MAX_PATTERN_LENGTH = 256;
32
+ /** Matching-step budget for the bounded pattern matcher. */
33
+ export declare const MAX_PATTERN_STEPS = 10000;
34
+ /**
35
+ * Read ONE own data property from a PLAIN object without ever invoking
36
+ * accessors. Cost: O(1) — a trap-catching plainness check, a Set lookup and
37
+ * one descriptor read inside a try/catch. Throws HOSTILE_INPUT for:
38
+ * non-object/null receivers, detectable Proxies, reflection/trap throws,
39
+ * non-plain prototypes, prototype-polluting keys and getter/setter
40
+ * descriptors. Returns `undefined` for an ABSENT own property as well as an
41
+ * own data property whose value is `undefined` — callers that must
42
+ * distinguish the two use `hasOwnPlainProperty`.
43
+ */
44
+ export declare function readOwnPlainProperty(obj: unknown, key: string): unknown;
45
+ /**
46
+ * Distinguish an ABSENT own property from an own data property whose value is
47
+ * `undefined`. O(1) — one trap-catching descriptor read.
48
+ */
49
+ export declare function hasOwnPlainProperty(obj: unknown, key: string): boolean;
50
+ /**
51
+ * Validate that `value` is a PLAIN record: an object with `Object.prototype`
52
+ * (or null) prototype, not an array, not a detectable Proxy, with no
53
+ * reflection throw. Refuses null/undefined (HOSTILE_INPUT). Cost: O(1).
54
+ */
55
+ export declare function validatePlainRecord(value: unknown): void;
56
+ /**
57
+ * Iterative bounded matcher. The recursive CPS matcher it replaces recursed
58
+ * once per quantifier repetition, so a long matching example (e.g. `a+`
59
+ * against thousands of characters) exhausted the JavaScript call stack and
60
+ * surfaced as a `RangeError` before the step budget could run. The machine
61
+ * below keeps its continuation and backtrack state on the heap in explicitly
62
+ * bounded structures, so MAX_PATTERN_STEPS is always the first budget to
63
+ * blow — with the required TIMEOUT_OR_BUDGET refusal, never a RangeError.
64
+ */
65
+ export declare function matchesPatternBounded(pattern: string, sample: string): boolean;
66
+ /**
67
+ * Synthesize ONE deterministic valid sample for an untrusted contract node.
68
+ * Throws `CodecTestGeneratorError` with the deterministic error-code
69
+ * precedence documented in the module header. O(N) with hard global budgets
70
+ * (nodes + serialized bytes) enforced BEFORE any unbounded traversal or
71
+ * allocation.
72
+ */
73
+ export declare function synthesizeValidSample(contract: unknown, portLabel: string): unknown;
74
+ export {};
75
+ //# sourceMappingURL=codec-sample-synthesizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-sample-synthesizer.d.ts","sourceR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wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CA+BtE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAqCxD;AAijBD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAiLT;AA+YD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAWT"}
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Local Result variant with E pinned to CodecGeneratorError (domain/result's
3
+ * `ok` hardcodes E = Error, which is not assignable to the narrower error
4
+ * this trust boundary must return).
5
+ */
6
+ export type Result<T, E = CodecGeneratorError> = {
7
+ success: true;
8
+ value: T;
9
+ } | {
10
+ success: false;
11
+ error: E;
12
+ };
13
+ export declare function ok<T>(value: T): Result<T, CodecGeneratorError>;
14
+ export declare function err(error: CodecGeneratorError): Result<never, CodecGeneratorError>;
15
+ /** Typed refusal reasons for the codec generator's trust boundary. */
16
+ export type CodecGeneratorErrorCode = "MALFORMED_CONTRACT" | "HOSTILE_INPUT" | "PROTOTYPE_POLLUTION" | "BOUNDS_EXCEEDED" | "UNKNOWN_TYPE" | "MISSING_BOUND" | "UNSUPPORTED_SHAPE" | "MALFORMED_RUNTIME_MODULE";
17
+ /** Typed error carried by every `err(...)` this module returns. */
18
+ export declare class CodecGeneratorError extends Error {
19
+ readonly code: CodecGeneratorErrorCode;
20
+ readonly path: string;
21
+ constructor(code: CodecGeneratorErrorCode, path: string, message: string);
22
+ }
23
+ /** Hard bounds for contract traversal (see cost bounds in the header). */
24
+ export declare const MAX_CONTRACT_DEPTH = 16;
25
+ export declare const MAX_OBJECT_FIELDS = 64;
26
+ export declare const MAX_ENUM_VALUES = 64;
27
+ export declare const MAX_TOTAL_NODES = 512;
28
+ /**
29
+ * Runtime API contract module providing `createCodec` / `Codec` / `CodecEnv` /
30
+ * `Validated`. Configurable via `manifest.codec.runtimeModule` (Lane H1).
31
+ */
32
+ export declare const DEFAULT_RUNTIME_MODULE = "@fleet/shared";
33
+ /**
34
+ * Read ONE own data property from untrusted input without ever invoking
35
+ * accessors. Cost: O(1) — a plainness check (itself trap-catching), a Set
36
+ * lookup and one descriptor read inside a trap-catching boundary.
37
+ */
38
+ export declare function readOwnDataProperty(obj: unknown, key: string, path: string): Result<unknown, CodecGeneratorError>;
39
+ /**
40
+ * Distinguish an ABSENT own property from an own DATA property whose value is
41
+ * `undefined` — `readOwnDataProperty` returns `ok(undefined)` for both, so
42
+ * callers that must reject any specified property (e.g. `minLength`) use this.
43
+ * Cost: O(1) — one trap-catching descriptor read.
44
+ */
45
+ export declare function hasOwnDataProperty(obj: unknown, key: string, path: string): Result<boolean, CodecGeneratorError>;
46
+ /**
47
+ * Read an untrusted value as a DENSE array. Never touches `val.length` via an
48
+ * ordinary property read (that would invoke a Proxy `get` trap outside the
49
+ * boundary); the length comes from its own data descriptor. Cost: O(len) with
50
+ * `len <= maxLen` enforced BEFORE any per-index work, so enormous lengths are
51
+ * refused without allocating or iterating.
52
+ */
53
+ export declare function readDenseArray(val: unknown, maxLen: number, path: string): Result<readonly unknown[], CodecGeneratorError>;
54
+ /**
55
+ * Literal schema tree handed to the runtime `createCodec` (Lane H1 contract).
56
+ * Objects are always exact; every bounded kind carries an explicit positive
57
+ * bound; no `minLength` is emitted.
58
+ */
59
+ export type CodecSchemaLiteral = {
60
+ kind: "object";
61
+ exact: true;
62
+ fields: Record<string, CodecSchemaLiteral>;
63
+ } | {
64
+ kind: "array";
65
+ items: CodecSchemaLiteral;
66
+ maxItems: number;
67
+ } | {
68
+ kind: "string";
69
+ maxLength: number;
70
+ pattern?: string;
71
+ } | {
72
+ kind: "integer" | "number";
73
+ min?: number;
74
+ max?: number;
75
+ } | {
76
+ kind: "boolean";
77
+ } | {
78
+ kind: "enum";
79
+ values: readonly string[];
80
+ } | {
81
+ kind: "literal";
82
+ value: string | number | boolean | null;
83
+ } | {
84
+ kind: "nullable";
85
+ of: CodecSchemaLiteral;
86
+ };
87
+ /**
88
+ * Resolve `manifest.codec.runtimeModule` defensively. O(1): at most two own
89
+ * descriptors are inspected, plus a length/charset check on the string —
90
+ * no recursion or iteration.
91
+ */
92
+ export declare function resolveRuntimeModule(manifest: unknown): Result<string, CodecGeneratorError>;
93
+ /**
94
+ * Validate an untrusted port contract into a `CodecSchemaLiteral`.
95
+ * O(N) with the bounds documented in the module header; the shared node
96
+ * counter enforces MAX_TOTAL_NODES across the entire tree.
97
+ */
98
+ export declare function buildCodecSchema(rawContract: unknown, pathPrefix?: string): Result<CodecSchemaLiteral, CodecGeneratorError>;
99
+ export interface RenderCodecModuleInput {
100
+ portName: string;
101
+ schemaId: string;
102
+ runtimeModule: string;
103
+ schema: CodecSchemaLiteral;
104
+ }
105
+ /**
106
+ * Render the emitted `<PortName>.codec.ts` module. Deterministic: field keys
107
+ * are sorted with code-point comparison at every object level (both in the TS
108
+ * type and in the schema literal), so equal inputs yield byte-identical
109
+ * output. O(N log F) with N <= MAX_TOTAL_NODES and F <= MAX_OBJECT_FIELDS.
110
+ */
111
+ export declare function renderCodecModule(input: RenderCodecModuleInput): string;
112
+ //# sourceMappingURL=codec-schema-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-schema-builder.d.ts","sourceRoot":"","sources":["../../../src/domain/services/codec-schema-builder.ts"],"names":[],"mappings":"AAmBA;;;;GAIG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,mBAAmB,IACzC;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAC3B;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC;AAEjC,wBAAgB,EAAE,CAAC,CAAC,EAAE,KA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AAC;IACtB,MAAM,EAAE,kBAAkB,CAAC;CAC5B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,MAAM,CAevE"}
@@ -1,4 +1,6 @@
1
1
  export * from "./architectural-boundary-checker.js";
2
+ export * from "./codec-sample-synthesizer.js";
3
+ export * from "./codec-schema-builder.js";
2
4
  export * from "./emission-plan-builder.js";
3
5
  export * from "./impact-analysis.types.js";
4
6
  export * from "./impact-request-validator.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/services/index.ts"],"names":[],"mappings":"AAEA,cAAc,qCAAqC,CAAC;AACpD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/services/index.ts"],"names":[],"mappings":"AAEA,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { SyncConfig } from "../config.js";
2
+ import { type GeneratorResult } from "../results.js";
3
+ import type { ReportRecorder } from "../domain/types.js";
4
+ /** Default runtime module providing the fleet-v2 codec contract. */
5
+ export declare const DEFAULT_RUNTIME_MODULE = "@fleet/shared";
6
+ export declare function generateCodecTests(moduleDir: string, moduleName: string, config: SyncConfig, report?: ReportRecorder): Promise<GeneratorResult>;
7
+ export interface RenderCodecTestInput {
8
+ portName: string;
9
+ portFileBase: string;
10
+ runtimeModule: string;
11
+ sample: unknown;
12
+ }
13
+ /**
14
+ * Render the emitted codec test. Deterministic: the synthesized sample is
15
+ * embedded as a JSON literal, so equal inputs yield byte-identical output
16
+ * (idempotent re-runs land on "unchanged").
17
+ */
18
+ export declare function renderCodecTest(input: RenderCodecTestInput): string;
19
+ //# sourceMappingURL=codec-test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-test.d.ts","sourceRoot":"","sources":["../../src/generators/codec-test.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAmBzD,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AA+EtD,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC,CAgE1B;AA8SD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CA0BnE"}
@@ -0,0 +1,8 @@
1
+ import type { SyncConfig } from "../config.js";
2
+ import { type GeneratorResult } from "../results.js";
3
+ import type { ReportRecorder } from "../domain/types.js";
4
+ /** Hard traversal bounds for the manifest walk (see header cost bound). */
5
+ export declare const MAX_BOUNDED_CONTEXTS = 64;
6
+ export declare const MAX_PORTS_PER_DIRECTION = 64;
7
+ export declare function generateCodecs(moduleDir: string, moduleName: string, config: SyncConfig, report?: ReportRecorder): Promise<GeneratorResult>;
8
+ //# sourceMappingURL=codecs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codecs.d.ts","sourceRoot":"","sources":["../../src/generators/codecs.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAGL,KAAK,eAAe,EAErB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAqBzD,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C,wBAAsB,cAAc,CAClC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,UAAU,EAClB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC,CA6C1B"}
@@ -45,6 +45,8 @@ export interface PortAnalysisResult {
45
45
  imports: TypeImport[];
46
46
  filePath: string;
47
47
  }
48
+ /** Test/run boundary: forget the memo (issue #907). */
49
+ export declare function resetPortAnalysisMemo(): void;
48
50
  /**
49
51
  * Analyze a port interface file and extract method signatures and imports
50
52
  *
@@ -1 +1 @@
1
- {"version":3,"file":"port-analyzer.d.ts","sourceRoot":"","sources":["../../src/generators/port-analyzer.ts"],"names":[],"mappings":"AAiBA;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,MAAM,CAQR;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,MAAM,CASR;AA8DD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,KAAK,CAAC;QAChB,IAAI,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