@prisma-next/framework-components 0.5.0-dev.27 → 0.5.0-dev.29

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 (80) hide show
  1. package/README.md +31 -0
  2. package/dist/authoring.d.mts +1 -1
  3. package/dist/authoring.mjs +1 -1
  4. package/dist/authoring.mjs.map +1 -1
  5. package/dist/{codec-types-DQ1Agjom.d.mts → codec-types-DXv-ROhF.d.mts} +33 -7
  6. package/dist/codec-types-DXv-ROhF.d.mts.map +1 -0
  7. package/dist/codec.d.mts +2 -2
  8. package/dist/codec.mjs +1 -1
  9. package/dist/codec.mjs.map +1 -1
  10. package/dist/components.d.mts +1 -1
  11. package/dist/components.mjs +1 -1
  12. package/dist/control.d.mts +54 -13
  13. package/dist/control.d.mts.map +1 -1
  14. package/dist/control.mjs +11 -5
  15. package/dist/control.mjs.map +1 -1
  16. package/dist/{emission-types-BPAALJbF.d.mts → emission-types-D234HxUz.d.mts} +3 -3
  17. package/dist/emission-types-D234HxUz.d.mts.map +1 -0
  18. package/dist/emission.d.mts +2 -2
  19. package/dist/execution.d.mts +5 -5
  20. package/dist/execution.d.mts.map +1 -1
  21. package/dist/execution.mjs +3 -3
  22. package/dist/execution.mjs.map +1 -1
  23. package/dist/{framework-authoring-D1-JZ37B.d.mts → framework-authoring-BdrFDx4x.d.mts} +2 -2
  24. package/dist/framework-authoring-BdrFDx4x.d.mts.map +1 -0
  25. package/dist/{framework-components-C8ZhSwXe.mjs → framework-components-BsWST1Rn.mjs} +2 -2
  26. package/dist/framework-components-BsWST1Rn.mjs.map +1 -0
  27. package/dist/{framework-components-DFZMi2h7.d.mts → framework-components-Buvf7mnC.d.mts} +6 -6
  28. package/dist/framework-components-Buvf7mnC.d.mts.map +1 -0
  29. package/dist/psl-ast-9X5rwo98.d.mts +159 -0
  30. package/dist/psl-ast-9X5rwo98.d.mts.map +1 -0
  31. package/dist/psl-ast.d.mts +2 -0
  32. package/dist/psl-ast.mjs +1 -0
  33. package/dist/runtime.d.mts +110 -25
  34. package/dist/runtime.d.mts.map +1 -1
  35. package/dist/runtime.mjs +103 -8
  36. package/dist/runtime.mjs.map +1 -1
  37. package/dist/{types-import-spec-C4sc7wbb.d.mts → types-import-spec-D-O6GotH.d.mts} +2 -2
  38. package/dist/types-import-spec-D-O6GotH.d.mts.map +1 -0
  39. package/package.json +5 -4
  40. package/src/control/control-capabilities.ts +71 -0
  41. package/src/{control-descriptors.ts → control/control-descriptors.ts} +7 -7
  42. package/src/{control-instances.ts → control/control-instances.ts} +6 -6
  43. package/src/{control-migration-types.ts → control/control-migration-types.ts} +1 -1
  44. package/src/control/control-operation-preview.ts +23 -0
  45. package/src/{control-stack.ts → control/control-stack.ts} +13 -13
  46. package/src/{emission-types.ts → control/emission-types.ts} +1 -1
  47. package/src/control/psl-ast.ts +193 -0
  48. package/src/{execution-descriptors.ts → execution/execution-descriptors.ts} +7 -7
  49. package/src/{execution-instances.ts → execution/execution-instances.ts} +1 -1
  50. package/src/{execution-requirements.ts → execution/execution-requirements.ts} +1 -1
  51. package/src/execution/race-against-abort.ts +85 -0
  52. package/src/{runtime-core.ts → execution/runtime-core.ts} +27 -3
  53. package/src/{runtime-error.ts → execution/runtime-error.ts} +28 -0
  54. package/src/{runtime-middleware.ts → execution/runtime-middleware.ts} +17 -1
  55. package/src/exports/authoring.ts +2 -2
  56. package/src/exports/codec.ts +2 -2
  57. package/src/exports/components.ts +2 -2
  58. package/src/exports/control.ts +26 -12
  59. package/src/exports/emission.ts +2 -2
  60. package/src/exports/execution.ts +5 -5
  61. package/src/exports/psl-ast.ts +1 -0
  62. package/src/exports/runtime.ts +16 -9
  63. package/src/{codec-types.ts → shared/codec-types.ts} +31 -4
  64. package/dist/codec-types-DQ1Agjom.d.mts.map +0 -1
  65. package/dist/emission-types-BPAALJbF.d.mts.map +0 -1
  66. package/dist/framework-authoring-D1-JZ37B.d.mts.map +0 -1
  67. package/dist/framework-components-C8ZhSwXe.mjs.map +0 -1
  68. package/dist/framework-components-DFZMi2h7.d.mts.map +0 -1
  69. package/dist/types-import-spec-C4sc7wbb.d.mts.map +0 -1
  70. package/src/control-capabilities.ts +0 -34
  71. /package/src/{control-result-types.ts → control/control-result-types.ts} +0 -0
  72. /package/src/{control-schema-view.ts → control/control-schema-view.ts} +0 -0
  73. /package/src/{async-iterable-result.ts → execution/async-iterable-result.ts} +0 -0
  74. /package/src/{execution-stack.ts → execution/execution-stack.ts} +0 -0
  75. /package/src/{query-plan.ts → execution/query-plan.ts} +0 -0
  76. /package/src/{run-with-middleware.ts → execution/run-with-middleware.ts} +0 -0
  77. /package/src/{framework-authoring.ts → shared/framework-authoring.ts} +0 -0
  78. /package/src/{framework-components.ts → shared/framework-components.ts} +0 -0
  79. /package/src/{mutation-default-types.ts → shared/mutation-default-types.ts} +0 -0
  80. /package/src/{types-import-spec.ts → shared/types-import-spec.ts} +0 -0
