@prisma-next/framework-components 0.4.0-dev.2 → 0.4.0-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import { S as checkContractComponentRequirements, _ as PackRefBase, a as ComponentMetadata, b as TargetInstance, c as DriverDescriptor, d as ExtensionDescriptor, f as ExtensionInstance, g as FamilyPackRef, h as FamilyInstance, i as ComponentDescriptor, l as DriverInstance, m as FamilyDescriptor, n as AdapterInstance, o as ContractComponentRequirementsCheckInput, p as ExtensionPackRef, r as AdapterPackRef, s as ContractComponentRequirementsCheckResult, t as AdapterDescriptor, u as DriverPackRef, v as TargetBoundComponentDescriptor, x as TargetPackRef, y as TargetDescriptor } from "./framework-components-DoWmh6GH.mjs";
1
+ import { S as checkContractComponentRequirements, _ as PackRefBase, a as ComponentMetadata, b as TargetInstance, c as DriverDescriptor, d as ExtensionDescriptor, f as ExtensionInstance, g as FamilyPackRef, h as FamilyInstance, i as ComponentDescriptor, l as DriverInstance, m as FamilyDescriptor, n as AdapterInstance, o as ContractComponentRequirementsCheckInput, p as ExtensionPackRef, r as AdapterPackRef, s as ContractComponentRequirementsCheckResult, t as AdapterDescriptor, u as DriverPackRef, v as TargetBoundComponentDescriptor, x as TargetPackRef, y as TargetDescriptor } from "./framework-components-EJXe-pum.mjs";
2
2
  export { type AdapterDescriptor, type AdapterInstance, type AdapterPackRef, type ComponentDescriptor, type ComponentMetadata, type ContractComponentRequirementsCheckInput, type ContractComponentRequirementsCheckResult, type DriverDescriptor, type DriverInstance, type DriverPackRef, type ExtensionDescriptor, type ExtensionInstance, type ExtensionPackRef, type FamilyDescriptor, type FamilyInstance, type FamilyPackRef, type PackRefBase, type TargetBoundComponentDescriptor, type TargetDescriptor, type TargetInstance, type TargetPackRef, checkContractComponentRequirements };
@@ -1,8 +1,8 @@
1
1
  import { a as AuthoringFieldNamespace, d as AuthoringTypeNamespace, i as AuthoringContributions } from "./framework-authoring-D1-JZ37B.mjs";
2
2
  import { n as CodecLookup } from "./codec-types-B58nCJiu.mjs";
3
- import { t as TypesImportSpec } from "./types-import-spec-Ddp4fNmt.mjs";
4
- import { a as ComponentMetadata, b as TargetInstance, c as DriverDescriptor, d as ExtensionDescriptor, f as ExtensionInstance, h as FamilyInstance, l as DriverInstance, m as FamilyDescriptor, n as AdapterInstance, t as AdapterDescriptor, v as TargetBoundComponentDescriptor, y as TargetDescriptor } from "./framework-components-DoWmh6GH.mjs";
5
- import { t as EmissionSpi } from "./emission-types-B3UblxTu.mjs";
3
+ import { A as LoweredDefaultResult, C as ControlMutationDefaultEntry, D as DefaultFunctionLoweringHandler, E as DefaultFunctionLoweringContext, F as SourceSpan, M as MutationDefaultGeneratorDescriptor, N as ParsedDefaultFunctionCall, O as DefaultFunctionRegistry, P as SourceDiagnostic, T as ControlMutationDefaults, a as ComponentMetadata, b as TargetInstance, c as DriverDescriptor, d as ExtensionDescriptor, f as ExtensionInstance, h as FamilyInstance, j as LoweredDefaultValue, k as DefaultFunctionRegistryEntry, l as DriverInstance, m as FamilyDescriptor, n as AdapterInstance, t as AdapterDescriptor, v as TargetBoundComponentDescriptor, w as ControlMutationDefaultRegistry, y as TargetDescriptor } from "./framework-components-EJXe-pum.mjs";
4
+ import { t as TypesImportSpec } from "./types-import-spec-C4sc7wbb.mjs";
5
+ import { t as EmissionSpi } from "./emission-types-BPAALJbF.mjs";
6
6
  import { Contract, ContractMarkerRecord } from "@prisma-next/contract/types";
7
7
  import { Result } from "@prisma-next/utils/result";
8
8
 
@@ -213,6 +213,8 @@ interface ControlStack<TFamilyId extends string = string, TTargetId extends stri
213
213
  readonly extensionIds: ReadonlyArray<string>;
214
214
  readonly codecLookup: CodecLookup;
215
215
  readonly authoringContributions: AssembledAuthoringContributions;
216
+ readonly scalarTypeDescriptors: ReadonlyMap<string, string>;
217
+ readonly controlMutationDefaults: ControlMutationDefaults;
216
218
  }
