Skip to content

Pin the Calls SDK prerelease and add call-link commands - #60

Merged
purpshell merged 3 commits into
devfrom
claude/calls-sdk-pin-call-links-20260927
Oct 1, 2026
Merged

purpshell merged 3 commits into
devfrom
claude/calls-sdk-pin-call-links-20260927

Conversation

@purpshell

@purpshell purpshell commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Summary

SDK pin. dev has since moved to @polymorfa/sdk 0.1.0-dev.20261001215108, and this branch now uses that pin unchanged. That SDK still provides CallsClient.placeGroup, reactions and raised hands, Client.calls.retrieve and MessagingClient.voip.createCallLink/previewCallLink.

The duck-typed "published SDK" guards for group, social and call-detail calls are removed: they can't trigger with an exact pin, and they bypassed the SDK's own types. Their always-skipped refusal tests are removed too, and the positive tests now always run. The --muted media-state guard is unchanged.

New commands:

  • calls link create --session S [--video]: creates a WhatsApp call link from a Linked Device Number and prints its URL. The request is never retried and sends no Idempotency-Key, matching the API.
  • calls link preview --session S [--video]: reads the link, or a bare token, from standard input so it never appears in shell history or process listings.
    • It refuses an interactive terminal instead of hanging, and reports empty input as a missing link.
    • It finds one https://call.whatsapp.com/{voice|video}/TOKEN link inside pasted share text, ignoring any query or fragment and matching the host case-insensitively. That link sets the media type, and a conflicting --video is refused.
    • Two different links, or a bare token shorter than 8 characters, are refused.
    • The token is registered as a secret and sent only in the POST body.
  • Both require a server API key or project token. Client tokens are refused before stdin is read or any request is sent.

Review

A local review pass stood in for Codex, whose usage is exhausted. It found 9 issues, and the second commit addresses them:

  • the interactive-terminal hang;
  • the stale README text for calls view;
  • the unreachable guards and skipped tests;
  • link parsing that was too strict for pasted links and too loose for bare tokens;
  • the credential-specific stdin error message;
  • session, result and yes/no helpers duplicated from calls.ts.

Verification

  • format:check, lint, typecheck, build, npm pack --dry-run and audit:prod (0 vulnerabilities) pass.
  • Full vitest run after merging current dev: 975 passed, none skipped.
  • New test/commands/call-links.test.ts covers 9 cases, including link parsing and the interactive-terminal and empty-input refusals:
    • request shapes, and no Idempotency-Key;
    • the token only in the POST body and not in human output;
    • bare token with --video;
    • voice/video mismatch, malformed input (not echoed), and client-token refusal, each with no request sent.
  • event-stream-process SIGINT/SIGTERM tests fail only under full-suite load on this machine. They pass in isolation, 3 of 3, on both the old and new pin.
  • Not exercised: a live call-link create/preview against staging.

Six-part assessment

  • API: unaffected. It uses the existing /messaging/voip/call-links routes from polymorfa#337.
  • SDKs: unaffected. It consumes the published SDK prerelease.
  • CLI: updated: the new calls link commands and topic, and removal of the unreachable SDK guards. The SDK pin comes from dev.
  • Docs: updated in the CLI README, including a new "Call links" section and the removal of the outdated "requires unpublished SDK" caveats. The public Mintlify docs have no per-command CLI pages. The API reference already documents the routes.
  • Feature releases: unaffected. Calls is unreleased, and no flags change.
  • Admin controls: unaffected. There's no new state; call links reuse the per-Number calling switch that Admin already controls (admin-call-settings).

Pin @polymorfa/sdk 0.1.0-dev.20260926235309, the first dev prerelease
containing the merged Calls SDK (sdks #306). Group placement, re-ring,
reactions, raised hands, media controls and call detail now use the SDK
methods instead of refusing with a dependency error.

Add calls link create and calls link preview for server-credential call
links. Preview reads the link or token from standard input so it stays out
of shell history, and derives voice or video from a full link.
Refuse an interactive terminal and report empty stdin as a missing link.
Accept a pasted link inside share text, with a query or fragment or an
uppercase host, and refuse two different links or short bare tokens.
Drop the unreachable pre-publication SDK guards and their skipped tests
now that the SDK is pinned, and reuse the shared Calls helpers.
@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 21508605-eb2a-491c-9948-49b8051b72b9

📥 Commits

Reviewing files that changed from the base of the PR and between efca79c and 114fa3f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (13)
  • README.md
  • package.json
  • src/commands/calls/link/create.ts
  • src/commands/calls/link/preview.ts
  • src/commands/calls/view.ts
  • src/services/call-analytics.ts
  • src/services/call-links.ts
  • src/services/calls.ts
  • test/commands/call-links.test.ts
  • test/commands/call-records.test.ts
  • test/commands/calls-social.test.ts
  • test/commands/calls.test.ts
  • test/release/check-prerelease.test.ts

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.


📝 Walkthrough

Walkthrough

The change adds commands to create and preview WhatsApp call links. It also updates call operations and call-detail retrieval to use SDK methods directly, removes SDK-capability checks, and updates related tests and documentation.

Changes

Call commands and SDK integration

Layer / File(s) Summary
Call-link parsing and operations
src/services/call-links.ts
Adds parsing for full links and bare tokens, link creation and preview services, and tab-separated renderers.
Call-link commands and validation
src/commands/calls/link/*, test/commands/call-links.test.ts, package.json, README.md
Adds create and preview commands. Tests cover voice and video links, standard input, authentication, and invalid inputs. Adds the calls:link topic and documents the commands.
Direct SDK call operations and detail retrieval
src/services/calls.ts, src/services/call-analytics.ts, test/commands/calls*.test.ts, test/commands/call-records.test.ts, test/release/check-prerelease.test.ts, package.json, README.md
Call placement, ringing, reactions, hand controls, and call-detail retrieval no longer check for SDK capabilities before calling SDK methods. Updates related tests, documentation, and the SDK prerelease version.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant CallsLinkPreview
  participant stdin
  participant parseCallLink
  participant previewCallLink
  CallsLinkPreview->>stdin: Read piped link or token
  CallsLinkPreview->>parseCallLink: Parse input
  parseCallLink-->>CallsLinkPreview: Return token and optional media type
  CallsLinkPreview->>previewCallLink: Preview parsed link with session and video option
  previewCallLink-->>CallsLinkPreview: Return preview data and metadata
  CallsLinkPreview->>CallsLinkPreview: Render and write preview
Loading

Merge Risk: ⚪ Minimal · up to 114fa

The supplied evidence identifies no issue requiring correction before merge. Create and preview have not been tested against live staging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 11 files. (2 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: pinning the Calls SDK prerelease and adding call-link commands.
Full details: Docstring Coverage

Explanation

Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 11 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

…all-links-20260927

# Conflicts:
#	README.md
#	package-lock.json
#	package.json
#	test/release/check-prerelease.test.ts
@purpshell
purpshell merged commit ed6515c into dev Oct 1, 2026
2 checks passed
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