@prisma-next/core-control-plane 0.3.0-dev.3 → 0.3.0-dev.30

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 (67) hide show
  1. package/README.md +29 -0
  2. package/dist/config-types-h9ifypQ0.d.mts +79 -0
  3. package/dist/config-types-h9ifypQ0.d.mts.map +1 -0
  4. package/dist/config-types.d.mts +2 -0
  5. package/dist/config-types.mjs +65 -0
  6. package/dist/config-types.mjs.map +1 -0
  7. package/dist/{exports/config-validation.d.ts → config-validation.d.mts} +5 -8
  8. package/dist/config-validation.d.mts.map +1 -0
  9. package/dist/config-validation.mjs +79 -0
  10. package/dist/config-validation.mjs.map +1 -0
  11. package/dist/emission.d.mts +57 -0
  12. package/dist/emission.d.mts.map +1 -0
  13. package/dist/emission.mjs +261 -0
  14. package/dist/emission.mjs.map +1 -0
  15. package/dist/errors-Qlh0sdcb.mjs +276 -0
  16. package/dist/errors-Qlh0sdcb.mjs.map +1 -0
  17. package/dist/{exports/errors.d.ts → errors.d.mts} +86 -79
  18. package/dist/errors.d.mts.map +1 -0
  19. package/dist/errors.mjs +3 -0
  20. package/dist/{exports/schema-view.d.ts → schema-view-BG_ebqoV.d.mts} +10 -8
  21. package/dist/schema-view-BG_ebqoV.d.mts.map +1 -0
  22. package/dist/schema-view.d.mts +2 -0
  23. package/dist/schema-view.mjs +1 -0
  24. package/dist/stack.d.mts +30 -0
  25. package/dist/stack.d.mts.map +1 -0
  26. package/dist/stack.mjs +30 -0
  27. package/dist/stack.mjs.map +1 -0
  28. package/dist/types-CsaU_uQP.d.mts +595 -0
  29. package/dist/types-CsaU_uQP.d.mts.map +1 -0
  30. package/dist/types.d.mts +2 -0
  31. package/dist/types.mjs +1 -0
  32. package/package.json +29 -40
  33. package/src/config-types.ts +174 -0
  34. package/src/config-validation.ts +270 -0
  35. package/src/emission/canonicalization.ts +253 -0
  36. package/src/emission/emit.ts +135 -0
  37. package/src/emission/hashing.ts +57 -0
  38. package/src/emission/types.ts +27 -0
  39. package/src/errors.ts +445 -0
  40. package/src/exports/config-types.ts +5 -0
  41. package/src/exports/config-validation.ts +1 -0
  42. package/src/exports/emission.ts +6 -0
  43. package/src/exports/errors.ts +22 -0
  44. package/src/exports/schema-view.ts +1 -0
  45. package/src/exports/stack.ts +1 -0
  46. package/src/exports/types.ts +38 -0
  47. package/src/migrations.ts +247 -0
  48. package/src/schema-view.ts +95 -0
  49. package/src/stack.ts +38 -0
  50. package/src/types.ts +530 -0
  51. package/dist/chunk-U5RYT6PT.js +0 -229
  52. package/dist/chunk-U5RYT6PT.js.map +0 -1
  53. package/dist/exports/config-types.d.ts +0 -70
  54. package/dist/exports/config-types.js +0 -53
  55. package/dist/exports/config-types.js.map +0 -1
  56. package/dist/exports/config-validation.js +0 -252
  57. package/dist/exports/config-validation.js.map +0 -1
  58. package/dist/exports/emission.d.ts +0 -42
  59. package/dist/exports/emission.js +0 -310
  60. package/dist/exports/emission.js.map +0 -1
  61. package/dist/exports/errors.js +0 -43
  62. package/dist/exports/errors.js.map +0 -1
  63. package/dist/exports/schema-view.js +0 -1
  64. package/dist/exports/schema-view.js.map +0 -1
  65. package/dist/exports/types.d.ts +0 -589
  66. package/dist/exports/types.js +0 -1
  67. package/dist/exports/types.js.map +0 -1
@@ -1,184 +1,191 @@
1
+ //#region src/errors.d.ts
1
2
  /**
2
3
  * CLI error envelope for output formatting.
3
4
  * This is the serialized form of a CliStructuredError.
4
5
  */
