Skip to content

Sync TypeScript Server SDK docs - #830

Open
hey-august wants to merge 16 commits into
mainfrom
august-20261022-sync-ts
Open

hey-august wants to merge 16 commits into
mainfrom
august-20261022-sync-ts

Conversation

@hey-august

@hey-august hey-august commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Description

  • Syncs the TypeScript Server SDK reference to @signalwire/sdk v3.7.1. It was synced to an unreleased commit between 2.0.5 and 3.5.0.
    • New pages: AgentBase.addPerCallConfig, onCallStart, onCallEnd, mount; FunctionResult.changeVoice, rpcAiGlobalData; ChatGateway; HandoffRouter; AIChatClient.rawPost; the capabilities helpers; the post-prompt helpers; validateWebhookSignatureSha256; the sw-tsdocs CLI.
    • Updated pages: dynamic config, tool handlers, onSummary, validateBasicAuth, enableMcpServer, defineContexts, addLanguage, hold, rpcAiMessage, tap, joinConference, pay, SemanticGate (visualInput), Bedrock, LiveWire, prefabs, skills, swaig-test, environment variables, serverless, AgentServer, Relay stream/userEvent.
    • DataMap correction: body() sets the webhook's params, which is sent as a POST body. A webhook's output, expressions, and foreach read response fields from the root (${temp}) and arguments as ${input.args.x}, so 20 examples change.
  • Bumps the TypeScript pin in the 9 capability guides from @signalwire/sdk@2.0.5 to 3.7.1 and fixes the samples 3.x breaks:
    • REST: positional calling.dial, transfer, stream/streamStop, phoneNumbers.setRelayTopic, and fabric.tokens.createSubscriberToken; swmlScripts.create takes contents as a string; list data is optional.
    • Relay: nested ringback items; typed call.device and collect results; record()'s missing max_length.
    • Builder: enter_queue, stream, stop_stream, and connect's stream settings fail the SDK's schema validation, so those samples skip validation for that verb only, as the rule's builder-gap convention says.
  • Updates sdk-source-sync.json to the v3.7.1 tag commit.
  • mdx-capability-guides.md: the TypeScript pin is now 3.7.1, and a new rule requires each pinned Server SDK version to match the release recorded in sdk-source-sync.json, bumped together in one PR.
  • Semantic gates guide: the TypeScript SDK accepts visual_input from 3.7.1.

Notes for reviewers

  • Open PRs still pin @signalwire/sdk@2.0.5: Add Transcribe Calls guide #829, Add send and receive messages guide #819, Add Text-to-speech on a call guide #789, Add AI sidecar guide to the SWML guides #783. Each needs the 3.7.1 pin and the same sample fixes before or after merge.
  • SDK inconsistencies worked around. Each is verified against the platform and the API spec, and each is worth an upstream issue:
    • The SDK's SWML schema requires transfer_after_bridge on enter_queue, which the platform doesn't. This repo's generated specs/swml/tsp-output still lists that field too, though the .tsp source was updated.
    • The SDK's SWML schema rejects the stream and stop_stream verbs and connect's codec, realtime, and name.
    • Relay record()'s type omits max_length, which the platform honors.
    • SwmlBuilder.build() returns a type that calling.dial's swml option rejects under --strict, and that option's type isn't exported. Samples pass JSON.parse(builder.render()).
    • The SDK's JSDoc says Relay dial maxDuration is in minutes. The platform reads seconds, and the reference keeps seconds.
  • Bedrock voices: joanna was replaced with tiffany in the examples, since the valid Bedrock voices are tiffany, matthew, amy, lupe, and carlos.
  • Not covered: WebService and ServerlessAdapter.createCgiHandler have no TypeScript reference pages; that gap predates this sync. The Python reference may have the same DataMap template issue; out of scope here.

Preview

Guides:

  • /docs/platform/voice/make-and-receive-calls
  • /docs/platform/voice/forward-calls
  • /docs/platform/voice/record-calls
  • /docs/platform/voice/call-queues
  • /docs/platform/voice/call-streaming
  • /docs/platform/voice/machine-detection
  • /docs/platform/voice/sip-refer
  • /docs/platform/voice/whatsapp/receive-calls
  • /docs/platform/fax/send-and-receive-faxes
  • /docs/platform/ai/semantic-gates

Reference (main entry points):

  • /docs/server-sdks/reference/typescript/agents/agent-base
  • /docs/server-sdks/reference/typescript/agents/chat-gateway
  • /docs/server-sdks/reference/typescript/agents/handoff-router
  • /docs/server-sdks/reference/typescript/agents/function-result
  • /docs/server-sdks/reference/typescript/agents/data-map
  • /docs/server-sdks/reference/typescript/agents/semantic-gate
  • /docs/server-sdks/reference/typescript/agents/cli/sw-tsdocs
  • /docs/server-sdks/reference/typescript/core/capabilities
  • /docs/server-sdks/reference/typescript/core/post-prompt
  • /docs/server-sdks/reference/typescript/agents/configuration/environment-variables

Type of Change

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

Related Issues

Follow-up to #829, which pins @signalwire/sdk@2.0.5 and notes that this PR bumps the pin and syncs the TypeScript reference.

Testing

Behavior verified against the platform and the API spec.

  • Every TypeScript block in the 9 guides, complete samples and fragments, passes tsc --strict against an installed @signalwire/sdk@3.7.1. One existing JavaScript sample (call streaming, Hono server) has a checkJs-only type mismatch under both 2.0.5 and 3.7.1; it runs as-is.
  • Ran every TypeScript SWML builder chain against 3.7.1 and diffed the output against the JSON sample beside it: all match. Compared rendered SWML between 2.0.5 and 3.7.1 as well; the only differences are AgentBase rendering the prompt as POM and adding per-function token URLs.
  • New and changed reference-page examples type-check against 3.7.1. Internal links resolve to existing slugs.
  • yarn fern-md-check: all MDX files valid.

Tests

  • Added/updated unit tests
  • Tested manually
  • Tested with live SignalWire credentials (if applicable)

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

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

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.

1 participant