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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +31 -0
  2. package/dist/authoring.d.mts +1 -1
  3. package/dist/authoring.mjs +1 -1
  4. package/dist/authoring.mjs.map +1 -1
  5. package/dist/{codec-types-DQ1Agjom.d.mts → codec-types-DXv-ROhF.d.mts} +33 -7
  6. package/dist/codec-types-DXv-ROhF.d.mts.map +1 -0
  7. package/dist/codec.d.mts +2 -2
  8. package/dist/codec.mjs +1 -1
  9. package/dist/codec.mjs.map +1 -1
  10. package/dist/components.d.mts +1 -1
  11. package/dist/components.mjs +1 -1
  12. package/dist/control.d.mts +54 -13
  13. package/dist/control.d.mts.map +1 -1
  14. package/dist/control.mjs +11 -5
  15. package/dist/control.mjs.map +1 -1
  16. package/dist/{emission-types-BPAALJbF.d.mts → emission-types-D234HxUz.d.mts} +3 -3
  17. package/dist/emission-types-D234HxUz.d.mts.map +1 -0
  18. package/dist/emission.d.mts +2 -2
  19. package/dist/execution.d.mts +5 -5
  20. package/dist/execution.d.mts.map +1 -1
  21. package/dist/execution.mjs +3 -3
  22. package/dist/execution.mjs.map +1 -1
  23. package/dist/{framework-authoring-D1-JZ37B.d.mts → framework-authoring-BdrFDx4x.d.mts} +2 -2
  24. package/dist/framework-authoring-BdrFDx4x.d.mts.map +1 -0
  25. package/dist/{framework-components-C8ZhSwXe.mjs → framework-components-BsWST1Rn.mjs} +2 -2
  26. package/dist/framework-components-BsWST1Rn.mjs.map +1 -0
  27. package/dist/{framework-components-DFZMi2h7.d.mts → framework-components-Buvf7mnC.d.mts} +6 -6
  28. package/dist/framework-components-Buvf7mnC.d.mts.map +1 -0
  29. package/dist/psl-ast-9X5rwo98.d.mts +159 -0
  30. package/dist/psl-ast-9X5rwo98.d.mts.map +1 -0
  31. package/dist/psl-ast.d.mts +2 -0
  32. package/dist/psl-ast.mjs +1 -0
  33. package/dist/runtime.d.mts +110 -25
  34. package/dist/runtime.d.mts.map +1 -1
  35. package/dist/runtime.mjs +103 -8
  36. package/dist/runtime.mjs.map +1 -1
  37. package/dist/{types-import-spec-C4sc7wbb.d.mts → types-import-spec-D-O6GotH.d.mts} +2 -2
  38. package/dist/types-import-spec-D-O6GotH.d.mts.map +1 -0
  39. package/package.json +5 -4
  40. package/src/control/control-capabilities.ts +71 -0
  41. package/src/{control-descriptors.ts → control/control-descriptors.ts} +7 -7
  42. package/src/{control-instances.ts → control/control-instances.ts} +6 -6
  43. package/src/{control-migration-types.ts → control/control-migration-types.ts} +1 -1
  44. package/src/control/control-operation-preview.ts +23 -0
  45. package/src/{control-stack.ts → control/control-stack.ts} +13 -13
  46. package/src/{emission-types.ts → control/emission-types.ts} +1 -1
  47. package/src/control/psl-ast.ts +193 -0
  48. package/src/{execution-descriptors.ts → execution/execution-descriptors.ts} +7 -7
  49. package/src/{execution-instances.ts → execution/execution-instances.ts} +1 -1
  50. package/src/{execution-requirements.ts → execution/execution-requirements.ts} +1 -1
  51. package/src/execution/race-against-abort.ts +85 -0
  52. package/src/{runtime-core.ts → execution/runtime-core.ts} +27 -3
  53. package/src/{runtime-error.ts → execution/runtime-error.ts} +28 -0
  54. package/src/{runtime-middleware.ts → execution/runtime-middleware.ts} +17 -1
  55. package/src/exports/authoring.ts +2 -2
  56. package/src/exports/codec.ts +2 -2
  57. package/src/exports/components.ts +2 -2
  58. package/src/exports/control.ts +26 -12
  59. package/src/exports/emission.ts +2 -2
  60. package/src/exports/execution.ts +5 -5
  61. package/src/exports/psl-ast.ts +1 -0
  62. package/src/exports/runtime.ts +16 -9
  63. package/src/{codec-types.ts → shared/codec-types.ts} +31 -4
  64. package/dist/codec-types-DQ1Agjom.d.mts.map +0 -1
  65. package/dist/emission-types-BPAALJbF.d.mts.map +0 -1
  66. package/dist/framework-authoring-D1-JZ37B.d.mts.map +0 -1
  67. package/dist/framework-components-C8ZhSwXe.mjs.map +0 -1
  68. package/dist/framework-components-DFZMi2h7.d.mts.map +0 -1
  69. package/dist/types-import-spec-C4sc7wbb.d.mts.map +0 -1
  70. package/src/control-capabilities.ts +0 -34
  71. /package/src/{control-result-types.ts → control/control-result-types.ts} +0 -0
  72. /package/src/{control-schema-view.ts → control/control-schema-view.ts} +0 -0
  73. /package/src/{async-iterable-result.ts → execution/async-iterable-result.ts} +0 -0
  74. /package/src/{execution-stack.ts → execution/execution-stack.ts} +0 -0
  75. /package/src/{query-plan.ts → execution/query-plan.ts} +0 -0
  76. /package/src/{run-with-middleware.ts → execution/run-with-middleware.ts} +0 -0
  77. /package/src/{framework-authoring.ts → shared/framework-authoring.ts} +0 -0
  78. /package/src/{framework-components.ts → shared/framework-components.ts} +0 -0
  79. /package/src/{mutation-default-types.ts → shared/mutation-default-types.ts} +0 -0
  80. /package/src/{types-import-spec.ts → shared/types-import-spec.ts} +0 -0