@@ -1,19 +1,29 @@
1
- export type { MigratableTargetDescriptor, SchemaViewCapable } from '../control-capabilities';
2
- export { hasMigrations, hasSchemaView } from '../control-capabilities';
1
+ export type {
2
+ MigratableTargetDescriptor,
3
+ OperationPreviewCapable,
4
+ PslContractInferCapable,
5
+ SchemaViewCapable,
6
+ } from '../control/control-capabilities';
7
+ export {
8
+ hasMigrations,
9
+ hasOperationPreview,
10
+ hasPslContractInfer,
11
+ hasSchemaView,
12
+ } from '../control/control-capabilities';
3
13
  export type {
4
14
  ControlAdapterDescriptor,
5
15
  ControlDriverDescriptor,
6
16
  ControlExtensionDescriptor,
7
17
  ControlFamilyDescriptor,
8
18
  ControlTargetDescriptor,
9
- } from '../control-descriptors';
19
+ } from '../control/control-descriptors';
10
20
  export type {
11
21
  ControlAdapterInstance,
12
22
  ControlDriverInstance,
13
23
  ControlExtensionInstance,
14
24
  ControlFamilyInstance,
15
25
  ControlTargetInstance,
16
- } from '../control-instances';
26
+ } from '../control/control-instances';
17
27
  export type {
18
28
  DataTransformOperation,
19
29
  MigrationOperationClass,
@@ -35,7 +45,11 @@ export type {
35
45
  OpFactoryCall,
36
46
  SerializedQueryPlan,
37
47
  TargetMigrationsCapability,
38
- } from '../control-migration-types';
48
+ } from '../control/control-migration-types';
49
+ export type {
50
+ OperationPreview,
51
+ OperationPreviewStatement,
52
+ } from '../control/control-operation-preview';
39
53
  export type {
40
54
  BaseSchemaIssue,
41
55
  EmitContractResult,
@@ -47,25 +61,25 @@ export type {
47
61
  SignDatabaseResult,
48
62
  VerifyDatabaseResult,
49
63
  VerifyDatabaseSchemaResult,
50
- } from '../control-result-types';
64
+ } from '../control/control-result-types';
51
65
  export {
52
66
  VERIFY_CODE_HASH_MISMATCH,
53
67
  VERIFY_CODE_MARKER_MISSING,
54
68
  VERIFY_CODE_SCHEMA_FAILURE,
55
69
  VERIFY_CODE_TARGET_MISMATCH,
56
- } from '../control-result-types';
70
+ } from '../control/control-result-types';
57
71
  export type {
58
72
  CoreSchemaView,
59
73
  SchemaNodeKind,
60
74
  SchemaTreeNodeOptions,
61
75
  SchemaTreeVisitor,
62
- } from '../control-schema-view';
63
- export { SchemaTreeNode } from '../control-schema-view';
76
+ } from '../control/control-schema-view';
77
+ export { SchemaTreeNode } from '../control/control-schema-view';
64
78
  export type {
65
79
  AssembledAuthoringContributions,
66
80
  ControlStack,
67
81
  CreateControlStackInput,
68
- } from '../control-stack';
82
+ } from '../control/control-stack';
69
83
  export {
70
84
  assembleAuthoringContributions,
71
85
  assembleControlMutationDefaults,
@@ -77,7 +91,7 @@ export {
77
91
  extractComponentIds,
78
92
  extractOperationTypeImports,
79
93
  extractQueryOperationTypeImports,
80
- } from '../control-stack';
94
+ } from '../control/control-stack';
81
95
  export type {
82
96
  ControlMutationDefaultEntry,
83
97
  ControlMutationDefaultRegistry,
@@ -92,4 +106,4 @@ export type {
92
106
  ParsedDefaultFunctionCall,
93
107
  SourceDiagnostic,
94
108
  SourceSpan,
95
- } from '../mutation-default-types';
109
+ } from '../shared/mutation-default-types';
@@ -2,5 +2,5 @@ export type {
2
2
  EmissionSpi,
3
3
  GenerateContractTypesOptions,
4
4
  ValidationContext,
5
- } from '../emission-types';
6
- export type { TypesImportSpec } from '../types-import-spec';
5
+ } from '../control/emission-types';
6
+ export type { TypesImportSpec } from '../shared/types-import-spec';
@@ -4,14 +4,14 @@ export type {
4
4
  RuntimeExtensionDescriptor,
5
5
  RuntimeFamilyDescriptor,
6
6
  RuntimeTargetDescriptor,
7
- } from '../execution-descriptors';
7
+ } from '../execution/execution-descriptors';
8
8
  export type {
9
9
  RuntimeAdapterInstance,
10
10
  RuntimeDriverInstance,
11
11
  RuntimeExtensionInstance,
12
12
  RuntimeFamilyInstance,
13
13
  RuntimeTargetInstance,
14
- } from '../execution-instances';
15
- export { assertRuntimeContractRequirementsSatisfied } from '../execution-requirements';
16
- export type { ExecutionStack, ExecutionStackInstance } from '../execution-stack';
17
- export { createExecutionStack, instantiateExecutionStack } from '../execution-stack';
14
+ } from '../execution/execution-instances';
15
+ export { assertRuntimeContractRequirementsSatisfied } from '../execution/execution-requirements';
16
+ export type { ExecutionStack, ExecutionStackInstance } from '../execution/execution-stack';
17
+ export { createExecutionStack, instantiateExecutionStack } from '../execution/execution-stack';
@@ -0,0 +1 @@
1
+ export * from '../control/psl-ast';
@@ -1,15 +1,22 @@
1
- export { AsyncIterableResult } from '../async-iterable-result';
2
- export type { ExecutionPlan, QueryPlan, ResultType } from '../query-plan';
3
- export { runWithMiddleware } from '../run-with-middleware';
4
- export type { RuntimeCoreOptions } from '../runtime-core';
5
- export { RuntimeCore } from '../runtime-core';
6
- export type { RuntimeErrorEnvelope } from '../runtime-error';
7
- export { isRuntimeError, runtimeError } from '../runtime-error';
1
+ export { AsyncIterableResult } from '../execution/async-iterable-result';
2
+ export type { ExecutionPlan, QueryPlan, ResultType } from '../execution/query-plan';
3
+ export { checkAborted, raceAgainstAbort } from '../execution/race-against-abort';
4
+ export { runWithMiddleware } from '../execution/run-with-middleware';
5
+ export type { RuntimeCoreOptions } from '../execution/runtime-core';
6
+ export { RuntimeCore } from '../execution/runtime-core';
7
+ export type { RuntimeAbortedPhase, RuntimeErrorEnvelope } from '../execution/runtime-error';
8
+ export {
9
+ isRuntimeError,
10
+ RUNTIME_ABORTED,
11
+ runtimeAborted,
12
+ runtimeError,
13
+ } from '../execution/runtime-error';
8
14
  export type {
9
15
  AfterExecuteResult,
16
+ RuntimeExecuteOptions,
10
17
  RuntimeExecutor,
11
18
  RuntimeLog,
12
19
  RuntimeMiddleware,
13
20
  RuntimeMiddlewareContext,
14
- } from '../runtime-middleware';
15
- export { checkMiddlewareCompatibility } from '../runtime-middleware';
21
+ } from '../execution/runtime-middleware';
22
+ export { checkMiddlewareCompatibility } from '../execution/runtime-middleware';
@@ -2,6 +2,33 @@ import type { JsonValue } from '@prisma-next/contract/types';
2
2
 
