@miosa/sdk 3.5.0 → 3.6.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/README.md +93 -0
- package/dist/chunk-BMWUKYWU.js +463 -0
- package/dist/chunk-BMWUKYWU.js.map +1 -0
- package/dist/chunk-H245ZDMW.js +195 -0
- package/dist/chunk-H245ZDMW.js.map +1 -0
- package/dist/client-C_uXhex9.d.ts +9221 -0
- package/dist/computer-CKDK0Ahy.d.ts +3689 -0
- package/dist/computer-use/index.d.ts +154 -0
- package/dist/computer-use/index.js +185 -0
- package/dist/computer-use/index.js.map +1 -0
- package/dist/helpers/index.d.ts +77 -0
- package/dist/helpers/index.js +151 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/index.d.ts +7 -12658
- package/dist/index.js +347 -486
- package/dist/index.js.map +1 -1
- package/package.json +18 -1
|
@@ -0,0 +1,3689 @@
|
|
|
1
|
+
import * as ws from 'ws';
|
|
2
|
+
import EventEmitter from 'node:events';
|
|
3
|
+
|
|
4
|
+
interface RequestOptions {
|
|
5
|
+
method?: string;
|
|
6
|
+
headers?: Record<string, string>;
|
|
7
|
+
body?: unknown;
|
|
8
|
+
timeout?: number;
|
|
9
|
+
/** Cancel this request and its response stream without retrying. */
|
|
10
|
+
signal?: AbortSignal | undefined;
|
|
11
|
+
/** Override retries for operations which cannot safely be replayed. */
|
|
12
|
+
maxRetries?: number;
|
|
13
|
+
/** Return raw Response instead of parsing JSON */
|
|
14
|
+
rawResponse?: boolean;
|
|
15
|
+
/** Send body as multipart/form-data */
|
|
16
|
+
formData?: FormData;
|
|
17
|
+
/** Expected response is binary */
|
|
18
|
+
binary?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** One parsed Server-Sent Events frame: its `event:` name plus `data:` payload. */
|
|
21
|
+
interface SseFrame<T> {
|
|
22
|
+
/** The SSE `event:` name, or `null` when the frame carried no event field. */
|
|
23
|
+
event: string | null;
|
|
24
|
+
/** The parsed JSON payload from the frame's `data:` line(s). */
|
|
25
|
+
data: T;
|
|
26
|
+
}
|
|
27
|
+
interface HttpClientConfig {
|
|
28
|
+
baseUrl: string;
|
|
29
|
+
apiKey: string;
|
|
30
|
+
tenant?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Replaces the default `@miosa/sdk/<version>` User-Agent. A platform that
|
|
33
|
+
* resells MIOSA under its own name sets this to its own product string.
|
|
34
|
+
*/
|
|
35
|
+
userAgent?: string;
|
|
36
|
+
timeout: number;
|
|
37
|
+
maxRetries: number;
|
|
38
|
+
}
|
|
39
|
+
declare class HttpClient {
|
|
40
|
+
/** Public for WebSocket clients that need to derive their own URL. */
|
|
41
|
+
readonly baseUrl: string;
|
|
42
|
+
/** Public for WebSocket clients that need to send the same auth. */
|
|
43
|
+
readonly apiKey: string;
|
|
44
|
+
readonly tenant: string | undefined;
|
|
45
|
+
readonly userAgent: string;
|
|
46
|
+
private readonly timeout;
|
|
47
|
+
private readonly maxRetries;
|
|
48
|
+
constructor(config: HttpClientConfig);
|
|
49
|
+
private buildUrl;
|
|
50
|
+
private baseHeaders;
|
|
51
|
+
request<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
52
|
+
get<T>(path: string, query?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
53
|
+
post<T>(path: string, body?: unknown): Promise<T>;
|
|
54
|
+
patch<T>(path: string, body?: unknown): Promise<T>;
|
|
55
|
+
put<T>(path: string, body?: unknown): Promise<T>;
|
|
56
|
+
delete<T>(path: string, body?: unknown): Promise<T>;
|
|
57
|
+
getBinary(path: string): Promise<Uint8Array>;
|
|
58
|
+
postFormData<T>(path: string, formData: FormData): Promise<T>;
|
|
59
|
+
/**
|
|
60
|
+
* Open a Server-Sent Events stream and yield each frame's parsed `data:`
|
|
61
|
+
* payload together with its SSE `event:` name (when present). Most callers
|
|
62
|
+
* want {@link stream}; use this when the event name carries meaning — e.g. the
|
|
63
|
+
* sandbox exec stream tags frames as `stdout` / `stderr` / `exit`. The caller
|
|
64
|
+
* is responsible for breaking the loop.
|
|
65
|
+
*/
|
|
66
|
+
streamFrames<T>(path: string, options?: RequestOptions): AsyncIterableIterator<SseFrame<T>>;
|
|
67
|
+
/**
|
|
68
|
+
* Open a Server-Sent Events stream. Returns an AsyncIterableIterator of
|
|
69
|
+
* parsed event data objects. The caller is responsible for breaking the loop.
|
|
70
|
+
*/
|
|
71
|
+
stream<T>(path: string, options?: RequestOptions): AsyncIterableIterator<T>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Per-computer shares: invite a person by email, or mint a link anyone with
|
|
76
|
+
* the link can accept. Roles are `viewer`, `editor` and `admin`. Routes:
|
|
77
|
+
* `/computers/:id/shares`, `/shared/:token`, `/shared/:token/accept`.
|
|
78
|
+
*/
|
|
79
|
+
type ShareRole = "viewer" | "editor" | "admin";
|
|
80
|
+
interface ComputerShare {
|
|
81
|
+
id: string;
|
|
82
|
+
kind: "user" | "link";
|
|
83
|
+
role: ShareRole;
|
|
84
|
+
email?: string | null;
|
|
85
|
+
expires_at?: string | null;
|
|
86
|
+
accepted_at?: string | null;
|
|
87
|
+
created_at?: string;
|
|
88
|
+
[key: string]: unknown;
|
|
89
|
+
}
|
|
90
|
+
type ComputerShareCreateParams = {
|
|
91
|
+
kind: "user";
|
|
92
|
+
email: string;
|
|
93
|
+
role: ShareRole;
|
|
94
|
+
expiresInHours?: number;
|
|
95
|
+
} | {
|
|
96
|
+
kind: "link";
|
|
97
|
+
role: ShareRole;
|
|
98
|
+
expiresInHours?: number;
|
|
99
|
+
};
|
|
100
|
+
declare class ComputerShares {
|
|
101
|
+
private readonly http;
|
|
102
|
+
private readonly computerId;
|
|
103
|
+
constructor(http: HttpClient, computerId: string);
|
|
104
|
+
private get base();
|
|
105
|
+
list(): Promise<ComputerShare[]>;
|
|
106
|
+
/**
|
|
107
|
+
* `POST /computers/:id/shares`. A `link` share also returns `share_url`; the
|
|
108
|
+
* raw token inside it is shown once.
|
|
109
|
+
*/
|
|
110
|
+
create(params: ComputerShareCreateParams): Promise<{
|
|
111
|
+
data: ComputerShare;
|
|
112
|
+
share_url?: string;
|
|
113
|
+
}>;
|
|
114
|
+
update(shareId: string, patch: {
|
|
115
|
+
role?: ShareRole;
|
|
116
|
+
expiresAt?: string | null;
|
|
117
|
+
}): Promise<ComputerShare>;
|
|
118
|
+
delete(shareId: string): Promise<{
|
|
119
|
+
id: string;
|
|
120
|
+
deleted: boolean;
|
|
121
|
+
}>;
|
|
122
|
+
}
|
|
123
|
+
/** Redeem a share link (`/shared/:token`). */
|
|
124
|
+
declare class SharedLinks {
|
|
125
|
+
private readonly http;
|
|
126
|
+
constructor(http: HttpClient);
|
|
127
|
+
/** `GET /shared/:token`: unauthenticated preview of what the link grants. */
|
|
128
|
+
resolve(token: string): Promise<{
|
|
129
|
+
computer: {
|
|
130
|
+
id: string;
|
|
131
|
+
name: string;
|
|
132
|
+
template_type: string;
|
|
133
|
+
size: string;
|
|
134
|
+
status: string;
|
|
135
|
+
};
|
|
136
|
+
role: ShareRole;
|
|
137
|
+
expires_at: string | null;
|
|
138
|
+
}>;
|
|
139
|
+
/** `POST /shared/:token/accept`: needs a signed-in user. */
|
|
140
|
+
accept(token: string): Promise<{
|
|
141
|
+
computer_id: string;
|
|
142
|
+
role: ShareRole;
|
|
143
|
+
}>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Pieces shared by sandboxes and computers: environment selection on create,
|
|
148
|
+
* resume, fork, start and clone; the machine JSON fields environments and
|
|
149
|
+
* setup scripts add; the synchronous commands endpoint; and agent steering.
|
|
150
|
+
*/
|
|
151
|
+
/** Which environment a machine is created or started from. */
|
|
152
|
+
interface EnvironmentSelectionParams {
|
|
153
|
+
/** Environment name. With none named, create uses the default and resume/start keeps the current pin. */
|
|
154
|
+
environment?: string;
|
|
155
|
+
/** Environment id. Alias `env_id` is accepted on the wire; the SDK sends `environment_id`. */
|
|
156
|
+
environmentId?: string;
|
|
157
|
+
environment_id?: string;
|
|
158
|
+
/** Nothing of the owner's passes to this machine, permanently (same as a `safe_for_third_parties` environment). */
|
|
159
|
+
noEnv?: boolean;
|
|
160
|
+
no_env?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Shed load instead of queueing: when no ready machine is free, the server
|
|
163
|
+
* answers `503 no_ready_machine` at once (a {@link NoReadyMachineError}) and
|
|
164
|
+
* the request is not retried by the client or counted against start limits.
|
|
165
|
+
*/
|
|
166
|
+
failFast?: boolean;
|
|
167
|
+
fail_fast?: boolean;
|
|
168
|
+
}
|
|
169
|
+
type EnvironmentStatus = "pending" | "applying" | "securing" | "applied" | "failed";
|
|
170
|
+
/** Fields every machine JSON carries once environments are enabled. */
|
|
171
|
+
interface MachineEnvironmentFields {
|
|
172
|
+
/** Environment name, or `null` for a machine that predates environments. */
|
|
173
|
+
environment?: string | null;
|
|
174
|
+
environment_id?: string | null;
|
|
175
|
+
environment_version?: number | null;
|
|
176
|
+
environment_latest_version?: number | null;
|
|
177
|
+
environment_base_id?: string | null;
|
|
178
|
+
environment_base_version?: number | null;
|
|
179
|
+
environment_upgrade_available?: boolean;
|
|
180
|
+
environment_protected?: boolean;
|
|
181
|
+
environment_status?: EnvironmentStatus | null;
|
|
182
|
+
/** Short machine-readable reason when `environment_status` is `failed`. Never a secret. */
|
|
183
|
+
environment_error?: string | null;
|
|
184
|
+
}
|
|
185
|
+
type SetupStatus = "pending" | "running" | "done" | "failed";
|
|
186
|
+
interface SetupRepoStep {
|
|
187
|
+
repo: string;
|
|
188
|
+
path: string;
|
|
189
|
+
blocking: boolean;
|
|
190
|
+
status: SetupStatus;
|
|
191
|
+
error: string | null;
|
|
192
|
+
started_at: string | null;
|
|
193
|
+
finished_at: string | null;
|
|
194
|
+
}
|
|
195
|
+
interface SetupEnvironmentStep {
|
|
196
|
+
blocking: boolean;
|
|
197
|
+
status: SetupStatus;
|
|
198
|
+
error: string | null;
|
|
199
|
+
started_at: string | null;
|
|
200
|
+
finished_at: string | null;
|
|
201
|
+
}
|
|
202
|
+
interface SetupCliToolsStep extends SetupEnvironmentStep {
|
|
203
|
+
tools: Record<string, string>;
|
|
204
|
+
}
|
|
205
|
+
/** Setup status fields on the machine JSON. The script itself is never returned. */
|
|
206
|
+
interface MachineSetupFields {
|
|
207
|
+
/** `null` means no setup. Combines the setup file and the environment steps. */
|
|
208
|
+
setup_status?: SetupStatus | null;
|
|
209
|
+
setup_error?: string | null;
|
|
210
|
+
setup_file_status?: SetupStatus | null;
|
|
211
|
+
setup_file_error?: string | null;
|
|
212
|
+
setup_started_at?: string | null;
|
|
213
|
+
setup_finished_at?: string | null;
|
|
214
|
+
setup_repos?: SetupRepoStep[];
|
|
215
|
+
setup_environment?: SetupEnvironmentStep | null;
|
|
216
|
+
setup_cli_tools?: SetupCliToolsStep | null;
|
|
217
|
+
}
|
|
218
|
+
/** Per-request billing override for creates. See {@link BillTo}. */
|
|
219
|
+
interface BillToParam {
|
|
220
|
+
/** Organization id, slug or name (case-insensitive). Sent as the `X-Miosa-Bill-To` header. */
|
|
221
|
+
billTo?: string;
|
|
222
|
+
bill_to?: string;
|
|
223
|
+
}
|
|
224
|
+
interface MachineCommandOptions {
|
|
225
|
+
/** Absolute, or relative to the work directory (`/workspace`, or the command user's home for a computer). */
|
|
226
|
+
cwd?: string;
|
|
227
|
+
/** 1 to 600, default 60. Larger values are refused with `422 TIMEOUT_TOO_LONG`. */
|
|
228
|
+
timeoutSeconds?: number;
|
|
229
|
+
/** Text for the command's standard input, at most 32768 bytes. */
|
|
230
|
+
stdin?: string;
|
|
231
|
+
}
|
|
232
|
+
interface MachineCommandResult {
|
|
233
|
+
stdout: string;
|
|
234
|
+
stderr: string;
|
|
235
|
+
exit_code: number;
|
|
236
|
+
duration_ms: number;
|
|
237
|
+
/** True, with `exit_code` -1, when the command was killed at its deadline. */
|
|
238
|
+
timed_out: boolean;
|
|
239
|
+
stdout_truncated?: boolean;
|
|
240
|
+
stderr_truncated?: boolean;
|
|
241
|
+
}
|
|
242
|
+
interface AgentPromptQueued {
|
|
243
|
+
queued: boolean;
|
|
244
|
+
after_run_id: string | null;
|
|
245
|
+
runner: string;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Steer the agent run attached to a machine (its newest queued or running
|
|
249
|
+
* harness run). With none attached both calls fail with `NoAgentRunError`.
|
|
250
|
+
*/
|
|
251
|
+
declare class MachineAgent {
|
|
252
|
+
private readonly http;
|
|
253
|
+
private readonly base;
|
|
254
|
+
constructor(http: HttpClient, base: string);
|
|
255
|
+
/** `POST .../agent/prompts`: queue a message as the next turn of the agent's chat. */
|
|
256
|
+
prompt(prompt: string): Promise<AgentPromptQueued>;
|
|
257
|
+
/** `POST .../agent/stop`: halt the agent run. Resolves with the canceled run. */
|
|
258
|
+
stop(): Promise<Record<string, unknown>>;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/** Producer names that can be subscribed to. */
|
|
262
|
+
type EventProducer = "window" | "clipboard" | "file" | "process" | "idle";
|
|
263
|
+
/** Options for `Events.subscribe()`. */
|
|
264
|
+
interface EventSubscribeOptions {
|
|
265
|
+
/** At least one producer is required. */
|
|
266
|
+
subscribe: EventProducer[];
|
|
267
|
+
/** Paths to watch for the `file` producer. Defaults to `["/home/user"]`. */
|
|
268
|
+
paths?: string[];
|
|
269
|
+
/** Idle threshold in seconds for the `idle` producer. Defaults to 30. */
|
|
270
|
+
idleThresholdSec?: number;
|
|
271
|
+
}
|
|
272
|
+
interface WindowFocusChangedPayload {
|
|
273
|
+
window_id: string;
|
|
274
|
+
pid: string;
|
|
275
|
+
title: string;
|
|
276
|
+
}
|
|
277
|
+
interface WindowOpenedPayload {
|
|
278
|
+
window_id: string;
|
|
279
|
+
pid: string;
|
|
280
|
+
title: string;
|
|
281
|
+
}
|
|
282
|
+
interface WindowClosedPayload {
|
|
283
|
+
window_id: string;
|
|
284
|
+
pid: string;
|
|
285
|
+
title: string;
|
|
286
|
+
}
|
|
287
|
+
interface ClipboardChangedPayload {
|
|
288
|
+
size_bytes: number;
|
|
289
|
+
}
|
|
290
|
+
interface FileCreatedPayload {
|
|
291
|
+
path: string;
|
|
292
|
+
}
|
|
293
|
+
interface FileModifiedPayload {
|
|
294
|
+
path: string;
|
|
295
|
+
}
|
|
296
|
+
interface FileDeletedPayload {
|
|
297
|
+
path: string;
|
|
298
|
+
}
|
|
299
|
+
interface ProcessStartedPayload {
|
|
300
|
+
pid: number;
|
|
301
|
+
cmd: string;
|
|
302
|
+
ppid: string;
|
|
303
|
+
}
|
|
304
|
+
interface ProcessStoppedPayload {
|
|
305
|
+
pid: number;
|
|
306
|
+
cmd: string;
|
|
307
|
+
}
|
|
308
|
+
interface IdleInactivePayload {
|
|
309
|
+
idle_ms: number;
|
|
310
|
+
}
|
|
311
|
+
interface IdleActivePayload {
|
|
312
|
+
idle_ms: number;
|
|
313
|
+
}
|
|
314
|
+
interface ProducerUnavailablePayload {
|
|
315
|
+
producer: EventProducer;
|
|
316
|
+
reason: string;
|
|
317
|
+
}
|
|
318
|
+
/** Union of all typed event envelopes. */
|
|
319
|
+
type ComputerEvent = {
|
|
320
|
+
type: "window.focus_changed";
|
|
321
|
+
timestamp: string;
|
|
322
|
+
payload: WindowFocusChangedPayload;
|
|
323
|
+
} | {
|
|
324
|
+
type: "window.opened";
|
|
325
|
+
timestamp: string;
|
|
326
|
+
payload: WindowOpenedPayload;
|
|
327
|
+
} | {
|
|
328
|
+
type: "window.closed";
|
|
329
|
+
timestamp: string;
|
|
330
|
+
payload: WindowClosedPayload;
|
|
331
|
+
} | {
|
|
332
|
+
type: "clipboard.changed";
|
|
333
|
+
timestamp: string;
|
|
334
|
+
payload: ClipboardChangedPayload;
|
|
335
|
+
} | {
|
|
336
|
+
type: "file.created";
|
|
337
|
+
timestamp: string;
|
|
338
|
+
payload: FileCreatedPayload;
|
|
339
|
+
} | {
|
|
340
|
+
type: "file.modified";
|
|
341
|
+
timestamp: string;
|
|
342
|
+
payload: FileModifiedPayload;
|
|
343
|
+
} | {
|
|
344
|
+
type: "file.deleted";
|
|
345
|
+
timestamp: string;
|
|
346
|
+
payload: FileDeletedPayload;
|
|
347
|
+
} | {
|
|
348
|
+
type: "process.started";
|
|
349
|
+
timestamp: string;
|
|
350
|
+
payload: ProcessStartedPayload;
|
|
351
|
+
} | {
|
|
352
|
+
type: "process.stopped";
|
|
353
|
+
timestamp: string;
|
|
354
|
+
payload: ProcessStoppedPayload;
|
|
355
|
+
} | {
|
|
356
|
+
type: "idle.inactive";
|
|
357
|
+
timestamp: string;
|
|
358
|
+
payload: IdleInactivePayload;
|
|
359
|
+
} | {
|
|
360
|
+
type: "idle.active";
|
|
361
|
+
timestamp: string;
|
|
362
|
+
payload: IdleActivePayload;
|
|
363
|
+
} | {
|
|
364
|
+
type: "producer.unavailable";
|
|
365
|
+
timestamp: string;
|
|
366
|
+
payload: ProducerUnavailablePayload;
|
|
367
|
+
};
|
|
368
|
+
type EventMap = {
|
|
369
|
+
[K in ComputerEvent["type"]]: [
|
|
370
|
+
Extract<ComputerEvent, {
|
|
371
|
+
type: K;
|
|
372
|
+
}>["payload"]
|
|
373
|
+
];
|
|
374
|
+
} & {
|
|
375
|
+
error: [Error];
|
|
376
|
+
close: [{
|
|
377
|
+
code: number;
|
|
378
|
+
reason: string;
|
|
379
|
+
}];
|
|
380
|
+
};
|
|
381
|
+
/**
|
|
382
|
+
* Typed event stream returned by `computer.events.subscribe()`.
|
|
383
|
+
*
|
|
384
|
+
* ```ts
|
|
385
|
+
* const stream = computer.events.subscribe({ subscribe: ["file", "process"] });
|
|
386
|
+
* stream.on("file.created", e => console.log("created:", e.path));
|
|
387
|
+
* stream.on("process.started", e => console.log("pid:", e.pid));
|
|
388
|
+
* stream.on("error", err => console.error(err));
|
|
389
|
+
* await stream.close();
|
|
390
|
+
* ```
|
|
391
|
+
*/
|
|
392
|
+
declare class EventStream extends EventEmitter<EventMap> {
|
|
393
|
+
private ws;
|
|
394
|
+
private closed;
|
|
395
|
+
/** @internal — use `Events.subscribe()` instead. */
|
|
396
|
+
constructor(ws: WebSocket | ws.WebSocket);
|
|
397
|
+
private attachHandlers;
|
|
398
|
+
/** Close the event stream. Idempotent. */
|
|
399
|
+
close(): Promise<void>;
|
|
400
|
+
/** Whether the stream has been closed (by client or server). */
|
|
401
|
+
get isClosed(): boolean;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Events resource attached to every `Computer` instance.
|
|
405
|
+
* Exposes `subscribe()` for real-time in-VM event streaming.
|
|
406
|
+
*/
|
|
407
|
+
declare class Events {
|
|
408
|
+
private readonly baseUrl;
|
|
409
|
+
private readonly apiKey;
|
|
410
|
+
private readonly computerId;
|
|
411
|
+
constructor(baseUrl: string, apiKey: string, computerId: string);
|
|
412
|
+
/**
|
|
413
|
+
* Open a WebSocket subscription for the specified producers.
|
|
414
|
+
*
|
|
415
|
+
* ```ts
|
|
416
|
+
* const stream = computer.events.subscribe({
|
|
417
|
+
* subscribe: ["window", "clipboard", "file"],
|
|
418
|
+
* paths: ["/home/user", "/workspace"],
|
|
419
|
+
* });
|
|
420
|
+
* stream.on("window.focus_changed", e => ...);
|
|
421
|
+
* stream.on("file.created", e => ...);
|
|
422
|
+
* stream.on("error", err => ...);
|
|
423
|
+
* await stream.close();
|
|
424
|
+
* ```
|
|
425
|
+
*/
|
|
426
|
+
subscribe(options: EventSubscribeOptions): EventStream;
|
|
427
|
+
private buildWsUrl;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
type CustomDomainStatus = "pending" | "verified" | "active" | "failed" | "removed";
|
|
431
|
+
interface CustomDomainData {
|
|
432
|
+
id: string;
|
|
433
|
+
computer_id: string;
|
|
434
|
+
tenant_id: string;
|
|
435
|
+
fqdn: string;
|
|
436
|
+
status: CustomDomainStatus;
|
|
437
|
+
/** The CNAME target the user must point their DNS record at. */
|
|
438
|
+
verification_target: string;
|
|
439
|
+
/** Human-readable DNS setup instructions. */
|
|
440
|
+
instructions: string;
|
|
441
|
+
verified_at: string | null;
|
|
442
|
+
tls_issued_at: string | null;
|
|
443
|
+
created_at: string;
|
|
444
|
+
updated_at: string;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Custom domain management for a Computer.
|
|
448
|
+
*
|
|
449
|
+
* Accessed via `computer.domains`.
|
|
450
|
+
*
|
|
451
|
+
* ## Workflow
|
|
452
|
+
* ```ts
|
|
453
|
+
* // 1. Register the domain
|
|
454
|
+
* const domain = await computer.domains.register("app.example.com");
|
|
455
|
+
* console.log(domain.instructions);
|
|
456
|
+
* // => "Add a CNAME record: app.example.com → <slug>.sandbox.miosa.ai"
|
|
457
|
+
*
|
|
458
|
+
* // 2. Add the CNAME in your DNS registrar, then...
|
|
459
|
+
*
|
|
460
|
+
* // 3. Verify ownership
|
|
461
|
+
* const verified = await computer.domains.verify(domain.id);
|
|
462
|
+
* // Caddy auto-issues a TLS certificate after this point.
|
|
463
|
+
* ```
|
|
464
|
+
*/
|
|
465
|
+
declare class CustomDomains {
|
|
466
|
+
private readonly http;
|
|
467
|
+
private readonly computerId;
|
|
468
|
+
constructor(http: HttpClient, computerId: string);
|
|
469
|
+
private base;
|
|
470
|
+
/**
|
|
471
|
+
* Register a custom FQDN for this computer.
|
|
472
|
+
*
|
|
473
|
+
* Returns the domain record with `verification_target` and `instructions`
|
|
474
|
+
* showing which CNAME record to add. The domain starts in `pending` status.
|
|
475
|
+
*
|
|
476
|
+
* @param fqdn - The fully-qualified domain name to register
|
|
477
|
+
* (e.g. `"app.example.com"`). Must be lowercase RFC 1123, ≤ 253 chars,
|
|
478
|
+
* and must NOT end with `miosa.ai`.
|
|
479
|
+
*/
|
|
480
|
+
register(fqdn: string): Promise<CustomDomainData>;
|
|
481
|
+
/**
|
|
482
|
+
* List all custom domains registered for this computer.
|
|
483
|
+
*/
|
|
484
|
+
list(): Promise<CustomDomainData[]>;
|
|
485
|
+
/**
|
|
486
|
+
* Verify DNS ownership of a registered domain.
|
|
487
|
+
*
|
|
488
|
+
* The control plane resolves the domain's CNAME and confirms it points to
|
|
489
|
+
* the expected `verification_target`. On success the domain transitions to
|
|
490
|
+
* `verified` status and Caddy will auto-issue a TLS certificate on the next
|
|
491
|
+
* inbound request.
|
|
492
|
+
*
|
|
493
|
+
* @param id - The custom domain record id (from `register()` or `list()`).
|
|
494
|
+
* @throws `ApiError` with code `CNAME_MISMATCH` if the CNAME doesn't match.
|
|
495
|
+
* @throws `ApiError` with code `DNS_LOOKUP_FAILED` if DNS is unreachable.
|
|
496
|
+
*/
|
|
497
|
+
verify(id: string): Promise<CustomDomainData>;
|
|
498
|
+
/**
|
|
499
|
+
* Delete a custom domain mapping.
|
|
500
|
+
*
|
|
501
|
+
* The domain is immediately removed from the routing cache and Caddy will
|
|
502
|
+
* stop serving it on the next cert renewal cycle.
|
|
503
|
+
*
|
|
504
|
+
* @param id - The custom domain record id.
|
|
505
|
+
*/
|
|
506
|
+
delete(id: string): Promise<void>;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
type ComputerId = string & {
|
|
510
|
+
readonly __brand: "ComputerId";
|
|
511
|
+
};
|
|
512
|
+
type SessionId = string & {
|
|
513
|
+
readonly __brand: "SessionId";
|
|
514
|
+
};
|
|
515
|
+
type TenantId = string & {
|
|
516
|
+
readonly __brand: "TenantId";
|
|
517
|
+
};
|
|
518
|
+
type ComputerSize = "xs" | "small" | "medium" | "large" | "xl";
|
|
519
|
+
type ComputerSizeInput = ComputerSize | "xlarge";
|
|
520
|
+
/**
|
|
521
|
+
* Lifecycle states emitted by the control plane.
|
|
522
|
+
*
|
|
523
|
+
* Canonical states (what the server actually emits):
|
|
524
|
+
* provisioning — VM is being created + booted (~30-50s on small tier)
|
|
525
|
+
* active — running and reachable (same as legacy "running")
|
|
526
|
+
* paused — RAM snapshot on disk, cold start available
|
|
527
|
+
* stopped — explicitly halted
|
|
528
|
+
* error — terminal failure; destroy and retry
|
|
529
|
+
* destroyed — terminal; gone
|
|
530
|
+
*
|
|
531
|
+
* Legacy aliases (`running`, `starting`, `creating`, `stopping`) are kept
|
|
532
|
+
* in the union so older callers still typecheck, but the server will emit
|
|
533
|
+
* the canonical names. Treat `active` and `running` as synonymous.
|
|
534
|
+
*/
|
|
535
|
+
type ComputerStatus = "provisioning" | "active" | "paused" | "stopped" | "error" | "destroyed" | "creating" | "starting" | "running" | "stopping";
|
|
536
|
+
/**
|
|
537
|
+
* Template slug for the rootfs a computer boots into.
|
|
538
|
+
*
|
|
539
|
+
* - `miosa-desktop` — full KasmVNC + Xfce GUI (default)
|
|
540
|
+
* - `miosa-sandbox` — lightweight code-exec rootfs, no desktop
|
|
541
|
+
*
|
|
542
|
+
* Additional templates can be added at the platform level; the type is kept
|
|
543
|
+
* open so future templates don't require an SDK release.
|
|
544
|
+
*/
|
|
545
|
+
type ComputerTemplateType = "miosa-desktop" | "miosa-sandbox" | (string & {});
|
|
546
|
+
/**
|
|
547
|
+
* Controls who can access the computer's HTTP preview URL.
|
|
548
|
+
*
|
|
549
|
+
* - `public` — unauthenticated access to preview paths (default)
|
|
550
|
+
* - `tenant` — requires a valid JWT with matching tenant_id
|
|
551
|
+
* - `key` — requires a Bearer `msk_u_*` key matching the owner tenant
|
|
552
|
+
*
|
|
553
|
+
* Sensitive paths (`/api/*`, `/vnc/*`, `/term/*`) are always auth-gated
|
|
554
|
+
* regardless of visibility mode.
|
|
555
|
+
*/
|
|
556
|
+
type ComputerVisibility = "public" | "tenant" | "key";
|
|
557
|
+
interface ComputerCreateParams extends EnvironmentSelectionParams, BillToParam {
|
|
558
|
+
name: string;
|
|
559
|
+
/**
|
|
560
|
+
* A script to run once, in the background, after the computer is ready (from
|
|
561
|
+
* a login shell, in the command user's home). At most 64 KiB, no NUL byte.
|
|
562
|
+
*/
|
|
563
|
+
setupFile?: string;
|
|
564
|
+
setup_file?: string;
|
|
565
|
+
/** Per-machine variables merged on top of the environment's. */
|
|
566
|
+
env?: Record<string, string>;
|
|
567
|
+
template_type?: ComputerTemplateType;
|
|
568
|
+
/** Canonical sizes are xs/small/medium/large/xl. `xlarge` is accepted as a legacy input alias. */
|
|
569
|
+
size?: ComputerSizeInput;
|
|
570
|
+
visibility?: ComputerVisibility;
|
|
571
|
+
metadata?: Record<string, string>;
|
|
572
|
+
/**
|
|
573
|
+
* Explicit agent runtime profile to mount into this computer. When omitted,
|
|
574
|
+
* MIOSA applies the workspace/tenant default profile that targets computers.
|
|
575
|
+
*/
|
|
576
|
+
agentRuntimeProfileId?: string;
|
|
577
|
+
agent_runtime_profile_id?: string;
|
|
578
|
+
/** Back-compat shorthand for agentRuntimeProfileId. */
|
|
579
|
+
agentProfileId?: string;
|
|
580
|
+
agent_profile_id?: string;
|
|
581
|
+
/** Opt out of the default agent runtime profile for this create call. */
|
|
582
|
+
skipRuntimeProfile?: boolean;
|
|
583
|
+
skipAgentRuntimeProfile?: boolean;
|
|
584
|
+
skip_agent_runtime_profile?: boolean;
|
|
585
|
+
}
|
|
586
|
+
interface ComputerUpdateParams {
|
|
587
|
+
name?: string;
|
|
588
|
+
visibility?: ComputerVisibility;
|
|
589
|
+
metadata?: Record<string, string>;
|
|
590
|
+
}
|
|
591
|
+
interface ComputerData extends MachineEnvironmentFields, MachineSetupFields {
|
|
592
|
+
id: ComputerId;
|
|
593
|
+
name: string;
|
|
594
|
+
/**
|
|
595
|
+
* URL-safe identifier used in preview URLs: `https://{port}-{slug}.sandbox.{preview_domain}`.
|
|
596
|
+
* Falls back to the computer id when no slug is assigned. The domain is the
|
|
597
|
+
* tenant's white-label `preview_domain` (server-provided) — never hardcode it.
|
|
598
|
+
*/
|
|
599
|
+
slug: string;
|
|
600
|
+
status: ComputerStatus;
|
|
601
|
+
template_type: ComputerTemplateType;
|
|
602
|
+
size: ComputerSize;
|
|
603
|
+
tenant_id: TenantId;
|
|
604
|
+
ip_address: string | null;
|
|
605
|
+
metadata: Record<string, string>;
|
|
606
|
+
/** Controls who can access the HTTP preview URL. Defaults to `"public"`. */
|
|
607
|
+
visibility: ComputerVisibility;
|
|
608
|
+
/** Public ingress root, e.g. `https://<slug>.sandbox.<preview_domain>` (server-provided). */
|
|
609
|
+
sandbox_url?: string;
|
|
610
|
+
/** Tenant's white-label preview/base domain (e.g. `cliniciq.com`). Use to build preview URLs. */
|
|
611
|
+
preview_domain?: string;
|
|
612
|
+
/** KasmVNC URL for desktop templates. */
|
|
613
|
+
desktop_url?: string;
|
|
614
|
+
created_at: string;
|
|
615
|
+
updated_at: string;
|
|
616
|
+
}
|
|
617
|
+
interface ComputerViewerPasswordStatus {
|
|
618
|
+
computer_id?: ComputerId | string;
|
|
619
|
+
password_set: boolean;
|
|
620
|
+
password_set_at?: string | null;
|
|
621
|
+
viewer_password_set_at?: string | null;
|
|
622
|
+
rotated_at?: string | null;
|
|
623
|
+
}
|
|
624
|
+
interface ComputerViewerPasswordRotation extends ComputerViewerPasswordStatus {
|
|
625
|
+
viewer_password: string;
|
|
626
|
+
password?: string;
|
|
627
|
+
}
|
|
628
|
+
type NetworkPolicyEffect = "allow" | "deny";
|
|
629
|
+
type NetworkPolicyProtocol = "tcp" | "udp" | "any";
|
|
630
|
+
/**
|
|
631
|
+
* A single egress rule.
|
|
632
|
+
*
|
|
633
|
+
* - `effect` — `"allow"` or `"deny"`
|
|
634
|
+
* - `destination` — CIDR (`"10.0.0.0/8"`), IP, domain (`"example.com"`),
|
|
635
|
+
* wildcard (`"*.example.com"`), or `"any"`
|
|
636
|
+
* - `ports` — optional: `"80"`, `"80,443"`, `"8000-9000"` (omit = all ports)
|
|
637
|
+
* - `protocol` — `"tcp"` | `"udp"` | `"any"` (default `"any"`)
|
|
638
|
+
*/
|
|
639
|
+
interface NetworkPolicyRule {
|
|
640
|
+
effect: NetworkPolicyEffect;
|
|
641
|
+
destination: string;
|
|
642
|
+
ports?: string;
|
|
643
|
+
protocol?: NetworkPolicyProtocol;
|
|
644
|
+
}
|
|
645
|
+
interface NetworkPolicySetParams {
|
|
646
|
+
/** Rules evaluated top-to-bottom. */
|
|
647
|
+
rules: NetworkPolicyRule[];
|
|
648
|
+
/**
|
|
649
|
+
* Verdict when no rule matches.
|
|
650
|
+
* `"allow"` = allowlist entries, deny everything else.
|
|
651
|
+
* `"deny"` = blocklist entries, allow everything else (default).
|
|
652
|
+
*/
|
|
653
|
+
default_effect?: NetworkPolicyEffect;
|
|
654
|
+
}
|
|
655
|
+
interface NetworkPolicyData {
|
|
656
|
+
computer_id: ComputerId;
|
|
657
|
+
tenant_id: TenantId;
|
|
658
|
+
rules: NetworkPolicyRule[];
|
|
659
|
+
default_effect: NetworkPolicyEffect;
|
|
660
|
+
inserted_at?: string;
|
|
661
|
+
updated_at?: string;
|
|
662
|
+
}
|
|
663
|
+
interface ComputerListResponse {
|
|
664
|
+
data: ComputerData[];
|
|
665
|
+
meta: {
|
|
666
|
+
total: number;
|
|
667
|
+
page: number;
|
|
668
|
+
per_page: number;
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
interface ComputerListParams {
|
|
672
|
+
page?: number;
|
|
673
|
+
per_page?: number;
|
|
674
|
+
status?: ComputerStatus;
|
|
675
|
+
/** Computers in this workspace. */
|
|
676
|
+
workspaceId?: string;
|
|
677
|
+
projectId?: string;
|
|
678
|
+
/** Your own identifiers for the end user, workspace and project that own the machine. */
|
|
679
|
+
externalWorkspaceId?: string;
|
|
680
|
+
externalUserId?: string;
|
|
681
|
+
externalProjectId?: string;
|
|
682
|
+
}
|
|
683
|
+
type MouseButton = "left" | "right" | "middle";
|
|
684
|
+
type ScrollDirection = "up" | "down" | "left" | "right";
|
|
685
|
+
interface ClickParams$1 {
|
|
686
|
+
x: number;
|
|
687
|
+
y: number;
|
|
688
|
+
button?: MouseButton;
|
|
689
|
+
}
|
|
690
|
+
interface DoubleClickParams {
|
|
691
|
+
x: number;
|
|
692
|
+
y: number;
|
|
693
|
+
}
|
|
694
|
+
interface TypeParams {
|
|
695
|
+
text: string;
|
|
696
|
+
delay?: number;
|
|
697
|
+
}
|
|
698
|
+
interface KeyParams {
|
|
699
|
+
key: string;
|
|
700
|
+
}
|
|
701
|
+
interface ScrollParams {
|
|
702
|
+
x?: number;
|
|
703
|
+
y?: number;
|
|
704
|
+
direction: ScrollDirection;
|
|
705
|
+
clicks?: number;
|
|
706
|
+
}
|
|
707
|
+
interface DragParams {
|
|
708
|
+
from_x: number;
|
|
709
|
+
from_y: number;
|
|
710
|
+
to_x: number;
|
|
711
|
+
to_y: number;
|
|
712
|
+
}
|
|
713
|
+
interface WaitParams {
|
|
714
|
+
seconds: number;
|
|
715
|
+
}
|
|
716
|
+
interface WindowInfo {
|
|
717
|
+
id: string;
|
|
718
|
+
title: string;
|
|
719
|
+
x: number;
|
|
720
|
+
y: number;
|
|
721
|
+
width: number;
|
|
722
|
+
height: number;
|
|
723
|
+
is_focused: boolean;
|
|
724
|
+
}
|
|
725
|
+
interface CursorInfo {
|
|
726
|
+
x: number;
|
|
727
|
+
y: number;
|
|
728
|
+
}
|
|
729
|
+
interface WindowFocusParams {
|
|
730
|
+
window_id: string;
|
|
731
|
+
}
|
|
732
|
+
interface LaunchParams {
|
|
733
|
+
app_name: string;
|
|
734
|
+
}
|
|
735
|
+
interface DesktopActionResult {
|
|
736
|
+
success: boolean;
|
|
737
|
+
}
|
|
738
|
+
interface ExecParams {
|
|
739
|
+
command: string;
|
|
740
|
+
timeout?: number;
|
|
741
|
+
}
|
|
742
|
+
interface ExecPythonParams {
|
|
743
|
+
code: string;
|
|
744
|
+
timeout?: number;
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Result of `exec.bash()` / `exec.python()`.
|
|
748
|
+
*
|
|
749
|
+
* The server returns stdout and stderr separately (what every other
|
|
750
|
+
* runtime does too) — the older `{output, success}` shape was never
|
|
751
|
+
* actually emitted. `output` is kept as a read-only alias of `stdout`
|
|
752
|
+
* for backwards compatibility; new code should use `stdout` + `stderr`.
|
|
753
|
+
*/
|
|
754
|
+
interface ExecResult {
|
|
755
|
+
/** Standard output from the command. */
|
|
756
|
+
stdout: string;
|
|
757
|
+
/** Standard error from the command. Empty string when no error output. */
|
|
758
|
+
stderr: string;
|
|
759
|
+
/** Process exit code. 0 = success. */
|
|
760
|
+
exit_code: number;
|
|
761
|
+
/** @deprecated alias for `stdout`; prefer `stdout` in new code. */
|
|
762
|
+
output?: string;
|
|
763
|
+
/** @deprecated derive from `exit_code === 0` in new code. */
|
|
764
|
+
success?: boolean;
|
|
765
|
+
}
|
|
766
|
+
interface FileEntry {
|
|
767
|
+
name: string;
|
|
768
|
+
path: string;
|
|
769
|
+
size: number;
|
|
770
|
+
is_dir: boolean;
|
|
771
|
+
modified_at: string;
|
|
772
|
+
}
|
|
773
|
+
interface FileListParams {
|
|
774
|
+
path: string;
|
|
775
|
+
}
|
|
776
|
+
interface FileDownloadParams {
|
|
777
|
+
path: string;
|
|
778
|
+
}
|
|
779
|
+
interface FileDeleteParams {
|
|
780
|
+
path: string;
|
|
781
|
+
}
|
|
782
|
+
interface FileExportParams {
|
|
783
|
+
path: string;
|
|
784
|
+
}
|
|
785
|
+
interface FileExportResult {
|
|
786
|
+
url: string;
|
|
787
|
+
expires_at: string;
|
|
788
|
+
}
|
|
789
|
+
interface FileListResult {
|
|
790
|
+
entries: FileEntry[];
|
|
791
|
+
path: string;
|
|
792
|
+
}
|
|
793
|
+
interface FileStat {
|
|
794
|
+
path: string;
|
|
795
|
+
/** File size in bytes. */
|
|
796
|
+
size: number;
|
|
797
|
+
/** Unix mode bits (e.g. 0o100644 for a regular file with rw-r--r--). */
|
|
798
|
+
mode: number;
|
|
799
|
+
is_dir: boolean;
|
|
800
|
+
is_symlink: boolean;
|
|
801
|
+
/** Populated when is_symlink is true. */
|
|
802
|
+
symlink_target?: string;
|
|
803
|
+
modified_at: string;
|
|
804
|
+
}
|
|
805
|
+
interface DirEntry {
|
|
806
|
+
name: string;
|
|
807
|
+
is_dir: boolean;
|
|
808
|
+
is_symlink: boolean;
|
|
809
|
+
size: number;
|
|
810
|
+
modified_at: string;
|
|
811
|
+
}
|
|
812
|
+
interface MkdirParams {
|
|
813
|
+
/** Create parent directories as needed. Defaults to true. */
|
|
814
|
+
recursive?: boolean;
|
|
815
|
+
/** Octal mode bits (e.g. 0o755). Defaults to 0o755. */
|
|
816
|
+
mode?: number;
|
|
817
|
+
}
|
|
818
|
+
interface CopyParams {
|
|
819
|
+
/** Copy directory trees recursively. Defaults to false. */
|
|
820
|
+
recursive?: boolean;
|
|
821
|
+
}
|
|
822
|
+
interface DirListResult {
|
|
823
|
+
data: {
|
|
824
|
+
entries: DirEntry[];
|
|
825
|
+
path: string;
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
type AgentSessionStatus = "pending" | "running" | "completed" | "failed" | "cancelled";
|
|
829
|
+
interface AgentSessionCreateParams {
|
|
830
|
+
goal: string;
|
|
831
|
+
model_id?: string;
|
|
832
|
+
max_turns?: number;
|
|
833
|
+
}
|
|
834
|
+
interface AgentSessionData {
|
|
835
|
+
id: SessionId;
|
|
836
|
+
computer_id: ComputerId;
|
|
837
|
+
goal: string;
|
|
838
|
+
model_id: string;
|
|
839
|
+
status: AgentSessionStatus;
|
|
840
|
+
max_turns: number;
|
|
841
|
+
turns_used: number;
|
|
842
|
+
created_at: string;
|
|
843
|
+
updated_at: string;
|
|
844
|
+
completed_at: string | null;
|
|
845
|
+
error: string | null;
|
|
846
|
+
}
|
|
847
|
+
interface AgentSessionListResponse {
|
|
848
|
+
data: AgentSessionData[];
|
|
849
|
+
}
|
|
850
|
+
type AgentEventType = "session_started" | "turn_started" | "thinking" | "tool_call" | "tool_result" | "streaming_token" | "agent_response" | "turn_completed" | "session_completed" | "session_failed" | "done" | "error";
|
|
851
|
+
interface AgentEvent {
|
|
852
|
+
type: AgentEventType;
|
|
853
|
+
session_id: SessionId;
|
|
854
|
+
data: unknown;
|
|
855
|
+
timestamp: string;
|
|
856
|
+
}
|
|
857
|
+
interface CreditBalance {
|
|
858
|
+
balance: number;
|
|
859
|
+
expires_at: string | null;
|
|
860
|
+
}
|
|
861
|
+
interface CreditTransaction {
|
|
862
|
+
id: string;
|
|
863
|
+
amount: number;
|
|
864
|
+
type: "credit" | "debit";
|
|
865
|
+
description: string;
|
|
866
|
+
created_at: string;
|
|
867
|
+
}
|
|
868
|
+
interface CreditTransactionListResponse {
|
|
869
|
+
data: CreditTransaction[];
|
|
870
|
+
meta: {
|
|
871
|
+
total: number;
|
|
872
|
+
page: number;
|
|
873
|
+
per_page: number;
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
interface CreditUsage {
|
|
877
|
+
period_start: string;
|
|
878
|
+
period_end: string;
|
|
879
|
+
compute_credits: number;
|
|
880
|
+
ai_credits: number;
|
|
881
|
+
total_credits: number;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
interface MiosaClientConfig {
|
|
885
|
+
/** Defaults to the `MIOSA_API_KEY` environment variable. */
|
|
886
|
+
apiKey?: string;
|
|
887
|
+
/** User JWT required for organization switching. */
|
|
888
|
+
accessToken?: string;
|
|
889
|
+
/** Organization UUID or slug sent as X-MIOSA-Tenant on every request. Defaults to `MIOSA_TENANT`. */
|
|
890
|
+
tenant?: string;
|
|
891
|
+
/** Defaults to the `MIOSA_BASE_URL` environment variable, then `https://api.miosa.ai/api/v1`. */
|
|
892
|
+
baseUrl?: string;
|
|
893
|
+
/**
|
|
894
|
+
* Replaces the default `@miosa/sdk/<version>` User-Agent on every request.
|
|
895
|
+
* A platform that resells MIOSA under its own name sets this to its own
|
|
896
|
+
* product string; the SDK adds no other identifying header.
|
|
897
|
+
*/
|
|
898
|
+
userAgent?: string;
|
|
899
|
+
timeout?: number;
|
|
900
|
+
maxRetries?: number;
|
|
901
|
+
/**
|
|
902
|
+
* Opt-in SOMA one-hop runner path (ONE-HOP-RUNNER-DESIGN-2026-10-02.md).
|
|
903
|
+
* When enabled, `Miosa.runner` talks straight to `run-<region>.miosa.ai`
|
|
904
|
+
* for sandbox create/exec/destroy, bypassing the control-plane hop.
|
|
905
|
+
* Also enabled by the `MIOSA_RUNNER_MODE=1` environment variable.
|
|
906
|
+
* Every other client path (`miosa.sandboxes`, etc.) is unaffected either way.
|
|
907
|
+
*/
|
|
908
|
+
runner?: {
|
|
909
|
+
enabled?: boolean;
|
|
910
|
+
/** Defaults to `us` (C5: not carried in the key this release); also settable via `MIOSA_RUNNER_REGION`. */
|
|
911
|
+
region?: string;
|
|
912
|
+
/** Overrides `miosa.ai` - for self-hosted / test deployments. */
|
|
913
|
+
baseDomain?: string;
|
|
914
|
+
/**
|
|
915
|
+
* Pin each runner session group to one resolved IPv4 address, so
|
|
916
|
+
* `run-<region>.miosa.ai`'s several A records are all used. Set `false`
|
|
917
|
+
* to dial the hostname and let the OS resolver choose instead.
|
|
918
|
+
* Defaults to `true`.
|
|
919
|
+
*/
|
|
920
|
+
pinAddresses?: boolean;
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
type SnapshotStatus = "creating" | "uploading" | "ready" | "restoring" | "failed" | "deleted";
|
|
925
|
+
interface SnapshotData {
|
|
926
|
+
id: string;
|
|
927
|
+
computer_id: string;
|
|
928
|
+
tenant_id: string;
|
|
929
|
+
comment: string | null;
|
|
930
|
+
status: SnapshotStatus;
|
|
931
|
+
state_size_bytes: number | null;
|
|
932
|
+
memory_size_bytes: number | null;
|
|
933
|
+
rootfs_size_bytes: number | null;
|
|
934
|
+
compressed_size_bytes: number | null;
|
|
935
|
+
s3_bucket: string | null;
|
|
936
|
+
s3_prefix: string | null;
|
|
937
|
+
parent_snapshot_id: string | null;
|
|
938
|
+
error: string | null;
|
|
939
|
+
created_at: string;
|
|
940
|
+
updated_at: string;
|
|
941
|
+
}
|
|
942
|
+
interface SnapshotCreateParams {
|
|
943
|
+
/** Optional human-readable label for this checkpoint. */
|
|
944
|
+
comment?: string;
|
|
945
|
+
}
|
|
946
|
+
interface SnapshotRestoreResult {
|
|
947
|
+
/** The newly provisioned Computer booted from this snapshot. */
|
|
948
|
+
data: ComputerData;
|
|
949
|
+
/** The source snapshot used for the restore. */
|
|
950
|
+
snapshot: SnapshotData;
|
|
951
|
+
}
|
|
952
|
+
interface SnapshotListResponse {
|
|
953
|
+
data: SnapshotData[];
|
|
954
|
+
}
|
|
955
|
+
type SnapshotProgressEvent = {
|
|
956
|
+
type: "snapshot_progress";
|
|
957
|
+
snapshot_id: string;
|
|
958
|
+
status: SnapshotStatus | string;
|
|
959
|
+
step?: string;
|
|
960
|
+
progress?: number;
|
|
961
|
+
error?: string;
|
|
962
|
+
};
|
|
963
|
+
/**
|
|
964
|
+
* Firecracker microVM checkpoint management for a Computer.
|
|
965
|
+
*
|
|
966
|
+
* Accessed via `computer.checkpoints`.
|
|
967
|
+
*
|
|
968
|
+
* @example
|
|
969
|
+
* ```ts
|
|
970
|
+
* const snap = await computer.checkpoints.create({ comment: "before upgrade" });
|
|
971
|
+
* // ... do risky work ...
|
|
972
|
+
* const fresh = await computer.checkpoints.restore(snap.id);
|
|
973
|
+
* ```
|
|
974
|
+
*/
|
|
975
|
+
declare class Checkpoints {
|
|
976
|
+
private readonly http;
|
|
977
|
+
private readonly computerId;
|
|
978
|
+
constructor(http: HttpClient, computerId: string);
|
|
979
|
+
private base;
|
|
980
|
+
/**
|
|
981
|
+
* Create a checkpoint of the running computer.
|
|
982
|
+
*
|
|
983
|
+
* The returned snapshot starts in `creating` status and progresses
|
|
984
|
+
* through `uploading` → `ready` asynchronously. Poll `get()` or subscribe
|
|
985
|
+
* to progress events via `onProgress` to know when it's ready.
|
|
986
|
+
*
|
|
987
|
+
* @param params - Optional `comment` label.
|
|
988
|
+
* @param onProgress - Optional callback fired for each SSE progress event.
|
|
989
|
+
* Only called if a SSE ticket is available (the `events` endpoint requires
|
|
990
|
+
* a prior `POST /api/v1/auth/sse-ticket` call).
|
|
991
|
+
*/
|
|
992
|
+
create(params?: SnapshotCreateParams, onProgress?: (event: SnapshotProgressEvent) => void): Promise<SnapshotData>;
|
|
993
|
+
/**
|
|
994
|
+
* List all non-deleted checkpoints for this computer.
|
|
995
|
+
*/
|
|
996
|
+
list(): Promise<SnapshotData[]>;
|
|
997
|
+
/**
|
|
998
|
+
* Fetch a single checkpoint by id.
|
|
999
|
+
*/
|
|
1000
|
+
get(id: string): Promise<SnapshotData>;
|
|
1001
|
+
/**
|
|
1002
|
+
* Delete a checkpoint.
|
|
1003
|
+
*
|
|
1004
|
+
* Transitions the snapshot to `deleted` and schedules S3 cleanup on the
|
|
1005
|
+
* server. After deletion the snapshot object is returned with
|
|
1006
|
+
* `status: "deleted"`.
|
|
1007
|
+
*/
|
|
1008
|
+
delete(id: string): Promise<SnapshotData>;
|
|
1009
|
+
/**
|
|
1010
|
+
* Restore a checkpoint onto a fresh Computer.
|
|
1011
|
+
*
|
|
1012
|
+
* The returned Computer starts in `provisioning` status. Use
|
|
1013
|
+
* `computer.checkpoints.restore(id, onProgress)` to subscribe to restore
|
|
1014
|
+
* progress events.
|
|
1015
|
+
*
|
|
1016
|
+
* @param id - Snapshot id to restore (must be in `ready` status).
|
|
1017
|
+
* @param onProgress - Optional callback for SSE progress events during restore.
|
|
1018
|
+
* @returns A `SnapshotRestoreResult` containing the new Computer and the
|
|
1019
|
+
* source snapshot.
|
|
1020
|
+
*/
|
|
1021
|
+
restore(id: string, onProgress?: (event: SnapshotProgressEvent) => void): Promise<SnapshotRestoreResult>;
|
|
1022
|
+
/**
|
|
1023
|
+
* Subscribe to Server-Sent Events for a snapshot's progress.
|
|
1024
|
+
*
|
|
1025
|
+
* Yields `SnapshotProgressEvent` objects until the stream closes or
|
|
1026
|
+
* `status` reaches a terminal state (`ready`, `failed`, `deleted`).
|
|
1027
|
+
*
|
|
1028
|
+
* Requires a valid SSE ticket obtained via
|
|
1029
|
+
* `POST /api/v1/auth/sse-ticket` and passed as `?ticket=<token>`.
|
|
1030
|
+
*
|
|
1031
|
+
* @param id - Snapshot id to watch.
|
|
1032
|
+
* @param ticket - Short-lived SSE ticket from the auth endpoint.
|
|
1033
|
+
*/
|
|
1034
|
+
events(id: string, ticket: string): AsyncIterableIterator<SnapshotProgressEvent>;
|
|
1035
|
+
/**
|
|
1036
|
+
* Internal: subscribe to SSE progress events and call `cb` for each.
|
|
1037
|
+
*
|
|
1038
|
+
* Resolves when the stream closes. Any auth/network errors are silently
|
|
1039
|
+
* swallowed so the caller isn't blocked on progress-tracking failures.
|
|
1040
|
+
*/
|
|
1041
|
+
private subscribeProgress;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
/**
|
|
1045
|
+
* ComputerAutoStop — read/update idle-timeout config.
|
|
1046
|
+
*
|
|
1047
|
+
* Routes:
|
|
1048
|
+
* GET /computers/:id/auto-stop
|
|
1049
|
+
* PATCH /computers/:id/auto-stop
|
|
1050
|
+
*/
|
|
1051
|
+
|
|
1052
|
+
declare class ComputerAutoStop {
|
|
1053
|
+
private readonly http;
|
|
1054
|
+
private readonly computerId;
|
|
1055
|
+
constructor(http: HttpClient, computerId: string);
|
|
1056
|
+
/** Return the current auto-stop configuration. */
|
|
1057
|
+
get(): Promise<Record<string, unknown>>;
|
|
1058
|
+
/** Set the idle timeout in seconds (0 disables auto-stop). */
|
|
1059
|
+
update(seconds: number): Promise<Record<string, unknown>>;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* ComputerEnv — encrypted env var CRUD scoped to one Computer.
|
|
1064
|
+
*
|
|
1065
|
+
* Routes:
|
|
1066
|
+
* GET /computers/:id/env → list
|
|
1067
|
+
* POST /computers/:id/env → create (single)
|
|
1068
|
+
* PATCH /computers/:id/env/:name → update value
|
|
1069
|
+
* DELETE /computers/:id/env/:name → remove
|
|
1070
|
+
*
|
|
1071
|
+
* bulkSet falls back to N individual POSTs (no bulk endpoint yet).
|
|
1072
|
+
*/
|
|
1073
|
+
|
|
1074
|
+
declare class ComputerEnv {
|
|
1075
|
+
private readonly http;
|
|
1076
|
+
private readonly computerId;
|
|
1077
|
+
constructor(http: HttpClient, computerId: string);
|
|
1078
|
+
private base;
|
|
1079
|
+
/** List all env vars (values may be masked depending on server policy). */
|
|
1080
|
+
list(): Promise<Record<string, unknown>[]>;
|
|
1081
|
+
/** Create a new env var. Use update() to change an existing one. */
|
|
1082
|
+
set(name: string, value: string): Promise<Record<string, unknown>>;
|
|
1083
|
+
/** Patch the value of an existing env var by name. */
|
|
1084
|
+
update(name: string, value: string): Promise<Record<string, unknown>>;
|
|
1085
|
+
/** Remove an env var by name. */
|
|
1086
|
+
delete(name: string): Promise<void>;
|
|
1087
|
+
/** Convenience: create one env var per entry. */
|
|
1088
|
+
bulkSet(env: Record<string, string>): Promise<Record<string, unknown>[]>;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
/**
|
|
1092
|
+
* ComputerLogs — read + stream VM logs.
|
|
1093
|
+
*
|
|
1094
|
+
* Routes:
|
|
1095
|
+
* GET /computers/:id/logs — JSON snapshot (last N lines)
|
|
1096
|
+
* GET /computers/:id/logs/stream — text/event-stream of new lines (SSE)
|
|
1097
|
+
*/
|
|
1098
|
+
|
|
1099
|
+
interface ComputerLogsGetParams {
|
|
1100
|
+
lines?: number;
|
|
1101
|
+
since?: string;
|
|
1102
|
+
}
|
|
1103
|
+
declare class ComputerLogs {
|
|
1104
|
+
private readonly http;
|
|
1105
|
+
private readonly computerId;
|
|
1106
|
+
constructor(http: HttpClient, computerId: string);
|
|
1107
|
+
/** Fetch the most recent log snapshot. */
|
|
1108
|
+
get(params?: ComputerLogsGetParams): Promise<Record<string, unknown>>;
|
|
1109
|
+
/** Stream live log events as SSE dicts `{type, data, id}`. */
|
|
1110
|
+
stream(): AsyncIterableIterator<Record<string, unknown>>;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
/**
|
|
1114
|
+
* ComputerOsa — task dispatch to the in-VM OSA agent.
|
|
1115
|
+
*
|
|
1116
|
+
* Routes:
|
|
1117
|
+
* POST /computers/:id/osa/task
|
|
1118
|
+
* DELETE /computers/:id/osa/task
|
|
1119
|
+
* GET /computers/:id/osa/status
|
|
1120
|
+
* POST /computers/:id/osa/configure
|
|
1121
|
+
*/
|
|
1122
|
+
|
|
1123
|
+
declare class ComputerOsa {
|
|
1124
|
+
private readonly http;
|
|
1125
|
+
private readonly computerId;
|
|
1126
|
+
constructor(http: HttpClient, computerId: string);
|
|
1127
|
+
/** Submit a free-form task to the in-VM OSA agent. */
|
|
1128
|
+
submitTask(task: string, params?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
1129
|
+
/** Cancel the currently-running OSA task, if any. */
|
|
1130
|
+
cancelTask(): Promise<Record<string, unknown>>;
|
|
1131
|
+
/** Return OSA's current task / configuration / health snapshot. */
|
|
1132
|
+
status(): Promise<Record<string, unknown>>;
|
|
1133
|
+
/** Update OSA runtime configuration (model, tools, secrets, etc.). */
|
|
1134
|
+
configure(config: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
/**
|
|
1138
|
+
* ComputerPorts — per-port visibility control.
|
|
1139
|
+
*
|
|
1140
|
+
* Routes:
|
|
1141
|
+
* GET /computers/:id/ports — list
|
|
1142
|
+
* POST /computers/:id/ports — create
|
|
1143
|
+
* PATCH /computers/:id/ports/:port — update
|
|
1144
|
+
* DELETE /computers/:id/ports/:port — delete
|
|
1145
|
+
*
|
|
1146
|
+
* The backend does not expose a single-port GET; get() filters the list
|
|
1147
|
+
* response client-side for ergonomics.
|
|
1148
|
+
*/
|
|
1149
|
+
|
|
1150
|
+
declare class ComputerPorts {
|
|
1151
|
+
private readonly http;
|
|
1152
|
+
private readonly computerId;
|
|
1153
|
+
constructor(http: HttpClient, computerId: string);
|
|
1154
|
+
private base;
|
|
1155
|
+
list(): Promise<Record<string, unknown>[]>;
|
|
1156
|
+
/** Return the port record for port, or null if not exposed. */
|
|
1157
|
+
get(port: number): Promise<Record<string, unknown> | null>;
|
|
1158
|
+
/** Expose port with the given visibility options. */
|
|
1159
|
+
create(port: number, opts?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
1160
|
+
/** Patch visibility / auth options for port. */
|
|
1161
|
+
update(port: number, opts: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
1162
|
+
/** Stop exposing port. */
|
|
1163
|
+
delete(port: number): Promise<void>;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
/**
|
|
1167
|
+
* ComputerTerminal — PTY session management for a Computer.
|
|
1168
|
+
*
|
|
1169
|
+
* Routes:
|
|
1170
|
+
* POST /computers/:id/terminal
|
|
1171
|
+
* POST /computers/:id/pty/:sessionId/resize
|
|
1172
|
+
*/
|
|
1173
|
+
|
|
1174
|
+
interface TerminalCreateParams {
|
|
1175
|
+
cols?: number;
|
|
1176
|
+
rows?: number;
|
|
1177
|
+
shell?: string;
|
|
1178
|
+
cwd?: string;
|
|
1179
|
+
env?: Record<string, string>;
|
|
1180
|
+
}
|
|
1181
|
+
declare class ComputerTerminal {
|
|
1182
|
+
private readonly http;
|
|
1183
|
+
private readonly computerId;
|
|
1184
|
+
constructor(http: HttpClient, computerId: string);
|
|
1185
|
+
/** Open a new PTY session. Returns the server payload (session id, etc.). */
|
|
1186
|
+
create(params?: TerminalCreateParams): Promise<Record<string, unknown>>;
|
|
1187
|
+
/** Resize an existing PTY session. */
|
|
1188
|
+
resize(sessionId: string, cols: number, rows: number): Promise<Record<string, unknown>>;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
/**
|
|
1192
|
+
* ComputerVolumes — per-computer volume attachment.
|
|
1193
|
+
*
|
|
1194
|
+
* Routes:
|
|
1195
|
+
* GET /computers/:id/volumes — list attachments
|
|
1196
|
+
* POST /computers/:id/volumes — attach a volume
|
|
1197
|
+
* DELETE /computers/:id/volumes/:aid — detach an attachment
|
|
1198
|
+
*/
|
|
1199
|
+
|
|
1200
|
+
declare class ComputerVolumes {
|
|
1201
|
+
private readonly http;
|
|
1202
|
+
private readonly computerId;
|
|
1203
|
+
constructor(http: HttpClient, computerId: string);
|
|
1204
|
+
private base;
|
|
1205
|
+
list(): Promise<Record<string, unknown>[]>;
|
|
1206
|
+
/** Attach volumeId at mountPath inside the VM. */
|
|
1207
|
+
attach(volumeId: string, mountPath: string): Promise<Record<string, unknown>>;
|
|
1208
|
+
/** Detach an existing attachment by attachment id. */
|
|
1209
|
+
detach(attachmentId: string): Promise<void>;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
/**
|
|
1213
|
+
* MIOSA Connect — provider connectors and runtime tokens.
|
|
1214
|
+
*
|
|
1215
|
+
* Connect is the product-facing credential layer. Egress remains the runtime
|
|
1216
|
+
* enforcement layer underneath it.
|
|
1217
|
+
*/
|
|
1218
|
+
|
|
1219
|
+
type ConnectorSubject = {
|
|
1220
|
+
type: "app";
|
|
1221
|
+
} | {
|
|
1222
|
+
type: "user";
|
|
1223
|
+
id: string;
|
|
1224
|
+
issuer?: string;
|
|
1225
|
+
} | {
|
|
1226
|
+
type: "jwt-bearer";
|
|
1227
|
+
sub: string;
|
|
1228
|
+
iss?: string;
|
|
1229
|
+
aud?: string;
|
|
1230
|
+
additionalClaims?: Record<string, unknown>;
|
|
1231
|
+
};
|
|
1232
|
+
interface ConnectorData {
|
|
1233
|
+
id?: string;
|
|
1234
|
+
uid?: string;
|
|
1235
|
+
name?: string;
|
|
1236
|
+
provider?: string;
|
|
1237
|
+
type?: string;
|
|
1238
|
+
scope?: string;
|
|
1239
|
+
status?: string;
|
|
1240
|
+
managed?: boolean;
|
|
1241
|
+
display_name?: string;
|
|
1242
|
+
displayName?: string;
|
|
1243
|
+
masked_value?: string | null;
|
|
1244
|
+
expires_at?: string | null;
|
|
1245
|
+
metadata?: Record<string, unknown>;
|
|
1246
|
+
[key: string]: unknown;
|
|
1247
|
+
}
|
|
1248
|
+
interface ExternalAttributionParams {
|
|
1249
|
+
externalUserId?: string;
|
|
1250
|
+
external_user_id?: string;
|
|
1251
|
+
externalWorkspaceId?: string;
|
|
1252
|
+
external_workspace_id?: string;
|
|
1253
|
+
externalProjectId?: string;
|
|
1254
|
+
external_project_id?: string;
|
|
1255
|
+
}
|
|
1256
|
+
interface ConnectorListParams extends ExternalAttributionParams {
|
|
1257
|
+
scope?: string;
|
|
1258
|
+
workspaceId?: string;
|
|
1259
|
+
workspace_id?: string;
|
|
1260
|
+
ownerUserId?: string;
|
|
1261
|
+
owner_user_id?: string;
|
|
1262
|
+
}
|
|
1263
|
+
interface ConnectorCreateParams extends ExternalAttributionParams {
|
|
1264
|
+
provider: string;
|
|
1265
|
+
name?: string;
|
|
1266
|
+
uid?: string;
|
|
1267
|
+
type?: string;
|
|
1268
|
+
scope?: string;
|
|
1269
|
+
workspaceId?: string;
|
|
1270
|
+
workspace_id?: string;
|
|
1271
|
+
ownerUserId?: string;
|
|
1272
|
+
owner_user_id?: string;
|
|
1273
|
+
value?: string;
|
|
1274
|
+
token?: string;
|
|
1275
|
+
apiKey?: string;
|
|
1276
|
+
api_key?: string;
|
|
1277
|
+
credential?: {
|
|
1278
|
+
field?: string;
|
|
1279
|
+
value: string;
|
|
1280
|
+
[key: string]: unknown;
|
|
1281
|
+
};
|
|
1282
|
+
[key: string]: unknown;
|
|
1283
|
+
}
|
|
1284
|
+
interface ConnectorTokenParams extends ExternalAttributionParams {
|
|
1285
|
+
subject?: ConnectorSubject;
|
|
1286
|
+
installationId?: string;
|
|
1287
|
+
installation_id?: string;
|
|
1288
|
+
projectId?: string;
|
|
1289
|
+
project_id?: string;
|
|
1290
|
+
environment?: string;
|
|
1291
|
+
resourceType?: string;
|
|
1292
|
+
resource_type?: string;
|
|
1293
|
+
resourceId?: string;
|
|
1294
|
+
resource_id?: string;
|
|
1295
|
+
scopes?: string[];
|
|
1296
|
+
scope?: string[];
|
|
1297
|
+
audience?: string[];
|
|
1298
|
+
validityBufferMs?: number;
|
|
1299
|
+
validity_buffer_ms?: number;
|
|
1300
|
+
}
|
|
1301
|
+
interface ConnectorTokenResponse {
|
|
1302
|
+
token: string;
|
|
1303
|
+
expires_at?: string | number | null;
|
|
1304
|
+
expiresAt?: string | number | null;
|
|
1305
|
+
connector?: {
|
|
1306
|
+
id?: string;
|
|
1307
|
+
uid?: string;
|
|
1308
|
+
type?: string;
|
|
1309
|
+
[key: string]: unknown;
|
|
1310
|
+
};
|
|
1311
|
+
name?: string;
|
|
1312
|
+
installation_id?: string;
|
|
1313
|
+
installationId?: string;
|
|
1314
|
+
subject?: ConnectorSubject | Record<string, unknown>;
|
|
1315
|
+
scopes?: string[];
|
|
1316
|
+
metadata?: Record<string, unknown>;
|
|
1317
|
+
[key: string]: unknown;
|
|
1318
|
+
}
|
|
1319
|
+
interface ConnectorInstallation {
|
|
1320
|
+
id?: string;
|
|
1321
|
+
connector_id?: string;
|
|
1322
|
+
connectorId?: string;
|
|
1323
|
+
installation_id?: string;
|
|
1324
|
+
installationId?: string;
|
|
1325
|
+
workspace_id?: string | null;
|
|
1326
|
+
workspaceId?: string | null;
|
|
1327
|
+
subject_type?: string;
|
|
1328
|
+
subjectType?: string;
|
|
1329
|
+
scope?: string;
|
|
1330
|
+
status?: string;
|
|
1331
|
+
scopes?: string[];
|
|
1332
|
+
metadata?: Record<string, unknown>;
|
|
1333
|
+
[key: string]: unknown;
|
|
1334
|
+
}
|
|
1335
|
+
interface ConnectorOauthProvider {
|
|
1336
|
+
id?: string;
|
|
1337
|
+
provider?: string;
|
|
1338
|
+
display_name?: string;
|
|
1339
|
+
displayName?: string;
|
|
1340
|
+
scopes?: string[];
|
|
1341
|
+
branding?: Record<string, unknown>;
|
|
1342
|
+
enabled?: boolean;
|
|
1343
|
+
[key: string]: unknown;
|
|
1344
|
+
}
|
|
1345
|
+
interface ConnectorOauthStartParams extends ExternalAttributionParams {
|
|
1346
|
+
provider: string;
|
|
1347
|
+
scope?: string;
|
|
1348
|
+
exposeAsEnv?: boolean;
|
|
1349
|
+
expose_as_env?: boolean;
|
|
1350
|
+
ownerUserId?: string;
|
|
1351
|
+
owner_user_id?: string;
|
|
1352
|
+
}
|
|
1353
|
+
interface ConnectorOauthStartResponse {
|
|
1354
|
+
authorize_url?: string;
|
|
1355
|
+
authorizeUrl?: string;
|
|
1356
|
+
state?: string;
|
|
1357
|
+
[key: string]: unknown;
|
|
1358
|
+
}
|
|
1359
|
+
interface ConnectorProjectLink {
|
|
1360
|
+
id?: string;
|
|
1361
|
+
connector_id?: string;
|
|
1362
|
+
connectorId?: string;
|
|
1363
|
+
installation_id?: string | null;
|
|
1364
|
+
installationId?: string | null;
|
|
1365
|
+
workspace_id?: string | null;
|
|
1366
|
+
workspaceId?: string | null;
|
|
1367
|
+
project_id?: string | null;
|
|
1368
|
+
projectId?: string | null;
|
|
1369
|
+
environment?: string;
|
|
1370
|
+
resource_type?: string | null;
|
|
1371
|
+
resourceType?: string | null;
|
|
1372
|
+
resource_id?: string | null;
|
|
1373
|
+
resourceId?: string | null;
|
|
1374
|
+
allowed_subjects?: string[];
|
|
1375
|
+
allowedSubjects?: string[];
|
|
1376
|
+
allowed_scopes?: string[];
|
|
1377
|
+
allowedScopes?: string[];
|
|
1378
|
+
mode?: string;
|
|
1379
|
+
effect?: string;
|
|
1380
|
+
external_workspace_id?: string | null;
|
|
1381
|
+
externalWorkspaceId?: string | null;
|
|
1382
|
+
external_user_id?: string | null;
|
|
1383
|
+
externalUserId?: string | null;
|
|
1384
|
+
external_project_id?: string | null;
|
|
1385
|
+
externalProjectId?: string | null;
|
|
1386
|
+
metadata?: Record<string, unknown>;
|
|
1387
|
+
[key: string]: unknown;
|
|
1388
|
+
}
|
|
1389
|
+
interface ConnectorProjectLinkParams extends ExternalAttributionParams {
|
|
1390
|
+
connector?: string;
|
|
1391
|
+
connectorId?: string;
|
|
1392
|
+
connector_id?: string;
|
|
1393
|
+
installationId?: string;
|
|
1394
|
+
installation_id?: string;
|
|
1395
|
+
workspaceId?: string;
|
|
1396
|
+
workspace_id?: string;
|
|
1397
|
+
projectId?: string;
|
|
1398
|
+
project_id?: string;
|
|
1399
|
+
environment?: string;
|
|
1400
|
+
resourceType?: string;
|
|
1401
|
+
resource_type?: string;
|
|
1402
|
+
resourceId?: string;
|
|
1403
|
+
resource_id?: string;
|
|
1404
|
+
allowedSubjects?: string[];
|
|
1405
|
+
allowed_subjects?: string[];
|
|
1406
|
+
allowedScopes?: string[];
|
|
1407
|
+
allowed_scopes?: string[];
|
|
1408
|
+
mode?: "token-api" | "token_api" | "brokered-env" | "brokered_env" | "plain-env" | "plain_env" | string;
|
|
1409
|
+
effect?: "allow" | "deny" | string;
|
|
1410
|
+
metadata?: Record<string, unknown>;
|
|
1411
|
+
}
|
|
1412
|
+
interface ConnectorLinkListParams extends ExternalAttributionParams {
|
|
1413
|
+
workspaceId?: string;
|
|
1414
|
+
workspace_id?: string;
|
|
1415
|
+
projectId?: string;
|
|
1416
|
+
project_id?: string;
|
|
1417
|
+
connectorId?: string;
|
|
1418
|
+
connector_id?: string;
|
|
1419
|
+
environment?: string;
|
|
1420
|
+
status?: string;
|
|
1421
|
+
}
|
|
1422
|
+
interface ConnectorDefault extends ConnectorProjectLink {
|
|
1423
|
+
default_scope?: string;
|
|
1424
|
+
defaultScope?: string;
|
|
1425
|
+
target?: string;
|
|
1426
|
+
}
|
|
1427
|
+
interface ConnectorDefaultParams extends ConnectorProjectLinkParams {
|
|
1428
|
+
defaultScope?: string;
|
|
1429
|
+
default_scope?: string;
|
|
1430
|
+
target?: "all" | "sandbox" | "computer" | "agent" | "deployment" | string;
|
|
1431
|
+
}
|
|
1432
|
+
interface ConnectorDefaultListParams extends ConnectorLinkListParams {
|
|
1433
|
+
defaultScope?: string;
|
|
1434
|
+
default_scope?: string;
|
|
1435
|
+
target?: string;
|
|
1436
|
+
}
|
|
1437
|
+
interface ConnectorTrigger {
|
|
1438
|
+
id?: string;
|
|
1439
|
+
connector_id?: string;
|
|
1440
|
+
connectorId?: string;
|
|
1441
|
+
workspace_id?: string | null;
|
|
1442
|
+
workspaceId?: string | null;
|
|
1443
|
+
project_id?: string | null;
|
|
1444
|
+
projectId?: string | null;
|
|
1445
|
+
environment?: string;
|
|
1446
|
+
destination_path?: string | null;
|
|
1447
|
+
destinationPath?: string | null;
|
|
1448
|
+
destination_url?: string | null;
|
|
1449
|
+
destinationUrl?: string | null;
|
|
1450
|
+
event_types?: string[];
|
|
1451
|
+
eventTypes?: string[];
|
|
1452
|
+
status?: string;
|
|
1453
|
+
provider_adapter?: "generic" | "github" | "slack" | string;
|
|
1454
|
+
providerAdapter?: "generic" | "github" | "slack" | string;
|
|
1455
|
+
signing_secret_preview?: string | null;
|
|
1456
|
+
signingSecretPreview?: string | null;
|
|
1457
|
+
webhook_signing_secret?: string;
|
|
1458
|
+
webhookSigningSecret?: string;
|
|
1459
|
+
metadata?: Record<string, unknown>;
|
|
1460
|
+
webhook_token?: string;
|
|
1461
|
+
webhookToken?: string;
|
|
1462
|
+
[key: string]: unknown;
|
|
1463
|
+
}
|
|
1464
|
+
interface ConnectorTriggerParams extends ExternalAttributionParams {
|
|
1465
|
+
connector?: string;
|
|
1466
|
+
connectorId?: string;
|
|
1467
|
+
connector_id?: string;
|
|
1468
|
+
workspaceId?: string;
|
|
1469
|
+
workspace_id?: string;
|
|
1470
|
+
projectId?: string;
|
|
1471
|
+
project_id?: string;
|
|
1472
|
+
environment?: string;
|
|
1473
|
+
destinationPath?: string;
|
|
1474
|
+
destination_path?: string;
|
|
1475
|
+
destinationUrl?: string;
|
|
1476
|
+
destination_url?: string;
|
|
1477
|
+
eventTypes?: string[];
|
|
1478
|
+
event_types?: string[];
|
|
1479
|
+
status?: string;
|
|
1480
|
+
providerAdapter?: "generic" | "github" | "slack" | string;
|
|
1481
|
+
provider_adapter?: "generic" | "github" | "slack" | string;
|
|
1482
|
+
webhookSigningSecret?: string;
|
|
1483
|
+
webhook_signing_secret?: string;
|
|
1484
|
+
metadata?: Record<string, unknown>;
|
|
1485
|
+
}
|
|
1486
|
+
interface ConnectorTriggerListParams extends ConnectorLinkListParams {
|
|
1487
|
+
}
|
|
1488
|
+
interface ConnectorTriggerDelivery {
|
|
1489
|
+
id?: string;
|
|
1490
|
+
trigger_id?: string;
|
|
1491
|
+
triggerId?: string;
|
|
1492
|
+
connector_id?: string;
|
|
1493
|
+
connectorId?: string;
|
|
1494
|
+
event_type?: string;
|
|
1495
|
+
eventType?: string;
|
|
1496
|
+
provider_delivery_id?: string | null;
|
|
1497
|
+
providerDeliveryId?: string | null;
|
|
1498
|
+
state?: string;
|
|
1499
|
+
attempts?: number;
|
|
1500
|
+
destination_url?: string | null;
|
|
1501
|
+
destinationUrl?: string | null;
|
|
1502
|
+
status_code?: number | null;
|
|
1503
|
+
statusCode?: number | null;
|
|
1504
|
+
error?: string | null;
|
|
1505
|
+
latency_ms?: number | null;
|
|
1506
|
+
latencyMs?: number | null;
|
|
1507
|
+
delivered_at?: string | null;
|
|
1508
|
+
deliveredAt?: string | null;
|
|
1509
|
+
metadata?: Record<string, unknown>;
|
|
1510
|
+
[key: string]: unknown;
|
|
1511
|
+
}
|
|
1512
|
+
interface ConnectorTriggerDeliveryListParams extends ConnectorLinkListParams {
|
|
1513
|
+
triggerId?: string;
|
|
1514
|
+
trigger_id?: string;
|
|
1515
|
+
eventType?: string;
|
|
1516
|
+
event_type?: string;
|
|
1517
|
+
}
|
|
1518
|
+
interface ConnectorApplicableDefaultParams extends ExternalAttributionParams {
|
|
1519
|
+
workspaceId?: string;
|
|
1520
|
+
workspace_id?: string;
|
|
1521
|
+
projectId?: string;
|
|
1522
|
+
project_id?: string;
|
|
1523
|
+
environment?: string;
|
|
1524
|
+
target?: "all" | "sandbox" | "computer" | "agent" | "deployment" | string;
|
|
1525
|
+
resourceType?: string;
|
|
1526
|
+
resource_type?: string;
|
|
1527
|
+
resourceId?: string;
|
|
1528
|
+
resource_id?: string;
|
|
1529
|
+
}
|
|
1530
|
+
interface ConnectorMaterializeDefaultsParams extends ConnectorApplicableDefaultParams {
|
|
1531
|
+
envName?: string;
|
|
1532
|
+
env_name?: string;
|
|
1533
|
+
}
|
|
1534
|
+
interface ConnectorMaterializeDefaultsResult {
|
|
1535
|
+
applied?: number;
|
|
1536
|
+
results?: Array<Record<string, unknown>>;
|
|
1537
|
+
[key: string]: unknown;
|
|
1538
|
+
}
|
|
1539
|
+
interface SandboxConnectorBinding {
|
|
1540
|
+
id?: string;
|
|
1541
|
+
secret_id?: string;
|
|
1542
|
+
connector?: string;
|
|
1543
|
+
resource_id?: string;
|
|
1544
|
+
resource_type?: string;
|
|
1545
|
+
exposure?: string;
|
|
1546
|
+
expose_as_env?: string;
|
|
1547
|
+
env?: string;
|
|
1548
|
+
sync?: Record<string, unknown>;
|
|
1549
|
+
[key: string]: unknown;
|
|
1550
|
+
}
|
|
1551
|
+
interface SandboxConnectorAttachParams {
|
|
1552
|
+
connector: string;
|
|
1553
|
+
env: string;
|
|
1554
|
+
mode?: "brokered-env" | "brokered_env" | "plain-env" | "plain_env" | string;
|
|
1555
|
+
installationId?: string;
|
|
1556
|
+
installation_id?: string;
|
|
1557
|
+
projectId?: string;
|
|
1558
|
+
project_id?: string;
|
|
1559
|
+
environment?: string;
|
|
1560
|
+
externalUserId?: string;
|
|
1561
|
+
external_user_id?: string;
|
|
1562
|
+
externalWorkspaceId?: string;
|
|
1563
|
+
external_workspace_id?: string;
|
|
1564
|
+
externalProjectId?: string;
|
|
1565
|
+
external_project_id?: string;
|
|
1566
|
+
}
|
|
1567
|
+
interface SandboxConnectorPreflightParams {
|
|
1568
|
+
connector?: string;
|
|
1569
|
+
provider?: string;
|
|
1570
|
+
}
|
|
1571
|
+
interface SandboxConnectorPreflightResult {
|
|
1572
|
+
sandbox_id?: string;
|
|
1573
|
+
sandboxId?: string;
|
|
1574
|
+
provider?: string;
|
|
1575
|
+
connector?: string;
|
|
1576
|
+
status?: Record<string, unknown>;
|
|
1577
|
+
sync?: Record<string, unknown>;
|
|
1578
|
+
[key: string]: unknown;
|
|
1579
|
+
}
|
|
1580
|
+
declare class Connectors {
|
|
1581
|
+
private readonly http;
|
|
1582
|
+
constructor(http: HttpClient);
|
|
1583
|
+
/** List Connect provider connectors visible to the current tenant/workspace. */
|
|
1584
|
+
list(params?: ConnectorListParams): Promise<ConnectorData[]>;
|
|
1585
|
+
/** Show one connector by UID or id. */
|
|
1586
|
+
get(connector: string): Promise<ConnectorData>;
|
|
1587
|
+
show(connector: string): Promise<ConnectorData>;
|
|
1588
|
+
/** Create an API-key backed connector. Raw values are never returned later. */
|
|
1589
|
+
create(provider: string, params: Omit<ConnectorCreateParams, "provider">): Promise<ConnectorData>;
|
|
1590
|
+
/** Request a runtime provider token for a connector. */
|
|
1591
|
+
getToken(connector: string, params?: ConnectorTokenParams): Promise<ConnectorTokenResponse>;
|
|
1592
|
+
token(connector: string, params?: ConnectorTokenParams): Promise<ConnectorTokenResponse>;
|
|
1593
|
+
/** List OAuth app providers available for end-user authorization. */
|
|
1594
|
+
oauthProviders(): Promise<ConnectorOauthProvider[]>;
|
|
1595
|
+
/** Start an OAuth authorization flow for a provider-backed connector. */
|
|
1596
|
+
startOauth(params: ConnectorOauthStartParams): Promise<ConnectorOauthStartResponse>;
|
|
1597
|
+
/** List connector installations/grants. */
|
|
1598
|
+
installations(params?: ConnectorLinkListParams): Promise<ConnectorInstallation[]>;
|
|
1599
|
+
/** List project/environment connector links. */
|
|
1600
|
+
projectLinks(params?: ConnectorLinkListParams): Promise<ConnectorProjectLink[]>;
|
|
1601
|
+
/** List inherited connector defaults for tenant/workspace/project runtimes. */
|
|
1602
|
+
defaults(params?: ConnectorDefaultListParams): Promise<ConnectorDefault[]>;
|
|
1603
|
+
/** Resolve inherited connector defaults that apply to a runtime target. */
|
|
1604
|
+
applicableDefaults(params?: ConnectorApplicableDefaultParams): Promise<ConnectorDefault[]>;
|
|
1605
|
+
/** Materialize inherited connector defaults onto one runtime resource. */
|
|
1606
|
+
materializeDefaults(params: ConnectorMaterializeDefaultsParams): Promise<ConnectorMaterializeDefaultsResult>;
|
|
1607
|
+
/** Create an inherited connector default for future runtime resources. */
|
|
1608
|
+
createDefault(params: ConnectorDefaultParams): Promise<ConnectorDefault>;
|
|
1609
|
+
/** Delete an inherited connector default. */
|
|
1610
|
+
deleteDefault(id: string): Promise<void>;
|
|
1611
|
+
/** List inbound provider trigger forwarding definitions. */
|
|
1612
|
+
triggers(params?: ConnectorTriggerListParams): Promise<ConnectorTrigger[]>;
|
|
1613
|
+
/** Create an inbound provider trigger forwarding definition. */
|
|
1614
|
+
createTrigger(params: ConnectorTriggerParams): Promise<ConnectorTrigger>;
|
|
1615
|
+
/**
|
|
1616
|
+
* List inbound provider trigger delivery attempts.
|
|
1617
|
+
*
|
|
1618
|
+
* The platform serves deliveries per trigger (`GET /connect/triggers/:id/deliveries`).
|
|
1619
|
+
* With a `triggerId` this is one call; without one it reads every trigger's
|
|
1620
|
+
* deliveries and merges them, newest first.
|
|
1621
|
+
*/
|
|
1622
|
+
triggerDeliveries(params?: ConnectorTriggerDeliveryListParams): Promise<ConnectorTriggerDelivery[]>;
|
|
1623
|
+
/** List delivery attempts for one trigger. */
|
|
1624
|
+
triggerDeliveryHistory(triggerId: string): Promise<ConnectorTriggerDelivery[]>;
|
|
1625
|
+
/** Delete an inbound provider trigger forwarding definition. */
|
|
1626
|
+
deleteTrigger(id: string): Promise<void>;
|
|
1627
|
+
/** Link a connector to a project/environment/resource. */
|
|
1628
|
+
createProjectLink(params: ConnectorProjectLinkParams): Promise<ConnectorProjectLink>;
|
|
1629
|
+
/** Delete a project connector link. */
|
|
1630
|
+
deleteProjectLink(id: string): Promise<void>;
|
|
1631
|
+
}
|
|
1632
|
+
declare class RuntimeConnectors {
|
|
1633
|
+
private readonly http;
|
|
1634
|
+
private readonly basePath;
|
|
1635
|
+
constructor(http: HttpClient, basePath: string);
|
|
1636
|
+
/** List provider connector bindings for this runtime resource. */
|
|
1637
|
+
list(): Promise<SandboxConnectorBinding[]>;
|
|
1638
|
+
/** Attach a connector to this runtime resource as a brokered env var. */
|
|
1639
|
+
attach(params: SandboxConnectorAttachParams): Promise<SandboxConnectorBinding>;
|
|
1640
|
+
/** Detach a connector binding by binding id or connector UID. */
|
|
1641
|
+
detach(bindingOrConnector: string): Promise<void>;
|
|
1642
|
+
/** Sync or materialize connector placeholder env vars for this runtime resource. */
|
|
1643
|
+
sync(): Promise<Record<string, unknown>>;
|
|
1644
|
+
/** Verify a required connector is attached before agent work begins. */
|
|
1645
|
+
preflight(params?: SandboxConnectorPreflightParams): Promise<SandboxConnectorPreflightResult>;
|
|
1646
|
+
}
|
|
1647
|
+
declare class SandboxConnectors extends RuntimeConnectors {
|
|
1648
|
+
constructor(http: HttpClient, sandboxId: string);
|
|
1649
|
+
}
|
|
1650
|
+
declare class ComputerConnectors extends RuntimeConnectors {
|
|
1651
|
+
constructor(http: HttpClient, computerId: string);
|
|
1652
|
+
}
|
|
1653
|
+
declare class DeploymentConnectors extends RuntimeConnectors {
|
|
1654
|
+
constructor(http: HttpClient, deploymentId: string);
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
interface ScreenSize {
|
|
1658
|
+
width: number;
|
|
1659
|
+
height: number;
|
|
1660
|
+
}
|
|
1661
|
+
interface DesktopEnvironmentInfo {
|
|
1662
|
+
name?: string;
|
|
1663
|
+
[key: string]: unknown;
|
|
1664
|
+
}
|
|
1665
|
+
interface WindowSize {
|
|
1666
|
+
width: number;
|
|
1667
|
+
height: number;
|
|
1668
|
+
}
|
|
1669
|
+
interface WindowPosition {
|
|
1670
|
+
x: number;
|
|
1671
|
+
y: number;
|
|
1672
|
+
}
|
|
1673
|
+
type DesktopMouseButton = "left" | "right" | "middle";
|
|
1674
|
+
declare class Desktop {
|
|
1675
|
+
private readonly http;
|
|
1676
|
+
private readonly computerId;
|
|
1677
|
+
constructor(http: HttpClient, computerId: string);
|
|
1678
|
+
private base;
|
|
1679
|
+
/** Capture a screenshot of the desktop. Returns raw PNG bytes. */
|
|
1680
|
+
screenshot(): Promise<Uint8Array>;
|
|
1681
|
+
/** Click at the given coordinates. */
|
|
1682
|
+
click(x: number, y: number, button?: ClickParams$1["button"]): Promise<DesktopActionResult>;
|
|
1683
|
+
/** Explicit left-button click. Alias for click(x, y, "left"). */
|
|
1684
|
+
leftClick(x: number, y: number): Promise<DesktopActionResult>;
|
|
1685
|
+
/** Right-button click. Alias for click(x, y, "right"). */
|
|
1686
|
+
rightClick(x: number, y: number): Promise<DesktopActionResult>;
|
|
1687
|
+
/** Middle-button click. Alias for click(x, y, "middle"). */
|
|
1688
|
+
middleClick(x: number, y: number): Promise<DesktopActionResult>;
|
|
1689
|
+
/** Double-click at the given coordinates. */
|
|
1690
|
+
doubleClick(x: number, y: number): Promise<DesktopActionResult>;
|
|
1691
|
+
/** Move the mouse pointer without clicking. */
|
|
1692
|
+
moveMouse(x: number, y: number): Promise<DesktopActionResult>;
|
|
1693
|
+
/** Type text into the currently focused element. */
|
|
1694
|
+
type(text: string, delay?: number): Promise<DesktopActionResult>;
|
|
1695
|
+
/** Alias for `type(text)` used by simple computer-control loops. */
|
|
1696
|
+
write(text: string, delay?: number): Promise<DesktopActionResult>;
|
|
1697
|
+
/** Send a key or key combination (e.g. "Enter", "ctrl+c"). */
|
|
1698
|
+
key(key: string): Promise<DesktopActionResult>;
|
|
1699
|
+
/** Alias for `key(key)` used by simple computer-control loops. */
|
|
1700
|
+
press(key: string): Promise<DesktopActionResult>;
|
|
1701
|
+
/** Scroll in a direction at an optional position. */
|
|
1702
|
+
scroll(direction: ScrollParams["direction"], clicks?: number, x?: number, y?: number): Promise<DesktopActionResult>;
|
|
1703
|
+
/** Click and drag from one coordinate to another. */
|
|
1704
|
+
drag(fromX: number, fromY: number, toX: number, toY: number): Promise<DesktopActionResult>;
|
|
1705
|
+
/** Wait for the given number of seconds. */
|
|
1706
|
+
wait(seconds: number): Promise<DesktopActionResult>;
|
|
1707
|
+
/** List all open windows on the desktop. */
|
|
1708
|
+
windows(): Promise<WindowInfo[]>;
|
|
1709
|
+
/** Get the current cursor position. */
|
|
1710
|
+
cursor(): Promise<CursorInfo>;
|
|
1711
|
+
/** Bring the given window into focus. */
|
|
1712
|
+
focusWindow(windowId: string): Promise<DesktopActionResult>;
|
|
1713
|
+
/** Launch an application by name. */
|
|
1714
|
+
launch(appName: string): Promise<DesktopActionResult>;
|
|
1715
|
+
/** Press several keys at once, for example `hotkey("ctrl", "c")`. `POST /desktop/hotkey`. */
|
|
1716
|
+
hotkey(...keys: string[]): Promise<DesktopActionResult>;
|
|
1717
|
+
/** Press a key and keep it down until {@link keyUp}. `POST /desktop/key-down`. */
|
|
1718
|
+
keyDown(key: string): Promise<DesktopActionResult>;
|
|
1719
|
+
/** Release a key held by {@link keyDown}. `POST /desktop/key-up`. */
|
|
1720
|
+
keyUp(key: string): Promise<DesktopActionResult>;
|
|
1721
|
+
/** Press a mouse button without releasing it. `POST /desktop/mouse-down`. */
|
|
1722
|
+
mouseDown(x: number, y: number, button?: DesktopMouseButton): Promise<DesktopActionResult>;
|
|
1723
|
+
/** Release a mouse button. `POST /desktop/mouse-up`. */
|
|
1724
|
+
mouseUp(x: number, y: number, button?: DesktopMouseButton): Promise<DesktopActionResult>;
|
|
1725
|
+
/** Screen dimensions in pixels. `GET /desktop/screen-size`. */
|
|
1726
|
+
screenSize(): Promise<ScreenSize>;
|
|
1727
|
+
/** PNG bytes of one rectangle of the screen. `POST /desktop/screenshot/region`. */
|
|
1728
|
+
screenshotRegion(x: number, y: number, width: number, height: number): Promise<Uint8Array>;
|
|
1729
|
+
/** The accessibility tree of the focused application. Cheaper to read than a screenshot. */
|
|
1730
|
+
accessibilityTree(): Promise<Record<string, unknown>>;
|
|
1731
|
+
/** The desktop environment (name and details). `GET /desktop/environment`. */
|
|
1732
|
+
environment(): Promise<DesktopEnvironmentInfo>;
|
|
1733
|
+
/** Set the wallpaper from an image path inside the computer. `POST /desktop/wallpaper`. */
|
|
1734
|
+
setWallpaper(path: string): Promise<DesktopActionResult>;
|
|
1735
|
+
/** Read the clipboard text. `GET /desktop/clipboard`. */
|
|
1736
|
+
getClipboard(): Promise<string>;
|
|
1737
|
+
/** Replace the clipboard text. `POST /desktop/clipboard`. */
|
|
1738
|
+
setClipboard(text: string): Promise<DesktopActionResult>;
|
|
1739
|
+
private windowPath;
|
|
1740
|
+
windowSize(windowId: string): Promise<WindowSize>;
|
|
1741
|
+
windowPosition(windowId: string): Promise<WindowPosition>;
|
|
1742
|
+
resizeWindow(windowId: string, width: number, height: number): Promise<DesktopActionResult>;
|
|
1743
|
+
moveWindow(windowId: string, x: number, y: number): Promise<DesktopActionResult>;
|
|
1744
|
+
maximizeWindow(windowId: string): Promise<DesktopActionResult>;
|
|
1745
|
+
minimizeWindow(windowId: string): Promise<DesktopActionResult>;
|
|
1746
|
+
closeWindow(windowId: string): Promise<DesktopActionResult>;
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
interface MiosaErrorBody {
|
|
1750
|
+
error?: string | {
|
|
1751
|
+
code?: string;
|
|
1752
|
+
message?: string;
|
|
1753
|
+
details?: unknown;
|
|
1754
|
+
retryable?: boolean;
|
|
1755
|
+
request_id?: string;
|
|
1756
|
+
retry_after_ms?: number;
|
|
1757
|
+
};
|
|
1758
|
+
message?: string;
|
|
1759
|
+
code?: string;
|
|
1760
|
+
detail?: string;
|
|
1761
|
+
details?: unknown;
|
|
1762
|
+
reason?: string;
|
|
1763
|
+
request_id?: string;
|
|
1764
|
+
retryable?: boolean;
|
|
1765
|
+
retry_after_ms?: number;
|
|
1766
|
+
}
|
|
1767
|
+
declare class MiosaError extends Error {
|
|
1768
|
+
readonly status: number;
|
|
1769
|
+
readonly code: string;
|
|
1770
|
+
readonly details: unknown;
|
|
1771
|
+
readonly requestId: string | undefined;
|
|
1772
|
+
readonly retryable: boolean;
|
|
1773
|
+
/**
|
|
1774
|
+
* Server-supplied retry hint in milliseconds, taken from the canonical
|
|
1775
|
+
* error shape's `retry_after_ms` (nested under `error` or top-level) or,
|
|
1776
|
+
* failing that, the HTTP `Retry-After` header. `undefined` when the
|
|
1777
|
+
* response carried neither, in which case a caller should fall back to
|
|
1778
|
+
* its own backoff policy.
|
|
1779
|
+
*/
|
|
1780
|
+
retryAfterMs: number | undefined;
|
|
1781
|
+
constructor(message: string, status: number, code: string, details?: unknown, requestId?: string, retryable?: boolean, retryAfterMs?: number);
|
|
1782
|
+
/**
|
|
1783
|
+
* @param retryAfterHeaderMs The `Retry-After` header value, already
|
|
1784
|
+
* converted to milliseconds by the caller. Used only when the body does
|
|
1785
|
+
* not carry the more precise `retry_after_ms`.
|
|
1786
|
+
*/
|
|
1787
|
+
static fromResponse(status: number, body: MiosaErrorBody, requestId?: string, retryAfterHeaderMs?: number): MiosaError;
|
|
1788
|
+
}
|
|
1789
|
+
declare class AuthError extends MiosaError {
|
|
1790
|
+
constructor(message: string, status?: number, code?: string, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1791
|
+
}
|
|
1792
|
+
declare class NotFoundError extends MiosaError {
|
|
1793
|
+
constructor(message: string, code?: string, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1794
|
+
}
|
|
1795
|
+
declare class RateLimitError extends MiosaError {
|
|
1796
|
+
readonly retryAfter: number | undefined;
|
|
1797
|
+
constructor(message: string, details?: unknown, requestId?: string, retryAfter?: number, retryable?: boolean, code?: string);
|
|
1798
|
+
}
|
|
1799
|
+
declare class InsufficientCreditsError extends MiosaError {
|
|
1800
|
+
constructor(message: string, details?: unknown, requestId?: string, retryable?: boolean, code?: string);
|
|
1801
|
+
}
|
|
1802
|
+
declare class ValidationError extends MiosaError {
|
|
1803
|
+
constructor(message: string, status: number, code?: string, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1804
|
+
}
|
|
1805
|
+
declare class TimeoutError extends MiosaError {
|
|
1806
|
+
constructor(message?: string);
|
|
1807
|
+
}
|
|
1808
|
+
declare class NetworkError extends MiosaError {
|
|
1809
|
+
readonly cause: Error;
|
|
1810
|
+
constructor(message: string, cause: Error);
|
|
1811
|
+
}
|
|
1812
|
+
declare class ProjectNotLinkedError extends MiosaError {
|
|
1813
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1814
|
+
}
|
|
1815
|
+
declare class SubjectNotAllowedError extends MiosaError {
|
|
1816
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1817
|
+
}
|
|
1818
|
+
declare class ScopeNotAllowedError extends MiosaError {
|
|
1819
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1820
|
+
}
|
|
1821
|
+
declare class ManagedProviderBindingOnlyError extends MiosaError {
|
|
1822
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1823
|
+
}
|
|
1824
|
+
declare class InstallationRequiredError extends MiosaError {
|
|
1825
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1826
|
+
}
|
|
1827
|
+
declare class UserAuthorizationRequiredError extends MiosaError {
|
|
1828
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1829
|
+
}
|
|
1830
|
+
declare class EgressHostNotAllowedError extends MiosaError {
|
|
1831
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1832
|
+
}
|
|
1833
|
+
declare class TokenRefreshFailedError extends MiosaError {
|
|
1834
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1835
|
+
}
|
|
1836
|
+
/**
|
|
1837
|
+
* `503 no_ready_machine`: a `failFast` request found no ready machine. The
|
|
1838
|
+
* server answers in about 1.5 seconds instead of queueing, and the request
|
|
1839
|
+
* does not count against start limits. Retryable later; the client does not
|
|
1840
|
+
* retry it for you, since shedding load is the point.
|
|
1841
|
+
*/
|
|
1842
|
+
declare class NoReadyMachineError extends MiosaError {
|
|
1843
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean, retryAfterMs?: number);
|
|
1844
|
+
}
|
|
1845
|
+
/** `400 INVALID_ID`: a path or body id is not a well-formed identifier. */
|
|
1846
|
+
declare class InvalidIdError extends ValidationError {
|
|
1847
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1848
|
+
}
|
|
1849
|
+
/**
|
|
1850
|
+
* `422 OWN_CREDENTIALS_REQUIRED`: the harness has no credential of the
|
|
1851
|
+
* account's own. MIOSA platform keys are never used for agent runs, so connect
|
|
1852
|
+
* a credential (`miosa.agentSettings.putCredential`) and retry.
|
|
1853
|
+
*/
|
|
1854
|
+
declare class OwnCredentialsRequiredError extends ValidationError {
|
|
1855
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1856
|
+
}
|
|
1857
|
+
/** `404 ENVIRONMENT_NOT_FOUND`: unknown id or name on an environment route. */
|
|
1858
|
+
declare class EnvironmentNotFoundError extends NotFoundError {
|
|
1859
|
+
constructor(message: string, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1860
|
+
}
|
|
1861
|
+
/**
|
|
1862
|
+
* `422 ENVIRONMENT_NOT_FOUND` on a machine route: the `environment` or
|
|
1863
|
+
* `environment_id` named on a create, resume, fork, start or clone does not
|
|
1864
|
+
* exist. Nothing was created or changed. A validation error, as it was before.
|
|
1865
|
+
*/
|
|
1866
|
+
declare class UnknownEnvironmentError extends ValidationError {
|
|
1867
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1868
|
+
}
|
|
1869
|
+
/** `409 ENVIRONMENT_NAME_TAKEN`. */
|
|
1870
|
+
declare class EnvironmentNameTakenError extends ValidationError {
|
|
1871
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1872
|
+
}
|
|
1873
|
+
/** `409 ENVIRONMENT_IS_DEFAULT`: the organization default cannot be deleted. */
|
|
1874
|
+
declare class EnvironmentIsDefaultError extends ValidationError {
|
|
1875
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1876
|
+
}
|
|
1877
|
+
/**
|
|
1878
|
+
* `409 ENVIRONMENT_SCRUB_FAILED`: the machine's delivered secrets could not be
|
|
1879
|
+
* removed before a snapshot or fork, so nothing was saved. Retryable.
|
|
1880
|
+
*/
|
|
1881
|
+
declare class EnvironmentScrubFailedError extends ValidationError {
|
|
1882
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1883
|
+
}
|
|
1884
|
+
/**
|
|
1885
|
+
* `409 ENVIRONMENT_MEMORY_WITHHELD`: a sandbox fork, restore or deploy whose
|
|
1886
|
+
* environment withholds something the source received. Not retryable as is.
|
|
1887
|
+
*/
|
|
1888
|
+
declare class EnvironmentMemoryWithheldError extends ValidationError {
|
|
1889
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1890
|
+
/** `details.reasons`: why the memory was withheld. Empty when absent. */
|
|
1891
|
+
get reasons(): string[];
|
|
1892
|
+
}
|
|
1893
|
+
/** `403 MACHINE_KEY_SCOPE`: a machine key called something outside its machine's lifecycle. */
|
|
1894
|
+
declare class MachineKeyScopeError extends AuthError {
|
|
1895
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1896
|
+
}
|
|
1897
|
+
/**
|
|
1898
|
+
* `409 SANDBOX_STARTING` / `409 COMPUTER_STARTING`: the machine is not ready for
|
|
1899
|
+
* a command yet. Retryable; `retryAfterMs` carries the server's hint (the
|
|
1900
|
+
* client already retries these using it).
|
|
1901
|
+
*/
|
|
1902
|
+
declare class MachineStartingError extends ValidationError {
|
|
1903
|
+
constructor(message: string, status?: number, code?: string, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1904
|
+
}
|
|
1905
|
+
declare class SandboxStartingError extends MachineStartingError {
|
|
1906
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1907
|
+
}
|
|
1908
|
+
declare class ComputerStartingError extends MachineStartingError {
|
|
1909
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1910
|
+
}
|
|
1911
|
+
/** `402 CREDIT_REQUIRED`: the action needs credit (for example a named snapshot past the free allowance). */
|
|
1912
|
+
declare class CreditRequiredError extends InsufficientCreditsError {
|
|
1913
|
+
constructor(message: string, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1914
|
+
}
|
|
1915
|
+
/** `402 TEAM_MEMBER_CAP_REACHED`: the caller's usage cap in the billed organization is reached. */
|
|
1916
|
+
declare class TeamMemberCapReachedError extends InsufficientCreditsError {
|
|
1917
|
+
constructor(message: string, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1918
|
+
}
|
|
1919
|
+
/** `429 MEMBER_LIMIT_REACHED`: the caller's concurrent-sandbox cap is reached. Not retryable until a sandbox stops. */
|
|
1920
|
+
declare class MemberLimitReachedError extends RateLimitError {
|
|
1921
|
+
constructor(message: string, details?: unknown, requestId?: string, retryAfter?: number, retryable?: boolean);
|
|
1922
|
+
}
|
|
1923
|
+
/** `403 BILL_TO_LOCKED`: this credential is locked to its own organization. */
|
|
1924
|
+
declare class BillToLockedError extends AuthError {
|
|
1925
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1926
|
+
}
|
|
1927
|
+
/** `403 BILL_TO_FORBIDDEN`: the caller's role in that organization cannot create resources. */
|
|
1928
|
+
declare class BillToForbiddenError extends AuthError {
|
|
1929
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1930
|
+
}
|
|
1931
|
+
/** `403 BILL_TO_SUSPENDED`: the organization to bill is suspended. */
|
|
1932
|
+
declare class BillToSuspendedError extends AuthError {
|
|
1933
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1934
|
+
}
|
|
1935
|
+
/** `404 ORG_NOT_FOUND`: the bill-to organization does not exist for the caller. */
|
|
1936
|
+
declare class OrgNotFoundError extends NotFoundError {
|
|
1937
|
+
constructor(message: string, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1938
|
+
}
|
|
1939
|
+
/** `409 AMBIGUOUS_ORG`: two organizations share the name; use the id. */
|
|
1940
|
+
declare class AmbiguousOrgError extends ValidationError {
|
|
1941
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1942
|
+
}
|
|
1943
|
+
/** `409 SNAPSHOT_IN_USE`: something still depends on the snapshot; see {@link dependents}. */
|
|
1944
|
+
declare class SnapshotInUseError extends ValidationError {
|
|
1945
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1946
|
+
/** `details.dependents`: every thing that still needs the snapshot's bytes. */
|
|
1947
|
+
get dependents(): Array<{
|
|
1948
|
+
type: string;
|
|
1949
|
+
id: string;
|
|
1950
|
+
label?: string;
|
|
1951
|
+
}>;
|
|
1952
|
+
}
|
|
1953
|
+
/** `409 RUN_SESSION_NOT_RESUMABLE`: `details.reason` says why (`not_found`, `still_running`, ...). */
|
|
1954
|
+
declare class RunSessionNotResumableError extends ValidationError {
|
|
1955
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1956
|
+
get reason(): string | undefined;
|
|
1957
|
+
}
|
|
1958
|
+
/** `409 CHAT_BUSY`: the chat's latest run has not finished. Retryable once it has. */
|
|
1959
|
+
declare class ChatBusyError extends ValidationError {
|
|
1960
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1961
|
+
}
|
|
1962
|
+
/** `409 NO_AGENT_RUN`: no agent run is attached to the machine. Not retryable. */
|
|
1963
|
+
declare class NoAgentRunError extends ValidationError {
|
|
1964
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1965
|
+
}
|
|
1966
|
+
/** `422 INVALID_SETUP_FILE`: `details.reason` is `setup_file_too_large`, `setup_file_not_string`, `setup_file_not_utf8` or `setup_file_has_nul`. */
|
|
1967
|
+
declare class InvalidSetupFileError extends ValidationError {
|
|
1968
|
+
constructor(message: string, status?: number, details?: unknown, requestId?: string, retryable?: boolean);
|
|
1969
|
+
get reason(): string | undefined;
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
/**
|
|
1973
|
+
* One typed dispatcher over the desktop routes, named after the members of
|
|
1974
|
+
* Anthropic's `computer_toolset_20260801` so the same names work in an agent
|
|
1975
|
+
* loop and in `computer.act()`.
|
|
1976
|
+
*/
|
|
1977
|
+
/** Every action `act()` understands. */
|
|
1978
|
+
declare const ACTION_NAMES: readonly ["screenshot", "zoom", "cursor_position", "left_click", "right_click", "middle_click", "double_click", "triple_click", "left_click_drag", "mouse_move", "left_mouse_down", "left_mouse_up", "scroll", "type", "key", "hold_key", "wait"];
|
|
1979
|
+
type ActionName = (typeof ACTION_NAMES)[number];
|
|
1980
|
+
/** `[x, y]` in screenshot pixels. */
|
|
1981
|
+
type Coordinate = readonly [number, number] | readonly number[];
|
|
1982
|
+
interface ClickParams {
|
|
1983
|
+
/** Where to click. Omitted: the current pointer position. */
|
|
1984
|
+
coordinate?: Coordinate;
|
|
1985
|
+
/** A modifier key held during the click, for example `"shift"`. */
|
|
1986
|
+
text?: string;
|
|
1987
|
+
}
|
|
1988
|
+
interface ActParamsMap {
|
|
1989
|
+
screenshot: Record<string, never>;
|
|
1990
|
+
zoom: {
|
|
1991
|
+
region: readonly [number, number, number, number] | readonly number[];
|
|
1992
|
+
};
|
|
1993
|
+
cursor_position: Record<string, never>;
|
|
1994
|
+
left_click: ClickParams;
|
|
1995
|
+
right_click: ClickParams;
|
|
1996
|
+
middle_click: ClickParams;
|
|
1997
|
+
double_click: ClickParams;
|
|
1998
|
+
triple_click: ClickParams;
|
|
1999
|
+
left_click_drag: {
|
|
2000
|
+
start_coordinate: Coordinate;
|
|
2001
|
+
coordinate: Coordinate;
|
|
2002
|
+
text?: string;
|
|
2003
|
+
};
|
|
2004
|
+
mouse_move: {
|
|
2005
|
+
coordinate: Coordinate;
|
|
2006
|
+
};
|
|
2007
|
+
left_mouse_down: Record<string, never>;
|
|
2008
|
+
left_mouse_up: Record<string, never>;
|
|
2009
|
+
scroll: {
|
|
2010
|
+
scroll_direction: "up" | "down" | "left" | "right";
|
|
2011
|
+
scroll_amount: number;
|
|
2012
|
+
coordinate?: Coordinate;
|
|
2013
|
+
text?: string;
|
|
2014
|
+
};
|
|
2015
|
+
type: {
|
|
2016
|
+
text: string;
|
|
2017
|
+
};
|
|
2018
|
+
key: {
|
|
2019
|
+
text: string;
|
|
2020
|
+
repeat?: number;
|
|
2021
|
+
};
|
|
2022
|
+
hold_key: {
|
|
2023
|
+
text: string;
|
|
2024
|
+
duration: number;
|
|
2025
|
+
};
|
|
2026
|
+
wait: {
|
|
2027
|
+
duration: number;
|
|
2028
|
+
};
|
|
2029
|
+
}
|
|
2030
|
+
interface ActionBase<A extends ActionName> {
|
|
2031
|
+
ok: true;
|
|
2032
|
+
action: A;
|
|
2033
|
+
/** Client-measured time for the whole action, including the round trips. */
|
|
2034
|
+
durationMs: number;
|
|
2035
|
+
}
|
|
2036
|
+
interface ScreenshotActionResult<A extends "screenshot" | "zoom" = "screenshot" | "zoom"> extends ActionBase<A> {
|
|
2037
|
+
imageBase64: string;
|
|
2038
|
+
mediaType: "image/png";
|
|
2039
|
+
/** Pixels, read from the PNG header. */
|
|
2040
|
+
width: number;
|
|
2041
|
+
height: number;
|
|
2042
|
+
takenAt: string;
|
|
2043
|
+
}
|
|
2044
|
+
interface CursorActionResult extends ActionBase<"cursor_position"> {
|
|
2045
|
+
x: number;
|
|
2046
|
+
y: number;
|
|
2047
|
+
}
|
|
2048
|
+
/** An action that moved or clicked the pointer. `coordinate` is where it ended. */
|
|
2049
|
+
interface PointerActionResult<A extends ActionName> extends ActionBase<A> {
|
|
2050
|
+
coordinate: [number, number];
|
|
2051
|
+
}
|
|
2052
|
+
type ActionResultMap = {
|
|
2053
|
+
[A in ActionName]: A extends "screenshot" | "zoom" ? ScreenshotActionResult<A> : A extends "cursor_position" ? CursorActionResult : A extends "left_click" | "right_click" | "middle_click" | "double_click" | "triple_click" | "left_click_drag" | "mouse_move" | "left_mouse_down" | "left_mouse_up" | "scroll" ? PointerActionResult<A> : ActionBase<A>;
|
|
2054
|
+
};
|
|
2055
|
+
/** What `act()` returns, discriminated on `action`. */
|
|
2056
|
+
type ActionResult = ActionResultMap[ActionName];
|
|
2057
|
+
/** Parameters are optional only for actions that take none. */
|
|
2058
|
+
type ActArgs<A extends ActionName> = A extends "screenshot" | "cursor_position" | "left_mouse_down" | "left_mouse_up" ? [params?: ActParamsMap[A]] : A extends "left_click" | "right_click" | "middle_click" | "double_click" | "triple_click" ? [params?: ActParamsMap[A]] : [params: ActParamsMap[A]];
|
|
2059
|
+
declare class InvalidActionInputError extends MiosaError {
|
|
2060
|
+
constructor(action: string, message: string);
|
|
2061
|
+
}
|
|
2062
|
+
/** Width and height from a PNG's IHDR chunk; `[0, 0]` for anything else. */
|
|
2063
|
+
declare function pngSize(bytes: Uint8Array): [number, number];
|
|
2064
|
+
/** Run one action against a desktop. */
|
|
2065
|
+
declare function performAction<A extends ActionName>(desktop: Desktop, action: A, ...args: ActArgs<A>): Promise<ActionResultMap[A]>;
|
|
2066
|
+
|
|
2067
|
+
/**
|
|
2068
|
+
* Helpers an agent loop needs around a computer: wait until it can be driven,
|
|
2069
|
+
* look at it cheaply, and get a viewer link.
|
|
2070
|
+
*/
|
|
2071
|
+
interface WaitOptions {
|
|
2072
|
+
/** Give up after this long. */
|
|
2073
|
+
timeoutMs?: number;
|
|
2074
|
+
/** Time between polls. */
|
|
2075
|
+
pollMs?: number;
|
|
2076
|
+
signal?: AbortSignal;
|
|
2077
|
+
}
|
|
2078
|
+
interface WaitIdleOptions extends WaitOptions {
|
|
2079
|
+
/** The screen must not change for this long. Default 1000. */
|
|
2080
|
+
quietMs?: number;
|
|
2081
|
+
}
|
|
2082
|
+
interface LookOptions {
|
|
2083
|
+
/** Include the accessibility tree. Default true. A failure here does not fail the call. */
|
|
2084
|
+
includeTree?: boolean;
|
|
2085
|
+
/** Include a screenshot. Default true. */
|
|
2086
|
+
includeImage?: boolean;
|
|
2087
|
+
}
|
|
2088
|
+
interface LookResult {
|
|
2089
|
+
imageBase64?: string;
|
|
2090
|
+
mediaType?: "image/png";
|
|
2091
|
+
width?: number;
|
|
2092
|
+
height?: number;
|
|
2093
|
+
tree?: Record<string, unknown>;
|
|
2094
|
+
/** Set when the tree was asked for and could not be read. */
|
|
2095
|
+
treeError?: string;
|
|
2096
|
+
takenAt: string;
|
|
2097
|
+
}
|
|
2098
|
+
interface ViewerOptions {
|
|
2099
|
+
/** Link lifetime. The server accepts its own bounds and answers `INVALID_TTL` outside them. */
|
|
2100
|
+
ttlSeconds?: number;
|
|
2101
|
+
}
|
|
2102
|
+
interface ComputerViewer {
|
|
2103
|
+
/** Open this in a browser or an iframe. */
|
|
2104
|
+
url: string;
|
|
2105
|
+
/** Direct desktop URL with the token in the query string. */
|
|
2106
|
+
desktopUrl: string;
|
|
2107
|
+
wsUrl: string;
|
|
2108
|
+
token: string;
|
|
2109
|
+
/** Unix seconds. */
|
|
2110
|
+
expiresAtUnix: number;
|
|
2111
|
+
/** ISO 8601. */
|
|
2112
|
+
expiresAt: string;
|
|
2113
|
+
ttlSeconds: number;
|
|
2114
|
+
mode: "vnc";
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
/**
|
|
2118
|
+
* Egress audit log — paginated query + live tail.
|
|
2119
|
+
*
|
|
2120
|
+
* Backed by:
|
|
2121
|
+
* GET /api/v1/egress/audit
|
|
2122
|
+
* GET /api/v1/egress/audit/:id
|
|
2123
|
+
*
|
|
2124
|
+
* `client.audit.tail()` long-polls the REST endpoint and yields new
|
|
2125
|
+
* events as they arrive. The sandbox-scoped variant
|
|
2126
|
+
* (`sandbox.audit.tail()`) upgrades to a live SSE connection backed by
|
|
2127
|
+
* `GET /sandboxes/:id/audit/stream` so the tail latency is
|
|
2128
|
+
* sub-second.
|
|
2129
|
+
*/
|
|
2130
|
+
|
|
2131
|
+
interface EgressAuditEvent {
|
|
2132
|
+
id: string;
|
|
2133
|
+
action?: string;
|
|
2134
|
+
effect?: string;
|
|
2135
|
+
host?: string;
|
|
2136
|
+
method?: string;
|
|
2137
|
+
path?: string;
|
|
2138
|
+
status_code?: number;
|
|
2139
|
+
actor_id?: string;
|
|
2140
|
+
resource_id?: string;
|
|
2141
|
+
resource_type?: string;
|
|
2142
|
+
policy_id?: string;
|
|
2143
|
+
rule_id?: string;
|
|
2144
|
+
external_user_id?: string;
|
|
2145
|
+
external_workspace_id?: string;
|
|
2146
|
+
metadata?: Record<string, unknown>;
|
|
2147
|
+
inserted_at?: string;
|
|
2148
|
+
timestamp?: string;
|
|
2149
|
+
[key: string]: unknown;
|
|
2150
|
+
}
|
|
2151
|
+
interface AuditListParams {
|
|
2152
|
+
resourceId?: string;
|
|
2153
|
+
resource_id?: string;
|
|
2154
|
+
resourceType?: string;
|
|
2155
|
+
resource_type?: string;
|
|
2156
|
+
host?: string;
|
|
2157
|
+
action?: string;
|
|
2158
|
+
since?: string;
|
|
2159
|
+
until?: string;
|
|
2160
|
+
limit?: number;
|
|
2161
|
+
cursor?: string;
|
|
2162
|
+
externalUserId?: string;
|
|
2163
|
+
external_user_id?: string;
|
|
2164
|
+
externalWorkspaceId?: string;
|
|
2165
|
+
external_workspace_id?: string;
|
|
2166
|
+
}
|
|
2167
|
+
interface AuditTailParams extends AuditListParams {
|
|
2168
|
+
pollIntervalMs?: number;
|
|
2169
|
+
}
|
|
2170
|
+
declare class EgressAudit {
|
|
2171
|
+
protected readonly http: HttpClient;
|
|
2172
|
+
constructor(http: HttpClient);
|
|
2173
|
+
/** List audit events with optional filters. */
|
|
2174
|
+
list(params?: AuditListParams): Promise<EgressAuditEvent[]>;
|
|
2175
|
+
/** Get a single audit event by id. */
|
|
2176
|
+
get(id: string): Promise<EgressAuditEvent>;
|
|
2177
|
+
/**
|
|
2178
|
+
* Long-poll the audit endpoint and yield new events as they appear.
|
|
2179
|
+
*
|
|
2180
|
+
* Tenant-wide `client.audit.tail()` is REST-based long polling. A
|
|
2181
|
+
* live WebSocket / SSE tail is only available for the sandbox-scoped
|
|
2182
|
+
* variant — see {@link SandboxAudit.tail}.
|
|
2183
|
+
*/
|
|
2184
|
+
tail(params?: AuditTailParams): AsyncIterableIterator<EgressAuditEvent>;
|
|
2185
|
+
}
|
|
2186
|
+
/**
|
|
2187
|
+
* Sandbox-bound view of {@link EgressAudit}. `list()` pre-scopes
|
|
2188
|
+
* `resource_id` + `resource_type="sandbox"`. `tail()` upgrades to the
|
|
2189
|
+
* per-sandbox SSE stream for sub-second tail latency.
|
|
2190
|
+
*/
|
|
2191
|
+
declare class SandboxAudit {
|
|
2192
|
+
protected readonly http: HttpClient;
|
|
2193
|
+
protected readonly resourceId: string;
|
|
2194
|
+
protected readonly resourceType: string;
|
|
2195
|
+
private readonly delegate;
|
|
2196
|
+
constructor(http: HttpClient, resourceId: string);
|
|
2197
|
+
list(params?: AuditListParams): Promise<EgressAuditEvent[]>;
|
|
2198
|
+
get(id: string): Promise<EgressAuditEvent>;
|
|
2199
|
+
/**
|
|
2200
|
+
* Tail this resource's egress audit events. The platform has no per-resource
|
|
2201
|
+
* stream route, so this follows the tenant-wide audit tail filtered to the
|
|
2202
|
+
* resource.
|
|
2203
|
+
*/
|
|
2204
|
+
tail(params?: AuditTailParams): AsyncIterableIterator<EgressAuditEvent>;
|
|
2205
|
+
}
|
|
2206
|
+
/** Computer-bound audit — same surface, `resource_type="computer"`. */
|
|
2207
|
+
declare class ComputerAudit extends SandboxAudit {
|
|
2208
|
+
protected readonly resourceType: string;
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
/**
|
|
2212
|
+
* Egress network — policies, allowlist, suggestions.
|
|
2213
|
+
*
|
|
2214
|
+
* Backed by:
|
|
2215
|
+
* GET /api/v1/egress/policies
|
|
2216
|
+
* POST /api/v1/egress/policies
|
|
2217
|
+
* PATCH /api/v1/egress/policies/:id
|
|
2218
|
+
*
|
|
2219
|
+
* GET /api/v1/egress/allowlist
|
|
2220
|
+
* POST /api/v1/egress/allowlist
|
|
2221
|
+
* DELETE /api/v1/egress/allowlist/:id
|
|
2222
|
+
*
|
|
2223
|
+
* GET /api/v1/egress/audit/suggestions
|
|
2224
|
+
*/
|
|
2225
|
+
|
|
2226
|
+
type EgressPolicyMode = "enforce" | "audit_only";
|
|
2227
|
+
type EgressRuleEffect = "allow" | "deny";
|
|
2228
|
+
interface EgressAllowlistRule {
|
|
2229
|
+
id: string;
|
|
2230
|
+
host: string;
|
|
2231
|
+
effect: EgressRuleEffect | string;
|
|
2232
|
+
methods?: string[];
|
|
2233
|
+
path_glob?: string | null;
|
|
2234
|
+
policy_id?: string | null;
|
|
2235
|
+
resource_id?: string | null;
|
|
2236
|
+
resource_type?: string | null;
|
|
2237
|
+
note?: string | null;
|
|
2238
|
+
created_at?: string;
|
|
2239
|
+
[key: string]: unknown;
|
|
2240
|
+
}
|
|
2241
|
+
interface EgressPolicyData {
|
|
2242
|
+
id: string;
|
|
2243
|
+
name?: string;
|
|
2244
|
+
mode: EgressPolicyMode | string;
|
|
2245
|
+
default_effect: EgressRuleEffect | string;
|
|
2246
|
+
description?: string | null;
|
|
2247
|
+
resource_id?: string | null;
|
|
2248
|
+
resource_type?: string | null;
|
|
2249
|
+
rules?: EgressAllowlistRule[];
|
|
2250
|
+
created_at?: string;
|
|
2251
|
+
updated_at?: string;
|
|
2252
|
+
[key: string]: unknown;
|
|
2253
|
+
}
|
|
2254
|
+
interface EgressSuggestion {
|
|
2255
|
+
host: string;
|
|
2256
|
+
methods?: string[];
|
|
2257
|
+
path_glob?: string | null;
|
|
2258
|
+
count?: number;
|
|
2259
|
+
first_seen?: string;
|
|
2260
|
+
last_seen?: string;
|
|
2261
|
+
resource_id?: string | null;
|
|
2262
|
+
[key: string]: unknown;
|
|
2263
|
+
}
|
|
2264
|
+
interface AllowParams {
|
|
2265
|
+
methods?: string[];
|
|
2266
|
+
pathGlob?: string;
|
|
2267
|
+
path_glob?: string;
|
|
2268
|
+
policyId?: string;
|
|
2269
|
+
policy_id?: string;
|
|
2270
|
+
resourceId?: string;
|
|
2271
|
+
resource_id?: string;
|
|
2272
|
+
resourceType?: string;
|
|
2273
|
+
resource_type?: string;
|
|
2274
|
+
note?: string;
|
|
2275
|
+
}
|
|
2276
|
+
interface PolicyCreateParams {
|
|
2277
|
+
name: string;
|
|
2278
|
+
mode?: EgressPolicyMode | string;
|
|
2279
|
+
defaultEffect?: EgressRuleEffect | string;
|
|
2280
|
+
default_effect?: EgressRuleEffect | string;
|
|
2281
|
+
resourceId?: string;
|
|
2282
|
+
resource_id?: string;
|
|
2283
|
+
resourceType?: string;
|
|
2284
|
+
resource_type?: string;
|
|
2285
|
+
description?: string;
|
|
2286
|
+
}
|
|
2287
|
+
interface PolicyUpdateParams {
|
|
2288
|
+
mode?: EgressPolicyMode | string;
|
|
2289
|
+
defaultEffect?: EgressRuleEffect | string;
|
|
2290
|
+
default_effect?: EgressRuleEffect | string;
|
|
2291
|
+
name?: string;
|
|
2292
|
+
description?: string;
|
|
2293
|
+
}
|
|
2294
|
+
interface ModeParams {
|
|
2295
|
+
policyId?: string;
|
|
2296
|
+
policy_id?: string;
|
|
2297
|
+
resourceId?: string;
|
|
2298
|
+
resource_id?: string;
|
|
2299
|
+
resourceType?: string;
|
|
2300
|
+
resource_type?: string;
|
|
2301
|
+
}
|
|
2302
|
+
interface SuggestionsParams {
|
|
2303
|
+
resourceId?: string;
|
|
2304
|
+
resource_id?: string;
|
|
2305
|
+
resourceType?: string;
|
|
2306
|
+
resource_type?: string;
|
|
2307
|
+
since?: string;
|
|
2308
|
+
}
|
|
2309
|
+
interface PolicyListParams {
|
|
2310
|
+
resourceId?: string;
|
|
2311
|
+
resource_id?: string;
|
|
2312
|
+
resourceType?: string;
|
|
2313
|
+
resource_type?: string;
|
|
2314
|
+
}
|
|
2315
|
+
interface RulesListParams {
|
|
2316
|
+
policyId?: string;
|
|
2317
|
+
policy_id?: string;
|
|
2318
|
+
resourceId?: string;
|
|
2319
|
+
resource_id?: string;
|
|
2320
|
+
resourceType?: string;
|
|
2321
|
+
resource_type?: string;
|
|
2322
|
+
}
|
|
2323
|
+
declare class EgressNetwork {
|
|
2324
|
+
protected readonly http: HttpClient;
|
|
2325
|
+
constructor(http: HttpClient);
|
|
2326
|
+
/** Add an `allow` rule for `host` to the allowlist. */
|
|
2327
|
+
allow(host: string, params?: AllowParams): Promise<EgressAllowlistRule>;
|
|
2328
|
+
/** Add a `deny` rule for `host` to the allowlist. */
|
|
2329
|
+
deny(host: string, params?: AllowParams): Promise<EgressAllowlistRule>;
|
|
2330
|
+
/** List allowlist rules. */
|
|
2331
|
+
rules(params?: RulesListParams): Promise<EgressAllowlistRule[]>;
|
|
2332
|
+
/** Delete an allowlist rule by id. */
|
|
2333
|
+
removeRule(ruleId: string): Promise<void>;
|
|
2334
|
+
/** List egress policies. */
|
|
2335
|
+
policies(params?: PolicyListParams): Promise<EgressPolicyData[]>;
|
|
2336
|
+
/** Create an egress policy. */
|
|
2337
|
+
createPolicy(params: PolicyCreateParams): Promise<EgressPolicyData>;
|
|
2338
|
+
/** Update an egress policy by id. */
|
|
2339
|
+
updatePolicy(policyId: string, params: PolicyUpdateParams): Promise<EgressPolicyData>;
|
|
2340
|
+
/** Set the policy to `mode="enforce"` — denied egress is blocked. */
|
|
2341
|
+
lockdown(params?: ModeParams): Promise<EgressPolicyData>;
|
|
2342
|
+
/** Set the policy to `mode="audit_only"` — log but do not block. */
|
|
2343
|
+
observe(params?: ModeParams): Promise<EgressPolicyData>;
|
|
2344
|
+
private setMode;
|
|
2345
|
+
/** AI-generated allowlist suggestions from recent denied egress. */
|
|
2346
|
+
suggestions(params?: SuggestionsParams): Promise<EgressSuggestion[]>;
|
|
2347
|
+
}
|
|
2348
|
+
/**
|
|
2349
|
+
* Sandbox-bound view of {@link EgressNetwork}. Pre-scopes
|
|
2350
|
+
* `resource_id` + `resource_type="sandbox"` on every call.
|
|
2351
|
+
*/
|
|
2352
|
+
declare class SandboxNetwork {
|
|
2353
|
+
protected readonly resourceId: string;
|
|
2354
|
+
protected readonly resourceType: string;
|
|
2355
|
+
private readonly delegate;
|
|
2356
|
+
constructor(http: HttpClient, resourceId: string);
|
|
2357
|
+
private resolvedResourceId;
|
|
2358
|
+
private resolvedResourceType;
|
|
2359
|
+
allow(host: string, params?: AllowParams): Promise<EgressAllowlistRule>;
|
|
2360
|
+
deny(host: string, params?: AllowParams): Promise<EgressAllowlistRule>;
|
|
2361
|
+
rules(params?: RulesListParams): Promise<EgressAllowlistRule[]>;
|
|
2362
|
+
removeRule(ruleId: string): Promise<void>;
|
|
2363
|
+
lockdown(params?: {
|
|
2364
|
+
policyId?: string;
|
|
2365
|
+
}): Promise<EgressPolicyData>;
|
|
2366
|
+
observe(params?: {
|
|
2367
|
+
policyId?: string;
|
|
2368
|
+
}): Promise<EgressPolicyData>;
|
|
2369
|
+
suggestions(params?: {
|
|
2370
|
+
since?: string;
|
|
2371
|
+
}): Promise<EgressSuggestion[]>;
|
|
2372
|
+
policies(): Promise<EgressPolicyData[]>;
|
|
2373
|
+
}
|
|
2374
|
+
/** Computer-bound network — same surface, `resource_type="computer"`. */
|
|
2375
|
+
declare class ComputerNetwork extends SandboxNetwork {
|
|
2376
|
+
protected readonly resourceType: string;
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2379
|
+
/**
|
|
2380
|
+
* Egress secrets — encrypted API key + OAuth credential vault.
|
|
2381
|
+
*
|
|
2382
|
+
* Backed by:
|
|
2383
|
+
* POST /api/v1/egress/secrets
|
|
2384
|
+
* GET /api/v1/egress/secrets
|
|
2385
|
+
* GET /api/v1/egress/secrets/:id
|
|
2386
|
+
* PATCH /api/v1/egress/secrets/:id (rotate)
|
|
2387
|
+
* DELETE /api/v1/egress/secrets/:id
|
|
2388
|
+
*
|
|
2389
|
+
* POST /api/v1/egress/bindings
|
|
2390
|
+
* GET /api/v1/egress/bindings
|
|
2391
|
+
* DELETE /api/v1/egress/bindings/:id
|
|
2392
|
+
*
|
|
2393
|
+
* GET /api/v1/egress/oauth/providers
|
|
2394
|
+
* POST /api/v1/egress/oauth/start
|
|
2395
|
+
* GET /api/v1/egress/oauth/status?state=...
|
|
2396
|
+
*/
|
|
2397
|
+
|
|
2398
|
+
type EgressSecretType = "api_key" | "oauth_token" | "bearer" | "basic" | "generic";
|
|
2399
|
+
type EgressSecretScope = "user" | "workspace" | "tenant" | "external_user" | "external_workspace";
|
|
2400
|
+
interface EgressSecretData {
|
|
2401
|
+
id: string;
|
|
2402
|
+
name?: string;
|
|
2403
|
+
type?: EgressSecretType | string;
|
|
2404
|
+
scope?: EgressSecretScope | string;
|
|
2405
|
+
workspace_id?: string | null;
|
|
2406
|
+
owner_user_id?: string | null;
|
|
2407
|
+
external_user_id?: string | null;
|
|
2408
|
+
external_workspace_id?: string | null;
|
|
2409
|
+
resource_id?: string | null;
|
|
2410
|
+
resource_type?: string | null;
|
|
2411
|
+
masked_value?: string | null;
|
|
2412
|
+
expires_at?: string | null;
|
|
2413
|
+
metadata?: Record<string, unknown>;
|
|
2414
|
+
created_at?: string;
|
|
2415
|
+
updated_at?: string;
|
|
2416
|
+
[key: string]: unknown;
|
|
2417
|
+
}
|
|
2418
|
+
interface EgressBindingData {
|
|
2419
|
+
id: string;
|
|
2420
|
+
secret_id: string;
|
|
2421
|
+
resource_id: string;
|
|
2422
|
+
resource_type: string;
|
|
2423
|
+
expose_as_env: string;
|
|
2424
|
+
created_at?: string;
|
|
2425
|
+
[key: string]: unknown;
|
|
2426
|
+
}
|
|
2427
|
+
interface OauthProvider {
|
|
2428
|
+
name: string;
|
|
2429
|
+
display_name?: string;
|
|
2430
|
+
scopes?: string[];
|
|
2431
|
+
[key: string]: unknown;
|
|
2432
|
+
}
|
|
2433
|
+
interface SecretSetParams {
|
|
2434
|
+
name: string;
|
|
2435
|
+
value: string;
|
|
2436
|
+
type?: EgressSecretType | string;
|
|
2437
|
+
scope?: EgressSecretScope | string;
|
|
2438
|
+
exposeAsEnv?: string;
|
|
2439
|
+
expose_as_env?: string;
|
|
2440
|
+
workspaceId?: string;
|
|
2441
|
+
workspace_id?: string;
|
|
2442
|
+
ownerUserId?: string;
|
|
2443
|
+
owner_user_id?: string;
|
|
2444
|
+
externalUserId?: string;
|
|
2445
|
+
external_user_id?: string;
|
|
2446
|
+
externalWorkspaceId?: string;
|
|
2447
|
+
external_workspace_id?: string;
|
|
2448
|
+
resourceId?: string;
|
|
2449
|
+
resource_id?: string;
|
|
2450
|
+
resourceType?: string;
|
|
2451
|
+
resource_type?: string;
|
|
2452
|
+
refreshToken?: string;
|
|
2453
|
+
refresh_token?: string;
|
|
2454
|
+
expiresAt?: string;
|
|
2455
|
+
expires_at?: string;
|
|
2456
|
+
metadata?: Record<string, unknown>;
|
|
2457
|
+
}
|
|
2458
|
+
interface SecretListParams {
|
|
2459
|
+
scope?: string;
|
|
2460
|
+
type?: string;
|
|
2461
|
+
workspaceId?: string;
|
|
2462
|
+
workspace_id?: string;
|
|
2463
|
+
ownerUserId?: string;
|
|
2464
|
+
owner_user_id?: string;
|
|
2465
|
+
externalUserId?: string;
|
|
2466
|
+
external_user_id?: string;
|
|
2467
|
+
externalWorkspaceId?: string;
|
|
2468
|
+
external_workspace_id?: string;
|
|
2469
|
+
resourceId?: string;
|
|
2470
|
+
resource_id?: string;
|
|
2471
|
+
resourceType?: string;
|
|
2472
|
+
resource_type?: string;
|
|
2473
|
+
}
|
|
2474
|
+
interface SecretRotateParams {
|
|
2475
|
+
newValue?: string;
|
|
2476
|
+
new_value?: string;
|
|
2477
|
+
value?: string;
|
|
2478
|
+
refreshToken?: string;
|
|
2479
|
+
refresh_token?: string;
|
|
2480
|
+
expiresAt?: string;
|
|
2481
|
+
expires_at?: string;
|
|
2482
|
+
}
|
|
2483
|
+
interface BindingCreateParams {
|
|
2484
|
+
secretId?: string;
|
|
2485
|
+
secret_id?: string;
|
|
2486
|
+
resourceId?: string;
|
|
2487
|
+
resource_id?: string;
|
|
2488
|
+
resourceType?: string;
|
|
2489
|
+
resource_type?: string;
|
|
2490
|
+
exposeAsEnv?: string;
|
|
2491
|
+
expose_as_env?: string;
|
|
2492
|
+
}
|
|
2493
|
+
interface BindingListParams {
|
|
2494
|
+
resourceId?: string;
|
|
2495
|
+
resource_id?: string;
|
|
2496
|
+
resourceType?: string;
|
|
2497
|
+
resource_type?: string;
|
|
2498
|
+
secretId?: string;
|
|
2499
|
+
secret_id?: string;
|
|
2500
|
+
}
|
|
2501
|
+
interface OauthConnectParams {
|
|
2502
|
+
provider: string;
|
|
2503
|
+
exposeAsEnv?: string;
|
|
2504
|
+
expose_as_env?: string;
|
|
2505
|
+
scope?: string;
|
|
2506
|
+
ownerUserId?: string;
|
|
2507
|
+
owner_user_id?: string;
|
|
2508
|
+
externalUserId?: string;
|
|
2509
|
+
external_user_id?: string;
|
|
2510
|
+
externalWorkspaceId?: string;
|
|
2511
|
+
external_workspace_id?: string;
|
|
2512
|
+
resourceId?: string;
|
|
2513
|
+
resource_id?: string;
|
|
2514
|
+
resourceType?: string;
|
|
2515
|
+
resource_type?: string;
|
|
2516
|
+
redirectUri?: string;
|
|
2517
|
+
redirect_uri?: string;
|
|
2518
|
+
}
|
|
2519
|
+
interface OauthStartResult {
|
|
2520
|
+
authorize_url: string;
|
|
2521
|
+
authorizeUrl?: string;
|
|
2522
|
+
state: string;
|
|
2523
|
+
provider?: string;
|
|
2524
|
+
expires_at?: string;
|
|
2525
|
+
[key: string]: unknown;
|
|
2526
|
+
}
|
|
2527
|
+
interface OauthStatusResult {
|
|
2528
|
+
status: string;
|
|
2529
|
+
state?: string;
|
|
2530
|
+
secret_id?: string;
|
|
2531
|
+
error?: string;
|
|
2532
|
+
message?: string;
|
|
2533
|
+
[key: string]: unknown;
|
|
2534
|
+
}
|
|
2535
|
+
/**
|
|
2536
|
+
* A pending OAuth flow.
|
|
2537
|
+
*
|
|
2538
|
+
* The SDK does NOT auto-open a browser — the caller is responsible for
|
|
2539
|
+
* surfacing `authorizeUrl` to the end user. Once the user grants
|
|
2540
|
+
* consent, call `waitForCompletion()` to poll the upstream provider
|
|
2541
|
+
* status.
|
|
2542
|
+
*/
|
|
2543
|
+
declare class OAuthFlow {
|
|
2544
|
+
readonly authorizeUrl: string;
|
|
2545
|
+
readonly state: string;
|
|
2546
|
+
readonly provider?: string;
|
|
2547
|
+
readonly data: OauthStartResult;
|
|
2548
|
+
private readonly http;
|
|
2549
|
+
private readonly startedAt;
|
|
2550
|
+
constructor(http: HttpClient, payload: OauthStartResult, provider?: string);
|
|
2551
|
+
/**
|
|
2552
|
+
* Wait for the user to finish the provider's consent screen.
|
|
2553
|
+
*
|
|
2554
|
+
* The platform has no status route for a pending flow (the callback redirects
|
|
2555
|
+
* the browser), so this polls `GET /egress/secrets` until an OAuth secret for
|
|
2556
|
+
* this provider appears that was created after the flow started. Resolves with
|
|
2557
|
+
* `{ status: "completed", secret_id }`. Rejects if the flow does not finish
|
|
2558
|
+
* within `timeoutSec` seconds.
|
|
2559
|
+
*/
|
|
2560
|
+
waitForCompletion(options?: {
|
|
2561
|
+
timeoutSec?: number;
|
|
2562
|
+
pollIntervalMs?: number;
|
|
2563
|
+
}): Promise<OauthStatusResult>;
|
|
2564
|
+
}
|
|
2565
|
+
declare class EgressSecrets {
|
|
2566
|
+
protected readonly http: HttpClient;
|
|
2567
|
+
constructor(http: HttpClient);
|
|
2568
|
+
/**
|
|
2569
|
+
* Create a secret. When `exposeAsEnv` is provided together with
|
|
2570
|
+
* `resourceId` the backend also creates a binding so the value is
|
|
2571
|
+
* injected as an env-var on that resource.
|
|
2572
|
+
*/
|
|
2573
|
+
set(params: SecretSetParams): Promise<EgressSecretData>;
|
|
2574
|
+
/** List secrets. */
|
|
2575
|
+
list(params?: SecretListParams): Promise<EgressSecretData[]>;
|
|
2576
|
+
/** Get a single secret by id. */
|
|
2577
|
+
get(id: string): Promise<EgressSecretData>;
|
|
2578
|
+
/** Rotate the secret's value. */
|
|
2579
|
+
rotate(id: string, params: SecretRotateParams | string): Promise<EgressSecretData>;
|
|
2580
|
+
/** Delete a secret. */
|
|
2581
|
+
delete(id: string): Promise<void>;
|
|
2582
|
+
/** Bind a secret to a resource as an env var. */
|
|
2583
|
+
createBinding(params: BindingCreateParams): Promise<EgressBindingData>;
|
|
2584
|
+
/** List secret bindings. */
|
|
2585
|
+
listBindings(params?: BindingListParams): Promise<EgressBindingData[]>;
|
|
2586
|
+
/** Delete a binding. */
|
|
2587
|
+
deleteBinding(id: string): Promise<void>;
|
|
2588
|
+
/** List OAuth providers visible to the current tenant. */
|
|
2589
|
+
providers(): Promise<OauthProvider[]>;
|
|
2590
|
+
/**
|
|
2591
|
+
* Start an OAuth Connect flow.
|
|
2592
|
+
*
|
|
2593
|
+
* Returns an {@link OAuthFlow} — the caller must surface
|
|
2594
|
+
* `flow.authorizeUrl` to the end user (the SDK does NOT open the
|
|
2595
|
+
* browser) and then call `flow.waitForCompletion()` to receive the
|
|
2596
|
+
* resulting secret id.
|
|
2597
|
+
*/
|
|
2598
|
+
connect(params: OauthConnectParams): Promise<OAuthFlow>;
|
|
2599
|
+
}
|
|
2600
|
+
/**
|
|
2601
|
+
* Sandbox-bound view of {@link EgressSecrets}. Pre-scopes
|
|
2602
|
+
* `resource_id` + `resource_type="sandbox"` on every call.
|
|
2603
|
+
*/
|
|
2604
|
+
declare class SandboxSecrets {
|
|
2605
|
+
protected readonly resourceId: string;
|
|
2606
|
+
protected readonly resourceType: string;
|
|
2607
|
+
private readonly delegate;
|
|
2608
|
+
constructor(http: HttpClient, resourceId: string);
|
|
2609
|
+
private resolvedResourceId;
|
|
2610
|
+
private resolvedResourceType;
|
|
2611
|
+
set(params: SecretSetParams): Promise<EgressSecretData>;
|
|
2612
|
+
list(params?: SecretListParams): Promise<EgressSecretData[]>;
|
|
2613
|
+
get(id: string): Promise<EgressSecretData>;
|
|
2614
|
+
rotate(id: string, params: SecretRotateParams | string): Promise<EgressSecretData>;
|
|
2615
|
+
delete(id: string): Promise<void>;
|
|
2616
|
+
connect(params: OauthConnectParams): Promise<OAuthFlow>;
|
|
2617
|
+
listBindings(params?: BindingListParams): Promise<EgressBindingData[]>;
|
|
2618
|
+
}
|
|
2619
|
+
/** Computer-bound secrets — same shape, `resource_type="computer"`. */
|
|
2620
|
+
declare class ComputerSecrets extends SandboxSecrets {
|
|
2621
|
+
protected readonly resourceType: string;
|
|
2622
|
+
}
|
|
2623
|
+
|
|
2624
|
+
/** Options for `Exec.stream()`. */
|
|
2625
|
+
interface ExecStreamOptions {
|
|
2626
|
+
/** Command to execute. */
|
|
2627
|
+
command: string;
|
|
2628
|
+
/** Optional arguments. */
|
|
2629
|
+
args?: string[];
|
|
2630
|
+
/** Optional environment variables as KEY=VALUE strings. */
|
|
2631
|
+
env?: string[];
|
|
2632
|
+
/** Working directory inside the VM. */
|
|
2633
|
+
cwd?: string;
|
|
2634
|
+
/** Allocate a PTY. Defaults to false. */
|
|
2635
|
+
tty?: boolean;
|
|
2636
|
+
/** Terminal rows (when tty=true). */
|
|
2637
|
+
rows?: number;
|
|
2638
|
+
/** Terminal columns (when tty=true). */
|
|
2639
|
+
cols?: number;
|
|
2640
|
+
}
|
|
2641
|
+
type ExecStreamEventMap = {
|
|
2642
|
+
stdout: [data: Uint8Array];
|
|
2643
|
+
stderr: [data: Uint8Array];
|
|
2644
|
+
exit: [code: number];
|
|
2645
|
+
error: [err: Error];
|
|
2646
|
+
close: [code: number, reason: string];
|
|
2647
|
+
};
|
|
2648
|
+
/**
|
|
2649
|
+
* Live bidirectional exec stream backed by a `miosa-exec-v1` WebSocket.
|
|
2650
|
+
*
|
|
2651
|
+
* The binary wire protocol (1-byte frame ID) is handled by the server-side
|
|
2652
|
+
* proxy and envd. The SDK exposes typed events on the received frames:
|
|
2653
|
+
*
|
|
2654
|
+
* - `stdout` — chunk of stdout bytes
|
|
2655
|
+
* - `stderr` — chunk of stderr bytes
|
|
2656
|
+
* - `exit` — process exit code (stream ends after this)
|
|
2657
|
+
* - `error` — WebSocket error
|
|
2658
|
+
* - `close` — WebSocket closed
|
|
2659
|
+
*
|
|
2660
|
+
* Obtain via `computer.exec.stream({ command: "bash", tty: true })`.
|
|
2661
|
+
*
|
|
2662
|
+
* ```ts
|
|
2663
|
+
* const s = computer.exec.stream({ command: "python3", args: ["script.py"] });
|
|
2664
|
+
* s.on("stdout", chunk => process.stdout.write(chunk));
|
|
2665
|
+
* s.on("exit", code => console.log("exit:", code));
|
|
2666
|
+
* s.sendStdin(new TextEncoder().encode("hello\n"));
|
|
2667
|
+
* await s.close();
|
|
2668
|
+
* ```
|
|
2669
|
+
*/
|
|
2670
|
+
declare class ExecStreamHandle {
|
|
2671
|
+
private ws;
|
|
2672
|
+
private closed;
|
|
2673
|
+
private readonly listeners;
|
|
2674
|
+
private static readonly FRAME_STDIN;
|
|
2675
|
+
private static readonly FRAME_STDOUT;
|
|
2676
|
+
private static readonly FRAME_STDERR;
|
|
2677
|
+
private static readonly FRAME_EXIT;
|
|
2678
|
+
/** @internal — use `Exec.stream()` instead. */
|
|
2679
|
+
constructor(ws: WebSocket | ws.WebSocket);
|
|
2680
|
+
on<K extends keyof ExecStreamEventMap>(event: K, handler: (...args: ExecStreamEventMap[K]) => void): this;
|
|
2681
|
+
off<K extends keyof ExecStreamEventMap>(event: K, handler: (...args: ExecStreamEventMap[K]) => void): this;
|
|
2682
|
+
private emit;
|
|
2683
|
+
/**
|
|
2684
|
+
* Send stdin bytes to the running process.
|
|
2685
|
+
* Prepends the 0x00 frame ID byte automatically.
|
|
2686
|
+
*/
|
|
2687
|
+
sendStdin(data: Uint8Array): void;
|
|
2688
|
+
/**
|
|
2689
|
+
* Send a terminal resize event.
|
|
2690
|
+
* Encodes as 0x05 + rows (u16 BE) + cols (u16 BE).
|
|
2691
|
+
*/
|
|
2692
|
+
sendResize(rows: number, cols: number): void;
|
|
2693
|
+
/** Close the stream. Idempotent. */
|
|
2694
|
+
close(): Promise<void>;
|
|
2695
|
+
/** Whether the stream has ended (by client or server). */
|
|
2696
|
+
get isClosed(): boolean;
|
|
2697
|
+
private attachHandlers;
|
|
2698
|
+
}
|
|
2699
|
+
/**
|
|
2700
|
+
* Exec resource attached to every `Computer` instance.
|
|
2701
|
+
* Exposes `bash()`, `python()`, and `stream()` for command execution.
|
|
2702
|
+
*/
|
|
2703
|
+
declare class Exec {
|
|
2704
|
+
private readonly http;
|
|
2705
|
+
private readonly computerId;
|
|
2706
|
+
constructor(http: HttpClient, computerId: string);
|
|
2707
|
+
private base;
|
|
2708
|
+
/**
|
|
2709
|
+
* Run a shell command inside the computer.
|
|
2710
|
+
* @param command - Shell command string to execute.
|
|
2711
|
+
* @param timeout - Optional timeout in seconds.
|
|
2712
|
+
*/
|
|
2713
|
+
bash(command: string, timeout?: number): Promise<ExecResult>;
|
|
2714
|
+
/**
|
|
2715
|
+
* Execute Python code inside the computer.
|
|
2716
|
+
* @param code - Python source code string.
|
|
2717
|
+
* @param timeout - Optional timeout in seconds.
|
|
2718
|
+
*/
|
|
2719
|
+
python(code: string, timeout?: number): Promise<ExecResult>;
|
|
2720
|
+
/**
|
|
2721
|
+
* Open a live binary exec stream using the `miosa-exec-v1` subprotocol.
|
|
2722
|
+
*
|
|
2723
|
+
* The WebSocket negotiates `Sec-WebSocket-Protocol: miosa-exec-v1` to
|
|
2724
|
+
* ensure version compatibility. Future protocol versions can be added
|
|
2725
|
+
* server-side without breaking v1 clients.
|
|
2726
|
+
*
|
|
2727
|
+
* ```ts
|
|
2728
|
+
* const stream = computer.exec.stream({ command: "bash", tty: true, rows: 24, cols: 80 });
|
|
2729
|
+
* stream.on("stdout", data => process.stdout.write(data));
|
|
2730
|
+
* stream.on("exit", code => console.log("done:", code));
|
|
2731
|
+
* stream.sendStdin(new TextEncoder().encode("echo hello\n"));
|
|
2732
|
+
* ```
|
|
2733
|
+
*/
|
|
2734
|
+
stream(options: ExecStreamOptions): ExecStreamHandle;
|
|
2735
|
+
private buildWsUrl;
|
|
2736
|
+
}
|
|
2737
|
+
|
|
2738
|
+
declare class Files {
|
|
2739
|
+
private readonly http;
|
|
2740
|
+
private readonly computerId;
|
|
2741
|
+
constructor(http: HttpClient, computerId: string);
|
|
2742
|
+
private base;
|
|
2743
|
+
/**
|
|
2744
|
+
* Upload a local file to the computer.
|
|
2745
|
+
*
|
|
2746
|
+
* In a Node.js environment pass a Buffer or Blob; in a browser pass a File
|
|
2747
|
+
* or Blob. The remote path is where the file will be written inside the VM.
|
|
2748
|
+
*
|
|
2749
|
+
* @param content - File content as Blob, Buffer, Uint8Array, or string.
|
|
2750
|
+
* @param remotePath - Absolute path inside the VM (e.g. /home/user/file.txt).
|
|
2751
|
+
* @param filename - Optional filename hint (defaults to basename of remotePath).
|
|
2752
|
+
*/
|
|
2753
|
+
upload(content: Blob | Uint8Array | string, remotePath: string, _filename?: string): Promise<FileEntry>;
|
|
2754
|
+
/**
|
|
2755
|
+
* Upload through the multipart route (`POST /computers/:id/files/upload`),
|
|
2756
|
+
* which suits large and binary files better than base64 JSON.
|
|
2757
|
+
*/
|
|
2758
|
+
uploadFile(content: Blob | Uint8Array | string, remotePath: string, filename?: string): Promise<FileEntry>;
|
|
2759
|
+
/**
|
|
2760
|
+
* List files and directories at the given path inside the VM.
|
|
2761
|
+
*/
|
|
2762
|
+
list(path: string): Promise<FileListResult>;
|
|
2763
|
+
/**
|
|
2764
|
+
* Download a file from the computer. Returns raw bytes.
|
|
2765
|
+
*/
|
|
2766
|
+
download(path: string): Promise<Uint8Array>;
|
|
2767
|
+
/**
|
|
2768
|
+
* Export a file from the computer and receive a temporary signed URL.
|
|
2769
|
+
*/
|
|
2770
|
+
export(path: string): Promise<FileExportResult>;
|
|
2771
|
+
/**
|
|
2772
|
+
* Delete a file or directory inside the computer.
|
|
2773
|
+
*/
|
|
2774
|
+
delete(path: string): Promise<void>;
|
|
2775
|
+
/**
|
|
2776
|
+
* Stat a path inside the computer. Does not follow symlinks (lstat semantics).
|
|
2777
|
+
*
|
|
2778
|
+
* Returns `{path, size, mode, is_dir, is_symlink, symlink_target?, modified_at}`.
|
|
2779
|
+
*/
|
|
2780
|
+
stat(path: string): Promise<FileStat>;
|
|
2781
|
+
/**
|
|
2782
|
+
* Create a directory inside the computer.
|
|
2783
|
+
*
|
|
2784
|
+
* @param path - Absolute path to create (e.g. `/home/user/project`).
|
|
2785
|
+
* @param options - `{ recursive?: boolean, mode?: number }`. Defaults: recursive=true, mode=0o755.
|
|
2786
|
+
*/
|
|
2787
|
+
mkdir(path: string, options?: MkdirParams): Promise<void>;
|
|
2788
|
+
/**
|
|
2789
|
+
* Rename (move) a path inside the computer.
|
|
2790
|
+
*
|
|
2791
|
+
* Creates the destination parent directory if it does not exist.
|
|
2792
|
+
*/
|
|
2793
|
+
rename(from: string, to: string): Promise<void>;
|
|
2794
|
+
/**
|
|
2795
|
+
* Copy a file or directory inside the computer.
|
|
2796
|
+
*
|
|
2797
|
+
* @param from - Source absolute path.
|
|
2798
|
+
* @param to - Destination absolute path.
|
|
2799
|
+
* @param options - `{ recursive?: boolean }`. Required when source is a directory.
|
|
2800
|
+
*/
|
|
2801
|
+
copy(from: string, to: string, options?: CopyParams): Promise<void>;
|
|
2802
|
+
/**
|
|
2803
|
+
* Change permissions on a path inside the computer.
|
|
2804
|
+
*
|
|
2805
|
+
* @param path - Absolute path inside the VM.
|
|
2806
|
+
* @param mode - Unix mode bits as an octal integer (e.g. `0o755`) or string (`"0755"`).
|
|
2807
|
+
*/
|
|
2808
|
+
chmod(path: string, mode: number | string): Promise<void>;
|
|
2809
|
+
/**
|
|
2810
|
+
* Return a rich directory listing for the given path.
|
|
2811
|
+
*
|
|
2812
|
+
* Each entry includes `{name, is_dir, is_symlink, size, modified_at}`.
|
|
2813
|
+
* Richer than `list()` which uses `find` under the hood.
|
|
2814
|
+
*
|
|
2815
|
+
* @param path - Absolute path to list.
|
|
2816
|
+
* @param _withTypes - Kept for API symmetry; types are always returned.
|
|
2817
|
+
*/
|
|
2818
|
+
readdir(path: string, _withTypes?: boolean): Promise<DirEntry[]>;
|
|
2819
|
+
/**
|
|
2820
|
+
* Write a UTF-8 string to a file inside the computer.
|
|
2821
|
+
* Convenience wrapper around `upload()`.
|
|
2822
|
+
*/
|
|
2823
|
+
writeFile(path: string, content: string): Promise<void>;
|
|
2824
|
+
/**
|
|
2825
|
+
* Read a file from the computer and return its contents as a UTF-8 string.
|
|
2826
|
+
*/
|
|
2827
|
+
readFile(path: string): Promise<string>;
|
|
2828
|
+
}
|
|
2829
|
+
|
|
2830
|
+
/**
|
|
2831
|
+
* Manage egress network policy for a computer.
|
|
2832
|
+
*
|
|
2833
|
+
* A policy is a list of rules evaluated top-to-bottom, with a `default_effect`
|
|
2834
|
+
* applied when no rule matches.
|
|
2835
|
+
*
|
|
2836
|
+
* Example — block IMDS and allow everything else:
|
|
2837
|
+
* ```ts
|
|
2838
|
+
* await computer.networkPolicy.set({
|
|
2839
|
+
* default_effect: "allow",
|
|
2840
|
+
* rules: [
|
|
2841
|
+
* { effect: "deny", destination: "169.254.169.254/32" },
|
|
2842
|
+
* { effect: "deny", destination: "metadata.google.internal" },
|
|
2843
|
+
* ],
|
|
2844
|
+
* });
|
|
2845
|
+
* ```
|
|
2846
|
+
*
|
|
2847
|
+
* Example — allowlist mode (deny all by default, allow only example.com):
|
|
2848
|
+
* ```ts
|
|
2849
|
+
* await computer.networkPolicy.set({
|
|
2850
|
+
* default_effect: "deny",
|
|
2851
|
+
* rules: [
|
|
2852
|
+
* { effect: "allow", destination: "example.com", ports: "443", protocol: "tcp" },
|
|
2853
|
+
* ],
|
|
2854
|
+
* });
|
|
2855
|
+
* ```
|
|
2856
|
+
*/
|
|
2857
|
+
declare class NetworkPolicy {
|
|
2858
|
+
private readonly http;
|
|
2859
|
+
private readonly computerId;
|
|
2860
|
+
constructor(http: HttpClient, computerId: string);
|
|
2861
|
+
/**
|
|
2862
|
+
* Get the current network policy.
|
|
2863
|
+
* Returns an empty allow-all policy if none is set.
|
|
2864
|
+
*/
|
|
2865
|
+
get(): Promise<NetworkPolicyData>;
|
|
2866
|
+
/**
|
|
2867
|
+
* Set (create or replace) the network policy.
|
|
2868
|
+
* Triggers immediate nftables update on the host — running VMs pick up
|
|
2869
|
+
* the new rules without a restart.
|
|
2870
|
+
*/
|
|
2871
|
+
set(params: NetworkPolicySetParams): Promise<NetworkPolicyData>;
|
|
2872
|
+
/**
|
|
2873
|
+
* Reset to the default policy (allow all egress).
|
|
2874
|
+
* Idempotent — safe to call even if no policy was set.
|
|
2875
|
+
*/
|
|
2876
|
+
reset(): Promise<void>;
|
|
2877
|
+
}
|
|
2878
|
+
|
|
2879
|
+
type AgentRunTargetKind = "sandbox" | "computer";
|
|
2880
|
+
type AgentRunStatus = "running" | "succeeded" | "failed" | "canceled";
|
|
2881
|
+
interface AgentRun {
|
|
2882
|
+
id: string;
|
|
2883
|
+
agent_run_group_id?: string;
|
|
2884
|
+
parent_agent_run_id?: string;
|
|
2885
|
+
orchestration_role?: string;
|
|
2886
|
+
external_workspace_id?: string | null;
|
|
2887
|
+
external_user_id?: string | null;
|
|
2888
|
+
external_project_id?: string | null;
|
|
2889
|
+
target_kind: AgentRunTargetKind;
|
|
2890
|
+
target_id: string;
|
|
2891
|
+
provider: string;
|
|
2892
|
+
prompt: string;
|
|
2893
|
+
status: AgentRunStatus;
|
|
2894
|
+
output?: string;
|
|
2895
|
+
stderr?: string;
|
|
2896
|
+
exit_code?: number;
|
|
2897
|
+
metadata?: Record<string, unknown>;
|
|
2898
|
+
started_at?: string;
|
|
2899
|
+
finished_at?: string;
|
|
2900
|
+
created_at?: string;
|
|
2901
|
+
updated_at?: string;
|
|
2902
|
+
[key: string]: unknown;
|
|
2903
|
+
}
|
|
2904
|
+
interface AgentRunArtifact {
|
|
2905
|
+
id: string;
|
|
2906
|
+
agent_run_id?: string;
|
|
2907
|
+
target_kind?: AgentRunTargetKind;
|
|
2908
|
+
target_id?: string;
|
|
2909
|
+
path: string;
|
|
2910
|
+
kind?: string;
|
|
2911
|
+
mime_type?: string;
|
|
2912
|
+
size_bytes?: number;
|
|
2913
|
+
sha256?: string;
|
|
2914
|
+
status?: string;
|
|
2915
|
+
persisted?: boolean;
|
|
2916
|
+
storage_backend?: string | null;
|
|
2917
|
+
persisted_at?: string | null;
|
|
2918
|
+
created_at?: string;
|
|
2919
|
+
updated_at?: string;
|
|
2920
|
+
[key: string]: unknown;
|
|
2921
|
+
}
|
|
2922
|
+
interface AgentRunEvent {
|
|
2923
|
+
id: string;
|
|
2924
|
+
agent_run_id?: string;
|
|
2925
|
+
sequence?: number;
|
|
2926
|
+
type: string;
|
|
2927
|
+
message?: string | null;
|
|
2928
|
+
payload?: Record<string, unknown>;
|
|
2929
|
+
created_at?: string | null;
|
|
2930
|
+
[key: string]: unknown;
|
|
2931
|
+
}
|
|
2932
|
+
interface AgentRunExecutionPacket {
|
|
2933
|
+
goal?: string;
|
|
2934
|
+
context?: Record<string, unknown>;
|
|
2935
|
+
plan?: unknown;
|
|
2936
|
+
constraints?: unknown;
|
|
2937
|
+
acceptance_criteria?: unknown;
|
|
2938
|
+
[key: string]: unknown;
|
|
2939
|
+
}
|
|
2940
|
+
interface AgentRunOutputContract {
|
|
2941
|
+
artifacts?: Array<string | Partial<AgentRunArtifact>>;
|
|
2942
|
+
artifact_paths?: string[];
|
|
2943
|
+
preview_port?: number;
|
|
2944
|
+
required_files?: string[];
|
|
2945
|
+
[key: string]: unknown;
|
|
2946
|
+
}
|
|
2947
|
+
interface AgentRunApprovalPolicy {
|
|
2948
|
+
publish?: "manual" | "automatic" | string;
|
|
2949
|
+
external_write?: "manual" | "automatic" | string;
|
|
2950
|
+
destructive_actions?: "forbidden" | "manual" | "automatic" | string;
|
|
2951
|
+
[key: string]: unknown;
|
|
2952
|
+
}
|
|
2953
|
+
interface AgentRunCreateParams {
|
|
2954
|
+
prompt: string;
|
|
2955
|
+
targetKind?: AgentRunTargetKind;
|
|
2956
|
+
targetId?: string;
|
|
2957
|
+
sandboxId?: string;
|
|
2958
|
+
/** Shortcut for a computer-backed Agent Run. */
|
|
2959
|
+
computerId?: string;
|
|
2960
|
+
provider?: string;
|
|
2961
|
+
model?: string;
|
|
2962
|
+
command?: string;
|
|
2963
|
+
runtimeCommand?: string;
|
|
2964
|
+
cwd?: string;
|
|
2965
|
+
timeout?: number;
|
|
2966
|
+
wait?: boolean;
|
|
2967
|
+
env?: Record<string, string>;
|
|
2968
|
+
/** Claude Code: `--output-format`, e.g. "json" or "stream-json". */
|
|
2969
|
+
outputFormat?: "text" | "json" | "stream-json" | string;
|
|
2970
|
+
output_format?: "text" | "json" | "stream-json" | string;
|
|
2971
|
+
/** Claude Code: `--resume <session_id>`. */
|
|
2972
|
+
resumeSessionId?: string;
|
|
2973
|
+
resume_session_id?: string;
|
|
2974
|
+
/** Codex: pass `--json` for JSONL event output. */
|
|
2975
|
+
json?: boolean;
|
|
2976
|
+
/** Codex: path to a JSON Schema file inside the runtime. */
|
|
2977
|
+
outputSchema?: string;
|
|
2978
|
+
output_schema?: string;
|
|
2979
|
+
/** Codex: path to an image file inside the runtime. */
|
|
2980
|
+
image?: string;
|
|
2981
|
+
agentRuntimeProfileId?: string;
|
|
2982
|
+
agentProfileId?: string;
|
|
2983
|
+
agentRunGroupId?: string;
|
|
2984
|
+
parentAgentRunId?: string;
|
|
2985
|
+
orchestrationRole?: string;
|
|
2986
|
+
externalWorkspaceId?: string;
|
|
2987
|
+
external_workspace_id?: string;
|
|
2988
|
+
externalUserId?: string;
|
|
2989
|
+
external_user_id?: string;
|
|
2990
|
+
externalProjectId?: string;
|
|
2991
|
+
external_project_id?: string;
|
|
2992
|
+
skipAgentRuntimeProfile?: boolean;
|
|
2993
|
+
executionPacket?: AgentRunExecutionPacket;
|
|
2994
|
+
outputContract?: AgentRunOutputContract;
|
|
2995
|
+
approvalPolicy?: AgentRunApprovalPolicy;
|
|
2996
|
+
capabilityRequirements?: string[];
|
|
2997
|
+
metadata?: Record<string, unknown>;
|
|
2998
|
+
}
|
|
2999
|
+
interface AgentRunListParams {
|
|
3000
|
+
targetKind?: AgentRunTargetKind;
|
|
3001
|
+
targetId?: string;
|
|
3002
|
+
sandboxId?: string;
|
|
3003
|
+
computerId?: string;
|
|
3004
|
+
agentRunGroupId?: string;
|
|
3005
|
+
externalWorkspaceId?: string;
|
|
3006
|
+
external_workspace_id?: string;
|
|
3007
|
+
externalUserId?: string;
|
|
3008
|
+
external_user_id?: string;
|
|
3009
|
+
externalProjectId?: string;
|
|
3010
|
+
external_project_id?: string;
|
|
3011
|
+
status?: AgentRunStatus | string;
|
|
3012
|
+
}
|
|
3013
|
+
interface AgentRunWaitOptions {
|
|
3014
|
+
timeoutMs?: number;
|
|
3015
|
+
pollIntervalMs?: number;
|
|
3016
|
+
terminalStatuses?: string[];
|
|
3017
|
+
}
|
|
3018
|
+
declare class AgentRuns {
|
|
3019
|
+
private readonly http;
|
|
3020
|
+
constructor(http: HttpClient);
|
|
3021
|
+
list(params?: AgentRunListParams): Promise<AgentRun[]>;
|
|
3022
|
+
get(id: string): Promise<AgentRun>;
|
|
3023
|
+
artifacts(id: string): Promise<AgentRunArtifact[]>;
|
|
3024
|
+
downloadArtifact(id: string, artifactId: string, options?: {
|
|
3025
|
+
inline?: boolean;
|
|
3026
|
+
}): Promise<Uint8Array>;
|
|
3027
|
+
events(id: string): Promise<AgentRunEvent[]>;
|
|
3028
|
+
streamEvents(id: string): AsyncIterableIterator<AgentRunEvent>;
|
|
3029
|
+
waitForCompletion(id: string, options?: AgentRunWaitOptions): Promise<AgentRun>;
|
|
3030
|
+
run(params: AgentRunCreateParams): Promise<AgentRun>;
|
|
3031
|
+
cancel(id: string): Promise<AgentRun>;
|
|
3032
|
+
}
|
|
3033
|
+
|
|
3034
|
+
type RunTargetKind = "sandbox" | "computer";
|
|
3035
|
+
type RunStatus = "running" | "succeeded" | "failed" | "canceled";
|
|
3036
|
+
interface Run {
|
|
3037
|
+
id: string;
|
|
3038
|
+
agent_definition_id?: string | null;
|
|
3039
|
+
agent_version_id?: string | null;
|
|
3040
|
+
configuration_receipt?: Record<string, unknown> | null;
|
|
3041
|
+
run_group_id?: string;
|
|
3042
|
+
parent_run_id?: string;
|
|
3043
|
+
orchestration_role?: string;
|
|
3044
|
+
external_workspace_id?: string | null;
|
|
3045
|
+
external_user_id?: string | null;
|
|
3046
|
+
external_project_id?: string | null;
|
|
3047
|
+
target_kind: RunTargetKind;
|
|
3048
|
+
target_id: string;
|
|
3049
|
+
runner: string;
|
|
3050
|
+
provider?: string | null;
|
|
3051
|
+
model?: string | null;
|
|
3052
|
+
instruction: string;
|
|
3053
|
+
status: RunStatus;
|
|
3054
|
+
metadata?: Record<string, unknown>;
|
|
3055
|
+
/** MIOSA's conversation id; every run of a chat shares it. */
|
|
3056
|
+
chat_id?: string | null;
|
|
3057
|
+
/** The harness's own session id (Claude Code `session_id`, Codex `thread_id`, OSA session id). */
|
|
3058
|
+
harness_session_id?: string | null;
|
|
3059
|
+
continued_from_run_id?: string | null;
|
|
3060
|
+
/** `new`, `resumed` or `reseeded`; `null` for runs that are not harness runs. */
|
|
3061
|
+
session_mode?: RunSessionMode | null;
|
|
3062
|
+
/** True when the harness ran with its approval bypass. */
|
|
3063
|
+
overdrive?: boolean | null;
|
|
3064
|
+
/** The user's own provider spend for this run; `null` while running or when no usage was reported. */
|
|
3065
|
+
provider_cost?: RunProviderCost | null;
|
|
3066
|
+
/** Context-window use of this run (one run is one chat turn). */
|
|
3067
|
+
context?: RunContext | null;
|
|
3068
|
+
started_at?: string;
|
|
3069
|
+
finished_at?: string;
|
|
3070
|
+
created_at?: string;
|
|
3071
|
+
updated_at?: string;
|
|
3072
|
+
[key: string]: unknown;
|
|
3073
|
+
}
|
|
3074
|
+
type RunSessionMode = "new" | "resumed" | "reseeded";
|
|
3075
|
+
interface RunProviderCost {
|
|
3076
|
+
input_tokens: number;
|
|
3077
|
+
output_tokens: number;
|
|
3078
|
+
cache_read_tokens: number;
|
|
3079
|
+
cache_write_tokens: number;
|
|
3080
|
+
/** `null` for a subscription login and for a model the catalog has no price for. */
|
|
3081
|
+
estimated_usd: number | null;
|
|
3082
|
+
/** `harness`: the harness reported the cost. `catalog`: tokens times the catalog price. */
|
|
3083
|
+
source: "harness" | "catalog";
|
|
3084
|
+
model: string;
|
|
3085
|
+
billed_to: "own_key" | "subscription";
|
|
3086
|
+
}
|
|
3087
|
+
interface RunContext {
|
|
3088
|
+
context_tokens: number | null;
|
|
3089
|
+
context_window: number | null;
|
|
3090
|
+
used_ratio: number | null;
|
|
3091
|
+
compactions: number | null;
|
|
3092
|
+
compacted: boolean;
|
|
3093
|
+
window_mode: "1m" | "standard" | null;
|
|
3094
|
+
compaction_events: Array<{
|
|
3095
|
+
before_tokens: number | null;
|
|
3096
|
+
after_tokens: number | null;
|
|
3097
|
+
}>;
|
|
3098
|
+
}
|
|
3099
|
+
interface RunFile {
|
|
3100
|
+
id: string;
|
|
3101
|
+
run_id?: string;
|
|
3102
|
+
target_kind?: RunTargetKind;
|
|
3103
|
+
target_id?: string;
|
|
3104
|
+
path: string;
|
|
3105
|
+
kind?: string;
|
|
3106
|
+
mime_type?: string;
|
|
3107
|
+
size_bytes?: number;
|
|
3108
|
+
sha256?: string;
|
|
3109
|
+
status?: string;
|
|
3110
|
+
persisted?: boolean;
|
|
3111
|
+
storage_backend?: string | null;
|
|
3112
|
+
persisted_at?: string | null;
|
|
3113
|
+
created_at?: string;
|
|
3114
|
+
updated_at?: string;
|
|
3115
|
+
[key: string]: unknown;
|
|
3116
|
+
name?: string | null;
|
|
3117
|
+
download_url?: string | null;
|
|
3118
|
+
signed_download_url?: string | null;
|
|
3119
|
+
}
|
|
3120
|
+
interface RunMessage {
|
|
3121
|
+
id?: string;
|
|
3122
|
+
role?: string;
|
|
3123
|
+
type?: string;
|
|
3124
|
+
text?: string;
|
|
3125
|
+
content?: string;
|
|
3126
|
+
created_at?: string | null;
|
|
3127
|
+
[key: string]: unknown;
|
|
3128
|
+
}
|
|
3129
|
+
interface RunCommandOutput {
|
|
3130
|
+
stdout?: string | null;
|
|
3131
|
+
stderr?: string | null;
|
|
3132
|
+
exit_code?: number | null;
|
|
3133
|
+
}
|
|
3134
|
+
interface RunDownload {
|
|
3135
|
+
id?: string;
|
|
3136
|
+
file_id: string;
|
|
3137
|
+
name?: string | null;
|
|
3138
|
+
path?: string;
|
|
3139
|
+
url: string;
|
|
3140
|
+
mime_type?: string | null;
|
|
3141
|
+
size_bytes?: number | null;
|
|
3142
|
+
status?: string;
|
|
3143
|
+
[key: string]: unknown;
|
|
3144
|
+
}
|
|
3145
|
+
interface RunPreview {
|
|
3146
|
+
id: string;
|
|
3147
|
+
run_id?: string;
|
|
3148
|
+
file_id?: string;
|
|
3149
|
+
type: string;
|
|
3150
|
+
title?: string | null;
|
|
3151
|
+
path?: string | null;
|
|
3152
|
+
url?: string | null;
|
|
3153
|
+
mime_type?: string | null;
|
|
3154
|
+
status?: string;
|
|
3155
|
+
metadata?: Record<string, unknown>;
|
|
3156
|
+
[key: string]: unknown;
|
|
3157
|
+
}
|
|
3158
|
+
interface RunDiagnostic {
|
|
3159
|
+
id: string;
|
|
3160
|
+
run_id?: string;
|
|
3161
|
+
code: string;
|
|
3162
|
+
message?: string | null;
|
|
3163
|
+
retryable?: boolean;
|
|
3164
|
+
[key: string]: unknown;
|
|
3165
|
+
}
|
|
3166
|
+
interface RunOutputs {
|
|
3167
|
+
run_id: string;
|
|
3168
|
+
task_run_id?: string;
|
|
3169
|
+
status: RunStatus;
|
|
3170
|
+
result?: Record<string, unknown> | null;
|
|
3171
|
+
message?: string | null;
|
|
3172
|
+
messages: RunMessage[];
|
|
3173
|
+
command_output: RunCommandOutput;
|
|
3174
|
+
activity: RunActivity[];
|
|
3175
|
+
files: RunFile[];
|
|
3176
|
+
downloads: RunDownload[];
|
|
3177
|
+
previews: RunPreview[];
|
|
3178
|
+
diagnostics: RunDiagnostic[];
|
|
3179
|
+
[key: string]: unknown;
|
|
3180
|
+
}
|
|
3181
|
+
interface RunActivity {
|
|
3182
|
+
id: string;
|
|
3183
|
+
run_id?: string;
|
|
3184
|
+
sequence?: number;
|
|
3185
|
+
type: string;
|
|
3186
|
+
message?: string | null;
|
|
3187
|
+
payload?: Record<string, unknown>;
|
|
3188
|
+
created_at?: string | null;
|
|
3189
|
+
[key: string]: unknown;
|
|
3190
|
+
}
|
|
3191
|
+
interface RunExecutionPacket {
|
|
3192
|
+
goal?: string;
|
|
3193
|
+
context?: Record<string, unknown>;
|
|
3194
|
+
plan?: unknown;
|
|
3195
|
+
constraints?: unknown;
|
|
3196
|
+
acceptance_criteria?: unknown;
|
|
3197
|
+
[key: string]: unknown;
|
|
3198
|
+
}
|
|
3199
|
+
interface RunExpectedFile {
|
|
3200
|
+
path: string;
|
|
3201
|
+
name?: string;
|
|
3202
|
+
kind?: string;
|
|
3203
|
+
mime_type?: string;
|
|
3204
|
+
preview?: boolean;
|
|
3205
|
+
[key: string]: unknown;
|
|
3206
|
+
}
|
|
3207
|
+
interface RunExpectedOutputs {
|
|
3208
|
+
messages?: boolean;
|
|
3209
|
+
files?: Array<string | RunExpectedFile>;
|
|
3210
|
+
previews?: boolean | unknown[];
|
|
3211
|
+
[key: string]: unknown;
|
|
3212
|
+
}
|
|
3213
|
+
interface RunApprovalPolicy {
|
|
3214
|
+
publish?: "manual" | "automatic" | string;
|
|
3215
|
+
external_write?: "manual" | "automatic" | string;
|
|
3216
|
+
destructive_actions?: "forbidden" | "manual" | "automatic" | string;
|
|
3217
|
+
[key: string]: unknown;
|
|
3218
|
+
}
|
|
3219
|
+
interface RunCreateParams {
|
|
3220
|
+
instruction?: string;
|
|
3221
|
+
targetKind?: RunTargetKind;
|
|
3222
|
+
targetId?: string;
|
|
3223
|
+
runtimeId?: string;
|
|
3224
|
+
sandboxId?: string;
|
|
3225
|
+
/** Shortcut for a computer-backed run. */
|
|
3226
|
+
computerId?: string;
|
|
3227
|
+
/** Optional model/vendor configuration, not the runner selector. */
|
|
3228
|
+
provider?: string;
|
|
3229
|
+
runner?: string;
|
|
3230
|
+
model?: string;
|
|
3231
|
+
command?: string;
|
|
3232
|
+
runtimeCommand?: string;
|
|
3233
|
+
cwd?: string;
|
|
3234
|
+
timeout?: number;
|
|
3235
|
+
wait?: boolean;
|
|
3236
|
+
env?: Record<string, string>;
|
|
3237
|
+
agentRuntimeProfileId?: string;
|
|
3238
|
+
agentProfileId?: string;
|
|
3239
|
+
agentDefinitionId?: string;
|
|
3240
|
+
agentVersionId?: string;
|
|
3241
|
+
configurationReceipt?: Record<string, unknown>;
|
|
3242
|
+
runGroupId?: string;
|
|
3243
|
+
parentRunId?: string;
|
|
3244
|
+
orchestrationRole?: string;
|
|
3245
|
+
externalWorkspaceId?: string;
|
|
3246
|
+
external_workspace_id?: string;
|
|
3247
|
+
externalUserId?: string;
|
|
3248
|
+
external_user_id?: string;
|
|
3249
|
+
externalProjectId?: string;
|
|
3250
|
+
external_project_id?: string;
|
|
3251
|
+
skipRuntimeProfile?: boolean;
|
|
3252
|
+
executionPacket?: RunExecutionPacket;
|
|
3253
|
+
expectedOutputs?: RunExpectedOutputs;
|
|
3254
|
+
approvalPolicy?: RunApprovalPolicy;
|
|
3255
|
+
capabilityRequirements?: string[];
|
|
3256
|
+
metadata?: Record<string, unknown>;
|
|
3257
|
+
/**
|
|
3258
|
+
* The chat this run belongs to: 1 to 128 characters, `^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$`.
|
|
3259
|
+
* Generate one (a UUID) when a chat starts and send it with every run. Sending
|
|
3260
|
+
* `chat_id` alone continues the chat's single harness session.
|
|
3261
|
+
*/
|
|
3262
|
+
chatId?: string;
|
|
3263
|
+
/** Resume a specific earlier run's session. Optional once `chatId` is sent. */
|
|
3264
|
+
continueFromRunId?: string;
|
|
3265
|
+
/** One of `max xhigh high medium low minimal none`, and one the model takes. */
|
|
3266
|
+
reasoningEffort?: string;
|
|
3267
|
+
/** Environment to pin the run's machine to (when the run starts its own machine). */
|
|
3268
|
+
environment?: string;
|
|
3269
|
+
environmentId?: string;
|
|
3270
|
+
noEnv?: boolean;
|
|
3271
|
+
}
|
|
3272
|
+
interface RunListParams {
|
|
3273
|
+
targetKind?: RunTargetKind;
|
|
3274
|
+
targetId?: string;
|
|
3275
|
+
runtimeId?: string;
|
|
3276
|
+
sandboxId?: string;
|
|
3277
|
+
computerId?: string;
|
|
3278
|
+
runGroupId?: string;
|
|
3279
|
+
externalWorkspaceId?: string;
|
|
3280
|
+
external_workspace_id?: string;
|
|
3281
|
+
externalUserId?: string;
|
|
3282
|
+
external_user_id?: string;
|
|
3283
|
+
externalProjectId?: string;
|
|
3284
|
+
external_project_id?: string;
|
|
3285
|
+
status?: RunStatus | string;
|
|
3286
|
+
agentDefinitionId?: string;
|
|
3287
|
+
agentVersionId?: string;
|
|
3288
|
+
/** `claude-code`, `codex`, `osa` or `custom` (maps to runner `gateway`). */
|
|
3289
|
+
harness?: string;
|
|
3290
|
+
harnessSessionId?: string;
|
|
3291
|
+
/** Load a chat's history: `{ chatId, limit: 200 }`. Newest first. */
|
|
3292
|
+
chatId?: string;
|
|
3293
|
+
limit?: number;
|
|
3294
|
+
}
|
|
3295
|
+
type RunUsageGroupBy = "agent" | "chat" | "workspace" | "day" | "model" | "harness";
|
|
3296
|
+
interface RunUsageParams {
|
|
3297
|
+
/** Any of `agent chat workspace day model harness`. Two or more group by every combination. */
|
|
3298
|
+
groupBy?: RunUsageGroupBy[];
|
|
3299
|
+
/** ISO 8601 datetime or date (a date is UTC midnight). Window is `[from, to)` on `finished_at`; default last 30 days, at most 366. */
|
|
3300
|
+
from?: string;
|
|
3301
|
+
to?: string;
|
|
3302
|
+
agentDefinitionId?: string;
|
|
3303
|
+
workspaceId?: string;
|
|
3304
|
+
chatId?: string;
|
|
3305
|
+
harness?: string;
|
|
3306
|
+
model?: string;
|
|
3307
|
+
billedTo?: "own_key" | "subscription";
|
|
3308
|
+
/** Groups returned, default 500, at most 2000. */
|
|
3309
|
+
limit?: number;
|
|
3310
|
+
}
|
|
3311
|
+
interface RunUsageCounters {
|
|
3312
|
+
runs: number;
|
|
3313
|
+
input_tokens: number;
|
|
3314
|
+
output_tokens: number;
|
|
3315
|
+
cache_read_tokens: number;
|
|
3316
|
+
cache_write_tokens: number;
|
|
3317
|
+
total_tokens: number;
|
|
3318
|
+
/** Sum over runs with a known price; 0.0 when there are none. */
|
|
3319
|
+
estimated_usd: number;
|
|
3320
|
+
priced_runs: number;
|
|
3321
|
+
subscription_runs: number;
|
|
3322
|
+
/** Own-key runs on a model the catalog does not price: show tokens, say the cost is unknown. */
|
|
3323
|
+
unpriced_runs: number;
|
|
3324
|
+
}
|
|
3325
|
+
interface RunUsageGroup extends RunUsageCounters {
|
|
3326
|
+
key: {
|
|
3327
|
+
agent_definition_id?: string | null;
|
|
3328
|
+
chat_id?: string | null;
|
|
3329
|
+
workspace_id?: string | null;
|
|
3330
|
+
day?: string | null;
|
|
3331
|
+
model?: string | null;
|
|
3332
|
+
harness?: string | null;
|
|
3333
|
+
};
|
|
3334
|
+
}
|
|
3335
|
+
interface RunUsage {
|
|
3336
|
+
from: string;
|
|
3337
|
+
to: string;
|
|
3338
|
+
group_by: string[];
|
|
3339
|
+
totals: RunUsageCounters;
|
|
3340
|
+
groups: RunUsageGroup[];
|
|
3341
|
+
/** True when `limit` groups came back and more may exist. */
|
|
3342
|
+
truncated: boolean;
|
|
3343
|
+
}
|
|
3344
|
+
interface RunWaitOptions {
|
|
3345
|
+
timeoutMs?: number;
|
|
3346
|
+
pollIntervalMs?: number;
|
|
3347
|
+
terminalStatuses?: string[];
|
|
3348
|
+
}
|
|
3349
|
+
declare class Runs {
|
|
3350
|
+
private readonly http;
|
|
3351
|
+
constructor(http: HttpClient);
|
|
3352
|
+
list(params?: RunListParams): Promise<Run[]>;
|
|
3353
|
+
get(id: string): Promise<Run>;
|
|
3354
|
+
/**
|
|
3355
|
+
* `GET /runs/usage`: the user's own provider spend over finished runs,
|
|
3356
|
+
* overall and grouped. Agents are bring-your-own-key: this is spend reported
|
|
3357
|
+
* for tracking, separate from the MIOSA credits a run used.
|
|
3358
|
+
*/
|
|
3359
|
+
usage(params?: RunUsageParams): Promise<RunUsage>;
|
|
3360
|
+
outputs(id: string): Promise<RunOutputs>;
|
|
3361
|
+
files(id: string): Promise<RunFile[]>;
|
|
3362
|
+
downloadFile(id: string, fileId: string, options?: {
|
|
3363
|
+
inline?: boolean;
|
|
3364
|
+
}): Promise<Uint8Array>;
|
|
3365
|
+
messages(id: string): Promise<RunMessage[]>;
|
|
3366
|
+
commandOutput(id: string): Promise<RunCommandOutput>;
|
|
3367
|
+
activity(id: string): Promise<RunActivity[]>;
|
|
3368
|
+
previews(id: string): Promise<RunPreview[]>;
|
|
3369
|
+
diagnostics(id: string): Promise<RunDiagnostic[]>;
|
|
3370
|
+
streamActivity(id: string): AsyncIterableIterator<RunActivity>;
|
|
3371
|
+
waitForCompletion(id: string, options?: RunWaitOptions): Promise<Run>;
|
|
3372
|
+
run(params: RunCreateParams): Promise<Run>;
|
|
3373
|
+
cancel(id: string): Promise<Run>;
|
|
3374
|
+
}
|
|
3375
|
+
|
|
3376
|
+
/**
|
|
3377
|
+
* Per-computer inbox config (GET/PATCH /computers/:id/inbox).
|
|
3378
|
+
* Defined inline because it has no separate file (small surface).
|
|
3379
|
+
*/
|
|
3380
|
+
declare class ComputerInbox {
|
|
3381
|
+
private readonly http;
|
|
3382
|
+
private readonly computerId;
|
|
3383
|
+
constructor(http: HttpClient, computerId: string);
|
|
3384
|
+
get(): Promise<Record<string, unknown>>;
|
|
3385
|
+
update(fields: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
3386
|
+
}
|
|
3387
|
+
type ComputerRunOptions = Omit<RunCreateParams, "instruction" | "targetKind" | "targetId" | "sandboxId" | "computerId">;
|
|
3388
|
+
type ComputerPromptOptions = Omit<AgentRunCreateParams, "prompt" | "targetKind" | "targetId" | "sandboxId" | "computerId">;
|
|
3389
|
+
/**
|
|
3390
|
+
* A Computer instance bound to a specific computer ID.
|
|
3391
|
+
*
|
|
3392
|
+
* Returned by `miosa.computers.create()`, `miosa.computers.get()`, and
|
|
3393
|
+
* `miosa.computers.list()`. Exposes all per-computer actions as methods and
|
|
3394
|
+
* sub-resources as properties.
|
|
3395
|
+
*/
|
|
3396
|
+
declare class Computer {
|
|
3397
|
+
/** Raw data from the API. Refresh with `await computer.reload()`. */
|
|
3398
|
+
data: ComputerData;
|
|
3399
|
+
/** Desktop control — screenshot, click, type, drag, etc. */
|
|
3400
|
+
readonly desktop: Desktop;
|
|
3401
|
+
/** Execute shell and Python commands. */
|
|
3402
|
+
readonly exec: Exec;
|
|
3403
|
+
/** File operations — upload, download, list, delete. */
|
|
3404
|
+
readonly files: Files;
|
|
3405
|
+
/** Firecracker checkpoint (snapshot) management. */
|
|
3406
|
+
readonly checkpoints: Checkpoints;
|
|
3407
|
+
/** Egress network policy — allow/deny rules applied at the host TAP level. */
|
|
3408
|
+
readonly networkPolicy: NetworkPolicy;
|
|
3409
|
+
/** Real-time event subscription (window, clipboard, file, process, idle). */
|
|
3410
|
+
readonly events: Events;
|
|
3411
|
+
/** Custom domain management — map your own FQDNs to this sandbox. */
|
|
3412
|
+
readonly domains: CustomDomains;
|
|
3413
|
+
/** PTY session management — create/resize. */
|
|
3414
|
+
readonly terminal: ComputerTerminal;
|
|
3415
|
+
/** In-VM OSA agent dispatch — submitTask, cancelTask, status, configure. */
|
|
3416
|
+
readonly osa: ComputerOsa;
|
|
3417
|
+
/** Idle auto-stop config — get/update. */
|
|
3418
|
+
readonly autoStop: ComputerAutoStop;
|
|
3419
|
+
/** Per-computer inbox config — get/update. */
|
|
3420
|
+
readonly inbox: ComputerInbox;
|
|
3421
|
+
/** Encrypted env var CRUD — list, set, update, delete, bulkSet. */
|
|
3422
|
+
readonly env: ComputerEnv;
|
|
3423
|
+
/** VM log read + SSE stream. */
|
|
3424
|
+
readonly logs: ComputerLogs;
|
|
3425
|
+
/** Per-port visibility control — list, get, create, update, delete. */
|
|
3426
|
+
readonly ports: ComputerPorts;
|
|
3427
|
+
/** Volume attachment — list, attach, detach. */
|
|
3428
|
+
readonly volumes: ComputerVolumes;
|
|
3429
|
+
/** MIOSA Connect provider bindings scoped to this computer. */
|
|
3430
|
+
readonly connectors: ComputerConnectors;
|
|
3431
|
+
/** Encrypted secrets + OAuth credentials scoped to this computer. */
|
|
3432
|
+
readonly secrets: ComputerSecrets;
|
|
3433
|
+
/** Egress allowlist + policies scoped to this computer. */
|
|
3434
|
+
readonly network: ComputerNetwork;
|
|
3435
|
+
/** Egress audit log + live tail scoped to this computer. */
|
|
3436
|
+
readonly audit: ComputerAudit;
|
|
3437
|
+
/** Steer the agent run attached to this computer (queue a prompt, stop it). */
|
|
3438
|
+
readonly agent: MachineAgent;
|
|
3439
|
+
/** Share this computer with a person or through a link. */
|
|
3440
|
+
readonly shares: ComputerShares;
|
|
3441
|
+
private readonly http;
|
|
3442
|
+
constructor(http: HttpClient, data: ComputerData);
|
|
3443
|
+
get id(): ComputerId;
|
|
3444
|
+
get name(): string;
|
|
3445
|
+
get status(): ComputerData["status"];
|
|
3446
|
+
/** URL-safe slug; falls back to the raw id when unset. */
|
|
3447
|
+
get slug(): string;
|
|
3448
|
+
/**
|
|
3449
|
+
* Public HTTPS URL that forwards to a given port inside the VM.
|
|
3450
|
+
*
|
|
3451
|
+
* Example — expose a dev server running on port 3000:
|
|
3452
|
+
* ```ts
|
|
3453
|
+
* await computer.exec.bash("npm run dev &");
|
|
3454
|
+
* const url = computer.previewUrl(3000);
|
|
3455
|
+
* // => https://3000-<slug>.sandbox.<tenant-domain>
|
|
3456
|
+
* ```
|
|
3457
|
+
*
|
|
3458
|
+
* Works for any TCP HTTP listener. Public (no auth required); anyone with
|
|
3459
|
+
* the URL can see it. Served over the ingress proxy so it inherits the
|
|
3460
|
+
* tenant's white-label preview domain — no per-sandbox certs to manage.
|
|
3461
|
+
*/
|
|
3462
|
+
previewUrl(port: number, path?: string): string;
|
|
3463
|
+
/** Root preview URL — serves whatever is on the default app port. */
|
|
3464
|
+
get publicUrl(): string;
|
|
3465
|
+
/** Tenant's preview/base domain, white-label aware. */
|
|
3466
|
+
get previewDomain(): string;
|
|
3467
|
+
/**
|
|
3468
|
+
* Start the computer. Pass `environment`/`environmentId`/`noEnv` to pin a
|
|
3469
|
+
* different environment; with none named the machine keeps its current pin.
|
|
3470
|
+
*/
|
|
3471
|
+
start(options?: EnvironmentSelectionParams & {
|
|
3472
|
+
env?: Record<string, string>;
|
|
3473
|
+
}): Promise<Computer>;
|
|
3474
|
+
/**
|
|
3475
|
+
* `POST /computers/:id/commands`: run a command synchronously (capped at 600
|
|
3476
|
+
* seconds). A computer that is not ready answers a retryable
|
|
3477
|
+
* `ComputerStartingError`, which the client retries using the server's hint.
|
|
3478
|
+
*/
|
|
3479
|
+
runCommand(command: string, options?: MachineCommandOptions): Promise<MachineCommandResult>;
|
|
3480
|
+
/** Setup progress (`setup_status`, per-step status) from the machine JSON, refreshed. */
|
|
3481
|
+
setupStatus(): Promise<MachineSetupFields>;
|
|
3482
|
+
/** Wait until setup is final: `done`, `failed`, or `null` when there is no setup. */
|
|
3483
|
+
waitForSetup(options?: {
|
|
3484
|
+
timeoutMs?: number;
|
|
3485
|
+
pollMs?: number;
|
|
3486
|
+
}): Promise<MachineSetupFields>;
|
|
3487
|
+
/** Stop the computer. */
|
|
3488
|
+
stop(): Promise<Computer>;
|
|
3489
|
+
/** Restart the computer. */
|
|
3490
|
+
restart(): Promise<Computer>;
|
|
3491
|
+
/** Permanently destroy the computer. After this call the instance is invalid. */
|
|
3492
|
+
destroy(): Promise<void>;
|
|
3493
|
+
/** Reload metadata from the API and update `this.data`. */
|
|
3494
|
+
reload(): Promise<Computer>;
|
|
3495
|
+
/**
|
|
3496
|
+
* Run an AI agent inside this Computer.
|
|
3497
|
+
*
|
|
3498
|
+
* The Computer is the graphical desktop VM product. This dispatches the
|
|
3499
|
+
* same Runs API as `miosa agent run --computer`, scoped to this VM.
|
|
3500
|
+
*/
|
|
3501
|
+
run(instruction: string, options?: ComputerRunOptions): Promise<Run>;
|
|
3502
|
+
/**
|
|
3503
|
+
* Dispatch a prompt into this Computer through the Agent Runs API.
|
|
3504
|
+
*/
|
|
3505
|
+
prompt(prompt: string, options?: ComputerPromptOptions): Promise<AgentRun>;
|
|
3506
|
+
/**
|
|
3507
|
+
* Capture a desktop screenshot as PNG bytes.
|
|
3508
|
+
* Shortcut for `computer.desktop.screenshot()`.
|
|
3509
|
+
*/
|
|
3510
|
+
screenshot(): Promise<Uint8Array>;
|
|
3511
|
+
/**
|
|
3512
|
+
* Capture a desktop screenshot encoded as a base64 string.
|
|
3513
|
+
* Convenience for AI agents that pass screenshots to LLMs.
|
|
3514
|
+
*/
|
|
3515
|
+
screenshotBase64(): Promise<string>;
|
|
3516
|
+
/**
|
|
3517
|
+
* Click at the given coordinates (default left button).
|
|
3518
|
+
* Shortcut for `computer.desktop.click(x, y)`.
|
|
3519
|
+
*/
|
|
3520
|
+
click(x: number, y: number): Promise<void>;
|
|
3521
|
+
/** Explicit left-button click. Alias for `click(x, y)`. */
|
|
3522
|
+
leftClick(x: number, y: number): Promise<void>;
|
|
3523
|
+
/** Right-button click. */
|
|
3524
|
+
rightClick(x: number, y: number): Promise<void>;
|
|
3525
|
+
/** Double-click at the given coordinates. */
|
|
3526
|
+
doubleClick(x: number, y: number): Promise<void>;
|
|
3527
|
+
/** Middle-button click. */
|
|
3528
|
+
middleClick(x: number, y: number): Promise<void>;
|
|
3529
|
+
/** Move the pointer without clicking. */
|
|
3530
|
+
moveMouse(x: number, y: number): Promise<void>;
|
|
3531
|
+
/**
|
|
3532
|
+
* Type text into the focused element.
|
|
3533
|
+
* Shortcut for `computer.desktop.type(text)`.
|
|
3534
|
+
*/
|
|
3535
|
+
type(text: string): Promise<void>;
|
|
3536
|
+
/** Alias for `type(text)`. */
|
|
3537
|
+
write(text: string): Promise<void>;
|
|
3538
|
+
/**
|
|
3539
|
+
* Send a key or key combo.
|
|
3540
|
+
* Shortcut for `computer.desktop.key(key)`.
|
|
3541
|
+
*/
|
|
3542
|
+
key(key: string): Promise<void>;
|
|
3543
|
+
/** Alias for `key(key)`. */
|
|
3544
|
+
press(key: string): Promise<void>;
|
|
3545
|
+
/**
|
|
3546
|
+
* Scroll in a direction.
|
|
3547
|
+
* Shortcut for `computer.desktop.scroll(direction, clicks)`.
|
|
3548
|
+
*/
|
|
3549
|
+
scroll(direction: Parameters<Desktop["scroll"]>[0], clicks?: number): Promise<void>;
|
|
3550
|
+
/**
|
|
3551
|
+
* Click and drag between two points.
|
|
3552
|
+
* Shortcut for `computer.desktop.drag(fromX, fromY, toX, toY)`.
|
|
3553
|
+
*/
|
|
3554
|
+
drag(fromX: number, fromY: number, toX: number, toY: number): Promise<void>;
|
|
3555
|
+
/**
|
|
3556
|
+
* Wait for N seconds inside the desktop environment.
|
|
3557
|
+
* Shortcut for `computer.desktop.wait(seconds)`.
|
|
3558
|
+
*/
|
|
3559
|
+
wait(seconds: number): Promise<void>;
|
|
3560
|
+
/**
|
|
3561
|
+
* Run a shell command.
|
|
3562
|
+
* Shortcut for `computer.exec.bash(command)`.
|
|
3563
|
+
*/
|
|
3564
|
+
bash(command: string, timeout?: number): Promise<ExecResult>;
|
|
3565
|
+
/**
|
|
3566
|
+
* Run Python code.
|
|
3567
|
+
* Shortcut for `computer.exec.python(code)`.
|
|
3568
|
+
*/
|
|
3569
|
+
python(code: string, timeout?: number): Promise<ExecResult>;
|
|
3570
|
+
/** List open windows on the desktop. */
|
|
3571
|
+
windows(): Promise<Awaited<ReturnType<Desktop["windows"]>>>;
|
|
3572
|
+
/** Get the current cursor position. */
|
|
3573
|
+
cursor(): Promise<Awaited<ReturnType<Desktop["cursor"]>>>;
|
|
3574
|
+
/** Focus a specific window by ID. */
|
|
3575
|
+
focusWindow(windowId: string): Promise<void>;
|
|
3576
|
+
/** Launch an installed app inside the VM. */
|
|
3577
|
+
launch(appName: string): Promise<void>;
|
|
3578
|
+
/**
|
|
3579
|
+
* Return a `ScopedFs` bound to `workingDir`. All path arguments to
|
|
3580
|
+
* `readFile`, `writeFile`, and `readdir` are resolved relative to that
|
|
3581
|
+
* directory — no need to repeat the prefix on every call.
|
|
3582
|
+
*
|
|
3583
|
+
* ```ts
|
|
3584
|
+
* const fs = computer.fs("/workspace");
|
|
3585
|
+
* await fs.writeFile("main.py", "print(1)");
|
|
3586
|
+
* const src = await fs.readFile("main.py");
|
|
3587
|
+
* const entries = await fs.readdir(".");
|
|
3588
|
+
* ```
|
|
3589
|
+
*/
|
|
3590
|
+
fs(workingDir: string): ScopedFs;
|
|
3591
|
+
/** Get VNC credentials for this computer. */
|
|
3592
|
+
vncCredentials(): Promise<Record<string, unknown>>;
|
|
3593
|
+
/**
|
|
3594
|
+
* Return whether the external/raw desktop viewer password is set.
|
|
3595
|
+
*
|
|
3596
|
+
* Authenticated MIOSA platform users should use the platform desktop entry
|
|
3597
|
+
* URL and do not need this password. This is only for raw external viewer
|
|
3598
|
+
* links such as `*.computer.miosa.ai/desktop/index.html`.
|
|
3599
|
+
*/
|
|
3600
|
+
viewerPassword(): Promise<ComputerViewerPasswordStatus>;
|
|
3601
|
+
/**
|
|
3602
|
+
* Rotate the external/raw desktop viewer password and return the plaintext
|
|
3603
|
+
* one time. Store it if you need to share the raw viewer URL.
|
|
3604
|
+
*/
|
|
3605
|
+
rotateViewerPassword(): Promise<ComputerViewerPasswordRotation>;
|
|
3606
|
+
/** List installed apps inside the VM. */
|
|
3607
|
+
apps(): Promise<Record<string, unknown>>;
|
|
3608
|
+
/** Get URL map for this computer (VNC, preview, etc.). */
|
|
3609
|
+
urls(): Promise<Record<string, unknown>>;
|
|
3610
|
+
/** Mint a short-lived stream token for this computer. */
|
|
3611
|
+
streamToken(): Promise<Record<string, unknown>>;
|
|
3612
|
+
/**
|
|
3613
|
+
* Mint a passwordless browser embed URL for authenticated platform sessions.
|
|
3614
|
+
*
|
|
3615
|
+
* Use this inside MIOSA or tenant apps. Raw shared desktop URLs can still use
|
|
3616
|
+
* the viewer password flow when opened outside an authenticated platform.
|
|
3617
|
+
*/
|
|
3618
|
+
embed(options?: {
|
|
3619
|
+
ttlSeconds?: number;
|
|
3620
|
+
}): Promise<Record<string, unknown>>;
|
|
3621
|
+
/** A typed, expiring viewer link. See {@link ComputerViewer}. */
|
|
3622
|
+
viewerUrl(options?: ViewerOptions): Promise<ComputerViewer>;
|
|
3623
|
+
/**
|
|
3624
|
+
* Run one desktop action by name and get a typed result. The names are the
|
|
3625
|
+
* members of Anthropic's `computer_toolset_20260801`:
|
|
3626
|
+
*
|
|
3627
|
+
* ```ts
|
|
3628
|
+
* const shot = await computer.act("screenshot"); // imageBase64, width, height
|
|
3629
|
+
* const at = await computer.act("cursor_position"); // x, y
|
|
3630
|
+
* await computer.act("left_click", { coordinate: [512, 384] });
|
|
3631
|
+
* ```
|
|
3632
|
+
*/
|
|
3633
|
+
act<A extends ActionName>(action: A, ...args: ActArgs<A>): Promise<ActionResultMap[A]>;
|
|
3634
|
+
/** A screenshot and the accessibility tree in one call. */
|
|
3635
|
+
look(options?: LookOptions): Promise<LookResult>;
|
|
3636
|
+
/** Wait until the computer is `active` or `running`. */
|
|
3637
|
+
waitUntilReady(options?: WaitOptions): Promise<Computer>;
|
|
3638
|
+
/** Wait until the computer is ready and its desktop answers. */
|
|
3639
|
+
waitForDesktop(options?: WaitOptions): Promise<Computer>;
|
|
3640
|
+
/** Wait until the screen stops changing. */
|
|
3641
|
+
waitUntilIdle(options?: WaitIdleOptions): Promise<void>;
|
|
3642
|
+
/**
|
|
3643
|
+
* `await using computer = await miosa.computers.create(...)` destroys the
|
|
3644
|
+
* computer when the scope ends. A computer that is already gone is ignored.
|
|
3645
|
+
*/
|
|
3646
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
3647
|
+
/**
|
|
3648
|
+
* `DELETE /computers/:id/stream-tokens`: revoke every viewer stream token
|
|
3649
|
+
* minted for this computer (see {@link streamToken}).
|
|
3650
|
+
*/
|
|
3651
|
+
revokeStreamTokens(): Promise<void>;
|
|
3652
|
+
/** Clone this computer into a new one. */
|
|
3653
|
+
clone(opts?: Record<string, unknown>): Promise<Computer>;
|
|
3654
|
+
/** Resize the computer (change CPU/memory/disk). */
|
|
3655
|
+
resize(size: string): Promise<Computer>;
|
|
3656
|
+
/** Move the computer to a different region or host. */
|
|
3657
|
+
move(opts: Record<string, unknown>): Promise<Computer>;
|
|
3658
|
+
/** Capture a region of the desktop as PNG bytes. */
|
|
3659
|
+
screenshotRegion(x: number, y: number, width: number, height: number): Promise<Uint8Array>;
|
|
3660
|
+
/** Get time-series metrics (window: "1h" | "24h" | "7d"). */
|
|
3661
|
+
metrics(window?: string): Promise<Record<string, unknown>>;
|
|
3662
|
+
toJSON(): ComputerData;
|
|
3663
|
+
toString(): string;
|
|
3664
|
+
}
|
|
3665
|
+
/**
|
|
3666
|
+
* A thin filesystem wrapper that prepends a fixed working directory to all
|
|
3667
|
+
* path arguments, mirroring the Node.js `fs/promises` surface.
|
|
3668
|
+
*
|
|
3669
|
+
* Obtain via `computer.fs("/workspace")`.
|
|
3670
|
+
*/
|
|
3671
|
+
declare class ScopedFs {
|
|
3672
|
+
private readonly files;
|
|
3673
|
+
private readonly workingDir;
|
|
3674
|
+
constructor(files: Files, workingDir: string);
|
|
3675
|
+
/** Resolve a relative or absolute path against `workingDir`. */
|
|
3676
|
+
private resolve;
|
|
3677
|
+
/** Write a UTF-8 string to a file (relative or absolute path). */
|
|
3678
|
+
writeFile(path: string, content: string): Promise<void>;
|
|
3679
|
+
/** Read a file and return its UTF-8 contents (relative or absolute path). */
|
|
3680
|
+
readFile(path: string): Promise<string>;
|
|
3681
|
+
/** List a directory (relative or absolute path). */
|
|
3682
|
+
readdir(path: string): Promise<DirEntry[]>;
|
|
3683
|
+
/** Stat a path (relative or absolute). */
|
|
3684
|
+
stat(path: string): Promise<FileStat>;
|
|
3685
|
+
/** Create a directory (relative or absolute). */
|
|
3686
|
+
mkdir(path: string, options?: MkdirParams): Promise<void>;
|
|
3687
|
+
}
|
|
3688
|
+
|
|
3689
|
+
export { type ComputerTemplateType as $, ACTION_NAMES as A, BillToForbiddenError as B, ChatBusyError as C, Computer as D, ComputerAudit as E, ComputerAutoStop as F, ComputerConnectors as G, type ComputerCreateParams as H, type ComputerData as I, ComputerEnv as J, type ComputerId as K, ComputerInbox as L, type ComputerListParams as M, type ComputerListResponse as N, ComputerLogs as O, type ComputerLogsGetParams as P, ComputerNetwork as Q, type RunExpectedOutputs as R, ComputerOsa as S, ComputerPorts as T, ComputerSecrets as U, type ComputerShare as V, type ComputerShareCreateParams as W, ComputerShares as X, type ComputerSize as Y, ComputerStartingError as Z, type ComputerStatus as _, type RunTargetKind as a, type FileExportResult as a$, ComputerTerminal as a0, type ComputerUpdateParams as a1, type ComputerViewer as a2, type ComputerVisibility as a3, ComputerVolumes as a4, type ConnectorApplicableDefaultParams as a5, type ConnectorCreateParams as a6, type ConnectorData as a7, type ConnectorDefault as a8, type ConnectorDefaultListParams as a9, type EgressAuditEvent as aA, type EgressBindingData as aB, EgressHostNotAllowedError as aC, EgressNetwork as aD, type EgressPolicyData as aE, type EgressPolicyMode as aF, type EgressRuleEffect as aG, type EgressSecretData as aH, type EgressSecretScope as aI, type EgressSecretType as aJ, EgressSecrets as aK, type EgressSuggestion as aL, EnvironmentIsDefaultError as aM, EnvironmentMemoryWithheldError as aN, EnvironmentNameTakenError as aO, EnvironmentNotFoundError as aP, EnvironmentScrubFailedError as aQ, type EnvironmentSelectionParams as aR, type EnvironmentStatus as aS, Exec as aT, type ExecParams as aU, type ExecPythonParams as aV, type ExecResult as aW, type FileDeleteParams as aX, type FileDownloadParams as aY, type FileEntry as aZ, type FileExportParams as a_, type ConnectorDefaultParams as aa, type ConnectorListParams as ab, type ConnectorSubject as ac, type ConnectorTokenParams as ad, type ConnectorTokenResponse as ae, Connectors as af, type Coordinate as ag, type CopyParams as ah, type CreditBalance as ai, CreditRequiredError as aj, type CreditTransaction as ak, type CreditTransactionListResponse as al, type CreditUsage as am, type CursorActionResult as an, type CursorInfo as ao, DeploymentConnectors as ap, Desktop as aq, type DesktopActionResult as ar, type DesktopEnvironmentInfo as as, type DesktopMouseButton as at, type DirEntry as au, type DirListResult as av, type DoubleClickParams as aw, type DragParams as ax, type EgressAllowlistRule as ay, EgressAudit as az, type RunCreateParams as b, type RunProviderCost as b$, type FileListParams as b0, type FileListResult as b1, type FileStat as b2, Files as b3, InstallationRequiredError as b4, InsufficientCreditsError as b5, InvalidActionInputError as b6, InvalidIdError as b7, InvalidSetupFileError as b8, type KeyParams as b9, NoReadyMachineError as bA, NotFoundError as bB, OAuthFlow as bC, type OauthConnectParams as bD, type OauthProvider as bE, type OauthStartResult as bF, type OauthStatusResult as bG, OrgNotFoundError as bH, OwnCredentialsRequiredError as bI, type PointerActionResult as bJ, type PolicyCreateParams as bK, type PolicyListParams as bL, type PolicyUpdateParams as bM, ProjectNotLinkedError as bN, RateLimitError as bO, type RulesListParams as bP, type Run as bQ, type RunActivity as bR, type RunCommandOutput as bS, type RunContext as bT, type RunDiagnostic as bU, type RunDownload as bV, type RunFile as bW, type RunListParams as bX, type RunMessage as bY, type RunOutputs as bZ, type RunPreview as b_, type LaunchParams as ba, type LookOptions as bb, type LookResult as bc, MachineAgent as bd, type MachineCommandOptions as be, type MachineCommandResult as bf, type MachineEnvironmentFields as bg, MachineKeyScopeError as bh, type MachineSetupFields as bi, MachineStartingError as bj, ManagedProviderBindingOnlyError as bk, MemberLimitReachedError as bl, type MiosaClientConfig as bm, MiosaError as bn, type MiosaErrorBody as bo, type MkdirParams as bp, type ModeParams as bq, type MouseButton as br, NetworkError as bs, NetworkPolicy as bt, type NetworkPolicyData as bu, type NetworkPolicyEffect as bv, type NetworkPolicyProtocol as bw, type NetworkPolicyRule as bx, type NetworkPolicySetParams as by, NoAgentRunError as bz, type ActArgs as c, type ComputerEvent as c$, type RunSessionMode as c0, RunSessionNotResumableError as c1, type RunStatus as c2, type RunUsage as c3, type RunUsageCounters as c4, type RunUsageGroup as c5, type RunUsageGroupBy as c6, type RunUsageParams as c7, type RunWaitOptions as c8, Runs as c9, type SnapshotData as cA, SnapshotInUseError as cB, type SnapshotListResponse as cC, type SnapshotProgressEvent as cD, type SnapshotRestoreResult as cE, type SnapshotStatus as cF, SubjectNotAllowedError as cG, type SuggestionsParams as cH, TeamMemberCapReachedError as cI, type TenantId as cJ, type TerminalCreateParams as cK, TimeoutError as cL, TokenRefreshFailedError as cM, type TypeParams as cN, UnknownEnvironmentError as cO, UserAuthorizationRequiredError as cP, ValidationError as cQ, type ViewerOptions as cR, type WaitIdleOptions as cS, type WaitOptions as cT, type WaitParams as cU, type WindowFocusParams as cV, type WindowInfo as cW, type WindowPosition as cX, type WindowSize as cY, performAction as cZ, pngSize as c_, SandboxAudit as ca, type SandboxConnectorAttachParams as cb, type SandboxConnectorBinding as cc, type SandboxConnectorPreflightParams as cd, type SandboxConnectorPreflightResult as ce, SandboxConnectors as cf, SandboxNetwork as cg, SandboxSecrets as ch, SandboxStartingError as ci, ScopeNotAllowedError as cj, ScopedFs as ck, type ScreenSize as cl, type ScreenshotActionResult as cm, type ScrollDirection as cn, type ScrollParams as co, type SecretListParams as cp, type SecretRotateParams as cq, type SecretSetParams as cr, type SessionId as cs, type SetupCliToolsStep as ct, type SetupEnvironmentStep as cu, type SetupRepoStep as cv, type SetupStatus as cw, type ShareRole as cx, SharedLinks as cy, type SnapshotCreateParams as cz, type ActParamsMap as d, HttpClient as d0, type AgentRun as d1, type AgentRunCreateParams as d2, type AgentRunArtifact as d3, type ComputerViewerPasswordStatus as d4, type ComputerViewerPasswordRotation as d5, AgentRuns as d6, type ActionName as e, type ActionResult as f, type ActionResultMap as g, type AgentEvent as h, type AgentEventType as i, type AgentPromptQueued as j, type AgentSessionCreateParams as k, type AgentSessionData as l, type AgentSessionListResponse as m, type AgentSessionStatus as n, type AllowParams as o, AmbiguousOrgError as p, type AuditListParams as q, type AuditTailParams as r, AuthError as s, BillToLockedError as t, type BillToParam as u, BillToSuspendedError as v, type BindingCreateParams as w, type BindingListParams as x, Checkpoints as y, type ClickParams$1 as z };
|