Update TypeScript Server SDK tech docs - #668
Conversation
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>
There was a problem hiding this comment.
The pageSize → page_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.mdxandrest/overview.mdx, wrap the existingconsole.loginif ('from' in log) { ... }. The declared VoiceLog union includes discarded records without address fields, causing TS2339. Inrest/logs/voice/list.mdx, useif ('duration' in call) { ... }around the print instead: Fabric records also lackduration. That example will skip both discarded and Fabric records. - Recording fields: in
rest/recordings/list.mdx, replace the print withconsole.log(rec.id, rec.duration_in_seconds, rec.status);. The SDK Recording model uses those names;durationandstatecause TS7053. - AI-agent name: in
rest/overview.mdx, replaceagent.namewithagent.display_name. AIAgentResponse definesdisplay_name;namecauses TS2339. - SWML rendering: in
agents/swml-builder/add-verb.mdx, replacebuilder.renderDocument()withbuilder.render(). SwmlBuilder exposesrender(); the old call throws becauserenderDocumentdoes 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 acontrolIdbefore the command, pass it as the request optioncontrol_id: controlId, and removeconst controlId = result.control_id. Preserve that ID for subsequent control commands. CallResponse has nocontrol_idfield (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.
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>
|
The follow-up items raised in the review have been addressed in Two of the issues were more extensive than the review stated:
The |
Description
Sync the TypeScript server SDK reference to
signalwire-typescript@6a2aa09.client.compatREST reference (namespace dropped from the SDK); redirect old URLs to the REST overviewmessages,projects,RequestOptions, and the expandedRestErrorAIChatClient,BedrockAgent, theswaig-testCLI,ParameterSchema,defineSkillTool, and newAgentBase/context methodsplayTTS,detectAnsweringMachine,waitForAnswered, …), constants, and Fabric device support indial/connectSIGNALWIRE_API_TOKENrenameNotes
BedrockAgent.maxTokensis stored but not applied by the TS SDK; documented as such. See also: SWML spec: hold action is missingstepandtimeout_step#666Type of Change
Related Issues
Testing
yarn fern-md-checkpasses (2783 files)yarn fern-checkclean apart from the unauthenticated redirects check6a2aa09Checklist