Skip to content

Update TypeScript Server SDK tech docs - #668

Open
hey-august wants to merge 20 commits into
mainfrom
august-20260904-update-typescript-docs
Open

Update TypeScript Server SDK tech docs#668
hey-august wants to merge 20 commits into
mainfrom
august-20260904-update-typescript-docs

Conversation

@hey-august

Copy link
Copy Markdown
Collaborator

Description

Sync the TypeScript server SDK reference to signalwire-typescript@6a2aa09.

  • Remove the client.compat REST reference (namespace dropped from the SDK); redirect old URLs to the REST overview
  • Add REST messages, projects, RequestOptions, and the expanded RestError
  • Add AIChatClient, BedrockAgent, the swaig-test CLI, ParameterSchema, defineSkillTool, and new AgentBase/context methods
  • Add typed Relay call helpers (playTTS, detectAnsweringMachine, waitForAnswered, …), constants, and Fabric device support in dial/connect
  • Correct calling/datasphere signatures, skill and tool defaults, and the SIGNALWIRE_API_TOKEN rename
  • Raise the Node floor to 22

Notes

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Code cleanup / refactor

Related Issues

Testing

  • yarn fern-md-check passes (2783 files)
  • yarn fern-check clean apart from the unauthenticated redirects check
  • Every signature and example verified against the SDK source at 6a2aa09

Checklist

  • I have read the CONTRIBUTING guidelines
  • My code follows the project's style guidelines
  • I have added tests for my changes (if applicable)
  • I have updated documentation (if applicable)
  • All existing tests pass

hey-august and others added 14 commits September 6, 2026 03:13
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…atures

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…t options

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…d ParameterSchema

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ent docs

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ssing members

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

@hey-august hey-august changed the title Update TypeScript SDK tech docs Update TypeScript Server SDK tech docs Sep 8, 2026

@Devon-White Devon-White left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pageSizepage_size edits are correct. My earlier inline comments on voice-log and recording fields concerned unchanged surrounding code, not defects in those edits. The same scope mistake affected the renderDocument() and result.control_id comments. Those threads have been removed from the inline review.

The two remaining inline findings concern new examples added by this PR: Bedrock prompt handling and the ParameterSchema/defineTool type mismatch. Each includes a replacement for the code it discusses.

Pre-existing issues — separate follow-up work, not regressions introduced by this PR. Retained here so the SDK-alignment findings are not lost. Paths below are relative to reference/typescript/:

  • Voice logs: in rest/logs/voice/index.mdx and rest/overview.mdx, wrap the existing console.log in if ('from' in log) { ... }. The declared VoiceLog union includes discarded records without address fields, causing TS2339. In rest/logs/voice/list.mdx, use if ('duration' in call) { ... } around the print instead: Fabric records also lack duration. That example will skip both discarded and Fabric records.
  • Recording fields: in rest/recordings/list.mdx, replace the print with console.log(rec.id, rec.duration_in_seconds, rec.status);. The SDK Recording model uses those names; duration and state cause TS7053.
  • AI-agent name: in rest/overview.mdx, replace agent.name with agent.display_name. AIAgentResponse defines display_name; name causes TS2339.
  • SWML rendering: in agents/swml-builder/add-verb.mdx, replace builder.renderDocument() with builder.render(). SwmlBuilder exposes render(); the old call throws because renderDocument does not exist. The PR's validation-warning edit is correct.
  • Call control IDs: in rest/calling/{play,stream,tap,collect-start-input-timers}.mdx, declare a controlId before the command, pass it as the request option control_id: controlId, and remove const controlId = result.control_id. Preserve that ID for subsequent control commands. CallResponse has no control_id field (TS2339); the SDK accepts it in request options. Update the play/stream/tap prose to describe supplying the ID rather than receiving it in the HTTP response. The PR's positional-argument corrections are correct.

Source references are pinned to SDK commit 6a2aa09. These follow-up findings were discovered during the earlier example typecheck; they should not have been presented as faults in unrelated changed lines.

Comment thread fern/products/server-sdks/pages/reference/typescript/agents/parameter-schema.mdx Outdated
hey-august and others added 6 commits September 9, 2026 14:53
defineTool() takes the flat property map, not the wrapped
{ type: 'object', properties, required } object that build() returns,
so the example failed to typecheck (TS2322). Spread properties and
required separately and say so in the intro.

Addresses review on #668.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
promptAddSection() takes an options object, not a string. The example
also combined systemPrompt with an added section, but raw prompt text
takes precedence and the section was never rendered. Build both
instructions as sections and document the precedence rule.

Addresses review on #668.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ields

VoiceLog is a union that includes discarded records with no address
fields and Fabric records with no duration, so narrow with an `in`
check before printing. Recording exposes duration_in_seconds and
status, not duration and state. AIAgentResponse exposes display_name,
not name. Each example failed to typecheck against SDK 6a2aa09.

Addresses review follow-ups on #668.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ment

The SDK removed both TypeScript-only methods in favor of the Python
parity names build() and render(); calling renderDocument() throws.
Switch every example to render()/build(), remove the two method pages,
redirect their URLs to build and render, and stop describing build and
render as aliases.

Addresses review follow-ups on #668.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…reading it

CallResponse has no control_id field, so the play, stream, tap, record,
and collectStartInputTimers examples failed with TS2339. The ID is a
client-chosen request option: declare it, pass it as control_id, and
keep it for later control commands. Reword the play, stream, tap,
record, collect, and detect prose to match.

Addresses review follow-ups on #668.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@hey-august

Copy link
Copy Markdown
Collaborator Author

The follow-up items raised in the review have been addressed in eff40ec9e3, c9a69d9143, and c6f1c853fb.

Two of the issues were more extensive than the review stated:

  • getDocument()/renderDocument() were removed from the SDK entirely, so every SwmlBuilder example now uses build()/render() and the two method pages are gone with redirects.
  • record, collect, and detect had the same control_id problem and got the same fix.

The defineTool type fix for the wrapped builder output is an SDK change, filed here: signalwire/signalwire-typescript#184

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants