@prisma-next/cli 0.12.0-dev.4 → 0.12.0-dev.40

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 (165) hide show
  1. package/README.md +2 -2
  2. package/dist/cli.mjs +180 -163
  3. package/dist/cli.mjs.map +1 -1
  4. package/dist/{client-KgJorIvG.mjs → client-BNdG504y.mjs} +80 -56
  5. package/dist/client-BNdG504y.mjs.map +1 -0
  6. package/dist/{command-helpers-Bbw1GbwL.mjs → command-helpers-xvg9oq4T.mjs} +301 -23
  7. package/dist/command-helpers-xvg9oq4T.mjs.map +1 -0
  8. package/dist/commands/contract-emit.mjs +1 -1
  9. package/dist/commands/contract-infer.mjs +1 -1
  10. package/dist/commands/db-init.mjs +4 -5
  11. package/dist/commands/db-init.mjs.map +1 -1
  12. package/dist/commands/db-schema.mjs +3 -3
  13. package/dist/commands/db-sign.mjs +4 -4
  14. package/dist/commands/db-update.d.mts.map +1 -1
  15. package/dist/commands/db-update.mjs +10 -7
  16. package/dist/commands/db-update.mjs.map +1 -1
  17. package/dist/commands/db-verify.mjs +1 -1
  18. package/dist/commands/migrate.d.mts +2 -2
  19. package/dist/commands/migrate.d.mts.map +1 -1
  20. package/dist/commands/migrate.mjs +6 -8
  21. package/dist/commands/migrate.mjs.map +1 -1
  22. package/dist/commands/migration-check.d.mts +55 -1
  23. package/dist/commands/migration-check.d.mts.map +1 -1
  24. package/dist/commands/migration-check.mjs +2 -2
  25. package/dist/commands/migration-graph.d.mts +25 -7
  26. package/dist/commands/migration-graph.d.mts.map +1 -1
  27. package/dist/commands/migration-graph.mjs +170 -2
  28. package/dist/commands/migration-graph.mjs.map +1 -0
  29. package/dist/commands/migration-list.d.mts +24 -26
  30. package/dist/commands/migration-list.d.mts.map +1 -1
  31. package/dist/commands/migration-list.mjs +2 -190
  32. package/dist/commands/migration-log.d.mts +20 -15
  33. package/dist/commands/migration-log.d.mts.map +1 -1
  34. package/dist/commands/migration-log.mjs +1 -137
  35. package/dist/commands/migration-new.mjs +3 -3
  36. package/dist/commands/migration-plan.d.mts +1 -1
  37. package/dist/commands/migration-plan.mjs +1 -1
  38. package/dist/commands/migration-show.d.mts +1 -4
  39. package/dist/commands/migration-show.d.mts.map +1 -1
  40. package/dist/commands/migration-show.mjs +13 -25
  41. package/dist/commands/migration-show.mjs.map +1 -1
  42. package/dist/commands/migration-status.d.mts +41 -141
  43. package/dist/commands/migration-status.d.mts.map +1 -1
  44. package/dist/commands/migration-status.mjs +2 -759
  45. package/dist/commands/ref.d.mts +1 -1
  46. package/dist/commands/ref.mjs +3 -3
  47. package/dist/commands/telemetry/index.d.mts +7 -0
  48. package/dist/commands/telemetry/index.d.mts.map +1 -0
  49. package/dist/commands/telemetry/index.mjs +2 -0
  50. package/dist/{contract-at-errors-BxP-TOMl.mjs → contract-at-errors-Wj3u4Xco.mjs} +2 -2
  51. package/dist/{contract-at-errors-BxP-TOMl.mjs.map → contract-at-errors-Wj3u4Xco.mjs.map} +1 -1
  52. package/dist/{contract-emit-DxcGl4Uq.mjs → contract-emit-COg18szA.mjs} +3 -3
  53. package/dist/{contract-emit-DxcGl4Uq.mjs.map → contract-emit-COg18szA.mjs.map} +1 -1
  54. package/dist/{contract-emit-D-4jrNve.mjs → contract-emit-KyJNQK5-.mjs} +3 -3
  55. package/dist/{contract-emit-D-4jrNve.mjs.map → contract-emit-KyJNQK5-.mjs.map} +1 -1
  56. package/dist/{contract-infer-D8uEbJuu.mjs → contract-infer-IEp0227u.mjs} +3 -3
  57. package/dist/{contract-infer-D8uEbJuu.mjs.map → contract-infer-IEp0227u.mjs.map} +1 -1
  58. package/dist/{contract-space-aggregate-loader-DvZwdkrr.mjs → contract-space-aggregate-loader-BdRPfM3Q.mjs} +63 -5
  59. package/dist/{contract-space-aggregate-loader-DvZwdkrr.mjs.map → contract-space-aggregate-loader-BdRPfM3Q.mjs.map} +1 -1
  60. package/dist/{db-verify-v_vUKXTU.mjs → db-verify-C9k5KAyI.mjs} +4 -4
  61. package/dist/{db-verify-v_vUKXTU.mjs.map → db-verify-C9k5KAyI.mjs.map} +1 -1
  62. package/dist/exports/control-api.d.mts +2 -2
  63. package/dist/exports/control-api.d.mts.map +1 -1
  64. package/dist/exports/control-api.mjs +2 -2
  65. package/dist/exports/index.mjs +1 -1
  66. package/dist/exports/init-output.mjs +1 -1
  67. package/dist/{framework-components-fYXjz_in.mjs → framework-components-Be4inY3I.mjs} +2 -2
  68. package/dist/{framework-components-fYXjz_in.mjs.map → framework-components-Be4inY3I.mjs.map} +1 -1
  69. package/dist/{global-flags-DEHjV8_s.d.mts → global-flags-DG4uY5tV.d.mts} +1 -1
  70. package/dist/{global-flags-DEHjV8_s.d.mts.map → global-flags-DG4uY5tV.d.mts.map} +1 -1
  71. package/dist/{init-Cv9UzWL5.mjs → init-BIxw3l7t.mjs} +5 -58
  72. package/dist/init-BIxw3l7t.mjs.map +1 -0
  73. package/dist/{inspect-live-schema-C6ohV_oQ.mjs → inspect-live-schema-DXUFGQDe.mjs} +3 -3
  74. package/dist/{inspect-live-schema-C6ohV_oQ.mjs.map → inspect-live-schema-DXUFGQDe.mjs.map} +1 -1
  75. package/dist/{migration-check-BiBJoYYW.mjs → migration-check-CUavU7U9.mjs} +236 -88
  76. package/dist/migration-check-CUavU7U9.mjs.map +1 -0
  77. package/dist/{migration-command-scaffold-CjvwO6at.mjs → migration-command-scaffold-omgKpt3K.mjs} +3 -3
  78. package/dist/{migration-command-scaffold-CjvwO6at.mjs.map → migration-command-scaffold-omgKpt3K.mjs.map} +1 -1
  79. package/dist/migration-graph-space-render-ByJ83gxp.mjs +1966 -0
  80. package/dist/migration-graph-space-render-ByJ83gxp.mjs.map +1 -0
  81. package/dist/migration-list-jK6QeczE.mjs +228 -0
  82. package/dist/migration-list-jK6QeczE.mjs.map +1 -0
  83. package/dist/migration-list-types-DS63IdFd.d.mts +23 -0
  84. package/dist/migration-list-types-DS63IdFd.d.mts.map +1 -0
  85. package/dist/migration-log-CW0EjxSr.mjs +215 -0
  86. package/dist/migration-log-CW0EjxSr.mjs.map +1 -0
  87. package/dist/migration-path-target-DqcrbOis.mjs +24 -0
  88. package/dist/migration-path-target-DqcrbOis.mjs.map +1 -0
  89. package/dist/{migration-plan-9DJ7q7_z.mjs → migration-plan-NHdlUwPG.mjs} +5 -6
  90. package/dist/{migration-plan-9DJ7q7_z.mjs.map → migration-plan-NHdlUwPG.mjs.map} +1 -1
  91. package/dist/migration-status-GZ6XfbWs.mjs +439 -0
  92. package/dist/migration-status-GZ6XfbWs.mjs.map +1 -0
  93. package/dist/{output-B60Gw5fu.mjs → output-CF_hqzI-.mjs} +1 -1
  94. package/dist/{output-B60Gw5fu.mjs.map → output-CF_hqzI-.mjs.map} +1 -1
  95. package/dist/{ref-advancement-DUZqsue6.mjs → ref-advancement-CJY9zOv7.mjs} +1 -1
  96. package/dist/{ref-advancement-DUZqsue6.mjs.map → ref-advancement-CJY9zOv7.mjs.map} +1 -1
  97. package/dist/telemetry-DQP0BvKv.mjs +122 -0
  98. package/dist/telemetry-DQP0BvKv.mjs.map +1 -0
  99. package/dist/{types-Dt_SfqFm.d.mts → types-Cculk5KV.d.mts} +44 -31
  100. package/dist/types-Cculk5KV.d.mts.map +1 -0
  101. package/dist/{verify-DCA9Sldu.mjs → verify-tvHRBBVP.mjs} +2 -2
  102. package/dist/{verify-DCA9Sldu.mjs.map → verify-tvHRBBVP.mjs.map} +1 -1
  103. package/package.json +22 -19
  104. package/src/cli.ts +5 -0
  105. package/src/commands/db-update.ts +7 -1
  106. package/src/commands/init/index.ts +6 -35
  107. package/src/commands/init/init.ts +1 -14
  108. package/src/commands/init/inputs.ts +0 -75
  109. package/src/commands/migrate.ts +6 -6
  110. package/src/commands/migration-check.ts +340 -117
  111. package/src/commands/migration-graph.ts +163 -90
  112. package/src/commands/migration-list.ts +55 -25
  113. package/src/commands/migration-log.ts +49 -98
  114. package/src/commands/migration-show.ts +10 -38
  115. package/src/commands/migration-status-overlay.ts +61 -0
  116. package/src/commands/migration-status.ts +440 -1056
  117. package/src/commands/telemetry/index.ts +107 -0
  118. package/src/commands/telemetry/status.ts +67 -0
  119. package/src/control-api/client.ts +17 -7
  120. package/src/control-api/operations/db-init.ts +3 -3
  121. package/src/control-api/operations/{db-apply.ts → db-run.ts} +37 -10
  122. package/src/control-api/operations/db-update.ts +4 -4
  123. package/src/control-api/operations/{migration-apply.ts → migrate.ts} +32 -24
  124. package/src/control-api/operations/{apply.ts → run-migration.ts} +33 -27
  125. package/src/control-api/types.ts +46 -29
  126. package/src/utils/cli-errors.ts +47 -2
  127. package/src/utils/formatters/errors.ts +11 -0
  128. package/src/utils/formatters/migration-graph-lane-colors.ts +194 -0
  129. package/src/utils/formatters/migration-graph-layout.ts +51 -7
  130. package/src/utils/formatters/migration-graph-rows.ts +128 -15
  131. package/src/utils/formatters/migration-graph-space-render.ts +138 -0
  132. package/src/utils/formatters/migration-graph-tree-render.ts +405 -77
  133. package/src/utils/formatters/migration-list-data-column.ts +4 -91
  134. package/src/utils/formatters/migration-list-graph-topology.ts +68 -90
  135. package/src/utils/formatters/migration-list-render.ts +122 -70
  136. package/src/utils/formatters/migration-list-styler.ts +48 -5
  137. package/src/utils/formatters/migration-log-table.ts +200 -0
  138. package/src/utils/formatters/migrations.ts +25 -1
  139. package/src/utils/global-flags.ts +35 -0
  140. package/src/utils/legend.ts +38 -0
  141. package/src/utils/migration-path-target.ts +39 -0
  142. package/src/utils/telemetry.ts +68 -32
  143. package/dist/client-KgJorIvG.mjs.map +0 -1
  144. package/dist/command-helpers-Bbw1GbwL.mjs.map +0 -1
  145. package/dist/commands/migration-list.mjs.map +0 -1
  146. package/dist/commands/migration-log.mjs.map +0 -1
  147. package/dist/commands/migration-status.mjs.map +0 -1
  148. package/dist/extension-pack-inputs-IDvjRCi3.mjs +0 -62
  149. package/dist/extension-pack-inputs-IDvjRCi3.mjs.map +0 -1
  150. package/dist/graph-render-rFAqZujX.mjs +0 -1081
  151. package/dist/graph-render-rFAqZujX.mjs.map +0 -1
  152. package/dist/init-Cv9UzWL5.mjs.map +0 -1
  153. package/dist/migration-check-BiBJoYYW.mjs.map +0 -1
  154. package/dist/migration-graph-D7DVUElV.mjs +0 -1232
  155. package/dist/migration-graph-D7DVUElV.mjs.map +0 -1
  156. package/dist/migration-list-styler-BRwF4-gy.mjs +0 -399
  157. package/dist/migration-list-styler-BRwF4-gy.mjs.map +0 -1
  158. package/dist/migration-types-D2FW63pr.d.mts +0 -15
  159. package/dist/migration-types-D2FW63pr.d.mts.map +0 -1
  160. package/dist/migrations-Cv2jxNNK.mjs +0 -228
  161. package/dist/migrations-Cv2jxNNK.mjs.map +0 -1
  162. package/dist/types-Dt_SfqFm.d.mts.map +0 -1
  163. package/src/utils/formatters/graph-migration-mapper.ts +0 -235
  164. package/src/utils/formatters/graph-render.ts +0 -1323
  165. package/src/utils/formatters/graph-types.ts +0 -120
