@prisma-next/contract 0.3.0-pr.110.2 → 0.3.0-pr.111.10

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.
@@ -2,12 +2,30 @@ import { t as ContractIR } from "./ir-B8zNqals.mjs";
2
2
  import { OperationRegistry } from "@prisma-next/operations";
3
3
 
4
4
  //#region src/types.d.ts
5
- interface ContractBase {
5
+ declare const coreHashBrand: unique symbol;
6
+ declare const profileHashBrand: unique symbol;
7
+ /**
8
+ * Base type for core contract hashes.
9
+ * Emitted contract.d.ts files use this with the hash value as a type parameter:
10
+ * `type CoreHash = CoreHashBase<'sha256:abc123...'>`
11
+ */
12
+ type CoreHashBase<THash extends string> = THash & {
13
+ readonly [coreHashBrand]: true;
14
+ };
15
+ /**
16
+ * Base type for profile contract hashes.
17
+ * Emitted contract.d.ts files use this with the hash value as a type parameter:
18
+ * `type ProfileHash = ProfileHashBase<'sha256:def456...'>`
19
+ */
20
+ type ProfileHashBase<THash extends string> = THash & {
21
+ readonly [profileHashBrand]: true;
22
+ };
23
+ interface ContractBase<TCoreHash extends CoreHashBase<string> = CoreHashBase<string>, TProfileHash extends ProfileHashBase<string> = ProfileHashBase<string>> {
6
24
  readonly schemaVersion: string;
7
25
  readonly target: string;
8
26
  readonly targetFamily: string;
9
- readonly coreHash: string;
10
- readonly profileHash?: string;
27
+ readonly coreHash: TCoreHash;
28
+ readonly profileHash?: TProfileHash | undefined;
11
29
  readonly capabilities: Record<string, Record<string, boolean>>;
12
30
  readonly extensionPacks: Record<string, unknown>;
13
31
  readonly meta: Record<string, unknown>;
@@ -53,7 +71,7 @@ interface DocumentStorage {
53
71
  readonly collections: Record<string, DocCollection>;
54
72
  };
55
73
  }
56
- interface DocumentContract extends ContractBase {
74
+ interface DocumentContract<TCoreHash extends CoreHashBase<string> = CoreHashBase<string>, TProfileHash extends ProfileHashBase<string> = ProfileHashBase<string>> extends ContractBase<TCoreHash, TProfileHash> {
57
75
  readonly targetFamily: string;
58
76
  readonly storage: DocumentStorage;
59
77
  }
@@ -225,10 +243,14 @@ interface TargetFamilyHook {
225
243
  * @param ir - Contract IR
226
244
  * @param codecTypeImports - Array of codec type import specs
227
245
  * @param operationTypeImports - Array of operation type import specs
246
+ * @param hashes - Contract hash values (coreHash and profileHash)
228
247
  * @param options - Additional options including parameterized type renderers
229
248
  * @returns Generated TypeScript type definitions as string
230
249
  */
231
- generateContractTypes(ir: ContractIR, codecTypeImports: ReadonlyArray<TypesImportSpec>, operationTypeImports: ReadonlyArray<TypesImportSpec>, options?: GenerateContractTypesOptions): string;
250
+ generateContractTypes(ir: ContractIR, codecTypeImports: ReadonlyArray<TypesImportSpec>, operationTypeImports: ReadonlyArray<TypesImportSpec>, hashes: {
251
+ readonly coreHash: string;
252
+ readonly profileHash: string;
253
+ }, options?: GenerateContractTypesOptions): string;
232
254
  }
233
255
  type ArgSpecManifest = {
234
256
  readonly kind: 'typeId';
@@ -853,5 +875,5 @@ interface ExtensionInstance<TFamilyId extends string, TTargetId extends string>
853
875
  readonly targetId: TTargetId;
854
876
  }
855
877
  //#endregion
856
- export { TypesImportSpec as $, ContractBase as A, LoweringSpecManifest as B, TypeRenderer as C, interpolateTypeTemplate as D, checkContractComponentRequirements as E, DocumentStorage as F, PlanRefs as G, ParamDescriptor as H, ExecutionPlan as I, Source as J, ResultType as K, Expr as L, DocCollection as M, DocIndex as N, normalizeRenderer as O, DocumentContract as P, TypeRenderer$1 as Q, FieldType as R, TargetPackRef as S, TypeRendererTemplate as T, ParameterizedCodecDescriptor as U, OperationManifest as V, PlanMeta as W, TypeRenderContext as X, TargetFamilyHook as Y, TypeRenderEntry as Z, PackRefBase as _, ComponentMetadata as a, TargetDescriptor as b, DriverDescriptor as c, ExtensionDescriptor as d, ValidationContext as et, ExtensionInstance as f, NormalizedTypeRenderer as g, FamilyInstance as h, ComponentDescriptor as i, ContractMarkerRecord as j, ArgSpecManifest as k, DriverInstance as l, FamilyDescriptor as m, AdapterInstance as n, ContractComponentRequirementsCheckInput as o, ExtensionPackRef as p, ReturnSpecManifest as q, AdapterPackRef as r, ContractComponentRequirementsCheckResult as s, AdapterDescriptor as t, isDocumentContract as tt, DriverPackRef as u, RenderTypeContext as v, TypeRendererFunction as w, TargetInstance as x, TargetBoundComponentDescriptor as y, GenerateContractTypesOptions as z };
857
- //# sourceMappingURL=framework-components-CLCmcNJY.d.mts.map
878
+ export { TypeRenderEntry as $, ContractBase as A, GenerateContractTypesOptions as B, TypeRenderer as C, interpolateTypeTemplate as D, checkContractComponentRequirements as E, DocumentContract as F, PlanMeta as G, OperationManifest as H, DocumentStorage as I, ResultType as J, PlanRefs as K, ExecutionPlan as L, CoreHashBase as M, DocCollection as N, normalizeRenderer as O, DocIndex as P, TypeRenderContext as Q, Expr as R, TargetPackRef as S, TypeRendererTemplate as T, ParamDescriptor as U, LoweringSpecManifest as V, ParameterizedCodecDescriptor as W, Source as X, ReturnSpecManifest as Y, TargetFamilyHook as Z, PackRefBase as _, ComponentMetadata as a, TargetDescriptor as b, DriverDescriptor as c, ExtensionDescriptor as d, TypeRenderer$1 as et, ExtensionInstance as f, NormalizedTypeRenderer as g, FamilyInstance as h, ComponentDescriptor as i, ContractMarkerRecord as j, ArgSpecManifest as k, DriverInstance as l, FamilyDescriptor as m, AdapterInstance as n, ValidationContext as nt, ContractComponentRequirementsCheckInput as o, ExtensionPackRef as p, ProfileHashBase as q, AdapterPackRef as r, isDocumentContract as rt, ContractComponentRequirementsCheckResult as s, AdapterDescriptor as t, TypesImportSpec as tt, DriverPackRef as u, RenderTypeContext as v, TypeRendererFunction as w, TargetInstance as x, TargetBoundComponentDescriptor as y, FieldType as z };
879
+ //# sourceMappingURL=framework-components-W7Tz8gam.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework-components-W7Tz8gam.d.mts","names":[],"sources":["../src/types.ts","../src/framework-components.ts"],"sourcesContent":[],"mappings":";;;;cAIc;AAFyB,cAGzB,gBAD4B,EAAA,OAAA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T,qFACR,iBAAiB,WAAW,aAC5B,kBAAkB,WAAW,aAC7B,iBAAiB,WAAW,aAC5B,oBAAoB,WAAW;;;;;;;;;;;;;;;;UA4BlB;;qBAEI;;;;;;;;;;;;;;;;;;;UAoBJ;;qBAEI;;qBAGA;;;;;;;;;;;;;;;;;;;UAoBJ;;qBAEI;;qBAGA;;;;;;;;;;;;;;;;;;;UAoBJ;;qBAEI;;qBAGA;;;;;;;;;;;;;;;;;;;UAoBJ;;qBAEI;;qBAGA"}
@@ -1,2 +1,2 @@
1
- import { C as TypeRenderer, D as interpolateTypeTemplate, E as checkContractComponentRequirements, O as normalizeRenderer, S as TargetPackRef, T as TypeRendererTemplate, _ as PackRefBase, a as ComponentMetadata, b as TargetDescriptor, c as DriverDescriptor, d as ExtensionDescriptor, f as ExtensionInstance, g as NormalizedTypeRenderer, h as FamilyInstance, i as ComponentDescriptor, l as DriverInstance, m as FamilyDescriptor, n as AdapterInstance, o as ContractComponentRequirementsCheckInput, p as ExtensionPackRef, r as AdapterPackRef, s as ContractComponentRequirementsCheckResult, t as AdapterDescriptor, u as DriverPackRef, v as RenderTypeContext, w as TypeRendererFunction, x as TargetInstance, y as TargetBoundComponentDescriptor } from "./framework-components-CLCmcNJY.mjs";
1
+ import { C as TypeRenderer, D as interpolateTypeTemplate, E as checkContractComponentRequirements, O as normalizeRenderer, S as TargetPackRef, T as TypeRendererTemplate, _ as PackRefBase, a as ComponentMetadata, b as TargetDescriptor, c as DriverDescriptor, d as ExtensionDescriptor, f as ExtensionInstance, g as NormalizedTypeRenderer, h as FamilyInstance, i as ComponentDescriptor, l as DriverInstance, m as FamilyDescriptor, n as AdapterInstance, o as ContractComponentRequirementsCheckInput, p as ExtensionPackRef, r as AdapterPackRef, s as ContractComponentRequirementsCheckResult, t as AdapterDescriptor, u as DriverPackRef, v as RenderTypeContext, w as TypeRendererFunction, x as TargetInstance, y as TargetBoundComponentDescriptor } from "./framework-components-W7Tz8gam.mjs";
2
2
  export { type AdapterDescriptor, type AdapterInstance, type AdapterPackRef, type ComponentDescriptor, type ComponentMetadata, type ContractComponentRequirementsCheckInput, type ContractComponentRequirementsCheckResult, type DriverDescriptor, type DriverInstance, type DriverPackRef, type ExtensionDescriptor, type ExtensionInstance, type ExtensionPackRef, type FamilyDescriptor, type FamilyInstance, type NormalizedTypeRenderer, type PackRefBase, type RenderTypeContext, type TargetBoundComponentDescriptor, type TargetDescriptor, type TargetInstance, type TargetPackRef, type TypeRenderer, type TypeRendererFunction, type TypeRendererTemplate, checkContractComponentRequirements, interpolateTypeTemplate, normalizeRenderer };
@@ -1,2 +1,2 @@
1
- import { B as LoweringSpecManifest, V as OperationManifest, k as ArgSpecManifest, q as ReturnSpecManifest } from "./framework-components-CLCmcNJY.mjs";
1
+ import { H as OperationManifest, V as LoweringSpecManifest, Y as ReturnSpecManifest, k as ArgSpecManifest } from "./framework-components-W7Tz8gam.mjs";
2
2
  export { type ArgSpecManifest, type LoweringSpecManifest, type OperationManifest, type ReturnSpecManifest };
package/dist/types.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as TypesImportSpec, A as ContractBase, F as DocumentStorage, G as PlanRefs, H as ParamDescriptor, I as ExecutionPlan, J as Source, K as ResultType, L as Expr, M as DocCollection, N as DocIndex, P as DocumentContract, Q as TypeRenderer, R as FieldType, U as ParameterizedCodecDescriptor, V as OperationManifest, W as PlanMeta, X as TypeRenderContext, Y as TargetFamilyHook, Z as TypeRenderEntry, et as ValidationContext, j as ContractMarkerRecord, tt as isDocumentContract, z as GenerateContractTypesOptions } from "./framework-components-CLCmcNJY.mjs";
2
- export { type ContractBase, type ContractMarkerRecord, type DocCollection, type DocIndex, type DocumentContract, type DocumentStorage, type ExecutionPlan, type Expr, type FieldType, type GenerateContractTypesOptions, type OperationManifest, type ParamDescriptor, type ParameterizedCodecDescriptor, type PlanMeta, type PlanRefs, type ResultType, type Source, type TargetFamilyHook, type TypeRenderContext, type TypeRenderEntry, type TypeRenderer, type TypesImportSpec, type ValidationContext, isDocumentContract };
1
+ import { $ as TypeRenderEntry, A as ContractBase, B as GenerateContractTypesOptions, F as DocumentContract, G as PlanMeta, H as OperationManifest, I as DocumentStorage, J as ResultType, K as PlanRefs, L as ExecutionPlan, M as CoreHashBase, N as DocCollection, P as DocIndex, Q as TypeRenderContext, R as Expr, U as ParamDescriptor, W as ParameterizedCodecDescriptor, X as Source, Z as TargetFamilyHook, et as TypeRenderer, j as ContractMarkerRecord, nt as ValidationContext, q as ProfileHashBase, rt as isDocumentContract, tt as TypesImportSpec, z as FieldType } from "./framework-components-W7Tz8gam.mjs";
2
+ export { type ContractBase, type ContractMarkerRecord, type CoreHashBase, type DocCollection, type DocIndex, type DocumentContract, type DocumentStorage, type ExecutionPlan, type Expr, type FieldType, type GenerateContractTypesOptions, type OperationManifest, type ParamDescriptor, type ParameterizedCodecDescriptor, type PlanMeta, type PlanRefs, type ProfileHashBase, type ResultType, type Source, type TargetFamilyHook, type TypeRenderContext, type TypeRenderEntry, type TypeRenderer, type TypesImportSpec, type ValidationContext, isDocumentContract };
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { OperationRegistry } from '@prisma-next/operations';\nimport type { RenderTypeContext } from './framework-components';\nimport type { ContractIR } from './ir';\n\nexport interface ContractBase {\n readonly schemaVersion: string;\n readonly target: string;\n readonly targetFamily: string;\n readonly coreHash: string;\n readonly profileHash?: string;\n readonly capabilities: Record<string, Record<string, boolean>>;\n readonly extensionPacks: Record<string, unknown>;\n readonly meta: Record<string, unknown>;\n readonly sources: Record<string, Source>;\n}\n\nexport interface FieldType {\n readonly type: string;\n readonly nullable: boolean;\n readonly items?: FieldType;\n readonly properties?: Record<string, FieldType>;\n}\n\nexport interface Source {\n readonly readOnly: boolean;\n readonly projection: Record<string, FieldType>;\n readonly origin?: Record<string, unknown>;\n readonly capabilities?: Record<string, boolean>;\n}\n\n// Document family types\nexport interface DocIndex {\n readonly name: string;\n readonly keys: Record<string, 'asc' | 'desc'>;\n readonly unique?: boolean;\n readonly where?: Expr;\n}\n\nexport type Expr =\n | { readonly kind: 'eq'; readonly path: ReadonlyArray<string>; readonly value: unknown }\n | { readonly kind: 'exists'; readonly path: ReadonlyArray<string> };\n\nexport interface DocCollection {\n readonly name: string;\n readonly id?: {\n readonly strategy: 'auto' | 'client' | 'uuid' | 'cuid' | 'objectId';\n };\n readonly fields: Record<string, FieldType>;\n readonly indexes?: ReadonlyArray<DocIndex>;\n readonly readOnly?: boolean;\n}\n\nexport interface DocumentStorage {\n readonly document: {\n readonly collections: Record<string, DocCollection>;\n };\n}\n\nexport interface DocumentContract extends ContractBase {\n // Accept string to work with JSON imports; runtime validation ensures 'document'\n readonly targetFamily: string;\n readonly storage: DocumentStorage;\n}\n\n// Plan types - target-family agnostic execution types\nexport interface ParamDescriptor {\n readonly index?: number;\n readonly name?: string;\n readonly codecId?: string;\n readonly nativeType?: string;\n readonly nullable?: boolean;\n readonly source: 'dsl' | 'raw';\n readonly refs?: { table: string; column: string };\n}\n\nexport interface PlanRefs {\n readonly tables?: readonly string[];\n readonly columns?: ReadonlyArray<{ table: string; column: string }>;\n readonly indexes?: ReadonlyArray<{\n readonly table: string;\n readonly columns: ReadonlyArray<string>;\n readonly name?: string;\n }>;\n}\n\nexport interface PlanMeta {\n readonly target: string;\n readonly targetFamily?: string;\n readonly coreHash: string;\n readonly profileHash?: string;\n readonly lane: string;\n readonly annotations?: {\n codecs?: Record<string, string>; // alias/param → codec id ('ns/name@v')\n [key: string]: unknown;\n };\n readonly paramDescriptors: ReadonlyArray<ParamDescriptor>;\n readonly refs?: PlanRefs;\n readonly projection?: Record<string, string> | ReadonlyArray<string>;\n /**\n * Optional mapping of projection alias → column type ID (fully qualified ns/name@version).\n * Used for codec resolution when AST+refs don't provide enough type info.\n */\n readonly projectionTypes?: Record<string, string>;\n}\n\n/**\n * Canonical execution plan shape used by runtimes.\n *\n * - Row is the inferred result row type (TypeScript-only).\n * - Ast is the optional, family-specific AST type (e.g. SQL QueryAst).\n *\n * The payload executed by the runtime is represented by the sql + params pair\n * for now; future families can specialize this via Ast or additional metadata.\n */\nexport interface ExecutionPlan<Row = unknown, Ast = unknown> {\n readonly sql: string;\n readonly params: readonly unknown[];\n readonly ast?: Ast;\n readonly meta: PlanMeta;\n /**\n * Phantom property to carry the Row generic for type-level utilities.\n * Not set at runtime; used only for ResultType extraction.\n */\n readonly _row?: Row;\n}\n\n/**\n * Utility type to extract the Row type from an ExecutionPlan.\n * Example: `type Row = ResultType<typeof plan>`\n *\n * Works with both ExecutionPlan and SqlQueryPlan (SQL query plans before lowering).\n * SqlQueryPlan includes a phantom `_Row` property to preserve the generic parameter\n * for type extraction.\n */\nexport type ResultType<P> =\n P extends ExecutionPlan<infer R, unknown> ? R : P extends { readonly _Row?: infer R } ? R : never;\n\n/**\n * Type guard to check if a contract is a Document contract\n */\nexport function isDocumentContract(contract: unknown): contract is DocumentContract {\n return (\n typeof contract === 'object' &&\n contract !== null &&\n 'targetFamily' in contract &&\n contract.targetFamily === 'document'\n );\n}\n\n/**\n * Contract marker record stored in the database.\n * Represents the current contract identity for a database.\n */\nexport interface ContractMarkerRecord {\n readonly coreHash: string;\n readonly profileHash: string;\n readonly contractJson: unknown | null;\n readonly canonicalVersion: number | null;\n readonly updatedAt: Date;\n readonly appTag: string | null;\n readonly meta: Record<string, unknown>;\n}\n\n// Emitter types - moved from @prisma-next/emitter to shared location\n/**\n * Specifies how to import TypeScript types from a package.\n * Used in extension pack manifests to declare codec and operation type imports.\n */\nexport interface TypesImportSpec {\n readonly package: string;\n readonly named: string;\n readonly alias: string;\n}\n\n/**\n * Validation context passed to TargetFamilyHook.validateTypes().\n * Contains pre-assembled operation registry, type imports, and extension IDs.\n */\nexport interface ValidationContext {\n readonly operationRegistry?: OperationRegistry;\n readonly codecTypeImports?: ReadonlyArray<TypesImportSpec>;\n readonly operationTypeImports?: ReadonlyArray<TypesImportSpec>;\n readonly extensionIds?: ReadonlyArray<string>;\n /**\n * Parameterized codec descriptors collected from adapters and extensions.\n * Map of codecId → descriptor for quick lookup during type generation.\n */\n readonly parameterizedCodecs?: Map<string, ParameterizedCodecDescriptor>;\n}\n\n/**\n * Context for rendering parameterized types during contract.d.ts generation.\n * Passed to type renderers so they can reference CodecTypes by name.\n */\nexport interface TypeRenderContext {\n readonly codecTypesName: string;\n}\n\n/**\n * A normalized type renderer for parameterized codecs.\n * This is the interface expected by TargetFamilyHook.generateContractTypes.\n */\nexport interface TypeRenderEntry {\n readonly codecId: string;\n readonly render: (params: Record<string, unknown>, ctx: TypeRenderContext) => string;\n}\n\n/**\n * Additional options for generateContractTypes.\n */\nexport interface GenerateContractTypesOptions {\n /**\n * Normalized parameterized type renderers, keyed by codecId.\n * When a column has typeParams and a renderer exists for its codecId,\n * the renderer is called to produce the TypeScript type expression.\n */\n readonly parameterizedRenderers?: Map<string, TypeRenderEntry>;\n /**\n * Type imports for parameterized codecs.\n * These are merged with codec and operation type imports in contract.d.ts.\n */\n readonly parameterizedTypeImports?: ReadonlyArray<TypesImportSpec>;\n}\n\n/**\n * SPI interface for target family hooks that extend emission behavior.\n * Implemented by family-specific emitter hooks (e.g., SQL family).\n */\nexport interface TargetFamilyHook {\n readonly id: string;\n\n /**\n * Validates that all type IDs in the contract come from referenced extension packs.\n * @param ir - Contract IR to validate\n * @param ctx - Validation context with operation registry and extension IDs\n */\n validateTypes(ir: ContractIR, ctx: ValidationContext): void;\n\n /**\n * Validates family-specific contract structure.\n * @param ir - Contract IR to validate\n */\n validateStructure(ir: ContractIR): void;\n\n /**\n * Generates contract.d.ts file content.\n * @param ir - Contract IR\n * @param codecTypeImports - Array of codec type import specs\n * @param operationTypeImports - Array of operation type import specs\n * @param options - Additional options including parameterized type renderers\n * @returns Generated TypeScript type definitions as string\n */\n generateContractTypes(\n ir: ContractIR,\n codecTypeImports: ReadonlyArray<TypesImportSpec>,\n operationTypeImports: ReadonlyArray<TypesImportSpec>,\n options?: GenerateContractTypesOptions,\n ): string;\n}\n\n// Extension pack manifest types - moved from @prisma-next/core-control-plane to shared location\nexport type ArgSpecManifest =\n | { readonly kind: 'typeId'; readonly type: string }\n | { readonly kind: 'param' }\n | { readonly kind: 'literal' };\n\nexport type ReturnSpecManifest =\n | { readonly kind: 'typeId'; readonly type: string }\n | { readonly kind: 'builtin'; readonly type: 'number' | 'boolean' | 'string' };\n\nexport interface LoweringSpecManifest {\n readonly targetFamily: 'sql';\n readonly strategy: 'infix' | 'function';\n readonly template: string;\n}\n\nexport interface OperationManifest {\n readonly for: string;\n readonly method: string;\n readonly args: ReadonlyArray<ArgSpecManifest>;\n readonly returns: ReturnSpecManifest;\n readonly lowering: LoweringSpecManifest;\n readonly capabilities?: ReadonlyArray<string>;\n}\n\n// ============================================================================\n// Parameterized Codec Descriptor Types\n// ============================================================================\n//\n// Types for codecs that support type parameters (e.g., Vector<1536>, Decimal<2>).\n// These enable precise TypeScript types for parameterized columns without\n// coupling the SQL family emitter to specific adapter codec IDs.\n//\n// ============================================================================\n\n// Re-export RenderTypeContext so it's available alongside TypeRenderer\nexport type { RenderTypeContext };\n\n/**\n * Declarative type renderer that produces a TypeScript type expression.\n *\n * Renderers can be:\n * - A template string with `{{paramName}}` placeholders (e.g., `Vector<{{length}}>`)\n * - A function that receives typeParams and context and returns a type expression\n *\n * **Prefer template strings** for most cases:\n * - Templates are JSON-serializable (safe for pack-ref metadata)\n * - Templates can be statically analyzed by tooling\n *\n * Function renderers are allowed but have tradeoffs:\n * - Require runtime execution during emission (the emitter runs code)\n * - Not JSON-serializable (can't be stored in contract.json)\n * - The emitted artifacts (contract.json, contract.d.ts) still contain no\n * executable code - this constraint applies to outputs, not the emission process\n */\nexport type TypeRenderer =\n | string\n | ((params: Record<string, unknown>, ctx: RenderTypeContext) => string);\n\n/**\n * Descriptor for a codec that supports type parameters.\n *\n * Parameterized codecs allow columns to carry additional metadata (typeParams)\n * that affects the generated TypeScript types. For example:\n * - A vector codec can use `{ length: 1536 }` to generate `Vector<1536>`\n * - A decimal codec can use `{ precision: 10, scale: 2 }` to generate `Decimal<10, 2>`\n *\n * The SQL family emitter uses these descriptors to generate precise types\n * without hard-coding knowledge of specific codec IDs.\n *\n * @example\n * ```typescript\n * const vectorCodecDescriptor: ParameterizedCodecDescriptor = {\n * codecId: 'pg/vector@1',\n * outputTypeRenderer: 'Vector<{{length}}>',\n * // Optional: paramsSchema for runtime validation\n * };\n * ```\n */\nexport interface ParameterizedCodecDescriptor {\n /** The codec ID this descriptor applies to (e.g., 'pg/vector@1') */\n readonly codecId: string;\n\n /**\n * Renderer for the output (read) type.\n * Can be a template string or function.\n *\n * This is the primary renderer used by SQL emission to generate\n * model field types in contract.d.ts.\n */\n readonly outputTypeRenderer: TypeRenderer;\n\n /**\n * Optional renderer for the input (write) type.\n * If not provided, outputTypeRenderer is used for both.\n *\n * **Reserved for future use**: Currently, SQL emission only uses\n * outputTypeRenderer. This field is defined for future support of\n * asymmetric codecs where input and output types differ (e.g., a\n * codec that accepts `string | number` but always returns `number`).\n */\n readonly inputTypeRenderer?: TypeRenderer;\n\n /**\n * Optional import spec for types used by this codec's renderers.\n * The emitter will add this import to contract.d.ts.\n */\n readonly typesImport?: TypesImportSpec;\n}\n"],"mappings":";;;;AA4IA,SAAgB,mBAAmB,UAAiD;AAClF,QACE,OAAO,aAAa,YACpB,aAAa,QACb,kBAAkB,YAClB,SAAS,iBAAiB"}
1
+ {"version":3,"file":"types.mjs","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { OperationRegistry } from '@prisma-next/operations';\nimport type { RenderTypeContext } from './framework-components';\nimport type { ContractIR } from './ir';\n\ndeclare const coreHashBrand: unique symbol;\ndeclare const profileHashBrand: unique symbol;\n\n/**\n * Base type for core contract hashes.\n * Emitted contract.d.ts files use this with the hash value as a type parameter:\n * `type CoreHash = CoreHashBase<'sha256:abc123...'>`\n */\nexport type CoreHashBase<THash extends string> = THash & { readonly [coreHashBrand]: true };\n\n/**\n * Base type for profile contract hashes.\n * Emitted contract.d.ts files use this with the hash value as a type parameter:\n * `type ProfileHash = ProfileHashBase<'sha256:def456...'>`\n */\nexport type ProfileHashBase<THash extends string> = THash & { readonly [profileHashBrand]: true };\n\nexport interface ContractBase<\n TCoreHash extends CoreHashBase<string> = CoreHashBase<string>,\n TProfileHash extends ProfileHashBase<string> = ProfileHashBase<string>,\n> {\n readonly schemaVersion: string;\n readonly target: string;\n readonly targetFamily: string;\n readonly coreHash: TCoreHash;\n readonly profileHash?: TProfileHash | undefined;\n readonly capabilities: Record<string, Record<string, boolean>>;\n readonly extensionPacks: Record<string, unknown>;\n readonly meta: Record<string, unknown>;\n readonly sources: Record<string, Source>;\n}\n\nexport interface FieldType {\n readonly type: string;\n readonly nullable: boolean;\n readonly items?: FieldType;\n readonly properties?: Record<string, FieldType>;\n}\n\nexport interface Source {\n readonly readOnly: boolean;\n readonly projection: Record<string, FieldType>;\n readonly origin?: Record<string, unknown>;\n readonly capabilities?: Record<string, boolean>;\n}\n\n// Document family types\nexport interface DocIndex {\n readonly name: string;\n readonly keys: Record<string, 'asc' | 'desc'>;\n readonly unique?: boolean;\n readonly where?: Expr;\n}\n\nexport type Expr =\n | { readonly kind: 'eq'; readonly path: ReadonlyArray<string>; readonly value: unknown }\n | { readonly kind: 'exists'; readonly path: ReadonlyArray<string> };\n\nexport interface DocCollection {\n readonly name: string;\n readonly id?: {\n readonly strategy: 'auto' | 'client' | 'uuid' | 'cuid' | 'objectId';\n };\n readonly fields: Record<string, FieldType>;\n readonly indexes?: ReadonlyArray<DocIndex>;\n readonly readOnly?: boolean;\n}\n\nexport interface DocumentStorage {\n readonly document: {\n readonly collections: Record<string, DocCollection>;\n };\n}\n\nexport interface DocumentContract<\n TCoreHash extends CoreHashBase<string> = CoreHashBase<string>,\n TProfileHash extends ProfileHashBase<string> = ProfileHashBase<string>,\n> extends ContractBase<TCoreHash, TProfileHash> {\n // Accept string to work with JSON imports; runtime validation ensures 'document'\n readonly targetFamily: string;\n readonly storage: DocumentStorage;\n}\n\n// Plan types - target-family agnostic execution types\nexport interface ParamDescriptor {\n readonly index?: number;\n readonly name?: string;\n readonly codecId?: string;\n readonly nativeType?: string;\n readonly nullable?: boolean;\n readonly source: 'dsl' | 'raw';\n readonly refs?: { table: string; column: string };\n}\n\nexport interface PlanRefs {\n readonly tables?: readonly string[];\n readonly columns?: ReadonlyArray<{ table: string; column: string }>;\n readonly indexes?: ReadonlyArray<{\n readonly table: string;\n readonly columns: ReadonlyArray<string>;\n readonly name?: string;\n }>;\n}\n\nexport interface PlanMeta {\n readonly target: string;\n readonly targetFamily?: string;\n readonly coreHash: string;\n readonly profileHash?: string;\n readonly lane: string;\n readonly annotations?: {\n codecs?: Record<string, string>; // alias/param → codec id ('ns/name@v')\n [key: string]: unknown;\n };\n readonly paramDescriptors: ReadonlyArray<ParamDescriptor>;\n readonly refs?: PlanRefs;\n readonly projection?: Record<string, string> | ReadonlyArray<string>;\n /**\n * Optional mapping of projection alias → column type ID (fully qualified ns/name@version).\n * Used for codec resolution when AST+refs don't provide enough type info.\n */\n readonly projectionTypes?: Record<string, string>;\n}\n\n/**\n * Canonical execution plan shape used by runtimes.\n *\n * - Row is the inferred result row type (TypeScript-only).\n * - Ast is the optional, family-specific AST type (e.g. SQL QueryAst).\n *\n * The payload executed by the runtime is represented by the sql + params pair\n * for now; future families can specialize this via Ast or additional metadata.\n */\nexport interface ExecutionPlan<Row = unknown, Ast = unknown> {\n readonly sql: string;\n readonly params: readonly unknown[];\n readonly ast?: Ast;\n readonly meta: PlanMeta;\n /**\n * Phantom property to carry the Row generic for type-level utilities.\n * Not set at runtime; used only for ResultType extraction.\n */\n readonly _row?: Row;\n}\n\n/**\n * Utility type to extract the Row type from an ExecutionPlan.\n * Example: `type Row = ResultType<typeof plan>`\n *\n * Works with both ExecutionPlan and SqlQueryPlan (SQL query plans before lowering).\n * SqlQueryPlan includes a phantom `_Row` property to preserve the generic parameter\n * for type extraction.\n */\nexport type ResultType<P> =\n P extends ExecutionPlan<infer R, unknown> ? R : P extends { readonly _Row?: infer R } ? R : never;\n\n/**\n * Type guard to check if a contract is a Document contract\n */\nexport function isDocumentContract(contract: unknown): contract is DocumentContract {\n return (\n typeof contract === 'object' &&\n contract !== null &&\n 'targetFamily' in contract &&\n contract.targetFamily === 'document'\n );\n}\n\n/**\n * Contract marker record stored in the database.\n * Represents the current contract identity for a database.\n */\nexport interface ContractMarkerRecord {\n readonly coreHash: string;\n readonly profileHash: string;\n readonly contractJson: unknown | null;\n readonly canonicalVersion: number | null;\n readonly updatedAt: Date;\n readonly appTag: string | null;\n readonly meta: Record<string, unknown>;\n}\n\n// Emitter types - moved from @prisma-next/emitter to shared location\n/**\n * Specifies how to import TypeScript types from a package.\n * Used in extension pack manifests to declare codec and operation type imports.\n */\nexport interface TypesImportSpec {\n readonly package: string;\n readonly named: string;\n readonly alias: string;\n}\n\n/**\n * Validation context passed to TargetFamilyHook.validateTypes().\n * Contains pre-assembled operation registry, type imports, and extension IDs.\n */\nexport interface ValidationContext {\n readonly operationRegistry?: OperationRegistry;\n readonly codecTypeImports?: ReadonlyArray<TypesImportSpec>;\n readonly operationTypeImports?: ReadonlyArray<TypesImportSpec>;\n readonly extensionIds?: ReadonlyArray<string>;\n /**\n * Parameterized codec descriptors collected from adapters and extensions.\n * Map of codecId → descriptor for quick lookup during type generation.\n */\n readonly parameterizedCodecs?: Map<string, ParameterizedCodecDescriptor>;\n}\n\n/**\n * Context for rendering parameterized types during contract.d.ts generation.\n * Passed to type renderers so they can reference CodecTypes by name.\n */\nexport interface TypeRenderContext {\n readonly codecTypesName: string;\n}\n\n/**\n * A normalized type renderer for parameterized codecs.\n * This is the interface expected by TargetFamilyHook.generateContractTypes.\n */\nexport interface TypeRenderEntry {\n readonly codecId: string;\n readonly render: (params: Record<string, unknown>, ctx: TypeRenderContext) => string;\n}\n\n/**\n * Additional options for generateContractTypes.\n */\nexport interface GenerateContractTypesOptions {\n /**\n * Normalized parameterized type renderers, keyed by codecId.\n * When a column has typeParams and a renderer exists for its codecId,\n * the renderer is called to produce the TypeScript type expression.\n */\n readonly parameterizedRenderers?: Map<string, TypeRenderEntry>;\n /**\n * Type imports for parameterized codecs.\n * These are merged with codec and operation type imports in contract.d.ts.\n */\n readonly parameterizedTypeImports?: ReadonlyArray<TypesImportSpec>;\n}\n\n/**\n * SPI interface for target family hooks that extend emission behavior.\n * Implemented by family-specific emitter hooks (e.g., SQL family).\n */\nexport interface TargetFamilyHook {\n readonly id: string;\n\n /**\n * Validates that all type IDs in the contract come from referenced extension packs.\n * @param ir - Contract IR to validate\n * @param ctx - Validation context with operation registry and extension IDs\n */\n validateTypes(ir: ContractIR, ctx: ValidationContext): void;\n\n /**\n * Validates family-specific contract structure.\n * @param ir - Contract IR to validate\n */\n validateStructure(ir: ContractIR): void;\n\n /**\n * Generates contract.d.ts file content.\n * @param ir - Contract IR\n * @param codecTypeImports - Array of codec type import specs\n * @param operationTypeImports - Array of operation type import specs\n * @param hashes - Contract hash values (coreHash and profileHash)\n * @param options - Additional options including parameterized type renderers\n * @returns Generated TypeScript type definitions as string\n */\n generateContractTypes(\n ir: ContractIR,\n codecTypeImports: ReadonlyArray<TypesImportSpec>,\n operationTypeImports: ReadonlyArray<TypesImportSpec>,\n hashes: { readonly coreHash: string; readonly profileHash: string },\n options?: GenerateContractTypesOptions,\n ): string;\n}\n\n// Extension pack manifest types - moved from @prisma-next/core-control-plane to shared location\nexport type ArgSpecManifest =\n | { readonly kind: 'typeId'; readonly type: string }\n | { readonly kind: 'param' }\n | { readonly kind: 'literal' };\n\nexport type ReturnSpecManifest =\n | { readonly kind: 'typeId'; readonly type: string }\n | { readonly kind: 'builtin'; readonly type: 'number' | 'boolean' | 'string' };\n\nexport interface LoweringSpecManifest {\n readonly targetFamily: 'sql';\n readonly strategy: 'infix' | 'function';\n readonly template: string;\n}\n\nexport interface OperationManifest {\n readonly for: string;\n readonly method: string;\n readonly args: ReadonlyArray<ArgSpecManifest>;\n readonly returns: ReturnSpecManifest;\n readonly lowering: LoweringSpecManifest;\n readonly capabilities?: ReadonlyArray<string>;\n}\n\n// ============================================================================\n// Parameterized Codec Descriptor Types\n// ============================================================================\n//\n// Types for codecs that support type parameters (e.g., Vector<1536>, Decimal<2>).\n// These enable precise TypeScript types for parameterized columns without\n// coupling the SQL family emitter to specific adapter codec IDs.\n//\n// ============================================================================\n\n// Re-export RenderTypeContext so it's available alongside TypeRenderer\nexport type { RenderTypeContext };\n\n/**\n * Declarative type renderer that produces a TypeScript type expression.\n *\n * Renderers can be:\n * - A template string with `{{paramName}}` placeholders (e.g., `Vector<{{length}}>`)\n * - A function that receives typeParams and context and returns a type expression\n *\n * **Prefer template strings** for most cases:\n * - Templates are JSON-serializable (safe for pack-ref metadata)\n * - Templates can be statically analyzed by tooling\n *\n * Function renderers are allowed but have tradeoffs:\n * - Require runtime execution during emission (the emitter runs code)\n * - Not JSON-serializable (can't be stored in contract.json)\n * - The emitted artifacts (contract.json, contract.d.ts) still contain no\n * executable code - this constraint applies to outputs, not the emission process\n */\nexport type TypeRenderer =\n | string\n | ((params: Record<string, unknown>, ctx: RenderTypeContext) => string);\n\n/**\n * Descriptor for a codec that supports type parameters.\n *\n * Parameterized codecs allow columns to carry additional metadata (typeParams)\n * that affects the generated TypeScript types. For example:\n * - A vector codec can use `{ length: 1536 }` to generate `Vector<1536>`\n * - A decimal codec can use `{ precision: 10, scale: 2 }` to generate `Decimal<10, 2>`\n *\n * The SQL family emitter uses these descriptors to generate precise types\n * without hard-coding knowledge of specific codec IDs.\n *\n * @example\n * ```typescript\n * const vectorCodecDescriptor: ParameterizedCodecDescriptor = {\n * codecId: 'pg/vector@1',\n * outputTypeRenderer: 'Vector<{{length}}>',\n * // Optional: paramsSchema for runtime validation\n * };\n * ```\n */\nexport interface ParameterizedCodecDescriptor {\n /** The codec ID this descriptor applies to (e.g., 'pg/vector@1') */\n readonly codecId: string;\n\n /**\n * Renderer for the output (read) type.\n * Can be a template string or function.\n *\n * This is the primary renderer used by SQL emission to generate\n * model field types in contract.d.ts.\n */\n readonly outputTypeRenderer: TypeRenderer;\n\n /**\n * Optional renderer for the input (write) type.\n * If not provided, outputTypeRenderer is used for both.\n *\n * **Reserved for future use**: Currently, SQL emission only uses\n * outputTypeRenderer. This field is defined for future support of\n * asymmetric codecs where input and output types differ (e.g., a\n * codec that accepts `string | number` but always returns `number`).\n */\n readonly inputTypeRenderer?: TypeRenderer;\n\n /**\n * Optional import spec for types used by this codec's renderers.\n * The emitter will add this import to contract.d.ts.\n */\n readonly typesImport?: TypesImportSpec;\n}\n"],"mappings":";;;;AAmKA,SAAgB,mBAAmB,UAAiD;AAClF,QACE,OAAO,aAAa,YACpB,aAAa,QACb,kBAAkB,YAClB,SAAS,iBAAiB"}
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@prisma-next/contract",
3
- "version": "0.3.0-pr.110.2",
3
+ "version": "0.3.0-pr.111.10",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Data contract type definitions and JSON schema for Prisma Next",
7
7
  "dependencies": {
8
- "@prisma-next/operations": "0.3.0-pr.110.2"
8
+ "@prisma-next/operations": "0.3.0-pr.111.10"
9
9
  },
