@workos/oagen 0.26.0 → 0.27.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/dist/cli/index.mjs +55 -1
- package/dist/cli/index.mjs.map +1 -1
- package/dist/compat/index.d.mts +6 -3
- package/dist/compat/index.d.mts.map +1 -1
- package/dist/compat/index.mjs +656 -39
- package/dist/compat/index.mjs.map +1 -1
- package/dist/{differ-HVvbbyUV.d.mts → differ-BoYl2n6Y.d.mts} +2 -2
- package/dist/{differ-HVvbbyUV.d.mts.map → differ-BoYl2n6Y.d.mts.map} +1 -1
- package/dist/index.d.mts +35 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +74 -1
- package/dist/index.mjs.map +1 -1
- package/dist/{overlay-DcvsIx5P.mjs → overlay-jsSkFJ2g.mjs} +21 -2
- package/dist/overlay-jsSkFJ2g.mjs.map +1 -0
- package/dist/scripts/smoke/baseline.mjs +35 -0
- package/dist/scripts/smoke/baseline.mjs.map +1 -1
- package/dist/smoke.mjs +35 -0
- package/dist/smoke.mjs.map +1 -1
- package/dist/{types-owWZiSwD.d.mts → types-CIAqYpcV.d.mts} +11 -3
- package/dist/types-CIAqYpcV.d.mts.map +1 -0
- package/dist/verify/index.d.mts +2 -2
- package/dist/verify/index.mjs +1 -1
- package/docs/agents/emitters.md +17 -0
- package/examples/reference-emitter/src/generators/client.ts +5 -1
- package/examples/reference-emitter/src/generators/models.ts +3 -2
- package/examples/reference-emitter/src/generators/resources.ts +2 -2
- package/package.json +1 -1
- package/skills/check-emitter-parity/SKILL.md +11 -0
- package/dist/overlay-DcvsIx5P.mjs.map +0 -1
- package/dist/types-owWZiSwD.d.mts.map +0 -1
|
@@ -23,7 +23,7 @@ declare const ALL_LANGUAGE_IDS: readonly LanguageId[];
|
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/compat/ir.d.ts
|
|
25
25
|
/** Language identifier for emitter targets. */
|
|
26
|
-
type LanguageId = 'node' | 'php' | 'python' | 'ruby' | 'go' | 'kotlin' | 'dotnet' | 'elixir' | 'rust';
|
|
26
|
+
type LanguageId = 'node' | 'php' | 'python' | 'ruby' | 'go' | 'kotlin' | 'dotnet' | 'elixir' | 'rust' | 'ios';
|
|
27
27
|
/** A full compatibility snapshot of an SDK's public API surface. */
|
|
28
28
|
interface CompatSnapshot {
|
|
29
29
|
schemaVersion: string;
|
|
@@ -64,6 +64,10 @@ interface CompatSymbol {
|
|
|
64
64
|
typeRef?: CompatTypeRef;
|
|
65
65
|
/** Value for enum member symbols. */
|
|
66
66
|
value?: string | number;
|
|
67
|
+
/** Whether a callable is a static/type-level method. Absent when the
|
|
68
|
+
* extractor does not capture staticness; the classifier only compares
|
|
69
|
+
* it when both snapshots define it, so older snapshots never diff. */
|
|
70
|
+
isStatic?: boolean;
|
|
67
71
|
/** Relative path to the source file where this symbol is defined. */
|
|
68
72
|
sourceFile?: string;
|
|
69
73
|
}
|
|
@@ -131,6 +135,10 @@ interface ApiMethod {
|
|
|
131
135
|
params: ApiParam[];
|
|
132
136
|
returnType: string;
|
|
133
137
|
async: boolean;
|
|
138
|
+
/** Whether this is a static/type-level method. Absent when the extractor
|
|
139
|
+
* does not capture staticness; the differ only compares it when both
|
|
140
|
+
* sides define it. */
|
|
141
|
+
isStatic?: boolean;
|
|
134
142
|
}
|
|
135
143
|
interface ApiParam {
|
|
136
144
|
name: string;
|
|
@@ -275,7 +283,7 @@ interface DiffResult {
|
|
|
275
283
|
//#endregion
|
|
276
284
|
//#region src/compat/config.d.ts
|
|
277
285
|
/** Breaking change categories — changes that break callers. */
|
|
278
|
-
type BreakingChangeCategory = 'symbol_removed' | 'symbol_renamed' | 'parameter_removed' | 'parameter_renamed' | 'parameter_requiredness_increased' | 'parameter_type_narrowed' | 'parameter_position_changed_order_sensitive' | 'constructor_position_changed_order_sensitive' | 'named_arg_name_removed' | 'keyword_name_removed' | 'overload_removed' | 'union_wrapper_migration_without_compat_alias' | 'field_type_changed' | 'return_type_changed' | 'enum_member_value_changed';
|
|
286
|
+
type BreakingChangeCategory = 'symbol_removed' | 'symbol_renamed' | 'parameter_removed' | 'parameter_renamed' | 'parameter_requiredness_increased' | 'parameter_type_narrowed' | 'parameter_position_changed_order_sensitive' | 'constructor_position_changed_order_sensitive' | 'named_arg_name_removed' | 'keyword_name_removed' | 'overload_removed' | 'union_wrapper_migration_without_compat_alias' | 'field_type_changed' | 'return_type_changed' | 'enum_member_value_changed' | 'staticness_changed';
|
|
279
287
|
/** Soft-risk change categories — may affect callers depending on usage. */
|
|
280
288
|
type SoftRiskChangeCategory = 'parameter_added_non_terminal_optional' | 'constructor_reordered_named_friendly' | 'default_value_changed' | 'wrapper_stricter_than_previous_sdk_but_matches_spec' | 'doc_surface_drift';
|
|
281
289
|
/** Additive change categories — safe to ship. */
|
|
@@ -802,4 +810,4 @@ interface SuccessResponse {
|
|
|
802
810
|
}
|
|
803
811
|
//#endregion
|
|
804
812
|
export { AdditiveChangeCategory as $, collectEnumRefs as A, CompatSnapshot as At, ErrorPolicy as B, ALL_LANGUAGE_IDS as Bt, Service as C, MethodOverlay as Ct, UnionType as D, ViolationSeverity as Dt, TypeRef as E, ViolationCategory as Et, validateModelHints as F, CompatTypeRef as Ft, RequestGuardPolicy as G, LogEvent as H, getDefaultPolicy as Ht, walkTypeRef as I, CompatVisibility as It, TelemetryPolicy as J, RetryPolicy as K, AiAgentEnvVar as L, LanguageId as Lt, collectModelRefs as M, CompatStability as Mt, collectRequestBodyModels as N, CompatSymbol as Nt, assertNever as O, CompatParameter as Ot, mapTypeRef as P, CompatSymbolKind as Pt, mergeSdkBehavior as Q, BackoffStrategy as R, ParameterSensitivity as Rt, ServerEntry as S, LanguageHints as St, TypeParam as T, Violation as Tt, LoggingPolicy as U, mergePolicy as Ut, IdempotencyPolicy as V, CompatPolicyHints as Vt, PaginationPolicy as W, UserAgentPolicy as X, TimeoutPolicy as Y, defaultSdkBehavior as Z, Parameter as _, ApiProperty as _t, EnumRef as a, CompatFailLevel as at, PrimitiveType as b, DiffResult as bt, Field as c, defaultSeverityForCategory as ct, MapType as d, ApiClass as dt, BreakingChangeCategory as et, Model as f, ApiEnum as ft, PaginationMeta as g, ApiParam as gt, Operation as h, ApiMethod as ht, Enum as i, CompatConfig as it, collectFieldDependencies as j, CompatSourceKind as jt, assignModelsToServices as k, CompatPassingStyle as kt, HttpMethod as l, severityMeetsThreshold as lt, NullableType as m, ApiInterface as mt, ArrayType as n, CompatChangeCategory as nt, EnumValue as o, CompatProvenance as ot, ModelRef as p, ApiField as pt, SdkBehavior as q, AuthScheme as r, CompatChangeSeverity as rt, ErrorResponse as s, SoftRiskChangeCategory as st, ApiSpec as t, CompatApproval as tt, LiteralType as u, Addition as ut, ParameterGroup as v, ApiSurface as vt, SuccessResponse as w, OverlayLookup as wt, SecurityRequirement as x, Extractor as xt, ParameterGroupVariant as y, ApiTypeAlias as yt, DeepPartial as z, apiSurfaceToSnapshot as zt };
|
|
805
|
-
//# sourceMappingURL=types-
|
|
813
|
+
//# sourceMappingURL=types-CIAqYpcV.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-CIAqYpcV.d.mts","names":[],"sources":["../src/compat/policy.ts","../src/compat/ir.ts","../src/compat/types.ts","../src/compat/config.ts","../src/ir/sdk-behavior.ts","../src/ir/types.ts"],"mappings":";;UAWiB,iBAAA;EAYf;EAVA,oBAAA;EAUgB;EARhB,uBAAA;EAkG8B;EAhG9B,gCAAA;EAgGuE;EA9FvE,qCAAA;EA8F+B;EA5F/B,qBAAA;EA4FuE;EA1FvE,gBAAA;AAAA;;iBA0Fc,gBAAA,CAAiB,QAAA,EAAU,UAAA,GAAa,iBAAA;;iBAKxC,WAAA,CAAY,QAAA,EAAU,iBAAA,EAAmB,SAAA,EAAW,OAAA,CAAQ,iBAAA,IAAqB,iBAAA;;cAKpF,gBAAA,WAA2B,UAAA;;;;KChH5B,UAAA;;UAGK,cAAA;EACf,aAAA;EACA,MAAA;IAC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AA,EAAK,SAAA,EAAW,WAAA,EAAa,CAAA,KAAM,CAAA;EAC3C,KAAA,GAAQ,GAAA,EAAK,QAAA,KAAa,CAAA;EAC1B,IAAA,GAAO,GAAA,EAAK,OAAA,KAAY,CAAA;EACxB,KAAA,GAAQ,GAAA,EAAK,SAAA,EAAW,cAAA,EAAgB,CAAA,OAAQ,CAAA;EAChD,QAAA,GAAW,GAAA,EAAK,YAAA,EAAc,WAAA,EAAa,CAAA,KAAM,CAAA;EACjD,OAAA,GAAU,GAAA,EAAK,WAAA,KAAgB,CAAA;EAC/B,GAAA,GAAM,GAAA,EAAK,OAAA,EAAS,WAAA,EAAa,CAAA,EAAG,SAAA,GAAY,CAAA,KAAM,CAAA;AAAA,IAEvD,CAAA;;;;iBAmCa,gBAAA,CAAiB,GAAA,EAAK,OAAA;;;;iBAStB,eAAA,CAAgB,GAAA,EAAK,OAAA;AHjUrC;;;;AAAA,iBG2UgB,wBAAA,CAAyB,KAAA,EAAO,KAAA;EAC9C,MAAA,EAAQ,GAAA;EACR,KAAA,EAAO,GAAA;AAAA;;;;;;AHpUT;;;;;;;;;iBGmWgB,sBAAA,CACd,MAAA,EAAQ,KAAA,IACR,QAAA,EAAU,OAAA,IACV,KAAA,GAAQ,MAAA,mBACP,GAAA;;;;;;;iBAuEa,kBAAA,CAAmB,MAAA,EAAQ,KAAA,IAAS,QAAA,EAAU,OAAA,IAAW,KAAA,EAAO,MAAA;;AHlahF;;iBG0bgB,wBAAA,CAAyB,QAAA,EAAU,OAAA,KAAY,GAAA;AAAA,UAc9C,aAAA;EACf,UAAA;EACA,IAAA,GAAO,OAAA;AAAA;;UAIQ,eAAA;EACf,UAAA;EACA,IAAA,EAAM,OAAA;AAAA"}
|
package/dist/verify/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Tt as Violation, Vt as CompatPolicyHints, t as ApiSpec, vt as ApiSurface } from "../types-
|
|
2
|
-
import { t as CompatDiffResult } from "../differ-
|
|
1
|
+
import { Tt as Violation, Vt as CompatPolicyHints, t as ApiSpec, vt as ApiSurface } from "../types-CIAqYpcV.mjs";
|
|
2
|
+
import { t as CompatDiffResult } from "../differ-BoYl2n6Y.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/verify/types.d.ts
|
|
5
5
|
interface VerifyDiagnostics {
|
package/dist/verify/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as CommandError } from "../tree-sitter-C6HB4OrC.mjs";
|
|
2
2
|
import { a as MANIFEST_FILENAME, i as generate, n as getEmitter, t as diffSpecs } from "../diff-B9wlNAVX.mjs";
|
|
3
|
-
import { A as getDefaultPolicy, T as apiSurfaceToSnapshot, c as filterSurface, f as specDerivedMethodPaths, i as getExtractor, j as mergePolicy, l as specDerivedEnumValues, n as isPatchableChange, o as diffSnapshots, p as specDerivedNames, r as patchOverlay, t as buildOverlayLookup, u as specDerivedFieldPaths } from "../overlay-
|
|
3
|
+
import { A as getDefaultPolicy, T as apiSurfaceToSnapshot, c as filterSurface, f as specDerivedMethodPaths, i as getExtractor, j as mergePolicy, l as specDerivedEnumValues, n as isPatchableChange, o as diffSnapshots, p as specDerivedNames, r as patchOverlay, t as buildOverlayLookup, u as specDerivedFieldPaths } from "../overlay-jsSkFJ2g.mjs";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { execFileSync } from "node:child_process";
|
package/docs/agents/emitters.md
CHANGED
|
@@ -34,6 +34,23 @@ Language-specific extras already exist in some emitters:
|
|
|
34
34
|
|
|
35
35
|
IR names use PascalCase. Each emitter is responsible for converting names through its local `naming.ts`.
|
|
36
36
|
|
|
37
|
+
## Escaping Spec-Controlled Free-Text
|
|
38
|
+
|
|
39
|
+
Free-text spec fields (schema/field/operation `description`, and `info.title`, which becomes the default namespace) are **attacker-influenceable data**. Interpolating them verbatim into generated source lets a crafted spec break out of the syntactic context and emit arbitrary top-level code — which then runs when the generated files are imported during `oagen generate` → `oagen verify`, and ships to consumers if published.
|
|
40
|
+
|
|
41
|
+
The core package exports two helpers for this. Apply them at **every** site where spec free-text is interpolated into output:
|
|
42
|
+
|
|
43
|
+
- `escapeBlockComment(text)` — neutralizes `*/` before it goes inside a `/** ... */` doc comment.
|
|
44
|
+
- `sanitizeIdentifier(text)` — strips characters that would break out of an identifier position (e.g. a class name built from the namespace). Already-valid identifiers pass through unchanged.
|
|
45
|
+
|
|
46
|
+
Both helpers are **JS/TS-block-comment / JS-identifier specific**. Emitters for other languages must apply language-appropriate escaping instead of, or in addition to, these:
|
|
47
|
+
|
|
48
|
+
- Python docstrings (`"""`) — escape/neutralize an embedded `"""`.
|
|
49
|
+
- Ruby (`=begin`/`=end`, `#`) and other line-comment styles — a newline in the text can start a new source line; escape newlines or emit one comment marker per line.
|
|
50
|
+
- Kotlin/Java KDoc/Javadoc (`/** */`) — same terminator hazard as `escapeBlockComment`.
|
|
51
|
+
|
|
52
|
+
When adding a new interpolation site, treat "does this field originate from the spec?" as the trigger for escaping — not "is this field usually a description?".
|
|
53
|
+
|
|
37
54
|
## Verifying Backwards Compatibility
|
|
38
55
|
|
|
39
56
|
When regenerating an SDK for a language that already has a published SDK, verify that the generated output preserves the existing public API surface.
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { ApiSpec, GeneratedFile, EmitterContext } from '@workos/oagen';
|
|
2
|
+
import { sanitizeIdentifier } from '@workos/oagen';
|
|
2
3
|
import { tsClassName } from '../naming.js';
|
|
3
4
|
|
|
4
5
|
export function generateClient(spec: ApiSpec, ctx: EmitterContext): GeneratedFile[] {
|
|
5
6
|
const lines: string[] = [];
|
|
6
|
-
|
|
7
|
+
// `namespacePascal` defaults to the spec's `info.title` when no explicit
|
|
8
|
+
// namespace is given — attacker-influenceable free-text flowing into an
|
|
9
|
+
// identifier position. Sanitize it so it cannot break out of the class name.
|
|
10
|
+
const className = `${sanitizeIdentifier(ctx.namespacePascal)}Client`;
|
|
7
11
|
|
|
8
12
|
// Import resources
|
|
9
13
|
for (const service of spec.services) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Model, GeneratedFile, EmitterContext } from '@workos/oagen';
|
|
2
|
+
import { escapeBlockComment } from '@workos/oagen';
|
|
2
3
|
import { tsTypeName, tsPropertyName } from '../naming.js';
|
|
3
4
|
import { toTsType } from '../type-mapper.js';
|
|
4
5
|
|
|
@@ -9,7 +10,7 @@ export function generateModels(models: Model[], _ctx: EmitterContext): Generated
|
|
|
9
10
|
|
|
10
11
|
for (const model of models) {
|
|
11
12
|
if (model.description) {
|
|
12
|
-
lines.push(`/** ${model.description} */`);
|
|
13
|
+
lines.push(`/** ${escapeBlockComment(model.description)} */`);
|
|
13
14
|
}
|
|
14
15
|
lines.push(`export interface ${tsTypeName(model.name)} {`);
|
|
15
16
|
for (const field of model.fields) {
|
|
@@ -17,7 +18,7 @@ export function generateModels(models: Model[], _ctx: EmitterContext): Generated
|
|
|
17
18
|
const tsType = toTsType(field.type);
|
|
18
19
|
const optional = field.required ? '' : '?';
|
|
19
20
|
if (field.description) {
|
|
20
|
-
lines.push(` /** ${field.description} */`);
|
|
21
|
+
lines.push(` /** ${escapeBlockComment(field.description)} */`);
|
|
21
22
|
}
|
|
22
23
|
lines.push(` ${tsName}${optional}: ${tsType};`);
|
|
23
24
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Service, GeneratedFile, EmitterContext } from '@workos/oagen';
|
|
2
|
-
import { planOperation } from '@workos/oagen';
|
|
2
|
+
import { planOperation, escapeBlockComment } from '@workos/oagen';
|
|
3
3
|
import { tsClassName, tsMethodName } from '../naming.js';
|
|
4
4
|
import { toTsType } from '../type-mapper.js';
|
|
5
5
|
|
|
@@ -39,7 +39,7 @@ export function generateResources(services: Service[], _ctx: EmitterContext): Ge
|
|
|
39
39
|
const asyncPrefix = plan.isAsync ? 'async ' : '';
|
|
40
40
|
|
|
41
41
|
if (op.description) {
|
|
42
|
-
lines.push(` /** ${op.description} */`);
|
|
42
|
+
lines.push(` /** ${escapeBlockComment(op.description)} */`);
|
|
43
43
|
}
|
|
44
44
|
lines.push(` ${asyncPrefix}${method}(${paramStr}): Promise<${returnType}> {`);
|
|
45
45
|
lines.push(` // Production emitters generate real HTTP calls here`);
|
package/package.json
CHANGED
|
@@ -148,6 +148,17 @@ Use `Grep` with patterns like `\.description`, `\.readOnly`, `\.writeOnly`, `\.d
|
|
|
148
148
|
|
|
149
149
|
If the emitter source contains comments like `// @oagen-ignore: <field>` or similar documented justifications for skipping a field, mark those fields as "intentionally skipped" rather than "missing." These are acceptable gaps — not every field applies to every language.
|
|
150
150
|
|
|
151
|
+
### 3d: Free-Text Escaping (security)
|
|
152
|
+
|
|
153
|
+
Spec free-text fields (`description` on model/field/operation/parameter/enum-value, and `info.title` when it becomes the namespace) are attacker-influenceable. An emitter that interpolates them verbatim into output can be made to emit arbitrary source — a code-execution vector during `oagen generate` → `oagen verify` and in published SDKs.
|
|
154
|
+
|
|
155
|
+
For every covered free-text field, check that the emitter escapes it at the interpolation site:
|
|
156
|
+
|
|
157
|
+
- **Doc comments** — the field must be wrapped so a comment terminator cannot break out. The core exports `escapeBlockComment` for JS/TS-style `/** */` comments; it is **specific to languages whose block comments end at `*/`** (JS, TS, Java, C#, Kotlin, Go). Emitters for other comment syntaxes need their own escaping: Python `"""` docstrings, Ruby `#`/`=begin` and other line-comment styles (where an embedded newline starts a new source line), etc.
|
|
158
|
+
- **Identifier positions** — free-text flowing into a class/variable name (notably `info.title` → namespace → client class) must be run through `sanitizeIdentifier` (or an equivalent) so it cannot break out of the declaration.
|
|
159
|
+
|
|
160
|
+
Report a covered-but-unescaped free-text field as a **HIGH-priority security gap**, distinct from a missing-coverage gap: the field is handled, but unsafely.
|
|
161
|
+
|
|
151
162
|
## Step 4: Produce Gap Analysis
|
|
152
163
|
|
|
153
164
|
Output a structured report grouped by priority tier:
|