@deepraxis/sdk 0.1.1-dev.cfc116e → 0.1.1-dev.d00e6d2

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`. 845 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`. 876 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
 
@@ -69,6 +69,13 @@ Multipart request bodies expand plain objects into bracketed fields (for example
69
69
  |---|---|---|---|---|
70
70
  | list | GET | `/agent/v1/agents/{agent_id}/inbox/letters` | no | no |
71
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
+
72
79
  ### agent.agents.unarchive
73
80
 
74
81
  | Method | HTTP | Path | Streaming | Pagination |
@@ -106,6 +113,7 @@ Multipart request bodies expand plain objects into bracketed fields (for example
106
113
  |---|---|---|---|---|
107
114
  | list | GET | `/agent/v1/computers/{computer_id}/files` | no | no |
108
115
  | retrieveContent | GET | `/agent/v1/computers/{computer_id}/files/content` | no | no |
116
+ | retrievePreview | GET | `/agent/v1/computers/{computer_id}/files/preview` | no | no |
109
117
 
110
118
  ### agent.computers.files.convert
111
119
 
@@ -220,6 +228,12 @@ Multipart request bodies expand plain objects into bracketed fields (for example
220
228
  | send | POST | `/agent/v1/sessions/{session_id}/events` | no | no |
221
229
  | stream | GET | `/agent/v1/sessions/{session_id}/events/stream` | always | no |
222
230
 
231
+ ### agent.sessions.name
232
+
233
+ | Method | HTTP | Path | Streaming | Pagination |
234
+ |---|---|---|---|---|
235
+ | create | POST | `/agent/v1/sessions/{session_id}/name` | no | no |
236
+
223
237
  ### agent.sessions.requests
224
238
 
225
239
  | Method | HTTP | Path | Streaming | Pagination |
@@ -581,6 +595,14 @@ Multipart request bodies expand plain objects into bracketed fields (for example
581
595
  | list | GET | `/automation/v1/workflows/{ns}/{name}/versions` | no | yes |
582
596
  | retrieve | GET | `/automation/v1/workflows/{ns}/{name}/versions/{version}` | no | no |
583
597
 
598
+ ## billing
599
+
600
+ ### billing.prices
601
+
602
+ | Method | HTTP | Path | Streaming | Pagination |
603
+ |---|---|---|---|---|
604
+ | list | GET | `/billing/v1/prices` | no | no |
605
+
584
606
  ## browser
585
607
 
586
608
  ### browser.connect
@@ -1203,6 +1225,7 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1203
1225
 
1204
1226
  | Method | HTTP | Path | Streaming | Pagination |
1205
1227
  |---|---|---|---|---|
1228
+ | close | POST | `/devops/v1/pull-requests/{id}:close` | no | no |
1206
1229
  | merge | POST | `/devops/v1/pull-requests/{id}:merge` | no | no |
1207
1230
  | recordVerdict | POST | `/devops/v1/pull-requests/{id}:recordVerdict` | no | no |
1208
1231
  | rerunGate | POST | `/devops/v1/pull-requests/{id}:rerunGate` | no | no |
@@ -1563,6 +1586,18 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1563
1586
  | list | GET | `/media/v1/libraries/{library_id}/understandings` | no | yes |
1564
1587
  | retrieveFailureSummary | GET | `/media/v1/libraries/{library_id}/understandings/failure_summary` | no | no |
1565
1588
 
1589
+ ### media.libraries.voices
1590
+
1591
+ | Method | HTTP | Path | Streaming | Pagination |
1592
+ |---|---|---|---|---|
1593
+ | create | POST | `/media/v1/libraries/{library_id}/voices` | no | no |
1594
+
1595
+ ### media.libraries.voices.designs
1596
+
1597
+ | Method | HTTP | Path | Streaming | Pagination |
1598
+ |---|---|---|---|---|
1599
+ | create | POST | `/media/v1/libraries/{library_id}/voices/designs` | no | no |
1600
+
1566
1601
  ### media.speech
1567
1602
 
1568
1603
  | Method | HTTP | Path | Streaming | Pagination |
@@ -1851,6 +1886,12 @@ Multipart request bodies expand plain objects into bracketed fields (for example
1851
1886
  |---|---|---|---|---|
1852
1887
  | create | POST | `/organization/v1/departments/{id}/dissolve` | no | no |
1853
1888
 
1889
+ ### organization.effectiveSpec
1890
+
1891
+ | Method | HTTP | Path | Streaming | Pagination |
1892
+ |---|---|---|---|---|
1893
+ | retrieve | GET | `/organization/v1/effective_spec` | no | no |
1894
+
1854
1895
  ### organization.events
1855
1896
 
1856
1897
  | Method | HTTP | Path | Streaming | Pagination |
@@ -2000,6 +2041,41 @@ Multipart request bodies expand plain objects into bracketed fields (for example
2000
2041
  |---|---|---|---|---|
2001
2042
  | create | POST | `/organization/v1/positions/{id}/unfreeze` | no | no |
2002
2043
 
2044
+ ### organization.reconcile
2045
+
2046
+ | Method | HTTP | Path | Streaming | Pagination |
2047
+ |---|---|---|---|---|
2048
+ | pause | POST | `/organization/v1/reconcile/pause` | no | no |
2049
+ | resume | POST | `/organization/v1/reconcile/resume` | no | no |
2050
+ | retrievePlan | GET | `/organization/v1/reconcile/plan` | no | no |
2051
+
2052
+ ### organization.reconcile.run
2053
+
2054
+ | Method | HTTP | Path | Streaming | Pagination |
2055
+ |---|---|---|---|---|
2056
+ | create | POST | `/organization/v1/reconcile/run` | no | no |
2057
+
2058
+ ### organization.reconcile.status
2059
+
2060
+ | Method | HTTP | Path | Streaming | Pagination |
2061
+ |---|---|---|---|---|
2062
+ | list | GET | `/organization/v1/reconcile/status` | no | no |
2063
+
2064
+ ### organization.specs
2065
+
2066
+ | Method | HTTP | Path | Streaming | Pagination |
2067
+ |---|---|---|---|---|
2068
+ | list | GET | `/organization/v1/specs` | no | no |
2069
+ | retrieve | GET | `/organization/v1/specs/{kind}/{id}` | no | no |
2070
+ | retrieveDiff | GET | `/organization/v1/specs/{kind}/{id}/diff` | no | no |
2071
+ | update | PUT | `/organization/v1/specs/{kind}/{id}` | no | no |
2072
+
2073
+ ### organization.specs.revisions
2074
+
2075
+ | Method | HTTP | Path | Streaming | Pagination |
2076
+ |---|---|---|---|---|
2077
+ | list | GET | `/organization/v1/specs/{kind}/{id}/revisions` | no | no |
2078
+
2003
2079
  ### organization.usage
2004
2080
 
2005
2081
  | Method | HTTP | Path | Streaming | Pagination |
@@ -2021,6 +2097,30 @@ Multipart request bodies expand plain objects into bracketed fields (for example
2021
2097
  |---|---|---|---|---|
2022
2098
  | retrieve | GET | `/registry/v1/packages/{package_id}` | no | no |
2023
2099
 
2100
+ ### registry.packages.git
2101
+
2102
+ | Method | HTTP | Path | Streaming | Pagination |
2103
+ |---|---|---|---|---|
2104
+ | retrieveLog | GET | `/registry/v1/packages/{package_id}/git/log` | no | no |
2105
+
2106
+ ### registry.packages.git.commits
2107
+
2108
+ | Method | HTTP | Path | Streaming | Pagination |
2109
+ |---|---|---|---|---|
2110
+ | retrieve | GET | `/registry/v1/packages/{package_id}/git/commits/{sha}` | no | no |
2111
+
2112
+ ### registry.packages.git.files
2113
+
2114
+ | Method | HTTP | Path | Streaming | Pagination |
2115
+ |---|---|---|---|---|
2116
+ | retrieve | GET | `/registry/v1/packages/{package_id}/git/files/{path}` | no | no |
2117
+
2118
+ ### registry.packages.git.trees
2119
+
2120
+ | Method | HTTP | Path | Streaming | Pagination |
2121
+ |---|---|---|---|---|
2122
+ | retrieve | GET | `/registry/v1/packages/{package_id}/git/trees/{sha}` | no | no |
2123
+
2024
2124
  ### registry.packages.installations
2025
2125
 
2026
2126
  | Method | HTTP | Path | Streaming | Pagination |
@@ -2068,6 +2168,33 @@ Multipart request bodies expand plain objects into bracketed fields (for example
2068
2168
 
2069
2169
  ## sandbox
2070
2170
 
2171
+ ### sandbox.byod.devices
2172
+
2173
+ | Method | HTTP | Path | Streaming | Pagination |
2174
+ |---|---|---|---|---|
2175
+ | list | GET | `/sandbox/v1/byod/devices` | no | no |
2176
+ | retrieve | GET | `/sandbox/v1/byod/devices/{deviceID}` | no | no |
2177
+ | update | PATCH | `/sandbox/v1/byod/devices/{deviceID}` | no | no |
2178
+
2179
+ ### sandbox.byod.devices.disconnect
2180
+
2181
+ | Method | HTTP | Path | Streaming | Pagination |
2182
+ |---|---|---|---|---|
2183
+ | create | POST | `/sandbox/v1/byod/devices/{deviceID}/disconnect` | no | no |
2184
+
2185
+ ### sandbox.byod.pairings
2186
+
2187
+ | Method | HTTP | Path | Streaming | Pagination |
2188
+ |---|---|---|---|---|
2189
+ | create | POST | `/sandbox/v1/byod/pairings` | no | no |
2190
+ | retrieve | GET | `/sandbox/v1/byod/pairings/{code}` | no | no |
2191
+
2192
+ ### sandbox.byod.pairings.claim
2193
+
2194
+ | Method | HTTP | Path | Streaming | Pagination |
2195
+ |---|---|---|---|---|
2196
+ | create | POST | `/sandbox/v1/byod/pairings/{code}/claim` | no | no |
2197
+
2071
2198
  ### sandbox.events.sandboxes
2072
2199
 
2073
2200
  | Method | HTTP | Path | Streaming | Pagination |
@@ -2078,6 +2205,7 @@ Multipart request bodies expand plain objects into bracketed fields (for example
2078
2205
 
2079
2206
  | Method | HTTP | Path | Streaming | Pagination |
2080
2207
  |---|---|---|---|---|
2208
+ | act | POST | `/sandbox/v1/sandboxes/{sandboxID}/act` | no | no |
2081
2209
  | connect | POST | `/sandbox/v1/sandboxes/{sandboxID}/connect` | no | no |
2082
2210
  | create | POST | `/sandbox/v1/sandboxes` | no | no |
2083
2211
  | delete | DELETE | `/sandbox/v1/sandboxes/{sandboxID}` | no | no |
@@ -2622,6 +2750,8 @@ Multipart request bodies expand plain objects into bracketed fields (for example
2622
2750
  |---|---|
2623
2751
  | 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. |
2624
2752
  | 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. |
2753
+ | 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. |
2754
+ | 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. |
2625
2755
  | agent.sessions.events.send | Events submit session input; the product verb is send rather than create. |
2626
2756
  | automation.hooks.send | Delivers a payload to a trigger's secret webhook URL; it sends an event rather than updating a hook resource. |
2627
2757
  | automation.scripts.distTags.set | A dist-tag assigns a version to a name; use npm vocabulary set rather than update. |
@@ -2670,6 +2800,7 @@ Multipart request bodies expand plain objects into bracketed fields (for example
2670
2800
  | 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. |
2671
2801
  | 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. |
2672
2802
  | meta.docs.search | Documentation keyword search is an operation on docs, not a nested collection. |
2803
+ | 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. |
2673
2804
  | sandbox.sandboxes.commands.run | Sandbox data operations use the E2B SDK verb while preserving URL resource nesting. |
2674
2805
  | sandbox.sandboxes.files.remove | Sandbox data operations use the E2B SDK verb while preserving URL resource nesting. |
2675
2806
  | sandbox.sandboxes.files.read | Sandbox data operations use the E2B SDK verb while preserving URL resource nesting. |
@@ -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
+ ];