10
10
  "devDependencies": {
11
11
  "tsdown": "0.18.4",
@@ -6,6 +6,7 @@
6
6
  export type {
7
7
  ContractBase,
8
8
  ContractMarkerRecord,
9
+ CoreHashBase,
9
10
  DocCollection,
10
11
  DocIndex,
11
12
  DocumentContract,
@@ -20,6 +21,7 @@ export type {
20
21
  ParameterizedCodecDescriptor,
21
22
  PlanMeta,
22
23
  PlanRefs,
24
+ ProfileHashBase,
23
25
  ResultType,
24
26
  Source,
25
27
  TargetFamilyHook,
package/src/types.ts CHANGED
@@ -2,12 +2,32 @@ import type { OperationRegistry } from '@prisma-next/operations';
2
2
  import type { RenderTypeContext } from './framework-components';
3
3
  import type { ContractIR } from './ir';
4
4
 
5
- export interface ContractBase {
5
+ declare const coreHashBrand: unique symbol;
6
+ declare const profileHashBrand: unique symbol;
7
+
8
+ /**
9
+ * Base type for core contract hashes.
10
+ * Emitted contract.d.ts files use this with the hash value as a type parameter:
11
+ * `type CoreHash = CoreHashBase<'sha256:abc123...'>`
12
+ */
13
+ export type CoreHashBase<THash extends string> = THash & { readonly [coreHashBrand]: true };
14
+
15
+ /**
16
+ * Base type for profile contract hashes.
17
+ * Emitted contract.d.ts files use this with the hash value as a type parameter:
18
+ * `type ProfileHash = ProfileHashBase<'sha256:def456...'>`
19
+ */
20
+ export type ProfileHashBase<THash extends string> = THash & { readonly [profileHashBrand]: true };
21
+
22
+ export interface ContractBase<
23
+ TCoreHash extends CoreHashBase<string> = CoreHashBase<string>,
24
+ TProfileHash extends ProfileHashBase<string> = ProfileHashBase<string>,
25
+ > {
6
26
  readonly schemaVersion: string;
7
27
  readonly target: string;
8
28
  readonly targetFamily: string;
9
- readonly coreHash: string;
10
- readonly profileHash?: string;
29
+ readonly coreHash: TCoreHash;
30
+ readonly profileHash?: TProfileHash | undefined;
11
31
  readonly capabilities: Record<string, Record<string, boolean>>;
12
32
  readonly extensionPacks: Record<string, unknown>;
13
33
  readonly meta: Record<string, unknown>;
@@ -56,7 +76,10 @@ export interface DocumentStorage {
56
76
  };
57
77
  }
58
78
 
59
- export interface DocumentContract extends ContractBase {
79
+ export interface DocumentContract<
80
+ TCoreHash extends CoreHashBase<string> = CoreHashBase<string>,
81
+ TProfileHash extends ProfileHashBase<string> = ProfileHashBase<string>,
82
+ > extends ContractBase<TCoreHash, TProfileHash> {
60
83
  // Accept string to work with JSON imports; runtime validation ensures 'document'
61
84
  readonly targetFamily: string;
62
85
  readonly storage: DocumentStorage;
@@ -247,6 +270,7 @@ export interface TargetFamilyHook {
247
270
  * @param ir - Contract IR
248
271
  * @param codecTypeImports - Array of codec type import specs
249
272
  * @param operationTypeImports - Array of operation type import specs
273
+ * @param hashes - Contract hash values (coreHash and profileHash)
250
274
  * @param options - Additional options including parameterized type renderers
251
275
  * @returns Generated TypeScript type definitions as string
252
276
  */
@@ -254,6 +278,7 @@ export interface TargetFamilyHook {
254
278
  ir: ContractIR,
255
279
  codecTypeImports: ReadonlyArray<TypesImportSpec>,
256
280
  operationTypeImports: ReadonlyArray<TypesImportSpec>,
281
+ hashes: { readonly coreHash: string; readonly profileHash: string },
257
282
  options?: GenerateContractTypesOptions,
258
283
  ): string;
259
284
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"framework-components-CLCmcNJY.d.mts","names":[],"sources":["../src/types.ts","../src/framework-components.ts"],"sourcesContent":[],"mappings":";;;;UAIiB,YAAA;EAAA,SAAA,aAAY,EAAA,MAAA;EAMW,SAAA,MAAA,EAAA,MAAA;EAAf,SAAA,YAAA,EAAA,MAAA;EACE,SAAA,QAAA,EAAA,MAAA;EACV,SAAA,WAAA,CAAA,EAAA,MAAA;EACkB,SAAA,YAAA,EAHV,MAGU,CAAA,MAAA,EAHK,MAGL,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA;EAAf,SAAA,cAAA,EAFO,MAEP,CAAA,MAAA,EAAA,OAAA,CAAA;EAAM,SAAA,IAAA,EADT,MACS,CAAA,MAAA,EAAA,OAAA,CAAA;EAGT,SAAA,OAAS,EAHN,MAGM,CAAA,MAAA,EAHS,MAGT,CAAA;;AAIa,UAJtB,SAAA,CAIsB;EAAf,SAAA,IAAA,EAAA,MAAA;EAAM,SAAA,QAAA,EAAA,OAAA;EAGb,SAAM,KAAA,CAAA,EAJJ,SAII;EAEe,SAAA,UAAA,CAAA,EALd,MAKc,CAAA,MAAA,EALC,SAKD,CAAA;;AAClB,UAHH,MAAA,CAGG;EACM,SAAA,QAAA,EAAA,OAAA;EAAM,SAAA,UAAA,EAFT,MAES,CAAA,MAAA,EAFM,SAEN,CAAA;EAIf,SAAA,MAAQ,CAAA,EALL,MAOH,CAAA,MAEE,EAAA,OAAI,CAAA;EAGX,SAAI,YAC0B,CAAA,EAZhB,MAYgB,CAAA,MACI,EAAA,OAAA,CAAa;AAE3D;AAKkC,UAhBjB,QAAA,CAgBiB;EAAf,SAA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