@prisma-next/core-control-plane 0.3.0-dev.2 → 0.3.0-dev.21

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 (66) hide show
  1. package/README.md +29 -0
  2. package/dist/{chunk-U5RYT6PT.js → chunk-YT6YGR3N.js} +17 -6
  3. package/dist/chunk-YT6YGR3N.js.map +1 -0
  4. package/dist/config-types.d.ts +79 -0
  5. package/dist/config-types.d.ts.map +1 -0
  6. package/dist/config-validation.d.ts +10 -0
  7. package/dist/config-validation.d.ts.map +1 -0
  8. package/dist/emission/canonicalization.d.ts +6 -0
  9. package/dist/emission/canonicalization.d.ts.map +1 -0
  10. package/dist/emission/emit.d.ts +5 -0
  11. package/dist/emission/emit.d.ts.map +1 -0
  12. package/dist/emission/hashing.d.ts +17 -0
  13. package/dist/emission/hashing.d.ts.map +1 -0
  14. package/dist/emission/types.d.ts +16 -0
  15. package/dist/emission/types.d.ts.map +1 -0
  16. package/dist/errors.d.ts +188 -0
  17. package/dist/errors.d.ts.map +1 -0
  18. package/dist/exports/config-types.d.ts +3 -70
  19. package/dist/exports/config-types.d.ts.map +1 -0
  20. package/dist/exports/config-types.js.map +1 -1
  21. package/dist/exports/config-validation.d.ts +2 -18
  22. package/dist/exports/config-validation.d.ts.map +1 -0
  23. package/dist/exports/config-validation.js +1 -1
  24. package/dist/exports/emission.d.ts +5 -42
  25. package/dist/exports/emission.d.ts.map +1 -0
  26. package/dist/exports/emission.js +2 -2
  27. package/dist/exports/emission.js.map +1 -1
  28. package/dist/exports/errors.d.ts +3 -184
  29. package/dist/exports/errors.d.ts.map +1 -0
  30. package/dist/exports/errors.js +3 -3
  31. package/dist/exports/schema-view.d.ts +2 -87
  32. package/dist/exports/schema-view.d.ts.map +1 -0
  33. package/dist/exports/stack.d.ts +2 -0
  34. package/dist/exports/stack.d.ts.map +1 -0
  35. package/dist/exports/stack.js +13 -0
  36. package/dist/exports/stack.js.map +1 -0
  37. package/dist/exports/types.d.ts +2 -589
  38. package/dist/exports/types.d.ts.map +1 -0
  39. package/dist/migrations.d.ts +190 -0
  40. package/dist/migrations.d.ts.map +1 -0
  41. package/dist/schema-view.d.ts +86 -0
  42. package/dist/schema-view.d.ts.map +1 -0
  43. package/dist/stack.d.ts +25 -0
  44. package/dist/stack.d.ts.map +1 -0
  45. package/dist/types.d.ts +416 -0
  46. package/dist/types.d.ts.map +1 -0
  47. package/package.json +18 -14
  48. package/src/config-types.ts +174 -0
  49. package/src/config-validation.ts +270 -0
  50. package/src/emission/canonicalization.ts +253 -0
  51. package/src/emission/emit.ts +118 -0
  52. package/src/emission/hashing.ts +57 -0
  53. package/src/emission/types.ts +17 -0
  54. package/src/errors.ts +445 -0
  55. package/src/exports/config-types.ts +5 -0
  56. package/src/exports/config-validation.ts +1 -0
  57. package/src/exports/emission.ts +6 -0
  58. package/src/exports/errors.ts +22 -0
  59. package/src/exports/schema-view.ts +1 -0
  60. package/src/exports/stack.ts +1 -0
  61. package/src/exports/types.ts +38 -0
  62. package/src/migrations.ts +247 -0
  63. package/src/schema-view.ts +95 -0
  64. package/src/stack.ts +38 -0
  65. package/src/types.ts +530 -0
  66. package/dist/chunk-U5RYT6PT.js.map +0 -1
