@prisma-next/core-execution-plane 0.3.0-dev.8 → 0.3.0-dev.81

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.
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [2026] [Prisma Data, Inc]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -4,12 +4,14 @@ Execution/runtime plane descriptor and instance types for Prisma Next.
4
4
 
5
5
  ## Overview
6
6
 
7
- This package provides TypeScript type definitions for execution/runtime-plane descriptors and instances. These types define the structure for runtime components (families, targets, adapters, drivers, extensions) that are used during query execution.
7
+ This package provides TypeScript type definitions for execution/runtime-plane descriptors and instances. These types define the structure for runtime components (families, targets, adapters, drivers, extensions) and the descriptors-only execution stack that is instantiated by applications.
8
8
 
9
9
  ## Responsibilities
10
10
 
11
11
  - **Runtime Instance Types**: Base interfaces for runtime plane instances (`RuntimeFamilyInstance`, `RuntimeTargetInstance`, `RuntimeAdapterInstance`, `RuntimeDriverInstance`, `RuntimeExtensionInstance`)
12
12
  - **Runtime Descriptor Types**: Type definitions for runtime plane descriptors (`RuntimeFamilyDescriptor`, `RuntimeTargetDescriptor`, `RuntimeAdapterDescriptor`, `RuntimeDriverDescriptor`, `RuntimeExtensionDescriptor`)
13
+ - **Execution Stack Types**: Descriptors-only execution stack (`ExecutionStack`) and instantiated stack (`ExecutionStackInstance`)
14
+ - **Stack Instantiation**: Helper to instantiate a stack (`instantiateExecutionStack`). When stack has a driver descriptor, instance includes unbound `driver`; caller connects at boundary then passes driver to runtime.
13
15
 
14
16
  ## Dependencies
15
17
 
@@ -77,6 +79,26 @@ import type { RuntimeAdapterInstance } from '@prisma-next/core-execution-plane/t
77
79
  const adapter: RuntimeAdapterInstance<'sql', 'postgres'> = adapterDescriptor.create();
