@prisma-next/core-control-plane 0.3.0-dev.53 → 0.3.0-dev.54

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.
@@ -1,4 +1,4 @@
1
- import { a as ControlExtensionDescriptor, i as ControlDriverInstance, r as ControlDriverDescriptor, s as ControlFamilyDescriptor, t as ControlAdapterDescriptor, u as ControlTargetDescriptor } from "./types-CuAauVCJ.mjs";
1
+ import { a as ControlExtensionDescriptor, i as ControlDriverInstance, r as ControlDriverDescriptor, s as ControlFamilyDescriptor, t as ControlAdapterDescriptor, u as ControlTargetDescriptor } from "./types-DWZxwNKq.mjs";
2
2
  import { ContractIR } from "@prisma-next/contract/ir";
3
3
  import { Result } from "@prisma-next/utils/result";
4
4
 
@@ -93,4 +93,4 @@ interface PrismaNextConfig<TFamilyId extends string = string, TTargetId extends
93
93
  declare function defineConfig<TFamilyId extends string = string, TTargetId extends string = string>(config: PrismaNextConfig<TFamilyId, TTargetId>): PrismaNextConfig<TFamilyId, TTargetId>;
94
94
  //#endregion
95
95
  export { ContractSourceDiagnosticPosition as a, ContractSourceProvider as c, ContractSourceDiagnostic as i, PrismaNextConfig as n, ContractSourceDiagnosticSpan as o, defineConfig as r, ContractSourceDiagnostics as s, ContractConfig as t };
96
- //# sourceMappingURL=config-types-Ci0VxOEC.d.mts.map
96
+ //# sourceMappingURL=config-types-UTSsxKk2.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-types-Ci0VxOEC.d.mts","names":[],"sources":["../src/contract-source-types.ts","../src/config-types.ts"],"sourcesContent":[],"mappings":";;;;;UAGiB,gCAAA;;;EAAA,SAAA,MAAA,EAAA,MAAA;AAMjB;AAKiB,UALA,4BAAA,CASC;EAGD,SAAA,KAAA,EAXC,gCAae;EAIrB,SAAA,GAAA,EAhBI,gCAgBkB;;AAAoC,UAbrD,wBAAA,CAaqD;EAAnB,SAAA,IAAA,EAAA,MAAA;EAAR,SAAA,OAAA,EAAA,M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B,CAAA;EACD;;;;EACI,SAAA,EAAA,CAAA,EAAA;IAA5B;;;;;0BA9CuB;;;;;;sBAMJ;;;;;;;;;;;;;iBAsCN,2FACN,iBAAiB,WAAW,aACnC,iBAAiB,WAAW"}
@@ -1,3 +1,3 @@
1
- import { a as ContractSourceDiagnosticPosition, c as ContractSourceProvider, i as ContractSourceDiagnostic, n as PrismaNextConfig, o as ContractSourceDiagnosticSpan, r as defineConfig, s as ContractSourceDiagnostics, t as ContractConfig } from "./config-types-Ci0VxOEC.mjs";
2
- import "./types-CuAauVCJ.mjs";
1
+ import { a as ContractSourceDiagnosticPosition, c as ContractSourceProvider, i as ContractSourceDiagnostic, n as PrismaNextConfig, o as ContractSourceDiagnosticSpan, r as defineConfig, s as ContractSourceDiagnostics, t as ContractConfig } from "./config-types-UTSsxKk2.mjs";
2
+ import "./types-DWZxwNKq.mjs";
3
3
  export { type ContractConfig, type ContractSourceDiagnostic, type ContractSourceDiagnosticPosition, type ContractSourceDiagnosticSpan, type ContractSourceDiagnostics, type ContractSourceProvider, type PrismaNextConfig, defineConfig };
@@ -1,5 +1,5 @@
1
- import { n as PrismaNextConfig } from "./config-types-Ci0VxOEC.mjs";
2
- import "./types-CuAauVCJ.mjs";
1
+ import { n as PrismaNextConfig } from "./config-types-UTSsxKk2.mjs";
2
+ import "./types-DWZxwNKq.mjs";
3
3
 
4
4
  //#region src/config-validation.d.ts
5
5
 
@@ -1,4 +1,4 @@
1
- import { r as errorConfigValidation } from "./errors-Qlh0sdcb.mjs";
1
+ import { r as errorConfigValidation } from "./errors-CvuQhtGp.mjs";
2
2
 
3
3
  //#region src/config-validation.ts
4
4
  /**
@@ -19,7 +19,7 @@ var CliStructuredError = class extends Error {
19
19
  this.domain = options?.domain ?? "CLI";
20
20
  this.severity = options?.severity ?? "error";
21
21
  this.why = options?.why;
22
- this.fix = options?.fix;
22
+ this.fix = options?.fix === options?.why ? void 0 : options?.fix;
23
23
  this.where = options?.where ? {
24
24
  path: options.where.path,
25
25
  line: options.where.line
@@ -32,6 +32,7 @@ var CliStructuredError = class extends Error {
32
32
  */
