@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.
- package/README.md +4 -12
- package/dist/cli/index.d.mts +1 -1
- package/dist/cli/index.mjs +2885 -651
- package/dist/cli/index.mjs.map +1 -1
- package/dist/compat/index.d.mts +85 -36
- package/dist/compat/index.d.mts.map +1 -1
- package/dist/compat/index.mjs +33 -23
- package/dist/compat/index.mjs.map +1 -1
- package/dist/{diff-BO5FieX5.mjs → diff-CAsypxXV.mjs} +107 -89
- package/dist/{diff-BO5FieX5.mjs.map → diff-CAsypxXV.mjs.map} +1 -1
- package/dist/differ-B0DSuKUZ.d.mts +72 -0
- package/dist/differ-B0DSuKUZ.d.mts.map +1 -0
- package/dist/index.d.mts +129 -61
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2877 -546
- package/dist/index.mjs.map +1 -1
- package/dist/{overlay-DWAHPofk.mjs → overlay-Dj3WWlNP.mjs} +44 -38
- package/dist/overlay-Dj3WWlNP.mjs.map +1 -0
- package/dist/scripts/smoke/baseline.d.mts +1 -1
- package/dist/scripts/smoke/baseline.mjs +2740 -527
- package/dist/scripts/smoke/baseline.mjs.map +1 -1
- package/dist/scripts/smoke/sdk-test.d.mts +1 -1
- package/dist/scripts/smoke/sdk-test.mjs +4 -2
- package/dist/scripts/smoke/sdk-test.mjs.map +1 -1
- package/dist/smoke.d.mts +251 -36
- package/dist/smoke.d.mts.map +1 -1
- package/dist/smoke.mjs +2740 -527
- package/dist/smoke.mjs.map +1 -1
- package/dist/{tree-sitter-CDKm3n64.mjs → tree-sitter-C7Hk-NDu.mjs} +35 -7
- package/dist/tree-sitter-C7Hk-NDu.mjs.map +1 -0
- package/dist/{types-BcbGLNkh.d.mts → types-I7W7CNl1.d.mts} +219 -9
- package/dist/types-I7W7CNl1.d.mts.map +1 -0
- package/dist/verify/index.d.mts +7 -8
- package/dist/verify/index.d.mts.map +1 -1
- package/dist/verify/index.mjs +24 -14
- package/dist/verify/index.mjs.map +1 -1
- package/docs/architecture/emitter-contract.md +1 -0
- package/docs/architecture/ir-types.md +170 -17
- package/docs/cli.md +13 -13
- package/package.json +3 -3
- package/skills/check-emitter-parity/SKILL.md +15 -1
- package/dist/differ-nZSxhCfC.d.mts +0 -123
- package/dist/differ-nZSxhCfC.d.mts.map +0 -1
- package/dist/overlay-DWAHPofk.mjs.map +0 -1
- package/dist/tree-sitter-CDKm3n64.mjs.map +0 -1
- package/dist/types-BcbGLNkh.d.mts.map +0 -1
package/dist/compat/index.d.mts
CHANGED
|
@@ -1,15 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
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,
|
|
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":"
|
|
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"}
|
package/dist/compat/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as safeParse$1, v as ExtractorError } from "../tree-sitter-
|
|
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-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
5655
|
+
const surface = await this.extract(sdkPath);
|
|
5656
|
+
return apiSurfaceToSnapshot(surface);
|
|
5647
5657
|
},
|
|
5648
5658
|
async extract(sdkPath) {
|
|
5649
5659
|
const swiftFiles = walkSwiftFiles(sdkPath);
|