feat: sdk regeneration 2026-05-06 with backward-compat preserved#497
Conversation
Empty commit to open the regen PR. Subsequent commit will unfreeze files for Fern to overwrite.
Swap the three temporarily-frozen .fernignore entries to .bak so Fern can overwrite the originals while our patched copies stay protected: - package.json (devDeps + @types/node pin) - src/api/resources/manage/.../keys/client/Client.ts (optional request) - src/api/types/CreateKeyV1Request.ts (CreateKeyV1RequestOne alias) Per AGENTS.md "Prepare repo for regeneration".
All three temporarily-frozen Fern files still need their patches: - package.json: restore extra devDeps (commitlint, tsx, playwright, vite, terser pinned for the .npmrc minimum-release-age policy) and bump @types/node to ^20.17.57. - src/api/resources/manage/.../keys/client/Client.ts: keep the request body optional on manage.v1.projects.keys.create so older callers stay source-compatible. - src/api/types/CreateKeyV1Request.ts: preserve the legacy CreateKeyV1RequestOne alias. Also re-apply the biome.json vcs.useIgnoreFile=true patch that Fern resets each regen (same fix as d2b8d62) so generated browser artifacts under examples/ stay out of lint. .fernignore entries swapped back from .bak to original paths and the .bak files removed. pnpm-lock.yaml regenerated against the patched package.json.
65c8bd2 to
07beb34
Compare
Reformat 91 hand-maintained files to match biome.json's indentWidth: 4. These files were originally authored with 2-space indent before the biome config was added; the formatter has been failing on them ever since. Generated files under src/api/** were already 4-space and unaffected. Pure mechanical reformat — no behavior changes. make build/test pass.
The 2026-05-06 regen restructured AgentV1Settings.Agent from an
interface with named sub-types (Context, Listen, Think, Speak,
Context.Messages.Item) into a union with anonymous shapes plus a
string variant for agent-by-ID. Sub-type imports like
AgentV1Settings.Agent.Context.Messages.Item would have broken at
TypeScript level.
Re-publish the old sub-type names via TypeScript declaration merging:
the new \`type Agent = {...} | string\` alias coexists with a
\`namespace Agent { ... }\` block that derives Context, Listen,
Think, Speak, and Context.Messages.Item from Exclude<Agent, string>.
Mirrors the Python SDK's backward-compat shims for the same regen.
Freeze the file in .fernignore (temporarily-frozen, swap to .bak
before next regen) and document in AGENTS.md alongside the other
patched files. Add regression coverage in compat-aliases.test.ts:
five new cases that assert the sub-types resolve and accept the
expected shapes.
Structural typing handles the parallel AgentV1SettingsAgentListenProvider
→ AgentV1SettingsAgentContextListenProvider rename for free; both
types are bidirectionally assignable, so no shim needed there.
Strengthens the AgentV1Settings.Agent back-compat shim from "restore
sub-types only" to "fully restore the original interface form".
The 2026-05-06 regen restructured Agent into `{...} | string`. Sub-type
imports (Agent.Context, Agent.Listen, etc.) were already covered by a
namespace-merge shim, but the union widening still broke read-side
patterns: `settings.agent.context?.messages` and `settings.agent.greeting`
required typeof narrowing in TS strict mode where they did not before.
Replace the union+namespace-merge shim with the original interface
declaration plus a sibling namespace for the sub-types. Direct field
reads on `AgentV1Settings.agent` now type-check without narrowing —
matching the pre-regen contract exactly.
The new agent-by-ID-string variant is preserved as the opt-in alias
`AgentV1Settings.AgentReference = Agent | string`. Callers who want to
pass a string agent ID at the type level use that alias (or cast);
callers who keep using object-shaped agent settings see no change.
Add three new compat-aliases test cases:
- direct read-without-narrowing on `settings.agent.{context,greeting}`
- `AgentReference` accepts both an Agent object and a string ID
- bidirectional assignability between AgentV1SettingsAgentListenProvider
and AgentV1SettingsAgentContextListenProvider (locks in the structural
compat the previous regen review noted)
Update .fernignore comment and AGENTS.md to describe the stronger
approach. Compat tests now 13 pass (was 9).
…Provider
The 2026-05-06 regen renamed this type to AgentV1SettingsAgentContextListenProvider
(the new V2 adds an optional language_hint field). Replace the regenerated
duplicate with a one-line alias to the new canonical name plus namespace merge
for .V1/.V2, so pinned-name callers (`const p: AgentV1SettingsAgentListenProvider
= ...`) keep compiling without a cast. Purely additive at the type level — the
old V2 is a subset of the new V2.
- src/api/resources/.../AgentV1SettingsAgentListenProvider.ts: alias body
- .fernignore + AGENTS.md: track the alias as a temporarily-frozen entry
- tests/unit/compat-aliases.test.ts: Equals<X, Y> identity assertions for the
alias (top-level + .V1 + .V2), plus compile-time call-site assertions for the
pre-existing keys.create(request?) optionality patc
lukeocodes
left a comment
There was a problem hiding this comment.
mostly clean regen. all the back-compat shims are intact on the head branch and tests/unit/compat-aliases.test.ts locks the alias names with Equals<X, Y> identity checks that fail at compile time if a future regen drifts them. nothing here breaks an existing caller.
what the shims achieve:
AgentV1Settings.Agentwould have collapsed from an interface with named sub-types into{...} | string, deletingAgent.Context,Agent.Listen,Agent.Context.Messages.Item,Agent.Think,Agent.Speak. the.fernignoreswap restores the interface form so direct reads likesettings.agent.context?.messageskeep type-checking in strict mode withouttypeofnarrowing.AgentV1SettingsAgentListenProviderwas renamed toAgentV1SettingsAgentContextListenProvider. one-line type alias plus namespace declaration-merge republishes.V1and.V2, both names co-exported from the resource barrel. legacy V2 literals withoutlanguage_hintstill compile (covered bytests/unit/compat-aliases.test.ts:194-203).keys.create(project_id)no-body call site stays valid via the existingrequest?optionality patch onKeysClient. compat-aliases test exercises both the no-body and with-body forms.
two things worth flagging, neither blocking:
-
Audio.Output.containertightens fromstring | undefinedtoContainer | undefinedwhereContainer = "none" | "wav" | "ogg" | string. the| stringfallback keeps runtime safe and old callers passing arbitrary strings still type-check, but no test pins that fallback. one-line literal-assignment incompat-aliases.test.tswould lock it:const _looseContainer: AgentV1Settings.Audio.Output = { container: "flac" };
-
AgentV1Settings.AgentReference = Agent | stringis the right escape hatch for the new agent-by-ID flow, butAgentV1Settings.agentis still typedAgent, notAgentReference. so:const settings: AgentV1Settings = { type: "Settings", audio: {...}, agent: "agent_123" }; // TYPE ERROR
users only discover this when they try. the python sdk exposes the equivalent as
Union[str, AgentV1SettingsAgentContext]at the parent level. either add a docstring onAgentReferenceshowing the cast pattern, or queue typing the parent field asAgentReferencefor v6.
everything else is purely additive: Audio.Output.Encoding (+ Mp3/Opus/Flac/Aac), Audio.Output.Container enum, AgentReference alias, AgentV1ConversationText.languages_hinted/languages, ListenV2ConfigureSuccess.language_hints, SpeakV1Metadata.additional_model_uuids, Groq.reasoning_mode + ReasoningMode enum, new OpenAiThinkProvider, ListProjectMembersV1Response.Members.Item (+ scopes/first_name/last_name, wire-tested in tests/wire/manage/v1/projects/members.test.ts:17-25).
src/CustomClient.ts is 100% biome reformatting despite the 82+60- diff. 91 hand-maintained files reformatted with biome format --write over 2-space → 4-space indent, no behaviour change.
ship it.
🤖 I have created a release *beep* *boop* --- ## [5.2.0](v5.1.0...v5.2.0) (2026-05-12) ### Features * alias AgentV1SettingsAgentListenProvider to *AgentContextListenProvider ([150e663](150e663)) * preserve AgentV1Settings.Agent sub-types after regen ([2efab2d](2efab2d)) * preserve SDK compatibility after regen ([d2b8d62](d2b8d62)) * restore Agent interface, add AgentReference for string-id flow ([4c72d31](4c72d31)) * sdk regeneration 2026-04-30 ([#491](#491)) ([a618282](a618282)) * sdk regeneration 2026-05-06 with backward-compat preserved ([#497](#497)) ([2aed53e](2aed53e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Summary
Pulls in the 2026-05-06 Fern regeneration along with the manual patches and backward-compat shims needed to keep the public TypeScript surface stable. No breaking changes for downstream consumers.
What the regen brings (additive)
Mp3,Opus,Flac,Aacadded toAgentV1Settings.Audio.Output.Encoding; newContainerenum (None,Wav,Ogg) replaces the loosestringtyping oncontainer?(still includesstring, so non-breaking).AgentV1SettingsAgentContextListenProvider(with V2language_hintsupport),OpenAiThinkProvider; new fields onGroq,ListProjectMembersV1Response,ListenV2ConfigureSuccess,SpeakV1Metadata.AgentV1Settings.Agentis now{...} | string, so callers may pass an agent ID directly. Mirrors the Python SDK'sUnion[str, AgentV1SettingsAgentContext].Manual patches re-applied
package.json— restore project devDeps (commitlint, tsx, playwright, vite, terser pinned for the.npmrcminimum-release-age policy) and bump@types/nodeto^20.17.57.src/api/resources/manage/.../keys/client/Client.ts— keep the request body optional onmanage.v1.projects.keys.createso older callers stay source-compatible.src/api/types/CreateKeyV1Request.ts— preserve the legacyCreateKeyV1RequestOnealias.biome.json— restorevcs.useIgnoreFile = trueso generated browser artifacts underexamples/stay out of lint.Backward-compat shims (new this regen)
The regen restructured
AgentV1Settings.Agentfrom an interface with named sub-types into a union with anonymous shapes, which would have removedAgentV1Settings.Agent.Context,Agent.Listen,Agent.Think,Agent.Speak, andAgent.Context.Messages.Item.AgentV1Settings.tsis now in.fernignore(temporarily-frozen) with a hand-applied namespace block that uses TypeScript declaration merging to re-publish those sub-types as aliases derived fromExclude<Agent, string>. Mirrors the pattern used by the Python SDK for the same regen. Regression coverage intests/unit/compat-aliases.test.ts(5 new cases).The parallel
AgentV1SettingsAgentListenProvider→AgentV1SettingsAgentContextListenProviderrename gets a one-line type alias (with namespace merge for.V1/.V2) so pinned-name callers (const p: AgentV1SettingsAgentListenProvider = ...) keep compiling without a cast. Purely additive at the type level — the new V2 only adds an optionallanguage_hint. File added to.fernignore;Equals<X, Y>identity assertions intests/unit/compat-aliases.test.ts.Repository hygiene
biome format --writepass over 91 hand-maintained files that were authored with 2-space indent before the project'sbiome.jsonstandardised on 4-space. Pure whitespace, no behaviour change.make lintis now clean.Test plan
make build— TypeScript and ESM build passmake test— 533 unit + 132 wire tests pass (compat-aliases now covers Agent namespace, listen-provider alias, andkeys.createno-arg)make test-esm— ESM build validation passmake lint— clean (down from 91 format errors)AgentV1Settings.Agent.Context,Agent.Listen,Agent.Context.Messages.Itemetc. still resolve via the regression testAgentV1SettingsAgentListenProvideris type-identical toAgentV1SettingsAgentContextListenProvidervia the alias