@runblackcat/sdk 0.1.0-alpha.104 → 0.1.0-alpha.105

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runblackcat/sdk",
3
- "version": "0.1.0-alpha.104",
3
+ "version": "0.1.0-alpha.105",
4
4
  "description": "TypeScript SDK for the Blackcat sandbox gateway",
5
5
  "license": "Apache-2.0",
6
6
  "repository": "https://github.com/TreebeardHQ/blackcat",
@@ -288,6 +288,8 @@ export type CreateSandboxInput = {
288
288
  /** Stable across retries of one acquisition; never reuse for another request. */
289
289
  request_id: string;
290
290
  ssh_public_key?: string;
291
+ /** Per-copy values applied before the restore gate opens. */
292
+ copy_env?: Record<string, string>;
291
293
  lease: SandboxLeaseInput;
292
294
  /** A capacity reservation this create should draw a bound slot from. */
293
295
  reservation?: string;
@@ -320,6 +322,8 @@ export type CreateSandboxBatchInput = CreateSandboxInput & {
320
322
  };
321
323
  export type SandboxBatchMemberState = "pending" | "placed" | "failed" | "destroyed";
322
324
  export interface SandboxBatchMember {
325
+ /** The gateway accepted and forwarded non-empty copy_env for this placed member; older gateways omit it. */
326
+ copy_env_forwarded?: true;
323
327
  /** Poll this member alone with `sandboxes.acquisition(request_id)`. */
324
328
  request_id: string;
325
329
  id: string;
@@ -460,6 +464,8 @@ export type CreateSandboxResponse = {
460
464
  * predates this field.
461
465
  */
462
466
  restore_timing?: RestoreTiming;
467
+ /** The gateway accepted and forwarded non-empty copy_env at launch. Older gateways omit this. */
468
+ copy_env_forwarded?: true;
463
469
  /** Present when the create asked for `capability` and created this sandbox. */
464
470
  capability?: SandboxCapability;
465
471
  } & ({
@@ -906,6 +912,17 @@ declare class ReservationsResource {
906
912
  * grace; a dedicated reservation's host is fenced and terminated after its
907
913
  * remaining sandboxes have been destroyed. */
908
914
  release(id: string): Promise<CapacityReservation>;
915
+ /** Shrink an active reusable dedicated reservation pinned to a template version.
916
+ * Claimed copies stay on their hosts. Surplus empty hosts terminate; kept
917
+ * hosts receive smaller share caps and unclaimed bound slots are trimmed.
918
+ * Old-contract reservations without fresh exclusive hosts are refused with
919
+ * `resize_requires_fresh_hosts`; create a new dedicated reservation instead.
920
+ * Equal count (including replay) is a no-op.
921
+ * Count must be positive. 409: `resize_grow_unsupported`, `resize_below_claimed`,
922
+ * `resize_layout_occupied`, `resize_requires_active_reusable`,
923
+ * `retarget_requires_dedicated`, `retarget_follows_resource`, or
924
+ * `resize_changed` (concurrent change; submit again). */
925
+ resize(id: string, count: number): Promise<CapacityReservation>;
909
926
  /** Move an active, unoccupied, reusable dedicated reservation pinned to a
910
927
  * version to a prepared template of the same `vcpus` and `memory_mib`,
911
928
  * keeping its hosts and bindings. Retargeting to its current template is a
package/sdk/dist/index.js CHANGED
@@ -445,6 +445,9 @@ class ReservationsResource {
445
445
  release(id) {
446
446
  return this.client.json("DELETE", `/v1/capacity-reservations/${pathSegment(id)}`, undefined, "either");
447
447
  }
448
+ resize(id, count) {
449
+ return this.client.json("PUT", `/v1/capacity-reservations/${pathSegment(id)}/count`, { count }, "either");
450
+ }
448
451
  retarget(id, template) {
449
452
  return this.client.json("PUT", `/v1/capacity-reservations/${pathSegment(id)}/template`, { template }, "either");
450
453
  }