3
3
  export type CodecTrait = 'equality' | 'order' | 'boolean' | 'numeric' | 'textual';
4
4
 
5
+ /**
6
+ * Per-call context the runtime threads to every `codec.encode` /
7
+ * `codec.decode` invocation for a single `runtime.execute()` call.
8
+ *
9
+ * The framework-level shape is family-agnostic and carries one field:
10
+ *
11
+ * - `signal?: AbortSignal` — per-query cancellation. The runtime returns
12
+ * a `RUNTIME.ABORTED` envelope when the signal aborts; codec authors
13
+ * who forward `signal` to their underlying SDK get true cancellation
14
+ * of in-flight network calls.
15
+ *
16
+ * Family layers extend this base with their own shape-of-call metadata:
17
+ * the SQL family adds `column?: SqlColumnRef` via `SqlCodecCallContext`
18
+ * (see `@prisma-next/sql-relational-core`). Mongo currently uses this
19
+ * framework type unchanged. Column metadata is intentionally **not** on
20
+ * the framework type — it is a SQL-family concept rooted in SQL's
21
+ * `(table, column)` addressing model and would not generalise to other
22
+ * families.
23
+ *
24
+ * The interface is named explicitly (not inlined) so future framework
25
+ * fields and family extensions can land additively without breaking
26
+ * codec author signatures.
27
+ */
28
+ export interface CodecCallContext {
29
+ readonly signal?: AbortSignal;
30
+ }
31
+
5
32
  /**
6
33
  * A codec is the contract between an application value and its on-wire and
7
34
  * on-contract-disk representations.
@@ -43,10 +70,10 @@ export interface Codec<
43
70
  readonly targetTypes: readonly string[];
44
71
  /** Semantic traits for operator gating (e.g. equality, order, numeric). */