33
33
  toEnvelope() {
34
34
  return {
35
+ ok: false,
35
36
  code: `${this.domain === "CLI" ? "PN-CLI-" : "PN-RTM-"}${this.code}`,
36
37
  domain: this.domain,
37
38
  severity: this.severity,
@@ -204,10 +205,10 @@ function errorTargetMigrationNotSupported(options) {
204
205
  * Config validation error (missing required fields).
205
206
  */
206
207
  function errorConfigValidation(field, options) {
207
- return new CliStructuredError("4001", "Config file not found", {
208
+ return new CliStructuredError("4009", "Config validation error", {
208
209
  domain: "CLI",
209
210
  why: options?.why ?? `Config must have a "${field}" field`,
210
- fix: "Run 'prisma-next init' to create a config file",
211
+ fix: "Check your prisma-next.config.ts and ensure all required fields are provided",
211
212
  docsUrl: "https://prisma-next.dev/docs/cli/config"
212
213
  });
213
214
  }
@@ -215,10 +216,10 @@ function errorConfigValidation(field, options) {
215
216
  * Contract marker not found in database.
216
217
  */
217
218
  function errorMarkerMissing(options) {
218
- return new CliStructuredError("3001", "Marker missing", {
219
+ return new CliStructuredError("3001", "Database not signed", {
219
220
  domain: "RTM",
220
- why: options?.why ?? "Contract marker not found in database",
221
- fix: "Run `prisma-next db sign --db <url>` to create marker"
221
+ why: options?.why ?? "No database signature (marker) found",
222
+ fix: "Run `prisma-next db sign --db <url>` to sign the database"
222
223
  });
223
224
  }
224
225
  /**
@@ -250,6 +251,39 @@ function errorTargetMismatch(expected, actual, options) {
250
251
  });
251
252
  }
252
253
  /**
254
+ * Database marker is required but not found.
255
+ * Used by commands that require a pre-existing marker as a precondition.
256
+ */
257
+ function errorMarkerRequired(options) {
258
+ return new CliStructuredError("3010", "Database must be signed first", {
259
+ domain: "RTM",
260
+ why: options?.why ?? "No database signature (marker) found",
261
+ fix: options?.fix ?? "Run `prisma-next db init` first to sign the database"
262
+ });
263
+ }
264
+ /**
265
+ * Migration runner failed during execution.
266
+ */
267
+ function errorRunnerFailed(summary, options) {
268
+ return new CliStructuredError("3020", summary, {
269
+ domain: "RTM",
270
+ why: options?.why ?? "Migration runner failed",
271
+ fix: options?.fix ?? "Inspect the reported conflict and reconcile schema drift",
272
+ ...options?.meta ? { meta: options.meta } : {}
273
+ });
274
+ }
275
+ /**
276
+ * Destructive operations require explicit confirmation via --accept-data-loss.
277
+ */
278
+ function errorDestructiveChanges(summary, options) {
279
+ return new CliStructuredError("3030", summary, {
280
+ domain: "RTM",
281
+ why: options?.why ?? "Planned operations include destructive changes that require confirmation",
282
+ fix: options?.fix ?? "Use `--plan` to preview, then re-run with `--accept-data-loss`",
283
+ ...options?.meta ? { meta: options.meta } : {}
284
+ });
285
+ }
286
+ /**
253
287
  * Generic runtime error.
254
288
  */
255
289
  function errorRuntime(summary, options) {
@@ -272,5 +306,5 @@ function errorUnexpected(message, options) {
272
306
  }
273
307
 
274
308
  //#endregion
275
- export { errorTargetMigrationNotSupported as _, errorContractMissingExtensionPacks as a, errorDriverRequired as c, errorHashMismatch as d, errorJsonFormatNotSupported as f, errorRuntime as g, errorQueryRunnerFactoryRequired as h, errorContractConfigMissing as i, errorFamilyReadMarkerSqlRequired as l, errorMigrationPlanningFailed as m, errorConfigFileNotFound as n, errorContractValidationFailed as o, errorMarkerMissing as p, errorConfigValidation as r, errorDatabaseConnectionRequired as s, CliStructuredError as t, errorFileNotFound as u, errorTargetMismatch as v, errorUnexpected as y };
276
- //# sourceMappingURL=errors-Qlh0sdcb.mjs.map
309
+ export { errorUnexpected as S, errorQueryRunnerFactoryRequired as _, errorContractMissingExtensionPacks as a, errorTargetMigrationNotSupported as b, errorDestructiveChanges as c, errorFileNotFound as d, errorHashMismatch as f, errorMigrationPlanningFailed as g, errorMarkerRequired as h, errorContractConfigMissing as i, errorDriverRequired as l, errorMarkerMissing as m, errorConfigFileNotFound as n, errorContractValidationFailed as o, errorJsonFormatNotSupported as p, errorConfigValidation as r, errorDatabaseConnectionRequired as s, CliStructuredError as t, errorFamilyReadMarkerSqlRequired as u, errorRunnerFailed as v, errorTargetMismatch as x, errorRuntime as y };
310
+ //# sourceMappingURL=errors-CvuQhtGp.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors-CvuQhtGp.mjs","names":[],"sources":["../src/errors.ts"],"sourcesContent":["/**\n * CLI error envelope for output formatting.\n * This is the serialized form of a CliStructuredError.\n */\nexport interface CliErrorEnvelope {\n readonly ok: false;\n readonly code: string;\n readonly domain: string;\n readonly severity: 'error' | 'warn' | 'info';\n readonly summary: string;\n readonly why: string | undefined;\n readonly fix: string | undefined;\n readonly where:\n | {\n readonly path: string | undefined;\n readonly line: number | undefined;\n }\n | undefined;\n readonly meta: Record<string, unknown> | undefined;\n readonly docsUrl: string | undefined;\n}\n\n/**\n * Minimal conflict data structure expected by CLI output.\n */\nexport interface CliErrorConflict {\n readonly kind: string;\n readonly summary: string;\n readonly why?: string;\n}\n\n/**\n * Structured CLI error that contains all information needed for error envelopes.\n * Call sites throw these errors with full context.\n */\nexport class CliStructuredError extends Error {\n readonly code: string;\n readonly domain: 'CLI' | 'RTM';\n readonly severity: 'error' | 'warn' | 'info';\n readonly why: string | undefined;\n readonly fix: string | undefined;\n readonly where:\n | {\n readonly path: string | undefined;\n readonly line: number | undefined;\n }\n | undefined;\n readonly meta: Record<string, unknown> | undefined;\n readonly docsUrl: string | undefined;\n\n constructor(\n code: string,\n summary: string,\n options?: {\n readonly domain?: 'CLI' | 'RTM';\n readonly severity?: 'error' | 'warn' | 'info';\n readonly why?: string;\n readonly fix?: string;\n readonly where?: { readonly path?: string; readonly line?: number };\n readonly meta?: Record<string, unknown>;\n readonly docsUrl?: string;\n },\n ) {\n super(summary);\n this.name = 'CliStructuredError';\n this.code = code;\n this.domain = options?.domain ?? 'CLI';\n this.severity = options?.severity ?? 'error';\n this.why = options?.why;\n this.fix = options?.fix === options?.why ? undefined : options?.fix;\n this.where = options?.where\n ? {\n path: options.where.path,\n line: options.where.line,\n }\n : undefined;\n this.meta = options?.meta;\n this.docsUrl = options?.docsUrl;\n }\n\n /**\n * Converts this error to a CLI error envelope for output formatting.\n */\n toEnvelope(): CliErrorEnvelope {\n const codePrefix = this.domain === 'CLI' ? 'PN-CLI-' : 'PN-RTM-';\n return {\n ok: false as const,\n code: `${codePrefix}${this.code}`,\n domain: this.domain,\n severity: this.severity,\n summary: this.message,\n why: this.why,\n fix: this.fix,\n where: this.where,\n meta: this.meta,\n docsUrl: this.docsUrl,\n };\n }\n\n /**\n * Type guard to check if an error is a CliStructuredError.\n * Uses duck-typing to work across module boundaries where instanceof may fail.\n */\n static is(error: unknown): error is CliStructuredError {\n if (!(error instanceof Error)) {\n return false;\n }\n const candidate = error as CliStructuredError;\n return (\n candidate.name === 'CliStructuredError' &&\n typeof candidate.code === 'string' &&\n (candidate.domain === 'CLI' || candidate.domain === 'RTM') &&\n typeof candidate.toEnvelope === 'function'\n );\n }\n}\n\n// ============================================================================\n// Config Errors (PN-CLI-4001-4007)\n// ============================================================================\n\n/**\n * Config file not found or missing.\n */\nexport function errorConfigFileNotFound(\n configPath?: string,\n options?: {\n readonly why?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4001', 'Config file not found', {\n domain: 'CLI',\n ...(options?.why ? { why: options.why } : { why: 'Config file not found' }),\n fix: \"Run 'prisma-next init' to create a config file\",\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n ...(configPath ? { where: { path: configPath } } : {}),\n });\n}\n\n/**\n * Contract configuration missing from config.\n */\nexport function errorContractConfigMissing(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4002', 'Contract configuration missing', {\n domain: 'CLI',\n why: options?.why ?? 'The contract configuration is required for emit',\n fix: 'Add contract configuration to your prisma-next.config.ts',\n docsUrl: 'https://prisma-next.dev/docs/cli/contract-emit',\n });\n}\n\n/**\n * Contract validation failed.\n */\nexport function errorContractValidationFailed(\n reason: string,\n options?: {\n readonly where?: { readonly path?: string; readonly line?: number };\n },\n): CliStructuredError {\n return new CliStructuredError('4003', 'Contract validation failed', {\n domain: 'CLI',\n why: reason,\n fix: 'Re-run `prisma-next contract emit`, or fix the contract file and try again',\n docsUrl: 'https://prisma-next.dev/docs/contracts',\n ...(options?.where ? { where: options.where } : {}),\n });\n}\n\n/**\n * File not found.\n */\nexport function errorFileNotFound(\n filePath: string,\n options?: {\n readonly why?: string;\n readonly fix?: string;\n readonly docsUrl?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4004', 'File not found', {\n domain: 'CLI',\n why: options?.why ?? `File not found: ${filePath}`,\n fix: options?.fix ?? 'Check that the file path is correct',\n where: { path: filePath },\n ...(options?.docsUrl ? { docsUrl: options.docsUrl } : {}),\n });\n}\n\n/**\n * Database connection is required but not provided.\n */\nexport function errorDatabaseConnectionRequired(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4005', 'Database connection is required', {\n domain: 'CLI',\n why: options?.why ?? 'Database connection is required for this command',\n fix: 'Provide `--db <url>` or set `db: { connection: \"postgres://…\" }` in prisma-next.config.ts',\n });\n}\n\n/**\n * Query runner factory is required but not provided in config.\n */\nexport function errorQueryRunnerFactoryRequired(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4006', 'Query runner factory is required', {\n domain: 'CLI',\n why: options?.why ?? 'Config.db.queryRunnerFactory is required for db verify',\n fix: 'Add db.queryRunnerFactory to prisma-next.config.ts',\n docsUrl: 'https://prisma-next.dev/docs/cli/db-verify',\n });\n}\n\n/**\n * Family verify.readMarker is required but not provided.\n */\nexport function errorFamilyReadMarkerSqlRequired(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4007', 'Family readMarker() is required', {\n domain: 'CLI',\n why: options?.why ?? 'Family verify.readMarker is required for db verify',\n fix: 'Ensure family.verify.readMarker() is exported by your family package',\n docsUrl: 'https://prisma-next.dev/docs/cli/db-verify',\n });\n}\n\n/**\n * JSON output format not supported.\n */\nexport function errorJsonFormatNotSupported(options: {\n readonly command: string;\n readonly format: string;\n readonly supportedFormats: readonly string[];\n}): CliStructuredError {\n return new CliStructuredError('4008', 'Unsupported JSON format', {\n domain: 'CLI',\n why: `The ${options.command} command does not support --json ${options.format}`,\n fix: `Use --json ${options.supportedFormats.join(' or ')}, or omit --json for human output`,\n meta: {\n command: options.command,\n format: options.format,\n supportedFormats: options.supportedFormats,\n },\n });\n}\n\n/**\n * Driver is required for DB-connected commands but not provided.\n */\nexport function errorDriverRequired(options?: { readonly why?: string }): CliStructuredError {\n return new CliStructuredError('4010', 'Driver is required for DB-connected commands', {\n domain: 'CLI',\n why: options?.why ?? 'Config.driver is required for DB-connected commands',\n fix: 'Add a control-plane driver to prisma-next.config.ts (e.g. import a driver descriptor and set `driver: postgresDriver`)',\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n });\n}\n\n/**\n * Contract requires extension packs that are not provided by config descriptors.\n */\nexport function errorContractMissingExtensionPacks(options: {\n readonly missingExtensionPacks: readonly string[];\n readonly providedComponentIds: readonly string[];\n}): CliStructuredError {\n const missing = [...options.missingExtensionPacks].sort();\n return new CliStructuredError('4011', 'Missing extension packs in config', {\n domain: 'CLI',\n why:\n missing.length === 1\n ? `Contract requires extension pack '${missing[0]}', but CLI config does not provide a matching descriptor.`\n : `Contract requires extension packs ${missing.map((p) => `'${p}'`).join(', ')}, but CLI config does not provide matching descriptors.`,\n fix: 'Add the missing extension descriptors to `extensions` in prisma-next.config.ts',\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n meta: {\n missingExtensionPacks: missing,\n providedComponentIds: [...options.providedComponentIds].sort(),\n },\n });\n}\n\n/**\n * Migration planning failed due to conflicts.\n */\nexport function errorMigrationPlanningFailed(options: {\n readonly conflicts: readonly CliErrorConflict[];\n readonly why?: string;\n}): CliStructuredError {\n // Build \"why\" from conflict summaries - these contain the actual problem description\n const conflictSummaries = options.conflicts.map((c) => c.summary);\n const computedWhy = options.why ?? conflictSummaries.join('\\n');\n\n // Build \"fix\" from conflict \"why\" fields - these contain actionable advice\n const conflictFixes = options.conflicts\n .map((c) => c.why)\n .filter((why): why is string => typeof why === 'string');\n const computedFix =\n conflictFixes.length > 0\n ? conflictFixes.join('\\n')\n : 'Use `db schema-verify` to inspect conflicts, or ensure the database is empty';\n\n return new CliStructuredError('4020', 'Migration planning failed', {\n domain: 'CLI',\n why: computedWhy,\n fix: computedFix,\n meta: { conflicts: options.conflicts },\n docsUrl: 'https://prisma-next.dev/docs/cli/db-init',\n });\n}\n\n/**\n * Target does not support migrations (missing createPlanner/createRunner).\n */\nexport function errorTargetMigrationNotSupported(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4021', 'Target does not support migrations', {\n domain: 'CLI',\n why: options?.why ?? 'The configured target does not provide migration planner/runner',\n fix: 'Select a target that provides migrations (it must export `target.migrations` for db init)',\n docsUrl: 'https://prisma-next.dev/docs/cli/db-init',\n });\n}\n\n/**\n * Config validation error (missing required fields).\n */\nexport function errorConfigValidation(\n field: string,\n options?: {\n readonly why?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4009', 'Config validation error', {\n domain: 'CLI',\n why: options?.why ?? `Config must have a \"${field}\" field`,\n fix: 'Check your prisma-next.config.ts and ensure all required fields are provided',\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n });\n}\n\n// ============================================================================\n// Runtime Errors (PN-RTM-3000-3030)\n// ============================================================================\n\n/**\n * Contract marker not found in database.\n */\nexport function errorMarkerMissing(options?: {\n readonly why?: string;\n readonly dbUrl?: string;\n}): CliStructuredError {\n return new CliStructuredError('3001', 'Database not signed', {\n domain: 'RTM',\n why: options?.why ?? 'No database signature (marker) found',\n fix: 'Run `prisma-next db sign --db <url>` to sign the database',\n });\n}\n\n/**\n * Contract hash does not match database marker.\n */\nexport function errorHashMismatch(options?: {\n readonly why?: string;\n readonly expected?: string;\n readonly actual?: string;\n}): CliStructuredError {\n return new CliStructuredError('3002', 'Hash mismatch', {\n domain: 'RTM',\n why: options?.why ?? 'Contract hash does not match database marker',\n fix: 'Migrate database or re-sign if intentional',\n ...(options?.expected || options?.actual\n ? {\n meta: {\n ...(options.expected ? { expected: options.expected } : {}),\n ...(options.actual ? { actual: options.actual } : {}),\n },\n }\n : {}),\n });\n}\n\n/**\n * Contract target does not match config target.\n */\nexport function errorTargetMismatch(\n expected: string,\n actual: string,\n options?: {\n readonly why?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('3003', 'Target mismatch', {\n domain: 'RTM',\n why:\n options?.why ??\n `Contract target does not match config target (expected: ${expected}, actual: ${actual})`,\n fix: 'Align contract target and config target',\n meta: { expected, actual },\n });\n}\n\n/**\n * Database marker is required but not found.\n * Used by commands that require a pre-existing marker as a precondition.\n */\nexport function errorMarkerRequired(options?: {\n readonly why?: string;\n readonly fix?: string;\n}): CliStructuredError {\n return new CliStructuredError('3010', 'Database must be signed first', {\n domain: 'RTM',\n why: options?.why ?? 'No database signature (marker) found',\n fix: options?.fix ?? 'Run `prisma-next db init` first to sign the database',\n });\n}\n\n/**\n * Migration runner failed during execution.\n */\nexport function errorRunnerFailed(\n summary: string,\n options?: {\n readonly why?: string;\n readonly fix?: string;\n readonly meta?: Record<string, unknown>;\n },\n): CliStructuredError {\n return new CliStructuredError('3020', summary, {\n domain: 'RTM',\n why: options?.why ?? 'Migration runner failed',\n fix: options?.fix ?? 'Inspect the reported conflict and reconcile schema drift',\n ...(options?.meta ? { meta: options.meta } : {}),\n });\n}\n\n/**\n * Destructive operations require explicit confirmation via --accept-data-loss.\n */\nexport function errorDestructiveChanges(\n summary: string,\n options?: {\n readonly why?: string;\n readonly fix?: string;\n readonly meta?: Record<string, unknown>;\n },\n): CliStructuredError {\n return new CliStructuredError('3030', summary, {\n domain: 'RTM',\n why: options?.why ?? 'Planned operations include destructive changes that require confirmation',\n fix: options?.fix ?? 'Use `--plan` to preview, then re-run with `--accept-data-loss`',\n ...(options?.meta ? { meta: options.meta } : {}),\n });\n}\n\n/**\n * Generic runtime error.\n */\nexport function errorRuntime(\n summary: string,\n options?: {\n readonly why?: string;\n readonly fix?: string;\n readonly meta?: Record<string, unknown>;\n },\n): CliStructuredError {\n return new CliStructuredError('3000', summary, {\n domain: 'RTM',\n ...(options?.why ? { why: options.why } : { why: 'Verification failed' }),\n ...(options?.fix ? { fix: options.fix } : { fix: 'Check contract and database state' }),\n ...(options?.meta ? { meta: options.meta } : {}),\n });\n}\n\n// ============================================================================\n// Generic Error\n// ============================================================================\n\n/**\n * Generic unexpected error.\n */\nexport function errorUnexpected(\n message: string,\n options?: {\n readonly why?: string;\n readonly fix?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4999', 'Unexpected error', {\n domain: 'CLI',\n why: options?.why ?? message,\n fix: options?.fix ?? 'Check the error message and try again',\n });\n}\n"],"mappings":";;;;;AAmCA,IAAa,qBAAb,cAAwC,MAAM;CAC5C,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CAMT,AAAS;CACT,AAAS;CAET,YACE,MACA,SACA,SASA;AACA,QAAM,QAAQ;AACd,OAAK,OAAO;AACZ,OAAK,OAAO;AACZ,OAAK,SAAS,SAAS,UAAU;AACjC,OAAK,WAAW,SAAS,YAAY;AACrC,OAAK,MAAM,SAAS;AACpB,OAAK,MAAM,SAAS,QAAQ,SAAS,MAAM,SAAY,SAAS;AAChE,OAAK,QAAQ,SAAS,QAClB;GACE,MAAM,QAAQ,MAAM;GACpB,MAAM,QAAQ,MAAM;GACrB,GACD;AACJ,OAAK,OAAO,SAAS;AACrB,OAAK,UAAU,SAAS;;;;;CAM1B,aAA+B;AAE7B,SAAO;GACL,IAAI;GACJ,MAAM,GAHW,KAAK,WAAW,QAAQ,YAAY,YAG/B,KAAK;GAC3B,QAAQ,KAAK;GACb,UAAU,KAAK;GACf,SAAS,KAAK;GACd,KAAK,KAAK;GACV,KAAK,KAAK;GACV,OAAO,KAAK;GACZ,MAAM,KAAK;GACX,SAAS,KAAK;GACf;;;;;;CAOH,OAAO,GAAG,OAA6C;AACrD,MAAI,EAAE,iBAAiB,OACrB,QAAO;EAET,MAAM,YAA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AAmB,QAAQ,iCAAiC;EACrE,QAAQ;EACR,KAAK,SAAS,OAAO;EACrB,KAAK,SAAS,OAAO;EACtB,CAAC;;;;;AAMJ,SAAgB,kBACd,SACA,SAKoB;AACpB,QAAO,IAAI,mBAAmB,QAAQ,SAAS;EAC7C,QAAQ;EACR,KAAK,SAAS,OAAO;EACrB,KAAK,SAAS,OAAO;EACrB,GAAI,SAAS,OAAO,EAAE,MAAM,QAAQ,MAAM,GAAG,EAAE;EAChD,CAAC;;;;;AAMJ,SAAgB,wBACd,SACA,SAKoB;AACpB,QAAO,IAAI,mBAAmB,QAAQ,SAAS;EAC7C,QAAQ;EACR,KAAK,SAAS,OAAO;EACrB,KAAK,SAAS,OAAO;EACrB,GAAI,SAAS,OAAO,EAAE,MAAM,QAAQ,MAAM,GAAG,EAAE;EAChD,CAAC;;;;;AAMJ,SAAgB,aACd,SACA,SAKoB;AACpB,QAAO,IAAI,mBAAmB,QAAQ,SAAS;EAC7C,QAAQ;EACR,GAAI,SAAS,MAAM,EAAE,KAAK,QAAQ,KAAK,GAAG,EAAE,KAAK,uBAAuB;EACxE,GAAI,SAAS,MAAM,EAAE,KAAK,QAAQ,KAAK,GAAG,EAAE,KAAK,qCAAqC;EACtF,GAAI,SAAS,OAAO,EAAE,MAAM,QAAQ,MAAM,GAAG,EAAE;EAChD,CAAC;;;;;AAUJ,SAAgB,gBACd,SACA,SAIoB;AACpB,QAAO,IAAI,mBAAmB,QAAQ,oBAAoB;EACxD,QAAQ;EACR,KAAK,SAAS,OAAO;EACrB,KAAK,SAAS,OAAO;EACtB,CAAC"}
package/dist/errors.d.mts CHANGED
@@ -4,6 +4,7 @@
4
4
  * This is the serialized form of a CliStructuredError.
5
5
  */
6
6
  interface CliErrorEnvelope {
7
+ readonly ok: false;
7
8
  readonly code: string;
8
9
  readonly domain: string;
9
10
  readonly severity: 'error' | 'warn' | 'info';
@@ -171,6 +172,30 @@ declare function errorHashMismatch(options?: {
171
172
  declare function errorTargetMismatch(expected: string, actual: string, options?: {
172
173
  readonly why?: string;
173
174
  }): CliStructuredError;
175
+ /**
176
+ * Database marker is required but not found.
177
+ * Used by commands that require a pre-existing marker as a precondition.
178
+ */
179
+ declare function errorMarkerRequired(options?: {
180
+ readonly why?: string;
181
+ readonly fix?: string;
182
+ }): CliStructuredError;
183
+ /**
184
+ * Migration runner failed during execution.
185
+ */
186
+ declare function errorRunnerFailed(summary: string, options?: {
187
+ readonly why?: string;
188
+ readonly fix?: string;
189
+ readonly meta?: Record<string, unknown>;
190
+ }): CliStructuredError;
191
+ /**
192
+ * Destructive operations require explicit confirmation via --accept-data-loss.
193
+ */
194
+ declare function errorDestructiveChanges(summary: string, options?: {
195
+ readonly why?: string;
196
+ readonly fix?: string;
197
+ readonly meta?: Record<string, unknown>;
198
+ }): CliStructuredError;
174
199
  /**
175
200
  * Generic runtime error.
176
201
  */
@@ -187,5 +212,5 @@ declare function errorUnexpected(message: string, options?: {
187
212
  readonly fix?: string;
188
213
  }): CliStructuredError;
189
214
  //#endregion
190
- export { type CliErrorConflict, type CliErrorEnvelope, CliStructuredError, errorConfigFileNotFound, errorConfigValidation, errorContractConfigMissing, errorContractMissingExtensionPacks, errorContractValidationFailed, errorDatabaseConnectionRequired, errorDriverRequired, errorFamilyReadMarkerSqlRequired, errorFileNotFound, errorHashMismatch, errorJsonFormatNotSupported, errorMarkerMissing, errorMigrationPlanningFailed, errorQueryRunnerFactoryRequired, errorRuntime, errorTargetMigrationNotSupported, errorTargetMismatch, errorUnexpected };
215
+ export { type CliErrorConflict, type CliErrorEnvelope, CliStructuredError, errorConfigFileNotFound, errorConfigValidation, errorContractConfigMissing, errorContractMissingExtensionPacks, errorContractValidationFailed, errorDatabaseConnectionRequired, errorDestructiveChanges, errorDriverRequired, errorFamilyReadMarkerSqlRequired, errorFileNotFound, errorHashMismatch, errorJsonFormatNotSupported, errorMarkerMissing, errorMarkerRequired, errorMigrationPlanningFailed, errorQueryRunnerFactoryRequired, errorRunnerFailed, errorRuntime, errorTargetMigrationNotSupported, errorTargetMismatch, errorUnexpected };
191
216
  //# sourceMappingURL=errors.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.mts","names":[],"sources":["../src/errors.ts"],"sourcesContent":[],"mappings":";;AAIA;AAoBA;AAUA;AAYiB,UA1CA,gBAAA,CA0CA;EAYK,SAAA,IAAA,EAAA,MAAA;EAwBN,SAAA,MAAA,EAAA,MAAA;EAmBsB,SAAA,QAAA,EAAA,OAAA,GAAA,MAAA,GAAA,MAAA;EAnEE,SAAA,OAAA,EAAA,MAAA;EAAK,SAAA,GAAA,EAAA,MAAA,GAAA,SAAA;EAwF7B,SAAA,GAAA,EAAA,MAAA,GAAA,SAAuB;EAkBvB,SAAA,KAAA,EAAA;IAcA,SAAA,IAAA,EAAA,MAAA,GAAA,SAA6B;IAkB7B,SAAA,IAAA,EAAA,MAAiB,GAAA,SAO9B;EAaa,CAAA,GAAA,SAAA;EAaA,SAAA,IAAA,EA5LC,MA4LD,CAAA,MAAA,EAAA,OAA+B,CAAA,GAAA,SAE3C;EAYY,SAAA,OAAA,EAAA,MAAA,GAAA,SAAgC;AAchD;AAoBA;AAYA;AAuBA;AA6BgB,UArSC,gBAAA,CAqSD;EAcA,SAAA,IAAA,EAAA,MAAA;EAqBA,SAAA,OAAA,EAAA,MAAkB;EAclB,SAAA,GAAA,CAAA,EAAA,MAAiB;AAuBjC;AAoBA;AAuBA;;;cA9Ya,kBAAA,SAA2B,KAAA;;;;;;;;;;iBAYvB;;;;;;;;;;;oBAYK;;;;;;gBAwBN;;;;;sCAmBsB;;;;;iBAqBtB,uBAAA;;IAKb;;;;iBAaa,0BAAA;;IAEZ;;;;iBAYY,6BAAA;;;;;IAKb;;;;iBAaa,iBAAA;;;;IAOb;;;;iBAaa,+BAAA;;IAEZ;;;;iBAWY,+BAAA;;IAEZ;;;;iBAYY,gCAAA;;IAEZ;;;;iBAYY,2BAAA;;;;IAIZ;;;;iBAgBY,mBAAA;;IAA0D;;;;iB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BAAA;;IAEZ;;;;iBAYY,6BAAA;;;;;IAKb;;;;iBAaa,iBAAA;;;;IAOb;;;;iBAaa,+BAAA;;IAEZ;;;;iBAWY,+BAAA;;IAEZ;;;;iBAYY,gCAAA;;IAEZ;;;;iBAYY,2BAAA;;;;IAIZ;;;;iBAgBY,mBAAA;;IAA0D;;;;iBAY1D,kCAAA;;;IAGZ;;;;iBAoBY,4BAAA;+BACe;;IAE3B;;;;iBA0BY,gCAAA;;IAEZ;;;;iBAYY,qBAAA;;IAKb;;;;iBAgBa,kBAAA;;;IAGZ;;;;iBAWY,iBAAA;;;;IAIZ;;;;iBAmBY,mBAAA;;IAMb;;;;;iBAea,mBAAA;;;IAGZ;;;;iBAWY,iBAAA;;;kBAKI;IAEjB;;;;iBAYa,uBAAA;;;kBAKI;IAEjB;;;;iBAYa,YAAA;;;kBAKI;IAEjB;;;;iBAgBa,eAAA;;;IAMb"}
package/dist/errors.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { _ as errorTargetMigrationNotSupported, a as errorContractMissingExtensionPacks, c as errorDriverRequired, d as errorHashMismatch, f as errorJsonFormatNotSupported, g as errorRuntime, h as errorQueryRunnerFactoryRequired, i as errorContractConfigMissing, l as errorFamilyReadMarkerSqlRequired, m as errorMigrationPlanningFailed, n as errorConfigFileNotFound, o as errorContractValidationFailed, p as errorMarkerMissing, r as errorConfigValidation, s as errorDatabaseConnectionRequired, t as CliStructuredError, u as errorFileNotFound, v as errorTargetMismatch, y as errorUnexpected } from "./errors-Qlh0sdcb.mjs";
1
+ import { S as errorUnexpected, _ as errorQueryRunnerFactoryRequired, a as errorContractMissingExtensionPacks, b as errorTargetMigrationNotSupported, c as errorDestructiveChanges, d as errorFileNotFound, f as errorHashMismatch, g as errorMigrationPlanningFailed, h as errorMarkerRequired, i as errorContractConfigMissing, l as errorDriverRequired, m as errorMarkerMissing, n as errorConfigFileNotFound, o as errorContractValidationFailed, p as errorJsonFormatNotSupported, r as errorConfigValidation, s as errorDatabaseConnectionRequired, t as CliStructuredError, u as errorFamilyReadMarkerSqlRequired, v as errorRunnerFailed, x as errorTargetMismatch, y as errorRuntime } from "./errors-CvuQhtGp.mjs";
2
2
 
3
- export { CliStructuredError, errorConfigFileNotFound, errorConfigValidation, errorContractConfigMissing, errorContractMissingExtensionPacks, errorContractValidationFailed, errorDatabaseConnectionRequired, errorDriverRequired, errorFamilyReadMarkerSqlRequired, errorFileNotFound, errorHashMismatch, errorJsonFormatNotSupported, errorMarkerMissing, errorMigrationPlanningFailed, errorQueryRunnerFactoryRequired, errorRuntime, errorTargetMigrationNotSupported, errorTargetMismatch, errorUnexpected };
3
+ export { CliStructuredError, errorConfigFileNotFound, errorConfigValidation, errorContractConfigMissing, errorContractMissingExtensionPacks, errorContractValidationFailed, errorDatabaseConnectionRequired, errorDestructiveChanges, errorDriverRequired, errorFamilyReadMarkerSqlRequired, errorFileNotFound, errorHashMismatch, errorJsonFormatNotSupported, errorMarkerMissing, errorMarkerRequired, errorMigrationPlanningFailed, errorQueryRunnerFactoryRequired, errorRunnerFailed, errorRuntime, errorTargetMigrationNotSupported, errorTargetMismatch, errorUnexpected };
package/dist/stack.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as ControlExtensionDescriptor, l as ControlPlaneStack, r as ControlDriverDescriptor, t as ControlAdapterDescriptor, u as ControlTargetDescriptor } from "./types-CuAauVCJ.mjs";
1
+ import { a as ControlExtensionDescriptor, l as ControlPlaneStack, r as ControlDriverDescriptor, t as ControlAdapterDescriptor, u as ControlTargetDescriptor } from "./types-DWZxwNKq.mjs";
2
2
 
3
3
  //#region src/stack.d.ts
4
4
 
@@ -38,6 +38,14 @@ interface MigrationPlanOperation {
38
38
  interface MigrationPlan {
39
39
  /** The target ID this plan is for (e.g., 'postgres'). */
40
40
  readonly targetId: string;
41
+ /**
42
+ * Origin contract identity that the plan expects the database to currently be at.
43
+ * If omitted or null, the runner skips origin validation entirely.
44
+ */
45
+ readonly origin?: {
46
+ readonly storageHash: string;
47
+ readonly profileHash?: string;
48
+ } | null;
41
49
  /** Destination contract identity that the plan intends to reach. */
42
50
  readonly destination: {
43
51
  readonly storageHash: string;
@@ -594,4 +602,4 @@ interface SignDatabaseResult {
594
602
  }
595
603
  //#endregion
596
604
  export { MigrationRunnerExecutionChecks as A, MigrationPlanOperation as C, MigrationPlannerResult as D, MigrationPlannerFailureResult as E, MigrationRunnerResult as M, MigrationRunnerSuccessValue as N, MigrationPlannerSuccessResult as O, TargetMigrationsCapability as P, MigrationPlan as S, MigrationPlannerConflict as T, SignDatabaseResult as _, ControlExtensionDescriptor as a, MigrationOperationClass as b, ControlFamilyInstance as c, ControlTargetInstance as d, EmitContractResult as f, SchemaVerificationNode as g, SchemaIssue as h, ControlDriverInstance as i, MigrationRunnerFailure as j, MigrationRunner as k, ControlPlaneStack as l, OperationContext as m, ControlAdapterInstance as n, ControlExtensionInstance as o, IntrospectSchemaResult as p, ControlDriverDescriptor as r, ControlFamilyDescriptor as s, ControlAdapterDescriptor as t, ControlTargetDescriptor as u, VerifyDatabaseResult as v, MigrationPlanner as w, MigrationOperationPolicy as x, VerifyDatabaseSchemaResult as y };
597
- //# sourceMappingURL=types-CuAauVCJ.d.mts.map
605
+ //# sourceMappingURL=types-DWZxwNKq.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-DWZxwNKq.d.mts","names":[],"sources":["../src/migrations.ts","../src/types.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAsGA;AAQA;AASA;AAQA;AAcA;;AAAwE,KApH5D,uBAAA,GAoH4D,UAAA,GAAA,UAAA,GAAA,aAAA;;;AAUxE;AA6BiB,UAtJA,wBAAA,CAsJgB;EAOZ,SAAA,uBAAA,EAAA,SA5JwB,uBA4JxB,EAAA;;;;;;AASO,UA1JX,sBAAA,CA0JW;EAUX;EAKE,SAAA,EAAA,EAAA,MAAA;EACwB;EAAW,SAAA,KAAA,EAAA,MAAA;EAAjC;EAEA,SAAA,cAAA,EAtKM,uBAsKN;;;;;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CAAA,kBAAA,MAAA,EAAA,wBAzFH,qBAyFG,CAzFmB,SAyFnB,CAAA,GAzFgC,qBAyFhC,CAzFsD,SAyFtD,CAAA,CAAA,SAxFnB,gBAwFmB,CAxFF,SAwFE,CAAA,CAAA;EAOZ,SAAA,IAAA,EA9FA,gBA8FoB;EA8BpB,MAAA,CAAA,kBAAW,MAAA,CAAA,CAAA,KAAA,EA3Hc,iBA2Hd,CA3HgC,SA2HhC,EA3H2C,SA2H3C,CAAA,CAAA,EA3HwD,eA2HxD;AAkC5B;AAeA;AAmCA;AAcA;AAqBA;;;;;UAvOiB,oGAGS,sBAAsB,WAAW,aAAa,sBACpE,WACA,oCAEsB,sBAAsB,aAAa,sBAAsB,oBACzE,iBAAiB,WAAW;;;;;;;wBAOd,2BAA2B,WAAW,WAAW;YAC7D;;;;;;;;;UAUK,sGAGU,uBAAuB,WAAW,aAAa,uBACtE,WACA,oBAEM,kBAAkB,WAAW;YAC3B;;;;;;;;;;;;;;UAeK,oGAGS,sBAAsB,WAAW,aAAa,sBACpE,WACA,0CAGM,iBAAiB,WAAW;qBACjB,cAAc,QAAQ;;;;;;;;;UAU1B,0GAGY,yBACzB,WACA,aACE,yBAAyB,WAAW,oBAChC,oBAAoB,WAAW;YAC7B;;;;;UAMK,oBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BA,WAAA;;;;;;;;;;;;;;UAkCA,sBAAA;;;;;;;;;8BASa;;;;;UAMb,0BAAA;;;;;;;;;;;;;8BAaa;mBACX;;;;;;;;;;;;;;;;;;;;UAqBF,kBAAA;;;;;;;;;;;;;UAcA;;;;;;;mBAOE;;;;;;;;;;;;;UAcF,kBAAA"}
package/dist/types.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { A as MigrationRunnerExecutionChecks, C as MigrationPlanOperation, D as MigrationPlannerResult, E as MigrationPlannerFailureResult, M as MigrationRunnerResult, N as MigrationRunnerSuccessValue, O as MigrationPlannerSuccessResult, P as TargetMigrationsCapability, S as MigrationPlan, T as MigrationPlannerConflict, _ as SignDatabaseResult, a as ControlExtensionDescriptor, b as MigrationOperationClass, c as ControlFamilyInstance, d as ControlTargetInstance, f as EmitContractResult, g as SchemaVerificationNode, h as SchemaIssue, i as ControlDriverInstance, j as MigrationRunnerFailure, k as MigrationRunner, l as ControlPlaneStack, m as OperationContext, n as ControlAdapterInstance, o as ControlExtensionInstance, p as IntrospectSchemaResult, r as ControlDriverDescriptor, s as ControlFamilyDescriptor, t as ControlAdapterDescriptor, u as ControlTargetDescriptor, v as VerifyDatabaseResult, w as MigrationPlanner, x as MigrationOperationPolicy, y as VerifyDatabaseSchemaResult } from "./types-CuAauVCJ.mjs";
1
+ import { A as MigrationRunnerExecutionChecks, C as MigrationPlanOperation, D as MigrationPlannerResult, E as MigrationPlannerFailureResult, M as MigrationRunnerResult, N as MigrationRunnerSuccessValue, O as MigrationPlannerSuccessResult, P as TargetMigrationsCapability, S as MigrationPlan, T as MigrationPlannerConflict, _ as SignDatabaseResult, a as ControlExtensionDescriptor, b as MigrationOperationClass, c as ControlFamilyInstance, d as ControlTargetInstance, f as EmitContractResult, g as SchemaVerificationNode, h as SchemaIssue, i as ControlDriverInstance, j as MigrationRunnerFailure, k as MigrationRunner, l as ControlPlaneStack, m as OperationContext, n as ControlAdapterInstance, o as ControlExtensionInstance, p as IntrospectSchemaResult, r as ControlDriverDescriptor, s as ControlFamilyDescriptor, t as ControlAdapterDescriptor, u as ControlTargetDescriptor, v as VerifyDatabaseResult, w as MigrationPlanner, x as MigrationOperationPolicy, y as VerifyDatabaseSchemaResult } from "./types-DWZxwNKq.mjs";
2
2
  export { type ControlAdapterDescriptor, type ControlAdapterInstance, type ControlDriverDescriptor, type ControlDriverInstance, type ControlExtensionDescriptor, type ControlExtensionInstance, type ControlFamilyDescriptor, type ControlFamilyInstance, type ControlPlaneStack, type ControlTargetDescriptor, type ControlTargetInstance, type EmitContractResult, type IntrospectSchemaResult, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerFailureResult, type MigrationPlannerResult, type MigrationPlannerSuccessResult, type MigrationRunner, type MigrationRunnerExecutionChecks, type MigrationRunnerFailure, type MigrationRunnerResult, type MigrationRunnerSuccessValue, type OperationContext, type SchemaIssue, type SchemaVerificationNode, type SignDatabaseResult, type TargetMigrationsCapability, type VerifyDatabaseResult, type VerifyDatabaseSchemaResult };
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@prisma-next/core-control-plane",
3
- "version": "0.3.0-dev.53",
3
+ "version": "0.3.0-dev.54",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Control plane domain actions, config types, validation, and error factories for Prisma Next",
7
7
  "dependencies": {
8
8
  "arktype": "^2.1.26",
9
9
  "prettier": "^3.3.3",
10
- "@prisma-next/operations": "0.3.0-dev.53",
11
- "@prisma-next/utils": "0.3.0-dev.53",
12
- "@prisma-next/contract": "0.3.0-dev.53"
10
+ "@prisma-next/contract": "0.3.0-dev.54",
11
+ "@prisma-next/operations": "0.3.0-dev.54",
12
+ "@prisma-next/utils": "0.3.0-dev.54"
13
13
  },
14
14
  "devDependencies": {
15
15
  "tsdown": "0.18.4",
package/src/errors.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  * This is the serialized form of a CliStructuredError.
4
4
  */
5
5
  export interface CliErrorEnvelope {
6
+ readonly ok: false;
6
7
  readonly code: string;
7
8
  readonly domain: string;
8
9
  readonly severity: 'error' | 'warn' | 'info';
@@ -66,7 +67,7 @@ export class CliStructuredError extends Error {
66
67
  this.domain = options?.domain ?? 'CLI';
67
68
  this.severity = options?.severity ?? 'error';
68
69
  this.why = options?.why;
69
- this.fix = options?.fix;
70
+ this.fix = options?.fix === options?.why ? undefined : options?.fix;
70
71
  this.where = options?.where
71
72
  ? {
72
73
  path: options.where.path,
@@ -83,6 +84,7 @@ export class CliStructuredError extends Error {
83
84
  toEnvelope(): CliErrorEnvelope {
84
85
  const codePrefix = this.domain === 'CLI' ? 'PN-CLI-' : 'PN-RTM-';
85
86
  return {
87
+ ok: false as const,
86
88
  code: `${codePrefix}${this.code}`,
87
89
  domain: this.domain,
88
90
  severity: this.severity,
@@ -335,16 +337,16 @@ export function errorConfigValidation(
335
337
  readonly why?: string;
336
338
  },
337
339
  ): CliStructuredError {
338
- return new CliStructuredError('4001', 'Config file not found', {
340
+ return new CliStructuredError('4009', 'Config validation error', {
339
341
  domain: 'CLI',
340
342
  why: options?.why ?? `Config must have a "${field}" field`,
341
- fix: "Run 'prisma-next init' to create a config file",
343
+ fix: 'Check your prisma-next.config.ts and ensure all required fields are provided',
342
344
  docsUrl: 'https://prisma-next.dev/docs/cli/config',
343
345
  });
344
346
  }
345
347
 
346
348
  // ============================================================================
347
- // Runtime Errors (PN-RTM-3000-3003)
349
+ // Runtime Errors (PN-RTM-3000-3030)
348
350
  // ============================================================================
349
351
 
350
352
  /**
@@ -354,10 +356,10 @@ export function errorMarkerMissing(options?: {
354
356
  readonly why?: string;
355
357
  readonly dbUrl?: string;
356
358
  }): CliStructuredError {
357
- return new CliStructuredError('3001', 'Marker missing', {
359
+ return new CliStructuredError('3001', 'Database not signed', {
358
360
  domain: 'RTM',
359
- why: options?.why ?? 'Contract marker not found in database',
360
- fix: 'Run `prisma-next db sign --db <url>` to create marker',
361
+ why: options?.why ?? 'No database signature (marker) found',
362
+ fix: 'Run `prisma-next db sign --db <url>` to sign the database',
361
363
  });
362
364
  }
363
365
 
@@ -404,6 +406,59 @@ export function errorTargetMismatch(
404
406
  });
405
407
  }
406
408
 
409
+ /**
410
+ * Database marker is required but not found.
411
+ * Used by commands that require a pre-existing marker as a precondition.
412
+ */
413
+ export function errorMarkerRequired(options?: {
414
+ readonly why?: string;
415
+ readonly fix?: string;
416
+ }): CliStructuredError {
417
+ return new CliStructuredError('3010', 'Database must be signed first', {
418
+ domain: 'RTM',
419
+ why: options?.why ?? 'No database signature (marker) found',
420
+ fix: options?.fix ?? 'Run `prisma-next db init` first to sign the database',
421
+ });
422
+ }
423
+
424
+ /**
425
+ * Migration runner failed during execution.
426
+ */
427
+ export function errorRunnerFailed(
428
+ summary: string,
429
+ options?: {
430
+ readonly why?: string;
431
+ readonly fix?: string;
432
+ readonly meta?: Record<string, unknown>;
433
+ },
434
+ ): CliStructuredError {
435
+ return new CliStructuredError('3020', summary, {
436
+ domain: 'RTM',
437
+ why: options?.why ?? 'Migration runner failed',
438
+ fix: options?.fix ?? 'Inspect the reported conflict and reconcile schema drift',
439
+ ...(options?.meta ? { meta: options.meta } : {}),
440
+ });
441
+ }
442
+
443
+ /**
444
+ * Destructive operations require explicit confirmation via --accept-data-loss.
445
+ */
446
+ export function errorDestructiveChanges(
447
+ summary: string,
448
+ options?: {
449
+ readonly why?: string;
450
+ readonly fix?: string;
451
+ readonly meta?: Record<string, unknown>;
452
+ },
453
+ ): CliStructuredError {
454
+ return new CliStructuredError('3030', summary, {
455
+ domain: 'RTM',
456
+ why: options?.why ?? 'Planned operations include destructive changes that require confirmation',
457
+ fix: options?.fix ?? 'Use `--plan` to preview, then re-run with `--accept-data-loss`',
458
+ ...(options?.meta ? { meta: options.meta } : {}),
459
+ });
460
+ }
461
+
407
462
  /**
408
463
  * Generic runtime error.
409
464
  */
@@ -7,14 +7,17 @@ export {
7
7
  errorContractMissingExtensionPacks,
8
8
  errorContractValidationFailed,
9
9
  errorDatabaseConnectionRequired,
10
+ errorDestructiveChanges,
10
11
  errorDriverRequired,
11
12
  errorFamilyReadMarkerSqlRequired,
12
13
  errorFileNotFound,
13
14
  errorHashMismatch,
14
15
  errorJsonFormatNotSupported,
15
16
  errorMarkerMissing,
17
+ errorMarkerRequired,
16
18
  errorMigrationPlanningFailed,
17
19
  errorQueryRunnerFactoryRequired,
20
+ errorRunnerFailed,
18
21
  errorRuntime,
19
22
  errorTargetMigrationNotSupported,
20
23
  errorTargetMismatch,
package/src/migrations.ts CHANGED
@@ -56,6 +56,14 @@ export interface MigrationPlanOperation {
56
56
  export interface MigrationPlan {
57
57
  /** The target ID this plan is for (e.g., 'postgres'). */
58
58
  readonly targetId: string;
59
+ /**
60
+ * Origin contract identity that the plan expects the database to currently be at.
61
+ * If omitted or null, the runner skips origin validation entirely.
62
+ */
63
+ readonly origin?: {
64
+ readonly storageHash: string;
65
+ readonly profileHash?: string;
66
+ } | null;
59
67
  /** Destination contract identity that the plan intends to reach. */
60
68
  readonly destination: {
61
69
  readonly storageHash: string;
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors-Qlh0sdcb.mjs","names":[],"sources":["../src/errors.ts"],"sourcesContent":["/**\n * CLI error envelope for output formatting.\n * This is the serialized form of a CliStructuredError.\n */\nexport interface CliErrorEnvelope {\n readonly code: string;\n readonly domain: string;\n readonly severity: 'error' | 'warn' | 'info';\n readonly summary: string;\n readonly why: string | undefined;\n readonly fix: string | undefined;\n readonly where:\n | {\n readonly path: string | undefined;\n readonly line: number | undefined;\n }\n | undefined;\n readonly meta: Record<string, unknown> | undefined;\n readonly docsUrl: string | undefined;\n}\n\n/**\n * Minimal conflict data structure expected by CLI output.\n */\nexport interface CliErrorConflict {\n readonly kind: string;\n readonly summary: string;\n readonly why?: string;\n}\n\n/**\n * Structured CLI error that contains all information needed for error envelopes.\n * Call sites throw these errors with full context.\n */\nexport class CliStructuredError extends Error {\n readonly code: string;\n readonly domain: 'CLI' | 'RTM';\n readonly severity: 'error' | 'warn' | 'info';\n readonly why: string | undefined;\n readonly fix: string | undefined;\n readonly where:\n | {\n readonly path: string | undefined;\n readonly line: number | undefined;\n }\n | undefined;\n readonly meta: Record<string, unknown> | undefined;\n readonly docsUrl: string | undefined;\n\n constructor(\n code: string,\n summary: string,\n options?: {\n readonly domain?: 'CLI' | 'RTM';\n readonly severity?: 'error' | 'warn' | 'info';\n readonly why?: string;\n readonly fix?: string;\n readonly where?: { readonly path?: string; readonly line?: number };\n readonly meta?: Record<string, unknown>;\n readonly docsUrl?: string;\n },\n ) {\n super(summary);\n this.name = 'CliStructuredError';\n this.code = code;\n this.domain = options?.domain ?? 'CLI';\n this.severity = options?.severity ?? 'error';\n this.why = options?.why;\n this.fix = options?.fix;\n this.where = options?.where\n ? {\n path: options.where.path,\n line: options.where.line,\n }\n : undefined;\n this.meta = options?.meta;\n this.docsUrl = options?.docsUrl;\n }\n\n /**\n * Converts this error to a CLI error envelope for output formatting.\n */\n toEnvelope(): CliErrorEnvelope {\n const codePrefix = this.domain === 'CLI' ? 'PN-CLI-' : 'PN-RTM-';\n return {\n code: `${codePrefix}${this.code}`,\n domain: this.domain,\n severity: this.severity,\n summary: this.message,\n why: this.why,\n fix: this.fix,\n where: this.where,\n meta: this.meta,\n docsUrl: this.docsUrl,\n };\n }\n\n /**\n * Type guard to check if an error is a CliStructuredError.\n * Uses duck-typing to work across module boundaries where instanceof may fail.\n */\n static is(error: unknown): error is CliStructuredError {\n if (!(error instanceof Error)) {\n return false;\n }\n const candidate = error as CliStructuredError;\n return (\n candidate.name === 'CliStructuredError' &&\n typeof candidate.code === 'string' &&\n (candidate.domain === 'CLI' || candidate.domain === 'RTM') &&\n typeof candidate.toEnvelope === 'function'\n );\n }\n}\n\n// ============================================================================\n// Config Errors (PN-CLI-4001-4007)\n// ============================================================================\n\n/**\n * Config file not found or missing.\n */\nexport function errorConfigFileNotFound(\n configPath?: string,\n options?: {\n readonly why?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4001', 'Config file not found', {\n domain: 'CLI',\n ...(options?.why ? { why: options.why } : { why: 'Config file not found' }),\n fix: \"Run 'prisma-next init' to create a config file\",\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n ...(configPath ? { where: { path: configPath } } : {}),\n });\n}\n\n/**\n * Contract configuration missing from config.\n */\nexport function errorContractConfigMissing(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4002', 'Contract configuration missing', {\n domain: 'CLI',\n why: options?.why ?? 'The contract configuration is required for emit',\n fix: 'Add contract configuration to your prisma-next.config.ts',\n docsUrl: 'https://prisma-next.dev/docs/cli/contract-emit',\n });\n}\n\n/**\n * Contract validation failed.\n */\nexport function errorContractValidationFailed(\n reason: string,\n options?: {\n readonly where?: { readonly path?: string; readonly line?: number };\n },\n): CliStructuredError {\n return new CliStructuredError('4003', 'Contract validation failed', {\n domain: 'CLI',\n why: reason,\n fix: 'Re-run `prisma-next contract emit`, or fix the contract file and try again',\n docsUrl: 'https://prisma-next.dev/docs/contracts',\n ...(options?.where ? { where: options.where } : {}),\n });\n}\n\n/**\n * File not found.\n */\nexport function errorFileNotFound(\n filePath: string,\n options?: {\n readonly why?: string;\n readonly fix?: string;\n readonly docsUrl?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4004', 'File not found', {\n domain: 'CLI',\n why: options?.why ?? `File not found: ${filePath}`,\n fix: options?.fix ?? 'Check that the file path is correct',\n where: { path: filePath },\n ...(options?.docsUrl ? { docsUrl: options.docsUrl } : {}),\n });\n}\n\n/**\n * Database connection is required but not provided.\n */\nexport function errorDatabaseConnectionRequired(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4005', 'Database connection is required', {\n domain: 'CLI',\n why: options?.why ?? 'Database connection is required for this command',\n fix: 'Provide `--db <url>` or set `db: { connection: \"postgres://…\" }` in prisma-next.config.ts',\n });\n}\n\n/**\n * Query runner factory is required but not provided in config.\n */\nexport function errorQueryRunnerFactoryRequired(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4006', 'Query runner factory is required', {\n domain: 'CLI',\n why: options?.why ?? 'Config.db.queryRunnerFactory is required for db verify',\n fix: 'Add db.queryRunnerFactory to prisma-next.config.ts',\n docsUrl: 'https://prisma-next.dev/docs/cli/db-verify',\n });\n}\n\n/**\n * Family verify.readMarker is required but not provided.\n */\nexport function errorFamilyReadMarkerSqlRequired(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4007', 'Family readMarker() is required', {\n domain: 'CLI',\n why: options?.why ?? 'Family verify.readMarker is required for db verify',\n fix: 'Ensure family.verify.readMarker() is exported by your family package',\n docsUrl: 'https://prisma-next.dev/docs/cli/db-verify',\n });\n}\n\n/**\n * JSON output format not supported.\n */\nexport function errorJsonFormatNotSupported(options: {\n readonly command: string;\n readonly format: string;\n readonly supportedFormats: readonly string[];\n}): CliStructuredError {\n return new CliStructuredError('4008', 'Unsupported JSON format', {\n domain: 'CLI',\n why: `The ${options.command} command does not support --json ${options.format}`,\n fix: `Use --json ${options.supportedFormats.join(' or ')}, or omit --json for human output`,\n meta: {\n command: options.command,\n format: options.format,\n supportedFormats: options.supportedFormats,\n },\n });\n}\n\n/**\n * Driver is required for DB-connected commands but not provided.\n */\nexport function errorDriverRequired(options?: { readonly why?: string }): CliStructuredError {\n return new CliStructuredError('4010', 'Driver is required for DB-connected commands', {\n domain: 'CLI',\n why: options?.why ?? 'Config.driver is required for DB-connected commands',\n fix: 'Add a control-plane driver to prisma-next.config.ts (e.g. import a driver descriptor and set `driver: postgresDriver`)',\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n });\n}\n\n/**\n * Contract requires extension packs that are not provided by config descriptors.\n */\nexport function errorContractMissingExtensionPacks(options: {\n readonly missingExtensionPacks: readonly string[];\n readonly providedComponentIds: readonly string[];\n}): CliStructuredError {\n const missing = [...options.missingExtensionPacks].sort();\n return new CliStructuredError('4011', 'Missing extension packs in config', {\n domain: 'CLI',\n why:\n missing.length === 1\n ? `Contract requires extension pack '${missing[0]}', but CLI config does not provide a matching descriptor.`\n : `Contract requires extension packs ${missing.map((p) => `'${p}'`).join(', ')}, but CLI config does not provide matching descriptors.`,\n fix: 'Add the missing extension descriptors to `extensions` in prisma-next.config.ts',\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n meta: {\n missingExtensionPacks: missing,\n providedComponentIds: [...options.providedComponentIds].sort(),\n },\n });\n}\n\n/**\n * Migration planning failed due to conflicts.\n */\nexport function errorMigrationPlanningFailed(options: {\n readonly conflicts: readonly CliErrorConflict[];\n readonly why?: string;\n}): CliStructuredError {\n // Build \"why\" from conflict summaries - these contain the actual problem description\n const conflictSummaries = options.conflicts.map((c) => c.summary);\n const computedWhy = options.why ?? conflictSummaries.join('\\n');\n\n // Build \"fix\" from conflict \"why\" fields - these contain actionable advice\n const conflictFixes = options.conflicts\n .map((c) => c.why)\n .filter((why): why is string => typeof why === 'string');\n const computedFix =\n conflictFixes.length > 0\n ? conflictFixes.join('\\n')\n : 'Use `db schema-verify` to inspect conflicts, or ensure the database is empty';\n\n return new CliStructuredError('4020', 'Migration planning failed', {\n domain: 'CLI',\n why: computedWhy,\n fix: computedFix,\n meta: { conflicts: options.conflicts },\n docsUrl: 'https://prisma-next.dev/docs/cli/db-init',\n });\n}\n\n/**\n * Target does not support migrations (missing createPlanner/createRunner).\n */\nexport function errorTargetMigrationNotSupported(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4021', 'Target does not support migrations', {\n domain: 'CLI',\n why: options?.why ?? 'The configured target does not provide migration planner/runner',\n fix: 'Select a target that provides migrations (it must export `target.migrations` for db init)',\n docsUrl: 'https://prisma-next.dev/docs/cli/db-init',\n });\n}\n\n/**\n * Config validation error (missing required fields).\n */\nexport function errorConfigValidation(\n field: string,\n options?: {\n readonly why?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4001', 'Config file not found', {\n domain: 'CLI',\n why: options?.why ?? `Config must have a \"${field}\" field`,\n fix: \"Run 'prisma-next init' to create a config file\",\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n });\n}\n\n// ============================================================================\n// Runtime Errors (PN-RTM-3000-3003)\n// ============================================================================\n\n/**\n * Contract marker not found in database.\n */\nexport function errorMarkerMissing(options?: {\n readonly why?: string;\n readonly dbUrl?: string;\n}): CliStructuredError {\n return new CliStructuredError('3001', 'Marker missing', {\n domain: 'RTM',\n why: options?.why ?? 'Contract marker not found in database',\n fix: 'Run `prisma-next db sign --db <url>` to create marker',\n });\n}\n\n/**\n * Contract hash does not match database marker.\n */\nexport function errorHashMismatch(options?: {\n readonly why?: string;\n readonly expected?: string;\n readonly actual?: string;\n}): CliStructuredError {\n return new CliStructuredError('3002', 'Hash mismatch', {\n domain: 'RTM',\n why: options?.why ?? 'Contract hash does not match database marker',\n fix: 'Migrate database or re-sign if intentional',\n ...(options?.expected || options?.actual\n ? {\n meta: {\n ...(options.expected ? { expected: options.expected } : {}),\n ...(options.actual ? { actual: options.actual } : {}),\n },\n }\n : {}),\n });\n}\n\n/**\n * Contract target does not match config target.\n */\nexport function errorTargetMismatch(\n expected: string,\n actual: string,\n options?: {\n readonly why?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('3003', 'Target mismatch', {\n domain: 'RTM',\n why:\n options?.why ??\n `Contract target does not match config target (expected: ${expected}, actual: ${actual})`,\n fix: 'Align contract target and config target',\n meta: { expected, actual },\n });\n}\n\n/**\n * Generic runtime error.\n */\nexport function errorRuntime(\n summary: string,\n options?: {\n readonly why?: string;\n readonly fix?: string;\n readonly meta?: Record<string, unknown>;\n },\n): CliStructuredError {\n return new CliStructuredError('3000', summary, {\n domain: 'RTM',\n ...(options?.why ? { why: options.why } : { why: 'Verification failed' }),\n ...(options?.fix ? { fix: options.fix } : { fix: 'Check contract and database state' }),\n ...(options?.meta ? { meta: options.meta } : {}),\n });\n}\n\n// ============================================================================\n// Generic Error\n// ============================================================================\n\n/**\n * Generic unexpected error.\n */\nexport function errorUnexpected(\n message: string,\n options?: {\n readonly why?: string;\n readonly fix?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4999', 'Unexpected error', {\n domain: 'CLI',\n why: options?.why ?? message,\n fix: options?.fix ?? 'Check the error message and try again',\n });\n}\n"],"mappings":";;;;;AAkCA,IAAa,qBAAb,cAAwC,MAAM;CAC5C,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CAMT,AAAS;CACT,AAAS;CAET,YACE,MACA,SACA,SASA;AACA,QAAM,QAAQ;AACd,OAAK,OAAO;AACZ,OAAK,OAAO;AACZ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