@workos/oagen 0.30.2 → 0.31.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 (46) hide show
  1. package/README.md +4 -12
  2. package/dist/cli/index.d.mts +1 -1
  3. package/dist/cli/index.mjs +2885 -651
  4. package/dist/cli/index.mjs.map +1 -1
  5. package/dist/compat/index.d.mts +85 -36
  6. package/dist/compat/index.d.mts.map +1 -1
  7. package/dist/compat/index.mjs +33 -23
  8. package/dist/compat/index.mjs.map +1 -1
  9. package/dist/{diff-BO5FieX5.mjs → diff-CAsypxXV.mjs} +107 -89
  10. package/dist/{diff-BO5FieX5.mjs.map → diff-CAsypxXV.mjs.map} +1 -1
  11. package/dist/differ-B0DSuKUZ.d.mts +72 -0
  12. package/dist/differ-B0DSuKUZ.d.mts.map +1 -0
  13. package/dist/index.d.mts +129 -61
  14. package/dist/index.d.mts.map +1 -1
  15. package/dist/index.mjs +2877 -546
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/{overlay-DWAHPofk.mjs → overlay-Dj3WWlNP.mjs} +44 -38
  18. package/dist/overlay-Dj3WWlNP.mjs.map +1 -0
  19. package/dist/scripts/smoke/baseline.d.mts +1 -1
  20. package/dist/scripts/smoke/baseline.mjs +2740 -527
  21. package/dist/scripts/smoke/baseline.mjs.map +1 -1
  22. package/dist/scripts/smoke/sdk-test.d.mts +1 -1
  23. package/dist/scripts/smoke/sdk-test.mjs +4 -2
  24. package/dist/scripts/smoke/sdk-test.mjs.map +1 -1
  25. package/dist/smoke.d.mts +251 -36
  26. package/dist/smoke.d.mts.map +1 -1
  27. package/dist/smoke.mjs +2740 -527
  28. package/dist/smoke.mjs.map +1 -1
  29. package/dist/{tree-sitter-CDKm3n64.mjs → tree-sitter-C7Hk-NDu.mjs} +35 -7
  30. package/dist/tree-sitter-C7Hk-NDu.mjs.map +1 -0
  31. package/dist/{types-BcbGLNkh.d.mts → types-I7W7CNl1.d.mts} +219 -9
  32. package/dist/types-I7W7CNl1.d.mts.map +1 -0
  33. package/dist/verify/index.d.mts +7 -8
  34. package/dist/verify/index.d.mts.map +1 -1
  35. package/dist/verify/index.mjs +24 -14
  36. package/dist/verify/index.mjs.map +1 -1
  37. package/docs/architecture/emitter-contract.md +1 -0
  38. package/docs/architecture/ir-types.md +170 -17
  39. package/docs/cli.md +13 -13
  40. package/package.json +3 -3
  41. package/skills/check-emitter-parity/SKILL.md +15 -1
  42. package/dist/differ-nZSxhCfC.d.mts +0 -123
  43. package/dist/differ-nZSxhCfC.d.mts.map +0 -1
  44. package/dist/overlay-DWAHPofk.mjs.map +0 -1
  45. package/dist/tree-sitter-CDKm3n64.mjs.map +0 -1
  46. package/dist/types-BcbGLNkh.d.mts.map +0 -1
@@ -1,15 +1,64 @@
1
- import { $ as AdditiveChangeCategory, At as CompatSnapshot, Bt as ALL_LANGUAGE_IDS, Ct as MethodOverlay, Dt as ViolationSeverity, Et as ViolationCategory, Ft as CompatTypeRef, Ht as getDefaultPolicy, It as CompatVisibility, Lt as LanguageId, Mt as CompatStability, Nt as CompatSymbol, Ot as CompatParameter, Pt as CompatSymbolKind, Rt as ParameterSensitivity, St as LanguageHints, Tt as Violation, Ut as mergePolicy, Vt as CompatPolicyHints, _t as ApiProperty, at as CompatFailLevel, bt as DiffResult, ct as defaultSeverityForCategory, dt as ApiClass, et as BreakingChangeCategory, ft as ApiEnum, gt as ApiParam, ht as ApiMethod, it as CompatConfig, jt as CompatSourceKind, kt as CompatPassingStyle, lt as severityMeetsThreshold, mt as ApiInterface, nt as CompatChangeCategory, ot as CompatProvenance, pt as ApiField, rt as CompatChangeSeverity, st as SoftRiskChangeCategory, t as ApiSpec, tt as CompatApproval, ut as Addition, vt as ApiSurface, wt as OverlayLookup, xt as Extractor, yt as ApiTypeAlias, zt as apiSurfaceToSnapshot } from "../types-BcbGLNkh.mjs";
2
- import { a as specDerivedEnumValues, c as specDerivedMethodPaths, d as ClassifiedChange, f as classifyAddedSymbol, i as filterSurface, l as specDerivedNames, m as summarizeChanges, n as diffSnapshots, o as specDerivedFieldPaths, p as classifySymbolChanges, r as diffSurfaces, s as specDerivedHttpKeys, t as CompatDiffResult, u as ClassificationResult } from "../differ-nZSxhCfC.mjs";
3
-
1
+ import { At as ViolationCategory, Bt as CompatVisibility, Ct as ApiTypeAlias, Dt as MethodOverlay, Et as LanguageHints, Ft as CompatSourceKind, Gt as CompatPolicyHints, Ht as ParameterSensitivity, It as CompatStability, Kt as getDefaultPolicy, Lt as CompatSymbol, Mt as CompatParameter, Nt as CompatPassingStyle, Ot as OverlayLookup, Pt as CompatSnapshot, Rt as CompatSymbolKind, St as ApiSurface, Tt as Extractor, Ut as apiSurfaceToSnapshot, Vt as LanguageId, Wt as ALL_LANGUAGE_IDS, _t as ApiField, at as CompatApproval, bt as ApiParam, ct as CompatConfig, dt as SoftRiskChangeCategory, ft as defaultSeverityForCategory, gt as ApiEnum, ht as ApiClass, it as BreakingChangeCategory, jt as ViolationSeverity, kt as Violation, lt as CompatFailLevel, mt as Addition, ot as CompatChangeCategory, pt as severityMeetsThreshold, qt as mergePolicy, rt as AdditiveChangeCategory, st as CompatChangeSeverity, t as ApiSpec, ut as CompatProvenance, vt as ApiInterface, wt as DiffResult, xt as ApiProperty, yt as ApiMethod, zt as CompatTypeRef } from "../types-I7W7CNl1.mjs";
2
+ import { a as ClassifiedChange, c as summarizeChanges, i as ClassificationResult, n as diffSnapshots, o as classifyAddedSymbol, r as diffSurfaces, s as classifySymbolChanges, t as CompatDiffResult } from "../differ-B0DSuKUZ.mjs";
4
3
  //#region src/compat/schema.d.ts