45
72
  readonly traits?: TTraits;
46
- /** Converts a JS value to the wire format expected by the database driver. Always Promise-returning at the boundary. */
47
- encode(value: TInput): Promise<TWire>;
48
- /** Converts a wire value from the database driver into the JS application type. Always Promise-returning at the boundary. */
49
- decode(wire: TWire): Promise<TInput>;
73
+ /** Converts a JS value to the wire format expected by the database driver. Always Promise-returning at the boundary. The {@link CodecCallContext} is supplied by the runtime on every call (allocated once per `runtime.execute()`); family layers may narrow the ctx to extend it (e.g. SQL adds `column`). Author-side single-arg `(value) => …` functions remain legal via TypeScript's bivariance for trailing parameters. */
74
+ encode(value: TInput, ctx: CodecCallContext): Promise<TWire>;
75
+ /** Converts a wire value from the database driver into the JS application type. Always Promise-returning at the boundary. The {@link CodecCallContext} is supplied by the runtime on every call (allocated once per `runtime.execute()`); family layers may narrow the ctx to extend it (e.g. SQL adds `column`). Author-side single-arg `(wire) => …` functions remain legal via TypeScript's bivariance for trailing parameters. */
76
+ decode(wire: TWire, ctx: CodecCallContext): Promise<TInput>;
50
77
  /** Converts a JS value to a JSON-safe representation for contract serialization. Synchronous; called during contract emission. */
51
78
  encodeJson(value: TInput): JsonValue;
52
79
  /** Converts a JSON representation back to the JS input type. Synchronous; called during contract loading via `validateContract`. */
