@runblackcat/sdk 0.1.0-alpha.115 → 0.1.0-alpha.117

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/README.md CHANGED
@@ -303,7 +303,7 @@ happened. These breaking pre-trial contracts are being verified together; old
303
303
  embedded guests and callers must be rebuilt/updated, not silently accepted.
304
304
 
305
305
  AWS adds exactly two things: an AMI that registers itself using the EC2 instance identity
306
- document, and a `CapacityProvider` that wraps an ASG. If AWS ever needs a *different*
306
+ document, and a direct-EC2 `MachineProvider` that launches workers. If AWS ever needs a *different*
307
307
  path, the design has failed — there is a test for that.
308
308
 
309
309
  **Bare-metal prerequisites:** Linux with `/dev/kvm`, root for the node agent, a hardened
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runblackcat/sdk",
3
- "version": "0.1.0-alpha.115",
3
+ "version": "0.1.0-alpha.117",
4
4
  "description": "TypeScript SDK for the Blackcat sandbox gateway",
5
5
  "license": "Apache-2.0",
6
6
  "repository": "https://github.com/TreebeardHQ/blackcat",
@@ -22,6 +22,7 @@ export declare const CAPABILITY_OPS: {
22
22
  };
23
23
  export type CapabilityOps = number;
24
24
  export declare const BLACKCAT_ERROR_CODES: {
25
+ readonly CHECKPOINT_KERNEL_MISMATCH: "checkpoint_kernel_mismatch";
25
26
  readonly SANDBOX_TRANSITIONING: "sandbox_transitioning";
26
27
  readonly FLEET_UPGRADE_QUIESCING: "fleet_upgrade_quiescing";
27
28
  };
@@ -491,6 +492,11 @@ export type CreateSandboxResponse = {
491
492
  * predates this field.
492
493
  */
493
494
  restore_timing?: RestoreTiming;
495
+ /** First recorded failure, also available while pending teardown. Rebuild captures on checkpoint_kernel_mismatch. */
496
+ failure?: {
497
+ code: string;
498
+ detail: string | null;
499
+ };
494
500
  /** The gateway accepted and forwarded non-empty copy_env at launch. Older gateways omit this. */
495
501
  copy_env_forwarded?: true;
496
502
  /** Present when the create asked for `capability` and created this sandbox. */
@@ -642,6 +648,8 @@ export interface FleetNode {
642
648
  cache_budget_bytes: number;
643
649
  /** The node's CPU; absent from nodes older than CPU-aware placement. */
644
650
  cpu?: CpuIdentity | null;
651
+ /** `[major, minor]` of the kernel the node boots guests with; null when unknown. */
652
+ guest_kernel?: [number, number] | null;
645
653
  /** 1000 charges file-backed clones in full; 2000 charges them at half. */
646
654
  max_memory_ratio_milli: number;
647
655
  max_vcpu_ratio_milli: number;
@@ -844,7 +852,7 @@ export interface RenewTokenResponse {
844
852
  }
845
853
  export declare class BlackcatApiError extends Error {
846
854
  readonly status: number;
847
- /** Stable gateway error code when one is provided. */
855
+ /** Stable gateway code, including failure.code on failed acquisition receipts. */
848
856
  readonly code?: string;
849
857
  readonly retryAfter?: number;
850
858
  readonly requestId?: string;
package/sdk/dist/index.js CHANGED
@@ -15,6 +15,7 @@ var CAPABILITY_OPS = {
15
15
  RENEW: 4096
16
16
  };
17
17
  var BLACKCAT_ERROR_CODES = {
18
+ CHECKPOINT_KERNEL_MISMATCH: "checkpoint_kernel_mismatch",
18
19
  SANDBOX_TRANSITIONING: "sandbox_transitioning",
19
20
  FLEET_UPGRADE_QUIESCING: "fleet_upgrade_quiescing"
20
21
  };
@@ -37,7 +38,9 @@ class BlackcatApiError extends Error {
37
38
  this.status = status;
38
39
  this.details = details;
39
40
  if (typeof details === "object" && details !== null && !Array.isArray(details)) {
40
- const code = details.code;
41
+ const fields = details;
42
+ const failure = fields.failure;
43
+ const code = fields.code ?? (typeof failure === "object" && failure !== null ? failure.code : undefined);
41
44
  if (typeof code === "string")
42
45
  this.code = code;
43
46
  }