@skmtc/core 0.16.2 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/esm/context/GenerateContext.d.ts +3 -3
  2. package/esm/context/GenerateContext.d.ts.map +1 -1
  3. package/esm/context/GenerateContext.js +45 -32
  4. package/esm/context/ParseContext.d.ts +16 -0
  5. package/esm/context/ParseContext.d.ts.map +1 -1
  6. package/esm/context/ParseContext.js +26 -0
  7. package/esm/context/ParseIssue.d.ts +24 -4
  8. package/esm/context/ParseIssue.d.ts.map +1 -1
  9. package/esm/context/ParseIssue.js +12 -4
  10. package/esm/context/parseTypes.d.ts +23 -1
  11. package/esm/context/parseTypes.d.ts.map +1 -1
  12. package/esm/dsl/model/ModelDriver.d.ts.map +1 -1
  13. package/esm/dsl/model/ModelDriver.js +29 -0
  14. package/esm/dsl/model/toModelEntry.d.ts +9 -3
  15. package/esm/dsl/model/toModelEntry.d.ts.map +1 -1
  16. package/esm/dsl/model/toModelEntry.js +29 -1
  17. package/esm/dsl/model/toModelProjectionBase.d.ts +16 -3
  18. package/esm/dsl/model/toModelProjectionBase.d.ts.map +1 -1
  19. package/esm/dsl/model/toModelProjectionBase.js +3 -3
  20. package/esm/dsl/model/types.d.ts +46 -0
  21. package/esm/dsl/model/types.d.ts.map +1 -1
  22. package/esm/dsl/operation/gql/types.d.ts +6 -1
  23. package/esm/dsl/operation/gql/types.d.ts.map +1 -1
  24. package/esm/dsl/operation/oas/types.d.ts +6 -1
  25. package/esm/dsl/operation/oas/types.d.ts.map +1 -1
  26. package/esm/enrichments/validateConfig.d.ts +60 -0
  27. package/esm/enrichments/validateConfig.d.ts.map +1 -0
  28. package/esm/enrichments/validateConfig.js +176 -0
  29. package/esm/mod.d.ts +1 -0
  30. package/esm/mod.d.ts.map +1 -1
  31. package/esm/mod.js +1 -0
  32. package/esm/oas/operation/Operation.d.ts.map +1 -1
  33. package/esm/oas/operation/Operation.js +2 -11
  34. package/esm/oas/response/toPrimaryResponseCode.d.ts +19 -0
  35. package/esm/oas/response/toPrimaryResponseCode.d.ts.map +1 -0
  36. package/esm/oas/response/toPrimaryResponseCode.js +33 -0
  37. package/esm/oas/webhook/Webhook.d.ts.map +1 -1
  38. package/esm/oas/webhook/Webhook.js +2 -11
  39. package/esm/parse/v3-0/_merge-all-of/decompose-union.d.ts.map +1 -1
  40. package/esm/parse/v3-0/_merge-all-of/decompose-union.js +8 -12
  41. package/esm/parse/v3-0/_merge-all-of/merge-union.d.ts.map +1 -1
  42. package/esm/parse/v3-0/_merge-all-of/merge-union.js +0 -8
  43. package/esm/parse/v3-0/integer/toInteger.js +4 -1
  44. package/esm/parse/v3-0/number/toNumber.js +4 -1
  45. package/esm/parse/v3-0/operation/toOperationsV3.d.ts.map +1 -1
  46. package/esm/parse/v3-0/operation/toOperationsV3.js +5 -1
  47. package/esm/parse/v3-0/schema/toSchemasV3.d.ts.map +1 -1
  48. package/esm/parse/v3-0/schema/toSchemasV3.js +35 -1
  49. package/esm/parse/v3-0/string/toString.d.ts.map +1 -1
  50. package/esm/parse/v3-0/string/toString.js +4 -11
  51. package/esm/parse/v3-1/_merge-all-of/decompose-union.d.ts.map +1 -1
  52. package/esm/parse/v3-1/_merge-all-of/decompose-union.js +8 -12
  53. package/esm/parse/v3-1/_merge-all-of/merge-union.d.ts.map +1 -1
  54. package/esm/parse/v3-1/_merge-all-of/merge-union.js +0 -8
  55. package/esm/parse/v3-1/integer/toInteger.js +4 -1
  56. package/esm/parse/v3-1/number/toNumber.js +4 -1
  57. package/esm/parse/v3-1/operation/toOperationsV3.d.ts.map +1 -1
  58. package/esm/parse/v3-1/operation/toOperationsV3.js +5 -1
  59. package/esm/parse/v3-1/schema/toSchemasV3.d.ts.map +1 -1
  60. package/esm/parse/v3-1/schema/toSchemasV3.js +34 -7
  61. package/esm/parse/v3-1/string/toString.d.ts.map +1 -1
  62. package/esm/parse/v3-1/string/toString.js +4 -11
  63. package/esm/types/Manifest.d.ts.map +1 -1
  64. package/esm/types/Manifest.js +14 -0
  65. package/esm/types/Settings.d.ts +16 -3
  66. package/esm/types/Settings.d.ts.map +1 -1
  67. package/esm/types/Settings.js +19 -13
  68. package/package.json +1 -1
  69. package/script/context/GenerateContext.d.ts +3 -3
  70. package/script/context/GenerateContext.d.ts.map +1 -1
  71. package/script/context/GenerateContext.js +45 -32
  72. package/script/context/ParseContext.d.ts +16 -0
  73. package/script/context/ParseContext.d.ts.map +1 -1
  74. package/script/context/ParseContext.js +26 -0
  75. package/script/context/ParseIssue.d.ts +24 -4
  76. package/script/context/ParseIssue.d.ts.map +1 -1
  77. package/script/context/ParseIssue.js +12 -4
  78. package/script/context/parseTypes.d.ts +23 -1
  79. package/script/context/parseTypes.d.ts.map +1 -1
  80. package/script/dsl/model/ModelDriver.d.ts.map +1 -1
  81. package/script/dsl/model/ModelDriver.js +29 -0
  82. package/script/dsl/model/toModelEntry.d.ts +9 -3
  83. package/script/dsl/model/toModelEntry.d.ts.map +1 -1
  84. package/script/dsl/model/toModelEntry.js +65 -1
  85. package/script/dsl/model/toModelProjectionBase.d.ts +16 -3
  86. package/script/dsl/model/toModelProjectionBase.d.ts.map +1 -1
  87. package/script/dsl/model/toModelProjectionBase.js +3 -3
  88. package/script/dsl/model/types.d.ts +46 -0
  89. package/script/dsl/model/types.d.ts.map +1 -1
  90. package/script/dsl/operation/gql/types.d.ts +6 -1
  91. package/script/dsl/operation/gql/types.d.ts.map +1 -1
  92. package/script/dsl/operation/oas/types.d.ts +6 -1
  93. package/script/dsl/operation/oas/types.d.ts.map +1 -1
  94. package/script/enrichments/validateConfig.d.ts +60 -0
  95. package/script/enrichments/validateConfig.d.ts.map +1 -0
  96. package/script/enrichments/validateConfig.js +213 -0
  97. package/script/mod.d.ts +1 -0
  98. package/script/mod.d.ts.map +1 -1
  99. package/script/mod.js +1 -0
  100. package/script/oas/operation/Operation.d.ts.map +1 -1
  101. package/script/oas/operation/Operation.js +2 -11
  102. package/script/oas/response/toPrimaryResponseCode.d.ts +19 -0
  103. package/script/oas/response/toPrimaryResponseCode.d.ts.map +1 -0
  104. package/script/oas/response/toPrimaryResponseCode.js +37 -0
  105. package/script/oas/webhook/Webhook.d.ts.map +1 -1
  106. package/script/oas/webhook/Webhook.js +2 -11
  107. package/script/parse/v3-0/_merge-all-of/decompose-union.d.ts.map +1 -1
  108. package/script/parse/v3-0/_merge-all-of/decompose-union.js +8 -12
  109. package/script/parse/v3-0/_merge-all-of/merge-union.d.ts.map +1 -1
  110. package/script/parse/v3-0/_merge-all-of/merge-union.js +0 -8
  111. package/script/parse/v3-0/integer/toInteger.js +4 -1
  112. package/script/parse/v3-0/number/toNumber.js +4 -1
  113. package/script/parse/v3-0/operation/toOperationsV3.d.ts.map +1 -1
  114. package/script/parse/v3-0/operation/toOperationsV3.js +5 -1
  115. package/script/parse/v3-0/schema/toSchemasV3.d.ts.map +1 -1
  116. package/script/parse/v3-0/schema/toSchemasV3.js +35 -1
  117. package/script/parse/v3-0/string/toString.d.ts.map +1 -1
  118. package/script/parse/v3-0/string/toString.js +3 -10
  119. package/script/parse/v3-1/_merge-all-of/decompose-union.d.ts.map +1 -1
  120. package/script/parse/v3-1/_merge-all-of/decompose-union.js +8 -12
  121. package/script/parse/v3-1/_merge-all-of/merge-union.d.ts.map +1 -1
  122. package/script/parse/v3-1/_merge-all-of/merge-union.js +0 -8
  123. package/script/parse/v3-1/integer/toInteger.js +4 -1
  124. package/script/parse/v3-1/number/toNumber.js +4 -1
  125. package/script/parse/v3-1/operation/toOperationsV3.d.ts.map +1 -1
  126. package/script/parse/v3-1/operation/toOperationsV3.js +5 -1
  127. package/script/parse/v3-1/schema/toSchemasV3.d.ts.map +1 -1
  128. package/script/parse/v3-1/schema/toSchemasV3.js +34 -7
  129. package/script/parse/v3-1/string/toString.d.ts.map +1 -1
  130. package/script/parse/v3-1/string/toString.js +3 -10
  131. package/script/types/Manifest.d.ts.map +1 -1
  132. package/script/types/Manifest.js +14 -0
  133. package/script/types/Settings.d.ts +16 -3
  134. package/script/types/Settings.d.ts.map +1 -1
  135. package/script/types/Settings.js +16 -10
