@workos/oagen 0.6.0 → 0.8.0

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 (53) hide show
  1. package/dist/cli/index.mjs +1339 -451
  2. package/dist/cli/index.mjs.map +1 -1
  3. package/dist/compat/index.d.mts +144 -57
  4. package/dist/compat/index.d.mts.map +1 -1
  5. package/dist/compat/index.mjs +365 -35
  6. package/dist/compat/index.mjs.map +1 -1
  7. package/dist/{diff-CltJMcwG.mjs → diff-BaH9qa8k.mjs} +100 -23
  8. package/dist/diff-BaH9qa8k.mjs.map +1 -0
  9. package/dist/differ-CTl98yoS.d.mts +116 -0
  10. package/dist/differ-CTl98yoS.d.mts.map +1 -0
  11. package/dist/index.d.mts +4 -2
  12. package/dist/index.d.mts.map +1 -1
  13. package/dist/index.mjs +177 -4
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/{differ-CG5ZErKl.mjs → overlay-TYxHOCow.mjs} +1112 -553
  16. package/dist/overlay-TYxHOCow.mjs.map +1 -0
  17. package/dist/scripts/smoke/baseline.mjs +176 -3
  18. package/dist/scripts/smoke/baseline.mjs.map +1 -1
  19. package/dist/smoke.d.mts +43 -0
  20. package/dist/smoke.d.mts.map +1 -1
  21. package/dist/smoke.mjs +176 -3
  22. package/dist/smoke.mjs.map +1 -1
  23. package/dist/tree-sitter-C53w_0WE.mjs.map +1 -1
  24. package/dist/{types-C7g5sLuX.d.mts → types-mTtkgy_h.d.mts} +213 -2
  25. package/dist/types-mTtkgy_h.d.mts.map +1 -0
  26. package/dist/verify/index.d.mts +4 -3
  27. package/dist/verify/index.d.mts.map +1 -1
  28. package/dist/verify/index.mjs +12 -10
  29. package/dist/verify/index.mjs.map +1 -1
  30. package/docs/architecture/emitter-contract.md +2 -2
  31. package/docs/architecture/extractor-contract.md +6 -5
  32. package/docs/architecture/pipeline.md +4 -3
  33. package/docs/architecture/workflows.md +5 -3
  34. package/docs/cli.md +148 -6
  35. package/docs/contributor/public-api.md +1 -1
  36. package/docs/core/compatibility-ir.md +200 -0
  37. package/docs/core/compatibility-policy.md +170 -0
  38. package/docs/core/compatibility.md +83 -0
  39. package/docs/core/index.md +5 -0
  40. package/docs/core/manifest-schema.md +76 -0
  41. package/docs/core/quickstart.md +9 -2
  42. package/docs/core/verify-compat.md +235 -0
  43. package/package.json +1 -1
  44. package/skills/generate-emitter/SKILL.md +12 -7
  45. package/skills/generate-emitter/references/project-scaffold.md +27 -6
  46. package/skills/generate-extractor/SKILL.md +14 -8
  47. package/skills/generate-sdk/SKILL.md +2 -2
  48. package/skills/generate-smoke-test/SKILL.md +9 -5
  49. package/skills/review-operations/SKILL.md +2 -2
  50. package/skills/verify-compat/SKILL.md +1 -1
  51. package/dist/diff-CltJMcwG.mjs.map +0 -1
  52. package/dist/differ-CG5ZErKl.mjs.map +0 -1
  53. package/dist/types-C7g5sLuX.d.mts.map +0 -1