5
6
  interface CliErrorEnvelope {
6
- readonly code: string;
7
- readonly domain: string;
8
- readonly severity: 'error' | 'warn' | 'info';
9
- readonly summary: string;
10
- readonly why: string | undefined;
11
- readonly fix: string | undefined;
12
- readonly where: {
13
- readonly path: string | undefined;
14
- readonly line: number | undefined;
15
- } | undefined;
16
- readonly meta: Record<string, unknown> | undefined;
17
- readonly docsUrl: string | undefined;
7
+ readonly code: string;
8
+ readonly domain: string;
9
+ readonly severity: 'error' | 'warn' | 'info';
10
+ readonly summary: string;
11
+ readonly why: string | undefined;
12
+ readonly fix: string | undefined;
13
+ readonly where: {
14
+ readonly path: string | undefined;
15
+ readonly line: number | undefined;
16
+ } | undefined;
17
+ readonly meta: Record<string, unknown> | undefined;
18
+ readonly docsUrl: string | undefined;
18
19
  }
19
20
  /**
20
21
  * Minimal conflict data structure expected by CLI output.
21
22
  */
22
23
  interface CliErrorConflict {
23
- readonly kind: string;
24
- readonly summary: string;
25
- readonly why?: string;
24
+ readonly kind: string;
25
+ readonly summary: string;
26
+ readonly why?: string;
26
27
  }
27
28
  /**
28
29
  * Structured CLI error that contains all information needed for error envelopes.
29
30
  * Call sites throw these errors with full context.
30
31
  */
31
32
  declare class CliStructuredError extends Error {
32
- readonly code: string;
33
- readonly domain: 'CLI' | 'RTM';
34
- readonly severity: 'error' | 'warn' | 'info';
35
- readonly why: string | undefined;
36
- readonly fix: string | undefined;
37
- readonly where: {
38
- readonly path: string | undefined;
39
- readonly line: number | undefined;
40
- } | undefined;
41
- readonly meta: Record<string, unknown> | undefined;
42
- readonly docsUrl: string | undefined;
43
- constructor(code: string, summary: string, options?: {
44
- readonly domain?: 'CLI' | 'RTM';
45
- readonly severity?: 'error' | 'warn' | 'info';
46
- readonly why?: string;
47
- readonly fix?: string;
48
- readonly where?: {
49
- readonly path?: string;
50
- readonly line?: number;
51
- };
52
- readonly meta?: Record<string, unknown>;
53
- readonly docsUrl?: string;
54
- });
55
- /**
56
- * Converts this error to a CLI error envelope for output formatting.
57
- */
58
- toEnvelope(): CliErrorEnvelope;
33
+ readonly code: string;
34
+ readonly domain: 'CLI' | 'RTM';
35
+ readonly severity: 'error' | 'warn' | 'info';
36
+ readonly why: string | undefined;
37
+ readonly fix: string | undefined;
38
+ readonly where: {
39
+ readonly path: string | undefined;
40
+ readonly line: number | undefined;
41
+ } | undefined;
42
+ readonly meta: Record<string, unknown> | undefined;
43
+ readonly docsUrl: string | undefined;
44
+ constructor(code: string, summary: string, options?: {
45
+ readonly domain?: 'CLI' | 'RTM';
46
+ readonly severity?: 'error' | 'warn' | 'info';
47
+ readonly why?: string;
48
+ readonly fix?: string;
49
+ readonly where?: {
50
+ readonly path?: string;
51
+ readonly line?: number;
52
+ };
53
+ readonly meta?: Record<string, unknown>;
54
+ readonly docsUrl?: string;
55
+ });
56
+ /**
57
+ * Converts this error to a CLI error envelope for output formatting.
58
+ */
59
+ toEnvelope(): CliErrorEnvelope;
60
+ /**
61
+ * Type guard to check if an error is a CliStructuredError.
62
+ * Uses duck-typing to work across module boundaries where instanceof may fail.
63
+ */
64
+ static is(error: unknown): error is CliStructuredError;
59
65
  }
60
66
  /**
61
67
  * Config file not found or missing.
62
68
  */
63
69
  declare function errorConfigFileNotFound(configPath?: string, options?: {
64
- readonly why?: string;
70
+ readonly why?: string;
65
71
  }): CliStructuredError;
66
72
  /**
67
73
  * Contract configuration missing from config.
68
74
  */
69
75
  declare function errorContractConfigMissing(options?: {
70
- readonly why?: string;
76
+ readonly why?: string;
71
77
  }): CliStructuredError;
72
78
  /**
73
79
  * Contract validation failed.
74
80
  */
