@deepraxis/sdk 0.1.0-dev.4cbfc1f → 0.1.0-dev.5dca2b5

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.
@@ -0,0 +1,24 @@
1
+ import type { Praxis } from '../core/client.js';
2
+ import type { OwnFileOpenAiFile } from '../generated/types.gen.js';
3
+ export interface UploadFileOptions {
4
+ /** user_data for conversation attachments; assistants for assistant files; vision for PNG/JPEG/GIF/WebP. */
5
+ purpose: 'user_data' | 'assistants' | 'vision';
6
+ /** Defaults to File.name, or upload for a Blob. */
7
+ filename?: string;
8
+ /** Fixed part size in bytes, 5 MiB–64 MB; defaults to 50 MiB. */
9
+ partSize?: number;
10
+ /** Concurrent part requests, a positive integer; defaults to 3. */
11
+ concurrency?: number;
12
+ /** Aborts outstanding requests and cancels an unfinished Upload. */
13
+ signal?: AbortSignal;
14
+ /** Acknowledged byte fraction, 0–1. A value of 1 does not imply processing has finished. */
15
+ onProgress?: (fraction: number) => void;
16
+ }
17
+ export type UploadedFile = OwnFileOpenAiFile;
18
+ /** Upload a nonempty file up to 2 GiB, returning only after processing reaches active.
19
+ * Files up to 32 MiB use one request; larger files use fixed-size Uploads parts.
20
+ * Parts and complete each retry transient failures at most five times with exponential backoff.
21
+ * A terminal failure or abort cancels the Upload. Completed files cannot be cancelled;
22
+ * if abort occurs during processing, delete the resulting file explicitly if no longer needed.
23
+ */
24
+ export declare function uploadFile(client: Pick<Praxis, 'file'>, file: Blob | File, options: UploadFileOptions): Promise<UploadedFile>;
@@ -0,0 +1,113 @@
1
+ import { PraxisError, PraxisConnectionError, PraxisTimeoutError } from "../core/errors.js";
2
+ import { sleep } from "../core/retry.js";
3
+ const MAX_RETRIES = 5;
4
+ function retryable(error) {
5
+ return error instanceof PraxisConnectionError || error instanceof PraxisTimeoutError
6
+ || error instanceof SyntaxError
7
+ || (error instanceof PraxisError && (error.status === 408 || error.status === 429 || (error.status !== undefined && error.status >= 500 && error.status <= 599)));
8
+ }
9
+ async function retry(signal, operation) {
10
+ for (let used = 0;; used++) {
11
+ signal.throwIfAborted();
12
+ try {
13
+ return await operation();
14
+ }
15
+ catch (error) {
16
+ signal.throwIfAborted();
17
+ if (used >= MAX_RETRIES || !retryable(error))
18
+ throw error;
19
+ await sleep(500 * 2 ** used, signal);
20
+ }
21
+ }
22
+ }
23
+ /** Upload a nonempty file up to 2 GiB, returning only after processing reaches active.
24
+ * Files up to 32 MiB use one request; larger files use fixed-size Uploads parts.
25
+ * Parts and complete each retry transient failures at most five times with exponential backoff.
26
+ * A terminal failure or abort cancels the Upload. Completed files cannot be cancelled;
27
+ * if abort occurs during processing, delete the resulting file explicitly if no longer needed.
28
+ */
29
+ export async function uploadFile(client, file, options) {
30
+ options.signal?.throwIfAborted();
31
+ if (file.size < 1 || file.size > 2 * 1024 ** 3)
32
+ throw new RangeError('File size must be 1 byte through 2 GiB');
33
+ const partSize = options.partSize ?? 50 * 1024 ** 2;
34
+ const concurrency = options.concurrency ?? 3;
35
+ if (!Number.isSafeInteger(partSize) || partSize < 5 * 1024 ** 2 || partSize > 64_000_000)
36
+ throw new RangeError('partSize must be an integer from 5242880 through 64000000');
37
+ if (!Number.isSafeInteger(concurrency) || concurrency < 1)
38
+ throw new RangeError('concurrency must be a positive integer');
39
+ const filename = options.filename ?? (typeof File !== 'undefined' && file instanceof File ? file.name : 'upload');
40
+ const work = new AbortController();
41
+ const abort = () => work.abort(options.signal?.reason);
42
+ options.signal?.addEventListener('abort', abort, { once: true });
43
+ const signal = work.signal;
44
+ const request = { signal, maxRetries: 0, timeoutMs: 120_000 };
45
+ let uploadId;
46
+ const active = async (initial) => {
47
+ let result = initial;
48
+ for (let polls = 0;; polls++) {
49
+ signal.throwIfAborted();
50
+ if (result.state === 'active')
51
+ return result;
52
+ if (result.state !== 'processing')
53
+ throw new PraxisError({ code: 'FILE_PROCESSING_FAILED', message: `File ${result.id} is not active (${result.state})` });
54
+ await sleep(Math.min(5000, 1000 * 2 ** polls), signal);
55
+ result = await retry(signal, () => client.file.files.retrieve({ path: { file_id: result.id }, ...request }));
56
+ }
57
+ };
58
+ try {
59
+ signal.throwIfAborted();
60
+ options.onProgress?.(0);
61
+ if (file.size <= 32 * 1024 ** 2) {
62
+ const result = await client.file.files.create({ body: { file: new File([file], filename, { type: file.type }), purpose: options.purpose }, ...request });
63
+ options.onProgress?.(1);
64
+ return await active(result);
65
+ }
66
+ const upload = await client.file.uploads.create({ body: { bytes: file.size, filename, mime_type: file.type || 'application/octet-stream', purpose: options.purpose, part_size: partSize }, ...request });
67
+ uploadId = upload.id;
68
+ signal.throwIfAborted();
69
+ const path = { upload_id: uploadId };
70
+ const count = Math.ceil(file.size / partSize);
71
+ const ids = new Array(count);
72
+ let cursor = 0, confirmed = 0;
73
+ const worker = async () => {
74
+ while (cursor < count) {
75
+ signal.throwIfAborted();
76
+ const index = cursor++;
77
+ const chunk = file.slice(index * partSize, Math.min(file.size, (index + 1) * partSize));
78
+ const part = await retry(signal, () => client.file.uploads.parts.create({ path, query: { part_number: index + 1 }, body: { data: new File([chunk], filename) }, ...request }));
79
+ ids[index] = part.id;
80
+ confirmed += chunk.size;
81
+ options.onProgress?.(confirmed / file.size);
82
+ }
83
+ };
84
+ const workers = Array.from({ length: Math.min(concurrency, count) }, worker);
85
+ try {
86
+ await Promise.all(workers);
87
+ }
88
+ catch (error) {
89
+ work.abort();
90
+ await Promise.allSettled(workers);
91
+ throw error;
92
+ }
93
+ const result = await retry(signal, () => client.file.uploads.complete({ path, body: { part_ids: ids }, ...request }));
94
+ if (result.error)
95
+ throw new PraxisError({ code: result.error.code, message: result.error.message });
96
+ if (result.status !== 'completed' || !result.file)
97
+ throw new PraxisError({ code: 'INVALID_RESPONSE', message: 'Complete did not return a completed Upload with a file' });
98
+ return await active(result.file);
99
+ }
100
+ catch (error) {
101
+ work.abort();
102
+ if (uploadId) {
103
+ // Cleanup uses its own timeout and must not inherit the aborted work signal.
104
+ await client.file.uploads.cancel({ path: { upload_id: uploadId }, maxRetries: 0, timeoutMs: 10_000 }).catch(() => { });
105
+ }
106
+ if (options.signal?.aborted)
107
+ throw options.signal.reason;
108
+ throw error;
109
+ }
110
+ finally {
111
+ options.signal?.removeEventListener('abort', abort);
112
+ }
113
+ }
package/dist/index.d.ts CHANGED
@@ -9,3 +9,5 @@ export { publish } from './helpers/application-publish.js';
9
9
  export type { PublishInput, PublishResult, AssetsConfig } from './helpers/application-publish.js';