@@ -165,9 +165,9 @@ export declare class GenerateContext implements GenerateContextType {
165
165
  * Evaluate each generator's `isSupported` over the parsed document's subjects
166
166
  * and report the subjects each generator supports — capability only, no
167
167
  * transform and no render. Operation generators report the operations their
168
- * `isSupported` accepts; model generators report every model (the generate
169
- * pipeline applies no model-level `isSupported`). A generator targeting the
170
- * other protocol reports nothing.
168
+ * `isSupported` accepts; model generators report the models theirs accepts
169
+ * (a generator that declares no `isSupported` defaults to every subject). A
170
+ * generator targeting the other protocol reports nothing.
171
171
  */
172
172
  toSupportedSubjects(): SupportedSubjects;
173
173
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"GenerateContext.d.ts","sourceRoot":"","sources":["../../src/context/GenerateContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACtE,OAAO,KAAK,EACV,kBAAkB,EAKnB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,EAEd,kBAAkB,EAClB,yBAAyB,EACzB,4BAA4B,EAC5B,2BAA2B,EAC3B,mBAAmB,EACnB,iBAAiB,EACjB,QAAQ,EACR,mBAAmB,EACnB,gBAAgB,EAEhB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EACV,cAAc,EASf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,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;AAEF,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GAAI,mCAI3B,iBAAiB,KAAG,WAKrB,CAAA"}
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
9
9
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
11
  };
