@kosa8/sdk 0.0.0-stage → 0.1.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/LICENSE +26 -0
- package/README.md +182 -2
- package/dist/index.cjs +1052 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +798 -0
- package/dist/index.d.ts +798 -0
- package/dist/index.js +990 -0
- package/dist/index.js.map +1 -0
- package/package.json +61 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,798 @@
|
|
|
1
|
+
import * as http from 'node:http';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shapes of the kosa8 native API (/kosa8/v1), taken from the daemon's Go
|
|
5
|
+
* source (pkg/apid/native, pkg/sandbox, pkg/engine, pkg/vnet). Field names
|
|
6
|
+
* are the daemon's JSON names, unchanged.
|
|
7
|
+
*/
|
|
8
|
+
/** GET /kosa8/v1/health */
|
|
9
|
+
interface Health {
|
|
10
|
+
status: string;
|
|
11
|
+
version: string;
|
|
12
|
+
commit: string;
|
|
13
|
+
go: string;
|
|
14
|
+
uptime_seconds: number;
|
|
15
|
+
phase: string;
|
|
16
|
+
}
|
|
17
|
+
/** A host directory exposed inside a sandbox (pkg/sandbox Mount). */
|
|
18
|
+
interface Mount {
|
|
19
|
+
host_path: string;
|
|
20
|
+
guest_path: string;
|
|
21
|
+
read_only: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Egress policy string the daemon accepts (pkg/vnet ParsePolicy):
|
|
25
|
+
* `any`, `deny`, `fakenet`, or `allow:HOST[,HOST...]` where each entry is a
|
|
26
|
+
* hostname, a `*.domain` wildcard, an IPv4 address or an IPv4 CIDR.
|
|
27
|
+
*/
|
|
28
|
+
type EgressPolicyString = 'any' | 'deny' | 'fakenet' | `allow:${string}`;
|
|
29
|
+
/**
|
|
30
|
+
* Egress policy as this SDK takes it: one of the daemon's strings, or
|
|
31
|
+
* `{ allow: [...] }` for an allow-list (everything else is refused on the host).
|
|
32
|
+
*/
|
|
33
|
+
type EgressPolicy = EgressPolicyString | {
|
|
34
|
+
allow: readonly string[];
|
|
35
|
+
};
|
|
36
|
+
/** A host the sandbox may reach through an egress broker (pkg/broker HostRule). */
|
|
37
|
+
interface BrokerHostRule {
|
|
38
|
+
/** Exact DNS name, a `*.domain` wildcard, or a literal IPv4 address. */
|
|
39
|
+
host: string;
|
|
40
|
+
/** Ports the host may be reached on. Empty means 443 and 80. */
|
|
41
|
+
ports?: number[];
|
|
42
|
+
/** Methods allowed for plain-HTTP requests. Empty means any. */
|
|
43
|
+
methods?: string[];
|
|
44
|
+
}
|
|
45
|
+
/** A credentialed upstream behind the broker (pkg/sandbox BrokerRoute). */
|
|
46
|
+
interface BrokerRoute {
|
|
47
|
+
name: string;
|
|
48
|
+
upstream: string;
|
|
49
|
+
methods?: string[];
|
|
50
|
+
paths?: string[];
|
|
51
|
+
/** Header the broker sets on the way out, e.g. `Authorization` or `x-api-key`. */
|
|
52
|
+
header: string;
|
|
53
|
+
scheme?: string;
|
|
54
|
+
/** The real credential. Held by the broker on the host, never by the sandbox. */
|
|
55
|
+
secret: string;
|
|
56
|
+
}
|
|
57
|
+
/** Puts a sandbox behind an egress broker (pkg/sandbox BrokerSpec). */
|
|
58
|
+
interface BrokerSpec {
|
|
59
|
+
allow?: BrokerHostRule[];
|
|
60
|
+
routes?: BrokerRoute[];
|
|
61
|
+
}
|
|
62
|
+
/** The broker as a running sandbox reports it (pkg/sandbox BrokerInfo). */
|
|
63
|
+
interface BrokerInfo {
|
|
64
|
+
url: string;
|
|
65
|
+
hosts?: string[];
|
|
66
|
+
routes?: string[];
|
|
67
|
+
}
|
|
68
|
+
/** Packet capture to a pcapng file on the host (pkg/sandbox CaptureSpec). */
|
|
69
|
+
interface CaptureSpec {
|
|
70
|
+
/** Absolute path on the host. */
|
|
71
|
+
path: string;
|
|
72
|
+
max_bytes?: number;
|
|
73
|
+
max_files?: number;
|
|
74
|
+
}
|
|
75
|
+
/** A sandbox (pkg/sandbox Sandbox). */
|
|
76
|
+
interface Sandbox {
|
|
77
|
+
id: string;
|
|
78
|
+
name: string;
|
|
79
|
+
created: string;
|
|
80
|
+
/** running | paused | stopped */
|
|
81
|
+
state: string;
|
|
82
|
+
parent?: string;
|
|
83
|
+
cpus: number;
|
|
84
|
+
mem_mb: number;
|
|
85
|
+
disk_gb?: number;
|
|
86
|
+
mounts?: Mount[];
|
|
87
|
+
egress?: string;
|
|
88
|
+
capture?: string;
|
|
89
|
+
ip?: string;
|
|
90
|
+
labels?: Record<string, string>;
|
|
91
|
+
broker?: BrokerInfo;
|
|
92
|
+
}
|
|
93
|
+
/** A saved sandbox state (pkg/sandbox Snapshot). */
|
|
94
|
+
interface Snapshot {
|
|
95
|
+
id: string;
|
|
96
|
+
sandbox: string;
|
|
97
|
+
created: string;
|
|
98
|
+
machine_id?: string;
|
|
99
|
+
mac?: string;
|
|
100
|
+
cpus: number;
|
|
101
|
+
mem_mb: number;
|
|
102
|
+
cmdline: string;
|
|
103
|
+
size_bytes: number;
|
|
104
|
+
state_path: string;
|
|
105
|
+
disk_path?: string;
|
|
106
|
+
data_path?: string;
|
|
107
|
+
disk_gb?: number;
|
|
108
|
+
ephemeral?: boolean;
|
|
109
|
+
mounts?: Mount[];
|
|
110
|
+
egress?: string;
|
|
111
|
+
received?: boolean;
|
|
112
|
+
received_mounts?: string[];
|
|
113
|
+
sealed?: boolean;
|
|
114
|
+
labels?: Record<string, string>;
|
|
115
|
+
encryption?: Record<string, unknown>;
|
|
116
|
+
[key: string]: unknown;
|
|
117
|
+
}
|
|
118
|
+
/** A container inside an engine (pkg/engine Container). */
|
|
119
|
+
interface Container {
|
|
120
|
+
id: string;
|
|
121
|
+
image: string;
|
|
122
|
+
status: string;
|
|
123
|
+
exit?: number;
|
|
124
|
+
ip?: string;
|
|
125
|
+
}
|
|
126
|
+
/** POST /kosa8/v1/sandboxes answer. */
|
|
127
|
+
interface CreateSandboxResult {
|
|
128
|
+
sandbox: Sandbox;
|
|
129
|
+
boot_ms: number;
|
|
130
|
+
/** Present when the sandbox was created behind a broker: the stand-ins the sandbox holds. */
|
|
131
|
+
broker?: {
|
|
132
|
+
url: string;
|
|
133
|
+
placeholders: Record<string, string>;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
/** POST /kosa8/v1/sandboxes/{id}/up answer. */
|
|
137
|
+
interface StartSandboxResult {
|
|
138
|
+
sandbox: Sandbox;
|
|
139
|
+
boot_ms: number;
|
|
140
|
+
warning?: string;
|
|
141
|
+
}
|
|
142
|
+
/** POST /kosa8/v1/sandboxes/{id}/down answer. */
|
|
143
|
+
interface StopSandboxResult {
|
|
144
|
+
ok: boolean;
|
|
145
|
+
sandbox?: Sandbox;
|
|
146
|
+
warning?: string;
|
|
147
|
+
already_stopped?: boolean;
|
|
148
|
+
}
|
|
149
|
+
/** DELETE /kosa8/v1/sandboxes/{id} answer. */
|
|
150
|
+
interface DeleteSandboxResult {
|
|
151
|
+
ok: boolean;
|
|
152
|
+
wipe?: unknown;
|
|
153
|
+
files?: unknown;
|
|
154
|
+
}
|
|
155
|
+
/** POST /kosa8/v1/sandboxes/{id}/snapshot answer. */
|
|
156
|
+
interface SnapshotSandboxResult {
|
|
157
|
+
snapshot: Snapshot;
|
|
158
|
+
snapshot_ms: number;
|
|
159
|
+
encrypted_by_policy?: string;
|
|
160
|
+
encrypt_ms?: number;
|
|
161
|
+
encryption?: unknown;
|
|
162
|
+
}
|
|
163
|
+
/** POST /kosa8/v1/sandboxes/{id}/fork answer. */
|
|
164
|
+
interface ForkResult {
|
|
165
|
+
forks: Sandbox[];
|
|
166
|
+
/** The (ephemeral) snapshot the forks were restored from. */
|
|
167
|
+
snapshot: string;
|
|
168
|
+
fork_ms: number;
|
|
169
|
+
count: number;
|
|
170
|
+
encrypted_by_policy?: string;
|
|
171
|
+
encrypt_ms?: number;
|
|
172
|
+
}
|
|
173
|
+
/** POST /kosa8/v1/snapshots/{id}/restore answer. */
|
|
174
|
+
interface RestoreResult {
|
|
175
|
+
sandbox: Sandbox;
|
|
176
|
+
restore_ms: number;
|
|
177
|
+
seal?: unknown;
|
|
178
|
+
}
|
|
179
|
+
/** DELETE /kosa8/v1/snapshots/{id} answer. */
|
|
180
|
+
interface DeleteSnapshotResult {
|
|
181
|
+
ok: boolean;
|
|
182
|
+
removed: string;
|
|
183
|
+
encrypted: boolean;
|
|
184
|
+
shred?: unknown;
|
|
185
|
+
wipe?: unknown;
|
|
186
|
+
files?: unknown;
|
|
187
|
+
}
|
|
188
|
+
/** GET /kosa8/v1/sandboxes/{id}/egress answer (pkg/sandbox EgressStatus). */
|
|
189
|
+
interface EgressStatus {
|
|
190
|
+
policy: string;
|
|
191
|
+
stats: {
|
|
192
|
+
passed: number;
|
|
193
|
+
denied: number;
|
|
194
|
+
dropped: number;
|
|
195
|
+
dns_answered: number;
|
|
196
|
+
dns_refused: number;
|
|
197
|
+
fakenet?: number;
|
|
198
|
+
};
|
|
199
|
+
capture?: string;
|
|
200
|
+
wildcards?: {
|
|
201
|
+
wildcard: string;
|
|
202
|
+
names?: string[];
|
|
203
|
+
more?: number;
|
|
204
|
+
}[];
|
|
205
|
+
fakenet?: {
|
|
206
|
+
interactions: number;
|
|
207
|
+
dropped?: number;
|
|
208
|
+
ca?: string;
|
|
209
|
+
log?: string;
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
/** One frame of a streamed answer (pkg/engine Frame), with `data` decoded. */
|
|
213
|
+
interface Frame {
|
|
214
|
+
/** stdout | stderr | status */
|
|
215
|
+
stream?: string;
|
|
216
|
+
data?: Buffer;
|
|
217
|
+
done?: boolean;
|
|
218
|
+
ok?: boolean;
|
|
219
|
+
error?: string;
|
|
220
|
+
exit?: number;
|
|
221
|
+
id?: string;
|
|
222
|
+
image?: string;
|
|
223
|
+
[key: string]: unknown;
|
|
224
|
+
}
|
|
225
|
+
/** The collected result of a streamed run or exec. */
|
|
226
|
+
interface ExecResult {
|
|
227
|
+
exitCode: number;
|
|
228
|
+
stdout: string;
|
|
229
|
+
stderr: string;
|
|
230
|
+
stdoutBytes: Buffer;
|
|
231
|
+
stderrBytes: Buffer;
|
|
232
|
+
}
|
|
233
|
+
/** A client-side restore point (same record as `kosa8 checkpoint`, pkg/checkpoint). */
|
|
234
|
+
interface Checkpoint {
|
|
235
|
+
/** The underlying snapshot id, e.g. `web-ckpt-3`. */
|
|
236
|
+
id: string;
|
|
237
|
+
sandbox: string;
|
|
238
|
+
label: string;
|
|
239
|
+
auto?: boolean;
|
|
240
|
+
/** RFC 3339 time it was taken. */
|
|
241
|
+
created: string;
|
|
242
|
+
}
|
|
243
|
+
/** One branch of an explore. */
|
|
244
|
+
interface ExploreBranch {
|
|
245
|
+
/** The forked sandbox's id. */
|
|
246
|
+
name: string;
|
|
247
|
+
variant: string;
|
|
248
|
+
exit: number;
|
|
249
|
+
output: string;
|
|
250
|
+
duration_ms: number;
|
|
251
|
+
error?: string;
|
|
252
|
+
}
|
|
253
|
+
interface ExploreResult {
|
|
254
|
+
parent: string;
|
|
255
|
+
branches: ExploreBranch[];
|
|
256
|
+
/** The fastest successful branch, or "" when every branch failed. */
|
|
257
|
+
winner: string;
|
|
258
|
+
removed: number;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Checkpoints are client-side bookkeeping over daemon snapshots, exactly as
|
|
263
|
+
* in the kosa8 CLI and MCP server (pkg/checkpoint): a checkpoint is a
|
|
264
|
+
* snapshot with the id `<sandbox>-ckpt-<n>`, and an ordered stack of them per
|
|
265
|
+
* sandbox records labels and order. The daemon itself has no checkpoint
|
|
266
|
+
* endpoint.
|
|
267
|
+
*/
|
|
268
|
+
/** How many checkpoints are kept per sandbox; the oldest is evicted (pkg/checkpoint MaxPerSandbox). */
|
|
269
|
+
declare const MAX_CHECKPOINTS_PER_SANDBOX = 10;
|
|
270
|
+
type StoreData = Record<string, Checkpoint[]>;
|
|
271
|
+
/** Where checkpoint stacks are kept. */
|
|
272
|
+
interface CheckpointStore {
|
|
273
|
+
/** Read every stack. */
|
|
274
|
+
load(): Promise<StoreData>;
|
|
275
|
+
/** Run `fn` on the stacks and save what it leaves, serialised against other updates. */
|
|
276
|
+
update<T>(fn: (data: StoreData) => T | Promise<T>): Promise<T>;
|
|
277
|
+
}
|
|
278
|
+
/** Reject a name that could escape the store (pkg/checkpoint validSandbox). */
|
|
279
|
+
declare function validateSandboxName(name: string): void;
|
|
280
|
+
/** Keeps stacks in memory only; nothing is shared with the kosa8 CLI. */
|
|
281
|
+
declare class MemoryCheckpointStore implements CheckpointStore {
|
|
282
|
+
private data;
|
|
283
|
+
private queue;
|
|
284
|
+
load(): Promise<StoreData>;
|
|
285
|
+
update<T>(fn: (data: StoreData) => T | Promise<T>): Promise<T>;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* The store the kosa8 CLI, MCP server and desk use: `~/.kosa8/checkpoints.json`
|
|
289
|
+
* (mode 0600, rewritten atomically). Checkpoints taken through the SDK are
|
|
290
|
+
* therefore visible to `kosa8 rewind` and the other way round.
|
|
291
|
+
*
|
|
292
|
+
* Updates are serialised within this process and between Node processes
|
|
293
|
+
* using this store (an exclusive lock file beside it). The Go tools lock the
|
|
294
|
+
* same file with flock(2), which Node cannot take, so an SDK update that
|
|
295
|
+
* lands in the same instant as a CLI update could lose one record; the
|
|
296
|
+
* snapshots themselves are unaffected.
|
|
297
|
+
*/
|
|
298
|
+
declare class FileCheckpointStore implements CheckpointStore {
|
|
299
|
+
readonly path: string;
|
|
300
|
+
private queue;
|
|
301
|
+
constructor(filePath?: string);
|
|
302
|
+
load(): Promise<StoreData>;
|
|
303
|
+
update<T>(fn: (data: StoreData) => T | Promise<T>): Promise<T>;
|
|
304
|
+
private locked;
|
|
305
|
+
}
|
|
306
|
+
/** The stack logic of pkg/checkpoint, over any store. */
|
|
307
|
+
declare class CheckpointBook {
|
|
308
|
+
readonly store: CheckpointStore;
|
|
309
|
+
constructor(store: CheckpointStore);
|
|
310
|
+
/** The snapshot id the next checkpoint should use, and ids to evict to stay under the cap. */
|
|
311
|
+
nextId(sandbox: string): Promise<{
|
|
312
|
+
id: string;
|
|
313
|
+
evict: string[];
|
|
314
|
+
}>;
|
|
315
|
+
record(c: Omit<Checkpoint, 'created'> & {
|
|
316
|
+
created?: string;
|
|
317
|
+
}, evicted?: string[]): Promise<Checkpoint>;
|
|
318
|
+
list(sandbox: string): Promise<Checkpoint[]>;
|
|
319
|
+
latest(sandbox: string): Promise<Checkpoint>;
|
|
320
|
+
/** Find by id or (case-insensitive) label, newest match first. */
|
|
321
|
+
resolve(sandbox: string, ref: string): Promise<Checkpoint>;
|
|
322
|
+
/** Keep `id` as the top of the stack; return the ids taken after it (now meaningless). */
|
|
323
|
+
pop(sandbox: string, id: string): Promise<string[]>;
|
|
324
|
+
/** Drop every checkpoint of a sandbox; return the snapshot ids to delete. */
|
|
325
|
+
forget(sandbox: string): Promise<string[]>;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/** Who the audit log should file a request under (pkg/policyd Actor). */
|
|
329
|
+
type Actor = 'human' | 'agent' | 'tool';
|
|
330
|
+
interface TransportOptions {
|
|
331
|
+
/**
|
|
332
|
+
* Unix socket of the daemon. Default: `$HOME/.kosa8/run/kosa8.sock`.
|
|
333
|
+
* Ignored when `host` (or KOSA8_HOST) is set.
|
|
334
|
+
*/
|
|
335
|
+
socketPath?: string;
|
|
336
|
+
/**
|
|
337
|
+
* A remote kosa8 worker: `https://host`, `http://host:port`, `tcp://host:port`
|
|
338
|
+
* or a bare `host:port`, the same spellings the kosa8 CLI accepts in
|
|
339
|
+
* KOSA8_HOST. `unix:///path/to.sock` selects a socket. Defaults to the
|
|
340
|
+
* KOSA8_HOST environment variable.
|
|
341
|
+
*/
|
|
342
|
+
host?: string;
|
|
343
|
+
/** Bearer token for a remote worker. Defaults to KOSA8_TOKEN when KOSA8_HOST is in use. */
|
|
344
|
+
token?: string;
|
|
345
|
+
/**
|
|
346
|
+
* Allow plain http to a non-loopback host. Off by default, as in the CLI,
|
|
347
|
+
* because the token and every request would cross the network unencrypted.
|
|
348
|
+
* KOSA8_INSECURE=1 also allows it.
|
|
349
|
+
*/
|
|
350
|
+
insecure?: boolean;
|
|
351
|
+
/** Sent as X-Kosa8-Actor so the audit log files requests correctly. Default `tool`. */
|
|
352
|
+
actor?: Actor;
|
|
353
|
+
/** Agent identity token (X-Kosa8-Agent-Token). Defaults to KOSA8_AGENT_TOKEN. */
|
|
354
|
+
agentToken?: string;
|
|
355
|
+
/** Extra headers on every request. */
|
|
356
|
+
headers?: Record<string, string>;
|
|
357
|
+
/** Environment to read KOSA8_* variables from. Default `process.env`. */
|
|
358
|
+
env?: Record<string, string | undefined>;
|
|
359
|
+
}
|
|
360
|
+
interface RequestOptions {
|
|
361
|
+
query?: Record<string, string | number | boolean | undefined>;
|
|
362
|
+
body?: unknown;
|
|
363
|
+
/** A raw (non-JSON) request body, sent as-is; an async iterable is streamed chunked. */
|
|
364
|
+
rawBody?: Uint8Array | string | AsyncIterable<Uint8Array | string>;
|
|
365
|
+
/** Signed-approval id, sent as X-Kosa8-Approval. */
|
|
366
|
+
approval?: string;
|
|
367
|
+
signal?: AbortSignal;
|
|
368
|
+
headers?: Record<string, string>;
|
|
369
|
+
}
|
|
370
|
+
type Endpoint = {
|
|
371
|
+
kind: 'unix';
|
|
372
|
+
socketPath: string;
|
|
373
|
+
} | {
|
|
374
|
+
kind: 'tcp';
|
|
375
|
+
url: URL;
|
|
376
|
+
token?: string;
|
|
377
|
+
};
|
|
378
|
+
declare const APPROVAL_HEADER = "X-Kosa8-Approval";
|
|
379
|
+
declare const ACTOR_HEADER = "X-Kosa8-Actor";
|
|
380
|
+
declare const AGENT_TOKEN_HEADER = "X-Kosa8-Agent-Token";
|
|
381
|
+
/** The daemon's default socket: $HOME/.kosa8/run/kosa8.sock (pkg/paths). */
|
|
382
|
+
declare function defaultSocketPath(): string;
|
|
383
|
+
/** Resolve where to connect, following the CLI's KOSA8_HOST rules. */
|
|
384
|
+
declare function resolveEndpoint(opts: TransportOptions): Endpoint;
|
|
385
|
+
interface RawResponse {
|
|
386
|
+
status: number;
|
|
387
|
+
headers: http.IncomingHttpHeaders;
|
|
388
|
+
stream: http.IncomingMessage;
|
|
389
|
+
}
|
|
390
|
+
/** HTTP over the daemon's unix socket (or a remote worker). No dependencies. */
|
|
391
|
+
declare class Transport {
|
|
392
|
+
private readonly endpoint;
|
|
393
|
+
private readonly actor;
|
|
394
|
+
private readonly agentToken?;
|
|
395
|
+
private readonly extraHeaders;
|
|
396
|
+
constructor(opts?: TransportOptions);
|
|
397
|
+
/** Human-readable description of where requests go. */
|
|
398
|
+
get target(): string;
|
|
399
|
+
private buildPath;
|
|
400
|
+
/** Send a request and return the raw response once headers arrive. */
|
|
401
|
+
raw(method: string, p: string, opts?: RequestOptions): Promise<RawResponse>;
|
|
402
|
+
/** Send a request and decode a JSON answer; HTTP errors become typed errors. */
|
|
403
|
+
json<T>(method: string, p: string, opts?: RequestOptions): Promise<T>;
|
|
404
|
+
/**
|
|
405
|
+
* Send a request whose answer is a stream of NDJSON frames (run, exec,
|
|
406
|
+
* attach). HTTP errors (a refusal before streaming began) become typed
|
|
407
|
+
* errors; each frame's base64 `data` is decoded to a Buffer.
|
|
408
|
+
*/
|
|
409
|
+
frames(method: string, p: string, opts?: RequestOptions): AsyncGenerator<Frame>;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/** Options every call accepts. */
|
|
413
|
+
interface CallOptions {
|
|
414
|
+
/**
|
|
415
|
+
* Id of a recorded signed approval for this exact action, sent as
|
|
416
|
+
* X-Kosa8-Approval. Needed only when the org policy requires one; a
|
|
417
|
+
* refusal (Kosa8ApprovalRequiredError) says how a human gets it.
|
|
418
|
+
*/
|
|
419
|
+
approval?: string;
|
|
420
|
+
signal?: AbortSignal;
|
|
421
|
+
}
|
|
422
|
+
interface Kosa8ClientOptions extends TransportOptions {
|
|
423
|
+
/**
|
|
424
|
+
* Where checkpoint stacks are kept. Default: the kosa8 CLI's own store,
|
|
425
|
+
* `~/.kosa8/checkpoints.json`, so `kosa8 rewind` sees SDK checkpoints.
|
|
426
|
+
*/
|
|
427
|
+
checkpointStore?: CheckpointStore;
|
|
428
|
+
}
|
|
429
|
+
interface CreateSandboxOptions extends CallOptions {
|
|
430
|
+
/** Sandbox name; the daemon generates one when omitted. */
|
|
431
|
+
name?: string;
|
|
432
|
+
cpus?: number;
|
|
433
|
+
memMb?: number;
|
|
434
|
+
/** Data disk in GB (holds images and everything written inside). 0 = daemon default. */
|
|
435
|
+
diskGb?: number;
|
|
436
|
+
mounts?: Mount[];
|
|
437
|
+
/**
|
|
438
|
+
* Network policy: `'deny'`, `'any'`, `'fakenet'`, `'allow:a.com,b.com'` or
|
|
439
|
+
* `{ allow: ['a.com', '*.b.com', '10.0.0.0/8'] }`. When omitted the daemon
|
|
440
|
+
* applies the org policy's default egress, else `any`.
|
|
441
|
+
*/
|
|
442
|
+
egress?: EgressPolicy;
|
|
443
|
+
/** Shorthand for `egress: { allow: [...] }`. */
|
|
444
|
+
egressAllow?: readonly string[];
|
|
445
|
+
/** Start a packet capture from the first frame. */
|
|
446
|
+
capture?: CaptureSpec;
|
|
447
|
+
labels?: Record<string, string>;
|
|
448
|
+
/** Put the sandbox behind an egress broker that adds credentials it never holds. */
|
|
449
|
+
broker?: BrokerSpec;
|
|
450
|
+
}
|
|
451
|
+
interface RunOptions extends CallOptions {
|
|
452
|
+
env?: Record<string, string> | string[];
|
|
453
|
+
onStdout?: (chunk: Buffer) => void;
|
|
454
|
+
onStderr?: (chunk: Buffer) => void;
|
|
455
|
+
/** Progress lines the daemon emits (e.g. "pulling alpine"). */
|
|
456
|
+
onStatus?: (chunk: Buffer) => void;
|
|
457
|
+
}
|
|
458
|
+
interface ExecOptions extends CallOptions {
|
|
459
|
+
onStdout?: (chunk: Buffer) => void;
|
|
460
|
+
onStderr?: (chunk: Buffer) => void;
|
|
461
|
+
}
|
|
462
|
+
interface ForkOptions extends CallOptions {
|
|
463
|
+
/** Number of copies (default 1). */
|
|
464
|
+
n?: number;
|
|
465
|
+
/** Name prefix; copies are named `<prefix>1`, `<prefix>2`, ... (default `<sandbox>-fork`). */
|
|
466
|
+
prefix?: string;
|
|
467
|
+
/** Raise the copies' classification label above the parent's. */
|
|
468
|
+
label?: string;
|
|
469
|
+
}
|
|
470
|
+
interface ExploreOptions extends CallOptions {
|
|
471
|
+
/** Shell commands, one per branch (at least two). */
|
|
472
|
+
variants: string[];
|
|
473
|
+
/** Image the variants run in (default `alpine:latest`). */
|
|
474
|
+
image?: string;
|
|
475
|
+
/** Keep every branch instead of only the winner. */
|
|
476
|
+
keepAll?: boolean;
|
|
477
|
+
/** Keep this branch (by id) instead of the winner. */
|
|
478
|
+
keep?: string;
|
|
479
|
+
/** Per-branch time limit in ms (default 120000). */
|
|
480
|
+
timeoutMs?: number;
|
|
481
|
+
/** Branch name prefix (default `<sandbox>-explore-<n>`). */
|
|
482
|
+
prefix?: string;
|
|
483
|
+
/**
|
|
484
|
+
* Pull `image` into the parent sandbox before forking so every branch has
|
|
485
|
+
* it (a sandbox's engine does not pull on run). Default true.
|
|
486
|
+
*/
|
|
487
|
+
pull?: boolean;
|
|
488
|
+
}
|
|
489
|
+
interface CheckpointOptions extends CallOptions {
|
|
490
|
+
/** Why it is being taken, e.g. "before the migration". */
|
|
491
|
+
label?: string;
|
|
492
|
+
}
|
|
493
|
+
interface CheckpointResult {
|
|
494
|
+
checkpoint: Checkpoint;
|
|
495
|
+
/** Older checkpoints dropped to stay under the cap of 10. */
|
|
496
|
+
evicted: string[];
|
|
497
|
+
snapshot: SnapshotSandboxResult;
|
|
498
|
+
}
|
|
499
|
+
interface RewindOptions extends CallOptions {
|
|
500
|
+
/** Checkpoint id or label (default: the most recent). */
|
|
501
|
+
to?: string;
|
|
502
|
+
}
|
|
503
|
+
interface RewindResult {
|
|
504
|
+
sandbox: Sandbox;
|
|
505
|
+
checkpoint: Checkpoint;
|
|
506
|
+
/** Checkpoints taken after the one returned to, now deleted. */
|
|
507
|
+
dropped: string[];
|
|
508
|
+
restore_ms: number;
|
|
509
|
+
}
|
|
510
|
+
interface RestoreOptions extends CallOptions {
|
|
511
|
+
/** Name for the restored sandbox. */
|
|
512
|
+
name?: string;
|
|
513
|
+
/** Raise the restored sandbox's classification label. */
|
|
514
|
+
label?: string;
|
|
515
|
+
/** Restore a sealed snapshot whose seal does not verify (recorded in the audit log). */
|
|
516
|
+
allowTampered?: boolean;
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Typed client for the kosa8 native API over the daemon's unix socket.
|
|
520
|
+
*
|
|
521
|
+
* ```ts
|
|
522
|
+
* const kosa8 = new Kosa8Client();
|
|
523
|
+
* const { sandbox } = await kosa8.createSandbox({ name: 'demo', egress: 'deny' });
|
|
524
|
+
* ```
|
|
525
|
+
*/
|
|
526
|
+
declare class Kosa8Client {
|
|
527
|
+
readonly transport: Transport;
|
|
528
|
+
readonly checkpoints: CheckpointBook;
|
|
529
|
+
constructor(options?: Kosa8ClientOptions);
|
|
530
|
+
/** GET /kosa8/v1/health: daemon status and version. */
|
|
531
|
+
health(opts?: CallOptions): Promise<Health>;
|
|
532
|
+
/** The daemon's version string. */
|
|
533
|
+
version(opts?: CallOptions): Promise<string>;
|
|
534
|
+
/** POST /kosa8/v1/pull: pull an image into the host engine (checked against the registry allow-list). */
|
|
535
|
+
pull(ref: string, opts?: CallOptions): Promise<{
|
|
536
|
+
ok: boolean;
|
|
537
|
+
image: string;
|
|
538
|
+
}>;
|
|
539
|
+
/** GET /kosa8/v1/sandboxes */
|
|
540
|
+
listSandboxes(opts?: CallOptions): Promise<Sandbox[]>;
|
|
541
|
+
/** Find one sandbox by id or name (from the list; there is no single-sandbox GET). */
|
|
542
|
+
getSandbox(idOrName: string, opts?: CallOptions): Promise<Sandbox | undefined>;
|
|
543
|
+
/** POST /kosa8/v1/sandboxes: boot a microVM sandbox. */
|
|
544
|
+
createSandbox(options?: CreateSandboxOptions): Promise<CreateSandboxResult>;
|
|
545
|
+
/** POST /kosa8/v1/sandboxes/{id}/up: boot a stopped sandbox from its own disk. */
|
|
546
|
+
startSandbox(id: string, opts?: CallOptions): Promise<StartSandboxResult>;
|
|
547
|
+
/** POST /kosa8/v1/sandboxes/{id}/down: stop without deleting (disk kept). */
|
|
548
|
+
stopSandbox(id: string, opts?: CallOptions): Promise<StopSandboxResult>;
|
|
549
|
+
/**
|
|
550
|
+
* DELETE /kosa8/v1/sandboxes/{id}. Like `kosa8 sandbox rm`, the sandbox's
|
|
551
|
+
* checkpoints and their snapshots are dropped too unless
|
|
552
|
+
* `keepCheckpoints` is set.
|
|
553
|
+
*/
|
|
554
|
+
deleteSandbox(id: string, opts?: CallOptions & {
|
|
555
|
+
wipe?: boolean;
|
|
556
|
+
keepCheckpoints?: boolean;
|
|
557
|
+
}): Promise<DeleteSandboxResult & {
|
|
558
|
+
checkpoints_dropped: number;
|
|
559
|
+
}>;
|
|
560
|
+
/** POST /kosa8/v1/sandboxes/{id}/pull: pull an image into the sandbox's private engine (fetched on the host). */
|
|
561
|
+
pullIntoSandbox(id: string, ref: string, opts?: CallOptions): Promise<{
|
|
562
|
+
ok: boolean;
|
|
563
|
+
image: string;
|
|
564
|
+
}>;
|
|
565
|
+
/** GET /kosa8/v1/sandboxes/{id}/images */
|
|
566
|
+
sandboxImages(id: string, opts?: CallOptions): Promise<string[]>;
|
|
567
|
+
/** GET /kosa8/v1/sandboxes/{id}/containers */
|
|
568
|
+
sandboxContainers(id: string, opts?: CallOptions): Promise<Container[]>;
|
|
569
|
+
/** GET /kosa8/v1/sandboxes/{id}/egress: the policy the host enforces and what it decided. */
|
|
570
|
+
sandboxEgress(id: string, opts?: CallOptions): Promise<EgressStatus>;
|
|
571
|
+
/**
|
|
572
|
+
* POST /kosa8/v1/sandboxes/{id}/run: run a container to completion inside
|
|
573
|
+
* the sandbox's engine. The image must already be in the sandbox
|
|
574
|
+
* (`pullIntoSandbox`). Resolves with the exit code; a non-zero exit is not
|
|
575
|
+
* an error.
|
|
576
|
+
*/
|
|
577
|
+
run(id: string, image: string, args?: string[], opts?: RunOptions): Promise<ExecResult>;
|
|
578
|
+
/** POST /kosa8/v1/sandboxes/{id}/start: start a detached container; resolves with its id. */
|
|
579
|
+
startContainer(id: string, image: string, args?: string[], opts?: CallOptions): Promise<string>;
|
|
580
|
+
/** POST /kosa8/v1/sandboxes/{id}/exec: run a command in a running container of the sandbox. */
|
|
581
|
+
exec(id: string, container: string, args: string[], opts?: ExecOptions): Promise<ExecResult>;
|
|
582
|
+
/** The raw frame stream of an exec, for callers that want to process output as it arrives. */
|
|
583
|
+
execFrames(id: string, container: string, args: string[], opts?: CallOptions): AsyncGenerator<Frame>;
|
|
584
|
+
/** POST /kosa8/v1/sandboxes/{id}/start-interactive: start a container with stdin held open. */
|
|
585
|
+
startInteractive(id: string, image: string, args?: string[], opts?: CallOptions & {
|
|
586
|
+
env?: Record<string, string> | string[];
|
|
587
|
+
tty?: boolean;
|
|
588
|
+
}): Promise<string>;
|
|
589
|
+
/** POST /kosa8/v1/sandboxes/{id}/containers/{cid}/stdin: stream bytes into an interactive container's stdin. */
|
|
590
|
+
writeStdin(id: string, container: string, data: Uint8Array | string | AsyncIterable<Uint8Array | string>, opts?: CallOptions): Promise<{
|
|
591
|
+
ok: boolean;
|
|
592
|
+
}>;
|
|
593
|
+
/** POST /kosa8/v1/sandboxes/{id}/containers/{cid}/attach: follow a container's output until it exits. */
|
|
594
|
+
attach(id: string, container: string, opts?: ExecOptions): Promise<ExecResult>;
|
|
595
|
+
/** POST /kosa8/v1/sandboxes/{id}/snapshot: capture memory, processes and disks. */
|
|
596
|
+
snapshot(id: string, opts?: CallOptions & {
|
|
597
|
+
id?: string;
|
|
598
|
+
encrypt?: boolean;
|
|
599
|
+
}): Promise<SnapshotSandboxResult>;
|
|
600
|
+
/** GET /kosa8/v1/snapshots */
|
|
601
|
+
listSnapshots(opts?: CallOptions): Promise<Snapshot[]>;
|
|
602
|
+
/** POST /kosa8/v1/snapshots/{id}/restore: boot a sandbox from a snapshot, processes resumed. */
|
|
603
|
+
restoreSnapshot(snapshotId: string, opts?: RestoreOptions): Promise<RestoreResult>;
|
|
604
|
+
/** DELETE /kosa8/v1/snapshots/{id} */
|
|
605
|
+
deleteSnapshot(snapshotId: string, opts?: CallOptions & {
|
|
606
|
+
wipe?: boolean;
|
|
607
|
+
force?: boolean;
|
|
608
|
+
}): Promise<DeleteSnapshotResult>;
|
|
609
|
+
/** POST /kosa8/v1/sandboxes/{id}/fork: N live copies of a running sandbox. */
|
|
610
|
+
fork(id: string, opts?: ForkOptions): Promise<ForkResult>;
|
|
611
|
+
/**
|
|
612
|
+
* Best-of-N, as `kosa8 explore`: fork the sandbox once per variant, run
|
|
613
|
+
* each variant (`sh -c VARIANT` in `image`) in its own branch
|
|
614
|
+
* concurrently, keep the fastest successful branch and delete the rest.
|
|
615
|
+
*/
|
|
616
|
+
explore(id: string, opts: ExploreOptions): Promise<ExploreResult>;
|
|
617
|
+
private runBranch;
|
|
618
|
+
/**
|
|
619
|
+
* Save a restore point: a snapshot with id `<sandbox>-ckpt-<n>`, recorded on
|
|
620
|
+
* the sandbox's checkpoint stack (the same store `kosa8 checkpoint` uses).
|
|
621
|
+
* The oldest is evicted past 10.
|
|
622
|
+
*/
|
|
623
|
+
checkpoint(sandbox: string, opts?: CheckpointOptions): Promise<CheckpointResult>;
|
|
624
|
+
/** A sandbox's restore points, oldest first. */
|
|
625
|
+
listCheckpoints(sandbox: string): Promise<Checkpoint[]>;
|
|
626
|
+
/**
|
|
627
|
+
* Undo: put the sandbox back to a checkpoint under the same name, processes
|
|
628
|
+
* resumed. Deletes the sandbox, then restores the snapshot with its name;
|
|
629
|
+
* checkpoints taken after the target are discarded. Current state is lost.
|
|
630
|
+
*/
|
|
631
|
+
rewind(sandbox: string, opts?: RewindOptions): Promise<RewindResult>;
|
|
632
|
+
/** A handle bound to one sandbox. */
|
|
633
|
+
sandbox(id: string): SandboxHandle;
|
|
634
|
+
private collect;
|
|
635
|
+
}
|
|
636
|
+
/** Convenience wrapper: the client's sandbox methods bound to one sandbox id. */
|
|
637
|
+
declare class SandboxHandle {
|
|
638
|
+
readonly client: Kosa8Client;
|
|
639
|
+
readonly id: string;
|
|
640
|
+
constructor(client: Kosa8Client, id: string);
|
|
641
|
+
info(opts?: CallOptions): Promise<Sandbox | undefined>;
|
|
642
|
+
start(opts?: CallOptions): Promise<StartSandboxResult>;
|
|
643
|
+
stop(opts?: CallOptions): Promise<StopSandboxResult>;
|
|
644
|
+
delete(opts?: CallOptions & {
|
|
645
|
+
wipe?: boolean;
|
|
646
|
+
keepCheckpoints?: boolean;
|
|
647
|
+
}): Promise<DeleteSandboxResult & {
|
|
648
|
+
checkpoints_dropped: number;
|
|
649
|
+
}>;
|
|
650
|
+
pull(ref: string, opts?: CallOptions): Promise<{
|
|
651
|
+
ok: boolean;
|
|
652
|
+
image: string;
|
|
653
|
+
}>;
|
|
654
|
+
run(image: string, args?: string[], opts?: RunOptions): Promise<ExecResult>;
|
|
655
|
+
startContainer(image: string, args?: string[], opts?: CallOptions): Promise<string>;
|
|
656
|
+
exec(container: string, args: string[], opts?: ExecOptions): Promise<ExecResult>;
|
|
657
|
+
containers(opts?: CallOptions): Promise<Container[]>;
|
|
658
|
+
images(opts?: CallOptions): Promise<string[]>;
|
|
659
|
+
egress(opts?: CallOptions): Promise<EgressStatus>;
|
|
660
|
+
snapshot(opts?: CallOptions & {
|
|
661
|
+
id?: string;
|
|
662
|
+
encrypt?: boolean;
|
|
663
|
+
}): Promise<SnapshotSandboxResult>;
|
|
664
|
+
fork(opts?: ForkOptions): Promise<ForkResult>;
|
|
665
|
+
explore(opts: ExploreOptions): Promise<ExploreResult>;
|
|
666
|
+
checkpoint(opts?: CheckpointOptions): Promise<CheckpointResult>;
|
|
667
|
+
checkpoints(): Promise<Checkpoint[]>;
|
|
668
|
+
rewind(opts?: RewindOptions): Promise<RewindResult>;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* Typed errors. Every error the daemon answers with carries its own words:
|
|
673
|
+
* `daemonMessage` is the daemon's `error` field verbatim, and `remediation`
|
|
674
|
+
* is its `remediation` field (what to do about it). A refusal because the
|
|
675
|
+
* org policy wants signed approvals also carries the refusal itself, under
|
|
676
|
+
* `approval`, exactly as the daemon sent it.
|
|
677
|
+
*/
|
|
678
|
+
/** An approval rule from the org policy, as the daemon reports it. */
|
|
679
|
+
interface ApprovalRule {
|
|
680
|
+
[key: string]: unknown;
|
|
681
|
+
}
|
|
682
|
+
/** What the policy requires before an action may run. */
|
|
683
|
+
interface ApprovalRequirement {
|
|
684
|
+
policy: string;
|
|
685
|
+
rules: ApprovalRule[];
|
|
686
|
+
}
|
|
687
|
+
/** The action a refusal is about. */
|
|
688
|
+
interface ApprovalAction {
|
|
689
|
+
kind: string;
|
|
690
|
+
target?: string;
|
|
691
|
+
command?: string[];
|
|
692
|
+
sandbox?: string;
|
|
693
|
+
[key: string]: unknown;
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* The daemon's answer to a call the org policy wants signed approvals for
|
|
697
|
+
* and that did not bring a usable one (pkg/approve Refusal).
|
|
698
|
+
*/
|
|
699
|
+
interface ApprovalRefusal {
|
|
700
|
+
route: string;
|
|
701
|
+
action: ApprovalAction;
|
|
702
|
+
description: string;
|
|
703
|
+
/** read-only | contained | destructive | escalating */
|
|
704
|
+
class: string;
|
|
705
|
+
policy: string;
|
|
706
|
+
policy_digest: string;
|
|
707
|
+
requirement: ApprovalRequirement;
|
|
708
|
+
/** The approval id the call presented, if any. */
|
|
709
|
+
request_id?: string;
|
|
710
|
+
/** What was wrong: nothing presented, not recorded, used, expired, ... */
|
|
711
|
+
why: string;
|
|
712
|
+
/** People the policy lets approve this action. */
|
|
713
|
+
signers?: string[];
|
|
714
|
+
/** The CLI command that opens a request for exactly this action. */
|
|
715
|
+
request_command: string;
|
|
716
|
+
}
|
|
717
|
+
interface Kosa8ErrorOptions {
|
|
718
|
+
status?: number;
|
|
719
|
+
daemonMessage?: string;
|
|
720
|
+
remediation?: string;
|
|
721
|
+
method?: string;
|
|
722
|
+
path?: string;
|
|
723
|
+
body?: unknown;
|
|
724
|
+
cause?: unknown;
|
|
725
|
+
}
|
|
726
|
+
/** Base class of every error this SDK throws. */
|
|
727
|
+
declare class Kosa8Error extends Error {
|
|
728
|
+
/** HTTP status the daemon answered with, when there was an answer. */
|
|
729
|
+
readonly status?: number;
|
|
730
|
+
/** The daemon's `error` text, verbatim. */
|
|
731
|
+
readonly daemonMessage?: string;
|
|
732
|
+
/** The daemon's `remediation` text: what to do about it. */
|
|
733
|
+
readonly remediation?: string;
|
|
734
|
+
readonly method?: string;
|
|
735
|
+
readonly path?: string;
|
|
736
|
+
/** The decoded response body, when there was one. */
|
|
737
|
+
readonly body?: unknown;
|
|
738
|
+
constructor(message: string, options?: Kosa8ErrorOptions);
|
|
739
|
+
}
|
|
740
|
+
/** The daemon could not be reached (no socket, connection refused, ...). */
|
|
741
|
+
declare class Kosa8ConnectionError extends Kosa8Error {
|
|
742
|
+
}
|
|
743
|
+
/** The daemon answered with an HTTP error. */
|
|
744
|
+
declare class Kosa8ApiError extends Kosa8Error {
|
|
745
|
+
}
|
|
746
|
+
/** 400: the request was malformed or a value was refused (an egress policy, say). */
|
|
747
|
+
declare class Kosa8BadRequestError extends Kosa8ApiError {
|
|
748
|
+
}
|
|
749
|
+
/** 401: a bearer token (remote worker) or agent token was missing or refused. */
|
|
750
|
+
declare class Kosa8AuthError extends Kosa8ApiError {
|
|
751
|
+
}
|
|
752
|
+
/** 403: refused by policy (org policy, registry allow-list, labels, ...). */
|
|
753
|
+
declare class Kosa8PolicyError extends Kosa8ApiError {
|
|
754
|
+
}
|
|
755
|
+
/**
|
|
756
|
+
* 403 with a signed-approval refusal: the org policy wants people other than
|
|
757
|
+
* the caller to approve this exact action. Get the approval id from a human
|
|
758
|
+
* and repeat the call with `{ approval: id }`.
|
|
759
|
+
*/
|
|
760
|
+
declare class Kosa8ApprovalRequiredError extends Kosa8PolicyError {
|
|
761
|
+
readonly approval: ApprovalRefusal;
|
|
762
|
+
constructor(message: string, approval: ApprovalRefusal, options?: Kosa8ErrorOptions);
|
|
763
|
+
}
|
|
764
|
+
/** 404: no such sandbox, snapshot, container, ... */
|
|
765
|
+
declare class Kosa8NotFoundError extends Kosa8ApiError {
|
|
766
|
+
}
|
|
767
|
+
/** 409: a conflict, e.g. the sandbox exists but is not running, or a snapshot id is taken. */
|
|
768
|
+
declare class Kosa8ConflictError extends Kosa8ApiError {
|
|
769
|
+
}
|
|
770
|
+
/** 501: the platform cannot do this (sandboxes need macOS on Apple silicon or Linux with KVM). */
|
|
771
|
+
declare class Kosa8UnsupportedError extends Kosa8ApiError {
|
|
772
|
+
}
|
|
773
|
+
/**
|
|
774
|
+
* A streamed operation (run, exec, attach) ended with an error frame rather
|
|
775
|
+
* than an exit code. Output produced before the error is kept.
|
|
776
|
+
*/
|
|
777
|
+
declare class Kosa8StreamError extends Kosa8Error {
|
|
778
|
+
readonly stdout: string;
|
|
779
|
+
readonly stderr: string;
|
|
780
|
+
constructor(message: string, out: {
|
|
781
|
+
stdout: string;
|
|
782
|
+
stderr: string;
|
|
783
|
+
}, options?: Kosa8ErrorOptions);
|
|
784
|
+
}
|
|
785
|
+
/** A client-side checkpoint operation failed (no checkpoint, bad name, ...). */
|
|
786
|
+
declare class Kosa8CheckpointError extends Kosa8Error {
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* Build the typed error for an HTTP error answer. The message is the daemon's
|
|
790
|
+
* own, with its remediation in parentheses, the way the kosa8 CLI and MCP
|
|
791
|
+
* server print it.
|
|
792
|
+
*/
|
|
793
|
+
declare function errorFromResponse(status: number, body: unknown, ctx?: {
|
|
794
|
+
method?: string;
|
|
795
|
+
path?: string;
|
|
796
|
+
}): Kosa8ApiError;
|
|
797
|
+
|
|
798
|
+
export { ACTOR_HEADER, AGENT_TOKEN_HEADER, APPROVAL_HEADER, type Actor, type ApprovalAction, type ApprovalRefusal, type ApprovalRequirement, type ApprovalRule, type BrokerHostRule, type BrokerInfo, type BrokerRoute, type BrokerSpec, type CallOptions, type CaptureSpec, type Checkpoint, CheckpointBook, type CheckpointOptions, type CheckpointResult, type CheckpointStore, type Container, type CreateSandboxOptions, type CreateSandboxResult, type DeleteSandboxResult, type DeleteSnapshotResult, type EgressPolicy, type EgressPolicyString, type EgressStatus, type ExecOptions, type ExecResult, type ExploreBranch, type ExploreOptions, type ExploreResult, FileCheckpointStore, type ForkOptions, type ForkResult, type Frame, type Health, Kosa8ApiError, Kosa8ApprovalRequiredError, Kosa8AuthError, Kosa8BadRequestError, Kosa8CheckpointError, Kosa8Client, type Kosa8ClientOptions, Kosa8ConflictError, Kosa8ConnectionError, Kosa8Error, Kosa8NotFoundError, Kosa8PolicyError, Kosa8StreamError, Kosa8UnsupportedError, MAX_CHECKPOINTS_PER_SANDBOX, MemoryCheckpointStore, type Mount, type RequestOptions, type RestoreOptions, type RestoreResult, type RewindOptions, type RewindResult, type RunOptions, type Sandbox, SandboxHandle, type Snapshot, type SnapshotSandboxResult, type StartSandboxResult, type StopSandboxResult, Transport, type TransportOptions, defaultSocketPath, errorFromResponse, resolveEndpoint, validateSandboxName };
|