5
4
  /** Current schema version for compatibility snapshots. */
6
- declare const COMPAT_SCHEMA_VERSION = "1";
5
+ export declare const COMPAT_SCHEMA_VERSION = "1";
7
6
  /** Validate that a parsed snapshot has a compatible schema version. */
8
- declare function isCompatibleSchemaVersion(snapshot: {
7
+ export declare function isCompatibleSchemaVersion(snapshot: {
9
8
  schemaVersion?: string;
10
9
  }): boolean;
11
10
  /** Validate the basic structure of a parsed compat snapshot. */
12
- declare function validateSnapshot(data: unknown): data is CompatSnapshot;
11
+ export declare function validateSnapshot(data: unknown): data is CompatSnapshot;
12
+ //#endregion
13
+ //#region src/compat/spec-filter.d.ts
14
+ /**
15
+ * Compute the set of symbol names that are derivable from the OpenAPI spec.
16
+ * Only these names should be compared during compat verification — everything
17
+ * else in the baseline is hand-written and out of scope for generation.
18
+ */
19
+ export declare function specDerivedNames(spec: ApiSpec, hints: LanguageHints): Set<string>;
20
+ /**
21
+ * Compute a map of enum name → set of wire values that appear in the spec.
22
+ * Used by filterSurface to exclude hand-added enum members that aren't in the spec.
23
+ */
24
+ export declare function specDerivedEnumValues(spec: ApiSpec): Map<string, Set<string | number>>;
25
+ /**
26
+ * Compute the set of field paths (e.g., "Organization.name") that are defined
27
+ * in the OpenAPI spec's model schemas. Used by filterSurface to exclude
28
+ * hand-added SDK fields that reference spec-derived types.
29
+ */
30
+ export declare function specDerivedFieldPaths(spec: ApiSpec, hints: LanguageHints): Set<string>;
31
+ /**
32
+ * Compute the set of method paths (e.g., "Auth.authorize") that are defined
33
+ * as operations in the OpenAPI spec's services. Used by filterSurface to
34
+ * exclude hand-written SDK methods that don't correspond to spec operations.
35
+ */
36
+ export declare function specDerivedMethodPaths(spec: ApiSpec): Set<string>;
37
+ /**
38
+ * Compute the set of HTTP operation keys (e.g., "GET /auth/authorize") that
39
+ * exist in the spec. Used for overlay-based method matching.
40
+ */
41
+ export declare function specDerivedHttpKeys(spec: ApiSpec): Set<string>;
42
+ /**
43
+ * Filter an ApiSurface to only include symbols whose names appear in the
44
+ * allowed set. Symbols not in the set are dropped entirely — they won't
45
+ * count toward the total or produce violations.
46
+ *
47
+ * For interfaces: when fieldPaths is provided, only keeps fields that appear
48
+ * in the spec-derived field paths. This prevents false positives from hand-added
49
+ * SDK fields that reference spec-derived types but aren't defined in the spec.
50
+ *
51
+ * For classes: when methodPaths is provided, only keeps methods whose names
52
+ * appear in the spec-derived method paths. This prevents false positives from
53
+ * hand-written SDK methods (e.g., Auth.authorization_url, Webhooks.construct_event)
54
+ * that don't correspond to spec operations. Properties on service classes are
55
+ * also filtered: only UPPER_CASE constants that are spec-derivable are kept.
56
+ */
57
+ export declare function filterSurface(surface: ApiSurface, allowedNames: Set<string>, opts?: {
58
+ fieldPaths?: Set<string>;
59
+ methodPaths?: Set<string>;
60
+ enumValues?: Map<string, Set<string | number>>;
61
+ }): ApiSurface;
13
62
  //#endregion
14
63
  //#region src/compat/concepts.d.ts
15
64
  /** A conceptual change with per-language severity. */
@@ -40,14 +89,14 @@ interface ConceptualRollup {
40
89
  * derived from the symbol, category, and match details. Changes with the
41
90
  * same ID across different languages represent the same conceptual change.
42
91
  */
43
- declare function buildConceptualRollup(perLanguageResults: Array<{
92
+ export declare function buildConceptualRollup(perLanguageResults: Array<{
44
93
  diff: CompatDiffResult;
45
94
  language: LanguageId;
46
95
  }>): ConceptualRollup;
47
96
  /** Get the highest severity across all languages for a conceptual change. */
48
- declare function highestSeverity(change: ConceptualChange): CompatChangeSeverity;
97
+ export declare function highestSeverity(change: ConceptualChange): CompatChangeSeverity;
49
98
  /** Count conceptual changes by highest severity. */
50
- declare function summarizeConceptualChanges(rollup: ConceptualRollup): {
99
+ export declare function summarizeConceptualChanges(rollup: ConceptualRollup): {
51
100
  breaking: number;
52
101
  softRisk: number;
53
102
  additive: number;
@@ -79,9 +128,9 @@ interface CompatReportChange {
79
128
  remediation?: string;
80
129
  }
81
130
  /** Generate a machine-readable compat report from a diff result. */
82
- declare function generateReport(diff: CompatDiffResult, language?: string): CompatReport;
131
+ export declare function generateReport(diff: CompatDiffResult, language?: string): CompatReport;
83
132
  /** Generate a human-readable summary string for terminal output. */
84
- declare function formatHumanSummary(diff: CompatDiffResult, opts?: {
133
+ export declare function formatHumanSummary(diff: CompatDiffResult, opts?: {
85
134
  explain?: boolean;
86
135
  language?: string;
87
136
  }): string;
@@ -95,12 +144,12 @@ interface ConceptualReport {
95
144
  }[];
96
145
  }
97
146
  /** Generate a conceptual cross-language report from multiple per-language results. */
98
- declare function generateConceptualReport(perLanguageResults: Array<{
147
+ export declare function generateConceptualReport(perLanguageResults: Array<{
99
148
  diff: CompatDiffResult;
100
149
  language: LanguageId;
101
150
  }>): ConceptualReport;
102
151
  /** Format a conceptual cross-language summary for terminal output. */
103
- declare function formatConceptualSummary(perLanguageResults: Array<{
152
+ export declare function formatConceptualSummary(perLanguageResults: Array<{
104
153
  diff: CompatDiffResult;
105
154
  language: LanguageId;
106
155
  }>): string;
@@ -121,28 +170,28 @@ interface ApprovalValidation {
121
170
  errors: string[];
122
171
  }
123
172
  /** Validate that an approval is narrow enough to be accepted. */
124
- declare function validateApproval(approval: CompatApproval): ApprovalValidation;
173
+ export declare function validateApproval(approval: CompatApproval): ApprovalValidation;
125
174
  /** Validate all approvals in a config. Returns errors keyed by index. */
126
- declare function validateApprovals(approvals: CompatApproval[]): Map<number, string[]>;
175
+ export declare function validateApprovals(approvals: CompatApproval[]): Map<number, string[]>;
127
176
  /**
128
177
  * Match a classified change against a list of approvals.
129
178
  * Returns the first matching approval, or null if none match.
130
179
  */
131
- declare function matchApproval(change: ClassifiedChange, approvals: CompatApproval[], language: LanguageId): CompatApproval | null;
180
+ export declare function matchApproval(change: ClassifiedChange, approvals: CompatApproval[], language: LanguageId): CompatApproval | null;
132
181
  /**
133
182
  * Apply approvals to a list of changes.
134
183
  * Returns matches for every change (approved or not).
135
184
  */
136
- declare function applyApprovals(changes: ClassifiedChange[], approvals: CompatApproval[], language: LanguageId): ApprovalMatch[];
185
+ export declare function applyApprovals(changes: ClassifiedChange[], approvals: CompatApproval[], language: LanguageId): ApprovalMatch[];
137
186
  /**
138
187
  * Filter changes to only those NOT covered by approvals.
139
188
  * These are the remaining unapproved changes that may cause failure.
140
189
  */
141
- declare function unapprovedChanges(changes: ClassifiedChange[], approvals: CompatApproval[], language: LanguageId): ClassifiedChange[];
190
+ export declare function unapprovedChanges(changes: ClassifiedChange[], approvals: CompatApproval[], language: LanguageId): ClassifiedChange[];
142
191
  //#endregion
143
192
  //#region src/compat/extractor-registry.d.ts
144
- declare function registerExtractor(extractor: Extractor): void;
145
- declare function getExtractor(language: string): Extractor;
193
+ export declare function registerExtractor(extractor: Extractor): void;
194
+ export declare function getExtractor(language: string): Extractor;
146
195
  //#endregion
147
196
  //#region src/compat/overlay.d.ts
148
197
  interface ManifestEntry {
@@ -155,62 +204,62 @@ interface ManifestEntry {
155
204
  bodyFields: string[];
156
205
  queryFields: string[];
157
206
  }
158
- declare function buildOverlayLookup(surface: ApiSurface, manifest?: ManifestEntry[], spec?: ApiSpec, hints?: LanguageHints, options?: {
207
+ export declare function buildOverlayLookup(surface: ApiSurface, manifest?: ManifestEntry[], spec?: ApiSpec, hints?: LanguageHints, options?: {
159
208
  strictModelMatch?: boolean;
160
209
  }): OverlayLookup;
161
210
  /** Check if a classified change is patchable by the overlay loop. */
162
- declare function isPatchableChange(change: ClassifiedChange): boolean;
211
+ export declare function isPatchableChange(change: ClassifiedChange): boolean;
163
212
  /**
164
213
  * Patch overlay with classified changes from a failed verification.
165
214
  * Adds explicit name mappings for symbols that were generated with wrong names.
166
215
  * Returns a new OverlayLookup (immutable).
167
216
  */
168
- declare function patchOverlay(overlay: OverlayLookup, changes: ClassifiedChange[], baseline: ApiSurface): OverlayLookup;
217
+ export declare function patchOverlay(overlay: OverlayLookup, changes: ClassifiedChange[], baseline: ApiSurface): OverlayLookup;
169
218
  //#endregion
170
219
  //#region src/compat/extractors/node.d.ts
171
- declare const nodeExtractor: Extractor;
220
+ export declare const nodeExtractor: Extractor;
172
221
  //#endregion
173
222
  //#region src/compat/extractors/php.d.ts
174
223
  /** Default PHP extractor with generic language hints (no SDK-specific bases). */
175
- declare const phpExtractor: Extractor;
224
+ export declare const phpExtractor: Extractor;
176
225
  //#endregion
177
226
  //#region src/compat/extractors/python.d.ts
178
227
  /** Default Python extractor with generic language hints (no SDK-specific bases). */
179
- declare const pythonExtractor: Extractor;
228
+ export declare const pythonExtractor: Extractor;
180
229
  //#endregion
181
230
  //#region src/compat/extractors/ruby.d.ts
182
- declare const rubyExtractor: Extractor;
231
+ export declare const rubyExtractor: Extractor;
183
232
  //#endregion
184
233
  //#region src/compat/extractors/go.d.ts
185
- declare const goExtractor: Extractor;
234
+ export declare const goExtractor: Extractor;
186
235
  //#endregion
187
236
  //#region src/compat/extractors/rust.d.ts
188
- declare const rustExtractor: Extractor;
237
+ export declare const rustExtractor: Extractor;
189
238
  //#endregion
190
239
  //#region src/compat/extractors/kotlin.d.ts
191
- declare const kotlinExtractor: Extractor;
240
+ export declare const kotlinExtractor: Extractor;
192
241
  //#endregion
193
242
  //#region src/compat/extractors/dotnet.d.ts
194
243
  /** Default DotNet extractor with generic language hints. */
195
- declare const dotnetExtractor: Extractor;
244
+ export declare const dotnetExtractor: Extractor;
196
245
  //#endregion
197
246
  //#region src/compat/extractors/elixir.d.ts
198
- declare const elixirExtractor: Extractor;
247
+ export declare const elixirExtractor: Extractor;
199
248
  //#endregion
200
249
  //#region src/compat/extractors/ios.d.ts
201
- declare const iosExtractor: Extractor;
250
+ export declare const iosExtractor: Extractor;
202
251
  //#endregion
203
252
  //#region src/compat/language-hints.d.ts
204
253
  /**
205
254
  * Node/TypeScript language hints — reference implementation.
206
255
  * Extracted from the hardcoded logic previously in differ.ts and overlay.ts.
207
256
  */
208
- declare const nodeHints: LanguageHints;
257
+ export declare const nodeHints: LanguageHints;
209
258
  /**
210
259
  * Merge partial language hint overrides over nodeHints defaults.
211
260
  * Any hint not provided falls back to the Node/TypeScript implementation.
212
261
  */
213
- declare function resolveHints(overrides: Partial<LanguageHints>): LanguageHints;
262
+ export declare function resolveHints(overrides: Partial<LanguageHints>): LanguageHints;
214
263
  //#endregion
215
- export { ALL_LANGUAGE_IDS, type Addition, type AdditiveChangeCategory, type ApiClass, type ApiEnum, type ApiField, type ApiInterface, type ApiMethod, type ApiParam, type ApiProperty, type ApiSurface, type ApiTypeAlias, type ApprovalMatch, type ApprovalValidation, type BreakingChangeCategory, COMPAT_SCHEMA_VERSION, type ClassificationResult, type ClassifiedChange, type CompatApproval, type CompatChangeCategory, type CompatChangeSeverity, type CompatConfig, type CompatDiffResult, type CompatFailLevel, type CompatParameter, type CompatPassingStyle, type CompatPolicyHints, type CompatProvenance, type CompatReport, type CompatReportChange, type CompatSnapshot, type CompatSourceKind, type CompatStability, type CompatSymbol, type CompatSymbolKind, type CompatTypeRef, type CompatVisibility, type ConceptualChange, type ConceptualReport, type ConceptualRollup, type DiffResult, type Extractor, type LanguageHints, type LanguageId, type MethodOverlay, type OverlayLookup, type ParameterSensitivity, type SoftRiskChangeCategory, type Violation, type ViolationCategory, type ViolationSeverity, apiSurfaceToSnapshot, applyApprovals, buildConceptualRollup, buildOverlayLookup, classifyAddedSymbol, classifySymbolChanges, defaultSeverityForCategory, diffSnapshots, diffSurfaces, dotnetExtractor, elixirExtractor, filterSurface, formatConceptualSummary, formatHumanSummary, generateConceptualReport, generateReport, getDefaultPolicy, getExtractor, goExtractor, highestSeverity, iosExtractor, isCompatibleSchemaVersion, isPatchableChange, kotlinExtractor, matchApproval, mergePolicy, nodeExtractor, nodeHints, patchOverlay, phpExtractor, pythonExtractor, registerExtractor, resolveHints, rubyExtractor, rustExtractor, severityMeetsThreshold, specDerivedEnumValues, specDerivedFieldPaths, specDerivedHttpKeys, specDerivedMethodPaths, specDerivedNames, summarizeChanges, summarizeConceptualChanges, unapprovedChanges, validateApproval, validateApprovals, validateSnapshot };
264
+ export { ALL_LANGUAGE_IDS, type Addition, type AdditiveChangeCategory, type ApiClass, type ApiEnum, type ApiField, type ApiInterface, type ApiMethod, type ApiParam, type ApiProperty, type ApiSurface, type ApiTypeAlias, type ApprovalMatch, type ApprovalValidation, type BreakingChangeCategory, type ClassificationResult, type ClassifiedChange, type CompatApproval, type CompatChangeCategory, type CompatChangeSeverity, type CompatConfig, type CompatDiffResult, type CompatFailLevel, type CompatParameter, type CompatPassingStyle, type CompatPolicyHints, type CompatProvenance, type CompatReport, type CompatReportChange, type CompatSnapshot, type CompatSourceKind, type CompatStability, type CompatSymbol, type CompatSymbolKind, type CompatTypeRef, type CompatVisibility, type ConceptualChange, type ConceptualReport, type ConceptualRollup, type DiffResult, type Extractor, type LanguageHints, type LanguageId, type MethodOverlay, type OverlayLookup, type ParameterSensitivity, type SoftRiskChangeCategory, type Violation, type ViolationCategory, type ViolationSeverity, apiSurfaceToSnapshot, classifyAddedSymbol, classifySymbolChanges, defaultSeverityForCategory, diffSnapshots, diffSurfaces, getDefaultPolicy, mergePolicy, severityMeetsThreshold, summarizeChanges };
216
265
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/compat/schema.ts","../../src/compat/concepts.ts","../../src/compat/report.ts","../../src/compat/approvals.ts","../../src/compat/extractor-registry.ts","../../src/compat/overlay.ts","../../src/compat/extractors/node.ts","../../src/compat/extractors/php.ts","../../src/compat/extractors/python.ts","../../src/compat/extractors/ruby.ts","../../src/compat/extractors/go.ts","../../src/compat/extractors/rust.ts","../../src/compat/extractors/kotlin.ts","../../src/compat/extractors/dotnet.ts","../../src/compat/extractors/elixir.ts","../../src/compat/extractors/ios.ts","../../src/compat/language-hints.ts"],"mappings":";;;;;cAUa,qBAAA;AAGb;AAAA,iBAAgB,yBAAA,CAA0B,QAAA;EAAY,aAAA;AAAA;;iBAKtC,gBAAA,CAAiB,IAAA,YAAgB,IAAA,IAAQ,cAAA;;;;UCJxC,gBAAA;EDD6D;ECG5E,EAAA;EDE8B;ECA9B,MAAA;EDAqE;ECErE,QAAA,EAAU,oBAAA;EDFqC;ECI/C,MAAA,EAAQ,OAAA,CAAQ,MAAA,CAAO,UAAA,EAAY,oBAAA;EDJkC;ECMrE,OAAA;;EAEA,GAAA,EAAK,MAAA;;EAEL,GAAA,EAAK,MAAA;AAAA;;UAIU,gBAAA;EACf,iBAAA,EAAmB,gBAAA;AAAA;;;;;;;;iBAUL,qBAAA,CACd,kBAAA,EAA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;;cCtCd,SAAA,EAAW,aAAA;;;;;iBAuJR,YAAA,CAAa,SAAA,EAAW,OAAA,CAAQ,aAAA,IAAiB,aAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/compat/schema.ts","../../src/compat/spec-filter.ts","../../src/compat/concepts.ts","../../src/compat/report.ts","../../src/compat/approvals.ts","../../src/compat/extractor-registry.ts","../../src/compat/overlay.ts","../../src/compat/extractors/node.ts","../../src/compat/extractors/php.ts","../../src/compat/extractors/python.ts","../../src/compat/extractors/ruby.ts","../../src/compat/extractors/go.ts","../../src/compat/extractors/rust.ts","../../src/compat/extractors/kotlin.ts","../../src/compat/extractors/dotnet.ts","../../src/compat/extractors/elixir.ts","../../src/compat/extractors/ios.ts","../../src/compat/language-hints.ts"],"mappings":";;;;qBAUa;;wBAGG,0BAA0B;EAAY;;;wBAKtC,iBAAiB,gBAAgB,QAAQ;;;;;;;;wBCTzC,iBAAiB,MAAM,SAAS,OAAO,gBAAgB;;;;;wBAsDvD,sBAAsB,MAAM,UAAU,YAAY;;;;;;wBAalD,sBAAsB,MAAM,SAAS,OAAO,gBAAgB;;;;;;wBAqB5D,uBAAuB,MAAM,UAAU;;;;;wBAcvC,oBAAoB,MAAM,UAAU;;;;;;;;;;;;;;;;wBAoDpC,cACd,SAAS,YACT,cAAc,aACd;EACE,aAAa;EACb,cAAc;EACd,aAAa,YAAY;IAE1B;;;;UC7Jc;;EAEf;;EAEA;;EAEA,UAAU;;EAEV,QAAQ,QAAQ,OAAO,YAAY;;EAEnC;;EAEA,KAAK;;EAEL,KAAK;;;UAIU;EACf,mBAAmB;;;;;;;;;wBAUL,sBACd,oBAAoB;EAAQ,MAAM;EAAkB,UAAU;KAC7D;;wBA4Ba,gBAAgB,QAAQ,mBAAmB;;wBAQ3C,2BAA2B,QAAQ;EACjD;EACA;EACA;;;;;UCnEe;EACf;EACA;EACA;IACE;IACA;IACA;;EAEF,SAAS;;;UAIM;EACf,UAAU;EACV,UAAU;EACV;EACA;EACA,YAAY;EACZ,KAAK;EACL,KAAK;EACL;;EAEA;;;wBAIc,eAAe,MAAM,kBAAkB,oBAAoB;;wBAwB3D,mBAAmB,MAAM,kBAAkB;EAAS;EAAmB;;;UA2DtE;EACf;IACE;IACA;IACA,UAAU;IACV,QAAQ,QAAQ,OAAO,YAAY;;;;wBAKvB,yBACd,oBAAoB;EAAQ,MAAM;EAAkB,UAAU;KAC7D;;wBAaa,wBACd,oBAAoB;EAAQ,MAAM;EAAkB,UAAU;;;;;UCzI/C;;EAEf,QAAQ;;EAER,UAAU;;EAEV;;;UAIe;EACf;EACA;;;wBAQc,iBAAiB,UAAU,iBAAiB;;wBA2B5C,kBAAkB,WAAW,mBAAmB;;;;;wBAmBhD,cACd,QAAQ,kBACR,WAAW,kBACX,UAAU,aACT;;;;;wBAaa,eACd,SAAS,oBACT,WAAW,kBACX,UAAU,aACT;;;;;wBAea,kBACd,SAAS,oBACT,WAAW,kBACX,UAAU,aACT;;;wBCpHa,kBAAkB,WAAW;wBAI7B,aAAa,mBAAmB;;;UCD/B;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;wBAoDc,mBACd,SAAS,YACT,WAAW,iBACX,OAAO,SACP,QAAQ,eACR;EAAY;IACX;;wBA6aa,kBAAkB,QAAQ;;;;;;wBAS1B,aAAa,SAAS,eAAe,SAAS,oBAAoB,UAAU,aAAa;;;qBC3e5F,eAAe;;;;qBCqMf,cAAc;;;;qBCwJd,iBAAiB;;;qBC7RjB,eAAe;;;qBC2Df,aAAa;;;qBCjEb,eAAe;;;qBCJf,iBAAiB;;;;qBCsLjB,iBAAiB;;;qBCnKjB,iBAAiB;;;qBCOjB,cAAc;;;;;;;qBCtCd,WAAW;;;;;wBAuJR,aAAa,WAAW,QAAQ,iBAAiB"}
@@ -1,5 +1,5 @@
1
- import { t as safeParse$1, v as ExtractorError } from "../tree-sitter-CDKm3n64.mjs";
2
- import { A as getDefaultPolicy, C as defaultSeverityForCategory, D as isCompatibleSchemaVersion, E as COMPAT_SCHEMA_VERSION, O as validateSnapshot, S as summarizeChanges, T as apiSurfaceToSnapshot, _ as nodeHints, a as registerExtractor, b as classifyAddedSymbol, c as filterSurface, d as specDerivedHttpKeys, f as specDerivedMethodPaths, g as namedTypeWordsOverlap, h as defaultIsNullableOnlyDifference, i as getExtractor, j as mergePolicy, k as ALL_LANGUAGE_IDS, l as specDerivedEnumValues, m as NAMED_TYPE_RE, n as isPatchableChange, o as diffSnapshots, p as specDerivedNames, r as patchOverlay, s as diffSurfaces, t as buildOverlayLookup, u as specDerivedFieldPaths, v as resolveHints, w as severityMeetsThreshold, x as classifySymbolChanges, y as typeExistsInSurface } from "../overlay-DWAHPofk.mjs";
1
+ import { t as safeParse$1, v as ExtractorError } from "../tree-sitter-C7Hk-NDu.mjs";
2
+ import { A as getDefaultPolicy, C as defaultSeverityForCategory, D as isCompatibleSchemaVersion, E as COMPAT_SCHEMA_VERSION, O as validateSnapshot, S as summarizeChanges, T as apiSurfaceToSnapshot, _ as nodeHints, a as registerExtractor, b as classifyAddedSymbol, c as filterSurface, d as specDerivedHttpKeys, f as specDerivedMethodPaths, g as namedTypeWordsOverlap, h as defaultIsNullableOnlyDifference, i as getExtractor, j as mergePolicy, k as ALL_LANGUAGE_IDS, l as specDerivedEnumValues, m as NAMED_TYPE_RE, n as isPatchableChange, o as diffSnapshots, p as specDerivedNames, r as patchOverlay, s as diffSurfaces, t as buildOverlayLookup, u as specDerivedFieldPaths, v as resolveHints, w as severityMeetsThreshold, x as classifySymbolChanges, y as typeExistsInSurface } from "../overlay-Dj3WWlNP.mjs";
3
3
  import path, { basename, dirname, join, relative, resolve } from "node:path";
4
4
  import Parser from "tree-sitter";
5
5
  import ts from "typescript";
@@ -261,7 +261,8 @@ const nodeExtractor = {
261
261
  language: "node",
262
262
  hints: nodeHints,
263
263
  async extractSnapshot(sdkPath) {
264
- return apiSurfaceToSnapshot(await this.extract(sdkPath));
264
+ const surface = await this.extract(sdkPath);
265
+ return apiSurfaceToSnapshot(surface);
265
266
  },
266
267
  async extract(sdkPath) {
267
268
  sdkPath = resolve(sdkPath);
@@ -1092,7 +1093,7 @@ function buildSurface$7(allClasses, hints) {
1092
1093
  * Parser: `php-parser.ts` — tree-sitter-based PHP source analysis
1093
1094
  * Surface: `php-surface.ts` — ApiSurface construction
1094
1095
  */
1095
- const PHP_BODY_TYPES = new Set(["array", "mixed"]);
1096
+ const PHP_BODY_TYPES = /* @__PURE__ */ new Set(["array", "mixed"]);
1096
1097
  const phpHints = {
1097
1098
  stripNullable(type) {
1098
1099
  if (type.startsWith("?")) return type.slice(1);
@@ -1187,7 +1188,8 @@ function createPhpExtractor(hintOverrides) {
1187
1188
  language: "php",
1188
1189
  hints: mergedHints,
1189
1190
  async extractSnapshot(sdkPath) {
1190
- return apiSurfaceToSnapshot(await this.extract(sdkPath));
1191
+ const surface = await this.extract(sdkPath);
1192
+ return apiSurfaceToSnapshot(surface);
1191
1193
  },
1192
1194
  async extract(sdkPath) {
1193
1195
  let sourceDir;
@@ -1565,9 +1567,9 @@ function parsePythonFile(filePath, sdkPath) {
1565
1567
  /** Default model base classes. Overridden by hints.modelBaseClasses when provided. */
1566
1568
  const DEFAULT_MODEL_BASES = [];
1567
1569
  /** Known dict-like base classes (→ ApiInterface). */
1568
- const DICT_BASES = new Set(["TypedDict"]);
1570
+ const DICT_BASES = /* @__PURE__ */ new Set(["TypedDict"]);
1569
1571
  /** Known protocol bases (→ ApiClass as service). */
1570
- const PROTOCOL_BASES = new Set(["Protocol"]);
1572
+ const PROTOCOL_BASES = /* @__PURE__ */ new Set(["Protocol"]);
1571
1573
  /** Default exception bases. Overridden by hints.exceptionBaseClasses when provided. */
1572
1574
  const DEFAULT_EXCEPTION_BASES = ["Exception", "BaseException"];
1573
1575
  /** Check if a class has any of the given base classes (by simple name). */
@@ -1862,7 +1864,7 @@ function buildSurface$6(parsedFiles, hints) {
1862
1864
  * Parser: `python-parser.ts` — tree-sitter-based Python source analysis
1863
1865
  * Surface: `python-surface.ts` — ApiSurface construction
1864
1866
  */
1865
- const PYTHON_PRIMITIVE_TYPES = new Set([
1867
+ const PYTHON_PRIMITIVE_TYPES = /* @__PURE__ */ new Set([
1866
1868
  "str",
1867
1869
  "int",
1868
1870
  "float",
@@ -2030,7 +2032,7 @@ const pythonHints = {
2030
2032
  if (candClean.startsWith("Literal[") && candidateSurface.enums?.[baseClean]) return true;
2031
2033
  if (baseClean === "str" && candidateSurface.enums[candClean]) return true;
2032
2034
  if (candClean === "str" && candidateSurface.enums?.[baseClean]) return true;
2033
- const numericTypes = new Set(["int", "float"]);
2035
+ const numericTypes = /* @__PURE__ */ new Set(["int", "float"]);
2034
2036
  if (numericTypes.has(baseClean) && numericTypes.has(candClean)) return true;
2035
2037
  if (NAMED_TYPE_RE.test(baseClean) && NAMED_TYPE_RE.test(candClean)) {
2036
2038
  if (typeExistsInSurface(candClean, candidateSurface)) {
@@ -2052,7 +2054,7 @@ const pythonHints = {
2052
2054
  if (!namedTypeWordsOverlap(baseRet, candRet)) return false;
2053
2055
  }
2054
2056
  }
2055
- const bodyDictTypes = new Set([
2057
+ const bodyDictTypes = /* @__PURE__ */ new Set([
2056
2058
  "dict[str, Any]",
2057
2059
  "Dict[str, Any]",
2058
2060
  "dict"
@@ -2080,7 +2082,8 @@ function createPythonExtractor(hintOverrides) {
2080
2082
  language: "python",
2081
2083
  hints: mergedHints,
2082
2084
  async extractSnapshot(sdkPath) {
2083
- return apiSurfaceToSnapshot(await this.extract(sdkPath));
2085
+ const surface = await this.extract(sdkPath);
2086
+ return apiSurfaceToSnapshot(surface);
2084
2087
  },
2085
2088
  async extract(sdkPath) {
2086
2089
  const sourceRoot = findPythonSourceRoot(sdkPath);
@@ -2365,7 +2368,6 @@ function extractMethodParams(methodNode) {
2365
2368
  });
2366
2369
  break;
2367
2370
  }
2368
- default: break;
2369
2371
  }
2370
2372
  return params;
2371
2373
  }
@@ -2502,7 +2504,8 @@ const rubyExtractor = {
2502
2504
  language: "ruby",
2503
2505
  hints: rubyHints,
2504
2506
  async extractSnapshot(sdkPath) {
2505
- return apiSurfaceToSnapshot(await this.extract(sdkPath));
2507
+ const surface = await this.extract(sdkPath);
2508
+ return apiSurfaceToSnapshot(surface);
2506
2509
  },
2507
2510
  async extract(sdkPath) {
2508
2511
  const libPath = resolve(sdkPath, "lib");
@@ -2844,7 +2847,8 @@ function buildReturnType(returnTypes) {
2844
2847
  }
2845
2848
  /** Get the package directory name from a source file relative path. */
2846
2849
  function getPackageDirName(relPath) {
2847
- return basename(dirname(relPath)) || "root";
2850
+ const dir = dirname(relPath);
2851
+ return basename(dir) || "root";
2848
2852
  }
2849
2853
  /**
2850
2854
  * When multiple packages define the same exported symbol, qualify with the
@@ -3094,7 +3098,8 @@ const goExtractor = {
3094
3098
  }
3095
3099
  },
3096
3100
  async extractSnapshot(sdkPath) {
3097
- return apiSurfaceToSnapshot(await this.extract(sdkPath));
3101
+ const surface = await this.extract(sdkPath);
3102
+ return apiSurfaceToSnapshot(surface);
3098
3103
  },
3099
3104
  async extract(sdkPath) {
3100
3105
  const goFiles = walkGoFiles(sdkPath);
@@ -3586,7 +3591,8 @@ const rustExtractor = {
3586
3591
  }
3587
3592
  },
3588
3593
  async extractSnapshot(sdkPath) {
3589
- return apiSurfaceToSnapshot(await this.extract(sdkPath));
3594
+ const surface = await this.extract(sdkPath);
3595
+ return apiSurfaceToSnapshot(surface);
3590
3596
  },
3591
3597
  async extract(sdkPath) {
3592
3598
  const rsFiles = walkRustFiles(sdkPath);
@@ -4024,7 +4030,8 @@ const kotlinExtractor = {
4024
4030
  }
4025
4031
  },
4026
4032
  async extractSnapshot(sdkPath) {
4027
- return apiSurfaceToSnapshot(await this.extract(sdkPath));
4033
+ const surface = await this.extract(sdkPath);
4034
+ return apiSurfaceToSnapshot(surface);
4028
4035
  },
4029
4036
  async extract(sdkPath) {
4030
4037
  const ktFiles = walkKotlinFiles(sdkPath);
@@ -4360,7 +4367,7 @@ function buildSurface$2(allClasses, allEnums, _hints) {
4360
4367
  * Parser: `dotnet-parser.ts` — regex-based C# source analysis
4361
4368
  * Surface: `dotnet-surface.ts` — ApiSurface construction
4362
4369
  */
4363
- const DOTNET_PRIMITIVE_TYPES = new Set([
4370
+ const DOTNET_PRIMITIVE_TYPES = /* @__PURE__ */ new Set([
4364
4371
  "string",
4365
4372
  "int",
4366
4373
  "long",
@@ -4494,7 +4501,7 @@ const dotnetHints = {
4494
4501
  if (namedTypeWordsOverlap(baseClean, candClean)) return true;
4495
4502
  }
4496
4503
  }
4497
- const numericTypes = new Set([
4504
+ const numericTypes = /* @__PURE__ */ new Set([
4498
4505
  "int",
4499
4506
  "long",
4500
4507
  "float",
@@ -4520,7 +4527,8 @@ function createDotnetExtractor(hintOverrides) {
4520
4527
  language: "dotnet",
4521
4528
  hints: mergedHints,
4522
4529
  async extractSnapshot(sdkPath) {
4523
- return apiSurfaceToSnapshot(await this.extract(sdkPath));
4530
+ const surface = await this.extract(sdkPath);
4531
+ return apiSurfaceToSnapshot(surface);
4524
4532
  },
4525
4533
  async extract(sdkPath) {
4526
4534
  let sourceDir;
@@ -5016,7 +5024,8 @@ const elixirExtractor = {
5016
5024
  }
5017
5025
  },
5018
5026
  async extractSnapshot(sdkPath) {
5019
- return apiSurfaceToSnapshot(await this.extract(sdkPath));
5027
+ const surface = await this.extract(sdkPath);
5028
+ return apiSurfaceToSnapshot(surface);
5020
5029
  },
5021
5030
  async extract(sdkPath) {
5022
5031
  let sourceDir;
@@ -5069,7 +5078,7 @@ const elixirExtractor = {
5069
5078
  * member raw values in `init(rawValue:)` / `var rawValue` switches rather
5070
5079
  * than `case name = "value"` declarations.
5071
5080
  */
5072
- const SKIP_DIRS = new Set([
5081
+ const SKIP_DIRS = /* @__PURE__ */ new Set([
5073
5082
  "build",
5074
5083
  "Tests",
5075
5084
  "DerivedData",
@@ -5643,7 +5652,8 @@ const iosExtractor = {
5643
5652
  }
5644
5653
  },
5645
5654
  async extractSnapshot(sdkPath) {
5646
- return apiSurfaceToSnapshot(await this.extract(sdkPath));
5655
+ const surface = await this.extract(sdkPath);
5656
+ return apiSurfaceToSnapshot(surface);
5647
5657
  },
5648
5658
  async extract(sdkPath) {
5649
5659
  const swiftFiles = walkSwiftFiles(sdkPath);