@prisma/orm-framework 8.0.0-rc.1-dev.28 → 8.0.0-rc.1-dev.30
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/{codec-D6TctTla.mjs → codec-4A4n5x6T.mjs} +2 -2
- package/dist/{codec-D6TctTla.mjs.map → codec-4A4n5x6T.mjs.map} +1 -1
- package/dist/components.mjs +3 -3
- package/dist/components__authoring.mjs +1 -1
- package/dist/components__codec.mjs +1 -1
- package/dist/components__control.mjs +1 -1
- package/dist/contract-authoring.mjs +2 -2
- package/dist/contract.mjs +2 -2
- package/dist/contract__default-namespace.mjs +1 -1
- package/dist/contract__types.mjs +2 -2
- package/dist/{control-C_8057XM-DMCFN-Wb.mjs → control-C9JfxzPo-C4JAdFMg.mjs} +22 -3
- package/dist/control-C9JfxzPo-C4JAdFMg.mjs.map +1 -0
- package/dist/{control-DFqSH2EY.mjs → control-DuiafB_U.mjs} +2 -2
- package/dist/{control-DFqSH2EY.mjs.map → control-DuiafB_U.mjs.map} +1 -1
- package/dist/{control-BWHddgfQ-CHZkHCnz.d.mts → control-ql9N9u4f-Dz4QqSR1.d.mts} +17 -3
- package/dist/control-ql9N9u4f-Dz4QqSR1.d.mts.map +1 -0
- package/dist/{default-namespace-D4vCwkXg-BaiW8LNK.mjs → default-namespace-D4vCwkXg-yt1Ch4tq.mjs} +2 -2
- package/dist/{default-namespace-D4vCwkXg-BaiW8LNK.mjs.map → default-namespace-D4vCwkXg-yt1Ch4tq.mjs.map} +1 -1
- package/dist/{dist-DFakQfiQ.mjs → dist-CC1FPJKo.mjs} +2 -2
- package/dist/{dist-DFakQfiQ.mjs.map → dist-CC1FPJKo.mjs.map} +1 -1
- package/dist/errors.d.mts +3 -3
- package/dist/errors.mjs +3 -3
- package/dist/errors__control.d.mts +1 -1
- package/dist/errors__control.mjs +1 -1
- package/dist/errors__execution.d.mts +1 -1
- package/dist/errors__execution.mjs +1 -1
- package/dist/errors__migration.d.mts +1 -1
- package/dist/errors__migration.mjs +1 -1
- package/dist/{execution-BRMViM_W.mjs → execution-CXy93CMh.mjs} +35 -4
- package/dist/execution-CXy93CMh.mjs.map +1 -0
- package/dist/{execution-CStuUgUf.d.mts → execution-Cs6rxLIE.d.mts} +5 -2
- package/dist/execution-Cs6rxLIE.d.mts.map +1 -0
- package/dist/{framework-authoring-CDEvlouU-mlMWSksD.mjs → framework-authoring-CDEvlouU-CD43IJTJ.mjs} +2 -2
- package/dist/{framework-authoring-CDEvlouU-mlMWSksD.mjs.map → framework-authoring-CDEvlouU-CD43IJTJ.mjs.map} +1 -1
- package/dist/ids.mjs +1 -1
- package/dist/{migration-dka5vLtm.d.mts → migration-CSc3ZZK3.d.mts} +2 -2
- package/dist/{migration-dka5vLtm.d.mts.map → migration-CSc3ZZK3.d.mts.map} +1 -1
- package/dist/{migration-DdUmzx06.mjs → migration-jmLnbo_A.mjs} +11 -2
- package/dist/migration-jmLnbo_A.mjs.map +1 -0
- package/dist/operations.mjs +1 -1
- package/dist/psl-parser.mjs +1 -1
- package/dist/psl-parser__format.mjs +1 -1
- package/dist/psl-printer.mjs +2 -2
- package/dist/structured-error-BBdCpY44.d.mts +59 -0
- package/dist/structured-error-BBdCpY44.d.mts.map +1 -0
- package/dist/{structured-error-H6WU9Kjt.mjs → structured-error-xG_PRmbb.mjs} +2 -1
- package/dist/structured-error-xG_PRmbb.mjs.map +1 -0
- package/dist/ts-render.mjs +1 -1
- package/dist/{types-DgdgskBY.mjs → types-B1qkza2E.mjs} +2 -2
- package/dist/{types-DgdgskBY.mjs.map → types-B1qkza2E.mjs.map} +1 -1
- package/dist/utils.d.mts +2 -2
- package/dist/utils.mjs +1 -1
- package/dist/utils__structured-error.d.mts +2 -2
- package/dist/utils__structured-error.mjs +1 -1
- package/package.json +15 -15
- package/dist/control-BWHddgfQ-CHZkHCnz.d.mts.map +0 -1
- package/dist/control-C_8057XM-DMCFN-Wb.mjs.map +0 -1
- package/dist/execution-BRMViM_W.mjs.map +0 -1
- package/dist/execution-CStuUgUf.d.mts.map +0 -1
- package/dist/migration-DdUmzx06.mjs.map +0 -1
- package/dist/structured-error-BVmv2aPB.d.mts +0 -34
- package/dist/structured-error-BVmv2aPB.d.mts.map +0 -1
- package/dist/structured-error-H6WU9Kjt.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as voidParamsSchema } from "./codec-types-DcNvNeY1-BO6kUiH0.mjs";
|
|
2
|
-
import { i as tsStringLiteral } from "./dist-
|
|
2
|
+
import { i as tsStringLiteral } from "./dist-CC1FPJKo.mjs";
|
|
3
3
|
//#region ../../../1-framework/1-core/framework-components/dist/codec.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Abstract base class for concrete codec implementations.
|
|
@@ -60,4 +60,4 @@ function renderTsLiteral(value) {
|
|
|
60
60
|
//#endregion
|
|
61
61
|
export { renderTsLiteral as i, CodecImpl as n, column as r, CodecDescriptorImpl as t };
|
|
62
62
|
|
|
63
|
-
//# sourceMappingURL=codec-
|
|
63
|
+
//# sourceMappingURL=codec-4A4n5x6T.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec-
|
|
1
|
+
{"version":3,"file":"codec-4A4n5x6T.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec.mjs"],"sourcesContent":["import { r as voidParamsSchema, t as emptyCodecLookup } from \"./codec-types-DcNvNeY1.mjs\";\nimport { i as validateCodecTypeParams, n as materializeCodec, r as resolveCodecDescriptorOrThrow, t as CONTRACT_CODEC_DESCRIPTOR_MISSING } from \"./resolve-codec-BZF8TZh_.mjs\";\nimport { tsStringLiteral } from \"@internal/ts-render\";\n//#region src/shared/codec.ts\n/**\n* Abstract base class for concrete codec implementations.\n*\n* Codec authors extend this class with their typed `Id`, `TTraits`, `TWire`, `TInput` and override all four abstract conversion methods: `encode`, `decode`, `encodeJson`, and `decodeJson`. The runtime instance carries only its `id` (proxied through the descriptor so alias subclasses inherit the descriptor's id automatically) and the conversion methods — static metadata lives on the {@link CodecDescriptor}.\n*/\nvar CodecImpl = class {\n\tdescriptor;\n\t/**\n\t* Variance-erased descriptor reference. Concrete codec subclasses receive the typed descriptor in their own constructors and forward it via `super(descriptor)`; the variance erasure lives at this base because the abstract surface can't carry the concrete `TParams`.\n\t*/\n\tconstructor(descriptor) {\n\t\tthis.descriptor = descriptor;\n\t}\n\tget id() {\n\t\treturn this.descriptor.codecId;\n\t}\n};\n//#endregion\n//#region src/shared/codec-descriptor.ts\n/**\n* Abstract base class for concrete codec descriptors.\n*\n* Codec authors extend this class with their typed `TParams` and declare `codecId`, `traits`, `targetTypes`, `paramsSchema`, the curried `factory(params)`, and (optionally) `renderOutputType`.\n*\n* Implements the {@link CodecDescriptor} interface so a concrete subclass instance is directly usable wherever the framework expects a `CodecDescriptor<P>`.\n*/\nvar CodecDescriptorImpl = class {\n\t/** Boolean derived from `paramsSchema`: `true` whenever the schema is not the singleton `voidParamsSchema`. */\n\tget isParameterized() {\n\t\treturn this.paramsSchema !== voidParamsSchema;\n\t}\n};\n//#endregion\n//#region src/shared/column-spec.ts\n/**\n* Trivial column packager. Per-codec helpers call this directly with the result of `descriptor.factory(params)` — direct method invocation binds the descriptor's method-level generic at the call site and the literal flows through `R`.\n*\n* `nativeType` is the column's database-native type spelling — the value the postgres adapter's migration planner, the SQL renderer's cast policy, and the emitted contract's column `nativeType` slot read. Per-codec helpers pass the literal native-type string for their codec (e.g. `'text'`, `'int4'`, `'character varying'`); for codecs whose native-type spelling depends on parameters (none today; reserved for future shapes), the helper computes the rendered string before calling `column`. The framework does not derive the value from `codecId` — that mapping is target-specific and lives at the helper.\n*/\nfunction column(codecFactory, codecId, typeParams, nativeType) {\n\treturn {\n\t\tcodecFactory,\n\t\tcodecId,\n\t\ttypeParams,\n\t\tnativeType\n\t};\n}\n//#endregion\n//#region src/shared/render-ts-literal.ts\n/**\n* Renders a codec-encoded value as a TypeScript literal (e.g. `\"low\"`, `1`, `true`), or `undefined`\n* when the value isn't literal-expressible (objects, arrays, null).\n*\n* Valid **only for identity codecs** whose `encodeJson` output equals their decoded output type\n* (text, int, float, bool). A non-identity codec (e.g. one that encodes to an int but decodes to a\n* string literal) must NOT use this: it has to `decodeJson` first, then render, in its own\n* `renderValueLiteral`.\n*/\nfunction renderTsLiteral(value) {\n\tif (typeof value === \"string\") return tsStringLiteral(value);\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n}\n//#endregion\nexport { CONTRACT_CODEC_DESCRIPTOR_MISSING, CodecDescriptorImpl, CodecImpl, column, emptyCodecLookup, materializeCodec, renderTsLiteral, resolveCodecDescriptorOrThrow, validateCodecTypeParams, voidParamsSchema };\n\n//# sourceMappingURL=codec.mjs.map"],"mappings":";;;;;;;;AASA,IAAI,YAAY,MAAM;CACrB;;;;CAIA,YAAY,YAAY;EACvB,KAAK,aAAa;CACnB;CACA,IAAI,KAAK;EACR,OAAO,KAAK,WAAW;CACxB;AACD;;;;;;;;AAUA,IAAI,sBAAsB,MAAM;;CAE/B,IAAI,kBAAkB;EACrB,OAAO,KAAK,iBAAiB;CAC9B;AACD;;;;;;AAQA,SAAS,OAAO,cAAc,SAAS,YAAY,YAAY;CAC9D,OAAO;EACN;EACA;EACA;EACA;CACD;AACD;;;;;;;;;;AAYA,SAAS,gBAAgB,OAAO;CAC/B,IAAI,OAAO,UAAU,UAAU,OAAO,gBAAgB,KAAK;CAC3D,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,WAAW,OAAO,OAAO,KAAK;AACjF"}
|
package/dist/components.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as isPlainRecord } from "./is-plain-record-CUofyVQ7-DWEzdhIx.mjs";
|
|
2
2
|
import { n as runtimeError, t as isRuntimeError } from "./runtime-error-BA9d7XjZ-BlT8t6LB.mjs";
|
|
3
|
-
import { _ as mergeAuthoringNamespaces, a as collectScalarTypeConstructors, b as validateAuthoringHelperArguments, c as instantiateAuthoringEntityType, d as isAuthoringArgRef, f as isAuthoringEntityTypeDescriptor, g as isAuthoringTypeConstructorDescriptor, h as isAuthoringPslBlockDescriptor, l as instantiateAuthoringFieldPreset, m as isAuthoringModelAttributeDescriptor, n as assertResolvableTypeConstructorTemplates, o as flushAuthoringWarnings, p as isAuthoringFieldPresetDescriptor, r as classifyEnumMemberType, s as hasRegisteredFieldNamespace, t as assertNoCrossRegistryCollisions, u as instantiateAuthoringTypeConstructor, v as resolveAuthoringTemplateValue, y as resolveEnumCodecId } from "./framework-authoring-CDEvlouU-
|
|
3
|
+
import { _ as mergeAuthoringNamespaces, a as collectScalarTypeConstructors, b as validateAuthoringHelperArguments, c as instantiateAuthoringEntityType, d as isAuthoringArgRef, f as isAuthoringEntityTypeDescriptor, g as isAuthoringTypeConstructorDescriptor, h as isAuthoringPslBlockDescriptor, l as instantiateAuthoringFieldPreset, m as isAuthoringModelAttributeDescriptor, n as assertResolvableTypeConstructorTemplates, o as flushAuthoringWarnings, p as isAuthoringFieldPresetDescriptor, r as classifyEnumMemberType, s as hasRegisteredFieldNamespace, t as assertNoCrossRegistryCollisions, u as instantiateAuthoringTypeConstructor, v as resolveAuthoringTemplateValue, y as resolveEnumCodecId } from "./framework-authoring-CDEvlouU-CD43IJTJ.mjs";
|
|
4
4
|
import { r as voidParamsSchema, t as emptyCodecLookup } from "./codec-types-DcNvNeY1-BO6kUiH0.mjs";
|
|
5
5
|
import { i as validateCodecTypeParams, n as materializeCodec, r as resolveCodecDescriptorOrThrow, t as CONTRACT_CODEC_DESCRIPTOR_MISSING } from "./resolve-codec-BZF8TZh_-D-xORT9Q.mjs";
|
|
6
|
-
import { i as renderTsLiteral, n as CodecImpl, r as column, t as CodecDescriptorImpl } from "./codec-
|
|
6
|
+
import { i as renderTsLiteral, n as CodecImpl, r as column, t as CodecDescriptorImpl } from "./codec-4A4n5x6T.mjs";
|
|
7
7
|
import { a as mergeCapabilityMatrices, i as isNoInputAggregateDescriptor, n as isAggregateDescriptor, r as isAnyInputAggregateDescriptor, t as aggregateDescriptorKey } from "./capabilities-BCEONw9w-C-lo3rF8.mjs";
|
|
8
8
|
import { t as checkContractComponentRequirements } from "./framework-components-D6j4Y5K7-RW9H184y.mjs";
|
|
9
9
|
import { t as settleAggregateOverloads } from "./components-dZRz3T5y.mjs";
|
|
10
|
-
import { C as hasOperationPreview, D as issueOutcome, E as hasSchemaView, O as orderIssuesByDependencies, S as hasMigrations, T as hasSchemaSubjectClassifier, _ as dispositionForCategory, a as VERIFY_CODE_HASH_MISMATCH, b as extractComponentIds, c as VERIFY_CODE_TARGET_MISMATCH, d as assertUniqueCodecOwner, f as buildExtensionLoadOrder, g as diffSchemas, h as createControlStack, i as SchemaTreeNode, k as storageHashHex, l as assembleAuthoringContributions, m as contractSnapshotTypesSpecifier, n as CONTRACT_SNAPSHOTS_DIRNAME, o as VERIFY_CODE_MARKER_MISSING, p as contractSnapshotJsonSpecifier, r as SchemaDiff, s as VERIFY_CODE_SCHEMA_FAILURE, t as APP_SPACE_ID, u as assembleControlMutationDefaults, v as extractCodecLookup, w as hasPslContractInfer, x as extractQueryOperationTypeImports, y as extractCodecTypeImports } from "./control-
|
|
10
|
+
import { C as hasOperationPreview, D as issueOutcome, E as hasSchemaView, O as orderIssuesByDependencies, S as hasMigrations, T as hasSchemaSubjectClassifier, _ as dispositionForCategory, a as VERIFY_CODE_HASH_MISMATCH, b as extractComponentIds, c as VERIFY_CODE_TARGET_MISMATCH, d as assertUniqueCodecOwner, f as buildExtensionLoadOrder, g as diffSchemas, h as createControlStack, i as SchemaTreeNode, k as storageHashHex, l as assembleAuthoringContributions, m as contractSnapshotTypesSpecifier, n as CONTRACT_SNAPSHOTS_DIRNAME, o as VERIFY_CODE_MARKER_MISSING, p as contractSnapshotJsonSpecifier, r as SchemaDiff, s as VERIFY_CODE_SCHEMA_FAILURE, t as APP_SPACE_ID, u as assembleControlMutationDefaults, v as extractCodecLookup, w as hasPslContractInfer, x as extractQueryOperationTypeImports, y as extractCodecTypeImports } from "./control-DuiafB_U.mjs";
|
|
11
11
|
import { n as resolveRequirementSpecifiers, t as keepInternalSpecifiers } from "./emission-CeoAV9mj.mjs";
|
|
12
12
|
import { n as createExecutionStack, r as instantiateExecutionStack, t as assertRuntimeContractRequirementsSatisfied } from "./execution-BNwBzmRd.mjs";
|
|
13
13
|
import { a as buildSingleNamespaceView, c as elementCoordinates, d as hydrateNamespaceEntities, f as promoteBuiltinKinds, i as buildNamespacedEntities, l as entityAt, n as NamespaceBase, o as coordinateKey, r as UNBOUND_NAMESPACE_ID, s as domainElementCoordinates, t as IRNodeBase, u as freezeNode } from "./ir-ChmSSAhX.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as mergeAuthoringNamespaces, a as collectScalarTypeConstructors, b as validateAuthoringHelperArguments, c as instantiateAuthoringEntityType, d as isAuthoringArgRef, f as isAuthoringEntityTypeDescriptor, g as isAuthoringTypeConstructorDescriptor, h as isAuthoringPslBlockDescriptor, l as instantiateAuthoringFieldPreset, m as isAuthoringModelAttributeDescriptor, n as assertResolvableTypeConstructorTemplates, o as flushAuthoringWarnings, p as isAuthoringFieldPresetDescriptor, r as classifyEnumMemberType, s as hasRegisteredFieldNamespace, t as assertNoCrossRegistryCollisions, u as instantiateAuthoringTypeConstructor, v as resolveAuthoringTemplateValue, y as resolveEnumCodecId } from "./framework-authoring-CDEvlouU-
|
|
1
|
+
import { _ as mergeAuthoringNamespaces, a as collectScalarTypeConstructors, b as validateAuthoringHelperArguments, c as instantiateAuthoringEntityType, d as isAuthoringArgRef, f as isAuthoringEntityTypeDescriptor, g as isAuthoringTypeConstructorDescriptor, h as isAuthoringPslBlockDescriptor, l as instantiateAuthoringFieldPreset, m as isAuthoringModelAttributeDescriptor, n as assertResolvableTypeConstructorTemplates, o as flushAuthoringWarnings, p as isAuthoringFieldPresetDescriptor, r as classifyEnumMemberType, s as hasRegisteredFieldNamespace, t as assertNoCrossRegistryCollisions, u as instantiateAuthoringTypeConstructor, v as resolveAuthoringTemplateValue, y as resolveEnumCodecId } from "./framework-authoring-CDEvlouU-CD43IJTJ.mjs";
|
|
2
2
|
export { assertNoCrossRegistryCollisions, assertResolvableTypeConstructorTemplates, classifyEnumMemberType, collectScalarTypeConstructors, flushAuthoringWarnings, hasRegisteredFieldNamespace, instantiateAuthoringEntityType, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, isAuthoringArgRef, isAuthoringEntityTypeDescriptor, isAuthoringFieldPresetDescriptor, isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor, isAuthoringTypeConstructorDescriptor, mergeAuthoringNamespaces, resolveAuthoringTemplateValue, resolveEnumCodecId, validateAuthoringHelperArguments };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { r as voidParamsSchema, t as emptyCodecLookup } from "./codec-types-DcNvNeY1-BO6kUiH0.mjs";
|
|
2
2
|
import { i as validateCodecTypeParams, n as materializeCodec, r as resolveCodecDescriptorOrThrow, t as CONTRACT_CODEC_DESCRIPTOR_MISSING } from "./resolve-codec-BZF8TZh_-D-xORT9Q.mjs";
|
|
3
|
-
import { i as renderTsLiteral, n as CodecImpl, r as column, t as CodecDescriptorImpl } from "./codec-
|
|
3
|
+
import { i as renderTsLiteral, n as CodecImpl, r as column, t as CodecDescriptorImpl } from "./codec-4A4n5x6T.mjs";
|
|
4
4
|
export { CONTRACT_CODEC_DESCRIPTOR_MISSING, CodecDescriptorImpl, CodecImpl, column, emptyCodecLookup, materializeCodec, renderTsLiteral, resolveCodecDescriptorOrThrow, validateCodecTypeParams, voidParamsSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as hasOperationPreview, D as issueOutcome, E as hasSchemaView, O as orderIssuesByDependencies, S as hasMigrations, T as hasSchemaSubjectClassifier, _ as dispositionForCategory, a as VERIFY_CODE_HASH_MISMATCH, b as extractComponentIds, c as VERIFY_CODE_TARGET_MISMATCH, d as assertUniqueCodecOwner, f as buildExtensionLoadOrder, g as diffSchemas, h as createControlStack, i as SchemaTreeNode, k as storageHashHex, l as assembleAuthoringContributions, m as contractSnapshotTypesSpecifier, n as CONTRACT_SNAPSHOTS_DIRNAME, o as VERIFY_CODE_MARKER_MISSING, p as contractSnapshotJsonSpecifier, r as SchemaDiff, s as VERIFY_CODE_SCHEMA_FAILURE, t as APP_SPACE_ID, u as assembleControlMutationDefaults, v as extractCodecLookup, w as hasPslContractInfer, x as extractQueryOperationTypeImports, y as extractCodecTypeImports } from "./control-
|
|
1
|
+
import { C as hasOperationPreview, D as issueOutcome, E as hasSchemaView, O as orderIssuesByDependencies, S as hasMigrations, T as hasSchemaSubjectClassifier, _ as dispositionForCategory, a as VERIFY_CODE_HASH_MISMATCH, b as extractComponentIds, c as VERIFY_CODE_TARGET_MISMATCH, d as assertUniqueCodecOwner, f as buildExtensionLoadOrder, g as diffSchemas, h as createControlStack, i as SchemaTreeNode, k as storageHashHex, l as assembleAuthoringContributions, m as contractSnapshotTypesSpecifier, n as CONTRACT_SNAPSHOTS_DIRNAME, o as VERIFY_CODE_MARKER_MISSING, p as contractSnapshotJsonSpecifier, r as SchemaDiff, s as VERIFY_CODE_SCHEMA_FAILURE, t as APP_SPACE_ID, u as assembleControlMutationDefaults, v as extractCodecLookup, w as hasPslContractInfer, x as extractQueryOperationTypeImports, y as extractCodecTypeImports } from "./control-DuiafB_U.mjs";
|
|
2
2
|
export { APP_SPACE_ID, CONTRACT_SNAPSHOTS_DIRNAME, SchemaDiff, SchemaTreeNode, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_SCHEMA_FAILURE, VERIFY_CODE_TARGET_MISMATCH, assembleAuthoringContributions, assembleControlMutationDefaults, assertUniqueCodecOwner, buildExtensionLoadOrder, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, createControlStack, diffSchemas, dispositionForCategory, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports, hasMigrations, hasOperationPreview, hasPslContractInfer, hasSchemaSubjectClassifier, hasSchemaView, issueOutcome, orderIssuesByDependencies, storageHashHex };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
|
|
2
|
-
import { a as structuredError } from "./structured-error-
|
|
3
|
-
import { c as instantiateAuthoringEntityType } from "./framework-authoring-CDEvlouU-
|
|
2
|
+
import { a as structuredError } from "./structured-error-xG_PRmbb.mjs";
|
|
3
|
+
import { c as instantiateAuthoringEntityType } from "./framework-authoring-CDEvlouU-CD43IJTJ.mjs";
|
|
4
4
|
//#region ../../../1-framework/2-authoring/contract/dist/index.mjs
|
|
5
5
|
/**
|
|
6
6
|
* Deep-merges any number of capability matrices into a single matrix.
|
package/dist/contract.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as applySpecifierDefaultControlPolicy } from "./apply-specifier-default-control-policy-CsYHsfTF.mjs";
|
|
2
2
|
import { t as ContractValidationError } from "./contract-validation-error-DEiWp_EI-CRwtUgRw.mjs";
|
|
3
|
-
import { r as soleDomainNamespaceId, t as UNBOUND_DOMAIN_NAMESPACE_ID } from "./default-namespace-D4vCwkXg-
|
|
3
|
+
import { r as soleDomainNamespaceId, t as UNBOUND_DOMAIN_NAMESPACE_ID } from "./default-namespace-D4vCwkXg-yt1Ch4tq.mjs";
|
|
4
4
|
import { n as buildNamespacedEnums, r as createEnumAccessor, t as buildEnumsMapForNamespace } from "./enum-accessor-Db5DaTNX.mjs";
|
|
5
5
|
import { n as matchesPathPattern, t as createPreserveEmptyPredicate } from "./canonicalization-path-match-CNgHuwM_-CCPBeUuk.mjs";
|
|
6
6
|
import { t as isPlainRecord } from "./is-plain-record-CUofyVQ7-DWEzdhIx.mjs";
|
|
@@ -8,6 +8,6 @@ import { a as computeStorageHash, i as computeProfileHash, n as canonicalizeCont
|
|
|
8
8
|
import { n as createStorageSort, t as compareByNameProperty } from "./hashing-utils-DQgS3nOe.mjs";
|
|
9
9
|
import { t as resolveDomainModel } from "./resolve-domain-model-BovPAsW2-8rwyzjxp.mjs";
|
|
10
10
|
import { t as asNamespaceId } from "./namespace-id-asbWpwMw-3yxn-tRe.mjs";
|
|
11
|
-
import { a as domainValueObjectsAtDefaultNamespace, c as isColumnDefault, d as profileHash, i as domainModelsAtDefaultNamespace, l as isColumnDefaultLiteralInputValue, n as coreHash, o as effectiveControlPolicy, r as crossRef, s as executionHash, t as CrossReferenceSchema, u as isExecutionMutationDefaultValue } from "./types-
|
|
11
|
+
import { a as domainValueObjectsAtDefaultNamespace, c as isColumnDefault, d as profileHash, i as domainModelsAtDefaultNamespace, l as isColumnDefaultLiteralInputValue, n as coreHash, o as effectiveControlPolicy, r as crossRef, s as executionHash, t as CrossReferenceSchema, u as isExecutionMutationDefaultValue } from "./types-B1qkza2E.mjs";
|
|
12
12
|
import { t as validateContractDomain } from "./validate-domain-BkvFlY3B.mjs";
|
|
13
13
|
export { ContractValidationError, CrossReferenceSchema, UNBOUND_DOMAIN_NAMESPACE_ID, applySpecifierDefaultControlPolicy, asNamespaceId, buildEnumsMapForNamespace, buildNamespacedEnums, canonicalizeContract, canonicalizeContractToObject, compareByNameProperty, computeExecutionHash, computeProfileHash, computeStorageHash, coreHash, createEnumAccessor, createPreserveEmptyPredicate, createStorageSort, crossRef, domainModelsAtDefaultNamespace, domainValueObjectsAtDefaultNamespace, effectiveControlPolicy, executionHash, isColumnDefault, isColumnDefaultLiteralInputValue, isExecutionMutationDefaultValue, isPlainRecord, matchesPathPattern, profileHash, resolveDomainModel, soleDomainNamespaceId, validateContractDomain };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as soleDomainNamespaceId, t as UNBOUND_DOMAIN_NAMESPACE_ID } from "./default-namespace-D4vCwkXg-
|
|
1
|
+
import { r as soleDomainNamespaceId, t as UNBOUND_DOMAIN_NAMESPACE_ID } from "./default-namespace-D4vCwkXg-yt1Ch4tq.mjs";
|
|
2
2
|
export { UNBOUND_DOMAIN_NAMESPACE_ID, soleDomainNamespaceId };
|
package/dist/contract__types.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as soleDomainNamespaceId, t as UNBOUND_DOMAIN_NAMESPACE_ID } from "./default-namespace-D4vCwkXg-
|
|
1
|
+
import { r as soleDomainNamespaceId, t as UNBOUND_DOMAIN_NAMESPACE_ID } from "./default-namespace-D4vCwkXg-yt1Ch4tq.mjs";
|
|
2
2
|
import { t as resolveDomainModel } from "./resolve-domain-model-BovPAsW2-8rwyzjxp.mjs";
|
|
3
3
|
import { t as asNamespaceId } from "./namespace-id-asbWpwMw-3yxn-tRe.mjs";
|
|
4
|
-
import { a as domainValueObjectsAtDefaultNamespace, c as isColumnDefault, d as profileHash, i as domainModelsAtDefaultNamespace, l as isColumnDefaultLiteralInputValue, n as coreHash, o as effectiveControlPolicy, r as crossRef, s as executionHash, t as CrossReferenceSchema, u as isExecutionMutationDefaultValue } from "./types-
|
|
4
|
+
import { a as domainValueObjectsAtDefaultNamespace, c as isColumnDefault, d as profileHash, i as domainModelsAtDefaultNamespace, l as isColumnDefaultLiteralInputValue, n as coreHash, o as effectiveControlPolicy, r as crossRef, s as executionHash, t as CrossReferenceSchema, u as isExecutionMutationDefaultValue } from "./types-B1qkza2E.mjs";
|
|
5
5
|
export { CrossReferenceSchema, UNBOUND_DOMAIN_NAMESPACE_ID, asNamespaceId, coreHash, crossRef, domainModelsAtDefaultNamespace, domainValueObjectsAtDefaultNamespace, effectiveControlPolicy, executionHash, isColumnDefault, isColumnDefaultLiteralInputValue, isExecutionMutationDefaultValue, profileHash, resolveDomainModel, soleDomainNamespaceId };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as ifDefined } from "./defined-BQWA85QH-BRSBMULx.mjs";
|
|
2
|
-
import { r as docsUrlFor } from "./structured-error-
|
|
3
|
-
//#region ../../../1-framework/1-core/errors/dist/control-
|
|
2
|
+
import { r as docsUrlFor } from "./structured-error-xG_PRmbb.mjs";
|
|
3
|
+
//#region ../../../1-framework/1-core/errors/dist/control-C9JfxzPo.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Structured CLI error that contains all information needed for error envelopes.
|
|
6
6
|
* Call sites throw these errors with full context.
|
|
@@ -28,6 +28,7 @@ var CliStructuredError = class extends Error {
|
|
|
28
28
|
Object.assign(this, {
|
|
29
29
|
...ifDefined("why", options?.why),
|
|
30
30
|
...ifDefined("fix", fix),
|
|
31
|
+
...ifDefined("nextActions", options?.nextActions),
|
|
31
32
|
...ifDefined("where", where),
|
|
32
33
|
...ifDefined("meta", options?.meta),
|
|
33
34
|
...ifDefined("docsUrl", options?.docsUrl)
|
|
@@ -35,6 +36,9 @@ var CliStructuredError = class extends Error {
|
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* Converts this error to a CLI error envelope for output formatting.
|
|
39
|
+
*
|
|
40
|
+
* This is the boundary that emits the envelope, so it is where a missing
|
|
41
|
+
* `nextActions` becomes `[]`.
|
|
38
42
|
*/
|
|
39
43
|
toEnvelope() {
|
|
40
44
|
return {
|
|
@@ -44,6 +48,7 @@ var CliStructuredError = class extends Error {
|
|
|
44
48
|
summary: this.message,
|
|
45
49
|
...ifDefined("why", this.why),
|
|
46
50
|
...ifDefined("fix", this.fix),
|
|
51
|
+
nextActions: this.nextActions ?? [],
|
|
47
52
|
...ifDefined("where", this.where),
|
|
48
53
|
...ifDefined("meta", this.meta),
|
|
49
54
|
...ifDefined("docsUrl", this.docsUrl)
|
|
@@ -66,6 +71,11 @@ function errorConfigFileNotFound(configPath, options) {
|
|
|
66
71
|
return new CliStructuredError("CONFIG.FILE_NOT_FOUND", "Config file not found", {
|
|
67
72
|
...options?.why ? { why: options.why } : { why: "Config file not found" },
|
|
68
73
|
fix: "Run 'prisma-next init' to create a config file",
|
|
74
|
+
nextActions: [{
|
|
75
|
+
kind: "run-command",
|
|
76
|
+
label: "Create a config file",
|
|
77
|
+
command: "{bin} init"
|
|
78
|
+
}],
|
|
69
79
|
docsUrl: docsUrlFor("CONFIG.FILE_NOT_FOUND"),
|
|
70
80
|
...configPath ? { where: { path: configPath } } : {}
|
|
71
81
|
});
|
|
@@ -112,6 +122,15 @@ function errorContractValidationFailed(reason, options) {
|
|
|
112
122
|
return new CliStructuredError("CONTRACT.VALIDATION_FAILED", "Contract validation failed", {
|
|
113
123
|
why: reason,
|
|
114
124
|
fix: "Re-run `prisma-next contract emit`, or fix the contract file and try again",
|
|
125
|
+
nextActions: [{
|
|
126
|
+
kind: "run-command",
|
|
127
|
+
label: "Re-emit the contract",
|
|
128
|
+
command: "{bin} contract emit"
|
|
129
|
+
}, {
|
|
130
|
+
kind: "edit-file",
|
|
131
|
+
label: "Fix the contract file, then re-run the command",
|
|
132
|
+
reason
|
|
133
|
+
}],
|
|
115
134
|
docsUrl: docsUrlFor("CONTRACT.VALIDATION_FAILED"),
|
|
116
135
|
...options?.where ? { where: options.where } : {},
|
|
117
136
|
...ifDefined("cause", options?.cause)
|
|
@@ -313,4 +332,4 @@ function errorUnexpected(message, options) {
|
|
|
313
332
|
//#endregion
|
|
314
333
|
export { errorUnexpected as S, errorMigrationCliUnknownFlag as _, errorConfigVersionMarkerMissing as a, errorQueryRunnerFactoryRequired as b, errorContractValidationFailed as c, errorEnumCodecNotInPackStack as d, errorFamilyReadMarkerSqlRequired as f, errorMigrationCliInvalidConfigArg as g, errorJsonFormatNotSupported as h, errorConfigValidation as i, errorDatabaseConnectionRequired as l, errorInvalidOutputFormat as m, errorConfigEvaluationFailed as n, errorContractConfigMissing as o, errorFileNotFound as p, errorConfigFileNotFound as r, errorContractMissingExtensions as s, CliStructuredError as t, errorDriverRequired as u, errorMigrationPlanningFailed as v, errorTargetMigrationNotSupported as x, errorOutputFormatMutex as y };
|
|
315
334
|
|
|
316
|
-
//# sourceMappingURL=control-
|
|
335
|
+
//# sourceMappingURL=control-C9JfxzPo-C4JAdFMg.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-C9JfxzPo-C4JAdFMg.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/control-C9JfxzPo.mjs"],"sourcesContent":["import { ifDefined } from \"@internal/utils/defined\";\nimport { docsUrlFor } from \"@internal/utils/structured-error\";\n//#region src/control.ts\n/**\n* Structured CLI error that contains all information needed for error envelopes.\n* Call sites throw these errors with full context.\n*\n* A `CliStructuredError` is a `StructuredError` (see\n* `@internal/utils/structured-error`): `code` is a dotted\n* `NAMESPACE.SUBCODE` string, and the namespace prefix is the error's\n* category — there is no separate `domain` field. See\n* [ADR 239](../../../../../docs/architecture%20docs/adrs/ADR%20239%20-%20Errors%20are%20structural%20envelopes%20with%20dotted%20namespace%20codes.md)\n* for the namespace taxonomy.\n*/\nvar CliStructuredError = class extends Error {\n\tcode;\n\tseverity;\n\tconstructor(code, summary, options) {\n\t\tsuper(summary, options?.cause !== void 0 ? { cause: options.cause } : void 0);\n\t\tthis.name = \"CliStructuredError\";\n\t\tthis.code = code;\n\t\tthis.severity = options?.severity ?? \"error\";\n\t\tconst fix = options?.fix === options?.why ? void 0 : options?.fix;\n\t\tconst where = options?.where ? {\n\t\t\t...ifDefined(\"path\", options.where.path),\n\t\t\t...ifDefined(\"line\", options.where.line)\n\t\t} : void 0;\n\t\tObject.assign(this, {\n\t\t\t...ifDefined(\"why\", options?.why),\n\t\t\t...ifDefined(\"fix\", fix),\n\t\t\t...ifDefined(\"nextActions\", options?.nextActions),\n\t\t\t...ifDefined(\"where\", where),\n\t\t\t...ifDefined(\"meta\", options?.meta),\n\t\t\t...ifDefined(\"docsUrl\", options?.docsUrl)\n\t\t});\n\t}\n\t/**\n\t* Converts this error to a CLI error envelope for output formatting.\n\t*\n\t* This is the boundary that emits the envelope, so it is where a missing\n\t* `nextActions` becomes `[]`.\n\t*/\n\ttoEnvelope() {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tcode: this.code,\n\t\t\tseverity: this.severity,\n\t\t\tsummary: this.message,\n\t\t\t...ifDefined(\"why\", this.why),\n\t\t\t...ifDefined(\"fix\", this.fix),\n\t\t\tnextActions: this.nextActions ?? [],\n\t\t\t...ifDefined(\"where\", this.where),\n\t\t\t...ifDefined(\"meta\", this.meta),\n\t\t\t...ifDefined(\"docsUrl\", this.docsUrl)\n\t\t};\n\t}\n\t/**\n\t* Type guard to check if an error is a CliStructuredError.\n\t* Uses duck-typing to work across module boundaries where instanceof may fail.\n\t*/\n\tstatic is(error) {\n\t\tif (!(error instanceof Error)) return false;\n\t\tconst candidate = error;\n\t\treturn candidate.name === \"CliStructuredError\" && typeof candidate.code === \"string\" && typeof candidate.toEnvelope === \"function\";\n\t}\n};\n/**\n* Config file not found or missing.\n*/\nfunction errorConfigFileNotFound(configPath, options) {\n\treturn new CliStructuredError(\"CONFIG.FILE_NOT_FOUND\", \"Config file not found\", {\n\t\t...options?.why ? { why: options.why } : { why: \"Config file not found\" },\n\t\tfix: \"Run 'prisma-next init' to create a config file\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Create a config file\",\n\t\t\tcommand: \"{bin} init\"\n\t\t}],\n\t\tdocsUrl: docsUrlFor(\"CONFIG.FILE_NOT_FOUND\"),\n\t\t...configPath ? { where: { path: configPath } } : {}\n\t});\n}\n/**\n* Config module failed to evaluate (syntax error, module threw during import).\n*/\nfunction errorConfigEvaluationFailed(configPath, options) {\n\treturn new CliStructuredError(\"CONFIG.EVALUATION_FAILED\", \"Config file could not be evaluated\", {\n\t\twhy: options.why,\n\t\tfix: \"Fix the error in your prisma-next.config.ts so the module evaluates, then rerun the command\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.EVALUATION_FAILED\"),\n\t\t...configPath ? { where: { path: configPath } } : {},\n\t\t...options.cause !== void 0 ? { cause: options.cause } : {}\n\t});\n}\n/**\n* Config module evaluated, but its export does not carry the defineConfig\n* version marker (plain object export, or a config produced by a different\n* defineConfig such as classic Prisma's).\n*/\nfunction errorConfigVersionMarkerMissing(configPath) {\n\treturn new CliStructuredError(\"CONFIG.VERSION_MARKER_MISSING\", \"Config is not a defineConfig result\", {\n\t\twhy: \"The config module evaluated, but its default export was not created by a current defineConfig\",\n\t\tfix: \"Create the config with defineConfig (imported from your target's '/config' entrypoint) and export its return value directly\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.VERSION_MARKER_MISSING\"),\n\t\t...configPath ? { where: { path: configPath } } : {}\n\t});\n}\n/**\n* Contract configuration missing from config.\n*/\nfunction errorContractConfigMissing(options) {\n\treturn new CliStructuredError(\"CONFIG.CONTRACT_MISSING\", \"Contract configuration missing\", {\n\t\twhy: options?.why ?? \"The contract configuration is required for emit\",\n\t\tfix: \"Add contract configuration to your prisma-next.config.ts\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.CONTRACT_MISSING\")\n\t});\n}\n/**\n* Contract validation failed.\n*/\nfunction errorContractValidationFailed(reason, options) {\n\treturn new CliStructuredError(\"CONTRACT.VALIDATION_FAILED\", \"Contract validation failed\", {\n\t\twhy: reason,\n\t\tfix: \"Re-run `prisma-next contract emit`, or fix the contract file and try again\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Re-emit the contract\",\n\t\t\tcommand: \"{bin} contract emit\"\n\t\t}, {\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: \"Fix the contract file, then re-run the command\",\n\t\t\treason\n\t\t}],\n\t\tdocsUrl: docsUrlFor(\"CONTRACT.VALIDATION_FAILED\"),\n\t\t...options?.where ? { where: options.where } : {},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n/**\n* File not found.\n*/\nfunction errorFileNotFound(filePath, options) {\n\treturn new CliStructuredError(\"CLI.FILE_NOT_FOUND\", \"File not found\", {\n\t\twhy: options?.why ?? `File not found: ${filePath}`,\n\t\tfix: options?.fix ?? \"Check that the file path is correct\",\n\t\twhere: { path: filePath },\n\t\t...options?.docsUrl ? { docsUrl: options.docsUrl } : {},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n/**\n* Database connection is required but not provided.\n*/\nfunction errorDatabaseConnectionRequired(options) {\n\tconst runHint = options?.retryCommand ? `Run \\`${options.retryCommand}\\`` : options?.commandName ? `Run \\`prisma-next ${options.commandName} --db <url>\\`` : \"Provide `--db <url>`\";\n\treturn new CliStructuredError(\"CONFIG.DB_CONNECTION_REQUIRED\", \"Database connection is required\", {\n\t\twhy: options?.why ?? \"Database connection is required for this command\",\n\t\tfix: `${runHint}, or set \\`db: { connection: \"postgres://…\" }\\` in prisma-next.config.ts`,\n\t\t...options?.missingFlags !== void 0 ? { meta: { missingFlags: [...options.missingFlags] } } : {}\n\t});\n}\n/**\n* Query runner factory is required but not provided in config.\n*/\nfunction errorQueryRunnerFactoryRequired(options) {\n\treturn new CliStructuredError(\"CONFIG.QUERY_RUNNER_FACTORY_REQUIRED\", \"Query runner factory is required\", {\n\t\twhy: options?.why ?? \"Config.db.queryRunnerFactory is required for db verify\",\n\t\tfix: \"Add db.queryRunnerFactory to prisma-next.config.ts\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.QUERY_RUNNER_FACTORY_REQUIRED\")\n\t});\n}\n/**\n* Family verify.readMarker is required but not provided.\n*/\nfunction errorFamilyReadMarkerSqlRequired(options) {\n\treturn new CliStructuredError(\"CONFIG.FAMILY_READ_MARKER_REQUIRED\", \"Family readMarker() is required\", {\n\t\twhy: options?.why ?? \"Family verify.readMarker is required for db verify\",\n\t\tfix: \"Ensure family.verify.readMarker() is exported by your family package\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.FAMILY_READ_MARKER_REQUIRED\")\n\t});\n}\n/**\n* JSON output format not supported.\n*/\nfunction errorJsonFormatNotSupported(options) {\n\treturn new CliStructuredError(\"CLI.JSON_FORMAT_UNSUPPORTED\", \"Unsupported JSON format\", {\n\t\twhy: `The ${options.command} command does not support --json ${options.format}`,\n\t\tfix: `Use --json ${options.supportedFormats.join(\" or \")}, or omit --json for human output`,\n\t\tmeta: {\n\t\t\tcommand: options.command,\n\t\t\tformat: options.format,\n\t\t\tsupportedFormats: options.supportedFormats\n\t\t}\n\t});\n}\n/**\n* Driver is required for DB-connected commands but not provided.\n*/\nfunction errorDriverRequired(options) {\n\treturn new CliStructuredError(\"CONFIG.DRIVER_REQUIRED\", \"Driver is required for DB-connected commands\", {\n\t\twhy: options?.why ?? \"Config.driver is required for DB-connected commands\",\n\t\tfix: \"Add a control-plane driver to prisma-next.config.ts (e.g. import a driver descriptor and set `driver: postgresDriver`)\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.DRIVER_REQUIRED\")\n\t});\n}\n/**\n* Contract requires extension packs that are not provided by config descriptors.\n*/\nfunction errorContractMissingExtensions(options) {\n\tconst missing = [...options.missingExtensions].sort();\n\treturn new CliStructuredError(\"CONFIG.MISSING_EXTENSION_PACKS\", \"Missing extension packs in config\", {\n\t\twhy: missing.length === 1 ? `Contract requires extension pack '${missing[0]}', but CLI config does not provide a matching descriptor.` : `Contract requires extension packs ${missing.map((p) => `'${p}'`).join(\", \")}, but CLI config does not provide matching descriptors.`,\n\t\tfix: \"Add the missing extension descriptors to `extensions` in prisma-next.config.ts\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.MISSING_EXTENSION_PACKS\"),\n\t\tmeta: {\n\t\t\tmissingExtensions: missing,\n\t\t\tprovidedComponentIds: [...options.providedComponentIds].sort()\n\t\t}\n\t});\n}\n/**\n* Migration planning failed due to conflicts.\n*/\nfunction errorMigrationPlanningFailed(options) {\n\tconst conflictSummaries = options.conflicts.map((c) => c.summary);\n\tconst computedWhy = options.why ?? conflictSummaries.join(\"\\n\");\n\tconst conflictFixes = options.conflicts.map((c) => c.why).filter((why) => typeof why === \"string\");\n\treturn new CliStructuredError(\"MIGRATION.PLANNING_FAILED\", \"Migration planning failed\", {\n\t\twhy: computedWhy,\n\t\tfix: conflictFixes.length > 0 ? conflictFixes.join(\"\\n\") : \"Use `db verify --schema-only` to inspect conflicts, or ensure the database is empty\",\n\t\tmeta: { conflicts: options.conflicts },\n\t\tdocsUrl: docsUrlFor(\"MIGRATION.PLANNING_FAILED\")\n\t});\n}\n/**\n* Target does not support migrations (missing createPlanner/createRunner).\n*/\nfunction errorTargetMigrationNotSupported(options) {\n\treturn new CliStructuredError(\"MIGRATION.TARGET_UNSUPPORTED\", \"Target does not support migrations\", {\n\t\twhy: options?.why ?? \"The configured target does not provide migration planner/runner\",\n\t\tfix: \"Select a target that provides migrations (it must export `target.migrations` for db init)\",\n\t\tdocsUrl: docsUrlFor(\"MIGRATION.TARGET_UNSUPPORTED\")\n\t});\n}\n/**\n* The migration-file CLI received `--config` without a path argument (either\n* a bare trailing `--config`, or `--config` followed by another flag like\n* `--config --dry-run`). Surfacing this as a structured error fails fast\n* rather than silently consuming the next flag as the config path or\n* falling back to default discovery against the wrong project.\n*/\nfunction errorMigrationCliInvalidConfigArg(options) {\n\treturn new CliStructuredError(\"CLI.CONFIG_ARG_MISSING_PATH\", \"--config flag requires a path argument\", {\n\t\twhy: options?.nextToken !== void 0 ? `\\`--config\\` was followed by another flag (\\`${options.nextToken}\\`) instead of a path argument.` : \"`--config` was passed without a following path argument.\",\n\t\tfix: \"Pass a config path: `--config <path>` or `--config=<path>`.\",\n\t\tmeta: options?.nextToken !== void 0 ? { nextToken: options.nextToken } : {}\n\t});\n}\n/**\n* The migration-file CLI received a flag it does not recognise. Surfaced as a\n* structured error so consumers can render their own \"did you mean\"\n* suggestions from `meta.knownFlags` rather than parsing the message.\n*\n* Designed to wrap clipanion's `UnknownSyntaxError` at the parser boundary:\n* pass the offending token as `flag` and the option declarations as\n* `knownFlags`.\n*/\nfunction errorMigrationCliUnknownFlag(options) {\n\tconst knownList = options.knownFlags.join(\", \");\n\treturn new CliStructuredError(\"CLI.UNKNOWN_FLAG\", \"Unknown migration CLI flag\", {\n\t\twhy: `Unknown flag \\`${options.flag}\\`.`,\n\t\tfix: `Known flags: ${knownList}. Run with \\`--help\\` to see the full list.`,\n\t\tmeta: {\n\t\t\tflag: options.flag,\n\t\t\tknownFlags: options.knownFlags\n\t\t}\n\t});\n}\n/**\n* The main CLI received an unsupported `--format` value.\n*/\nfunction errorInvalidOutputFormat(value) {\n\treturn new CliStructuredError(\"CLI.INVALID_OUTPUT_FORMAT\", `Invalid --format value \"${value}\". Allowed values: pretty, json.`, { meta: {\n\t\tvalue,\n\t\tallowed: [\"pretty\", \"json\"]\n\t} });\n}\n/**\n* The main CLI received mutually exclusive output format flags\n* (`--format pretty` together with `--json`).\n*/\nfunction errorOutputFormatMutex() {\n\treturn new CliStructuredError(\"CLI.OUTPUT_FORMAT_CONFLICT\", \"Cannot use --format pretty together with --json. Use --format json or --json alone for JSON output.\");\n}\n/**\n* Config validation error (missing required fields).\n*/\nfunction errorConfigValidation(field, options) {\n\treturn new CliStructuredError(\"CONFIG.VALIDATION_FAILED\", \"Config validation error\", {\n\t\twhy: options?.why ?? `Config must have a \"${field}\" field`,\n\t\tfix: \"Check your prisma-next.config.ts and ensure all required fields are provided\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.VALIDATION_FAILED\"),\n\t\tmeta: {\n\t\t\tfield,\n\t\t\t...options?.section !== void 0 ? { section: options.section } : {}\n\t\t}\n\t});\n}\n/**\n* An enum declares a codecId that no component in the contract's pack stack provides,\n* so its member values cannot be encoded. Thrown by both authoring paths (TS `defineContract`\n* and PSL interpretation) when the codec lookup built from the contract's packs has no\n* descriptor for the codecId.\n*/\nfunction errorEnumCodecNotInPackStack(options) {\n\treturn new CliStructuredError(\"CONTRACT.ENUM_CODEC_NOT_IN_PACK_STACK\", `Enum codec \"${options.codecId}\" is not part of the contract's pack stack`, {\n\t\twhy: `An enum uses codec \"${options.codecId}\", but no family, target, or extension pack in the contract provides it.`,\n\t\tfix: \"Use a codec provided by the contract's target/extension packs, or add the pack that supplies this codec.\",\n\t\tmeta: { codecId: options.codecId }\n\t});\n}\n/**\n* Generic unexpected error.\n*/\nfunction errorUnexpected(message, options) {\n\treturn new CliStructuredError(\"CLI.UNEXPECTED\", \"Unexpected error\", {\n\t\twhy: options?.why ?? message,\n\t\tfix: options?.fix ?? \"Check the error message and try again\",\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n//#endregion\nexport { errorUnexpected as S, errorMigrationCliUnknownFlag as _, errorConfigVersionMarkerMissing as a, errorQueryRunnerFactoryRequired as b, errorContractValidationFailed as c, errorEnumCodecNotInPackStack as d, errorFamilyReadMarkerSqlRequired as f, errorMigrationCliInvalidConfigArg as g, errorJsonFormatNotSupported as h, errorConfigValidation as i, errorDatabaseConnectionRequired as l, errorInvalidOutputFormat as m, errorConfigEvaluationFailed as n, errorContractConfigMissing as o, errorFileNotFound as p, errorConfigFileNotFound as r, errorContractMissingExtensions as s, CliStructuredError as t, errorDriverRequired as u, errorMigrationPlanningFailed as v, errorTargetMigrationNotSupported as x, errorOutputFormatMutex as y };\n\n//# sourceMappingURL=control-C9JfxzPo.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,IAAI,qBAAqB,cAAc,MAAM;CAC5C;CACA;CACA,YAAY,MAAM,SAAS,SAAS;EACnC,MAAM,SAAS,SAAS,UAAU,KAAK,IAAI,EAAE,OAAO,QAAQ,MAAM,IAAI,KAAK,CAAC;EAC5E,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,WAAW,SAAS,YAAY;EACrC,MAAM,MAAM,SAAS,QAAQ,SAAS,MAAM,KAAK,IAAI,SAAS;EAC9D,MAAM,QAAQ,SAAS,QAAQ;GAC9B,GAAG,UAAU,QAAQ,QAAQ,MAAM,IAAI;GACvC,GAAG,UAAU,QAAQ,QAAQ,MAAM,IAAI;EACxC,IAAI,KAAK;EACT,OAAO,OAAO,MAAM;GACnB,GAAG,UAAU,OAAO,SAAS,GAAG;GAChC,GAAG,UAAU,OAAO,GAAG;GACvB,GAAG,UAAU,eAAe,SAAS,WAAW;GAChD,GAAG,UAAU,SAAS,KAAK;GAC3B,GAAG,UAAU,QAAQ,SAAS,IAAI;GAClC,GAAG,UAAU,WAAW,SAAS,OAAO;EACzC,CAA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B,qGAAqG;AAClK;;;;AAIA,SAAS,sBAAsB,OAAO,SAAS;CAC9C,OAAO,IAAI,mBAAmB,4BAA4B,2BAA2B;EACpF,KAAK,SAAS,OAAO,uBAAuB,MAAM;EAClD,KAAK;EACL,SAAS,WAAW,0BAA0B;EAC9C,MAAM;GACL;GACA,GAAG,SAAS,YAAY,KAAK,IAAI,EAAE,SAAS,QAAQ,QAAQ,IAAI,CAAC;EAClE;CACD,CAAC;AACF;;;;;;;AAOA,SAAS,6BAA6B,SAAS;CAC9C,OAAO,IAAI,mBAAmB,yCAAyC,eAAe,QAAQ,QAAQ,6CAA6C;EAClJ,KAAK,uBAAuB,QAAQ,QAAQ;EAC5C,KAAK;EACL,MAAM,EAAE,SAAS,QAAQ,QAAQ;CAClC,CAAC;AACF;;;;AAIA,SAAS,gBAAgB,SAAS,SAAS;CAC1C,OAAO,IAAI,mBAAmB,kBAAkB,oBAAoB;EACnE,KAAK,SAAS,OAAO;EACrB,KAAK,SAAS,OAAO;EACrB,GAAG,UAAU,SAAS,SAAS,KAAK;CACrC,CAAC;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
|
|
2
2
|
import { t as InternalError } from "./internal-error-BIc-ehme-ouBQPoEL.mjs";
|
|
3
3
|
import { n as runtimeError } from "./runtime-error-BA9d7XjZ-BlT8t6LB.mjs";
|
|
4
|
-
import { _ as mergeAuthoringNamespaces, a as collectScalarTypeConstructors, i as collectContributedDescriptorPaths, n as assertResolvableTypeConstructorTemplates, t as assertNoCrossRegistryCollisions } from "./framework-authoring-CDEvlouU-
|
|
4
|
+
import { _ as mergeAuthoringNamespaces, a as collectScalarTypeConstructors, i as collectContributedDescriptorPaths, n as assertResolvableTypeConstructorTemplates, t as assertNoCrossRegistryCollisions } from "./framework-authoring-CDEvlouU-CD43IJTJ.mjs";
|
|
5
5
|
import { n as materializeCodec, r as resolveCodecDescriptorOrThrow, t as CONTRACT_CODEC_DESCRIPTOR_MISSING } from "./resolve-codec-BZF8TZh_-D-xORT9Q.mjs";
|
|
6
6
|
import { a as mergeCapabilityMatrices, n as isAggregateDescriptor, t as aggregateDescriptorKey } from "./capabilities-BCEONw9w-C-lo3rF8.mjs";
|
|
7
7
|
//#region ../../../1-framework/1-core/framework-components/dist/control.mjs
|
|
@@ -657,4 +657,4 @@ function dispositionForCategory(controlPolicy, category) {
|
|
|
657
657
|
//#endregion
|
|
658
658
|
export { hasOperationPreview as C, issueOutcome as D, hasSchemaView as E, orderIssuesByDependencies as O, hasMigrations as S, hasSchemaSubjectClassifier as T, dispositionForCategory as _, VERIFY_CODE_HASH_MISMATCH as a, extractComponentIds as b, VERIFY_CODE_TARGET_MISMATCH as c, assertUniqueCodecOwner as d, buildExtensionLoadOrder as f, diffSchemas as g, createControlStack as h, SchemaTreeNode as i, storageHashHex as k, assembleAuthoringContributions as l, contractSnapshotTypesSpecifier as m, CONTRACT_SNAPSHOTS_DIRNAME as n, VERIFY_CODE_MARKER_MISSING as o, contractSnapshotJsonSpecifier as p, SchemaDiff as r, VERIFY_CODE_SCHEMA_FAILURE as s, APP_SPACE_ID as t, assembleControlMutationDefaults as u, extractCodecLookup as v, hasPslContractInfer as w, extractQueryOperationTypeImports as x, extractCodecTypeImports as y };
|
|
659
659
|
|
|
660
|
-
//# sourceMappingURL=control-
|
|
660
|
+
//# sourceMappingURL=control-DuiafB_U.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-DFqSH2EY.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/control.mjs"],"sourcesContent":["import { n as runtimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { n as materializeCodec, r as resolveCodecDescriptorOrThrow, t as CONTRACT_CODEC_DESCRIPTOR_MISSING } from \"./resolve-codec-BZF8TZh_.mjs\";\nimport { n as aggregateDescriptorKey, r as isAggregateDescriptor, t as mergeCapabilityMatrices } from \"./capabilities-BCEONw9w.mjs\";\nimport { _ as mergeAuthoringNamespaces, a as collectScalarTypeConstructors, i as collectContributedDescriptorPaths, n as assertResolvableTypeConstructorTemplates, t as assertNoCrossRegistryCollisions } from \"./framework-authoring-CDEvlouU.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/control/contract-snapshot-layout.ts\nconst CONTRACT_SNAPSHOTS_DIRNAME = \"snapshots\";\nconst STORAGE_HASH_PATTERN = /^[0-9a-f]{64}$/;\n/** Validate a storage hash for use as a directory name. */\nfunction storageHashHex(storageHash) {\n\tif (!STORAGE_HASH_PATTERN.test(storageHash)) throw new InternalError(`Invalid storage hash \"${storageHash}\": expected 64 lowercase hex characters`);\n\treturn storageHash;\n}\n/** Module specifier for the store's `contract.json`, POSIX separators. */\nfunction contractSnapshotJsonSpecifier(snapshotsImportPath, storageHash) {\n\treturn `${snapshotsImportPath}/${storageHashHex(storageHash)}/contract.json`;\n}\n/** Type-only module specifier for the store's `contract.d.ts` (no extension). */\nfunction contractSnapshotTypesSpecifier(snapshotsImportPath, storageHash) {\n\treturn `${snapshotsImportPath}/${storageHashHex(storageHash)}/contract`;\n}\n//#endregion\n//#region src/control/control-capabilities.ts\nfunction hasMigrations(target) {\n\treturn \"migrations\" in target && !!target[\"migrations\"];\n}\nfunction hasSchemaView(instance) {\n\treturn \"toSchemaView\" in instance && typeof instance[\"toSchemaView\"] === \"function\";\n}\nfunction hasPslContractInfer(instance) {\n\treturn \"inferPslContract\" in instance && typeof instance[\"inferPslContract\"] === \"function\";\n}\nfunction hasOperationPreview(instance) {\n\treturn \"toOperationPreview\" in instance && typeof instance[\"toOperationPreview\"] === \"function\";\n}\nfunction hasSchemaSubjectClassifier(instance) {\n\treturn \"classifySubjectGranularity\" in instance && typeof instance[\"classifySubjectGranularity\"] === \"function\" && \"classifyEntityKind\" in instance && typeof instance[\"classifyEntityKind\"] === \"function\";\n}\n//#endregion\n//#region src/control/control-operation-results.ts\nconst VERIFY_CODE_MARKER_MISSING = \"CONTRACT.MARKER_MISSING\";\nconst VERIFY_CODE_HASH_MISMATCH = \"CONTRACT.MARKER_MISMATCH\";\nconst VERIFY_CODE_TARGET_MISMATCH = \"CONTRACT.TARGET_MISMATCH\";\nconst VERIFY_CODE_SCHEMA_FAILURE = \"CONTRACT.SCHEMA_VERIFICATION_FAILED\";\n//#endregion\n//#region src/control/control-schema-view.ts\nvar SchemaTreeNode = class {\n\tkind;\n\tid;\n\tlabel;\n\tmeta;\n\tchildren;\n\tconstructor(options) {\n\t\tthis.kind = options.kind;\n\t\tthis.id = options.id;\n\t\tthis.label = options.label;\n\t\tif (options.meta !== void 0) this.meta = options.meta;\n\t\tif (options.children !== void 0) this.children = options.children;\n\t\tObject.freeze(this);\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visit(this);\n\t}\n};\n//#endregion\n//#region src/control/control-spaces.ts\n/**\n* Canonical control-plane identifiers for contract spaces.\n*\n* A contract space is the disjoint `(contract.json, migration-graph)` unit\n* the per-space planner / runner / verifier (project: extension contract\n* spaces, TML-2397) operates on. The application owns one well-known\n* space — the value below — and each loaded extension that contributes\n* schema owns a uniquely-named space.\n*\n* Lives in `framework-components/control` so every layer that has to\n* reason about space identity (the migration tooling, the SQL runtime's\n* marker reader, target-side statement builders, target-side adapters)\n* can import a single value rather than duplicating the literal. Raw\n* `'app'` string literals in framework / target / runtime / adapter\n* source code are forbidden and policed by\n* `scripts/lint-app-space-id.mjs` (wired into `pnpm lint:deps`).\n*\n* @see specs/framework-mechanism.spec.md § 3 — Layout convention (γ).\n*/\nconst APP_SPACE_ID = \"app\";\n//#endregion\n//#region src/control/control-stack.ts\nfunction addUniqueId(ids, seen, id) {\n\tif (!seen.has(id)) {\n\t\tids.push(id);\n\t\tseen.add(id);\n\t}\n}\nfunction assertUniqueCodecOwner(options) {\n\tconst existingOwner = options.owners.get(options.codecId);\n\tif (existingOwner !== void 0) throw new InternalError(`Duplicate ${options.entityLabel} for codecId \"${options.codecId}\". Descriptor \"${options.descriptorId}\" conflicts with \"${existingOwner}\". Each codecId can only have one ${options.entityOwnershipLabel}.`);\n}\nfunction extractCodecTypeImports(descriptors) {\n\tconst imports = [];\n\tfor (const descriptor of descriptors) {\n\t\tconst codecTypes = descriptor.types?.codecTypes;\n\t\tif (codecTypes?.import) imports.push(codecTypes.import);\n\t\tif (codecTypes?.typeImports) imports.push(...codecTypes.typeImports);\n\t}\n\treturn imports;\n}\nfunction extractQueryOperationTypeImports(descriptors) {\n\tconst imports = [];\n\tfor (const descriptor of descriptors) {\n\t\tconst queryOperationTypes = descriptor.types?.queryOperationTypes;\n\t\tif (queryOperationTypes?.import) imports.push(queryOperationTypes.import);\n\t}\n\treturn imports;\n}\nfunction extractComponentIds(family, target, adapter, extensions) {\n\tconst ids = [];\n\tconst seen = /* @__PURE__ */ new Set();\n\taddUniqueId(ids, seen, family.id);\n\taddUniqueId(ids, seen, target.id);\n\tif (adapter) addUniqueId(ids, seen, adapter.id);\n\tfor (const ext of extensions) addUniqueId(ids, seen, ext.id);\n\treturn ids;\n}\nfunction assembleAuthoringContributions(descriptors) {\n\tconst field = {};\n\tconst type = {};\n\tconst entityTypes = {};\n\tconst pslBlockDescriptors = {};\n\tconst modelAttributes = {};\n\tconst pathOwners = /* @__PURE__ */ new Map();\n\tconst claimContributedPaths = (namespace, descriptorKind, label, descriptorId) => {\n\t\tfor (const path of collectContributedDescriptorPaths(namespace, descriptorKind)) {\n\t\t\tconst key = `${label}:${path}`;\n\t\t\tconst existingOwner = pathOwners.get(key);\n\t\t\tif (existingOwner !== void 0) throw new InternalError(`Duplicate authoring ${label} helper \"${path}\". Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\".`);\n\t\t\tpathOwners.set(key, descriptorId);\n\t\t}\n\t};\n\tlet valueObjectStorageDeclaration;\n\tfor (const descriptor of descriptors) {\n\t\tconst descriptorId = descriptor.id ?? \"<unknown>\";\n\t\tconst declaredValueObjectStorageType = descriptor.authoring?.valueObjectStorageType;\n\t\tif (declaredValueObjectStorageType !== void 0) {\n\t\t\tif (valueObjectStorageDeclaration !== void 0) throw new InternalError(`Duplicate authoring valueObjectStorageType declaration. Descriptor \"${descriptorId}\" conflicts with \"${valueObjectStorageDeclaration.ownerId}\". Exactly one composed component may declare the value-object storage type.`);\n\t\t\tvalueObjectStorageDeclaration = {\n\t\t\t\tname: declaredValueObjectStorageType,\n\t\t\t\townerId: descriptorId\n\t\t\t};\n\t\t}\n\t\tif (descriptor.authoring?.field) {\n\t\t\tclaimContributedPaths(descriptor.authoring.field, \"fieldPreset\", \"field\", descriptorId);\n\t\t\tmergeAuthoringNamespaces(field, descriptor.authoring.field, [], \"fieldPreset\", \"field\");\n\t\t}\n\t\tif (descriptor.authoring?.type) {\n\t\t\tclaimContributedPaths(descriptor.authoring.type, \"typeConstructor\", \"type\", descriptorId);\n\t\t\tassertResolvableTypeConstructorTemplates(descriptor.authoring.type, descriptorId);\n\t\t\tmergeAuthoringNamespaces(type, descriptor.authoring.type, [], \"typeConstructor\", \"type\");\n\t\t}\n\t\tif (descriptor.authoring?.entityTypes) {\n\t\t\tclaimContributedPaths(descriptor.authoring.entityTypes, \"entity\", \"entity\", descriptorId);\n\t\t\tmergeAuthoringNamespaces(entityTypes, descriptor.authoring.entityTypes, [], \"entity\", \"entity\");\n\t\t}\n\t\tif (descriptor.authoring?.pslBlockDescriptors) {\n\t\t\tclaimContributedPaths(descriptor.authoring.pslBlockDescriptors, \"pslBlock\", \"pslBlock\", descriptorId);\n\t\t\tmergeAuthoringNamespaces(pslBlockDescriptors, descriptor.authoring.pslBlockDescriptors, [], \"pslBlock\", \"pslBlock\");\n\t\t}\n\t\tif (descriptor.authoring?.modelAttributes) mergeAuthoringNamespaces(modelAttributes, descriptor.authoring.modelAttributes, [], \"modelAttribute\", \"modelAttribute\");\n\t}\n\tconst fieldNamespace = field;\n\tconst typeNamespace = type;\n\tconst entityTypeNamespace = entityTypes;\n\tconst pslBlockDescriptorNamespace = blindCast(pslBlockDescriptors);\n\tconst modelAttributeNamespace = blindCast(modelAttributes);\n\tassertNoCrossRegistryCollisions(typeNamespace, fieldNamespace, entityTypeNamespace, pslBlockDescriptorNamespace, modelAttributeNamespace);\n\tif (valueObjectStorageDeclaration !== void 0 && !collectScalarTypeConstructors(typeNamespace).has(valueObjectStorageDeclaration.name)) throw new InternalError(`Invalid authoring valueObjectStorageType \"${valueObjectStorageDeclaration.name}\" declared by descriptor \"${valueObjectStorageDeclaration.ownerId}\". The name must be a top-level bare-eligible type constructor in the assembled authoring namespace.`);\n\treturn {\n\t\tfield: fieldNamespace,\n\t\ttype: typeNamespace,\n\t\tentityTypes: entityTypeNamespace,\n\t\tpslBlockDescriptors: pslBlockDescriptorNamespace,\n\t\tmodelAttributes: modelAttributeNamespace,\n\t\t...valueObjectStorageDeclaration !== void 0 ? { valueObjectStorageType: valueObjectStorageDeclaration.name } : {}\n\t};\n}\nfunction assembleControlMutationDefaults(descriptors) {\n\tconst defaultFunctionRegistry = /* @__PURE__ */ new Map();\n\tconst functionOwners = /* @__PURE__ */ new Map();\n\tconst generatorMap = /* @__PURE__ */ new Map();\n\tconst generatorOwners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tconst contributions = descriptor.controlMutationDefaults;\n\t\tif (!contributions) continue;\n\t\tconst descriptorId = descriptor.id ?? \"<unknown>\";\n\t\tfor (const generatorDescriptor of contributions.generatorDescriptors) {\n\t\t\tconst existingOwner = generatorOwners.get(generatorDescriptor.id);\n\t\t\tif (existingOwner !== void 0) throw new InternalError(`Duplicate mutation default generator id \"${generatorDescriptor.id}\". Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\".`);\n\t\t\tgeneratorMap.set(generatorDescriptor.id, generatorDescriptor);\n\t\t\tgeneratorOwners.set(generatorDescriptor.id, descriptorId);\n\t\t}\n\t\tfor (const [functionName, handler] of contributions.defaultFunctionRegistry) {\n\t\t\tconst existingOwner = functionOwners.get(functionName);\n\t\t\tif (existingOwner !== void 0) throw new InternalError(`Duplicate mutation default function \"${functionName}\". Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\".`);\n\t\t\tdefaultFunctionRegistry.set(functionName, handler);\n\t\t\tfunctionOwners.set(functionName, descriptorId);\n\t\t}\n\t}\n\treturn {\n\t\tdefaultFunctionRegistry,\n\t\tgeneratorDescriptors: Array.from(generatorMap.values())\n\t};\n}\n/**\n* Collect every contributed {@link AggregateDescriptor} across the composed components, rejecting malformed shapes and second claims on one `(operation, input)` overload.\n*\n* Both planes read the same contribution slot: emission derives result types from these descriptors, and family runtimes build their resolution registry from them. Rejections are user-facing — an extension author's bad contribution surfaces here first, during `contract emit` — so a malformed shape raises `CONTRACT.AGGREGATE_DESCRIPTOR_INVALID` and a second claim raises `CONTRACT.AGGREGATE_DESCRIPTOR_DUPLICATE`, each naming the contributing component.\n*/\nfunction collectAggregateDescriptors(descriptors) {\n\tconst collected = [];\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tconst descriptorId = descriptor.id ?? \"<unknown>\";\n\t\tfor (const contributed of descriptor.types?.aggregateDescriptors ?? []) {\n\t\t\tif (!isAggregateDescriptor(contributed)) throw runtimeError(\"CONTRACT.AGGREGATE_DESCRIPTOR_INVALID\", `Malformed aggregate descriptor contributed by \"${descriptorId}\". A descriptor declares a non-empty \\`operation\\`, an \\`input\\` match of kind \\`none\\`/\\`any\\`/\\`codec\\`/\\`trait\\`, an \\`output\\` of kind \\`self\\`/\\`codec\\`, and a boolean \\`nullable\\` — plus \\`emptyResultJson\\`, in the result codec's canonical JSON, where \\`nullable\\` is false; a \\`self\\` output needs an input to reuse.`, {\n\t\t\t\tcontributedBy: descriptorId,\n\t\t\t\tdescriptor: contributed\n\t\t\t});\n\t\t\tconst key = aggregateDescriptorKey(contributed);\n\t\t\tconst existingOwner = owners.get(key);\n\t\t\tif (existingOwner !== void 0) throw runtimeError(\"CONTRACT.AGGREGATE_DESCRIPTOR_DUPLICATE\", `Duplicate aggregate descriptor for \"${key}\". Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\". Each operation/input pair can only have one provider.`, {\n\t\t\t\tkey,\n\t\t\t\tcontributedBy: descriptorId,\n\t\t\t\towner: existingOwner\n\t\t\t});\n\t\t\towners.set(key, descriptorId);\n\t\t\tcollected.push(contributed);\n\t\t}\n\t}\n\treturn collected;\n}\n/**\n* Flatten the codec descriptors the composed components contribute.\n*\n* A component may know a codec and still withhold it — an adapter that cannot name a codec's emitted type contributes the rest without it — so the contributed set is not always the set some component's own registry holds. Consumers whose output must agree with what the runtime resolves read this list rather than any one component's registry.\n*/\nfunction collectCodecDescriptors(descriptors) {\n\treturn descriptors.flatMap((descriptor) => descriptor.types?.codecTypes?.codecDescriptors ?? []);\n}\nfunction extractCodecLookup(descriptors) {\n\tconst byId = /* @__PURE__ */ new Map();\n\tconst descriptorsById = /* @__PURE__ */ new Map();\n\tconst targetTypesById = /* @__PURE__ */ new Map();\n\tconst renderersById = /* @__PURE__ */ new Map();\n\tconst inputRenderersById = /* @__PURE__ */ new Map();\n\tconst valueLiteralRenderersById = /* @__PURE__ */ new Map();\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tconst codecTypes = descriptor.types?.codecTypes;\n\t\tconst descriptorId = descriptor.id;\n\t\tfor (const codecDescriptor of codecTypes?.codecDescriptors ?? []) {\n\t\t\tassertUniqueCodecOwner({\n\t\t\t\tcodecId: codecDescriptor.codecId,\n\t\t\t\towners,\n\t\t\t\tdescriptorId,\n\t\t\t\tentityLabel: \"codec descriptor\",\n\t\t\t\tentityOwnershipLabel: \"codec descriptor provider\"\n\t\t\t});\n\t\t\towners.set(codecDescriptor.codecId, descriptorId);\n\t\t\tdescriptorsById.set(codecDescriptor.codecId, codecDescriptor);\n\t\t\tif (Array.isArray(codecDescriptor.targetTypes)) targetTypesById.set(codecDescriptor.codecId, codecDescriptor.targetTypes);\n\t\t\tif (typeof codecDescriptor.renderOutputType === \"function\") renderersById.set(codecDescriptor.codecId, codecDescriptor.renderOutputType);\n\t\t\tif (typeof codecDescriptor.renderInputType === \"function\") inputRenderersById.set(codecDescriptor.codecId, codecDescriptor.renderInputType);\n\t\t\tif (typeof codecDescriptor.renderValueLiteral === \"function\") valueLiteralRenderersById.set(codecDescriptor.codecId, codecDescriptor.renderValueLiteral);\n\t\t\tif (!byId.has(codecDescriptor.codecId)) if (codecDescriptor.isParameterized) try {\n\t\t\t\tconst representative = codecDescriptor.factory({})({ name: `<lookup:${codecDescriptor.codecId}>` });\n\t\t\t\tbyId.set(codecDescriptor.codecId, representative);\n\t\t\t} catch {}\n\t\t\telse {\n\t\t\t\tconst representative = codecDescriptor.factory(void 0)({ name: `<lookup:${codecDescriptor.codecId}>` });\n\t\t\t\tbyId.set(codecDescriptor.codecId, representative);\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tget: (id) => byId.get(id),\n\t\tforCodecRef(ref) {\n\t\t\treturn materializeCodec(resolveCodecDescriptorOrThrow((id) => descriptorsById.get(id), ref, CONTRACT_CODEC_DESCRIPTOR_MISSING), ref, { name: `<ref:${ref.codecId}>` });\n\t\t},\n\t\tforColumn: () => void 0,\n\t\ttargetTypesFor: (id) => targetTypesById.get(id),\n\t\trenderOutputTypeFor: (id, params) => renderersById.get(id)?.(params),\n\t\trenderInputTypeFor: (id, params) => inputRenderersById.get(id)?.(params),\n\t\trenderValueLiteralFor: (id, value, side) => valueLiteralRenderersById.get(id)?.(value, side),\n\t\tdescriptorFor: (id) => descriptorsById.get(id)\n\t};\n}\nfunction assembleExtensionContracts(extensions) {\n\tconst result = /* @__PURE__ */ new Map();\n\tfor (const ext of extensions) {\n\t\tif (ext.contractSpace === void 0) continue;\n\t\tresult.set(ext.id, ext.contractSpace.contractJson);\n\t}\n\treturn result;\n}\nfunction readDeclaredDependencyIds(descriptor) {\n\tconst packs = descriptor.contractSpace?.contractJson?.extensions;\n\tif (packs === null || typeof packs !== \"object\") return [];\n\treturn Object.keys(packs);\n}\n/**\n* Builds a dependency-respecting load order for the given extension descriptors\n* using Kahn's topological sort algorithm. Dependencies (packs declared in\n* `contractSpace.contractJson.extensions`) are placed before the extensions\n* that depend on them.\n*\n* Throws if the dependency graph contains a cycle, with an error message that\n* names every extension involved in the cycle.\n*\n* Throws if any extension declares a dependency on a pack ID that is not present\n* in the provided list — add the missing pack to the `extensions` list to\n* resolve the error.\n*/\nfunction buildExtensionLoadOrder(extensions) {\n\tif (extensions.length === 0) return [];\n\tconst idSet = new Set(extensions.map((e) => e.id));\n\tconst inDegree = /* @__PURE__ */ new Map();\n\tconst dependents = /* @__PURE__ */ new Map();\n\tfor (const ext of extensions) {\n\t\tif (!inDegree.has(ext.id)) inDegree.set(ext.id, 0);\n\t\tif (!dependents.has(ext.id)) dependents.set(ext.id, []);\n\t}\n\tfor (const ext of extensions) for (const depId of readDeclaredDependencyIds(ext)) {\n\t\tif (!idSet.has(depId)) throw new InternalError(`Extension \"${ext.id}\" declares a dependency on \"${depId}\", but \"${depId}\" is not in the provided extension set. Add the missing space to extensions.`);\n\t\tinDegree.set(ext.id, (inDegree.get(ext.id) ?? 0) + 1);\n\t\tconst list = dependents.get(depId);\n\t\tif (list !== void 0) list.push(ext.id);\n\t}\n\tconst queue = [];\n\tfor (const [id, deg] of inDegree) if (deg === 0) queue.push(id);\n\tqueue.sort();\n\tconst result = [];\n\twhile (queue.length > 0) {\n\t\tconst id = queue.shift();\n\t\tif (id === void 0) break;\n\t\tresult.push(id);\n\t\tconst children = dependents.get(id) ?? [];\n\t\tchildren.sort();\n\t\tfor (const childId of children) {\n\t\t\tconst newDeg = (inDegree.get(childId) ?? 1) - 1;\n\t\t\tinDegree.set(childId, newDeg);\n\t\t\tif (newDeg === 0) queue.push(childId);\n\t\t}\n\t}\n\tif (result.length < extensions.length) throw new InternalError(`Extension dependency cycle detected. Cycle members: ${extensions.map((e) => e.id).filter((id) => !result.includes(id)).sort().map((id) => `\"${id}\"`).join(\", \")}.`);\n\treturn result;\n}\nfunction createControlStack(input) {\n\tconst { family, target, adapter, driver, extensions = [] } = input;\n\tconst orderedIds = buildExtensionLoadOrder(extensions);\n\tconst extensionById = new Map(extensions.map((ext) => [ext.id, ext]));\n\tconst orderedExtensions = orderedIds.map((id) => extensionById.get(id)).filter((ext) => ext !== void 0);\n\tconst allDescriptors = [\n\t\tfamily,\n\t\ttarget,\n\t\t...adapter ? [adapter] : [],\n\t\t...orderedExtensions\n\t];\n\tconst codecLookup = extractCodecLookup(allDescriptors);\n\tconst authoringContributions = assembleAuthoringContributions(allDescriptors);\n\treturn {\n\t\tfamily,\n\t\ttarget,\n\t\tadapter,\n\t\tdriver,\n\t\textensions: orderedExtensions,\n\t\textensionContracts: assembleExtensionContracts(orderedExtensions),\n\t\tcodecTypeImports: extractCodecTypeImports(allDescriptors),\n\t\tqueryOperationTypeImports: extractQueryOperationTypeImports(allDescriptors),\n\t\textensionIds: extractComponentIds(family, target, adapter, orderedExtensions),\n\t\tcodecLookup,\n\t\tcodecDescriptors: collectCodecDescriptors(allDescriptors),\n\t\taggregateDescriptors: collectAggregateDescriptors(allDescriptors),\n\t\tauthoringContributions,\n\t\tscalarTypes: [...collectScalarTypeConstructors(authoringContributions.type).keys()],\n\t\tcontrolMutationDefaults: assembleControlMutationDefaults(allDescriptors),\n\t\tcapabilities: mergeCapabilityMatrices({}, [\n\t\t\ttarget,\n\t\t\t...adapter ? [adapter] : [],\n\t\t\t...orderedExtensions\n\t\t])\n\t};\n}\n//#endregion\n//#region src/control/order-issues-by-dependencies.ts\nconst PATH_DELIMITER = \" \";\nfunction pathKey(path) {\n\treturn path.join(PATH_DELIMITER);\n}\n/**\n* Whether an issue's op builds its subject up (create or alter) rather than\n* only tearing it down. The differ sets `expected` on every create (`not-found`)\n* and alter (`not-equal`) issue and leaves it absent on a pure drop\n* (`not-expected`). This is the single signal the ordering law reads for edge\n* direction — never `reason`.\n*/\nfunction buildsUp(issue) {\n\treturn issue.expected !== void 0;\n}\n/**\n* The nearest strict-ancestor bucket of `path` — the surviving parent entity a\n* child is contained by. Walks the path's proper prefixes from longest to\n* shortest and returns the first prefix that maps to a bucket; a gap (a prefix\n* with no bucket) is skipped so containment always attaches to the closest real\n* parent.\n*\n* Returns a list because a path prefix can be shared by two siblings of\n* different `nodeKind` (a role and a namespace named alike); linking the child\n* to every candidate over-constrains safely (the extra edge points at a same-\n* direction op and never forms a cycle, since a parent never depends on its\n* child) rather than risk picking the wrong one.\n*/\nfunction nearestAncestors(path, byPath) {\n\tfor (let end = path.length - 1; end >= 1; end -= 1) {\n\t\tconst bucket = byPath.get(pathKey(path.slice(0, end)));\n\t\tif (bucket !== void 0) return bucket;\n\t}\n\treturn [];\n}\n/**\n* Orders schema-diff issues so that every dependency's op precedes its\n* dependent on the way up and follows it on the way down, breaking ties\n* deterministically by path.\n*\n* Edges come from two sources:\n* - **`dependsOn` cross-links** — the resolved issue-to-issue paths the differ\n* mirrors onto each issue (a node's declared structural prerequisites). A\n* path that resolves to no issue in this list is skipped (the dependency is\n* satisfied by reality); a path shared by two same-id/different-kind siblings\n* links to every match, over-constraining safely.\n* - **containment** — every issue depends on its nearest strict-ancestor issue\n* (a child entity on the parent entity that owns it). Subtree coalescing has\n* already removed the descendants of a whole create/drop, so this only links\n* the parent/child pairs that legitimately survive together.\n*\n* The ordering law reads each dependent's presence for direction: an issue that\n* builds up (`expected` present — a create or alter) needs its dependency\n* first; a pure drop needs its dependent removed first, so the edge reverses.\n* The graph is a DAG by construction (dependencies point from dependents to\n* their prerequisites, and prerequisites never point back), so a cycle is a\n* derivation or authoring bug: the topological sort asserts acyclicity and\n* throws, naming the issues it could not place.\n*/\nfunction orderIssuesByDependencies(issues) {\n\tif (issues.length <= 1) return issues;\n\tconst nodes = issues.map((issue) => ({\n\t\tissue,\n\t\tkey: pathKey(issue.path),\n\t\tbuildsUp: buildsUp(issue),\n\t\toutgoing: /* @__PURE__ */ new Set(),\n\t\tinDegree: 0\n\t}));\n\tconst nodesByPath = /* @__PURE__ */ new Map();\n\tfor (const node of nodes) {\n\t\tconst bucket = nodesByPath.get(node.key);\n\t\tif (bucket === void 0) nodesByPath.set(node.key, [node]);\n\t\telse bucket.push(node);\n\t}\n\tconst addEdge = (before, after) => {\n\t\tif (before.outgoing.has(after)) return;\n\t\tbefore.outgoing.add(after);\n\t\tafter.inDegree += 1;\n\t};\n\tconst addDependency = (dependent, dependency) => {\n\t\tif (dependent === dependency) return;\n\t\tif (dependent.buildsUp) addEdge(dependency, dependent);\n\t\telse addEdge(dependent, dependency);\n\t};\n\tfor (const node of nodes) {\n\t\tfor (const targetPath of node.issue.dependsOn ?? []) for (const target of nodesByPath.get(pathKey(targetPath)) ?? []) addDependency(node, target);\n\t\tfor (const ancestor of nearestAncestors(node.issue.path, nodesByPath)) addDependency(node, ancestor);\n\t}\n\tconst ready = nodes.filter((node) => node.inDegree === 0);\n\tconst order = [];\n\twhile (ready.length > 0) {\n\t\tlet best;\n\t\tfor (const candidate of ready) if (best === void 0 || candidate.key < best.key) best = candidate;\n\t\tif (best === void 0) break;\n\t\tready.splice(ready.indexOf(best), 1);\n\t\torder.push(best);\n\t\tfor (const next of best.outgoing) {\n\t\t\tnext.inDegree -= 1;\n\t\t\tif (next.inDegree === 0) ready.push(next);\n\t\t}\n\t}\n\tif (order.length !== nodes.length) {\n\t\tconst placed = new Set(order);\n\t\tthrow new InternalError(`orderIssuesByDependencies: dependency cycle among schema-diff issues (unresolved: ${nodes.filter((node) => !placed.has(node)).map((node) => node.issue.path.join(\"/\")).join(\", \")})`);\n\t}\n\treturn order.map((node) => node.issue);\n}\n//#endregion\n//#region src/control/schema-diff.ts\n/**\n* The outcome an issue represents, discriminated by presence rather than any\n* stored field — the single source of truth every consumer reads. An issue\n* always carries at least one side by construction; neither is a malformed\n* issue and throws.\n*/\nfunction issueOutcome(issue) {\n\tconst hasExpected = issue.expected !== void 0;\n\tconst hasActual = issue.actual !== void 0;\n\tif (hasExpected && hasActual) return \"not-equal\";\n\tif (hasExpected) return \"not-found\";\n\tif (hasActual) return \"not-expected\";\n\tthrow new InternalError(`issueOutcome: issue at \"${issue.path.join(\"/\")}\" carries neither an expected nor an actual node`);\n}\n/** Delimiter joining `nodeKind` and `id` into one sibling-map key. Every `nodeKind` is a code-defined literal (kebab-case-style), so a null character can never appear in one. */\nconst SIBLING_KEY_DELIMITER = \"\\0\";\nfunction siblingKey(node) {\n\treturn `${node.nodeKind}${SIBLING_KEY_DELIMITER}${node.id}`;\n}\nfunction insertNode(map, node) {\n\tconst key = siblingKey(node);\n\tif (map.has(key)) throw new InternalError(`diffSchemas: duplicate id among siblings: ${node.nodeKind}/${node.id}`);\n\tmap.set(key, node);\n}\nfunction emitMissingSubtree(node, parentPath) {\n\tconst path = [...parentPath, node.id];\n\treturn [{\n\t\tpath,\n\t\texpected: node\n\t}, ...node.children().flatMap((c) => emitMissingSubtree(c, path))];\n}\nfunction emitExtraSubtree(node, parentPath) {\n\tconst path = [...parentPath, node.id];\n\treturn [{\n\t\tpath,\n\t\tactual: node\n\t}, ...node.children().flatMap((c) => emitExtraSubtree(c, path))];\n}\n/**\n* Diff two schema trees starting from their roots.\n*\n* The differ is **total**: every node-level difference is reported. An unmatched\n* non-leaf node emits its own issue and descends, emitting an issue for every\n* node in the missing/extra subtree. Coalescing a parent change over its\n* children is the planner's responsibility. Ownership filtering (dropping `extra`\n* issues in namespaces a contract doesn't own) is the caller's responsibility.\n*/\nfunction diffSchemas(expected, actual) {\n\treturn mirrorDependsOnOntoIssues(diffPair(expected, actual, []));\n}\nfunction schemaNodeRefKey(ref) {\n\treturn ref.map((step) => step.id).join(SIBLING_KEY_DELIMITER);\n}\nfunction issuePathKey(path) {\n\treturn path.join(SIBLING_KEY_DELIMITER);\n}\nfunction terminalNodeKind(issue) {\n\treturn (issue.expected ?? issue.actual)?.nodeKind;\n}\n/**\n* Copies each issue's node's `dependsOn` refs onto the issue itself, as\n* issue-to-issue path references. A ref is kept only when some emitted issue\n* sits at that exact path AND that issue's node `nodeKind` matches the ref's\n* last step — otherwise the ref is dropped (its target either didn't\n* change, or was never part of either tree; either way the dependency is\n* satisfied by reality, not by an operation this diff will produce).\n*\n* The path index is a multimap: two siblings may share an `id` under\n* different `nodeKind`s (a role and a namespace named alike), so an id-path\n* alone is ambiguous. The ref's terminal `nodeKind` disambiguates — the ref\n* resolves only against a same-path issue whose own node carries that kind.\n*/\nfunction mirrorDependsOnOntoIssues(issues) {\n\tconst issuesByPath = /* @__PURE__ */ new Map();\n\tfor (const issue of issues) {\n\t\tconst key = issuePathKey(issue.path);\n\t\tconst bucket = issuesByPath.get(key);\n\t\tif (bucket === void 0) issuesByPath.set(key, [issue]);\n\t\telse bucket.push(issue);\n\t}\n\treturn issues.map((issue) => {\n\t\tconst refs = (issue.expected ?? issue.actual)?.dependsOn;\n\t\tif (refs === void 0 || refs.length === 0) return issue;\n\t\tconst dependsOn = refs.flatMap((ref) => {\n\t\t\tconst lastStep = ref[ref.length - 1];\n\t\t\tif (lastStep === void 0) return [];\n\t\t\tif (!(issuesByPath.get(schemaNodeRefKey(ref)) ?? []).some((c) => terminalNodeKind(c) === lastStep.nodeKind)) return [];\n\t\t\treturn [ref.map((step) => step.id)];\n\t\t});\n\t\tif (dependsOn.length === 0) return issue;\n\t\treturn {\n\t\t\t...issue,\n\t\t\tdependsOn\n\t\t};\n\t});\n}\nfunction diffPair(expected, actual, parentPath) {\n\tconst path = [...parentPath, expected.id];\n\tconst issues = [];\n\tif (!expected.isEqualTo(actual)) issues.push({\n\t\tpath,\n\t\texpected,\n\t\tactual\n\t});\n\tissues.push(...diffChildren(expected.children(), actual.children(), path));\n\treturn issues;\n}\n/**\n* Align one level of nodes by `(nodeKind, id)`; emit issues in input order\n* and recurse.\n*\n* A missing node emits one issue for itself and one for every node in its\n* subtree (total descent). Same for extra nodes. A matched pair recurses via\n* `diffPair`.\n*/\nfunction diffChildren(expected, actual, parentPath) {\n\tconst expectedMap = /* @__PURE__ */ new Map();\n\tfor (const node of expected) insertNode(expectedMap, node);\n\tconst actualMap = /* @__PURE__ */ new Map();\n\tfor (const node of actual) insertNode(actualMap, node);\n\tconst issues = [];\n\tfor (const [key, expectedNode] of expectedMap) {\n\t\tconst actualNode = actualMap.get(key);\n\t\tif (actualNode === void 0) issues.push(...emitMissingSubtree(expectedNode, parentPath));\n\t\telse issues.push(...diffPair(expectedNode, actualNode, parentPath));\n\t}\n\tfor (const [key, actualNode] of actualMap) if (!expectedMap.has(key)) issues.push(...emitExtraSubtree(actualNode, parentPath));\n\treturn issues;\n}\n/**\n* The result of diffing a contract's expected schema against the introspected\n* actual schema: one node-typed issue list. Carries no verdict, verification\n* tree, or counts — those are the verifier's own presentation, built from the\n* same underlying comparison.\n*\n* `TNode` is the concrete schema-IR node the issues carry; it defaults to\n* `DiffableNode`, so this is purely additive — a caller that wants the\n* concrete node opts in (the Postgres planner uses the concrete node type),\n* everyone else keeps the default unchanged.\n*/\nvar SchemaDiff = class SchemaDiff {\n\tissues;\n\tconstructor(issues) {\n\t\tthis.issues = issues;\n\t}\n\t/** Returns a new `SchemaDiff` narrowed to the issues `keep` returns true for. */\n\tfilter(keep) {\n\t\treturn new SchemaDiff(this.issues.filter(keep));\n\t}\n};\n//#endregion\n//#region src/control/verifier-disposition.ts\n/**\n* Grades a target-neutral issue category against a control policy.\n*\n* - `observed` warns on everything.\n* - `tolerated` suppresses only an extra nested element (everything else fails).\n* - `external` suppresses every extra category and value drift (existence and\n* declared-shape divergences still fail).\n* - `managed` (and any other) fails.\n*/\nfunction dispositionForCategory(controlPolicy, category) {\n\tif (controlPolicy === \"observed\") return \"warn\";\n\tif (controlPolicy === \"tolerated\" && category === \"extraNestedElement\") return \"suppress\";\n\tif (controlPolicy === \"external\") {\n\t\tif (category === \"extraNestedElement\" || category === \"extraAuxiliary\" || category === \"extraTopLevelObject\" || category === \"valueDrift\") return \"suppress\";\n\t}\n\treturn \"fail\";\n}\n//#endregion\nexport { APP_SPACE_ID, CONTRACT_SNAPSHOTS_DIRNAME, SchemaDiff, SchemaTreeNode, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_SCHEMA_FAILURE, VERIFY_CODE_TARGET_MISMATCH, assembleAuthoringContributions, assembleControlMutationDefaults, assertUniqueCodecOwner, buildExtensionLoadOrder, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, createControlStack, diffSchemas, dispositionForCategory, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports, hasMigrations, hasOperationPreview, hasPslContractInfer, hasSchemaSubjectClassifier, hasSchemaView, issueOutcome, orderIssuesByDependencies, storageHashHex };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,6BAA6B;AACnC,MAAM,uBAAuB;;AAE7B,SAAS,eAAe,aAAa;CACpC,IAAI,CAAC,qBAAqB,KAAK,WAAW,GAAG,MAAM,IAAI,cAAc,yBAAyB,YAAY,wCAAwC;CAClJ,OAAO;AACR;;AAEA,SAAS,8BAA8B,qBAAqB,aAAa;CACxE,OAAO,GAAG,oBAAoB,GAAG,eAAe,WAAW,EAAE;AAC9D;;AAEA,SAAS,+BAA+B,qBAAqB,aAAa;CACzE,OAAO,GAAG,oBAAoB,GAAG,eAAe,WAAW,EAAE;AAC9D;AAGA,SAAS,cAAc,QAAQ;CAC9B,OAAO,gBAAgB,UAAU,CAAC,CAAC,OAAO;AAC3C;AACA,SAAS,cAAc,UAAU;CAChC,OAAO,kBAAkB,YAAY,OAAO,SAAS,oBAAoB;AAC1E;AACA,SAAS,oBAAoB,UAAU;CACtC,OAAO,sBAAsB,YAAY,OAAO,SAAS,wBAAwB;AAClF;AACA,SAAS,oBAAoB,UAAU;CACtC,OAAO,wBAAwB,YAAY,OAAO,SAAS,0BAA0B;AACtF;AACA,SAAS,2BAA2B,UAAU;CAC7C,OAAO,gCAAgC,YAAY,OAAO,SAAS,kCAAkC,cAAc,wBAAwB,YAAY,OAAO,SAAS,0BAA0B;AAClM;AAGA,MAAM,6BAA6B;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C;OACjF,OAAO,KAAK,GAAG,SAAS,cAAc,YAAY,UAAU,CAAC;CACnE;CACA,KAAK,MAAM,CAAC,KAAK,eAAe,WAAW,IAAI,CAAC,YAAY,IAAI,GAAG,GAAG,OAAO,KAAK,GAAG,iBAAiB,YAAY,UAAU,CAAC;CAC7H,OAAO;AACR;;;;;;;;;;;;AAYA,IAAI,aAAa,MAAM,WAAW;CACjC;CACA,YAAY,QAAQ;EACnB,KAAK,SAAS;CACf;;CAEA,OAAO,MAAM;EACZ,OAAO,IAAI,WAAW,KAAK,OAAO,OAAO,IAAI,CAAC;CAC/C;AACD;;;;;;;;;;AAYA,SAAS,uBAAuB,eAAe,UAAU;CACxD,IAAI,kBAAkB,YAAY,OAAO;CACzC,IAAI,kBAAkB,eAAe,aAAa,sBAAsB,OAAO;CAC/E,IAAI,kBAAkB,YACjB;MAAA,aAAa,wBAAwB,aAAa,oBAAoB,aAAa,yBAAyB,aAAa,cAAc,OAAO;CAAA;CAEnJ,OAAO;AACR"}
|
|
1
|
+
{"version":3,"file":"control-DuiafB_U.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/control.mjs"],"sourcesContent":["import { n as runtimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { n as materializeCodec, r as resolveCodecDescriptorOrThrow, t as CONTRACT_CODEC_DESCRIPTOR_MISSING } from \"./resolve-codec-BZF8TZh_.mjs\";\nimport { n as aggregateDescriptorKey, r as isAggregateDescriptor, t as mergeCapabilityMatrices } from \"./capabilities-BCEONw9w.mjs\";\nimport { _ as mergeAuthoringNamespaces, a as collectScalarTypeConstructors, i as collectContributedDescriptorPaths, n as assertResolvableTypeConstructorTemplates, t as assertNoCrossRegistryCollisions } from \"./framework-authoring-CDEvlouU.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/control/contract-snapshot-layout.ts\nconst CONTRACT_SNAPSHOTS_DIRNAME = \"snapshots\";\nconst STORAGE_HASH_PATTERN = /^[0-9a-f]{64}$/;\n/** Validate a storage hash for use as a directory name. */\nfunction storageHashHex(storageHash) {\n\tif (!STORAGE_HASH_PATTERN.test(storageHash)) throw new InternalError(`Invalid storage hash \"${storageHash}\": expected 64 lowercase hex characters`);\n\treturn storageHash;\n}\n/** Module specifier for the store's `contract.json`, POSIX separators. */\nfunction contractSnapshotJsonSpecifier(snapshotsImportPath, storageHash) {\n\treturn `${snapshotsImportPath}/${storageHashHex(storageHash)}/contract.json`;\n}\n/** Type-only module specifier for the store's `contract.d.ts` (no extension). */\nfunction contractSnapshotTypesSpecifier(snapshotsImportPath, storageHash) {\n\treturn `${snapshotsImportPath}/${storageHashHex(storageHash)}/contract`;\n}\n//#endregion\n//#region src/control/control-capabilities.ts\nfunction hasMigrations(target) {\n\treturn \"migrations\" in target && !!target[\"migrations\"];\n}\nfunction hasSchemaView(instance) {\n\treturn \"toSchemaView\" in instance && typeof instance[\"toSchemaView\"] === \"function\";\n}\nfunction hasPslContractInfer(instance) {\n\treturn \"inferPslContract\" in instance && typeof instance[\"inferPslContract\"] === \"function\";\n}\nfunction hasOperationPreview(instance) {\n\treturn \"toOperationPreview\" in instance && typeof instance[\"toOperationPreview\"] === \"function\";\n}\nfunction hasSchemaSubjectClassifier(instance) {\n\treturn \"classifySubjectGranularity\" in instance && typeof instance[\"classifySubjectGranularity\"] === \"function\" && \"classifyEntityKind\" in instance && typeof instance[\"classifyEntityKind\"] === \"function\";\n}\n//#endregion\n//#region src/control/control-operation-results.ts\nconst VERIFY_CODE_MARKER_MISSING = \"CONTRACT.MARKER_MISSING\";\nconst VERIFY_CODE_HASH_MISMATCH = \"CONTRACT.MARKER_MISMATCH\";\nconst VERIFY_CODE_TARGET_MISMATCH = \"CONTRACT.TARGET_MISMATCH\";\nconst VERIFY_CODE_SCHEMA_FAILURE = \"CONTRACT.SCHEMA_VERIFICATION_FAILED\";\n//#endregion\n//#region src/control/control-schema-view.ts\nvar SchemaTreeNode = class {\n\tkind;\n\tid;\n\tlabel;\n\tmeta;\n\tchildren;\n\tconstructor(options) {\n\t\tthis.kind = options.kind;\n\t\tthis.id = options.id;\n\t\tthis.label = options.label;\n\t\tif (options.meta !== void 0) this.meta = options.meta;\n\t\tif (options.children !== void 0) this.children = options.children;\n\t\tObject.freeze(this);\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visit(this);\n\t}\n};\n//#endregion\n//#region src/control/control-spaces.ts\n/**\n* Canonical control-plane identifiers for contract spaces.\n*\n* A contract space is the disjoint `(contract.json, migration-graph)` unit\n* the per-space planner / runner / verifier (project: extension contract\n* spaces, TML-2397) operates on. The application owns one well-known\n* space — the value below — and each loaded extension that contributes\n* schema owns a uniquely-named space.\n*\n* Lives in `framework-components/control` so every layer that has to\n* reason about space identity (the migration tooling, the SQL runtime's\n* marker reader, target-side statement builders, target-side adapters)\n* can import a single value rather than duplicating the literal. Raw\n* `'app'` string literals in framework / target / runtime / adapter\n* source code are forbidden and policed by\n* `scripts/lint-app-space-id.mjs` (wired into `pnpm lint:deps`).\n*\n* @see specs/framework-mechanism.spec.md § 3 — Layout convention (γ).\n*/\nconst APP_SPACE_ID = \"app\";\n//#endregion\n//#region src/control/control-stack.ts\nfunction addUniqueId(ids, seen, id) {\n\tif (!seen.has(id)) {\n\t\tids.push(id);\n\t\tseen.add(id);\n\t}\n}\nfunction assertUniqueCodecOwner(options) {\n\tconst existingOwner = options.owners.get(options.codecId);\n\tif (existingOwner !== void 0) throw new InternalError(`Duplicate ${options.entityLabel} for codecId \"${options.codecId}\". Descriptor \"${options.descriptorId}\" conflicts with \"${existingOwner}\". Each codecId can only have one ${options.entityOwnershipLabel}.`);\n}\nfunction extractCodecTypeImports(descriptors) {\n\tconst imports = [];\n\tfor (const descriptor of descriptors) {\n\t\tconst codecTypes = descriptor.types?.codecTypes;\n\t\tif (codecTypes?.import) imports.push(codecTypes.import);\n\t\tif (codecTypes?.typeImports) imports.push(...codecTypes.typeImports);\n\t}\n\treturn imports;\n}\nfunction extractQueryOperationTypeImports(descriptors) {\n\tconst imports = [];\n\tfor (const descriptor of descriptors) {\n\t\tconst queryOperationTypes = descriptor.types?.queryOperationTypes;\n\t\tif (queryOperationTypes?.import) imports.push(queryOperationTypes.import);\n\t}\n\treturn imports;\n}\nfunction extractComponentIds(family, target, adapter, extensions) {\n\tconst ids = [];\n\tconst seen = /* @__PURE__ */ new Set();\n\taddUniqueId(ids, seen, family.id);\n\taddUniqueId(ids, seen, target.id);\n\tif (adapter) addUniqueId(ids, seen, adapter.id);\n\tfor (const ext of extensions) addUniqueId(ids, seen, ext.id);\n\treturn ids;\n}\nfunction assembleAuthoringContributions(descriptors) {\n\tconst field = {};\n\tconst type = {};\n\tconst entityTypes = {};\n\tconst pslBlockDescriptors = {};\n\tconst modelAttributes = {};\n\tconst pathOwners = /* @__PURE__ */ new Map();\n\tconst claimContributedPaths = (namespace, descriptorKind, label, descriptorId) => {\n\t\tfor (const path of collectContributedDescriptorPaths(namespace, descriptorKind)) {\n\t\t\tconst key = `${label}:${path}`;\n\t\t\tconst existingOwner = pathOwners.get(key);\n\t\t\tif (existingOwner !== void 0) throw new InternalError(`Duplicate authoring ${label} helper \"${path}\". Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\".`);\n\t\t\tpathOwners.set(key, descriptorId);\n\t\t}\n\t};\n\tlet valueObjectStorageDeclaration;\n\tfor (const descriptor of descriptors) {\n\t\tconst descriptorId = descriptor.id ?? \"<unknown>\";\n\t\tconst declaredValueObjectStorageType = descriptor.authoring?.valueObjectStorageType;\n\t\tif (declaredValueObjectStorageType !== void 0) {\n\t\t\tif (valueObjectStorageDeclaration !== void 0) throw new InternalError(`Duplicate authoring valueObjectStorageType declaration. Descriptor \"${descriptorId}\" conflicts with \"${valueObjectStorageDeclaration.ownerId}\". Exactly one composed component may declare the value-object storage type.`);\n\t\t\tvalueObjectStorageDeclaration = {\n\t\t\t\tname: declaredValueObjectStorageType,\n\t\t\t\townerId: descriptorId\n\t\t\t};\n\t\t}\n\t\tif (descriptor.authoring?.field) {\n\t\t\tclaimContributedPaths(descriptor.authoring.field, \"fieldPreset\", \"field\", descriptorId);\n\t\t\tmergeAuthoringNamespaces(field, descriptor.authoring.field, [], \"fieldPreset\", \"field\");\n\t\t}\n\t\tif (descriptor.authoring?.type) {\n\t\t\tclaimContributedPaths(descriptor.authoring.type, \"typeConstructor\", \"type\", descriptorId);\n\t\t\tassertResolvableTypeConstructorTemplates(descriptor.authoring.type, descriptorId);\n\t\t\tmergeAuthoringNamespaces(type, descriptor.authoring.type, [], \"typeConstructor\", \"type\");\n\t\t}\n\t\tif (descriptor.authoring?.entityTypes) {\n\t\t\tclaimContributedPaths(descriptor.authoring.entityTypes, \"entity\", \"entity\", descriptorId);\n\t\t\tmergeAuthoringNamespaces(entityTypes, descriptor.authoring.entityTypes, [], \"entity\", \"entity\");\n\t\t}\n\t\tif (descriptor.authoring?.pslBlockDescriptors) {\n\t\t\tclaimContributedPaths(descriptor.authoring.pslBlockDescriptors, \"pslBlock\", \"pslBlock\", descriptorId);\n\t\t\tmergeAuthoringNamespaces(pslBlockDescriptors, descriptor.authoring.pslBlockDescriptors, [], \"pslBlock\", \"pslBlock\");\n\t\t}\n\t\tif (descriptor.authoring?.modelAttributes) mergeAuthoringNamespaces(modelAttributes, descriptor.authoring.modelAttributes, [], \"modelAttribute\", \"modelAttribute\");\n\t}\n\tconst fieldNamespace = field;\n\tconst typeNamespace = type;\n\tconst entityTypeNamespace = entityTypes;\n\tconst pslBlockDescriptorNamespace = blindCast(pslBlockDescriptors);\n\tconst modelAttributeNamespace = blindCast(modelAttributes);\n\tassertNoCrossRegistryCollisions(typeNamespace, fieldNamespace, entityTypeNamespace, pslBlockDescriptorNamespace, modelAttributeNamespace);\n\tif (valueObjectStorageDeclaration !== void 0 && !collectScalarTypeConstructors(typeNamespace).has(valueObjectStorageDeclaration.name)) throw new InternalError(`Invalid authoring valueObjectStorageType \"${valueObjectStorageDeclaration.name}\" declared by descriptor \"${valueObjectStorageDeclaration.ownerId}\". The name must be a top-level bare-eligible type constructor in the assembled authoring namespace.`);\n\treturn {\n\t\tfield: fieldNamespace,\n\t\ttype: typeNamespace,\n\t\tentityTypes: entityTypeNamespace,\n\t\tpslBlockDescriptors: pslBlockDescriptorNamespace,\n\t\tmodelAttributes: modelAttributeNamespace,\n\t\t...valueObjectStorageDeclaration !== void 0 ? { valueObjectStorageType: valueObjectStorageDeclaration.name } : {}\n\t};\n}\nfunction assembleControlMutationDefaults(descriptors) {\n\tconst defaultFunctionRegistry = /* @__PURE__ */ new Map();\n\tconst functionOwners = /* @__PURE__ */ new Map();\n\tconst generatorMap = /* @__PURE__ */ new Map();\n\tconst generatorOwners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tconst contributions = descriptor.controlMutationDefaults;\n\t\tif (!contributions) continue;\n\t\tconst descriptorId = descriptor.id ?? \"<unknown>\";\n\t\tfor (const generatorDescriptor of contributions.generatorDescriptors) {\n\t\t\tconst existingOwner = generatorOwners.get(generatorDescriptor.id);\n\t\t\tif (existingOwner !== void 0) throw new InternalError(`Duplicate mutation default generator id \"${generatorDescriptor.id}\". Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\".`);\n\t\t\tgeneratorMap.set(generatorDescriptor.id, generatorDescriptor);\n\t\t\tgeneratorOwners.set(generatorDescriptor.id, descriptorId);\n\t\t}\n\t\tfor (const [functionName, handler] of contributions.defaultFunctionRegistry) {\n\t\t\tconst existingOwner = functionOwners.get(functionName);\n\t\t\tif (existingOwner !== void 0) throw new InternalError(`Duplicate mutation default function \"${functionName}\". Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\".`);\n\t\t\tdefaultFunctionRegistry.set(functionName, handler);\n\t\t\tfunctionOwners.set(functionName, descriptorId);\n\t\t}\n\t}\n\treturn {\n\t\tdefaultFunctionRegistry,\n\t\tgeneratorDescriptors: Array.from(generatorMap.values())\n\t};\n}\n/**\n* Collect every contributed {@link AggregateDescriptor} across the composed components, rejecting malformed shapes and second claims on one `(operation, input)` overload.\n*\n* Both planes read the same contribution slot: emission derives result types from these descriptors, and family runtimes build their resolution registry from them. Rejections are user-facing — an extension author's bad contribution surfaces here first, during `contract emit` — so a malformed shape raises `CONTRACT.AGGREGATE_DESCRIPTOR_INVALID` and a second claim raises `CONTRACT.AGGREGATE_DESCRIPTOR_DUPLICATE`, each naming the contributing component.\n*/\nfunction collectAggregateDescriptors(descriptors) {\n\tconst collected = [];\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tconst descriptorId = descriptor.id ?? \"<unknown>\";\n\t\tfor (const contributed of descriptor.types?.aggregateDescriptors ?? []) {\n\t\t\tif (!isAggregateDescriptor(contributed)) throw runtimeError(\"CONTRACT.AGGREGATE_DESCRIPTOR_INVALID\", `Malformed aggregate descriptor contributed by \"${descriptorId}\". A descriptor declares a non-empty \\`operation\\`, an \\`input\\` match of kind \\`none\\`/\\`any\\`/\\`codec\\`/\\`trait\\`, an \\`output\\` of kind \\`self\\`/\\`codec\\`, and a boolean \\`nullable\\` — plus \\`emptyResultJson\\`, in the result codec's canonical JSON, where \\`nullable\\` is false; a \\`self\\` output needs an input to reuse.`, {\n\t\t\t\tcontributedBy: descriptorId,\n\t\t\t\tdescriptor: contributed\n\t\t\t});\n\t\t\tconst key = aggregateDescriptorKey(contributed);\n\t\t\tconst existingOwner = owners.get(key);\n\t\t\tif (existingOwner !== void 0) throw runtimeError(\"CONTRACT.AGGREGATE_DESCRIPTOR_DUPLICATE\", `Duplicate aggregate descriptor for \"${key}\". Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\". Each operation/input pair can only have one provider.`, {\n\t\t\t\tkey,\n\t\t\t\tcontributedBy: descriptorId,\n\t\t\t\towner: existingOwner\n\t\t\t});\n\t\t\towners.set(key, descriptorId);\n\t\t\tcollected.push(contributed);\n\t\t}\n\t}\n\treturn collected;\n}\n/**\n* Flatten the codec descriptors the composed components contribute.\n*\n* A component may know a codec and still withhold it — an adapter that cannot name a codec's emitted type contributes the rest without it — so the contributed set is not always the set some component's own registry holds. Consumers whose output must agree with what the runtime resolves read this list rather than any one component's registry.\n*/\nfunction collectCodecDescriptors(descriptors) {\n\treturn descriptors.flatMap((descriptor) => descriptor.types?.codecTypes?.codecDescriptors ?? []);\n}\nfunction extractCodecLookup(descriptors) {\n\tconst byId = /* @__PURE__ */ new Map();\n\tconst descriptorsById = /* @__PURE__ */ new Map();\n\tconst targetTypesById = /* @__PURE__ */ new Map();\n\tconst renderersById = /* @__PURE__ */ new Map();\n\tconst inputRenderersById = /* @__PURE__ */ new Map();\n\tconst valueLiteralRenderersById = /* @__PURE__ */ new Map();\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tconst codecTypes = descriptor.types?.codecTypes;\n\t\tconst descriptorId = descriptor.id;\n\t\tfor (const codecDescriptor of codecTypes?.codecDescriptors ?? []) {\n\t\t\tassertUniqueCodecOwner({\n\t\t\t\tcodecId: codecDescriptor.codecId,\n\t\t\t\towners,\n\t\t\t\tdescriptorId,\n\t\t\t\tentityLabel: \"codec descriptor\",\n\t\t\t\tentityOwnershipLabel: \"codec descriptor provider\"\n\t\t\t});\n\t\t\towners.set(codecDescriptor.codecId, descriptorId);\n\t\t\tdescriptorsById.set(codecDescriptor.codecId, codecDescriptor);\n\t\t\tif (Array.isArray(codecDescriptor.targetTypes)) targetTypesById.set(codecDescriptor.codecId, codecDescriptor.targetTypes);\n\t\t\tif (typeof codecDescriptor.renderOutputType === \"function\") renderersById.set(codecDescriptor.codecId, codecDescriptor.renderOutputType);\n\t\t\tif (typeof codecDescriptor.renderInputType === \"function\") inputRenderersById.set(codecDescriptor.codecId, codecDescriptor.renderInputType);\n\t\t\tif (typeof codecDescriptor.renderValueLiteral === \"function\") valueLiteralRenderersById.set(codecDescriptor.codecId, codecDescriptor.renderValueLiteral);\n\t\t\tif (!byId.has(codecDescriptor.codecId)) if (codecDescriptor.isParameterized) try {\n\t\t\t\tconst representative = codecDescriptor.factory({})({ name: `<lookup:${codecDescriptor.codecId}>` });\n\t\t\t\tbyId.set(codecDescriptor.codecId, representative);\n\t\t\t} catch {}\n\t\t\telse {\n\t\t\t\tconst representative = codecDescriptor.factory(void 0)({ name: `<lookup:${codecDescriptor.codecId}>` });\n\t\t\t\tbyId.set(codecDescriptor.codecId, representative);\n\t\t\t}\n\t\t}\n\t}\n\treturn {\n\t\tget: (id) => byId.get(id),\n\t\tforCodecRef(ref) {\n\t\t\treturn materializeCodec(resolveCodecDescriptorOrThrow((id) => descriptorsById.get(id), ref, CONTRACT_CODEC_DESCRIPTOR_MISSING), ref, { name: `<ref:${ref.codecId}>` });\n\t\t},\n\t\tforColumn: () => void 0,\n\t\ttargetTypesFor: (id) => targetTypesById.get(id),\n\t\trenderOutputTypeFor: (id, params) => renderersById.get(id)?.(params),\n\t\trenderInputTypeFor: (id, params) => inputRenderersById.get(id)?.(params),\n\t\trenderValueLiteralFor: (id, value, side) => valueLiteralRenderersById.get(id)?.(value, side),\n\t\tdescriptorFor: (id) => descriptorsById.get(id)\n\t};\n}\nfunction assembleExtensionContracts(extensions) {\n\tconst result = /* @__PURE__ */ new Map();\n\tfor (const ext of extensions) {\n\t\tif (ext.contractSpace === void 0) continue;\n\t\tresult.set(ext.id, ext.contractSpace.contractJson);\n\t}\n\treturn result;\n}\nfunction readDeclaredDependencyIds(descriptor) {\n\tconst packs = descriptor.contractSpace?.contractJson?.extensions;\n\tif (packs === null || typeof packs !== \"object\") return [];\n\treturn Object.keys(packs);\n}\n/**\n* Builds a dependency-respecting load order for the given extension descriptors\n* using Kahn's topological sort algorithm. Dependencies (packs declared in\n* `contractSpace.contractJson.extensions`) are placed before the extensions\n* that depend on them.\n*\n* Throws if the dependency graph contains a cycle, with an error message that\n* names every extension involved in the cycle.\n*\n* Throws if any extension declares a dependency on a pack ID that is not present\n* in the provided list — add the missing pack to the `extensions` list to\n* resolve the error.\n*/\nfunction buildExtensionLoadOrder(extensions) {\n\tif (extensions.length === 0) return [];\n\tconst idSet = new Set(extensions.map((e) => e.id));\n\tconst inDegree = /* @__PURE__ */ new Map();\n\tconst dependents = /* @__PURE__ */ new Map();\n\tfor (const ext of extensions) {\n\t\tif (!inDegree.has(ext.id)) inDegree.set(ext.id, 0);\n\t\tif (!dependents.has(ext.id)) dependents.set(ext.id, []);\n\t}\n\tfor (const ext of extensions) for (const depId of readDeclaredDependencyIds(ext)) {\n\t\tif (!idSet.has(depId)) throw new InternalError(`Extension \"${ext.id}\" declares a dependency on \"${depId}\", but \"${depId}\" is not in the provided extension set. Add the missing space to extensions.`);\n\t\tinDegree.set(ext.id, (inDegree.get(ext.id) ?? 0) + 1);\n\t\tconst list = dependents.get(depId);\n\t\tif (list !== void 0) list.push(ext.id);\n\t}\n\tconst queue = [];\n\tfor (const [id, deg] of inDegree) if (deg === 0) queue.push(id);\n\tqueue.sort();\n\tconst result = [];\n\twhile (queue.length > 0) {\n\t\tconst id = queue.shift();\n\t\tif (id === void 0) break;\n\t\tresult.push(id);\n\t\tconst children = dependents.get(id) ?? [];\n\t\tchildren.sort();\n\t\tfor (const childId of children) {\n\t\t\tconst newDeg = (inDegree.get(childId) ?? 1) - 1;\n\t\t\tinDegree.set(childId, newDeg);\n\t\t\tif (newDeg === 0) queue.push(childId);\n\t\t}\n\t}\n\tif (result.length < extensions.length) throw new InternalError(`Extension dependency cycle detected. Cycle members: ${extensions.map((e) => e.id).filter((id) => !result.includes(id)).sort().map((id) => `\"${id}\"`).join(\", \")}.`);\n\treturn result;\n}\nfunction createControlStack(input) {\n\tconst { family, target, adapter, driver, extensions = [] } = input;\n\tconst orderedIds = buildExtensionLoadOrder(extensions);\n\tconst extensionById = new Map(extensions.map((ext) => [ext.id, ext]));\n\tconst orderedExtensions = orderedIds.map((id) => extensionById.get(id)).filter((ext) => ext !== void 0);\n\tconst allDescriptors = [\n\t\tfamily,\n\t\ttarget,\n\t\t...adapter ? [adapter] : [],\n\t\t...orderedExtensions\n\t];\n\tconst codecLookup = extractCodecLookup(allDescriptors);\n\tconst authoringContributions = assembleAuthoringContributions(allDescriptors);\n\treturn {\n\t\tfamily,\n\t\ttarget,\n\t\tadapter,\n\t\tdriver,\n\t\textensions: orderedExtensions,\n\t\textensionContracts: assembleExtensionContracts(orderedExtensions),\n\t\tcodecTypeImports: extractCodecTypeImports(allDescriptors),\n\t\tqueryOperationTypeImports: extractQueryOperationTypeImports(allDescriptors),\n\t\textensionIds: extractComponentIds(family, target, adapter, orderedExtensions),\n\t\tcodecLookup,\n\t\tcodecDescriptors: collectCodecDescriptors(allDescriptors),\n\t\taggregateDescriptors: collectAggregateDescriptors(allDescriptors),\n\t\tauthoringContributions,\n\t\tscalarTypes: [...collectScalarTypeConstructors(authoringContributions.type).keys()],\n\t\tcontrolMutationDefaults: assembleControlMutationDefaults(allDescriptors),\n\t\tcapabilities: mergeCapabilityMatrices({}, [\n\t\t\ttarget,\n\t\t\t...adapter ? [adapter] : [],\n\t\t\t...orderedExtensions\n\t\t])\n\t};\n}\n//#endregion\n//#region src/control/order-issues-by-dependencies.ts\nconst PATH_DELIMITER = \" \";\nfunction pathKey(path) {\n\treturn path.join(PATH_DELIMITER);\n}\n/**\n* Whether an issue's op builds its subject up (create or alter) rather than\n* only tearing it down. The differ sets `expected` on every create (`not-found`)\n* and alter (`not-equal`) issue and leaves it absent on a pure drop\n* (`not-expected`). This is the single signal the ordering law reads for edge\n* direction — never `reason`.\n*/\nfunction buildsUp(issue) {\n\treturn issue.expected !== void 0;\n}\n/**\n* The nearest strict-ancestor bucket of `path` — the surviving parent entity a\n* child is contained by. Walks the path's proper prefixes from longest to\n* shortest and returns the first prefix that maps to a bucket; a gap (a prefix\n* with no bucket) is skipped so containment always attaches to the closest real\n* parent.\n*\n* Returns a list because a path prefix can be shared by two siblings of\n* different `nodeKind` (a role and a namespace named alike); linking the child\n* to every candidate over-constrains safely (the extra edge points at a same-\n* direction op and never forms a cycle, since a parent never depends on its\n* child) rather than risk picking the wrong one.\n*/\nfunction nearestAncestors(path, byPath) {\n\tfor (let end = path.length - 1; end >= 1; end -= 1) {\n\t\tconst bucket = byPath.get(pathKey(path.slice(0, end)));\n\t\tif (bucket !== void 0) return bucket;\n\t}\n\treturn [];\n}\n/**\n* Orders schema-diff issues so that every dependency's op precedes its\n* dependent on the way up and follows it on the way down, breaking ties\n* deterministically by path.\n*\n* Edges come from two sources:\n* - **`dependsOn` cross-links** — the resolved issue-to-issue paths the differ\n* mirrors onto each issue (a node's declared structural prerequisites). A\n* path that resolves to no issue in this list is skipped (the dependency is\n* satisfied by reality); a path shared by two same-id/different-kind siblings\n* links to every match, over-constraining safely.\n* - **containment** — every issue depends on its nearest strict-ancestor issue\n* (a child entity on the parent entity that owns it). Subtree coalescing has\n* already removed the descendants of a whole create/drop, so this only links\n* the parent/child pairs that legitimately survive together.\n*\n* The ordering law reads each dependent's presence for direction: an issue that\n* builds up (`expected` present — a create or alter) needs its dependency\n* first; a pure drop needs its dependent removed first, so the edge reverses.\n* The graph is a DAG by construction (dependencies point from dependents to\n* their prerequisites, and prerequisites never point back), so a cycle is a\n* derivation or authoring bug: the topological sort asserts acyclicity and\n* throws, naming the issues it could not place.\n*/\nfunction orderIssuesByDependencies(issues) {\n\tif (issues.length <= 1) return issues;\n\tconst nodes = issues.map((issue) => ({\n\t\tissue,\n\t\tkey: pathKey(issue.path),\n\t\tbuildsUp: buildsUp(issue),\n\t\toutgoing: /* @__PURE__ */ new Set(),\n\t\tinDegree: 0\n\t}));\n\tconst nodesByPath = /* @__PURE__ */ new Map();\n\tfor (const node of nodes) {\n\t\tconst bucket = nodesByPath.get(node.key);\n\t\tif (bucket === void 0) nodesByPath.set(node.key, [node]);\n\t\telse bucket.push(node);\n\t}\n\tconst addEdge = (before, after) => {\n\t\tif (before.outgoing.has(after)) return;\n\t\tbefore.outgoing.add(after);\n\t\tafter.inDegree += 1;\n\t};\n\tconst addDependency = (dependent, dependency) => {\n\t\tif (dependent === dependency) return;\n\t\tif (dependent.buildsUp) addEdge(dependency, dependent);\n\t\telse addEdge(dependent, dependency);\n\t};\n\tfor (const node of nodes) {\n\t\tfor (const targetPath of node.issue.dependsOn ?? []) for (const target of nodesByPath.get(pathKey(targetPath)) ?? []) addDependency(node, target);\n\t\tfor (const ancestor of nearestAncestors(node.issue.path, nodesByPath)) addDependency(node, ancestor);\n\t}\n\tconst ready = nodes.filter((node) => node.inDegree === 0);\n\tconst order = [];\n\twhile (ready.length > 0) {\n\t\tlet best;\n\t\tfor (const candidate of ready) if (best === void 0 || candidate.key < best.key) best = candidate;\n\t\tif (best === void 0) break;\n\t\tready.splice(ready.indexOf(best), 1);\n\t\torder.push(best);\n\t\tfor (const next of best.outgoing) {\n\t\t\tnext.inDegree -= 1;\n\t\t\tif (next.inDegree === 0) ready.push(next);\n\t\t}\n\t}\n\tif (order.length !== nodes.length) {\n\t\tconst placed = new Set(order);\n\t\tthrow new InternalError(`orderIssuesByDependencies: dependency cycle among schema-diff issues (unresolved: ${nodes.filter((node) => !placed.has(node)).map((node) => node.issue.path.join(\"/\")).join(\", \")})`);\n\t}\n\treturn order.map((node) => node.issue);\n}\n//#endregion\n//#region src/control/schema-diff.ts\n/**\n* The outcome an issue represents, discriminated by presence rather than any\n* stored field — the single source of truth every consumer reads. An issue\n* always carries at least one side by construction; neither is a malformed\n* issue and throws.\n*/\nfunction issueOutcome(issue) {\n\tconst hasExpected = issue.expected !== void 0;\n\tconst hasActual = issue.actual !== void 0;\n\tif (hasExpected && hasActual) return \"not-equal\";\n\tif (hasExpected) return \"not-found\";\n\tif (hasActual) return \"not-expected\";\n\tthrow new InternalError(`issueOutcome: issue at \"${issue.path.join(\"/\")}\" carries neither an expected nor an actual node`);\n}\n/** Delimiter joining `nodeKind` and `id` into one sibling-map key. Every `nodeKind` is a code-defined literal (kebab-case-style), so a null character can never appear in one. */\nconst SIBLING_KEY_DELIMITER = \"\\0\";\nfunction siblingKey(node) {\n\treturn `${node.nodeKind}${SIBLING_KEY_DELIMITER}${node.id}`;\n}\nfunction insertNode(map, node) {\n\tconst key = siblingKey(node);\n\tif (map.has(key)) throw new InternalError(`diffSchemas: duplicate id among siblings: ${node.nodeKind}/${node.id}`);\n\tmap.set(key, node);\n}\nfunction emitMissingSubtree(node, parentPath) {\n\tconst path = [...parentPath, node.id];\n\treturn [{\n\t\tpath,\n\t\texpected: node\n\t}, ...node.children().flatMap((c) => emitMissingSubtree(c, path))];\n}\nfunction emitExtraSubtree(node, parentPath) {\n\tconst path = [...parentPath, node.id];\n\treturn [{\n\t\tpath,\n\t\tactual: node\n\t}, ...node.children().flatMap((c) => emitExtraSubtree(c, path))];\n}\n/**\n* Diff two schema trees starting from their roots.\n*\n* The differ is **total**: every node-level difference is reported. An unmatched\n* non-leaf node emits its own issue and descends, emitting an issue for every\n* node in the missing/extra subtree. Coalescing a parent change over its\n* children is the planner's responsibility. Ownership filtering (dropping `extra`\n* issues in namespaces a contract doesn't own) is the caller's responsibility.\n*/\nfunction diffSchemas(expected, actual) {\n\treturn mirrorDependsOnOntoIssues(diffPair(expected, actual, []));\n}\nfunction schemaNodeRefKey(ref) {\n\treturn ref.map((step) => step.id).join(SIBLING_KEY_DELIMITER);\n}\nfunction issuePathKey(path) {\n\treturn path.join(SIBLING_KEY_DELIMITER);\n}\nfunction terminalNodeKind(issue) {\n\treturn (issue.expected ?? issue.actual)?.nodeKind;\n}\n/**\n* Copies each issue's node's `dependsOn` refs onto the issue itself, as\n* issue-to-issue path references. A ref is kept only when some emitted issue\n* sits at that exact path AND that issue's node `nodeKind` matches the ref's\n* last step — otherwise the ref is dropped (its target either didn't\n* change, or was never part of either tree; either way the dependency is\n* satisfied by reality, not by an operation this diff will produce).\n*\n* The path index is a multimap: two siblings may share an `id` under\n* different `nodeKind`s (a role and a namespace named alike), so an id-path\n* alone is ambiguous. The ref's terminal `nodeKind` disambiguates — the ref\n* resolves only against a same-path issue whose own node carries that kind.\n*/\nfunction mirrorDependsOnOntoIssues(issues) {\n\tconst issuesByPath = /* @__PURE__ */ new Map();\n\tfor (const issue of issues) {\n\t\tconst key = issuePathKey(issue.path);\n\t\tconst bucket = issuesByPath.get(key);\n\t\tif (bucket === void 0) issuesByPath.set(key, [issue]);\n\t\telse bucket.push(issue);\n\t}\n\treturn issues.map((issue) => {\n\t\tconst refs = (issue.expected ?? issue.actual)?.dependsOn;\n\t\tif (refs === void 0 || refs.length === 0) return issue;\n\t\tconst dependsOn = refs.flatMap((ref) => {\n\t\t\tconst lastStep = ref[ref.length - 1];\n\t\t\tif (lastStep === void 0) return [];\n\t\t\tif (!(issuesByPath.get(schemaNodeRefKey(ref)) ?? []).some((c) => terminalNodeKind(c) === lastStep.nodeKind)) return [];\n\t\t\treturn [ref.map((step) => step.id)];\n\t\t});\n\t\tif (dependsOn.length === 0) return issue;\n\t\treturn {\n\t\t\t...issue,\n\t\t\tdependsOn\n\t\t};\n\t});\n}\nfunction diffPair(expected, actual, parentPath) {\n\tconst path = [...parentPath, expected.id];\n\tconst issues = [];\n\tif (!expected.isEqualTo(actual)) issues.push({\n\t\tpath,\n\t\texpected,\n\t\tactual\n\t});\n\tissues.push(...diffChildren(expected.children(), actual.children(), path));\n\treturn issues;\n}\n/**\n* Align one level of nodes by `(nodeKind, id)`; emit issues in input order\n* and recurse.\n*\n* A missing node emits one issue for itself and one for every node in its\n* subtree (total descent). Same for extra nodes. A matched pair recurses via\n* `diffPair`.\n*/\nfunction diffChildren(expected, actual, parentPath) {\n\tconst expectedMap = /* @__PURE__ */ new Map();\n\tfor (const node of expected) insertNode(expectedMap, node);\n\tconst actualMap = /* @__PURE__ */ new Map();\n\tfor (const node of actual) insertNode(actualMap, node);\n\tconst issues = [];\n\tfor (const [key, expectedNode] of expectedMap) {\n\t\tconst actualNode = actualMap.get(key);\n\t\tif (actualNode === void 0) issues.push(...emitMissingSubtree(expectedNode, parentPath));\n\t\telse issues.push(...diffPair(expectedNode, actualNode, parentPath));\n\t}\n\tfor (const [key, actualNode] of actualMap) if (!expectedMap.has(key)) issues.push(...emitExtraSubtree(actualNode, parentPath));\n\treturn issues;\n}\n/**\n* The result of diffing a contract's expected schema against the introspected\n* actual schema: one node-typed issue list. Carries no verdict, verification\n* tree, or counts — those are the verifier's own presentation, built from the\n* same underlying comparison.\n*\n* `TNode` is the concrete schema-IR node the issues carry; it defaults to\n* `DiffableNode`, so this is purely additive — a caller that wants the\n* concrete node opts in (the Postgres planner uses the concrete node type),\n* everyone else keeps the default unchanged.\n*/\nvar SchemaDiff = class SchemaDiff {\n\tissues;\n\tconstructor(issues) {\n\t\tthis.issues = issues;\n\t}\n\t/** Returns a new `SchemaDiff` narrowed to the issues `keep` returns true for. */\n\tfilter(keep) {\n\t\treturn new SchemaDiff(this.issues.filter(keep));\n\t}\n};\n//#endregion\n//#region src/control/verifier-disposition.ts\n/**\n* Grades a target-neutral issue category against a control policy.\n*\n* - `observed` warns on everything.\n* - `tolerated` suppresses only an extra nested element (everything else fails).\n* - `external` suppresses every extra category and value drift (existence and\n* declared-shape divergences still fail).\n* - `managed` (and any other) fails.\n*/\nfunction dispositionForCategory(controlPolicy, category) {\n\tif (controlPolicy === \"observed\") return \"warn\";\n\tif (controlPolicy === \"tolerated\" && category === \"extraNestedElement\") return \"suppress\";\n\tif (controlPolicy === \"external\") {\n\t\tif (category === \"extraNestedElement\" || category === \"extraAuxiliary\" || category === \"extraTopLevelObject\" || category === \"valueDrift\") return \"suppress\";\n\t}\n\treturn \"fail\";\n}\n//#endregion\nexport { APP_SPACE_ID, CONTRACT_SNAPSHOTS_DIRNAME, SchemaDiff, SchemaTreeNode, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_SCHEMA_FAILURE, VERIFY_CODE_TARGET_MISMATCH, assembleAuthoringContributions, assembleControlMutationDefaults, assertUniqueCodecOwner, buildExtensionLoadOrder, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, createControlStack, diffSchemas, dispositionForCategory, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports, hasMigrations, hasOperationPreview, hasPslContractInfer, hasSchemaSubjectClassifier, hasSchemaView, issueOutcome, orderIssuesByDependencies, storageHashHex };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,6BAA6B;AACnC,MAAM,uBAAuB;;AAE7B,SAAS,eAAe,aAAa;CACpC,IAAI,CAAC,qBAAqB,KAAK,WAAW,GAAG,MAAM,IAAI,cAAc,yBAAyB,YAAY,wCAAwC;CAClJ,OAAO;AACR;;AAEA,SAAS,8BAA8B,qBAAqB,aAAa;CACxE,OAAO,GAAG,oBAAoB,GAAG,eAAe,WAAW,EAAE;AAC9D;;AAEA,SAAS,+BAA+B,qBAAqB,aAAa;CACzE,OAAO,GAAG,oBAAoB,GAAG,eAAe,WAAW,EAAE;AAC9D;AAGA,SAAS,cAAc,QAAQ;CAC9B,OAAO,gBAAgB,UAAU,CAAC,CAAC,OAAO;AAC3C;AACA,SAAS,cAAc,UAAU;CAChC,OAAO,kBAAkB,YAAY,OAAO,SAAS,oBAAoB;AAC1E;AACA,SAAS,oBAAoB,UAAU;CACtC,OAAO,sBAAsB,YAAY,OAAO,SAAS,wBAAwB;AAClF;AACA,SAAS,oBAAoB,UAAU;CACtC,OAAO,wBAAwB,YAAY,OAAO,SAAS,0BAA0B;AACtF;AACA,SAAS,2BAA2B,UAAU;CAC7C,OAAO,gCAAgC,YAAY,OAAO,SAAS,kCAAkC,cAAc,wBAAwB,YAAY,OAAO,SAAS,0BAA0B;AAClM;AAGA,MAAM,6BAA6B;AACnC,MAAM,4BAA4B;AAClC,MAAM,8BAA8B;AACpC,MAAM,6BAA6B;AAGnC,IAAI,iBAAiB,MAAM;CAC1B;CACA;CACA;CACA;CACA;CACA,YAAY,SAAS;EACpB,KAAK,OAAO,QAAQ;EACpB,KAAK,KAAK,QAAQ;EAClB,KAAK,QAAQ,QAAQ;EACrB,IAAI,QAAQ,SAAS,KAAK,GAAG,KAAK,OAAO,QAAQ;EACjD,IAAI,QAAQ,aAAa,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;;CAEA,OAAO,MAAM;EACZ,OAAO,IAAI,WAAW,KAAK,OAAO,OAAO,IAAI,CAAC;CAC/C;AACD;;;;;;;;;;AAYA,SAAS,uBAAuB,eAAe,UAAU;CACxD,IAAI,kBAAkB,YAAY,OAAO;CACzC,IAAI,kBAAkB,eAAe,aAAa,sBAAsB,OAAO;CAC/E,IAAI,kBAAkB,YACjB;MAAA,aAAa,wBAAwB,aAAa,oBAAoB,aAAa,yBAAyB,aAAa,cAAc,OAAO;CAAA;CAEnJ,OAAO;AACR"}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region ../../../1-framework/1-core/errors/dist/control-
|
|
1
|
+
import { i as StructuredError, r as NextAction } from "./structured-error-BBdCpY44.mjs";
|
|
2
|
+
//#region ../../../1-framework/1-core/errors/dist/control-ql9N9u4f.d.mts
|
|
3
3
|
//#region src/control.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* CLI error envelope for output formatting.
|
|
6
6
|
* This is the serialized form of a CliStructuredError.
|
|
7
|
+
*
|
|
8
|
+
* `nextActions` is required here even though it is optional on the raised
|
|
9
|
+
* error: a consumer reading a serialized envelope must never have to tell
|
|
10
|
+
* "no remediation" apart from "field absent". See
|
|
11
|
+
* [ADR 239](../../../../../docs/architecture%20docs/adrs/ADR%20239%20-%20Errors%20are%20structural%20envelopes%20with%20dotted%20namespace%20codes.md#which-surface-guarantees-nextactions).
|
|
12
|
+
*
|
|
13
|
+
* A `command` inside `nextActions` still carries the `{bin}` placeholder here;
|
|
14
|
+
* the surface that renders the envelope substitutes the running binary's name.
|
|
7
15
|
*/
|
|
8
16
|
interface CliErrorEnvelope {
|
|
9
17
|
readonly ok: false;
|
|
@@ -12,6 +20,7 @@ interface CliErrorEnvelope {
|
|
|
12
20
|
readonly summary: string;
|
|
13
21
|
readonly why?: string;
|
|
14
22
|
readonly fix?: string;
|
|
23
|
+
readonly nextActions: readonly NextAction[];
|
|
15
24
|
readonly where?: {
|
|
16
25
|
readonly path?: string;
|
|
17
26
|
readonly line?: number;
|
|
@@ -43,6 +52,7 @@ declare class CliStructuredError extends Error implements StructuredError {
|
|
|
43
52
|
readonly severity: 'error' | 'warn' | 'info';
|
|
44
53
|
readonly why?: string;
|
|
45
54
|
readonly fix?: string;
|
|
55
|
+
readonly nextActions?: readonly NextAction[];
|
|
46
56
|
readonly where?: {
|
|
47
57
|
readonly path?: string;
|
|
48
58
|
readonly line?: number;
|
|
@@ -53,6 +63,7 @@ declare class CliStructuredError extends Error implements StructuredError {
|
|
|
53
63
|
readonly severity?: 'error' | 'warn' | 'info';
|
|
54
64
|
readonly why?: string;
|
|
55
65
|
readonly fix?: string;
|
|
66
|
+
readonly nextActions?: readonly NextAction[];
|
|
56
67
|
readonly where?: {
|
|
57
68
|
readonly path?: string;
|
|
58
69
|
readonly line?: number;
|
|
@@ -63,6 +74,9 @@ declare class CliStructuredError extends Error implements StructuredError {
|
|
|
63
74
|
});
|
|
64
75
|
/**
|
|
65
76
|
* Converts this error to a CLI error envelope for output formatting.
|
|
77
|
+
*
|
|
78
|
+
* This is the boundary that emits the envelope, so it is where a missing
|
|
79
|
+
* `nextActions` becomes `[]`.
|
|
66
80
|
*/
|
|
67
81
|
toEnvelope(): CliErrorEnvelope;
|
|
68
82
|
/**
|
|
@@ -228,4 +242,4 @@ declare function errorUnexpected(message: string, options?: {
|
|
|
228
242
|
}): CliStructuredError;
|
|
229
243
|
//#endregion
|
|
230
244
|
export { errorTargetMigrationNotSupported as C, errorQueryRunnerFactoryRequired as S, errorJsonFormatNotSupported as _, errorConfigFileNotFound as a, errorMigrationPlanningFailed as b, errorContractConfigMissing as c, errorDatabaseConnectionRequired as d, errorDriverRequired as f, errorInvalidOutputFormat as g, errorFileNotFound as h, errorConfigEvaluationFailed as i, errorContractMissingExtensions as l, errorFamilyReadMarkerSqlRequired as m, CliErrorEnvelope as n, errorConfigValidation as o, errorEnumCodecNotInPackStack as p, CliStructuredError as r, errorConfigVersionMarkerMissing as s, CliErrorConflict as t, errorContractValidationFailed as u, errorMigrationCliInvalidConfigArg as v, errorUnexpected as w, errorOutputFormatMutex as x, errorMigrationCliUnknownFlag as y };
|
|
231
|
-
//# sourceMappingURL=control-
|
|
245
|
+
//# sourceMappingURL=control-ql9N9u4f-Dz4QqSR1.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-ql9N9u4f-Dz4QqSR1.d.mts","names":[],"sources":["../../../../1-framework/1-core/errors/dist/control-ql9N9u4f.d.mts"],"mappings":";;;;;;;;;;;;;;;UAcU;WACC;WACA;WACA;WACA;WACA;WACA;WACA,sBAAsB;WACtB;aACE;aACA;;WAEF,OAAO;WACP;;;;;UAKD;WACC;WACA;WACA;;;;;;;;;;;;;cAaG,2BAA2B,iBAAiB;WAC/C;WACA;WACA;WACA;WACA,uBAAuB;WACvB;aACE;aACA;;WAEF,OAAO;WACP;EACT,YAAY,6BAA6B,iBAAiB;aAC/C;aACA;aACA;aACA,uBAAuB;aACvB;eACE;eACA;;aAEF,OAAO;aACP;aACA;;;;;;;;EAQX,cAAc;;;;;SAKP,GAAG,iBAAiB,SAAS;;;;;iBAKrB,wBAAwB,qBAAqB;WACnD;IACP;;;;iBAIa,4BAA4B,gCAAgC;WAClE;WACA;IACP;;;;;;iBAMa,gCAAgC,sBAAsB;;;;iBAItD,2BAA2B;WACjC;IACP;;;;iBAIa,8BAA8B,gBAAgB;WACpD;aACE;aACA;;WAEF;IACP;;;;iBAIa,kBAAkB,kBAAkB;WAC1C;WACA;WACA;WACA;IACP;;;;iBAIa,gCAAgC;WACtC;WACA;WACA;WACA;IACP;;;;iBAIa,gCAAgC;WACtC;IACP;;;;iBAIa,iCAAiC;WACvC;IACP;;;;iBAIa,4BAA4B;WAClC;WACA;WACA;IACP;;;;iBAIa,oBAAoB;WAC1B;IACP;;;;iBAIa,+BAA+B;WACrC;WACA;IACP;;;;iBAIa,6BAA6B;WACnC,oBAAoB;WACpB;IACP;;;;iBAIa,iCAAiC;WACvC;IACP;;;;;;;;iBAQa,kCAAkC;WACxC;IACP;;;;;;;;;;iBAUa,6BAA6B;WACnC;WACA;IACP;;;;iBAIa,yBAAyB,gBAAgB;;;;;iBAKzC,0BAA0B;;;;iBAI1B,sBAAsB,eAAe;WAC3C;WACA;IACP;;;;;;;iBAOa,6BAA6B;WACnC;IACP;;;;iBAIa,gBAAgB,iBAAiB;WACvC;WACA;WACA;IACP"}
|
package/dist/{default-namespace-D4vCwkXg-BaiW8LNK.mjs → default-namespace-D4vCwkXg-yt1Ch4tq.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as structuredError } from "./structured-error-
|
|
1
|
+
import { a as structuredError } from "./structured-error-xG_PRmbb.mjs";
|
|
2
2
|
//#region ../../../1-framework/0-foundation/contract/dist/default-namespace-D4vCwkXg.mjs
|
|
3
3
|
function contractError(code, message, options) {
|
|
4
4
|
return structuredError(code, message, options);
|
|
@@ -36,4 +36,4 @@ function soleDomainNamespaceId(domain) {
|
|
|
36
36
|
//#endregion
|
|
37
37
|
export { contractError as n, soleDomainNamespaceId as r, UNBOUND_DOMAIN_NAMESPACE_ID as t };
|
|
38
38
|
|
|
39
|
-
//# sourceMappingURL=default-namespace-D4vCwkXg-
|
|
39
|
+
//# sourceMappingURL=default-namespace-D4vCwkXg-yt1Ch4tq.mjs.map
|