@vibeorm/generator 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -3
- package/dist/index.js.map +3 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1442,7 +1442,6 @@ export type ${n}UpdateWhereInput = ${n}WhereUniqueInput & ${n}WhereInput;`);
|
|
|
1442
1442
|
` readonly select?: ${n}CountAggregateInput;`,
|
|
1443
1443
|
` readonly where?: ${n}WhereInput;`,
|
|
1444
1444
|
` readonly orderBy?: ${orMany({ type: `${n}ScalarOrderByInput` })};`,
|
|
1445
|
-
` readonly cursor?: ${n}WhereUniqueInput;`,
|
|
1446
1445
|
` readonly take?: number;`,
|
|
1447
1446
|
` readonly skip?: number;`
|
|
1448
1447
|
]
|
|
@@ -1452,7 +1451,6 @@ export type ${n}UpdateWhereInput = ${n}WhereUniqueInput & ${n}WhereInput;`);
|
|
|
1452
1451
|
lines: [
|
|
1453
1452
|
` readonly where?: ${n}WhereInput;`,
|
|
1454
1453
|
` readonly orderBy?: ${orMany({ type: `${n}ScalarOrderByInput` })};`,
|
|
1455
|
-
` readonly cursor?: ${n}WhereUniqueInput;`,
|
|
1456
1454
|
` readonly take?: number;`,
|
|
1457
1455
|
` readonly skip?: number;`,
|
|
1458
1456
|
...aggregateOpProps
|
|
@@ -2485,4 +2483,4 @@ export {
|
|
|
2485
2483
|
generateClient
|
|
2486
2484
|
};
|
|
2487
2485
|
|
|
2488
|
-
//# debugId=
|
|
2486
|
+
//# debugId=BC4813FB63493C9C64756E2164756E21
|
package/dist/index.js.map
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
"import { createHash } from \"node:crypto\";\nimport { VibeError, providerToDialect } from \"@vibeorm/schema\";\nimport type { DatabaseModuleManifest, DatabaseModuleOptions } from \"@vibeorm/schema\";\nimport type { SchemaView } from \"./schema-view.ts\";\nimport { stableStringify } from \"./util.ts\";\n\nconst MODULE_DECLARATIONS: string = `import type { ClientContext, DatabaseAdapter, QueryOperation, TransactionOptions } from \"@vibeorm/runtime\";\nimport type { DatabaseModuleManifest, SchemaIR } from \"@vibeorm/schema\";\nimport type { VibeClientInstance, VibeTransactionClientInstance, ReadOnlyClientInstance } from \"./index.js\";\nexport { sql, decode, sqlModels, sqlProjection } from \"./index.js\";\nexport type ModuleClient = Omit<VibeClientInstance, \"$connect\" | \"$disconnect\" | \"$transaction\" | \"$scoped\" | \"$withPolicy\" | \"$bypassPolicy\" | \"$readOnly\"> & {\n readonly $transaction: ModuleTransactionClient[\"$transaction\"];\n readonly $readOnly: () => ReadOnlyClientInstance;\n};\nexport type ModuleTransactionClient = Omit<VibeTransactionClientInstance, \"$transaction\" | \"$scoped\" | \"$withPolicy\" | \"$bypassPolicy\"> & {\n readonly $transaction: {\n <T>(run: (tx: ModuleTransactionClient) => Promise<T>, options?: TransactionOptions): Promise<T>;\n <T extends readonly QueryOperation<unknown, \"read\" | \"write\">[]>(operations: readonly [...T], options?: TransactionOptions): Promise<{ -readonly [K in keyof T]: Awaited<T[K]> }>;\n };\n};\nexport declare const databaseModule: {\n readonly manifest: DatabaseModuleManifest;\n readonly schema: SchemaIR;\n readonly create: (params: { adapter: DatabaseAdapter }) => ModuleClient;\n readonly bind: {\n (params: { db: ClientContext<\"root\"> }): ModuleClient;\n (params: { db: ClientContext<\"transaction\"> }): ModuleTransactionClient;\n (params: { db: ClientContext<\"readOnly\"> }): ReadOnlyClientInstance;\n };\n};\n`;\n\n/** Emit a separate package entry using the ordinary generated delegate declarations. */\nexport function emitDatabaseModule(params: { view: SchemaView; module: DatabaseModuleOptions }): readonly { name: string; content: string }[] {\n const { view, module } = params;\n for (const key of [\"id\", \"contract\", \"revision\"] as const) {\n if (typeof module[key] !== \"string\" || module[key].trim().length === 0 || module[key].includes(\"\\0\")) throw new VibeError({ code: \"VIBE_CONFIG\", message: `Database module ${key} must be a non-empty identifier`, meta: { reason: \"module_manifest\", key } });\n }\n if (view.schema.rls !== undefined || view.schema.extensions.length > 0 || view.schema.models.some((model) => model.policy !== undefined)) throw new VibeError({ code: \"VIBE_UNSUPPORTED_CAPABILITY\", message: `Module ${module.id} cannot declare extensions, policy or native RLS in this module protocol`, meta: { reason: \"module_schema_feature\", moduleId: module.id } });\n const serialized = stableStringify({ value: view.schema });\n const manifest: DatabaseModuleManifest = {\n ...module, protocol: 1, dialect: providerToDialect({ provider: view.schema.datasource.provider }),\n schemaChecksum: createHash(\"sha256\").update(JSON.stringify(JSON.parse(serialized))).digest(\"hex\"),\n };\n return [\n { name: \"module.js\", content: `// Generated package module. No connection or DDL on import.\\nimport { defineDatabaseModule } from \"@vibeorm/runtime\";\\nimport { schema } from \"./schema.js\";\\nexport { sql, decode, sqlModels, sqlProjection } from \"./index.js\";\\nexport const databaseModule = defineDatabaseModule({ ...${JSON.stringify(module)}, schema, manifest: ${JSON.stringify(manifest)} });\\n` },\n { name: \"schema.js\", content: `// Generated data-only schema and runtime manifest.\\nexport const schema = ${serialized};\\nexport const moduleManifest = ${JSON.stringify(manifest)};\\n` },\n { name: \"schema.d.ts\", content: `import type { SchemaIR, DatabaseModuleManifest } from \"@vibeorm/schema\";\\nexport declare const schema: SchemaIR;\\nexport declare const moduleManifest: DatabaseModuleManifest;\\n` },\n { name: \"module.d.ts\", content: MODULE_DECLARATIONS },\n ];\n}\n",
|
|
6
6
|
"/**\n * Shared helpers for the generator: naming, TS property keys, and the stable\n * JSON serializer that keeps emitted output byte-identical for structurally\n * identical IR (object-key insertion order never leaks into the output).\n */\n\nimport { VibeError } from \"@vibeorm/schema\";\n\n// ─── Naming ───────────────────────────────────────────────────────\n\n/** First character uppercased, rest untouched (`posts` → `Posts`). */\nexport function pascal(params: { name: string }): string {\n const { name } = params;\n if (name.length === 0) return name;\n return name.charAt(0).toUpperCase() + name.slice(1);\n}\n\n/**\n * Delegate key for a model name: first character lowercased, rest untouched\n * (the Prisma convention — mirrors @vibeorm/runtime's `toClientName`, which the\n * generator must never drift from: the emitted d.ts declares exactly the\n * properties the runtime attaches).\n */\nexport function clientNameOf(params: { name: string }): string {\n const { name } = params;\n if (name.length === 0) return name;\n return name.charAt(0).toLowerCase() + name.slice(1);\n}\n\nconst IDENTIFIER_RE: RegExp = /^[A-Za-z_$][A-Za-z0-9_$]*$/;\n\n/** A field name as a TS property key — bare when it is a valid identifier, quoted otherwise. */\nexport function propKey(params: { name: string }): string {\n const { name } = params;\n return IDENTIFIER_RE.test(name) ? name : JSON.stringify(name);\n}\n\n/** A TS/JS double-quoted string literal, escaped. */\nexport function tsString(params: { value: string }): string {\n return JSON.stringify(params.value);\n}\n\n/** Wrap a type expression in parens when it is a union (for `[]` suffixing). */\nexport function maybeParens(params: { type: string }): string {\n const { type } = params;\n return type.includes(\"|\") ? `(${type})` : type;\n}\n\n// ─── Stable JSON ──────────────────────────────────────────────────\n\n/**\n * JSON.stringify with recursively sorted object keys and 2-space indentation.\n * Arrays keep their order (array order is semantic in the IR); `undefined`\n * object values are omitted exactly like JSON.stringify does.\n */\nexport function stableStringify(params: { value: unknown }): string {\n return renderValue({ value: params.value, indent: \"\" });\n}\n\nfunction renderValue(params: { value: unknown; indent: string }): string {\n const { value, indent } = params;\n if (value === null) return \"null\";\n const kind = typeof value;\n if (kind === \"string\" || kind === \"number\" || kind === \"boolean\") return JSON.stringify(value);\n if (Array.isArray(value)) {\n if (value.length === 0) return \"[]\";\n const inner = `${indent} `;\n const items = value.map((item) => inner + renderValue({ value: item, indent: inner }));\n return `[\\n${items.join(\",\\n\")}\\n${indent}]`;\n }\n if (kind === \"object\") {\n const record = value as Record<string, unknown>;\n const keys = Object.keys(record)\n .filter((key) => record[key] !== undefined)\n .sort();\n if (keys.length === 0) return \"{}\";\n const inner = `${indent} `;\n const items = keys.map(\n (key) => `${inner}${JSON.stringify(key)}: ${renderValue({ value: record[key], indent: inner })}`,\n );\n return `{\\n${items.join(\",\\n\")}\\n${indent}}`;\n }\n throw new VibeError({\n code: \"VIBE_INTERNAL\",\n message: `internal: cannot serialize a ${kind} value into the generated client`,\n meta: { kind },\n });\n}\n",
|
|
7
7
|
"/**\n * The generator's public entry point: SchemaIR → a consumable client module\n * directory (index.js + directly-written index.d.ts, the lightweight enums.js +\n * enums.d.ts entry index re-exports from, and README.md).\n *\n * Output is byte-identical for structurally identical IR: models, enums and\n * extensions are sorted by name, object keys are serialized sorted, and every\n * emitter iterates deterministically.\n */\n\nimport { emitDatabaseModule } from \"./emit-module.ts\";\nimport { mkdir, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { VibeError, buildComputedManifest, validateComputedConfig } from \"@vibeorm/schema\";\nimport type { DatabaseModuleOptions, ComputedConfig, ComputedManifestEntry, SchemaIR, VibeExtension } from \"@vibeorm/schema\";\nimport { emitDts, emitEnumsDts } from \"./emit-dts.ts\";\nimport { emitEnumsJs, emitJs } from \"./emit-js.ts\";\nimport { bakeExtensions } from \"./extension-bake.ts\";\nimport { buildSchemaView } from \"./schema-view.ts\";\n\n/** What `generateClient` wrote. */\nexport type GenerateResult = {\n /** Paths of the written files (outDir-joined, in emission order). */\n files: string[];\n};\n\nconst README: string = `# Generated VibeORM client\n\nThis directory was generated by \\`@vibeorm/generator\\` from your VibeORM schema — do not edit it by hand, any change is overwritten on the next generate. After every schema change, regenerate with \\`vibeorm generate\\` (or programmatically via \\`generateClient({ schema, outDir })\\` from \\`@vibeorm/generator\\`).\n`;\n\n/**\n * Generate the client module for a schema into `outDir` (created if missing).\n *\n * @throws VibeError `VIBE_SCHEMA_INVALID` when the IR fails validation.\n */\nexport async function generateClient(params: {\n schema: SchemaIR;\n outDir: string;\n /** Optional package-owned module entry, in addition to the ordinary client. */\n module?: DatabaseModuleOptions;\n /** Configured extension instances — their surfaces bake into the client (D9). */\n extensions?: readonly VibeExtension[];\n /** Computed-field config — types bake into the .d.ts, the manifest into index.js. */\n computed?: ComputedConfig;\n}): Promise<GenerateResult> {\n const { schema, outDir } = params;\n const view = buildSchemaView({ schema });\n const baked = bakeExtensions({ schema: view.schema, extensions: params.extensions ?? [] });\n\n let computed: readonly ComputedManifestEntry[] = [];\n if (params.computed !== undefined && Object.keys(params.computed).length > 0) {\n validateComputedConfig({ schema, computed: params.computed });\n computed = buildComputedManifest({ computed: params.computed });\n }\n\n if (params.module !== undefined && (!baked.empty || computed.length > 0)) throw new VibeError({ code: \"VIBE_UNSUPPORTED_CAPABILITY\", message: \"Package modules do not support computed fields or extension mounts in this protocol\", meta: { reason: \"module_schema_feature\", moduleId: params.module.id } });\n const outputs: ReadonlyArray<{ name: string; content: string }> = [\n { name: \"index.js\", content: emitJs({ view, baked, computed }) },\n { name: \"index.d.ts\", content: emitDts({ view, baked, computed }) },\n { name: \"enums.js\", content: emitEnumsJs({ view }) },\n { name: \"enums.d.ts\", content: emitEnumsDts({ view }) },\n { name: \"README.md\", content: README },\n ...(params.module === undefined ? [] : emitDatabaseModule({ view, module: params.module })),\n ];\n\n await mkdir(outDir, { recursive: true });\n const files: string[] = [];\n for (const output of outputs) {\n const path = join(outDir, output.name);\n await writeFile(path, output.content, \"utf-8\");\n files.push(path);\n }\n return { files };\n}\n",
|
|
8
|
-
"/**\n * Emits the generated client's index.d.ts as text (decision D3): the entire\n * typed surface, written directly — no tsc run, no inference for the consumer's\n * tsserver to pay for.\n *\n * Type-budget rules this file is built around (plan §6, constitution rule 2):\n * - concrete per-model base types; narrowing via mapped lookups over them;\n * - no conditional type deeper than a single level per key — recursion exists\n * only where the API is recursive (nested select/include), and each hop is\n * one shallow conditional + one mapped lookup;\n * - no distributive conditionals over model unions — every model's types are\n * spelled out flat;\n * - no Zod, no `as const` inference trees, no mega-unions.\n */\n\nimport { DIALECT_CAPABILITIES, VibeError, providerToDialect } from \"@vibeorm/schema\";\nimport type { ComputedManifestEntry, DialectCapabilities, RlsContextScalar } from \"@vibeorm/schema\";\nimport { enumEntryExports } from \"./emit-js.ts\";\nimport { EMPTY_BAKED_EXTENSIONS } from \"./extension-bake.ts\";\nimport type { BakedExtensions } from \"./extension-bake.ts\";\nimport type { EnumView, FieldView, ModelView, RelationView, SchemaView } from \"./schema-view.ts\";\nimport {\n MINMAX_SCALARS,\n NUMERIC_SCALARS,\n filterName,\n inputBaseType,\n payloadBaseType,\n updateOpsName,\n} from \"./type-names.ts\";\nimport { maybeParens, pascal, propKey, tsString } from \"./util.ts\";\n\n// ─── Small helpers ────────────────────────────────────────────────\n\nfunction banner(params: { title: string }): string {\n return `// ─── ${params.title} ───`;\n}\n\n/**\n * What THIS schema's database can do. The generated client is written for one\n * provider, so a capability it lacks is left out of the emitted types entirely:\n * asking for it becomes a compile error, which is earlier than the runtime's\n * own refusal and the earliest moment anything can know (constitution rule 4,\n * \"generate > build > execute\").\n */\nfunction capabilitiesOf(params: { view: SchemaView }): DialectCapabilities {\n return DIALECT_CAPABILITIES[providerToDialect({ provider: params.view.schema.datasource.provider })];\n}\n\n/** `\"a\" | \"b\"` from a list of literal members. */\nfunction literalUnion(params: { members: readonly string[] }): string {\n return params.members.map((member) => tsString({ value: member })).join(\" | \");\n}\n\n/** An `export type Name = { …lines }` alias; empty bodies become Record<string, never>. */\nfunction objectAlias(params: { name: string; lines: readonly string[] }): string {\n const { name, lines } = params;\n if (lines.length === 0) return `export type ${name} = Record<string, never>;`;\n return `export type ${name} = {\\n${lines.join(\"\\n\")}\\n};`;\n}\n\n/** ` readonly key?: T;` / ` \"quoted key\"?: T;` — an optional member and its type. */\nconst OPTIONAL_MEMBER = /^(\\s*(?:readonly\\s+)?(?:[A-Za-z_$][\\w$]*|\"(?:[^\"\\\\]|\\\\.)*\")\\?:\\s*)(.+);$/;\n\n/** Append `| Skip` to every optional member in one emitted block. */\nfunction skippableMembers(params: { block: string }): string {\n return params.block\n .split(\"\\n\")\n .map((line) => {\n const match = OPTIONAL_MEMBER.exec(line);\n const head = match?.[1];\n const type = match?.[2];\n if (head === undefined || type === undefined) return line;\n // A function type needs parentheses, or `| Skip` would join its RETURN.\n return `${head}${type.includes(\"=>\") ? `(${type})` : type} | Skip;`;\n })\n .join(\"\\n\");\n}\n\n/**\n * `objectAlias` for ARGUMENT-SYNTAX types: every optional member also accepts\n * the `SKIP` sentinel.\n *\n * The runtime refuses an explicit `undefined` in argument syntax and strips\n * `SKIP` instead (`runtime/src/strict-args.ts`), so a caller assembling an\n * object conditionally needs a value that means \"omit this property\". The\n * widening is written into the emitted text rather than expressed as a\n * `{ [K in keyof T]: T[K] | Skip }` wrapper: a mapped type would move the cost\n * onto every consumer's tsserver, which constitution rule 2 forbids.\n *\n * Only OPTIONAL members widen. A required member (`data`, `update`'s `where`)\n * stays required — `SKIP` there would type-check an argument the runtime then\n * refuses for a missing property.\n *\n * NOT used for view args (`*View*Args`) or `VibeClientOptions`: the view layer\n * reads `select`/`reveal`/`include` in `mergeLevel` BEFORE the model delegate's\n * strict check runs, and client options are never walked at all, so the\n * sentinel is not stripped on either path.\n */\nfunction inputAlias(params: { name: string; lines: readonly string[] }): string {\n const { name, lines } = params;\n return objectAlias({ name, lines: lines.map((block) => skippableMembers({ block })) });\n}\n\n/** `T | readonly T[]` for single-or-many input positions. */\nfunction orMany(params: { type: string }): string {\n const { type } = params;\n return `${type} | readonly ${maybeParens({ type })}[]`;\n}\n\nfunction payloadFieldType(params: { field: FieldView }): string {\n const { field } = params;\n const base = payloadBaseType({ field });\n if (field.isList) return `${maybeParens({ type: base })}[]`;\n return field.isOptional ? `${base} | null` : base;\n}\n\nfunction relationPayloadType(params: { relation: RelationView }): string {\n const { relation } = params;\n if (relation.isList) return `${relation.target}[]`;\n return relation.isOptional ? `${relation.target} | null` : relation.target;\n}\n\n// ─── Static preamble ──────────────────────────────────────────────\n\nconst PREAMBLE: string = `${banner({ title: \"Shared scalar & helper types\" })}\n\n/** JSON as stored/returned by Json columns (decoded payload shape). */\nexport type JsonValue = string | number | boolean | null | { [key: string]: JsonValue } | JsonValue[];\n\n/** Object form accepted as Json INPUT — readonly, and undefined-valued keys are dropped on serialize. */\nexport type InputJsonObject = { readonly [key: string]: InputJsonValue | null | undefined };\n\n/** Array form accepted as Json INPUT — readonly arrays are welcome (v1 lesson, LEARNINGS bug 7). */\nexport type InputJsonArray = ReadonlyArray<InputJsonValue | null>;\n\n/**\n * JSON as ACCEPTED for Json input positions — deliberately wider than\n * JsonValue: readonly containers and toJSON-bearing values (Date) serialize\n * fine, the runtime stringifies with JSON.stringify (v1 lessons, bugs 7+8).\n */\nexport type InputJsonValue = string | number | boolean | InputJsonObject | InputJsonArray | { toJSON(): unknown };\n\n/** \\`strict\\` (board #20) forces case-SENSITIVE matching where the engine folds (sqlite/mysql); a no-op on postgres. */\nexport type QueryMode = \"default\" | \"insensitive\" | \"strict\";\n\nexport type SortOrder = \"asc\" | \"desc\";\n\nexport type SortOrderWithNulls = SortOrder | { readonly sort: SortOrder; readonly nulls?: \"first\" | \"last\" };\n\n/** How relations are loaded: batched WHERE-IN queries, or a single JOIN (pg/pglite). */\nexport type RelationStrategy = \"query\" | \"join\";\n\n/**\n * An opaque, versioned keyset position (\\`after\\`) — ordering values plus a\n * unique tie-breaker, minted by a previous page. It is ENCODED, not encrypted:\n * whoever holds it can read the ordering values inside. It is also NOT an\n * authorization credential — it selects a position, never a row, and every\n * query still applies its own where/scoped/policy/RLS filters.\n */\nexport type KeysetToken = string;\n\n/** Per-query keyset options. */\nexport type KeysetOptions = {\n /**\n * Asserts that every DateTime ordering column in this query holds\n * millisecond-exact values. Required on postgres and mysql, whose timestamps\n * may be finer than a JavaScript Date; NOT safe for \\`@default(now())\\`\n * columns on postgres, which are microsecond-precise.\n */\n readonly timestampPrecision?: \"milliseconds\";\n};\n\n/** Result of createMany/updateMany/deleteMany. */\nexport type BatchPayload = { readonly count: number };\n\n/** Static operation classification only; runtime verifies instance ownership and active lifetime. */\ndeclare const vibeTransaction: unique symbol;\nexport type VibeQueryPromise<T, Access extends \"read\" | \"write\" = \"read\"> = QueryOperation<T, Access>;\n\n/**\n * What upsertMany reports. \\`count\\` is the rows submitted after duplicate-key\n * validation — every one of them was inserted or updated, since the statement\n * has no skip arm and the whole operation is atomic. \\`affectedRows\\` is the\n * driver's own number, and only where that number IS a row count: it is null on\n * mysql, whose ON DUPLICATE KEY scores an insert 1, a changed update 2 and an\n * unchanged update 0.\n */\nexport type UpsertManyPayload = { readonly count: number; readonly affectedRows: number | null };\n\n/**\n * An argument member as the RESULT machinery must read it. Absent and the\n * \\`SKIP\\` sentinel both mean \"not provided\", so neither may narrow a payload:\n * without this, \\`{ omit?: UserOmitInput | Skip }\\` would collapse the key\n * helpers below to \\`never\\` and promise fields the query may still have dropped.\n */\ntype Provided<T> = Exclude<T, Skip | undefined>;\n\n/** Keys of an omit object whose value is exactly true — the scalars the result drops. */\ntype OmittedKeys<O> = keyof { [K in keyof O as O[K] extends true ? K : never]: 0 };\n\n/** Keys a selection has not RULED OUT — everything except a literal false/undefined. */\ntype PossibleKeys<S> = keyof { [K in keyof S as S[K] extends false | undefined | Skip ? never : K]: 0 };\n\n/**\n * Keys whose flag can STILL be false or missing when the query runs — a widened\n * \\`boolean\\`, or an optional nested selection. They are emitted OPTIONAL: the\n * result type must not promise a field a run-time flag can switch off.\n */\ntype UncertainKeys<S> = PossibleKeys<S> &\n keyof { [K in keyof S as [false] extends [S[K]] ? K : [undefined] extends [S[K]] ? K : [Skip] extends [S[K]] ? K : never]: 0 };\n\n/** Keys the selection definitely turns on: a literal \\`true\\`, or a nested selection object. */\ntype ExactKeys<S> = Exclude<PossibleKeys<S>, UncertainKeys<S>>;\n\n/** An aggregate object is absent when none of its selectors is enabled. */\ntype HasSelectedField<S> = [S] extends [true] ? true : [S] extends [object] ? ExactKeys<S> extends never ? false : true : false;`;\n\ntype ScalarFilterConfig = {\n readonly prefix: string;\n readonly value: string;\n readonly comparable: boolean;\n readonly text: boolean;\n /** Comparison positions also accept the `DbNow` database-clock sentinel. */\n readonly clock?: boolean;\n};\n\nconst SCALAR_FILTER_CONFIGS: readonly ScalarFilterConfig[] = [\n { prefix: \"String\", value: \"string\", comparable: true, text: true },\n { prefix: \"Int\", value: \"number\", comparable: true, text: false },\n { prefix: \"Float\", value: \"number\", comparable: true, text: false },\n { prefix: \"BigInt\", value: \"bigint | number\", comparable: true, text: false },\n { prefix: \"Decimal\", value: \"string | number\", comparable: true, text: false },\n { prefix: \"DateTime\", value: \"Date | string\", comparable: true, text: false, clock: true },\n { prefix: \"Bool\", value: \"boolean\", comparable: false, text: false },\n { prefix: \"Bytes\", value: \"Uint8Array\", comparable: false, text: false },\n];\n\nfunction scalarFilterAlias(params: { config: ScalarFilterConfig; nullable: boolean }): string {\n const { config, nullable } = params;\n const name = nullable ? `${config.prefix}NullableFilter` : `${config.prefix}Filter`;\n const value = config.value;\n // Comparison positions (equals/not/lt…) also take the database-clock\n // sentinel on clock scalars; IN lists never do (refused at build time).\n const point = config.clock === true ? `${value} | DbNow` : value;\n const valueOrNull = nullable ? `${point} | null` : point;\n const array = `readonly ${maybeParens({ type: value })}[]`;\n const lines: string[] = [];\n lines.push(` readonly equals?: ${valueOrNull};`);\n lines.push(` readonly in?: ${array};`);\n lines.push(` readonly notIn?: ${array};`);\n if (config.comparable) {\n lines.push(` readonly lt?: ${point};`);\n lines.push(` readonly lte?: ${point};`);\n lines.push(` readonly gt?: ${point};`);\n lines.push(` readonly gte?: ${point};`);\n }\n if (config.text) {\n lines.push(` readonly contains?: ${value};`);\n lines.push(` readonly startsWith?: ${value};`);\n lines.push(` readonly endsWith?: ${value};`);\n lines.push(` readonly mode?: QueryMode;`);\n }\n lines.push(` readonly not?: ${value} | ${name}${nullable ? \" | null\" : \"\"};`);\n return inputAlias({ name, lines });\n}\n\nfunction scalarListFilterAlias(params: { config: ScalarFilterConfig }): string {\n const { config } = params;\n const value = config.value;\n const array = `readonly ${maybeParens({ type: value })}[]`;\n return inputAlias({\n name: `${config.prefix}ListFilter`,\n lines: [\n ` readonly equals?: ${array} | null;`,\n ` readonly has?: ${value} | null;`,\n ` readonly hasEvery?: ${array};`,\n ` readonly hasSome?: ${array};`,\n ` readonly isEmpty?: boolean;`,\n ],\n });\n}\n\nconst UPDATE_OPS_CONFIGS: ReadonlyArray<{ readonly prefix: string; readonly value: string }> = [\n { prefix: \"Int\", value: \"number\" },\n { prefix: \"Float\", value: \"number\" },\n { prefix: \"BigInt\", value: \"bigint | number\" },\n { prefix: \"Decimal\", value: \"string | number\" },\n];\n\nfunction updateOpsAlias(params: { prefix: string; value: string; nullable: boolean }): string {\n const { prefix, value, nullable } = params;\n const name = nullable ? `Nullable${prefix}FieldUpdateOperationsInput` : `${prefix}FieldUpdateOperationsInput`;\n return inputAlias({\n name,\n lines: [\n ` readonly set?: ${nullable ? `${value} | null` : value};`,\n ` readonly increment?: ${value};`,\n ` readonly decrement?: ${value};`,\n ` readonly multiply?: ${value};`,\n ` readonly divide?: ${value};`,\n ],\n });\n}\n\n/**\n * Json-column filters: the `path` + `equals`/`not`/`string_*`/`array_*` surface\n * `compileJsonFieldFilter` compiles, and NOTHING else — a member here that the\n * runtime refuses would be a compile-time promise broken at execution.\n *\n * `path` is a plain key/index array on purpose: the declaration says nothing\n * about which paths exist inside a stored document (the ORM cannot know), and\n * a template-literal or recursive key type would both lie and cost tsserver.\n * `mode` is narrower than `QueryMode` because the Json path takes only\n * `\"insensitive\"` / `\"default\"` — `\"strict\"` is refused there.\n */\nfunction jsonFilterAlias(params: { nullable: boolean }): string {\n const { nullable } = params;\n const document = nullable ? \"InputJsonValue | null\" : \"InputJsonValue\";\n return inputAlias({\n name: nullable ? \"JsonNullableFilter\" : \"JsonFilter\",\n lines: [\n ` readonly path?: readonly (string | number)[];`,\n ` readonly mode?: \"default\" | \"insensitive\";`,\n ` readonly equals?: ${document};`,\n ` readonly not?: ${document};`,\n ` readonly string_contains?: string;`,\n ` readonly string_starts_with?: string;`,\n ` readonly string_ends_with?: string;`,\n ` readonly array_contains?: InputJsonValue;`,\n ` readonly array_starts_with?: InputJsonValue;`,\n ` readonly array_ends_with?: InputJsonValue;`,\n ],\n });\n}\n\nfunction filterSection(): string[] {\n const parts: string[] = [banner({ title: \"Scalar filters\" })];\n for (const config of SCALAR_FILTER_CONFIGS) {\n parts.push(scalarFilterAlias({ config, nullable: false }));\n parts.push(scalarFilterAlias({ config, nullable: true }));\n parts.push(scalarListFilterAlias({ config }));\n }\n parts.push(jsonFilterAlias({ nullable: false }));\n parts.push(jsonFilterAlias({ nullable: true }));\n parts.push(\n inputAlias({\n name: \"JsonListFilter\",\n lines: [\n ` readonly equals?: readonly InputJsonValue[] | null;`,\n ` readonly has?: InputJsonValue | null;`,\n ` readonly hasEvery?: readonly InputJsonValue[];`,\n ` readonly hasSome?: readonly InputJsonValue[];`,\n ` readonly isEmpty?: boolean;`,\n ],\n }),\n );\n parts.push(banner({ title: \"Atomic update operations\" }));\n for (const config of UPDATE_OPS_CONFIGS) {\n parts.push(updateOpsAlias({ ...config, nullable: false }));\n parts.push(updateOpsAlias({ ...config, nullable: true }));\n }\n return parts;\n}\n\n// ─── Enums ────────────────────────────────────────────────────────\n\nconst GENERATED_HEADER: string = `// Generated by VibeORM (@vibeorm/generator) — DO NOT EDIT.\\n// Regenerate with \\`vibeorm generate\\` after every schema change.`;\n\n/** The constant object + literal union of one enum (the enums.d.ts half). */\nfunction emitEnumDeclaration(params: { declared: EnumView }): string {\n const { declared } = params;\n const name = declared.name;\n const valueLines = declared.values.map(\n (value) => ` readonly ${propKey({ name: value })}: ${tsString({ value })};`,\n );\n return [\n banner({ title: `Enum ${name}` }),\n `export declare const ${name}: {\\n${valueLines.join(\"\\n\")}\\n};`,\n `export type ${name} = ${declared.values.map((value) => tsString({ value })).join(\" | \")};`,\n `/** Boundary validator for ${name}: \\`values\\`, \\`is\\`, \\`parse\\` (throws VIBE_VALIDATION on a non-member). */\\n` +\n `export type ${name}Validator = {\\n` +\n ` readonly values: readonly ${name}[];\\n` +\n ` is(value: unknown): value is ${name};\\n` +\n ` parse(params: { readonly value: unknown }): ${name};\\n` +\n `};`,\n ].join(\"\\n\\n\");\n}\n\n/**\n * Emit enums.d.ts: every enum's constant, literal union and flat validator\n * type, plus the grouped `enumValidators`. Fully pre-resolved — no generics,\n * no imports — and independent of the client surface in index.d.ts.\n */\nexport function emitEnumsDts(params: { view: SchemaView }): string {\n const { view } = params;\n const parts: string[] = [\n `${GENERATED_HEADER}\\n// Lightweight entry: enum constants + boundary parsers. No runtime client, no schema module.`,\n ];\n for (const declared of view.enums) parts.push(emitEnumDeclaration({ declared }));\n parts.push(banner({ title: \"Enum validators\" }));\n const validatorLines = view.enums.map((declared) => ` readonly ${declared.name}: ${declared.name}Validator;`);\n parts.push(\n `/** Boundary parsers grouped by enum name, so an enum member named \\`parse\\` cannot collide. */\\n` +\n (validatorLines.length === 0\n ? `export declare const enumValidators: Record<string, never>;`\n : `export declare const enumValidators: {\\n${validatorLines.join(\"\\n\")}\\n};`),\n );\n return `${parts.join(\"\\n\\n\")}\\n`;\n}\n\n/** The client-surface half of an enum: its filter aliases (the constant + union live in enums.d.ts). */\nfunction emitEnum(params: { declared: EnumView }): string {\n const { declared } = params;\n const name = declared.name;\n const parts: string[] = [banner({ title: `Enum ${name} filters` })];\n\n const array = `readonly ${name}[]`;\n parts.push(\n inputAlias({\n name: `${name}Filter`,\n lines: [\n ` readonly equals?: ${name};`,\n ` readonly in?: ${array};`,\n ` readonly notIn?: ${array};`,\n ` readonly not?: ${name} | ${name}Filter;`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${name}NullableFilter`,\n lines: [\n ` readonly equals?: ${name} | null;`,\n ` readonly in?: ${array};`,\n ` readonly notIn?: ${array};`,\n ` readonly not?: ${name} | ${name}NullableFilter | null;`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${name}ListFilter`,\n lines: [\n ` readonly equals?: ${array} | null;`,\n ` readonly has?: ${name} | null;`,\n ` readonly hasEvery?: ${array};`,\n ` readonly hasSome?: ${array};`,\n ` readonly isEmpty?: boolean;`,\n ],\n }),\n );\n return parts.join(\"\\n\\n\");\n}\n\n// ─── Create / update input bodies ─────────────────────────────────\n\nfunction createFieldProp(params: { field: FieldView }): string {\n const { field } = params;\n const optional = field.isOptional || field.hasDefault || field.isUpdatedAt || field.isList;\n const base = inputBaseType({ field });\n const value = field.isList\n ? `readonly ${maybeParens({ type: base })}[]`\n : field.isOptional\n ? `${base} | null`\n : base;\n return ` readonly ${propKey({ name: field.name })}${optional ? \"?\" : \"\"}: ${value};`;\n}\n\nfunction updateFieldProp(params: { field: FieldView }): string {\n const { field } = params;\n const base = inputBaseType({ field });\n const key = propKey({ name: field.name });\n if (field.isList) {\n const element = maybeParens({ type: base });\n return ` readonly ${key}?: readonly ${element}[] | { readonly set?: readonly ${element}[]; readonly push?: ${base} | readonly ${element}[] };`;\n }\n const ops = updateOpsName({ field });\n const withNull = field.isOptional ? `${base} | null` : base;\n if (ops !== null) return ` readonly ${key}?: ${withNull} | ${ops};`;\n return ` readonly ${key}?: ${withNull} | { readonly set: ${withNull} };`;\n}\n\nfunction nestedRefName(params: { relation: RelationView; verb: \"Create\" | \"Update\" }): string {\n const { relation, verb } = params;\n const suffix = relation.inverseName === null ? \"\" : `Without${pascal({ name: relation.inverseName })}`;\n return `${relation.target}${verb}Nested${relation.isList ? \"Many\" : \"One\"}${suffix}Input`;\n}\n\n/** Checked input: relation fields present, ALL FK scalar columns excluded. */\nfunction checkedCreateLines(params: { model: ModelView; omitRelation?: string }): string[] {\n const { model, omitRelation } = params;\n const lines: string[] = [];\n for (const field of model.fields) {\n if (model.fkFieldNames.has(field.name)) continue;\n lines.push(createFieldProp({ field }));\n }\n for (const relation of model.relations) {\n if (relation.name === omitRelation) continue;\n const required = !relation.isList && !relation.isOptional;\n lines.push(\n ` readonly ${propKey({ name: relation.name })}${required ? \"\" : \"?\"}: ${nestedRefName({ relation, verb: \"Create\" })};`,\n );\n }\n return lines;\n}\n\n/** Unchecked input: scalar columns only (FKs included), no relation fields. */\nfunction uncheckedCreateLines(params: { model: ModelView; omitRelation?: string }): string[] {\n const { model, omitRelation } = params;\n const omitted = new Set(\n omitRelation === undefined\n ? []\n : (model.relations.find((relation) => relation.name === omitRelation)?.fkFields ?? []),\n );\n return model.fields.filter((field) => !omitted.has(field.name)).map((field) => createFieldProp({ field }));\n}\n\nfunction checkedUpdateLines(params: { model: ModelView; omitRelation?: string }): string[] {\n const { model, omitRelation } = params;\n const lines: string[] = [];\n for (const field of model.fields) {\n if (model.fkFieldNames.has(field.name)) continue;\n lines.push(updateFieldProp({ field }));\n }\n for (const relation of model.relations) {\n if (relation.name === omitRelation) continue;\n lines.push(\n ` readonly ${propKey({ name: relation.name })}?: ${nestedRefName({ relation, verb: \"Update\" })};`,\n );\n }\n return lines;\n}\n\nfunction uncheckedUpdateLines(params: { model: ModelView; omitRelation?: string }): string[] {\n const { model, omitRelation } = params;\n const omitted = new Set(\n omitRelation === undefined\n ? []\n : (model.relations.find((relation) => relation.name === omitRelation)?.fkFields ?? []),\n );\n return model.fields.filter((field) => !omitted.has(field.name)).map((field) => updateFieldProp({ field }));\n}\n\n// ─── Nested input registry ────────────────────────────────────────\n\n/**\n * Nested write wrappers, deduplicated by alias name. A context is one relation\n * seen from its parent: nested inputs for the TARGET model, \"without\" the\n * inverse field pointing back at the parent.\n */\ntype NestedRegistry = Map<string, string>;\n\nfunction register(params: { registry: NestedRegistry; name: string; text: string }): void {\n const { registry, name, text } = params;\n const existing = registry.get(name);\n if (existing !== undefined) {\n if (existing !== text) {\n throw new VibeError({\n code: \"VIBE_INTERNAL\",\n message: `internal: nested input type \"${name}\" generated with two different bodies`,\n meta: { name },\n });\n }\n return;\n }\n registry.set(name, text);\n}\n\nfunction registerNestedContext(params: {\n registry: NestedRegistry;\n view: SchemaView;\n relation: RelationView;\n}): void {\n const { registry, view, relation } = params;\n const target = view.modelByName.get(relation.target);\n if (target === undefined) return; // validation would have thrown already\n const t = target.name;\n const inverse = relation.inverseName;\n const suffix = inverse === null ? \"\" : `Without${pascal({ name: inverse })}`;\n const many = relation.isList;\n const m2m = relation.type === \"manyToMany\";\n\n let createUnion: string;\n let updateUnion: string;\n if (inverse === null) {\n createUnion = `${t}CreateInput | ${t}UncheckedCreateInput`;\n updateUnion = `${t}UpdateInput | ${t}UncheckedUpdateInput`;\n } else {\n createUnion = `${t}Create${suffix}Input | ${t}UncheckedCreate${suffix}Input`;\n updateUnion = `${t}Update${suffix}Input | ${t}UncheckedUpdate${suffix}Input`;\n register({\n registry,\n name: `${t}Create${suffix}Input`,\n text: inputAlias({\n name: `${t}Create${suffix}Input`,\n lines: checkedCreateLines({ model: target, omitRelation: inverse }),\n }),\n });\n register({\n registry,\n name: `${t}UncheckedCreate${suffix}Input`,\n text: inputAlias({\n name: `${t}UncheckedCreate${suffix}Input`,\n lines: uncheckedCreateLines({ model: target, omitRelation: inverse }),\n }),\n });\n register({\n registry,\n name: `${t}Update${suffix}Input`,\n text: inputAlias({\n name: `${t}Update${suffix}Input`,\n lines: checkedUpdateLines({ model: target, omitRelation: inverse }),\n }),\n });\n register({\n registry,\n name: `${t}UncheckedUpdate${suffix}Input`,\n text: inputAlias({\n name: `${t}UncheckedUpdate${suffix}Input`,\n lines: uncheckedUpdateLines({ model: target, omitRelation: inverse }),\n }),\n });\n }\n\n const connectOrCreateName = `${t}ConnectOrCreate${suffix}Input`;\n register({\n registry,\n name: connectOrCreateName,\n text: inputAlias({\n name: connectOrCreateName,\n lines: [` readonly where: ${t}WhereUniqueInput;`, ` readonly create: ${createUnion};`],\n }),\n });\n\n const createManyData =\n inverse === null ? `readonly ${t}CreateManyInput[]` : `readonly ${t}UncheckedCreate${suffix}Input[]`;\n\n if (many) {\n register({\n registry,\n name: `${t}CreateNestedMany${suffix}Input`,\n text: inputAlias({\n name: `${t}CreateNestedMany${suffix}Input`,\n lines: [\n ` readonly create?: ${orMany({ type: createUnion })};`,\n ` readonly connect?: ${orMany({ type: `${t}WhereUniqueInput` })};`,\n ` readonly connectOrCreate?: ${orMany({ type: connectOrCreateName })};`,\n ...(m2m\n ? []\n : [` readonly createMany?: { readonly data: ${createManyData}; readonly skipDuplicates?: boolean };`]),\n ],\n }),\n });\n\n const updateWithWhere = `${t}UpdateWithWhereUnique${suffix}Input`;\n register({\n registry,\n name: updateWithWhere,\n text: inputAlias({\n name: updateWithWhere,\n lines: [` readonly where: ${t}WhereUniqueInput;`, ` readonly data: ${updateUnion};`],\n }),\n });\n const updateManyWithWhere = `${t}UpdateManyWithWhere${suffix}Input`;\n register({\n registry,\n name: updateManyWithWhere,\n text: inputAlias({\n name: updateManyWithWhere,\n lines: [` readonly where: ${t}WhereInput;`, ` readonly data: ${t}UpdateManyInput;`],\n }),\n });\n const upsertWithWhere = `${t}UpsertWithWhereUnique${suffix}Input`;\n register({\n registry,\n name: upsertWithWhere,\n text: inputAlias({\n name: upsertWithWhere,\n lines: [\n ` readonly where: ${t}WhereUniqueInput;`,\n ` readonly create: ${createUnion};`,\n ` readonly update: ${updateUnion};`,\n ],\n }),\n });\n register({\n registry,\n name: `${t}UpdateNestedMany${suffix}Input`,\n text: inputAlias({\n name: `${t}UpdateNestedMany${suffix}Input`,\n lines: [\n ` readonly create?: ${orMany({ type: createUnion })};`,\n ` readonly connect?: ${orMany({ type: `${t}WhereUniqueInput` })};`,\n ` readonly connectOrCreate?: ${orMany({ type: connectOrCreateName })};`,\n ...(m2m\n ? []\n : [` readonly createMany?: { readonly data: ${createManyData}; readonly skipDuplicates?: boolean };`]),\n ` readonly set?: ${orMany({ type: `${t}WhereUniqueInput` })};`,\n ` readonly disconnect?: ${orMany({ type: `${t}WhereUniqueInput` })};`,\n ` readonly delete?: ${orMany({ type: `${t}WhereUniqueInput` })};`,\n ` readonly update?: ${orMany({ type: updateWithWhere })};`,\n ` readonly updateMany?: ${orMany({ type: updateManyWithWhere })};`,\n ` readonly deleteMany?: ${orMany({ type: `${t}WhereInput` })};`,\n ` readonly upsert?: ${orMany({ type: upsertWithWhere })};`,\n ],\n }),\n });\n } else {\n // The rare fallback (no resolvable inverse) always offers disconnect/delete;\n // the precise Without-variant gates them on the forward relation's optionality.\n const allowDetach = inverse === null || relation.isOptional;\n register({\n registry,\n name: `${t}CreateNestedOne${suffix}Input`,\n text: inputAlias({\n name: `${t}CreateNestedOne${suffix}Input`,\n lines: [\n ` readonly create?: ${createUnion};`,\n ` readonly connect?: ${t}WhereUniqueInput;`,\n ` readonly connectOrCreate?: ${connectOrCreateName};`,\n ],\n }),\n });\n register({\n registry,\n name: `${t}UpdateNestedOne${suffix}Input`,\n text: inputAlias({\n name: `${t}UpdateNestedOne${suffix}Input`,\n lines: [\n ` readonly create?: ${createUnion};`,\n ` readonly connect?: ${t}WhereUniqueInput;`,\n ` readonly connectOrCreate?: ${connectOrCreateName};`,\n ` readonly update?: ${updateUnion};`,\n ` readonly upsert?: { readonly create: ${createUnion}; readonly update: ${updateUnion} };`,\n ...(allowDetach ? [` readonly disconnect?: boolean;`, ` readonly delete?: boolean;`] : []),\n ],\n }),\n });\n }\n}\n\n// ─── Per-model emission ───────────────────────────────────────────\n\nconst AGGREGATE_OPS_UNION: string = `\"_count\" | \"_avg\" | \"_sum\" | \"_min\" | \"_max\"`;\n\nfunction emitModel(params: {\n model: ModelView;\n view: SchemaView;\n registry: NestedRegistry;\n /** Extension delegate-body lines (already indented) — baked surfaces (D9). */\n extensionLines?: readonly string[];\n /** The classified read-only subset of `extensionLines` (deny-by-default). */\n readOnlyExtensionLines?: readonly string[];\n /** Computed-field manifest entries for THIS model (config-declared, pre-resolved types). */\n computed?: readonly ComputedManifestEntry[];\n}): string {\n const { model, view, registry } = params;\n const computedEntries = params.computed ?? [];\n const n = model.name;\n const hasRelations = model.relations.length > 0;\n const parts: string[] = [banner({ title: `Model ${n}` })];\n\n for (const relation of model.relations) {\n registerNestedContext({ registry, view, relation });\n }\n\n // Payload (scalars + computed fields — relations are opt-in via include/select).\n parts.push(\n `export type ${n} = {\\n${[\n ...model.fields.map((field) => ` ${propKey({ name: field.name })}: ${payloadFieldType({ field })};`),\n ...computedEntries.map((entry) => ` ${propKey({ name: entry.field })}: ${entry.type};`),\n ].join(\"\\n\")}\\n};`,\n );\n\n parts.push(\n `export type ${n}ScalarFieldEnum = ${model.fields.map((field) => tsString({ value: field.name })).join(\" | \")};`,\n );\n\n // Computed fields are selectable/omittable but never SQL-addressable, so the\n // scalar enum (distinct, groupBy.by) stays scalar-only and the payload\n // narrowing maps over this wider union instead.\n if (computedEntries.length > 0) {\n parts.push(\n `export type ${n}SelectableFieldEnum = ${n}ScalarFieldEnum | ${computedEntries\n .map((entry) => tsString({ value: entry.field }))\n .join(\" | \")};`,\n );\n }\n const selectableEnum = computedEntries.length > 0 ? `${n}SelectableFieldEnum` : `${n}ScalarFieldEnum`;\n\n if (hasRelations) {\n parts.push(\n `export type ${n}Relations = {\\n${model.relations\n .map((relation) => ` ${propKey({ name: relation.name })}: ${relationPayloadType({ relation })};`)\n .join(\"\\n\")}\\n};`,\n );\n }\n\n // Select / Include / omit / nested-args. `_count` exists only where the\n // runtime can count something: models with at least one list relation.\n const listRelations = model.relations.filter((relation) => relation.isList);\n const hasCounts = listRelations.length > 0;\n const countLine = ` readonly _count?: boolean | { readonly select: ${n}CountSelect };`;\n const relationSelectValue = (relation: RelationView): string =>\n `boolean | ${relation.target}${relation.isList ? \"RelationFindManyArgs\" : \"Args\"}`;\n if (hasCounts) {\n parts.push(\n inputAlias({\n name: `${n}CountSelect`,\n // A count entry is a boolean OR a filter over the counted children —\n // the same WhereInput an ordinary query takes, pre-resolved, never\n // inferred (`_count: { select: { posts: { where: … } } }`).\n lines: listRelations.map(\n (relation) =>\n ` readonly ${propKey({ name: relation.name })}?: boolean | { readonly where?: ${relation.target}WhereInput };`,\n ),\n }),\n );\n }\n parts.push(\n inputAlias({\n name: `${n}Select`,\n lines: [\n ...model.fields.map((field) => ` readonly ${propKey({ name: field.name })}?: boolean;`),\n ...computedEntries.map((entry) => ` readonly ${propKey({ name: entry.field })}?: boolean;`),\n ...model.relations.map(\n (relation) => ` readonly ${propKey({ name: relation.name })}?: ${relationSelectValue(relation)};`,\n ),\n ...(hasCounts ? [countLine] : []),\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}Include`,\n lines: [\n ...model.relations.map(\n (relation) => ` readonly ${propKey({ name: relation.name })}?: ${relationSelectValue(relation)};`,\n ),\n ...(hasCounts ? [countLine] : []),\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}OmitInput`,\n lines: [\n ...model.fields.map((field) => ` readonly ${propKey({ name: field.name })}?: boolean;`),\n ...computedEntries.map((entry) => ` readonly ${propKey({ name: entry.field })}?: boolean;`),\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}Args`,\n lines: [\n ` readonly select?: ${n}Select;`,\n ` readonly include?: ${n}Include;`,\n ` readonly omit?: ${n}OmitInput;`,\n ` readonly relationStrategy?: RelationStrategy;`,\n ],\n }),\n );\n\n // Relation filters (referenced by OTHER models' WhereInput).\n parts.push(\n inputAlias({\n name: `${n}ListRelationFilter`,\n lines: [\n ` readonly some?: ${n}WhereInput;`,\n ` readonly every?: ${n}WhereInput;`,\n ` readonly none?: ${n}WhereInput;`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}RelationFilter`,\n lines: [` readonly is?: ${n}WhereInput | null;`, ` readonly isNot?: ${n}WhereInput | null;`],\n }),\n );\n\n // Where.\n const whereLines: string[] = [\n ` /** Constructed raw SQL; refused on scoped, read-only and field-masked handles. */`,\n ` readonly $raw?: SqlFragment;`,\n ` readonly AND?: ${orMany({ type: `${n}WhereInput` })};`,\n ` readonly OR?: readonly ${n}WhereInput[];`,\n ` readonly NOT?: ${orMany({ type: `${n}WhereInput` })};`,\n ];\n for (const field of model.fields) {\n const key = propKey({ name: field.name });\n if (field.isList || field.scalar === \"Json\") {\n whereLines.push(` readonly ${key}?: ${filterName({ field })};`);\n continue;\n }\n const nullable = field.isOptional ? \" | null\" : \"\";\n whereLines.push(` readonly ${key}?: ${inputBaseType({ field })} | ${filterName({ field })}${nullable};`);\n }\n for (const relation of model.relations) {\n const key = propKey({ name: relation.name });\n if (relation.isList) {\n whereLines.push(` readonly ${key}?: ${relation.target}ListRelationFilter;`);\n } else {\n whereLines.push(\n ` readonly ${key}?: ${relation.target}RelationFilter | ${relation.target}WhereInput${relation.isOptional ? \" | null\" : \"\"};`,\n );\n }\n }\n parts.push(inputAlias({ name: `${n}WhereInput`, lines: whereLines }));\n\n // WhereUnique — one union member per way to address a single row.\n if (model.uniques.length === 0) {\n parts.push(`export type ${n}WhereUniqueInput = never;`);\n } else {\n const members = model.uniques.map((member) => {\n // NULLS NOT DISTINCT groups: a null member addresses the (single) null\n // slot, so optional members widen to `| null` — mirroring the runtime's\n // isAddressableMember rule.\n const first = member.fields[0];\n if (member.fields.length === 1 && first !== undefined) {\n return `{ readonly ${propKey({ name: first.name })}: ${inputBaseType({ field: first })}${member.nullsNotDistinct && first.isOptional ? \" | null\" : \"\"} }`;\n }\n const inner = member.fields\n .map(\n (field) =>\n `readonly ${propKey({ name: field.name })}: ${inputBaseType({ field })}${member.nullsNotDistinct && field.isOptional ? \" | null\" : \"\"}`,\n )\n .join(\"; \");\n return `{ readonly ${propKey({ name: member.key })}: { ${inner} } }`;\n });\n parts.push(`export type ${n}WhereUniqueInput =\\n | ${members.join(\"\\n | \")};`);\n }\n\n // Only top-level finds accept relation ordering. Related scalars take a\n // direction, never null placement or another relation traversal.\n const scalarOrderLines = model.fields.map(\n (field) => ` readonly ${propKey({ name: field.name })}?: ${field.isOptional ? \"SortOrderWithNulls\" : \"SortOrder\"};`,\n );\n parts.push(inputAlias({ name: `${n}ScalarOrderByInput`, lines: scalarOrderLines }));\n parts.push(inputAlias({\n name: `${n}RelationOrderByInput`,\n lines: model.fields.map((field) => ` readonly ${propKey({ name: field.name })}?: SortOrder;`),\n }));\n parts.push(inputAlias({\n name: `${n}OrderByInput`,\n lines: [\n ...scalarOrderLines,\n ...model.relations.map((relation) =>\n ` readonly ${propKey({ name: relation.name })}?: ${relation.isList ? \"{ readonly _count?: SortOrder | Skip }\" : `${relation.target}RelationOrderByInput`};`,\n ),\n ],\n }));\n\n // Create / update inputs.\n parts.push(inputAlias({ name: `${n}CreateInput`, lines: checkedCreateLines({ model }) }));\n parts.push(inputAlias({ name: `${n}UncheckedCreateInput`, lines: uncheckedCreateLines({ model }) }));\n parts.push(`export type ${n}CreateManyInput = ${n}UncheckedCreateInput;`);\n parts.push(inputAlias({ name: `${n}UpdateInput`, lines: checkedUpdateLines({ model }) }));\n parts.push(inputAlias({ name: `${n}UncheckedUpdateInput`, lines: uncheckedUpdateLines({ model }) }));\n parts.push(`export type ${n}UpdateManyInput = ${n}UncheckedUpdateInput;`);\n\n // Aggregate inputs.\n const numericFields = model.fields.filter(\n (field) => !field.isList && field.scalar !== null && NUMERIC_SCALARS.has(field.scalar),\n );\n const minmaxFields = model.fields.filter(\n (field) => !field.isList && field.scalar !== null && MINMAX_SCALARS.has(field.scalar),\n );\n parts.push(\n inputAlias({\n name: `${n}CountAggregateInput`,\n lines: [\n ...model.fields.map((field) => ` readonly ${propKey({ name: field.name })}?: true;`),\n ` readonly _all?: true;`,\n ],\n }),\n );\n const aggregateOpProps: string[] = [` readonly _count?: true | ${n}CountAggregateInput;`];\n if (numericFields.length > 0) {\n parts.push(\n inputAlias({\n name: `${n}AvgAggregateInput`,\n lines: numericFields.map((field) => ` readonly ${propKey({ name: field.name })}?: true;`),\n }),\n );\n parts.push(`export type ${n}SumAggregateInput = ${n}AvgAggregateInput;`);\n aggregateOpProps.push(` readonly _avg?: ${n}AvgAggregateInput;`);\n aggregateOpProps.push(` readonly _sum?: ${n}SumAggregateInput;`);\n }\n if (minmaxFields.length > 0) {\n parts.push(\n inputAlias({\n name: `${n}MinAggregateInput`,\n lines: minmaxFields.map((field) => ` readonly ${propKey({ name: field.name })}?: true;`),\n }),\n );\n parts.push(`export type ${n}MaxAggregateInput = ${n}MinAggregateInput;`);\n aggregateOpProps.push(` readonly _min?: ${n}MinAggregateInput;`);\n aggregateOpProps.push(` readonly _max?: ${n}MaxAggregateInput;`);\n }\n\n // Method args. Write nested inputs concretely to keep consumer type cost low.\n for (const nested of [false, true]) {\n parts.push(\n inputAlias({\n name: `${n}${nested ? \"RelationFindManyArgs\" : \"FindManyArgs\"}`,\n lines: [\n ` readonly where?: ${n}WhereInput;`,\n ` readonly orderBy?: ${orMany({ type: `${n}${nested ? \"ScalarOrderByInput\" : \"OrderByInput\"}` })};`,\n ` readonly select?: ${n}Select;`,\n ` readonly include?: ${n}Include;`,\n ` readonly omit?: ${n}OmitInput;`,\n ` readonly take?: number;`,\n ` readonly skip?: number;`,\n ...(!nested ? [\n ` readonly cursor?: ${n}WhereUniqueInput;`,\n ` readonly after?: KeysetToken;`,\n ` readonly keyset?: KeysetOptions;`,\n ` readonly distinct?: ${orMany({ type: `${n}ScalarFieldEnum` })};`,\n ` readonly relationStrategy?: RelationStrategy;`,\n lockArgumentLines(),\n ] : []),\n ],\n }),\n );\n }\n parts.push(`export type ${n}FindFirstArgs = ${n}FindManyArgs;`);\n parts.push(\n inputAlias({\n name: `${n}FindUniqueArgs`,\n lines: [\n ` readonly where: ${n}WhereUniqueInput;`,\n ` readonly select?: ${n}Select;`,\n ` readonly include?: ${n}Include;`,\n ` readonly omit?: ${n}OmitInput;`,\n ` readonly relationStrategy?: RelationStrategy;`,\n lockArgumentLines(),\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}CreateArgs`,\n lines: [\n ` readonly onConflict?: never;`,\n ` readonly data: ${n}CreateInput | ${n}UncheckedCreateInput;`,\n ` readonly select?: ${n}Select;`,\n ` readonly include?: ${n}Include;`,\n ` readonly omit?: ${n}OmitInput;`,\n ],\n }),\n );\n parts.push(\n `export type ${n}ConflictTarget = readonly ${n}ScalarFieldEnum[] | { readonly constraint: string };`,\n );\n parts.push(\n `export type ${n}CreateOnConflictInput =\\n` +\n ` | { readonly action: \"nothing\"; readonly update?: never; readonly target?: ${n}ConflictTarget | Skip; readonly where?: string | Skip }` +\n (capabilitiesOf({ view }).returning\n ? `\\n | { readonly action: \"update\"; readonly target: ${n}ConflictTarget; readonly update: { ${model.fields.map((field) => `readonly ${propKey({ name: field.name })}?: SqlFragment`).join(\"; \")} }; readonly where?: string | Skip }`\n : \"\") + \";\",\n );\n parts.push(\n inputAlias({\n name: `${n}CreateOrSkipArgs`,\n lines: [\n ` readonly data: ${n}CreateInput | ${n}UncheckedCreateInput;`,\n ` readonly onConflict: ${n}CreateOnConflictInput;`,\n ` readonly select?: ${n}Select;`,\n ` readonly include?: ${n}Include;`,\n ` readonly omit?: ${n}OmitInput;`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}CreateManyArgs`,\n lines: [\n ` readonly data: ${orMany({ type: `${n}CreateManyInput` })};`,\n ` readonly skipDuplicates?: boolean | { readonly target?: ${n}ConflictTarget; readonly where?: string };`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}CreateManyAndReturnArgs`,\n lines: [\n ` readonly data: ${orMany({ type: `${n}CreateManyInput` })};`,\n ` readonly skipDuplicates?: boolean | { readonly target?: ${n}ConflictTarget; readonly where?: string };`,\n ` readonly select?: ${n}Select;`,\n ` readonly omit?: ${n}OmitInput;`,\n ],\n }),\n );\n // EPIC 10 — batched upsert for ingestion. Scalar rows, an explicit arbiter\n // and an explicit list of columns the conflict arm copies from the incoming\n // row. No select/include: the operation reports a count, not rows.\n parts.push(\n inputAlias({\n name: `${n}UpsertManyArgs`,\n lines: [\n ` readonly data: readonly ${n}CreateManyInput[];`,\n ` readonly conflictTarget: ${n}ConflictTarget;`,\n ` readonly conflictWhere?: string;`,\n ` readonly update: readonly ${n}ScalarFieldEnum[] | { ${model.fields.map((field) => `readonly ${propKey({ name: field.name })}?: SqlFragment`).join(\"; \")} };`,\n ` readonly skipUpdatedAt?: boolean;`,\n ` readonly allowAnyUniqueConflict?: boolean;`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}UpdateArgs`,\n lines: [\n ` readonly where: ${n}UpdateWhereInput;`,\n ` readonly data: ${n}UpdateInput | ${n}UncheckedUpdateInput;`,\n ` readonly select?: ${n}Select;`,\n ` readonly include?: ${n}Include;`,\n ` readonly omit?: ${n}OmitInput;`,\n ` readonly skipUpdatedAt?: boolean;`,\n ],\n }),\n );\n // EPIC 2 — conditional update. The shared WhereUniqueInput is deliberately\n // NOT widened: cursors and the native upsert have different contracts (a\n // cursor must name one row's position; ON CONFLICT cannot see a guard field).\n // update() alone preserves extra predicates — they compile into the UPDATE's\n // own WHERE, so the check and the write are ONE atomic statement.\n parts.push(\n `/** update()'s where: a concrete unique selector AND any additional predicates (optimistic-concurrency guards such as \\`{ id, version }\\`). */\\nexport type ${n}UpdateWhereInput = ${n}WhereUniqueInput & ${n}WhereInput;`,\n );\n parts.push(\n inputAlias({\n name: `${n}UpdateManyArgs`,\n lines: [\n ` readonly where?: ${n}WhereInput;`,\n ` readonly data: ${n}UpdateManyInput;`,\n ` readonly skipUpdatedAt?: boolean;`,\n ],\n }),\n );\n // EPIC 2 — the bulk update that reports WHICH rows changed. No `include`:\n // relations are refused explicitly rather than accepted and ignored.\n parts.push(\n inputAlias({\n name: `${n}UpdateManyAndReturnArgs`,\n lines: [\n ` readonly include?: never;`,\n ` readonly where?: ${n}WhereInput;`,\n ` readonly data: ${n}UpdateManyInput;`,\n ` readonly select?: ${n}Select;`,\n ` readonly omit?: ${n}OmitInput;`,\n ` readonly skipUpdatedAt?: boolean;`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}UpsertArgs`,\n lines: [\n ` readonly where: ${n}WhereUniqueInput;`,\n ` readonly create: ${n}CreateInput | ${n}UncheckedCreateInput;`,\n ` readonly update: ${n}UpdateInput | ${n}UncheckedUpdateInput;`,\n ` readonly onConflict?: { readonly constraint: string };`,\n ` readonly select?: ${n}Select;`,\n ` readonly include?: ${n}Include;`,\n ` readonly omit?: ${n}OmitInput;`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}DeleteArgs`,\n lines: [\n ` readonly where: ${n}WhereUniqueInput;`,\n ` readonly select?: ${n}Select;`,\n ` readonly include?: ${n}Include;`,\n ` readonly omit?: ${n}OmitInput;`,\n ],\n }),\n );\n parts.push(inputAlias({ name: `${n}DeleteManyArgs`, lines: [` readonly where?: ${n}WhereInput;`] }));\n parts.push(\n inputAlias({\n name: `${n}CountArgs`,\n lines: [\n ` readonly select?: ${n}CountAggregateInput;`,\n ` readonly where?: ${n}WhereInput;`,\n ` readonly orderBy?: ${orMany({ type: `${n}ScalarOrderByInput` })};`,\n ` readonly cursor?: ${n}WhereUniqueInput;`,\n ` readonly take?: number;`,\n ` readonly skip?: number;`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}AggregateArgs`,\n lines: [\n ` readonly where?: ${n}WhereInput;`,\n ` readonly orderBy?: ${orMany({ type: `${n}ScalarOrderByInput` })};`,\n ` readonly cursor?: ${n}WhereUniqueInput;`,\n ` readonly take?: number;`,\n ` readonly skip?: number;`,\n ...aggregateOpProps,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}GroupByArgs`,\n lines: [\n ` readonly by: readonly ${n}ScalarFieldEnum[];`,\n ` readonly where?: ${n}WhereInput;`,\n ` readonly orderBy?: ${orMany({ type: `${n}ScalarOrderByInput` })};`,\n ` readonly having?: ${n}WhereInput;`,\n ` readonly take?: number;`,\n ` readonly skip?: number;`,\n ...aggregateOpProps,\n ],\n }),\n );\n\n // Result narrowing: one shallow conditional per key + mapped lookups.\n // `omit`/`include`/`_count` each resolve through their own single-conditional\n // helper and combine by intersection (`unknown` is the identity), so no\n // branch nests deeper than one conditional (constitution rule 2).\n // Conditional selections are CONSERVATIVE: a literal `true` keeps the field\n // required, a literal `false`/`undefined` drops it, and anything widened\n // (`boolean`, a variable flag) makes it OPTIONAL — the result type must not\n // promise a field the run-time flag can still switch off.\n const exactPart = (source: string): string => `${source}[K] extends false | undefined | Skip ? never : false extends ${source}[K] ? never : undefined extends ${source}[K] ? never : Skip extends ${source}[K] ? never : K`;\n const uncertainPart = (source: string): string =>\n `${source}[K] extends false | undefined | Skip ? never : false extends ${source}[K] ? K : undefined extends ${source}[K] ? K : Skip extends ${source}[K] ? K : never`;\n parts.push(\n `type ${n}OmitBase<A> = A extends { readonly omit: infer O extends object }\\n` +\n ` ? Omit<${n}, PossibleKeys<O> & keyof ${n}> & { [K in UncertainKeys<O> & keyof ${n}]?: ${n}[K] }\\n` +\n ` : \"omit\" extends keyof A ? Omit<${n}, PossibleKeys<Provided<A[\"omit\"]>> & keyof ${n}> & Partial<Pick<${n}, PossibleKeys<Provided<A[\"omit\"]>> & keyof ${n}>> : ${n};`,\n );\n if (hasCounts) {\n const listUnion = listRelations.map((relation) => tsString({ value: relation.name })).join(\" | \");\n const allCounts = listRelations\n .map((relation) => `${propKey({ name: relation.name })}: number`)\n .join(\"; \");\n parts.push(\n `type ${n}CountResult<C> = C extends { readonly select: infer CS extends object }\\n` +\n ` ? { [K in keyof CS & (${listUnion}) as ${exactPart(\"CS\")}]: number } &\\n` +\n ` { [K in keyof CS & (${listUnion}) as ${uncertainPart(\"CS\")}]?: number }\\n` +\n ` : C extends { readonly select: Skip } ? { ${allCounts} }\\n` +\n ` : \"select\" extends keyof C ? Partial<{ ${allCounts} }> : { ${allCounts} };`,\n );\n parts.push(\n `type ${n}CountPayload<S> = S extends { readonly _count: infer C extends true | object } ? { _count: ${n}CountResult<C> }\\n` +\n ` : S extends { readonly _count: false | undefined | Skip } ? unknown\\n` +\n ` : S extends { readonly _count?: infer C extends boolean | object | Skip } ? { _count?: ${n}CountResult<Provided<C>> } : unknown;`,\n );\n }\n if (hasRelations) {\n const relationCases = model.relations\n .map((relation) => {\n const nested = `${relation.target}GetPayload<A>`;\n const guard = `A extends object`;\n let expression: string;\n if (relation.isList) {\n expression = `${guard} ? ${nested}[] : ${relation.target}[]`;\n } else if (relation.isOptional) {\n expression = `(${guard} ? ${nested} : ${relation.target}) | null`;\n } else {\n expression = `${guard} ? ${nested} : ${relation.target}`;\n }\n return ` ${propKey({ name: relation.name })}: ${expression};`;\n })\n .join(\"\\n\");\n parts.push(`type ${n}RelationPayload<K extends keyof ${n}Relations, A> = {\\n${relationCases}\\n}[K];`);\n parts.push(\n `type ${n}IncludePayload<A> = A extends { readonly include: infer I extends object }\\n` +\n ` ? { [K in keyof I & keyof ${n}Relations as ${exactPart(\"I\")}]: ${n}RelationPayload<K, I[K]> } &\\n` +\n ` { [K in keyof I & keyof ${n}Relations as ${uncertainPart(\"I\")}]?: ${n}RelationPayload<K, I[K]> }${hasCounts ? ` &\\n ${n}CountPayload<I>` : \"\"}\\n` +\n ` : \"include\" extends keyof A ? Partial<${n}IncludePayload<{ include: Provided<A[\"include\"]> }>> : unknown;`,\n );\n parts.push(\n `export type ${n}GetPayload<A> = A extends { readonly select: infer S extends object }\\n` +\n ` ? { [K in keyof S & ${selectableEnum} as ${exactPart(\"S\")}]: ${n}[K & keyof ${n}] } &\\n` +\n ` { [K in keyof S & ${selectableEnum} as ${uncertainPart(\"S\")}]?: ${n}[K & keyof ${n}] } &\\n` +\n ` { [K in keyof S & keyof ${n}Relations as ${exactPart(\"S\")}]: ${n}RelationPayload<K, S[K]> } &\\n` +\n ` { [K in keyof S & keyof ${n}Relations as ${uncertainPart(\"S\")}]?: ${n}RelationPayload<K, S[K]> }${hasCounts ? ` &\\n ${n}CountPayload<S>` : \"\"}\\n` +\n ` : A extends { readonly select: Skip } ? ${n}OmitBase<A> & ${n}IncludePayload<A>\\n` +\n ` : \"select\" extends keyof A ? Partial<${n}>\\n` +\n ` : ${n}OmitBase<A> & ${n}IncludePayload<A>;`,\n );\n } else {\n parts.push(\n `export type ${n}GetPayload<A> = A extends { readonly select: infer S extends object }\\n` +\n ` ? { [K in keyof S & ${selectableEnum} as ${exactPart(\"S\")}]: ${n}[K & keyof ${n}] } &\\n` +\n ` { [K in keyof S & ${selectableEnum} as ${uncertainPart(\"S\")}]?: ${n}[K & keyof ${n}] }\\n` +\n ` : A extends { readonly select: Skip } ? ${n}OmitBase<A>\\n` +\n ` : \"select\" extends keyof A ? Partial<${n}> : ${n}OmitBase<A>;`,\n );\n }\n\n // All aggregate value types are resolved from the schema here, not inferred\n // from field kinds by the consumer. Only the caller's selected keys remain generic.\n const aggregateFields = (fields: readonly FieldView[], value: (field: FieldView) => string): string =>\n `{ ${fields.map((field) => `${propKey({ name: field.name })}: ${value(field)}`).join(\"; \")} }`;\n const countValues = aggregateFields(model.fields, () => \"number\").replace(\" }\", \"; _all: number }\");\n parts.push(`type ${n}AggregateValues = {\\n` +\n ` _count: ${countValues};\\n` +\n ` _avg: ${aggregateFields(numericFields, () => \"number | null\")};\\n` +\n ` _sum: ${aggregateFields(numericFields, (field) => `${n}[${tsString({ value: field.name })}] | null`)};\\n` +\n ` _min: ${aggregateFields(minmaxFields, (field) => `${n}[${tsString({ value: field.name })}] | null`)};\\n` +\n ` _max: ${aggregateFields(minmaxFields, (field) => `${n}[${tsString({ value: field.name })}] | null`)};\n};`);\n parts.push(`type ${n}AggregateSelection<V, S> = S extends true ? number : S extends object\\n` +\n ` ? { [K in keyof S & keyof V as ${exactPart(\"S\")}]: V[K] } &\\n` +\n ` { [K in keyof S & keyof V as ${uncertainPart(\"S\")}]?: V[K] } : never;`);\n parts.push(`type ${n}CountOutput<A> = A extends { readonly select: infer S extends object }\\n` +\n ` ? ${n}AggregateSelection<${n}AggregateValues[\"_count\"], S>\\n` +\n ` : \"select\" extends keyof A ? number | ${n}AggregateSelection<${n}AggregateValues[\"_count\"], Provided<A[\"select\"]>> : number;`);\n parts.push(`export type ${n}AggregateResult<A> =\\n` +\n ` { [K in keyof A & keyof ${n}AggregateValues as HasSelectedField<A[K]> extends true ? K : never]: ${n}AggregateSelection<${n}AggregateValues[K], A[K]> } &\\n` +\n ` { [K in keyof A & keyof ${n}AggregateValues as A[K] extends false | undefined | Skip ? never : HasSelectedField<A[K]> extends true ? never : K]?: ${n}AggregateSelection<${n}AggregateValues[K], Provided<A[K]>> };`);\n parts.push(\n `export type ${n}GroupByResult<A extends ${n}GroupByArgs> =\\n` +\n ` (number extends A[\"by\"][\"length\"] ? Partial<Pick<${n}, A[\"by\"][number]>> : Pick<${n}, A[\"by\"][number]>) & ${n}AggregateResult<A>;`,\n );\n\n // Delegate. A view carries the read half only: `migrate` never creates a\n // table for it, so a typed write would be a promise the system cannot keep.\n const readMethods: string[] = [\n ` findMany<A extends ${n}FindManyArgs = {}>(args?: A): VibeQueryPromise<${n}GetPayload<A>[]>;`,\n ` findFirst<A extends ${n}FindFirstArgs = {}>(args?: A): VibeQueryPromise<${n}GetPayload<A> | null>;`,\n ` findFirstOrThrow<A extends ${n}FindFirstArgs = {}>(args?: A): VibeQueryPromise<${n}GetPayload<A>>;`,\n ` findUnique<A extends ${n}FindUniqueArgs>(args: A): VibeQueryPromise<${n}GetPayload<A> | null>;`,\n ` findUniqueOrThrow<A extends ${n}FindUniqueArgs>(args: A): VibeQueryPromise<${n}GetPayload<A>>;`,\n ];\n const writeMethods: string[] = [\n ` create<A extends ${n}CreateOrSkipArgs>(args: A): VibeQueryPromise<${n}GetPayload<A> | null, \"write\">;`,\n ` create<A extends ${n}CreateArgs>(args: A): VibeQueryPromise<${n}GetPayload<A>, \"write\">;`,\n ` createMany(args: ${n}CreateManyArgs): VibeQueryPromise<BatchPayload, \"write\">;`,\n ` createManyAndReturn<A extends ${n}CreateManyAndReturnArgs>(args: A): VibeQueryPromise<${n}GetPayload<A>[], \"write\">;`,\n ` update<A extends ${n}UpdateArgs>(args: A): VibeQueryPromise<${n}GetPayload<A>, \"write\">;`,\n ` updateMany(args: ${n}UpdateManyArgs): VibeQueryPromise<BatchPayload, \"write\">;`,\n ` updateManyAndReturn<A extends ${n}UpdateManyAndReturnArgs>(args: A): VibeQueryPromise<${n}GetPayload<A>[], \"write\">;`,\n ` upsert<A extends ${n}UpsertArgs>(args: A): VibeQueryPromise<${n}GetPayload<A>, \"write\">;`,\n ` upsertMany(args: ${n}UpsertManyArgs): VibeQueryPromise<UpsertManyPayload, \"write\">;`,\n ` delete<A extends ${n}DeleteArgs>(args: A): VibeQueryPromise<${n}GetPayload<A>, \"write\">;`,\n ` deleteMany(args?: ${n}DeleteManyArgs): VibeQueryPromise<BatchPayload, \"write\">;`,\n ];\n const aggregateMethods: string[] = [\n ` count<A extends ${n}CountArgs = {}>(args?: A): VibeQueryPromise<${n}CountOutput<A>>;`,\n ` aggregate<A extends ${n}AggregateArgs>(args: A): VibeQueryPromise<${n}AggregateResult<A>>;`,\n ` groupBy<const A extends ${n}GroupByArgs>(args: A): VibeQueryPromise<${n}GroupByResult<A>[]>;`,\n ];\n const delegateMethods: string[] = model.isView\n ? [...readMethods, ...aggregateMethods]\n : [...readMethods, ...writeMethods, ...aggregateMethods];\n delegateMethods.push(...(params.extensionLines ?? []));\n parts.push(`export type ${n}Delegate = {\\n${delegateMethods.join(\"\\n\")}\\n};`);\n\n // The read-only delegate: the SAME read members, and no write member at all.\n // Built from the allowlist the runtime enforces (`READ_DELEGATE_METHODS`), not\n // by subtracting a list of writes — a method added later is absent from both\n // until someone classifies it.\n parts.push(\n `/** ${n}'s read surface on a \\`$readOnly()\\` client. Writes are not declared, and are refused at runtime with \\`VIBE_READ_ONLY\\`. */\\n` +\n `export type ${n}ReadOnlyDelegate = {\\n${[...readMethods, ...aggregateMethods, ...(params.readOnlyExtensionLines ?? [])].join(\"\\n\")}\\n};`,\n );\n\n return parts.join(\"\\n\\n\");\n}\n\n// ─── Field-masking views ($defineView) ──────────────────────────\n\n/**\n * The typed `$defineView` surface (board #11 — v1 `defineView` parity).\n * Budget shape (rule 2): every helper is one shallow conditional or one mapped\n * lookup; relation masking resolves ONE include level against the definition\n * (the runtime masks recursively — deeper levels are typed as their masked\n * target's scalars, matching v1's depth).\n */\nfunction emitViewTypesForModel(params: { model: ModelView; view: SchemaView }): string {\n const { model, view } = params;\n const n = model.name;\n const hasRelations = model.relations.length > 0;\n const parts: string[] = [];\n\n parts.push(\n objectAlias({\n name: `${n}ViewFields`,\n lines: model.fields.map((field) => ` readonly ${propKey({ name: field.name })}?: true;`),\n }),\n );\n parts.push(\n objectAlias({\n name: `${n}ViewSelect`,\n lines: model.fields.map((field) => ` readonly ${propKey({ name: field.name })}?: boolean;`),\n }),\n );\n parts.push(\n `type ${n}ViewScalars<F> = { [K in keyof F & ${n}ScalarFieldEnum]: ${n}[K & keyof ${n}] };`,\n );\n\n if (hasRelations) {\n parts.push(\n objectAlias({\n name: `${n}ViewInclude`,\n lines: model.relations.map(\n (relation) =>\n ` readonly ${propKey({ name: relation.name })}?: boolean | ${relation.target}ViewNestedArgs;`,\n ),\n }),\n );\n }\n parts.push(\n objectAlias({\n name: `${n}ViewNestedArgs`,\n lines: [\n ` readonly where?: ${n}WhereInput;`,\n ` readonly orderBy?: ${orMany({ type: `${n}ScalarOrderByInput` })};`,\n ` readonly take?: number;`,\n ` readonly skip?: number;`,\n ` readonly select?: ${n}ViewSelect;`,\n ` readonly reveal?: ${n}ViewSelect;`,\n ...(hasRelations ? [` readonly include?: ${n}ViewInclude;`] : []),\n ],\n }),\n );\n parts.push(\n objectAlias({\n name: `${n}ViewFindManyArgs`,\n lines: [\n ` readonly where?: ${n}WhereInput;`,\n ` readonly orderBy?: ${orMany({ type: `${n}OrderByInput` })};`,\n ` readonly select?: ${n}ViewSelect;`,\n ` readonly reveal?: ${n}ViewSelect;`,\n ...(hasRelations ? [` readonly include?: ${n}ViewInclude;`] : []),\n ` readonly cursor?: ${n}WhereUniqueInput;`,\n ` readonly take?: number;`,\n ` readonly skip?: number;`,\n ` readonly distinct?: ${orMany({ type: `${n}ScalarFieldEnum` })};`,\n ` readonly relationStrategy?: RelationStrategy;`,\n ],\n }),\n );\n parts.push(\n objectAlias({\n name: `${n}ViewFindUniqueArgs`,\n lines: [\n ` readonly where: ${n}WhereUniqueInput;`,\n ` readonly select?: ${n}ViewSelect;`,\n ` readonly reveal?: ${n}ViewSelect;`,\n ...(hasRelations ? [` readonly include?: ${n}ViewInclude;`] : []),\n ` readonly relationStrategy?: RelationStrategy;`,\n ],\n }),\n );\n\n // Result narrowing — same one-conditional-per-key discipline as GetPayload.\n const exactPart = (source: string): string => `${source}[K] extends false | undefined | Skip ? never : false extends ${source}[K] ? never : undefined extends ${source}[K] ? never : Skip extends ${source}[K] ? never : K`;\n const uncertainPart = (source: string): string => `${source}[K] extends false | undefined | Skip ? never : false extends ${source}[K] ? K : undefined extends ${source}[K] ? K : Skip extends ${source}[K] ? K : never`;\n parts.push(\n `type ${n}ViewSelectScalars<F, A> = A extends { readonly select: infer S extends object }\\n` +\n ` ? { [K in keyof S & keyof F & ${n}ScalarFieldEnum as ${exactPart(\"S\")}]: ${n}[K & keyof ${n}] } &\\n` +\n ` { [K in keyof S & keyof F & ${n}ScalarFieldEnum as ${uncertainPart(\"S\")}]?: ${n}[K & keyof ${n}] }\\n` +\n ` : \"select\" extends keyof A ? Partial<${n}ViewScalars<F>> : ${n}ViewScalars<F>;`,\n );\n parts.push(\n `type ${n}ViewReveal<A> = A extends { readonly reveal: infer R extends object }\\n` +\n ` ? { [K in keyof R & ${n}ScalarFieldEnum as ${exactPart(\"R\")}]: ${n}[K & keyof ${n}] } &\\n` +\n ` { [K in keyof R & ${n}ScalarFieldEnum as ${uncertainPart(\"R\")}]?: ${n}[K & keyof ${n}] }\\n` +\n ` : \"reveal\" extends keyof A ? Partial<${n}ViewReveal<{ reveal: NonNullable<A[\"reveal\"]> }>> : unknown;`,\n );\n if (hasRelations) {\n const relationCases = model.relations\n .map((relation) => {\n const target = relation.target;\n const targetClientKey = view.modelByName.get(target)?.clientName ?? target;\n const guard = `D extends { readonly ${propKey({ name: targetClientKey })}: infer RF extends object }`;\n const masked = `ViewRow<${target}ViewSelectScalars<RF, A> & ${target}ViewReveal<A>>`;\n const unmasked = `(A extends object ? ${target}GetPayload<A> : ${target})`;\n let expression: string;\n if (relation.isList) {\n expression = `${guard} ? ${masked}[] : ${unmasked}[]`;\n } else if (relation.isOptional) {\n expression = `(${guard} ? ${masked} : ${unmasked}) | null`;\n } else {\n expression = `${guard} ? ${masked} : ${unmasked}`;\n }\n return ` ${propKey({ name: relation.name })}: ${expression};`;\n })\n .join(\"\\n\");\n parts.push(`type ${n}ViewRelationResult<K extends keyof ${n}Relations, D, A> = {\\n${relationCases}\\n}[K];`);\n parts.push(\n `type ${n}ViewIncludeResult<A, D> = A extends { readonly include: infer I extends object }\\n` +\n ` ? { [K in keyof I & keyof ${n}Relations as ${exactPart(\"I\")}]: ${n}ViewRelationResult<K, D, I[K]> } &\\n` +\n ` { [K in keyof I & keyof ${n}Relations as ${uncertainPart(\"I\")}]?: ${n}ViewRelationResult<K, D, I[K]> }\\n` +\n ` : \"include\" extends keyof A ? Partial<${n}ViewIncludeResult<{ include: NonNullable<A[\"include\"]> }, D>> : unknown;`,\n );\n parts.push(\n `export type ${n}ViewResult<F, A, D> = ViewRow<${n}ViewSelectScalars<F, A> & ${n}ViewReveal<A> & ${n}ViewIncludeResult<A, D>>;`,\n );\n } else {\n parts.push(\n `export type ${n}ViewResult<F, A, D> = ViewRow<${n}ViewSelectScalars<F, A> & ${n}ViewReveal<A>>;`,\n );\n }\n\n parts.push(\n `export type ${n}ViewDelegate<F, D extends ViewDefinitionInput = ViewDefinitionInput> = {\\n` +\n ` findMany<A extends ${n}ViewFindManyArgs = {}>(args?: A): Promise<${n}ViewResult<F, A, D>[]>;\\n` +\n ` findFirst<A extends ${n}ViewFindManyArgs = {}>(args?: A): Promise<${n}ViewResult<F, A, D> | null>;\\n` +\n ` findFirstOrThrow<A extends ${n}ViewFindManyArgs = {}>(args?: A): Promise<${n}ViewResult<F, A, D>>;\\n` +\n ` findUnique<A extends ${n}ViewFindUniqueArgs>(args: A): Promise<${n}ViewResult<F, A, D> | null>;\\n` +\n ` findUniqueOrThrow<A extends ${n}ViewFindUniqueArgs>(args: A): Promise<${n}ViewResult<F, A, D>>;\\n` +\n ` count<A extends ${n}CountArgs = {}>(args?: A): Promise<${n}CountOutput<A>>;\\n` +\n ` aggregate<A extends ${n}AggregateArgs>(args: A): Promise<${n}AggregateResult<A>>;\\n` +\n ` groupBy<const A extends ${n}GroupByArgs>(args: A): Promise<${n}GroupByResult<A>[]>;\\n` +\n `};`,\n );\n\n return parts.join(\"\\n\\n\");\n}\n\nfunction emitViewSection(params: { view: SchemaView }): string[] {\n const { view } = params;\n const parts: string[] = [banner({ title: \"Field-masking views ($defineView)\" })];\n parts.push(\n `/**\\n` +\n ` * A masked row: definition fields are properties, JSON.stringify drops\\n` +\n ` * revealed fields (toJSON), $unsafe() returns everything as a plain object.\\n` +\n ` */\\n` +\n `export type ViewRow<T> = T & {\\n` +\n ` toJSON(): Partial<T>;\\n` +\n ` $unsafe(): Record<string, unknown>;\\n` +\n `};`,\n );\n parts.push(\n objectAlias({\n name: \"ViewDefinitionInput\",\n lines: view.models.map(\n (model) => ` readonly ${propKey({ name: model.clientName })}?: ${model.name}ViewFields;`,\n ),\n }),\n );\n parts.push(\n `type ViewDelegateMap<D extends ViewDefinitionInput> = {\\n${view.models\n .map(\n (model) =>\n ` ${propKey({ name: model.clientName })}: ${model.name}ViewDelegate<NonNullable<D[${tsString({ value: model.clientName })}]>, D>;`,\n )\n .join(\"\\n\")}\\n};`,\n );\n parts.push(\n `/** A read-only scoped client over the definition's models — what $defineView returns. */\\n` +\n `export type ViewClient<D extends ViewDefinitionInput> = {\\n` +\n ` readonly [K in keyof D & keyof ViewDelegateMap<D>]: ViewDelegateMap<D>[K];\\n` +\n `};`,\n );\n for (const model of view.models) {\n parts.push(emitViewTypesForModel({ model, view }));\n }\n return parts;\n}\n\n// ─── Native row-level security ─────────────────────────────────────\n\n/** Does this schema declare native row-level security? */\nfunction hasNativeRls(params: { view: SchemaView }): boolean {\n return params.view.schema.rls !== undefined;\n}\n\n/**\n * The context slot types. STRICTER than the ordinary input types on purpose:\n * an identity value is compared by the database against a physical column, so\n * a DateTime slot takes a `Date` (not an ISO string, not the database-clock\n * sentinel) and a BigInt slot takes a `bigint` (not a number). Widening here\n * would move a silent no-match into production.\n */\nconst RLS_CONTEXT_TYPES: Readonly<Record<RlsContextScalar, string>> = {\n String: \"string\",\n Boolean: \"boolean\",\n Int: \"number\",\n BigInt: \"bigint\",\n Float: \"number\",\n Decimal: \"string\",\n DateTime: \"Date\",\n};\n\n/**\n * `RlsContext` — the concrete identity context this schema declares. Every\n * slot is REQUIRED, including nullable ones: an explicit null is a value (it\n * matches no ownership equality), while a missing key is an unbound query.\n * Slots keep their declaration order, which is the order the runtime sets them\n * in and the order the policy predicate reads them in.\n */\nfunction emitRlsSection(params: { view: SchemaView }): string[] {\n const rls = params.view.schema.rls;\n if (rls === undefined) return [];\n const lines = Object.entries(rls.context).map(\n ([key, slot]) =>\n ` readonly ${propKey({ name: key })}: ${RLS_CONTEXT_TYPES[slot.type]}${slot.nullable ? \" | null\" : \"\"};`,\n );\n const doc = `/** The identity context every query on this schema must be bound to — all slots required, an explicit null included. */`;\n return [\n banner({ title: \"Native row-level security\" }),\n lines.length === 0\n ? `${doc}\\nexport type RlsContext = Record<string, never>;`\n : `${doc}\\nexport type RlsContext = {\\n${lines.join(\"\\n\")}\\n};`,\n ];\n}\n\n// ─── Client ──────────────────────────────────────────────────────\n\n// ─── Locking ──────────────────────────────────────────────────────\n\n/**\n * `RowLockRequest` — the `lock` argument, narrowed to what THIS database can\n * express. A strength or wait policy the dialect cannot render is not in the\n * union, so asking for it is a compile error rather than a runtime refusal.\n */\nfunction emitLockSection(params: { view: SchemaView }): string[] {\n const capabilities = capabilitiesOf(params);\n const example =\n capabilities.rowLockWaitPolicies.includes(\"skipLocked\")\n ? [\n ` * @example Claim one queued job without waiting for another worker's row`,\n ` * await db.$transaction(async (tx) => {`,\n ` * const [job] = await tx.job.findMany({`,\n ` * where: { status: \"queued\" },`,\n ` * take: 1,`,\n ` * lock: { strength: \"update\", wait: \"skipLocked\" },`,\n ` * });`,\n ` * if (job !== undefined) await tx.job.update({ where: { id: job.id }, data: { status: \"running\" } });`,\n ` * });`,\n ]\n : [\n ` * @example Read a row you are about to write`,\n ` * await db.$transaction(async (tx) => {`,\n ` * const account = await tx.account.findUnique({ where: { id }, lock: \"update\" });`,\n ` * await tx.account.update({ where: { id }, data: { balance: account.balance - amount } });`,\n ` * });`,\n ];\n const body =\n capabilities.rowLockStrengths.length === 0\n ? [\n `/**`,\n ` * A row-locking read. This database has NO locking-read clause, so the`,\n ` * historical \\`\"update\"\\` request emits no clause at all — a documented`,\n ` * no-op that costs nothing here, because its write transactions already`,\n ` * exclude each other. Every other strength and wait policy is refused`,\n ` * rather than silently downgraded, so they are absent from this type.`,\n ` *`,\n ` * Still REQUIRES a transaction: outside one the call is refused`,\n ` * (\\`VIBE_VALIDATION\\`), so code written here stays portable.`,\n ` *`,\n ...example,\n ` */`,\n `export type RowLockRequest = \"update\";`,\n ]\n : [\n `/**`,\n ` * A row-locking read (\\`SELECT … FOR UPDATE SKIP LOCKED\\`).`,\n ` *`,\n ` * REQUIRES a transaction — call it on the client \\`$transaction\\` hands its`,\n ` * callback. Outside one the lock would be released at statement end, so`,\n ` * the call is refused with \\`VIBE_VALIDATION\\` instead.`,\n ` *`,\n ` * \\`\"update\"\\` is the shorthand for \\`{ strength: \"update\", wait: \"wait\" }\\`.`,\n ` * \\`wait\\` is ONE policy, never several flags: \\`\"wait\"\\` blocks until the`,\n ` * holder finishes (the default), \\`\"nowait\"\\` fails immediately with`,\n ` * \\`VIBE_LOCK_NOT_AVAILABLE\\`, and \\`\"skipLocked\"\\` leaves locked rows out of`,\n ` * the result. Refused with \\`include\\`/relation \\`select\\`, with \\`distinct\\`,`,\n ` * and on views.`,\n ` *`,\n ...example,\n ` */`,\n `export type RowLockRequest =`,\n ` | \"update\"`,\n ` | {`,\n ` readonly strength: ${literalUnion({ members: capabilities.rowLockStrengths })};`,\n ` readonly wait?: ${literalUnion({ members: capabilities.rowLockWaitPolicies })};`,\n ` };`,\n ];\n return [banner({ title: \"Row locks\" }), body.join(\"\\n\")];\n}\n\n/** The `lock` member, with the doc a caller reads at the call site. */\nfunction lockArgumentLines(): string {\n return [\n ` /** Row-locking read — see {@link RowLockRequest}. Only inside \\`$transaction\\`. */`,\n ` readonly lock?: RowLockRequest;`,\n ].join(\"\\n\");\n}\n\n/**\n * The advisory-lock methods, or nothing on a dialect without them. Absence IS\n * the refusal: a MySQL or sqlite client cannot call a lock this ORM would have\n * to fake (mysql's `GET_LOCK` is session-scoped and survives a rollback).\n */\nfunction advisoryLockLines(params: { view: SchemaView; selfLabel: string }): string {\n if (!capabilitiesOf(params).advisoryLocks) return \"\";\n return (\n ` /**\\n` +\n ` * Lock an application-defined resource for the rest of the transaction —\\n` +\n ` * including one that has no row yet. BLOCKS until the lock is held.\\n` +\n ` *\\n` +\n ` * Released by commit and by rollback; there is no unlock call, so nothing\\n` +\n ` * can leak onto a pooled connection. Only inside \\`$transaction\\` (outside\\n` +\n ` * one the lock would be gone before the next statement).\\n` +\n ` *\\n` +\n ` * @example Serialize an import of a supplier's price list\\n` +\n ` * await ${params.selfLabel}.$transaction(async (tx) => {\\n` +\n ` * await tx.$advisoryLock({ classId: 1, objectId: supplierId });\\n` +\n ` * await rebuildPrices(tx);\\n` +\n ` * });\\n` +\n ` */\\n` +\n ` readonly $advisoryLock: (options: AdvisoryLockOptions) => Promise<void>;\\n` +\n ` /** The same lock WITHOUT waiting: \\`true\\` when acquired, \\`false\\` when someone else holds it. The transaction stays usable either way. */\\n` +\n ` readonly $tryAdvisoryLock: (options: AdvisoryLockOptions) => Promise<boolean>;\\n`\n );\n}\n\n// ─── Client ────────────────────────────────────────────────────\n\n/**\n * Delegate properties + `$models` + `$on` — the block every client surface\n * opens with. `delegateSuffix` picks the full delegate or the read-only one;\n * both are pre-resolved declarations, so naming one costs nothing extra.\n */\nfunction delegateSurfaceLines(params: {\n view: SchemaView;\n delegateSuffix: \"Delegate\" | \"ReadOnlyDelegate\";\n}): string {\n const { view, delegateSuffix } = params;\n const typeOf = (model: { readonly name: string }): string => `${model.name}${delegateSuffix}`;\n const delegateProps = view.models.map(\n (model) => ` readonly ${propKey({ name: model.clientName })}: ${typeOf(model)};`,\n );\n const modelsProps = view.models.flatMap((model) => {\n const byClientName = ` readonly ${propKey({ name: model.clientName })}: ${typeOf(model)};`;\n return model.name === model.clientName\n ? [byClientName]\n : [byClientName, ` readonly ${propKey({ name: model.name })}: ${typeOf(model)};`];\n });\n return (\n `${delegateProps.join(\"\\n\")}\\n` +\n ` /** Delegates keyed by BOTH camelCase client name and model name — the same objects as the top-level properties (dynamic access). */\\n` +\n ` readonly $models: {\\n${modelsProps.join(\"\\n\")}\\n };\\n` +\n ` /** Subscribe to client events (\"query\" fires after every statement, with the same payload as onQuery — both fire). Returns an unsubscribe function. */\\n` +\n ` readonly $on: (event: \"query\", listener: (event: QueryEvent) => void) => () => void;\\n`\n );\n}\n\n/**\n * `$transaction`, self-typed to the handle its callback receives. That callback\n * type is the point of the split: a helper that needs a transaction takes\n * `VibeTransactionClientInstance` and no longer accepts a root client.\n */\nfunction transactionLines(params: { transactionType: string; reads: boolean }): string {\n const { transactionType, reads } = params;\n const doc = reads\n ? ` /** ONE transaction of READS — a consistent snapshot. The callback's handle is read-only too, and the array form takes read operations only. */`\n : ` /** ONE transaction. Callback form: everything on \\`tx\\` rides the same BEGIN/COMMIT; a throw rolls back. Array form (Prisma parity): UN-AWAITED delegate calls run sequentially in one transaction, results returned positionally. */`;\n return (\n `${doc}\\n` +\n ` readonly $transaction: {\\n` +\n ` <T>(fn: (tx: ${transactionType}) => Promise<T>, options?: TransactionOptions): Promise<T>;\\n` +\n ` <T extends readonly VibeQueryPromise<unknown, ${reads ? '\"read\"' : '\"read\" | \"write\"'}>[]>(operations: readonly [...T], options?: TransactionOptions): Promise<{ -readonly [K in keyof T]: Awaited<T[K]> }>;\\n` +\n ` };\\n`\n );\n}\n\n/** The four raw-SQL doors. Absent from every read-only surface. */\nconst RAW_SURFACE_LINES: string =\n ` readonly $querySql: <T>(params: { readonly query: SqlFragment; readonly decoder: ResultDecoder<T> }) => Promise<T[]>;\\n` +\n ` readonly $executeSql: (params: { readonly query: SqlFragment }) => Promise<number>;\\n` +\n ` readonly $queryRaw: <T = Record<string, unknown>>(strings: TemplateStringsArray, ...values: unknown[]) => Promise<T[]>;\\n` +\n ` readonly $executeRaw: (strings: TemplateStringsArray, ...values: unknown[]) => Promise<number>;\\n` +\n ` readonly $queryRawUnsafe: <T = Record<string, unknown>>(text: string, ...values: unknown[]) => Promise<T[]>;\\n` +\n ` readonly $executeRawUnsafe: (text: string, ...values: unknown[]) => Promise<number>;\\n`;\n\n/** Connection lifecycle — never on a transaction handle: the transaction owns the connection. */\nconst CONNECTION_SURFACE_LINES: string =\n ` readonly $connect: () => Promise<void>;\\n` + ` readonly $disconnect: () => Promise<void>;\\n`;\n\nconst DEFINE_VIEW_LINE: string =\n ` /** Field-masking views (v1 defineView parity): a read-only masked projection of models. */\\n` +\n ` readonly $defineView: <D extends ViewDefinitionInput>(options: { readonly name: string; readonly definition: D }) => ViewClient<D>;\\n`;\n\n/** The `$readOnly` member, on every surface that can query. */\nconst READ_ONLY_LINE: string =\n ` /** A read-only handle over this one: reads pass through, and every write, raw-SQL and control method is refused with \\`VIBE_READ_ONLY\\`. Closed under composition — transactions, views, scoped and policy handles built from it stay read-only. */\\n` +\n ` readonly $readOnly: () => ReadOnlyClientInstance;\\n`;\n\n/**\n * The full query surface. `inTransaction` is what splits the root from the\n * handle `$transaction` gives its callback: a transaction handle carries the\n * advisory locks (which REQUIRE a transaction) and not the connection\n * lifecycle (which the open transaction owns).\n *\n * The split is a compile-time layer over runtime guards that stay the\n * authority. A type cannot prove LIFETIME: a handle captured and used after\n * commit is refused at runtime, never by this declaration.\n */\nfunction instanceSurfaceLines(params: {\n view: SchemaView;\n transactionType: string;\n inTransaction: boolean;\n selfLabel: string;\n}): string {\n const { view, transactionType, inTransaction, selfLabel } = params;\n return (\n (inTransaction ? ` readonly [vibeTransaction]: true;\\n` : \"\") +\n delegateSurfaceLines({ view, delegateSuffix: \"Delegate\" }) +\n transactionLines({ transactionType, reads: false }) +\n RAW_SURFACE_LINES +\n (inTransaction ? advisoryLockLines({ view, selfLabel }) : \"\") +\n (inTransaction ? \"\" : CONNECTION_SURFACE_LINES) +\n DEFINE_VIEW_LINE\n );\n}\n\n/**\n * Operation-telemetry declarations, emitted INTO the client rather than imported\n * from `@vibeorm/runtime`: the generated surface stays self-contained, so a\n * consumer never depends on which runtime symbols happen to be re-exported.\n */\nfunction telemetryDeclarations(): string {\n return [\n `/** One SQL execution inside an operation. Parameter values are redacted; \\`sql\\` and \\`parameters\\` appear only with the matching capture option. */`,\n `export type VibeTelemetryStatementEvent = {`,\n ` readonly operationId: string;`,\n ` readonly index: number;`,\n ` readonly kind: \"rows\" | \"affected\" | \"raw\" | \"extension\";`,\n ` readonly model: string | null;`,\n ` readonly method: string;`,\n ` readonly dialect: string;`,\n ` readonly provider: string;`,\n ` /** Stable normalized grouping key — bounded and literal-free, safe as a metric label. */`,\n ` readonly fingerprint: string;`,\n ` readonly outcome: \"success\" | \"failure\";`,\n ` /** Adapter-call elapsed time: networking and possibly pool wait included — not pure server execution time. */`,\n ` readonly durationMs: number;`,\n ` readonly parameterCount: number;`,\n ` readonly inTransaction: boolean;`,\n ` readonly rowCount?: number;`,\n ` readonly errorCode?: string;`,\n ` readonly slow?: boolean;`,\n ` readonly sql?: string;`,\n ` readonly parameters?: readonly unknown[];`,\n `};`,\n ``,\n `/** One public ORM call, start to terminal outcome. Emitted exactly once. Unknown values are ABSENT, never zero. */`,\n `export type VibeTelemetryOperationEvent = {`,\n ` readonly operationId: string;`,\n ` readonly parentOperationId?: string;`,\n ` readonly context?: unknown;`,\n ` readonly kind: \"model\" | \"raw\" | \"transaction\" | \"extension\";`,\n ` readonly model: string | null;`,\n ` readonly method: string;`,\n ` readonly dialect: string;`,\n ` readonly provider: string;`,\n ` readonly outcome: \"success\" | \"failure\";`,\n ` readonly stage: \"refused\" | \"validation\" | \"statement\" | \"decode\" | \"transaction\" | \"completed\" | \"unknown\";`,\n ` readonly dispatched: boolean;`,\n ` readonly startedAt?: number;`,\n ` readonly durationMs?: number;`,\n ` /** Creation to dispatch — labelled separately, never folded into durationMs. */`,\n ` readonly queueWaitMs?: number;`,\n ` readonly statementCount: number;`,\n ` readonly statementDurationMs?: number;`,\n ` readonly rowCount?: number;`,\n ` readonly errorCode?: string;`,\n ` readonly detail?: { readonly renderMs?: number; readonly adapterMs?: number; readonly processingMs?: number };`,\n ` readonly statements: readonly VibeTelemetryStatementEvent[];`,\n ` readonly droppedStatements?: number;`,\n ` readonly slow?: boolean;`,\n ` readonly sampled: true;`,\n `};`,\n ``,\n `/** Where events go. A throw from any callback is contained: it can never change a database outcome. */`,\n `export type VibeTelemetryExporter = {`,\n ` readonly onOperation?: (event: VibeTelemetryOperationEvent) => void;`,\n ` readonly onStatement?: (event: VibeTelemetryStatementEvent) => void;`,\n ` readonly onDrop?: (event: { readonly reason: \"buffer_full\" | \"statement_limit\"; readonly count: number }) => void;`,\n ` readonly flush?: () => void | Promise<void>;`,\n ` /** NEVER called by the client — \\`$disconnect()\\` flushes only, because the provider is yours. */`,\n ` readonly shutdown?: () => void | Promise<void>;`,\n `};`,\n ``,\n `/** Complete counters (spans may be sampled, these are not) and explicit lifecycle. */`,\n `export type VibeTelemetryHandle = {`,\n ` readonly metrics: () => {`,\n ` readonly countsRepresent: \"all\";`,\n ` readonly sampleRate: number;`,\n ` readonly sampledOperations: number;`,\n ` readonly operations: { readonly total: number; readonly failed: number; readonly refused: number };`,\n ` readonly statements: { readonly total: number; readonly failed: number };`,\n ` readonly rows: { readonly known: number; readonly total: number };`,\n ` readonly operationLatencyMs: { readonly bounds: readonly number[]; readonly counts: readonly number[]; readonly sum: number; readonly count: number };`,\n ` readonly statementLatencyMs: { readonly bounds: readonly number[]; readonly counts: readonly number[]; readonly sum: number; readonly count: number };`,\n ` readonly dropped: { readonly operations: number; readonly statements: number };`,\n ` };`,\n ` readonly flush: () => Promise<void>;`,\n ` readonly shutdown: () => Promise<void>;`,\n `};`,\n ``,\n `/** Opt-in operation telemetry. Defaults are conservative: no SQL text, no parameter values, no sampling. */`,\n `export type VibeTelemetryOptions = {`,\n ` readonly exporter: VibeTelemetryExporter;`,\n ` /** Attach rendered SQL text (default false — raw text can embed secrets). */`,\n ` readonly captureSql?: boolean;`,\n ` /** Attach parameter VALUES (default false — only the count is reported). */`,\n ` readonly captureParameterValues?: boolean;`,\n ` /** Split render / adapter / processing time on the operation event (default false). */`,\n ` readonly detailedTimings?: boolean;`,\n ` /** Span sampling probability, 0..1 (default 1). Counters still count every execution. */`,\n ` readonly sampleRate?: number;`,\n ` readonly sampler?: (input: { readonly kind: \"model\" | \"raw\" | \"transaction\" | \"extension\"; readonly model: string | null; readonly method: string; readonly context?: unknown }) => boolean;`,\n ` /** Read your current parent context SYNCHRONOUSLY at call time, so an application span survives the async boundary. */`,\n ` readonly context?: () => unknown;`,\n ` readonly delivery?: \"immediate\" | \"buffered\";`,\n ` readonly maxBufferedOperations?: number;`,\n ` readonly maxStatementsPerOperation?: number;`,\n ` readonly slowStatementMs?: number;`,\n ` readonly slowOperationMs?: number;`,\n ` readonly onExporterError?: (params: { readonly error: unknown; readonly phase: \"operation\" | \"statement\" | \"drop\" | \"flush\" | \"shutdown\" | \"sampler\" | \"context\" }) => void;`,\n ` /** Called once while the client is built, with the handle that owns metrics and lifecycle. */`,\n ` readonly onReady?: (handle: VibeTelemetryHandle) => void;`,\n `};`,\n ].join(\"\\n\");\n}\n\nfunction emitClient(params: { view: SchemaView; baked: BakedExtensions; hasComputed: boolean }): string {\n const { view, baked, hasComputed } = params;\n const nativeRls = hasNativeRls({ view });\n const parts: string[] = [banner({ title: \"Client\" })];\n parts.push(telemetryDeclarations());\n parts.push(\n objectAlias({\n name: \"VibeClientOptions\",\n lines: [\n ` readonly adapter: DatabaseAdapter;`,\n ` /** Strict argument validation defaults to true; false restores legacy omission of undefined values. */`,\n ` readonly strictArguments?: boolean;`,\n ` readonly onQuery?: (event: QueryEvent) => void;`,\n ` readonly relationStrategy?: RelationStrategy;`,\n ` /** Opt-in concurrent relation loading: how many of ONE query's relation statements (siblings, \\`_count\\` entries, key chunks) may be in flight at once. Default 1; ignored inside \\`$transaction\\`. */`,\n ` readonly relationLoading?: { readonly concurrency?: number };`,\n ` /** Append the primary key to ORDER BY when a find has no explicit orderBy (default false) — deterministic row order. */`,\n ` readonly defaultOrderByPk?: boolean;`,\n ` /** Append the primary key as a tie-breaker to \\`distinct\\` ordering (default true) — pins WHICH row represents each distinct key. */`,\n ` readonly distinctOrderByPk?: boolean;`,\n ` /** Opt-in write-boundary validators, per model × field: \\`{ User: { email: zodSchema } }\\`. Any Standard Schema validator (zod, valibot, arktype) works; they run on every write path before encoding. */`,\n ` readonly validate?: WriteValidators;`,\n ` /** Opt-in operation telemetry: one event per public ORM call, with the statements it ran. Parameter values are redacted by default and the exporter can never change a database outcome. */`,\n ` readonly telemetry?: VibeTelemetryOptions;`,\n ` /** Statement diagnostics: every statement over \\`slowerThanMs\\` is reported with its duration and, with \\`explain\\`, an automatic EXPLAIN summary on PostgreSQL/PGlite (\\`\"analyze\"\\` re-executes read statements). \\`VIBEORM_DIAGNOSTICS=analyze:5\\` switches it on for a run; local runs only. */`,\n ` readonly diagnostics?: StatementDiagnosticsOptions;`,\n ...(baked.empty\n ? []\n : [\n ` /** The live extension instances — verified against the baked manifest. */`,\n ` readonly extensions?: readonly VibeExtension[];`,\n ]),\n ...(hasComputed\n ? [\n ` /** The live computed-field config — verified against the baked manifest (VIBE_STALE_CLIENT). */`,\n ` readonly computed: ComputedConfig;`,\n ]\n : []),\n ...(nativeRls\n ? [\n ` /** Native row-level security: the non-bypassing database role the runtime binds each transaction to (required on PGlite; server connections log in as it). */`,\n ` readonly nativeRls?: { readonly runtimeRole?: string };`,\n ]\n : []),\n ],\n }),\n );\n const clientExtensionLines = baked.clientDts.length === 0 ? \"\" : `${baked.clientDts.join(\"\\n\")}\\n`;\n\n if (nativeRls) {\n // Native RLS: the ROOT cannot reach a row. Every query surface — delegates,\n // $models, raw SQL, transactions, views and extension mounts — lives on the\n // handle returned by $withContext, so \"query without an identity\" is a\n // compile error rather than a runtime check. The bound handle has no\n // $withContext of its own: identity is bound once, from the root.\n parts.push(\n `export type BoundVibeClientInstance = ClientContext<\"restricted\"> & {\\n` +\n instanceSurfaceLines({\n view,\n transactionType: \"BoundVibeTransactionClientInstance\",\n inTransaction: false,\n selfLabel: \"db\",\n }) +\n READ_ONLY_LINE +\n clientExtensionLines +\n `};`,\n );\n parts.push(\n `/** The bound handle inside \\`$transaction\\`: same identity, plus the locks that require a transaction, minus the connection lifecycle the transaction owns. */\\n` +\n `export type BoundVibeTransactionClientInstance = ClientContext<\"restricted\"> & {\\n` +\n instanceSurfaceLines({\n view,\n transactionType: \"BoundVibeTransactionClientInstance\",\n inTransaction: true,\n selfLabel: \"tx\",\n }) +\n READ_ONLY_LINE +\n clientExtensionLines +\n ` // Deliberately ABSENT: $connect / $disconnect (the open transaction owns the connection) and $withContext (identity is bound once, from the root).\\n` +\n `};`,\n );\n parts.push(\n `export type VibeClientInstance = ClientContext<\"restricted\"> & {\\n` +\n ` /** Bind the request's identity context — ALL of it, every declared slot — and get the client that can actually query. */\\n` +\n ` readonly $withContext: (context: RlsContext) => BoundVibeClientInstance;\\n` +\n ` /** Subscribe to client events (\"query\" fires after every statement, with the same payload as onQuery — both fire). Returns an unsubscribe function. */\\n` +\n ` readonly $on: (event: \"query\", listener: (event: QueryEvent) => void) => () => void;\\n` +\n ` readonly $connect: () => Promise<void>;\\n` +\n ` readonly $disconnect: () => Promise<void>;\\n` +\n ` // Deliberately ABSENT: model delegates, $models, $transaction, $queryRaw / $executeRaw / $queryRawUnsafe / $executeRawUnsafe, $advisoryLock / $tryAdvisoryLock, $defineView, $readOnly and every extension mount — an unbound client has no identity, so it cannot read or write a row. Bind one with $withContext.\\n` +\n `};`,\n );\n } else {\n parts.push(\n `export type VibeClientInstance = ClientContext<\"root\"> & {\\n` +\n instanceSurfaceLines({\n view,\n transactionType: \"VibeTransactionClientInstance\",\n inTransaction: false,\n selfLabel: \"db\",\n }) +\n policyClientLines({ view, selfType: \"VibeClientInstance\" }) +\n scopedClientLines({ view, scopedType: \"ScopedClientInstance\" }) +\n READ_ONLY_LINE +\n clientExtensionLines +\n `};`,\n );\n parts.push(\n `/** The handle \\`$transaction\\` gives its callback. A helper that REQUIRES a transaction takes this type, and an ordinary client no longer satisfies it. */\\n` +\n `export type VibeTransactionClientInstance = ClientContext<\"transaction\"> & {\\n` +\n instanceSurfaceLines({\n view,\n transactionType: \"VibeTransactionClientInstance\",\n inTransaction: true,\n selfLabel: \"tx\",\n }) +\n policyClientLines({ view, selfType: \"VibeTransactionClientInstance\" }) +\n scopedClientLines({ view, scopedType: \"ScopedTransactionClientInstance\" }) +\n READ_ONLY_LINE +\n clientExtensionLines +\n ` // Deliberately ABSENT: $connect / $disconnect — the open transaction owns the connection, and both are refused at runtime here too.\\n` +\n `};`,\n );\n }\n parts.push(`/** Build a typed client over a database adapter. */\\nexport declare function VibeClient(options: VibeClientOptions): VibeClientInstance;`);\n parts.push(\n `/** The normalized Schema IR this client was generated from (plain data). */\\nexport declare const schema: SchemaIR;`,\n );\n return parts.join(\"\\n\\n\");\n}\n\n// ─── Tenant scoping ($scoped) ─────────────────────────────\n\n/** Fields eligible as a tenant column: non-list String / Int / BigInt. */\nfunction scopedColumnCandidates(params: { model: ModelView }): readonly string[] {\n return params.model.fields\n .filter((field) => !field.isList && (field.scalar === \"String\" || field.scalar === \"Int\" || field.scalar === \"BigInt\"))\n .map((field) => field.name);\n}\n\n/**\n * `ScopedNestedMode` / `ScopedModelsConfig` / `ScopedClientInstance` — the\n * generated `$scoped` surface. Omitted entirely when the schema declares\n * @@policy: the two scoping layers do not combine, and the runtime refuses\n * the call — the type's absence makes that a compile-time fact.\n *\n * The models map is TOTAL by construction: every model is a required key, so\n * adding a model to the schema breaks `$scoped` callers loudly until they\n * classify it (deny-by-default applied to configuration).\n */\nfunction emitScopedSection(params: { view: SchemaView }): string[] {\n const { view } = params;\n // Native RLS does not combine with either rewriting layer (contract rule 2):\n // the runtime refuses the call, and the type's absence says so at compile time.\n if (hasNativeRls({ view })) return [];\n if (view.models.some((model) => model.policy !== undefined)) return [];\n\n const entries = view.models.map((model) => {\n const arms: string[] = [`\"none\"`];\n const columns = scopedColumnCandidates({ model });\n if (columns.length > 0) {\n const union = columns.map((name) => `\"${name}\"`).join(\" | \");\n arms.push(`{ readonly column: ${union}; readonly nested?: ScopedNestedMode }`);\n }\n const throughs = model.relations.filter((relation) => !relation.isList).map((relation) => relation.name);\n if (throughs.length > 0) {\n const union = throughs.map((name) => `\"${name}\"`).join(\" | \");\n arms.push(`{ readonly through: ${union}; readonly nested?: ScopedNestedMode }`);\n }\n return ` readonly ${propKey({ name: model.name })}: ${arms.join(\" | \")};`;\n });\n\n // EPIC 2: `updateManyAndReturn` IS routed by a scoped handle — `rewriteScopedCall`\n // merges the tenant predicate into its filter and masks the returned rows'\n // projection, and `scopedDelegate` lists it — so a scoped delegate keeps the\n // base delegate's EXACT type. `scoped.type-test.ts` pins that equality.\n const scopedDelegateType = (model: { readonly name: string }): string => `${model.name}Delegate`;\n const delegateProps = view.models.map(\n (model) => ` readonly ${propKey({ name: model.clientName })}: ${scopedDelegateType(model)};`,\n );\n const modelsProps = view.models.flatMap((model) => {\n const byClientName = ` readonly ${propKey({ name: model.clientName })}: ${scopedDelegateType(model)};`;\n return model.name === model.clientName\n ? [byClientName]\n : [byClientName, ` readonly ${propKey({ name: model.name })}: ${scopedDelegateType(model)};`];\n });\n\n const scopedSurface = (params2: { transactionType: string; inTransaction: boolean }): string =>\n (params2.inTransaction ? ` readonly [vibeTransaction]: true;\\n` : \"\") +\n `${delegateProps.join(\"\\n\")}\\n` +\n ` /** Delegates keyed by BOTH camelCase client name and model name — the same objects as the top-level properties (dynamic access). */\\n` +\n ` readonly $models: {\\n${modelsProps.join(\"\\n\")}\\n };\\n` +\n ` /** Subscribe to client events — shared with the base client. */\\n` +\n ` readonly $on: (event: \"query\", listener: (event: QueryEvent) => void) => () => void;\\n` +\n ` /** ONE transaction; the callback receives a handle that INHERITS the scope. The array form takes un-awaited scoped delegate calls. */\\n` +\n ` readonly $transaction: {\\n` +\n ` <T>(fn: (tx: ${params2.transactionType}) => Promise<T>, options?: TransactionOptions): Promise<T>;\\n` +\n ` <T extends readonly VibeQueryPromise<unknown, \"read\" | \"write\">[]>(operations: readonly [...T], options?: TransactionOptions): Promise<{ -readonly [K in keyof T]: Awaited<T[K]> }>;\\n` +\n ` };\\n` +\n (params2.inTransaction ? advisoryLockLines({ view, selfLabel: \"tx\" }) : CONNECTION_SURFACE_LINES) +\n ` /** Field-masking views compose over the scoped handle (columns × rows). */\\n` +\n ` readonly $defineView: <D extends ViewDefinitionInput>(options: { readonly name: string; readonly definition: D }) => ViewClient<D>;\\n` +\n READ_ONLY_LINE;\n\n return [\n banner({ title: \"Tenant scoping ($scoped)\" }),\n `/** What a scoped handle does when this model appears INSIDE another model's nested write: \"verify\" (default) rewrites reference verbs into tenant-verified lookups; \"refuse\" rejects them. */\\nexport type ScopedNestedMode = \"verify\" | \"refuse\";`,\n `/** Per-model tenancy classification — TOTAL: every model must be named (\"none\" = global, passes through untouched). */\\nexport type ScopedModelsConfig = {\\n${entries.join(\"\\n\")}\\n};`,\n `export type ScopedClientInstance = {\\n` +\n scopedSurface({ transactionType: \"ScopedTransactionClientInstance\", inTransaction: false }) +\n ` // Deliberately ABSENT: $queryRaw / $executeRaw / $queryRawUnsafe / $executeRawUnsafe (raw SQL cannot be tenant-verified — use the base client) and $scoped (scope once, from the base client).\\n` +\n `};`,\n `/** The scoped handle inside \\`$transaction\\`: same scope, plus the locks that require a transaction. */\\n` +\n `export type ScopedTransactionClientInstance = {\\n` +\n scopedSurface({ transactionType: \"ScopedTransactionClientInstance\", inTransaction: true }) +\n ` // Deliberately ABSENT: the raw-SQL doors, $scoped, and $connect / $disconnect (the open transaction owns the connection).\\n` +\n `};`,\n ];\n}\n\n/** The `$scoped` client property — omitted when the schema declares @@policy. */\nfunction scopedClientLines(params: { view: SchemaView; scopedType: string }): string {\n if (hasNativeRls(params)) return \"\";\n if (params.view.models.some((model) => model.policy !== undefined)) return \"\";\n return (\n ` /** Tenant scoping: a total per-model tenancy map + a scope value → a NEW handle whose every call is confined to that tenant. scope: null builds the handle but refuses calls on scoped models. */\\n` +\n ` readonly $scoped: (config: { readonly scope: string | number | bigint | null; readonly models: ScopedModelsConfig }) => ${params.scopedType};\\n`\n );\n}\n\n/** `$withPolicy`/`$bypassPolicy` — emitted only when the schema declares @@policy. */\nfunction policyClientLines(params: { view: SchemaView; selfType: string }): string {\n const policied = params.view.models.filter((model) => model.policy !== undefined);\n if (policied.length === 0) return \"\";\n // Policy fields are non-list scalars (schema validation); the context value\n // types after the wire scalar — anything else degrades to string.\n const CONTEXT_SCALAR_TYPES: Record<string, string> = { String: \"string\", Int: \"number\", BigInt: \"bigint\" };\n const contextKeys = new Map<string, string>();\n for (const model of policied) {\n const policy = model.policy as NonNullable<typeof model.policy>;\n const field = model.fields.find((entry) => entry.name === policy.field);\n contextKeys.set(\n policy.context,\n field?.scalar == null ? \"string\" : (CONTEXT_SCALAR_TYPES[field.scalar] ?? \"string\"),\n );\n }\n const contextType = `{ ${[...contextKeys.entries()].map(([key, type]) => `readonly ${propKey({ name: key })}: ${type};`).join(\" \")} }`;\n return (\n ` /** Row scoping (@@policy): bind a per-request context; policied models fail closed without one. */\\n` +\n ` readonly $withPolicy: (context: ${contextType}) => ${params.selfType};\\n` +\n ` /** Deliberate, greppable full-access escape from policy scoping. It escapes the ROW policy, never a read-only restriction. */\\n` +\n ` readonly $bypassPolicy: () => ${params.selfType};\\n`\n );\n}\n\n// ─── Read-only clients ($readOnly) ───────────────────────────\n\n/**\n * `ReadOnlyClientInstance` — the surface behind `$readOnly()`. Declared from\n * the same allowlist the runtime enforces: read delegates, `$on`,\n * `$transaction`, `$defineView`, and the scoping handles, all of which return\n * this type again. Every write method, every raw-SQL door, the connection\n * lifecycle, the advisory locks and any unclassified extension surface are\n * ABSENT here and refused at runtime with `VIBE_READ_ONLY`.\n */\nfunction emitReadOnlySection(params: { view: SchemaView; baked: BakedExtensions }): string[] {\n const { view, baked } = params;\n const extensionLines =\n baked.readOnlyClientDts.length === 0 ? \"\" : `${baked.readOnlyClientDts.join(\"\\n\")}\\n`;\n return [\n banner({ title: \"Read-only clients ($readOnly)\" }),\n `/**\\n` +\n ` * A read-only handle. Application-level, not a database privilege: it refuses\\n` +\n ` * the calls VibeORM would issue, and cannot stop another connection or a role\\n` +\n ` * with write rights — use a read-only database role or transaction when the\\n` +\n ` * database itself must enforce it.\\n` +\n ` *\\n` +\n ` * @example Hand a query resolver something that cannot write\\n` +\n ` * const reader = db.$readOnly();\\n` +\n ` * await reader.user.findMany(); // fine\\n` +\n ` * await reader.user.upsertMany({ … }); // VIBE_READ_ONLY, and a compile error\\n` +\n ` */\\n` +\n `export type ReadOnlyClientInstance = ClientContext<\"readOnly\"> & {\\n` +\n delegateSurfaceLines({ view, delegateSuffix: \"ReadOnlyDelegate\" }) +\n transactionLines({ transactionType: \"ReadOnlyClientInstance\", reads: true }) +\n DEFINE_VIEW_LINE +\n policyClientLines({ view, selfType: \"ReadOnlyClientInstance\" }) +\n scopedClientLines({ view, scopedType: \"ReadOnlyClientInstance\" }) +\n ` /** Idempotent — restricting an already-restricted handle returns the same handle. */\\n` +\n ` readonly $readOnly: () => ReadOnlyClientInstance;\\n` +\n extensionLines +\n ` // Deliberately ABSENT: every write method, $queryRaw / $executeRaw / $queryRawUnsafe / $executeRawUnsafe, $connect / $disconnect, $advisoryLock / $tryAdvisoryLock, $withContext, and every extension surface its author did not classify as a read.\\n` +\n `};`,\n ];\n}\n\n// ─── Entry ────────────────────────────────────────────────────────\n\n/** Emit the full index.d.ts for a resolved schema view. */\nexport function emitDts(params: {\n view: SchemaView;\n baked?: BakedExtensions;\n computed?: readonly ComputedManifestEntry[];\n}): string {\n const { view } = params;\n const baked = params.baked ?? EMPTY_BAKED_EXTENSIONS;\n const computed = params.computed ?? [];\n const hasComputed = computed.length > 0;\n const computedByModel = new Map<string, ComputedManifestEntry[]>();\n for (const entry of computed) {\n const list = computedByModel.get(entry.model) ?? [];\n list.push(entry);\n computedByModel.set(entry.model, list);\n }\n const parts: string[] = [];\n parts.push(GENERATED_HEADER);\n const schemaTypeImports = [\n \"SchemaIR\",\n ...(baked.empty ? [] : [\"VibeExtension\"]),\n ...(hasComputed ? [\"ComputedConfig\"] : []),\n ].sort();\n const runtimeTypeImports = [\n \"ClientContext\",\n \"QueryOperation\",\n \"SqlFragment\",\n \"ResultDecoder\",\n \"SqlColumn\",\n \"DatabaseAdapter\",\n \"DbNow\",\n \"QueryEvent\",\n \"Skip\",\n \"StatementDiagnosticsOptions\",\n \"TransactionOptions\",\n \"WriteValidators\",\n // Imported rather than re-declared: ONE definition of the key forms, so the\n // generated surface and the runtime's validation can never drift apart.\n ...(capabilitiesOf({ view }).advisoryLocks ? [\"AdvisoryLockOptions\"] : []),\n ].sort();\n const importLines = [\n `import type { ${runtimeTypeImports.join(\", \")} } from \"@vibeorm/runtime\";`,\n `import type { ${schemaTypeImports.join(\", \")} } from \"@vibeorm/schema\";`,\n ...baked.dtsImports,\n // Enum constants, unions and parsers are declared once in enums.d.ts;\n // imported here (the model types reference the unions) and re-exported.\n `import { ${enumEntryExports({ view }).join(\", \")} } from \"./enums.js\";`,\n ];\n parts.push(\n `${importLines.join(\"\\n\")}\\n\\n` +\n `export { VibeError } from \"@vibeorm/schema\";\\nexport type { VibeErrorCode } from \"@vibeorm/schema\";\\n` +\n // Re-exported so the sentinel comes from the SAME module as the argument\n // types that accept it — a consumer need not depend on @vibeorm/runtime.\n `export { SKIP } from \"@vibeorm/runtime\";\\nexport type { Skip } from \"@vibeorm/runtime\";\\n` +\n `export { ${enumEntryExports({ view }).join(\", \")} };`,\n );\n parts.push(PREAMBLE);\n parts.push(`export { sql, decode, sqlProjection } from \"@vibeorm/runtime\";`);\n parts.push(`export type { SqlFragment, ResultDecoder, ExtendedDateTime, SqlColumn } from \"@vibeorm/runtime\";`);\n parts.push(`/** Mapped SQL references. No database handle or execution privileges are captured. */\\nexport declare const sqlModels: {\\n${view.models.map((model) => ` readonly ${propKey({ name: model.clientName })}: (options?: { readonly alias?: string }) => { readonly table: SqlFragment; readonly fields: { ${model.fields.map((field) => `readonly ${propKey({ name: field.name })}: SqlColumn<${field.scalar === \"Json\" ? \"unknown\" : payloadFieldType({ field })}>`).join(\"; \")} } };`).join(\"\\n\")}\\n};`);\n parts.push(...emitLockSection({ view }));\n parts.push(...filterSection());\n for (const declared of view.enums) parts.push(emitEnum({ declared }));\n\n const registry: NestedRegistry = new Map();\n const modelParts: string[] = [];\n for (const model of view.models) {\n const extensionLines = baked.delegateDts.get(model.name);\n const readOnlyExtensionLines = baked.readOnlyDelegateDts.get(model.name);\n const modelComputed = computedByModel.get(model.name);\n modelParts.push(\n emitModel({\n model,\n view,\n registry,\n ...(extensionLines === undefined ? {} : { extensionLines }),\n ...(readOnlyExtensionLines === undefined ? {} : { readOnlyExtensionLines }),\n ...(modelComputed === undefined ? {} : { computed: modelComputed }),\n }),\n );\n }\n parts.push(...modelParts);\n\n if (registry.size > 0) {\n parts.push(banner({ title: \"Nested write inputs\" }));\n for (const name of [...registry.keys()].sort()) {\n parts.push(registry.get(name) as string);\n }\n }\n\n if (baked.moduleDts.length > 0) {\n parts.push(banner({ title: \"Extensions\" }));\n parts.push(...baked.moduleDts);\n }\n\n parts.push(...emitViewSection({ view }));\n\n parts.push(...emitScopedSection({ view }));\n\n parts.push(...emitReadOnlySection({ view, baked }));\n\n parts.push(...emitRlsSection({ view }));\n\n parts.push(emitClient({ view, baked, hasComputed }));\n return `${parts.join(\"\\n\\n\")}\\n`;\n}\n",
|
|
8
|
+
"/**\n * Emits the generated client's index.d.ts as text (decision D3): the entire\n * typed surface, written directly — no tsc run, no inference for the consumer's\n * tsserver to pay for.\n *\n * Type-budget rules this file is built around (plan §6, constitution rule 2):\n * - concrete per-model base types; narrowing via mapped lookups over them;\n * - no conditional type deeper than a single level per key — recursion exists\n * only where the API is recursive (nested select/include), and each hop is\n * one shallow conditional + one mapped lookup;\n * - no distributive conditionals over model unions — every model's types are\n * spelled out flat;\n * - no Zod, no `as const` inference trees, no mega-unions.\n */\n\nimport { DIALECT_CAPABILITIES, VibeError, providerToDialect } from \"@vibeorm/schema\";\nimport type { ComputedManifestEntry, DialectCapabilities, RlsContextScalar } from \"@vibeorm/schema\";\nimport { enumEntryExports } from \"./emit-js.ts\";\nimport { EMPTY_BAKED_EXTENSIONS } from \"./extension-bake.ts\";\nimport type { BakedExtensions } from \"./extension-bake.ts\";\nimport type { EnumView, FieldView, ModelView, RelationView, SchemaView } from \"./schema-view.ts\";\nimport {\n MINMAX_SCALARS,\n NUMERIC_SCALARS,\n filterName,\n inputBaseType,\n payloadBaseType,\n updateOpsName,\n} from \"./type-names.ts\";\nimport { maybeParens, pascal, propKey, tsString } from \"./util.ts\";\n\n// ─── Small helpers ────────────────────────────────────────────────\n\nfunction banner(params: { title: string }): string {\n return `// ─── ${params.title} ───`;\n}\n\n/**\n * What THIS schema's database can do. The generated client is written for one\n * provider, so a capability it lacks is left out of the emitted types entirely:\n * asking for it becomes a compile error, which is earlier than the runtime's\n * own refusal and the earliest moment anything can know (constitution rule 4,\n * \"generate > build > execute\").\n */\nfunction capabilitiesOf(params: { view: SchemaView }): DialectCapabilities {\n return DIALECT_CAPABILITIES[providerToDialect({ provider: params.view.schema.datasource.provider })];\n}\n\n/** `\"a\" | \"b\"` from a list of literal members. */\nfunction literalUnion(params: { members: readonly string[] }): string {\n return params.members.map((member) => tsString({ value: member })).join(\" | \");\n}\n\n/** An `export type Name = { …lines }` alias; empty bodies become Record<string, never>. */\nfunction objectAlias(params: { name: string; lines: readonly string[] }): string {\n const { name, lines } = params;\n if (lines.length === 0) return `export type ${name} = Record<string, never>;`;\n return `export type ${name} = {\\n${lines.join(\"\\n\")}\\n};`;\n}\n\n/** ` readonly key?: T;` / ` \"quoted key\"?: T;` — an optional member and its type. */\nconst OPTIONAL_MEMBER = /^(\\s*(?:readonly\\s+)?(?:[A-Za-z_$][\\w$]*|\"(?:[^\"\\\\]|\\\\.)*\")\\?:\\s*)(.+);$/;\n\n/** Append `| Skip` to every optional member in one emitted block. */\nfunction skippableMembers(params: { block: string }): string {\n return params.block\n .split(\"\\n\")\n .map((line) => {\n const match = OPTIONAL_MEMBER.exec(line);\n const head = match?.[1];\n const type = match?.[2];\n if (head === undefined || type === undefined) return line;\n // A function type needs parentheses, or `| Skip` would join its RETURN.\n return `${head}${type.includes(\"=>\") ? `(${type})` : type} | Skip;`;\n })\n .join(\"\\n\");\n}\n\n/**\n * `objectAlias` for ARGUMENT-SYNTAX types: every optional member also accepts\n * the `SKIP` sentinel.\n *\n * The runtime refuses an explicit `undefined` in argument syntax and strips\n * `SKIP` instead (`runtime/src/strict-args.ts`), so a caller assembling an\n * object conditionally needs a value that means \"omit this property\". The\n * widening is written into the emitted text rather than expressed as a\n * `{ [K in keyof T]: T[K] | Skip }` wrapper: a mapped type would move the cost\n * onto every consumer's tsserver, which constitution rule 2 forbids.\n *\n * Only OPTIONAL members widen. A required member (`data`, `update`'s `where`)\n * stays required — `SKIP` there would type-check an argument the runtime then\n * refuses for a missing property.\n *\n * NOT used for view args (`*View*Args`) or `VibeClientOptions`: the view layer\n * reads `select`/`reveal`/`include` in `mergeLevel` BEFORE the model delegate's\n * strict check runs, and client options are never walked at all, so the\n * sentinel is not stripped on either path.\n */\nfunction inputAlias(params: { name: string; lines: readonly string[] }): string {\n const { name, lines } = params;\n return objectAlias({ name, lines: lines.map((block) => skippableMembers({ block })) });\n}\n\n/** `T | readonly T[]` for single-or-many input positions. */\nfunction orMany(params: { type: string }): string {\n const { type } = params;\n return `${type} | readonly ${maybeParens({ type })}[]`;\n}\n\nfunction payloadFieldType(params: { field: FieldView }): string {\n const { field } = params;\n const base = payloadBaseType({ field });\n if (field.isList) return `${maybeParens({ type: base })}[]`;\n return field.isOptional ? `${base} | null` : base;\n}\n\nfunction relationPayloadType(params: { relation: RelationView }): string {\n const { relation } = params;\n if (relation.isList) return `${relation.target}[]`;\n return relation.isOptional ? `${relation.target} | null` : relation.target;\n}\n\n// ─── Static preamble ──────────────────────────────────────────────\n\nconst PREAMBLE: string = `${banner({ title: \"Shared scalar & helper types\" })}\n\n/** JSON as stored/returned by Json columns (decoded payload shape). */\nexport type JsonValue = string | number | boolean | null | { [key: string]: JsonValue } | JsonValue[];\n\n/** Object form accepted as Json INPUT — readonly, and undefined-valued keys are dropped on serialize. */\nexport type InputJsonObject = { readonly [key: string]: InputJsonValue | null | undefined };\n\n/** Array form accepted as Json INPUT — readonly arrays are welcome (v1 lesson, LEARNINGS bug 7). */\nexport type InputJsonArray = ReadonlyArray<InputJsonValue | null>;\n\n/**\n * JSON as ACCEPTED for Json input positions — deliberately wider than\n * JsonValue: readonly containers and toJSON-bearing values (Date) serialize\n * fine, the runtime stringifies with JSON.stringify (v1 lessons, bugs 7+8).\n */\nexport type InputJsonValue = string | number | boolean | InputJsonObject | InputJsonArray | { toJSON(): unknown };\n\n/** \\`strict\\` (board #20) forces case-SENSITIVE matching where the engine folds (sqlite/mysql); a no-op on postgres. */\nexport type QueryMode = \"default\" | \"insensitive\" | \"strict\";\n\nexport type SortOrder = \"asc\" | \"desc\";\n\nexport type SortOrderWithNulls = SortOrder | { readonly sort: SortOrder; readonly nulls?: \"first\" | \"last\" };\n\n/** How relations are loaded: batched WHERE-IN queries, or a single JOIN (pg/pglite). */\nexport type RelationStrategy = \"query\" | \"join\";\n\n/**\n * An opaque, versioned keyset position (\\`after\\`) — ordering values plus a\n * unique tie-breaker, minted by a previous page. It is ENCODED, not encrypted:\n * whoever holds it can read the ordering values inside. It is also NOT an\n * authorization credential — it selects a position, never a row, and every\n * query still applies its own where/scoped/policy/RLS filters.\n */\nexport type KeysetToken = string;\n\n/** Per-query keyset options. */\nexport type KeysetOptions = {\n /**\n * Asserts that every DateTime ordering column in this query holds\n * millisecond-exact values. Required on postgres and mysql, whose timestamps\n * may be finer than a JavaScript Date; NOT safe for \\`@default(now())\\`\n * columns on postgres, which are microsecond-precise.\n */\n readonly timestampPrecision?: \"milliseconds\";\n};\n\n/** Result of createMany/updateMany/deleteMany. */\nexport type BatchPayload = { readonly count: number };\n\n/** Static operation classification only; runtime verifies instance ownership and active lifetime. */\ndeclare const vibeTransaction: unique symbol;\nexport type VibeQueryPromise<T, Access extends \"read\" | \"write\" = \"read\"> = QueryOperation<T, Access>;\n\n/**\n * What upsertMany reports. \\`count\\` is the rows submitted after duplicate-key\n * validation — every one of them was inserted or updated, since the statement\n * has no skip arm and the whole operation is atomic. \\`affectedRows\\` is the\n * driver's own number, and only where that number IS a row count: it is null on\n * mysql, whose ON DUPLICATE KEY scores an insert 1, a changed update 2 and an\n * unchanged update 0.\n */\nexport type UpsertManyPayload = { readonly count: number; readonly affectedRows: number | null };\n\n/**\n * An argument member as the RESULT machinery must read it. Absent and the\n * \\`SKIP\\` sentinel both mean \"not provided\", so neither may narrow a payload:\n * without this, \\`{ omit?: UserOmitInput | Skip }\\` would collapse the key\n * helpers below to \\`never\\` and promise fields the query may still have dropped.\n */\ntype Provided<T> = Exclude<T, Skip | undefined>;\n\n/** Keys of an omit object whose value is exactly true — the scalars the result drops. */\ntype OmittedKeys<O> = keyof { [K in keyof O as O[K] extends true ? K : never]: 0 };\n\n/** Keys a selection has not RULED OUT — everything except a literal false/undefined. */\ntype PossibleKeys<S> = keyof { [K in keyof S as S[K] extends false | undefined | Skip ? never : K]: 0 };\n\n/**\n * Keys whose flag can STILL be false or missing when the query runs — a widened\n * \\`boolean\\`, or an optional nested selection. They are emitted OPTIONAL: the\n * result type must not promise a field a run-time flag can switch off.\n */\ntype UncertainKeys<S> = PossibleKeys<S> &\n keyof { [K in keyof S as [false] extends [S[K]] ? K : [undefined] extends [S[K]] ? K : [Skip] extends [S[K]] ? K : never]: 0 };\n\n/** Keys the selection definitely turns on: a literal \\`true\\`, or a nested selection object. */\ntype ExactKeys<S> = Exclude<PossibleKeys<S>, UncertainKeys<S>>;\n\n/** An aggregate object is absent when none of its selectors is enabled. */\ntype HasSelectedField<S> = [S] extends [true] ? true : [S] extends [object] ? ExactKeys<S> extends never ? false : true : false;`;\n\ntype ScalarFilterConfig = {\n readonly prefix: string;\n readonly value: string;\n readonly comparable: boolean;\n readonly text: boolean;\n /** Comparison positions also accept the `DbNow` database-clock sentinel. */\n readonly clock?: boolean;\n};\n\nconst SCALAR_FILTER_CONFIGS: readonly ScalarFilterConfig[] = [\n { prefix: \"String\", value: \"string\", comparable: true, text: true },\n { prefix: \"Int\", value: \"number\", comparable: true, text: false },\n { prefix: \"Float\", value: \"number\", comparable: true, text: false },\n { prefix: \"BigInt\", value: \"bigint | number\", comparable: true, text: false },\n { prefix: \"Decimal\", value: \"string | number\", comparable: true, text: false },\n { prefix: \"DateTime\", value: \"Date | string\", comparable: true, text: false, clock: true },\n { prefix: \"Bool\", value: \"boolean\", comparable: false, text: false },\n { prefix: \"Bytes\", value: \"Uint8Array\", comparable: false, text: false },\n];\n\nfunction scalarFilterAlias(params: { config: ScalarFilterConfig; nullable: boolean }): string {\n const { config, nullable } = params;\n const name = nullable ? `${config.prefix}NullableFilter` : `${config.prefix}Filter`;\n const value = config.value;\n // Comparison positions (equals/not/lt…) also take the database-clock\n // sentinel on clock scalars; IN lists never do (refused at build time).\n const point = config.clock === true ? `${value} | DbNow` : value;\n const valueOrNull = nullable ? `${point} | null` : point;\n const array = `readonly ${maybeParens({ type: value })}[]`;\n const lines: string[] = [];\n lines.push(` readonly equals?: ${valueOrNull};`);\n lines.push(` readonly in?: ${array};`);\n lines.push(` readonly notIn?: ${array};`);\n if (config.comparable) {\n lines.push(` readonly lt?: ${point};`);\n lines.push(` readonly lte?: ${point};`);\n lines.push(` readonly gt?: ${point};`);\n lines.push(` readonly gte?: ${point};`);\n }\n if (config.text) {\n lines.push(` readonly contains?: ${value};`);\n lines.push(` readonly startsWith?: ${value};`);\n lines.push(` readonly endsWith?: ${value};`);\n lines.push(` readonly mode?: QueryMode;`);\n }\n lines.push(` readonly not?: ${value} | ${name}${nullable ? \" | null\" : \"\"};`);\n return inputAlias({ name, lines });\n}\n\nfunction scalarListFilterAlias(params: { config: ScalarFilterConfig }): string {\n const { config } = params;\n const value = config.value;\n const array = `readonly ${maybeParens({ type: value })}[]`;\n return inputAlias({\n name: `${config.prefix}ListFilter`,\n lines: [\n ` readonly equals?: ${array} | null;`,\n ` readonly has?: ${value} | null;`,\n ` readonly hasEvery?: ${array};`,\n ` readonly hasSome?: ${array};`,\n ` readonly isEmpty?: boolean;`,\n ],\n });\n}\n\nconst UPDATE_OPS_CONFIGS: ReadonlyArray<{ readonly prefix: string; readonly value: string }> = [\n { prefix: \"Int\", value: \"number\" },\n { prefix: \"Float\", value: \"number\" },\n { prefix: \"BigInt\", value: \"bigint | number\" },\n { prefix: \"Decimal\", value: \"string | number\" },\n];\n\nfunction updateOpsAlias(params: { prefix: string; value: string; nullable: boolean }): string {\n const { prefix, value, nullable } = params;\n const name = nullable ? `Nullable${prefix}FieldUpdateOperationsInput` : `${prefix}FieldUpdateOperationsInput`;\n return inputAlias({\n name,\n lines: [\n ` readonly set?: ${nullable ? `${value} | null` : value};`,\n ` readonly increment?: ${value};`,\n ` readonly decrement?: ${value};`,\n ` readonly multiply?: ${value};`,\n ` readonly divide?: ${value};`,\n ],\n });\n}\n\n/**\n * Json-column filters: the `path` + `equals`/`not`/`string_*`/`array_*` surface\n * `compileJsonFieldFilter` compiles, and NOTHING else — a member here that the\n * runtime refuses would be a compile-time promise broken at execution.\n *\n * `path` is a plain key/index array on purpose: the declaration says nothing\n * about which paths exist inside a stored document (the ORM cannot know), and\n * a template-literal or recursive key type would both lie and cost tsserver.\n * `mode` is narrower than `QueryMode` because the Json path takes only\n * `\"insensitive\"` / `\"default\"` — `\"strict\"` is refused there.\n */\nfunction jsonFilterAlias(params: { nullable: boolean }): string {\n const { nullable } = params;\n const document = nullable ? \"InputJsonValue | null\" : \"InputJsonValue\";\n return inputAlias({\n name: nullable ? \"JsonNullableFilter\" : \"JsonFilter\",\n lines: [\n ` readonly path?: readonly (string | number)[];`,\n ` readonly mode?: \"default\" | \"insensitive\";`,\n ` readonly equals?: ${document};`,\n ` readonly not?: ${document};`,\n ` readonly string_contains?: string;`,\n ` readonly string_starts_with?: string;`,\n ` readonly string_ends_with?: string;`,\n ` readonly array_contains?: InputJsonValue;`,\n ` readonly array_starts_with?: InputJsonValue;`,\n ` readonly array_ends_with?: InputJsonValue;`,\n ],\n });\n}\n\nfunction filterSection(): string[] {\n const parts: string[] = [banner({ title: \"Scalar filters\" })];\n for (const config of SCALAR_FILTER_CONFIGS) {\n parts.push(scalarFilterAlias({ config, nullable: false }));\n parts.push(scalarFilterAlias({ config, nullable: true }));\n parts.push(scalarListFilterAlias({ config }));\n }\n parts.push(jsonFilterAlias({ nullable: false }));\n parts.push(jsonFilterAlias({ nullable: true }));\n parts.push(\n inputAlias({\n name: \"JsonListFilter\",\n lines: [\n ` readonly equals?: readonly InputJsonValue[] | null;`,\n ` readonly has?: InputJsonValue | null;`,\n ` readonly hasEvery?: readonly InputJsonValue[];`,\n ` readonly hasSome?: readonly InputJsonValue[];`,\n ` readonly isEmpty?: boolean;`,\n ],\n }),\n );\n parts.push(banner({ title: \"Atomic update operations\" }));\n for (const config of UPDATE_OPS_CONFIGS) {\n parts.push(updateOpsAlias({ ...config, nullable: false }));\n parts.push(updateOpsAlias({ ...config, nullable: true }));\n }\n return parts;\n}\n\n// ─── Enums ────────────────────────────────────────────────────────\n\nconst GENERATED_HEADER: string = `// Generated by VibeORM (@vibeorm/generator) — DO NOT EDIT.\\n// Regenerate with \\`vibeorm generate\\` after every schema change.`;\n\n/** The constant object + literal union of one enum (the enums.d.ts half). */\nfunction emitEnumDeclaration(params: { declared: EnumView }): string {\n const { declared } = params;\n const name = declared.name;\n const valueLines = declared.values.map(\n (value) => ` readonly ${propKey({ name: value })}: ${tsString({ value })};`,\n );\n return [\n banner({ title: `Enum ${name}` }),\n `export declare const ${name}: {\\n${valueLines.join(\"\\n\")}\\n};`,\n `export type ${name} = ${declared.values.map((value) => tsString({ value })).join(\" | \")};`,\n `/** Boundary validator for ${name}: \\`values\\`, \\`is\\`, \\`parse\\` (throws VIBE_VALIDATION on a non-member). */\\n` +\n `export type ${name}Validator = {\\n` +\n ` readonly values: readonly ${name}[];\\n` +\n ` is(value: unknown): value is ${name};\\n` +\n ` parse(params: { readonly value: unknown }): ${name};\\n` +\n `};`,\n ].join(\"\\n\\n\");\n}\n\n/**\n * Emit enums.d.ts: every enum's constant, literal union and flat validator\n * type, plus the grouped `enumValidators`. Fully pre-resolved — no generics,\n * no imports — and independent of the client surface in index.d.ts.\n */\nexport function emitEnumsDts(params: { view: SchemaView }): string {\n const { view } = params;\n const parts: string[] = [\n `${GENERATED_HEADER}\\n// Lightweight entry: enum constants + boundary parsers. No runtime client, no schema module.`,\n ];\n for (const declared of view.enums) parts.push(emitEnumDeclaration({ declared }));\n parts.push(banner({ title: \"Enum validators\" }));\n const validatorLines = view.enums.map((declared) => ` readonly ${declared.name}: ${declared.name}Validator;`);\n parts.push(\n `/** Boundary parsers grouped by enum name, so an enum member named \\`parse\\` cannot collide. */\\n` +\n (validatorLines.length === 0\n ? `export declare const enumValidators: Record<string, never>;`\n : `export declare const enumValidators: {\\n${validatorLines.join(\"\\n\")}\\n};`),\n );\n return `${parts.join(\"\\n\\n\")}\\n`;\n}\n\n/** The client-surface half of an enum: its filter aliases (the constant + union live in enums.d.ts). */\nfunction emitEnum(params: { declared: EnumView }): string {\n const { declared } = params;\n const name = declared.name;\n const parts: string[] = [banner({ title: `Enum ${name} filters` })];\n\n const array = `readonly ${name}[]`;\n parts.push(\n inputAlias({\n name: `${name}Filter`,\n lines: [\n ` readonly equals?: ${name};`,\n ` readonly in?: ${array};`,\n ` readonly notIn?: ${array};`,\n ` readonly not?: ${name} | ${name}Filter;`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${name}NullableFilter`,\n lines: [\n ` readonly equals?: ${name} | null;`,\n ` readonly in?: ${array};`,\n ` readonly notIn?: ${array};`,\n ` readonly not?: ${name} | ${name}NullableFilter | null;`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${name}ListFilter`,\n lines: [\n ` readonly equals?: ${array} | null;`,\n ` readonly has?: ${name} | null;`,\n ` readonly hasEvery?: ${array};`,\n ` readonly hasSome?: ${array};`,\n ` readonly isEmpty?: boolean;`,\n ],\n }),\n );\n return parts.join(\"\\n\\n\");\n}\n\n// ─── Create / update input bodies ─────────────────────────────────\n\nfunction createFieldProp(params: { field: FieldView }): string {\n const { field } = params;\n const optional = field.isOptional || field.hasDefault || field.isUpdatedAt || field.isList;\n const base = inputBaseType({ field });\n const value = field.isList\n ? `readonly ${maybeParens({ type: base })}[]`\n : field.isOptional\n ? `${base} | null`\n : base;\n return ` readonly ${propKey({ name: field.name })}${optional ? \"?\" : \"\"}: ${value};`;\n}\n\nfunction updateFieldProp(params: { field: FieldView }): string {\n const { field } = params;\n const base = inputBaseType({ field });\n const key = propKey({ name: field.name });\n if (field.isList) {\n const element = maybeParens({ type: base });\n return ` readonly ${key}?: readonly ${element}[] | { readonly set?: readonly ${element}[]; readonly push?: ${base} | readonly ${element}[] };`;\n }\n const ops = updateOpsName({ field });\n const withNull = field.isOptional ? `${base} | null` : base;\n if (ops !== null) return ` readonly ${key}?: ${withNull} | ${ops};`;\n return ` readonly ${key}?: ${withNull} | { readonly set: ${withNull} };`;\n}\n\nfunction nestedRefName(params: { relation: RelationView; verb: \"Create\" | \"Update\" }): string {\n const { relation, verb } = params;\n const suffix = relation.inverseName === null ? \"\" : `Without${pascal({ name: relation.inverseName })}`;\n return `${relation.target}${verb}Nested${relation.isList ? \"Many\" : \"One\"}${suffix}Input`;\n}\n\n/** Checked input: relation fields present, ALL FK scalar columns excluded. */\nfunction checkedCreateLines(params: { model: ModelView; omitRelation?: string }): string[] {\n const { model, omitRelation } = params;\n const lines: string[] = [];\n for (const field of model.fields) {\n if (model.fkFieldNames.has(field.name)) continue;\n lines.push(createFieldProp({ field }));\n }\n for (const relation of model.relations) {\n if (relation.name === omitRelation) continue;\n const required = !relation.isList && !relation.isOptional;\n lines.push(\n ` readonly ${propKey({ name: relation.name })}${required ? \"\" : \"?\"}: ${nestedRefName({ relation, verb: \"Create\" })};`,\n );\n }\n return lines;\n}\n\n/** Unchecked input: scalar columns only (FKs included), no relation fields. */\nfunction uncheckedCreateLines(params: { model: ModelView; omitRelation?: string }): string[] {\n const { model, omitRelation } = params;\n const omitted = new Set(\n omitRelation === undefined\n ? []\n : (model.relations.find((relation) => relation.name === omitRelation)?.fkFields ?? []),\n );\n return model.fields.filter((field) => !omitted.has(field.name)).map((field) => createFieldProp({ field }));\n}\n\nfunction checkedUpdateLines(params: { model: ModelView; omitRelation?: string }): string[] {\n const { model, omitRelation } = params;\n const lines: string[] = [];\n for (const field of model.fields) {\n if (model.fkFieldNames.has(field.name)) continue;\n lines.push(updateFieldProp({ field }));\n }\n for (const relation of model.relations) {\n if (relation.name === omitRelation) continue;\n lines.push(\n ` readonly ${propKey({ name: relation.name })}?: ${nestedRefName({ relation, verb: \"Update\" })};`,\n );\n }\n return lines;\n}\n\nfunction uncheckedUpdateLines(params: { model: ModelView; omitRelation?: string }): string[] {\n const { model, omitRelation } = params;\n const omitted = new Set(\n omitRelation === undefined\n ? []\n : (model.relations.find((relation) => relation.name === omitRelation)?.fkFields ?? []),\n );\n return model.fields.filter((field) => !omitted.has(field.name)).map((field) => updateFieldProp({ field }));\n}\n\n// ─── Nested input registry ────────────────────────────────────────\n\n/**\n * Nested write wrappers, deduplicated by alias name. A context is one relation\n * seen from its parent: nested inputs for the TARGET model, \"without\" the\n * inverse field pointing back at the parent.\n */\ntype NestedRegistry = Map<string, string>;\n\nfunction register(params: { registry: NestedRegistry; name: string; text: string }): void {\n const { registry, name, text } = params;\n const existing = registry.get(name);\n if (existing !== undefined) {\n if (existing !== text) {\n throw new VibeError({\n code: \"VIBE_INTERNAL\",\n message: `internal: nested input type \"${name}\" generated with two different bodies`,\n meta: { name },\n });\n }\n return;\n }\n registry.set(name, text);\n}\n\nfunction registerNestedContext(params: {\n registry: NestedRegistry;\n view: SchemaView;\n relation: RelationView;\n}): void {\n const { registry, view, relation } = params;\n const target = view.modelByName.get(relation.target);\n if (target === undefined) return; // validation would have thrown already\n const t = target.name;\n const inverse = relation.inverseName;\n const suffix = inverse === null ? \"\" : `Without${pascal({ name: inverse })}`;\n const many = relation.isList;\n const m2m = relation.type === \"manyToMany\";\n\n let createUnion: string;\n let updateUnion: string;\n if (inverse === null) {\n createUnion = `${t}CreateInput | ${t}UncheckedCreateInput`;\n updateUnion = `${t}UpdateInput | ${t}UncheckedUpdateInput`;\n } else {\n createUnion = `${t}Create${suffix}Input | ${t}UncheckedCreate${suffix}Input`;\n updateUnion = `${t}Update${suffix}Input | ${t}UncheckedUpdate${suffix}Input`;\n register({\n registry,\n name: `${t}Create${suffix}Input`,\n text: inputAlias({\n name: `${t}Create${suffix}Input`,\n lines: checkedCreateLines({ model: target, omitRelation: inverse }),\n }),\n });\n register({\n registry,\n name: `${t}UncheckedCreate${suffix}Input`,\n text: inputAlias({\n name: `${t}UncheckedCreate${suffix}Input`,\n lines: uncheckedCreateLines({ model: target, omitRelation: inverse }),\n }),\n });\n register({\n registry,\n name: `${t}Update${suffix}Input`,\n text: inputAlias({\n name: `${t}Update${suffix}Input`,\n lines: checkedUpdateLines({ model: target, omitRelation: inverse }),\n }),\n });\n register({\n registry,\n name: `${t}UncheckedUpdate${suffix}Input`,\n text: inputAlias({\n name: `${t}UncheckedUpdate${suffix}Input`,\n lines: uncheckedUpdateLines({ model: target, omitRelation: inverse }),\n }),\n });\n }\n\n const connectOrCreateName = `${t}ConnectOrCreate${suffix}Input`;\n register({\n registry,\n name: connectOrCreateName,\n text: inputAlias({\n name: connectOrCreateName,\n lines: [` readonly where: ${t}WhereUniqueInput;`, ` readonly create: ${createUnion};`],\n }),\n });\n\n const createManyData =\n inverse === null ? `readonly ${t}CreateManyInput[]` : `readonly ${t}UncheckedCreate${suffix}Input[]`;\n\n if (many) {\n register({\n registry,\n name: `${t}CreateNestedMany${suffix}Input`,\n text: inputAlias({\n name: `${t}CreateNestedMany${suffix}Input`,\n lines: [\n ` readonly create?: ${orMany({ type: createUnion })};`,\n ` readonly connect?: ${orMany({ type: `${t}WhereUniqueInput` })};`,\n ` readonly connectOrCreate?: ${orMany({ type: connectOrCreateName })};`,\n ...(m2m\n ? []\n : [` readonly createMany?: { readonly data: ${createManyData}; readonly skipDuplicates?: boolean };`]),\n ],\n }),\n });\n\n const updateWithWhere = `${t}UpdateWithWhereUnique${suffix}Input`;\n register({\n registry,\n name: updateWithWhere,\n text: inputAlias({\n name: updateWithWhere,\n lines: [` readonly where: ${t}WhereUniqueInput;`, ` readonly data: ${updateUnion};`],\n }),\n });\n const updateManyWithWhere = `${t}UpdateManyWithWhere${suffix}Input`;\n register({\n registry,\n name: updateManyWithWhere,\n text: inputAlias({\n name: updateManyWithWhere,\n lines: [` readonly where: ${t}WhereInput;`, ` readonly data: ${t}UpdateManyInput;`],\n }),\n });\n const upsertWithWhere = `${t}UpsertWithWhereUnique${suffix}Input`;\n register({\n registry,\n name: upsertWithWhere,\n text: inputAlias({\n name: upsertWithWhere,\n lines: [\n ` readonly where: ${t}WhereUniqueInput;`,\n ` readonly create: ${createUnion};`,\n ` readonly update: ${updateUnion};`,\n ],\n }),\n });\n register({\n registry,\n name: `${t}UpdateNestedMany${suffix}Input`,\n text: inputAlias({\n name: `${t}UpdateNestedMany${suffix}Input`,\n lines: [\n ` readonly create?: ${orMany({ type: createUnion })};`,\n ` readonly connect?: ${orMany({ type: `${t}WhereUniqueInput` })};`,\n ` readonly connectOrCreate?: ${orMany({ type: connectOrCreateName })};`,\n ...(m2m\n ? []\n : [` readonly createMany?: { readonly data: ${createManyData}; readonly skipDuplicates?: boolean };`]),\n ` readonly set?: ${orMany({ type: `${t}WhereUniqueInput` })};`,\n ` readonly disconnect?: ${orMany({ type: `${t}WhereUniqueInput` })};`,\n ` readonly delete?: ${orMany({ type: `${t}WhereUniqueInput` })};`,\n ` readonly update?: ${orMany({ type: updateWithWhere })};`,\n ` readonly updateMany?: ${orMany({ type: updateManyWithWhere })};`,\n ` readonly deleteMany?: ${orMany({ type: `${t}WhereInput` })};`,\n ` readonly upsert?: ${orMany({ type: upsertWithWhere })};`,\n ],\n }),\n });\n } else {\n // The rare fallback (no resolvable inverse) always offers disconnect/delete;\n // the precise Without-variant gates them on the forward relation's optionality.\n const allowDetach = inverse === null || relation.isOptional;\n register({\n registry,\n name: `${t}CreateNestedOne${suffix}Input`,\n text: inputAlias({\n name: `${t}CreateNestedOne${suffix}Input`,\n lines: [\n ` readonly create?: ${createUnion};`,\n ` readonly connect?: ${t}WhereUniqueInput;`,\n ` readonly connectOrCreate?: ${connectOrCreateName};`,\n ],\n }),\n });\n register({\n registry,\n name: `${t}UpdateNestedOne${suffix}Input`,\n text: inputAlias({\n name: `${t}UpdateNestedOne${suffix}Input`,\n lines: [\n ` readonly create?: ${createUnion};`,\n ` readonly connect?: ${t}WhereUniqueInput;`,\n ` readonly connectOrCreate?: ${connectOrCreateName};`,\n ` readonly update?: ${updateUnion};`,\n ` readonly upsert?: { readonly create: ${createUnion}; readonly update: ${updateUnion} };`,\n ...(allowDetach ? [` readonly disconnect?: boolean;`, ` readonly delete?: boolean;`] : []),\n ],\n }),\n });\n }\n}\n\n// ─── Per-model emission ───────────────────────────────────────────\n\nconst AGGREGATE_OPS_UNION: string = `\"_count\" | \"_avg\" | \"_sum\" | \"_min\" | \"_max\"`;\n\nfunction emitModel(params: {\n model: ModelView;\n view: SchemaView;\n registry: NestedRegistry;\n /** Extension delegate-body lines (already indented) — baked surfaces (D9). */\n extensionLines?: readonly string[];\n /** The classified read-only subset of `extensionLines` (deny-by-default). */\n readOnlyExtensionLines?: readonly string[];\n /** Computed-field manifest entries for THIS model (config-declared, pre-resolved types). */\n computed?: readonly ComputedManifestEntry[];\n}): string {\n const { model, view, registry } = params;\n const computedEntries = params.computed ?? [];\n const n = model.name;\n const hasRelations = model.relations.length > 0;\n const parts: string[] = [banner({ title: `Model ${n}` })];\n\n for (const relation of model.relations) {\n registerNestedContext({ registry, view, relation });\n }\n\n // Payload (scalars + computed fields — relations are opt-in via include/select).\n parts.push(\n `export type ${n} = {\\n${[\n ...model.fields.map((field) => ` ${propKey({ name: field.name })}: ${payloadFieldType({ field })};`),\n ...computedEntries.map((entry) => ` ${propKey({ name: entry.field })}: ${entry.type};`),\n ].join(\"\\n\")}\\n};`,\n );\n\n parts.push(\n `export type ${n}ScalarFieldEnum = ${model.fields.map((field) => tsString({ value: field.name })).join(\" | \")};`,\n );\n\n // Computed fields are selectable/omittable but never SQL-addressable, so the\n // scalar enum (distinct, groupBy.by) stays scalar-only and the payload\n // narrowing maps over this wider union instead.\n if (computedEntries.length > 0) {\n parts.push(\n `export type ${n}SelectableFieldEnum = ${n}ScalarFieldEnum | ${computedEntries\n .map((entry) => tsString({ value: entry.field }))\n .join(\" | \")};`,\n );\n }\n const selectableEnum = computedEntries.length > 0 ? `${n}SelectableFieldEnum` : `${n}ScalarFieldEnum`;\n\n if (hasRelations) {\n parts.push(\n `export type ${n}Relations = {\\n${model.relations\n .map((relation) => ` ${propKey({ name: relation.name })}: ${relationPayloadType({ relation })};`)\n .join(\"\\n\")}\\n};`,\n );\n }\n\n // Select / Include / omit / nested-args. `_count` exists only where the\n // runtime can count something: models with at least one list relation.\n const listRelations = model.relations.filter((relation) => relation.isList);\n const hasCounts = listRelations.length > 0;\n const countLine = ` readonly _count?: boolean | { readonly select: ${n}CountSelect };`;\n const relationSelectValue = (relation: RelationView): string =>\n `boolean | ${relation.target}${relation.isList ? \"RelationFindManyArgs\" : \"Args\"}`;\n if (hasCounts) {\n parts.push(\n inputAlias({\n name: `${n}CountSelect`,\n // A count entry is a boolean OR a filter over the counted children —\n // the same WhereInput an ordinary query takes, pre-resolved, never\n // inferred (`_count: { select: { posts: { where: … } } }`).\n lines: listRelations.map(\n (relation) =>\n ` readonly ${propKey({ name: relation.name })}?: boolean | { readonly where?: ${relation.target}WhereInput };`,\n ),\n }),\n );\n }\n parts.push(\n inputAlias({\n name: `${n}Select`,\n lines: [\n ...model.fields.map((field) => ` readonly ${propKey({ name: field.name })}?: boolean;`),\n ...computedEntries.map((entry) => ` readonly ${propKey({ name: entry.field })}?: boolean;`),\n ...model.relations.map(\n (relation) => ` readonly ${propKey({ name: relation.name })}?: ${relationSelectValue(relation)};`,\n ),\n ...(hasCounts ? [countLine] : []),\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}Include`,\n lines: [\n ...model.relations.map(\n (relation) => ` readonly ${propKey({ name: relation.name })}?: ${relationSelectValue(relation)};`,\n ),\n ...(hasCounts ? [countLine] : []),\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}OmitInput`,\n lines: [\n ...model.fields.map((field) => ` readonly ${propKey({ name: field.name })}?: boolean;`),\n ...computedEntries.map((entry) => ` readonly ${propKey({ name: entry.field })}?: boolean;`),\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}Args`,\n lines: [\n ` readonly select?: ${n}Select;`,\n ` readonly include?: ${n}Include;`,\n ` readonly omit?: ${n}OmitInput;`,\n ` readonly relationStrategy?: RelationStrategy;`,\n ],\n }),\n );\n\n // Relation filters (referenced by OTHER models' WhereInput).\n parts.push(\n inputAlias({\n name: `${n}ListRelationFilter`,\n lines: [\n ` readonly some?: ${n}WhereInput;`,\n ` readonly every?: ${n}WhereInput;`,\n ` readonly none?: ${n}WhereInput;`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}RelationFilter`,\n lines: [` readonly is?: ${n}WhereInput | null;`, ` readonly isNot?: ${n}WhereInput | null;`],\n }),\n );\n\n // Where.\n const whereLines: string[] = [\n ` /** Constructed raw SQL; refused on scoped, read-only and field-masked handles. */`,\n ` readonly $raw?: SqlFragment;`,\n ` readonly AND?: ${orMany({ type: `${n}WhereInput` })};`,\n ` readonly OR?: readonly ${n}WhereInput[];`,\n ` readonly NOT?: ${orMany({ type: `${n}WhereInput` })};`,\n ];\n for (const field of model.fields) {\n const key = propKey({ name: field.name });\n if (field.isList || field.scalar === \"Json\") {\n whereLines.push(` readonly ${key}?: ${filterName({ field })};`);\n continue;\n }\n const nullable = field.isOptional ? \" | null\" : \"\";\n whereLines.push(` readonly ${key}?: ${inputBaseType({ field })} | ${filterName({ field })}${nullable};`);\n }\n for (const relation of model.relations) {\n const key = propKey({ name: relation.name });\n if (relation.isList) {\n whereLines.push(` readonly ${key}?: ${relation.target}ListRelationFilter;`);\n } else {\n whereLines.push(\n ` readonly ${key}?: ${relation.target}RelationFilter | ${relation.target}WhereInput${relation.isOptional ? \" | null\" : \"\"};`,\n );\n }\n }\n parts.push(inputAlias({ name: `${n}WhereInput`, lines: whereLines }));\n\n // WhereUnique — one union member per way to address a single row.\n if (model.uniques.length === 0) {\n parts.push(`export type ${n}WhereUniqueInput = never;`);\n } else {\n const members = model.uniques.map((member) => {\n // NULLS NOT DISTINCT groups: a null member addresses the (single) null\n // slot, so optional members widen to `| null` — mirroring the runtime's\n // isAddressableMember rule.\n const first = member.fields[0];\n if (member.fields.length === 1 && first !== undefined) {\n return `{ readonly ${propKey({ name: first.name })}: ${inputBaseType({ field: first })}${member.nullsNotDistinct && first.isOptional ? \" | null\" : \"\"} }`;\n }\n const inner = member.fields\n .map(\n (field) =>\n `readonly ${propKey({ name: field.name })}: ${inputBaseType({ field })}${member.nullsNotDistinct && field.isOptional ? \" | null\" : \"\"}`,\n )\n .join(\"; \");\n return `{ readonly ${propKey({ name: member.key })}: { ${inner} } }`;\n });\n parts.push(`export type ${n}WhereUniqueInput =\\n | ${members.join(\"\\n | \")};`);\n }\n\n // Only top-level finds accept relation ordering. Related scalars take a\n // direction, never null placement or another relation traversal.\n const scalarOrderLines = model.fields.map(\n (field) => ` readonly ${propKey({ name: field.name })}?: ${field.isOptional ? \"SortOrderWithNulls\" : \"SortOrder\"};`,\n );\n parts.push(inputAlias({ name: `${n}ScalarOrderByInput`, lines: scalarOrderLines }));\n parts.push(inputAlias({\n name: `${n}RelationOrderByInput`,\n lines: model.fields.map((field) => ` readonly ${propKey({ name: field.name })}?: SortOrder;`),\n }));\n parts.push(inputAlias({\n name: `${n}OrderByInput`,\n lines: [\n ...scalarOrderLines,\n ...model.relations.map((relation) =>\n ` readonly ${propKey({ name: relation.name })}?: ${relation.isList ? \"{ readonly _count?: SortOrder | Skip }\" : `${relation.target}RelationOrderByInput`};`,\n ),\n ],\n }));\n\n // Create / update inputs.\n parts.push(inputAlias({ name: `${n}CreateInput`, lines: checkedCreateLines({ model }) }));\n parts.push(inputAlias({ name: `${n}UncheckedCreateInput`, lines: uncheckedCreateLines({ model }) }));\n parts.push(`export type ${n}CreateManyInput = ${n}UncheckedCreateInput;`);\n parts.push(inputAlias({ name: `${n}UpdateInput`, lines: checkedUpdateLines({ model }) }));\n parts.push(inputAlias({ name: `${n}UncheckedUpdateInput`, lines: uncheckedUpdateLines({ model }) }));\n parts.push(`export type ${n}UpdateManyInput = ${n}UncheckedUpdateInput;`);\n\n // Aggregate inputs.\n const numericFields = model.fields.filter(\n (field) => !field.isList && field.scalar !== null && NUMERIC_SCALARS.has(field.scalar),\n );\n const minmaxFields = model.fields.filter(\n (field) => !field.isList && field.scalar !== null && MINMAX_SCALARS.has(field.scalar),\n );\n parts.push(\n inputAlias({\n name: `${n}CountAggregateInput`,\n lines: [\n ...model.fields.map((field) => ` readonly ${propKey({ name: field.name })}?: true;`),\n ` readonly _all?: true;`,\n ],\n }),\n );\n const aggregateOpProps: string[] = [` readonly _count?: true | ${n}CountAggregateInput;`];\n if (numericFields.length > 0) {\n parts.push(\n inputAlias({\n name: `${n}AvgAggregateInput`,\n lines: numericFields.map((field) => ` readonly ${propKey({ name: field.name })}?: true;`),\n }),\n );\n parts.push(`export type ${n}SumAggregateInput = ${n}AvgAggregateInput;`);\n aggregateOpProps.push(` readonly _avg?: ${n}AvgAggregateInput;`);\n aggregateOpProps.push(` readonly _sum?: ${n}SumAggregateInput;`);\n }\n if (minmaxFields.length > 0) {\n parts.push(\n inputAlias({\n name: `${n}MinAggregateInput`,\n lines: minmaxFields.map((field) => ` readonly ${propKey({ name: field.name })}?: true;`),\n }),\n );\n parts.push(`export type ${n}MaxAggregateInput = ${n}MinAggregateInput;`);\n aggregateOpProps.push(` readonly _min?: ${n}MinAggregateInput;`);\n aggregateOpProps.push(` readonly _max?: ${n}MaxAggregateInput;`);\n }\n\n // Method args. Write nested inputs concretely to keep consumer type cost low.\n for (const nested of [false, true]) {\n parts.push(\n inputAlias({\n name: `${n}${nested ? \"RelationFindManyArgs\" : \"FindManyArgs\"}`,\n lines: [\n ` readonly where?: ${n}WhereInput;`,\n ` readonly orderBy?: ${orMany({ type: `${n}${nested ? \"ScalarOrderByInput\" : \"OrderByInput\"}` })};`,\n ` readonly select?: ${n}Select;`,\n ` readonly include?: ${n}Include;`,\n ` readonly omit?: ${n}OmitInput;`,\n ` readonly take?: number;`,\n ` readonly skip?: number;`,\n ...(!nested ? [\n ` readonly cursor?: ${n}WhereUniqueInput;`,\n ` readonly after?: KeysetToken;`,\n ` readonly keyset?: KeysetOptions;`,\n ` readonly distinct?: ${orMany({ type: `${n}ScalarFieldEnum` })};`,\n ` readonly relationStrategy?: RelationStrategy;`,\n lockArgumentLines(),\n ] : []),\n ],\n }),\n );\n }\n parts.push(`export type ${n}FindFirstArgs = ${n}FindManyArgs;`);\n parts.push(\n inputAlias({\n name: `${n}FindUniqueArgs`,\n lines: [\n ` readonly where: ${n}WhereUniqueInput;`,\n ` readonly select?: ${n}Select;`,\n ` readonly include?: ${n}Include;`,\n ` readonly omit?: ${n}OmitInput;`,\n ` readonly relationStrategy?: RelationStrategy;`,\n lockArgumentLines(),\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}CreateArgs`,\n lines: [\n ` readonly onConflict?: never;`,\n ` readonly data: ${n}CreateInput | ${n}UncheckedCreateInput;`,\n ` readonly select?: ${n}Select;`,\n ` readonly include?: ${n}Include;`,\n ` readonly omit?: ${n}OmitInput;`,\n ],\n }),\n );\n parts.push(\n `export type ${n}ConflictTarget = readonly ${n}ScalarFieldEnum[] | { readonly constraint: string };`,\n );\n parts.push(\n `export type ${n}CreateOnConflictInput =\\n` +\n ` | { readonly action: \"nothing\"; readonly update?: never; readonly target?: ${n}ConflictTarget | Skip; readonly where?: string | Skip }` +\n (capabilitiesOf({ view }).returning\n ? `\\n | { readonly action: \"update\"; readonly target: ${n}ConflictTarget; readonly update: { ${model.fields.map((field) => `readonly ${propKey({ name: field.name })}?: SqlFragment`).join(\"; \")} }; readonly where?: string | Skip }`\n : \"\") + \";\",\n );\n parts.push(\n inputAlias({\n name: `${n}CreateOrSkipArgs`,\n lines: [\n ` readonly data: ${n}CreateInput | ${n}UncheckedCreateInput;`,\n ` readonly onConflict: ${n}CreateOnConflictInput;`,\n ` readonly select?: ${n}Select;`,\n ` readonly include?: ${n}Include;`,\n ` readonly omit?: ${n}OmitInput;`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}CreateManyArgs`,\n lines: [\n ` readonly data: ${orMany({ type: `${n}CreateManyInput` })};`,\n ` readonly skipDuplicates?: boolean | { readonly target?: ${n}ConflictTarget; readonly where?: string };`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}CreateManyAndReturnArgs`,\n lines: [\n ` readonly data: ${orMany({ type: `${n}CreateManyInput` })};`,\n ` readonly skipDuplicates?: boolean | { readonly target?: ${n}ConflictTarget; readonly where?: string };`,\n ` readonly select?: ${n}Select;`,\n ` readonly omit?: ${n}OmitInput;`,\n ],\n }),\n );\n // EPIC 10 — batched upsert for ingestion. Scalar rows, an explicit arbiter\n // and an explicit list of columns the conflict arm copies from the incoming\n // row. No select/include: the operation reports a count, not rows.\n parts.push(\n inputAlias({\n name: `${n}UpsertManyArgs`,\n lines: [\n ` readonly data: readonly ${n}CreateManyInput[];`,\n ` readonly conflictTarget: ${n}ConflictTarget;`,\n ` readonly conflictWhere?: string;`,\n ` readonly update: readonly ${n}ScalarFieldEnum[] | { ${model.fields.map((field) => `readonly ${propKey({ name: field.name })}?: SqlFragment`).join(\"; \")} };`,\n ` readonly skipUpdatedAt?: boolean;`,\n ` readonly allowAnyUniqueConflict?: boolean;`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}UpdateArgs`,\n lines: [\n ` readonly where: ${n}UpdateWhereInput;`,\n ` readonly data: ${n}UpdateInput | ${n}UncheckedUpdateInput;`,\n ` readonly select?: ${n}Select;`,\n ` readonly include?: ${n}Include;`,\n ` readonly omit?: ${n}OmitInput;`,\n ` readonly skipUpdatedAt?: boolean;`,\n ],\n }),\n );\n // EPIC 2 — conditional update. The shared WhereUniqueInput is deliberately\n // NOT widened: cursors and the native upsert have different contracts (a\n // cursor must name one row's position; ON CONFLICT cannot see a guard field).\n // update() alone preserves extra predicates — they compile into the UPDATE's\n // own WHERE, so the check and the write are ONE atomic statement.\n parts.push(\n `/** update()'s where: a concrete unique selector AND any additional predicates (optimistic-concurrency guards such as \\`{ id, version }\\`). */\\nexport type ${n}UpdateWhereInput = ${n}WhereUniqueInput & ${n}WhereInput;`,\n );\n parts.push(\n inputAlias({\n name: `${n}UpdateManyArgs`,\n lines: [\n ` readonly where?: ${n}WhereInput;`,\n ` readonly data: ${n}UpdateManyInput;`,\n ` readonly skipUpdatedAt?: boolean;`,\n ],\n }),\n );\n // EPIC 2 — the bulk update that reports WHICH rows changed. No `include`:\n // relations are refused explicitly rather than accepted and ignored.\n parts.push(\n inputAlias({\n name: `${n}UpdateManyAndReturnArgs`,\n lines: [\n ` readonly include?: never;`,\n ` readonly where?: ${n}WhereInput;`,\n ` readonly data: ${n}UpdateManyInput;`,\n ` readonly select?: ${n}Select;`,\n ` readonly omit?: ${n}OmitInput;`,\n ` readonly skipUpdatedAt?: boolean;`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}UpsertArgs`,\n lines: [\n ` readonly where: ${n}WhereUniqueInput;`,\n ` readonly create: ${n}CreateInput | ${n}UncheckedCreateInput;`,\n ` readonly update: ${n}UpdateInput | ${n}UncheckedUpdateInput;`,\n ` readonly onConflict?: { readonly constraint: string };`,\n ` readonly select?: ${n}Select;`,\n ` readonly include?: ${n}Include;`,\n ` readonly omit?: ${n}OmitInput;`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}DeleteArgs`,\n lines: [\n ` readonly where: ${n}WhereUniqueInput;`,\n ` readonly select?: ${n}Select;`,\n ` readonly include?: ${n}Include;`,\n ` readonly omit?: ${n}OmitInput;`,\n ],\n }),\n );\n parts.push(inputAlias({ name: `${n}DeleteManyArgs`, lines: [` readonly where?: ${n}WhereInput;`] }));\n parts.push(\n inputAlias({\n name: `${n}CountArgs`,\n // No `cursor`: the runtime's count/aggregate argument allowlists refuse\n // it (VIBE_VALIDATION), so the declaration must not promise it.\n lines: [\n ` readonly select?: ${n}CountAggregateInput;`,\n ` readonly where?: ${n}WhereInput;`,\n ` readonly orderBy?: ${orMany({ type: `${n}ScalarOrderByInput` })};`,\n ` readonly take?: number;`,\n ` readonly skip?: number;`,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}AggregateArgs`,\n lines: [\n ` readonly where?: ${n}WhereInput;`,\n ` readonly orderBy?: ${orMany({ type: `${n}ScalarOrderByInput` })};`,\n ` readonly take?: number;`,\n ` readonly skip?: number;`,\n ...aggregateOpProps,\n ],\n }),\n );\n parts.push(\n inputAlias({\n name: `${n}GroupByArgs`,\n lines: [\n ` readonly by: readonly ${n}ScalarFieldEnum[];`,\n ` readonly where?: ${n}WhereInput;`,\n ` readonly orderBy?: ${orMany({ type: `${n}ScalarOrderByInput` })};`,\n ` readonly having?: ${n}WhereInput;`,\n ` readonly take?: number;`,\n ` readonly skip?: number;`,\n ...aggregateOpProps,\n ],\n }),\n );\n\n // Result narrowing: one shallow conditional per key + mapped lookups.\n // `omit`/`include`/`_count` each resolve through their own single-conditional\n // helper and combine by intersection (`unknown` is the identity), so no\n // branch nests deeper than one conditional (constitution rule 2).\n // Conditional selections are CONSERVATIVE: a literal `true` keeps the field\n // required, a literal `false`/`undefined` drops it, and anything widened\n // (`boolean`, a variable flag) makes it OPTIONAL — the result type must not\n // promise a field the run-time flag can still switch off.\n const exactPart = (source: string): string => `${source}[K] extends false | undefined | Skip ? never : false extends ${source}[K] ? never : undefined extends ${source}[K] ? never : Skip extends ${source}[K] ? never : K`;\n const uncertainPart = (source: string): string =>\n `${source}[K] extends false | undefined | Skip ? never : false extends ${source}[K] ? K : undefined extends ${source}[K] ? K : Skip extends ${source}[K] ? K : never`;\n parts.push(\n `type ${n}OmitBase<A> = A extends { readonly omit: infer O extends object }\\n` +\n ` ? Omit<${n}, PossibleKeys<O> & keyof ${n}> & { [K in UncertainKeys<O> & keyof ${n}]?: ${n}[K] }\\n` +\n ` : \"omit\" extends keyof A ? Omit<${n}, PossibleKeys<Provided<A[\"omit\"]>> & keyof ${n}> & Partial<Pick<${n}, PossibleKeys<Provided<A[\"omit\"]>> & keyof ${n}>> : ${n};`,\n );\n if (hasCounts) {\n const listUnion = listRelations.map((relation) => tsString({ value: relation.name })).join(\" | \");\n const allCounts = listRelations\n .map((relation) => `${propKey({ name: relation.name })}: number`)\n .join(\"; \");\n parts.push(\n `type ${n}CountResult<C> = C extends { readonly select: infer CS extends object }\\n` +\n ` ? { [K in keyof CS & (${listUnion}) as ${exactPart(\"CS\")}]: number } &\\n` +\n ` { [K in keyof CS & (${listUnion}) as ${uncertainPart(\"CS\")}]?: number }\\n` +\n ` : C extends { readonly select: Skip } ? { ${allCounts} }\\n` +\n ` : \"select\" extends keyof C ? Partial<{ ${allCounts} }> : { ${allCounts} };`,\n );\n parts.push(\n `type ${n}CountPayload<S> = S extends { readonly _count: infer C extends true | object } ? { _count: ${n}CountResult<C> }\\n` +\n ` : S extends { readonly _count: false | undefined | Skip } ? unknown\\n` +\n ` : S extends { readonly _count?: infer C extends boolean | object | Skip } ? { _count?: ${n}CountResult<Provided<C>> } : unknown;`,\n );\n }\n if (hasRelations) {\n const relationCases = model.relations\n .map((relation) => {\n const nested = `${relation.target}GetPayload<A>`;\n const guard = `A extends object`;\n let expression: string;\n if (relation.isList) {\n expression = `${guard} ? ${nested}[] : ${relation.target}[]`;\n } else if (relation.isOptional) {\n expression = `(${guard} ? ${nested} : ${relation.target}) | null`;\n } else {\n expression = `${guard} ? ${nested} : ${relation.target}`;\n }\n return ` ${propKey({ name: relation.name })}: ${expression};`;\n })\n .join(\"\\n\");\n parts.push(`type ${n}RelationPayload<K extends keyof ${n}Relations, A> = {\\n${relationCases}\\n}[K];`);\n parts.push(\n `type ${n}IncludePayload<A> = A extends { readonly include: infer I extends object }\\n` +\n ` ? { [K in keyof I & keyof ${n}Relations as ${exactPart(\"I\")}]: ${n}RelationPayload<K, I[K]> } &\\n` +\n ` { [K in keyof I & keyof ${n}Relations as ${uncertainPart(\"I\")}]?: ${n}RelationPayload<K, I[K]> }${hasCounts ? ` &\\n ${n}CountPayload<I>` : \"\"}\\n` +\n ` : \"include\" extends keyof A ? Partial<${n}IncludePayload<{ include: Provided<A[\"include\"]> }>> : unknown;`,\n );\n parts.push(\n `export type ${n}GetPayload<A> = A extends { readonly select: infer S extends object }\\n` +\n ` ? { [K in keyof S & ${selectableEnum} as ${exactPart(\"S\")}]: ${n}[K & keyof ${n}] } &\\n` +\n ` { [K in keyof S & ${selectableEnum} as ${uncertainPart(\"S\")}]?: ${n}[K & keyof ${n}] } &\\n` +\n ` { [K in keyof S & keyof ${n}Relations as ${exactPart(\"S\")}]: ${n}RelationPayload<K, S[K]> } &\\n` +\n ` { [K in keyof S & keyof ${n}Relations as ${uncertainPart(\"S\")}]?: ${n}RelationPayload<K, S[K]> }${hasCounts ? ` &\\n ${n}CountPayload<S>` : \"\"}\\n` +\n ` : A extends { readonly select: Skip } ? ${n}OmitBase<A> & ${n}IncludePayload<A>\\n` +\n ` : \"select\" extends keyof A ? Partial<${n}>\\n` +\n ` : ${n}OmitBase<A> & ${n}IncludePayload<A>;`,\n );\n } else {\n parts.push(\n `export type ${n}GetPayload<A> = A extends { readonly select: infer S extends object }\\n` +\n ` ? { [K in keyof S & ${selectableEnum} as ${exactPart(\"S\")}]: ${n}[K & keyof ${n}] } &\\n` +\n ` { [K in keyof S & ${selectableEnum} as ${uncertainPart(\"S\")}]?: ${n}[K & keyof ${n}] }\\n` +\n ` : A extends { readonly select: Skip } ? ${n}OmitBase<A>\\n` +\n ` : \"select\" extends keyof A ? Partial<${n}> : ${n}OmitBase<A>;`,\n );\n }\n\n // All aggregate value types are resolved from the schema here, not inferred\n // from field kinds by the consumer. Only the caller's selected keys remain generic.\n const aggregateFields = (fields: readonly FieldView[], value: (field: FieldView) => string): string =>\n `{ ${fields.map((field) => `${propKey({ name: field.name })}: ${value(field)}`).join(\"; \")} }`;\n const countValues = aggregateFields(model.fields, () => \"number\").replace(\" }\", \"; _all: number }\");\n parts.push(`type ${n}AggregateValues = {\\n` +\n ` _count: ${countValues};\\n` +\n ` _avg: ${aggregateFields(numericFields, () => \"number | null\")};\\n` +\n ` _sum: ${aggregateFields(numericFields, (field) => `${n}[${tsString({ value: field.name })}] | null`)};\\n` +\n ` _min: ${aggregateFields(minmaxFields, (field) => `${n}[${tsString({ value: field.name })}] | null`)};\\n` +\n ` _max: ${aggregateFields(minmaxFields, (field) => `${n}[${tsString({ value: field.name })}] | null`)};\n};`);\n parts.push(`type ${n}AggregateSelection<V, S> = S extends true ? number : S extends object\\n` +\n ` ? { [K in keyof S & keyof V as ${exactPart(\"S\")}]: V[K] } &\\n` +\n ` { [K in keyof S & keyof V as ${uncertainPart(\"S\")}]?: V[K] } : never;`);\n parts.push(`type ${n}CountOutput<A> = A extends { readonly select: infer S extends object }\\n` +\n ` ? ${n}AggregateSelection<${n}AggregateValues[\"_count\"], S>\\n` +\n ` : \"select\" extends keyof A ? number | ${n}AggregateSelection<${n}AggregateValues[\"_count\"], Provided<A[\"select\"]>> : number;`);\n parts.push(`export type ${n}AggregateResult<A> =\\n` +\n ` { [K in keyof A & keyof ${n}AggregateValues as HasSelectedField<A[K]> extends true ? K : never]: ${n}AggregateSelection<${n}AggregateValues[K], A[K]> } &\\n` +\n ` { [K in keyof A & keyof ${n}AggregateValues as A[K] extends false | undefined | Skip ? never : HasSelectedField<A[K]> extends true ? never : K]?: ${n}AggregateSelection<${n}AggregateValues[K], Provided<A[K]>> };`);\n parts.push(\n `export type ${n}GroupByResult<A extends ${n}GroupByArgs> =\\n` +\n ` (number extends A[\"by\"][\"length\"] ? Partial<Pick<${n}, A[\"by\"][number]>> : Pick<${n}, A[\"by\"][number]>) & ${n}AggregateResult<A>;`,\n );\n\n // Delegate. A view carries the read half only: `migrate` never creates a\n // table for it, so a typed write would be a promise the system cannot keep.\n const readMethods: string[] = [\n ` findMany<A extends ${n}FindManyArgs = {}>(args?: A): VibeQueryPromise<${n}GetPayload<A>[]>;`,\n ` findFirst<A extends ${n}FindFirstArgs = {}>(args?: A): VibeQueryPromise<${n}GetPayload<A> | null>;`,\n ` findFirstOrThrow<A extends ${n}FindFirstArgs = {}>(args?: A): VibeQueryPromise<${n}GetPayload<A>>;`,\n ` findUnique<A extends ${n}FindUniqueArgs>(args: A): VibeQueryPromise<${n}GetPayload<A> | null>;`,\n ` findUniqueOrThrow<A extends ${n}FindUniqueArgs>(args: A): VibeQueryPromise<${n}GetPayload<A>>;`,\n ];\n const writeMethods: string[] = [\n ` create<A extends ${n}CreateOrSkipArgs>(args: A): VibeQueryPromise<${n}GetPayload<A> | null, \"write\">;`,\n ` create<A extends ${n}CreateArgs>(args: A): VibeQueryPromise<${n}GetPayload<A>, \"write\">;`,\n ` createMany(args: ${n}CreateManyArgs): VibeQueryPromise<BatchPayload, \"write\">;`,\n ` createManyAndReturn<A extends ${n}CreateManyAndReturnArgs>(args: A): VibeQueryPromise<${n}GetPayload<A>[], \"write\">;`,\n ` update<A extends ${n}UpdateArgs>(args: A): VibeQueryPromise<${n}GetPayload<A>, \"write\">;`,\n ` updateMany(args: ${n}UpdateManyArgs): VibeQueryPromise<BatchPayload, \"write\">;`,\n ` updateManyAndReturn<A extends ${n}UpdateManyAndReturnArgs>(args: A): VibeQueryPromise<${n}GetPayload<A>[], \"write\">;`,\n ` upsert<A extends ${n}UpsertArgs>(args: A): VibeQueryPromise<${n}GetPayload<A>, \"write\">;`,\n ` upsertMany(args: ${n}UpsertManyArgs): VibeQueryPromise<UpsertManyPayload, \"write\">;`,\n ` delete<A extends ${n}DeleteArgs>(args: A): VibeQueryPromise<${n}GetPayload<A>, \"write\">;`,\n ` deleteMany(args?: ${n}DeleteManyArgs): VibeQueryPromise<BatchPayload, \"write\">;`,\n ];\n const aggregateMethods: string[] = [\n ` count<A extends ${n}CountArgs = {}>(args?: A): VibeQueryPromise<${n}CountOutput<A>>;`,\n ` aggregate<A extends ${n}AggregateArgs>(args: A): VibeQueryPromise<${n}AggregateResult<A>>;`,\n ` groupBy<const A extends ${n}GroupByArgs>(args: A): VibeQueryPromise<${n}GroupByResult<A>[]>;`,\n ];\n const delegateMethods: string[] = model.isView\n ? [...readMethods, ...aggregateMethods]\n : [...readMethods, ...writeMethods, ...aggregateMethods];\n delegateMethods.push(...(params.extensionLines ?? []));\n parts.push(`export type ${n}Delegate = {\\n${delegateMethods.join(\"\\n\")}\\n};`);\n\n // The read-only delegate: the SAME read members, and no write member at all.\n // Built from the allowlist the runtime enforces (`READ_DELEGATE_METHODS`), not\n // by subtracting a list of writes — a method added later is absent from both\n // until someone classifies it.\n parts.push(\n `/** ${n}'s read surface on a \\`$readOnly()\\` client. Writes are not declared, and are refused at runtime with \\`VIBE_READ_ONLY\\`. */\\n` +\n `export type ${n}ReadOnlyDelegate = {\\n${[...readMethods, ...aggregateMethods, ...(params.readOnlyExtensionLines ?? [])].join(\"\\n\")}\\n};`,\n );\n\n return parts.join(\"\\n\\n\");\n}\n\n// ─── Field-masking views ($defineView) ──────────────────────────\n\n/**\n * The typed `$defineView` surface (board #11 — v1 `defineView` parity).\n * Budget shape (rule 2): every helper is one shallow conditional or one mapped\n * lookup; relation masking resolves ONE include level against the definition\n * (the runtime masks recursively — deeper levels are typed as their masked\n * target's scalars, matching v1's depth).\n */\nfunction emitViewTypesForModel(params: { model: ModelView; view: SchemaView }): string {\n const { model, view } = params;\n const n = model.name;\n const hasRelations = model.relations.length > 0;\n const parts: string[] = [];\n\n parts.push(\n objectAlias({\n name: `${n}ViewFields`,\n lines: model.fields.map((field) => ` readonly ${propKey({ name: field.name })}?: true;`),\n }),\n );\n parts.push(\n objectAlias({\n name: `${n}ViewSelect`,\n lines: model.fields.map((field) => ` readonly ${propKey({ name: field.name })}?: boolean;`),\n }),\n );\n parts.push(\n `type ${n}ViewScalars<F> = { [K in keyof F & ${n}ScalarFieldEnum]: ${n}[K & keyof ${n}] };`,\n );\n\n if (hasRelations) {\n parts.push(\n objectAlias({\n name: `${n}ViewInclude`,\n lines: model.relations.map(\n (relation) =>\n ` readonly ${propKey({ name: relation.name })}?: boolean | ${relation.target}ViewNestedArgs;`,\n ),\n }),\n );\n }\n parts.push(\n objectAlias({\n name: `${n}ViewNestedArgs`,\n lines: [\n ` readonly where?: ${n}WhereInput;`,\n ` readonly orderBy?: ${orMany({ type: `${n}ScalarOrderByInput` })};`,\n ` readonly take?: number;`,\n ` readonly skip?: number;`,\n ` readonly select?: ${n}ViewSelect;`,\n ` readonly reveal?: ${n}ViewSelect;`,\n ...(hasRelations ? [` readonly include?: ${n}ViewInclude;`] : []),\n ],\n }),\n );\n parts.push(\n objectAlias({\n name: `${n}ViewFindManyArgs`,\n lines: [\n ` readonly where?: ${n}WhereInput;`,\n ` readonly orderBy?: ${orMany({ type: `${n}OrderByInput` })};`,\n ` readonly select?: ${n}ViewSelect;`,\n ` readonly reveal?: ${n}ViewSelect;`,\n ...(hasRelations ? [` readonly include?: ${n}ViewInclude;`] : []),\n ` readonly cursor?: ${n}WhereUniqueInput;`,\n ` readonly take?: number;`,\n ` readonly skip?: number;`,\n ` readonly distinct?: ${orMany({ type: `${n}ScalarFieldEnum` })};`,\n ` readonly relationStrategy?: RelationStrategy;`,\n ],\n }),\n );\n parts.push(\n objectAlias({\n name: `${n}ViewFindUniqueArgs`,\n lines: [\n ` readonly where: ${n}WhereUniqueInput;`,\n ` readonly select?: ${n}ViewSelect;`,\n ` readonly reveal?: ${n}ViewSelect;`,\n ...(hasRelations ? [` readonly include?: ${n}ViewInclude;`] : []),\n ` readonly relationStrategy?: RelationStrategy;`,\n ],\n }),\n );\n\n // Result narrowing — same one-conditional-per-key discipline as GetPayload.\n const exactPart = (source: string): string => `${source}[K] extends false | undefined | Skip ? never : false extends ${source}[K] ? never : undefined extends ${source}[K] ? never : Skip extends ${source}[K] ? never : K`;\n const uncertainPart = (source: string): string => `${source}[K] extends false | undefined | Skip ? never : false extends ${source}[K] ? K : undefined extends ${source}[K] ? K : Skip extends ${source}[K] ? K : never`;\n parts.push(\n `type ${n}ViewSelectScalars<F, A> = A extends { readonly select: infer S extends object }\\n` +\n ` ? { [K in keyof S & keyof F & ${n}ScalarFieldEnum as ${exactPart(\"S\")}]: ${n}[K & keyof ${n}] } &\\n` +\n ` { [K in keyof S & keyof F & ${n}ScalarFieldEnum as ${uncertainPart(\"S\")}]?: ${n}[K & keyof ${n}] }\\n` +\n ` : \"select\" extends keyof A ? Partial<${n}ViewScalars<F>> : ${n}ViewScalars<F>;`,\n );\n parts.push(\n `type ${n}ViewReveal<A> = A extends { readonly reveal: infer R extends object }\\n` +\n ` ? { [K in keyof R & ${n}ScalarFieldEnum as ${exactPart(\"R\")}]: ${n}[K & keyof ${n}] } &\\n` +\n ` { [K in keyof R & ${n}ScalarFieldEnum as ${uncertainPart(\"R\")}]?: ${n}[K & keyof ${n}] }\\n` +\n ` : \"reveal\" extends keyof A ? Partial<${n}ViewReveal<{ reveal: NonNullable<A[\"reveal\"]> }>> : unknown;`,\n );\n if (hasRelations) {\n const relationCases = model.relations\n .map((relation) => {\n const target = relation.target;\n const targetClientKey = view.modelByName.get(target)?.clientName ?? target;\n const guard = `D extends { readonly ${propKey({ name: targetClientKey })}: infer RF extends object }`;\n const masked = `ViewRow<${target}ViewSelectScalars<RF, A> & ${target}ViewReveal<A>>`;\n const unmasked = `(A extends object ? ${target}GetPayload<A> : ${target})`;\n let expression: string;\n if (relation.isList) {\n expression = `${guard} ? ${masked}[] : ${unmasked}[]`;\n } else if (relation.isOptional) {\n expression = `(${guard} ? ${masked} : ${unmasked}) | null`;\n } else {\n expression = `${guard} ? ${masked} : ${unmasked}`;\n }\n return ` ${propKey({ name: relation.name })}: ${expression};`;\n })\n .join(\"\\n\");\n parts.push(`type ${n}ViewRelationResult<K extends keyof ${n}Relations, D, A> = {\\n${relationCases}\\n}[K];`);\n parts.push(\n `type ${n}ViewIncludeResult<A, D> = A extends { readonly include: infer I extends object }\\n` +\n ` ? { [K in keyof I & keyof ${n}Relations as ${exactPart(\"I\")}]: ${n}ViewRelationResult<K, D, I[K]> } &\\n` +\n ` { [K in keyof I & keyof ${n}Relations as ${uncertainPart(\"I\")}]?: ${n}ViewRelationResult<K, D, I[K]> }\\n` +\n ` : \"include\" extends keyof A ? Partial<${n}ViewIncludeResult<{ include: NonNullable<A[\"include\"]> }, D>> : unknown;`,\n );\n parts.push(\n `export type ${n}ViewResult<F, A, D> = ViewRow<${n}ViewSelectScalars<F, A> & ${n}ViewReveal<A> & ${n}ViewIncludeResult<A, D>>;`,\n );\n } else {\n parts.push(\n `export type ${n}ViewResult<F, A, D> = ViewRow<${n}ViewSelectScalars<F, A> & ${n}ViewReveal<A>>;`,\n );\n }\n\n parts.push(\n `export type ${n}ViewDelegate<F, D extends ViewDefinitionInput = ViewDefinitionInput> = {\\n` +\n ` findMany<A extends ${n}ViewFindManyArgs = {}>(args?: A): Promise<${n}ViewResult<F, A, D>[]>;\\n` +\n ` findFirst<A extends ${n}ViewFindManyArgs = {}>(args?: A): Promise<${n}ViewResult<F, A, D> | null>;\\n` +\n ` findFirstOrThrow<A extends ${n}ViewFindManyArgs = {}>(args?: A): Promise<${n}ViewResult<F, A, D>>;\\n` +\n ` findUnique<A extends ${n}ViewFindUniqueArgs>(args: A): Promise<${n}ViewResult<F, A, D> | null>;\\n` +\n ` findUniqueOrThrow<A extends ${n}ViewFindUniqueArgs>(args: A): Promise<${n}ViewResult<F, A, D>>;\\n` +\n ` count<A extends ${n}CountArgs = {}>(args?: A): Promise<${n}CountOutput<A>>;\\n` +\n ` aggregate<A extends ${n}AggregateArgs>(args: A): Promise<${n}AggregateResult<A>>;\\n` +\n ` groupBy<const A extends ${n}GroupByArgs>(args: A): Promise<${n}GroupByResult<A>[]>;\\n` +\n `};`,\n );\n\n return parts.join(\"\\n\\n\");\n}\n\nfunction emitViewSection(params: { view: SchemaView }): string[] {\n const { view } = params;\n const parts: string[] = [banner({ title: \"Field-masking views ($defineView)\" })];\n parts.push(\n `/**\\n` +\n ` * A masked row: definition fields are properties, JSON.stringify drops\\n` +\n ` * revealed fields (toJSON), $unsafe() returns everything as a plain object.\\n` +\n ` */\\n` +\n `export type ViewRow<T> = T & {\\n` +\n ` toJSON(): Partial<T>;\\n` +\n ` $unsafe(): Record<string, unknown>;\\n` +\n `};`,\n );\n parts.push(\n objectAlias({\n name: \"ViewDefinitionInput\",\n lines: view.models.map(\n (model) => ` readonly ${propKey({ name: model.clientName })}?: ${model.name}ViewFields;`,\n ),\n }),\n );\n parts.push(\n `type ViewDelegateMap<D extends ViewDefinitionInput> = {\\n${view.models\n .map(\n (model) =>\n ` ${propKey({ name: model.clientName })}: ${model.name}ViewDelegate<NonNullable<D[${tsString({ value: model.clientName })}]>, D>;`,\n )\n .join(\"\\n\")}\\n};`,\n );\n parts.push(\n `/** A read-only scoped client over the definition's models — what $defineView returns. */\\n` +\n `export type ViewClient<D extends ViewDefinitionInput> = {\\n` +\n ` readonly [K in keyof D & keyof ViewDelegateMap<D>]: ViewDelegateMap<D>[K];\\n` +\n `};`,\n );\n for (const model of view.models) {\n parts.push(emitViewTypesForModel({ model, view }));\n }\n return parts;\n}\n\n// ─── Native row-level security ─────────────────────────────────────\n\n/** Does this schema declare native row-level security? */\nfunction hasNativeRls(params: { view: SchemaView }): boolean {\n return params.view.schema.rls !== undefined;\n}\n\n/**\n * The context slot types. STRICTER than the ordinary input types on purpose:\n * an identity value is compared by the database against a physical column, so\n * a DateTime slot takes a `Date` (not an ISO string, not the database-clock\n * sentinel) and a BigInt slot takes a `bigint` (not a number). Widening here\n * would move a silent no-match into production.\n */\nconst RLS_CONTEXT_TYPES: Readonly<Record<RlsContextScalar, string>> = {\n String: \"string\",\n Boolean: \"boolean\",\n Int: \"number\",\n BigInt: \"bigint\",\n Float: \"number\",\n Decimal: \"string\",\n DateTime: \"Date\",\n};\n\n/**\n * `RlsContext` — the concrete identity context this schema declares. Every\n * slot is REQUIRED, including nullable ones: an explicit null is a value (it\n * matches no ownership equality), while a missing key is an unbound query.\n * Slots keep their declaration order, which is the order the runtime sets them\n * in and the order the policy predicate reads them in.\n */\nfunction emitRlsSection(params: { view: SchemaView }): string[] {\n const rls = params.view.schema.rls;\n if (rls === undefined) return [];\n const lines = Object.entries(rls.context).map(\n ([key, slot]) =>\n ` readonly ${propKey({ name: key })}: ${RLS_CONTEXT_TYPES[slot.type]}${slot.nullable ? \" | null\" : \"\"};`,\n );\n const doc = `/** The identity context every query on this schema must be bound to — all slots required, an explicit null included. */`;\n return [\n banner({ title: \"Native row-level security\" }),\n lines.length === 0\n ? `${doc}\\nexport type RlsContext = Record<string, never>;`\n : `${doc}\\nexport type RlsContext = {\\n${lines.join(\"\\n\")}\\n};`,\n ];\n}\n\n// ─── Client ──────────────────────────────────────────────────────\n\n// ─── Locking ──────────────────────────────────────────────────────\n\n/**\n * `RowLockRequest` — the `lock` argument, narrowed to what THIS database can\n * express. A strength or wait policy the dialect cannot render is not in the\n * union, so asking for it is a compile error rather than a runtime refusal.\n */\nfunction emitLockSection(params: { view: SchemaView }): string[] {\n const capabilities = capabilitiesOf(params);\n const example =\n capabilities.rowLockWaitPolicies.includes(\"skipLocked\")\n ? [\n ` * @example Claim one queued job without waiting for another worker's row`,\n ` * await db.$transaction(async (tx) => {`,\n ` * const [job] = await tx.job.findMany({`,\n ` * where: { status: \"queued\" },`,\n ` * take: 1,`,\n ` * lock: { strength: \"update\", wait: \"skipLocked\" },`,\n ` * });`,\n ` * if (job !== undefined) await tx.job.update({ where: { id: job.id }, data: { status: \"running\" } });`,\n ` * });`,\n ]\n : [\n ` * @example Read a row you are about to write`,\n ` * await db.$transaction(async (tx) => {`,\n ` * const account = await tx.account.findUnique({ where: { id }, lock: \"update\" });`,\n ` * await tx.account.update({ where: { id }, data: { balance: account.balance - amount } });`,\n ` * });`,\n ];\n const body =\n capabilities.rowLockStrengths.length === 0\n ? [\n `/**`,\n ` * A row-locking read. This database has NO locking-read clause, so the`,\n ` * historical \\`\"update\"\\` request emits no clause at all — a documented`,\n ` * no-op that costs nothing here, because its write transactions already`,\n ` * exclude each other. Every other strength and wait policy is refused`,\n ` * rather than silently downgraded, so they are absent from this type.`,\n ` *`,\n ` * Still REQUIRES a transaction: outside one the call is refused`,\n ` * (\\`VIBE_VALIDATION\\`), so code written here stays portable.`,\n ` *`,\n ...example,\n ` */`,\n `export type RowLockRequest = \"update\";`,\n ]\n : [\n `/**`,\n ` * A row-locking read (\\`SELECT … FOR UPDATE SKIP LOCKED\\`).`,\n ` *`,\n ` * REQUIRES a transaction — call it on the client \\`$transaction\\` hands its`,\n ` * callback. Outside one the lock would be released at statement end, so`,\n ` * the call is refused with \\`VIBE_VALIDATION\\` instead.`,\n ` *`,\n ` * \\`\"update\"\\` is the shorthand for \\`{ strength: \"update\", wait: \"wait\" }\\`.`,\n ` * \\`wait\\` is ONE policy, never several flags: \\`\"wait\"\\` blocks until the`,\n ` * holder finishes (the default), \\`\"nowait\"\\` fails immediately with`,\n ` * \\`VIBE_LOCK_NOT_AVAILABLE\\`, and \\`\"skipLocked\"\\` leaves locked rows out of`,\n ` * the result. Refused with \\`include\\`/relation \\`select\\`, with \\`distinct\\`,`,\n ` * and on views.`,\n ` *`,\n ...example,\n ` */`,\n `export type RowLockRequest =`,\n ` | \"update\"`,\n ` | {`,\n ` readonly strength: ${literalUnion({ members: capabilities.rowLockStrengths })};`,\n ` readonly wait?: ${literalUnion({ members: capabilities.rowLockWaitPolicies })};`,\n ` };`,\n ];\n return [banner({ title: \"Row locks\" }), body.join(\"\\n\")];\n}\n\n/** The `lock` member, with the doc a caller reads at the call site. */\nfunction lockArgumentLines(): string {\n return [\n ` /** Row-locking read — see {@link RowLockRequest}. Only inside \\`$transaction\\`. */`,\n ` readonly lock?: RowLockRequest;`,\n ].join(\"\\n\");\n}\n\n/**\n * The advisory-lock methods, or nothing on a dialect without them. Absence IS\n * the refusal: a MySQL or sqlite client cannot call a lock this ORM would have\n * to fake (mysql's `GET_LOCK` is session-scoped and survives a rollback).\n */\nfunction advisoryLockLines(params: { view: SchemaView; selfLabel: string }): string {\n if (!capabilitiesOf(params).advisoryLocks) return \"\";\n return (\n ` /**\\n` +\n ` * Lock an application-defined resource for the rest of the transaction —\\n` +\n ` * including one that has no row yet. BLOCKS until the lock is held.\\n` +\n ` *\\n` +\n ` * Released by commit and by rollback; there is no unlock call, so nothing\\n` +\n ` * can leak onto a pooled connection. Only inside \\`$transaction\\` (outside\\n` +\n ` * one the lock would be gone before the next statement).\\n` +\n ` *\\n` +\n ` * @example Serialize an import of a supplier's price list\\n` +\n ` * await ${params.selfLabel}.$transaction(async (tx) => {\\n` +\n ` * await tx.$advisoryLock({ classId: 1, objectId: supplierId });\\n` +\n ` * await rebuildPrices(tx);\\n` +\n ` * });\\n` +\n ` */\\n` +\n ` readonly $advisoryLock: (options: AdvisoryLockOptions) => Promise<void>;\\n` +\n ` /** The same lock WITHOUT waiting: \\`true\\` when acquired, \\`false\\` when someone else holds it. The transaction stays usable either way. */\\n` +\n ` readonly $tryAdvisoryLock: (options: AdvisoryLockOptions) => Promise<boolean>;\\n`\n );\n}\n\n// ─── Client ────────────────────────────────────────────────────\n\n/**\n * Delegate properties + `$models` + `$on` — the block every client surface\n * opens with. `delegateSuffix` picks the full delegate or the read-only one;\n * both are pre-resolved declarations, so naming one costs nothing extra.\n */\nfunction delegateSurfaceLines(params: {\n view: SchemaView;\n delegateSuffix: \"Delegate\" | \"ReadOnlyDelegate\";\n}): string {\n const { view, delegateSuffix } = params;\n const typeOf = (model: { readonly name: string }): string => `${model.name}${delegateSuffix}`;\n const delegateProps = view.models.map(\n (model) => ` readonly ${propKey({ name: model.clientName })}: ${typeOf(model)};`,\n );\n const modelsProps = view.models.flatMap((model) => {\n const byClientName = ` readonly ${propKey({ name: model.clientName })}: ${typeOf(model)};`;\n return model.name === model.clientName\n ? [byClientName]\n : [byClientName, ` readonly ${propKey({ name: model.name })}: ${typeOf(model)};`];\n });\n return (\n `${delegateProps.join(\"\\n\")}\\n` +\n ` /** Delegates keyed by BOTH camelCase client name and model name — the same objects as the top-level properties (dynamic access). */\\n` +\n ` readonly $models: {\\n${modelsProps.join(\"\\n\")}\\n };\\n` +\n ` /** Subscribe to client events (\"query\" fires after every statement, with the same payload as onQuery — both fire). Returns an unsubscribe function. */\\n` +\n ` readonly $on: (event: \"query\", listener: (event: QueryEvent) => void) => () => void;\\n`\n );\n}\n\n/**\n * `$transaction`, self-typed to the handle its callback receives. That callback\n * type is the point of the split: a helper that needs a transaction takes\n * `VibeTransactionClientInstance` and no longer accepts a root client.\n */\nfunction transactionLines(params: { transactionType: string; reads: boolean }): string {\n const { transactionType, reads } = params;\n const doc = reads\n ? ` /** ONE transaction of READS — a consistent snapshot. The callback's handle is read-only too, and the array form takes read operations only. */`\n : ` /** ONE transaction. Callback form: everything on \\`tx\\` rides the same BEGIN/COMMIT; a throw rolls back. Array form (Prisma parity): UN-AWAITED delegate calls run sequentially in one transaction, results returned positionally. */`;\n return (\n `${doc}\\n` +\n ` readonly $transaction: {\\n` +\n ` <T>(fn: (tx: ${transactionType}) => Promise<T>, options?: TransactionOptions): Promise<T>;\\n` +\n ` <T extends readonly VibeQueryPromise<unknown, ${reads ? '\"read\"' : '\"read\" | \"write\"'}>[]>(operations: readonly [...T], options?: TransactionOptions): Promise<{ -readonly [K in keyof T]: Awaited<T[K]> }>;\\n` +\n ` };\\n`\n );\n}\n\n/** The four raw-SQL doors. Absent from every read-only surface. */\nconst RAW_SURFACE_LINES: string =\n ` readonly $querySql: <T>(params: { readonly query: SqlFragment; readonly decoder: ResultDecoder<T> }) => Promise<T[]>;\\n` +\n ` readonly $executeSql: (params: { readonly query: SqlFragment }) => Promise<number>;\\n` +\n ` readonly $queryRaw: <T = Record<string, unknown>>(strings: TemplateStringsArray, ...values: unknown[]) => Promise<T[]>;\\n` +\n ` readonly $executeRaw: (strings: TemplateStringsArray, ...values: unknown[]) => Promise<number>;\\n` +\n ` readonly $queryRawUnsafe: <T = Record<string, unknown>>(text: string, ...values: unknown[]) => Promise<T[]>;\\n` +\n ` readonly $executeRawUnsafe: (text: string, ...values: unknown[]) => Promise<number>;\\n`;\n\n/** Connection lifecycle — never on a transaction handle: the transaction owns the connection. */\nconst CONNECTION_SURFACE_LINES: string =\n ` readonly $connect: () => Promise<void>;\\n` + ` readonly $disconnect: () => Promise<void>;\\n`;\n\nconst DEFINE_VIEW_LINE: string =\n ` /** Field-masking views (v1 defineView parity): a read-only masked projection of models. */\\n` +\n ` readonly $defineView: <D extends ViewDefinitionInput>(options: { readonly name: string; readonly definition: D }) => ViewClient<D>;\\n`;\n\n/** The `$readOnly` member, on every surface that can query. */\nconst READ_ONLY_LINE: string =\n ` /** A read-only handle over this one: reads pass through, and every write, raw-SQL and control method is refused with \\`VIBE_READ_ONLY\\`. Closed under composition — transactions, views, scoped and policy handles built from it stay read-only. */\\n` +\n ` readonly $readOnly: () => ReadOnlyClientInstance;\\n`;\n\n/**\n * The full query surface. `inTransaction` is what splits the root from the\n * handle `$transaction` gives its callback: a transaction handle carries the\n * advisory locks (which REQUIRE a transaction) and not the connection\n * lifecycle (which the open transaction owns).\n *\n * The split is a compile-time layer over runtime guards that stay the\n * authority. A type cannot prove LIFETIME: a handle captured and used after\n * commit is refused at runtime, never by this declaration.\n */\nfunction instanceSurfaceLines(params: {\n view: SchemaView;\n transactionType: string;\n inTransaction: boolean;\n selfLabel: string;\n}): string {\n const { view, transactionType, inTransaction, selfLabel } = params;\n return (\n (inTransaction ? ` readonly [vibeTransaction]: true;\\n` : \"\") +\n delegateSurfaceLines({ view, delegateSuffix: \"Delegate\" }) +\n transactionLines({ transactionType, reads: false }) +\n RAW_SURFACE_LINES +\n (inTransaction ? advisoryLockLines({ view, selfLabel }) : \"\") +\n (inTransaction ? \"\" : CONNECTION_SURFACE_LINES) +\n DEFINE_VIEW_LINE\n );\n}\n\n/**\n * Operation-telemetry declarations, emitted INTO the client rather than imported\n * from `@vibeorm/runtime`: the generated surface stays self-contained, so a\n * consumer never depends on which runtime symbols happen to be re-exported.\n */\nfunction telemetryDeclarations(): string {\n return [\n `/** One SQL execution inside an operation. Parameter values are redacted; \\`sql\\` and \\`parameters\\` appear only with the matching capture option. */`,\n `export type VibeTelemetryStatementEvent = {`,\n ` readonly operationId: string;`,\n ` readonly index: number;`,\n ` readonly kind: \"rows\" | \"affected\" | \"raw\" | \"extension\";`,\n ` readonly model: string | null;`,\n ` readonly method: string;`,\n ` readonly dialect: string;`,\n ` readonly provider: string;`,\n ` /** Stable normalized grouping key — bounded and literal-free, safe as a metric label. */`,\n ` readonly fingerprint: string;`,\n ` readonly outcome: \"success\" | \"failure\";`,\n ` /** Adapter-call elapsed time: networking and possibly pool wait included — not pure server execution time. */`,\n ` readonly durationMs: number;`,\n ` readonly parameterCount: number;`,\n ` readonly inTransaction: boolean;`,\n ` readonly rowCount?: number;`,\n ` readonly errorCode?: string;`,\n ` readonly slow?: boolean;`,\n ` readonly sql?: string;`,\n ` readonly parameters?: readonly unknown[];`,\n `};`,\n ``,\n `/** One public ORM call, start to terminal outcome. Emitted exactly once. Unknown values are ABSENT, never zero. */`,\n `export type VibeTelemetryOperationEvent = {`,\n ` readonly operationId: string;`,\n ` readonly parentOperationId?: string;`,\n ` readonly context?: unknown;`,\n ` readonly kind: \"model\" | \"raw\" | \"transaction\" | \"extension\";`,\n ` readonly model: string | null;`,\n ` readonly method: string;`,\n ` readonly dialect: string;`,\n ` readonly provider: string;`,\n ` readonly outcome: \"success\" | \"failure\";`,\n ` readonly stage: \"refused\" | \"validation\" | \"statement\" | \"decode\" | \"transaction\" | \"completed\" | \"unknown\";`,\n ` readonly dispatched: boolean;`,\n ` readonly startedAt?: number;`,\n ` readonly durationMs?: number;`,\n ` /** Creation to dispatch — labelled separately, never folded into durationMs. */`,\n ` readonly queueWaitMs?: number;`,\n ` readonly statementCount: number;`,\n ` readonly statementDurationMs?: number;`,\n ` readonly rowCount?: number;`,\n ` readonly errorCode?: string;`,\n ` readonly detail?: { readonly renderMs?: number; readonly adapterMs?: number; readonly processingMs?: number };`,\n ` readonly statements: readonly VibeTelemetryStatementEvent[];`,\n ` readonly droppedStatements?: number;`,\n ` readonly slow?: boolean;`,\n ` readonly sampled: true;`,\n `};`,\n ``,\n `/** Where events go. A throw from any callback is contained: it can never change a database outcome. */`,\n `export type VibeTelemetryExporter = {`,\n ` readonly onOperation?: (event: VibeTelemetryOperationEvent) => void;`,\n ` readonly onStatement?: (event: VibeTelemetryStatementEvent) => void;`,\n ` readonly onDrop?: (event: { readonly reason: \"buffer_full\" | \"statement_limit\"; readonly count: number }) => void;`,\n ` readonly flush?: () => void | Promise<void>;`,\n ` /** NEVER called by the client — \\`$disconnect()\\` flushes only, because the provider is yours. */`,\n ` readonly shutdown?: () => void | Promise<void>;`,\n `};`,\n ``,\n `/** Complete counters (spans may be sampled, these are not) and explicit lifecycle. */`,\n `export type VibeTelemetryHandle = {`,\n ` readonly metrics: () => {`,\n ` readonly countsRepresent: \"all\";`,\n ` readonly sampleRate: number;`,\n ` readonly sampledOperations: number;`,\n ` readonly operations: { readonly total: number; readonly failed: number; readonly refused: number };`,\n ` readonly statements: { readonly total: number; readonly failed: number };`,\n ` readonly rows: { readonly known: number; readonly total: number };`,\n ` readonly operationLatencyMs: { readonly bounds: readonly number[]; readonly counts: readonly number[]; readonly sum: number; readonly count: number };`,\n ` readonly statementLatencyMs: { readonly bounds: readonly number[]; readonly counts: readonly number[]; readonly sum: number; readonly count: number };`,\n ` readonly dropped: { readonly operations: number; readonly statements: number };`,\n ` };`,\n ` readonly flush: () => Promise<void>;`,\n ` readonly shutdown: () => Promise<void>;`,\n `};`,\n ``,\n `/** Opt-in operation telemetry. Defaults are conservative: no SQL text, no parameter values, no sampling. */`,\n `export type VibeTelemetryOptions = {`,\n ` readonly exporter: VibeTelemetryExporter;`,\n ` /** Attach rendered SQL text (default false — raw text can embed secrets). */`,\n ` readonly captureSql?: boolean;`,\n ` /** Attach parameter VALUES (default false — only the count is reported). */`,\n ` readonly captureParameterValues?: boolean;`,\n ` /** Split render / adapter / processing time on the operation event (default false). */`,\n ` readonly detailedTimings?: boolean;`,\n ` /** Span sampling probability, 0..1 (default 1). Counters still count every execution. */`,\n ` readonly sampleRate?: number;`,\n ` readonly sampler?: (input: { readonly kind: \"model\" | \"raw\" | \"transaction\" | \"extension\"; readonly model: string | null; readonly method: string; readonly context?: unknown }) => boolean;`,\n ` /** Read your current parent context SYNCHRONOUSLY at call time, so an application span survives the async boundary. */`,\n ` readonly context?: () => unknown;`,\n ` readonly delivery?: \"immediate\" | \"buffered\";`,\n ` readonly maxBufferedOperations?: number;`,\n ` readonly maxStatementsPerOperation?: number;`,\n ` readonly slowStatementMs?: number;`,\n ` readonly slowOperationMs?: number;`,\n ` readonly onExporterError?: (params: { readonly error: unknown; readonly phase: \"operation\" | \"statement\" | \"drop\" | \"flush\" | \"shutdown\" | \"sampler\" | \"context\" }) => void;`,\n ` /** Called once while the client is built, with the handle that owns metrics and lifecycle. */`,\n ` readonly onReady?: (handle: VibeTelemetryHandle) => void;`,\n `};`,\n ].join(\"\\n\");\n}\n\nfunction emitClient(params: { view: SchemaView; baked: BakedExtensions; hasComputed: boolean }): string {\n const { view, baked, hasComputed } = params;\n const nativeRls = hasNativeRls({ view });\n const parts: string[] = [banner({ title: \"Client\" })];\n parts.push(telemetryDeclarations());\n parts.push(\n objectAlias({\n name: \"VibeClientOptions\",\n lines: [\n ` readonly adapter: DatabaseAdapter;`,\n ` /** Strict argument validation defaults to true; false restores legacy omission of undefined values. */`,\n ` readonly strictArguments?: boolean;`,\n ` readonly onQuery?: (event: QueryEvent) => void;`,\n ` readonly relationStrategy?: RelationStrategy;`,\n ` /** Opt-in concurrent relation loading: how many of ONE query's relation statements (siblings, \\`_count\\` entries, key chunks) may be in flight at once. Default 1; ignored inside \\`$transaction\\`. */`,\n ` readonly relationLoading?: { readonly concurrency?: number };`,\n ` /** Append the primary key to ORDER BY when a find has no explicit orderBy (default false) — deterministic row order. */`,\n ` readonly defaultOrderByPk?: boolean;`,\n ` /** Append the primary key as a tie-breaker to \\`distinct\\` ordering (default true) — pins WHICH row represents each distinct key. */`,\n ` readonly distinctOrderByPk?: boolean;`,\n ` /** Opt-in write-boundary validators, per model × field: \\`{ User: { email: zodSchema } }\\`. Any Standard Schema validator (zod, valibot, arktype) works; they run on every write path before encoding. */`,\n ` readonly validate?: WriteValidators;`,\n ` /** Opt-in operation telemetry: one event per public ORM call, with the statements it ran. Parameter values are redacted by default and the exporter can never change a database outcome. */`,\n ` readonly telemetry?: VibeTelemetryOptions;`,\n ` /** Statement diagnostics: every statement over \\`slowerThanMs\\` is reported with its duration and, with \\`explain\\`, an automatic EXPLAIN summary on PostgreSQL/PGlite (\\`\"analyze\"\\` re-executes read statements). \\`VIBEORM_DIAGNOSTICS=analyze:5\\` switches it on for a run; local runs only. */`,\n ` readonly diagnostics?: StatementDiagnosticsOptions;`,\n ...(baked.empty\n ? []\n : [\n ` /** The live extension instances — verified against the baked manifest. */`,\n ` readonly extensions?: readonly VibeExtension[];`,\n ]),\n ...(hasComputed\n ? [\n ` /** The live computed-field config — verified against the baked manifest (VIBE_STALE_CLIENT). */`,\n ` readonly computed: ComputedConfig;`,\n ]\n : []),\n ...(nativeRls\n ? [\n ` /** Native row-level security: the non-bypassing database role the runtime binds each transaction to (required on PGlite; server connections log in as it). */`,\n ` readonly nativeRls?: { readonly runtimeRole?: string };`,\n ]\n : []),\n ],\n }),\n );\n const clientExtensionLines = baked.clientDts.length === 0 ? \"\" : `${baked.clientDts.join(\"\\n\")}\\n`;\n\n if (nativeRls) {\n // Native RLS: the ROOT cannot reach a row. Every query surface — delegates,\n // $models, raw SQL, transactions, views and extension mounts — lives on the\n // handle returned by $withContext, so \"query without an identity\" is a\n // compile error rather than a runtime check. The bound handle has no\n // $withContext of its own: identity is bound once, from the root.\n parts.push(\n `export type BoundVibeClientInstance = ClientContext<\"restricted\"> & {\\n` +\n instanceSurfaceLines({\n view,\n transactionType: \"BoundVibeTransactionClientInstance\",\n inTransaction: false,\n selfLabel: \"db\",\n }) +\n READ_ONLY_LINE +\n clientExtensionLines +\n `};`,\n );\n parts.push(\n `/** The bound handle inside \\`$transaction\\`: same identity, plus the locks that require a transaction, minus the connection lifecycle the transaction owns. */\\n` +\n `export type BoundVibeTransactionClientInstance = ClientContext<\"restricted\"> & {\\n` +\n instanceSurfaceLines({\n view,\n transactionType: \"BoundVibeTransactionClientInstance\",\n inTransaction: true,\n selfLabel: \"tx\",\n }) +\n READ_ONLY_LINE +\n clientExtensionLines +\n ` // Deliberately ABSENT: $connect / $disconnect (the open transaction owns the connection) and $withContext (identity is bound once, from the root).\\n` +\n `};`,\n );\n parts.push(\n `export type VibeClientInstance = ClientContext<\"restricted\"> & {\\n` +\n ` /** Bind the request's identity context — ALL of it, every declared slot — and get the client that can actually query. */\\n` +\n ` readonly $withContext: (context: RlsContext) => BoundVibeClientInstance;\\n` +\n ` /** Subscribe to client events (\"query\" fires after every statement, with the same payload as onQuery — both fire). Returns an unsubscribe function. */\\n` +\n ` readonly $on: (event: \"query\", listener: (event: QueryEvent) => void) => () => void;\\n` +\n ` readonly $connect: () => Promise<void>;\\n` +\n ` readonly $disconnect: () => Promise<void>;\\n` +\n ` // Deliberately ABSENT: model delegates, $models, $transaction, $queryRaw / $executeRaw / $queryRawUnsafe / $executeRawUnsafe, $advisoryLock / $tryAdvisoryLock, $defineView, $readOnly and every extension mount — an unbound client has no identity, so it cannot read or write a row. Bind one with $withContext.\\n` +\n `};`,\n );\n } else {\n parts.push(\n `export type VibeClientInstance = ClientContext<\"root\"> & {\\n` +\n instanceSurfaceLines({\n view,\n transactionType: \"VibeTransactionClientInstance\",\n inTransaction: false,\n selfLabel: \"db\",\n }) +\n policyClientLines({ view, selfType: \"VibeClientInstance\" }) +\n scopedClientLines({ view, scopedType: \"ScopedClientInstance\" }) +\n READ_ONLY_LINE +\n clientExtensionLines +\n `};`,\n );\n parts.push(\n `/** The handle \\`$transaction\\` gives its callback. A helper that REQUIRES a transaction takes this type, and an ordinary client no longer satisfies it. */\\n` +\n `export type VibeTransactionClientInstance = ClientContext<\"transaction\"> & {\\n` +\n instanceSurfaceLines({\n view,\n transactionType: \"VibeTransactionClientInstance\",\n inTransaction: true,\n selfLabel: \"tx\",\n }) +\n policyClientLines({ view, selfType: \"VibeTransactionClientInstance\" }) +\n scopedClientLines({ view, scopedType: \"ScopedTransactionClientInstance\" }) +\n READ_ONLY_LINE +\n clientExtensionLines +\n ` // Deliberately ABSENT: $connect / $disconnect — the open transaction owns the connection, and both are refused at runtime here too.\\n` +\n `};`,\n );\n }\n parts.push(`/** Build a typed client over a database adapter. */\\nexport declare function VibeClient(options: VibeClientOptions): VibeClientInstance;`);\n parts.push(\n `/** The normalized Schema IR this client was generated from (plain data). */\\nexport declare const schema: SchemaIR;`,\n );\n return parts.join(\"\\n\\n\");\n}\n\n// ─── Tenant scoping ($scoped) ─────────────────────────────\n\n/** Fields eligible as a tenant column: non-list String / Int / BigInt. */\nfunction scopedColumnCandidates(params: { model: ModelView }): readonly string[] {\n return params.model.fields\n .filter((field) => !field.isList && (field.scalar === \"String\" || field.scalar === \"Int\" || field.scalar === \"BigInt\"))\n .map((field) => field.name);\n}\n\n/**\n * `ScopedNestedMode` / `ScopedModelsConfig` / `ScopedClientInstance` — the\n * generated `$scoped` surface. Omitted entirely when the schema declares\n * @@policy: the two scoping layers do not combine, and the runtime refuses\n * the call — the type's absence makes that a compile-time fact.\n *\n * The models map is TOTAL by construction: every model is a required key, so\n * adding a model to the schema breaks `$scoped` callers loudly until they\n * classify it (deny-by-default applied to configuration).\n */\nfunction emitScopedSection(params: { view: SchemaView }): string[] {\n const { view } = params;\n // Native RLS does not combine with either rewriting layer (contract rule 2):\n // the runtime refuses the call, and the type's absence says so at compile time.\n if (hasNativeRls({ view })) return [];\n if (view.models.some((model) => model.policy !== undefined)) return [];\n\n const entries = view.models.map((model) => {\n const arms: string[] = [`\"none\"`];\n const columns = scopedColumnCandidates({ model });\n if (columns.length > 0) {\n const union = columns.map((name) => `\"${name}\"`).join(\" | \");\n arms.push(`{ readonly column: ${union}; readonly nested?: ScopedNestedMode }`);\n }\n const throughs = model.relations.filter((relation) => !relation.isList).map((relation) => relation.name);\n if (throughs.length > 0) {\n const union = throughs.map((name) => `\"${name}\"`).join(\" | \");\n arms.push(`{ readonly through: ${union}; readonly nested?: ScopedNestedMode }`);\n }\n return ` readonly ${propKey({ name: model.name })}: ${arms.join(\" | \")};`;\n });\n\n // EPIC 2: `updateManyAndReturn` IS routed by a scoped handle — `rewriteScopedCall`\n // merges the tenant predicate into its filter and masks the returned rows'\n // projection, and `scopedDelegate` lists it — so a scoped delegate keeps the\n // base delegate's EXACT type. `scoped.type-test.ts` pins that equality.\n const scopedDelegateType = (model: { readonly name: string }): string => `${model.name}Delegate`;\n const delegateProps = view.models.map(\n (model) => ` readonly ${propKey({ name: model.clientName })}: ${scopedDelegateType(model)};`,\n );\n const modelsProps = view.models.flatMap((model) => {\n const byClientName = ` readonly ${propKey({ name: model.clientName })}: ${scopedDelegateType(model)};`;\n return model.name === model.clientName\n ? [byClientName]\n : [byClientName, ` readonly ${propKey({ name: model.name })}: ${scopedDelegateType(model)};`];\n });\n\n const scopedSurface = (params2: { transactionType: string; inTransaction: boolean }): string =>\n (params2.inTransaction ? ` readonly [vibeTransaction]: true;\\n` : \"\") +\n `${delegateProps.join(\"\\n\")}\\n` +\n ` /** Delegates keyed by BOTH camelCase client name and model name — the same objects as the top-level properties (dynamic access). */\\n` +\n ` readonly $models: {\\n${modelsProps.join(\"\\n\")}\\n };\\n` +\n ` /** Subscribe to client events — shared with the base client. */\\n` +\n ` readonly $on: (event: \"query\", listener: (event: QueryEvent) => void) => () => void;\\n` +\n ` /** ONE transaction; the callback receives a handle that INHERITS the scope. The array form takes un-awaited scoped delegate calls. */\\n` +\n ` readonly $transaction: {\\n` +\n ` <T>(fn: (tx: ${params2.transactionType}) => Promise<T>, options?: TransactionOptions): Promise<T>;\\n` +\n ` <T extends readonly VibeQueryPromise<unknown, \"read\" | \"write\">[]>(operations: readonly [...T], options?: TransactionOptions): Promise<{ -readonly [K in keyof T]: Awaited<T[K]> }>;\\n` +\n ` };\\n` +\n (params2.inTransaction ? advisoryLockLines({ view, selfLabel: \"tx\" }) : CONNECTION_SURFACE_LINES) +\n ` /** Field-masking views compose over the scoped handle (columns × rows). */\\n` +\n ` readonly $defineView: <D extends ViewDefinitionInput>(options: { readonly name: string; readonly definition: D }) => ViewClient<D>;\\n` +\n READ_ONLY_LINE;\n\n return [\n banner({ title: \"Tenant scoping ($scoped)\" }),\n `/** What a scoped handle does when this model appears INSIDE another model's nested write: \"verify\" (default) rewrites reference verbs into tenant-verified lookups; \"refuse\" rejects them. */\\nexport type ScopedNestedMode = \"verify\" | \"refuse\";`,\n `/** Per-model tenancy classification — TOTAL: every model must be named (\"none\" = global, passes through untouched). */\\nexport type ScopedModelsConfig = {\\n${entries.join(\"\\n\")}\\n};`,\n `export type ScopedClientInstance = {\\n` +\n scopedSurface({ transactionType: \"ScopedTransactionClientInstance\", inTransaction: false }) +\n ` // Deliberately ABSENT: $queryRaw / $executeRaw / $queryRawUnsafe / $executeRawUnsafe (raw SQL cannot be tenant-verified — use the base client) and $scoped (scope once, from the base client).\\n` +\n `};`,\n `/** The scoped handle inside \\`$transaction\\`: same scope, plus the locks that require a transaction. */\\n` +\n `export type ScopedTransactionClientInstance = {\\n` +\n scopedSurface({ transactionType: \"ScopedTransactionClientInstance\", inTransaction: true }) +\n ` // Deliberately ABSENT: the raw-SQL doors, $scoped, and $connect / $disconnect (the open transaction owns the connection).\\n` +\n `};`,\n ];\n}\n\n/** The `$scoped` client property — omitted when the schema declares @@policy. */\nfunction scopedClientLines(params: { view: SchemaView; scopedType: string }): string {\n if (hasNativeRls(params)) return \"\";\n if (params.view.models.some((model) => model.policy !== undefined)) return \"\";\n return (\n ` /** Tenant scoping: a total per-model tenancy map + a scope value → a NEW handle whose every call is confined to that tenant. scope: null builds the handle but refuses calls on scoped models. */\\n` +\n ` readonly $scoped: (config: { readonly scope: string | number | bigint | null; readonly models: ScopedModelsConfig }) => ${params.scopedType};\\n`\n );\n}\n\n/** `$withPolicy`/`$bypassPolicy` — emitted only when the schema declares @@policy. */\nfunction policyClientLines(params: { view: SchemaView; selfType: string }): string {\n const policied = params.view.models.filter((model) => model.policy !== undefined);\n if (policied.length === 0) return \"\";\n // Policy fields are non-list scalars (schema validation); the context value\n // types after the wire scalar — anything else degrades to string.\n const CONTEXT_SCALAR_TYPES: Record<string, string> = { String: \"string\", Int: \"number\", BigInt: \"bigint\" };\n const contextKeys = new Map<string, string>();\n for (const model of policied) {\n const policy = model.policy as NonNullable<typeof model.policy>;\n const field = model.fields.find((entry) => entry.name === policy.field);\n contextKeys.set(\n policy.context,\n field?.scalar == null ? \"string\" : (CONTEXT_SCALAR_TYPES[field.scalar] ?? \"string\"),\n );\n }\n const contextType = `{ ${[...contextKeys.entries()].map(([key, type]) => `readonly ${propKey({ name: key })}: ${type};`).join(\" \")} }`;\n return (\n ` /** Row scoping (@@policy): bind a per-request context; policied models fail closed without one. */\\n` +\n ` readonly $withPolicy: (context: ${contextType}) => ${params.selfType};\\n` +\n ` /** Deliberate, greppable full-access escape from policy scoping. It escapes the ROW policy, never a read-only restriction. */\\n` +\n ` readonly $bypassPolicy: () => ${params.selfType};\\n`\n );\n}\n\n// ─── Read-only clients ($readOnly) ───────────────────────────\n\n/**\n * `ReadOnlyClientInstance` — the surface behind `$readOnly()`. Declared from\n * the same allowlist the runtime enforces: read delegates, `$on`,\n * `$transaction`, `$defineView`, and the scoping handles, all of which return\n * this type again. Every write method, every raw-SQL door, the connection\n * lifecycle, the advisory locks and any unclassified extension surface are\n * ABSENT here and refused at runtime with `VIBE_READ_ONLY`.\n */\nfunction emitReadOnlySection(params: { view: SchemaView; baked: BakedExtensions }): string[] {\n const { view, baked } = params;\n const extensionLines =\n baked.readOnlyClientDts.length === 0 ? \"\" : `${baked.readOnlyClientDts.join(\"\\n\")}\\n`;\n return [\n banner({ title: \"Read-only clients ($readOnly)\" }),\n `/**\\n` +\n ` * A read-only handle. Application-level, not a database privilege: it refuses\\n` +\n ` * the calls VibeORM would issue, and cannot stop another connection or a role\\n` +\n ` * with write rights — use a read-only database role or transaction when the\\n` +\n ` * database itself must enforce it.\\n` +\n ` *\\n` +\n ` * @example Hand a query resolver something that cannot write\\n` +\n ` * const reader = db.$readOnly();\\n` +\n ` * await reader.user.findMany(); // fine\\n` +\n ` * await reader.user.upsertMany({ … }); // VIBE_READ_ONLY, and a compile error\\n` +\n ` */\\n` +\n `export type ReadOnlyClientInstance = ClientContext<\"readOnly\"> & {\\n` +\n delegateSurfaceLines({ view, delegateSuffix: \"ReadOnlyDelegate\" }) +\n transactionLines({ transactionType: \"ReadOnlyClientInstance\", reads: true }) +\n DEFINE_VIEW_LINE +\n policyClientLines({ view, selfType: \"ReadOnlyClientInstance\" }) +\n scopedClientLines({ view, scopedType: \"ReadOnlyClientInstance\" }) +\n ` /** Idempotent — restricting an already-restricted handle returns the same handle. */\\n` +\n ` readonly $readOnly: () => ReadOnlyClientInstance;\\n` +\n extensionLines +\n ` // Deliberately ABSENT: every write method, $queryRaw / $executeRaw / $queryRawUnsafe / $executeRawUnsafe, $connect / $disconnect, $advisoryLock / $tryAdvisoryLock, $withContext, and every extension surface its author did not classify as a read.\\n` +\n `};`,\n ];\n}\n\n// ─── Entry ────────────────────────────────────────────────────────\n\n/** Emit the full index.d.ts for a resolved schema view. */\nexport function emitDts(params: {\n view: SchemaView;\n baked?: BakedExtensions;\n computed?: readonly ComputedManifestEntry[];\n}): string {\n const { view } = params;\n const baked = params.baked ?? EMPTY_BAKED_EXTENSIONS;\n const computed = params.computed ?? [];\n const hasComputed = computed.length > 0;\n const computedByModel = new Map<string, ComputedManifestEntry[]>();\n for (const entry of computed) {\n const list = computedByModel.get(entry.model) ?? [];\n list.push(entry);\n computedByModel.set(entry.model, list);\n }\n const parts: string[] = [];\n parts.push(GENERATED_HEADER);\n const schemaTypeImports = [\n \"SchemaIR\",\n ...(baked.empty ? [] : [\"VibeExtension\"]),\n ...(hasComputed ? [\"ComputedConfig\"] : []),\n ].sort();\n const runtimeTypeImports = [\n \"ClientContext\",\n \"QueryOperation\",\n \"SqlFragment\",\n \"ResultDecoder\",\n \"SqlColumn\",\n \"DatabaseAdapter\",\n \"DbNow\",\n \"QueryEvent\",\n \"Skip\",\n \"StatementDiagnosticsOptions\",\n \"TransactionOptions\",\n \"WriteValidators\",\n // Imported rather than re-declared: ONE definition of the key forms, so the\n // generated surface and the runtime's validation can never drift apart.\n ...(capabilitiesOf({ view }).advisoryLocks ? [\"AdvisoryLockOptions\"] : []),\n ].sort();\n const importLines = [\n `import type { ${runtimeTypeImports.join(\", \")} } from \"@vibeorm/runtime\";`,\n `import type { ${schemaTypeImports.join(\", \")} } from \"@vibeorm/schema\";`,\n ...baked.dtsImports,\n // Enum constants, unions and parsers are declared once in enums.d.ts;\n // imported here (the model types reference the unions) and re-exported.\n `import { ${enumEntryExports({ view }).join(\", \")} } from \"./enums.js\";`,\n ];\n parts.push(\n `${importLines.join(\"\\n\")}\\n\\n` +\n `export { VibeError } from \"@vibeorm/schema\";\\nexport type { VibeErrorCode } from \"@vibeorm/schema\";\\n` +\n // Re-exported so the sentinel comes from the SAME module as the argument\n // types that accept it — a consumer need not depend on @vibeorm/runtime.\n `export { SKIP } from \"@vibeorm/runtime\";\\nexport type { Skip } from \"@vibeorm/runtime\";\\n` +\n `export { ${enumEntryExports({ view }).join(\", \")} };`,\n );\n parts.push(PREAMBLE);\n parts.push(`export { sql, decode, sqlProjection } from \"@vibeorm/runtime\";`);\n parts.push(`export type { SqlFragment, ResultDecoder, ExtendedDateTime, SqlColumn } from \"@vibeorm/runtime\";`);\n parts.push(`/** Mapped SQL references. No database handle or execution privileges are captured. */\\nexport declare const sqlModels: {\\n${view.models.map((model) => ` readonly ${propKey({ name: model.clientName })}: (options?: { readonly alias?: string }) => { readonly table: SqlFragment; readonly fields: { ${model.fields.map((field) => `readonly ${propKey({ name: field.name })}: SqlColumn<${field.scalar === \"Json\" ? \"unknown\" : payloadFieldType({ field })}>`).join(\"; \")} } };`).join(\"\\n\")}\\n};`);\n parts.push(...emitLockSection({ view }));\n parts.push(...filterSection());\n for (const declared of view.enums) parts.push(emitEnum({ declared }));\n\n const registry: NestedRegistry = new Map();\n const modelParts: string[] = [];\n for (const model of view.models) {\n const extensionLines = baked.delegateDts.get(model.name);\n const readOnlyExtensionLines = baked.readOnlyDelegateDts.get(model.name);\n const modelComputed = computedByModel.get(model.name);\n modelParts.push(\n emitModel({\n model,\n view,\n registry,\n ...(extensionLines === undefined ? {} : { extensionLines }),\n ...(readOnlyExtensionLines === undefined ? {} : { readOnlyExtensionLines }),\n ...(modelComputed === undefined ? {} : { computed: modelComputed }),\n }),\n );\n }\n parts.push(...modelParts);\n\n if (registry.size > 0) {\n parts.push(banner({ title: \"Nested write inputs\" }));\n for (const name of [...registry.keys()].sort()) {\n parts.push(registry.get(name) as string);\n }\n }\n\n if (baked.moduleDts.length > 0) {\n parts.push(banner({ title: \"Extensions\" }));\n parts.push(...baked.moduleDts);\n }\n\n parts.push(...emitViewSection({ view }));\n\n parts.push(...emitScopedSection({ view }));\n\n parts.push(...emitReadOnlySection({ view, baked }));\n\n parts.push(...emitRlsSection({ view }));\n\n parts.push(emitClient({ view, baked, hasComputed }));\n return `${parts.join(\"\\n\\n\")}\\n`;\n}\n",
|
|
9
9
|
"/**\n * Emits the generated client's index.js — runtime glue ONLY. All typing lives\n * in the directly-written index.d.ts (see emit-dts.ts); this file embeds the\n * normalized Schema IR as plain data (no `as const` inference trees), exports\n * re-exports the enum constants and `enumValidators` from the lightweight\n * enums.js entry (emitted here too, by `emitEnumsJs`) and wires `VibeClient()`\n * to the dynamic client in @vibeorm/runtime. Import specifiers stay bare — the\n * consumer resolves @vibeorm/runtime and @vibeorm/schema from its own\n * node_modules.\n */\n\nimport { internalError } from \"@vibeorm/schema\";\nimport type { ComputedManifestEntry } from \"@vibeorm/schema\";\nimport type { BakedExtensions } from \"./extension-bake.ts\";\nimport { EMPTY_BAKED_EXTENSIONS } from \"./extension-bake.ts\";\nimport type { SchemaView } from \"./schema-view.ts\";\nimport { stableStringify, tsString } from \"./util.ts\";\n\nconst HEADER: string = `// Generated by VibeORM (@vibeorm/generator) — DO NOT EDIT.\\n// Regenerate with \\`vibeorm generate\\` after every schema change.`;\n\n// ─── enums.js ────────────────────────────────────────────────────\n\n/** The names index.js / index.d.ts re-export from the enums entry (enum constants + the parser group). */\nexport function enumEntryExports(params: { view: SchemaView }): readonly string[] {\n return [...params.view.enums.map((declared) => declared.name), \"enumValidators\"];\n}\n\n/**\n * Emit the lightweight enums.js entry: one frozen constant object per enum\n * (the SAME declaration index.js re-exports — one source of truth) and the\n * grouped `enumValidators` boundary parsers. Depends on `@vibeorm/schema`\n * (for the typed `VibeError`) and nothing else — never on the runtime\n * client or the application schema module, so a frontend can import it.\n */\nexport function emitEnumsJs(params: { view: SchemaView }): string {\n const { view } = params;\n const parts: string[] = [\n `${HEADER}\\n// Lightweight entry: enum constants + boundary parsers. No runtime client, no schema module.`,\n ];\n\n if (view.enums.length === 0) {\n parts.push(\n `/** Boundary parsers grouped by enum name — this schema declares no enums. */\\n` +\n `export const enumValidators = Object.freeze({});`,\n );\n return `${parts.join(\"\\n\\n\")}\\n`;\n }\n\n parts.push(`import { VibeError } from \"@vibeorm/schema\";`);\n for (const declared of view.enums) {\n const entries = declared.values\n .map((value) => ` ${value === \"__proto__\" ? `[${tsString({ value })}]` : tsString({ value })}: ${tsString({ value })},`)\n .join(\"\\n\");\n parts.push(`export const ${declared.name} = Object.freeze({\\n${entries}\\n});`);\n }\n\n parts.push(\n `/** Membership validator for one enum: \\`values\\`, \\`is\\`, \\`parse\\` (VIBE_VALIDATION on a non-member). */\\n` +\n `function enumValidator(params) {\\n` +\n ` const { name, values } = params;\\n` +\n ` const members = new Set(values);\\n` +\n ` const is = (value) => typeof value === \"string\" && members.has(value);\\n` +\n ` return Object.freeze({\\n` +\n ` values: Object.freeze([...values]),\\n` +\n ` is,\\n` +\n ` parse(input) {\\n` +\n ` const { value } = input;\\n` +\n ` if (is(value)) return value;\\n` +\n ` const received = typeof value === \"string\" ? value.slice(0, 80) : value === null ? \"null\" : typeof value;\\n` +\n ` throw new VibeError({\\n` +\n ` code: \"VIBE_VALIDATION\",\\n` +\n ` message: \\`Invalid \\${name} value \\${JSON.stringify(received)} — expected one of \\${values.join(\", \")}\\`,\\n` +\n ` meta: { enum: name, received },\\n` +\n ` });\\n` +\n ` },\\n` +\n ` });\\n` +\n `}`,\n );\n\n const validatorLines = view.enums\n .map(\n (declared) =>\n ` ${declared.name === \"__proto__\" ? `[${tsString({ value: declared.name })}]` : declared.name}: enumValidator({ name: ${tsString({ value: declared.name })}, values: [${declared.values\n .map((value) => tsString({ value }))\n .join(\", \")}] }),`,\n )\n .join(\"\\n\");\n parts.push(\n `/** Boundary parsers grouped by enum name, so an enum member named \\`parse\\` cannot collide. */\\n` +\n `export const enumValidators = Object.freeze({\\n${validatorLines}\\n});`,\n );\n return `${parts.join(\"\\n\\n\")}\\n`;\n}\n\n// ─── Embedded IR ─────────────────────────────────────────────────\n\n/**\n * Serialize the embedded IR. Ordinary metadata keeps the stable sorted form\n * (`stableStringify`) so output stays byte-identical for structurally\n * identical input, but everything under an `rls` key is written in\n * DECLARATION order.\n *\n * Order is semantic there: the context declaration is the order the runtime\n * emits its `set_config` calls in, and an ownership equality map is the order\n * the policy predicate is rendered in. Sorting those keys would make the\n * client's copy of the schema describe a different statement order than the\n * authored schema the migration installed.\n */\nfunction serializeSchema(params: { schema: SchemaView[\"schema\"] }): string {\n const { schema } = params;\n if (schema.rls === undefined) return stableStringify({ value: schema });\n return renderIr({ value: schema, indent: \"\", ordered: false });\n}\n\n/** `stableStringify`'s renderer, with key sorting suspended inside `rls` subtrees. */\nfunction renderIr(params: { value: unknown; indent: string; ordered: boolean }): string {\n const { value, indent, ordered } = params;\n if (value === null) return \"null\";\n const kind = typeof value;\n if (kind === \"string\" || kind === \"number\" || kind === \"boolean\") return JSON.stringify(value);\n if (Array.isArray(value)) {\n if (value.length === 0) return \"[]\";\n const inner = `${indent} `;\n const items = value.map((item) => inner + renderIr({ value: item, indent: inner, ordered }));\n return `[\\n${items.join(\",\\n\")}\\n${indent}]`;\n }\n if (kind !== \"object\") {\n throw internalError({ message: `internal: cannot serialize a ${kind} value into the generated client`, meta: { kind } });\n }\n const record = value as Record<string, unknown>;\n const defined = Object.keys(record).filter((key) => record[key] !== undefined);\n const keys = ordered ? defined : defined.sort();\n if (keys.length === 0) return \"{}\";\n const inner = `${indent} `;\n const items = keys.map(\n (key) =>\n `${inner}${JSON.stringify(key)}: ${renderIr({ value: record[key], indent: inner, ordered: ordered || key === \"rls\" })}`,\n );\n return `{\\n${items.join(\",\\n\")}\\n${indent}}`;\n}\n\n// ─── index.js ────────────────────────────────────────────────────\n\n/** Emit the full index.js for a resolved schema view. */\nexport function emitJs(params: {\n view: SchemaView;\n baked?: BakedExtensions;\n computed?: readonly ComputedManifestEntry[];\n}): string {\n const { view } = params;\n const baked = params.baked ?? EMPTY_BAKED_EXTENSIONS;\n const computed = params.computed ?? [];\n const hasComputed = computed.length > 0;\n const parts: string[] = [];\n\n parts.push(HEADER);\n parts.push(`import { createClient, createSqlModel } from \"@vibeorm/runtime\";`);\n parts.push(`export { sql, decode, sqlProjection } from \"@vibeorm/runtime\";`);\n if (baked.jsImports.length > 0) parts.push(baked.jsImports.join(\"\\n\"));\n parts.push(`export { VibeError } from \"@vibeorm/schema\";`);\n // The omission sentinel: `where: { tenantId: SKIP }` compiles like `where: {}`.\n parts.push(`export { SKIP } from \"@vibeorm/runtime\";`);\n // Enum constants and parsers live in enums.js; index re-exports them so\n // `import { Role } from \"./generated/vibeorm\"` keeps working.\n parts.push(`export { ${enumEntryExports({ view }).join(\", \")} } from \"./enums.js\";`);\n parts.push(\n `/** The normalized Schema IR this client was generated from (plain data). */\\nexport const schema = ${serializeSchema(\n { schema: view.schema },\n )};`,\n );\n\n parts.push(`/** Mapped identifiers and explicit projection decoders. */\\nexport const sqlModels = Object.freeze({\\n${view.models.map((model) => ` [${tsString({ value: model.clientName })}]: (options = {}) => createSqlModel({ schema, model: ${tsString({ value: model.name })}, ...options }),`).join(\"\\n\")}\\n});`);\n\n if (baked.empty && !hasComputed) {\n parts.push(\n `/** Build a typed client over a database adapter. */\\n` +\n `export function VibeClient(options) {\\n` +\n ` const { adapter, ...clientOptions } = options;\\n` +\n ` return createClient({ schema, adapter, options: clientOptions });\\n` +\n `}`,\n );\n return `${parts.join(\"\\n\\n\")}\\n`;\n }\n\n if (!baked.empty) {\n parts.push(\n `/** Extension manifest — verified against the live extension list (VIBE_STALE_CLIENT). */\\n` +\n `const extensionManifest = ${stableStringify({ value: baked.manifest })};`,\n );\n parts.push(\n `/** Baked extension surfaces (extensions.md D9). */\\n` +\n `const extensionMounts = [\\n${baked.mounts.map((mount) => ` ${mount},`).join(\"\\n\")}\\n];`,\n );\n }\n if (hasComputed) {\n parts.push(\n `/** Computed-field manifest — verified against the live computed config (VIBE_STALE_CLIENT). */\\n` +\n `const computedManifest = ${stableStringify({ value: computed })};`,\n );\n }\n\n const destructured = [\n \"adapter\",\n ...(baked.empty ? [] : [\"extensions\"]),\n ...(hasComputed ? [\"computed\"] : []),\n \"...clientOptions\",\n ].join(\", \");\n const createLines = [\n ` schema,`,\n ` adapter,`,\n ` options: clientOptions,`,\n ...(baked.empty\n ? []\n : [` extensions: { manifest: extensionManifest, mounts: extensionMounts, instances: extensions ?? [] },`]),\n ...(hasComputed ? [` computed: { manifest: computedManifest, specs: computed },`] : []),\n ];\n parts.push(\n `/** Build a typed client over a database adapter. */\\n` +\n `export function VibeClient(options) {\\n` +\n ` const { ${destructured} } = options;\\n` +\n ` return createClient({\\n${createLines.join(\"\\n\")}\\n });\\n` +\n `}`,\n );\n\n return `${parts.join(\"\\n\\n\")}\\n`;\n}\n",
|
|
10
10
|
"/**\n * Generate-time extension baking (plan D9).\n *\n * Each configured extension's client plane contributes runtime glue (JS\n * expressions over its own module's exports) and d.ts text per opted-in model\n * / per client. This module collects those contributions once, validates the\n * one-identifier rule against the exported reserved-name lists, and hands the\n * emitters plain string blocks — the emitted types stay fully pre-resolved\n * (no inference), keeping the tsserver budget flat.\n */\n\nimport {\n VibeError,\n buildExtensionRegistry,\n extensionDeclarations,\n extensionManifestEntry,\n providerToDialect,\n} from \"@vibeorm/schema\";\nimport type {\n ExtensionClientContribution,\n ExtensionImportSpec,\n ExtensionManifestEntry,\n SchemaIR,\n VibeExtension,\n} from \"@vibeorm/schema\";\n\n// ─── Result ───────────────────────────────────────────────────────\n\n/** Everything the js/d.ts emitters need, pre-stringified. */\nexport type BakedExtensions = {\n /** `import { x } from \"…\";` lines for index.js. */\n readonly jsImports: readonly string[];\n /** JS object-literal expressions — one ClientExtensionMount each. */\n readonly mounts: readonly string[];\n /** Manifest entries (name-sorted) for the staleness gate. */\n readonly manifest: readonly ExtensionManifestEntry[];\n /** `import type { x } from \"…\";` lines for index.d.ts. */\n readonly dtsImports: readonly string[];\n /** Model name → delegate-body lines (already 2-space indented). */\n readonly delegateDts: ReadonlyMap<string, readonly string[]>;\n /**\n * Model name → the CLASSIFIED read-only subset of those lines, written as\n * indexed access into the full delegate type so the two can never drift.\n * A contribution that declared no `readOnly` classification contributes\n * nothing here — which is what makes it absent from the read-only client.\n */\n readonly readOnlyDelegateDts: ReadonlyMap<string, readonly string[]>;\n /** Module-scope type declaration blocks. */\n readonly moduleDts: readonly string[];\n /** VibeClientInstance-body lines for root `$name` namespaces. */\n readonly clientDts: readonly string[];\n /** The classified read-only subset of `clientDts`. */\n readonly readOnlyClientDts: readonly string[];\n /** True when nothing was configured — emitters keep their baseline output. */\n readonly empty: boolean;\n};\n\nexport const EMPTY_BAKED_EXTENSIONS: BakedExtensions = {\n jsImports: [],\n mounts: [],\n manifest: [],\n dtsImports: [],\n delegateDts: new Map(),\n readOnlyDelegateDts: new Map(),\n moduleDts: [],\n clientDts: [],\n readOnlyClientDts: [],\n empty: true,\n};\n\n// ─── Import collection ────────────────────────────────────────────\n\nclass ImportCollector {\n private readonly byModule = new Map<string, Set<string>>();\n\n add(specs: readonly ExtensionImportSpec[] | undefined): void {\n for (const spec of specs ?? []) {\n const names = this.byModule.get(spec.from) ?? new Set<string>();\n for (const name of spec.names) names.add(name);\n this.byModule.set(spec.from, names);\n }\n }\n\n lines(params: { typeOnly: boolean }): string[] {\n return [...this.byModule.entries()]\n .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))\n .map(\n ([from, names]) =>\n `import ${params.typeOnly ? \"type \" : \"\"}{ ${[...names].sort().join(\", \")} } from ${JSON.stringify(from)};`,\n );\n }\n}\n\n// ─── Baking ───────────────────────────────────────────────────────\n\nfunction indent(lines: readonly string[]): string[] {\n return lines.map((line) => (line.length === 0 ? line : ` ${line}`));\n}\n\n/**\n * Validate an extension's read-only classification at GENERATE time — the\n * earliest knowable moment. `true` classifies a single mounted METHOD; a\n * non-empty member list classifies a NAMESPACE. The wrong shape would silently\n * deny (or silently widen) a surface, so it refuses instead.\n */\nfunction readOnlyClassification(params: {\n extension: VibeExtension;\n contribution: ExtensionClientContribution;\n}): true | readonly string[] | undefined {\n const { extension, contribution } = params;\n const readOnly = contribution.readOnly;\n if (readOnly === undefined) return undefined;\n const refuse = (problem: string): never => {\n throw new VibeError({\n code: \"VIBE_CONFIG\",\n message: `extension \"${extension.name}\": readOnly ${problem}`,\n meta: { extension: extension.name, kind: contribution.kind },\n });\n };\n if (contribution.kind === \"method\" && readOnly !== true) {\n refuse('must be `true` on a \"method\" contribution — a member list classifies a namespace');\n }\n if (contribution.kind === \"namespace\") {\n if (readOnly === true) {\n refuse(\n 'must list the readable members on a \"namespace\" contribution — `true` would also classify members added later',\n );\n } else if (readOnly.length === 0) {\n refuse(\"names no members — omit it instead, which denies the whole namespace\");\n }\n }\n return readOnly;\n}\n\n/**\n * One read-only client line for a classified mount, written as indexed access\n * into the full type: `readonly search: PostDelegate[\"search\"]`. The full\n * declaration stays the single source of truth, so the read-only surface cannot\n * drift from it, and `Pick` over a concrete object type costs one shallow\n * mapped instantiation.\n */\nfunction readOnlyLine(params: {\n owner: string;\n property: string;\n readOnly: true | readonly string[] | undefined;\n}): string | undefined {\n const { owner, property, readOnly } = params;\n if (readOnly === undefined) return undefined;\n const access = `${owner}[${JSON.stringify(property)}]`;\n return readOnly === true\n ? ` readonly ${property}: ${access};`\n : ` readonly ${property}: Pick<${access}, ${readOnly.map((member) => JSON.stringify(member)).join(\" | \")}>;`;\n}\n\n/**\n * Collect every configured extension's baked surface for this schema.\n *\n * @throws VibeError VIBE_CONFIG on duplicate names/claims (registry) and on\n * contributions that break the one-identifier rule (D9).\n */\nexport function bakeExtensions(params: {\n schema: SchemaIR;\n extensions: readonly VibeExtension[];\n}): BakedExtensions {\n const { schema } = params;\n if (params.extensions.length === 0) return EMPTY_BAKED_EXTENSIONS;\n\n // Validates duplicate names and cross-extension attribute claims.\n buildExtensionRegistry({ extensions: params.extensions });\n\n const dialect = providerToDialect({ provider: schema.datasource.provider });\n const provider = schema.datasource.provider;\n const sorted = [...params.extensions].sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));\n\n const jsImports = new ImportCollector();\n const dtsImports = new ImportCollector();\n const mounts: string[] = [];\n const delegateDts = new Map<string, string[]>();\n const readOnlyDelegateDts = new Map<string, string[]>();\n const moduleDts: string[] = [];\n const clientDts: string[] = [];\n const readOnlyClientDts: string[] = [];\n\n const useContribution = (paramsInner: {\n extension: VibeExtension;\n contribution: ExtensionClientContribution;\n scope: \"model\" | \"client\";\n model?: string;\n }): void => {\n const { extension, contribution, scope, model } = paramsInner;\n const property = scope === \"model\" ? extension.name : `$${extension.name}`;\n const readOnly = readOnlyClassification({ extension, contribution });\n jsImports.add(contribution.imports);\n dtsImports.add(contribution.dtsImports);\n moduleDts.push(...(contribution.dtsTypes ?? []));\n mounts.push(\n `{ extension: ${JSON.stringify(extension.name)}, scope: ${JSON.stringify(scope)}, ${\n model === undefined ? \"\" : `model: ${JSON.stringify(model)}, `\n }property: ${JSON.stringify(property)}, ${\n readOnly === undefined ? \"\" : `readOnly: ${JSON.stringify(readOnly)}, `\n }create: ${contribution.runtimeGlue} }`,\n );\n if (scope === \"model\" && model !== undefined) {\n const lines = delegateDts.get(model) ?? [];\n lines.push(...indent(contribution.dts));\n delegateDts.set(model, lines);\n const classified = readOnlyLine({ owner: `${model}Delegate`, property, readOnly });\n if (classified !== undefined) {\n const readOnlyLines = readOnlyDelegateDts.get(model) ?? [];\n readOnlyLines.push(classified);\n readOnlyDelegateDts.set(model, readOnlyLines);\n }\n } else {\n // Root contributions write their own `readonly $name: …;` lines.\n clientDts.push(...indent(contribution.dts));\n const classified = readOnlyLine({ owner: schema.rls === undefined ? \"VibeClientInstance\" : \"BoundVibeClientInstance\", property, readOnly });\n if (classified !== undefined) readOnlyClientDts.push(classified);\n }\n };\n\n for (const extension of sorted) {\n const declarations = extensionDeclarations({ schema, name: extension.name });\n\n const modelHook = extension.client?.model;\n if (modelHook !== undefined) {\n for (const model of schema.models) {\n const declaration = declarations[model.name];\n if (declaration === undefined) continue;\n const contribution = modelHook({\n model,\n schema,\n dialect,\n provider,\n options: extension.options,\n declaration,\n typeNames: { payload: model.name, whereInput: `${model.name}WhereInput` },\n });\n if (contribution === null) continue;\n // One-identifier rule (D9): the mounted name must not shadow a field\n // or relation of the model.\n const clash =\n model.fields.some((field) => field.name === extension.name) ||\n model.relations.some((relation) => relation.name === extension.name);\n if (clash) {\n throw new VibeError({\n code: \"VIBE_CONFIG\",\n message: `extension \"${extension.name}\" collides with a field/relation named \"${extension.name}\" on model \"${model.name}\" — rename one of them`,\n meta: { extension: extension.name, model: model.name },\n });\n }\n useContribution({ extension, contribution, scope: \"model\", model: model.name });\n }\n }\n\n const rootHook = extension.client?.root;\n if (rootHook !== undefined) {\n const contribution = rootHook({\n schema,\n dialect,\n provider,\n options: extension.options,\n declarations,\n });\n if (contribution !== null) {\n useContribution({ extension, contribution, scope: \"client\" });\n }\n }\n }\n\n return {\n jsImports: jsImports.lines({ typeOnly: false }),\n mounts,\n manifest: sorted.map((extension) => extensionManifestEntry({ extension })),\n dtsImports: dtsImports.lines({ typeOnly: true }),\n delegateDts,\n readOnlyDelegateDts,\n moduleDts,\n clientDts,\n readOnlyClientDts,\n empty: false,\n };\n}\n",
|
|
11
11
|
"/**\n * Scalar → TypeScript type mapping and the shared filter/update-operation type\n * names referenced by the emitted d.ts. Payload types mirror the runtime codec\n * table exactly (BigInt → bigint, Decimal → string, DateTime → Date, Json →\n * JsonValue, Bytes → Uint8Array); input types are wider where every dialect\n * coerces (`Date | string`, `bigint | number`, `string | number` for Decimal).\n */\n\nimport type { ScalarType } from \"@vibeorm/schema\";\nimport type { FieldView } from \"./schema-view.ts\";\nimport { tsString } from \"./util.ts\";\n\n// ─── Tables ───────────────────────────────────────────────────────\n\n/** Decoded payload type per scalar (what rows contain after the codec table ran). */\nconst PAYLOAD_TYPES: Readonly<Record<ScalarType, string>> = {\n String: \"string\",\n Boolean: \"boolean\",\n Int: \"number\",\n BigInt: \"bigint\",\n Float: \"number\",\n Decimal: \"string\",\n DateTime: \"Date\",\n Json: \"JsonValue\",\n Bytes: \"Uint8Array\",\n};\n\n/**\n * Accepted input type per scalar (what create/update/filter values accept).\n * DateTime additionally accepts the `DbNow` database-clock sentinel; list\n * ELEMENTS do not (the runtime refuses a sentinel inside a list loudly).\n */\nconst INPUT_TYPES: Readonly<Record<ScalarType, string>> = {\n String: \"string\",\n Boolean: \"boolean\",\n Int: \"number\",\n BigInt: \"bigint | number\",\n Float: \"number\",\n Decimal: \"string | number\",\n DateTime: \"Date | string | DbNow\",\n Json: \"InputJsonValue\",\n Bytes: \"Uint8Array\",\n};\n\n/** Prefix of the shared filter/update-ops type names per scalar. */\nconst FILTER_PREFIX: Readonly<Record<ScalarType, string>> = {\n String: \"String\",\n Boolean: \"Bool\",\n Int: \"Int\",\n BigInt: \"BigInt\",\n Float: \"Float\",\n Decimal: \"Decimal\",\n DateTime: \"DateTime\",\n Json: \"Json\",\n Bytes: \"Bytes\",\n};\n\n/** Scalars that take atomic update operations (increment/decrement/multiply/divide). */\nexport const NUMERIC_SCALARS: ReadonlySet<ScalarType> = new Set([\"Int\", \"BigInt\", \"Float\", \"Decimal\"]);\n\n/** Scalars aggregable with `_min`/`_max` (orderable on every dialect). */\nexport const MINMAX_SCALARS: ReadonlySet<ScalarType> = new Set([\n \"String\",\n \"Int\",\n \"BigInt\",\n \"Float\",\n \"Decimal\",\n \"DateTime\",\n]);\n\n// ─── Lookups ──────────────────────────────────────────────────────\n\n/** The payload type of a field WITHOUT list/null decoration (`string`, `Role`, …). */\nexport function payloadBaseType(params: { field: FieldView }): string {\n const { field } = params;\n // A qualified type reference creates no binding that could shadow generated names.\n if (field.jsonType !== undefined) return `import(${tsString({ value: field.jsonType.from })}).${field.jsonType.name}`;\n return field.enumName ?? PAYLOAD_TYPES[field.scalar as ScalarType];\n}\n\n/** The accepted input value type of a field WITHOUT list/null decoration. */\nexport function inputBaseType(params: { field: FieldView }): string {\n const { field } = params;\n // Typed JSON uses the same qualified contract for writes and reads.\n if (field.jsonType !== undefined) return `import(${tsString({ value: field.jsonType.from })}).${field.jsonType.name}`;\n if (field.isList && field.scalar === \"DateTime\") return \"Date | string\";\n return field.enumName ?? INPUT_TYPES[field.scalar as ScalarType];\n}\n\n/** The filter type name for a field (`StringFilter`, `RoleNullableFilter`, `IntListFilter`, …). */\nexport function filterName(params: { field: FieldView }): string {\n const { field } = params;\n const prefix = field.enumName ?? FILTER_PREFIX[field.scalar as ScalarType];\n if (field.isList) return `${prefix}ListFilter`;\n return field.isOptional ? `${prefix}NullableFilter` : `${prefix}Filter`;\n}\n\n/** The atomic update-operations type name for a numeric field, else `null`. */\nexport function updateOpsName(params: { field: FieldView }): string | null {\n const { field } = params;\n if (field.isList || field.scalar === null || !NUMERIC_SCALARS.has(field.scalar)) return null;\n const prefix = FILTER_PREFIX[field.scalar];\n return field.isOptional ? `Nullable${prefix}FieldUpdateOperationsInput` : `${prefix}FieldUpdateOperationsInput`;\n}\n",
|
|
12
12
|
"/**\n * The generator's resolved view of a SchemaIR: models and enums sorted by name\n * (deterministic emission), `Unsupported(...)` columns dropped from the typed\n * surface (ruling F3 — kept in the embedded IR for schema fidelity), unique\n * lookup members precomputed, and every relation resolved to its inverse field\n * on the target model using the v1 pairing rule: same model pair, symmetric\n * relation name (both unnamed or same name), self-pair excluded by field name.\n */\n\nimport { VibeError, assertValidSchemaIR, enumStorageOf, isEnumType } from \"@vibeorm/schema\";\nimport { postgresDialect, renderRlsPolicy } from \"@vibeorm/sql\";\nimport type {\n EnumStorage,\n FieldIR,\n ModelIR,\n RelationIR,\n RelationType,\n ScalarType,\n SchemaIR,\n} from \"@vibeorm/schema\";\nimport { clientNameOf } from \"./util.ts\";\n\n// ─── Typed JSON annotation ────────────────────────────────\n\n/** A `/// @type(Name from \"specifier\")` annotation on a Json field's doc comment. */\nexport type JsonTypeAnnotation = { readonly name: string; readonly from: string };\n\nconst JSON_TYPE_RE = /@type\\(\\s*([A-Za-z_$][A-Za-z0-9_$]*)\\s+from\\s+\"([^\"]+)\"\\s*\\)/;\n\n/** Extract the typed-JSON annotation from a doc comment; null when absent. */\nexport function parseJsonTypeAnnotation(params: { comment: string | undefined }): JsonTypeAnnotation | null {\n if (params.comment === undefined) return null;\n const match = JSON_TYPE_RE.exec(params.comment);\n if (match === null) return null;\n return { name: match[1] as string, from: match[2] as string };\n}\n\n// ─── Types ────────────────────────────────────────────────────────\n\nexport type EnumView = {\n readonly name: string;\n readonly values: readonly string[];\n /** Effective physical storage (`\"database\"` when the IR omits it). */\n readonly storage: EnumStorage;\n};\n\n/** A scalar/enum column, resolved for type emission. */\nexport type FieldView = {\n readonly name: string;\n /** The scalar type, or `null` when the field is an enum reference. */\n readonly scalar: ScalarType | null;\n /** The enum name, or `null` when the field is a scalar. */\n readonly enumName: string | null;\n readonly isList: boolean;\n readonly isOptional: boolean;\n readonly isId: boolean;\n readonly isUnique: boolean;\n readonly hasDefault: boolean;\n readonly isUpdatedAt: boolean;\n /** Typed-JSON annotation (Json fields only) — replaces JsonValue/InputJsonValue in the emitted types. */\n readonly jsonType?: JsonTypeAnnotation;\n};\n\n/** A relation field, resolved to its inverse on the target model. */\nexport type RelationView = {\n readonly name: string;\n /** Target model name. */\n readonly target: string;\n readonly type: RelationType;\n readonly isList: boolean;\n readonly isOptional: boolean;\n /** FK scalar field names on the owning model (FK side only, else empty). */\n readonly fkFields: readonly string[];\n /**\n * The back-relation field name on the target model, or `null` when pairing\n * is ambiguous/absent — nested input types then fall back to the target's\n * plain create/update inputs instead of `Without…` variants.\n */\n readonly inverseName: string | null;\n};\n\n/** One way to identify a single row: a unique field, or a composite unique/PK. */\nexport type UniqueMemberView = {\n /**\n * Property key in WhereUniqueInput — the field name, the declared client\n * selector (`@@unique`/`@@id` `name:`), or fields joined by `_`.\n */\n readonly key: string;\n readonly fields: readonly FieldView[];\n /**\n * NULLS NOT DISTINCT group: optional members are null-addressable and widen\n * to `| null` in WhereUniqueInput (mirrors the runtime's rule).\n */\n readonly nullsNotDistinct: boolean;\n};\n\nexport type ModelView = {\n readonly name: string;\n /** Delegate key on the client (`user` for `User`). */\n readonly clientName: string;\n readonly fields: readonly FieldView[];\n readonly relations: readonly RelationView[];\n readonly uniques: readonly UniqueMemberView[];\n /** Every scalar field name that backs some relation's FK. */\n readonly fkFieldNames: ReadonlySet<string>;\n readonly isView: boolean;\n /** Row-scoping policy (@@policy) — drives the $withPolicy client surface. */\n readonly policy?: { readonly field: string; readonly context: string };\n};\n\nexport type SchemaView = {\n /** The normalized IR (models/enums/extensions sorted by name) — embedded as data in index.js. */\n readonly schema: SchemaIR;\n readonly enums: readonly EnumView[];\n readonly models: readonly ModelView[];\n readonly modelByName: ReadonlyMap<string, ModelView>;\n};\n\n// ─── Building ─────────────────────────────────────────────────────\n\nfunction byName(left: { readonly name: string }, right: { readonly name: string }): number {\n return left.name < right.name ? -1 : left.name > right.name ? 1 : 0;\n}\n\nfunction buildFieldView(params: { field: FieldIR; model: string }): FieldView {\n const { field, model } = params;\n const enumRef = isEnumType(field.type);\n const annotation = parseJsonTypeAnnotation({ comment: field.documentation });\n if (annotation !== null && (enumRef || field.type !== \"Json\")) {\n throw new VibeError({\n code: \"VIBE_SCHEMA_INVALID\",\n message: `@type(...) annotation on ${model}.${field.name} — typed JSON is only valid on Json fields`,\n meta: { model, field: field.name },\n });\n }\n return {\n name: field.name,\n scalar: enumRef ? null : (field.type as ScalarType),\n enumName: enumRef ? (field.type as { readonly enum: string }).enum : null,\n isList: field.isList,\n isOptional: field.isOptional,\n isId: field.isId,\n isUnique: field.isUnique,\n hasDefault: field.default !== undefined,\n isUpdatedAt: field.isUpdatedAt,\n ...(annotation === null ? {} : { jsonType: annotation }),\n };\n}\n\n/**\n * Resolve the inverse field of a relation on its target model. Exactly one\n * candidate must match (same model pair, symmetric relation name, not the\n * relation itself on self-relations) — anything else returns `null` and the\n * nested input types degrade to the plain create/update inputs.\n */\nfunction resolveInverse(params: { relation: RelationIR; target: ModelIR }): string | null {\n const { relation, target } = params;\n const candidates = target.relations.filter(\n (candidate) =>\n candidate.targetModel === relation.model &&\n (candidate.relationName ?? null) === (relation.relationName ?? null) &&\n !(candidate.model === relation.model && candidate.name === relation.name),\n );\n const first = candidates[0];\n return candidates.length === 1 && first !== undefined ? first.name : null;\n}\n\nfunction buildUniques(params: {\n model: ModelIR;\n fields: readonly FieldView[];\n}): UniqueMemberView[] {\n const { model, fields } = params;\n const fieldByName = new Map(fields.map((field) => [field.name, field]));\n const members: UniqueMemberView[] = [];\n const seen = new Set<string>();\n\n const add = (names: readonly string[], nullsNotDistinct: boolean, clientName?: string): void => {\n const key = clientName ?? names.join(\"_\");\n if (seen.has(key)) return;\n const resolved: FieldView[] = [];\n for (const name of names) {\n const field = fieldByName.get(name);\n if (field === undefined) return; // Unsupported column inside a unique — not addressable.\n resolved.push(field);\n }\n seen.add(key);\n members.push({ key, fields: resolved, nullsNotDistinct });\n };\n\n for (const field of fields) {\n if (field.isId || field.isUnique) add([field.name], false);\n }\n if (model.primaryKey !== undefined) {\n // A SINGLE-column block key (`@@id([sessionId])`, no field-level `@id`)\n // addresses a row exactly like `@id` does — a plain `{ sessionId }`\n // member, never compound sugar. It leaves `field.isId` false in the IR, so\n // without this branch it fell through both loops and the model's\n // WhereUniqueInput came out `never`: findUnique/update/delete/upsert were\n // uncallable on it (mirrored in the runtime's model-meta).\n if (model.primaryKey.fields.length === 1) add(model.primaryKey.fields, false);\n else add(model.primaryKey.fields, false, model.primaryKey.clientName);\n }\n for (const index of model.indexes) {\n // A PARTIAL unique guards only the rows its predicate covers — it cannot\n // address a row, so it never joins WhereUniqueInput (mirrors model-meta).\n if (index.kind === \"unique\" && index.where === undefined) {\n add(\n index.fields.map((field) => field.name),\n index.nullsNotDistinct === true,\n index.clientName,\n );\n }\n }\n return members;\n}\n\nfunction buildModelView(params: { model: ModelIR; modelIRByName: ReadonlyMap<string, ModelIR> }): ModelView {\n const { model, modelIRByName } = params;\n const fields = model.fields\n .filter((field) => field.isUnsupported !== true)\n .map((field) => buildFieldView({ field, model: model.name }));\n\n const fkFieldNames = new Set<string>();\n const relations: RelationView[] = model.relations.map((relation) => {\n for (const fk of relation.fields ?? []) fkFieldNames.add(fk);\n const target = modelIRByName.get(relation.targetModel);\n return {\n name: relation.name,\n target: relation.targetModel,\n type: relation.type,\n isList: relation.isList,\n // A foreign key guarantees its owning row's parent, never an inverse child.\n isOptional: relation.isOptional || (!relation.isList && (relation.fields?.length ?? 0) === 0),\n fkFields: relation.fields ?? [],\n inverseName: target === undefined ? null : resolveInverse({ relation, target }),\n };\n });\n\n return {\n name: model.name,\n clientName: clientNameOf({ name: model.name }),\n fields,\n relations,\n uniques: buildUniques({ model, fields }),\n fkFieldNames,\n isView: model.isView,\n ...(model.policy === undefined ? {} : { policy: model.policy }),\n };\n}\n\n/**\n * Native RLS: render every protected policy WHILE GENERATING, and throw away\n * the SQL. Structural validation (above) owns logical shape; only the renderer\n * knows the physical types, so an ownership column that cannot be cast safely\n * (a user-defined type such as `citext`, an array, an enum) must fail here —\n * at `vibeorm generate`, the earliest knowable moment — rather than at\n * migration or at runtime. No policy text ever reaches the generated client.\n */\nfunction assertRlsRenderable(params: { schema: SchemaIR }): void {\n for (const model of params.schema.models) {\n if (model.rls === undefined || model.rls === \"unprotected\") continue;\n renderRlsPolicy({ dialect: postgresDialect, schema: params.schema, model: model.name });\n }\n}\n\n/**\n * Validate and resolve a SchemaIR for emission. The returned view's `schema`\n * is the normalized IR (sorted models/enums/extensions) that gets embedded in\n * the generated index.js — byte-identical for structurally identical input.\n */\nexport function buildSchemaView(params: { schema: SchemaIR }): SchemaView {\n const { schema } = params;\n assertValidSchemaIR({ schema });\n if (schema.rls !== undefined) assertRlsRenderable({ schema });\n\n const normalized: SchemaIR = {\n datasource: schema.datasource,\n models: [...schema.models].sort(byName),\n enums: [...schema.enums].sort(byName),\n extensions: [...schema.extensions].sort(byName),\n // The schema-level context declaration is part of the client's contract:\n // the runtime binds exactly these slots. Omitting it would leave the\n // native-RLS client with nothing to bind.\n ...(schema.rls === undefined ? {} : { rls: schema.rls }),\n };\n\n const modelIRByName = new Map(normalized.models.map((model) => [model.name, model]));\n const models = normalized.models.map((model) => buildModelView({ model, modelIRByName }));\n\n return {\n schema: normalized,\n enums: normalized.enums.map((declared) => ({\n name: declared.name,\n values: declared.values,\n storage: enumStorageOf({ enumDef: declared }),\n })),\n models,\n modelByName: new Map(models.map((model) => [model.name, model])),\n };\n}\n"
|
|
13
13
|
],
|
|
14
|
-
"mappings": ";;AAAA;AACA,sBAAS;;;ACKT;AAKO,SAAS,MAAM,CAAC,QAAkC;AAAA,EACvD,QAAQ,SAAS;AAAA,EACjB,IAAI,KAAK,WAAW;AAAA,IAAG,OAAO;AAAA,EAC9B,OAAO,KAAK,OAAO,CAAC,EAAE,YAAY,IAAI,KAAK,MAAM,CAAC;AAAA;AAS7C,SAAS,YAAY,CAAC,QAAkC;AAAA,EAC7D,QAAQ,SAAS;AAAA,EACjB,IAAI,KAAK,WAAW;AAAA,IAAG,OAAO;AAAA,EAC9B,OAAO,KAAK,OAAO,CAAC,EAAE,YAAY,IAAI,KAAK,MAAM,CAAC;AAAA;AAGpD,IAAM,gBAAwB;AAGvB,SAAS,OAAO,CAAC,QAAkC;AAAA,EACxD,QAAQ,SAAS;AAAA,EACjB,OAAO,cAAc,KAAK,IAAI,IAAI,OAAO,KAAK,UAAU,IAAI;AAAA;AAIvD,SAAS,QAAQ,CAAC,QAAmC;AAAA,EAC1D,OAAO,KAAK,UAAU,OAAO,KAAK;AAAA;AAI7B,SAAS,WAAW,CAAC,QAAkC;AAAA,EAC5D,QAAQ,SAAS;AAAA,EACjB,OAAO,KAAK,SAAS,GAAG,IAAI,IAAI,UAAU;AAAA;AAUrC,SAAS,eAAe,CAAC,QAAoC;AAAA,EAClE,OAAO,YAAY,EAAE,OAAO,OAAO,OAAO,QAAQ,GAAG,CAAC;AAAA;AAGxD,SAAS,WAAW,CAAC,QAAoD;AAAA,EACvE,QAAQ,OAAO,WAAW;AAAA,EAC1B,IAAI,UAAU;AAAA,IAAM,OAAO;AAAA,EAC3B,MAAM,OAAO,OAAO;AAAA,EACpB,IAAI,SAAS,YAAY,SAAS,YAAY,SAA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EAAE,iBAAiB,OAAO,MAAM,CAAC,IAClD,qBACC,gBAAgB,kBAAkB,EAAE,MAAM,UAAU,CAAC,IAAI,OACzD,gBAAgB,KAAK,4BACtB;AAAA;AASJ,SAAS,qBAAqB,GAAW;AAAA,EACvC,OAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;A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;AAAA,EAC5S,MAAM,UAA4D;AAAA,IAChE,EAAE,MAAM,YAAY,SAAS,OAAO,EAAE,MAAM,OAAO,SAAS,CAAC,EAAE;AAAA,IAC/D,EAAE,MAAM,cAAc,SAAS,QAAQ,EAAE,MAAM,OAAO,SAAS,CAAC,EAAE;AAAA,IAClE,EAAE,MAAM,YAAY,SAAS,YAAY,EAAE,KAAK,CAAC,EAAE;AAAA,IACnD,EAAE,MAAM,cAAc,SAAS,aAAa,EAAE,KAAK,CAAC,EAAE;AAAA,IACtD,EAAE,MAAM,aAAa,SAAS,OAAO;AAAA,IACrC,GAAI,OAAO,WAAW,YAAY,CAAC,IAAI,mBAAmB,EAAE,MAAM,QAAQ,OAAO,OAAO,CAAC;AAAA,EAC3F;AAAA,EAEA,MAAM,MAAM,QAAQ,EAAE,WAAW,KAAK,CAAC;AAAA,EACvC,MAAM,QAAkB,CAAC;AAAA,EACzB,WAAW,UAAU,SAAS;AAAA,IAC5B,MAAM,OAAO,KAAK,QAAQ,OAAO,IAAI;AAAA,IACrC,MAAM,UAAU,MAAM,OAAO,SAAS,OAAO;AAAA,IAC7C,MAAM,KAAK,IAAI;AAAA,EACjB;AAAA,EACA,OAAO,EAAE,MAAM;AAAA;",
|
|
15
|
+
"debugId": "BC4813FB63493C9C64756E2164756E21",
|
|
16
16
|
"names": []
|
|
17
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibeorm/generator",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "Client generator for VibeORM v2 — emits .js + directly-written .d.ts from the Schema IR",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"orm",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"bun": ">=1.2.0"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@vibeorm/schema": "2.
|
|
45
|
-
"@vibeorm/sql": "2.3.
|
|
44
|
+
"@vibeorm/schema": "2.4.0",
|
|
45
|
+
"@vibeorm/sql": "2.3.1"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|