@@ -1 +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 {\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,I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eAAgB;EACrB,MAAM,eAAe,WAAW,MAAM;AACtC,OAAK,MAAM,SAAS,gBAAgB;AAClC,0BAAuB;IACrB,SAAS,MAAM;IACf;IACA;IACA,aAAa;IACb,sBAAsB;IACvB,CAAC;AACF,UAAO,IAAI,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
+ {"version":3,"file":"control.mjs","names":["imports: TypesImportSpec[]","ids: string[]"],"sources":["../src/control/control-capabilities.ts","../src/control/control-result-types.ts","../src/control/control-schema-view.ts","../src/control/control-stack.ts"],"sourcesContent":["import type { ControlTargetDescriptor } from './control-descriptors';\nimport type { ControlFamilyInstance } from './control-instances';\nimport type { MigrationPlanOperation, TargetMigrationsCapability } from './control-migration-types';\nimport type { OperationPreview } from './control-operation-preview';\nimport type { CoreSchemaView } from './control-schema-view';\nimport type { PslDocumentAst } from './psl-ast';\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\n/**\n * Capability declaring that a family can infer a PSL contract AST from its\n * opaque introspected schema IR. Consumed by `prisma-next contract infer`.\n */\nexport interface PslContractInferCapable<TSchemaIR = unknown> {\n inferPslContract(schemaIR: TSchemaIR): PslDocumentAst;\n}\n\nexport function hasPslContractInfer<TFamilyId extends string, TSchemaIR>(\n instance: ControlFamilyInstance<TFamilyId, TSchemaIR>,\n): instance is ControlFamilyInstance<TFamilyId, TSchemaIR> & PslContractInferCapable<TSchemaIR> {\n return (\n 'inferPslContract' in instance &&\n typeof (instance as Record<string, unknown>)['inferPslContract'] === 'function'\n );\n}\n\n/**\n * Capability declaring that a family can render a textual preview of migration\n * operations for the CLI's \"DDL preview\" output. SQL families emit\n * `language: 'sql'` statements; Mongo families emit `language: 'mongodb-shell'`.\n */\nexport interface OperationPreviewCapable {\n toOperationPreview(operations: readonly MigrationPlanOperation[]): OperationPreview;\n}\n\nexport function hasOperationPreview<TFamilyId extends string, TSchemaIR>(\n instance: ControlFamilyInstance<TFamilyId, TSchemaIR>,\n): instance is ControlFamilyInstance<TFamilyId, TSchemaIR> & OperationPreviewCapable {\n return (\n 'toOperationPreview' in instance &&\n typeof (instance as Record<string, unknown>)['toOperationPreview'] === '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 '../shared/codec-types';\nimport type {\n AuthoringContributions,\n AuthoringFieldNamespace,\n AuthoringFieldPresetDescriptor,\n AuthoringTypeConstructorDescriptor,\n AuthoringTypeNamespace,\n} from '../shared/framework-authoring';\nimport type { ComponentMetadata } from '../shared/framework-components';\nimport type {\n ControlMutationDefaultEntry,\n ControlMutationDefaults,\n MutationDefaultGeneratorDescriptor,\n} from '../shared/mutation-default-types';\nimport type { TypesImportSpec } from '../shared/types-import-spec';\nimport type {\n ControlAdapterDescriptor,\n ControlDriverDescriptor,\n ControlExtensionDescriptor,\n ControlFamilyDescriptor,\n ControlTargetDescriptor,\n} from './control-descriptors';\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('../shared/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":";AAkBA,SAAgB,cACd,QAC4D;AAC5D,QAAO,gBAAgB,UAAU,CAAC,CAAE,OAAmC;;AAOzE,SAAgB,cACd,UACwF;AACxF,QACE,kBAAkB,YAClB,OAAQ,SAAqC,oBAAoB;;AAYrE,SAAgB,oBACd,UAC8F;AAC9F,QACE,sBAAsB,YACtB,OAAQ,SAAqC,wBAAwB;;AAazE,SAAgB,oBACd,UACmF;AACnF,QACE,wBAAwB,YACxB,OAAQ,SAAqC,0BAA0B;;;;;ACpE3E,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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B;EACrB,MAAM,eAAe,WAAW,MAAM;AACtC,OAAK,MAAM,SAAS,gBAAgB;AAClC,0BAAuB;IACrB,SAAS,MAAM;IACf;IACA;IACA,aAAa;IACb,sBAAsB;IACvB,CAAC;AACF,UAAO,IAAI,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,7 +1,7 @@
1
- import { t as TypesImportSpec } from "./types-import-spec-C4sc7wbb.mjs";
1
+ import { t as TypesImportSpec } from "./types-import-spec-D-O6GotH.mjs";
2
2
  import { Contract, ContractModel } from "@prisma-next/contract/types";
3
3
 
4
- //#region src/emission-types.d.ts
4
+ //#region src/control/emission-types.d.ts
5
5
  interface GenerateContractTypesOptions {
6
6
  readonly queryOperationTypeImports?: ReadonlyArray<TypesImportSpec>;
7
7
  }
@@ -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-BPAALJbF.d.mts.map
24
+ //# sourceMappingURL=emission-types-D234HxUz.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emission-types-D234HxUz.d.mts","names":[],"sources":["../src/control/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-C4sc7wbb.mjs";
2
- import { n as GenerateContractTypesOptions, r as ValidationContext, t as EmissionSpi } from "./emission-types-BPAALJbF.mjs";
1
+ import { t as TypesImportSpec } from "./types-import-spec-D-O6GotH.mjs";
2
+ import { n as GenerateContractTypesOptions, r as ValidationContext, t as EmissionSpi } from "./emission-types-D234HxUz.mjs";
3
3
  export { type EmissionSpi, type GenerateContractTypesOptions, type TypesImportSpec, type ValidationContext };
@@ -1,13 +1,13 @@
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-DFZMi2h7.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-Buvf7mnC.mjs";
2
2
 
3
- //#region src/execution-instances.d.ts
3
+ //#region src/execution/execution-instances.d.ts
4
4
  interface RuntimeFamilyInstance<TFamilyId extends string> extends FamilyInstance<TFamilyId> {}
5
5
  interface RuntimeTargetInstance<TFamilyId extends string, TTargetId extends string> extends TargetInstance<TFamilyId, TTargetId> {}
6
6
  interface RuntimeAdapterInstance<TFamilyId extends string, TTargetId extends string> extends AdapterInstance<TFamilyId, TTargetId> {}
7
7
  interface RuntimeDriverInstance<TFamilyId extends string, TTargetId extends string> extends DriverInstance<TFamilyId, TTargetId> {}
8
8
  interface RuntimeExtensionInstance<TFamilyId extends string, TTargetId extends string> extends ExtensionInstance<TFamilyId, TTargetId> {}
9
9
  //#endregion
10
- //#region src/execution-stack.d.ts
10
+ //#region src/execution/execution-stack.d.ts
11
11
  interface ExecutionStack<TFamilyId extends string, TTargetId extends string, TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<TFamilyId, TTargetId>, TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<TFamilyId, TTargetId>, TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId> = RuntimeExtensionInstance<TFamilyId, TTargetId>> {
12
12
  readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;
13
13
  readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId, TAdapterInstance>;
@@ -34,7 +34,7 @@ declare function createExecutionStack<TFamilyId extends string, TTargetId extend
34
34
  };
35
35
  declare function instantiateExecutionStack<TFamilyId extends string, TTargetId extends string, TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId>, TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId>, TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId>>(stack: ExecutionStack<TFamilyId, TTargetId, TAdapterInstance, TDriverInstance, TExtensionInstance>): ExecutionStackInstance<TFamilyId, TTargetId, TAdapterInstance, TDriverInstance, TExtensionInstance>;
36
36
  //#endregion
37
- //#region src/execution-descriptors.d.ts
37
+ //#region src/execution/execution-descriptors.d.ts
38
38
  interface RuntimeFamilyDescriptor<TFamilyId extends string, TFamilyInstance extends RuntimeFamilyInstance<TFamilyId> = RuntimeFamilyInstance<TFamilyId>> extends FamilyDescriptor<TFamilyId> {
39
39
  create<TTargetId extends string>(options: {
40
40
  readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;
@@ -63,7 +63,7 @@ interface RuntimeExtensionDescriptor<TFamilyId extends string, TTargetId extends
63
63
  create(): TExtensionInstance;
64
64
  }
65
65
  //#endregion
66
- //#region src/execution-requirements.d.ts
66
+ //#region src/execution/execution-requirements.d.ts
67
67
  declare function assertRuntimeContractRequirementsSatisfied<TFamilyId extends string, TTargetId extends string>({
68
68
  contract,
69
69
  family,
@@ -1 +1 @@
1
- {"version":3,"file":"execution.d.mts","names":[],"sources":["../src/execution-instances.ts","../src/execution-stack.ts","../src/execution-descriptors.ts","../src/execution-requirements.ts"],"sourcesContent":[],"mappings":";;;UAQiB,wDACP,eAAe;AADR,UAGA,qBAHqB,CAAA,kBACb,MAAf,EAAA,kBAAc,MAAA,CAAA,SAGd,cAHc,CAGC,SAHD,EAGY,SAHZ,CAAA,CAAA,CAExB;AACyB,UAER,sBAFQ,CAAA,kBAAA,MAAA,EAAA,kBAAA,MAAA,CAAA,SAGf,eAHe,CAGC,SAHD,EAGY,SAHZ,CAAA,CAAA;AAAf,UAKO,qBALP,CAAA,kBAAA,MAAA,EAAA,kBAAA,MAAA,CAAA,SAMA,cANA,CAMe,SANf,EAM0B,SAN1B,CAAA,CAAA;AAEO,UAMA,wBANsB,CAAA,kBAAA,MAAA,EAAA,kBAAA,MAAA,CAAA,SAO7B,iBAP6B,CAO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B,CE6BV,SF7BU,EE6BC,SF7BD,CAAA,CAAA;EACb;;;;AAEzB;;;EACU,MAAA,CAAA,KAAA,EEiCM,cFjCN,CEiCqB,SFjCrB,EEiCgC,SFjChC,CAAA,CAAA,EEiC6C,gBFjC7C;;UEoCO,2HAIS,sBAAsB,WAAW,aAAa,sBACpE,WACA,oBAEM,iBAAiB,WAAW;mBACnB,iBAAiB;;ADrDnB,UCwDA,0BDxDc,CAAA,kBAAA,MAAA,EAAA,kBAAA,MAAA,EAAA,2BC2DF,wBD3DE,CC4D3B,SD5D2B,EC6D3B,SD7D2B,CAAA,GC8DzB,wBD9DyB,CC8DA,SD9DA,EC8DW,SD9DX,CAAA,CAAA,SC+DrB,mBD/DqB,CC+DD,SD/DC,EC+DU,SD/DV,CAAA,CAAA;EAGmB,MAAA,EAAA,EC6DtC,kBD7DsC;;;;iBERlC;;;;;;;;IHAC,SAAA,MAAA,EAAA,MAAqB;IAGrB,SAAA,cAAqB,CAAA,EGOoC,MHPpC,CAAA,MAAA,EAAA,OAAA,CAAA;EACb,CAAA;EAAW,SAAA,MAAA,EGOjB,uBHPiB,CGOO,SHPP,CAAA;EAA1B,SAAA,MAAA,EGQS,uBHRT,CGQiC,SHRjC,EGQ4C,SHR5C,CAAA;EAAc,SAAA,OAAA,EGSJ,wBHTI,CGSqB,SHTrB,EGSgC,SHThC,CAAA;EAEP,SAAA,cAAA,EAAsB,SGQH,0BHRG,CGQwB,SHRxB,EGQmC,SHRnC,CAAA,EAAA;CACb,CAAA,EAAA,IAAA"}
1
+ {"version":3,"file":"execution.d.mts","names":[],"sources":["../src/execution/execution-instances.ts","../src/execution/execution-stack.ts","../src/execution/execution-descriptors.ts","../src/execution/execution-requirements.ts"],"sourcesContent":[],"mappings":";;;UAQiB,wDACP,eAAe;AADR,UAGA,qBAHqB,CAAA,kBACb,MAAf,EAAA,kBAAc,MAAA,CAAA,SAGd,cAHc,CAGC,SAHD,EAGY,SAHZ,CAAA,CAAA,CAExB;AACyB,U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AAA,EAAA,IAAA"}
@@ -1,6 +1,6 @@
1
- import { t as checkContractComponentRequirements } from "./framework-components-C8ZhSwXe.mjs";
1
+ import { t as checkContractComponentRequirements } from "./framework-components-BsWST1Rn.mjs";
2
2
 
3
- //#region src/execution-requirements.ts
3
+ //#region src/execution/execution-requirements.ts
4
4
  function assertRuntimeContractRequirementsSatisfied({ contract, family, target, adapter, extensionPacks }) {
5
5
  const providedComponentIds = new Set([
6
6
  family.id,
@@ -18,7 +18,7 @@ function assertRuntimeContractRequirementsSatisfied({ contract, family, target,
18
18
  }
19
19
 
20
20
  //#endregion
21
- //#region src/execution-stack.ts
21
+ //#region src/execution/execution-stack.ts
22
22
  function createExecutionStack(input) {
23
23
  return {
24
24
  target: input.target,
@@ -1 +1 @@
1
- {"version":3,"file":"execution.mjs","names":[],"sources":["../src/execution-requirements.ts","../src/execution-stack.ts"],"sourcesContent":["import type {\n RuntimeAdapterDescriptor,\n RuntimeExtensionDescriptor,\n RuntimeFamilyDescriptor,\n RuntimeTargetDescriptor,\n} from './execution-descriptors';\nimport { checkContractComponentRequirements } from './framework-components';\n\nexport function assertRuntimeContractRequirementsSatisfied<\n TFamilyId extends string,\n TTargetId extends string,\n>({\n contract,\n family,\n target,\n adapter,\n extensionPacks,\n}: {\n readonly contract: { readonly target: string; readonly extensionPacks?: Record<string, unknown> };\n readonly family: RuntimeFamilyDescriptor<TFamilyId>;\n readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId>;\n readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[];\n}): void {\n const providedComponentIds = new Set<string>([family.id, target.id, adapter.id]);\n for (const extension of extensionPacks) {\n providedComponentIds.add(extension.id);\n }\n\n const result = checkContractComponentRequirements({\n contract,\n expectedTargetId: target.targetId,\n providedComponentIds,\n });\n\n if (result.targetMismatch) {\n throw new Error(\n `Contract target '${result.targetMismatch.actual}' does not match runtime target descriptor '${result.targetMismatch.expected}'.`,\n );\n }\n\n for (const packId of result.missingExtensionPackIds) {\n throw new Error(\n `Contract requires extension pack '${packId}', but runtime descriptors do not provide a matching component.`,\n );\n }\n}\n","import type {\n RuntimeAdapterDescriptor,\n RuntimeDriverDescriptor,\n RuntimeExtensionDescriptor,\n RuntimeTargetDescriptor,\n} from './execution-descriptors';\nimport type {\n RuntimeAdapterInstance,\n RuntimeDriverInstance,\n RuntimeExtensionInstance,\n RuntimeTargetInstance,\n} from './execution-instances';\n\nexport interface ExecutionStack<\n TFamilyId extends string,\n TTargetId extends string,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<\n TFamilyId,\n TTargetId\n >,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<\n TFamilyId,\n TTargetId\n >,\n TExtensionInstance extends RuntimeExtensionInstance<\n TFamilyId,\n TTargetId\n > = RuntimeExtensionInstance<TFamilyId, TTargetId>,\n> {\n readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId, TAdapterInstance>;\n readonly driver:\n | RuntimeDriverDescriptor<TFamilyId, TTargetId, unknown, TDriverInstance>\n | undefined;\n readonly extensionPacks: readonly RuntimeExtensionDescriptor<\n TFamilyId,\n TTargetId,\n TExtensionInstance\n >[];\n}\n\nexport interface ExecutionStackInstance<\n TFamilyId extends string,\n TTargetId extends string,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<\n TFamilyId,\n TTargetId\n >,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<\n TFamilyId,\n TTargetId\n >,\n TExtensionInstance extends RuntimeExtensionInstance<\n TFamilyId,\n TTargetId\n > = RuntimeExtensionInstance<TFamilyId, TTargetId>,\n> {\n readonly stack: ExecutionStack<\n TFamilyId,\n TTargetId,\n TAdapterInstance,\n TDriverInstance,\n TExtensionInstance\n >;\n readonly target: RuntimeTargetInstance<TFamilyId, TTargetId>;\n readonly adapter: TAdapterInstance;\n readonly driver: TDriverInstance | undefined;\n readonly extensionPacks: readonly TExtensionInstance[];\n}\n\nexport function createExecutionStack<\n TFamilyId extends string,\n TTargetId extends string,\n TTargetInstance extends RuntimeTargetInstance<TFamilyId, TTargetId>,\n TTargetDescriptor extends RuntimeTargetDescriptor<TFamilyId, TTargetId, TTargetInstance>,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId>,\n TAdapterDescriptor extends RuntimeAdapterDescriptor<TFamilyId, TTargetId, TAdapterInstance>,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<\n TFamilyId,\n TTargetId\n >,\n TDriverDescriptor extends\n | RuntimeDriverDescriptor<TFamilyId, TTargetId, unknown, TDriverInstance>\n | undefined = undefined,\n TExtensionInstance extends RuntimeExtensionInstance<\n TFamilyId,\n TTargetId\n > = RuntimeExtensionInstance<TFamilyId, TTargetId>,\n TExtensionDescriptor extends RuntimeExtensionDescriptor<\n TFamilyId,\n TTargetId,\n TExtensionInstance\n > = never,\n>(input: {\n readonly target: TTargetDescriptor;\n readonly adapter: TAdapterDescriptor;\n readonly driver?: TDriverDescriptor | undefined;\n readonly extensionPacks?: readonly TExtensionDescriptor[] | undefined;\n}): ExecutionStack<TFamilyId, TTargetId, TAdapterInstance, TDriverInstance, TExtensionInstance> & {\n readonly target: TTargetDescriptor;\n readonly adapter: TAdapterDescriptor;\n readonly driver: TDriverDescriptor | undefined;\n readonly extensionPacks: readonly TExtensionDescriptor[];\n} {\n return {\n target: input.target,\n adapter: input.adapter,\n driver: input.driver,\n extensionPacks: input.extensionPacks ?? [],\n };\n}\n\nexport function instantiateExecutionStack<\n TFamilyId extends string,\n TTargetId extends string,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId>,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId>,\n TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId>,\n>(\n stack: ExecutionStack<\n TFamilyId,\n TTargetId,\n TAdapterInstance,\n TDriverInstance,\n TExtensionInstance\n >,\n): ExecutionStackInstance<\n TFamilyId,\n TTargetId,\n TAdapterInstance,\n TDriverInstance,\n TExtensionInstance\n> {\n const driver = stack.driver ? stack.driver.create() : undefined;\n\n return {\n stack,\n target: stack.target.create(),\n adapter: stack.adapter.create(stack),\n driver,\n extensionPacks: stack.extensionPacks.map((descriptor) => descriptor.create()),\n };\n}\n"],"mappings":";;;AAQA,SAAgB,2CAGd,EACA,UACA,QACA,QACA,SACA,kBAOO;CACP,MAAM,uBAAuB,IAAI,IAAY;EAAC,OAAO;EAAI,OAAO;EAAI,QAAQ;EAAG,CAAC;AAChF,MAAK,MAAM,aAAa,eACtB,sBAAqB,IAAI,UAAU,GAAG;CAGxC,MAAM,SAAS,mCAAmC;EAChD;EACA,kBAAkB,OAAO;EACzB;EACD,CAAC;AAEF,KAAI,OAAO,eACT,OAAM,IAAI,MACR,oBAAoB,OAAO,eAAe,OAAO,8CAA8C,OAAO,eAAe,SAAS,IAC/H;AAGH,MAAK,MAAM,UAAU,OAAO,wBAC1B,OAAM,IAAI,MACR,qCAAqC,OAAO,iEAC7C;;;;;AC0BL,SAAgB,qBAuBd,OAUA;AACA,QAAO;EACL,QAAQ,MAAM;EACd,SAAS,MAAM;EACf,QAAQ,MAAM;EACd,gBAAgB,MAAM,kBAAkB,EAAE;EAC3C;;AAGH,SAAgB,0BAOd,OAaA;CACA,MAAM,SAAS,MAAM,SAAS,MAAM,OAAO,QAAQ,GAAG;AAEtD,QAAO;EACL;EACA,QAAQ,MAAM,OAAO,QAAQ;EAC7B,SAAS,MAAM,QAAQ,OAAO,MAAM;EACpC;EACA,gBAAgB,MAAM,eAAe,KAAK,eAAe,WAAW,QAAQ,CAAC;EAC9E"}
1
+ {"version":3,"file":"execution.mjs","names":[],"sources":["../src/execution/execution-requirements.ts","../src/execution/execution-stack.ts"],"sourcesContent":["import { checkContractComponentRequirements } from '../shared/framework-components';\nimport type {\n RuntimeAdapterDescriptor,\n RuntimeExtensionDescriptor,\n RuntimeFamilyDescriptor,\n RuntimeTargetDescriptor,\n} from './execution-descriptors';\n\nexport function assertRuntimeContractRequirementsSatisfied<\n TFamilyId extends string,\n TTargetId extends string,\n>({\n contract,\n family,\n target,\n adapter,\n extensionPacks,\n}: {\n readonly contract: { readonly target: string; readonly extensionPacks?: Record<string, unknown> };\n readonly family: RuntimeFamilyDescriptor<TFamilyId>;\n readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId>;\n readonly extensionPacks: readonly RuntimeExtensionDescriptor<TFamilyId, TTargetId>[];\n}): void {\n const providedComponentIds = new Set<string>([family.id, target.id, adapter.id]);\n for (const extension of extensionPacks) {\n providedComponentIds.add(extension.id);\n }\n\n const result = checkContractComponentRequirements({\n contract,\n expectedTargetId: target.targetId,\n providedComponentIds,\n });\n\n if (result.targetMismatch) {\n throw new Error(\n `Contract target '${result.targetMismatch.actual}' does not match runtime target descriptor '${result.targetMismatch.expected}'.`,\n );\n }\n\n for (const packId of result.missingExtensionPackIds) {\n throw new Error(\n `Contract requires extension pack '${packId}', but runtime descriptors do not provide a matching component.`,\n );\n }\n}\n","import type {\n RuntimeAdapterDescriptor,\n RuntimeDriverDescriptor,\n RuntimeExtensionDescriptor,\n RuntimeTargetDescriptor,\n} from './execution-descriptors';\nimport type {\n RuntimeAdapterInstance,\n RuntimeDriverInstance,\n RuntimeExtensionInstance,\n RuntimeTargetInstance,\n} from './execution-instances';\n\nexport interface ExecutionStack<\n TFamilyId extends string,\n TTargetId extends string,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<\n TFamilyId,\n TTargetId\n >,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<\n TFamilyId,\n TTargetId\n >,\n TExtensionInstance extends RuntimeExtensionInstance<\n TFamilyId,\n TTargetId\n > = RuntimeExtensionInstance<TFamilyId, TTargetId>,\n> {\n readonly target: RuntimeTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter: RuntimeAdapterDescriptor<TFamilyId, TTargetId, TAdapterInstance>;\n readonly driver:\n | RuntimeDriverDescriptor<TFamilyId, TTargetId, unknown, TDriverInstance>\n | undefined;\n readonly extensionPacks: readonly RuntimeExtensionDescriptor<\n TFamilyId,\n TTargetId,\n TExtensionInstance\n >[];\n}\n\nexport interface ExecutionStackInstance<\n TFamilyId extends string,\n TTargetId extends string,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId> = RuntimeAdapterInstance<\n TFamilyId,\n TTargetId\n >,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<\n TFamilyId,\n TTargetId\n >,\n TExtensionInstance extends RuntimeExtensionInstance<\n TFamilyId,\n TTargetId\n > = RuntimeExtensionInstance<TFamilyId, TTargetId>,\n> {\n readonly stack: ExecutionStack<\n TFamilyId,\n TTargetId,\n TAdapterInstance,\n TDriverInstance,\n TExtensionInstance\n >;\n readonly target: RuntimeTargetInstance<TFamilyId, TTargetId>;\n readonly adapter: TAdapterInstance;\n readonly driver: TDriverInstance | undefined;\n readonly extensionPacks: readonly TExtensionInstance[];\n}\n\nexport function createExecutionStack<\n TFamilyId extends string,\n TTargetId extends string,\n TTargetInstance extends RuntimeTargetInstance<TFamilyId, TTargetId>,\n TTargetDescriptor extends RuntimeTargetDescriptor<TFamilyId, TTargetId, TTargetInstance>,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId>,\n TAdapterDescriptor extends RuntimeAdapterDescriptor<TFamilyId, TTargetId, TAdapterInstance>,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId> = RuntimeDriverInstance<\n TFamilyId,\n TTargetId\n >,\n TDriverDescriptor extends\n | RuntimeDriverDescriptor<TFamilyId, TTargetId, unknown, TDriverInstance>\n | undefined = undefined,\n TExtensionInstance extends RuntimeExtensionInstance<\n TFamilyId,\n TTargetId\n > = RuntimeExtensionInstance<TFamilyId, TTargetId>,\n TExtensionDescriptor extends RuntimeExtensionDescriptor<\n TFamilyId,\n TTargetId,\n TExtensionInstance\n > = never,\n>(input: {\n readonly target: TTargetDescriptor;\n readonly adapter: TAdapterDescriptor;\n readonly driver?: TDriverDescriptor | undefined;\n readonly extensionPacks?: readonly TExtensionDescriptor[] | undefined;\n}): ExecutionStack<TFamilyId, TTargetId, TAdapterInstance, TDriverInstance, TExtensionInstance> & {\n readonly target: TTargetDescriptor;\n readonly adapter: TAdapterDescriptor;\n readonly driver: TDriverDescriptor | undefined;\n readonly extensionPacks: readonly TExtensionDescriptor[];\n} {\n return {\n target: input.target,\n adapter: input.adapter,\n driver: input.driver,\n extensionPacks: input.extensionPacks ?? [],\n };\n}\n\nexport function instantiateExecutionStack<\n TFamilyId extends string,\n TTargetId extends string,\n TAdapterInstance extends RuntimeAdapterInstance<TFamilyId, TTargetId>,\n TDriverInstance extends RuntimeDriverInstance<TFamilyId, TTargetId>,\n TExtensionInstance extends RuntimeExtensionInstance<TFamilyId, TTargetId>,\n>(\n stack: ExecutionStack<\n TFamilyId,\n TTargetId,\n TAdapterInstance,\n TDriverInstance,\n TExtensionInstance\n >,\n): ExecutionStackInstance<\n TFamilyId,\n TTargetId,\n TAdapterInstance,\n TDriverInstance,\n TExtensionInstance\n> {\n const driver = stack.driver ? stack.driver.create() : undefined;\n\n return {\n stack,\n target: stack.target.create(),\n adapter: stack.adapter.create(stack),\n driver,\n extensionPacks: stack.extensionPacks.map((descriptor) => descriptor.create()),\n };\n}\n"],"mappings":";;;AAQA,SAAgB,2CAGd,EACA,UACA,QACA,QACA,SACA,kBAOO;CACP,MAAM,uBAAuB,IAAI,IAAY;EAAC,OAAO;EAAI,OAAO;EAAI,QAAQ;EAAG,CAAC;AAChF,MAAK,MAAM,aAAa,eACtB,sBAAqB,IAAI,UAAU,GAAG;CAGxC,MAAM,SAAS,mCAAmC;EAChD;EACA,kBAAkB,OAAO;EACzB;EACD,CAAC;AAEF,KAAI,OAAO,eACT,OAAM,IAAI,MACR,oBAAoB,OAAO,eAAe,OAAO,8CAA8C,OAAO,eAAe,SAAS,IAC/H;AAGH,MAAK,MAAM,UAAU,OAAO,wBAC1B,OAAM,IAAI,MACR,qCAAqC,OAAO,iEAC7C;;;;;AC0BL,SAAgB,qBAuBd,OAUA;AACA,QAAO;EACL,QAAQ,MAAM;EACd,SAAS,MAAM;EACf,QAAQ,MAAM;EACd,gBAAgB,MAAM,kBAAkB,EAAE;EAC3C;;AAGH,SAAgB,0BAOd,OAaA;CACA,MAAM,SAAS,MAAM,SAAS,MAAM,OAAO,QAAQ,GAAG;AAEtD,QAAO;EACL;EACA,QAAQ,MAAM,OAAO,QAAQ;EAC7B,SAAS,MAAM,QAAQ,OAAO,MAAM;EACpC;EACA,gBAAgB,MAAM,eAAe,KAAK,eAAe,WAAW,QAAQ,CAAC;EAC9E"}
@@ -1,4 +1,4 @@
1
- //#region src/framework-authoring.d.ts
1
+ //#region src/shared/framework-authoring.d.ts
2
2
  type AuthoringArgRef = {
3
3
  readonly kind: 'arg';
4
4
  readonly index: number;
@@ -96,4 +96,4 @@ declare function instantiateAuthoringFieldPreset(descriptor: AuthoringFieldPrese
96
96
  };
97
97
  //#endregion
98
98
  export { resolveAuthoringTemplateValue as _, AuthoringFieldNamespace as a, AuthoringStorageTypeTemplate as c, AuthoringTypeNamespace as d, instantiateAuthoringFieldPreset as f, isAuthoringTypeConstructorDescriptor as g, isAuthoringFieldPresetDescriptor as h, AuthoringContributions as i, AuthoringTemplateValue as l, isAuthoringArgRef as m, AuthoringArgumentDescriptor as n, AuthoringFieldPresetDescriptor as o, instantiateAuthoringTypeConstructor as p, AuthoringColumnDefaultTemplate as r, AuthoringFieldPresetOutput as s, AuthoringArgRef as t, AuthoringTypeConstructorDescriptor as u, validateAuthoringHelperArguments as v };
99
- //# sourceMappingURL=framework-authoring-D1-JZ37B.d.mts.map
99
+ //# sourceMappingURL=framework-authoring-BdrFDx4x.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework-authoring-BdrFDx4x.d.mts","names":[],"sources":["../src/shared/framework-authoring.ts"],"sourcesContent":[],"mappings":";KAEY,eAAA;EAAA,SAAA,IAAA,EAAA,KAAe;EAOf,SAAA,KAAA,EAAA,MAAA;EAKR,SAAA,IAAA,CAAA,EAAA,SAAA,MAAA,EAAA;EACS,SAAA,OAAA,CAAA,EATQ,sBASR;CACiB;AAAsB,KAPxC,sBAAA,GAOwC,MAAA,GAAA,MAAA,GAAA,OAAA,GAAA,IAAA,GAFhD,eAEgD,GAAA,SADvC,sBACuC,EAAA,GAAA;EAE1C,UAAA,GAAA,EAAA,MAAA,CAAA,EAFoB,sBAEa;AAK3C,CAAA;UALU,iCAAA,CAKgC;EAYE,SAAA,IAAA,CAAA,EAAA,MAAA;EAAf,SAAA,QAAA,CAAA,EAAA,OAAA;;AAIZ,KAhBL,2BAAA,GAA8B,iCAgBG,GAAA,CAAA;EAEtB,SAAA,IAAA,EAAA,QAAA;CACgB,GAAA;EAAf,SAAA,IAAA,EAAA,QAAA;EAAM,SAAA,OAAA,CAAA,EAAA,OAAA;EAGb,SAAA,OAAA,CAAA,EAAA,MAAA;EAMA,SAAA,OAAA,CAAA,EAAA,MAAA;AAKjB,CAAA,GAAiB;EAKL,SAAA,IAAA,EAAA,aAAA;AAIZ,CAAA,GAAiB;EAEI,SAAA,IAAA,EAAA,QAAA;EACS,SAAA,UAAA,EAjCD,MAiCC,CAAA,MAAA,EAjCc,2BAiCd,CAAA;CAHsB,CAAA;AAA4B,UA1B/D,4BAAA,CA0B+D;EAQ/D,SAAA,OAAA,EAAA,MAAA;EAML,SAAA,UAAA,EAtCW,sBAuCI;EAGf,SAAA,UAAA,CAAA,EAzCY,MAyCW,CAAA,MAAA,EAzCI,sBA0CZ,CAAA;AAG3B;AAKgB,UA/CC,kCAAA,CA+C0D;EAkB3D,SAAA,IAAA,EAAA,iBAAA;EAYA,SAAA,IAAA,CAAA,EAAA,SA3EW,2BA6Ef,EAAA;EAUI,SAAA,MAAA,EAtFG,4BAuFP;AA2GZ;AAuFgB,UAtRC,qCAAA,CAuRH;EAUE,SAAA,IAAA,EAAA,SAAA;kBA/RE;;UAGD,sCAAA;;uBAEM;;KAGX,8BAAA,GACR,wCACA;UAEa,0BAAA,SAAmC;;qBAE/B;8BACS;;;;UAKb,8BAAA;;2BAEU;mBACR;;KAGP,sBAAA;2BACe,qCAAqC;;KAGpD,uBAAA;2BACe,iCAAiC;;UAG3C,sBAAA;kBACC;mBACC;;iBAGH,iBAAA,2BAA4C;iBAkB5C,oCAAA,2BAEJ;iBAUI,gCAAA,2BAEJ;iBAUI,6BAAA,WACJ;iBA2GI,gCAAA,2CAEQ;iBAqFR,mCAAA,aACF;;;wBAKU;;iBAKR,+BAAA,aACF;;;;0BAMY"}
@@ -1,4 +1,4 @@
1
- //#region src/framework-components.ts
1
+ //#region src/shared/framework-components.ts
2
2
  function checkContractComponentRequirements(input) {
3
3
  const providedIds = /* @__PURE__ */ new Set();
4
4
  for (const id of input.providedComponentIds) providedIds.add(id);
@@ -24,4 +24,4 @@ function checkContractComponentRequirements(input) {
24
24
 
25
25
  //#endregion
26
26
  export { checkContractComponentRequirements as t };
27
- //# sourceMappingURL=framework-components-C8ZhSwXe.mjs.map
27
+ //# sourceMappingURL=framework-components-BsWST1Rn.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework-components-BsWST1Rn.mjs","names":[],"sources":["../src/shared/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,9 @@
1
- import { i as AuthoringContributions } from "./framework-authoring-D1-JZ37B.mjs";
2
- import { t as Codec } from "./codec-types-DQ1Agjom.mjs";
3
- import { t as TypesImportSpec } from "./types-import-spec-C4sc7wbb.mjs";
1
+ import { i as AuthoringContributions } from "./framework-authoring-BdrFDx4x.mjs";
2
+ import { t as Codec } from "./codec-types-DXv-ROhF.mjs";
3
+ import { t as TypesImportSpec } from "./types-import-spec-D-O6GotH.mjs";
4
4
  import { ColumnDefault, ExecutionMutationDefaultValue } from "@prisma-next/contract/types";
5
5
 
6
- //#region src/mutation-default-types.d.ts
6
+ //#region src/shared/mutation-default-types.d.ts
7
7
  interface SourcePosition {
8
8
  readonly offset: number;
9
9
  readonly line: number;
@@ -84,7 +84,7 @@ interface ControlMutationDefaults {
84
84
  readonly generatorDescriptors: readonly MutationDefaultGeneratorDescriptor[];
85
85
  }
86
86
  //#endregion
87
- //#region src/framework-components.d.ts
87
+ //#region src/shared/framework-components.d.ts
88
88
  /**
89
89
  * Declarative fields that describe component metadata.
90
90
  */
@@ -421,4 +421,4 @@ interface ExtensionInstance<TFamilyId extends string, TTargetId extends string>
421
421
  }
422
422
  //#endregion
423
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-DFZMi2h7.d.mts.map
424
+ //# sourceMappingURL=framework-components-Buvf7mnC.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework-components-Buvf7mnC.d.mts","names":[],"sources":["../src/shared/mutation-default-types.ts","../src/shared/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,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mD;;qBAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BJ,6EACP;;qBAEW;;qBAGA;;;;;;UAOJ,mEACP;iBACO;;qBAEI;;uBAEE;;KAGX,mDAAmD,sBAAsB;KAEzE,sFAGR,sBAAsB;qBACL;;KAGT,uFAGR,uBAAuB;qBACN;;KAGT,yFAGR,yBAAyB;qBACR;;KAGT,sFAGR,sBAAsB;qBACL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA+BJ,8EACP;;qBAEW;;qBAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAiCJ,6EACP;;qBAEW;;qBAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA8BJ,gFACP;;qBAEW;;qBAGA;;;KAIT,qFACR,iBAAiB,WAAW,aAC5B,kBAAkB,WAAW,aAC7B,iBAAiB,WAAW,aAC5B,oBAAoB,WAAW;UAElB;qBACI;;UAGJ;qBACI;qBACA;;UAGJ;qBACI;qBACA;;UAGJ;qBACI;qBACA;;UAGJ;qBACI;qBACA"}
@@ -0,0 +1,159 @@
1
+ //#region src/control/psl-ast.d.ts
2
+ interface PslPosition {
3
+ readonly offset: number;
4
+ readonly line: number;
5
+ readonly column: number;
6
+ }
7
+ interface PslSpan {
8
+ readonly start: PslPosition;
9
+ readonly end: PslPosition;
10
+ }
11
+ type PslDiagnosticCode = 'PSL_UNTERMINATED_BLOCK' | 'PSL_UNSUPPORTED_TOP_LEVEL_BLOCK' | 'PSL_INVALID_ATTRIBUTE_SYNTAX' | 'PSL_INVALID_MODEL_MEMBER' | 'PSL_UNSUPPORTED_MODEL_ATTRIBUTE' | 'PSL_UNSUPPORTED_FIELD_ATTRIBUTE' | 'PSL_INVALID_RELATION_ATTRIBUTE' | 'PSL_INVALID_REFERENTIAL_ACTION' | 'PSL_INVALID_DEFAULT_VALUE' | 'PSL_INVALID_ENUM_MEMBER' | 'PSL_INVALID_TYPES_MEMBER';
12
+ interface PslDiagnostic {
13
+ readonly code: PslDiagnosticCode;
14
+ readonly message: string;
15
+ readonly sourceId: string;
16
+ readonly span: PslSpan;
17
+ }
18
+ interface PslDefaultFunctionValue {
19
+ readonly kind: 'function';
20
+ readonly name: 'autoincrement' | 'now';
21
+ }
22
+ interface PslDefaultLiteralValue {
23
+ readonly kind: 'literal';
24
+ readonly value: string | number | boolean;
25
+ }
26
+ type PslDefaultValue = PslDefaultFunctionValue | PslDefaultLiteralValue;
27
+ type PslAttributeTarget = 'field' | 'model' | 'enum' | 'namedType';
28
+ interface PslAttributePositionalArgument {
29
+ readonly kind: 'positional';
30
+ readonly value: string;
31
+ readonly span: PslSpan;
32
+ }
33
+ interface PslAttributeNamedArgument {
34
+ readonly kind: 'named';
35
+ readonly name: string;
36
+ readonly value: string;
37
+ readonly span: PslSpan;
38
+ }
39
+ type PslAttributeArgument = PslAttributePositionalArgument | PslAttributeNamedArgument;
40
+ interface PslTypeConstructorCall {
41
+ readonly kind: 'typeConstructor';
42
+ readonly path: readonly string[];
43
+ readonly args: readonly PslAttributeArgument[];
44
+ readonly span: PslSpan;
45
+ }
46
+ interface PslAttribute {
47
+ readonly kind: 'attribute';
48
+ readonly target: PslAttributeTarget;
49
+ readonly name: string;
50
+ readonly args: readonly PslAttributeArgument[];
51
+ readonly span: PslSpan;
52
+ }
53
+ type PslReferentialAction = string;
54
+ type PslFieldAttribute = PslAttribute;
55
+ interface PslField {
56
+ readonly kind: 'field';
57
+ readonly name: string;
58
+ readonly typeName: string;
59
+ readonly typeConstructor?: PslTypeConstructorCall;
60
+ readonly optional: boolean;
61
+ readonly list: boolean;
62
+ readonly typeRef?: string;
63
+ readonly attributes: readonly PslFieldAttribute[];
64
+ readonly span: PslSpan;
65
+ }
66
+ interface PslUniqueConstraint {
67
+ readonly kind: 'unique';
68
+ readonly fields: readonly string[];
69
+ readonly span: PslSpan;
70
+ }
71
+ interface PslIndexConstraint {
72
+ readonly kind: 'index';
73
+ readonly fields: readonly string[];
74
+ readonly span: PslSpan;
75
+ }
76
+ type PslModelAttribute = PslAttribute;
77
+ interface PslModel {
78
+ readonly kind: 'model';
79
+ readonly name: string;
80
+ readonly fields: readonly PslField[];
81
+ readonly attributes: readonly PslModelAttribute[];
82
+ readonly span: PslSpan;
83
+ /**
84
+ * Optional leading comment line emitted above the `model` keyword by the
85
+ * printer. Producers (e.g. `sqlSchemaIrToPslAst`) attach introspection
86
+ * advisories such as "// WARNING: This table has no primary key in the
87
+ * database" here. The parser leaves this field unset; round-tripping a
88
+ * parsed schema does not re-attach comments.
89
+ */
90
+ readonly comment?: string;
91
+ }
92
+ interface PslEnumValue {
93
+ readonly kind: 'enumValue';
94
+ readonly name: string;
95
+ /**
96
+ * Optional storage label for the enum member, captured from a trailing
97
+ * `@map("...")` attribute on the member line. The parser populates this
98
+ * when the source PSL carries an explicit `@map`. Producers (e.g.
99
+ * `sqlSchemaIrToPslAst`) leave it unset; the printer emits `@map(...)`
100
+ * automatically when normalisation would change the printed member name
101
+ * (so an enum value `'in-progress'` becomes `inProgress @map("in-progress")`
102
+ * in PSL, preserving the round-trip).
103
+ */
104
+ readonly mapName?: string;
105
+ readonly span: PslSpan;
106
+ }
107
+ interface PslEnum {
108
+ readonly kind: 'enum';
109
+ readonly name: string;
110
+ readonly values: readonly PslEnumValue[];
111
+ readonly attributes: readonly PslAttribute[];
112
+ readonly span: PslSpan;
113
+ }
114
+ interface PslCompositeType {
115
+ readonly kind: 'compositeType';
116
+ readonly name: string;
117
+ readonly fields: readonly PslField[];
118
+ readonly attributes: readonly PslAttribute[];
119
+ readonly span: PslSpan;
120
+ }
121
+ interface PslNamedTypeDeclaration {
122
+ readonly kind: 'namedType';
123
+ readonly name: string;
124
+ /**
125
+ * Parser invariant: exactly one of `baseType` and `typeConstructor` is set.
126
+ * Expressing this as a discriminated union trips TypeScript narrowing when
127
+ * the declaration flows through helpers that accept the full union.
128
+ */
129
+ readonly baseType?: string;
130
+ readonly typeConstructor?: PslTypeConstructorCall;
131
+ readonly attributes: readonly PslAttribute[];
132
+ readonly span: PslSpan;
133
+ }
134
+ interface PslTypesBlock {
135
+ readonly kind: 'types';
136
+ readonly declarations: readonly PslNamedTypeDeclaration[];
137
+ readonly span: PslSpan;
138
+ }
139
+ interface PslDocumentAst {
140
+ readonly kind: 'document';
141
+ readonly sourceId: string;
142
+ readonly models: readonly PslModel[];
143
+ readonly enums: readonly PslEnum[];
144
+ readonly compositeTypes: readonly PslCompositeType[];
145
+ readonly types?: PslTypesBlock;
146
+ readonly span: PslSpan;
147
+ }
148
+ interface ParsePslDocumentInput {
149
+ readonly schema: string;
150
+ readonly sourceId: string;
151
+ }
152
+ interface ParsePslDocumentResult {
153
+ readonly ast: PslDocumentAst;
154
+ readonly diagnostics: readonly PslDiagnostic[];
155
+ readonly ok: boolean;
156
+ }
157
+ //#endregion
158
+ export { PslPosition as C, PslTypesBlock as D, PslTypeConstructorCall as E, PslUniqueConstraint as O, PslNamedTypeDeclaration as S, PslSpan as T, PslField as _, PslAttributeNamedArgument as a, PslModel as b, PslCompositeType as c, PslDefaultValue as d, PslDiagnostic as f, PslEnumValue as g, PslEnum as h, PslAttributeArgument as i, PslDefaultFunctionValue as l, PslDocumentAst as m, ParsePslDocumentResult as n, PslAttributePositionalArgument as o, PslDiagnosticCode as p, PslAttribute as r, PslAttributeTarget as s, ParsePslDocumentInput as t, PslDefaultLiteralValue as u, PslFieldAttribute as v, PslReferentialAction as w, PslModelAttribute as x, PslIndexConstraint as y };
159
+ //# sourceMappingURL=psl-ast-9X5rwo98.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"psl-ast-9X5rwo98.d.mts","names":[],"sources":["../src/control/psl-ast.ts"],"sourcesContent":[],"mappings":";UAAiB,WAAA;EAAA,SAAA,MAAW,EAAA,MAAA;EAMX,SAAA,IAAO,EAAA,MAAA;EAKZ,SAAA,MAAA,EAAA,MAAiB;AAa7B;AAOiB,UAzBA,OAAA,CAyBA;EAKA,SAAA,KAAA,EA7BC,WA6BqB;EAK3B,SAAA,GAAA,EA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,SAAA,IAAA,EAAA,WAAA;EACG,SAAA,MAAA,EA9Fb,kBA8Fa;EACf,SAAA,IAAA,EAAA,MAAA;EAAO,SAAA,IAAA,EAAA,SA7FE,oBA6FF,EAAA;EAGP,SAAA,IAAA,EA/FA,OA+Fa;AAM9B;AAG4B,KArGhB,oBAAA,GAqGgB,MAAA;AACD,KApGf,iBAAA,GAAoB,YAoGL;AACS,UAnGnB,QAAA,CAmGmB;EACjB,SAAA,IAAA,EAAA,OAAA;EACF,SAAA,IAAA,EAAA,MAAA;EAAO,SAAA,QAAA,EAAA,MAAA;EAGP,SAAA,eAAqB,CAAA,EApGT,sBAoGS;EAKrB,SAAA,QAAA,EAAA,OAAsB;;;gCArGP;iBACf;;UAGA,mBAAA;;;iBAGA;;UAGA,kBAAA;;;iBAGA;;KAGL,iBAAA,GAAoB;UAEf,QAAA;;;4BAGW;gCACI;iBACf;;;;;;;;;;UAWA,YAAA;;;;;;;;;;;;;iBAaA;;UAGA,OAAA;;;4BAGW;gCACI;iBACf;;UAGA,gBAAA;;;4BAGW;gCACI;iBACf;;UAGA,uBAAA;;;;;;;;;6BASY;gCACG;iBACf;;UAGA,aAAA;;kCAEiB;iBACjB;;UAGA,cAAA;;;4BAGW;2BACD;oCACS;mBACjB;iBACF;;UAGA,qBAAA;;;;UAKA,sBAAA;gBACD;iCACiB"}
@@ -0,0 +1,2 @@
1
+ import { C as PslPosition, D as PslTypesBlock, E as PslTypeConstructorCall, O as PslUniqueConstraint, S as PslNamedTypeDeclaration, T as PslSpan, _ as PslField, a as PslAttributeNamedArgument, b as PslModel, c as PslCompositeType, d as PslDefaultValue, f as PslDiagnostic, g as PslEnumValue, h as PslEnum, i as PslAttributeArgument, l as PslDefaultFunctionValue, m as PslDocumentAst, n as ParsePslDocumentResult, o as PslAttributePositionalArgument, p as PslDiagnosticCode, r as PslAttribute, s as PslAttributeTarget, t as ParsePslDocumentInput, u as PslDefaultLiteralValue, v as PslFieldAttribute, w as PslReferentialAction, x as PslModelAttribute, y as PslIndexConstraint } from "./psl-ast-9X5rwo98.mjs";
2
+ export { ParsePslDocumentInput, ParsePslDocumentResult, PslAttribute, PslAttributeArgument, PslAttributeNamedArgument, PslAttributePositionalArgument, PslAttributeTarget, PslCompositeType, PslDefaultFunctionValue, PslDefaultLiteralValue, PslDefaultValue, PslDiagnostic, PslDiagnosticCode, PslDocumentAst, PslEnum, PslEnumValue, PslField, PslFieldAttribute, PslIndexConstraint, PslModel, PslModelAttribute, PslNamedTypeDeclaration, PslPosition, PslReferentialAction, PslSpan, PslTypeConstructorCall, PslTypesBlock, PslUniqueConstraint };
@@ -0,0 +1 @@
1
+ export { };