@aerol-ai/aerolvm-sdk 0.2.1 → 0.2.2
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 +1 -1
- package/dist/internal/client.d.ts +2 -1
- package/dist/internal/client.js +15 -0
- package/dist/types.d.ts +10 -0
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export { MicroVM } from "./MicroVM.js";
|
|
|
2
2
|
export { Sandbox } from "./Sandbox.js";
|
|
3
3
|
export { Image } from "./Image.js";
|
|
4
4
|
export type { MicroVMConfig } from "./MicroVM.js";
|
|
5
|
-
export type { BinaryLike, BuildImageOptions, BuildImagePushOptions, BuildImageResult, CreateOptions, CreateSessionOptions, ExecRequest, ExecResult, ExecExitInfo, ExposedPort, ExposePortOptions, ExposeProtocol, ExposeResult, HealthStatus, Lifecycle, MountSpec, MountSpecRedacted, MountType, RegisterSnapshotOptions, RegistryAuth, ResizeOptions, Sandbox as SandboxData, SandboxSnapshot, SandboxStatus, Session, SessionAttachHandle, SessionAttachOptions, SessionStatus, UpdateLifecycleOptions, } from "./types.js";
|
|
5
|
+
export type { BinaryLike, BuildImageOptions, BuildImagePushOptions, BuildImageResult, CreateOptions, CreateSessionOptions, ExecRequest, ExecResult, ExecExitInfo, ExposedPort, ExposePortOptions, ExposeProtocol, ExposeResult, Failover, FailoverPolicy, HealthStatus, Lifecycle, MountSpec, MountSpecRedacted, MountType, RegisterSnapshotOptions, RegistryAuth, ResizeOptions, Sandbox as SandboxData, SandboxSnapshot, SandboxStatus, Session, SessionAttachHandle, SessionAttachOptions, SessionStatus, UpdateLifecycleOptions, } from "./types.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Image } from "../Image.js";
|
|
2
|
-
import type { BinaryLike, BuildImageOptions, BuildImageResult, CreateOptions, CreateSessionOptions, ExecRequest, ExecResult, ExecStreamHandle, ExecStreamOptions, ExposedPort, ExposePortOptions, ExposeResult, HealthStatus, Lifecycle, ListOptions, MountSpecRedacted, NetworkUsage, RegisterSnapshotOptions, SetNetworkLimitsOptions, ResizeOptions, Sandbox, SandboxSnapshot, Session, SessionAttachHandle, SessionAttachOptions } from "../types.js";
|
|
2
|
+
import type { BinaryLike, BuildImageOptions, BuildImageResult, CreateOptions, CreateSessionOptions, ExecRequest, ExecResult, ExecStreamHandle, ExecStreamOptions, ExposedPort, ExposePortOptions, ExposeResult, Failover, HealthStatus, Lifecycle, ListOptions, MountSpecRedacted, NetworkUsage, RegisterSnapshotOptions, SetNetworkLimitsOptions, ResizeOptions, Sandbox, SandboxSnapshot, Session, SessionAttachHandle, SessionAttachOptions } from "../types.js";
|
|
3
3
|
type FetchLike = typeof fetch;
|
|
4
4
|
/**
|
|
5
5
|
* Wire version of the v1-style sandbox endpoints (`/v1/sandboxes`, etc.) this
|
|
@@ -126,6 +126,7 @@ export declare class SandboxResource implements Sandbox {
|
|
|
126
126
|
lastError?: string;
|
|
127
127
|
containerCommand?: string[];
|
|
128
128
|
lifecycle: Lifecycle;
|
|
129
|
+
failover?: Failover;
|
|
129
130
|
runtime: Sandbox["runtime"];
|
|
130
131
|
protected readonly client: APIClient;
|
|
131
132
|
constructor(client: APIClient, sandbox: Sandbox);
|
package/dist/internal/client.js
CHANGED
|
@@ -388,6 +388,7 @@ function toApiCreateOptions(options) {
|
|
|
388
388
|
container_command: options.containerCommand,
|
|
389
389
|
mounts: options.mounts?.map(toApiMountSpec),
|
|
390
390
|
lifecycle: options.lifecycle ? toApiLifecycle(options.lifecycle) : undefined,
|
|
391
|
+
failover: options.failover ? toApiFailover(options.failover) : undefined,
|
|
391
392
|
runtime: options.runtime,
|
|
392
393
|
};
|
|
393
394
|
}
|
|
@@ -440,6 +441,11 @@ function toApiLifecycle(lifecycle) {
|
|
|
440
441
|
destroy_at_age: lifecycle.destroyAtAge,
|
|
441
442
|
};
|
|
442
443
|
}
|
|
444
|
+
function toApiFailover(failover) {
|
|
445
|
+
return {
|
|
446
|
+
policy: failover.policy,
|
|
447
|
+
};
|
|
448
|
+
}
|
|
443
449
|
function fromApiSandbox(sandbox) {
|
|
444
450
|
return {
|
|
445
451
|
id: sandbox.id,
|
|
@@ -463,6 +469,7 @@ function fromApiSandbox(sandbox) {
|
|
|
463
469
|
lastError: sandbox.last_error,
|
|
464
470
|
containerCommand: sandbox.container_command,
|
|
465
471
|
lifecycle: fromApiLifecycle(sandbox.lifecycle),
|
|
472
|
+
failover: fromApiFailover(sandbox.failover),
|
|
466
473
|
runtime: normalizeRuntime(sandbox.runtime),
|
|
467
474
|
};
|
|
468
475
|
}
|
|
@@ -609,6 +616,13 @@ function fromApiLifecycle(lifecycle) {
|
|
|
609
616
|
}
|
|
610
617
|
return result;
|
|
611
618
|
}
|
|
619
|
+
function fromApiFailover(failover) {
|
|
620
|
+
const policy = failover?.policy;
|
|
621
|
+
if (policy !== "recreate" && policy !== "none") {
|
|
622
|
+
return undefined;
|
|
623
|
+
}
|
|
624
|
+
return { policy };
|
|
625
|
+
}
|
|
612
626
|
// buildTagQuery renders ListOptions.tags as the server's wire format. The
|
|
613
627
|
// `tag.` prefix is literal — the server's parseTagFilter does a prefix check
|
|
614
628
|
// on the *decoded* query key, so only the user-supplied key and value get
|
|
@@ -631,6 +645,7 @@ function cloneSandbox(sandbox) {
|
|
|
631
645
|
exposedPorts: sandbox.exposedPorts?.map((port) => ({ ...port })),
|
|
632
646
|
containerCommand: sandbox.containerCommand ? [...sandbox.containerCommand] : undefined,
|
|
633
647
|
lifecycle: { ...sandbox.lifecycle },
|
|
648
|
+
failover: sandbox.failover ? { ...sandbox.failover } : undefined,
|
|
634
649
|
};
|
|
635
650
|
}
|
|
636
651
|
function toBlob(data) {
|
package/dist/types.d.ts
CHANGED
|
@@ -75,6 +75,14 @@ export interface Lifecycle {
|
|
|
75
75
|
destroyAtAge?: number;
|
|
76
76
|
}
|
|
77
77
|
export type UpdateLifecycleOptions = Lifecycle;
|
|
78
|
+
export type FailoverPolicy = "none" | "recreate";
|
|
79
|
+
export interface Failover {
|
|
80
|
+
/**
|
|
81
|
+
* "none" (default) returns 410 Gone after owner-node death. "recreate"
|
|
82
|
+
* opts into best-effort cluster recreation from the replicated create spec.
|
|
83
|
+
*/
|
|
84
|
+
policy: FailoverPolicy;
|
|
85
|
+
}
|
|
78
86
|
export type GPUVendor = "nvidia" | "amd" | "apple";
|
|
79
87
|
export interface GPUOptions {
|
|
80
88
|
/**
|
|
@@ -138,6 +146,7 @@ export interface CreateOptions {
|
|
|
138
146
|
containerCommand?: string[];
|
|
139
147
|
mounts?: MountSpec[];
|
|
140
148
|
lifecycle?: Lifecycle;
|
|
149
|
+
failover?: Failover;
|
|
141
150
|
/**
|
|
142
151
|
* Container runtime to use for this sandbox. Omit to inherit the host
|
|
143
152
|
* default (`SB_CONTAINER_RUNTIME`). Use `"gvisor"` for runsc-backed
|
|
@@ -268,6 +277,7 @@ export interface Sandbox {
|
|
|
268
277
|
lastError?: string;
|
|
269
278
|
containerCommand?: string[];
|
|
270
279
|
lifecycle: Lifecycle;
|
|
280
|
+
failover?: Failover;
|
|
271
281
|
/**
|
|
272
282
|
* Container runtime this sandbox is running under. Empty string indicates
|
|
273
283
|
* a pre-migration row that resolves to the host default at start time.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aerol-ai/aerolvm-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"test": "tsc -p tsconfig.test.json --outDir dist-test && node --test dist-test/*.test.js dist-test/internal/*.test.js"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@types/node": "^25.
|
|
24
|
+
"@types/node": "^25.8.0",
|
|
25
25
|
"typescript": "^6.0.3",
|
|
26
|
-
"tsx": "^4.
|
|
26
|
+
"tsx": "^4.22.3"
|
|
27
27
|
}
|
|
28
28
|
}
|