Repository navigation
feat(voice): audio library and provider credentials (Voice Automation beta) - #279
Conversation
|
Warning Review limit reached
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 49 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 72 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (24)
Comment |
Format the voice resources, upload transport and tests, and drop lint directives the open enum types do not need. Tests cover every method, the upload helper sending no Authorization header, the new error codes, the write-only provider key and unknown enum values.
Add the Voice audio library section to the SDK README, list Client.voice in the root README, add the unreleased changelog entry, and record in the contracts README that voice-audio-v1 is typed ahead of the pinned snapshots.
Upload a recording, store an ElevenLabs key, render text-to-speech, preview and list the library of one project.
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0f3c0719c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ...(wait.signal === undefined ? {} : { signal: wait.signal }), | ||
| }; | ||
| while (true) { | ||
| const response = await this.retrieve(assetId, read); |
There was a problem hiding this comment.
Enforce the polling deadline during retrieval
When a status request takes longer than wait.timeoutMs, this await remains governed by the independent request timeout (30 seconds by default), and a terminal response is returned before the elapsed deadline is checked. Consequently, waitUntilReady(..., { timeoutMs: 1000 }) can block far beyond one second and even succeed after the promised timeout; cap each retrieval by the remaining time and check the deadline after it completes.
Useful? React with 👍 / 👎.
| value.byteOffset, | ||
| value.byteLength, | ||
| ).slice(); | ||
| return { body: bytes.buffer, sizeBytes: input.sizeBytes ?? bytes.length }; |
There was a problem hiding this comment.
Derive byte-array upload sizes from the body
For a Buffer or other typed-array body, the actual byte length is already known, but this line prefers an optional caller-supplied sizeBytes. If that value is stale—for example, it is the size of a parent buffer while body is a slice—the asset is created with one length and different bytes are uploaded, which can make storage reject the upload or leave an unusable pending asset. Ignore sizeBytes for known-size bodies or reject values that differ from bytes.length.
Useful? React with 👍 / 👎.
… sizes from byte bodies waitUntilReady now bounds every status read, including transport retries, by the time left before timeoutMs, combined with the caller's signals, and checks the deadline after each read, so a result arriving after the deadline raises PolymorfaTimeoutError (request_timeout) instead of resolving late. upload takes the size of Buffer, typed-array, ArrayBuffer and Blob bodies from their byte length and refuses a mismatched sizeBytes with a PolymorfaValidationError before any request, so no asset is created. sizeBytes stays required for streams.
…e changelog Calls and voice are unreleased; the entry is kept as a draft in the monorepo release record instead.
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Record all 13 existing voice methods and Console exclusions against exact pending API b361dab snapshots. Replace fake pending error/event additions with real schema parity, including required and nullable voice fields. Narrow request enums to accepted API values while preserving documented response handling. Reject unsupported Blob MIME types before creating assets and type preview audio as Ogg. Preserve the bounded polling and exact upload-size fixes. Node 20 and 22 typechecks and builds pass. Final full suites each pass 1112 tests with only the two known SDK #282 contract failures; final source repin after API #227 merge remains required before publication.
…rary # Conflicts: # CHANGELOG.md # README.md # contracts/README.md # contracts/coverage.json # contracts/openapi.platform.json # contracts/source.json # packages/typescript/test/coverage-reconciliation.test.ts # packages/typescript/test/coverage.test.ts
…rary # Conflicts: # CHANGELOG.md # README.md # contracts/README.md # contracts/coverage.json # contracts/openapi.platform.json # contracts/source.json # packages/typescript/README.md # packages/typescript/src/client.ts # packages/typescript/test/coverage-reconciliation.test.ts # packages/typescript/test/coverage.test.ts # packages/typescript/test/webhook-contract.test.ts
…rary # Conflicts: # CHANGELOG.md # README.md # contracts/README.md # contracts/coverage.json # contracts/openapi.messaging.json # contracts/openapi.platform.json # contracts/source.json # packages/typescript/README.md # packages/typescript/src/client.ts # packages/typescript/src/transport/http.ts # packages/typescript/src/webhooks/events.ts # packages/typescript/test/coverage-reconciliation.test.ts # packages/typescript/test/coverage.test.ts
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6010302048
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (left <= 0) throw timedOut(); | ||
| const pause = linkSignals(callerSignals); | ||
| try { | ||
| await defaultSleep(Math.min(intervalMs, left), pause.signal); |
There was a problem hiding this comment.
Normalize aborts during polling delays
When either caller signal is aborted after a transcoding response while this interval sleep is active, defaultSleep rejects directly with signal.reason, so waitUntilReady exposes a raw AbortError or caller-supplied value rather than the PolymorfaCancelledError with code: "request_cancelled" produced when the same abort occurs during retrieval. Catch and normalize cancellation around the sleep as well so cancellation behavior does not depend on which phase of polling receives the signal.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6010302048
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (left <= 0) throw timedOut(); | ||
| const pause = linkSignals(callerSignals); | ||
| try { | ||
| await defaultSleep(Math.min(intervalMs, left), pause.signal); |
There was a problem hiding this comment.
Normalize aborts between polling reads
When an asset remains pending and either caller signal aborts during this interval, defaultSleep rejects directly with the signal's reason (normally a raw DOMException). An abort during the preceding retrieve is instead translated by HttpTransport into PolymorfaCancelledError with code: "request_cancelled", so callers receive different error types depending only on whether cancellation lands during a request or the pause. Catch the sleep rejection and normalize caller aborts to the SDK cancellation error.
Useful? React with 👍 / 👎.
|
Merge gate for exact head |
Voice audio library
Adds the TypeScript
Client.voice.audioandClient.voice.providerCredentialsresources for the Voice Automation beta. The SDK can create and complete audio uploads, synthesize speech, list and manage assets, get preview URLs, wait for processing, and manage write-only provider credentials.voice.asset_readyandvoice.asset_failedwebhooks are typed. The upload helper sends bytes only to the returned URL, strips Polymorfa credentials, refuses redirects and non-loopback HTTP, and keeps URL and provider-key material out of errors, including network-error causes.The SDK contract is pinned to merged API
devcommit087d0e34b53eec82ebc5d04c5b4c75eaaa556b4f(API #227). The Messaging and Platform OpenAPI snapshots match that commit byte for byte. Strict coverage reconciles 485 operations: 361 covered, 124 explicitly excluded, zero missing or changed. The branch includes the SDKdevbaseline througheaa7f67a6dd24e67fea4a1a22fc5a85fad39deb9, so Voice coexists with Calls analytics, usage, and gates.constructWebhookEventalso accepts project-scoped deliveries with an emptysession. Those envelopes are emitted forcustomer.*events and the newvoice.*events.Verification
Node 22 local format, lint (zero errors; two existing unused-disable warnings), typecheck, all workspace builds, 1,205 tests in 110 files, strict coverage, Functions and retired-name checks, workspace pack dry run, and production dependency audit (zero findings) pass. Voice tests cover method routes and bodies, project confinement, upload credential isolation and error paths, provider-key redaction, unknown enums, polling states, and project-scoped webhook parsing. The exact API snapshots have matching SHA-256 hashes. CI and current-head review are pending. A live API, provider upload, and real call were not exercised.
Contract and release assessment
devpackage from this PR, validate its commands, and become review-ready.calls.voice-automationremains a gated beta requiring enrollment and server authority. Merging this PR only publishes a development SDK package; it does not enable an audience or establish deployed availability. No rollout or production flag changes are made.Calls remains unreleased. Cloud/VoIP immutable project ownership is a separate Calls release-acceptance gap; no production release or deployment is part of this PR.