217
219
  interface CreateControlStackInput<TFamilyId extends string = string, TTargetId extends string = string> {
218
220
  readonly family: ControlFamilyDescriptor<TFamilyId>;
@@ -243,6 +245,12 @@ declare function extractComponentIds(family: {
243
245
  declare function assembleAuthoringContributions(descriptors: ReadonlyArray<{
244
246
  readonly authoring?: AuthoringContributions;
245
247
  }>): AssembledAuthoringContributions;
248
+ declare function assembleScalarTypeDescriptors(descriptors: ReadonlyArray<Pick<ComponentMetadata, 'scalarTypeDescriptors'> & {
249
+ readonly id?: string;
250
+ }>): ReadonlyMap<string, string>;
251
+ declare function assembleControlMutationDefaults(descriptors: ReadonlyArray<Pick<ComponentMetadata, 'controlMutationDefaults'> & {
252
+ readonly id?: string;
253
+ }>): ControlMutationDefaults;
246
254
  declare function extractCodecLookup(descriptors: ReadonlyArray<Pick<ComponentMetadata & {
247
255
  id?: string;
248
256
  }, 'types' | 'id'>>): CodecLookup;
@@ -598,5 +606,5 @@ interface SchemaViewCapable<TSchemaIR = unknown> {
598
606
  }
599
607
  declare function hasSchemaView<TFamilyId extends string, TSchemaIR>(instance: ControlFamilyInstance<TFamilyId, TSchemaIR>): instance is ControlFamilyInstance<TFamilyId, TSchemaIR> & SchemaViewCapable<TSchemaIR>;
600
608
  //#endregion
601
- export { type AssembledAuthoringContributions, type BaseSchemaIssue, type ControlAdapterDescriptor, type ControlAdapterInstance, type ControlDriverDescriptor, type ControlDriverInstance, type ControlExtensionDescriptor, type ControlExtensionInstance, type ControlFamilyDescriptor, type ControlFamilyInstance, type ControlStack, type ControlTargetDescriptor, type ControlTargetInstance, type CoreSchemaView, type CreateControlStackInput, type DataTransformOperation, type EmitContractResult, type EnumValuesChangedIssue, type IntrospectSchemaResult, type MigratableTargetDescriptor, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerFailureResult, type MigrationPlannerResult, type MigrationPlannerSuccessResult, type MigrationRunner, type MigrationRunnerExecutionChecks, type MigrationRunnerFailure, type MigrationRunnerResult, type MigrationRunnerSuccessValue, type OperationContext, type OperationDescriptor, type SchemaIssue, type SchemaNodeKind, SchemaTreeNode, type SchemaTreeNodeOptions, type SchemaTreeVisitor, type SchemaVerificationNode, type SchemaViewCapable, type SerializedQueryPlan, type SignDatabaseResult, type TargetMigrationsCapability, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_SCHEMA_FAILURE, VERIFY_CODE_TARGET_MISMATCH, type VerifyDatabaseResult, type VerifyDatabaseSchemaResult, assembleAuthoringContributions, assertUniqueCodecOwner, createControlStack, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractOperationTypeImports, extractQueryOperationTypeImports, hasMigrations, hasSchemaView };
609
+ export { type AssembledAuthoringContributions, type BaseSchemaIssue, type ControlAdapterDescriptor, type ControlAdapterInstance, type ControlDriverDescriptor, type ControlDriverInstance, type ControlExtensionDescriptor, type ControlExtensionInstance, type ControlFamilyDescriptor, type ControlFamilyInstance, type ControlMutationDefaultEntry, type ControlMutationDefaultRegistry, type ControlMutationDefaults, type ControlStack, type ControlTargetDescriptor, type ControlTargetInstance, type CoreSchemaView, type CreateControlStackInput, type DataTransformOperation, type DefaultFunctionLoweringContext, type DefaultFunctionLoweringHandler, type DefaultFunctionRegistry, type DefaultFunctionRegistryEntry, type EmitContractResult, type EnumValuesChangedIssue, type IntrospectSchemaResult, type LoweredDefaultResult, type LoweredDefaultValue, type MigratableTargetDescriptor, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerFailureResult, type MigrationPlannerResult, type MigrationPlannerSuccessResult, type MigrationRunner, type MigrationRunnerExecutionChecks, type MigrationRunnerFailure, type MigrationRunnerResult, type MigrationRunnerSuccessValue, type MutationDefaultGeneratorDescriptor, type OperationContext, type OperationDescriptor, type ParsedDefaultFunctionCall, type SchemaIssue, type SchemaNodeKind, SchemaTreeNode, type SchemaTreeNodeOptions, type SchemaTreeVisitor, type SchemaVerificationNode, type SchemaViewCapable, type SerializedQueryPlan, type SignDatabaseResult, type SourceDiagnostic, type SourceSpan, type TargetMigrationsCapability, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_SCHEMA_FAILURE, VERIFY_CODE_TARGET_MISMATCH, type VerifyDatabaseResult, type VerifyDatabaseSchemaResult, assembleAuthoringContributions, assembleControlMutationDefaults, assembleScalarTypeDescriptors, assertUniqueCodecOwner, createControlStack, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractOperationTypeImports, extractQueryOperationTypeImports, hasMigrations, hasSchemaView };
602
610
  //# sourceMappingURL=control.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"control.d.mts","names":[],"sources":["../src/control-result-types.ts","../src/control-instances.ts","../src/control-stack.ts","../src/control-descriptors.ts","../src/control-migration-types.ts","../src/control-schema-view.ts","../src/control-capabilities.ts"],"sourcesContent":[],"mappings":";;;;;;;;;cAAa,0BAAA;cACA,yBAAA;cACA,2BAAA;cACA,0BAAA;UAEI,gBAAA;;;kBAGC,SAAS;;AARd,UAWI,oBAAA,CAXsB;EAC1B,SAAA,EAAA,EAAA,OAAA;EACA,SAAA,IAAA,CAAA,EAAA,MAAA;EACA,SAAA,OAAA,EAAA,MAAA;EAEI,SAAA,QAAA,EAAgB;IAMhB,SAAA,WAAoB,EAAA,MAAA;IA2BpB,SAAA,WAAe,CAAA,EAAA,MAAA;EAiCf,CAAA;EAQL,SAAA,MAAW,CAAA,EAAA;IAEN,SAAA,WAAA,CAAsB,EAAA,MAAA;IAYtB,SAAA,WAAA,CAAA,EAAA,MAA0B;EAgC1B,CAAA;EAQA,SAAA,MAAA,EAAA;IAiBA,SAAA,QAAkB,EAAA,MAAA;;;;ECvIlB,SAAA,oBAAqB,CAAA,EAAA,OAAA;EACb,SAAA,IAAA,CAAA,EAAA;IACkB,SAAA,UAAA,CAAA,EAAA,MAAA;IAGA,SAAA,YAAA,EAAA,MAAA;EAAt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tB,2BAA2B,WAAW,WAAW;;iBAGxD,0EACN,wBAAwB,WAAW,uBAChC,2BAA2B,WAAW;UAIlC;ENtBJ,YAAA,CAAA,MAAA,EMuBU,SNvBgB,CAAA,EMuBJ,cNvBI;AACvC;AACa,iBMwBG,aNxBwB,CAAA,kBAAA,MAAA,EAAA,SAAA,CAAA,CAAA,QAAA,EMyB5B,qBNzB4B,CMyBN,SNzBM,EMyBK,SNzBL,CAAA,CAAA,EAAA,QAAA,IM0BzB,qBN1ByB,CM0BH,SN1BG,EM0BQ,SN1BR,CAAA,GM0BqB,iBN1BrB,CM0BuC,SN1BvC,CAAA"}
1
+ {"version":3,"file":"control.d.mts","names":[],"sources":["../src/control-result-types.ts","../src/control-instances.ts","../src/control-stack.ts","../src/control-descriptors.ts","../src/control-migration-types.ts","../src/control-schema-view.ts","../src/control-capabilities.ts"],"sourcesContent":[],"mappings":";;;;;;;;;cAAa,0BAAA;cACA,yBAAA;cACA,2BAAA;cACA,0BAAA;UAEI,gBAAA;;;kBAGC,SAAS;;AARd,UAWI,oBAAA,CAXsB;EAC1B,SAAA,EAAA,EAAA,OAAA;EACA,SAAA,IAAA,CAAA,EAAA,MAAA;EACA,SAAA,OAAA,EAAA,MAAA;EAEI,SAAA,QAAA,EAAgB;IAMhB,SAAA,WAAoB,EAAA,MAAA;IA2BpB,SAAA,WAAe,CAAA,EAAA,MAAA;EAiCf,CAAA;EAQL,SAAA,MAAW,CAAA,EAAA;IAEN,SAAA,WAAA,CAAsB,EAAA,MAAA;IAYtB,SAAA,WAAA,CAAA,EAAA,MAA0B;EAgC1B,CAAA;EAQA,SAAA,MAAA,EAAA;IAiBA,SAAA,QAAkB,EAAA,MAAA;;;;ECvIlB,SAAA,oBAAqB,CAAA,EAAA,OAAA;EACb,SAAA,IAAA,CAAA,EAAA;IACkB,SAAA,UAAA,CAAA,EAAA,MAAA;IAGA,SAAA,YAAA,EAAA,MAAA;EAAtB,CAAA;EAKP,SAAA,OAAA,EAAA;IAAR,S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SAAA,IAAA,CAAW,EKpDL,MLoDK,CAAA,MAAG,EAAA,OAAA,CAAA;EAET,SAAA,QAAA,CAAA,EAAA,SKrDc,cL8DD,EAAA;AAG9B;AAgCiB,cK9FJ,cAAA,CL8FsB;EAQlB,SAAA,IAAA,EKrGA,cLqGsB;EAiBtB,SAAA,EAAA,EAAA,MAAA;;kBKnHC;+BACa;EJrBd,WAAA,CAAA,OAAA,EIuBM,qBJvBe;EACb,MAAA,CAAA,CAAA,CAAA,CAAA,OAAA,EI+BJ,iBJ/BI,CI+Bc,CJ/Bd,CAAA,CAAA,EI+BmB,CJ/BnB;;;;;;AAYkB,UI4B1B,cAAA,CJ5B0B;EAAtB,SAAA,IAAA,EI6BJ,cJ7BI;;;;UKvBJ,uGAGS,sBAAsB,sBAAsB,sBAClE,6BAGM,wBAAwB,WAAW;uBACtB,2BAA2B,WAAW,WAAW;;iBAGxD,0EACN,wBAAwB,WAAW,uBAChC,2BAA2B,WAAW;UAIlC;ENtBJ,YAAA,CAAA,MAAA,EMuBU,SNvBgB,CAAA,EMuBJ,cNvBI;AACvC;AACa,iBMwBG,aNxBwB,CAAA,kBAAA,MAAA,EAAA,SAAA,CAAA,CAAA,QAAA,EMyB5B,qBNzB4B,CMyBN,SNzBM,EMyBK,SNzBL,CAAA,CAAA,EAAA,QAAA,IM0BzB,qBN1ByB,CM0BH,SN1BG,EM0BQ,SN1BR,CAAA,GM0BqB,iBN1BrB,CM0BuC,SN1BvC,CAAA"}
package/dist/control.mjs CHANGED
@@ -119,6 +119,49 @@ function assembleAuthoringContributions(descriptors) {
119
119
  type
120
120
  };
121
121
  }
122
+ function assembleScalarTypeDescriptors(descriptors) {
123
+ const result = /* @__PURE__ */ new Map();
124
+ const owners = /* @__PURE__ */ new Map();
125
+ for (const descriptor of descriptors) {
126
+ const descriptorMap = descriptor.scalarTypeDescriptors;
127
+ if (!descriptorMap) continue;
128
+ const descriptorId = descriptor.id ?? "<unknown>";
129
+ for (const [typeName, codecId] of descriptorMap) {
130
+ const existingOwner = owners.get(typeName);
131
+ if (existingOwner !== void 0) throw new Error(`Duplicate scalar type descriptor "${typeName}". Descriptor "${descriptorId}" conflicts with "${existingOwner}".`);
132
+ result.set(typeName, codecId);
133
+ owners.set(typeName, descriptorId);
134
+ }
135
+ }
136
+ return result;
137
+ }
138
+ function assembleControlMutationDefaults(descriptors) {
139
+ const defaultFunctionRegistry = /* @__PURE__ */ new Map();
140
+ const functionOwners = /* @__PURE__ */ new Map();
141
+ const generatorMap = /* @__PURE__ */ new Map();
142
+ const generatorOwners = /* @__PURE__ */ new Map();
143
+ for (const descriptor of descriptors) {
144
+ const contributions = descriptor.controlMutationDefaults;
145
+ if (!contributions) continue;
146
+ const descriptorId = descriptor.id ?? "<unknown>";
147
+ for (const generatorDescriptor of contributions.generatorDescriptors) {
148
+ const existingOwner = generatorOwners.get(generatorDescriptor.id);
149
+ if (existingOwner !== void 0) throw new Error(`Duplicate mutation default generator id "${generatorDescriptor.id}". Descriptor "${descriptorId}" conflicts with "${existingOwner}".`);
150
+ generatorMap.set(generatorDescriptor.id, generatorDescriptor);
151
+ generatorOwners.set(generatorDescriptor.id, descriptorId);
152
+ }
153
+ for (const [functionName, handler] of contributions.defaultFunctionRegistry) {
154
+ const existingOwner = functionOwners.get(functionName);
155
+ if (existingOwner !== void 0) throw new Error(`Duplicate mutation default function "${functionName}". Descriptor "${descriptorId}" conflicts with "${existingOwner}".`);
156
+ defaultFunctionRegistry.set(functionName, handler);
157
+ functionOwners.set(functionName, descriptorId);
158
+ }
159
+ }
160
+ return {
161
+ defaultFunctionRegistry,
162
+ generatorDescriptors: Array.from(generatorMap.values())
163
+ };
164
+ }
122
165
  function extractCodecLookup(descriptors) {
123
166
  const byId = /* @__PURE__ */ new Map();
124
167
  const owners = /* @__PURE__ */ new Map();
@@ -148,6 +191,8 @@ function createControlStack(input) {
148
191
  ...adapter ? [adapter] : [],
149
192
  ...extensionPacks
150
193
  ];
194
+ const codecLookup = extractCodecLookup(allDescriptors);
195
+ const scalarTypeDescriptors = assembleScalarTypeDescriptors(allDescriptors);
151
196
  return {
152
197
  family,
153
198
  target,
@@ -158,11 +203,13 @@ function createControlStack(input) {
158
203
  operationTypeImports: extractOperationTypeImports(allDescriptors),
159
204
  queryOperationTypeImports: extractQueryOperationTypeImports(allDescriptors),
160
205
  extensionIds: extractComponentIds(family, target, adapter, extensionPacks),
161
- codecLookup: extractCodecLookup(allDescriptors),
162
- authoringContributions: assembleAuthoringContributions(allDescriptors)
206
+ codecLookup,
207
+ authoringContributions: assembleAuthoringContributions(allDescriptors),
208
+ scalarTypeDescriptors,
209
+ controlMutationDefaults: assembleControlMutationDefaults(allDescriptors)
163
210
  };
164
211
  }
165
212
 
166
213
  //#endregion
167
- export { SchemaTreeNode, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_SCHEMA_FAILURE, VERIFY_CODE_TARGET_MISMATCH, assembleAuthoringContributions, assertUniqueCodecOwner, createControlStack, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractOperationTypeImports, extractQueryOperationTypeImports, hasMigrations, hasSchemaView };
214
+ export { SchemaTreeNode, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_SCHEMA_FAILURE, VERIFY_CODE_TARGET_MISMATCH, assembleAuthoringContributions, assembleControlMutationDefaults, assembleScalarTypeDescriptors, assertUniqueCodecOwner, createControlStack, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractOperationTypeImports, extractQueryOperationTypeImports, hasMigrations, hasSchemaView };
168
215
  //# sourceMappingURL=control.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"control.mjs","names":["imports: TypesImportSpec[]","ids: string[]"],"sources":["../src/control-capabilities.ts","../src/control-result-types.ts","../src/control-schema-view.ts","../src/control-stack.ts"],"sourcesContent":["import type { ControlTargetDescriptor } from './control-descriptors';\nimport type { ControlFamilyInstance } from './control-instances';\nimport type { TargetMigrationsCapability } from './control-migration-types';\nimport type { CoreSchemaView } from './control-schema-view';\n\nexport interface MigratableTargetDescriptor<\n TFamilyId extends string,\n TTargetId extends string,\n TFamilyInstance extends ControlFamilyInstance<TFamilyId, unknown> = ControlFamilyInstance<\n TFamilyId,\n unknown\n >,\n> extends ControlTargetDescriptor<TFamilyId, TTargetId> {\n readonly migrations: TargetMigrationsCapability<TFamilyId, TTargetId, TFamilyInstance>;\n}\n\nexport function hasMigrations<TFamilyId extends string, TTargetId extends string>(\n target: ControlTargetDescriptor<TFamilyId, TTargetId>,\n): target is MigratableTargetDescriptor<TFamilyId, TTargetId> {\n return 'migrations' in target && !!(target as Record<string, unknown>)['migrations'];\n}\n\nexport interface SchemaViewCapable<TSchemaIR = unknown> {\n toSchemaView(schema: TSchemaIR): CoreSchemaView;\n}\n\nexport function hasSchemaView<TFamilyId extends string, TSchemaIR>(\n instance: ControlFamilyInstance<TFamilyId, TSchemaIR>,\n): instance is ControlFamilyInstance<TFamilyId, TSchemaIR> & SchemaViewCapable<TSchemaIR> {\n return (\n 'toSchemaView' in instance &&\n typeof (instance as Record<string, unknown>)['toSchemaView'] === 'function'\n );\n}\n","export const VERIFY_CODE_MARKER_MISSING = 'PN-RUN-3001';\nexport const VERIFY_CODE_HASH_MISMATCH = 'PN-RUN-3002';\nexport const VERIFY_CODE_TARGET_MISMATCH = 'PN-RUN-3003';\nexport const VERIFY_CODE_SCHEMA_FAILURE = 'PN-RUN-3010';\n\nexport interface OperationContext {\n readonly contractPath?: string;\n readonly configPath?: string;\n readonly meta?: Readonly<Record<string, unknown>>;\n}\n\nexport interface VerifyDatabaseResult {\n readonly ok: boolean;\n readonly code?: string;\n readonly summary: string;\n readonly contract: {\n readonly storageHash: string;\n readonly profileHash?: string;\n };\n readonly marker?: {\n readonly storageHash?: string;\n readonly profileHash?: string;\n };\n readonly target: {\n readonly expected: string;\n readonly actual?: string;\n };\n readonly missingCodecs?: readonly string[];\n readonly codecCoverageSkipped?: boolean;\n readonly meta?: {\n readonly configPath?: string;\n readonly contractPath: string;\n };\n readonly timings: {\n readonly total: number;\n };\n}\n\nexport interface BaseSchemaIssue {\n readonly kind:\n | 'missing_table'\n | 'missing_column'\n | 'extra_table'\n | 'extra_column'\n | 'extra_primary_key'\n | 'extra_foreign_key'\n | 'extra_unique_constraint'\n | 'extra_index'\n | 'extra_validator'\n | 'type_mismatch'\n | 'type_missing'\n | 'type_values_mismatch'\n | 'nullability_mismatch'\n | 'primary_key_mismatch'\n | 'foreign_key_mismatch'\n | 'unique_constraint_mismatch'\n | 'index_mismatch'\n | 'dependency_missing'\n | 'default_missing'\n | 'default_mismatch'\n | 'extra_default';\n readonly table?: string;\n readonly column?: string;\n readonly indexOrConstraint?: string;\n readonly typeName?: string;\n readonly dependencyId?: string;\n readonly expected?: string;\n readonly actual?: string;\n readonly message: string;\n}\n\nexport interface EnumValuesChangedIssue {\n readonly kind: 'enum_values_changed';\n readonly typeName: string;\n readonly addedValues: readonly string[];\n readonly removedValues: readonly string[];\n readonly message: string;\n}\n\nexport type SchemaIssue = BaseSchemaIssue | EnumValuesChangedIssue;\n\nexport interface SchemaVerificationNode {\n readonly status: 'pass' | 'warn' | 'fail';\n readonly kind: string;\n readonly name: string;\n readonly contractPath: string;\n readonly code: string;\n readonly message: string;\n readonly expected: unknown;\n readonly actual: unknown;\n readonly children: readonly SchemaVerificationNode[];\n}\n\nexport interface VerifyDatabaseSchemaResult {\n readonly ok: boolean;\n readonly code?: string;\n readonly summary: string;\n readonly contract: {\n readonly storageHash: string;\n readonly profileHash?: string;\n };\n readonly target: {\n readonly expected: string;\n readonly actual?: string;\n };\n readonly schema: {\n readonly issues: readonly SchemaIssue[];\n readonly root: SchemaVerificationNode;\n readonly counts: {\n readonly pass: number;\n readonly warn: number;\n readonly fail: number;\n readonly totalNodes: number;\n };\n };\n readonly meta?: {\n readonly configPath?: string;\n readonly contractPath?: string;\n readonly strict: boolean;\n };\n readonly timings: {\n readonly total: number;\n };\n}\n\nexport interface EmitContractResult {\n readonly contractJson: string;\n readonly contractDts: string;\n readonly storageHash: string;\n readonly executionHash?: string;\n readonly profileHash: string;\n}\n\nexport interface IntrospectSchemaResult<TSchemaIR> {\n readonly ok: true;\n readonly summary: string;\n readonly target: {\n readonly familyId: string;\n readonly id: string;\n };\n readonly schema: TSchemaIR;\n readonly meta?: {\n readonly configPath?: string;\n readonly dbUrl?: string;\n };\n readonly timings: {\n readonly total: number;\n };\n}\n\nexport interface SignDatabaseResult {\n readonly ok: boolean;\n readonly summary: string;\n readonly contract: {\n readonly storageHash: string;\n readonly profileHash?: string;\n };\n readonly target: {\n readonly expected: string;\n readonly actual?: string;\n };\n readonly marker: {\n readonly created: boolean;\n readonly updated: boolean;\n readonly previous?: {\n readonly storageHash?: string;\n readonly profileHash?: string;\n };\n };\n readonly meta?: {\n readonly configPath?: string;\n readonly contractPath: string;\n };\n readonly timings: {\n readonly total: number;\n };\n}\n","/**\n * Core schema view types for family-agnostic schema visualization.\n *\n * These types provide a minimal, generic, tree-shaped representation of schemas\n * across families, designed for CLI visualization and lightweight tooling.\n *\n * Families can optionally project their family-specific Schema IR into this\n * core view via the `toSchemaView` method on `FamilyInstance`.\n */\n\nexport type SchemaNodeKind =\n | 'root'\n | 'namespace'\n | 'collection'\n | 'entity'\n | 'field'\n | 'index'\n | 'dependency';\n\nexport interface SchemaTreeVisitor<R> {\n visit(node: SchemaTreeNode): R;\n}\n\nexport interface SchemaTreeNodeOptions {\n readonly kind: SchemaNodeKind;\n readonly id: string;\n readonly label: string;\n readonly meta?: Record<string, unknown>;\n readonly children?: readonly SchemaTreeNode[];\n}\n\nexport class SchemaTreeNode {\n readonly kind: SchemaNodeKind;\n readonly id: string;\n readonly label: string;\n readonly meta?: Record<string, unknown>;\n readonly children?: readonly SchemaTreeNode[];\n\n constructor(options: SchemaTreeNodeOptions) {\n this.kind = options.kind;\n this.id = options.id;\n this.label = options.label;\n if (options.meta !== undefined) this.meta = options.meta;\n if (options.children !== undefined) this.children = options.children;\n Object.freeze(this);\n }\n\n accept<R>(visitor: SchemaTreeVisitor<R>): R {\n return visitor.visit(this);\n }\n}\n\n/**\n * Core schema view providing a family-agnostic tree representation of a schema.\n * Used by CLI and cross-family tooling for visualization.\n */\nexport interface CoreSchemaView {\n readonly root: SchemaTreeNode;\n}\n","import type { CodecLookup } from './codec-types';\nimport type {\n ControlAdapterDescriptor,\n ControlDriverDescriptor,\n ControlExtensionDescriptor,\n ControlFamilyDescriptor,\n ControlTargetDescriptor,\n} from './control-descriptors';\nimport type {\n AuthoringContributions,\n AuthoringFieldNamespace,\n AuthoringFieldPresetDescriptor,\n AuthoringTypeConstructorDescriptor,\n AuthoringTypeNamespace,\n} from './framework-authoring';\nimport type { ComponentMetadata } from './framework-components';\nimport type { TypesImportSpec } from './types-import-spec';\n\nexport interface AssembledAuthoringContributions {\n readonly field: AuthoringFieldNamespace;\n readonly type: AuthoringTypeNamespace;\n}\n\nexport interface ControlStack<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n> {\n readonly family: ControlFamilyDescriptor<TFamilyId>;\n readonly target: ControlTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter?: ControlAdapterDescriptor<TFamilyId, TTargetId> | undefined;\n readonly driver?: ControlDriverDescriptor<TFamilyId, TTargetId> | undefined;\n readonly extensionPacks: readonly ControlExtensionDescriptor<TFamilyId, TTargetId>[];\n\n readonly codecTypeImports: ReadonlyArray<TypesImportSpec>;\n readonly operationTypeImports: ReadonlyArray<TypesImportSpec>;\n readonly queryOperationTypeImports: ReadonlyArray<TypesImportSpec>;\n readonly extensionIds: ReadonlyArray<string>;\n readonly codecLookup: CodecLookup;\n readonly authoringContributions: AssembledAuthoringContributions;\n}\n\nexport interface CreateControlStackInput<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n> {\n readonly family: ControlFamilyDescriptor<TFamilyId>;\n readonly target: ControlTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter?: ControlAdapterDescriptor<TFamilyId, TTargetId> | undefined;\n readonly driver?: ControlDriverDescriptor<TFamilyId, TTargetId> | undefined;\n readonly extensionPacks?:\n | ReadonlyArray<ControlExtensionDescriptor<TFamilyId, TTargetId>>\n | undefined;\n}\n\nfunction addUniqueId(ids: string[], seen: Set<string>, id: string): void {\n if (!seen.has(id)) {\n ids.push(id);\n seen.add(id);\n }\n}\n\nexport function assertUniqueCodecOwner(options: {\n readonly codecId: string;\n readonly owners: Map<string, string>;\n readonly descriptorId: string;\n readonly entityLabel: string;\n readonly entityOwnershipLabel: string;\n}): void {\n const existingOwner = options.owners.get(options.codecId);\n if (existingOwner !== undefined) {\n throw new Error(\n `Duplicate ${options.entityLabel} for codecId \"${options.codecId}\". ` +\n `Descriptor \"${options.descriptorId}\" conflicts with \"${existingOwner}\". ` +\n `Each codecId can only have one ${options.entityOwnershipLabel}.`,\n );\n }\n}\n\nexport function extractCodecTypeImports(\n descriptors: ReadonlyArray<Pick<ComponentMetadata, 'types'>>,\n): ReadonlyArray<TypesImportSpec> {\n const imports: TypesImportSpec[] = [];\n\n for (const descriptor of descriptors) {\n const codecTypes = descriptor.types?.codecTypes;\n if (codecTypes?.import) {\n imports.push(codecTypes.import);\n }\n if (codecTypes?.typeImports) {\n imports.push(...codecTypes.typeImports);\n }\n }\n\n return imports;\n}\n\nexport function extractOperationTypeImports(\n descriptors: ReadonlyArray<Pick<ComponentMetadata, 'types'>>,\n): ReadonlyArray<TypesImportSpec> {\n const imports: TypesImportSpec[] = [];\n\n for (const descriptor of descriptors) {\n const operationTypes = descriptor.types?.operationTypes;\n if (operationTypes?.import) {\n imports.push(operationTypes.import);\n }\n }\n\n return imports;\n}\n\nexport function extractQueryOperationTypeImports(\n descriptors: ReadonlyArray<Pick<ComponentMetadata, 'types'>>,\n): ReadonlyArray<TypesImportSpec> {\n const imports: TypesImportSpec[] = [];\n\n for (const descriptor of descriptors) {\n const queryOperationTypes = descriptor.types?.queryOperationTypes;\n if (queryOperationTypes?.import) {\n imports.push(queryOperationTypes.import);\n }\n }\n\n return imports;\n}\n\nexport function extractComponentIds(\n family: { readonly id: string },\n target: { readonly id: string },\n adapter: { readonly id: string } | undefined,\n extensions: ReadonlyArray<{ readonly id: string }>,\n): ReadonlyArray<string> {\n const ids: string[] = [];\n const seen = new Set<string>();\n\n addUniqueId(ids, seen, family.id);\n addUniqueId(ids, seen, target.id);\n if (adapter) {\n addUniqueId(ids, seen, adapter.id);\n }\n\n for (const ext of extensions) {\n addUniqueId(ids, seen, ext.id);\n }\n\n return ids;\n}\n\nfunction isTypeConstructorDescriptor(value: unknown): value is AuthoringTypeConstructorDescriptor {\n return (\n typeof value === 'object' &&\n value !== null &&\n (value as { kind?: unknown }).kind === 'typeConstructor'\n );\n}\n\nfunction isFieldPresetDescriptor(value: unknown): value is AuthoringFieldPresetDescriptor {\n return (\n typeof value === 'object' &&\n value !== null &&\n (value as { kind?: unknown }).kind === 'fieldPreset'\n );\n}\n\nfunction mergeAuthoringNamespaces(\n target: Record<string, unknown>,\n source: Record<string, unknown>,\n path: readonly string[],\n leafGuard: (value: unknown) => boolean,\n label: string,\n): void {\n const assertSafePath = (currentPath: readonly string[]) => {\n const blockedSegment = currentPath.find(\n (segment) => segment === '__proto__' || segment === 'constructor' || segment === 'prototype',\n );\n if (blockedSegment) {\n throw new Error(\n `Invalid authoring ${label} helper \"${currentPath.join('.')}\". Helper path segments must not use \"${blockedSegment}\".`,\n );\n }\n };\n\n for (const [key, sourceValue] of Object.entries(source)) {\n const currentPath = [...path, key];\n assertSafePath(currentPath);\n const hasExistingValue = Object.hasOwn(target, key);\n const existingValue = hasExistingValue ? target[key] : undefined;\n\n if (!hasExistingValue) {\n target[key] = sourceValue;\n continue;\n }\n\n const existingIsLeaf = leafGuard(existingValue);\n const sourceIsLeaf = leafGuard(sourceValue);\n\n if (existingIsLeaf || sourceIsLeaf) {\n throw new Error(\n `Duplicate authoring ${label} helper \"${currentPath.join('.')}\". Descriptor contributions must be unique across composed components.`,\n );\n }\n\n mergeAuthoringNamespaces(\n existingValue as Record<string, unknown>,\n sourceValue as Record<string, unknown>,\n currentPath,\n leafGuard,\n label,\n );\n }\n}\n\nexport function assembleAuthoringContributions(\n descriptors: ReadonlyArray<{ readonly authoring?: AuthoringContributions }>,\n): AssembledAuthoringContributions {\n const field = {} as Record<string, unknown>;\n const type = {} as Record<string, unknown>;\n\n for (const descriptor of descriptors) {\n if (descriptor.authoring?.field) {\n mergeAuthoringNamespaces(\n field,\n descriptor.authoring.field,\n [],\n isFieldPresetDescriptor,\n 'field',\n );\n }\n if (!descriptor.authoring?.type) {\n continue;\n }\n mergeAuthoringNamespaces(\n type,\n descriptor.authoring.type,\n [],\n isTypeConstructorDescriptor,\n 'type',\n );\n }\n\n return {\n field: field as AuthoringFieldNamespace,\n type: type as AuthoringTypeNamespace,\n };\n}\n\nexport function extractCodecLookup(\n descriptors: ReadonlyArray<Pick<ComponentMetadata & { id?: string }, 'types' | 'id'>>,\n): CodecLookup {\n const byId = new Map<string, import('./codec-types').Codec>();\n const owners = new Map<string, string>();\n for (const descriptor of descriptors) {\n const codecInstances = descriptor.types?.codecTypes?.codecInstances;\n if (!codecInstances) continue;\n const descriptorId = descriptor.id ?? '<unknown>';\n for (const codec of codecInstances) {\n assertUniqueCodecOwner({\n codecId: codec.id,\n owners,\n descriptorId,\n entityLabel: 'codec instance',\n entityOwnershipLabel: 'codec instance provider',\n });\n owners.set(codec.id, descriptorId);\n byId.set(codec.id, codec);\n }\n }\n return { get: (id) => byId.get(id) };\n}\n\nexport function createControlStack<TFamilyId extends string, TTargetId extends string>(\n input: CreateControlStackInput<TFamilyId, TTargetId>,\n): ControlStack<TFamilyId, TTargetId> {\n const { family, target, adapter, driver, extensionPacks = [] } = input;\n\n const allDescriptors = [family, target, ...(adapter ? [adapter] : []), ...extensionPacks];\n\n return {\n family,\n target,\n adapter,\n driver,\n extensionPacks: extensionPacks as readonly ControlExtensionDescriptor<TFamilyId, TTargetId>[],\n\n codecTypeImports: extractCodecTypeImports(allDescriptors),\n operationTypeImports: extractOperationTypeImports(allDescriptors),\n queryOperationTypeImports: extractQueryOperationTypeImports(allDescriptors),\n extensionIds: extractComponentIds(family, target, adapter, extensionPacks),\n codecLookup: extractCodecLookup(allDescriptors),\n authoringContributions: assembleAuthoringContributions(allDescriptors),\n };\n}\n"],"mappings":";AAgBA,SAAgB,cACd,QAC4D;AAC5D,QAAO,gBAAgB,UAAU,CAAC,CAAE,OAAmC;;AAOzE,SAAgB,cACd,UACwF;AACxF,QACE,kBAAkB,YAClB,OAAQ,SAAqC,oBAAoB;;;;;AC/BrE,MAAa,6BAA6B;AAC1C,MAAa,4BAA4B;AACzC,MAAa,8BAA8B;AAC3C,MAAa,6BAA6B;;;;AC4B1C,IAAa,iBAAb,MAA4B;CAC1B,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CAET,YAAY,SAAgC;AAC1C,OAAK,OAAO,QAAQ;AACpB,OAAK,KAAK,QAAQ;AAClB,OAAK,QAAQ,QAAQ;AACrB,MAAI,QAAQ,SAAS,OAAW,MAAK,OAAO,QAAQ;AACpD,MAAI,QAAQ,aAAa,OAAW,MAAK,WAAW,QAAQ;AAC5D,SAAO,OAAO,KAAK;;CAGrB,OAAU,SAAkC;AAC1C,SAAO,QAAQ,MAAM,KAAK;;;;;;ACM9B,SAAS,YAAY,KAAe,MAAmB,IAAkB;AACvE,KAAI,CAAC,KAAK,IAAI,GAAG,EAAE;AACjB,MAAI,KAAK,GAAG;AACZ,OAAK,IAAI,GAAG;;;AAIhB,SAAgB,uBAAuB,SAM9B;CACP,MAAM,gBAAgB,QAAQ,OAAO,IAAI,QAAQ,QAAQ;AACzD,KAAI,kBAAkB,OACpB,OAAM,IAAI,MACR,aAAa,QAAQ,YAAY,gBAAgB,QAAQ,QAAQ,iBAChD,QAAQ,aAAa,oBAAoB,cAAc,oCACpC,QAAQ,qBAAqB,GAClE;;AAIL,SAAgB,wBACd,aACgC;CAChC,MAAMA,UAA6B,EAAE;AAErC,MAAK,MAAM,cAAc,aAA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mBACd,OACoC;CACpC,MAAM,EAAE,QAAQ,QAAQ,SAAS,QAAQ,iBAAiB,EAAE,KAAK;CAEjE,MAAM,iBAAiB;EAAC;EAAQ;EAAQ,GAAI,UAAU,CAAC,QAAQ,GAAG,EAAE;EAAG,GAAG;EAAe;AAEzF,QAAO;EACL;EACA;EACA;EACA;EACgB;EAEhB,kBAAkB,wBAAwB,eAAe;EACzD,sBAAsB,4BAA4B,eAAe;EACjE,2BAA2B,iCAAiC,eAAe;EAC3E,cAAc,oBAAoB,QAAQ,QAAQ,SAAS,eAAe;EAC1E,aAAa,mBAAmB,eAAe;EAC/C,wBAAwB,+BAA+B,eAAe;EACvE"}
1
+ {"version":3,"file":"control.mjs","names":["imports: TypesImportSpec[]","ids: string[]"],"sources":["../src/control-capabilities.ts","../src/control-result-types.ts","../src/control-schema-view.ts","../src/control-stack.ts"],"sourcesContent":["import type { ControlTargetDescriptor } from './control-descriptors';\nimport type { ControlFamilyInstance } from './control-instances';\nimport type { TargetMigrationsCapability } from './control-migration-types';\nimport type { CoreSchemaView } from './control-schema-view';\n\nexport interface MigratableTargetDescriptor<\n TFamilyId extends string,\n TTargetId extends string,\n TFamilyInstance extends ControlFamilyInstance<TFamilyId, unknown> = ControlFamilyInstance<\n TFamilyId,\n unknown\n >,\n> extends ControlTargetDescriptor<TFamilyId, TTargetId> {\n readonly migrations: TargetMigrationsCapability<TFamilyId, TTargetId, TFamilyInstance>;\n}\n\nexport function hasMigrations<TFamilyId extends string, TTargetId extends string>(\n target: ControlTargetDescriptor<TFamilyId, TTargetId>,\n): target is MigratableTargetDescriptor<TFamilyId, TTargetId> {\n return 'migrations' in target && !!(target as Record<string, unknown>)['migrations'];\n}\n\nexport interface SchemaViewCapable<TSchemaIR = unknown> {\n toSchemaView(schema: TSchemaIR): CoreSchemaView;\n}\n\nexport function hasSchemaView<TFamilyId extends string, TSchemaIR>(\n instance: ControlFamilyInstance<TFamilyId, TSchemaIR>,\n): instance is ControlFamilyInstance<TFamilyId, TSchemaIR> & SchemaViewCapable<TSchemaIR> {\n return (\n 'toSchemaView' in instance &&\n typeof (instance as Record<string, unknown>)['toSchemaView'] === 'function'\n );\n}\n","export const VERIFY_CODE_MARKER_MISSING = 'PN-RUN-3001';\nexport const VERIFY_CODE_HASH_MISMATCH = 'PN-RUN-3002';\nexport const VERIFY_CODE_TARGET_MISMATCH = 'PN-RUN-3003';\nexport const VERIFY_CODE_SCHEMA_FAILURE = 'PN-RUN-3010';\n\nexport interface OperationContext {\n readonly contractPath?: string;\n readonly configPath?: string;\n readonly meta?: Readonly<Record<string, unknown>>;\n}\n\nexport interface VerifyDatabaseResult {\n readonly ok: boolean;\n readonly code?: string;\n readonly summary: string;\n readonly contract: {\n readonly storageHash: string;\n readonly profileHash?: string;\n };\n readonly marker?: {\n readonly storageHash?: string;\n readonly profileHash?: string;\n };\n readonly target: {\n readonly expected: string;\n readonly actual?: string;\n };\n readonly missingCodecs?: readonly string[];\n readonly codecCoverageSkipped?: boolean;\n readonly meta?: {\n readonly configPath?: string;\n readonly contractPath: string;\n };\n readonly timings: {\n readonly total: number;\n };\n}\n\nexport interface BaseSchemaIssue {\n readonly kind:\n | 'missing_table'\n | 'missing_column'\n | 'extra_table'\n | 'extra_column'\n | 'extra_primary_key'\n | 'extra_foreign_key'\n | 'extra_unique_constraint'\n | 'extra_index'\n | 'extra_validator'\n | 'type_mismatch'\n | 'type_missing'\n | 'type_values_mismatch'\n | 'nullability_mismatch'\n | 'primary_key_mismatch'\n | 'foreign_key_mismatch'\n | 'unique_constraint_mismatch'\n | 'index_mismatch'\n | 'dependency_missing'\n | 'default_missing'\n | 'default_mismatch'\n | 'extra_default';\n readonly table?: string;\n readonly column?: string;\n readonly indexOrConstraint?: string;\n readonly typeName?: string;\n readonly dependencyId?: string;\n readonly expected?: string;\n readonly actual?: string;\n readonly message: string;\n}\n\nexport interface EnumValuesChangedIssue {\n readonly kind: 'enum_values_changed';\n readonly typeName: string;\n readonly addedValues: readonly string[];\n readonly removedValues: readonly string[];\n readonly message: string;\n}\n\nexport type SchemaIssue = BaseSchemaIssue | EnumValuesChangedIssue;\n\nexport interface SchemaVerificationNode {\n readonly status: 'pass' | 'warn' | 'fail';\n readonly kind: string;\n readonly name: string;\n readonly contractPath: string;\n readonly code: string;\n readonly message: string;\n readonly expected: unknown;\n readonly actual: unknown;\n readonly children: readonly SchemaVerificationNode[];\n}\n\nexport interface VerifyDatabaseSchemaResult {\n readonly ok: boolean;\n readonly code?: string;\n readonly summary: string;\n readonly contract: {\n readonly storageHash: string;\n readonly profileHash?: string;\n };\n readonly target: {\n readonly expected: string;\n readonly actual?: string;\n };\n readonly schema: {\n readonly issues: readonly SchemaIssue[];\n readonly root: SchemaVerificationNode;\n readonly counts: {\n readonly pass: number;\n readonly warn: number;\n readonly fail: number;\n readonly totalNodes: number;\n };\n };\n readonly meta?: {\n readonly configPath?: string;\n readonly contractPath?: string;\n readonly strict: boolean;\n };\n readonly timings: {\n readonly total: number;\n };\n}\n\nexport interface EmitContractResult {\n readonly contractJson: string;\n readonly contractDts: string;\n readonly storageHash: string;\n readonly executionHash?: string;\n readonly profileHash: string;\n}\n\nexport interface IntrospectSchemaResult<TSchemaIR> {\n readonly ok: true;\n readonly summary: string;\n readonly target: {\n readonly familyId: string;\n readonly id: string;\n };\n readonly schema: TSchemaIR;\n readonly meta?: {\n readonly configPath?: string;\n readonly dbUrl?: string;\n };\n readonly timings: {\n readonly total: number;\n };\n}\n\nexport interface SignDatabaseResult {\n readonly ok: boolean;\n readonly summary: string;\n readonly contract: {\n readonly storageHash: string;\n readonly profileHash?: string;\n };\n readonly target: {\n readonly expected: string;\n readonly actual?: string;\n };\n readonly marker: {\n readonly created: boolean;\n readonly updated: boolean;\n readonly previous?: {\n readonly storageHash?: string;\n readonly profileHash?: string;\n };\n };\n readonly meta?: {\n readonly configPath?: string;\n readonly contractPath: string;\n };\n readonly timings: {\n readonly total: number;\n };\n}\n","/**\n * Core schema view types for family-agnostic schema visualization.\n *\n * These types provide a minimal, generic, tree-shaped representation of schemas\n * across families, designed for CLI visualization and lightweight tooling.\n *\n * Families can optionally project their family-specific Schema IR into this\n * core view via the `toSchemaView` method on `FamilyInstance`.\n */\n\nexport type SchemaNodeKind =\n | 'root'\n | 'namespace'\n | 'collection'\n | 'entity'\n | 'field'\n | 'index'\n | 'dependency';\n\nexport interface SchemaTreeVisitor<R> {\n visit(node: SchemaTreeNode): R;\n}\n\nexport interface SchemaTreeNodeOptions {\n readonly kind: SchemaNodeKind;\n readonly id: string;\n readonly label: string;\n readonly meta?: Record<string, unknown>;\n readonly children?: readonly SchemaTreeNode[];\n}\n\nexport class SchemaTreeNode {\n readonly kind: SchemaNodeKind;\n readonly id: string;\n readonly label: string;\n readonly meta?: Record<string, unknown>;\n readonly children?: readonly SchemaTreeNode[];\n\n constructor(options: SchemaTreeNodeOptions) {\n this.kind = options.kind;\n this.id = options.id;\n this.label = options.label;\n if (options.meta !== undefined) this.meta = options.meta;\n if (options.children !== undefined) this.children = options.children;\n Object.freeze(this);\n }\n\n accept<R>(visitor: SchemaTreeVisitor<R>): R {\n return visitor.visit(this);\n }\n}\n\n/**\n * Core schema view providing a family-agnostic tree representation of a schema.\n * Used by CLI and cross-family tooling for visualization.\n */\nexport interface CoreSchemaView {\n readonly root: SchemaTreeNode;\n}\n","import type { CodecLookup } from './codec-types';\nimport type {\n ControlAdapterDescriptor,\n ControlDriverDescriptor,\n ControlExtensionDescriptor,\n ControlFamilyDescriptor,\n ControlTargetDescriptor,\n} from './control-descriptors';\nimport type {\n AuthoringContributions,\n AuthoringFieldNamespace,\n AuthoringFieldPresetDescriptor,\n AuthoringTypeConstructorDescriptor,\n AuthoringTypeNamespace,\n} from './framework-authoring';\nimport type { ComponentMetadata } from './framework-components';\nimport type {\n ControlMutationDefaultEntry,\n ControlMutationDefaults,\n MutationDefaultGeneratorDescriptor,\n} from './mutation-default-types';\nimport type { TypesImportSpec } from './types-import-spec';\n\nexport interface AssembledAuthoringContributions {\n readonly field: AuthoringFieldNamespace;\n readonly type: AuthoringTypeNamespace;\n}\n\nexport interface ControlStack<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n> {\n readonly family: ControlFamilyDescriptor<TFamilyId>;\n readonly target: ControlTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter?: ControlAdapterDescriptor<TFamilyId, TTargetId> | undefined;\n readonly driver?: ControlDriverDescriptor<TFamilyId, TTargetId> | undefined;\n readonly extensionPacks: readonly ControlExtensionDescriptor<TFamilyId, TTargetId>[];\n\n readonly codecTypeImports: ReadonlyArray<TypesImportSpec>;\n readonly operationTypeImports: ReadonlyArray<TypesImportSpec>;\n readonly queryOperationTypeImports: ReadonlyArray<TypesImportSpec>;\n readonly extensionIds: ReadonlyArray<string>;\n readonly codecLookup: CodecLookup;\n readonly authoringContributions: AssembledAuthoringContributions;\n readonly scalarTypeDescriptors: ReadonlyMap<string, string>;\n readonly controlMutationDefaults: ControlMutationDefaults;\n}\n\nexport interface CreateControlStackInput<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n> {\n readonly family: ControlFamilyDescriptor<TFamilyId>;\n readonly target: ControlTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter?: ControlAdapterDescriptor<TFamilyId, TTargetId> | undefined;\n readonly driver?: ControlDriverDescriptor<TFamilyId, TTargetId> | undefined;\n readonly extensionPacks?:\n | ReadonlyArray<ControlExtensionDescriptor<TFamilyId, TTargetId>>\n | undefined;\n}\n\nfunction addUniqueId(ids: string[], seen: Set<string>, id: string): void {\n if (!seen.has(id)) {\n ids.push(id);\n seen.add(id);\n }\n}\n\nexport function assertUniqueCodecOwner(options: {\n readonly codecId: string;\n readonly owners: Map<string, string>;\n readonly descriptorId: string;\n readonly entityLabel: string;\n readonly entityOwnershipLabel: string;\n}): void {\n const existingOwner = options.owners.get(options.codecId);\n if (existingOwner !== undefined) {\n throw new Error(\n `Duplicate ${options.entityLabel} for codecId \"${options.codecId}\". ` +\n `Descriptor \"${options.descriptorId}\" conflicts with \"${existingOwner}\". ` +\n `Each codecId can only have one ${options.entityOwnershipLabel}.`,\n );\n }\n}\n\nexport function extractCodecTypeImports(\n descriptors: ReadonlyArray<Pick<ComponentMetadata, 'types'>>,\n): ReadonlyArray<TypesImportSpec> {\n const imports: TypesImportSpec[] = [];\n\n for (const descriptor of descriptors) {\n const codecTypes = descriptor.types?.codecTypes;\n if (codecTypes?.import) {\n imports.push(codecTypes.import);\n }\n if (codecTypes?.typeImports) {\n imports.push(...codecTypes.typeImports);\n }\n }\n\n return imports;\n}\n\nexport function extractOperationTypeImports(\n descriptors: ReadonlyArray<Pick<ComponentMetadata, 'types'>>,\n): ReadonlyArray<TypesImportSpec> {\n const imports: TypesImportSpec[] = [];\n\n for (const descriptor of descriptors) {\n const operationTypes = descriptor.types?.operationTypes;\n if (operationTypes?.import) {\n imports.push(operationTypes.import);\n }\n }\n\n return imports;\n}\n\nexport function extractQueryOperationTypeImports(\n descriptors: ReadonlyArray<Pick<ComponentMetadata, 'types'>>,\n): ReadonlyArray<TypesImportSpec> {\n const imports: TypesImportSpec[] = [];\n\n for (const descriptor of descriptors) {\n const queryOperationTypes = descriptor.types?.queryOperationTypes;\n if (queryOperationTypes?.import) {\n imports.push(queryOperationTypes.import);\n }\n }\n\n return imports;\n}\n\nexport function extractComponentIds(\n family: { readonly id: string },\n target: { readonly id: string },\n adapter: { readonly id: string } | undefined,\n extensions: ReadonlyArray<{ readonly id: string }>,\n): ReadonlyArray<string> {\n const ids: string[] = [];\n const seen = new Set<string>();\n\n addUniqueId(ids, seen, family.id);\n addUniqueId(ids, seen, target.id);\n if (adapter) {\n addUniqueId(ids, seen, adapter.id);\n }\n\n for (const ext of extensions) {\n addUniqueId(ids, seen, ext.id);\n }\n\n return ids;\n}\n\nfunction isTypeConstructorDescriptor(value: unknown): value is AuthoringTypeConstructorDescriptor {\n return (\n typeof value === 'object' &&\n value !== null &&\n (value as { kind?: unknown }).kind === 'typeConstructor'\n );\n}\n\nfunction isFieldPresetDescriptor(value: unknown): value is AuthoringFieldPresetDescriptor {\n return (\n typeof value === 'object' &&\n value !== null &&\n (value as { kind?: unknown }).kind === 'fieldPreset'\n );\n}\n\nfunction mergeAuthoringNamespaces(\n target: Record<string, unknown>,\n source: Record<string, unknown>,\n path: readonly string[],\n leafGuard: (value: unknown) => boolean,\n label: string,\n): void {\n const assertSafePath = (currentPath: readonly string[]) => {\n const blockedSegment = currentPath.find(\n (segment) => segment === '__proto__' || segment === 'constructor' || segment === 'prototype',\n );\n if (blockedSegment) {\n throw new Error(\n `Invalid authoring ${label} helper \"${currentPath.join('.')}\". Helper path segments must not use \"${blockedSegment}\".`,\n );\n }\n };\n\n for (const [key, sourceValue] of Object.entries(source)) {\n const currentPath = [...path, key];\n assertSafePath(currentPath);\n const hasExistingValue = Object.hasOwn(target, key);\n const existingValue = hasExistingValue ? target[key] : undefined;\n\n if (!hasExistingValue) {\n target[key] = sourceValue;\n continue;\n }\n\n const existingIsLeaf = leafGuard(existingValue);\n const sourceIsLeaf = leafGuard(sourceValue);\n\n if (existingIsLeaf || sourceIsLeaf) {\n throw new Error(\n `Duplicate authoring ${label} helper \"${currentPath.join('.')}\". Descriptor contributions must be unique across composed components.`,\n );\n }\n\n mergeAuthoringNamespaces(\n existingValue as Record<string, unknown>,\n sourceValue as Record<string, unknown>,\n currentPath,\n leafGuard,\n label,\n );\n }\n}\n\nexport function assembleAuthoringContributions(\n descriptors: ReadonlyArray<{ readonly authoring?: AuthoringContributions }>,\n): AssembledAuthoringContributions {\n const field = {} as Record<string, unknown>;\n const type = {} as Record<string, unknown>;\n\n for (const descriptor of descriptors) {\n if (descriptor.authoring?.field) {\n mergeAuthoringNamespaces(\n field,\n descriptor.authoring.field,\n [],\n isFieldPresetDescriptor,\n 'field',\n );\n }\n if (!descriptor.authoring?.type) {\n continue;\n }\n mergeAuthoringNamespaces(\n type,\n descriptor.authoring.type,\n [],\n isTypeConstructorDescriptor,\n 'type',\n );\n }\n\n return {\n field: field as AuthoringFieldNamespace,\n type: type as AuthoringTypeNamespace,\n };\n}\n\nexport function assembleScalarTypeDescriptors(\n descriptors: ReadonlyArray<\n Pick<ComponentMetadata, 'scalarTypeDescriptors'> & { readonly id?: string }\n >,\n): ReadonlyMap<string, string> {\n const result = new Map<string, string>();\n const owners = new Map<string, string>();\n\n for (const descriptor of descriptors) {\n const descriptorMap = descriptor.scalarTypeDescriptors;\n if (!descriptorMap) continue;\n const descriptorId = descriptor.id ?? '<unknown>';\n for (const [typeName, codecId] of descriptorMap) {\n const existingOwner = owners.get(typeName);\n if (existingOwner !== undefined) {\n throw new Error(\n `Duplicate scalar type descriptor \"${typeName}\". ` +\n `Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\".`,\n );\n }\n result.set(typeName, codecId);\n owners.set(typeName, descriptorId);\n }\n }\n\n return result;\n}\n\nexport function assembleControlMutationDefaults(\n descriptors: ReadonlyArray<\n Pick<ComponentMetadata, 'controlMutationDefaults'> & { readonly id?: string }\n >,\n): ControlMutationDefaults {\n const defaultFunctionRegistry = new Map<string, ControlMutationDefaultEntry>();\n const functionOwners = new Map<string, string>();\n const generatorMap = new Map<string, MutationDefaultGeneratorDescriptor>();\n const generatorOwners = new Map<string, string>();\n\n for (const descriptor of descriptors) {\n const contributions = descriptor.controlMutationDefaults;\n if (!contributions) continue;\n const descriptorId = descriptor.id ?? '<unknown>';\n\n for (const generatorDescriptor of contributions.generatorDescriptors) {\n const existingOwner = generatorOwners.get(generatorDescriptor.id);\n if (existingOwner !== undefined) {\n throw new Error(\n `Duplicate mutation default generator id \"${generatorDescriptor.id}\". ` +\n `Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\".`,\n );\n }\n generatorMap.set(generatorDescriptor.id, generatorDescriptor);\n generatorOwners.set(generatorDescriptor.id, descriptorId);\n }\n\n for (const [functionName, handler] of contributions.defaultFunctionRegistry) {\n const existingOwner = functionOwners.get(functionName);\n if (existingOwner !== undefined) {\n throw new Error(\n `Duplicate mutation default function \"${functionName}\". ` +\n `Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\".`,\n );\n }\n defaultFunctionRegistry.set(functionName, handler);\n functionOwners.set(functionName, descriptorId);\n }\n }\n\n return {\n defaultFunctionRegistry,\n generatorDescriptors: Array.from(generatorMap.values()),\n };\n}\n\nexport function extractCodecLookup(\n descriptors: ReadonlyArray<Pick<ComponentMetadata & { id?: string }, 'types' | 'id'>>,\n): CodecLookup {\n const byId = new Map<string, import('./codec-types').Codec>();\n const owners = new Map<string, string>();\n for (const descriptor of descriptors) {\n const codecInstances = descriptor.types?.codecTypes?.codecInstances;\n if (!codecInstances) continue;\n const descriptorId = descriptor.id ?? '<unknown>';\n for (const codec of codecInstances) {\n assertUniqueCodecOwner({\n codecId: codec.id,\n owners,\n descriptorId,\n entityLabel: 'codec instance',\n entityOwnershipLabel: 'codec instance provider',\n });\n owners.set(codec.id, descriptorId);\n byId.set(codec.id, codec);\n }\n }\n return { get: (id) => byId.get(id) };\n}\n\nexport function validateScalarTypeCodecIds(\n scalarTypeDescriptors: ReadonlyMap<string, string>,\n codecLookup: CodecLookup,\n): string[] {\n const errors: string[] = [];\n for (const [typeName, codecId] of scalarTypeDescriptors) {\n if (!codecLookup.get(codecId)) {\n errors.push(\n `Scalar type \"${typeName}\" references codec \"${codecId}\" which is not registered by any component.`,\n );\n }\n }\n return errors;\n}\n\nexport function createControlStack<TFamilyId extends string, TTargetId extends string>(\n input: CreateControlStackInput<TFamilyId, TTargetId>,\n): ControlStack<TFamilyId, TTargetId> {\n const { family, target, adapter, driver, extensionPacks = [] } = input;\n\n const allDescriptors = [family, target, ...(adapter ? [adapter] : []), ...extensionPacks];\n\n const codecLookup = extractCodecLookup(allDescriptors);\n const scalarTypeDescriptors = assembleScalarTypeDescriptors(allDescriptors);\n\n return {\n family,\n target,\n adapter,\n driver,\n extensionPacks: extensionPacks as readonly ControlExtensionDescriptor<TFamilyId, TTargetId>[],\n\n codecTypeImports: extractCodecTypeImports(allDescriptors),\n operationTypeImports: extractOperationTypeImports(allDescriptors),\n queryOperationTypeImports: extractQueryOperationTypeImports(allDescriptors),\n extensionIds: extractComponentIds(family, target, adapter, extensionPacks),\n codecLookup,\n authoringContributions: assembleAuthoringContributions(allDescriptors),\n scalarTypeDescriptors,\n controlMutationDefaults: assembleControlMutationDefaults(allDescriptors),\n };\n}\n"],"mappings":";AAgBA,SAAgB,cACd,QAC4D;AAC5D,QAAO,gBAAgB,UAAU,CAAC,CAAE,OAAmC;;AAOzE,SAAgB,cACd,UACwF;AACxF,QACE,kBAAkB,YAClB,OAAQ,SAAqC,oBAAoB;;;;;AC/BrE,MAAa,6BAA6B;AAC1C,MAAa,4BAA4B;AACzC,MAAa,8BAA8B;AAC3C,MAAa,6BAA6B;;;;AC4B1C,IAAa,iBAAb,MAA4B;CAC1B,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CAET,YAAY,SAAgC;AAC1C,OAAK,OAAO,QAAQ;AACpB,OAAK,KAAK,QAAQ;AAClB,OAAK,QAAQ,QAAQ;AACrB,MAAI,QAAQ,SAAS,OAAW,MAAK,OAAO,QAAQ;AACpD,MAAI,QAAQ,aAAa,OAAW,MAAK,WAAW,QAAQ;AAC5D,SAAO,OAAO,KAAK;;CAGrB,OAAU,SAAkC;AAC1C,SAAO,QAAQ,MAAM,KAAK;;;;;;ACa9B,SAAS,YAAY,KAAe,MAAmB,IAAkB;AACvE,KAAI,CAAC,KAAK,IAAI,GAAG,EAAE;AACjB,MAAI,KAAK,GAAG;AACZ,OAAK,IAAI,GAAG;;;AAIhB,SAAgB,uBAAuB,SAM9B;CACP,MAAM,gBAAgB,QAAQ,OAAO,IAAI,QAAQ,QAAQ;AACzD,KAAI,kBAAkB,OACpB,OAAM,IAAI,MACR,aAAa,QAAQ,YAAY,gBAAgB,QAAQ,QAAQ,iBAChD,QAAQ,aAAa,oBAAoB,cAAc,oCACpC,QAAQ,qBAAqB,GAClE;;AAIL,SAAgB,wBACd,aACgC;CAChC,MAAMA,UAA6B,E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,MAAM,IAAI,aAAa;AAClC,QAAK,IAAI,MAAM,IAAI,MAAM;;;AAG7B,QAAO,EAAE,MAAM,OAAO,KAAK,IAAI,GAAG,EAAE;;AAkBtC,SAAgB,mBACd,OACoC;CACpC,MAAM,EAAE,QAAQ,QAAQ,SAAS,QAAQ,iBAAiB,EAAE,KAAK;CAEjE,MAAM,iBAAiB;EAAC;EAAQ;EAAQ,GAAI,UAAU,CAAC,QAAQ,GAAG,EAAE;EAAG,GAAG;EAAe;CAEzF,MAAM,cAAc,mBAAmB,eAAe;CACtD,MAAM,wBAAwB,8BAA8B,eAAe;AAE3E,QAAO;EACL;EACA;EACA;EACA;EACgB;EAEhB,kBAAkB,wBAAwB,eAAe;EACzD,sBAAsB,4BAA4B,eAAe;EACjE,2BAA2B,iCAAiC,eAAe;EAC3E,cAAc,oBAAoB,QAAQ,QAAQ,SAAS,eAAe;EAC1E;EACA,wBAAwB,+BAA+B,eAAe;EACtE;EACA,yBAAyB,gCAAgC,eAAe;EACzE"}
@@ -1,4 +1,4 @@
1
- import { t as TypesImportSpec } from "./types-import-spec-Ddp4fNmt.mjs";
1
+ import { t as TypesImportSpec } from "./types-import-spec-C4sc7wbb.mjs";
2
2
  import { Contract, ContractModel } from "@prisma-next/contract/types";
3
3
 
4
4
  //#region src/emission-types.d.ts
@@ -21,4 +21,4 @@ interface EmissionSpi {
21
21
  }
22
22
  //#endregion
23
23
  export { GenerateContractTypesOptions as n, ValidationContext as r, EmissionSpi as t };
24
- //# sourceMappingURL=emission-types-B3UblxTu.d.mts.map
24
+ //# sourceMappingURL=emission-types-BPAALJbF.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"emission-types-B3UblxTu.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
+ {"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,3 +1,3 @@
1
- import { t as TypesImportSpec } from "./types-import-spec-Ddp4fNmt.mjs";
2
- import { n as GenerateContractTypesOptions, r as ValidationContext, t as EmissionSpi } from "./emission-types-B3UblxTu.mjs";
1
+ import { t as TypesImportSpec } from "./types-import-spec-C4sc7wbb.mjs";
2
+ import { n as GenerateContractTypesOptions, r as ValidationContext, t as EmissionSpi } from "./emission-types-BPAALJbF.mjs";
3
3
  export { type EmissionSpi, type GenerateContractTypesOptions, type TypesImportSpec, type ValidationContext };
@@ -1,4 +1,4 @@
1
- import { b as TargetInstance, c as DriverDescriptor, d as ExtensionDescriptor, f as ExtensionInstance, h as FamilyInstance, l as DriverInstance, m as FamilyDescriptor, n as AdapterInstance, t as AdapterDescriptor, y as TargetDescriptor } from "./framework-components-DoWmh6GH.mjs";
1
+ import { b as TargetInstance, c as DriverDescriptor, d as ExtensionDescriptor, f as ExtensionInstance, h as FamilyInstance, l as DriverInstance, m as FamilyDescriptor, n as AdapterInstance, t as AdapterDescriptor, y as TargetDescriptor } from "./framework-components-EJXe-pum.mjs";
2
2
 
3
3
  //#region src/execution-instances.d.ts
4
4
  interface RuntimeFamilyInstance<TFamilyId extends string> extends FamilyInstance<TFamilyId> {}
@@ -1 +1 @@
1
- {"version":3,"file":"framework-components-C8ZhSwXe.mjs","names":[],"sources":["../src/framework-components.ts"],"sourcesContent":["import type { Codec } from './codec-types';\nimport type { AuthoringContributions } from './framework-authoring';\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/**\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":";AAiHA,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
+ {"version":3,"file":"framework-components-C8ZhSwXe.mjs","names":[],"sources":["../src/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,9 +1,90 @@
1
1
  import { i as AuthoringContributions } from "./framework-authoring-D1-JZ37B.mjs";
2
2
  import { t as Codec } from "./codec-types-B58nCJiu.mjs";
3
- import { t as TypesImportSpec } from "./types-import-spec-Ddp4fNmt.mjs";
3
+ import { t as TypesImportSpec } from "./types-import-spec-C4sc7wbb.mjs";
4
+ import { ColumnDefault, ExecutionMutationDefaultValue } from "@prisma-next/contract/types";
4
5
 
6
+ //#region src/mutation-default-types.d.ts
7
+ interface SourcePosition {
8
+ readonly offset: number;
9
+ readonly line: number;
10
+ readonly column: number;
11
+ }
12
+ interface SourceSpan {
13
+ readonly start: SourcePosition;
14
+ readonly end: SourcePosition;
15
+ }
16
+ interface SourceDiagnostic {
17
+ readonly code: string;
18
+ readonly message: string;
19
+ readonly sourceId?: string;
20
+ readonly span?: SourceSpan;
21
+ readonly data?: Readonly<Record<string, unknown>>;
22
+ }
23
+ interface DefaultFunctionArgument {
24
+ readonly raw: string;
25
+ readonly span: SourceSpan;
26
+ }
27
+ interface ParsedDefaultFunctionCall {
28
+ readonly name: string;
29
+ readonly raw: string;
30
+ readonly args: readonly DefaultFunctionArgument[];
31
+ readonly span: SourceSpan;
32
+ }
33
+ interface DefaultFunctionLoweringContext {
34
+ readonly sourceId: string;
35
+ readonly modelName: string;
36
+ readonly fieldName: string;
37
+ readonly columnCodecId?: string;
38
+ }
39
+ type LoweredDefaultValue = {
40
+ readonly kind: 'storage';
41
+ readonly defaultValue: ColumnDefault;
42
+ } | {
43
+ readonly kind: 'execution';
44
+ readonly generated: ExecutionMutationDefaultValue;
45
+ };
46
+ type LoweredDefaultResult = {
47
+ readonly ok: true;
48
+ readonly value: LoweredDefaultValue;
49
+ } | {
50
+ readonly ok: false;
51
+ readonly diagnostic: SourceDiagnostic;
52
+ };
53
+ type DefaultFunctionLoweringHandler = (input: {
54
+ readonly call: ParsedDefaultFunctionCall;
55
+ readonly context: DefaultFunctionLoweringContext;
56
+ }) => LoweredDefaultResult;
57
+ interface DefaultFunctionRegistryEntry {
58
+ readonly lower: DefaultFunctionLoweringHandler;
59
+ readonly usageSignatures?: readonly string[];
60
+ }
61
+ type DefaultFunctionRegistry = ReadonlyMap<string, DefaultFunctionRegistryEntry>;
62
+ interface MutationDefaultGeneratorDescriptor {
63
+ readonly id: string;
64
+ readonly applicableCodecIds: readonly string[];
65
+ readonly resolveGeneratedColumnDescriptor?: (input: {
66
+ readonly generated: ExecutionMutationDefaultValue;
67
+ }) => {
68
+ readonly codecId: string;
69
+ readonly nativeType: string;
70
+ readonly typeRef?: string;
71
+ readonly typeParams?: Record<string, unknown>;
72
+ } | undefined;
73
+ }
74
+ interface ControlMutationDefaultEntry {
75
+ readonly lower: (input: {
76
+ readonly call: ParsedDefaultFunctionCall;
77
+ readonly context: DefaultFunctionLoweringContext;
78
+ }) => LoweredDefaultResult;
79
+ readonly usageSignatures?: readonly string[];
80
+ }
81
+ type ControlMutationDefaultRegistry = ReadonlyMap<string, ControlMutationDefaultEntry>;
82
+ interface ControlMutationDefaults {
83
+ readonly defaultFunctionRegistry: ControlMutationDefaultRegistry;
84
+ readonly generatorDescriptors: readonly MutationDefaultGeneratorDescriptor[];
85
+ }
86
+ //#endregion
5
87
  //#region src/framework-components.d.ts
6
-
7
88
  /**
8
89
  * Declarative fields that describe component metadata.
9
90
  */
@@ -68,6 +149,16 @@ interface ComponentMetadata {
68
149
  * project them into concrete helper functions for TS-first workflows.
69
150
  */
70
151
  readonly authoring?: AuthoringContributions;
152
+ /**
153
+ * Scalar type name to codec ID mapping contributed by this component.
154
+ * Assembled by `createControlStack` with duplicate detection.
155
+ */
156
+ readonly scalarTypeDescriptors?: ReadonlyMap<string, string>;
157
+ /**
158
+ * Mutation default function handlers and generator descriptors contributed
159
+ * by this component. Assembled by `createControlStack` with duplicate detection.
160
+ */
161
+ readonly controlMutationDefaults?: ControlMutationDefaults;
71
162
  }
72
163
  /**
73
164
  * Base descriptor for any framework component.
@@ -329,5 +420,5 @@ interface ExtensionInstance<TFamilyId extends string, TTargetId extends string>
329
420
  readonly targetId: TTargetId;
330
421
  }
331
422
  //#endregion
332
- export { checkContractComponentRequirements as S, PackRefBase as _, ComponentMetadata as a, TargetInstance as b, DriverDescriptor as c, ExtensionDescriptor as d, ExtensionInstance as f, FamilyPackRef as g, FamilyInstance as h, ComponentDescriptor as i, DriverInstance as l, FamilyDescriptor as m, AdapterInstance as n, ContractComponentRequirementsCheckInput as o, ExtensionPackRef as p, AdapterPackRef as r, ContractComponentRequirementsCheckResult as s, AdapterDescriptor as t, DriverPackRef as u, TargetBoundComponentDescriptor as v, TargetPackRef as x, TargetDescriptor as y };
333
- //# sourceMappingURL=framework-components-DoWmh6GH.d.mts.map
423
+ export { LoweredDefaultResult as A, ControlMutationDefaultEntry as C, DefaultFunctionLoweringHandler as D, DefaultFunctionLoweringContext as E, SourceSpan as F, MutationDefaultGeneratorDescriptor as M, ParsedDefaultFunctionCall as N, DefaultFunctionRegistry as O, SourceDiagnostic as P, checkContractComponentRequirements as S, ControlMutationDefaults as T, PackRefBase as _, ComponentMetadata as a, TargetInstance as b, DriverDescriptor as c, ExtensionDescriptor as d, ExtensionInstance as f, FamilyPackRef as g, FamilyInstance as h, ComponentDescriptor as i, LoweredDefaultValue as j, DefaultFunctionRegistryEntry as k, DriverInstance as l, FamilyDescriptor as m, AdapterInstance as n, ContractComponentRequirementsCheckInput as o, ExtensionPackRef as p, AdapterPackRef as r, ContractComponentRequirementsCheckResult as s, AdapterDescriptor as t, DriverPackRef as u, TargetBoundComponentDescriptor as v, ControlMutationDefaultRegistry as w, TargetPackRef as x, TargetDescriptor as y };
424
+ //# sourceMappingURL=framework-components-EJXe-pum.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework-components-EJXe-pum.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,IAAA,EAAA,MAAA;EAET,SAAA,GAAA,EAAA,MAAA;EAKL,SAAA,IAAA,EAAA,SA7Bc,uBA6BgC,EAAA;EAEzC,SAAA,IAAA,EA9BA,UA8BA;AAejB;AAEmB,UA5CF,8BAAA,CA4CE;EACG,SAAA,QAAA,EAAA,MAAA;EACd,SAAA,SAAA,EAAA,MAAA;EAAoB,SAAA,SAAA,EAAA,MAAA;EAIhB,SAAA,aAAA,CAAA,EAA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AGR,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"}
@@ -10,4 +10,4 @@ interface TypesImportSpec {
10
10
  }
11
11
  //#endregion
12
12
  export { TypesImportSpec as t };
13
- //# sourceMappingURL=types-import-spec-Ddp4fNmt.d.mts.map
13
+ //# sourceMappingURL=types-import-spec-C4sc7wbb.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-import-spec-C4sc7wbb.d.mts","names":[],"sources":["../src/types-import-spec.ts"],"sourcesContent":[],"mappings":";;AAIA;;;UAAiB,eAAA"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@prisma-next/framework-components",
3
- "version": "0.4.0-dev.2",
3
+ "version": "0.4.0-dev.3",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Framework component types, assembly logic, and stack creation for Prisma Next",
7
7
  "dependencies": {
8
- "@prisma-next/contract": "0.4.0-dev.2",
9
- "@prisma-next/operations": "0.4.0-dev.2",
10
- "@prisma-next/utils": "0.4.0-dev.2"
8
+ "@prisma-next/contract": "0.4.0-dev.3",
9
+ "@prisma-next/utils": "0.4.0-dev.3",
10
+ "@prisma-next/operations": "0.4.0-dev.3"
11
11
  },
12
12
  "devDependencies": {
13
13
  "tsdown": "0.18.4",
@@ -14,6 +14,11 @@ import type {
14
14
  AuthoringTypeNamespace,
15
15
  } from './framework-authoring';
16
16
  import type { ComponentMetadata } from './framework-components';
17
+ import type {
18
+ ControlMutationDefaultEntry,
19
+ ControlMutationDefaults,
20
+ MutationDefaultGeneratorDescriptor,
21
+ } from './mutation-default-types';
17
22
  import type { TypesImportSpec } from './types-import-spec';
18
23
 
19
24
  export interface AssembledAuthoringContributions {
@@ -37,6 +42,8 @@ export interface ControlStack<
37
42
  readonly extensionIds: ReadonlyArray<string>;
38
43
  readonly codecLookup: CodecLookup;
39
44
  readonly authoringContributions: AssembledAuthoringContributions;
45
+ readonly scalarTypeDescriptors: ReadonlyMap<string, string>;
46
+ readonly controlMutationDefaults: ControlMutationDefaults;
40
47
  }
41
48
 
42
49
  export interface CreateControlStackInput<
@@ -244,6 +251,80 @@ export function assembleAuthoringContributions(
244
251
  };
245
252
  }
246
253
 
254
+ export function assembleScalarTypeDescriptors(
255
+ descriptors: ReadonlyArray<
256
+ Pick<ComponentMetadata, 'scalarTypeDescriptors'> & { readonly id?: string }
257
+ >,
258
+ ): ReadonlyMap<string, string> {
259
+ const result = new Map<string, string>();
260
+ const owners = new Map<string, string>();
261
+
262
+ for (const descriptor of descriptors) {
263
+ const descriptorMap = descriptor.scalarTypeDescriptors;
264
+ if (!descriptorMap) continue;
265
+ const descriptorId = descriptor.id ?? '<unknown>';
266
+ for (const [typeName, codecId] of descriptorMap) {
267
+ const existingOwner = owners.get(typeName);
268
+ if (existingOwner !== undefined) {
269
+ throw new Error(
270
+ `Duplicate scalar type descriptor "${typeName}". ` +
271
+ `Descriptor "${descriptorId}" conflicts with "${existingOwner}".`,
272
+ );
273
+ }
274
+ result.set(typeName, codecId);
275
+ owners.set(typeName, descriptorId);
276
+ }
277
+ }
278
+
279
+ return result;
280
+ }
281
+
282
+ export function assembleControlMutationDefaults(
283
+ descriptors: ReadonlyArray<
284
+ Pick<ComponentMetadata, 'controlMutationDefaults'> & { readonly id?: string }
285
+ >,
286
+ ): ControlMutationDefaults {
287
+ const defaultFunctionRegistry = new Map<string, ControlMutationDefaultEntry>();
288
+ const functionOwners = new Map<string, string>();
289
+ const generatorMap = new Map<string, MutationDefaultGeneratorDescriptor>();
290
+ const generatorOwners = new Map<string, string>();
291
+
292
+ for (const descriptor of descriptors) {
293
+ const contributions = descriptor.controlMutationDefaults;
294
+ if (!contributions) continue;
295
+ const descriptorId = descriptor.id ?? '<unknown>';
296
+
297
+ for (const generatorDescriptor of contributions.generatorDescriptors) {
298
+ const existingOwner = generatorOwners.get(generatorDescriptor.id);
299
+ if (existingOwner !== undefined) {
300
+ throw new Error(
301
+ `Duplicate mutation default generator id "${generatorDescriptor.id}". ` +
302
+ `Descriptor "${descriptorId}" conflicts with "${existingOwner}".`,
303
+ );
304
+ }
305
+ generatorMap.set(generatorDescriptor.id, generatorDescriptor);
306
+ generatorOwners.set(generatorDescriptor.id, descriptorId);
307
+ }
308
+
309
+ for (const [functionName, handler] of contributions.defaultFunctionRegistry) {
310
+ const existingOwner = functionOwners.get(functionName);
311
+ if (existingOwner !== undefined) {
312
+ throw new Error(
313
+ `Duplicate mutation default function "${functionName}". ` +
314
+ `Descriptor "${descriptorId}" conflicts with "${existingOwner}".`,
315
+ );
316
+ }
317
+ defaultFunctionRegistry.set(functionName, handler);
318
+ functionOwners.set(functionName, descriptorId);
319
+ }
320
+ }
321
+
322
+ return {
323
+ defaultFunctionRegistry,
324
+ generatorDescriptors: Array.from(generatorMap.values()),
325
+ };
326
+ }
327
+
247
328
  export function extractCodecLookup(
248
329
  descriptors: ReadonlyArray<Pick<ComponentMetadata & { id?: string }, 'types' | 'id'>>,
249
330
  ): CodecLookup {
@@ -268,6 +349,21 @@ export function extractCodecLookup(
268
349
  return { get: (id) => byId.get(id) };
269
350
  }
270
351
 
352
+ export function validateScalarTypeCodecIds(
353
+ scalarTypeDescriptors: ReadonlyMap<string, string>,
354
+ codecLookup: CodecLookup,
355
+ ): string[] {
356
+ const errors: string[] = [];
357
+ for (const [typeName, codecId] of scalarTypeDescriptors) {
358
+ if (!codecLookup.get(codecId)) {
359
+ errors.push(
360
+ `Scalar type "${typeName}" references codec "${codecId}" which is not registered by any component.`,
361
+ );
362
+ }
363
+ }
364
+ return errors;
365
+ }
366
+
271
367
  export function createControlStack<TFamilyId extends string, TTargetId extends string>(
272
368
  input: CreateControlStackInput<TFamilyId, TTargetId>,
273
369
  ): ControlStack<TFamilyId, TTargetId> {
@@ -275,6 +371,9 @@ export function createControlStack<TFamilyId extends string, TTargetId extends s
275
371
 
276
372
  const allDescriptors = [family, target, ...(adapter ? [adapter] : []), ...extensionPacks];
277
373
 
374
+ const codecLookup = extractCodecLookup(allDescriptors);
375
+ const scalarTypeDescriptors = assembleScalarTypeDescriptors(allDescriptors);
376
+
278
377
  return {
279
378
  family,
280
379
  target,
@@ -286,7 +385,9 @@ export function createControlStack<TFamilyId extends string, TTargetId extends s
286
385
  operationTypeImports: extractOperationTypeImports(allDescriptors),
287
386
  queryOperationTypeImports: extractQueryOperationTypeImports(allDescriptors),
288
387
  extensionIds: extractComponentIds(family, target, adapter, extensionPacks),
289
- codecLookup: extractCodecLookup(allDescriptors),
388
+ codecLookup,
290
389
  authoringContributions: assembleAuthoringContributions(allDescriptors),
390
+ scalarTypeDescriptors,
391
+ controlMutationDefaults: assembleControlMutationDefaults(allDescriptors),
291
392
  };
292
393
  }
@@ -66,6 +66,8 @@ export type {
66
66
  } from '../control-stack';
67
67
  export {
68
68
  assembleAuthoringContributions,
69
+ assembleControlMutationDefaults,
70
+ assembleScalarTypeDescriptors,
69
71
  assertUniqueCodecOwner,
70
72
  createControlStack,
71
73
  extractCodecLookup,
@@ -74,3 +76,18 @@ export {
74
76
  extractOperationTypeImports,
75
77
  extractQueryOperationTypeImports,
76
78
  } from '../control-stack';
79
+ export type {
80
+ ControlMutationDefaultEntry,
81
+ ControlMutationDefaultRegistry,
82
+ ControlMutationDefaults,
83
+ DefaultFunctionLoweringContext,
84
+ DefaultFunctionLoweringHandler,
85
+ DefaultFunctionRegistry,
86
+ DefaultFunctionRegistryEntry,
87
+ LoweredDefaultResult,
88
+ LoweredDefaultValue,
89
+ MutationDefaultGeneratorDescriptor,
90
+ ParsedDefaultFunctionCall,
91
+ SourceDiagnostic,
92
+ SourceSpan,
93
+ } from '../mutation-default-types';
@@ -1,5 +1,6 @@
1
1
  import type { Codec } from './codec-types';
2
2
  import type { AuthoringContributions } from './framework-authoring';
3
+ import type { ControlMutationDefaults } from './mutation-default-types';
3
4
  import type { TypesImportSpec } from './types-import-spec';
4
5
 
5
6
  /**
@@ -65,6 +66,18 @@ export interface ComponentMetadata {
65
66
  * project them into concrete helper functions for TS-first workflows.
66
67
  */
67
68
  readonly authoring?: AuthoringContributions;
69
+
70
+ /**
71
+ * Scalar type name to codec ID mapping contributed by this component.
72
+ * Assembled by `createControlStack` with duplicate detection.
73
+ */
74
+ readonly scalarTypeDescriptors?: ReadonlyMap<string, string>;
75
+
76
+ /**
77
+ * Mutation default function handlers and generator descriptors contributed
78
+ * by this component. Assembled by `createControlStack` with duplicate detection.
79
+ */
80
+ readonly controlMutationDefaults?: ControlMutationDefaults;
68
81
  }
69
82
 
70
83
  /**
@@ -0,0 +1,89 @@
1
+ import type { ColumnDefault, ExecutionMutationDefaultValue } from '@prisma-next/contract/types';
2
+
3
+ interface SourcePosition {
4
+ readonly offset: number;
5
+ readonly line: number;
6
+ readonly column: number;
7
+ }
8
+
9
+ export interface SourceSpan {
10
+ readonly start: SourcePosition;
11
+ readonly end: SourcePosition;
12
+ }
13
+
14
+ export interface SourceDiagnostic {
15
+ readonly code: string;
16
+ readonly message: string;
17
+ readonly sourceId?: string;
18
+ readonly span?: SourceSpan;
19
+ readonly data?: Readonly<Record<string, unknown>>;
20
+ }
21
+
22
+ interface DefaultFunctionArgument {
23
+ readonly raw: string;
24
+ readonly span: SourceSpan;
25
+ }
26
+
27
+ export interface ParsedDefaultFunctionCall {
28
+ readonly name: string;
29
+ readonly raw: string;
30
+ readonly args: readonly DefaultFunctionArgument[];
31
+ readonly span: SourceSpan;
32
+ }
33
+
34
+ export interface DefaultFunctionLoweringContext {
35
+ readonly sourceId: string;
36
+ readonly modelName: string;
37
+ readonly fieldName: string;
38
+ readonly columnCodecId?: string;
39
+ }
40
+
41
+ export type LoweredDefaultValue =
42
+ | { readonly kind: 'storage'; readonly defaultValue: ColumnDefault }
43
+ | { readonly kind: 'execution'; readonly generated: ExecutionMutationDefaultValue };
44
+
45
+ export type LoweredDefaultResult =
46
+ | { readonly ok: true; readonly value: LoweredDefaultValue }
47
+ | { readonly ok: false; readonly diagnostic: SourceDiagnostic };
48
+
49
+ export type DefaultFunctionLoweringHandler = (input: {
50
+ readonly call: ParsedDefaultFunctionCall;
51
+ readonly context: DefaultFunctionLoweringContext;
52
+ }) => LoweredDefaultResult;
53
+
54
+ export interface DefaultFunctionRegistryEntry {
55
+ readonly lower: DefaultFunctionLoweringHandler;
56
+ readonly usageSignatures?: readonly string[];
57
+ }
58
+
59
+ export type DefaultFunctionRegistry = ReadonlyMap<string, DefaultFunctionRegistryEntry>;
60
+
61
+ export interface MutationDefaultGeneratorDescriptor {
62
+ readonly id: string;
63
+ readonly applicableCodecIds: readonly string[];
64
+ readonly resolveGeneratedColumnDescriptor?: (input: {
65
+ readonly generated: ExecutionMutationDefaultValue;
66
+ }) =>
67
+ | {
68
+ readonly codecId: string;
69
+ readonly nativeType: string;
70
+ readonly typeRef?: string;
71
+ readonly typeParams?: Record<string, unknown>;
72
+ }
73
+ | undefined;
74
+ }
75
+
76
+ export interface ControlMutationDefaultEntry {
77
+ readonly lower: (input: {
78
+ readonly call: ParsedDefaultFunctionCall;
79
+ readonly context: DefaultFunctionLoweringContext;
80
+ }) => LoweredDefaultResult;
81
+ readonly usageSignatures?: readonly string[];
82
+ }
83
+
84
+ export type ControlMutationDefaultRegistry = ReadonlyMap<string, ControlMutationDefaultEntry>;
85
+
86
+ export interface ControlMutationDefaults {
87
+ readonly defaultFunctionRegistry: ControlMutationDefaultRegistry;
88
+ readonly generatorDescriptors: readonly MutationDefaultGeneratorDescriptor[];
89
+ }
@@ -1 +0,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