78
80
  ```
79
81
 
82
+ ### Execution Stack
83
+
84
+ Execution stacks group runtime descriptors and are instantiated explicitly. When the stack has a driver descriptor, `instantiateExecutionStack` includes an unbound driver; connect at the boundary then create runtime:
85
+
86
+ ```typescript
87
+ import { createExecutionStack, instantiateExecutionStack } from '@prisma-next/core-execution-plane/stack';
88
+
89
+ const stack = createExecutionStack({
90
+ target: postgresTarget,
91
+ adapter: postgresAdapter,
92
+ driver: postgresDriver,
93
+ extensionPacks: [],
94
+ });
95
+
96
+ const stackInstance = instantiateExecutionStack(stack);
97
+ // stackInstance.driver is unbound; caller connects at boundary:
98
+ await stackInstance.driver!.connect(binding);
99
+ // then createRuntime({ stackInstance, context, driver: stackInstance.driver, ... })
100
+ ```
101
+
80
102
  ## Package Location
81
103
 
82
104
  This package is part of the **framework domain**, **core layer**, **runtime plane**:
@@ -87,7 +109,8 @@ This package is part of the **framework domain**, **core layer**, **runtime plan
87
109
 
88
110
  ## Related Documentation
89
111
 
90
- - `docs/architecture docs/adrs/ADR 152 - Runtime Plane Descriptors and Instances.md`: Complete ADR specification
112
+ - [ADR 152 Execution Plane Descriptors and Instances](../../../../docs/architecture%20docs/adrs/ADR%20152%20-%20Execution%20Plane%20Descriptors%20and%20Instances.md)
113
+ - [ADR 159 — Driver Terminology and Lifecycle](../../../../docs/architecture%20docs/adrs/ADR%20159%20-%20Driver%20Terminology%20and%20Lifecycle.md): Driver instantiation vs connection binding
91
114
  - `.cursor/rules/multi-plane-packages.mdc`: Multi-plane package structure
92
115
  - `packages/1-framework/1-core/migration/control-plane/README.md`: Control plane counterpart
93
116
 
@@ -0,0 +1,32 @@
1
+ import { a as RuntimeExtensionDescriptor, l as RuntimeTargetDescriptor, s as RuntimeFamilyDescriptor, t as RuntimeAdapterDescriptor } from "./types-DELFO9yp.mjs";
2
+
3
+ //#region src/framework-components.d.ts
4
+
5
+ /**
6
+ * Asserts that runtime component descriptors satisfy contract requirements.
7
+ *
8
+ * Routes the same framework composition through validation as control-plane:
9
+ * family, target, adapter, extensionPacks (all as descriptors with IDs).
10
+ *
11
+ * @throws Error if contract target doesn't match the provided target descriptor
12
+ * @throws Error if contract requires extension packs not provided in descriptors
13
+ */
14
+ declare function assertRuntimeContractRequirementsSatisfied<TFamilyId extends string, TTargetId extends string>({
15
+ contract,
16
+ family,
17
+ target,
18
+ adapter,
19
+ extensionPacks
20
+ }: {
21
+ readonly contract: {
22
+ readonly target: string;
23
+ readonly extensionPacks?: Record<string, unknown>;
24
+ };
25
+ readonly family: RuntimeFamilyDescriptor<TFamilyId>;
26
+ readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;
27
+ readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId>;
28
+ readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[];
29
+ }): void;
30
+ //#endregion
31
+ export { assertRuntimeContractRequirementsSatisfied };
32
+ //# sourceMappingURL=framework-components.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework-components.d.mts","names":[],"sources":["../src/framework-components.ts"],"sourcesContent":[],"mappings":";;;;;;AAkBA;;;;;;;AAW2C,iBAX3B,0CAW2B,CAAA,kBAAA,MAAA,EAAA,kBAAA,MAAA,CAAA,CAAA;EAAA,QAAA;EAAA,MAAA;EAAA,MAAA;EAAA,OAAA;EAAA;CAAA,EAAA;EAAxB,SAAA,QAAA,EAAA;IACwB,SAAA,MAAA,EAAA,MAAA;IAAW,SAAA,cAAA,CAAA,EAFoB,MAEpB,CAAA,MAAA,EAAA,OAAA,CAAA;EAAnC,CAAA;EAC0B,SAAA,MAAA,EAF1B,uBAE0B,CAFF,SAEE,CAAA;EAAW,SAAA,MAAA,EADrC,uBACqC,CADb,SACa,EADF,SACE,CAAA;EAApC,SAAA,OAAA,EAAA,wBAAA,CAAyB,SAAzB,EAAoC,SAApC,CAAA;EAC2C,SAAA,cAAA,EAAA,SAA3B,0BAA2B,CAAA,SAAA,EAAW,SAAX,CAAA,EAAA;CAAW,CAAA,EAAA,IAAA"}
@@ -0,0 +1,31 @@
1
+ import { checkContractComponentRequirements } from "@prisma-next/contract/framework-components";
2
+
3
+ //#region src/framework-components.ts
4
+ /**
5
+ * Asserts that runtime component descriptors satisfy contract requirements.
6
+ *
7
+ * Routes the same framework composition through validation as control-plane:
8
+ * family, target, adapter, extensionPacks (all as descriptors with IDs).
9
+ *
10
+ * @throws Error if contract target doesn't match the provided target descriptor
11
+ * @throws Error if contract requires extension packs not provided in descriptors
12
+ */
13
+ function assertRuntimeContractRequirementsSatisfied({ contract, family, target, adapter, extensionPacks }) {
14
+ const providedComponentIds = new Set([
15
+ family.id,
16
+ target.id,
17
+ adapter.id
18
+ ]);
19
+ for (const extension of extensionPacks) providedComponentIds.add(extension.id);
20
+ const result = checkContractComponentRequirements({
21
+ contract,
22
+ expectedTargetId: target.targetId,
23
+ providedComponentIds
24
+ });
25
+ if (result.targetMismatch) throw new Error(`Contract target '${result.targetMismatch.actual}' does not match runtime target descriptor '${result.targetMismatch.expected}'.`);
26
+ for (const packId of result.missingExtensionPackIds) throw new Error(`Contract requires extension pack '${packId}', but runtime descriptors do not provide a matching component.`);
27
+ }
28
+
29
+ //#endregion
30
+ export { assertRuntimeContractRequirementsSatisfied };
31
+ //# sourceMappingURL=framework-components.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework-components.mjs","names":[],"sources":["../src/framework-components.ts"],"sourcesContent":["import { checkContractComponentRequirements } from '@prisma-next/contract/framework-components';\n\nimport type {\n RuntimeAdapterDescriptor,\n RuntimeExtensionDescriptor,\n RuntimeFamilyDescriptor,\n RuntimeTargetDescriptor,\n} from './types';\n\n/**\n * Asserts that runtime component descriptors satisfy contract requirements.\n *\n * Routes the same framework composition through validation as control-plane:\n * family, target, adapter, extensionPacks (all as descriptors with IDs).\n *\n * @throws Error if contract target doesn't match the provided target descriptor\n * @throws Error if contract requires extension packs not provided in descriptors\n */\nexport function assertRuntimeContractRequirementsSatisfied<\n TFamilyId extends string,\n TTargetId extends string,\n>({\n contract,\n family,\n target,\n adapter,\n extensionPacks,\n}: {\n readonly contract: { readonly target: string; readonly extensionPacks?: Record<string, unknown> };\n readonly family: RuntimeFamilyDescriptor<TFamilyId>;\n readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId>;\n readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[];\n}): void {\n // Build set of provided component IDs from descriptors\n const providedComponentIds = new Set<string>([family.id, target.id, adapter.id]);\n for (const extension of extensionPacks) {\n providedComponentIds.add(extension.id);\n }\n\n const result = checkContractComponentRequirements({\n contract,\n expectedTargetId: target.targetId,\n providedComponentIds,\n });\n\n if (result.targetMismatch) {\n throw new Error(\n `Contract target '${result.targetMismatch.actual}' does not match runtime target descriptor '${result.targetMismatch.expected}'.`,\n );\n }\n\n // Strict enforcement: all extension packs required by contract must be provided as descriptors\n for (const packId of result.missingExtensionPackIds) {\n throw new Error(\n `Contract requires extension pack '${packId}', but runtime descriptors do not provide a matching component.`,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAgB,2CAGd,EACA,UACA,QACA,QACA,SACA,kBAOO;CAEP,MAAM,uBAAuB,IAAI,IAAY;EAAC,OAAO;EAAI,OAAO;EAAI,QAAQ;EAAG,CAAC;AAChF,MAAK,MAAM,aAAa,eACtB,sBAAqB,IAAI,UAAU,GAAG;CAGxC,MAAM,SAAS,mCAAmC;EAChD;EACA,kBAAkB,OAAO;EACzB;EACD,CAAC;AAEF,KAAI,OAAO,eACT,OAAM,IAAI,MACR,oBAAoB,OAAO,eAAe,OAAO,8CAA8C,OAAO,eAAe,SAAS,IAC/H;AAIH,MAAK,MAAM,UAAU,OAAO,wBAC1B,OAAM,IAAI,MACR,qCAAqC,OAAO,iEAC7C"}
@@ -0,0 +1,31 @@
1
+ import { a as RuntimeExtensionDescriptor, i as RuntimeDriverInstance, l as RuntimeTargetDescriptor, n as RuntimeAdapterInstance, o as RuntimeExtensionInstance, r as RuntimeDriverDescriptor, t as RuntimeAdapterDescriptor, u as RuntimeTargetInstance } from "./types-DELFO9yp.mjs";
2
+
3
+ //#region src/stack.d.ts
4
+ interface ExecutionStack<TFamilyId extends string, TTargetId extends string, TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<TFamilyId, TTargetId>, TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<TFamilyId, TTargetId>, TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId> = RuntimeExtensionInstance<TFamilyId, TTargetId>> {
5
+ readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;
6
+ readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId, TAdapterInstance>;
7
+ readonly driver: RuntimeDriverDescriptor<TFamilyId, TTargetId, unknown, TDriverInstance> | undefined;
8
+ readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId, TExtensionInstance>[];
9
+ }
10
+ interface ExecutionStackInstance<TFamilyId extends string, TTargetId extends string, TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<TFamilyId, TTargetId>, TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<TFamilyId, TTargetId>, TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId> = RuntimeExtensionInstance<TFamilyId, TTargetId>> {
11
+ readonly stack: ExecutionStack<TFamilyId, TTargetId, TAdapterInstance, TDriverInstance, TExtensionInstance>;
12
+ readonly target: RuntimeTargetInstance<TFamilyId, TTargetId>;
13
+ readonly adapter: TAdapterInstance;
14
+ readonly driver: TDriverInstance | undefined;
15
+ readonly extensionPacks: readonly TExtensionInstance[];
16
+ }
17
+ declare function createExecutionStack<TFamilyId extends string, TTargetId extends string, TTargetInstance extends RuntimeTargetInstance<TFamilyId, TTargetId>, TTargetDescriptor extends RuntimeTargetDescriptor<TFamilyId, TTargetId, TTargetInstance>, TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId>, TAdapterDescriptor extends RuntimeAdapterDescriptor<TFamilyId, TTargetId, TAdapterInstance>, TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<TFamilyId, TTargetId>, TDriverDescriptor extends RuntimeDriverDescriptor<TFamilyId, TTargetId, unknown, TDriverInstance> | undefined = undefined, TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId> = RuntimeExtensionInstance<TFamilyId, TTargetId>, TExtensionDescriptor extends RuntimeExtensionDescriptor<TFamilyId, TTargetId, TExtensionInstance> = never>(input: {
18
+ readonly target: TTargetDescriptor;
19
+ readonly adapter: TAdapterDescriptor;
20
+ readonly driver?: TDriverDescriptor | undefined;
21
+ readonly extensionPacks?: readonly TExtensionDescriptor[] | undefined;
22
+ }): ExecutionStack<TFamilyId, TTargetId, TAdapterInstance, TDriverInstance, TExtensionInstance> & {
23
+ readonly target: TTargetDescriptor;
24
+ readonly adapter: TAdapterDescriptor;
25
+ readonly driver: TDriverDescriptor | undefined;
26
+ readonly extensionPacks: readonly TExtensionDescriptor[];
27
+ };
28
+ declare function instantiateExecutionStack<TFamilyId extends string, TTargetId extends string, TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId>, TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId>, TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId>>(stack: ExecutionStack<TFamilyId, TTargetId, TAdapterInstance, TDriverInstance, TExtensionInstance>): ExecutionStackInstance<TFamilyId, TTargetId, TAdapterInstance, TDriverInstance, TExtensionInstance>;
29
+ //#endregion
30
+ export { type ExecutionStack, type ExecutionStackInstance, createExecutionStack, instantiateExecutionStack };
31
+ //# sourceMappingURL=stack.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack.d.mts","names":[],"sources":["../src/stack.ts"],"sourcesContent":[],"mappings":";;;UAWiB,4FAGU,uBAAuB,WAAW,aAAa,uBACtE,WACA,oCAEsB,sBAAsB,WAAW,aAAa,sBACpE,WACA,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A,EAAA,yBAqFlB,sBArFkB,CAqFK,SArFL,EAqFgB,SArFhB,CAAA,EAAA,wBAsFnB,qBAtFmB,CAsFG,SAtFH,EAsFc,SAtFd,CAAA,EAAA,2BAuFhB,wBAvFgB,CAuFS,SAvFT,EAuFoB,SAvFpB,CAAA,CAAA,CAAA,KAAA,EAyFpC,cAzFoC,CA0FzC,SA1FyC,EA2FzC,SA3FyC,EA4FzC,gBA5FyC,EA6FzC,eA7FyC,EA8FzC,kBA9FyC,CAAA,CAAA,EAgG1C,sBAhG0C,CAiG3C,SAjG2C,EAkG3C,SAlG2C,EAmG3C,gBAnG2C,EAoG3C,eApG2C,EAqG3C,kBArG2C,CAAA"}
package/dist/stack.mjs ADDED
@@ -0,0 +1,23 @@
1
+ //#region src/stack.ts
2
+ function createExecutionStack(input) {
3
+ return {
4
+ target: input.target,
5
+ adapter: input.adapter,
6
+ driver: input.driver,
7
+ extensionPacks: input.extensionPacks ?? []
8
+ };
9
+ }
10
+ function instantiateExecutionStack(stack) {
11
+ const driver = stack.driver ? stack.driver.create() : void 0;
12
+ return {
13
+ stack,
14
+ target: stack.target.create(),
15
+ adapter: stack.adapter.create(),
16
+ driver,
17
+ extensionPacks: stack.extensionPacks.map((descriptor) => descriptor.create())
18
+ };
19
+ }
20
+
21
+ //#endregion
22
+ export { createExecutionStack, instantiateExecutionStack };
23
+ //# sourceMappingURL=stack.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack.mjs","names":[],"sources":["../src/stack.ts"],"sourcesContent":["import type {\n RuntimeAdapterDescriptor,\n RuntimeAdapterInstance,\n RuntimeDriverDescriptor,\n RuntimeDriverInstance,\n RuntimeExtensionDescriptor,\n RuntimeExtensionInstance,\n RuntimeTargetDescriptor,\n RuntimeTargetInstance,\n} from './types';\n\nexport interface ExecutionStack<\n TFamilyId extends string,\n TTargetId extends string,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<\n TFamilyId,\n TTargetId\n >,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<\n TFamilyId,\n TTargetId\n >,\n TExtensionInstance extends RuntimeExtensionInstance<\n TFamilyId,\n TTargetId\n > = RuntimeExtensionInstance<TFamilyId, TTargetId>,\n> {\n readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId, TAdapterInstance>;\n readonly driver:\n | RuntimeDriverDescriptor<TFamilyId, TTargetId, unknown, TDriverInstance>\n | undefined;\n readonly extensionPacks: readonly RuntimeExtensionDescriptor<\n TFamilyId,\n TTargetId,\n TExtensionInstance\n >[];\n}\n\nexport interface ExecutionStackInstance<\n TFamilyId extends string,\n TTargetId extends string,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<\n TFamilyId,\n TTargetId\n >,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<\n TFamilyId,\n TTargetId\n >,\n TExtensionInstance extends RuntimeExtensionInstance<\n TFamilyId,\n TTargetId\n > = RuntimeExtensionInstance<TFamilyId, TTargetId>,\n> {\n readonly stack: ExecutionStack<\n TFamilyId,\n TTargetId,\n TAdapterInstance,\n TDriverInstance,\n TExtensionInstance\n >;\n readonly target: RuntimeTargetInstance<TFamilyId, TTargetId>;\n readonly adapter: TAdapterInstance;\n readonly driver: TDriverInstance | undefined;\n readonly extensionPacks: readonly TExtensionInstance[];\n}\n\nexport function createExecutionStack<\n TFamilyId extends string,\n TTargetId extends string,\n TTargetInstance extends RuntimeTargetInstance<TFamilyId, TTargetId>,\n TTargetDescriptor extends RuntimeTargetDescriptor<TFamilyId, TTargetId, TTargetInstance>,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId>,\n TAdapterDescriptor extends RuntimeAdapterDescriptor<TFamilyId, TTargetId, TAdapterInstance>,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<\n TFamilyId,\n TTargetId\n >,\n TDriverDescriptor extends\n | RuntimeDriverDescriptor<TFamilyId, TTargetId, unknown, TDriverInstance>\n | undefined = undefined,\n TExtensionInstance extends RuntimeExtensionInstance<\n TFamilyId,\n TTargetId\n > = RuntimeExtensionInstance<TFamilyId, TTargetId>,\n TExtensionDescriptor extends RuntimeExtensionDescriptor<\n TFamilyId,\n TTargetId,\n TExtensionInstance\n > = never,\n>(input: {\n readonly target: TTargetDescriptor;\n readonly adapter: TAdapterDescriptor;\n readonly driver?: TDriverDescriptor | undefined;\n readonly extensionPacks?: readonly TExtensionDescriptor[] | undefined;\n}): ExecutionStack<TFamilyId, TTargetId, TAdapterInstance, TDriverInstance, TExtensionInstance> & {\n readonly target: TTargetDescriptor;\n readonly adapter: TAdapterDescriptor;\n readonly driver: TDriverDescriptor | undefined;\n readonly extensionPacks: readonly TExtensionDescriptor[];\n} {\n return {\n target: input.target,\n adapter: input.adapter,\n driver: input.driver,\n extensionPacks: input.extensionPacks ?? [],\n };\n}\n\nexport function instantiateExecutionStack<\n TFamilyId extends string,\n TTargetId extends string,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId>,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId>,\n TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId>,\n>(\n stack: ExecutionStack<\n TFamilyId,\n TTargetId,\n TAdapterInstance,\n TDriverInstance,\n TExtensionInstance\n >,\n): ExecutionStackInstance<\n TFamilyId,\n TTargetId,\n TAdapterInstance,\n TDriverInstance,\n TExtensionInstance\n> {\n const driver = stack.driver ? stack.driver.create() : undefined;\n\n return {\n stack,\n target: stack.target.create(),\n adapter: stack.adapter.create(),\n driver,\n extensionPacks: stack.extensionPacks.map((descriptor) => descriptor.create()),\n };\n}\n"],"mappings":";AAoEA,SAAgB,qBAuBd,OAUA;AACA,QAAO;EACL,QAAQ,MAAM;EACd,SAAS,MAAM;EACf,QAAQ,MAAM;EACd,gBAAgB,MAAM,kBAAkB,EAAE;EAC3C;;AAGH,SAAgB,0BAOd,OAaA;CACA,MAAM,SAAS,MAAM,SAAS,MAAM,OAAO,QAAQ,GAAG;AAEtD,QAAO;EACL;EACA,QAAQ,MAAM,OAAO,QAAQ;EAC7B,SAAS,MAAM,QAAQ,QAAQ;EAC/B;EACA,gBAAgB,MAAM,eAAe,KAAK,eAAe,WAAW,QAAQ,CAAC;EAC9E"}
@@ -0,0 +1,104 @@
1
+ import { AdapterDescriptor, AdapterInstance, DriverDescriptor, DriverInstance, ExtensionDescriptor, ExtensionInstance, FamilyDescriptor, FamilyInstance, TargetDescriptor, TargetInstance } from "@prisma-next/contract/framework-components";
2
+
3
+ //#region src/types.d.ts
4
+
5
+ /**
6
+ * Runtime-plane family instance interface.
7
+ * Extends the base FamilyInstance for runtime-plane specific methods.
8
+ *
9
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
10
+ */
11
+ interface RuntimeFamilyInstance<TFamilyId extends string> extends FamilyInstance<TFamilyId> {}
12
+ /**
13
+ * Runtime-plane target instance interface.
14
+ * Extends the base TargetInstance with runtime-plane specific behavior.
15
+ *
16
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
17
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
18
+ */
19
+ interface RuntimeTargetInstance<TFamilyId extends string, TTargetId extends string> extends TargetInstance<TFamilyId, TTargetId> {}
20
+ /**
21
+ * Runtime-plane adapter instance interface.
22
+ * Extends the base AdapterInstance with runtime-plane specific behavior.
23
+ * Families extend this with family-specific adapter interfaces.
24
+ *
25
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
26
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
27
+ */
28
+ interface RuntimeAdapterInstance<TFamilyId extends string, TTargetId extends string> extends AdapterInstance<TFamilyId, TTargetId> {}
29
+ /**
30
+ * Runtime-plane driver instance interface.
31
+ * Extends the base DriverInstance with runtime-plane specific behavior.
32
+ *
33
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
34
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
35
+ */
36
+ interface RuntimeDriverInstance<TFamilyId extends string, TTargetId extends string> extends DriverInstance<TFamilyId, TTargetId> {}
37
+ /**
38
+ * Runtime-plane extension instance interface.
39
+ * Extends the base ExtensionInstance with runtime-plane specific behavior.
40
+ *
41
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
42
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
43
+ */
44
+ interface RuntimeExtensionInstance<TFamilyId extends string, TTargetId extends string> extends ExtensionInstance<TFamilyId, TTargetId> {}
45
+ /**
46
+ * Descriptor for an execution/runtime-plane family (e.g., SQL).
47
+ * Provides factory method to create runtime family instance.
48
+ *
49
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
50
+ * @template TFamilyInstance - The family instance type
51
+ */
52
+ interface RuntimeFamilyDescriptor<TFamilyId extends string, TFamilyInstance extends RuntimeFamilyInstance<TFamilyId> = RuntimeFamilyInstance<TFamilyId>> extends FamilyDescriptor<TFamilyId> {
53
+ create<TTargetId extends string>(options: {
54
+ readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;
55
+ readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId>;
56
+ readonly driver: RuntimeDriverDescriptor<TFamilyId, TTargetId>;
57
+ readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[];
58
+ }): TFamilyInstance;
59
+ }
60
+ /**
61
+ * Descriptor for an execution/runtime-plane target component (e.g., Postgres target).
62
+ *
63
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
64
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
65
+ * @template TTargetInstance - The target instance type
66
+ */
67
+ interface RuntimeTargetDescriptor<TFamilyId extends string, TTargetId extends string, TTargetInstance extends RuntimeTargetInstance<TFamilyId, TTargetId> = RuntimeTargetInstance<TFamilyId, TTargetId>> extends TargetDescriptor<TFamilyId, TTargetId> {
68
+ create(): TTargetInstance;
69
+ }
70
+ /**
71
+ * Descriptor for an execution/runtime-plane adapter component (e.g., Postgres adapter).
72
+ *
73
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
74
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
75
+ * @template TAdapterInstance - The adapter instance type
76
+ */
77
+ interface RuntimeAdapterDescriptor<TFamilyId extends string, TTargetId extends string, TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<TFamilyId, TTargetId>> extends AdapterDescriptor<TFamilyId, TTargetId> {
78
+ create(): TAdapterInstance;
79
+ }
80
+ /**
81
+ * Descriptor for an execution/runtime-plane driver component (e.g., Postgres driver).
82
+ * create() accepts optional driver-specific options; connection binding happens at connect time.
83
+ *
84
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
85
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
86
+ * @template TCreateOptions - Optional options for create (no connection); default void
87
+ * @template TDriverInstance - The driver instance type
88
+ */
89
+ interface RuntimeDriverDescriptor<TFamilyId extends string, TTargetId extends string, TCreateOptions = void, TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<TFamilyId, TTargetId>> extends DriverDescriptor<TFamilyId, TTargetId> {
90
+ create(options?: TCreateOptions): TDriverInstance;
91
+ }
92
+ /**
93
+ * Descriptor for an execution/runtime-plane extension component (e.g., pgvector).
94
+ *
95
+ * @template TFamilyId - The family ID (e.g., 'sql', 'document')
96
+ * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
97
+ * @template TExtensionInstance - The extension instance type
98
+ */
99
+ interface RuntimeExtensionDescriptor<TFamilyId extends string, TTargetId extends string, TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId> = RuntimeExtensionInstance<TFamilyId, TTargetId>> extends ExtensionDescriptor<TFamilyId, TTargetId> {
100
+ create(): TExtensionInstance;
101
+ }
102
+ //#endregion
103
+ export { RuntimeExtensionDescriptor as a, RuntimeFamilyInstance as c, RuntimeDriverInstance as i, RuntimeTargetDescriptor as l, RuntimeAdapterInstance as n, RuntimeExtensionInstance as o, RuntimeDriverDescriptor as r, RuntimeFamilyDescriptor as s, RuntimeAdapterDescriptor as t, RuntimeTargetInstance as u };
104
+ //# sourceMappingURL=types-DELFO9yp.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-DELFO9yp.d.mts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;;;;AAuBA;AAWA;;;AACU,UAZO,qBAYP,CAAA,kBAAA,MAAA,CAAA,SAZ+D,cAY/D,CAZ8E,SAY9E,CAAA,CAAA;AAUV;;;;;AAUA;;AACoC,UAtBnB,qBAsBmB,CAAA,kBAAA,MAAA,EAAA,kBAAA,MAAA,CAAA,SArB1B,cAqB0B,CArBX,SAqBW,EArBA,SAqBA,CAAA,CAAA;;AASpC;;;;;AAcA;;AAE0B,UApCT,sBAoCS,CAAA,kBAAA,MAAA,EAAA,kBAAA,MAAA,CAAA,SAnChB,eAmCgB,CAnCA,SAmCA,EAnCW,SAmCX,CAAA,CAAA;;;;;;;;AAIJ,UA9BL,qBA8BK,CAAA,kBAAA,MAAA,EAAA,kBAAA,MAAA,CAAA,SA7BZ,cA6BY,CA7BG,SA6BH,EA7Bc,SA6Bd,CAAA,CAAA;;;;;;;;AAHI,UAjBT,wBAiBS,CAAA,kBAAA,MAAA,EAAA,kBAAA,MAAA,CAAA,SAhBhB,iBAgBgB,CAhBE,SAgBF,EAhBa,SAgBb,CAAA,CAAA,CAgB1B;;;;;;;;AAOsC,UA1BrB,uBA0BqB,CAAA,kBAAA,MAAA,EAAA,wBAxBZ,qBAwBY,CAxBU,SAwBV,CAAA,GAxBuB,qBAwBvB,CAxB6C,SAwB7C,CAAA,CAAA,SAvB5B,gBAuB4B,CAvBX,SAuBW,CAAA,CAAA;EAC1B,MAAA,CAAA,kBAAA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AAA,OAAA,CAAA,EAlBO,cAkBP,CAAA,EAlBwB,eAkBxB;;;;;;;;;UARK,0GAGY,yBACzB,WACA,aACE,yBAAyB,WAAW,oBAChC,oBAAoB,WAAW;YAC7B"}
@@ -0,0 +1,2 @@
1
+ import { a as RuntimeExtensionDescriptor, c as RuntimeFamilyInstance, i as RuntimeDriverInstance, l as RuntimeTargetDescriptor, n as RuntimeAdapterInstance, o as RuntimeExtensionInstance, r as RuntimeDriverDescriptor, s as RuntimeFamilyDescriptor, t as RuntimeAdapterDescriptor, u as RuntimeTargetInstance } from "./types-DELFO9yp.mjs";
2
+ export { type RuntimeAdapterDescriptor, type RuntimeAdapterInstance, type RuntimeDriverDescriptor, type RuntimeDriverInstance, type RuntimeExtensionDescriptor, type RuntimeExtensionInstance, type RuntimeFamilyDescriptor, type RuntimeFamilyInstance, type RuntimeTargetDescriptor, type RuntimeTargetInstance };
package/dist/types.mjs ADDED
@@ -0,0 +1 @@
1
+ export { };
package/package.json CHANGED
@@ -1,42 +1,47 @@
1
1
  {
2
2
  "name": "@prisma-next/core-execution-plane",
3
- "version": "0.3.0-dev.8",
3
+ "version": "0.3.0-dev.81",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Execution/runtime plane descriptor and instance types for Prisma Next",
7
7
  "dependencies": {
8
- "@prisma-next/contract": "0.3.0-dev.8",
9
- "@prisma-next/core-control-plane": "0.3.0-dev.8"
8
+ "@prisma-next/contract": "0.3.0-dev.81",
9
+ "@prisma-next/core-control-plane": "0.3.0-dev.81"
10
10
  },
11
11
  "devDependencies": {
12
- "@vitest/coverage-v8": "4.0.16",
13
- "tsup": "8.5.1",
12
+ "tsdown": "0.18.4",
14
13
  "typescript": "5.9.3",
15
- "vitest": "4.0.16",
14
+ "vitest": "4.0.17",
15
+ "@prisma-next/tsdown": "0.0.0",
16
+ "@prisma-next/tsconfig": "0.0.0",
16
17
  "@prisma-next/test-utils": "0.0.1"
17
18
  },
18
19
  "files": [
19
20
  "dist",
20
21
  "src"
21
22
  ],
23
+ "engines": {
24
+ "node": ">=20"
25
+ },
22
26
  "exports": {
23
- "./types": {
24
- "types": "./dist/exports/types.d.ts",
25
- "import": "./dist/exports/types.js"
26
- },
27
- "./framework-components": {
28
- "types": "./dist/exports/framework-components.d.ts",
29
- "import": "./dist/exports/framework-components.js"
30
- }
27
+ "./framework-components": "./dist/framework-components.mjs",
28
+ "./stack": "./dist/stack.mjs",
29
+ "./types": "./dist/types.mjs",
30
+ "./package.json": "./package.json"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/prisma/prisma-next.git",
35
+ "directory": "packages/1-framework/1-core/runtime/execution-plane"
31
36
  },
32
37
  "scripts": {
33
- "build": "tsup --config tsup.config.ts && tsc --project tsconfig.build.json",
38
+ "build": "tsdown",
34
39
  "test": "vitest run --passWithNoTests",
35
40
  "test:coverage": "vitest run --coverage --passWithNoTests",
36
- "typecheck": "tsc --project tsconfig.json --noEmit",
37
- "lint": "biome check . --config-path ../../../../../biome.json --error-on-warnings",
38
- "lint:fix": "biome check --write . --config-path ../../../biome.json",
39
- "lint:fix:unsafe": "biome check --write --unsafe . --config-path ../../../biome.json",
40
- "clean": "node ../../../../../scripts/clean.mjs"
41
+ "typecheck": "tsc --noEmit",
42
+ "lint": "biome check . --error-on-warnings",
43
+ "lint:fix": "biome check --write .",
44
+ "lint:fix:unsafe": "biome check --write --unsafe .",
45
+ "clean": "rm -rf dist dist-tsc dist-tsc-prod coverage .tmp-output"
41
46
  }
42
47
  }
@@ -0,0 +1,2 @@
1
+ export type { ExecutionStack, ExecutionStackInstance } from '../stack';
2
+ export { createExecutionStack, instantiateExecutionStack } from '../stack';
package/src/stack.ts ADDED
@@ -0,0 +1,141 @@
1
+ import type {
2
+ RuntimeAdapterDescriptor,
3
+ RuntimeAdapterInstance,
4
+ RuntimeDriverDescriptor,
5
+ RuntimeDriverInstance,
6
+ RuntimeExtensionDescriptor,
7
+ RuntimeExtensionInstance,
8
+ RuntimeTargetDescriptor,
9
+ RuntimeTargetInstance,
10
+ } from './types';
11
+
12
+ export interface ExecutionStack<
13
+ TFamilyId extends string,
14
+ TTargetId extends string,
15
+ TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<
16
+ TFamilyId,
17
+ TTargetId
18
+ >,
19
+ TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<
20
+ TFamilyId,
21
+ TTargetId
22
+ >,
23
+ TExtensionInstance extends RuntimeExtensionInstance<
24
+ TFamilyId,
25
+ TTargetId
26
+ > = RuntimeExtensionInstance<TFamilyId, TTargetId>,
27
+ > {
28
+ readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;
29
+ readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId, TAdapterInstance>;
30
+ readonly driver:
31
+ | RuntimeDriverDescriptor<TFamilyId, TTargetId, unknown, TDriverInstance>
32
+ | undefined;
33
+ readonly extensionPacks: readonly RuntimeExtensionDescriptor<
34
+ TFamilyId,
35
+ TTargetId,
36
+ TExtensionInstance
37
+ >[];
38
+ }
39
+
40
+ export interface ExecutionStackInstance<
41
+ TFamilyId extends string,
42
+ TTargetId extends string,
43
+ TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<
44
+ TFamilyId,
45
+ TTargetId
46
+ >,
47
+ TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<
48
+ TFamilyId,
49
+ TTargetId
50
+ >,
51
+ TExtensionInstance extends RuntimeExtensionInstance<
52
+ TFamilyId,
53
+ TTargetId
54
+ > = RuntimeExtensionInstance<TFamilyId, TTargetId>,
55
+ > {
56
+ readonly stack: ExecutionStack<
57
+ TFamilyId,
58
+ TTargetId,
59
+ TAdapterInstance,
60
+ TDriverInstance,
61
+ TExtensionInstance
62
+ >;
63
+ readonly target: RuntimeTargetInstance<TFamilyId, TTargetId>;
64
+ readonly adapter: TAdapterInstance;
65
+ readonly driver: TDriverInstance | undefined;
66
+ readonly extensionPacks: readonly TExtensionInstance[];
67
+ }
68
+
69
+ export function createExecutionStack<
70
+ TFamilyId extends string,
71
+ TTargetId extends string,
72
+ TTargetInstance extends RuntimeTargetInstance<TFamilyId, TTargetId>,
73
+ TTargetDescriptor extends RuntimeTargetDescriptor<TFamilyId, TTargetId, TTargetInstance>,
74
+ TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId>,
75
+ TAdapterDescriptor extends RuntimeAdapterDescriptor<TFamilyId, TTargetId, TAdapterInstance>,
76
+ TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<
77
+ TFamilyId,
78
+ TTargetId
79
+ >,
80
+ TDriverDescriptor extends
81
+ | RuntimeDriverDescriptor<TFamilyId, TTargetId, unknown, TDriverInstance>
82
+ | undefined = undefined,
83
+ TExtensionInstance extends RuntimeExtensionInstance<
84
+ TFamilyId,
85
+ TTargetId
86
+ > = RuntimeExtensionInstance<TFamilyId, TTargetId>,
87
+ TExtensionDescriptor extends RuntimeExtensionDescriptor<
88
+ TFamilyId,
89
+ TTargetId,
90
+ TExtensionInstance
91
+ > = never,
92
+ >(input: {
93
+ readonly target: TTargetDescriptor;
94
+ readonly adapter: TAdapterDescriptor;
95
+ readonly driver?: TDriverDescriptor | undefined;
96
+ readonly extensionPacks?: readonly TExtensionDescriptor[] | undefined;
97
+ }): ExecutionStack<TFamilyId, TTargetId, TAdapterInstance, TDriverInstance, TExtensionInstance> & {
98
+ readonly target: TTargetDescriptor;
99
+ readonly adapter: TAdapterDescriptor;
100
+ readonly driver: TDriverDescriptor | undefined;
101
+ readonly extensionPacks: readonly TExtensionDescriptor[];
102
+ } {
103
+ return {
104
+ target: input.target,
105
+ adapter: input.adapter,
106
+ driver: input.driver,
107
+ extensionPacks: input.extensionPacks ?? [],
108
+ };
109
+ }
110
+
111
+ export function instantiateExecutionStack<
112
+ TFamilyId extends string,
113
+ TTargetId extends string,
114
+ TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId>,
115
+ TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId>,
116
+ TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId>,
117
+ >(
118
+ stack: ExecutionStack<
119
+ TFamilyId,
120
+ TTargetId,
121
+ TAdapterInstance,
122
+ TDriverInstance,
123
+ TExtensionInstance
124
+ >,
125
+ ): ExecutionStackInstance<
126
+ TFamilyId,
127
+ TTargetId,
128
+ TAdapterInstance,
129
+ TDriverInstance,
130
+ TExtensionInstance
131
+ > {
132
+ const driver = stack.driver ? stack.driver.create() : undefined;
133
+
134
+ return {
135
+ stack,
136
+ target: stack.target.create(),
137
+ adapter: stack.adapter.create(),
138
+ driver,
139
+ extensionPacks: stack.extensionPacks.map((descriptor) => descriptor.create()),
140
+ };
141
+ }
package/src/types.ts CHANGED
@@ -127,20 +127,23 @@ export interface RuntimeAdapterDescriptor<
127
127
 
128
128
  /**
129
129
  * Descriptor for an execution/runtime-plane driver component (e.g., Postgres driver).
130
+ * create() accepts optional driver-specific options; connection binding happens at connect time.
130
131
  *
131
132
  * @template TFamilyId - The family ID (e.g., 'sql', 'document')
132
133
  * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
134
+ * @template TCreateOptions - Optional options for create (no connection); default void
133
135
  * @template TDriverInstance - The driver instance type
134
136
  */
135
137
  export interface RuntimeDriverDescriptor<
136
138
  TFamilyId extends string,
137
139
  TTargetId extends string,
140
+ TCreateOptions = void,
138
141
  TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<
139
142
  TFamilyId,
140
143
  TTargetId
141
144
  >,
142
145
  > extends DriverDescriptor<TFamilyId, TTargetId> {
143
- create(options: unknown): TDriverInstance;
146
+ create(options?: TCreateOptions): TDriverInstance;
144
147
  }
145
148
 
146
149
  /**
@@ -1,2 +0,0 @@
1
- export { assertRuntimeContractRequirementsSatisfied } from '../framework-components';
2
- //# sourceMappingURL=framework-components.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"framework-components.d.ts","sourceRoot":"","sources":["../../src/exports/framework-components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0CAA0C,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,33 +0,0 @@
1
- // src/framework-components.ts
2
- import { checkContractComponentRequirements } from "@prisma-next/contract/framework-components";
3
- function assertRuntimeContractRequirementsSatisfied({
4
- contract,
5
- family,
6
- target,
7
- adapter,
8
- extensionPacks
9
- }) {
10
- const providedComponentIds = /* @__PURE__ */ new Set([family.id, target.id, adapter.id]);
11
- for (const extension of extensionPacks) {
12
- providedComponentIds.add(extension.id);
13
- }
14
- const result = checkContractComponentRequirements({
15
- contract,
16
- expectedTargetId: target.targetId,
17
- providedComponentIds
18
- });
19
- if (result.targetMismatch) {
20
- throw new Error(
21
- `Contract target '${result.targetMismatch.actual}' does not match runtime target descriptor '${result.targetMismatch.expected}'.`
22
- );
23
- }
24
- for (const packId of result.missingExtensionPackIds) {
25
- throw new Error(
26
- `Contract requires extension pack '${packId}', but runtime descriptors do not provide a matching component.`
27
- );
28
- }
29
- }
30
- export {
31
- assertRuntimeContractRequirementsSatisfied
32
- };
33
- //# sourceMappingURL=framework-components.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/framework-components.ts"],"sourcesContent":["import { checkContractComponentRequirements } from '@prisma-next/contract/framework-components';\n\nimport type {\n RuntimeAdapterDescriptor,\n RuntimeExtensionDescriptor,\n RuntimeFamilyDescriptor,\n RuntimeTargetDescriptor,\n} from './types';\n\n/**\n * Asserts that runtime component descriptors satisfy contract requirements.\n *\n * Routes the same framework composition through validation as control-plane:\n * family, target, adapter, extensionPacks (all as descriptors with IDs).\n *\n * @throws Error if contract target doesn't match the provided target descriptor\n * @throws Error if contract requires extension packs not provided in descriptors\n */\nexport function assertRuntimeContractRequirementsSatisfied<\n TFamilyId extends string,\n TTargetId extends string,\n>({\n contract,\n family,\n target,\n adapter,\n extensionPacks,\n}: {\n readonly contract: { readonly target: string; readonly extensionPacks?: Record<string, unknown> };\n readonly family: RuntimeFamilyDescriptor<TFamilyId>;\n readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId>;\n readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[];\n}): void {\n // Build set of provided component IDs from descriptors\n const providedComponentIds = new Set<string>([family.id, target.id, adapter.id]);\n for (const extension of extensionPacks) {\n providedComponentIds.add(extension.id);\n }\n\n const result = checkContractComponentRequirements({\n contract,\n expectedTargetId: target.targetId,\n providedComponentIds,\n });\n\n if (result.targetMismatch) {\n throw new Error(\n `Contract target '${result.targetMismatch.actual}' does not match runtime target descriptor '${result.targetMismatch.expected}'.`,\n );\n }\n\n // Strict enforcement: all extension packs required by contract must be provided as descriptors\n for (const packId of result.missingExtensionPackIds) {\n throw new Error(\n `Contract requires extension pack '${packId}', but runtime descriptors do not provide a matching component.`,\n );\n }\n}\n"],"mappings":";AAAA,SAAS,0CAA0C;AAkB5C,SAAS,2CAGd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMS;AAEP,QAAM,uBAAuB,oBAAI,IAAY,CAAC,OAAO,IAAI,OAAO,IAAI,QAAQ,EAAE,CAAC;AAC/E,aAAW,aAAa,gBAAgB;AACtC,yBAAqB,IAAI,UAAU,EAAE;AAAA,EACvC;AAEA,QAAM,SAAS,mCAAmC;AAAA,IAChD;AAAA,IACA,kBAAkB,OAAO;AAAA,IACzB;AAAA,EACF,CAAC;AAED,MAAI,OAAO,gBAAgB;AACzB,UAAM,IAAI;AAAA,MACR,oBAAoB,OAAO,eAAe,MAAM,+CAA+C,OAAO,eAAe,QAAQ;AAAA,IAC/H;AAAA,EACF;AAGA,aAAW,UAAU,OAAO,yBAAyB;AACnD,UAAM,IAAI;AAAA,MACR,qCAAqC,MAAM;AAAA,IAC7C;AAAA,EACF;AACF;","names":[]}
@@ -1,2 +0,0 @@
1
- export type { RuntimeAdapterDescriptor, RuntimeAdapterInstance, RuntimeDriverDescriptor, RuntimeDriverInstance, RuntimeExtensionDescriptor, RuntimeExtensionInstance, RuntimeFamilyDescriptor, RuntimeFamilyInstance, RuntimeTargetDescriptor, RuntimeTargetInstance, } from '../types';
2
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/exports/types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,UAAU,CAAC"}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,21 +0,0 @@
1
- import type { RuntimeAdapterDescriptor, RuntimeExtensionDescriptor, RuntimeFamilyDescriptor, RuntimeTargetDescriptor } from './types';
2
- /**
3
- * Asserts that runtime component descriptors satisfy contract requirements.
4
- *
5
- * Routes the same framework composition through validation as control-plane:
6
- * family, target, adapter, extensionPacks (all as descriptors with IDs).
7
- *
8
- * @throws Error if contract target doesn't match the provided target descriptor
9
- * @throws Error if contract requires extension packs not provided in descriptors
10
- */
11
- export declare function assertRuntimeContractRequirementsSatisfied<TFamilyId extends string, TTargetId extends string>({ contract, family, target, adapter, extensionPacks, }: {
12
- readonly contract: {
13
- readonly target: string;
14
- readonly extensionPacks?: Record<string, unknown>;
15
- };
16
- readonly family: RuntimeFamilyDescriptor<TFamilyId>;
17
- readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;
18
- readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId>;
19
- readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[];
20
- }): void;
21
- //# sourceMappingURL=framework-components.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"framework-components.d.ts","sourceRoot":"","sources":["../src/framework-components.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;GAQG;AACH,wBAAgB,0CAA0C,CACxD,SAAS,SAAS,MAAM,EACxB,SAAS,SAAS,MAAM,EACxB,EACA,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,cAAc,GACf,EAAE;IACD,QAAQ,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IAClG,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACpD,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,cAAc,EAAE,SAAS,0BAA0B,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC;CACtF,GAAG,IAAI,CAyBP"}
package/dist/types.d.ts DELETED
@@ -1,102 +0,0 @@
1
- import type { AdapterDescriptor, AdapterInstance, DriverDescriptor, DriverInstance, ExtensionDescriptor, ExtensionInstance, FamilyDescriptor, FamilyInstance, TargetDescriptor, TargetInstance } from '@prisma-next/contract/framework-components';
2
- /**
3
- * Runtime-plane family instance interface.
4
- * Extends the base FamilyInstance for runtime-plane specific methods.
5
- *
6
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
7
- */
8
- export interface RuntimeFamilyInstance<TFamilyId extends string> extends FamilyInstance<TFamilyId> {
9
- }
10
- /**
11
- * Runtime-plane target instance interface.
12
- * Extends the base TargetInstance with runtime-plane specific behavior.
13
- *
14
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
15
- * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
16
- */
17
- export interface RuntimeTargetInstance<TFamilyId extends string, TTargetId extends string> extends TargetInstance<TFamilyId, TTargetId> {
18
- }
19
- /**
20
- * Runtime-plane adapter instance interface.
21
- * Extends the base AdapterInstance with runtime-plane specific behavior.
22
- * Families extend this with family-specific adapter interfaces.
23
- *
24
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
25
- * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
26
- */
27
- export interface RuntimeAdapterInstance<TFamilyId extends string, TTargetId extends string> extends AdapterInstance<TFamilyId, TTargetId> {
28
- }
29
- /**
30
- * Runtime-plane driver instance interface.
31
- * Extends the base DriverInstance with runtime-plane specific behavior.
32
- *
33
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
34
- * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
35
- */
36
- export interface RuntimeDriverInstance<TFamilyId extends string, TTargetId extends string> extends DriverInstance<TFamilyId, TTargetId> {
37
- }
38
- /**
39
- * Runtime-plane extension instance interface.
40
- * Extends the base ExtensionInstance with runtime-plane specific behavior.
41
- *
42
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
43
- * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
44
- */
45
- export interface RuntimeExtensionInstance<TFamilyId extends string, TTargetId extends string> extends ExtensionInstance<TFamilyId, TTargetId> {
46
- }
47
- /**
48
- * Descriptor for an execution/runtime-plane family (e.g., SQL).
49
- * Provides factory method to create runtime family instance.
50
- *
51
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
52
- * @template TFamilyInstance - The family instance type
53
- */
54
- export interface RuntimeFamilyDescriptor<TFamilyId extends string, TFamilyInstance extends RuntimeFamilyInstance<TFamilyId> = RuntimeFamilyInstance<TFamilyId>> extends FamilyDescriptor<TFamilyId> {
55
- create<TTargetId extends string>(options: {
56
- readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;
57
- readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId>;
58
- readonly driver: RuntimeDriverDescriptor<TFamilyId, TTargetId>;
59
- readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[];
60
- }): TFamilyInstance;
61
- }
62
- /**
63
- * Descriptor for an execution/runtime-plane target component (e.g., Postgres target).
64
- *
65
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
66
- * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
67
- * @template TTargetInstance - The target instance type
68
- */
69
- export interface RuntimeTargetDescriptor<TFamilyId extends string, TTargetId extends string, TTargetInstance extends RuntimeTargetInstance<TFamilyId, TTargetId> = RuntimeTargetInstance<TFamilyId, TTargetId>> extends TargetDescriptor<TFamilyId, TTargetId> {
70
- create(): TTargetInstance;
71
- }
72
- /**
73
- * Descriptor for an execution/runtime-plane adapter component (e.g., Postgres adapter).
74
- *
75
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
76
- * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
77
- * @template TAdapterInstance - The adapter instance type
78
- */
79
- export interface RuntimeAdapterDescriptor<TFamilyId extends string, TTargetId extends string, TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<TFamilyId, TTargetId>> extends AdapterDescriptor<TFamilyId, TTargetId> {
80
- create(): TAdapterInstance;
81
- }
82
- /**
83
- * Descriptor for an execution/runtime-plane driver component (e.g., Postgres driver).
84
- *
85
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
86
- * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
87
- * @template TDriverInstance - The driver instance type
88
- */
89
- export interface RuntimeDriverDescriptor<TFamilyId extends string, TTargetId extends string, TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<TFamilyId, TTargetId>> extends DriverDescriptor<TFamilyId, TTargetId> {
90
- create(options: unknown): TDriverInstance;
91
- }
92
- /**
93
- * Descriptor for an execution/runtime-plane extension component (e.g., pgvector).
94
- *
95
- * @template TFamilyId - The family ID (e.g., 'sql', 'document')
96
- * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
97
- * @template TExtensionInstance - The extension instance type
98
- */
99
- export interface RuntimeExtensionDescriptor<TFamilyId extends string, TTargetId extends string, TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId> = RuntimeExtensionInstance<TFamilyId, TTargetId>> extends ExtensionDescriptor<TFamilyId, TTargetId> {
100
- create(): TExtensionInstance;
101
- }
102
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACf,MAAM,4CAA4C,CAAC;AAMpD;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB,CAAC,SAAS,SAAS,MAAM,CAAE,SAAQ,cAAc,CAAC,SAAS,CAAC;CAEjG;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB,CAAC,SAAS,SAAS,MAAM,EAAE,SAAS,SAAS,MAAM,CACvF,SAAQ,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC;CAAG;AAEjD;;;;;;;GAOG;AACH,MAAM,WAAW,sBAAsB,CAAC,SAAS,SAAS,MAAM,EAAE,SAAS,SAAS,MAAM,CACxF,SAAQ,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC;CAAG;AAElD;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB,CAAC,SAAS,SAAS,MAAM,EAAE,SAAS,SAAS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