@deepraxis/sdk 0.1.1-dev.ed927d7 → 0.1.1-dev.ee5d4e3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/METHODS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # SDK methods
2
2
 
3
- Generated by `bun run generate`. 842 HTTP operations, plus product aliases. Version segments and path parameters are omitted from resource names. Inputs use typed `{ path, query, body, headers }` options. Collections form nested resource objects; POST actions retain their verb. Naming rules are documented in `scripts/resources.ts`; semantic exceptions and aliases with reasons are in `scripts/naming-overrides.ts`.
3
+ Generated by `bun run generate`. 888 HTTP operations, plus product aliases. Version segments and path parameters are omitted from resource names. Inputs use typed `{ path, query, body, headers }` options. Collections form nested resource objects; POST actions retain their verb. Naming rules are documented in `scripts/resources.ts`; semantic exceptions and aliases with reasons are in `scripts/naming-overrides.ts`.
4
4
 
5
5
  `always` returns an AsyncIterable; `optional` streams with `{ stream: true }`; `yes` pagination returns a Page. Only `{ data, next_cursor }` + `cursor` query contracts are automatically paginated.
6
6
 
@@ -17,7 +17,9 @@ Multipart request bodies expand plain objects into bracketed fields (for example
17
17
  | list | GET | `/agent/v1/agents` | no | no |
18
18
  | retrieve | GET | `/agent/v1/agents/{agent_id}` | no | no |
19
19
  | retrieveAppearance | GET | `/agent/v1/agents/{agent_id}/appearance` | no | no |
20
+ | retrieveEmbedPolicy | GET | `/agent/v1/agents/{agent_id}/embed_policy` | no | no |
20
21
  | update | POST | `/agent/v1/agents/{agent_id}` | no | no |
22
+ | updateEmbedPolicy | POST | `/agent/v1/agents/{agent_id}/embed_policy` | no | no |
21
23
 
22
24
  ### agent.agents.consolidations
23
25
 
@@ -67,6 +69,13 @@ Multipart request bodies expand plain objects into bracketed fields (for example
67
69
  |---|---|---|---|---|
68
70
  | list | GET | `/agent/v1/agents/{agent_id}/inbox/letters` | no | no |
69
71
 
72
+ ### agent.agents.phone
73
+
74
+ | Method | HTTP | Path | Streaming | Pagination |
75
+ |---|---|---|---|---|
76
+ | release | POST | `/agent/v1/agents/{agent_id}/phone/release` | no | no |
77
+ | retrieve | GET | `/agent/v1/agents/{agent_id}/phone` | no | no |
78
+
70
79
  ### agent.agents.unarchive
71
80
 
72
81
  | Method | HTTP | Path | Streaming | Pagination |
@@ -104,6 +113,8 @@ Multipart request bodies expand plain objects into bracketed fields (for example
104
113
  |---|---|---|---|---|
105
114
  | list | GET | `/agent/v1/computers/{computer_id}/files` | no | no |
106
115
  | retrieveContent | GET | `/agent/v1/computers/{computer_id}/files/content` | no | no |
116
+ | retrievePreview | GET | `/agent/v1/computers/{computer_id}/files/preview` | no | no |
117
+ | updateContent | PUT | `/agent/v1/computers/{computer_id}/files/content` | no | no |
107
118
 
108
119
  ### agent.computers.files.convert
109
120
 
@@ -178,6 +189,12 @@ Multipart request bodies expand plain objects into bracketed fields (for example
178
189
  | retrieveContext | GET | `/agent/v1/sessions/{session_id}/context` | no | no |
179
190
  | update | POST | `/agent/v1/sessions/{session_id}` | no | no |
180
191
 
192
+ ### agent.sessions.agentVersion
193
+
194
+ | Method | HTTP | Path | Streaming | Pagination |
195
+ |---|---|---|---|---|
196
+ | create | POST | `/agent/v1/sessions/{session_id}/agent_version` | no | no |
197
+
181
198
  ### agent.sessions.artifacts
182
199
 
183
200
  | Method | HTTP | Path | Streaming | Pagination |
@@ -212,6 +229,12 @@ Multipart request bodies expand plain objects into bracketed fields (for example
212
229
  | send | POST | `/agent/v1/sessions/{session_id}/events` | no | no |
213
230
  | stream | GET | `/agent/v1/sessions/{session_id}/events/stream` | always | no |
214
231
 
232
+ ### agent.sessions.name
233
+
234
+ | Method | HTTP | Path | Streaming | Pagination |
235
+ |---|---|---|---|---|
236
+ | create | POST | `/agent/v1/sessions/{session_id}/name` | no | no |
237
+
215
238
  ### agent.sessions.requests
216
239
 
217
240
  | Method | HTTP | Path | Streaming | Pagination |
@@ -573,6 +596,14 @@ Multipart request bodies expand plain objects into bracketed fields (for example
573
596
  | list | GET | `/automation/v1/workflows/{ns}/{name}/versions` | no | yes |
574
597
  | retrieve | GET | `/automation/v1/workflows/{ns}/{name}/versions/{version}` | no | no |
575
598
 
599
+ ## billing
600
+
601
+ ### billing.prices
602
+
603
+ | Method | HTTP | Path | Streaming | Pagination |
604
+ |---|---|---|---|---|
605
+ | list | GET | `/billing/v1/prices` | no | no |
606
+
576
607
  ## browser
577
608
 
578
609
  ### browser.connect
@@ -1047,6 +1078,7 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1047
1078
 
1048
1079
  | Method | HTTP | Path | Streaming | Pagination |
1049
1080
  |---|---|---|---|---|
1081
+ | create | POST | `/devops/v1/projects` | no | no |
1050
1082
  | list | GET | `/devops/v1/projects` | no | no |
1051
1083
  | retrieve | GET | `/devops/v1/projects/{id}` | no | no |
1052
1084
  | retrieveTestCatalog | GET | `/devops/v1/projects/{project}/test-catalog` | no | no |
@@ -1060,6 +1092,18 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1060
1092
  | create | POST | `/devops/v1/projects/{project}/changes` | no | no |
1061
1093
  | list | GET | `/devops/v1/projects/{project}/changes` | no | no |
1062
1094
 
1095
+ ### devops.projects.cleanups
1096
+
1097
+ | Method | HTTP | Path | Streaming | Pagination |
1098
+ |---|---|---|---|---|
1099
+ | list | GET | `/devops/v1/projects/{project}/cleanups` | no | no |
1100
+
1101
+ ### devops.projects.defaultBranch
1102
+
1103
+ | Method | HTTP | Path | Streaming | Pagination |
1104
+ |---|---|---|---|---|
1105
+ | initialize | POST | `/devops/v1/projects/{id}/default-branch:initialize` | no | no |
1106
+
1063
1107
  ### devops.projects.environments
1064
1108
 
1065
1109
  | Method | HTTP | Path | Streaming | Pagination |
@@ -1180,6 +1224,7 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1180
1224
  |---|---|---|---|---|
1181
1225
  | approve | POST | `/devops/v1/promotions/{id}:approve` | no | no |
1182
1226
  | cancel | POST | `/devops/v1/promotions/{id}:cancel` | no | no |
1227
+ | checkoutCredential | POST | `/devops/v1/promotions/{id}:checkoutCredential` | no | no |
1183
1228
  | conclude | POST | `/devops/v1/promotions/{id}:conclude` | no | no |
1184
1229
  | create | POST | `/devops/v1/promotions` | no | no |
1185
1230
  | retrieve | GET | `/devops/v1/promotions/{id}` | no | no |
@@ -1195,11 +1240,18 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1195
1240
 
1196
1241
  | Method | HTTP | Path | Streaming | Pagination |
1197
1242
  |---|---|---|---|---|
1243
+ | close | POST | `/devops/v1/pull-requests/{id}:close` | no | no |
1198
1244
  | merge | POST | `/devops/v1/pull-requests/{id}:merge` | no | no |
1199
1245
  | recordVerdict | POST | `/devops/v1/pull-requests/{id}:recordVerdict` | no | no |
1200
1246
  | rerunGate | POST | `/devops/v1/pull-requests/{id}:rerunGate` | no | no |
1201
1247
  | retrieve | GET | `/devops/v1/pull-requests/{id}` | no | no |
1202
1248
 
1249
+ ### devops.pullRequests.reviews
1250
+
1251
+ | Method | HTTP | Path | Streaming | Pagination |
1252
+ |---|---|---|---|---|
1253
+ | create | POST | `/devops/v1/pull-requests/{id}/reviews` | no | no |
1254
+
1203
1255
  ### devops.releases
1204
1256
 
1205
1257
  | Method | HTTP | Path | Streaming | Pagination |
@@ -1555,6 +1607,18 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1555
1607
  | list | GET | `/media/v1/libraries/{library_id}/understandings` | no | yes |
1556
1608
  | retrieveFailureSummary | GET | `/media/v1/libraries/{library_id}/understandings/failure_summary` | no | no |
1557
1609
 
1610
+ ### media.libraries.voices
1611
+
1612
+ | Method | HTTP | Path | Streaming | Pagination |
1613
+ |---|---|---|---|---|
1614
+ | create | POST | `/media/v1/libraries/{library_id}/voices` | no | no |
1615
+
1616
+ ### media.libraries.voices.designs
1617
+
1618
+ | Method | HTTP | Path | Streaming | Pagination |
1619
+ |---|---|---|---|---|
1620
+ | create | POST | `/media/v1/libraries/{library_id}/voices/designs` | no | no |
1621
+
1558
1622
  ### media.speech
1559
1623
 
1560
1624
  | Method | HTTP | Path | Streaming | Pagination |
@@ -1843,6 +1907,12 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1843
1907
  |---|---|---|---|---|
1844
1908
  | create | POST | `/organization/v1/departments/{id}/dissolve` | no | no |
1845
1909
 
1910
+ ### organization.effectiveSpec
1911
+
1912
+ | Method | HTTP | Path | Streaming | Pagination |
1913
+ |---|---|---|---|---|
1914
+ | retrieve | GET | `/organization/v1/effective_spec` | no | no |
1915
+
1846
1916
  ### organization.events
1847
1917
 
1848
1918
  | Method | HTTP | Path | Streaming | Pagination |
@@ -1992,6 +2062,47 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1992
2062
  |---|---|---|---|---|
1993
2063
  | create | POST | `/organization/v1/positions/{id}/unfreeze` | no | no |
1994
2064
 
2065
+ ### organization.reconcile
2066
+
2067
+ | Method | HTTP | Path | Streaming | Pagination |
2068
+ |---|---|---|---|---|
2069
+ | pause | POST | `/organization/v1/reconcile/pause` | no | no |
2070
+ | resume | POST | `/organization/v1/reconcile/resume` | no | no |
2071
+ | retrievePlan | GET | `/organization/v1/reconcile/plan` | no | no |
2072
+
2073
+ ### organization.reconcile.run
2074
+
2075
+ | Method | HTTP | Path | Streaming | Pagination |
2076
+ |---|---|---|---|---|
2077
+ | create | POST | `/organization/v1/reconcile/run` | no | no |
2078
+
2079
+ ### organization.reconcile.status
2080
+
2081
+ | Method | HTTP | Path | Streaming | Pagination |
2082
+ |---|---|---|---|---|
2083
+ | list | GET | `/organization/v1/reconcile/status` | no | no |
2084
+
2085
+ ### organization.specSchema
2086
+
2087
+ | Method | HTTP | Path | Streaming | Pagination |
2088
+ |---|---|---|---|---|
2089
+ | retrieve | GET | `/organization/v1/spec_schema` | no | no |
2090
+
2091
+ ### organization.specs
2092
+
2093
+ | Method | HTTP | Path | Streaming | Pagination |
2094
+ |---|---|---|---|---|
2095
+ | list | GET | `/organization/v1/specs` | no | no |
2096
+ | retrieve | GET | `/organization/v1/specs/{kind}/{id}` | no | no |
2097
+ | retrieveDiff | GET | `/organization/v1/specs/{kind}/{id}/diff` | no | no |
2098
+ | update | PUT | `/organization/v1/specs/{kind}/{id}` | no | no |
2099
+
2100
+ ### organization.specs.revisions
2101
+
2102
+ | Method | HTTP | Path | Streaming | Pagination |
2103
+ |---|---|---|---|---|
2104
+ | list | GET | `/organization/v1/specs/{kind}/{id}/revisions` | no | no |
2105
+
1995
2106
  ### organization.usage
1996
2107
 
1997
2108
  | Method | HTTP | Path | Streaming | Pagination |
@@ -2013,6 +2124,45 @@ Multipart request bodies expand plain objects into bracketed fields (for example
2013
2124
  |---|---|---|---|---|
2014
2125
  | retrieve | GET | `/registry/v1/packages/{package_id}` | no | no |
2015
2126
 
2127
+ ### registry.packages.git
2128
+
2129
+ | Method | HTTP | Path | Streaming | Pagination |
2130
+ |---|---|---|---|---|
2131
+ | retrieveCompare | GET | `/registry/v1/packages/{package_id}/git/compare` | no | no |
2132
+ | retrieveLog | GET | `/registry/v1/packages/{package_id}/git/log` | no | no |
2133
+ | retrieveResolve | GET | `/registry/v1/packages/{package_id}/git/resolve` | no | no |
2134
+
2135
+ ### registry.packages.git.commits
2136
+
2137
+ | Method | HTTP | Path | Streaming | Pagination |
2138
+ |---|---|---|---|---|
2139
+ | retrieve | GET | `/registry/v1/packages/{package_id}/git/commits/{sha}` | no | no |
2140
+
2141
+ ### registry.packages.git.files
2142
+
2143
+ | Method | HTTP | Path | Streaming | Pagination |
2144
+ |---|---|---|---|---|
2145
+ | retrieve | GET | `/registry/v1/packages/{package_id}/git/files/{path}` | no | no |
2146
+
2147
+ ### registry.packages.git.refs
2148
+
2149
+ | Method | HTTP | Path | Streaming | Pagination |
2150
+ |---|---|---|---|---|
2151
+ | list | GET | `/registry/v1/packages/{package_id}/git/refs` | no | no |
2152
+
2153
+ ### registry.packages.git.trees
2154
+
2155
+ | Method | HTTP | Path | Streaming | Pagination |
2156
+ |---|---|---|---|---|
2157
+ | retrieve | GET | `/registry/v1/packages/{package_id}/git/trees/{sha}` | no | no |
2158
+ | retrieveRecursive | GET | `/registry/v1/packages/{package_id}/git/trees/{sha}/recursive` | no | no |
2159
+
2160
+ ### registry.packages.gitCredential
2161
+
2162
+ | Method | HTTP | Path | Streaming | Pagination |
2163
+ |---|---|---|---|---|
2164
+ | create | POST | `/registry/v1/packages/{package_id}/git-credential` | no | no |
2165
+
2016
2166
  ### registry.packages.installations
2017
2167
 
2018
2168
  | Method | HTTP | Path | Streaming | Pagination |
@@ -2060,6 +2210,33 @@ Multipart request bodies expand plain objects into bracketed fields (for example
2060
2210
 
2061
2211
  ## sandbox
2062
2212
 
2213
+ ### sandbox.byod.devices
2214
+
2215
+ | Method | HTTP | Path | Streaming | Pagination |
2216
+ |---|---|---|---|---|
2217
+ | list | GET | `/sandbox/v1/byod/devices` | no | no |
2218
+ | retrieve | GET | `/sandbox/v1/byod/devices/{deviceID}` | no | no |
2219
+ | update | PATCH | `/sandbox/v1/byod/devices/{deviceID}` | no | no |
2220
+
2221
+ ### sandbox.byod.devices.disconnect
2222
+
2223
+ | Method | HTTP | Path | Streaming | Pagination |
2224
+ |---|---|---|---|---|
2225
+ | create | POST | `/sandbox/v1/byod/devices/{deviceID}/disconnect` | no | no |
2226
+
2227
+ ### sandbox.byod.pairings
2228
+
2229
+ | Method | HTTP | Path | Streaming | Pagination |
2230
+ |---|---|---|---|---|
2231
+ | create | POST | `/sandbox/v1/byod/pairings` | no | no |
2232
+ | retrieve | GET | `/sandbox/v1/byod/pairings/{code}` | no | no |
2233
+
2234
+ ### sandbox.byod.pairings.claim
2235
+
2236
+ | Method | HTTP | Path | Streaming | Pagination |
2237
+ |---|---|---|---|---|
2238
+ | create | POST | `/sandbox/v1/byod/pairings/{code}/claim` | no | no |
2239
+
2063
2240
  ### sandbox.events.sandboxes
2064
2241
 
2065
2242
  | Method | HTTP | Path | Streaming | Pagination |
@@ -2070,6 +2247,7 @@ Multipart request bodies expand plain objects into bracketed fields (for example
2070
2247
 
2071
2248
  | Method | HTTP | Path | Streaming | Pagination |
2072
2249
  |---|---|---|---|---|
2250
+ | act | POST | `/sandbox/v1/sandboxes/{sandboxID}/act` | no | no |
2073
2251
  | connect | POST | `/sandbox/v1/sandboxes/{sandboxID}/connect` | no | no |
2074
2252
  | create | POST | `/sandbox/v1/sandboxes` | no | no |
2075
2253
  | delete | DELETE | `/sandbox/v1/sandboxes/{sandboxID}` | no | no |
@@ -2612,7 +2790,10 @@ Multipart request bodies expand plain objects into bracketed fields (for example
2612
2790
 
2613
2791
  | Operation | Reason |
2614
2792
  |---|---|
2793
+ | agent.agents.updateEmbedPolicy | The embed policy is a singleton of the agent; POST updates it in part, so it pairs with retrieveEmbedPolicy as agents.updateEmbedPolicy rather than a nested embedPolicy collection create. |
2615
2794
  | agent.agents.events.send | ADR-123 (#1550): the agent-subject door fires the session events operation, so it takes the same product verb as sessions.events.send; the path alone would derive events.create. |
2795
+ | agent.agents.phone.retrieve | ticket-3311: reading the agent's cloud phone is agents.phone.retrieve; the path alone would derive agents.retrievePhone, which does not name the sub-resource. |
2796
+ | agent.agents.phone.release | ticket-3311: release is the act on the agent's cloud phone (the row is marked, then the cron archives and kills it); the path alone would derive agents.phone.release.create. |
2616
2797
  | agent.sessions.events.send | Events submit session input; the product verb is send rather than create. |
2617
2798
  | automation.hooks.send | Delivers a payload to a trigger's secret webhook URL; it sends an event rather than updating a hook resource. |
2618
2799
  | automation.scripts.distTags.set | A dist-tag assigns a version to a name; use npm vocabulary set rather than update. |
@@ -2661,6 +2842,7 @@ Multipart request bodies expand plain objects into bracketed fields (for example
2661
2842
  | media.images.generate | ADR-094 §9 names image generation images.generate; the URL mounts it under a library, but generation is an operation on images and the path alone would derive a generations collection create. |
2662
2843
  | media.videos.generate | ADR-094 §2/§9 names video generation videos.generate beside images.generate; the URL mounts it under a library, but generation is an operation on videos and the path alone would derive a generations collection create. The unqualified videos resource is the video lane, distinct from the batch and legacy job resources. |
2663
2844
  | meta.docs.search | Documentation keyword search is an operation on docs, not a nested collection. |
2845
+ | sandbox.sandboxes.act | ticket-3311: act is the one display door of an addressed phone sandbox; the URL spells the operation but the generic post rule would derive sandboxes.create, colliding with createSandbox. |
2664
2846
  | sandbox.sandboxes.commands.run | Sandbox data operations use the E2B SDK verb while preserving URL resource nesting. |
2665
2847
  | sandbox.sandboxes.files.remove | Sandbox data operations use the E2B SDK verb while preserving URL resource nesting. |
2666
2848
  | sandbox.sandboxes.files.read | Sandbox data operations use the E2B SDK verb while preserving URL resource nesting. |
package/README.md CHANGED
@@ -10,7 +10,7 @@ The official TypeScript SDK for [Praxis](https://deepraxis.com), the cloud where
10
10
  [![Bundle size](https://img.shields.io/bundlephobia/minzip/@deepraxis/sdk?color=2e8555)](https://bundlephobia.com/package/@deepraxis/sdk)
11
11
  [![License](https://img.shields.io/badge/license-Apache--2.0-2e8555)](https://www.apache.org/licenses/LICENSE-2.0)
12
12
 
13
- [Website](https://deepraxis.com) · [Documentation](https://docs.deepraxis.com) · [API reference](https://docs.deepraxis.com/docs/api) · [Console](https://console.deepraxis.com)
13
+ [Website](https://deepraxis.com) · [Documentation](https://docs.deepraxis.com) · [API reference](https://docs.deepraxis.com/api) · [Console](https://console.deepraxis.com)
14
14
 
15
15
  </div>
16
16
 
@@ -262,13 +262,14 @@ export default async (input: { prompt: string }) => {
262
262
 
263
263
  Keep your code and point the official SDK at Praxis by changing `baseURL`, for example
264
264
  `https://api.deepraxis.com/openai/v1` for the OpenAI SDK. The
265
- [SDK cookbook](https://docs.deepraxis.com/docs/cookbook/sdk) has the details for OpenAI,
266
- Anthropic, the Vercel AI SDK and LangChain. This SDK covers what those don't: agents,
265
+ [OpenAI-compatible](https://docs.deepraxis.com/en/developers/model/guides/openai-compatible) and
266
+ [Anthropic-compatible](https://docs.deepraxis.com/en/developers/model/guides/anthropic-compatible)
267
+ guides have the details. This SDK covers what those don't: agents,
267
268
  sandboxes, search, data, automation and the rest of the platform.
268
269
 
269
270
  ## Resources
270
271
 
271
- - [Documentation](https://docs.deepraxis.com) and [API reference](https://docs.deepraxis.com/docs/api)
272
+ - [Documentation](https://docs.deepraxis.com) and [API reference](https://docs.deepraxis.com/api)
272
273
  - [METHODS.md](https://unpkg.com/@deepraxis/sdk/METHODS.md): every method, its HTTP route, and whether it streams or paginates
273
274
  - [Praxis CLI](https://www.npmjs.com/package/@deepraxis/cli): the same API from your terminal
274
275
 
@@ -0,0 +1,3 @@
1
+ import type { Operation } from './transport.js';
2
+ /** Whether this operation's 200 response is the declared bytes of the resource, not a JSON body. */
3
+ export declare function isBinaryOperation(operation: Operation): boolean;
@@ -0,0 +1,14 @@
1
+ import * as sdk from "../generated/sdk.gen.js";
2
+ import { binaryOperations } from "../generated/binary-operations.gen.js";
3
+ /**
4
+ * The generated SDK operations whose success response the OpenAPI declares as binary bytes
5
+ * (generated from the spec into `binary-operations.gen.ts`). Resolved by function identity, so
6
+ * wrapping, renaming or minification cannot change the answer.
7
+ */
8
+ const binary = new Set(binaryOperations
9
+ .map(name => sdk[name])
10
+ .filter((operation) => typeof operation === 'function'));
11
+ /** Whether this operation's 200 response is the declared bytes of the resource, not a JSON body. */
12
+ export function isBinaryOperation(operation) {
13
+ return binary.has(operation);
14
+ }
@@ -3,6 +3,7 @@ import { PraxisError, PraxisTimeoutError } from "./errors.js";
3
3
  import { abortable, fetchWithRetry } from "./retry.js";
4
4
  import { parseSSE } from "./sse.js";
5
5
  import { resolveDefaultCredentials } from "./credentials.js";
6
+ import { isBinaryOperation } from "./binary-operations.js";
6
7
  /** Our own per-call keys, beyond what the generated hey-api client accepts. */
7
8
  const SDK_OPTION_KEYS = ['timeoutMs', 'maxRetries', 'stream', 'lastEventId'];
8
9
  /** Every key of the generated client's per-call RequestOptions (request parts, fetch/RequestInit, serializers,
@@ -55,7 +56,7 @@ export class Transport {
55
56
  if (!Number.isSafeInteger(retries) || retries < 0)
56
57
  throw new RangeError('maxRetries must be a non-negative integer');
57
58
  }
58
- scope(options, streaming) {
59
+ scope(operation, options, streaming) {
59
60
  assertKnownOptions(options);
60
61
  const timeoutMs = options.timeoutMs ?? Math.max(this.config.timeoutMs, serverDeadlineMs(options));
61
62
  const maxRetries = options.maxRetries ?? this.config.maxRetries;
@@ -98,7 +99,10 @@ export class Transport {
98
99
  }
99
100
  return {
100
101
  signal,
101
- options: { ...options, headers: Object.fromEntries(headers), client, signal, throwOnError: true, responseStyle: 'fields', ...(streaming ? { parseAs: 'stream' } : {}) },
102
+ // A binary operation is parsed as a Blob whatever the server says in Content-Type: the runtime
103
+ // value must match the declared `Blob | File`, and JSON bytes must survive as bytes.
104
+ options: { ...options, headers: Object.fromEntries(headers), client, signal, throwOnError: true, responseStyle: 'fields',
105
+ ...(streaming ? { parseAs: 'stream' } : isBinaryOperation(operation) ? { parseAs: 'blob' } : {}) },
102
106
  close() { clearTimeout(timer); external?.removeEventListener('abort', abort); },
103
107
  };
104
108
  }
@@ -107,7 +111,7 @@ export class Transport {
107
111
  }
108
112
  /** Internal helper access to response metadata, with the same request policy. */
109
113
  async requestWithResponse(operation, options = {}) {
110
- const scope = this.scope(options, false);
114
+ const scope = this.scope(operation, options, false);
111
115
  try {
112
116
  const result = await abortable(operation(scope.options), scope.signal);
113
117
  return { data: result.data, response: result.response };
@@ -117,7 +121,7 @@ export class Transport {
117
121
  }
118
122
  }
119
123
  async *stream(operation, options = {}) {
120
- const scope = this.scope(options, true);
124
+ const scope = this.scope(operation, options, true);
121
125
  try {
122
126
  const result = await abortable(operation(scope.options), scope.signal);
123
127
  if (!result.response.headers.get('content-type')?.split(';')[0]?.trim().toLowerCase().includes('text/event-stream')) {
@@ -0,0 +1,3 @@
1
+ /** Exported SDK operations whose 2xx response the OpenAPI declares as binary bytes: the core
2
+ * transport resolves them to a Blob whatever the response Content-Type says. */
3
+ export declare const binaryOperations: readonly string[];
@@ -0,0 +1,14 @@
1
+ // Generated by scripts/resources.ts. DO NOT EDIT.
2
+ /** Exported SDK operations whose 2xx response the OpenAPI declares as binary bytes: the core
3
+ * transport resolves them to a Blob whatever the response Content-Type says. */
4
+ export const binaryOperations = [
5
+ 'browserGetSessionFrame',
6
+ 'computersFilesContent',
7
+ 'createAudioSpeech',
8
+ 'downloadVideoContent',
9
+ 'fileRetrieveFileContent',
10
+ 'registryGitFilesRetrieve',
11
+ 'registryPackagesVersionsArchive',
12
+ 'registryPackagesVersionsFilesRetrieve',
13
+ 'skillsVersionsDownload',
14
+ ];