@prisma-next/extension-arktype-json 0.5.0-dev.66 → 0.5.0-dev.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/{arktype-json-codec-Cykol-li.mjs → arktype-json-codec-DluUG3EZ.mjs} +3 -3
  2. package/dist/arktype-json-codec-DluUG3EZ.mjs.map +1 -0
  3. package/dist/{arktype-json-codec-DBfCWQkt.d.mts → arktype-json-codec-VX9T28RG.d.mts} +1 -2
  4. package/dist/arktype-json-codec-VX9T28RG.d.mts.map +1 -0
  5. package/dist/{codec-types-5Jy4t54u.d.mts → codec-types-DY2DS594.d.mts} +1 -1
  6. package/dist/codec-types-DY2DS594.d.mts.map +1 -0
  7. package/dist/codec-types.d.mts +1 -1
  8. package/dist/codec-types.mjs +1 -1
  9. package/dist/codecs.d.mts +1 -2
  10. package/dist/codecs.d.mts.map +1 -1
  11. package/dist/codecs.mjs +3 -4
  12. package/dist/column-types.d.mts +1 -1
  13. package/dist/column-types.mjs +2 -3
  14. package/dist/control.d.mts +0 -1
  15. package/dist/control.d.mts.map +1 -1
  16. package/dist/control.mjs +4 -7
  17. package/dist/control.mjs.map +1 -1
  18. package/dist/{pack-meta-BaJhoZfD.mjs → pack-meta-TjNpp3sc.mjs} +8 -11
  19. package/dist/pack-meta-TjNpp3sc.mjs.map +1 -0
  20. package/dist/pack.d.mts +3 -4
  21. package/dist/pack.d.mts.map +1 -1
  22. package/dist/pack.mjs +2 -5
  23. package/dist/{registry-DN6MqSGJ.mjs → registry-CfU1C3-F.mjs} +3 -4
  24. package/dist/registry-CfU1C3-F.mjs.map +1 -0
  25. package/dist/runtime.d.mts +0 -1
  26. package/dist/runtime.d.mts.map +1 -1
  27. package/dist/runtime.mjs +4 -7
  28. package/dist/runtime.mjs.map +1 -1
  29. package/package.json +11 -11
  30. package/dist/arktype-json-codec-Cykol-li.mjs.map +0 -1
  31. package/dist/arktype-json-codec-DBfCWQkt.d.mts.map +0 -1
  32. package/dist/codec-types-5Jy4t54u.d.mts.map +0 -1
  33. package/dist/pack-meta-BaJhoZfD.mjs.map +0 -1
  34. package/dist/registry-DN6MqSGJ.mjs.map +0 -1
@@ -1,7 +1,6 @@
1
1
  import { CodecDescriptorImpl, CodecImpl, column } from "@prisma-next/framework-components/codec";
2
2
  import { runtimeError } from "@prisma-next/framework-components/runtime";
3
3
  import { ArkErrors, ark, type } from "arktype";
4
-
5
4
  //#region src/core/arktype-json-codec.ts
6
5
  /** Codec id for arktype-backed JSON columns. Library-bound, not target-bound. */
7
6
  const ARKTYPE_JSON_CODEC_ID = "arktype/json@1";
@@ -57,6 +56,7 @@ function renderArktypeJsonOutputType(params) {
57
56
  return expression.length > 0 ? expression : "unknown";
58
57
  }