@@ -0,0 +1,116 @@
1
+ import { Bt as CompatPolicyHints, Mt as CompatSymbol, _t as ApiSurface, at as CompatProvenance, kt as CompatSnapshot, nt as CompatChangeSeverity, t as ApiSpec, tt as CompatChangeCategory, xt as LanguageHints, yt as DiffResult } from "./types-mTtkgy_h.mjs";
2
+
3
+ //#region src/compat/classify.d.ts
4
+ /** A single classified compatibility change. */
5
+ interface ClassifiedChange {
6
+ /** Specific change category. */
7
+ category: CompatChangeCategory;
8
+ /** Policy-aware severity (may differ from defaultSeverityForCategory). */
9
+ severity: CompatChangeSeverity;
10
+ /** Fully-qualified symbol path. */
11
+ symbol: string;
12
+ /** Deterministic ID for grouping related changes across languages. */
13
+ conceptualChangeId: string;
14
+ /** Where the drift originated. */
15
+ provenance: CompatProvenance;
16
+ /** Description of the old state. */
17
+ old: Record<string, string>;
18
+ /** Description of the new state. */
19
+ new: Record<string, string>;
20
+ /** Human-readable explanation. */
21
+ message: string;
22
+ }
23
+ /** Result of classifying all changes between two snapshots. */
24
+ interface ClassificationResult {
25
+ changes: ClassifiedChange[];
26
+ summary: {
27
+ breaking: number;
28
+ softRisk: number;
29
+ additive: number;
30
+ };
31
+ }
32
+ /**
33
+ * Classify changes between a baseline and candidate symbol.
34
+ * Returns one or more classified changes for the diff.
35
+ */
36
+ declare function classifySymbolChanges(baseline: CompatSymbol, candidate: CompatSymbol | undefined, policy: CompatPolicyHints): ClassifiedChange[];
37
+ /**
38
+ * Classify a new symbol as additive.
39
+ */
40
+ declare function classifyAddedSymbol(symbol: CompatSymbol): ClassifiedChange;
41
+ /** Summarize a list of classified changes by severity. */
42
+ declare function summarizeChanges(changes: ClassifiedChange[]): ClassificationResult['summary'];
43
+ //#endregion
44
+ //#region src/compat/spec-filter.d.ts
45
+ /**
46
+ * Compute the set of symbol names that are derivable from the OpenAPI spec.
47
+ * Only these names should be compared during compat verification — everything
48
+ * else in the baseline is hand-written and out of scope for generation.
49
+ */
50
+ declare function specDerivedNames(spec: ApiSpec, hints: LanguageHints): Set<string>;
51
+ /**
52
+ * Compute a map of enum name → set of wire values that appear in the spec.
53
+ * Used by filterSurface to exclude hand-added enum members that aren't in the spec.
54
+ */
55
+ declare function specDerivedEnumValues(spec: ApiSpec): Map<string, Set<string | number>>;
56
+ /**
57
+ * Compute the set of field paths (e.g., "Organization.name") that are defined
58
+ * in the OpenAPI spec's model schemas. Used by filterSurface to exclude
59
+ * hand-added SDK fields that reference spec-derived types.
60
+ */
61
+ declare function specDerivedFieldPaths(spec: ApiSpec, hints: LanguageHints): Set<string>;
62
+ /**
63
+ * Compute the set of method paths (e.g., "SSO.authorize") that are defined
64
+ * as operations in the OpenAPI spec's services. Used by filterSurface to
65
+ * exclude hand-written SDK methods that don't correspond to spec operations.
66
+ */
67
+ declare function specDerivedMethodPaths(spec: ApiSpec): Set<string>;
68
+ /**
69
+ * Compute the set of HTTP operation keys (e.g., "GET /sso/authorize") that
70
+ * exist in the spec. Used for overlay-based method matching.
71
+ */
72
+ declare function specDerivedHttpKeys(spec: ApiSpec): Set<string>;
73
+ /**
74
+ * Filter an ApiSurface to only include symbols whose names appear in the
75
+ * allowed set. Symbols not in the set are dropped entirely — they won't
76
+ * count toward the total or produce violations.
77
+ *
78
+ * For interfaces: when fieldPaths is provided, only keeps fields that appear
79
+ * in the spec-derived field paths. This prevents false positives from hand-added
80
+ * SDK fields that reference spec-derived types but aren't defined in the spec.
81
+ *
82
+ * For classes: when methodPaths is provided, only keeps methods whose names
83
+ * appear in the spec-derived method paths. This prevents false positives from
84
+ * hand-written SDK methods (e.g., SSO.authorization_url, Webhooks.construct_event)
85
+ * that don't correspond to spec operations. Properties on service classes are
86
+ * also filtered: only UPPER_CASE constants that are spec-derivable are kept.
87
+ */
88
+ declare function filterSurface(surface: ApiSurface, allowedNames: Set<string>, opts?: {
89
+ fieldPaths?: Set<string>;
90
+ methodPaths?: Set<string>;
91
+ enumValues?: Map<string, Set<string | number>>;
92
+ }): ApiSurface;
93
+ //#endregion
94
+ //#region src/compat/differ.d.ts
95
+ /** Result of diffing two compat snapshots. */
96
+ interface CompatDiffResult {
97
+ changes: ClassifiedChange[];
98
+ summary: ClassificationResult['summary'];
99
+ }
100
+ /**
101
+ * Diff two compat snapshots, producing classified changes with
102
+ * policy-aware severity.
103
+ */
104
+ declare function diffSnapshots(baseline: CompatSnapshot, candidate: CompatSnapshot, policy?: CompatPolicyHints): CompatDiffResult;
105
+ /**
106
+ * Compare two ApiSurface objects and return a DiffResult.
107
+ *
108
+ * This preserves the existing diffing behavior used by the overlay retry loop,
109
+ * compat check, and all existing tests. The internal implementation uses the
110
+ * same algorithms as before to maintain full backward compatibility with
111
+ * overlay patching and verification workflows.
112
+ */
113
+ declare function diffSurfaces(baseline: ApiSurface, candidate: ApiSurface, hints: LanguageHints): DiffResult;
114
+ //#endregion
115
+ export { specDerivedEnumValues as a, specDerivedMethodPaths as c, ClassifiedChange as d, classifyAddedSymbol as f, filterSurface as i, specDerivedNames as l, summarizeChanges as m, diffSnapshots as n, specDerivedFieldPaths as o, classifySymbolChanges as p, diffSurfaces as r, specDerivedHttpKeys as s, CompatDiffResult as t, ClassificationResult as u };
116
+ //# sourceMappingURL=differ-CTl98yoS.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"differ-CTl98yoS.d.mts","names":[],"sources":["../src/compat/classify.ts","../src/compat/spec-filter.ts","../src/compat/differ.ts"],"mappings":";;;;UAaiB,gBAAA;EAcJ;EAZX,QAAA,EAAU,oBAAA;EAAV;EAEA,QAAA,EAAU,oBAAA;EAAV;EAEA,MAAA;EAAA;EAEA,kBAAA;EAEA;EAAA,UAAA,EAAY,gBAAA;EAEZ;EAAA,GAAA,EAAK,MAAA;EAEL;EAAA,GAAA,EAAK,MAAA;EAEL;EAAA,OAAA;AAAA;AAIF;AAAA,UAAiB,oBAAA;EACf,OAAA,EAAS,gBAAA;EACT,OAAA;IACE,QAAA;IACA,QAAA;IACA,QAAA;EAAA;AAAA;;;;AAYJ;iBAAgB,qBAAA,CACd,QAAA,EAAU,YAAA,EACV,SAAA,EAAW,YAAA,cACX,MAAA,EAAQ,iBAAA,GACP,gBAAA;;;;iBAuSa,mBAAA,CAAoB,MAAA,EAAQ,YAAA,GAAe,gBAAA;;iBAc3C,gBAAA,CAAiB,OAAA,EAAS,gBAAA,KAAqB,oBAAA;;;;AA9V/D;;;;iBCJgB,gBAAA,CAAiB,IAAA,EAAM,OAAA,EAAS,KAAA,EAAO,aAAA,GAAgB,GAAA;;;;;iBA0CvD,qBAAA,CAAsB,IAAA,EAAM,OAAA,GAAU,GAAA,SAAY,GAAA;;;;;;iBAalD,qBAAA,CAAsB,IAAA,EAAM,OAAA,EAAS,KAAA,EAAO,aAAA,GAAgB,GAAA;;;;;;iBAqB5D,sBAAA,CAAuB,IAAA,EAAM,OAAA,GAAU,GAAA;;;;ADpDvD;iBCkEgB,mBAAA,CAAoB,IAAA,EAAM,OAAA,GAAU,GAAA;;;;;;;;;;;ADjDpD;;;;;iBCqGgB,aAAA,CACd,OAAA,EAAS,UAAA,EACT,YAAA,EAAc,GAAA,UACd,IAAA;EACE,UAAA,GAAa,GAAA;EACb,WAAA,GAAc,GAAA;EACd,UAAA,GAAa,GAAA,SAAY,GAAA;AAAA,IAE1B,UAAA;;;;UChIc,gBAAA;EACf,OAAA,EAAS,gBAAA;EACT,OAAA,EAAS,oBAAA;AAAA;;;;;iBAOK,aAAA,CACd,QAAA,EAAU,cAAA,EACV,SAAA,EAAW,cAAA,EACX,MAAA,GAAS,iBAAA,GACR,gBAAA;;;;;AFXH;;;;iBE4DgB,YAAA,CAAa,QAAA,EAAU,UAAA,EAAY,SAAA,EAAW,UAAA,EAAY,KAAA,EAAO,aAAA,GAAgB,UAAA"}
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as collectModelRefs, B as LoggingPolicy, C as TypeParam, D as assignModelsToServices, E as assertNever, F as BackoffStrategy, G as TelemetryPolicy, H as RequestGuardPolicy, I as DeepPartial, J as defaultSdkBehavior, K as TimeoutPolicy, L as ErrorPolicy, M as mapTypeRef, N as walkTypeRef, O as collectEnumRefs, P as AiAgentEnvVar, R as IdempotencyPolicy, S as SuccessResponse, T as UnionType, U as RetryPolicy, V as PaginationPolicy, W as SdkBehavior, Y as mergeSdkBehavior, _ as Parameter, a as EnumRef, b as ServerEntry, c as Field, d as MapType, f as Model, g as PaginationMeta, h as Operation, i as Enum, it as ApiSurface, j as collectRequestBodyModels, k as collectFieldDependencies, l as HttpMethod, m as NullableType, n as ArrayType, o as EnumValue, p as ModelRef, q as UserAgentPolicy, r as AuthScheme, s as ErrorResponse, st as Extractor, t as ApiSpec, u as LiteralType, ut as OverlayLookup, v as PrimitiveType, w as TypeRef, x as Service, y as SecurityRequirement, z as LogEvent } from "./types-C7g5sLuX.mjs";
1
+ import { A as collectEnumRefs, B as IdempotencyPolicy, C as Service, Ct as OverlayLookup, D as UnionType, E as TypeRef, F as walkTypeRef, G as RetryPolicy, H as LoggingPolicy, I as AiAgentEnvVar, J as TimeoutPolicy, K as SdkBehavior, L as BackoffStrategy, M as collectModelRefs, N as collectRequestBodyModels, O as assertNever, P as mapTypeRef, R as DeepPartial, S as ServerEntry, T as TypeParam, U as PaginationPolicy, V as LogEvent, W as RequestGuardPolicy, X as defaultSdkBehavior, Y as UserAgentPolicy, Z as mergeSdkBehavior, _ as Parameter, _t as ApiSurface, a as EnumRef, b as PrimitiveType, bt as Extractor, c as Field, d as MapType, f as Model, g as PaginationMeta, h as Operation, i as Enum, j as collectFieldDependencies, k as assignModelsToServices, l as HttpMethod, m as NullableType, n as ArrayType, o as EnumValue, p as ModelRef, q as TelemetryPolicy, r as AuthScheme, rt as CompatConfig, s as ErrorResponse, t as ApiSpec, u as LiteralType, v as ParameterGroup, w as SuccessResponse, x as SecurityRequirement, y as ParameterGroupVariant, z as ErrorPolicy } from "./types-mTtkgy_h.mjs";
2
2
 