@@ -71,7 +71,12 @@ function mapDbUpdateFailure(failure: DbUpdateFailure): CliStructuredError {
71
71
  return errorRunnerFailed(failure.summary, {
72
72
  why: failure.why ?? 'Migration runner failed',
73
73
  fix,
74
- ...ifDefined('meta', failure.meta),
74
+ meta: {
75
+ ...failure.meta,
76
+ ...(failure.warnings && failure.warnings.length > 0
77
+ ? { plannerWarnings: failure.warnings }
78
+ : {}),
79
+ },
75
80
  });
76
81
  }
77
82
 
@@ -236,6 +241,7 @@ async function executeDbUpdateCommand(
236
241
  : undefined,
237
242
  ),
238
243
  ...ifDefined('perSpace', result.value.perSpace),
244
+ ...ifDefined('warnings', result.value.warnings),
239
245
  advancedRef: refAdvancementFields.advancedRef,
240
246
  plannedAdvanceRef: refAdvancementFields.plannedAdvanceRef,
241
247
  summary: result.value.summary,
@@ -4,8 +4,11 @@ import {
4
4
  setCommandDescriptions,
5
5
  setCommandExamples,
6
6
  } from '../../utils/command-helpers';
7
- import { type CommonCommandOptions, parseGlobalFlagsOrExit } from '../../utils/global-flags';
8
- import { fireTelemetryAfterInitConsent } from '../../utils/telemetry';
7
+ import {
8
+ type CommonCommandOptions,
9
+ deriveCanPrompt,
10
+ parseGlobalFlagsOrExit,
11
+ } from '../../utils/global-flags';
9
12
  import {
10
13
  INIT_EXIT_EMIT_FAILED,
11
14
  INIT_EXIT_INSTALL_FAILED,
@@ -93,7 +96,7 @@ export function createInitCommand(): Command {
93
96
  '--no-skill',
94
97
  'Skip Prisma Next skills install (air-gapped CI, restricted registries, etc.)',
95
98
  )
96
- .action(async (options: InitCommandOptions, actionCommand: Command) => {
99
+ .action(async (options: InitCommandOptions) => {
97
100
  const { runInit } = await import('./init');
98
101
  const flags = parseGlobalFlagsOrExit(options);
99
102
  const canPrompt = deriveCanPrompt({
@@ -105,39 +108,7 @@ export function createInitCommand(): Command {
105
108
  options,
106
109
  flags,
107
110
  canPrompt,
108
- afterFirstTelemetryConsent: (inputs) => {
109
- fireTelemetryAfterInitConsent(actionCommand, { databaseTarget: inputs.target });
110
- },
111
111
  });
112
112
  process.exit(exitCode);
113
113
  });
114
114
  }
115
-
116
- /**
117
- * Bridges the action handler's two TTY checks (stdout via `flags`, stdin
118
- * via `process.stdin.isTTY`) into the `canPrompt` boolean `runInit`
119
- * consumes.
120
- *
121
- * Per the [Style Guide § Interactivity](../../../../../../../docs/CLI%20Style%20Guide.md#interactivity):
122
- *
123
- * - `flags.interactive` governs *decoration* (TerminalUI, intro/outro,
124
- * spinners) and is derived from stdout-TTY by `parseGlobalFlags`,
125
- * honouring `--interactive` / `--no-interactive`.
126
- * - Prompting additionally requires a stdin TTY — closing stdin is a
127
- * common signal in CI / agent environments even when stdout stays
128
- * attached.
129
- * - `--interactive` is the explicit override: when the user passes it,
130
- * we honour it (e.g. testing flows where stdin is stubbed).
131
- *
132
- * Exported so callers and tests can derive the same value without
133
- * touching `process` globals.
134
- */
135
- export function deriveCanPrompt(opts: {
136
- readonly flagsInteractive: boolean | undefined;
137
- readonly optionInteractive: boolean | undefined;
138
- readonly stdinIsTTY: boolean;
139
- }): boolean {
140
- if (opts.optionInteractive === true) return true;
141
- if (opts.flagsInteractive === false) return false;
142
- return opts.stdinIsTTY;
143
- }
@@ -113,11 +113,6 @@ export async function runInit(
113
113
  * mode) — see [Style Guide § Interactivity](../../../../../../../docs/CLI%20Style%20Guide.md#interactivity).
114
114
  */
115
115
  readonly canPrompt: boolean;
116
- /**
117
- * Called once after the first affirmative telemetry consent is persisted.
118
- * Failures are swallowed by the caller; init success must not depend on telemetry.
119
- */
120
- readonly afterFirstTelemetryConsent?: (inputs: ResolvedInitInputs) => void | Promise<void>;
121
116
  /**
122
117
  * FR8.3 — test-only seam for the optional database version probe.
123
118
  * Production callers omit this; tests inject stub `probePostgres` /
@@ -129,7 +124,7 @@ export async function runInit(
129
124
  readonly probeOverrides?: ProbeOverrides;
130
125
  },
131
126
  ): Promise<number> {
132
- const { options, flags, canPrompt, probeOverrides, afterFirstTelemetryConsent } = runOptions;
127
+ const { options, flags, canPrompt, probeOverrides } = runOptions;
133
128
  const ui = createTerminalUI(flags);
134
129
  const warnings: string[] = [];
135
130
  const filesWritten: string[] = [];
@@ -149,14 +144,6 @@ export async function runInit(
149
144
  throw error;
150
145
  }
151
146
 
152
- if (inputs.enableTelemetry === true && afterFirstTelemetryConsent !== undefined) {
153
- try {
154
- await afterFirstTelemetryConsent(inputs);
155
- } catch {
156
- // telemetry is best-effort and must never affect init
157
- }
158
- }
159
-
160
147
  const pm = await detectPackageManager(baseDir);
161
148
  const pkgRun = formatRunCommand(pm, 'prisma-next', '').trimEnd();
162
149
 
@@ -1,9 +1,7 @@
1
1
  import { existsSync, readFileSync } from 'node:fs';
2
2
  import * as clack from '@clack/prompts';
3
- import { readUserConfig, resolveGating, writeUserConfig } from '@prisma-next/cli-telemetry';
4
3
  import { extname, join, normalize } from 'pathe';
5
4
  import type { GlobalFlags } from '../../utils/global-flags';
6
- import { isCI } from '../../utils/is-ci';
7
5
  import {
8
6
  errorInitAuthoringSchemaPathMismatch,
9
7
  errorInitInvalidFlagValue,
@@ -71,18 +69,6 @@ export interface ResolvedInitInputs {
71
69
  * is added separately via the install step.
72
70
  */
73
71
  readonly removePreviousFacade: string | null;
74
- /**
75
- * Telemetry consent answer recorded during this `init` run, or `null`
76
- * when no prompt was shown. The prompt fires only on the
77
- * canPrompt + !autoAcceptPrompts + no env/CI opt-out +
78
- * `enableTelemetry === undefined` intersection; outside that window
79
- * the field is `null` and the stored preference (if any) stays
80
- * unchanged. The answer has already been persisted to
81
- * `$XDG_CONFIG_HOME/prisma-next/config.json` by
82
- * the time `runInit` sees this value — it's surfaced here purely so
83
- * the post-init summary can mention what the user chose.
84
- */
85
- readonly enableTelemetry: boolean | null;
86
72
  /**
87
73
  * Whether to run `npx skills add prisma/prisma-next#v<version>` at the
88
74
  * project level after install + emit. True by default; `--no-skill`
@@ -106,12 +92,6 @@ const AUTHORING_VALUES: ReadonlyMap<string, AuthoringId> = new Map([
106
92
  ['ts', 'typescript'],
107
93
  ]);
108
94
 
109
- export const TELEMETRY_CONSENT_MESSAGE = [
110
- 'Help us prioritize features by sharing anonymous CLI usage data?',
111
- 'The telemetry implementation is open source and fully transparent.',
112
- '(packages/1-framework/3-tooling/cli-telemetry and apps/telemetry-backend).',
113
- ].join(' ');
114
-
115
95
  /**
116
96
  * Resolves every required input for `runInit`. In interactive mode, missing
117
97
  * inputs are prompted via clack; in non-interactive mode, missing required
@@ -197,11 +177,6 @@ export async function resolveInitInputs(ctx: {
197
177
  autoAcceptPrompts,
198
178
  });
199
179
 
200
- const enableTelemetry = await resolveTelemetryConsent({
201
- canPrompt,
202
- autoAcceptPrompts,
203
- });
204
-
205
180
  // Skill-install gating. `--no-skill` (commander parses
206
181
  // `options.skill === false`) is the only escape hatch; otherwise
207
182
  // project-level install is unconditional. The skill is always
@@ -219,60 +194,10 @@ export async function resolveInitInputs(ctx: {
219
194
  strictProbe: Boolean(options.strictProbe),
220
195
  reinit,
221
196
  removePreviousFacade,
222
- enableTelemetry,
223
197
  installProjectSkill,
224
198
  };
225
199
  }
226
200
 
227
- /**
228
- * The interactive telemetry consent prompt. Shown as the last
229
- * question of the `init` sequence iff:
230
- * 1. `canPrompt === true` (interactive stdin / stdout combo),
231
- * 2. `autoAcceptPrompts === false` (the user did not pass `--yes`),
232
- * 3. neither telemetry env opt-out is active,
233
- * 4. the process is not running in CI,
234
- * 5. the stored `enableTelemetry` value is `undefined` (the user
235
- * has never been asked, or skipped the prompt previously).
236
- *
237
- * Outside that intersection the function returns `null` and leaves the
238
- * stored preference untouched. Inside it, the user's answer is
239
- * persisted via `writeUserConfig({ enableTelemetry })` before this
240
- * function returns; on an affirmative answer `writeUserConfig`
241
- * generates and stores the v4 `installationId` in the same write.
242
- *
243
- * The wording names CLI usage data and points to the open-source
244
- * client/backend paths. Default value is `true` to match precedent
245
- * and to make the consent answer a single keystroke once it's been
246
- * disclosed.
247
- */
248
- async function resolveTelemetryConsent(opts: {
249
- readonly canPrompt: boolean;
250
- readonly autoAcceptPrompts: boolean;
251
- }): Promise<boolean | null> {
252
- if (!opts.canPrompt || opts.autoAcceptPrompts || isCI()) {
253
- return null;
254
- }
255
- const config = readUserConfig();
256
- const gating = resolveGating({ env: process.env, config });
257
- if (!gating.enabled && gating.reason === 'env-override') {
258
- return null;
259
- }
260
- const stored = config.enableTelemetry;
261
- if (stored !== undefined) {
262
- return null;
263
- }
264
- const result = await clack.confirm({
265
- message: TELEMETRY_CONSENT_MESSAGE,
266
- initialValue: true,
267
- output: process.stderr,
268
- });
269
- if (clack.isCancel(result)) {
270
- throw errorInitUserAborted();
271
- }
272
- writeUserConfig({ enableTelemetry: Boolean(result) });
273
- return Boolean(result);
274
- }
275
-
276
201
  async function resolveWriteEnv(opts: {
277
202
  readonly flag: boolean | undefined;
278
203
  readonly canPrompt: boolean;
@@ -11,8 +11,8 @@ import { Command } from 'commander';
11
11
  import { loadConfig } from '../config-loader';
12
12
  import { createControlClient } from '../control-api/client';
13
13
  import type {
14
- MigrationApplyFailure,
15
- MigrationApplyPathDecision,
14
+ MigrateFailure,
15
+ MigratePathDecision,
16
16
  PerSpaceExecutionEntry,
17
17
  } from '../control-api/types';
18
18
  import {
@@ -76,14 +76,14 @@ export interface MigrateResult {
76
76
  }[];
77
77
  readonly summary: string;
78
78
  readonly perSpace: readonly PerSpaceExecutionEntry[];
79
- readonly pathDecision?: MigrationApplyPathDecision;
79
+ readonly pathDecision?: MigratePathDecision;
80
80
  readonly timings: {
81
81
  readonly total: number;
82
82
  };
83
83
  readonly advancedRef?: { readonly name: string; readonly hash: string } | null;
84
84
  }
85
85
 
86
- function mapApplyFailure(failure: MigrationApplyFailure): CliStructuredErrorType {
86
+ function mapApplyFailure(failure: MigrateFailure): CliStructuredErrorType {
87
87
  if (failure.code === 'MIGRATION_PATH_NOT_FOUND') {
88
88
  return errorPathUnreachable(failure);
89
89
  }
@@ -136,7 +136,7 @@ async function executeMigrateCommand(
136
136
 
137
137
  // Construct the family instance up-front so the on-disk contract read
138
138
  // crosses the serializer seam (`familyInstance.deserializeContract`) at
139
- // the read site. The downstream `client.migrationApply({ contract })`
139
+ // the read site. The downstream `client.migrate({ contract })`
140
140
  // re-validates internally (no harm — validation is idempotent), but
141
141
  // closing the gap at the read site is what makes the cast-pattern
142
142
  // lint enforceable and matches the other CLI commands. See TML-2536.
@@ -312,7 +312,7 @@ async function executeMigrateCommand(
312
312
  }
313
313
  }
314
314
 
315
- const applyResult = await client.migrationApply({
315
+ const applyResult = await client.migrate({
316
316
  contract: applyContract,
317
317
  migrationsDir,
318
318
  ...ifDefined('refHash', refEntry?.hash),