75
81
  declare function errorContractValidationFailed(reason: string, options?: {
76
- readonly where?: {
77
- readonly path?: string;
78
- readonly line?: number;
79
- };
82
+ readonly where?: {
83
+ readonly path?: string;
84
+ readonly line?: number;
85
+ };
80
86
  }): CliStructuredError;
81
87
  /**
82
88
  * File not found.
83
89
  */
84
90
  declare function errorFileNotFound(filePath: string, options?: {
85
- readonly why?: string;
86
- readonly fix?: string;
87
- readonly docsUrl?: string;
91
+ readonly why?: string;
92
+ readonly fix?: string;
93
+ readonly docsUrl?: string;
88
94
  }): CliStructuredError;
89
95
  /**
90
- * Database URL is required but not provided.
96
+ * Database connection is required but not provided.
91
97
  */
92
- declare function errorDatabaseUrlRequired(options?: {
93
- readonly why?: string;
98
+ declare function errorDatabaseConnectionRequired(options?: {
99
+ readonly why?: string;
94
100
  }): CliStructuredError;
95
101
  /**
96
102
  * Query runner factory is required but not provided in config.
97
103
  */
98
104
  declare function errorQueryRunnerFactoryRequired(options?: {
99
- readonly why?: string;
105
+ readonly why?: string;
100
106
  }): CliStructuredError;
101
107
  /**
102
108
  * Family verify.readMarker is required but not provided.
103
109
  */
104
110
  declare function errorFamilyReadMarkerSqlRequired(options?: {
105
- readonly why?: string;
111
+ readonly why?: string;
106
112
  }): CliStructuredError;
107
113
  /**
108
114
  * JSON output format not supported.
109
115
  */
110
116
  declare function errorJsonFormatNotSupported(options: {
111
- readonly command: string;
112
- readonly format: string;
113
- readonly supportedFormats: readonly string[];
117
+ readonly command: string;
118
+ readonly format: string;
119
+ readonly supportedFormats: readonly string[];
114
120
  }): CliStructuredError;
115
121
  /**
116
122
  * Driver is required for DB-connected commands but not provided.
117
123
  */
118
124
  declare function errorDriverRequired(options?: {
119
- readonly why?: string;
125
+ readonly why?: string;
120
126
  }): CliStructuredError;
121
127
  /**
122
128
  * Contract requires extension packs that are not provided by config descriptors.
123
129
  */
124
130
  declare function errorContractMissingExtensionPacks(options: {
125
- readonly missingExtensionPacks: readonly string[];
126
- readonly providedComponentIds: readonly string[];
131
+ readonly missingExtensionPacks: readonly string[];
132
+ readonly providedComponentIds: readonly string[];
127
133
  }): CliStructuredError;
128
134
  /**
129
135
  * Migration planning failed due to conflicts.
130
136
  */
131
137
  declare function errorMigrationPlanningFailed(options: {
132
- readonly conflicts: readonly CliErrorConflict[];
133
- readonly why?: string;
138
+ readonly conflicts: readonly CliErrorConflict[];
139
+ readonly why?: string;
134
140
  }): CliStructuredError;
135
141
  /**
136
142
  * Target does not support migrations (missing createPlanner/createRunner).
137
143
  */
138
144
  declare function errorTargetMigrationNotSupported(options?: {
139
- readonly why?: string;
145
+ readonly why?: string;
140
146
  }): CliStructuredError;
141
147
  /**
142
148
  * Config validation error (missing required fields).
143
149
  */
144
150
  declare function errorConfigValidation(field: string, options?: {
145
- readonly why?: string;
151
+ readonly why?: string;
146
152
  }): CliStructuredError;
147
153
  /**
148
154
  * Contract marker not found in database.
149
155
  */
150
156
  declare function errorMarkerMissing(options?: {
151
- readonly why?: string;
152
- readonly dbUrl?: string;
157
+ readonly why?: string;
158
+ readonly dbUrl?: string;
153
159
  }): CliStructuredError;
154
160
  /**
155
161
  * Contract hash does not match database marker.
156
162
  */
157
163
  declare function errorHashMismatch(options?: {
158
- readonly why?: string;
159
- readonly expected?: string;
160
- readonly actual?: string;
164
+ readonly why?: string;
165
+ readonly expected?: string;
166
+ readonly actual?: string;
161
167
  }): CliStructuredError;
162
168
  /**
163
169
  * Contract target does not match config target.
164
170
  */
165
171
  declare function errorTargetMismatch(expected: string, actual: string, options?: {
166
- readonly why?: string;
172
+ readonly why?: string;
167
173
  }): CliStructuredError;
168
174
  /**
169
175
  * Generic runtime error.
170
176
  */
171
177
  declare function errorRuntime(summary: string, options?: {
172
- readonly why?: string;
173
- readonly fix?: string;
174
- readonly meta?: Record<string, unknown>;
178
+ readonly why?: string;
179
+ readonly fix?: string;
180
+ readonly meta?: Record<string, unknown>;
175
181
  }): CliStructuredError;
176
182
  /**
177
183
  * Generic unexpected error.
178
184
  */
179
185
  declare function errorUnexpected(message: string, options?: {
180
- readonly why?: string;
181
- readonly fix?: string;
186
+ readonly why?: string;
187
+ readonly fix?: string;
182
188
  }): CliStructuredError;
183
-
184
- export { type CliErrorConflict, type CliErrorEnvelope, CliStructuredError, errorConfigFileNotFound, errorConfigValidation, errorContractConfigMissing, errorContractMissingExtensionPacks, errorContractValidationFailed, errorDatabaseUrlRequired, errorDriverRequired, errorFamilyReadMarkerSqlRequired, errorFileNotFound, errorHashMismatch, errorJsonFormatNotSupported, errorMarkerMissing, errorMigrationPlanningFailed, errorQueryRunnerFactoryRequired, errorRuntime, errorTargetMigrationNotSupported, errorTargetMismatch, errorUnexpected };
189
+ //#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 };
191
+ //# sourceMappingURL=errors.d.mts.map
@@ -0,0 +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;;;;iBAY1D,kCAAA;;;IAGZ;;;;iBAoBY,4BAAA;+BACe;;IAE3B;;;;iBA0BY,gCAAA;;IAEZ;;;;iBAYY,qBAAA;;IAKb;;;;iBAgBa,kBAAA;;;IAGZ;;;;iBAWY,iBAAA;;;;IAIZ;;;;iBAmBY,mBAAA;;IAMb;;;;iBAca,YAAA;;;kBAKI;IAEjB;;;;iBAgBa,eAAA;;;IAMb"}
@@ -0,0 +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";
2
+
3
+ export { CliStructuredError, errorConfigFileNotFound, errorConfigValidation, errorContractConfigMissing, errorContractMissingExtensionPacks, errorContractValidationFailed, errorDatabaseConnectionRequired, errorDriverRequired, errorFamilyReadMarkerSqlRequired, errorFileNotFound, errorHashMismatch, errorJsonFormatNotSupported, errorMarkerMissing, errorMigrationPlanningFailed, errorQueryRunnerFactoryRequired, errorRuntime, errorTargetMigrationNotSupported, errorTargetMismatch, errorUnexpected };
@@ -1,3 +1,4 @@
1
+ //#region src/schema-view.d.ts
1
2
  /**
2
3
  * Core schema view types for family-agnostic schema visualization.
3
4
  *
@@ -70,18 +71,19 @@ type SchemaNodeKind = 'root' | 'namespace' | 'collection' | 'entity' | 'field' |
70
71
  * Tree-shaped structure good for Command Tree-style CLI output.
71
72
  */
72
73
  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[];
74
+ readonly kind: SchemaNodeKind;
75
+ readonly id: string;
76
+ readonly label: string;
77
+ readonly meta?: Record<string, unknown>;
78
+ readonly children?: readonly SchemaTreeNode[];
78
79
  }
79
80
  /**
80
81
  * Core schema view providing a family-agnostic tree representation of a schema.
81
82
  * Used by CLI and cross-family tooling for visualization.
82
83
  */
83
84
  interface CoreSchemaView {
84
- readonly root: SchemaTreeNode;
85
+ readonly root: SchemaTreeNode;
85
86
  }
86
-
87
- export type { CoreSchemaView, SchemaNodeKind, SchemaTreeNode };
87
+ //#endregion
88
+ export { SchemaNodeKind as n, SchemaTreeNode as r, CoreSchemaView as t };
89
+ //# sourceMappingURL=schema-view-BG_ebqoV.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-view-BG_ebqoV.d.mts","names":[],"sources":["../src/schema-view.ts"],"sourcesContent":[],"mappings":";;AAmEA;AAaA;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAzBY,cAAA;;;;;UAaK,cAAA;iBACA;;;kBAGC;+BACa;;;;;;UAOd,cAAA;iBACA"}
@@ -0,0 +1,2 @@
1
+ import { n as SchemaNodeKind, r as SchemaTreeNode, t as CoreSchemaView } from "./schema-view-BG_ebqoV.mjs";
2
+ export { type CoreSchemaView, type SchemaNodeKind, type SchemaTreeNode };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,30 @@
1
+ import { a as ControlExtensionDescriptor, l as ControlPlaneStack, r as ControlDriverDescriptor, t as ControlAdapterDescriptor, u as ControlTargetDescriptor } from "./types-CsaU_uQP.mjs";
2
+
3
+ //#region src/stack.d.ts
4
+
5
+ /**
6
+ * Creates a ControlPlaneStack from component descriptors.
7
+ *
8
+ * Provides sensible defaults:
9
+ * - `driver` defaults to `undefined` (optional for commands that don't need DB connection)
10
+ * - `extensionPacks` defaults to `[]` (empty array)
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const stack = createControlPlaneStack({
15
+ * target: postgresTarget,
16
+ * adapter: postgresAdapter,
17
+ * driver: postgresDriver, // optional
18
+ * extensionPacks: [pgvector], // optional
19
+ * });
20
+ * ```
21
+ */
22
+ declare function createControlPlaneStack<TFamilyId extends string, TTargetId extends string>(input: {
23
+ readonly target: ControlTargetDescriptor<TFamilyId, TTargetId>;
24
+ readonly adapter: ControlAdapterDescriptor<TFamilyId, TTargetId>;
25
+ readonly driver?: ControlDriverDescriptor<TFamilyId, TTargetId> | undefined;
26
+ readonly extensionPacks?: readonly ControlExtensionDescriptor<TFamilyId, TTargetId>[] | undefined;
27
+ }): ControlPlaneStack<TFamilyId, TTargetId>;
28
+ //#endregion
29
+ export { createControlPlaneStack };
30
+ //# sourceMappingURL=stack.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack.d.mts","names":[],"sources":["../src/stack.ts"],"sourcesContent":[],"mappings":";;;;;;AAyBA;;;;;;;;;;;;;;;AAKI,iBALY,uBAKZ,CAAA,kBAAA,MAAA,EAAA,kBAAA,MAAA,CAAA,CAAA,KAAA,EAAA;EAAiB,SAAA,MAAA,EAJF,uBAIE,CAJsB,SAItB,EAJiC,SAIjC,CAAA;oBAHD,yBAAyB,WAAW;oBACpC,wBAAwB,WAAW;qCAClB,2BAA2B,WAAW;IACvE,kBAAkB,WAAW"}
package/dist/stack.mjs ADDED
@@ -0,0 +1,30 @@
1
+ //#region src/stack.ts
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
+ function createControlPlaneStack(input) {
20
+ return {
21
+ target: input.target,
22
+ adapter: input.adapter,
23
+ driver: input.driver,
24
+ extensionPacks: input.extensionPacks ?? []
25
+ };
26
+ }
27
+
28
+ //#endregion
29
+ export { createControlPlaneStack };
30
+ //# sourceMappingURL=stack.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack.mjs","names":[],"sources":["../src/stack.ts"],"sourcesContent":["import type {\n ControlAdapterDescriptor,\n ControlDriverDescriptor,\n ControlExtensionDescriptor,\n ControlPlaneStack,\n ControlTargetDescriptor,\n} from './types';\n\n/**\n * Creates a ControlPlaneStack from component descriptors.\n *\n * Provides sensible defaults:\n * - `driver` defaults to `undefined` (optional for commands that don't need DB connection)\n * - `extensionPacks` defaults to `[]` (empty array)\n *\n * @example\n * ```ts\n * const stack = createControlPlaneStack({\n * target: postgresTarget,\n * adapter: postgresAdapter,\n * driver: postgresDriver, // optional\n * extensionPacks: [pgvector], // optional\n * });\n * ```\n */\nexport function createControlPlaneStack<TFamilyId extends string, TTargetId extends string>(input: {\n readonly target: ControlTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter: ControlAdapterDescriptor<TFamilyId, TTargetId>;\n readonly driver?: ControlDriverDescriptor<TFamilyId, TTargetId> | undefined;\n readonly extensionPacks?: readonly ControlExtensionDescriptor<TFamilyId, TTargetId>[] | undefined;\n}): ControlPlaneStack<TFamilyId, TTargetId> {\n return {\n target: input.target,\n adapter: input.adapter,\n driver: input.driver,\n extensionPacks: input.extensionPacks ?? [],\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,SAAgB,wBAA4E,OAKhD;AAC1C,QAAO;EACL,QAAQ,MAAM;EACd,SAAS,MAAM;EACf,QAAQ,MAAM;EACd,gBAAgB,MAAM,kBAAkB,EAAE;EAC3C"}