3
3
  //#region src/ir/operation-hints.d.ts
4
4
  /** Per-operation override keyed by "METHOD /path" (e.g. "POST /sso/token"). */
@@ -430,6 +430,8 @@ declare function planOperation(op: Operation): OperationPlan;
430
430
  interface OagenConfig {
431
431
  emitters?: Emitter[];
432
432
  extractors?: Extractor[];
433
+ /** Compatibility verification policy. See docs/core/compatibility-policy.md. */
434
+ compat?: CompatConfig;
433
435
  /** Path to the emitter project (where skills scaffold new emitters, tests, smoke runners). */
434
436
  emitterProject?: string;
435
437
  /** Map from language key to custom smoke runner script path. */
@@ -466,5 +468,5 @@ interface OagenConfig {
466
468
  mountRules?: Record<string, string>;
467
469
  }
468
470
  //#endregion
469
- export { ACRONYM_SET, type AiAgentEnvVar, type ApiSpec, type ArrayType, type AuthScheme, type BackoffStrategy, type Change, CommandError, ConfigError, ConfigLoadError, ConfigVersionMismatchError, type DeepPartial, type DiffReport, type Emitter, type EmitterContext, type Enum, type EnumAdded, type EnumModified, type EnumRef, type EnumRemoved, type EnumValue, type EnumValueChange, type ErrorPolicy, type ErrorResponse, ExtractorError, type Field, type FieldChange, type FormatCommand, type GeneratedFile, type HttpMethod, type IdempotencyPolicy, InternalError, type LiteralType, type LogEvent, type LoggingPolicy, type MapType, type Model, type ModelAdded, type ModelModified, type ModelRef, type ModelRemoved, type NullableType, type OagenConfig, OagenError, type Operation, type OperationAdded, type OperationHint, type OperationModified, type OperationPlan, type OperationRemoved, type PaginationMeta, type PaginationPolicy, type ParamChange, type Parameter, type PrimitiveType, RegistryError, type RequestGuardPolicy, type ResolvedOperation, type ResolvedWrapper, type RetryPolicy, type SdkBehavior, type SecurityRequirement, type ServerEntry, type Service, type ServiceAdded, type ServiceRemoved, SpecParseError, type SplitHint, type SuccessResponse, type TelemetryPolicy, type TimeoutPolicy, type TypeParam, type TypeRef, type UnionType, type UserAgentPolicy, applyFileHeaders, assertNever, assignModelsToServices, buildEmitterContext, cleanSchemaName, collectEnumRefs, collectFieldDependencies, collectModelRefs, collectReferencedNames, collectRequestBodyModels, defaultSdkBehavior, deriveMethodName, diffSpecs, generate, generateAllFiles, generateFiles, getEmitter, integrateGeneratedFiles, mapFilesForTargetIntegration, mapTypeRef, mergeSdkBehavior, parseSpec, planOperation, registerEmitter, resolveOperations, stripBackendPrefixes, toCamelCase, toKebabCase, toPascalCase, toSnakeCase, toUpperSnakeCase, treeShakeFiles, walkTypeRef };
471
+ export { ACRONYM_SET, type AiAgentEnvVar, type ApiSpec, type ArrayType, type AuthScheme, type BackoffStrategy, type Change, CommandError, ConfigError, ConfigLoadError, ConfigVersionMismatchError, type DeepPartial, type DiffReport, type Emitter, type EmitterContext, type Enum, type EnumAdded, type EnumModified, type EnumRef, type EnumRemoved, type EnumValue, type EnumValueChange, type ErrorPolicy, type ErrorResponse, ExtractorError, type Field, type FieldChange, type FormatCommand, type GeneratedFile, type HttpMethod, type IdempotencyPolicy, InternalError, type LiteralType, type LogEvent, type LoggingPolicy, type MapType, type Model, type ModelAdded, type ModelModified, type ModelRef, type ModelRemoved, type NullableType, type OagenConfig, OagenError, type Operation, type OperationAdded, type OperationHint, type OperationModified, type OperationPlan, type OperationRemoved, type PaginationMeta, type PaginationPolicy, type ParamChange, type Parameter, type ParameterGroup, type ParameterGroupVariant, type PrimitiveType, RegistryError, type RequestGuardPolicy, type ResolvedOperation, type ResolvedWrapper, type RetryPolicy, type SdkBehavior, type SecurityRequirement, type ServerEntry, type Service, type ServiceAdded, type ServiceRemoved, SpecParseError, type SplitHint, type SuccessResponse, type TelemetryPolicy, type TimeoutPolicy, type TypeParam, type TypeRef, type UnionType, type UserAgentPolicy, applyFileHeaders, assertNever, assignModelsToServices, buildEmitterContext, cleanSchemaName, collectEnumRefs, collectFieldDependencies, collectModelRefs, collectReferencedNames, collectRequestBodyModels, defaultSdkBehavior, deriveMethodName, diffSpecs, generate, generateAllFiles, generateFiles, getEmitter, integrateGeneratedFiles, mapFilesForTargetIntegration, mapTypeRef, mergeSdkBehavior, parseSpec, planOperation, registerEmitter, resolveOperations, stripBackendPrefixes, toCamelCase, toKebabCase, toPascalCase, toSnakeCase, toUpperSnakeCase, treeShakeFiles, walkTypeRef };
470
472
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/ir/operation-hints.ts","../src/errors.ts","../src/engine/types.ts","../src/differ/types.ts","../src/parser/parse.ts","../src/engine/orchestrator.ts","../src/engine/generate-files.ts","../src/engine/writer.ts","../src/engine/integrate.ts","../src/engine/registry.ts","../src/differ/diff.ts","../src/utils/naming.ts","../src/engine/operation-plan.ts","../src/cli/config-loader.ts"],"mappings":";;;;UAeiB,aAAA;EAAA;EAEf,IAAA;;EAEA,OAAA;EAFA;EAIA,KAAA,GAAQ,SAAA;EAAR;EAEA,QAAA,GAAW,MAAA;EAAX;EAEA,eAAA;EAAA;;;;AAUF;;EAHE,UAAA;AAAA;AAAA,UAGe,SAAA;EAIf;EAFA,IAAA;EAIW;EAFX,aAAA;EAMA;EAJA,QAAA,GAAW,MAAA;EAUG;EARd,eAAA;EAee;EAbf,aAAA;;;;;;EAMA,cAAA;AAAA;AAAA,UAOe,iBAAA;EAEJ;EAAX,SAAA,EAAW,SAAA;EA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MAAA;EboBA;;;AAOF;;EarBE,cAAA,GAAiB,MAAA,SAAe,aAAA;EbuBrB;;;;;;EahBX,UAAA,GAAa,MAAA;AAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/ir/operation-hints.ts","../src/errors.ts","../src/engine/types.ts","../src/differ/types.ts","../src/parser/parse.ts","../src/engine/orchestrator.ts","../src/engine/generate-files.ts","../src/engine/writer.ts","../src/engine/integrate.ts","../src/engine/registry.ts","../src/differ/diff.ts","../src/utils/naming.ts","../src/engine/operation-plan.ts","../src/cli/config-loader.ts"],"mappings":";;;;UAeiB,aAAA;EAAA;EAEf,IAAA;;EAEA,OAAA;EAFA;EAIA,KAAA,GAAQ,SAAA;EAAR;EAEA,QAAA,GAAW,MAAA;EAAX;EAEA,eAAA;EAAA;;;;AAUF;;EAHE,UAAA;AAAA;AAAA,UAGe,SAAA;EAIf;EAFA,IAAA;EAIW;EAFX,aAAA;EAMA;EAJA,QAAA,GAAW,MAAA;EAUG;EARd,eAAA;EAee;EAbf,aAAA;;;;;;EAMA,cAAA;AAAA;AAAA,UAOe,iBAAA;EAEJ;EAAX,SAAA,EAAW,SAAA;EAEF;EAAT,OAAA,EAAS,OAAA;EAIT;EAFA,UAAA;EAIW;EAFX,OAAA;EAIU;EAFV,QAAA,GAAW,eAAA;EAMX;EAJA,QAAA,EAAU,MAAA;EAIA;EAFV,eAAA;EAK8B;EAH9B,UAAA;AAAA;AAAA,UAGe,eAAA;EAIf;EAFA,IAAA;EAIU;EAFV,aAAA;EAMA;EAJA,QAAA,EAAU,MAAA;EAQV;EANA,eAAA;EAMiB;EAJjB,aAAA;EAgF8B;EA9E9B,cAAA;EA8E+D;EA5E/D,iBAAA;AAAA;;;;;AA2JF;;;;;;;iBA/EgB,gBAAA,CAAiB,EAAA,EAAI,SAAA,EAAW,QAAA,EAAU,OAAA;;;;;;;;;iBA+E1C,iBAAA,CACd,IAAA,EAAM,OAAA,EACN,KAAA,GAAQ,MAAA,SAAe,aAA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AAA,iBAER,YAAA,CAAa,CAAA,UAAW,QAAA,GAAW,GAAA;AAAA,iBAanC,WAAA,CAAY,CAAA,UAAW,QAAA,GAAW,GAAA;AAAA,iBAelC,WAAA,CAAY,CAAA;AAAA,iBAMZ,WAAA,CAAY,CAAA;AAAA,iBAMZ,gBAAA,CAAiB,CAAA;AAAA,iBAiBjB,oBAAA,CAAqB,IAAA;AAAA,iBAqErB,eAAA,CAAgB,IAAA;;;UCzLf,aAAA;EACf,SAAA,EAAW,SAAA;EACX,QAAA;EACA,OAAA;EACA,gBAAA;EACA,mBAAA;EACA,WAAA;EACA,iBAAA;EZWA;;EYRA,sBAAA;EACA,eAAA;EZWA;;;EYPA,eAAA;EACA,cAAA;EACA,OAAA;AAAA;AAAA,iBAGc,aAAA,CAAc,EAAA,EAAI,SAAA,GAAY,aAAA;;;UCd7B,WAAA;EACf,QAAA,GAAW,OAAA;EACX,UAAA,GAAa,SAAA;EbMb;EaJA,MAAA,GAAS,YAAA;EbQT;EaNA,cAAA;EbQA;EaNA,YAAA,GAAe,MAAA;EbQf;;;;AAUF;;EaXE,oBAAA,IAAwB,EAAA;EbiBP;;;;;;EaVjB,mBAAA,IAAuB,IAAA;EboBvB;;EajBA,MAAA;EbwBe;;;;;EalBf,cAAA,GAAiB,MAAA,SAAe,aAAA;Eb8BtB;;;;;;EavBV,UAAA,GAAa,MAAA;AAAA"}
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { A as walkTypeRef, C as assertNever, D as collectModelRefs, E as collectFieldDependencies, O as collectRequestBodyModels, S as SpecParseError, T as collectEnumRefs, _ as ConfigVersionMismatchError, a as singularize, b as OagenError, c as stripListItemMarkers, d as toPascalCase, f as toSnakeCase, g as ConfigLoadError, h as ConfigError, k as mapTypeRef, l as toCamelCase, m as CommandError, n as ACRONYM_SET, p as toUpperSnakeCase, r as cleanSchemaName, s as stripBackendPrefixes, u as toKebabCase, v as ExtractorError, w as assignModelsToServices, x as RegistryError, y as InternalError } from "./tree-sitter-C53w_0WE.mjs";
2
- import { a as integrateGeneratedFiles, c as applyFileHeaders, d as generateAllFiles, f as generateFiles, i as generate, l as buildEmitterContext, m as resolveOperations, n as getEmitter, o as mapFilesForTargetIntegration, p as deriveMethodName, r as registerEmitter, s as treeShakeFiles, t as diffSpecs, u as collectReferencedNames } from "./diff-CltJMcwG.mjs";
2
+ import { a as integrateGeneratedFiles, c as applyFileHeaders, d as generateAllFiles, f as generateFiles, i as generate, l as buildEmitterContext, m as resolveOperations, n as getEmitter, o as mapFilesForTargetIntegration, p as deriveMethodName, r as registerEmitter, s as treeShakeFiles, t as diffSpecs, u as collectReferencedNames } from "./diff-BaH9qa8k.mjs";
3
3
  import { readFile } from "node:fs/promises";
4
4
  import { resolve } from "node:path";
5
5
  import { pathToFileURL } from "node:url";
@@ -353,7 +353,7 @@ function findSchemaByName(pascalName, schemas) {
353
353
  for (const [k, v] of Object.entries(schemas)) if (resolveSchemaName(k) === pascalName) return v;
354
354
  return null;
355
355
  }
356
- /** Walk into a schema to find a field's sub-schema, resolving allOf. */
356
+ /** Walk into a schema to find a field's sub-schema, resolving allOf and oneOf/anyOf. */
357
357
  function findNestedFieldSchema(fieldName, parentSchema, schemas) {
358
358
  if (parentSchema.properties?.[fieldName]) return parentSchema.properties[fieldName];
359
359
  if (parentSchema.allOf) for (const sub of parentSchema.allOf) {
@@ -365,6 +365,15 @@ function findNestedFieldSchema(fieldName, parentSchema, schemas) {
365
365
  }
366
366
  if (resolved.properties?.[fieldName]) return resolved.properties[fieldName];
367
367
  }
368
+ for (const variant of [...parentSchema.oneOf ?? [], ...parentSchema.anyOf ?? []]) {
369
+ let resolved = variant;
370
+ if (variant.$ref) {
371
+ const segments = variant.$ref.split("/");
372
+ const refName = segments[segments.length - 1];
373
+ if (refName && schemas[refName]) resolved = schemas[refName];
374
+ }
375
+ if (resolved.properties?.[fieldName]) return resolved.properties[fieldName];
376
+ }
368
377
  return null;
369
378
  }
370
379
  /** Extract a model (and nested models) from an inline field schema. */
@@ -530,6 +539,19 @@ function extractModel(name, schema, schemas) {
530
539
  if (!fieldSchema) continue;
531
540
  fields.push(buildFieldFromSchema(fieldName, fieldSchema, name, requiredSet));
532
541
  }
542
+ if (fields.length === 0 && (schema.oneOf || schema.anyOf)) {
543
+ const variants = schema.oneOf ?? schema.anyOf ?? [];
544
+ const emptyRequired = /* @__PURE__ */ new Set();
545
+ const seenFieldNames = /* @__PURE__ */ new Set();
546
+ for (const variant of variants) {
547
+ if (!variant.properties) continue;
548
+ for (const [fieldName, fieldSchema] of Object.entries(variant.properties)) {
549
+ if (!fieldSchema || seenFieldNames.has(fieldName)) continue;
550
+ seenFieldNames.add(fieldName);
551
+ fields.push(buildFieldFromSchema(fieldName, fieldSchema, name, emptyRequired));
552
+ }
553
+ }
554
+ }
533
555
  if (schema.additionalProperties && typeof schema.additionalProperties === "object" && schema.properties) {
534
556
  if (Object.keys(schema.additionalProperties).length > 0) {
535
557
  const valueType = schemaToTypeRef(schema.additionalProperties, "additionalProperties", name);
@@ -553,6 +575,7 @@ function extractModel(name, schema, schemas) {
553
575
  function extractAllOfModel(name, schema, schemas) {
554
576
  const fields = [];
555
577
  const requiredSet = /* @__PURE__ */ new Set();
578
+ let resultDiscriminator;
556
579
  for (const subSchema of schema.allOf ?? []) {
557
580
  let resolved = subSchema;
558
581
  if (subSchema.$ref && schemas) {
@@ -569,6 +592,22 @@ function extractAllOfModel(name, schema, schemas) {
569
592
  });
570
593
  if (f.required) requiredSet.add(f.name);
571
594
  }
595
+ } else if (resolved.oneOf || resolved.anyOf) {
596
+ const variants = resolved.oneOf ?? resolved.anyOf ?? [];
597
+ const discriminatorInfo = detectAllOfVariantDiscriminator(variants, name);
598
+ if (discriminatorInfo) resultDiscriminator = discriminatorInfo;
599
+ else {
600
+ const emptyRequired = /* @__PURE__ */ new Set();
601
+ const seenFieldNames = new Set(fields.map((f) => f.name));
602
+ for (const variant of variants) {
603
+ if (!variant.properties) continue;
604
+ for (const [fieldName, fieldSchema] of Object.entries(variant.properties)) {
605
+ if (!fieldSchema || seenFieldNames.has(fieldName)) continue;
606
+ seenFieldNames.add(fieldName);
607
+ fields.push(buildFieldFromSchema(fieldName, fieldSchema, name, emptyRequired));
608
+ }
609
+ }
610
+ }
572
611
  } else {
573
612
  if (resolved.required) for (const r of resolved.required) requiredSet.add(r);
574
613
  if (resolved.properties) {
@@ -585,7 +624,42 @@ function extractAllOfModel(name, schema, schemas) {
585
624
  return {
586
625
  name,
587
626
  description: schema.description,
588
- fields
627
+ fields,
628
+ ...resultDiscriminator ? { discriminator: resultDiscriminator } : {}
629
+ };
630
+ }
631
+ /**
632
+ * Detect an implicit discriminator on an allOf+oneOf where every variant is an
633
+ * object that pins the same property to a distinct const value. Unlike
634
+ * detectConstPropertyDiscriminator (which requires $ref or title for variant
635
+ * model names), this version derives model names from the const value itself
636
+ * using deriveDiscriminatedVariantName — matching how extractDiscriminatedAllOfVariantModels
637
+ * names those models.
638
+ *
639
+ * Returns null when no discriminator can be reliably detected.
640
+ */
641
+ function detectAllOfVariantDiscriminator(variants, fallbackName) {
642
+ if (variants.length < 2) return null;
643
+ const candidates = Object.keys(variants[0]?.properties ?? {});
644
+ let candidateProperty = null;
645
+ for (const propName of candidates) if (variants.every((v) => getConstPropertyValue(v, propName) !== null)) {
646
+ candidateProperty = propName;
647
+ break;
648
+ }
649
+ if (!candidateProperty) return null;
650
+ const mapping = {};
651
+ const seenModelNames = /* @__PURE__ */ new Set();
652
+ for (const v of variants) {
653
+ const value = getConstPropertyValue(v, candidateProperty);
654
+ if (value === null) return null;
655
+ const modelName = deriveDiscriminatedVariantName(v, fallbackName);
656
+ if (seenModelNames.has(modelName)) return null;
657
+ seenModelNames.add(modelName);
658
+ mapping[value] = modelName;
659
+ }
660
+ return {
661
+ property: candidateProperty,
662
+ mapping
589
663
  };
590
664
  }
591
665
  function extractDiscriminatedAllOfVariantModels(schema, fallbackName) {
@@ -1425,6 +1499,94 @@ function inferDeeperContext(path) {
1425
1499
  if (nonParams.length >= 3) return toPascalCase(nonParams.slice(1, -1).join("_"));
1426
1500
  return null;
1427
1501
  }
1502
+ /**
1503
+ * Extract mutually-exclusive parameter groups from the `x-mutually-exclusive-parameter-groups`
1504
+ * operation extension. Cross-references grouped parameter names against the already-extracted
1505
+ * IR parameter arrays so emitters get object-identity references.
1506
+ */
1507
+ function extractParameterGroups(op, allIRParams, operationContext) {
1508
+ const raw = op["x-mutually-exclusive-parameter-groups"];
1509
+ if (!raw || typeof raw !== "object") return void 0;
1510
+ const paramByName = /* @__PURE__ */ new Map();
1511
+ for (const p of allIRParams) paramByName.set(p.name, p);
1512
+ const groups = [];
1513
+ for (const [groupName, groupDef] of Object.entries(raw)) {
1514
+ if (!groupDef || typeof groupDef !== "object") throw new Error(`Malformed x-mutually-exclusive-parameter-groups.${groupName} in ${operationContext}: expected an object with "optional" and "variants".`);
1515
+ if (typeof groupDef.optional !== "boolean") throw new Error(`Malformed x-mutually-exclusive-parameter-groups.${groupName}.optional in ${operationContext}: expected a boolean.`);
1516
+ if (!groupDef.variants || typeof groupDef.variants !== "object") throw new Error(`Malformed x-mutually-exclusive-parameter-groups.${groupName}.variants in ${operationContext}: expected an object mapping variant names to parameter name arrays.`);
1517
+ if (Object.keys(groupDef.variants).length === 0) throw new Error(`Malformed x-mutually-exclusive-parameter-groups.${groupName} in ${operationContext}: group has zero variants.`);
1518
+ const variants = Object.entries(groupDef.variants).map(([variantName, paramNames]) => {
1519
+ if (!Array.isArray(paramNames) || paramNames.length === 0) throw new Error(`Malformed x-mutually-exclusive-parameter-groups.${groupName}.variants.${variantName} in ${operationContext}: expected a non-empty array of parameter names.`);
1520
+ return {
1521
+ name: variantName,
1522
+ parameters: paramNames.map((pName) => {
1523
+ const irParam = paramByName.get(pName);
1524
+ if (!irParam) throw new Error(`x-mutually-exclusive-parameter-groups.${groupName}.variants.${variantName} references parameter "${pName}" which does not exist in the operation's parameters[] (${operationContext}).`);
1525
+ return irParam;
1526
+ })
1527
+ };
1528
+ });
1529
+ groups.push({
1530
+ name: groupName,
1531
+ optional: groupDef.optional,
1532
+ variants
1533
+ });
1534
+ }
1535
+ return groups.length > 0 ? groups : void 0;
1536
+ }
1537
+ /**
1538
+ * Extract mutually-exclusive body parameter groups from the
1539
+ * `x-mutually-exclusive-body-groups` operation extension. Unlike query
1540
+ * parameter groups (whose parameters live in operation.queryParams), body
1541
+ * group parameters are synthetic — built from the oneOf variant schemas in
1542
+ * the request body. Emitters use the group's presence to generate sum-type
1543
+ * interfaces and custom JSON marshalling instead of flat optional fields.
1544
+ */
1545
+ function extractBodyParameterGroups(op, operationContext) {
1546
+ const raw = op["x-mutually-exclusive-body-groups"];
1547
+ if (!raw || typeof raw !== "object") return void 0;
1548
+ const bodySchema = op.requestBody?.content?.["application/json"]?.schema;
1549
+ const variantFieldSchemas = /* @__PURE__ */ new Map();
1550
+ if (bodySchema) {
1551
+ for (const sub of bodySchema.allOf ?? []) for (const variant of sub.oneOf ?? []) if (variant.properties) {
1552
+ for (const [name, fieldSchema] of Object.entries(variant.properties)) if (fieldSchema) variantFieldSchemas.set(name, fieldSchema);
1553
+ }
1554
+ for (const variant of bodySchema.oneOf ?? []) if (variant.properties) {
1555
+ for (const [name, fieldSchema] of Object.entries(variant.properties)) if (fieldSchema) variantFieldSchemas.set(name, fieldSchema);
1556
+ }
1557
+ }
1558
+ const groups = [];
1559
+ for (const [groupName, groupDef] of Object.entries(raw)) {
1560
+ if (!groupDef || typeof groupDef !== "object") continue;
1561
+ if (typeof groupDef.optional !== "boolean") continue;
1562
+ if (!groupDef.variants || typeof groupDef.variants !== "object") continue;
1563
+ if (Object.keys(groupDef.variants).length === 0) continue;
1564
+ const variants = Object.entries(groupDef.variants).map(([variantName, paramNames]) => {
1565
+ if (!Array.isArray(paramNames) || paramNames.length === 0) throw new Error(`Malformed x-mutually-exclusive-body-groups.${groupName}.variants.${variantName} in ${operationContext}: expected a non-empty array of parameter names.`);
1566
+ return {
1567
+ name: variantName,
1568
+ parameters: paramNames.map((pName) => {
1569
+ const fieldSchema = variantFieldSchemas.get(pName);
1570
+ return {
1571
+ name: pName,
1572
+ type: fieldSchema ? schemaToTypeRef(fieldSchema, toPascalCase(pName)) : {
1573
+ kind: "primitive",
1574
+ type: "string"
1575
+ },
1576
+ required: false,
1577
+ description: fieldSchema?.description
1578
+ };
1579
+ })
1580
+ };
1581
+ });
1582
+ groups.push({
1583
+ name: groupName,
1584
+ optional: groupDef.optional,
1585
+ variants
1586
+ });
1587
+ }
1588
+ return groups.length > 0 ? groups : void 0;
1589
+ }
1428
1590
  function buildOperation(method, path, op, pathLevelParams, operationIdTransform, serviceName) {
1429
1591
  const allParams = [...pathLevelParams, ...op.parameters ?? []];
1430
1592
  const hasIdempotencyHeader = allParams.some((p) => p.in === "header" && p.name.toLowerCase() === "idempotency-key");
@@ -1450,6 +1612,16 @@ function buildOperation(method, path, op, pathLevelParams, operationIdTransform,
1450
1612
  };
1451
1613
  } else if (paginationFromParams) pagination = paginationFromParams;
1452
1614
  const security = extractOperationSecurity(op.security);
1615
+ const allIRParams = [
1616
+ ...pathParams,
1617
+ ...queryParams,
1618
+ ...headerParams,
1619
+ ...cookieParams
1620
+ ];
1621
+ const opLabel = op.operationId ?? `${method.toUpperCase()} ${path}`;
1622
+ const queryParamGroups = extractParameterGroups(op, allIRParams, opLabel);
1623
+ const bodyParamGroups = extractBodyParameterGroups(op, opLabel);
1624
+ const parameterGroups = queryParamGroups || bodyParamGroups ? [...queryParamGroups ?? [], ...bodyParamGroups ?? []] : void 0;
1453
1625
  return {
1454
1626
  operation: {
1455
1627
  name: inferOperationName(method, path, op.operationId, operationIdTransform),
@@ -1469,7 +1641,8 @@ function buildOperation(method, path, op, pathLevelParams, operationIdTransform,
1469
1641
  injectIdempotencyKey: hasIdempotencyHeader,
1470
1642
  deprecated: op.deprecated || void 0,
1471
1643
  async: op["x-oagen-async"],
1472
- security
1644
+ security,
1645
+ parameterGroups
1473
1646
  },
1474
1647
  inlineModels
1475
1648
  };