codai-sdk 0.64.0 → 0.65.0

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/dist/index.d.ts CHANGED
@@ -37193,9 +37193,12 @@ export declare class Sandboxes {
37193
37193
  readonly files: SandboxFiles;
37194
37194
  constructor(http: HttpClient);
37195
37195
  /**
37196
- * `POST /v1/sandboxes` — start a sandbox (`ttl_seconds` 60–86400, default 3600; `egress` none by default).
37197
- * `backend: 'v2'` (closed canary) starts a long-lived pod with memory snapshots and accepts `template`
37198
- * `codai-base` | `brivio-acte` | `desktop`; its reply may carry `restored`.
37196
+ * `POST /v1/sandboxes` — start a sandbox (`ttl_seconds` default 3600, max 86400 on v1 / 604800 on v2;
37197
+ * `egress` none by default, or a `pypi`/`npm` preset / allowlist on both backends).
37198
+ * `backend` defaults to `'v2'`: a long-lived pod with memory snapshots, Node 24 + npm, `template`
37199
+ * `codai-base` | `brivio-acte` | `desktop`; its reply may carry `restored`. When `backend` is omitted and v2
37200
+ * is unavailable for the key the gateway falls back to `'v1'` (check `backend` on the reply).
37201
+ * Errors: 429 `sandbox_concurrency_limit` (3 per key, 5 running v2 per user), 503 `sandbox_capacity` (retry).
37199
37202
  */
37200
37203
  create(input?: SandboxCreateInput, opts?: CallOpts$6): Promise<Sandbox>;
37201
37204
  /** `GET /v1/sandboxes` — your sandboxes, newest first, optionally one `status`. */
@@ -37216,7 +37219,7 @@ export declare class Sandboxes {
37216
37219
  execStream(id: string, input: SandboxExecInput, opts?: IdemOpts): AsyncGenerator<SandboxExecEvent, void, undefined>;
37217
37220
  /** `GET /v1/sandboxes/{id}/artifacts` — collect `/workspace/out` (scanned, signed 1 h links). */
37218
37221
  artifacts(id: string, opts?: CallOpts$6): Promise<SandboxArtifactList>;
37219
- /** `POST /v1/sandboxes/{id}/snapshot` — store a compressed copy of the workspace. */
37222
+ /** `POST /v1/sandboxes/{id}/snapshot` (v1 only; v2 answers 409 `not_supported_on_v2`) — store a compressed copy of the workspace. */
37220
37223
  snapshot(id: string, input?: SandboxSnapshotInput, opts?: CallOpts$6): Promise<SandboxSnapshot>;
37221
37224
  /**
37222
37225
  * `POST /v1/sandboxes/{id}/run_code` (v2) — run Python in the persistent kernel; globals survive between
@@ -37225,7 +37228,10 @@ export declare class Sandboxes {
37225
37228
  runCode(id: string, input: SandboxRunCodeInput, opts?: CallOpts$6): Promise<SandboxRunCodeResult>;
37226
37229
  /** `POST /v1/sandboxes/{id}/kernel/reset` (v2) — restart the kernel; globals are lost, files kept. */
37227
37230
  resetKernel(id: string, opts?: CallOpts$6): Promise<void>;
37228
- /** `POST /v1/sandboxes/{id}/pause` (v2) — memory snapshot, then stop the pod (status `paused`). */
37231
+ /**
37232
+ * `POST /v1/sandboxes/{id}/pause` (v2) — memory snapshot, then stop the pod (status `paused`).
37233
+ * At most 10 paused v2 sandboxes per user (429 `sandbox_paused_limit`).
37234
+ */
37229
37235
  pause(id: string, opts?: CallOpts$6): Promise<Sandbox>;
37230
37236
  /** `POST /v1/sandboxes/{id}/resume` (v2) — restore a paused sandbox; `restored: false` = cold start. */
37231
37237
  resume(id: string, opts?: CallOpts$6): Promise<SandboxResumed>;
@@ -38003,7 +38009,7 @@ export declare class Codai {
38003
38009
  readonly orgs: Orgs;
38004
38010
  readonly projects: Projects;
38005
38011
  readonly environments: Environments;
38006
- /** Agent sandboxes (beta) — isolated gVisor workspaces: `sandboxes.create/exec/execStream/files/artifacts/run`. */
38012
+ /** Agent sandboxes (backend v2 by default) — isolated gVisor workspaces: `sandboxes.create/exec/execStream/files/artifacts/run`. */
38007
38013
  readonly sandboxes: Sandboxes;
38008
38014
  /** EXPERIMENTAL (HIDE, unaudited): verify signed agent outputs. Provenance only. */
38009
38015
  readonly verify: Verify;
package/dist/index.js CHANGED
@@ -5317,8 +5317,9 @@ var Memory = class {
5317
5317
  //#endregion
5318
5318
  //#region src/resources/sandboxes.ts
5319
5319
  /**
5320
- * `/v1/sandboxes` — agent sandboxes (beta): isolated gVisor containers with a persistent
5321
- * `/workspace`, no network by default, artifacts from `/workspace/out` as scanned, signed links.
5320
+ * `/v1/sandboxes` — agent sandboxes: isolated gVisor containers with a persistent `/workspace`, no network
5321
+ * by default, artifacts from `/workspace/out` as scanned, signed links. Backend `v2` (default) = long-lived
5322
+ * GKE pod with pause/resume, fork, a persistent kernel and preview URLs; `v1` = Cloud Run, on request.
5322
5323
  */
5323
5324
  const base = (id) => `/v1/sandboxes/${encodeURIComponent(id)}`;
5324
5325
  /** Encode each segment of a workspace path, keeping the slashes. */
@@ -5369,9 +5370,12 @@ var Sandboxes = class {
5369
5370
  this.files = new SandboxFiles(http);
5370
5371
  }
5371
5372
  /**
5372
- * `POST /v1/sandboxes` — start a sandbox (`ttl_seconds` 60–86400, default 3600; `egress` none by default).
5373
- * `backend: 'v2'` (closed canary) starts a long-lived pod with memory snapshots and accepts `template`
5374
- * `codai-base` | `brivio-acte` | `desktop`; its reply may carry `restored`.
5373
+ * `POST /v1/sandboxes` — start a sandbox (`ttl_seconds` default 3600, max 86400 on v1 / 604800 on v2;
5374
+ * `egress` none by default, or a `pypi`/`npm` preset / allowlist on both backends).
5375
+ * `backend` defaults to `'v2'`: a long-lived pod with memory snapshots, Node 24 + npm, `template`
5376
+ * `codai-base` | `brivio-acte` | `desktop`; its reply may carry `restored`. When `backend` is omitted and v2
5377
+ * is unavailable for the key the gateway falls back to `'v1'` (check `backend` on the reply).
5378
+ * Errors: 429 `sandbox_concurrency_limit` (3 per key, 5 running v2 per user), 503 `sandbox_capacity` (retry).
5375
5379
  */
5376
5380
  create(input = {}, opts = {}) {
5377
5381
  return this.http.json("/v1/sandboxes", {
@@ -5440,7 +5444,7 @@ var Sandboxes = class {
5440
5444
  signal: opts.signal
5441
5445
  });
5442
5446
  }
5443
- /** `POST /v1/sandboxes/{id}/snapshot` — store a compressed copy of the workspace. */
5447
+ /** `POST /v1/sandboxes/{id}/snapshot` (v1 only; v2 answers 409 `not_supported_on_v2`) — store a compressed copy of the workspace. */
5444
5448
  snapshot(id, input = {}, opts = {}) {
5445
5449
  return this.http.json(`${base(id)}/snapshot`, {
5446
5450
  method: "POST",
@@ -5474,7 +5478,10 @@ var Sandboxes = class {
5474
5478
  signal: opts.signal
5475
5479
  });
5476
5480
  }
5477
- /** `POST /v1/sandboxes/{id}/pause` (v2) — memory snapshot, then stop the pod (status `paused`). */
5481
+ /**
5482
+ * `POST /v1/sandboxes/{id}/pause` (v2) — memory snapshot, then stop the pod (status `paused`).
5483
+ * At most 10 paused v2 sandboxes per user (429 `sandbox_paused_limit`).
5484
+ */
5478
5485
  pause(id, opts = {}) {
5479
5486
  return this.http.json(`${base(id)}/pause`, {
5480
5487
  method: "POST",
@@ -6826,8 +6833,8 @@ var CodaiApps = class {
6826
6833
  * client.usage.get / client.keys.list / .setTags (own usage breakdown + API keys)
6827
6834
  * client.projects.* client.environments.* (members, ports, secrets)
6828
6835
  * client.sandboxes.create / .list / .retrieve / .exec / .execStream / .files.put / .files.get / .files.list
6829
- * / .artifacts / .snapshot / .delete / .run (agent sandboxes, beta: isolated gVisor workspaces, no network by default)
6830
- * / .runCode / .resetKernel / .pause / .resume / .fork / .preview (backend v2, closed canary)
6836
+ * / .artifacts / .snapshot / .delete / .run (agent sandboxes: isolated gVisor workspaces, no network by default)
6837
+ * / .runCode / .resetKernel / .pause / .resume / .fork / .preview (backend v2, the default; .snapshot is v1 only)
6831
6838
  * client.verify.agentOutputKey / .agentOutput (EXPERIMENTAL HIDE-signed agent outputs)
6832
6839
  * client.feedback / client.phoneModels
6833
6840
  * client.resolve.* (verified bug fixes on https://resolve.codai.ro — resolve.yaml; .list / .iterate page your jobs)
@@ -6921,7 +6928,7 @@ var Codai = class {
6921
6928
  orgs;
6922
6929
  projects;
6923
6930
  environments;
6924
- /** Agent sandboxes (beta) — isolated gVisor workspaces: `sandboxes.create/exec/execStream/files/artifacts/run`. */
6931
+ /** Agent sandboxes (backend v2 by default) — isolated gVisor workspaces: `sandboxes.create/exec/execStream/files/artifacts/run`. */
6925
6932
  sandboxes;
6926
6933
  /** EXPERIMENTAL (HIDE, unaudited): verify signed agent outputs. Provenance only. */
6927
6934
  verify;