59
58
  var ArktypeJsonCodecClass = class extends CodecImpl {
59
+ schema;
60
60
  constructor(descriptor, schema) {
61
61
  super(descriptor);
62
62
  this.schema = schema;
@@ -114,7 +114,7 @@ function arktypeJsonColumn(schema) {
114
114
  return column((_ctx) => new ArktypeJsonCodecClass(arktypeJsonDescriptor, schema), arktypeJsonDescriptor.codecId, params, ARKTYPE_JSON_NATIVE_TYPE);
115
115
  }
116
116
  const codecDescriptors = [arktypeJsonDescriptor];
117
-
118
117
  //#endregion
119
118
  export { codecDescriptors as i, ARKTYPE_JSON_NATIVE_TYPE as n, arktypeJsonColumn as r, ARKTYPE_JSON_CODEC_ID as t };
120
- //# sourceMappingURL=arktype-json-codec-Cykol-li.mjs.map
119
+
120
+ //# sourceMappingURL=arktype-json-codec-DluUG3EZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arktype-json-codec-DluUG3EZ.mjs","names":[],"sources":["../src/core/arktype-json-codec.ts"],"sourcesContent":["/**\n * Arktype-json codec (TML-2357).\n *\n * Spec § Case 3: method-level generic over `S extends Type<unknown>`. The schema's TypeScript-level inferred type `S['infer']` is only available at the column-author site (where the user passes their typed schema), not at the descriptor's factory site (where only the serialized IR is available). This drives the shape:\n *\n * 1. {@link ArktypeJsonCodecClass} extends {@link CodecImpl} and is generic over `TInferred` — the application-level JS type the schema validates to. The constructor takes both the descriptor (for `id` proxy) and the rehydrated arktype `Type` (closure-captured so encode/decode/encodeJson/decodeJson can validate through it). 2. {@link ArktypeJsonDescriptor} extends {@link CodecDescriptorImpl} over {@link\n * ArktypeJsonTypeParams}. Factory rehydrates the schema from `params.jsonIr` and returns `(ctx) => new ArktypeJsonCodecClass<unknown>(this, schema)` — `S` is erased to `unknown` because the descriptor only sees IR. The runtime path through `descriptor.factory(params)` always exists (e.g. for `validateContract` re-materialization); it just loses the typed inferred shape. 3. {@link arktypeJsonColumn} is the column-author\n * surface with the method-level generic over `S extends Type<unknown>`. It bypasses `descriptor.factory` because `S` is only available here, instead constructing the typed codec directly so `S['infer']` flows through `codecFactory`'s return into the column site's resolved output type. Eager serialization at this call site captures `expression` (for the emit-path renderer) and `jsonIr` (for runtime rehydration).\n *\n * `satisfies ColumnHelperFor<ArktypeJsonDescriptor>` (coarse) is applied — the typeParams shape is verified. `ColumnHelperForStrict` is intentionally skipped: the descriptor's factory return is `ArktypeJsonCodecClass<unknown>` while the helper produces `ArktypeJsonCodecClass<S['infer']>`, and `Codec`'s `TInput` is invariant (used contravariantly in `encode`, covariantly in `decode`/`encodeJson`/`decodeJson`). Strict\n * assignment fails by design; the explicit `expectTypeOf` tests in `test/arktype-json-codec.types.test-d.ts` cover the literal-preservation property the strict variant would otherwise enforce.\n */\n\nimport type { JsonValue } from '@prisma-next/contract/types';\nimport {\n type AnyCodecDescriptor,\n type CodecCallContext,\n CodecDescriptorImpl,\n CodecImpl,\n type CodecInstanceContext,\n type ColumnHelperFor,\n type ColumnSpec,\n column,\n} from '@prisma-next/framework-components/codec';\nimport { runtimeError } from '@prisma-next/framework-components/runtime';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport { ArkErrors, ark, type Type, type } from 'arktype';\n\n/** Codec id for arktype-backed JSON columns. Library-bound, not target-bound. */\nexport const ARKTYPE_JSON_CODEC_ID = 'arktype/json@1' as const;\n\n/** Native storage type backing the codec. JSONB on Postgres; binary, indexable. */\nexport const ARKTYPE_JSON_NATIVE_TYPE = 'jsonb' as const;\n\n/**\n * Eagerly serialized typeParams for the arktype-json column. Carried in the contract IR; the runtime descriptor's factory rehydrates `jsonIr` and the emitter consumes `expression`.\n */\nexport type ArktypeJsonTypeParams = {\n /**\n * Arktype's TypeScript-source-like rendering of the schema. Read by `renderOutputType` to emit the column's TS type into `contract.d.ts`. Stable across the serialize/rehydrate cycle: the rehydrated schema's `expression` matches the source schema's.\n */\n readonly expression: string;\n /**\n * Arktype's internal IR for the schema. Lossless; the rehydration source. Schema-shape — `ark.schema(jsonIr)` reconstructs a callable `Type`-like structurally identical to the original `type(definition)` output.\n */\n readonly jsonIr: object;\n};\n\ntype ArktypeSchemaLike = ((value: unknown) => unknown) & {\n readonly expression: string;\n};\n\nfunction isArktypeSchemaLike(value: unknown): value is ArktypeSchemaLike {\n if (typeof value !== 'function') return false;\n const expression = (value as { readonly expression?: unknown }).expression;\n return typeof expression === 'string';\n}\n\nfunction validateSchema<TInferred>(schema: ArktypeSchemaLike, value: unknown): TInferred {\n const result = schema(value);\n if (result instanceof ArkErrors) {\n throw runtimeError(\n 'RUNTIME.JSON_SCHEMA_VALIDATION_FAILED',\n `arktype-json schema validation failed (decode): ${result.summary}`,\n { codecId: ARKTYPE_JSON_CODEC_ID, issues: result.summary },\n );\n }\n return result as TInferred;\n}\n\nfunction serializeToJsonSafe<TInferred>(\n schema: ArktypeSchemaLike,\n value: TInferred,\n): { wire: string; json: JsonValue } {\n const wire: string | undefined = JSON.stringify(value);\n if (typeof wire !== 'string') {\n throw runtimeError(\n 'RUNTIME.JSON_SCHEMA_VALIDATION_FAILED',\n `arktype-json value is not representable as JSON (codecId: ${ARKTYPE_JSON_CODEC_ID})`,\n { codecId: ARKTYPE_JSON_CODEC_ID },\n );\n }\n const json = JSON.parse(wire) as JsonValue;\n validateSchema(schema, json);\n return { wire, json };\n}\n\nfunction rehydrateSchema(jsonIr: object): ArktypeSchemaLike {\n let rehydrated: unknown;\n try {\n rehydrated = ark.schema(jsonIr);\n } catch (error) {\n throw runtimeError(\n 'RUNTIME.JSON_SCHEMA_VALIDATION_FAILED',\n /* c8 ignore next — the `String(error)` fallback covers throws of non-Error values; arktype only throws Error subclasses, so this branch is defensive only. */\n `Failed to rehydrate arktype schema from contract IR: ${error instanceof Error ? error.message : String(error)}`,\n { codecId: ARKTYPE_JSON_CODEC_ID, jsonIr },\n );\n }\n /* c8 ignore start — defensive: ark.schema either throws (handled above) or returns a callable Type with `expression: string`. The structural guard is kept so a future ark internal change can't silently slip a non-callable past us. */\n if (!isArktypeSchemaLike(rehydrated)) {\n throw runtimeError(\n 'RUNTIME.JSON_SCHEMA_VALIDATION_FAILED',\n `Rehydrated arktype schema does not have the expected callable + 'expression: string' shape (codecId: ${ARKTYPE_JSON_CODEC_ID})`,\n { codecId: ARKTYPE_JSON_CODEC_ID, jsonIr },\n );\n }\n /* c8 ignore stop */\n return rehydrated;\n}\n\nfunction renderArktypeJsonOutputType(params: ArktypeJsonTypeParams): string {\n const expression = params.expression.trim();\n return expression.length > 0 ? expression : 'unknown';\n}\n\nexport class ArktypeJsonCodecClass<TInferred> extends CodecImpl<\n typeof ARKTYPE_JSON_CODEC_ID,\n readonly ['equality'],\n string,\n TInferred\n> {\n constructor(\n descriptor: ArktypeJsonDescriptor,\n private readonly schema: ArktypeSchemaLike,\n ) {\n super(descriptor);\n }\n\n async encode(value: TInferred, _ctx: CodecCallContext): Promise<string> {\n return serializeToJsonSafe(this.schema, value).wire;\n }\n\n async decode(wire: string, _ctx: CodecCallContext): Promise<TInferred> {\n return validateSchema<TInferred>(this.schema, JSON.parse(wire));\n }\n\n encodeJson(value: TInferred): JsonValue {\n return serializeToJsonSafe(this.schema, value).json;\n }\n\n decodeJson(json: JsonValue): TInferred {\n return validateSchema<TInferred>(this.schema, json);\n }\n}\n\nconst arktypeJsonParamsSchema = type({\n expression: 'string',\n jsonIr: 'object',\n}) satisfies StandardSchemaV1<ArktypeJsonTypeParams>;\n\nexport class ArktypeJsonDescriptor extends CodecDescriptorImpl<ArktypeJsonTypeParams> {\n override readonly codecId = ARKTYPE_JSON_CODEC_ID;\n override readonly traits = ['equality'] as const;\n override readonly targetTypes = [ARKTYPE_JSON_NATIVE_TYPE] as const;\n override readonly paramsSchema: StandardSchemaV1<ArktypeJsonTypeParams> = arktypeJsonParamsSchema;\n override renderOutputType(params: ArktypeJsonTypeParams): string {\n return renderArktypeJsonOutputType(params);\n }\n override factory(\n params: ArktypeJsonTypeParams,\n ): (ctx: CodecInstanceContext) => ArktypeJsonCodecClass<unknown> {\n const schema = rehydrateSchema(params.jsonIr);\n /* c8 ignore start — defensive parity check; not exercised by typical contracts */\n const rehydratedExpression = (schema as { readonly expression?: unknown }).expression;\n if (typeof rehydratedExpression === 'string' && rehydratedExpression !== params.expression) {\n console.warn(\n `[arktype-json] typeParams.expression (${params.expression}) does not match rehydrated schema expression (${rehydratedExpression}); contract.json may be stale relative to the runtime schema.`,\n );\n }\n /* c8 ignore stop */\n return () => new ArktypeJsonCodecClass<unknown>(this, schema);\n }\n}\n\nexport const arktypeJsonDescriptor = new ArktypeJsonDescriptor();\n\n/**\n * Per-codec column helper for `arktype/json@1`. Method-level generic over `S extends Type<unknown>` so the column site preserves the schema's inferred TS type in the resolved codec (`ArktypeJsonCodecClass<S['infer']>`). Bypasses `descriptor.factory` because `S` is only available at the column-author site; constructs the typed codec directly with the closure-captured schema.\n *\n * Eager serialization at this call site captures `expression` (for the emit-path renderer) and `jsonIr` (for runtime rehydration via the descriptor's factory).\n *\n * @throws {Error} if the schema doesn't expose `expression` and `json` fields (i.e. is not an arktype `Type`). Validates the schema shape at the call site so configuration errors surface during contract authoring, not at runtime.\n */\nexport function arktypeJsonColumn<S extends Type<unknown>>(\n schema: S,\n): ColumnSpec<ArktypeJsonCodecClass<S['infer']>, ArktypeJsonTypeParams> {\n if (!isArktypeSchemaLike(schema)) {\n throw new Error(\n typeof schema !== 'function'\n ? 'arktypeJsonColumn(schema) expects a callable arktype Type.'\n : 'arktypeJsonColumn(schema) expects an arktype Type (missing `expression: string`).',\n );\n }\n const jsonIr: unknown = (schema as { readonly json?: unknown }).json;\n if (jsonIr === null || typeof jsonIr !== 'object') {\n throw new Error('arktypeJsonColumn(schema) expects an arktype Type (missing `json` IR).');\n }\n const params: ArktypeJsonTypeParams = { expression: schema.expression, jsonIr };\n return column(\n (_ctx: CodecInstanceContext) =>\n new ArktypeJsonCodecClass<S['infer']>(arktypeJsonDescriptor, schema),\n arktypeJsonDescriptor.codecId,\n params,\n ARKTYPE_JSON_NATIVE_TYPE,\n );\n}\n\narktypeJsonColumn satisfies ColumnHelperFor<ArktypeJsonDescriptor>;\n// Note: `ColumnHelperForStrict` is intentionally not applied — `Codec` is invariant in `TInput` (encode contravariant, decode covariant), so `ArktypeJsonCodecClass<S['infer']>` is not assignable to `ArktypeJsonCodecClass<unknown>` (the descriptor.factory return). `expectTypeOf` tests cover the literal-preservation property strict satisfies would otherwise enforce.\n\n/**\n * Codec instance returned by `arktypeJsonColumn(schema).codecFactory(ctx)` and by `arktypeJsonDescriptor.factory(typeParams)(ctx)`. The `TInferred` slot carries the arktype schema's inferred output type at the column-author site; descriptor-side factories erase to `unknown`.\n */\nexport type ArktypeJsonCodec<TInferred> = ArktypeJsonCodecClass<TInferred>;\n\nexport const codecDescriptors: readonly AnyCodecDescriptor[] = [arktypeJsonDescriptor];\n"],"mappings":";;;;;AA6BA,MAAa,wBAAwB;;AAGrC,MAAa,2BAA2B;AAoBxC,SAAS,oBAAoB,OAA4C;CACvE,IAAI,OAAO,UAAU,YAAY,OAAO;CAExC,OAAO,OADa,MAA4C,eACnC;;AAG/B,SAAS,eAA0B,QAA2B,OAA2B;CACvF,MAAM,SAAS,OAAO,MAAM;CAC5B,IAAI,kBAAkB,WACpB,MAAM,aACJ,yCACA,mDAAmD,OAAO,WAC1D;EAAE,SAAS;EAAuB,QAAQ,OAAO;EAAS,CAC3D;CAEH,OAAO;;AAGT,SAAS,oBACP,QACA,OACmC;CACnC,MAAM,OAA2B,KAAK,UAAU,MAAM;CACtD,IAAI,OAAO,SAAS,UAClB,MAAM,aACJ,yCACA,6DAA6D,sBAAsB,IACnF,EAAE,SAAS,uBAAuB,CACnC;CAEH,MAAM,OAAO,KAAK,MAAM,KAAK;CAC7B,eAAe,QAAQ,KAAK;CAC5B,OAAO;EAAE;EAAM;EAAM;;AAGvB,SAAS,gBAAgB,QAAmC;CAC1D,IAAI;CACJ,IAAI;EACF,aAAa,IAAI,OAAO,OAAO;UACxB,OAAO;EACd,MAAM;GACJ;;GAEA,wDAAwD,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;GAC9G;IAAE,SAAS;IAAuB;IAAQ;GAC3C;;;CAGH,IAAI,CAAC,oBAAoB,WAAW,EAClC,MAAM,aACJ,yCACA,wGAAwG,sBAAsB,IAC9H;EAAE,SAAS;EAAuB;EAAQ,CAC3C;;CAGH,OAAO;;AAGT,SAAS,4BAA4B,QAAuC;CAC1E,MAAM,aAAa,OAAO,WAAW,MAAM;CAC3C,OAAO,WAAW,SAAS,IAAI,aAAa;;AAG9C,IAAa,wBAAb,cAAsD,UAKpD;CAGmB;CAFnB,YACE,YACA,QACA;EACA,MAAM,WAAW;EAFA,KAAA,SAAA;;CAKnB,MAAM,OAAO,OAAkB,MAAyC;EACtE,OAAO,oBAAoB,KAAK,QAAQ,MAAM,CAAC;;CAGjD,MAAM,OAAO,MAAc,MAA4C;EACrE,OAAO,eAA0B,KAAK,QAAQ,KAAK,MAAM,KAAK,CAAC;;CAGjE,WAAW,OAA6B;EACtC,OAAO,oBAAoB,KAAK,QAAQ,MAAM,CAAC;;CAGjD,WAAW,MAA4B;EACrC,OAAO,eAA0B,KAAK,QAAQ,KAAK;;;AAIvD,MAAM,0BAA0B,KAAK;CACnC,YAAY;CACZ,QAAQ;CACT,CAAC;AAEF,IAAa,wBAAb,cAA2C,oBAA2C;CACpF,UAA4B;CAC5B,SAA2B,CAAC,WAAW;CACvC,cAAgC,CAAC,yBAAyB;CAC1D,eAA0E;CAC1E,iBAA0B,QAAuC;EAC/D,OAAO,4BAA4B,OAAO;;CAE5C,QACE,QAC+D;EAC/D,MAAM,SAAS,gBAAgB,OAAO,OAAO;;EAE7C,MAAM,uBAAwB,OAA6C;EAC3E,IAAI,OAAO,yBAAyB,YAAY,yBAAyB,OAAO,YAC9E,QAAQ,KACN,yCAAyC,OAAO,WAAW,iDAAiD,qBAAqB,+DAClI;;EAGH,aAAa,IAAI,sBAA+B,MAAM,OAAO;;;AAIjE,MAAa,wBAAwB,IAAI,uBAAuB;;;;;;;;AAShE,SAAgB,kBACd,QACsE;CACtE,IAAI,CAAC,oBAAoB,OAAO,EAC9B,MAAM,IAAI,MACR,OAAO,WAAW,aACd,+DACA,oFACL;CAEH,MAAM,SAAmB,OAAuC;CAChE,IAAI,WAAW,QAAQ,OAAO,WAAW,UACvC,MAAM,IAAI,MAAM,yEAAyE;CAE3F,MAAM,SAAgC;EAAE,YAAY,OAAO;EAAY;EAAQ;CAC/E,OAAO,QACJ,SACC,IAAI,sBAAkC,uBAAuB,OAAO,EACtE,sBAAsB,SACtB,QACA,yBACD;;AAWH,MAAa,mBAAkD,CAAC,sBAAsB"}
@@ -4,7 +4,6 @@ import { JsonValue } from "@prisma-next/contract/types";
4
4
  import { StandardSchemaV1 } from "@standard-schema/spec";
5
5
 
6
6
  //#region src/core/arktype-json-codec.d.ts
7
-
8
7
  /** Codec id for arktype-backed JSON columns. Library-bound, not target-bound. */
9
8
  declare const ARKTYPE_JSON_CODEC_ID: "arktype/json@1";
10
9
  /** Native storage type backing the codec. JSONB on Postgres; binary, indexable. */
@@ -55,4 +54,4 @@ declare function arktypeJsonColumn<S extends Type<unknown>>(schema: S): ColumnSp
55
54
  type ArktypeJsonCodec<TInferred> = ArktypeJsonCodecClass<TInferred>;
56
55
  //#endregion
57
56
  export { ArktypeJsonTypeParams as a, ArktypeJsonDescriptor as i, ARKTYPE_JSON_NATIVE_TYPE as n, arktypeJsonColumn as o, ArktypeJsonCodec as r, ARKTYPE_JSON_CODEC_ID as t };
58
- //# sourceMappingURL=arktype-json-codec-DBfCWQkt.d.mts.map
57
+ //# sourceMappingURL=arktype-json-codec-VX9T28RG.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arktype-json-codec-VX9T28RG.d.mts","names":[],"sources":["../src/core/arktype-json-codec.ts"],"mappings":";;;;;;AAqCA;AAAA,cARa,qBAAA;;cAGA,wBAAA;;AAcX;;KATU,qBAAA;EAWe;;AAoE3B;EApE2B,SAPhB,UAAA;EA2EuB;;;EAAA,SAvEvB,MAAA;AAAA;AAAA,KAGN,iBAAA,KAAsB,KAAA;EAAA,SAChB,UAAA;AAAA;AAAA,cAmEE,qBAAA,oBAAyC,SAAA,QAC7C,qBAAA,iCAGP,SAAA;EAAA,iBAImB,MAAA;cADjB,UAAA,EAAY,qBAAA,EACK,MAAA,EAAQ,iBAAA;EAKrB,MAAA,CAAO,KAAA,EAAO,SAAA,EAAW,IAAA,EAAM,gBAAA,GAAmB,OAAA;EAIlD,MAAA,CAAO,IAAA,UAAc,IAAA,EAAM,gBAAA,GAAmB,OAAA,CAAQ,SAAA;EAI5D,UAAA,CAAW,KAAA,EAAO,SAAA,GAAY,SAAA;EAI9B,UAAA,CAAW,IAAA,EAAM,SAAA,GAAY,SAAA;AAAA;AAAA,cAUlB,qBAAA,SAA8B,mBAAA,CAAoB,qBAAA;EAAA,SAC3C,OAAA;EAAA,SACA,MAAA;EAAA,SACA,WAAA;EAAA,SACA,YAAA,EAAc,gBAAA,CAAiB,qBAAA;EACxC,gBAAA,CAAiB,MAAA,EAAQ,qBAAA;EAGzB,OAAA,CACP,MAAA,EAAQ,qBAAA,IACN,GAAA,EAAK,oBAAA,KAAyB,qBAAA;AAAA;;;;;;;;iBAuBpB,iBAAA,WAA4B,IAAA,UAAA,CAC1C,MAAA,EAAQ,CAAA,GACP,UAAA,CAAW,qBAAA,CAAsB,CAAA,YAAa,qBAAA;;;;KA4BrC,gBAAA,cAA8B,qBAAA,CAAsB,SAAA"}
@@ -24,4 +24,4 @@ type CodecTypes = {
24
24
  };
25
25
  //#endregion
26
26
  export { CodecTypes as t };
27
- //# sourceMappingURL=codec-types-5Jy4t54u.d.mts.map
27
+ //# sourceMappingURL=codec-types-DY2DS594.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-types-DY2DS594.d.mts","names":[],"sources":["../src/types/codec-types.ts"],"mappings":";;AAiBA;;;;;;;;;;;;;;;KAAY,UAAA;EAAA,SACD,gBAAA;IAAA,SACE,KAAA;IAAA,SACA,MAAA;IAAA,SACA,MAAA;EAAA;AAAA"}
@@ -1,2 +1,2 @@
1
- import { t as CodecTypes } from "./codec-types-5Jy4t54u.mjs";
1
+ import { t as CodecTypes } from "./codec-types-DY2DS594.mjs";
2
2
  export { type CodecTypes };
@@ -1 +1 @@
1
- export { };
1
+ export {};
package/dist/codecs.d.mts CHANGED
@@ -1,8 +1,7 @@
1
- import { a as ArktypeJsonTypeParams, i as ArktypeJsonDescriptor, n as ARKTYPE_JSON_NATIVE_TYPE, o as arktypeJsonColumn, r as ArktypeJsonCodec, t as ARKTYPE_JSON_CODEC_ID } from "./arktype-json-codec-DBfCWQkt.mjs";
1
+ import { a as ArktypeJsonTypeParams, i as ArktypeJsonDescriptor, n as ARKTYPE_JSON_NATIVE_TYPE, o as arktypeJsonColumn, r as ArktypeJsonCodec, t as ARKTYPE_JSON_CODEC_ID } from "./arktype-json-codec-VX9T28RG.mjs";
2
2
  import { CodecDescriptorRegistry } from "@prisma-next/sql-relational-core/query-lane-context";
3
3
 
4
4
  //#region src/core/registry.d.ts
5
-
6
5
  /**
7
6
  * Registry of every codec descriptor shipped by `@prisma-next/extension-arktype-json`.
8
7
  *
@@ -1 +1 @@
1
- {"version":3,"file":"codecs.d.mts","names":[],"sources":["../src/core/registry.ts"],"sourcesContent":[],"mappings":";;;;;;;;AASA;;cAAa,0BAA0B"}
1
+ {"version":3,"file":"codecs.d.mts","names":[],"sources":["../src/core/registry.ts"],"mappings":";;;;;;;AASA;;cAAa,wBAAA,EAA0B,uBAAA"}
package/dist/codecs.mjs CHANGED
@@ -1,4 +1,3 @@
1
- import { n as ARKTYPE_JSON_NATIVE_TYPE, r as arktypeJsonColumn, t as ARKTYPE_JSON_CODEC_ID } from "./arktype-json-codec-Cykol-li.mjs";
2
- import { t as arktypeJsonCodecRegistry } from "./registry-DN6MqSGJ.mjs";
3
-
4
- export { ARKTYPE_JSON_CODEC_ID, ARKTYPE_JSON_NATIVE_TYPE, arktypeJsonCodecRegistry, arktypeJsonColumn };
1
+ import { n as ARKTYPE_JSON_NATIVE_TYPE, r as arktypeJsonColumn, t as ARKTYPE_JSON_CODEC_ID } from "./arktype-json-codec-DluUG3EZ.mjs";
2
+ import { t as arktypeJsonCodecRegistry } from "./registry-CfU1C3-F.mjs";
3
+ export { ARKTYPE_JSON_CODEC_ID, ARKTYPE_JSON_NATIVE_TYPE, arktypeJsonCodecRegistry, arktypeJsonColumn };
@@ -1,2 +1,2 @@
1
- import { a as ArktypeJsonTypeParams, o as arktypeJsonColumn, r as ArktypeJsonCodec } from "./arktype-json-codec-DBfCWQkt.mjs";
1
+ import { a as ArktypeJsonTypeParams, o as arktypeJsonColumn, r as ArktypeJsonCodec } from "./arktype-json-codec-VX9T28RG.mjs";
2
2
  export { type ArktypeJsonCodec, type ArktypeJsonTypeParams, arktypeJsonColumn as arktypeJson };
@@ -1,3 +1,2 @@
1
- import { r as arktypeJsonColumn } from "./arktype-json-codec-Cykol-li.mjs";
2
-
3
- export { arktypeJsonColumn as arktypeJson };
1
+ import { r as arktypeJsonColumn } from "./arktype-json-codec-DluUG3EZ.mjs";
2
+ export { arktypeJsonColumn as arktypeJson };
@@ -1,7 +1,6 @@
1
1
  import { SqlControlExtensionDescriptor } from "@prisma-next/family-sql/control";
2
2
 
3
3
  //#region src/exports/control.d.ts
4
-
5
4
  declare const arktypeJsonExtensionDescriptor: SqlControlExtensionDescriptor<'postgres'>;
6
5
  //#endregion
7
6
  export { arktypeJsonExtensionDescriptor, arktypeJsonExtensionDescriptor as default };
@@ -1 +1 @@
1
- {"version":3,"file":"control.d.mts","names":[],"sources":["../src/exports/control.ts"],"sourcesContent":[],"mappings":";;;;cA0Ba,gCAAgC"}
1
+ {"version":3,"file":"control.d.mts","names":[],"sources":["../src/exports/control.ts"],"mappings":";;;cA0Ba,8BAAA,EAAgC,6BAAA"}
package/dist/control.mjs CHANGED
@@ -1,7 +1,5 @@
1
- import { t as ARKTYPE_JSON_CODEC_ID } from "./arktype-json-codec-Cykol-li.mjs";
2
- import "./registry-DN6MqSGJ.mjs";
3
- import { t as arktypeJsonPackMeta } from "./pack-meta-BaJhoZfD.mjs";
4
-
1
+ import { t as ARKTYPE_JSON_CODEC_ID } from "./arktype-json-codec-DluUG3EZ.mjs";
2
+ import { t as arktypeJsonPackMeta } from "./pack-meta-TjNpp3sc.mjs";
5
3
  //#region src/exports/control.ts
6
4
  const arktypeJsonControlPlaneHooks = { expandNativeType: ({ nativeType }) => nativeType };
7
5
  const arktypeJsonExtensionDescriptor = {
@@ -18,8 +16,7 @@ const arktypeJsonExtensionDescriptor = {
18
16
  targetId: "postgres"
19
17
  })
20
18
  };
21
- var control_default = arktypeJsonExtensionDescriptor;
22
-
23
19
  //#endregion
24
- export { arktypeJsonExtensionDescriptor, control_default as default };
20
+ export { arktypeJsonExtensionDescriptor, arktypeJsonExtensionDescriptor as default };
21
+
25
22
  //# sourceMappingURL=control.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"control.mjs","names":["arktypeJsonControlPlaneHooks: CodecControlHooks","arktypeJsonExtensionDescriptor: SqlControlExtensionDescriptor<'postgres'>"],"sources":["../src/exports/control.ts"],"sourcesContent":["/**\n * Control-plane extension descriptor for arktype-json.\n *\n * Composes pack metadata and the control-plane hooks into the migration-\n * plane shape the framework's control stack consumes. Lives at the\n * control-plane entrypoint so `src/core/**` stays free of migration-plane\n * imports (per `.cursor/rules/multi-plane-entrypoints.mdc`).\n *\n * Unlike pgvector, arktype-json has no database extension to install\n * (`jsonb` is a built-in Postgres type), no `databaseDependencies`, no\n * query operations, and the only control-plane hook is the identity\n * `expandNativeType` (jsonb is dimension-free; the schema in typeParams\n * affects runtime validation only, never DDL).\n */\n\nimport type {\n CodecControlHooks,\n SqlControlExtensionDescriptor,\n} from '@prisma-next/family-sql/control';\nimport { ARKTYPE_JSON_CODEC_ID } from '../core/arktype-json-codec';\nimport { arktypeJsonPackMeta } from '../core/pack-meta';\n\nconst arktypeJsonControlPlaneHooks: CodecControlHooks = {\n expandNativeType: ({ nativeType }) => nativeType,\n};\n\nexport const arktypeJsonExtensionDescriptor: SqlControlExtensionDescriptor<'postgres'> = {\n ...arktypeJsonPackMeta,\n types: {\n ...arktypeJsonPackMeta.types,\n codecTypes: {\n ...arktypeJsonPackMeta.types.codecTypes,\n controlPlaneHooks: {\n [ARKTYPE_JSON_CODEC_ID]: arktypeJsonControlPlaneHooks,\n },\n },\n },\n create: () => ({\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n }),\n};\n\nexport default arktypeJsonExtensionDescriptor;\n"],"mappings":";;;;;AAsBA,MAAMA,+BAAkD,EACtD,mBAAmB,EAAE,iBAAiB,YACvC;AAED,MAAaC,iCAA4E;CACvF,GAAG;CACH,OAAO;EACL,GAAG,oBAAoB;EACvB,YAAY;GACV,GAAG,oBAAoB,MAAM;GAC7B,mBAAmB,GAChB,wBAAwB,8BAC1B;GACF;EACF;CACD,eAAe;EACb,UAAU;EACV,UAAU;EACX;CACF;AAED,sBAAe"}
1
+ {"version":3,"file":"control.mjs","names":[],"sources":["../src/exports/control.ts"],"sourcesContent":["/**\n * Control-plane extension descriptor for arktype-json.\n *\n * Composes pack metadata and the control-plane hooks into the migration-\n * plane shape the framework's control stack consumes. Lives at the\n * control-plane entrypoint so `src/core/**` stays free of migration-plane\n * imports (per `.cursor/rules/multi-plane-entrypoints.mdc`).\n *\n * Unlike pgvector, arktype-json has no database extension to install\n * (`jsonb` is a built-in Postgres type), no `databaseDependencies`, no\n * query operations, and the only control-plane hook is the identity\n * `expandNativeType` (jsonb is dimension-free; the schema in typeParams\n * affects runtime validation only, never DDL).\n */\n\nimport type {\n CodecControlHooks,\n SqlControlExtensionDescriptor,\n} from '@prisma-next/family-sql/control';\nimport { ARKTYPE_JSON_CODEC_ID } from '../core/arktype-json-codec';\nimport { arktypeJsonPackMeta } from '../core/pack-meta';\n\nconst arktypeJsonControlPlaneHooks: CodecControlHooks = {\n expandNativeType: ({ nativeType }) => nativeType,\n};\n\nexport const arktypeJsonExtensionDescriptor: SqlControlExtensionDescriptor<'postgres'> = {\n ...arktypeJsonPackMeta,\n types: {\n ...arktypeJsonPackMeta.types,\n codecTypes: {\n ...arktypeJsonPackMeta.types.codecTypes,\n controlPlaneHooks: {\n [ARKTYPE_JSON_CODEC_ID]: arktypeJsonControlPlaneHooks,\n },\n },\n },\n create: () => ({\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n }),\n};\n\nexport default arktypeJsonExtensionDescriptor;\n"],"mappings":";;;AAsBA,MAAM,+BAAkD,EACtD,mBAAmB,EAAE,iBAAiB,YACvC;AAED,MAAa,iCAA4E;CACvF,GAAG;CACH,OAAO;EACL,GAAG,oBAAoB;EACvB,YAAY;GACV,GAAG,oBAAoB,MAAM;GAC7B,mBAAmB,GAChB,wBAAwB,8BAC1B;GACF;EACF;CACD,eAAe;EACb,UAAU;EACV,UAAU;EACX;CACF"}
@@ -1,8 +1,9 @@
1
- import { t as ARKTYPE_JSON_CODEC_ID } from "./arktype-json-codec-Cykol-li.mjs";
2
- import { t as arktypeJsonCodecRegistry } from "./registry-DN6MqSGJ.mjs";
3
-
4
- //#region src/core/pack-meta.ts
5
- const arktypeJsonPackMetaBase = {
1
+ import { t as ARKTYPE_JSON_CODEC_ID } from "./arktype-json-codec-DluUG3EZ.mjs";
2
+ import { t as arktypeJsonCodecRegistry } from "./registry-CfU1C3-F.mjs";
3
+ /**
4
+ * Public pack metadata. The phantom `__codecTypes` field threads the codec-types map's literal type into the pack ref so contract-builder generics can pick it up; it is never accessed at runtime.
5
+ */
6
+ const arktypeJsonPackMeta = {
6
7
  kind: "extension",
7
8
  id: "arktype-json",
8
9
  familyId: "sql",
@@ -26,11 +27,7 @@ const arktypeJsonPackMetaBase = {
26
27
  }]
27
28
  }
28
29
  };
29
- /**
30
- * Public pack metadata. The phantom `__codecTypes` field threads the codec-types map's literal type into the pack ref so contract-builder generics can pick it up; it is never accessed at runtime.
31
- */
32
- const arktypeJsonPackMeta = arktypeJsonPackMetaBase;
33
-
34
30
  //#endregion
35
31
  export { arktypeJsonPackMeta as t };
36
- //# sourceMappingURL=pack-meta-BaJhoZfD.mjs.map
32
+
33
+ //# sourceMappingURL=pack-meta-TjNpp3sc.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pack-meta-TjNpp3sc.mjs","names":[],"sources":["../src/core/pack-meta.ts"],"sourcesContent":["/**\n * arktype-json pack metadata.\n *\n * The pack metadata is the framework-composition entry point: control-stack assembly reads `types.codecTypes.import` to thread the type-side imports into emitted `contract.d.ts`, and `types.storage` declares the codec id's storage backing (`jsonb` on Postgres).\n *\n * Per TML-2357 runtime materialization flows through the unified descriptor map (`arktypeJsonDescriptor`) and the emit path consults `descriptorFor('arktype/json@1').renderOutputType` directly — no per-library \"emit-only Codec\" stub.\n */\n\nimport type { CodecTypes } from '../types/codec-types';\nimport { ARKTYPE_JSON_CODEC_ID } from './arktype-json-codec';\nimport { arktypeJsonCodecRegistry } from './registry';\n\nconst arktypeJsonPackMetaBase = {\n kind: 'extension',\n id: 'arktype-json',\n familyId: 'sql',\n targetId: 'postgres',\n version: '0.0.1',\n capabilities: {},\n types: {\n codecTypes: {\n codecDescriptors: Array.from(arktypeJsonCodecRegistry.values()),\n import: {\n package: '@prisma-next/extension-arktype-json/codec-types',\n named: 'CodecTypes',\n alias: 'ArktypeJsonTypes',\n },\n },\n storage: [\n {\n typeId: ARKTYPE_JSON_CODEC_ID,\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n nativeType: 'jsonb',\n },\n ],\n },\n} as const;\n\n/**\n * Public pack metadata. The phantom `__codecTypes` field threads the codec-types map's literal type into the pack ref so contract-builder generics can pick it up; it is never accessed at runtime.\n */\nexport const arktypeJsonPackMeta: typeof arktypeJsonPackMetaBase & {\n readonly __codecTypes?: CodecTypes;\n} = arktypeJsonPackMetaBase;\n"],"mappings":";;;;;AA0CA,MAAa,sBAET;CA/BF,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV,SAAS;CACT,cAAc,EAAE;CAChB,OAAO;EACL,YAAY;GACV,kBAAkB,MAAM,KAAK,yBAAyB,QAAQ,CAAC;GAC/D,QAAQ;IACN,SAAS;IACT,OAAO;IACP,OAAO;IACR;GACF;EACD,SAAS,CACP;GACE,QAAQ;GACR,UAAU;GACV,UAAU;GACV,YAAY;GACb,CACF;EACF;CAQC"}
package/dist/pack.d.mts CHANGED
@@ -1,8 +1,7 @@
1
- import { t as CodecTypes } from "./codec-types-5Jy4t54u.mjs";
2
- import * as _prisma_next_framework_components_codec0 from "@prisma-next/framework-components/codec";
1
+ import { t as CodecTypes } from "./codec-types-DY2DS594.mjs";
2
+ import * as _$_prisma_next_framework_components_codec0 from "@prisma-next/framework-components/codec";
3
3
 
4
4
  //#region src/core/pack-meta.d.ts
5
-
6
5
  declare const arktypeJsonPackMetaBase: {
7
6
  readonly kind: "extension";
8
7
  readonly id: "arktype-json";
@@ -12,7 +11,7 @@ declare const arktypeJsonPackMetaBase: {
12
11
  readonly capabilities: {};
13
12
  readonly types: {
14
13
  readonly codecTypes: {
15
- readonly codecDescriptors: _prisma_next_framework_components_codec0.CodecDescriptor<unknown>[];
14
+ readonly codecDescriptors: _$_prisma_next_framework_components_codec0.CodecDescriptor<unknown>[];
16
15
  readonly import: {
17
16
  readonly package: "@prisma-next/extension-arktype-json/codec-types";
18
17
  readonly named: "CodecTypes";
@@ -1 +1 @@
1
- {"version":3,"file":"pack.d.mts","names":[],"sources":["../src/core/pack-meta.ts"],"sourcesContent":[],"mappings":";;;;;cAYM;;;;;;;;;iCAyBI,wCAAA,CAAA;;;;;;;;;;;;;;;;;;cAKG,4BAA4B;0BACf"}
1
+ {"version":3,"file":"pack.d.mts","names":[],"sources":["../src/core/pack-meta.ts"],"mappings":";;;;cAYM,uBAAA;EAAA;;;;;;;;iCAyBI,0CAAA,CAAA,eAAA;MAAA;;;;;;;;;;;;;;;;;cAKG,mBAAA,SAA4B,uBAAA;EAAA,SAC9B,YAAA,GAAe,UAAA;AAAA"}
package/dist/pack.mjs CHANGED
@@ -1,5 +1,2 @@
1
- import "./arktype-json-codec-Cykol-li.mjs";
2
- import "./registry-DN6MqSGJ.mjs";
3
- import { t as arktypeJsonPackMeta } from "./pack-meta-BaJhoZfD.mjs";
4
-
5
- export { arktypeJsonPackMeta, arktypeJsonPackMeta as default };
1
+ import { t as arktypeJsonPackMeta } from "./pack-meta-TjNpp3sc.mjs";
2
+ export { arktypeJsonPackMeta, arktypeJsonPackMeta as default };
@@ -1,6 +1,5 @@
1
- import { i as codecDescriptors } from "./arktype-json-codec-Cykol-li.mjs";
1
+ import { i as codecDescriptors } from "./arktype-json-codec-DluUG3EZ.mjs";
2
2
  import { buildCodecDescriptorRegistry } from "@prisma-next/sql-relational-core/codec-descriptor-registry";
3
-
4
3
  //#region src/core/registry.ts
5
4
  /**
6
5
  * Registry of every codec descriptor shipped by `@prisma-next/extension-arktype-json`.
@@ -8,7 +7,7 @@ import { buildCodecDescriptorRegistry } from "@prisma-next/sql-relational-core/c
8
7
  * Public consumer surface for the arktype-json codec set. Currently a single entry (`arktype/json@1`); the registry shape stays consistent with the other codec-shipping packages so consumers don't need to special-case extensions. See ADR 208.
9
8
  */
10
9
  const arktypeJsonCodecRegistry = buildCodecDescriptorRegistry(codecDescriptors);
11
-
12
10
  //#endregion
13
11
  export { arktypeJsonCodecRegistry as t };
14
- //# sourceMappingURL=registry-DN6MqSGJ.mjs.map
12
+
13
+ //# sourceMappingURL=registry-CfU1C3-F.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-CfU1C3-F.mjs","names":[],"sources":["../src/core/registry.ts"],"sourcesContent":["import { buildCodecDescriptorRegistry } from '@prisma-next/sql-relational-core/codec-descriptor-registry';\nimport type { CodecDescriptorRegistry } from '@prisma-next/sql-relational-core/query-lane-context';\nimport { codecDescriptors } from './arktype-json-codec';\n\n/**\n * Registry of every codec descriptor shipped by `@prisma-next/extension-arktype-json`.\n *\n * Public consumer surface for the arktype-json codec set. Currently a single entry (`arktype/json@1`); the registry shape stays consistent with the other codec-shipping packages so consumers don't need to special-case extensions. See ADR 208.\n */\nexport const arktypeJsonCodecRegistry: CodecDescriptorRegistry =\n buildCodecDescriptorRegistry(codecDescriptors);\n"],"mappings":";;;;;;;;AASA,MAAa,2BACX,6BAA6B,iBAAiB"}
@@ -1,7 +1,6 @@
1
1
  import { SqlRuntimeExtensionDescriptor } from "@prisma-next/sql-runtime";
2
2
 
3
3
  //#region src/exports/runtime.d.ts
4
-
5
4
  declare const arktypeJsonRuntimeDescriptor: SqlRuntimeExtensionDescriptor<'postgres'>;
6
5
  //#endregion
7
6
  export { arktypeJsonRuntimeDescriptor, arktypeJsonRuntimeDescriptor as default };
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.mts","names":[],"sources":["../src/exports/runtime.ts"],"sourcesContent":[],"mappings":";;;;cAYa,8BAA8B"}
1
+ {"version":3,"file":"runtime.d.mts","names":[],"sources":["../src/exports/runtime.ts"],"mappings":";;;cAYa,4BAAA,EAA8B,6BAAA"}
package/dist/runtime.mjs CHANGED
@@ -1,7 +1,5 @@
1
- import "./arktype-json-codec-Cykol-li.mjs";
2
- import { t as arktypeJsonCodecRegistry } from "./registry-DN6MqSGJ.mjs";
3
- import { t as arktypeJsonPackMeta } from "./pack-meta-BaJhoZfD.mjs";
4
-
1
+ import { t as arktypeJsonCodecRegistry } from "./registry-CfU1C3-F.mjs";
2
+ import { t as arktypeJsonPackMeta } from "./pack-meta-TjNpp3sc.mjs";
5
3
  //#region src/exports/runtime.ts
6
4
  const arktypeJsonRuntimeDescriptor = {
7
5
  kind: "extension",
@@ -17,8 +15,7 @@ const arktypeJsonRuntimeDescriptor = {
17
15
  };
18
16
  }
19
17
  };
20
- var runtime_default = arktypeJsonRuntimeDescriptor;
21
-
22
18
  //#endregion
23
- export { arktypeJsonRuntimeDescriptor, runtime_default as default };
19
+ export { arktypeJsonRuntimeDescriptor, arktypeJsonRuntimeDescriptor as default };
20
+
24
21
  //# sourceMappingURL=runtime.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.mjs","names":["arktypeJsonRuntimeDescriptor: SqlRuntimeExtensionDescriptor<'postgres'>"],"sources":["../src/exports/runtime.ts"],"sourcesContent":["/**\n * Runtime-plane extension descriptor for arktype-json.\n *\n * Registers `arktypeJsonCodec` (the unified `CodecDescriptor`) through the SQL runtime's `codecs:` slot. Per TML-2357 the dedicated parameterized-codec slot retired — the unified descriptor map dispatches every codec id, parameterized or not.\n *\n * Lives at the runtime-plane entrypoint so `src/core/**` stays free of runtime-plane imports (per `.cursor/rules/multi-plane-entrypoints.mdc`).\n */\n\nimport type { SqlRuntimeExtensionDescriptor } from '@prisma-next/sql-runtime';\nimport { arktypeJsonPackMeta } from '../core/pack-meta';\nimport { arktypeJsonCodecRegistry } from '../core/registry';\n\nexport const arktypeJsonRuntimeDescriptor: SqlRuntimeExtensionDescriptor<'postgres'> = {\n kind: 'extension' as const,\n id: arktypeJsonPackMeta.id,\n version: arktypeJsonPackMeta.version,\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n codecs: () => Array.from(arktypeJsonCodecRegistry.values()),\n create() {\n return {\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n };\n },\n};\n\nexport default arktypeJsonRuntimeDescriptor;\n"],"mappings":";;;;;AAYA,MAAaA,+BAA0E;CACrF,MAAM;CACN,IAAI,oBAAoB;CACxB,SAAS,oBAAoB;CAC7B,UAAU;CACV,UAAU;CACV,cAAc,MAAM,KAAK,yBAAyB,QAAQ,CAAC;CAC3D,SAAS;AACP,SAAO;GACL,UAAU;GACV,UAAU;GACX;;CAEJ;AAED,sBAAe"}
1
+ {"version":3,"file":"runtime.mjs","names":[],"sources":["../src/exports/runtime.ts"],"sourcesContent":["/**\n * Runtime-plane extension descriptor for arktype-json.\n *\n * Registers `arktypeJsonCodec` (the unified `CodecDescriptor`) through the SQL runtime's `codecs:` slot. Per TML-2357 the dedicated parameterized-codec slot retired — the unified descriptor map dispatches every codec id, parameterized or not.\n *\n * Lives at the runtime-plane entrypoint so `src/core/**` stays free of runtime-plane imports (per `.cursor/rules/multi-plane-entrypoints.mdc`).\n */\n\nimport type { SqlRuntimeExtensionDescriptor } from '@prisma-next/sql-runtime';\nimport { arktypeJsonPackMeta } from '../core/pack-meta';\nimport { arktypeJsonCodecRegistry } from '../core/registry';\n\nexport const arktypeJsonRuntimeDescriptor: SqlRuntimeExtensionDescriptor<'postgres'> = {\n kind: 'extension' as const,\n id: arktypeJsonPackMeta.id,\n version: arktypeJsonPackMeta.version,\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n codecs: () => Array.from(arktypeJsonCodecRegistry.values()),\n create() {\n return {\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n };\n },\n};\n\nexport default arktypeJsonRuntimeDescriptor;\n"],"mappings":";;;AAYA,MAAa,+BAA0E;CACrF,MAAM;CACN,IAAI,oBAAoB;CACxB,SAAS,oBAAoB;CAC7B,UAAU;CACV,UAAU;CACV,cAAc,MAAM,KAAK,yBAAyB,QAAQ,CAAC;CAC3D,SAAS;EACP,OAAO;GACL,UAAU;GACV,UAAU;GACX;;CAEJ"}
package/package.json CHANGED
@@ -1,26 +1,26 @@
1
1
  {
2
2
  "name": "@prisma-next/extension-arktype-json",
3
- "version": "0.5.0-dev.66",
3
+ "version": "0.5.0-dev.68",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "dependencies": {
8
8
  "@standard-schema/spec": "^1.1.0",
9
9
  "arktype": "^2.1.29",
10
- "@prisma-next/contract-authoring": "0.5.0-dev.66",
11
- "@prisma-next/sql-relational-core": "0.5.0-dev.66",
12
- "@prisma-next/contract": "0.5.0-dev.66",
13
- "@prisma-next/family-sql": "0.5.0-dev.66",
14
- "@prisma-next/sql-runtime": "0.5.0-dev.66",
15
- "@prisma-next/framework-components": "0.5.0-dev.66"
10
+ "@prisma-next/contract": "0.5.0-dev.68",
11
+ "@prisma-next/contract-authoring": "0.5.0-dev.68",
12
+ "@prisma-next/family-sql": "0.5.0-dev.68",
13
+ "@prisma-next/framework-components": "0.5.0-dev.68",
14
+ "@prisma-next/sql-relational-core": "0.5.0-dev.68",
15
+ "@prisma-next/sql-runtime": "0.5.0-dev.68"
16
16
  },
17
17
  "devDependencies": {
18
- "tsdown": "0.18.4",
18
+ "tsdown": "0.22.0",
19
19
  "typescript": "5.9.3",
20
- "vitest": "4.0.17",
21
- "@prisma-next/sql-contract": "0.5.0-dev.66",
22
- "@prisma-next/tsconfig": "0.0.0",
20
+ "vitest": "4.1.5",
21
+ "@prisma-next/sql-contract": "0.5.0-dev.68",
23
22
  "@prisma-next/test-utils": "0.0.1",
23
+ "@prisma-next/tsconfig": "0.0.0",
24
24
  "@prisma-next/tsdown": "0.0.0"
25
25
  },
26
26
  "files": [
@@ -1 +0,0 @@
1
- {"version":3,"file":"arktype-json-codec-Cykol-li.mjs","names":["wire: string | undefined","rehydrated: unknown","schema: ArktypeSchemaLike","jsonIr: unknown","params: ArktypeJsonTypeParams","codecDescriptors: readonly AnyCodecDescriptor[]"],"sources":["../src/core/arktype-json-codec.ts"],"sourcesContent":["/**\n * Arktype-json codec (TML-2357).\n *\n * Spec § Case 3: method-level generic over `S extends Type<unknown>`. The schema's TypeScript-level inferred type `S['infer']` is only available at the column-author site (where the user passes their typed schema), not at the descriptor's factory site (where only the serialized IR is available). This drives the shape:\n *\n * 1. {@link ArktypeJsonCodecClass} extends {@link CodecImpl} and is generic over `TInferred` — the application-level JS type the schema validates to. The constructor takes both the descriptor (for `id` proxy) and the rehydrated arktype `Type` (closure-captured so encode/decode/encodeJson/decodeJson can validate through it). 2. {@link ArktypeJsonDescriptor} extends {@link CodecDescriptorImpl} over {@link\n * ArktypeJsonTypeParams}. Factory rehydrates the schema from `params.jsonIr` and returns `(ctx) => new ArktypeJsonCodecClass<unknown>(this, schema)` — `S` is erased to `unknown` because the descriptor only sees IR. The runtime path through `descriptor.factory(params)` always exists (e.g. for `validateContract` re-materialization); it just loses the typed inferred shape. 3. {@link arktypeJsonColumn} is the column-author\n * surface with the method-level generic over `S extends Type<unknown>`. It bypasses `descriptor.factory` because `S` is only available here, instead constructing the typed codec directly so `S['infer']` flows through `codecFactory`'s return into the column site's resolved output type. Eager serialization at this call site captures `expression` (for the emit-path renderer) and `jsonIr` (for runtime rehydration).\n *\n * `satisfies ColumnHelperFor<ArktypeJsonDescriptor>` (coarse) is applied — the typeParams shape is verified. `ColumnHelperForStrict` is intentionally skipped: the descriptor's factory return is `ArktypeJsonCodecClass<unknown>` while the helper produces `ArktypeJsonCodecClass<S['infer']>`, and `Codec`'s `TInput` is invariant (used contravariantly in `encode`, covariantly in `decode`/`encodeJson`/`decodeJson`). Strict\n * assignment fails by design; the explicit `expectTypeOf` tests in `test/arktype-json-codec.types.test-d.ts` cover the literal-preservation property the strict variant would otherwise enforce.\n */\n\nimport type { JsonValue } from '@prisma-next/contract/types';\nimport {\n type AnyCodecDescriptor,\n type CodecCallContext,\n CodecDescriptorImpl,\n CodecImpl,\n type CodecInstanceContext,\n type ColumnHelperFor,\n type ColumnSpec,\n column,\n} from '@prisma-next/framework-components/codec';\nimport { runtimeError } from '@prisma-next/framework-components/runtime';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport { ArkErrors, ark, type Type, type } from 'arktype';\n\n/** Codec id for arktype-backed JSON columns. Library-bound, not target-bound. */\nexport const ARKTYPE_JSON_CODEC_ID = 'arktype/json@1' as const;\n\n/** Native storage type backing the codec. JSONB on Postgres; binary, indexable. */\nexport const ARKTYPE_JSON_NATIVE_TYPE = 'jsonb' as const;\n\n/**\n * Eagerly serialized typeParams for the arktype-json column. Carried in the contract IR; the runtime descriptor's factory rehydrates `jsonIr` and the emitter consumes `expression`.\n */\nexport type ArktypeJsonTypeParams = {\n /**\n * Arktype's TypeScript-source-like rendering of the schema. Read by `renderOutputType` to emit the column's TS type into `contract.d.ts`. Stable across the serialize/rehydrate cycle: the rehydrated schema's `expression` matches the source schema's.\n */\n readonly expression: string;\n /**\n * Arktype's internal IR for the schema. Lossless; the rehydration source. Schema-shape — `ark.schema(jsonIr)` reconstructs a callable `Type`-like structurally identical to the original `type(definition)` output.\n */\n readonly jsonIr: object;\n};\n\ntype ArktypeSchemaLike = ((value: unknown) => unknown) & {\n readonly expression: string;\n};\n\nfunction isArktypeSchemaLike(value: unknown): value is ArktypeSchemaLike {\n if (typeof value !== 'function') return false;\n const expression = (value as { readonly expression?: unknown }).expression;\n return typeof expression === 'string';\n}\n\nfunction validateSchema<TInferred>(schema: ArktypeSchemaLike, value: unknown): TInferred {\n const result = schema(value);\n if (result instanceof ArkErrors) {\n throw runtimeError(\n 'RUNTIME.JSON_SCHEMA_VALIDATION_FAILED',\n `arktype-json schema validation failed (decode): ${result.summary}`,\n { codecId: ARKTYPE_JSON_CODEC_ID, issues: result.summary },\n );\n }\n return result as TInferred;\n}\n\nfunction serializeToJsonSafe<TInferred>(\n schema: ArktypeSchemaLike,\n value: TInferred,\n): { wire: string; json: JsonValue } {\n const wire: string | undefined = JSON.stringify(value);\n if (typeof wire !== 'string') {\n throw runtimeError(\n 'RUNTIME.JSON_SCHEMA_VALIDATION_FAILED',\n `arktype-json value is not representable as JSON (codecId: ${ARKTYPE_JSON_CODEC_ID})`,\n { codecId: ARKTYPE_JSON_CODEC_ID },\n );\n }\n const json = JSON.parse(wire) as JsonValue;\n validateSchema(schema, json);\n return { wire, json };\n}\n\nfunction rehydrateSchema(jsonIr: object): ArktypeSchemaLike {\n let rehydrated: unknown;\n try {\n rehydrated = ark.schema(jsonIr);\n } catch (error) {\n throw runtimeError(\n 'RUNTIME.JSON_SCHEMA_VALIDATION_FAILED',\n /* c8 ignore next — the `String(error)` fallback covers throws of non-Error values; arktype only throws Error subclasses, so this branch is defensive only. */\n `Failed to rehydrate arktype schema from contract IR: ${error instanceof Error ? error.message : String(error)}`,\n { codecId: ARKTYPE_JSON_CODEC_ID, jsonIr },\n );\n }\n /* c8 ignore start — defensive: ark.schema either throws (handled above) or returns a callable Type with `expression: string`. The structural guard is kept so a future ark internal change can't silently slip a non-callable past us. */\n if (!isArktypeSchemaLike(rehydrated)) {\n throw runtimeError(\n 'RUNTIME.JSON_SCHEMA_VALIDATION_FAILED',\n `Rehydrated arktype schema does not have the expected callable + 'expression: string' shape (codecId: ${ARKTYPE_JSON_CODEC_ID})`,\n { codecId: ARKTYPE_JSON_CODEC_ID, jsonIr },\n );\n }\n /* c8 ignore stop */\n return rehydrated;\n}\n\nfunction renderArktypeJsonOutputType(params: ArktypeJsonTypeParams): string {\n const expression = params.expression.trim();\n return expression.length > 0 ? expression : 'unknown';\n}\n\nexport class ArktypeJsonCodecClass<TInferred> extends CodecImpl<\n typeof ARKTYPE_JSON_CODEC_ID,\n readonly ['equality'],\n string,\n TInferred\n> {\n constructor(\n descriptor: ArktypeJsonDescriptor,\n private readonly schema: ArktypeSchemaLike,\n ) {\n super(descriptor);\n }\n\n async encode(value: TInferred, _ctx: CodecCallContext): Promise<string> {\n return serializeToJsonSafe(this.schema, value).wire;\n }\n\n async decode(wire: string, _ctx: CodecCallContext): Promise<TInferred> {\n return validateSchema<TInferred>(this.schema, JSON.parse(wire));\n }\n\n encodeJson(value: TInferred): JsonValue {\n return serializeToJsonSafe(this.schema, value).json;\n }\n\n decodeJson(json: JsonValue): TInferred {\n return validateSchema<TInferred>(this.schema, json);\n }\n}\n\nconst arktypeJsonParamsSchema = type({\n expression: 'string',\n jsonIr: 'object',\n}) satisfies StandardSchemaV1<ArktypeJsonTypeParams>;\n\nexport class ArktypeJsonDescriptor extends CodecDescriptorImpl<ArktypeJsonTypeParams> {\n override readonly codecId = ARKTYPE_JSON_CODEC_ID;\n override readonly traits = ['equality'] as const;\n override readonly targetTypes = [ARKTYPE_JSON_NATIVE_TYPE] as const;\n override readonly paramsSchema: StandardSchemaV1<ArktypeJsonTypeParams> = arktypeJsonParamsSchema;\n override renderOutputType(params: ArktypeJsonTypeParams): string {\n return renderArktypeJsonOutputType(params);\n }\n override factory(\n params: ArktypeJsonTypeParams,\n ): (ctx: CodecInstanceContext) => ArktypeJsonCodecClass<unknown> {\n const schema = rehydrateSchema(params.jsonIr);\n /* c8 ignore start — defensive parity check; not exercised by typical contracts */\n const rehydratedExpression = (schema as { readonly expression?: unknown }).expression;\n if (typeof rehydratedExpression === 'string' && rehydratedExpression !== params.expression) {\n console.warn(\n `[arktype-json] typeParams.expression (${params.expression}) does not match rehydrated schema expression (${rehydratedExpression}); contract.json may be stale relative to the runtime schema.`,\n );\n }\n /* c8 ignore stop */\n return () => new ArktypeJsonCodecClass<unknown>(this, schema);\n }\n}\n\nexport const arktypeJsonDescriptor = new ArktypeJsonDescriptor();\n\n/**\n * Per-codec column helper for `arktype/json@1`. Method-level generic over `S extends Type<unknown>` so the column site preserves the schema's inferred TS type in the resolved codec (`ArktypeJsonCodecClass<S['infer']>`). Bypasses `descriptor.factory` because `S` is only available at the column-author site; constructs the typed codec directly with the closure-captured schema.\n *\n * Eager serialization at this call site captures `expression` (for the emit-path renderer) and `jsonIr` (for runtime rehydration via the descriptor's factory).\n *\n * @throws {Error} if the schema doesn't expose `expression` and `json` fields (i.e. is not an arktype `Type`). Validates the schema shape at the call site so configuration errors surface during contract authoring, not at runtime.\n */\nexport function arktypeJsonColumn<S extends Type<unknown>>(\n schema: S,\n): ColumnSpec<ArktypeJsonCodecClass<S['infer']>, ArktypeJsonTypeParams> {\n if (!isArktypeSchemaLike(schema)) {\n throw new Error(\n typeof schema !== 'function'\n ? 'arktypeJsonColumn(schema) expects a callable arktype Type.'\n : 'arktypeJsonColumn(schema) expects an arktype Type (missing `expression: string`).',\n );\n }\n const jsonIr: unknown = (schema as { readonly json?: unknown }).json;\n if (jsonIr === null || typeof jsonIr !== 'object') {\n throw new Error('arktypeJsonColumn(schema) expects an arktype Type (missing `json` IR).');\n }\n const params: ArktypeJsonTypeParams = { expression: schema.expression, jsonIr };\n return column(\n (_ctx: CodecInstanceContext) =>\n new ArktypeJsonCodecClass<S['infer']>(arktypeJsonDescriptor, schema),\n arktypeJsonDescriptor.codecId,\n params,\n ARKTYPE_JSON_NATIVE_TYPE,\n );\n}\n\narktypeJsonColumn satisfies ColumnHelperFor<ArktypeJsonDescriptor>;\n// Note: `ColumnHelperForStrict` is intentionally not applied — `Codec` is invariant in `TInput` (encode contravariant, decode covariant), so `ArktypeJsonCodecClass<S['infer']>` is not assignable to `ArktypeJsonCodecClass<unknown>` (the descriptor.factory return). `expectTypeOf` tests cover the literal-preservation property strict satisfies would otherwise enforce.\n\n/**\n * Codec instance returned by `arktypeJsonColumn(schema).codecFactory(ctx)` and by `arktypeJsonDescriptor.factory(typeParams)(ctx)`. The `TInferred` slot carries the arktype schema's inferred output type at the column-author site; descriptor-side factories erase to `unknown`.\n */\nexport type ArktypeJsonCodec<TInferred> = ArktypeJsonCodecClass<TInferred>;\n\nexport const codecDescriptors: readonly AnyCodecDescriptor[] = [arktypeJsonDescriptor];\n"],"mappings":";;;;;;AA6BA,MAAa,wBAAwB;;AAGrC,MAAa,2BAA2B;AAoBxC,SAAS,oBAAoB,OAA4C;AACvE,KAAI,OAAO,UAAU,WAAY,QAAO;AAExC,QAAO,OADa,MAA4C,eACnC;;AAG/B,SAAS,eAA0B,QAA2B,OAA2B;CACvF,MAAM,SAAS,OAAO,MAAM;AAC5B,KAAI,kBAAkB,UACpB,OAAM,aACJ,yCACA,mDAAmD,OAAO,WAC1D;EAAE,SAAS;EAAuB,QAAQ,OAAO;EAAS,CAC3D;AAEH,QAAO;;AAGT,SAAS,oBACP,QACA,OACmC;CACnC,MAAMA,OAA2B,KAAK,UAAU,MAAM;AACtD,KAAI,OAAO,SAAS,SAClB,OAAM,aACJ,yCACA,6DAA6D,sBAAsB,IACnF,EAAE,SAAS,uBAAuB,CACnC;CAEH,MAAM,OAAO,KAAK,MAAM,KAAK;AAC7B,gBAAe,QAAQ,KAAK;AAC5B,QAAO;EAAE;EAAM;EAAM;;AAGvB,SAAS,gBAAgB,QAAmC;CAC1D,IAAIC;AACJ,KAAI;AACF,eAAa,IAAI,OAAO,OAAO;UACxB,OAAO;AACd,QAAM;GACJ;;GAEA,wDAAwD,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;GAC9G;IAAE,SAAS;IAAuB;IAAQ;GAC3C;;;AAGH,KAAI,CAAC,oBAAoB,WAAW,CAClC,OAAM,aACJ,yCACA,wGAAwG,sBAAsB,IAC9H;EAAE,SAAS;EAAuB;EAAQ,CAC3C;;AAGH,QAAO;;AAGT,SAAS,4BAA4B,QAAuC;CAC1E,MAAM,aAAa,OAAO,WAAW,MAAM;AAC3C,QAAO,WAAW,SAAS,IAAI,aAAa;;AAG9C,IAAa,wBAAb,cAAsD,UAKpD;CACA,YACE,YACA,AAAiBC,QACjB;AACA,QAAM,WAAW;EAFA;;CAKnB,MAAM,OAAO,OAAkB,MAAyC;AACtE,SAAO,oBAAoB,KAAK,QAAQ,MAAM,CAAC;;CAGjD,MAAM,OAAO,MAAc,MAA4C;AACrE,SAAO,eAA0B,KAAK,QAAQ,KAAK,MAAM,KAAK,CAAC;;CAGjE,WAAW,OAA6B;AACtC,SAAO,oBAAoB,KAAK,QAAQ,MAAM,CAAC;;CAGjD,WAAW,MAA4B;AACrC,SAAO,eAA0B,KAAK,QAAQ,KAAK;;;AAIvD,MAAM,0BAA0B,KAAK;CACnC,YAAY;CACZ,QAAQ;CACT,CAAC;AAEF,IAAa,wBAAb,cAA2C,oBAA2C;CACpF,AAAkB,UAAU;CAC5B,AAAkB,SAAS,CAAC,WAAW;CACvC,AAAkB,cAAc,CAAC,yBAAyB;CAC1D,AAAkB,eAAwD;CAC1E,AAAS,iBAAiB,QAAuC;AAC/D,SAAO,4BAA4B,OAAO;;CAE5C,AAAS,QACP,QAC+D;EAC/D,MAAM,SAAS,gBAAgB,OAAO,OAAO;;EAE7C,MAAM,uBAAwB,OAA6C;AAC3E,MAAI,OAAO,yBAAyB,YAAY,yBAAyB,OAAO,WAC9E,SAAQ,KACN,yCAAyC,OAAO,WAAW,iDAAiD,qBAAqB,+DAClI;;AAGH,eAAa,IAAI,sBAA+B,MAAM,OAAO;;;AAIjE,MAAa,wBAAwB,IAAI,uBAAuB;;;;;;;;AAShE,SAAgB,kBACd,QACsE;AACtE,KAAI,CAAC,oBAAoB,OAAO,CAC9B,OAAM,IAAI,MACR,OAAO,WAAW,aACd,+DACA,oFACL;CAEH,MAAMC,SAAmB,OAAuC;AAChE,KAAI,WAAW,QAAQ,OAAO,WAAW,SACvC,OAAM,IAAI,MAAM,yEAAyE;CAE3F,MAAMC,SAAgC;EAAE,YAAY,OAAO;EAAY;EAAQ;AAC/E,QAAO,QACJ,SACC,IAAI,sBAAkC,uBAAuB,OAAO,EACtE,sBAAsB,SACtB,QACA,yBACD;;AAWH,MAAaC,mBAAkD,CAAC,sBAAsB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"arktype-json-codec-DBfCWQkt.d.mts","names":[],"sources":["../src/core/arktype-json-codec.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAiI0D,cApG7C,qBAoG6C,EAAA,gBAAA;;AAII,cArGjD,wBAqGiD,EAAA,OAAA;;;;AAQ3C,KAxGP,qBAAA,GAwGO;EAAY;;;EAUlB,SAAA,UAAA,EAAA,MAAsB;EAA4B;;;EAK3B,SAAA,MAAA,EAAA,MAAA;CAIxB;KAhHP,iBAAA,GAiHM,CAAA,CAAA,KAAA,EAAA,OAAA,EAAA,GAAA,OAAA,CAAA,GAAA;EAAyB,SAAA,UAAA,EAAA,MAAA;CAVO;AAAmB,cAnCjD,qBAmCiD,CAAA,SAAA,CAAA,SAnCR,SAmCQ,CAAA,OAlCrD,qBAkCqD,EAAA,SAAA,CAAA,UAAA,CAAA,EAAA,MAAA,EA/B5D,SA+B4D,CAAA,CAAA;EAiC9C,iBAAA,MAAiB;EAAW,WAAA,CAAA,UAAA,EA7D5B,qBA6D4B,EAAA,MAAA,EA5Df,iBA4De;EAClC,MAAA,CAAA,KAAA,EAxDY,SAwDZ,EAAA,IAAA,EAxD6B,gBAwD7B,CAAA,EAxDgD,OAwDhD,CAAA,MAAA,CAAA;EAC0B,MAAA,CAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EArDD,gBAqDC,CAAA,EArDkB,OAqDlB,CArD0B,SAqD1B,CAAA;EAAtB,UAAA,CAAA,KAAA,EAjDM,SAiDN,CAAA,EAjDkB,SAiDlB;EAAmC,UAAA,CAAA,IAAA,EA7C9B,SA6C8B,CAAA,EA7ClB,SA6CkB;;AAApC,cAnCA,qBAAA,SAA8B,mBAmC9B,CAnCkD,qBAmClD,CAAA,CAAA;EA4BD,SAAA,OAAA,EAAA,gBAAgB;;;yBA3DM,iBAAiB;2BACf;kBAIxB,8BACD,yBAAyB;;;;;;;;;iBAuBpB,4BAA4B,uBAClC,IACP,WAAW,sBAAsB,aAAa;;;;KA4BrC,8BAA8B,sBAAsB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"codec-types-5Jy4t54u.d.mts","names":[],"sources":["../src/types/codec-types.ts"],"sourcesContent":[],"mappings":";;AAiBA;;;;;;;;;;;;;;;KAAY,UAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"pack-meta-BaJhoZfD.mjs","names":["arktypeJsonPackMeta: typeof arktypeJsonPackMetaBase & {\n readonly __codecTypes?: CodecTypes;\n}"],"sources":["../src/core/pack-meta.ts"],"sourcesContent":["/**\n * arktype-json pack metadata.\n *\n * The pack metadata is the framework-composition entry point: control-stack assembly reads `types.codecTypes.import` to thread the type-side imports into emitted `contract.d.ts`, and `types.storage` declares the codec id's storage backing (`jsonb` on Postgres).\n *\n * Per TML-2357 runtime materialization flows through the unified descriptor map (`arktypeJsonDescriptor`) and the emit path consults `descriptorFor('arktype/json@1').renderOutputType` directly — no per-library \"emit-only Codec\" stub.\n */\n\nimport type { CodecTypes } from '../types/codec-types';\nimport { ARKTYPE_JSON_CODEC_ID } from './arktype-json-codec';\nimport { arktypeJsonCodecRegistry } from './registry';\n\nconst arktypeJsonPackMetaBase = {\n kind: 'extension',\n id: 'arktype-json',\n familyId: 'sql',\n targetId: 'postgres',\n version: '0.0.1',\n capabilities: {},\n types: {\n codecTypes: {\n codecDescriptors: Array.from(arktypeJsonCodecRegistry.values()),\n import: {\n package: '@prisma-next/extension-arktype-json/codec-types',\n named: 'CodecTypes',\n alias: 'ArktypeJsonTypes',\n },\n },\n storage: [\n {\n typeId: ARKTYPE_JSON_CODEC_ID,\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n nativeType: 'jsonb',\n },\n ],\n },\n} as const;\n\n/**\n * Public pack metadata. The phantom `__codecTypes` field threads the codec-types map's literal type into the pack ref so contract-builder generics can pick it up; it is never accessed at runtime.\n */\nexport const arktypeJsonPackMeta: typeof arktypeJsonPackMetaBase & {\n readonly __codecTypes?: CodecTypes;\n} = arktypeJsonPackMetaBase;\n"],"mappings":";;;;AAYA,MAAM,0BAA0B;CAC9B,MAAM;CACN,IAAI;CACJ,UAAU;CACV,UAAU;CACV,SAAS;CACT,cAAc,EAAE;CAChB,OAAO;EACL,YAAY;GACV,kBAAkB,MAAM,KAAK,yBAAyB,QAAQ,CAAC;GAC/D,QAAQ;IACN,SAAS;IACT,OAAO;IACP,OAAO;IACR;GACF;EACD,SAAS,CACP;GACE,QAAQ;GACR,UAAU;GACV,UAAU;GACV,YAAY;GACb,CACF;EACF;CACF;;;;AAKD,MAAaA,sBAET"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry-DN6MqSGJ.mjs","names":["arktypeJsonCodecRegistry: CodecDescriptorRegistry"],"sources":["../src/core/registry.ts"],"sourcesContent":["import { buildCodecDescriptorRegistry } from '@prisma-next/sql-relational-core/codec-descriptor-registry';\nimport type { CodecDescriptorRegistry } from '@prisma-next/sql-relational-core/query-lane-context';\nimport { codecDescriptors } from './arktype-json-codec';\n\n/**\n * Registry of every codec descriptor shipped by `@prisma-next/extension-arktype-json`.\n *\n * Public consumer surface for the arktype-json codec set. Currently a single entry (`arktype/json@1`); the registry shape stays consistent with the other codec-shipping packages so consumers don't need to special-case extensions. See ADR 208.\n */\nexport const arktypeJsonCodecRegistry: CodecDescriptorRegistry =\n buildCodecDescriptorRegistry(codecDescriptors);\n"],"mappings":";;;;;;;;;AASA,MAAaA,2BACX,6BAA6B,iBAAiB"}