12
- var _GenerateContext_instances, _GenerateContext_files, _GenerateContext_previews, _GenerateContext_mappings, _GenerateContext_captureChannel, _GenerateContext_supports, _GenerateContext_subjectDefaults, _GenerateContext_runOasOperationGenerator, _GenerateContext_runWebhookGenerator, _GenerateContext_runGqlOperationGenerator, _GenerateContext_runModelGenerator, _GenerateContext_addPreview, _GenerateContext_addMapping;
12
+ var _GenerateContext_instances, _GenerateContext_files, _GenerateContext_previews, _GenerateContext_mappings, _GenerateContext_captureChannel, _GenerateContext_schemaRefNames, _GenerateContext_subjectDefaults, _GenerateContext_runOasOperationGenerator, _GenerateContext_runWebhookGenerator, _GenerateContext_runGqlOperationGenerator, _GenerateContext_runModelGenerator, _GenerateContext_addPreview, _GenerateContext_addMapping;
13
13
  import { normalize } from '../deps/jsr.io/@std/path/1.1.4/normalize.js';
14
14
  import { OasOperationDriver } from '../dsl/operation/oas/OasOperationDriver.js';
15
15
  import { WebhookDriver } from '../dsl/webhook/WebhookDriver.js';
@@ -232,9 +232,9 @@ export class GenerateContext {
232
232
  * Evaluate each generator's `isSupported` over the parsed document's subjects
233
233
  * and report the subjects each generator supports — capability only, no
234
234
  * transform and no render. Operation generators report the operations their
235
- * `isSupported` accepts; model generators report every model (the generate
236
- * pipeline applies no model-level `isSupported`). A generator targeting the
237
- * other protocol reports nothing.
235
+ * `isSupported` accepts; model generators report the models theirs accepts
236
+ * (a generator that declares no `isSupported` defaults to every subject). A
237
+ * generator targeting the other protocol reports nothing.
238
238
  */
239
239
  toSupportedSubjects() {
240
240
  const generators = Object.values(this.toGeneratorConfigMap());
@@ -244,7 +244,8 @@ export class GenerateContext {
244
244
  case 'oasOperation': {
245
245
  const operations = this.document.type === 'oas'
246
246
  ? this.document.value.operations
247
- .filter(operation => __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_supports).call(this, () => generatorConfig.isSupported({ operation, context: this, variant: DEFAULT_VARIANT })))
247
+ .filter(operation => typeof generatorConfig.isSupported !== 'function' ||
248
+ generatorConfig.isSupported({ operation, context: this, variant: DEFAULT_VARIANT }))
248
249
  .map(operation => ({ path: operation.path, method: operation.method }))
249
250
  : [];
250
251
  out[generatorConfig.id] = { type: 'oasOperation', operations };
@@ -253,7 +254,8 @@ export class GenerateContext {
253
254
  case 'webhook': {
254
255
  const webhooks = this.document.type === 'oas'
255
256
  ? this.document.value.webhooks
256
- .filter(webhook => __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_supports).call(this, () => generatorConfig.isSupported({ webhook, context: this, variant: DEFAULT_VARIANT })))
257
+ .filter(webhook => typeof generatorConfig.isSupported !== 'function' ||
258
+ generatorConfig.isSupported({ webhook, context: this, variant: DEFAULT_VARIANT }))
257
259
  .map(webhook => ({ name: webhook.name, method: webhook.method }))
258
260
  : [];
259
261
  out[generatorConfig.id] = { type: 'webhook', webhooks };
@@ -262,7 +264,8 @@ export class GenerateContext {
262
264
  case 'gqlOperation': {
263
265
  const operations = this.document.type === 'gql'
264
266
  ? this.document.value.operations
265
- .filter(operation => __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_supports).call(this, () => generatorConfig.isSupported({ operation, context: this, variant: DEFAULT_VARIANT })))
267
+ .filter(operation => typeof generatorConfig.isSupported !== 'function' ||
268
+ generatorConfig.isSupported({ operation, context: this, variant: DEFAULT_VARIANT }))
266
269
  .map(operation => ({
267
270
  rootKind: operation.rootKind,
268
271
  fieldName: operation.fieldName
@@ -272,10 +275,9 @@ export class GenerateContext {
272
275
  break;
273
276
  }
274
277
  case 'model': {
275
- const refNames = this.document.type === 'oas'
276
- ? (this.document.value.components?.toSchemasRefNames() ?? [])
277
- : this.document.value.registry.toSchemasRefNames();
278
- out[generatorConfig.id] = { type: 'model', models: [...refNames] };
278
+ const models = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_schemaRefNames).call(this).filter(refName => typeof generatorConfig.isSupported !== 'function' ||
279
+ generatorConfig.isSupported({ refName, context: this, variant: DEFAULT_VARIANT }));
280
+ out[generatorConfig.id] = { type: 'model', models };
279
281
  break;
280
282
  }
281
283
  default: {
@@ -311,7 +313,8 @@ export class GenerateContext {
311
313
  break;
312
314
  const operations = {};
313
315
  this.document.value.operations.forEach(operation => {
314
- if (!__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_supports).call(this, () => generatorConfig.isSupported({ operation, context: this, variant: DEFAULT_VARIANT }))) {
316
+ if (typeof generatorConfig.isSupported === 'function' &&
317
+ !generatorConfig.isSupported({ operation, context: this, variant: DEFAULT_VARIANT })) {
315
318
  return;
316
319
  }
317
320
  const leaf = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_subjectDefaults).call(this, () => toDefaults({ operation, context: this, variant: DEFAULT_VARIANT }));
@@ -331,7 +334,8 @@ export class GenerateContext {
331
334
  break;
332
335
  const webhooks = {};
333
336
  this.document.value.webhooks.forEach(webhook => {
334
- if (!__classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_supports).call(this, () => generatorConfig.isSupported({ webhook, context: this, variant: DEFAULT_VARIANT }))) {
337
+ if (typeof generatorConfig.isSupported === 'function' &&
338
+ !generatorConfig.isSupported({ webhook, context: this, variant: DEFAULT_VARIANT })) {
335
339
  return;
336
340
  }
337
341
  const leaf = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_subjectDefaults).call(this, () => toDefaults({ webhook, context: this, variant: DEFAULT_VARIANT }));
@@ -349,14 +353,16 @@ export class GenerateContext {
349
353
  const toDefaults = generatorConfig.toEnrichmentDefaults;
350
354
  if (!toDefaults)
351
355
  break;
352
- // Model entries carry no `isSupported` — the generate pipeline visits
353
- // every refName and filters inside the callback. Mirror that here: the
354
- // hook itself returns `undefined` for schemas it doesn't seed.
355
- const refNames = this.document.type === 'oas'
356
- ? (this.document.value.components?.toSchemasRefNames() ?? [])
357
- : this.document.value.registry.toSchemasRefNames();
356
+ // Seed only the models the generator supports — mirrors the
357
+ // operation arm. A generator that declares no `isSupported`
358
+ // defaults to every model; the hook itself still returns
359
+ // `undefined` for schemas it doesn't seed.
358
360
  const models = {};
359
- for (const refName of refNames) {
361
+ for (const refName of __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_schemaRefNames).call(this)) {
362
+ if (typeof generatorConfig.isSupported === 'function' &&
363
+ !generatorConfig.isSupported({ refName, context: this, variant: DEFAULT_VARIANT })) {
364
+ continue;
365
+ }
360
366
  const leaf = __classPrivateFieldGet(this, _GenerateContext_instances, "m", _GenerateContext_subjectDefaults).call(this, () => toDefaults({ refName, context: this, variant: DEFAULT_VARIANT }));
361
367
  if (leaf === undefined)
362
368
  continue;
@@ -727,13 +733,16 @@ export class GenerateContext {
727
733
  return this.getFile(exportPath)?.definitions.get(name);
728
734
  }
729
735
  }
730
- _GenerateContext_files = new WeakMap(), _GenerateContext_previews = new WeakMap(), _GenerateContext_mappings = new WeakMap(), _GenerateContext_captureChannel = new WeakMap(), _GenerateContext_instances = new WeakSet(), _GenerateContext_supports = function _GenerateContext_supports(probe) {
731
- try {
732
- return probe();
733
- }
734
- catch (error) {
735
- this.logger.error(error);
736
- return false;
736
+ _GenerateContext_files = new WeakMap(), _GenerateContext_previews = new WeakMap(), _GenerateContext_mappings = new WeakMap(), _GenerateContext_captureChannel = new WeakMap(), _GenerateContext_instances = new WeakSet(), _GenerateContext_schemaRefNames = function _GenerateContext_schemaRefNames() {
737
+ switch (this.document.type) {
738
+ case 'oas':
739
+ return [...(this.document.value.components?.toSchemasRefNames() ?? [])];
740
+ case 'gql':
741
+ return [...this.document.value.registry.toSchemasRefNames()];
742
+ default: {
743
+ const _exhaustive = this.document;
744
+ throw new Error(`Unhandled document type: ${JSON.stringify(_exhaustive)}`);
745
+ }
737
746
  }
738
747
  }, _GenerateContext_subjectDefaults = function _GenerateContext_subjectDefaults(produce) {
739
748
  try {
@@ -935,11 +944,15 @@ _GenerateContext_files = new WeakMap(), _GenerateContext_previews = new WeakMap(
935
944
  variants.forEach(variant => {
936
945
  refTrail.trace(`variant: ${variant}`, st => {
937
946
  try {
938
- // Order: include (allow) → skip (deny). Match is now on
939
- // `(refName, variant)`. An empty variant array on a
940
- // refName means "every variant of this refName"; a
941
- // populated array names the variants the entry applies
942
- // to.
947
+ if (typeof generatorConfig.isSupported === 'function' &&
948
+ !generatorConfig.isSupported({ refName, context: this, variant })) {
949
+ this.captureCurrentResult('notSupported', st);
950
+ return;
951
+ }
952
+ // Order: isSupported (capability) → include (allow) → skip
953
+ // (deny). Match is on `(refName, variant)`. An empty variant
954
+ // array on a refName means "every variant of this refName"; a
955
+ // populated array names the variants the entry applies to.
943
956
  if (include !== undefined &&
944
957
  !matchesRefFilter({ refs: include, refName, variant })) {
945
958
  this.captureCurrentResult('skipped', st);
@@ -118,6 +118,22 @@ export declare class ParseContext {
118
118
  * the parsed document. Symmetric across protocols: OAS prunes via
119
119
  * `OasDocument.removeItem`, GQL via `GqlDocument.removeItem`. Each
120
120
  * pruned consumer yields an `INVALID_DEPENDENCY_REF` issue.
121
+ *
122
+ * Pruning is deliberately **single-level** — only the direct
123
+ * consumers of a parse-errored schema are removed. Anything those
124
+ * removals leave with a dangling reference is left in place: if a
125
+ * generator never resolves it, it is harmless; if one does, that
126
+ * single artifact fails at generate time and is isolated there. We
127
+ * do not cascade transitively.
128
+ *
129
+ * Known coarseness, intentionally left as-is for now: a `paths:P:M:…`
130
+ * consumer trail resolves to the *whole operation*, so an operation
131
+ * that references a broken schema is pruned even when the reference
132
+ * is only through a response it does not generate from. A finer
133
+ * design — don't prune operations for response-position refs and let
134
+ * generate-time isolation handle the dangling ref — is deferred; the
135
+ * single-level + generate-time-isolation contract above keeps the
136
+ * dangling ref safe in the meantime.
121
137
  */
122
138
  removeErroredItems(): void;
123
139
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ParseContext.d.ts","sourceRoot":"","sources":["../../src/context/ParseContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,SAAS,CAAA;AAIzD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,YAAY,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EACV,eAAe,EACf,SAAS,EACT,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAMjD,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC/D,YAAY,EACV,eAAe,EACf,SAAS,EACT,YAAY,EACZ,cAAc,EACd,iBAAiB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MAAM,GAAG,IAAI;IASvD;;;;;;OAMG;IACH,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAUlE;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,KAAK,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI;IAiBzD,QAAQ,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,GAAG,IAAI;IAMzE,aAAa,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,GAAG,IAAI;IAkE9E;;;;;;;;;;;;;;;;;OAiBG;IACH,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,GAAG,IAAI;IAK1D;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EACf,OAAO,EACP,UAAU,EACV,MAAM,EACN,UAAU,EACV,IAA4B,EAC7B,EAAE,oBAAoB,GAAG,IAAI;CAY/B"}
@@ -234,6 +234,22 @@ export class ParseContext {
234
234
  * the parsed document. Symmetric across protocols: OAS prunes via
235
235
  * `OasDocument.removeItem`, GQL via `GqlDocument.removeItem`. Each
236
236
  * pruned consumer yields an `INVALID_DEPENDENCY_REF` issue.
237
+ *
238
+ * Pruning is deliberately **single-level** — only the direct
239
+ * consumers of a parse-errored schema are removed. Anything those
240
+ * removals leave with a dangling reference is left in place: if a
241
+ * generator never resolves it, it is harmless; if one does, that
242
+ * single artifact fails at generate time and is isolated there. We
243
+ * do not cascade transitively.
244
+ *
245
+ * Known coarseness, intentionally left as-is for now: a `paths:P:M:…`
246
+ * consumer trail resolves to the *whole operation*, so an operation
247
+ * that references a broken schema is pruned even when the reference
248
+ * is only through a response it does not generate from. A finer
249
+ * design — don't prune operations for response-position refs and let
250
+ * generate-time isolation handle the dangling ref — is deferred; the
251
+ * single-level + generate-time-isolation contract above keeps the
252
+ * dangling ref safe in the meantime.
237
253
  */
238
254
  removeErroredItems() {
239
255
  switch (this.protocol.type) {
@@ -413,6 +429,16 @@ export class ParseContext {
413
429
  }, parent);
414
430
  break;
415
431
  }
432
+ case 'debug': {
433
+ this.logIssueAt({
434
+ protocol,
435
+ level: 'debug',
436
+ type,
437
+ location,
438
+ message: issue.message
439
+ }, parent);
440
+ break;
441
+ }
416
442
  default: {
417
443
  const _exhaustive = issue;
418
444
  throw new Error(`Unhandled parse-issue level: ${JSON.stringify(_exhaustive)}`);
@@ -3,10 +3,18 @@
3
3
  * GraphQL parsing. Each variant stands on its own — no shared base —
4
4
  * so TypeScript narrows cleanly on `protocol` and `level`.
5
5
  *
6
- * `cause?: unknown` is only present on the error variants. Warnings are
7
- * synthesized by the parser with all the information needed for the
8
- * `message`; errors usually wrap a thrown `Error`, which we keep in
9
- * `cause` for debugging without forcing renderers to know about it.
6
+ * `cause?: unknown` is only present on the error variants. Warnings and
7
+ * `debug` issues are synthesized by the parser with all the information
8
+ * needed for the `message`; errors usually wrap a thrown `Error`, which
9
+ * we keep in `cause` for debugging without forcing renderers to know
10
+ * about it.
11
+ *
12
+ * Three severities: `error` (broken — drives exit status), `warning` (a
13
+ * real deviation that was handled, e.g. a 3.0 schema missing `type`), and
14
+ * `debug` (informational — the parser handled the input gracefully and
15
+ * recorded what it assumed or dropped; spec-legal-but-lossy or
16
+ * dialect-benign cases live here). All three are recorded on the manifest;
17
+ * consumers filter `debug` out of the default view.
10
18
  *
11
19
  * `location` is the schema-level address of the issue: for OAS it's the
12
20
  * stringified stack trail (e.g. `components.schemas.User.properties.email`);
@@ -63,6 +71,12 @@ export type ParseIssue = {
63
71
  type: OasIssueType;
64
72
  location: string;
65
73
  message: string;
74
+ } | {
75
+ protocol: 'oas';
76
+ level: 'debug';
77
+ type: OasIssueType;
78
+ location: string;
79
+ message: string;
66
80
  } | {
67
81
  protocol: 'gql';
68
82
  level: 'error';
@@ -76,5 +90,11 @@ export type ParseIssue = {
76
90
  type: GqlIssueType;
77
91
  location: string;
78
92
  message: string;
93
+ } | {
94
+ protocol: 'gql';
95
+ level: 'debug';
96
+ type: GqlIssueType;
97
+ location: string;
98
+ message: string;
79
99
  };
80
100
  //# sourceMappingURL=ParseIssue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ParseIssue.d.ts","sourceRoot":"","sources":["../../src/context/ParseIssue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,YAAY,GACpB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,yBAAyB,GACzB,iBAAiB,GACjB,yBAAyB,GACzB,wBAAwB,CAAA;AAE5B;;;;;GAKG;AACH,eAAO,MAAM,YAAY,kYAQvB,CAAA;AAKF,MAAM,MAAM,UAAU,GAClB;IACE,QAAQ,EAAE,KAAK,CAAA;IACf,KAAK,EAAE,OAAO,CAAA;IACd,IAAI,EAAE,YAAY,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,GACD;IACE,QAAQ,EAAE,KAAK,CAAA;IACf,KAAK,EAAE,SAAS,CAAA;IAChB,IAAI,EAAE,YAAY,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB,GACD;IACE,QAAQ,EAAE,KAAK,CAAA;IACf,KAAK,EAAE,OAAO,CAAA;IACd,IAAI,EAAE,YAAY,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,OAA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CAAA;IACd,IAAI,EAAE,YAAY,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,GACD;IACE,QAAQ,EAAE,KAAK,CAAA;IACf,KAAK,EAAE,SAAS,CAAA;IAChB,IAAI,EAAE,YAAY,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB,GACD;IACE,QAAQ,EAAE,KAAK,CAAA;IACf,KAAK,EAAE,OAAO,CAAA;IACd,IAAI,EAAE,YAAY,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA"}
@@ -3,10 +3,18 @@
3
3
  * GraphQL parsing. Each variant stands on its own — no shared base —
4
4
  * so TypeScript narrows cleanly on `protocol` and `level`.
5
5
  *
6
- * `cause?: unknown` is only present on the error variants. Warnings are
7
- * synthesized by the parser with all the information needed for the
8
- * `message`; errors usually wrap a thrown `Error`, which we keep in
9
- * `cause` for debugging without forcing renderers to know about it.
6
+ * `cause?: unknown` is only present on the error variants. Warnings and
7
+ * `debug` issues are synthesized by the parser with all the information
8
+ * needed for the `message`; errors usually wrap a thrown `Error`, which
9
+ * we keep in `cause` for debugging without forcing renderers to know
10
+ * about it.
11
+ *
12
+ * Three severities: `error` (broken — drives exit status), `warning` (a
13
+ * real deviation that was handled, e.g. a 3.0 schema missing `type`), and
14
+ * `debug` (informational — the parser handled the input gracefully and
15
+ * recorded what it assumed or dropped; spec-legal-but-lossy or
16
+ * dialect-benign cases live here). All three are recorded on the manifest;
17
+ * consumers filter `debug` out of the default view.
10
18
  *
11
19
  * `location` is the schema-level address of the issue: for OAS it's the
12
20
  * stringified stack trail (e.g. `components.schemas.User.properties.email`);
@@ -48,7 +48,17 @@ export type ParseWarningInput = {
48
48
  level: 'warning';
49
49
  message: string;
50
50
  };
51
- export type ParseIssueInput = ParseErrorInput | ParseWarningInput;
51
+ /**
52
+ * Informational diagnostic — the parser handled the input gracefully and
53
+ * is recording what it assumed or dropped (a spec-legal-but-lossy or
54
+ * dialect-benign case). Recorded on the manifest but filtered out of the
55
+ * default view; never affects exit status.
56
+ */
57
+ export type ParseDebugInput = {
58
+ level: 'debug';
59
+ message: string;
60
+ };
61
+ export type ParseIssueInput = ParseErrorInput | ParseWarningInput | ParseDebugInput;
52
62
  /**
53
63
  * Arguments accepted by `ParseContext.logIssue` (StackTrail-based
54
64
  * location, computed via `stackTrail.trace(key, ...)`).
@@ -149,6 +159,12 @@ export type LogIssueAtArgs = {
149
159
  type: OasIssueType;
150
160
  location: string;
151
161
  message: string;
162
+ } | {
163
+ protocol: 'oas';
164
+ level: 'debug';
165
+ type: OasIssueType;
166
+ location: string;
167
+ message: string;
152
168
  } | {
153
169
  protocol: 'gql';
154
170
  level: 'error';
@@ -162,6 +178,12 @@ export type LogIssueAtArgs = {
162
178
  type: GqlIssueType;
163
179
  location: string;
164
180
  message: string;
181
+ } | {
182
+ protocol: 'gql';
183
+ level: 'debug';
184
+ type: GqlIssueType;
185
+ location: string;
186
+ message: string;
165
187
  };
166
188
  /**
167
189
  * Options accepted by the GQL parse phase. Passed through the
@@ -1 +1 @@
1
- {"version":3,"file":"parseTypes.d.ts","sourceRoot":"","sources":["../../src/context/parseTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAEnD;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAA;AAE3C;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,eAAe,GAAG;IAC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AAE,cAAc,CAAC,CAAA;IAC9C,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,eAAe,CAAC,cAAc,CAAC,CAAA;IACzC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;IAClC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;gBAEH,EACV,OAAO,EACP,UAAU,EACV,OAAO,EACP,eAAe,EACf,OAAO,EACP,QAAQ,EACR,OAAO,EACR,EAAE,eAAe,CAAC,CAAC,EAAE,cAAc,CAAC;IA0BrC,OAAO,CAAC,KAAK;IAoBb;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,aAAa;IAkCrB,OAAO,CAAC,gBAAgB;CAsBzB"}
@@ -81,6 +81,7 @@ export class ModelDriver {
81
81
  refName,
82
82
  variant
83
83
  });
84
+ assertPeerSupported({ context, projection, refName });
84
85
  this.settings = this.context.toModelContentSettings({ refName, projection, variant });
85
86
  this.definition = this.apply({ destinationPath });
86
87
  this.context.modelDepth[`${projection.id}:${refName}`] = 0;
@@ -190,3 +191,31 @@ const assertPeerVariantExists = ({ context, generatorId, refName, variant }) =>
190
191
  `Available variants: ${available}.`);
191
192
  }
192
193
  };
194
+ /**
195
+ * Guard the peer-capability invariant for model insertions.
196
+ *
197
+ * `insertModel` materialises a peer's Definition regardless of the peer's
198
+ * `skip` / `include` configuration — dependency edges are intentionally
199
+ * filter-blind. Capability is different: a peer's `isSupported` declares
200
+ * which models it can serve *at all*. Handing a peer a model it has declared
201
+ * unsupported would build a broken Definition or crash inside the peer's
202
+ * constructor.
203
+ *
204
+ * The Driver throws here instead. The throw unwinds into `GenerateContext`'s
205
+ * per-item `try/catch`, so the *calling* generator's item is recorded as
206
+ * `error` and the run continues — loud, isolated failure rather than silent
207
+ * broken output.
208
+ *
209
+ * A peer that exposes no static `isSupported` is treated as supporting every
210
+ * model: `toModelProjectionBase` defaults it to `() => true`, and a
211
+ * hand-rolled projection may omit it.
212
+ */
213
+ const assertPeerSupported = ({ context, projection, refName }) => {
214
+ if (typeof projection.isSupported !== 'function') {
215
+ return;
216
+ }
217
+ if (!projection.isSupported({ refName, context })) {
218
+ throw new Error(`[${projection.id}] Cannot insert '${refName}' — peer generator ` +
219
+ `does not support this model (isSupported returned false).`);
220
+ }
221
+ };
@@ -1,12 +1,13 @@
1
1
  import type { RefName } from '../../types/RefName.js';
2
2
  import type { EnrichmentRequest } from '../../types/EnrichmentRequest.js';
3
- import type { TransformModelArgs, ToModelPreviewModuleArgs, ToModelMappingArgs, ToModelEnrichmentsArgs } from './types.js';
4
- import type * as v from 'valibot';
3
+ import type { TransformModelArgs, ToModelPreviewModuleArgs, ToModelMappingArgs, ToModelEnrichmentsArgs, IsSupportedModelArgs, IsSupportedModelConfigArgs } from './types.js';
4
+ import * as v from 'valibot';
5
5
  import type { MappingModule, PreviewModule } from '../../types/Preview.js';
6
6
  type ToModelEntryArgs<EnrichmentType = undefined> = {
7
7
  id: string;
8
8
  transform: ({ context, refName, variant }: TransformModelArgs) => void;
9
9
  toEnrichmentSchema: () => v.GenericSchema<EnrichmentType>;
10
+ isSupported?: ({ context, refName }: IsSupportedModelConfigArgs<EnrichmentType>) => boolean;
10
11
  toPreviewModule?: ({ context, refName, variant }: ToModelPreviewModuleArgs) => PreviewModule;
11
12
  toMappingModule?: ({ context, refName, variant }: ToModelMappingArgs) => MappingModule;
12
13
  toEnrichmentRequest?: <RequestedEnrichment extends EnrichmentType>(refName: RefName) => EnrichmentRequest<RequestedEnrichment> | undefined;
@@ -26,6 +27,10 @@ type ToModelEntryArgs<EnrichmentType = undefined> = {
26
27
  * @param args - Configuration for the model entry
27
28
  * @param args.id - Unique identifier for this model entry
28
29
  * @param args.transform - Function to transform schemas into artifacts
30
+ * @param args.isSupported - Optional capability gate; a model whose predicate
31
+ * returns `false` is recorded `notSupported` and its `transform` is skipped.
32
+ * Resolve the schema inside the predicate when needed
33
+ * (`context.resolveSchemaRefOnce(refName, id)`). Defaults to supporting every model.
29
34
  * @param args.toPreviewModule - Optional function to generate preview modules
30
35
  * @param args.toMappingModule - Optional function to generate mapping modules
31
36
  * @param args.toEnrichmentSchema - Optional function to provide enrichment validation
@@ -67,10 +72,11 @@ type ToModelEntryArgs<EnrichmentType = undefined> = {
67
72
  * });
68
73
  * ```
69
74
  */
70
- export declare const toModelEntry: <EnrichmentType = undefined>({ id, transform, toPreviewModule, toMappingModule, toEnrichmentSchema, toEnrichmentRequest, toEnrichmentDefaults }: ToModelEntryArgs<EnrichmentType>) => {
75
+ export declare const toModelEntry: <EnrichmentType = undefined>({ id, transform, isSupported, toPreviewModule, toMappingModule, toEnrichmentSchema, toEnrichmentRequest, toEnrichmentDefaults }: ToModelEntryArgs<EnrichmentType>) => {
71
76
  id: string;
72
77
  type: "model";
73
78
  transform: ({ context, refName, variant }: TransformModelArgs) => void;
79
+ isSupported: ({ context, refName }: IsSupportedModelArgs) => boolean;
74
80
  toPreviewModule?: ({ context, refName, variant }: ToModelPreviewModuleArgs) => PreviewModule;
75
81
  toMappingModule?: ({ context, refName, variant }: ToModelMappingArgs) => MappingModule;
76
82
  toEnrichmentSchema: () => v.GenericSchema<EnrichmentType>;
@@ -1 +1 @@
1
- {"version":3,"file":"toModelEntry.d.ts","sourceRoot":"","sources":["../../../src/dsl/model/toModelEntry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,KAAK,CAAC,MAAM,SAAS,CAAA;AACjC,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,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A;IACvD,oBAAoB,CAAC,EAAE,CAAC,EACtB,OAAO,EACP,OAAO,EACP,OAAO,EACR,EAAE,sBAAsB,KAAK,cAAc,GAAG,SAAS,CAAA;CAmCzD,CAAA"}
@@ -1,3 +1,6 @@
1
+ import * as v from 'valibot';
2
+ import { GENERATOR_ENRICHMENT_KEY, STACK_ENRICHMENT_KEY } from '../../types/Enrichments.js';
3
+ import get from 'lodash-es/get.js';
1
4
  /**
2
5
  * Creates a model transformation entry for the SKMTC pipeline.
3
6
  *
@@ -12,6 +15,10 @@
12
15
  * @param args - Configuration for the model entry
13
16
  * @param args.id - Unique identifier for this model entry
14
17
  * @param args.transform - Function to transform schemas into artifacts
18
+ * @param args.isSupported - Optional capability gate; a model whose predicate
19
+ * returns `false` is recorded `notSupported` and its `transform` is skipped.
20
+ * Resolve the schema inside the predicate when needed
21
+ * (`context.resolveSchemaRefOnce(refName, id)`). Defaults to supporting every model.
15
22
  * @param args.toPreviewModule - Optional function to generate preview modules
16
23
  * @param args.toMappingModule - Optional function to generate mapping modules
17
24
  * @param args.toEnrichmentSchema - Optional function to provide enrichment validation
@@ -53,11 +60,32 @@
53
60
  * });
54
61
  * ```
55
62
  */
56
- export const toModelEntry = ({ id, transform, toPreviewModule, toMappingModule, toEnrichmentSchema, toEnrichmentRequest, toEnrichmentDefaults }) => {
63
+ export const toModelEntry = ({ id, transform, isSupported, toPreviewModule, toMappingModule, toEnrichmentSchema, toEnrichmentRequest, toEnrichmentDefaults }) => {
57
64
  return {
58
65
  id,
59
66
  type: 'model',
60
67
  transform,
68
+ isSupported: ({ context, refName, variant }) => {
69
+ if (!isSupported) {
70
+ return true;
71
+ }
72
+ // Assemble the three-scope umbrella — mirrors
73
+ // `ModelProjectionBase.toEnrichments` so the shim and the
74
+ // projection-base resolve to the same value. Subject is per-item
75
+ // (`[id][refName][variant]`); generator and stack are run-constants.
76
+ // The required composite schema parses cast-free.
77
+ const raw = {
78
+ subject: get(context.settings, ['enrichments', id, refName, variant]),
79
+ generator: get(context.settings, ['enrichments', id, GENERATOR_ENRICHMENT_KEY]),
80
+ stack: get(context.settings, ['enrichments', STACK_ENRICHMENT_KEY])
81
+ };
82
+ return isSupported({
83
+ context,
84
+ refName,
85
+ enrichments: v.parse(toEnrichmentSchema(), raw),
86
+ variant
87
+ });
88
+ },
61
89
  toPreviewModule,
62
90
  toMappingModule,
63
91
  toEnrichmentSchema,
@@ -66,6 +66,16 @@ export type ModelProjectionBaseConfig<EnrichmentType = undefined, L extends Lang
66
66
  * static returns `undefined`.
67
67
  */
68
68
  toEnrichmentDefaults?: (args: ToEnrichmentsArgs) => EnrichmentType | undefined;
69
+ /**
70
+ * Family-level applicability predicate. Becomes a static `isSupported`
71
+ * on the returned base class so other projections can probe it before
72
+ * `insertModel` (the model counterpart of the operation-reference
73
+ * protocol). When omitted, advertises support for every model.
74
+ */
75
+ isSupported?: (args: {
76
+ refName: RefName;
77
+ context: GenerateContextType;
78
+ }) => boolean;
69
79
  };
70
80
  /**
71
81
  * Build a model projection base class from a per-generator config.
@@ -75,8 +85,8 @@ export type ModelProjectionBaseConfig<EnrichmentType = undefined, L extends Lang
75
85
  * while core stays language-blind (the base arrives as an opaque
76
86
  * constructor; core never names a concrete language class). The class
77
87
  * exposes the generator's `id`, `toIdentifierName`, `toIdentifierType`,
78
- * `toExportPath`, and `toEnrichments` statics, inherits the static `lang`
79
- * from the base, and
88
+ * `toExportPath`, `toEnrichments`, and `isSupported` statics, inherits the
89
+ * static `lang` from the base, and
80
90
  * injects `generatorKey` so subclasses don't have to.
81
91
  *
82
92
  * Defines NO `register` / `registerInto` — register ergonomics are typed by
@@ -118,7 +128,10 @@ export declare const toModelProjectionBase: <EnrichmentType = undefined, L exten
118
128
  * generator declares no `toEnrichmentDefaults` — the common case.
119
129
  */
120
130
  toEnrichmentDefaults: (args: ToEnrichmentsArgs) => EnrichmentType | undefined;
121
- isSupported: () => boolean;
131
+ isSupported: (args: {
132
+ refName: RefName;
133
+ context: GenerateContextType;
134
+ }) => boolean;
122
135
  lang: L;
123
136
  };
124
137
  export {};