Skip to content

Commit a618282

Browse files
authored
feat: sdk regeneration 2026-04-30 (#491)
## Summary - regenerate the JavaScript SDK to `5.1.1` with the updated Fern generator output - add the regenerated public API surface for `listen.v2.language_hint` and voice-agent inject `behavior`, and serialize repeated `listen.v2` array query params correctly - restore JavaScript/TypeScript source compatibility for `manage.v1.projects.keys.create(projectId)` and the legacy `CreateKeyV1RequestOne` type alias, and document/freeze those manual patches for future regens - make Biome honor `.gitignore` and clean up the hand-maintained browser examples so generated browser artifacts do not fail lint - fix flaky browser example tests that logged immediate placeholder output before the final success state was rendered ## Verification - `pnpm build` ✅ - `pnpm lint` ✅ (`353` warnings, `3` infos, no error-level diagnostics) - `DEEPGRAM_PROJECT_ID=3d8f1f2b-92d0-4663-8b7a-6ae230fb2a20 pnpm test` ✅ (`674/674` tests passing)
2 parents b766920 + b139966 commit a618282

58 files changed

Lines changed: 534 additions & 313 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/deepgram-js-maintaining-sdk/SKILL.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,16 @@ How to identify:
5454

5555
Current temporarily frozen entries:
5656

57-
- **None right now.** `AGENTS.md` explicitly says all current `.fernignore` entries are permanently frozen.
57+
- `package.json` — Fern's generator produces a minimal `devDependencies` set; we add the following:
58+
- `@commitlint/cli`, `@commitlint/config-conventional` — used by `.github/workflows/pr-title-check.yml`
59+
- `tsx` — used by `make examples` / `make example-N`
60+
- `playwright` — used by `make browser`
61+
- `vite`, `terser` — pinned not because we use them directly, but because `.npmrc` sets `minimum-release-age=14400` (10 days) + `strict-peer-dependencies=true`. Without an explicit pin, pnpm tries to satisfy `vitest`'s and `webpack`'s wide peer ranges by picking the latest, which is often too new and the install fails. Pinning forces mature versions. Update the pins (and bump comments below) when you want to move forward.
62+
- `@types/node` pinned forward to `^20.17.57` to match the Node features the SDK uses (relax this if Fern's default ever advances past Node 20).
63+
64+
`pnpm-lock.yaml` is **not** frozen — let Fern regenerate it, then run `pnpm install` after re-applying the `package.json` patch and the lockfile rebuilds correctly.
65+
- `src/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.ts` — keep `manage.v1.projects.keys.create(projectId, request?)` source-compatible with older callers that omit the request body, while still allowing the regenerated request form.
66+
- `src/api/types/CreateKeyV1Request.ts` — preserve the old exported `CreateKeyV1RequestOne` alias alongside `CreateKeyV1Request` so existing type imports keep compiling.
5867

5968
If you patch a generated file in the future, add it to `.fernignore` with a comment explaining the patch and update this skill plus `AGENTS.md`.
6069

@@ -109,6 +118,7 @@ Relevant underlying commands today:
109118
3. **The repo ships both CJS and ESM.** Validate both outputs after generator changes.
110119
4. **Browser behavior matters.** The wrapper intentionally diverges for browser WebSocket auth because browsers cannot send arbitrary socket headers.
111120
5. **`.agents/` is permanently frozen in `.fernignore`.** Treat these skills as hand-written documentation during regeneration; Fern will not touch the folder. Keep this note aligned with `AGENTS.md` whenever the frozen-file list changes.
121+
6. **`biome.json` should honor `.gitignore`.** Generated browser artifacts like `examples/browser/deepgram.js` are produced by `make browser-serve`; keep them gitignored and let Biome's VCS ignore integration exclude them from linting.
112122

113123
## Source-of-truth note
114124

.fern/metadata.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"cliVersion": "4.92.0",
2+
"cliVersion": "4.107.0",
33
"generatorName": "fernapi/fern-typescript-sdk",
4-
"generatorVersion": "3.65.5",
4+
"generatorVersion": "3.66.4",
55
"generatorConfig": {
66
"enableInlineTypes": true,
77
"namespaceExport": "Deepgram",
@@ -11,10 +11,8 @@
1111
"shouldGenerateWebsocketClients": true,
1212
"enableForwardCompatibleEnums": true
1313
},
14-
"originGitCommit": "0d16d3b0d2f3da69dc058ea78f235b2b11288371",
14+
"originGitCommit": "05bd7add608b322a6278fa20da22f2ed501d50ef",
1515
"originGitCommitIsDirty": true,
1616
"invokedBy": "manual",
17-
"requestedVersion": null,
18-
"ciProvider": null,
19-
"sdkVersion": "5.1.0"
17+
"sdkVersion": "5.1.1"
2018
}

.fernignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ webpack.config.js
1515
# Tests
1616
tests/browser
1717
tests/esm-build.test.ts
18+
tests/manual
1819
tests/unit/agent-providers.test.ts
1920
tests/unit/async-send-finalize.test.ts
2021
tests/unit/baseurl-priority.test.ts
22+
tests/unit/compat-aliases.test.ts
2123
tests/unit/custom-baseurl.test.ts
2224
tests/unit/custom-client.test.ts
2325
tests/unit/error-handling.test.ts
@@ -52,3 +54,21 @@ AGENTS.md
5254
.claude
5355
.agents
5456
.mcp.json
57+
58+
# Unfreeze for regen (temporarily frozen — see AGENTS.md)
59+
# package.json: Fern's generator produces a minimal devDependencies set; we add
60+
# @commitlint/cli, @commitlint/config-conventional (PR title workflow), tsx (make
61+
# examples), playwright (make browser), vite + terser (pinned for the .npmrc
62+
# minimum-release-age + strict-peer-deps policy, not used directly), and bump
63+
# @types/node forward to ^20. Swap to package.json.bak before regen.
64+
package.json
65+
66+
# src/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.ts:
67+
# keep manage.v1.projects.keys.create(request?) source-compatible with older
68+
# callers that omit the request body. Swap to .bak before regen.
69+
src/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.ts
70+
71+
# src/api/types/CreateKeyV1Request.ts: preserve the old exported
72+
# CreateKeyV1RequestOne alias alongside CreateKeyV1Request. Swap to .bak before
73+
# regen.
74+
src/api/types/CreateKeyV1Request.ts

AGENTS.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ Current permanently frozen files:
3030
- `webpack.config.js` — browser build configuration
3131
- `tests/browser` — browser-specific test suite
3232
- `tests/esm-build.test.ts` — ESM build validation test
33-
- `tests/unit/*` — hand-written unit tests
33+
- `tests/manual` — hand-written manual smoke scripts (e.g. `tests/manual/compat.ts` for the legacy `CreateKeyV1RequestOne` alias). Not picked up by vitest; run with `pnpm tsx`.
34+
- `tests/unit/*` — hand-written unit tests (includes `compat-aliases.test.ts`, the regression test that proves the legacy `CreateKeyV1RequestOne` type still resolves to `CreateKeyV1Request`)
3435
- `tests/wire/websocket` — hand-written WebSocket wire tests
3536
- `tests/wire/listen/v1/transcription.test.ts` — hand-written wire test
3637
- `vitest.config.mts` — test configuration
@@ -51,7 +52,16 @@ How to identify:
5152
- Our version is a **modified copy** of what Fern generates (e.g., fixed types, added optional defaults, broadened a union type)
5253

5354
Current temporarily frozen files:
54-
- _(none currently — all `.fernignore` entries are permanently frozen)_
55+
- `package.json` — Fern's generator produces a minimal `devDependencies` set; we add the following:
56+
- `@commitlint/cli`, `@commitlint/config-conventional` — used by `.github/workflows/pr-title-check.yml`
57+
- `tsx` — used by `make examples` / `make example-N`
58+
- `playwright` — used by `make browser`
59+
- `vite`, `terser` — pinned not because we use them directly, but because `.npmrc` sets `minimum-release-age=14400` (10 days) + `strict-peer-dependencies=true`. Without an explicit pin, pnpm tries to satisfy `vitest`'s and `webpack`'s wide peer ranges by picking the latest, which is often too new and the install fails. Pinning forces mature versions. Update the pins (and bump comments below) when you want to move forward.
60+
- `@types/node` pinned forward to `^20.17.57` to match the Node features the SDK uses (relax this if Fern's default ever advances past Node 20).
61+
62+
`pnpm-lock.yaml` is **not** frozen — let Fern regenerate it, then run `pnpm install` after re-applying the `package.json` patch and the lockfile rebuilds correctly.
63+
- `src/api/resources/manage/resources/v1/resources/projects/resources/keys/client/Client.ts` — keep `manage.v1.projects.keys.create(projectId, request?)` source-compatible with older callers that omit the request body, while still allowing the regenerated request form.
64+
- `src/api/types/CreateKeyV1Request.ts` — preserve the old exported `CreateKeyV1RequestOne` alias alongside `CreateKeyV1Request` so existing type imports keep compiling.
5565

5666
**Note:** If you need to patch a Fern-generated file, add it to `.fernignore` with a comment describing the patch, and add it to the "temporarily frozen" list above.
5767

biome.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
33
"root": true,
44
"vcs": {
5-
"enabled": false
5+
"clientKind": "git",
6+
"enabled": true,
7+
"useIgnoreFile": true
68
},
79
"files": {
810
"ignoreUnknown": true,

examples/09-voice-agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async function voiceAgent() {
5353
console.error("Error:", error);
5454
});
5555

56-
let keepAliveInterval;
56+
let keepAliveInterval: ReturnType<typeof setInterval> | undefined;
5757
deepgramConnection.on("close", () => {
5858
console.log("Connection closed");
5959
if (keepAliveInterval) {

examples/36-agent-inject-message.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ async function agentInjectMessage() {
7878
console.error("Error:", error);
7979
});
8080

81-
let keepAliveInterval;
81+
let keepAliveInterval: ReturnType<typeof setInterval> | undefined;
8282
deepgramConnection.on("close", () => {
8383
console.log("Connection closed");
8484
if (keepAliveInterval) {

examples/browser/01-authentication-api-key.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ <h1>Authentication with API Key</h1>
6565
<p>This example demonstrates authentication through the proxy server. The API key is configured via the DEEPGRAM_API_KEY environment variable on the proxy server.</p>
6666

6767
<div class="container">
68-
<button id="runExample">Run Example</button>
68+
<button type="button" id="runExample">Run Example</button>
6969
</div>
7070

7171
<div id="output"></div>
@@ -121,4 +121,3 @@ <h1>Authentication with API Key</h1>
121121
</script>
122122
</body>
123123
</html>
124-

examples/browser/02-authentication-access-token.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ <h1>Authentication with Access Token</h1>
6565
<p>Access tokens are temporary (30-second TTL) and must be obtained using an API key. The API key is configured via the DEEPGRAM_API_KEY environment variable on the proxy server. Uses Bearer scheme in Authorization header.</p>
6666

6767
<div class="container">
68-
<button id="runExample">Run Example</button>
68+
<button type="button" id="runExample">Run Example</button>
6969
</div>
7070

7171
<div id="output"></div>
@@ -165,4 +165,3 @@ <h1>Authentication with Access Token</h1>
165165
</script>
166166
</body>
167167
</html>
168-

examples/browser/03-authentication-proxy.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <h1>Proxy Authentication</h1>
6969
<p class="warning"><strong>Important:</strong> The proxy server sets the Authorization header and forwards requests to Deepgram's API.</p>
7070

7171
<div class="container">
72-
<button id="runExample">Run Example</button>
72+
<button type="button" id="runExample">Run Example</button>
7373
</div>
7474

7575
<div id="output"></div>
@@ -120,4 +120,3 @@ <h1>Proxy Authentication</h1>
120120
</script>
121121
</body>
122122
</html>
123-

0 commit comments

Comments
 (0)