@@ -1 +0,0 @@
1
- {"version":3,"file":"codec-types-DQ1Agjom.d.mts","names":[],"sources":["../src/codec-types.ts"],"sourcesContent":[],"mappings":";;;KAEY,UAAA;;AAAZ;AA+BA;;;;;;;;;;;;;;;;;AAwBA;AAIA;;;;;;;;;UA5BiB,2DAEU,wBAAwB;;eAKpC;;;;oBAIK;;gBAEJ,SAAS,QAAQ;;eAElB,QAAQ,QAAQ;;oBAEX,SAAS;;mBAEV,YAAY;;gCAEC;;UAGf,WAAA;mBACE;;cAGN,kBAAkB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"emission-types-BPAALJbF.d.mts","names":[],"sources":["../src/emission-types.ts"],"sourcesContent":[],"mappings":";;;;UAGiB,4BAAA;uCACsB,cAAc;AADrD;AAIiB,UAAA,iBAAA,CAAiB;EACU,SAAA,gBAAA,CAAA,EAAd,aAAc,CAAA,eAAA,CAAA;EAAd,SAAA,oBAAA,CAAA,EACI,aADJ,CACkB,eADlB,CAAA;EACkB,SAAA,YAAA,CAAA,EACtB,aADsB,CAAA,MAAA,CAAA;;AACtB,UAGT,WAAA,CAHS;EAAa,SAAA,EAAA,EAAA,MAAA;EAGtB,mBAAW,CAAA,QAAA,EAGI,QAHJ,EAAA,mBAAA,EAAA,MAAA,CAAA,EAAA,MAAA;EAGI,wBAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,EAEqB,aAFrB,CAAA,EAAA,MAAA;EAEqB,gBAAA,EAAA,EAAA,MAAA,EAAA;EAIpB,oBAAA,CAAA,OAAA,CAAA,EAAA,4BAAA,CAAA,EAAA,MAAA;EAA4B,qBAAA,EAAA,EAAA,MAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"framework-authoring-D1-JZ37B.d.mts","names":[],"sources":["../src/framework-authoring.ts"],"sourcesContent":[],"mappings":";KAEY,eAAA;EAAA,SAAA,IAAA,EAAA,KAAe;EAOf,SAAA,KAAA,EAAA,MAAA;EAKR,SAAA,IAAA,CAAA,EAAA,SAAA,MAAA,EAAA;EACS,SAAA,OAAA,CAAA,EATQ,sBASR;CACiB;AAAsB,KAPxC,sBAAA,GAOwC,MAAA,GAAA,MAAA,GAAA,OAAA,GAAA,IAAA,GAFhD,eAEgD,GAAA,SADvC,sBACuC,EAAA,GAAA;EAE1C,UAAA,GAAA,EAAA,MAAA,CAAA,EAFoB,sBAEa;AAK3C,CAAA;UALU,iCAAA,CAKgC;EAYE,SAAA,IAAA,CAAA,EAAA,MAAA;EAAf,SAAA,QAAA,CAAA,EAAA,OAAA;;AAIZ,KAhBL,2BAAA,GAA8B,iCAgB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framework-components.ts"],"sourcesContent":["import type { Codec } from './codec-types';\nimport type { AuthoringContributions } from './framework-authoring';\nimport type { ControlMutationDefaults } from './mutation-default-types';\nimport type { TypesImportSpec } from './types-import-spec';\n\n/**\n * Declarative fields that describe component metadata.\n */\nexport interface ComponentMetadata {\n /** Component version (semver) */\n readonly version: string;\n\n /**\n * Capabilities this component provides.\n *\n * For adapters, capabilities must be declared on the adapter descriptor (so they are emitted into\n * the contract) and also exposed in runtime adapter code (e.g. `adapter.profile.capabilities`);\n * keep these declarations in sync. Targets are identifiers/descriptors and typically do not\n * declare capabilities.\n */\n readonly capabilities?: Record<string, unknown>;\n\n /** Type imports for contract.d.ts generation */\n readonly types?: {\n readonly codecTypes?: {\n /**\n * Base codec types import spec.\n * Optional: adapters typically provide this, extensions usually don't.\n */\n readonly import?: TypesImportSpec;\n /**\n * Additional type-only imports for parameterized codec branded types.\n *\n * These imports are included in generated `contract.d.ts` but are NOT treated as\n * codec type maps (i.e., they should not be intersected into `export type CodecTypes = ...`).\n *\n * Example: `Vector<N>` for pgvector codecs that emit `Vector<1536>`\n */\n readonly typeImports?: ReadonlyArray<TypesImportSpec>;\n /**\n * Optional control-plane hooks keyed by codecId.\n * Used by family-specific planners/verifiers to handle storage types.\n */\n readonly controlPlaneHooks?: Record<string, unknown>;\n /**\n * Codec instances contributed by this component.\n * Used to build a CodecLookup for codec-dispatched type rendering during emission.\n */\n readonly codecInstances?: ReadonlyArray<Codec>;\n };\n readonly operationTypes?: { readonly import: TypesImportSpec };\n readonly queryOperationTypes?: { readonly import: TypesImportSpec };\n readonly storage?: ReadonlyArray<{\n readonly typeId: string;\n readonly familyId: string;\n readonly targetId: string;\n readonly nativeType?: string;\n }>;\n };\n\n /**\n * Optional pure-data authoring contributions exposed by this component.\n *\n * These contributions are safe to include on pack refs and descriptors because\n * they contain only declarative metadata. Higher-level authoring packages may\n * project them into concrete helper functions for TS-first workflows.\n */\n readonly authoring?: AuthoringContributions;\n\n /**\n * Scalar type name to codec ID mapping contributed by this component.\n * Assembled by `createControlStack` with duplicate detection.\n */\n readonly scalarTypeDescriptors?: ReadonlyMap<string, string>;\n\n /**\n * Mutation default function handlers and generator descriptors contributed\n * by this component. Assembled by `createControlStack` with duplicate detection.\n */\n readonly controlMutationDefaults?: ControlMutationDefaults;\n}\n\n/**\n * Base descriptor for any framework component.\n *\n * All component descriptors share these fundamental properties that identify\n * the component and provide its metadata. This interface is extended by\n * specific descriptor types (FamilyDescriptor, TargetDescriptor, etc.).\n *\n * @template Kind - Discriminator literal identifying the component type.\n * Built-in kinds are 'family', 'target', 'adapter', 'driver', 'extension',\n * but the type accepts any string to allow ecosystem extensions.\n *\n * @example\n * ```ts\n * // All descriptors have these properties\n * descriptor.kind // The Kind type parameter (e.g., 'family', 'target', or custom kinds)\n * descriptor.id // Unique string identifier (e.g., 'sql', 'postgres')\n * descriptor.version // Component version (semver)\n * ```\n */\nexport interface ComponentDescriptor<Kind extends string> extends ComponentMetadata {\n /** Discriminator identifying the component type */\n readonly kind: Kind;\n\n /** Unique identifier for this component (e.g., 'sql', 'postgres', 'pgvector') */\n readonly id: string;\n}\n\nexport interface ContractComponentRequirementsCheckInput {\n readonly contract: {\n readonly target: string;\n readonly targetFamily?: string | undefined;\n readonly extensionPacks?: Record<string, unknown> | undefined;\n };\n readonly expectedTargetFamily?: string | undefined;\n readonly expectedTargetId?: string | undefined;\n readonly providedComponentIds: Iterable<string>;\n}\n\nexport interface ContractComponentRequirementsCheckResult {\n readonly familyMismatch?: { readonly expected: string; readonly actual: string } | undefined;\n readonly targetMismatch?: { readonly expected: string; readonly actual: string } | undefined;\n readonly missingExtensionPackIds: readonly string[];\n}\n\nexport function checkContractComponentRequirements(\n input: ContractComponentRequirementsCheckInput,\n): ContractComponentRequirementsCheckResult {\n const providedIds = new Set<string>();\n for (const id of input.providedComponentIds) {\n providedIds.add(id);\n }\n\n const requiredExtensionPackIds = input.contract.extensionPacks\n ? Object.keys(input.contract.extensionPacks)\n : [];\n const missingExtensionPackIds = requiredExtensionPackIds.filter((id) => !providedIds.has(id));\n\n const expectedTargetFamily = input.expectedTargetFamily;\n const contractTargetFamily = input.contract.targetFamily;\n const familyMismatch =\n expectedTargetFamily !== undefined &&\n contractTargetFamily !== undefined &&\n contractTargetFamily !== expectedTargetFamily\n ? { expected: expectedTargetFamily, actual: contractTargetFamily }\n : undefined;\n\n const expectedTargetId = input.expectedTargetId;\n const contractTargetId = input.contract.target;\n const targetMismatch =\n expectedTargetId !== undefined && contractTargetId !== expectedTargetId\n ? { expected: expectedTargetId, actual: contractTargetId }\n : undefined;\n\n return {\n ...(familyMismatch ? { familyMismatch } : {}),\n ...(targetMismatch ? { targetMismatch } : {}),\n missingExtensionPackIds,\n };\n}\n\n/**\n * Descriptor for a family component.\n *\n * A \"family\" represents a category of data sources with shared semantics\n * (e.g., SQL databases, document stores). Families define:\n * - Query semantics and operations (SELECT, INSERT, find, aggregate, etc.)\n * - Contract structure (tables vs collections, columns vs fields)\n * - Type system and codecs\n *\n * Families are the top-level grouping. Each family contains multiple targets\n * (e.g., SQL family contains Postgres, MySQL, SQLite targets).\n *\n * Extended by plane-specific descriptors:\n * - `ControlFamilyDescriptor` - adds `emission` for CLI/tooling operations\n * - `RuntimeFamilyDescriptor` - adds runtime-specific factory methods\n *\n * @template TFamilyId - Literal type for the family identifier (e.g., 'sql', 'document')\n *\n * @example\n * ```ts\n * import sql from '@prisma-next/family-sql/control';\n *\n * sql.kind // 'family'\n * sql.familyId // 'sql'\n * sql.id // 'sql'\n * ```\n */\nexport interface FamilyDescriptor<TFamilyId extends string> extends ComponentDescriptor<'family'> {\n /** The family identifier (e.g., 'sql', 'document') */\n readonly familyId: TFamilyId;\n}\n\n/**\n * Descriptor for a target component.\n *\n * A \"target\" represents a specific database or data store within a family\n * (e.g., Postgres, MySQL, MongoDB). Targets define:\n * - Native type mappings (e.g., Postgres int4 → TypeScript number)\n * - Target-specific capabilities (e.g., RETURNING, LATERAL joins)\n *\n * Targets are bound to a family and provide the target-specific implementation\n * details that adapters and drivers use.\n *\n * Extended by plane-specific descriptors:\n * - `ControlTargetDescriptor` - adds optional `migrations` capability\n * - `RuntimeTargetDescriptor` - adds runtime factory method\n *\n * @template TFamilyId - Literal type for the family identifier\n * @template TTargetId - Literal type for the target identifier (e.g., 'postgres', 'mysql')\n *\n * @example\n * ```ts\n * import postgres from '@prisma-next/target-postgres/control';\n *\n * postgres.kind // 'target'\n * postgres.familyId // 'sql'\n * postgres.targetId // 'postgres'\n * ```\n */\nexport interface TargetDescriptor<TFamilyId extends string, TTargetId extends string>\n extends ComponentDescriptor<'target'> {\n /** The family this target belongs to */\n readonly familyId: TFamilyId;\n\n /** The target identifier (e.g., 'postgres', 'mysql', 'mongodb') */\n readonly targetId: TTargetId;\n}\n\n/**\n * Base shape for any pack reference.\n * Pack refs are pure JSON-friendly objects safe to import in authoring flows.\n */\nexport interface PackRefBase<Kind extends string, TFamilyId extends string>\n extends ComponentMetadata {\n readonly kind: Kind;\n readonly id: string;\n readonly familyId: TFamilyId;\n readonly targetId?: string;\n readonly authoring?: AuthoringContributions;\n}\n\nexport type FamilyPackRef<TFamilyId extends string = string> = PackRefBase<'family', TFamilyId>;\n\nexport type TargetPackRef<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n> = PackRefBase<'target', TFamilyId> & {\n readonly targetId: TTargetId;\n};\n\nexport type AdapterPackRef<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n> = PackRefBase<'adapter', TFamilyId> & {\n readonly targetId: TTargetId;\n};\n\nexport type ExtensionPackRef<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n> = PackRefBase<'extension', TFamilyId> & {\n readonly targetId: TTargetId;\n};\n\nexport type DriverPackRef<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n> = PackRefBase<'driver', TFamilyId> & {\n readonly targetId: TTargetId;\n};\n\n/**\n * Descriptor for an adapter component.\n *\n * An \"adapter\" provides the protocol and dialect implementation for a target.\n * Adapters handle:\n * - SQL/query generation (lowering AST to target-specific syntax)\n * - Codec registration (encoding/decoding between JS and wire types)\n * - Type mappings and coercions\n *\n * Adapters are bound to a specific family+target combination and work with\n * any compatible driver for that target.\n *\n * Extended by plane-specific descriptors:\n * - `ControlAdapterDescriptor` - control-plane factory\n * - `RuntimeAdapterDescriptor` - runtime factory\n *\n * @template TFamilyId - Literal type for the family identifier\n * @template TTargetId - Literal type for the target identifier\n *\n * @example\n * ```ts\n * import postgresAdapter from '@prisma-next/adapter-postgres/control';\n *\n * postgresAdapter.kind // 'adapter'\n * postgresAdapter.familyId // 'sql'\n * postgresAdapter.targetId // 'postgres'\n * ```\n */\nexport interface AdapterDescriptor<TFamilyId extends string, TTargetId extends string>\n extends ComponentDescriptor<'adapter'> {\n /** The family this adapter belongs to */\n readonly familyId: TFamilyId;\n\n /** The target this adapter is designed for */\n readonly targetId: TTargetId;\n}\n\n/**\n * Descriptor for a driver component.\n *\n * A \"driver\" provides the connection and execution layer for a target.\n * Drivers handle:\n * - Connection management (pooling, timeouts, retries)\n * - Query execution (sending SQL/commands, receiving results)\n * - Transaction management\n * - Wire protocol communication\n *\n * Drivers are bound to a specific family+target and work with any compatible\n * adapter. Multiple drivers can exist for the same target (e.g., node-postgres\n * vs postgres.js for Postgres).\n *\n * Extended by plane-specific descriptors:\n * - `ControlDriverDescriptor` - creates driver from connection URL\n * - `RuntimeDriverDescriptor` - creates driver with runtime options\n *\n * @template TFamilyId - Literal type for the family identifier\n * @template TTargetId - Literal type for the target identifier\n *\n * @example\n * ```ts\n * import postgresDriver from '@prisma-next/driver-postgres/control';\n *\n * postgresDriver.kind // 'driver'\n * postgresDriver.familyId // 'sql'\n * postgresDriver.targetId // 'postgres'\n * ```\n */\nexport interface DriverDescriptor<TFamilyId extends string, TTargetId extends string>\n extends ComponentDescriptor<'driver'> {\n /** The family this driver belongs to */\n readonly familyId: TFamilyId;\n\n /** The target this driver connects to */\n readonly targetId: TTargetId;\n}\n\n/**\n * Descriptor for an extension component.\n *\n * An \"extension\" adds optional capabilities to a target. Extensions can provide:\n * - Additional operations (e.g., vector similarity search with pgvector)\n * - Custom types and codecs (e.g., vector type)\n * - Extended query capabilities\n *\n * Extensions are bound to a specific family+target and are registered in the\n * config alongside the core components. Multiple extensions can be used together.\n *\n * Extended by plane-specific descriptors:\n * - `ControlExtensionDescriptor` - control-plane extension factory\n * - `RuntimeExtensionDescriptor` - runtime extension factory\n *\n * @template TFamilyId - Literal type for the family identifier\n * @template TTargetId - Literal type for the target identifier\n *\n * @example\n * ```ts\n * import pgvector from '@prisma-next/extension-pgvector/control';\n *\n * pgvector.kind // 'extension'\n * pgvector.familyId // 'sql'\n * pgvector.targetId // 'postgres'\n * ```\n */\nexport interface ExtensionDescriptor<TFamilyId extends string, TTargetId extends string>\n extends ComponentDescriptor<'extension'> {\n /** The family this extension belongs to */\n readonly familyId: TFamilyId;\n\n /** The target this extension is designed for */\n readonly targetId: TTargetId;\n}\n\n/** Components bound to a specific family+target combination. */\nexport type TargetBoundComponentDescriptor<TFamilyId extends string, TTargetId extends string> =\n | TargetDescriptor<TFamilyId, TTargetId>\n | AdapterDescriptor<TFamilyId, TTargetId>\n | DriverDescriptor<TFamilyId, TTargetId>\n | ExtensionDescriptor<TFamilyId, TTargetId>;\n\nexport interface FamilyInstance<TFamilyId extends string> {\n readonly familyId: TFamilyId;\n}\n\nexport interface TargetInstance<TFamilyId extends string, TTargetId extends string> {\n readonly familyId: TFamilyId;\n readonly targetId: TTargetId;\n}\n\nexport interface AdapterInstance<TFamilyId extends string, TTargetId extends string> {\n readonly familyId: TFamilyId;\n readonly targetId: TTargetId;\n}\n\nexport interface DriverInstance<TFamilyId extends string, TTargetId extends string> {\n readonly familyId: TFamilyId;\n readonly targetId: TTargetId;\n}\n\nexport interface ExtensionInstance<TFamilyId extends string, TTargetId extends string> {\n readonly familyId: TFamilyId;\n readonly targetId: TTargetId;\n}\n"],"mappings":";AA8HA,SAAgB,mCACd,OAC0C;CAC1C,MAAM,8BAAc,IAAI,KAAa;AACrC,MAAK,MAAM,MAAM,MAAM,qBACrB,aAAY,IAAI,GAAG;CAMrB,MAAM,2BAH2B,MAAM,SAAS,iBAC5C,OAAO,KAAK,MAAM,SAAS,eAAe,GAC1C,EAAE,EACmD,QAAQ,OAAO,CAAC,YAAY,IAAI,GAAG,CAAC;CAE7F,MAAM,uBAAuB,MAAM;CACnC,MAAM,uBAAuB,MAAM,SAAS;CAC5C,MAAM,iBACJ,yBAAyB,UACzB,yBAAyB,UACzB,yBAAyB,uBACrB;EAAE,UAAU;EAAsB,QAAQ;EAAsB,GAChE;CAEN,MAAM,mBAAmB,MAAM;CAC/B,MAAM,mBAAmB,MAAM,SAAS;CACxC,MAAM,iBACJ,qBAAqB,UAAa,qBAAqB,mBACnD;EAAE,UAAU;EAAkB,QAAQ;EAAkB,GACxD;AAEN,QAAO;EACL,GAAI,iBAAiB,EAAE,gBAAgB,GAAG,EAAE;EAC5C,GAAI,iBAAiB,EAAE,gBAAgB,GAAG,EAAE;EAC5C;EACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"framework-components-DFZMi2h7.d.mts","names":[],"sources":["../src/mutation-default-types.ts","../src/framework-components.ts"],"sourcesContent":[],"mappings":";;;;;;UAEU,cAAA;;;;;AAAA,UAMO,UAAA,CANO;EAMP,SAAA,KAAU,EACT,cAAA;EAID,SAAA,GAAA,EAHD,cAGiB;;AAKN,UALV,gBAAA,CAKU;EAAT,SAAA,IAAA,EAAA,MAAA;EAAQ,SAAA,OAAA,EAAA,MAAA;EAGhB,SAAA,QAAA,CAAA,EAAA,MAAuB;EAKhB,SAAA,IAAA,CAAA,EATC,UASD;EAOA,SAAA,IAAA,CAAA,EAfC,QAeD,CAfU,MAeV,CAAA,MAA8B,EAAA,OAAA,CAAA,CAAA;AAO/C;AAIA,UAvBU,uBAAA,CAuBsB;EAIpB,SAAA,GAAA,EAAA,MAAA;EACK,SAAA,IAAA,EA1BA,UA0BA;;AAEX,UAzBW,yBAAA,CAyBX;EAAoB,SAAA,I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;;;;;;;;;;;;;;;;;;;;;;UA6Dc,mDAAmD;;qBAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BJ,6EACP;;qBAEW;;qBAGA;;;;;;UAOJ,mEACP;iBACO;;qBAEI;;uBAEE;;KAGX,mDAAmD,sBAAsB;KAEzE,sFAGR,sBAAsB;qBACL;;KAGT,uFAGR,uBAAuB;qBACN;;KAGT,yFAGR,yBAAyB;qBACR;;KAGT,sFAGR,sBAAsB;qBACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA+BJ,8EACP;;qBAEW;;qBAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAiCJ,6EACP;;qBAEW;;qBAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BJ,gFACP;;qBAEW;;qBAGA;;;KAIT,qFACR,iBAAiB,WAAW,aAC5B,kBAAkB,WAAW,aAC7B,iBAAiB,WAAW,aAC5B,oBAAoB,WAAW;UAElB;qBACI;;UAGJ;qBACI;qBACA;;UAGJ;qBACI;qBACA;;UAGJ;qBACI;qBACA;;UAGJ;qBACI;qBACA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-import-spec-C4sc7wbb.d.mts","names":[],"sources":["../src/types-import-spec.ts"],"sourcesContent":[],"mappings":";;AAIA;;;UAAiB,eAAA"}
@@ -1,34 +0,0 @@
1
- import type { ControlTargetDescriptor } from './control-descriptors';
2
- import type { ControlFamilyInstance } from './control-instances';
3
- import type { TargetMigrationsCapability } from './control-migration-types';
4
- import type { CoreSchemaView } from './control-schema-view';
5
-
6
- export interface MigratableTargetDescriptor<
7
- TFamilyId extends string,
8
- TTargetId extends string,
9
- TFamilyInstance extends ControlFamilyInstance<TFamilyId, unknown> = ControlFamilyInstance<
10
- TFamilyId,
11
- unknown
12
- >,
13
- > extends ControlTargetDescriptor<TFamilyId, TTargetId> {
14
- readonly migrations: TargetMigrationsCapability<TFamilyId, TTargetId, TFamilyInstance>;
15
- }
16
-
17
- export function hasMigrations<TFamilyId extends string, TTargetId extends string>(
18
- target: ControlTargetDescriptor<TFamilyId, TTargetId>,
19
- ): target is MigratableTargetDescriptor<TFamilyId, TTargetId> {
20
- return 'migrations' in target && !!(target as Record<string, unknown>)['migrations'];
21
- }
22
-
23
- export interface SchemaViewCapable<TSchemaIR = unknown> {
24
- toSchemaView(schema: TSchemaIR): CoreSchemaView;
25
- }
26
-
27
- export function hasSchemaView<TFamilyId extends string, TSchemaIR>(
28
- instance: ControlFamilyInstance<TFamilyId, TSchemaIR>,
29
- ): instance is ControlFamilyInstance<TFamilyId, TSchemaIR> & SchemaViewCapable<TSchemaIR> {
30
- return (
31
- 'toSchemaView' in instance &&
32
- typeof (instance as Record<string, unknown>)['toSchemaView'] === 'function'
33
- );
34
- }
File without changes