tina4-nodejs 3.13.119 → 3.13.121

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.
@@ -23,6 +23,17 @@ export interface ResolutionInput {
23
23
  name: string;
24
24
  fields: string | null;
25
25
  }
26
+ /**
27
+ * One `// tina4:edit …` marker found in a written (or would-be-written)
28
+ * template file. `file` is repo-relative POSIX (matches the rest of the
29
+ * envelope's paths); `line` is 1-based; `label` is the short imperative label
30
+ * that followed the marker on the same line.
31
+ */
32
+ export interface EditHint {
33
+ file: string;
34
+ line: number;
35
+ label: string;
36
+ }
26
37
  export interface ResolutionBody {
27
38
  class_name?: string;
28
39
  table_name?: string;
@@ -30,6 +41,8 @@ export interface ResolutionBody {
30
41
  migration_path?: string;
31
42
  routes?: string[];
32
43
  test_paths?: string[];
44
+ edit_hints?: EditHint[];
45
+ next?: string[];
33
46
  transformations: ResolutionTransformation[];
34
47
  }
35
48
  export interface ResolutionEnvelope {
@@ -45,8 +58,15 @@ export interface ResolutionEnvelope {
45
58
  * `resolution_contract.envelope` so the tina4 client (or any consumer) can
46
59
  * discover the exact contract this framework speaks. Bump when a breaking
47
60
  * key rename / removal lands; keep unchanged when new OPTIONAL keys are added.
61
+ *
62
+ * `generate_v1_1` (ADR-0063, 3.13.120) is a PURELY ADDITIVE superset of
63
+ * `generate_v1`: every v1 field is preserved, and two new optional arrays
64
+ * appear — `resolution.edit_hints[]` (one entry per `// tina4:edit` marker
65
+ * baked into a template) and `resolution.next[]` (curated per-verb actionable
66
+ * next steps). `resolution.test_paths[]` was already in v1; v1.1 surfaces it
67
+ * in the human stderr block too.
48
68
  */
49
- export declare const RESOLUTION_ENVELOPE_VERSION = "generate_v1";
69
+ export declare const RESOLUTION_ENVELOPE_VERSION = "generate_v1_1";
50
70
  /** Read-only snapshot of the current resolution — exported for tests that
51
71
  * want to inspect it in-process (the CLI itself uses only the envelope). */
52
72
  export declare function currentResolution(): ResolutionEnvelope;
@@ -95,3 +115,19 @@ export interface GeneratorSpec {
95
115
  }
96
116
  export declare const GENERATORS: Record<string, GeneratorSpec>;
97
117
  export declare function generate(what: string, name: string, extraArgs?: string[]): Promise<void>;
118
+ /**
119
+ * Programmatic entry point for in-process consumers (MCP tools, tests, hosted
120
+ * agents) — does everything `generate()` does EXCEPT print.
121
+ *
122
+ * Reset the resolution → dispatch to the requested generator → populate `next[]`
123
+ * → return the envelope. Files still land on disk (unless `--dry-run` is passed
124
+ * in `extraArgs`); only the human "Created …" per-file log and the
125
+ * `printResolution()` output are suppressed (via `jsonMode: true`, the same
126
+ * suppression `--json` uses on the CLI).
127
+ *
128
+ * Used by the MCP `migration_create` tool (packages/core/src/mcp.ts) so the
129
+ * ADR-0063 `generate_v1_1` envelope drives every surface (CLI, MCP, tests)
130
+ * without a subprocess round-trip.
131
+ */
132
+ export declare function generateProgrammatic(what: string, name: string, extraArgs?: string[]): Promise<ResolutionEnvelope>;
133
+ export declare function generateMigration(name: string, flags: Record<string, string | boolean>, fieldsOverride?: Array<[string, string]>, tableOverride?: string, emitTest?: boolean): void;
@@ -1 +1 @@
1
- export declare function createMigration(description?: string): Promise<void>;
1
+ export declare function createMigration(args?: string[]): Promise<void>;