@@ -0,0 +1,190 @@
1
+ /**
2
+ * Core migration types for the framework control plane.
3
+ *
4
+ * These are family-agnostic, display-oriented types that provide a stable
5
+ * vocabulary for CLI commands to work with migration planners and runners
6
+ * without importing family-specific types.
7
+ *
8
+ * Family-specific types (e.g., SqlMigrationPlan) extend these base types
9
+ * with additional fields for execution (precheck SQL, execute SQL, etc.).
10
+ */
11
+ import type { TargetBoundComponentDescriptor } from '@prisma-next/contract/framework-components';
12
+ import type { Result } from '@prisma-next/utils/result';
13
+ import type { ControlDriverInstance, ControlFamilyInstance } from './types';
14
+ /**
15
+ * Migration operation classes define the safety level of an operation.
16
+ * - 'additive': Adds new structures without modifying existing ones (safe)
17
+ * - 'widening': Relaxes constraints or expands types (generally safe)
18
+ * - 'destructive': Removes or alters existing structures (potentially unsafe)
19
+ */
20
+ export type MigrationOperationClass = 'additive' | 'widening' | 'destructive';
21
+ /**
22
+ * Policy defining which operation classes are allowed during a migration.
23
+ */
24
+ export interface MigrationOperationPolicy {
25
+ readonly allowedOperationClasses: readonly MigrationOperationClass[];
26
+ }
27
+ /**
28
+ * A single migration operation for display purposes.
29
+ * Contains only the fields needed for CLI output (tree view, JSON envelope).
30
+ */
31
+ export interface MigrationPlanOperation {
32
+ /** Unique identifier for this operation (e.g., "table.users.create"). */
33
+ readonly id: string;
34
+ /** Human-readable label for display in UI/CLI (e.g., "Create table users"). */
35
+ readonly label: string;
36
+ /** The class of operation (additive, widening, destructive). */
37
+ readonly operationClass: MigrationOperationClass;
38
+ }
39
+ /**
40
+ * A migration plan for display purposes.
41
+ * Contains only the fields needed for CLI output (summary, JSON envelope).
42
+ */
43
+ export interface MigrationPlan {
44
+ /** The target ID this plan is for (e.g., 'postgres'). */
45
+ readonly targetId: string;
46
+ /** Destination contract identity that the plan intends to reach. */
47
+ readonly destination: {
48
+ readonly coreHash: string;
49
+ readonly profileHash?: string;
50
+ };
51
+ /** Ordered list of operations to execute. */
52
+ readonly operations: readonly MigrationPlanOperation[];
53
+ }
54
+ /**
55
+ * A conflict detected during migration planning.
56
+ */
57
+ export interface MigrationPlannerConflict {
58
+ /** Kind of conflict (e.g., 'typeMismatch', 'nullabilityConflict'). */
59
+ readonly kind: string;
60
+ /** Human-readable summary of the conflict. */
61
+ readonly summary: string;
62
+ /** Optional explanation of why this conflict occurred. */
63
+ readonly why?: string;
64
+ }
65
+ /**
66
+ * Successful planner result with the migration plan.
67
+ */
68
+ export interface MigrationPlannerSuccessResult {
69
+ readonly kind: 'success';
70
+ readonly plan: MigrationPlan;
71
+ }
72
+ /**
73
+ * Failed planner result with the list of conflicts.
74
+ */
75
+ export interface MigrationPlannerFailureResult {
76
+ readonly kind: 'failure';
77
+ readonly conflicts: readonly MigrationPlannerConflict[];
78
+ }
79
+ /**
80
+ * Union type for planner results.
81
+ */
82
+ export type MigrationPlannerResult = MigrationPlannerSuccessResult | MigrationPlannerFailureResult;
83
+ /**
84
+ * Success value for migration runner execution.
85
+ */
86
+ export interface MigrationRunnerSuccessValue {
87
+ readonly operationsPlanned: number;
88
+ readonly operationsExecuted: number;
89
+ }
90
+ /**
91
+ * Failure details for migration runner execution.
92
+ */
93
+ export interface MigrationRunnerFailure {
94
+ /** Error code for the failure. */
95
+ readonly code: string;
96
+ /** Human-readable summary of the failure. */
97
+ readonly summary: string;
98
+ /** Optional explanation of why the failure occurred. */
99
+ readonly why?: string;
100
+ /** Optional metadata for debugging and UX (e.g., schema issues, SQL state). */
101
+ readonly meta?: Record<string, unknown>;
102
+ }
103
+ /**
104
+ * Result type for migration runner execution.
105
+ */
106
+ export type MigrationRunnerResult = Result<MigrationRunnerSuccessValue, MigrationRunnerFailure>;
107
+ /**
108
+ * Execution-time checks configuration for migration runners.
109
+ * All checks default to `true` (enabled) when omitted.
110
+ */
111
+ export interface MigrationRunnerExecutionChecks {
112
+ /**
113
+ * Whether to run prechecks before executing operations.
114
+ * Defaults to `true` (prechecks are run).
115
+ */
116
+ readonly prechecks?: boolean;
117
+ /**
118
+ * Whether to run postchecks after executing operations.
119
+ * Defaults to `true` (postchecks are run).
120
+ */
121
+ readonly postchecks?: boolean;
122
+ /**
123
+ * Whether to run idempotency probe (check if postcheck is already satisfied before execution).
124
+ * Defaults to `true` (idempotency probe is run).
125
+ */
126
+ readonly idempotencyChecks?: boolean;
127
+ }
128
+ /**
129
+ * Migration planner interface for planning schema changes.
130
+ * This is the minimal interface that CLI commands use.
131
+ *
132
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
133
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
134
+ */
135
+ export interface MigrationPlanner<TFamilyId extends string = string, TTargetId extends string = string> {
136
+ plan(options: {
137
+ readonly contract: unknown;
138
+ readonly schema: unknown;
139
+ readonly policy: MigrationOperationPolicy;
140
+ /**
141
+ * Active framework components participating in this composition.
142
+ * Families/targets can interpret this list to derive family-specific metadata.
143
+ * All components must have matching familyId and targetId.
144
+ */
145
+ readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<TFamilyId, TTargetId>>;
146
+ }): MigrationPlannerResult;
147
+ }
148
+ /**
149
+ * Migration runner interface for executing migration plans.
150
+ * This is the minimal interface that CLI commands use.
151
+ *
152
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
153
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
154
+ */
155
+ export interface MigrationRunner<TFamilyId extends string = string, TTargetId extends string = string> {
156
+ execute(options: {
157
+ readonly plan: MigrationPlan;
158
+ readonly driver: ControlDriverInstance<TFamilyId, TTargetId>;
159
+ readonly destinationContract: unknown;
160
+ readonly policy: MigrationOperationPolicy;
161
+ readonly callbacks?: {
162
+ onOperationStart?(op: MigrationPlanOperation): void;
163
+ onOperationComplete?(op: MigrationPlanOperation): void;
164
+ };
165
+ /**
166
+ * Execution-time checks configuration.
167
+ * All checks default to `true` (enabled) when omitted.
168
+ */
169
+ readonly executionChecks?: MigrationRunnerExecutionChecks;
170
+ /**
171
+ * Active framework components participating in this composition.
172
+ * Families/targets can interpret this list to derive family-specific metadata.
173
+ * All components must have matching familyId and targetId.
174
+ */
175
+ readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<TFamilyId, TTargetId>>;
176
+ }): Promise<MigrationRunnerResult>;
177
+ }
178
+ /**
179
+ * Optional capability interface for targets that support migrations.
180
+ * Targets that implement migrations expose this via their descriptor.
181
+ *
182
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
183
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
184
+ * @template TFamilyInstance - The family instance type (e.g., SqlControlFamilyInstance)
185
+ */
186
+ export interface TargetMigrationsCapability<TFamilyId extends string = string, TTargetId extends string = string, TFamilyInstance extends ControlFamilyInstance<TFamilyId> = ControlFamilyInstance<TFamilyId>> {
187
+ createPlanner(family: TFamilyInstance): MigrationPlanner<TFamilyId, TTargetId>;
188
+ createRunner(family: TFamilyInstance): MigrationRunner<TFamilyId, TTargetId>;
189
+ }
190
+ //# sourceMappingURL=migrations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../src/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AACjG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAM5E;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,uBAAuB,EAAE,SAAS,uBAAuB,EAAE,CAAC;CACtE;AAMD;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,yEAAyE;IACzE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,gEAAgE;IAChE,QAAQ,CAAC,cAAc,EAAE,uBAAuB,CAAC;CAClD;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,yDAAyD;IACzD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,oEAAoE;IACpE,QAAQ,CAAC,WAAW,EAAE;QACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;KAC/B,CAAC;IACF,6CAA6C;IAC7C,QAAQ,CAAC,UAAU,EAAE,SAAS,sBAAsB,EAAE,CAAC;CACxD;AAMD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,sEAAsE;IACt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CAAC,qBAAqB,CAAC,CAAC;CACpC;AAMD;;;;;;;GAOG;AACH,MAAM,WAAW,0BAA0B,CACzC,SAAS,SAAS,MAAM,GAAG,MAAM,EACjC,SAAS,SAAS,MAAM,GAAG,MAAM,EACjC,eAAe,SAAS,qBAAqB,CAAC,SAAS,CAAC,GAAG,qBAAqB,CAAC,SAAS,CAAC;IAE3F,aAAa,CAAC,MAAM,EAAE,eAAe,GAAG,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC/E,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;CAC9E"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Core schema view types for family-agnostic schema visualization.
3
+ *
4
+ * These types provide a minimal, generic, tree-shaped representation of schemas
5
+ * across families, designed for CLI visualization and lightweight tooling.
6
+ *
7
+ * Families can optionally project their family-specific Schema IR into this
8
+ * core view via the `toSchemaView` method on `FamilyInstance`.
9
+ *
10
+ * ## Example: SQL Family Mapping
11
+ *
12
+ * For the SQL family, `SqlSchemaIR` can be mapped to `CoreSchemaView` as follows:
13
+ *
14
+ * ```ts
15
+ * // SqlSchemaIR structure:
16
+ * // {
17
+ * // tables: { user: { columns: {...}, primaryKey: {...}, ... }, ... },
18
+ * // extensions: ['pgvector'],
19
+ * // annotations: {...}
20
+ * // }
21
+ *
22
+ * // CoreSchemaView mapping:
23
+ * // {
24
+ * // root: {
25
+ * // kind: 'root',
26
+ * // id: 'sql-schema',
27
+ * // label: 'sql schema (tables: 2)',
28
+ * // children: [
29
+ * // {
30
+ * // kind: 'entity',
31
+ * // id: 'table-user',
32
+ * // label: 'table user',
33
+ * // meta: { primaryKey: ['id'], ... },
34
+ * // children: [
35
+ * // {
36
+ * // kind: 'field',
37
+ * // id: 'column-id',
38
+ * // label: 'id: int4 (pg/int4@1, not null)',
39
+ * // meta: { nativeType: 'int4', codecId: 'pg/int4@1', nullable: false, ... }
40
+ * // },
41
+ * // {
42
+ * // kind: 'index',
43
+ * // id: 'index-user-email',
44
+ * // label: 'index user_email_unique',
45
+ * // meta: { columns: ['email'], unique: true, ... }
46
+ * // }
47
+ * // ]
48
+ * // },
49
+ * // {
50
+ * // kind: 'extension',
51
+ * // id: 'extension-pgvector',
52
+ * // label: 'extension pgvector',
53
+ * // meta: { ... }
54
+ * // }
55
+ * // ]
56
+ * // }
57
+ * // }
58
+ * ```
59
+ *
60
+ * This mapping demonstrates that the core view types are expressive enough
61
+ * to represent SQL schemas without being SQL-specific.
62
+ */
63
+ /**
64
+ * Node kinds for schema tree nodes.
65
+ * Designed to be generic enough for SQL, document, KV, and future families.
66
+ */
67
+ export type SchemaNodeKind = 'root' | 'namespace' | 'collection' | 'entity' | 'field' | 'index' | 'extension';
68
+ /**
69
+ * A node in the schema tree.
70
+ * Tree-shaped structure good for Command Tree-style CLI output.
71
+ */
72
+ export interface SchemaTreeNode {
73
+ readonly kind: SchemaNodeKind;
74
+ readonly id: string;
75
+ readonly label: string;
76
+ readonly meta?: Record<string, unknown>;
77
+ readonly children?: readonly SchemaTreeNode[];
78
+ }
79
+ /**
80
+ * Core schema view providing a family-agnostic tree representation of a schema.
81
+ * Used by CLI and cross-family tooling for visualization.
82
+ */
83
+ export interface CoreSchemaView {
84
+ readonly root: SchemaTreeNode;
85
+ }
86
+ //# sourceMappingURL=schema-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-view.d.ts","sourceRoot":"","sources":["../src/schema-view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,OAAO,GACP,OAAO,GACP,WAAW,CAAC;AAEhB;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;CAC/C;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;CAC/B"}
@@ -0,0 +1,25 @@
1
+ import type { ControlAdapterDescriptor, ControlDriverDescriptor, ControlExtensionDescriptor, ControlPlaneStack, ControlTargetDescriptor } from './types';
2
+ /**
3
+ * Creates a ControlPlaneStack from component descriptors.
4
+ *
5
+ * Provides sensible defaults:
6
+ * - `driver` defaults to `undefined` (optional for commands that don't need DB connection)
7
+ * - `extensionPacks` defaults to `[]` (empty array)
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const stack = createControlPlaneStack({
12
+ * target: postgresTarget,
13
+ * adapter: postgresAdapter,
14
+ * driver: postgresDriver, // optional
15
+ * extensionPacks: [pgvector], // optional
16
+ * });
17
+ * ```
18
+ */
19
+ export declare function createControlPlaneStack<TFamilyId extends string, TTargetId extends string>(input: {
20
+ readonly target: ControlTargetDescriptor<TFamilyId, TTargetId>;
21
+ readonly adapter: ControlAdapterDescriptor<TFamilyId, TTargetId>;
22
+ readonly driver?: ControlDriverDescriptor<TFamilyId, TTargetId> | undefined;
23
+ readonly extensionPacks?: readonly ControlExtensionDescriptor<TFamilyId, TTargetId>[] | undefined;
24
+ }): ControlPlaneStack<TFamilyId, TTargetId>;
25
+ //# sourceMappingURL=stack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../src/stack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,SAAS,MAAM,EAAE,SAAS,SAAS,MAAM,EAAE,KAAK,EAAE;IACjG,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC/D,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACjE,QAAQ,CAAC,MAAM,CAAC,EAAE,uBAAuB,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,SAAS,CAAC;IAC5E,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,0BAA0B,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,GAAG,SAAS,CAAC;CACnG,GAAG,iBAAiB,CAAC,SAAS,EAAE,SAAS,CAAC,CAO1C"}