10
10
  export { count } from './helpers/database-count.js';
11
11
  export type { CountInput, CountResult } from './helpers/database-count.js';
12
+ export { uploadFile } from './helpers/file-upload.js';
13
+ export type { UploadFileOptions, UploadedFile } from './helpers/file-upload.js';
package/dist/index.js CHANGED
@@ -4,3 +4,4 @@ export { Page } from "./core/pagination.js";
4
4
  export { parseSSE } from "./core/sse.js";
5
5
  export { publish } from "./helpers/application-publish.js";
6
6
  export { count } from "./helpers/database-count.js";
7
+ export { uploadFile } from "./helpers/file-upload.js";
@@ -102,6 +102,24 @@ export declare const operations: readonly [{
102
102
  readonly itemType: "object";
103
103
  readonly required: false;
104
104
  readonly description: "Tool configurations available to the agent. Maximum of 128 tools\nacross all toolsets allowed.";
105
+ }, {
106
+ readonly name: "databases";
107
+ readonly type: "array";
108
+ readonly itemType: "object";
109
+ readonly required: false;
110
+ readonly description: "Database allowlist for platform resources accessible through service-agent codemode. Only kind=service accepts nonempty bindings; personal agents return 400. At most 20 bindings per resource type, with no duplicate ids. Newly added bindings apply only to new sessions; disabling or removing a binding immediately revokes access in running sessions. Unbound resources return 404; writes to read_only resources are refused. Other platform APIs return 403, except public API discovery. Invalid bindings and unknown item fields return 400. Omit on create for no bindings.";
111
+ }, {
112
+ readonly name: "vector_stores";
113
+ readonly type: "array";
114
+ readonly itemType: "object";
115
+ readonly required: false;
116
+ readonly description: "Knowledge vector store allowlist for platform resources accessible through service-agent codemode. Only kind=service accepts nonempty bindings; personal agents return 400. At most 20 bindings per resource type, with no duplicate ids. Newly added bindings apply only to new sessions; disabling or removing a binding immediately revokes access in running sessions. Unbound resources return 404; writes to read_only resources are refused. Other platform APIs return 403, except public API discovery. Invalid bindings and unknown item fields return 400. Omit on create for no bindings.";
117
+ }, {
118
+ readonly name: "files";
119
+ readonly type: "array";
120
+ readonly itemType: "object";
121
+ readonly required: false;
122
+ readonly description: "File allowlist for platform resources accessible through service-agent codemode. Only kind=service accepts nonempty bindings; personal agents return 400. At most 20 bindings per resource type, with no duplicate ids. Newly added bindings apply only to new sessions; disabling or removing a binding immediately revokes access in running sessions. Unbound resources return 404; writes to read_only resources are refused. Other platform APIs return 403, except public API discovery. Invalid bindings and unknown item fields return 400. Omit on create for no bindings.";
105
123
  }, {
106
124
  readonly name: "kind";
107
125
  readonly type: "string";
@@ -236,6 +254,24 @@ export declare const operations: readonly [{
236
254
  readonly type: "number";
237
255
  readonly required: false;
238
256
  readonly description: "The agent's current version, used to prevent concurrent overwrites.\nObtain this value from a create or retrieve response. Must be at least 1 if\nspecified. When supplied, the request fails if it does not match the server's\ncurrent version; omit to apply the update unconditionally.";
257
+ }, {
258
+ readonly name: "databases";
259
+ readonly type: "array";
260
+ readonly itemType: "object";
261
+ readonly required: false;
262
+ readonly description: "Replace this resource allowlist; omission preserves it, and null or [] clears it. Additions apply only to new sessions; disabling or removing a binding immediately revokes access in running sessions. Only service agents accept nonempty bindings.";
263
+ }, {
264
+ readonly name: "vector_stores";
265
+ readonly type: "array";
266
+ readonly itemType: "object";
267
+ readonly required: false;
268
+ readonly description: "Replace this resource allowlist; omission preserves it, and null or [] clears it. Additions apply only to new sessions; disabling or removing a binding immediately revokes access in running sessions. Only service agents accept nonempty bindings.";
269
+ }, {
270
+ readonly name: "files";
271
+ readonly type: "array";
272
+ readonly itemType: "object";
273
+ readonly required: false;
274
+ readonly description: "Replace this resource allowlist; omission preserves it, and null or [] clears it. Additions apply only to new sessions; disabling or removing a binding immediately revokes access in running sessions. Only service agents accept nonempty bindings.";
239
275
  }, {
240
276
  readonly name: "kind";
241
277
  readonly type: "string";
@@ -608,7 +644,7 @@ export declare const operations: readonly [{
608
644
  readonly resource: "agent.computers";
609
645
  readonly method: "connect";
610
646
  readonly summary: "Connect computer";
611
- readonly description: "Resume the computer and issue a sandbox connection.\n\nOwn-face extension: Managed Agents has no persistent Computer connection. Returns the public SDK sandbox_id, envd_access_token and template_id, plus the machine tier the computer is on now (light or heavy) and the lease that keeps it there (lease_id, lease_expires_at; lease_id is null when no lease exists). Keep the lease while the connection stays open: renew it about every 20 seconds (POST .../leases/{lease_id}/renew) and release it on close (DELETE .../leases/{lease_id}). An unrenewed lease simply expires, and the full machine is reclaimed only after that. Archived computers remain accessible; foreign or absent computers return 404. Never cache credentials.\n\nConnect to a computer with a caller-held lease. Omit the body or send {} to request light: the lightweight shell, or the heavy instance while it is running. Send {\"need\":\"heavy\"} to request full Linux for interactive programs; files are synchronized before the heavy connection is returned with tier heavy. Heavy running time counts toward the daily budget in seconds. Renew the lease while using the connection and release it with DELETE when finished. If the daily budget is exhausted, 429 COMPUTER_BUDGET_EXHAUSTED allows you to continue with need light.";
647
+ readonly description: "Resume the computer and issue a sandbox connection.\n\nOwn-face extension: Managed Agents has no persistent Computer connection. Returns the public SDK sandbox_id, envd_access_token and template_id, plus the machine tier the computer is on now (light or heavy) and the lease that keeps it there (lease_id, lease_expires_at; lease_id is null when no lease exists). Keep the lease while the connection stays open: renew it about every 20 seconds (POST .../leases/{lease_id}/renew) and release it on close (DELETE .../leases/{lease_id}). An unrenewed lease simply expires, and the full machine is reclaimed only after that. Archived computers remain accessible; foreign or absent computers return 404. Never cache credentials.\n\nConnect to a computer with a caller-held lease. Omit the body or send {} to request light: the lightweight shell, or the heavy instance while it is running. Send {\"need\":\"heavy\"} to request full Linux for interactive programs; files are synchronized before the heavy connection is returned with tier heavy. Renew the lease while using the connection and release it with DELETE when finished.";
612
648
  readonly http: "POST";
613
649
  readonly path: "/agent/v1/computers/{computer_id}/connect";
614
650
  readonly streaming: "no";
@@ -1442,7 +1478,7 @@ export declare const operations: readonly [{
1442
1478
  readonly resource: "agent.sessions";
1443
1479
  readonly method: "create";
1444
1480
  readonly summary: "Create session";
1445
- readonly description: "Create a session: one conversation with an agent, running on a machine. Pass agent as an agent id (latest version) or {id, version, type:\"agent\"}. Unlike Anthropic Managed Agents, omit environment_id to get a light machine, unless computer_id (explicit, or the agent's default) selects a Computer; pass environment_id for a sandbox recipe. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Inline agent overrides are not supported. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Omitted budget defaults to USD 20; null removes the limit, and a limit object uses a positive integer string of USD cents. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion.";
1481
+ readonly description: "Create a session: one conversation with an agent. Pass agent as an agent id (latest version) or {id, version, type:\"agent\"}. Unlike Anthropic Managed Agents, omit environment_id to get a light machine, unless computer_id (explicit, or the agent's default) selects a Computer; pass an environment id for a sandbox recipe. For service agents, omission returns environment_id=light; explicit null allocates no machine, so codemode, bash and other machine tools are unavailable. Optional model must be one of the agent's allowed models; optional thinking is {effort: low|medium|high|xhigh|max|none} or null, where null inherits the agent default and then the model default (none requires the model to allow disabling thinking). Selections are saved before initial_events run; invalid ones return 400 invalid_request_error. Inline agent overrides are not supported. Supports vault_ids, up to 50, owned by the current organization and not archived; credential injection is deferred to a later version. Omitted budget defaults to USD 20; null removes the limit, and a limit object uses a positive integer string of USD cents. Up to 500 file resources can be attached. Use initial_events to send a first user.message in this request, or send messages afterwards with sessions.events.send. The returned status can still be idle before initial events run; read agent.message and the subsequent session.status_idle event to confirm completion.";
1446
1482
  readonly http: "POST";
1447
1483
  readonly path: "/agent/v1/sessions";
1448
1484
  readonly streaming: "no";
@@ -1460,7 +1496,7 @@ export declare const operations: readonly [{
1460
1496
  readonly name: "environment_id";
1461
1497
  readonly type: "string";
1462
1498
  readonly required: false;
1463
- readonly description: "ID of the `environment` defining the container configuration for\nthis session.";
1499
+ readonly description: "Execution environment id from agent.environments.list or agent.environments.create. For a service agent, omission selects the built-in light environment and returns session.environment_id=light; explicit null allocates no machine and makes machine tools, including codemode and bash, unavailable. Personal agents use their selected Computer.";
1464
1500
  }, {
1465
1501
  readonly name: "budget";
1466
1502
  readonly type: "object";
@@ -6113,7 +6149,7 @@ export declare const operations: readonly [{
6113
6149
  readonly resource: "file.files";
6114
6150
  readonly method: "create";
6115
6151
  readonly summary: "Upload file";
6116
- readonly description: "Upload a file to reuse in conversations or attach to a knowledge base. Unlike OpenAI Files, uploads must be nonempty and at most 104857600 bytes, and only user_data, assistants and vision purposes are accepted. Send file bytes as a multipart file part, not a filename or file ID; in the SDK use a File or Blob, for example new File([\"Return within 23 days.\"], \"policy.txt\", { type: \"text/plain\" }). Content determines the MIME type. Supported uploads include PDF, DOCX/XLSX/PPTX, PNG/JPEG/GIF/WebP, MP3/WAV/FLAC/OGG/M4A, MP4/WebM, and UTF-8 JSON/NDJSON/CSV/Markdown/plain text; empty, unsupported, oversized files and unsupported purposes return 400. OpenAI Uploads chunking is not supported. The purpose vision accepts only PNG, JPEG, GIF and WebP, while conversation images require user_data. The returned ID belongs to your tenant; upload alone does not ingest the file into Knowledge. Knowledge attachment has a lower limit of 100000000 bytes. Optionally set expires_after[anchor]=created_at with expires_after[seconds] (3600–2592000), or praxis[expires_in_seconds] (3600–7776000), never both. Without expiry, the file persists until deleted.";
6152
+ readonly description: "Upload a file to reuse in conversations or attach to a knowledge base. Unlike OpenAI Files, uploads must be nonempty and at most 100000000 bytes, and only user_data, assistants and vision purposes are accepted. Send file bytes as a multipart file part, not a filename or file ID; in the SDK use a File or Blob, for example new File([\"Return within 23 days.\"], \"policy.txt\", { type: \"text/plain\" }). Content determines the MIME type. Supported uploads include PDF, DOCX/XLSX/PPTX, PNG/JPEG/GIF/WebP, MP3/WAV/FLAC/OGG/M4A, MP4/WebM, and UTF-8 JSON/NDJSON/CSV/Markdown/plain text; empty, unsupported, oversized files and unsupported purposes return 400. Use Uploads for larger files. The purpose vision accepts only PNG, JPEG, GIF and WebP, while conversation images require user_data. The returned ID belongs to your tenant; upload alone does not ingest the file into Knowledge. Knowledge attachment has a lower limit of 100000000 bytes. Optionally set expires_after[anchor]=created_at with expires_after[seconds] (3600–2592000), or praxis[expires_in_seconds] (3600–7776000), never both. Without expiry, the file persists until deleted.";
6117
6153
  readonly http: "POST";
6118
6154
  readonly path: "/file/v1/files";
6119
6155
  readonly streaming: "no";
@@ -6127,7 +6163,7 @@ export declare const operations: readonly [{
6127
6163
  readonly name: "file";
6128
6164
  readonly type: "string";
6129
6165
  readonly required: true;
6130
- readonly description: "File bytes in one multipart file part, not a filename or file ID. The file must be nonempty and at most 104857600 bytes; its content determines the MIME type.";
6166
+ readonly description: "File bytes in one multipart file part, not a filename or file ID. The file must be nonempty and at most 100000000 bytes; its content determines the MIME type.";
6131
6167
  }, {
6132
6168
  readonly name: "purpose";
6133
6169
  readonly type: "string";
@@ -6164,7 +6200,7 @@ export declare const operations: readonly [{
6164
6200
  readonly resource: "file.files";
6165
6201
  readonly method: "retrieve";
6166
6202
  readonly summary: "Retrieve file";
6167
- readonly description: "Retrieve metadata for a live file owned by your tenant. Use its file_dp_ ID from upload or list. Missing, deleted, expired and other-tenant files return 404; use the content endpoint to download the bytes.";
6203
+ readonly description: "Retrieve metadata for a live file owned by your tenant. Use its file- ID from upload or list. Missing, deleted, expired and other-tenant files return 404; use the content endpoint to download the bytes.";
6168
6204
  readonly http: "GET";
6169
6205
  readonly path: "/file/v1/files/{file_id}";
6170
6206
  readonly streaming: "no";
@@ -6178,7 +6214,7 @@ export declare const operations: readonly [{
6178
6214
  readonly resource: "file.files";
6179
6215
  readonly method: "retrieveContent";
6180
6216
  readonly summary: "Retrieve file content";
6181
- readonly description: "Download the original bytes of a live file owned by your tenant. Supply its file_dp_ ID from upload or list. A single byte Range can return a partial response; a range outside the file returns 416. Missing, deleted, expired and other-tenant files return 404.";
6217
+ readonly description: "Download the original bytes of a live file owned by your tenant. Supply its file- ID from upload or list. A single byte Range can return a partial response; a range outside the file returns 416. Missing, deleted, expired and other-tenant files return 404.";
6182
6218
  readonly http: "GET";
6183
6219
  readonly path: "/file/v1/files/{file_id}/content";
6184
6220
  readonly streaming: "no";
@@ -6188,6 +6224,124 @@ export declare const operations: readonly [{
6188
6224
  readonly sdkName: "file_id";
6189
6225
  }];
6190
6226
  readonly query: readonly [];
6227
+ }, {
6228
+ readonly resource: "file.uploads";
6229
+ readonly method: "create";
6230
+ readonly summary: "Create an upload";
6231
+ readonly description: "Start a multipart upload for a file larger than the 100000000-byte direct-upload limit. Supply the exact byte length, filename, MIME type and purpose. Unlike OpenAI, uploads accept at most 2 GiB (2147483648 bytes) and only user_data, assistants and vision purposes. Add parts of at most 64000000 bytes and complete within one hour. Optional part_size enables fixed-size, retryable parts. expires_after applies to the resulting file (3600–7776000 seconds on this own face); without it the file persists until deleted.";
6232
+ readonly http: "POST";
6233
+ readonly path: "/file/v1/uploads";
6234
+ readonly streaming: "no";
6235
+ readonly pagination: false;
6236
+ readonly pathParams: readonly [];
6237
+ readonly query: readonly [];
6238
+ readonly body: {
6239
+ readonly required: true;
6240
+ readonly fields: readonly [{
6241
+ readonly name: "bytes";
6242
+ readonly type: "integer";
6243
+ readonly required: true;
6244
+ readonly description: "Exact complete file length in bytes, from 1 through 2147483648 (2 GiB); the sum of completed parts must match.";
6245
+ }, {
6246
+ readonly name: "filename";
6247
+ readonly type: "string";
6248
+ readonly required: true;
6249
+ readonly description: "Filename for the resulting file, at most 255 UTF-8 bytes.";
6250
+ }, {
6251
+ readonly name: "mime_type";
6252
+ readonly type: "string";
6253
+ readonly required: true;
6254
+ readonly description: "Declared MIME type; validated against the assembled content.";
6255
+ }, {
6256
+ readonly name: "purpose";
6257
+ readonly type: "string";
6258
+ readonly enum: readonly ["user_data", "assistants", "vision"];
6259
+ readonly required: true;
6260
+ readonly description: "Use user_data for conversation attachments, assistants for assistant files, or vision for PNG, JPEG, GIF and WebP images.";
6261
+ }, {
6262
+ readonly name: "expires_after";
6263
+ readonly type: "object";
6264
+ readonly required: false;
6265
+ readonly description: "Optional expiry policy for the resulting file; omission retains the file until deletion.";
6266
+ }, {
6267
+ readonly name: "part_size";
6268
+ readonly type: "integer";
6269
+ readonly required: false;
6270
+ readonly description: "Optional fixed part size in bytes, 5242880–64000000. Requires part_number on every part; retries of identical bytes at the same number return the same part. Omit to use arbitrary-sized parts.";
6271
+ }];
6272
+ };
6273
+ }, {
6274
+ readonly resource: "file.uploads";
6275
+ readonly method: "cancel";
6276
+ readonly summary: "Cancel an upload";
6277
+ readonly description: "Cancel an unfinished upload using upload_id from create and release its reserved storage. Further parts and completion are rejected. Cancelling an already cancelled upload returns the same terminal result; a completed upload cannot be cancelled. Delete its resulting file instead.";
6278
+ readonly http: "POST";
6279
+ readonly path: "/file/v1/uploads/{upload_id}/cancel";
6280
+ readonly streaming: "no";
6281
+ readonly pagination: false;
6282
+ readonly pathParams: readonly [{
6283
+ readonly name: "upload_id";
6284
+ readonly sdkName: "upload_id";
6285
+ }];
6286
+ readonly query: readonly [];
6287
+ }, {
6288
+ readonly resource: "file.uploads";
6289
+ readonly method: "complete";
6290
+ readonly summary: "Complete an upload";
6291
+ readonly description: "Assemble the uploaded parts into a file. Supply upload_id from create and part_ids from addPart in file byte order; their sizes must total the declared bytes. Optional md5 verifies the assembled content. Retrying identical part_ids and normalized md5 returns the same result; different inputs return 409. Unlike OpenAI, completed can contain a file still processing (status uploaded). Poll files.retrieve using file.id until status processed (own face state active); error, expiry or 404 means processing failed and the file cannot be used.";
6292
+ readonly http: "POST";
6293
+ readonly path: "/file/v1/uploads/{upload_id}/complete";
6294
+ readonly streaming: "no";
6295
+ readonly pagination: false;
6296
+ readonly pathParams: readonly [{
6297
+ readonly name: "upload_id";
6298
+ readonly sdkName: "upload_id";
6299
+ }];
6300
+ readonly query: readonly [];
6301
+ readonly body: {
6302
+ readonly required: true;
6303
+ readonly fields: readonly [{
6304
+ readonly name: "part_ids";
6305
+ readonly type: "array";
6306
+ readonly itemType: "string";
6307
+ readonly required: true;
6308
+ readonly description: "All part IDs in concatenation order, without duplicates. Fixed-size uploads require increasing part_number order.";
6309
+ }, {
6310
+ readonly name: "md5";
6311
+ readonly type: "string";
6312
+ readonly required: false;
6313
+ readonly description: "Optional whole-file MD5 as 32 hexadecimal characters; verified after assembly.";
6314
+ }];
6315
+ };
6316
+ }, {
6317
+ readonly resource: "file.uploads.parts";
6318
+ readonly method: "create";
6319
+ readonly summary: "Add an upload part";
6320
+ readonly description: "Send one nonempty part as the multipart data field, at most 64000000 bytes. Parts may arrive concurrently in any order. Use upload_id from create. For a fixed-size upload, supply part_number starting at 1 and exactly part_size bytes except for the final remainder; retry the same number with identical bytes to recover its part ID. Without part_size, each request creates a new part and part_number is ignored. Save the returned part IDs for complete.";
6321
+ readonly http: "POST";
6322
+ readonly path: "/file/v1/uploads/{upload_id}/parts";
6323
+ readonly streaming: "no";
6324
+ readonly pagination: false;
6325
+ readonly multipart: true;
6326
+ readonly pathParams: readonly [{
6327
+ readonly name: "upload_id";
6328
+ readonly sdkName: "upload_id";
6329
+ }];
6330
+ readonly query: readonly [{
6331
+ readonly name: "part_number";
6332
+ readonly type: "integer";
6333
+ readonly required: false;
6334
+ readonly description: "Required when create set part_size; 1 through ceil(bytes / part_size). Ignored for general uploads.";
6335
+ }];
6336
+ readonly body: {
6337
+ readonly required: true;
6338
+ readonly fields: readonly [{
6339
+ readonly name: "data";
6340
+ readonly type: "string";
6341
+ readonly required: true;
6342
+ readonly description: "Raw bytes of this part, nonempty and at most 64000000 bytes.";
6343
+ }];
6344
+ };
6191
6345
  }, {
6192
6346
  readonly resource: "knowledge.vectorStores";
6193
6347
  readonly method: "list";
@@ -9462,7 +9616,7 @@ export declare const operations: readonly [{
9462
9616
  readonly name: "message";
9463
9617
  readonly type: "string";
9464
9618
  readonly required: true;
9465
- readonly description: "Problem description and original error text; at most 4096 Unicode code points.";
9619
+ readonly description: "Problem description, at most 4096 Unicode code points; may be empty only when contexts.praxis.error.message is a non-empty string.";
9466
9620
  }, {
9467
9621
  readonly name: "contact_email";
9468
9622
  readonly type: "string";
@@ -9697,7 +9851,7 @@ export declare const operations: readonly [{
9697
9851
  readonly resource: "sandbox.sandboxes";
9698
9852
  readonly method: "create";
9699
9853
  readonly summary: "Create sandbox (v2)";
9700
- readonly description: "Start an isolated environment using a templateID from templates.list, then retain sandboxID for lifecycle calls. Unlike E2B, templateID resolves to your ready Environment or a public Base; omit it to use the default base template (`base`), as the E2B SDK does. timeout is seconds from creation and defaults to 300. envVars supplies environment variables and metadata stores your string labels. All system communication is secured; use the returned envdAccessToken for files and commands through the envd data plane, not the management methods. Never print that token.";
9854
+ readonly description: "Create a sandbox from the template. All system communication with the sandbox is secured.";
9701
9855
  readonly http: "POST";
9702
9856
  readonly path: "/sandbox/v1/sandboxes";
9703
9857
  readonly streaming: "no";
@@ -9710,7 +9864,7 @@ export declare const operations: readonly [{
9710
9864
  readonly name: "templateID";
9711
9865
  readonly type: "string";
9712
9866
  readonly required: true;
9713
- readonly description: "Template ID or alias from templates.list; resolves to your ready Environment first, then a public Base. Omit it to use the default base template (`base`).";
9867
+ readonly description: "Identifier of the required template";
9714
9868
  }, {
9715
9869
  readonly name: "timeout";
9716
9870
  readonly type: "integer";
@@ -9824,7 +9978,7 @@ export declare const operations: readonly [{
9824
9978
  readonly resource: "sandbox.sandboxes";
9825
9979
  readonly method: "connect";
9826
9980
  readonly summary: "Connect sandbox (v2)";
9827
- readonly description: "Reconnect to an existing sandbox and resume it if paused. The optional timeout is seconds from now and defaults to 300; a later existing deadline is preserved. A running sandbox returns 200 and a resumed sandbox returns 201. Read sandboxID, domain and envdAccessToken from the response for subsequent data-plane access; never treat connecting as executing a command.";
9981
+ readonly description: "Returns sandbox details. If the sandbox is paused, it will be resumed. TTL is only extended. The request body is optional; an omitted timeout defaults to 300 seconds.";
9828
9982
  readonly http: "POST";
9829
9983
  readonly path: "/sandbox/v1/sandboxes/{sandboxID}/connect";
9830
9984
  readonly streaming: "no";
@@ -9945,7 +10099,7 @@ export declare const operations: readonly [{
9945
10099
  readonly resource: "sandbox.sandboxes.metrics";
9946
10100
  readonly method: "list";
9947
10101
  readonly summary: "Sandbox metrics";
9948
- readonly description: "Read CPU, memory and disk usage over the requested interval; start and end are Unix seconds. Unlike E2B, light sandboxes do not provide metrics; check the returned capabilities before requesting them.";
10102
+ readonly description: "Read CPU, memory and disk usage samples of a sandbox over a time window. Use it to size a sandbox or find out why it is slow. start and end are Unix timestamps in seconds; without them the recent samples are returned. An unknown id answers 404.";
9949
10103
  readonly http: "GET";
9950
10104
  readonly path: "/sandbox/v1/sandboxes/{sandboxID}/metrics";
9951
10105
  readonly streaming: "no";
@@ -10014,7 +10168,7 @@ export declare const operations: readonly [{
10014
10168
  readonly resource: "sandbox.sandboxes";
10015
10169
  readonly method: "pause";
10016
10170
  readonly summary: "Pause sandbox";
10017
- readonly description: "Suspend a running sandbox for later connection; use delete to discard it instead. Unlike E2B, light sandboxes preserve disk rather than memory, and persistent sandboxes can resume on data-plane traffic even when autoResume is false. Inspect paused state with the management retrieve operation to avoid waking the sandbox. Explicitly ephemeral sandboxes cannot pause. memory defaults to true, but only a memory-capable sandbox preserves running processes; memory=false saves disk state and resumes with a cold boot. Success returns 204; connect resumes the saved sandbox.";
10171
+ readonly description: "Pause a running sandbox, keeping its files and memory so that connectSandbox can resume it later. Use it to stop paying for compute without losing state; to discard the sandbox use killSandbox. Success answers 204. A sandbox that is not running answers 409.";
10018
10172
  readonly http: "POST";
10019
10173
  readonly path: "/sandbox/v1/sandboxes/{sandboxID}/pause";
10020
10174
  readonly streaming: "no";
@@ -10330,7 +10484,7 @@ export declare const operations: readonly [{
10330
10484
  readonly resource: "sandbox.templates";
10331
10485
  readonly method: "list";
10332
10486
  readonly summary: "List templates (v2)";
10333
- readonly description: "Choose a templateID before creating a sandbox. Unlike E2B, this catalog lists your ready Environments and public Bases; use a returned ID or alias; `base` is the default template that create uses when templateID is omitted. Page through results using nextToken.";
10487
+ readonly description: "List the templates you can create sandboxes from. Use it to pick the template id or alias for createSandbox. `base` is the default template that createSandbox uses when templateID is omitted. limit is 1 to 100 (default 100); send the cursor from the response back as nextToken to continue.";
10334
10488
  readonly http: "GET";
10335
10489
  readonly path: "/sandbox/v1/templates";
10336
10490
  readonly streaming: "no";