File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "version" : " 1.1" ,
3- "generated_at" : " 2026-05-07T23:13:22Z " ,
4- "spec_sha" : " dd2556942628d8b4:63d381c5e2045349 " ,
3+ "generated_at" : " 2026-05-09T12:00:13Z " ,
4+ "spec_sha" : " 4c822a78c44f68ac:53f7f73325c83be4 " ,
55 "files" : [
66 " api.md" ,
77 " src/_shims/MultipartBody.ts" ,
Original file line number Diff line number Diff line change 1- // Vendored by carbonsteel. DO NOT EDIT here in the SDK; edit
2- // tool/carbonsteel/src/lmnt/tool/carbonsteel/codegen/node/vendor/src/_websocketRuntime.ts
3- // in the monorepo and re-run carbonsteel.
4- //
51// Spec-agnostic WebSocket session helpers shared by the generated SpeechSession.
62// MessageQueue: simple async resolver/buffer pair so the generated session can
73// expose an `AsyncIterator` while the underlying WebSocket pushes via callbacks.
8- // processAudioData : normalises Blob/Buffer payloads to a uniform binary type.
4+ // processBinaryFrame : normalises Blob/Buffer payloads to a uniform binary type.
95
106import { Buffer } from 'buffer' ;
117import { LmntError } from './error' ;
@@ -47,12 +43,12 @@ export class MessageQueue {
4743 }
4844}
4945
50- export async function processAudioData ( audioData : Blob | Buffer ) : Promise < ArrayBuffer | Buffer > {
51- if ( audioData instanceof Blob ) {
52- return await audioData . arrayBuffer ( ) ;
53- } else if ( audioData instanceof Buffer ) {
54- return audioData ;
46+ export async function processBinaryFrame ( frame : Blob | Buffer ) : Promise < ArrayBuffer | Buffer > {
47+ if ( frame instanceof Blob ) {
48+ return await frame . arrayBuffer ( ) ;
49+ } else if ( frame instanceof Buffer ) {
50+ return frame ;
5551 } else {
56- throw new LmntError ( `Unexpected message type received from server: ${ audioData } ` ) ;
52+ throw new LmntError ( `Unexpected message type received from server: ${ frame } ` ) ;
5753 }
5854}
Original file line number Diff line number Diff line change @@ -85,24 +85,24 @@ async function defaultParseResponse<T>(props: APIResponseProps): Promise<T> {
8585}
8686
8787/**
88- * Attaches `_request_id ` (read from the `request-id` response header) as a non-enumerable
88+ * Attaches `request_id ` (read from the `request-id` response header) as a non-enumerable
8989 * property on object responses. Skipped for arrays and non-objects (callers can read the
9090 * `request-id` header from the underlying `Response` directly via `.withResponse()`).
9191 */
9292export function addRequestID < T > ( value : T , response : Response ) : T {
9393 if ( ! value || typeof value !== 'object' || Array . isArray ( value ) ) {
9494 return value ;
9595 }
96- return Object . defineProperty ( value , '_request_id ' , {
96+ return Object . defineProperty ( value , 'request_id ' , {
9797 value : response . headers . get ( 'request-id' ) ,
9898 enumerable : false ,
9999 } ) as T ;
100100}
101101
102- /** Optional `_request_id ` field added to plain-object responses by `addRequestID`. */
102+ /** `request_id ` field added to plain-object responses by `addRequestID`. */
103103export type WithRequestID < T > =
104104 T extends Array < any > | Response ? T
105- : T extends Record < string , any > ? T & { _request_id ? : string | null }
105+ : T extends Record < string , any > ? T & { request_id : string | null }
106106 : T ;
107107
108108/**
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export class APIError<
1717 readonly error : TError ;
1818
1919 /** The unique identifier of the request that caused this error, matching the `request-id` response header. */
20- readonly requestID : string | null | undefined ;
20+ readonly request_id : string | null | undefined ;
2121
2222 /** The `error.type` from the API response body, e.g. `"rate_limit_error"`. */
2323 readonly type : string | null ;
@@ -32,7 +32,7 @@ export class APIError<
3232 super ( `${ APIError . makeMessage ( status , error , message ) } ` ) ;
3333 this . status = status ;
3434 this . headers = headers ;
35- this . requestID = headers ?. [ 'request-id' ] ?? undefined ;
35+ this . request_id = headers ?. [ 'request-id' ] ?? undefined ;
3636 this . error = error ;
3737 this . type = type ?? null ;
3838 }
You can’t perform that action at this time.
0 commit comments