@rivet-dev/agentos 0.2.22 → 0.4.1

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.
Files changed (38) hide show
  1. package/assets/inspector-tabs-app/assets/{agentos-hero-logo-E3fapwXM.svg → agentos-hero-logo-BL8gBiZH.svg} +1 -1
  2. package/assets/inspector-tabs-app/assets/{sed-BwsOyU9v.svg → coreutils-CQXb6ysD.svg} +1 -1
  3. package/assets/inspector-tabs-app/assets/filesystem-C9Z7HA3k.js +1 -0
  4. package/assets/inspector-tabs-app/assets/{hooks-DU8a-cwM.js → hooks-DaKa0v02.js} +1 -1
  5. package/assets/inspector-tabs-app/assets/index-BQ48yGn7.css +1 -0
  6. package/assets/inspector-tabs-app/assets/index-bwUfaXzS.js +126 -0
  7. package/assets/inspector-tabs-app/assets/processes-CZ6M0f6m.js +4 -0
  8. package/assets/inspector-tabs-app/assets/scroll-area-BN1MPKEE.js +1 -0
  9. package/assets/inspector-tabs-app/assets/system-CXd1uvC-.js +1 -0
  10. package/assets/inspector-tabs-app/assets/terminal-yincB5PP.js +13 -0
  11. package/assets/inspector-tabs-app/assets/useMutation-CmlocRNE.js +1 -0
  12. package/assets/inspector-tabs-app/assets/vm-status-badges-C7eIpgyG.js +1 -0
  13. package/assets/inspector-tabs-app/index.html +2 -2
  14. package/dist/index.d.ts +2861 -448
  15. package/dist/index.js +33 -1924
  16. package/dist/index.js.map +1 -1
  17. package/package.json +60 -114
  18. package/assets/inspector-tabs-app/assets/filesystem-C-x0K5sy.js +0 -1
  19. package/assets/inspector-tabs-app/assets/index-7G_DbdZ6.js +0 -110
  20. package/assets/inspector-tabs-app/assets/index-DG_s1YoH.css +0 -1
  21. package/assets/inspector-tabs-app/assets/scroll-area-kPbv4IGy.js +0 -1
  22. package/assets/inspector-tabs-app/assets/system-D98yBhMj.js +0 -2
  23. package/assets/inspector-tabs-app/assets/terminal-Bv9GKv4q.js +0 -13
  24. package/assets/inspector-tabs-app/assets/transcript-kMbm_tF8.js +0 -1
  25. package/assets/inspector-tabs-app/assets/useSuspenseQuery-ChN8rnBd.js +0 -1
  26. package/assets/inspector-tabs-app/assets/vm-boot-gate-rpuO0b5W.js +0 -1
  27. package/assets/inspector-tabs-app/assets/vm-status-badges-09qyfN_A.js +0 -5
  28. package/dist/chunk-V6TY7KAL.js +0 -8
  29. package/dist/chunk-V6TY7KAL.js.map +0 -1
  30. package/dist/client.d.ts +0 -2
  31. package/dist/client.js +0 -3
  32. package/dist/client.js.map +0 -1
  33. package/dist/node.d.ts +0 -67
  34. package/dist/node.js +0 -275
  35. package/dist/node.js.map +0 -1
  36. package/dist/react.d.ts +0 -1
  37. package/dist/react.js +0 -3
  38. package/dist/react.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,465 +1,2878 @@
1
- import { Actions, ActorConfigInput, ActorContext, ActorDefinition, Type, setup as setup$1 } from 'rivetkit';
2
- export { Registry } from 'rivetkit';
3
- import * as _rivet_dev_agentos_core from '@rivet-dev/agentos-core';
4
- import { LanguageSpawnOptions, SpawnOptions, LanguageExecutionOptions, JavaScriptExecutionOptions, NpmProjectInstallOptions, NpmPackageInstallOptions, TypeScriptExecutionOptions, TypeScriptFileExecutionOptions, TypeScriptCheckOptions, InlineExecutionOptions, PythonInstallOptions, SessionStreamEntry, AgentExitEvent, ProcessOutput, ProcessExit, ShellData, ShellExit, CronEvent, CronJobInfo, HostFunctionSchemas, AgentOsOptions, AgentOs, DynamicMountDescriptor, ProcessDescriptor, OpenSessionInput, PromptInput, PackageDescriptor, CodeExecutionResult } from '@rivet-dev/agentos-core';
5
- export * from '@rivet-dev/agentos-core';
6
- import * as _agentclientprotocol_sdk from '@agentclientprotocol/sdk';
7
- import * as _rivet_dev_agentos_core_internal_runtime_compat from '@rivet-dev/agentos-core/internal/runtime-compat';
8
- import { DatabaseProvider, RawAccess } from 'rivetkit/db';
1
+ import { BaseActorDefinition, Type, Client, Registry } from 'rivetkit';
2
+ import { ActorAccessor, GetOptions, ActorHandle, ActorConnectOptions, ActorConn, CreateOptions, GetWithIdOptions, ClientConfigInput } from 'rivetkit/client';
9
3
 
10
- type VmBootedPayload = Record<string, never>;
11
- interface VmShutdownPayload {
12
- reason: "sleep" | "destroy" | "error";
13
- }
14
- type ProcessOutputPayload = ProcessOutput;
15
- type ProcessExitPayload = ProcessExit;
16
- /** `seq` orders this chunk against `ShellSnapshot.seq`; it is 0 when the shell
17
- * has no server-side emulator and therefore no replay. */
18
- type ShellDataPayload = ShellData & {
19
- seq: number;
20
- };
21
- type ShellExitPayload = ShellExit;
22
- type SerializableCronEvent = CronEvent;
23
- type ActorData = {
24
- encoding: "utf8";
25
- data: string;
26
- } | {
27
- encoding: "base64";
28
- data: string;
29
- };
30
- type ActorLanguageExecutionOptions = Omit<LanguageExecutionOptions, "stdin" | "signal" | "onStdout" | "onStderr"> & {
31
- stdin?: ActorData;
32
- };
33
- type ActorSpawnOptions = Omit<SpawnOptions, "stdin" | "signal" | "onStdout" | "onStderr"> & {
34
- stdin?: ActorData;
35
- };
36
- type ActorLanguageSpawnOptions = Omit<LanguageSpawnOptions, "stdin" | "signal" | "onStdout" | "onStderr"> & {
37
- stdin?: ActorData;
38
- };
39
- type ActorInlineExecutionOptions = Omit<InlineExecutionOptions, "stdin" | "signal" | "onStdout" | "onStderr"> & {
40
- stdin?: ActorData;
41
- };
42
- type ActorJavaScriptExecutionOptions = Omit<JavaScriptExecutionOptions, "stdin" | "signal" | "onStdout" | "onStderr"> & {
43
- stdin?: ActorData;
44
- };
45
- type ActorTypeScriptExecutionOptions = Omit<TypeScriptExecutionOptions, "stdin" | "signal" | "onStdout" | "onStderr"> & {
46
- stdin?: ActorData;
47
- };
48
- type ActorTypeScriptFileExecutionOptions = Omit<TypeScriptFileExecutionOptions, "stdin" | "signal" | "onStdout" | "onStderr"> & {
49
- stdin?: ActorData;
50
- };
51
- type ActorTypeScriptCheckOptions = Omit<TypeScriptCheckOptions, "signal">;
52
- type ActorNpmProjectInstallOptions = Omit<NpmProjectInstallOptions, "signal">;
53
- type ActorNpmPackageInstallOptions = Omit<NpmPackageInstallOptions, "signal">;
54
- type ActorPythonInstallOptions = Omit<PythonInstallOptions, "signal">;
55
- interface AgentOsEvents {
56
- sessionEvent: SessionStreamEntry;
57
- agentExit: AgentExitEvent;
58
- vmBooted: VmBootedPayload;
59
- vmShutdown: VmShutdownPayload;
60
- processOutput: ProcessOutputPayload;
61
- processExit: ProcessExitPayload;
62
- /** Ordered PTY output containing stdout and stderr exactly once. */
63
- shellData: ShellDataPayload;
64
- /** Optional stderr-only diagnostic tap; do not render it with `shellData`. */
65
- shellStderr: ShellDataPayload;
66
- /** Shell process exit (mirrors `waitShell` resolution). */
67
- shellExit: ShellExitPayload;
68
- cronEvent: SerializableCronEvent;
69
- }
70
- /** One buffered near-capacity limit warning (`RuntimeHealth.warnings`). */
71
- interface RuntimeLimitWarning {
72
- /** Epoch milliseconds when the warning was observed host-side. */
73
- ts: number;
74
- limit: string;
75
- category: string;
76
- observed: number;
77
- capacity: number;
78
- fillPercent: number;
79
- }
80
- /** One buffered unexpected adapter exit (`RuntimeHealth.agentExits`). */
81
- interface RuntimeAgentExit {
82
- /** Epoch milliseconds when the exit was observed host-side. */
83
- ts: number;
84
- sessionId: string;
85
- agentType: string;
86
- exitCode: number | null;
87
- restart: string;
88
- restartCount: number;
4
+ declare const AGENTOS_API_VERSION: "agentos-sdk.dev/v1alpha1";
5
+ declare const AGENTOS_CONTRACT_MAJOR: 1;
6
+ declare const AGENTOS_CONTRACT_HASH: "sha256:ebf1dda8056f5fc3821395516407b2b165add49be71efd89c96c8d4b9e4a1393";
7
+ declare const AGENTOS_CAPABILITIES: readonly ["config.merge-patch", "network.pull-streaming", "output.replay", "inspector.filesystem", "inspector.processes", "inspector.software", "inspector.terminals", "inspector.vm", "language.javascript", "language.python", "language.typescript"];
8
+ declare const AGENTOS_CONTRACT: {
9
+ readonly apiVersion: "agentos-sdk.dev/v1alpha1";
10
+ readonly contractMajor: 1;
11
+ readonly contractHash: "sha256:ebf1dda8056f5fc3821395516407b2b165add49be71efd89c96c8d4b9e4a1393";
12
+ readonly capabilities: readonly ["config.merge-patch", "network.pull-streaming", "output.replay", "inspector.filesystem", "inspector.processes", "inspector.software", "inspector.terminals", "inspector.vm", "language.javascript", "language.python", "language.typescript"];
13
+ };
14
+ declare namespace Input {
15
+ type ActorCodeEvaluationResult = {
16
+ result: ActorCodeExecutionResult;
17
+ value?: JsonValue | null;
18
+ };
19
+ type ActorCodeExecutionResult = {
20
+ execution?: ActorExecutionDescriptor | null;
21
+ outcome: ActorExecutionOutcome;
22
+ exitCode?: number | null;
23
+ error?: ActorExecutionError | null;
24
+ stdout?: FileBytes | null;
25
+ stderr?: FileBytes | null;
26
+ stdoutTruncated?: boolean | null;
27
+ stderrTruncated?: boolean | null;
28
+ };
29
+ type ActorContextDescriptor = {
30
+ context: ActorContextId;
31
+ state: string;
32
+ language?: string | null;
33
+ createdAtMs: number | bigint;
34
+ lastStartedAtMs?: number | bigint | null;
35
+ lastCompletedAtMs?: number | bigint | null;
36
+ };
37
+ type ActorContextId = {
38
+ generation: number | bigint;
39
+ contextId: string;
40
+ };
41
+ type ActorCronJob = {
42
+ name: string;
43
+ expression: string;
44
+ timezone?: string | null;
45
+ command: string;
46
+ args: Array<string>;
47
+ options: ActorSpawnOptions;
48
+ configRevision: number | bigint;
49
+ nextRunAtMs: number | bigint;
50
+ lastRunAtMs?: number | bigint | null;
51
+ maxHistory: number | bigint;
52
+ };
53
+ type ActorExecOptions = {
54
+ env?: {
55
+ [key in string]?: string;
56
+ };
57
+ cwd?: string | null;
58
+ stdin?: FileContentInput | null;
59
+ timeoutMs?: number | bigint | null;
60
+ captureStdio?: boolean | null;
61
+ };
62
+ type ActorExecResult = {
63
+ status: ActorExitStatus;
64
+ stdout: string;
65
+ stderr: string;
66
+ };
67
+ type ActorExecutionDescriptor = {
68
+ executionId: string;
69
+ generation: number | bigint;
70
+ state: string;
71
+ language?: string | null;
72
+ processId?: string | null;
73
+ pid?: number | null;
74
+ createdAtMs: number | bigint;
75
+ lastStartedAtMs?: number | bigint | null;
76
+ lastCompletedAtMs?: number | bigint | null;
77
+ lastOutcome?: ActorExecutionOutcome | null;
78
+ lastExitCode?: number | null;
79
+ };
80
+ type ActorExecutionError = {
81
+ code: string;
82
+ name: string;
83
+ message: string;
84
+ stack?: string | null;
85
+ details?: JsonValue | null;
86
+ };
87
+ type ActorExecutionOutcome = "succeeded" | "failed" | "cancelled" | "timedOut";
88
+ type ActorExecutionOutputOptions = {
89
+ capture?: ActorOutputCapture | null;
90
+ retainEvents?: boolean | null;
91
+ };
92
+ type ActorExecutionPtyOptions = {
93
+ cols?: number | null;
94
+ rows?: number | null;
95
+ };
96
+ type ActorExitStatus = {
97
+ exitCode: number;
98
+ signal?: ActorSignal | null;
99
+ };
100
+ type ActorFetchStreamChunk = {
101
+ body: FileBytes;
102
+ done: boolean;
103
+ };
104
+ type ActorFetchStreamHead = {
105
+ stream: ActorFetchStreamId;
106
+ status: number;
107
+ statusText: string;
108
+ headers: Array<[string, string]>;
109
+ };
110
+ type ActorFetchStreamId = {
111
+ generation: number | bigint;
112
+ streamId: string;
113
+ expiresAtMs: number | bigint;
114
+ };
115
+ type ActorFileStat = {
116
+ mode: number;
117
+ sizeBytes: number | bigint;
118
+ blocks: number | bigint;
119
+ dev: number | bigint;
120
+ rdev: number | bigint;
121
+ isDirectory: boolean;
122
+ isSymbolicLink: boolean;
123
+ atimeMs: number;
124
+ mtimeMs: number;
125
+ ctimeMs: number;
126
+ birthtimeMs: number;
127
+ ino: number | bigint;
128
+ nlink: number | bigint;
129
+ uid: number;
130
+ gid: number;
131
+ };
132
+ type ActorHttpRequest = {
133
+ port: number;
134
+ path: string;
135
+ method?: string;
136
+ headers?: {
137
+ [key in string]?: string;
138
+ };
139
+ body?: FileContentInput | null;
140
+ };
141
+ type ActorHttpResponse = {
142
+ status: number;
143
+ statusText: string;
144
+ headers: Array<[string, string]>;
145
+ body: FileBytes;
146
+ };
147
+ type ActorInlineExecutionOptions = {
148
+ process?: ActorLanguageExecutionOptions;
149
+ inputs?: {
150
+ [key in string]?: JsonValue;
151
+ } | null;
152
+ };
153
+ type ActorInstalledSoftware = {
154
+ packageId: string;
155
+ digest: string;
156
+ sizeBytes: number | bigint;
157
+ packageName: string;
158
+ version: string;
159
+ commands: Array<string>;
160
+ };
161
+ type ActorJavaScriptExecutionOptions = {
162
+ inline?: ActorInlineExecutionOptions;
163
+ format?: ActorJavaScriptModuleFormat | null;
164
+ filePath?: string | null;
165
+ };
166
+ type ActorJavaScriptModuleFormat = "module" | "commonJs";
167
+ type ActorLanguageExecutionOptions = {
168
+ context?: ActorContextId | null;
169
+ cwd?: string | null;
170
+ env?: {
171
+ [key in string]?: string;
172
+ };
173
+ args?: Array<string>;
174
+ stdin?: FileContentInput | null;
175
+ timeoutMs?: number | bigint | null;
176
+ pty?: ActorExecutionPtyOptions | null;
177
+ output?: ActorExecutionOutputOptions;
178
+ };
179
+ type ActorLanguageSpawnOptions = {
180
+ cwd?: string | null;
181
+ env?: {
182
+ [key in string]?: string;
183
+ };
184
+ args?: Array<string>;
185
+ stdin?: FileContentInput | null;
186
+ timeoutMs?: number | bigint | null;
187
+ pty?: ActorExecutionPtyOptions | null;
188
+ };
189
+ type ActorNpmInstallOptions = {
190
+ context?: ActorContextId | null;
191
+ cwd?: string | null;
192
+ env?: {
193
+ [key in string]?: string;
194
+ };
195
+ timeoutMs?: number | bigint | null;
196
+ frozen?: boolean | null;
197
+ dev?: boolean | null;
198
+ global?: boolean | null;
199
+ output?: ActorExecutionOutputOptions;
200
+ };
201
+ type ActorOutputCapture = "none" | "stderr" | "all";
202
+ type ActorOutputEvent = {
203
+ sequence: number | bigint;
204
+ stream: ProcessStream;
205
+ data: FileBytes;
206
+ timestampMs: number | bigint;
207
+ };
208
+ type ActorOutputReplay = {
209
+ generation: number | bigint;
210
+ events: Array<ActorOutputEvent>;
211
+ nextCursor?: number | bigint | null;
212
+ hasMore: boolean;
213
+ truncated: boolean;
214
+ end?: ActorExitStatus | null;
215
+ };
216
+ type ActorPreview = {
217
+ token: string;
218
+ path: string;
219
+ port: number;
220
+ expiresAtMs: number | bigint;
221
+ };
222
+ type ActorProcessExit = {
223
+ process: ActorProcessId;
224
+ status: ActorExitStatus;
225
+ };
226
+ type ActorProcessId = {
227
+ generation: number | bigint;
228
+ pid: number;
229
+ };
230
+ type ActorProcessInfo = {
231
+ process: ActorProcessId;
232
+ command: string;
233
+ args: Array<string>;
234
+ running: boolean;
235
+ exit?: ActorExitStatus | null;
236
+ startedAtMs: number | bigint;
237
+ };
238
+ type ActorProcessTree = {
239
+ generation: number | bigint;
240
+ roots: Array<ActorProcessTreeNode>;
241
+ };
242
+ type ActorProcessTreeNode = {
243
+ process?: ActorProcessId | null;
244
+ pid: number;
245
+ ppid: number;
246
+ pgid: number;
247
+ sid: number;
248
+ driver: string;
249
+ command: string;
250
+ args: Array<string>;
251
+ cwd: string;
252
+ status: ProcessStatus;
253
+ exit?: ActorExitStatus | null;
254
+ startTimeMs: number;
255
+ exitTimeMs?: number | null;
256
+ children: Array<ActorProcessTreeNode>;
257
+ };
258
+ type ActorPythonInstallOptions = {
259
+ context?: ActorContextId | null;
260
+ cwd?: string | null;
261
+ env?: {
262
+ [key in string]?: string;
263
+ };
264
+ timeoutMs?: number | bigint | null;
265
+ upgrade?: boolean | null;
266
+ requirementsFile?: string | null;
267
+ indexUrl?: string | null;
268
+ extraIndexUrls?: Array<string>;
269
+ output?: ActorExecutionOutputOptions;
270
+ };
271
+ type ActorSignal = "SIGTERM" | "SIGINT" | "SIGKILL";
272
+ type ActorSpawnOptions = {
273
+ env?: {
274
+ [key in string]?: string;
275
+ };
276
+ cwd?: string | null;
277
+ stdio?: SpawnStdio | null;
278
+ stdinFd?: number | null;
279
+ stdoutFd?: number | null;
280
+ stderrFd?: number | null;
281
+ };
282
+ type ActorTerminalExit = {
283
+ terminal: ActorTerminalId;
284
+ status: ActorExitStatus;
285
+ };
286
+ type ActorTerminalId = {
287
+ generation: number | bigint;
288
+ shellId: string;
289
+ };
290
+ type ActorTerminalOptions = {
291
+ command?: string | null;
292
+ args?: Array<string>;
293
+ env?: {
294
+ [key in string]?: string;
295
+ };
296
+ cwd?: string | null;
297
+ cols?: number | null;
298
+ rows?: number | null;
299
+ };
300
+ type ActorTypeScriptCheckOptions = {
301
+ context?: ActorContextId | null;
302
+ cwd?: string | null;
303
+ filePath?: string | null;
304
+ tsconfigPath?: string | null;
305
+ compilerOptions?: {
306
+ [key in string]?: JsonValue;
307
+ } | null;
308
+ timeoutMs?: number | bigint | null;
309
+ output?: ActorExecutionOutputOptions;
310
+ };
311
+ type ActorTypeScriptCheckResult = {
312
+ result: ActorCodeExecutionResult;
313
+ hasErrors?: boolean | null;
314
+ diagnostics: Array<ActorTypeScriptDiagnostic>;
315
+ };
316
+ type ActorTypeScriptDiagnostic = {
317
+ code: number;
318
+ category: string;
319
+ message: string;
320
+ filePath?: string | null;
321
+ line?: number | null;
322
+ column?: number | null;
323
+ };
324
+ type ActorTypeScriptExecutionOptions = {
325
+ inline?: ActorInlineExecutionOptions;
326
+ filePath?: string | null;
327
+ tsconfigPath?: string | null;
328
+ compilerOptions?: {
329
+ [key in string]?: JsonValue;
330
+ } | null;
331
+ };
332
+ type AgentOsActorConfig = {
333
+ user?: VmUserConfig | null;
334
+ environment?: {
335
+ [key in string]?: string;
336
+ } | null;
337
+ allowedNodeBuiltins?: Array<string> | null;
338
+ highResolutionTime?: boolean | null;
339
+ loopbackExemptPorts: Array<number>;
340
+ limits?: AgentOsLimits | null;
341
+ permissions?: Permissions | null;
342
+ filesystem: HostedFilesystemConfig;
343
+ defaultSoftware?: boolean | null;
344
+ software: Array<RemotePackageSource>;
345
+ preview: PreviewPolicy;
346
+ };
347
+ type AgentOsActorConfigInput = {
348
+ user?: VmUserConfig | null;
349
+ environment?: {
350
+ [key in string]?: string;
351
+ } | null;
352
+ allowedNodeBuiltins?: Array<string> | null;
353
+ highResolutionTime?: boolean | null;
354
+ loopbackExemptPorts?: Array<number> | null;
355
+ limits?: AgentOsLimits | null;
356
+ permissions?: Permissions | null;
357
+ filesystem?: HostedFilesystemConfigInput | null;
358
+ /**
359
+ * Install agentOS default software (coreutils, sed, grep, gawk, findutils,
360
+ * diffutils, tar, gzip) before `software`. Defaults to true.
361
+ */
362
+ defaultSoftware?: boolean | null;
363
+ software?: Array<RemotePackageSourceInput> | null;
364
+ preview?: PreviewPolicyInput | null;
365
+ };
366
+ type AgentOsActorCreateInput = {
367
+ config?: AgentOsActorConfigInput | null;
368
+ };
369
+ type AgentOsLimits = {
370
+ agentosPackages?: AgentOsPackageLimits;
371
+ resources?: ResourceLimits | null;
372
+ http?: HttpLimits | null;
373
+ tls?: TlsLimits;
374
+ hostFunctions?: HostFunctionLimits | null;
375
+ plugins?: PluginLimits | null;
376
+ sqlite?: SqliteLimits | null;
377
+ jsRuntime?: JsRuntimeLimits | null;
378
+ python?: PythonLimits | null;
379
+ wasm?: WasmLimits | null;
380
+ execution?: ExecutionLimits;
381
+ process?: ProcessLimits | null;
382
+ };
383
+ type AgentOsPackageLimits = {
384
+ maxMounts?: number | bigint;
385
+ };
386
+ type ConfigApplyState = "applying" | "ready" | "restart_required" | "failed";
387
+ type ConfigGet = Record<string, never>;
388
+ type ConfigPatch = {
389
+ patch: JsonValue;
390
+ expectedRevision?: number | bigint | null;
391
+ };
392
+ type ConfigSet = {
393
+ config: AgentOsActorConfigInput;
394
+ expectedRevision?: number | bigint | null;
395
+ };
396
+ type ConfigSnapshot = {
397
+ revision: number | bigint;
398
+ desired: AgentOsActorConfig;
399
+ appliedRevision?: number | bigint | null;
400
+ state: ConfigApplyState;
401
+ issues: Array<VmIssue>;
402
+ createdAtMs: number | bigint;
403
+ updatedAtMs: number | bigint;
404
+ };
405
+ type ContextsCreate = {
406
+ contextId: string;
407
+ };
408
+ type ContextsDelete = {
409
+ context: ActorContextId;
410
+ };
411
+ type ContextsGet = {
412
+ context: ActorContextId;
413
+ };
414
+ type ContextsList = Record<string, never>;
415
+ type ContextsReset = {
416
+ context: ActorContextId;
417
+ };
418
+ type CoreSidecarStatus = {
419
+ state: string;
420
+ activeVmCount: number;
421
+ };
422
+ type CronCancel = {
423
+ name: string;
424
+ };
425
+ type CronFiredEvent = {
426
+ scheduleName: string;
427
+ process?: ActorProcessId | null;
428
+ error?: CronLaunchError | null;
429
+ firedAtMs: number | bigint;
430
+ };
431
+ type CronLaunchError = {
432
+ code: string;
433
+ message: string;
434
+ };
435
+ type CronList = Record<string, never>;
436
+ type CronSchedule = {
437
+ name?: string | null;
438
+ expression: string;
439
+ timezone?: string | null;
440
+ command: string;
441
+ args?: Array<string>;
442
+ options?: ActorSpawnOptions;
443
+ maxHistory?: number | bigint | null;
444
+ };
445
+ type DirEntryType = "file" | "directory" | "symlink";
446
+ type ExecutionLimits = {
447
+ completedTtlMs?: number | bigint;
448
+ maxCompletedExecutions?: number | bigint;
449
+ liveExecutionWarningThreshold?: number | bigint;
450
+ };
451
+ type FileBytes = Uint8Array;
452
+ type FileContentInput = string | Uint8Array;
453
+ type FilesystemEntry = {
454
+ path: string;
455
+ type: DirEntryType;
456
+ mode: string;
457
+ uid: number;
458
+ gid: number;
459
+ content?: string | null;
460
+ encoding?: FilesystemEntryEncoding | null;
461
+ target?: string | null;
462
+ };
463
+ type FilesystemEntryEncoding = "utf8" | "base64";
464
+ type FilesystemExists = {
465
+ path: string;
466
+ };
467
+ type FilesystemExport = {
468
+ maxBytes?: number | null;
469
+ };
470
+ type FilesystemListMounts = Record<string, never>;
471
+ type FilesystemMkdir = {
472
+ path: string;
473
+ recursive?: boolean;
474
+ };
475
+ type FilesystemMove = {
476
+ from: string;
477
+ to: string;
478
+ };
479
+ type FilesystemReadFile = {
480
+ path: string;
481
+ maxBytes?: number | null;
482
+ };
483
+ type FilesystemReadFiles = {
484
+ paths: Array<string>;
485
+ maxBytes?: number | null;
486
+ };
487
+ type FilesystemReaddir = {
488
+ path: string;
489
+ };
490
+ type FilesystemReaddirEntries = {
491
+ path: string;
492
+ };
493
+ type FilesystemReaddirRecursive = {
494
+ path: string;
495
+ maxDepth?: number | null;
496
+ exclude?: Array<string>;
497
+ };
498
+ type FilesystemRemove = {
499
+ path: string;
500
+ recursive?: boolean;
501
+ };
502
+ type FilesystemSnapshotEntries = {
503
+ entries: Array<FilesystemEntry>;
504
+ };
505
+ type FilesystemSnapshotExport = {
506
+ format: string;
507
+ filesystem: FilesystemSnapshotEntries;
508
+ };
509
+ type FilesystemStat = {
510
+ path: string;
511
+ };
512
+ type FilesystemWriteEntry = {
513
+ path: string;
514
+ content: FileContentInput;
515
+ };
516
+ type FilesystemWriteFile = {
517
+ path: string;
518
+ content: FileContentInput;
519
+ };
520
+ type FilesystemWriteFiles = {
521
+ entries: Array<FilesystemWriteEntry>;
522
+ };
523
+ type FsPermissionRule = {
524
+ mode: PermissionMode;
525
+ operations?: Array<string> | null;
526
+ paths?: Array<string> | null;
527
+ };
528
+ type FsPermissions = PermissionMode | RulePermissions<FsPermissionRule>;
529
+ type HostFunctionLimits = {
530
+ defaultTimeoutMs?: number | bigint | null;
531
+ maxTimeoutMs?: number | bigint | null;
532
+ maxRegisteredCollections?: number | bigint | null;
533
+ maxRegisteredFunctionsPerVm?: number | bigint | null;
534
+ maxFunctionsPerCollection?: number | bigint | null;
535
+ maxSchemaBytes?: number | bigint | null;
536
+ maxExamplesPerFunction?: number | bigint | null;
537
+ maxExampleInputBytes?: number | bigint | null;
538
+ };
539
+ type HostedFilesystemBackend = {
540
+ type: "durable";
541
+ namespace: string;
542
+ };
543
+ type HostedFilesystemBackendInput = {
544
+ type: "durable";
545
+ namespace?: string | null;
546
+ };
547
+ type HostedFilesystemConfig = {
548
+ root: HostedRootFilesystem;
549
+ mounts: Array<HostedFilesystemMount>;
550
+ };
551
+ type HostedFilesystemConfigInput = {
552
+ root?: HostedRootFilesystemInput | null;
553
+ mounts?: Array<HostedFilesystemMountInput>;
554
+ };
555
+ type HostedFilesystemMount = {
556
+ path: string;
557
+ backend: HostedFilesystemBackend;
558
+ readOnly: boolean;
559
+ };
560
+ type HostedFilesystemMountInput = {
561
+ path: string;
562
+ backend: HostedFilesystemBackendInput;
563
+ readOnly?: boolean;
564
+ };
565
+ type HostedRootFilesystem = {
566
+ type: "default";
567
+ } | {
568
+ type: "durable";
569
+ namespace: string;
570
+ readOnly: boolean;
571
+ };
572
+ type HostedRootFilesystemInput = {
573
+ type: "default";
574
+ } | {
575
+ type: "durable";
576
+ namespace?: string | null;
577
+ readOnly?: boolean;
578
+ };
579
+ type HttpLimits = {
580
+ maxFetchResponseBytes?: number | bigint | null;
581
+ };
582
+ type JavaScriptEvaluate = {
583
+ expression: string;
584
+ options?: ActorJavaScriptExecutionOptions;
585
+ };
586
+ type JavaScriptExecute = {
587
+ source: string;
588
+ options?: ActorJavaScriptExecutionOptions;
589
+ };
590
+ type JavaScriptExecuteFile = {
591
+ path: string;
592
+ options?: ActorLanguageExecutionOptions;
593
+ };
594
+ type JavaScriptNpmInstall = {
595
+ packages?: Array<string>;
596
+ options?: ActorNpmInstallOptions;
597
+ };
598
+ type JavaScriptNpmRunPackage = {
599
+ packageSpec: string;
600
+ binary?: string | null;
601
+ options?: ActorLanguageExecutionOptions;
602
+ };
603
+ type JavaScriptNpmRunScript = {
604
+ script: string;
605
+ options?: ActorLanguageExecutionOptions;
606
+ };
607
+ type JavaScriptSpawn = {
608
+ source: string;
609
+ options?: ActorLanguageSpawnOptions;
610
+ };
611
+ type JavaScriptSpawnFile = {
612
+ path: string;
613
+ options?: ActorLanguageSpawnOptions;
614
+ };
615
+ type JsRuntimeLimits = {
616
+ v8HeapLimitMb?: number | bigint | null;
617
+ syncRpcWaitTimeoutMs?: number | bigint | null;
618
+ cpuTimeLimitMs?: number | bigint | null;
619
+ wallClockLimitMs?: number | bigint | null;
620
+ importCacheMaterializeTimeoutMs?: number | bigint | null;
621
+ capturedOutputLimitBytes?: number | bigint | null;
622
+ stdinBufferLimitBytes?: number | bigint | null;
623
+ eventPayloadLimitBytes?: number | bigint | null;
624
+ v8IpcMaxFrameBytes?: number | bigint | null;
625
+ };
626
+ type JsonValue = number | string | boolean | Array<JsonValue> | {
627
+ [key in string]?: JsonValue;
628
+ } | null;
629
+ type NetworkFetch = {
630
+ request: ActorHttpRequest;
631
+ };
632
+ type NetworkFetchStreamCancel = {
633
+ stream: ActorFetchStreamId;
634
+ };
635
+ type NetworkFetchStreamRead = {
636
+ stream: ActorFetchStreamId;
637
+ maxBytes?: number | null;
638
+ };
639
+ type NetworkFetchStreamStart = {
640
+ request: ActorHttpRequest;
641
+ };
642
+ type NetworkPreviewCreate = {
643
+ port: number;
644
+ ttlMs?: number | bigint | null;
645
+ };
646
+ type NetworkPreviewExpire = {
647
+ token: string;
648
+ };
649
+ type PackageStartupStatus = {
650
+ requiredTotal: number;
651
+ requiredReady: number;
652
+ optionalPreloadTotal: number;
653
+ optionalPreloadReady: number;
654
+ optionalPreloadFailed: number;
655
+ optionalPreloadSkipped: number;
656
+ optionalPreloadWarmedBytes: number | bigint;
657
+ optionalPreloadDeadlineHit: boolean;
658
+ optionalPreloadCoordinatorAvailable: boolean;
659
+ };
660
+ type PatternPermissionRule = {
661
+ mode: PermissionMode;
662
+ operations?: Array<string> | null;
663
+ patterns?: Array<string> | null;
664
+ };
665
+ type PatternPermissions = PermissionMode | RulePermissions<PatternPermissionRule>;
666
+ type PermissionMode = "allow" | "deny";
667
+ type Permissions = {
668
+ fs?: FsPermissions | null;
669
+ network?: PatternPermissions | null;
670
+ childProcess?: PatternPermissions | null;
671
+ process?: PatternPermissions | null;
672
+ env?: PatternPermissions | null;
673
+ hostFunction?: PatternPermissions | null;
674
+ };
675
+ type PluginLimits = {
676
+ maxPersistedManifestBytes?: number | bigint | null;
677
+ maxPersistedManifestFileBytes?: number | bigint | null;
678
+ };
679
+ type PreviewPolicy = {
680
+ defaultTtlMs: number | bigint;
681
+ maxTtlMs: number | bigint;
682
+ maxActive: number;
683
+ };
684
+ type PreviewPolicyInput = {
685
+ defaultTtlMs?: number | bigint | null;
686
+ maxTtlMs?: number | bigint | null;
687
+ maxActive?: number | null;
688
+ };
689
+ type ProcessExitEvent = {
690
+ process: ActorProcessId;
691
+ status: ActorExitStatus;
692
+ };
693
+ type ProcessGet = {
694
+ process: ActorProcessId;
695
+ };
696
+ type ProcessLimits = {
697
+ maxSpawnFileActions?: number | bigint | null;
698
+ maxSpawnFileActionBytes?: number | bigint | null;
699
+ pendingStdinBytes?: number | bigint | null;
700
+ pendingEventCount?: number | bigint | null;
701
+ pendingEventBytes?: number | bigint | null;
702
+ };
703
+ type ProcessList = Record<string, never>;
704
+ type ProcessOutputEvent = {
705
+ process: ActorProcessId;
706
+ sequence: number | bigint;
707
+ stream: ProcessStream;
708
+ data: FileBytes;
709
+ timestampMs: number | bigint;
710
+ };
711
+ type ProcessOutputRead = {
712
+ process: ActorProcessId;
713
+ after?: number | bigint | null;
714
+ maxEvents?: number | null;
715
+ maxBytes?: number | null;
716
+ };
717
+ type ProcessPtyResize = {
718
+ process: ActorProcessId;
719
+ cols: number;
720
+ rows: number;
721
+ };
722
+ type ProcessRun = {
723
+ command: string;
724
+ args?: Array<string>;
725
+ options?: ActorExecOptions;
726
+ };
727
+ type ProcessSignal = {
728
+ process: ActorProcessId;
729
+ signal: ActorSignal;
730
+ };
731
+ type ProcessSpawn = {
732
+ command: string;
733
+ args?: Array<string>;
734
+ options?: ActorSpawnOptions;
735
+ };
736
+ type ProcessStatus = "running" | "exited";
737
+ type ProcessStdinClose = {
738
+ process: ActorProcessId;
739
+ };
740
+ type ProcessStdinWrite = {
741
+ process: ActorProcessId;
742
+ data: FileContentInput;
743
+ };
744
+ type ProcessStream = "stdout" | "stderr";
745
+ type ProcessTree = Record<string, never>;
746
+ type ProcessWait = {
747
+ process: ActorProcessId;
748
+ };
749
+ type PythonEvaluate = {
750
+ expression: string;
751
+ options?: ActorInlineExecutionOptions;
752
+ };
753
+ type PythonExecute = {
754
+ source: string;
755
+ options?: ActorInlineExecutionOptions;
756
+ };
757
+ type PythonExecuteFile = {
758
+ path: string;
759
+ options?: ActorLanguageExecutionOptions;
760
+ };
761
+ type PythonExecuteModule = {
762
+ module: string;
763
+ options?: ActorLanguageExecutionOptions;
764
+ };
765
+ type PythonInstall = {
766
+ packages?: Array<string>;
767
+ options?: ActorPythonInstallOptions;
768
+ };
769
+ type PythonLimits = {
770
+ outputBufferMaxBytes?: number | bigint | null;
771
+ executionTimeoutMs?: number | bigint | null;
772
+ maxOldSpaceMb?: number | bigint | null;
773
+ vfsRpcTimeoutMs?: number | bigint | null;
774
+ };
775
+ type PythonSpawn = {
776
+ source: string;
777
+ options?: ActorLanguageSpawnOptions;
778
+ };
779
+ type PythonSpawnFile = {
780
+ path: string;
781
+ options?: ActorLanguageSpawnOptions;
782
+ };
783
+ type PythonSpawnModule = {
784
+ module: string;
785
+ options?: ActorLanguageSpawnOptions;
786
+ };
787
+ type RemotePackageSource = {
788
+ url: string;
789
+ digest?: string | null;
790
+ sizeBytes?: number | bigint | null;
791
+ packageId?: string | null;
792
+ };
793
+ type RemotePackageSourceInput = {
794
+ url: string;
795
+ digest?: string | null;
796
+ /**
797
+ * Resolution metadata is accepted so a `v1.config.get` snapshot can be sent
798
+ * back to `v1.config.set`. Core re-resolves the source and never trusts it.
799
+ */
800
+ sizeBytes?: number | bigint | null;
801
+ packageId?: string | null;
802
+ };
803
+ type ResourceLimits = {
804
+ cpuCount?: number | bigint | null;
805
+ maxProcesses?: number | bigint | null;
806
+ maxOpenFds?: number | bigint | null;
807
+ maxPipes?: number | bigint | null;
808
+ maxPtys?: number | bigint | null;
809
+ maxSockets?: number | bigint | null;
810
+ maxConnections?: number | bigint | null;
811
+ maxSocketBufferedBytes?: number | bigint | null;
812
+ maxSocketDatagramQueueLen?: number | bigint | null;
813
+ maxFilesystemBytes?: number | bigint | null;
814
+ maxInodeCount?: number | bigint | null;
815
+ maxBlockingReadMs?: number | bigint | null;
816
+ maxPreadBytes?: number | bigint | null;
817
+ maxFdWriteBytes?: number | bigint | null;
818
+ maxProcessArgvBytes?: number | bigint | null;
819
+ maxProcessEnvBytes?: number | bigint | null;
820
+ maxReaddirEntries?: number | bigint | null;
821
+ maxWasmFuel?: number | bigint | null;
822
+ maxWasmMemoryBytes?: number | bigint | null;
823
+ maxWasmStackBytes?: number | bigint | null;
824
+ };
825
+ type RootSnapshotExport = {
826
+ kind: SnapshotExportKind;
827
+ source: FilesystemSnapshotExport;
828
+ };
829
+ type RulePermissions<T> = {
830
+ default?: PermissionMode | null;
831
+ rules: Array<T>;
832
+ };
833
+ type SnapshotExportKind = "snapshot-export";
834
+ type SoftwareInstall = {
835
+ source: RemotePackageSourceInput;
836
+ expectedRevision?: number | bigint | null;
837
+ };
838
+ type SoftwareList = Record<string, never>;
839
+ type SoftwareMutationResult = {
840
+ software?: ActorInstalledSoftware | null;
841
+ source: RemotePackageSource;
842
+ config: ConfigSnapshot;
843
+ };
844
+ type SoftwareUninstall = {
845
+ packageId: string;
846
+ expectedRevision?: number | bigint | null;
847
+ };
848
+ type SpawnStdio = "pipe" | "inherit";
849
+ type SqliteLimits = {
850
+ maxResultBytes?: number | bigint | null;
851
+ };
852
+ type TerminalClose = {
853
+ terminal: ActorTerminalId;
854
+ };
855
+ type TerminalExitEvent = {
856
+ terminal: ActorTerminalId;
857
+ status: ActorExitStatus;
858
+ };
859
+ type TerminalList = Record<string, never>;
860
+ type TerminalOpen = {
861
+ options?: ActorTerminalOptions;
862
+ };
863
+ type TerminalOutputEvent = {
864
+ terminal: ActorTerminalId;
865
+ sequence: number | bigint;
866
+ stream: ProcessStream;
867
+ data: FileBytes;
868
+ timestampMs: number | bigint;
869
+ };
870
+ type TerminalOutputRead = {
871
+ terminal: ActorTerminalId;
872
+ after?: number | bigint | null;
873
+ maxBytes?: number | null;
874
+ maxEvents?: number | null;
875
+ };
876
+ type TerminalPtyResize = {
877
+ terminal: ActorTerminalId;
878
+ cols: number;
879
+ rows: number;
880
+ };
881
+ type TerminalStdinWrite = {
882
+ terminal: ActorTerminalId;
883
+ data: FileContentInput;
884
+ };
885
+ type TerminalWait = {
886
+ terminal: ActorTerminalId;
887
+ };
888
+ type TlsLimits = {
889
+ maxBufferedBytes?: number | bigint;
890
+ };
891
+ type TypeScriptCheck = {
892
+ source: string;
893
+ options?: ActorTypeScriptCheckOptions;
894
+ };
895
+ type TypeScriptCheckProject = {
896
+ options?: ActorTypeScriptCheckOptions;
897
+ };
898
+ type TypeScriptEvaluate = {
899
+ expression: string;
900
+ options?: ActorTypeScriptExecutionOptions;
901
+ };
902
+ type TypeScriptExecute = {
903
+ source: string;
904
+ options?: ActorTypeScriptExecutionOptions;
905
+ };
906
+ type TypeScriptExecuteFile = {
907
+ path: string;
908
+ options?: ActorTypeScriptExecutionOptions;
909
+ };
910
+ type TypeScriptSpawn = {
911
+ source: string;
912
+ options?: ActorLanguageSpawnOptions;
913
+ };
914
+ type TypeScriptSpawnFile = {
915
+ path: string;
916
+ options?: ActorLanguageSpawnOptions;
917
+ };
918
+ type VmBooted = {
919
+ generation: number | bigint;
920
+ configRevision: number | bigint;
921
+ bootedAtMs: number | bigint;
922
+ };
923
+ type VmGroupConfig = {
924
+ gid: number;
925
+ name: string;
926
+ members: Array<string>;
927
+ };
928
+ type VmIssue = {
929
+ code: string;
930
+ message: string;
931
+ atMs: number | bigint;
932
+ };
933
+ type VmLifecycleState = "initializing" | "preloading" | "booting" | "ready" | "degraded" | "stopping" | "failed";
934
+ type VmLimitWarning = {
935
+ limit: string;
936
+ observed: number | bigint;
937
+ capacity: number | bigint;
938
+ message: string;
939
+ };
940
+ type VmRestart = Record<string, never>;
941
+ type VmShutdown = {
942
+ generation: number | bigint;
943
+ reason: string;
944
+ shutdownAtMs: number | bigint;
945
+ };
946
+ type VmStatus = Record<string, never>;
947
+ type VmStatusSnapshot = {
948
+ lifecycle: VmLifecycleState;
949
+ configState: ConfigApplyState;
950
+ desiredConfigRevision: number | bigint;
951
+ appliedConfigRevision?: number | bigint | null;
952
+ generation: number | bigint;
953
+ lastBootAtMs?: number | bigint | null;
954
+ lastShutdownAtMs?: number | bigint | null;
955
+ packages: PackageStartupStatus;
956
+ issues: Array<VmIssue>;
957
+ core?: CoreSidecarStatus | null;
958
+ };
959
+ type VmUserAccountConfig = {
960
+ uid: number;
961
+ gid: number;
962
+ username: string;
963
+ homedir: string;
964
+ shell: string;
965
+ gecos?: string;
966
+ supplementaryGids: Array<number>;
967
+ };
968
+ type VmUserConfig = {
969
+ uid?: number;
970
+ gid?: number;
971
+ euid?: number;
972
+ egid?: number;
973
+ username?: string;
974
+ homedir?: string;
975
+ shell?: string;
976
+ gecos?: string;
977
+ groupName?: string;
978
+ supplementaryGids?: Array<number>;
979
+ accounts?: Array<VmUserAccountConfig>;
980
+ groups?: Array<VmGroupConfig>;
981
+ };
982
+ type WasmLimits = {
983
+ maxModuleFileBytes?: number | bigint | null;
984
+ capturedOutputLimitBytes?: number | bigint | null;
985
+ syncReadLimitBytes?: number | bigint | null;
986
+ prewarmTimeoutMs?: number | bigint | null;
987
+ runnerHeapLimitMb?: number | bigint | null;
988
+ runnerCpuTimeLimitMs?: number | bigint | null;
989
+ };
89
990
  }
90
- /**
91
- * One buffered adapter stderr line (`RuntimeHealth.stderrTail`). Always empty
92
- * today; kept in the reply shape so consumers stay stable when a stderr feed
93
- * lands.
94
- */
95
- interface RuntimeStderrLine {
96
- ts: number;
97
- line: string;
991
+ declare namespace Output {
992
+ type ActorCodeEvaluationResult = {
993
+ result: ActorCodeExecutionResult;
994
+ value?: JsonValue | null;
995
+ };
996
+ type ActorCodeExecutionResult = {
997
+ execution?: ActorExecutionDescriptor | null;
998
+ outcome: ActorExecutionOutcome;
999
+ exitCode?: number | null;
1000
+ error?: ActorExecutionError | null;
1001
+ stdout?: FileBytes | null;
1002
+ stderr?: FileBytes | null;
1003
+ stdoutTruncated?: boolean | null;
1004
+ stderrTruncated?: boolean | null;
1005
+ };
1006
+ type ActorContextDescriptor = {
1007
+ context: ActorContextId;
1008
+ state: string;
1009
+ language?: string | null;
1010
+ createdAtMs: number | bigint;
1011
+ lastStartedAtMs?: number | bigint | null;
1012
+ lastCompletedAtMs?: number | bigint | null;
1013
+ };
1014
+ type ActorContextId = {
1015
+ generation: number | bigint;
1016
+ contextId: string;
1017
+ };
1018
+ type ActorCronJob = {
1019
+ name: string;
1020
+ expression: string;
1021
+ timezone?: string | null;
1022
+ command: string;
1023
+ args: Array<string>;
1024
+ options: ActorSpawnOptions;
1025
+ configRevision: number | bigint;
1026
+ nextRunAtMs: number | bigint;
1027
+ lastRunAtMs?: number | bigint | null;
1028
+ maxHistory: number | bigint;
1029
+ };
1030
+ type ActorExecOptions = {
1031
+ env?: {
1032
+ [key in string]?: string;
1033
+ };
1034
+ cwd?: string | null;
1035
+ stdin?: FileContentInput | null;
1036
+ timeoutMs?: number | bigint | null;
1037
+ captureStdio?: boolean | null;
1038
+ };
1039
+ type ActorExecResult = {
1040
+ status: ActorExitStatus;
1041
+ stdout: string;
1042
+ stderr: string;
1043
+ };
1044
+ type ActorExecutionDescriptor = {
1045
+ executionId: string;
1046
+ generation: number | bigint;
1047
+ state: string;
1048
+ language?: string | null;
1049
+ processId?: string | null;
1050
+ pid?: number | null;
1051
+ createdAtMs: number | bigint;
1052
+ lastStartedAtMs?: number | bigint | null;
1053
+ lastCompletedAtMs?: number | bigint | null;
1054
+ lastOutcome?: ActorExecutionOutcome | null;
1055
+ lastExitCode?: number | null;
1056
+ };
1057
+ type ActorExecutionError = {
1058
+ code: string;
1059
+ name: string;
1060
+ message: string;
1061
+ stack?: string | null;
1062
+ details?: JsonValue | null;
1063
+ };
1064
+ type ActorExecutionOutcome = "succeeded" | "failed" | "cancelled" | "timedOut";
1065
+ type ActorExecutionOutputOptions = {
1066
+ capture?: ActorOutputCapture | null;
1067
+ retainEvents?: boolean | null;
1068
+ };
1069
+ type ActorExecutionPtyOptions = {
1070
+ cols?: number | null;
1071
+ rows?: number | null;
1072
+ };
1073
+ type ActorExitStatus = {
1074
+ exitCode: number;
1075
+ signal?: ActorSignal | null;
1076
+ };
1077
+ type ActorFetchStreamChunk = {
1078
+ body: FileBytes;
1079
+ done: boolean;
1080
+ };
1081
+ type ActorFetchStreamHead = {
1082
+ stream: ActorFetchStreamId;
1083
+ status: number;
1084
+ statusText: string;
1085
+ headers: Array<[string, string]>;
1086
+ };
1087
+ type ActorFetchStreamId = {
1088
+ generation: number | bigint;
1089
+ streamId: string;
1090
+ expiresAtMs: number | bigint;
1091
+ };
1092
+ type ActorFileStat = {
1093
+ mode: number;
1094
+ sizeBytes: number | bigint;
1095
+ blocks: number | bigint;
1096
+ dev: number | bigint;
1097
+ rdev: number | bigint;
1098
+ isDirectory: boolean;
1099
+ isSymbolicLink: boolean;
1100
+ atimeMs: number;
1101
+ mtimeMs: number;
1102
+ ctimeMs: number;
1103
+ birthtimeMs: number;
1104
+ ino: number | bigint;
1105
+ nlink: number | bigint;
1106
+ uid: number;
1107
+ gid: number;
1108
+ };
1109
+ type ActorHttpRequest = {
1110
+ port: number;
1111
+ path: string;
1112
+ method?: string;
1113
+ headers?: {
1114
+ [key in string]?: string;
1115
+ };
1116
+ body?: FileContentInput | null;
1117
+ };
1118
+ type ActorHttpResponse = {
1119
+ status: number;
1120
+ statusText: string;
1121
+ headers: Array<[string, string]>;
1122
+ body: FileBytes;
1123
+ };
1124
+ type ActorInlineExecutionOptions = {
1125
+ process?: ActorLanguageExecutionOptions;
1126
+ inputs?: {
1127
+ [key in string]?: JsonValue;
1128
+ } | null;
1129
+ };
1130
+ type ActorInstalledSoftware = {
1131
+ packageId: string;
1132
+ digest: string;
1133
+ sizeBytes: number | bigint;
1134
+ packageName: string;
1135
+ version: string;
1136
+ commands: Array<string>;
1137
+ };
1138
+ type ActorJavaScriptExecutionOptions = {
1139
+ inline?: ActorInlineExecutionOptions;
1140
+ format?: ActorJavaScriptModuleFormat | null;
1141
+ filePath?: string | null;
1142
+ };
1143
+ type ActorJavaScriptModuleFormat = "module" | "commonJs";
1144
+ type ActorLanguageExecutionOptions = {
1145
+ context?: ActorContextId | null;
1146
+ cwd?: string | null;
1147
+ env?: {
1148
+ [key in string]?: string;
1149
+ };
1150
+ args?: Array<string>;
1151
+ stdin?: FileContentInput | null;
1152
+ timeoutMs?: number | bigint | null;
1153
+ pty?: ActorExecutionPtyOptions | null;
1154
+ output?: ActorExecutionOutputOptions;
1155
+ };
1156
+ type ActorLanguageSpawnOptions = {
1157
+ cwd?: string | null;
1158
+ env?: {
1159
+ [key in string]?: string;
1160
+ };
1161
+ args?: Array<string>;
1162
+ stdin?: FileContentInput | null;
1163
+ timeoutMs?: number | bigint | null;
1164
+ pty?: ActorExecutionPtyOptions | null;
1165
+ };
1166
+ type ActorNpmInstallOptions = {
1167
+ context?: ActorContextId | null;
1168
+ cwd?: string | null;
1169
+ env?: {
1170
+ [key in string]?: string;
1171
+ };
1172
+ timeoutMs?: number | bigint | null;
1173
+ frozen?: boolean | null;
1174
+ dev?: boolean | null;
1175
+ global?: boolean | null;
1176
+ output?: ActorExecutionOutputOptions;
1177
+ };
1178
+ type ActorOutputCapture = "none" | "stderr" | "all";
1179
+ type ActorOutputEvent = {
1180
+ sequence: number | bigint;
1181
+ stream: ProcessStream;
1182
+ data: FileBytes;
1183
+ timestampMs: number | bigint;
1184
+ };
1185
+ type ActorOutputReplay = {
1186
+ generation: number | bigint;
1187
+ events: Array<ActorOutputEvent>;
1188
+ nextCursor?: number | bigint | null;
1189
+ hasMore: boolean;
1190
+ truncated: boolean;
1191
+ end?: ActorExitStatus | null;
1192
+ };
1193
+ type ActorPreview = {
1194
+ token: string;
1195
+ path: string;
1196
+ port: number;
1197
+ expiresAtMs: number | bigint;
1198
+ };
1199
+ type ActorProcessExit = {
1200
+ process: ActorProcessId;
1201
+ status: ActorExitStatus;
1202
+ };
1203
+ type ActorProcessId = {
1204
+ generation: number | bigint;
1205
+ pid: number;
1206
+ };
1207
+ type ActorProcessInfo = {
1208
+ process: ActorProcessId;
1209
+ command: string;
1210
+ args: Array<string>;
1211
+ running: boolean;
1212
+ exit?: ActorExitStatus | null;
1213
+ startedAtMs: number | bigint;
1214
+ };
1215
+ type ActorProcessTree = {
1216
+ generation: number | bigint;
1217
+ roots: Array<ActorProcessTreeNode>;
1218
+ };
1219
+ type ActorProcessTreeNode = {
1220
+ process?: ActorProcessId | null;
1221
+ pid: number;
1222
+ ppid: number;
1223
+ pgid: number;
1224
+ sid: number;
1225
+ driver: string;
1226
+ command: string;
1227
+ args: Array<string>;
1228
+ cwd: string;
1229
+ status: ProcessStatus;
1230
+ exit?: ActorExitStatus | null;
1231
+ startTimeMs: number;
1232
+ exitTimeMs?: number | null;
1233
+ children: Array<ActorProcessTreeNode>;
1234
+ };
1235
+ type ActorPythonInstallOptions = {
1236
+ context?: ActorContextId | null;
1237
+ cwd?: string | null;
1238
+ env?: {
1239
+ [key in string]?: string;
1240
+ };
1241
+ timeoutMs?: number | bigint | null;
1242
+ upgrade?: boolean | null;
1243
+ requirementsFile?: string | null;
1244
+ indexUrl?: string | null;
1245
+ extraIndexUrls?: Array<string>;
1246
+ output?: ActorExecutionOutputOptions;
1247
+ };
1248
+ type ActorSignal = "SIGTERM" | "SIGINT" | "SIGKILL";
1249
+ type ActorSpawnOptions = {
1250
+ env?: {
1251
+ [key in string]?: string;
1252
+ };
1253
+ cwd?: string | null;
1254
+ stdio?: SpawnStdio | null;
1255
+ stdinFd?: number | null;
1256
+ stdoutFd?: number | null;
1257
+ stderrFd?: number | null;
1258
+ };
1259
+ type ActorTerminalExit = {
1260
+ terminal: ActorTerminalId;
1261
+ status: ActorExitStatus;
1262
+ };
1263
+ type ActorTerminalId = {
1264
+ generation: number | bigint;
1265
+ shellId: string;
1266
+ };
1267
+ type ActorTerminalOptions = {
1268
+ command?: string | null;
1269
+ args?: Array<string>;
1270
+ env?: {
1271
+ [key in string]?: string;
1272
+ };
1273
+ cwd?: string | null;
1274
+ cols?: number | null;
1275
+ rows?: number | null;
1276
+ };
1277
+ type ActorTypeScriptCheckOptions = {
1278
+ context?: ActorContextId | null;
1279
+ cwd?: string | null;
1280
+ filePath?: string | null;
1281
+ tsconfigPath?: string | null;
1282
+ compilerOptions?: {
1283
+ [key in string]?: JsonValue;
1284
+ } | null;
1285
+ timeoutMs?: number | bigint | null;
1286
+ output?: ActorExecutionOutputOptions;
1287
+ };
1288
+ type ActorTypeScriptCheckResult = {
1289
+ result: ActorCodeExecutionResult;
1290
+ hasErrors?: boolean | null;
1291
+ diagnostics: Array<ActorTypeScriptDiagnostic>;
1292
+ };
1293
+ type ActorTypeScriptDiagnostic = {
1294
+ code: number;
1295
+ category: string;
1296
+ message: string;
1297
+ filePath?: string | null;
1298
+ line?: number | null;
1299
+ column?: number | null;
1300
+ };
1301
+ type ActorTypeScriptExecutionOptions = {
1302
+ inline?: ActorInlineExecutionOptions;
1303
+ filePath?: string | null;
1304
+ tsconfigPath?: string | null;
1305
+ compilerOptions?: {
1306
+ [key in string]?: JsonValue;
1307
+ } | null;
1308
+ };
1309
+ type AgentOsActorConfig = {
1310
+ user?: VmUserConfig | null;
1311
+ environment?: {
1312
+ [key in string]?: string;
1313
+ } | null;
1314
+ allowedNodeBuiltins?: Array<string> | null;
1315
+ highResolutionTime?: boolean | null;
1316
+ loopbackExemptPorts: Array<number>;
1317
+ limits?: AgentOsLimits | null;
1318
+ permissions?: Permissions | null;
1319
+ filesystem: HostedFilesystemConfig;
1320
+ defaultSoftware?: boolean | null;
1321
+ software: Array<RemotePackageSource>;
1322
+ preview: PreviewPolicy;
1323
+ };
1324
+ type AgentOsActorConfigInput = {
1325
+ user?: VmUserConfig | null;
1326
+ environment?: {
1327
+ [key in string]?: string;
1328
+ } | null;
1329
+ allowedNodeBuiltins?: Array<string> | null;
1330
+ highResolutionTime?: boolean | null;
1331
+ loopbackExemptPorts?: Array<number> | null;
1332
+ limits?: AgentOsLimits | null;
1333
+ permissions?: Permissions | null;
1334
+ filesystem?: HostedFilesystemConfigInput | null;
1335
+ /**
1336
+ * Install agentOS default software (coreutils, sed, grep, gawk, findutils,
1337
+ * diffutils, tar, gzip) before `software`. Defaults to true.
1338
+ */
1339
+ defaultSoftware?: boolean | null;
1340
+ software?: Array<RemotePackageSourceInput> | null;
1341
+ preview?: PreviewPolicyInput | null;
1342
+ };
1343
+ type AgentOsActorCreateInput = {
1344
+ config?: AgentOsActorConfigInput | null;
1345
+ };
1346
+ type AgentOsLimits = {
1347
+ agentosPackages?: AgentOsPackageLimits;
1348
+ resources?: ResourceLimits | null;
1349
+ http?: HttpLimits | null;
1350
+ tls?: TlsLimits;
1351
+ hostFunctions?: HostFunctionLimits | null;
1352
+ plugins?: PluginLimits | null;
1353
+ sqlite?: SqliteLimits | null;
1354
+ jsRuntime?: JsRuntimeLimits | null;
1355
+ python?: PythonLimits | null;
1356
+ wasm?: WasmLimits | null;
1357
+ execution?: ExecutionLimits;
1358
+ process?: ProcessLimits | null;
1359
+ };
1360
+ type AgentOsPackageLimits = {
1361
+ maxMounts?: number | bigint;
1362
+ };
1363
+ type ConfigApplyState = "applying" | "ready" | "restart_required" | "failed";
1364
+ type ConfigGet = Record<string, never>;
1365
+ type ConfigPatch = {
1366
+ patch: JsonValue;
1367
+ expectedRevision?: number | bigint | null;
1368
+ };
1369
+ type ConfigSet = {
1370
+ config: AgentOsActorConfigInput;
1371
+ expectedRevision?: number | bigint | null;
1372
+ };
1373
+ type ConfigSnapshot = {
1374
+ revision: number | bigint;
1375
+ desired: AgentOsActorConfig;
1376
+ appliedRevision?: number | bigint | null;
1377
+ state: ConfigApplyState;
1378
+ issues: Array<VmIssue>;
1379
+ createdAtMs: number | bigint;
1380
+ updatedAtMs: number | bigint;
1381
+ };
1382
+ type ContextsCreate = {
1383
+ contextId: string;
1384
+ };
1385
+ type ContextsDelete = {
1386
+ context: ActorContextId;
1387
+ };
1388
+ type ContextsGet = {
1389
+ context: ActorContextId;
1390
+ };
1391
+ type ContextsList = Record<string, never>;
1392
+ type ContextsReset = {
1393
+ context: ActorContextId;
1394
+ };
1395
+ type CoreSidecarStatus = {
1396
+ state: string;
1397
+ activeVmCount: number;
1398
+ };
1399
+ type CronCancel = {
1400
+ name: string;
1401
+ };
1402
+ type CronFiredEvent = {
1403
+ scheduleName: string;
1404
+ process?: ActorProcessId | null;
1405
+ error?: CronLaunchError | null;
1406
+ firedAtMs: number | bigint;
1407
+ };
1408
+ type CronLaunchError = {
1409
+ code: string;
1410
+ message: string;
1411
+ };
1412
+ type CronList = Record<string, never>;
1413
+ type CronSchedule = {
1414
+ name?: string | null;
1415
+ expression: string;
1416
+ timezone?: string | null;
1417
+ command: string;
1418
+ args?: Array<string>;
1419
+ options?: ActorSpawnOptions;
1420
+ maxHistory?: number | bigint | null;
1421
+ };
1422
+ type DirEntryType = "file" | "directory" | "symlink";
1423
+ type ExecutionLimits = {
1424
+ completedTtlMs?: number | bigint;
1425
+ maxCompletedExecutions?: number | bigint;
1426
+ liveExecutionWarningThreshold?: number | bigint;
1427
+ };
1428
+ type FileBytes = Uint8Array;
1429
+ type FileContentInput = string | Uint8Array;
1430
+ type FilesystemEntry = {
1431
+ path: string;
1432
+ type: DirEntryType;
1433
+ mode: string;
1434
+ uid: number;
1435
+ gid: number;
1436
+ content?: string | null;
1437
+ encoding?: FilesystemEntryEncoding | null;
1438
+ target?: string | null;
1439
+ };
1440
+ type FilesystemEntryEncoding = "utf8" | "base64";
1441
+ type FilesystemExists = {
1442
+ path: string;
1443
+ };
1444
+ type FilesystemExport = {
1445
+ maxBytes?: number | null;
1446
+ };
1447
+ type FilesystemListMounts = Record<string, never>;
1448
+ type FilesystemMkdir = {
1449
+ path: string;
1450
+ recursive?: boolean;
1451
+ };
1452
+ type FilesystemMove = {
1453
+ from: string;
1454
+ to: string;
1455
+ };
1456
+ type FilesystemReadFile = {
1457
+ path: string;
1458
+ maxBytes?: number | null;
1459
+ };
1460
+ type FilesystemReadFiles = {
1461
+ paths: Array<string>;
1462
+ maxBytes?: number | null;
1463
+ };
1464
+ type FilesystemReaddir = {
1465
+ path: string;
1466
+ };
1467
+ type FilesystemReaddirEntries = {
1468
+ path: string;
1469
+ };
1470
+ type FilesystemReaddirRecursive = {
1471
+ path: string;
1472
+ maxDepth?: number | null;
1473
+ exclude?: Array<string>;
1474
+ };
1475
+ type FilesystemRemove = {
1476
+ path: string;
1477
+ recursive?: boolean;
1478
+ };
1479
+ type FilesystemSnapshotEntries = {
1480
+ entries: Array<FilesystemEntry>;
1481
+ };
1482
+ type FilesystemSnapshotExport = {
1483
+ format: string;
1484
+ filesystem: FilesystemSnapshotEntries;
1485
+ };
1486
+ type FilesystemStat = {
1487
+ path: string;
1488
+ };
1489
+ type FilesystemWriteEntry = {
1490
+ path: string;
1491
+ content: FileContentInput;
1492
+ };
1493
+ type FilesystemWriteFile = {
1494
+ path: string;
1495
+ content: FileContentInput;
1496
+ };
1497
+ type FilesystemWriteFiles = {
1498
+ entries: Array<FilesystemWriteEntry>;
1499
+ };
1500
+ type FsPermissionRule = {
1501
+ mode: PermissionMode;
1502
+ operations?: Array<string> | null;
1503
+ paths?: Array<string> | null;
1504
+ };
1505
+ type FsPermissions = PermissionMode | RulePermissions<FsPermissionRule>;
1506
+ type HostFunctionLimits = {
1507
+ defaultTimeoutMs?: number | bigint | null;
1508
+ maxTimeoutMs?: number | bigint | null;
1509
+ maxRegisteredCollections?: number | bigint | null;
1510
+ maxRegisteredFunctionsPerVm?: number | bigint | null;
1511
+ maxFunctionsPerCollection?: number | bigint | null;
1512
+ maxSchemaBytes?: number | bigint | null;
1513
+ maxExamplesPerFunction?: number | bigint | null;
1514
+ maxExampleInputBytes?: number | bigint | null;
1515
+ };
1516
+ type HostedFilesystemBackend = {
1517
+ type: "durable";
1518
+ namespace: string;
1519
+ };
1520
+ type HostedFilesystemBackendInput = {
1521
+ type: "durable";
1522
+ namespace?: string | null;
1523
+ };
1524
+ type HostedFilesystemConfig = {
1525
+ root: HostedRootFilesystem;
1526
+ mounts: Array<HostedFilesystemMount>;
1527
+ };
1528
+ type HostedFilesystemConfigInput = {
1529
+ root?: HostedRootFilesystemInput | null;
1530
+ mounts?: Array<HostedFilesystemMountInput>;
1531
+ };
1532
+ type HostedFilesystemMount = {
1533
+ path: string;
1534
+ backend: HostedFilesystemBackend;
1535
+ readOnly: boolean;
1536
+ };
1537
+ type HostedFilesystemMountInput = {
1538
+ path: string;
1539
+ backend: HostedFilesystemBackendInput;
1540
+ readOnly?: boolean;
1541
+ };
1542
+ type HostedRootFilesystem = {
1543
+ type: "default";
1544
+ } | {
1545
+ type: "durable";
1546
+ namespace: string;
1547
+ readOnly: boolean;
1548
+ };
1549
+ type HostedRootFilesystemInput = {
1550
+ type: "default";
1551
+ } | {
1552
+ type: "durable";
1553
+ namespace?: string | null;
1554
+ readOnly?: boolean;
1555
+ };
1556
+ type HttpLimits = {
1557
+ maxFetchResponseBytes?: number | bigint | null;
1558
+ };
1559
+ type JavaScriptEvaluate = {
1560
+ expression: string;
1561
+ options?: ActorJavaScriptExecutionOptions;
1562
+ };
1563
+ type JavaScriptExecute = {
1564
+ source: string;
1565
+ options?: ActorJavaScriptExecutionOptions;
1566
+ };
1567
+ type JavaScriptExecuteFile = {
1568
+ path: string;
1569
+ options?: ActorLanguageExecutionOptions;
1570
+ };
1571
+ type JavaScriptNpmInstall = {
1572
+ packages?: Array<string>;
1573
+ options?: ActorNpmInstallOptions;
1574
+ };
1575
+ type JavaScriptNpmRunPackage = {
1576
+ packageSpec: string;
1577
+ binary?: string | null;
1578
+ options?: ActorLanguageExecutionOptions;
1579
+ };
1580
+ type JavaScriptNpmRunScript = {
1581
+ script: string;
1582
+ options?: ActorLanguageExecutionOptions;
1583
+ };
1584
+ type JavaScriptSpawn = {
1585
+ source: string;
1586
+ options?: ActorLanguageSpawnOptions;
1587
+ };
1588
+ type JavaScriptSpawnFile = {
1589
+ path: string;
1590
+ options?: ActorLanguageSpawnOptions;
1591
+ };
1592
+ type JsRuntimeLimits = {
1593
+ v8HeapLimitMb?: number | bigint | null;
1594
+ syncRpcWaitTimeoutMs?: number | bigint | null;
1595
+ cpuTimeLimitMs?: number | bigint | null;
1596
+ wallClockLimitMs?: number | bigint | null;
1597
+ importCacheMaterializeTimeoutMs?: number | bigint | null;
1598
+ capturedOutputLimitBytes?: number | bigint | null;
1599
+ stdinBufferLimitBytes?: number | bigint | null;
1600
+ eventPayloadLimitBytes?: number | bigint | null;
1601
+ v8IpcMaxFrameBytes?: number | bigint | null;
1602
+ };
1603
+ type JsonValue = number | string | boolean | Array<JsonValue> | {
1604
+ [key in string]?: JsonValue;
1605
+ } | null;
1606
+ type NetworkFetch = {
1607
+ request: ActorHttpRequest;
1608
+ };
1609
+ type NetworkFetchStreamCancel = {
1610
+ stream: ActorFetchStreamId;
1611
+ };
1612
+ type NetworkFetchStreamRead = {
1613
+ stream: ActorFetchStreamId;
1614
+ maxBytes?: number | null;
1615
+ };
1616
+ type NetworkFetchStreamStart = {
1617
+ request: ActorHttpRequest;
1618
+ };
1619
+ type NetworkPreviewCreate = {
1620
+ port: number;
1621
+ ttlMs?: number | bigint | null;
1622
+ };
1623
+ type NetworkPreviewExpire = {
1624
+ token: string;
1625
+ };
1626
+ type PackageStartupStatus = {
1627
+ requiredTotal: number;
1628
+ requiredReady: number;
1629
+ optionalPreloadTotal: number;
1630
+ optionalPreloadReady: number;
1631
+ optionalPreloadFailed: number;
1632
+ optionalPreloadSkipped: number;
1633
+ optionalPreloadWarmedBytes: number | bigint;
1634
+ optionalPreloadDeadlineHit: boolean;
1635
+ optionalPreloadCoordinatorAvailable: boolean;
1636
+ };
1637
+ type PatternPermissionRule = {
1638
+ mode: PermissionMode;
1639
+ operations?: Array<string> | null;
1640
+ patterns?: Array<string> | null;
1641
+ };
1642
+ type PatternPermissions = PermissionMode | RulePermissions<PatternPermissionRule>;
1643
+ type PermissionMode = "allow" | "deny";
1644
+ type Permissions = {
1645
+ fs?: FsPermissions | null;
1646
+ network?: PatternPermissions | null;
1647
+ childProcess?: PatternPermissions | null;
1648
+ process?: PatternPermissions | null;
1649
+ env?: PatternPermissions | null;
1650
+ hostFunction?: PatternPermissions | null;
1651
+ };
1652
+ type PluginLimits = {
1653
+ maxPersistedManifestBytes?: number | bigint | null;
1654
+ maxPersistedManifestFileBytes?: number | bigint | null;
1655
+ };
1656
+ type PreviewPolicy = {
1657
+ defaultTtlMs: number | bigint;
1658
+ maxTtlMs: number | bigint;
1659
+ maxActive: number;
1660
+ };
1661
+ type PreviewPolicyInput = {
1662
+ defaultTtlMs?: number | bigint | null;
1663
+ maxTtlMs?: number | bigint | null;
1664
+ maxActive?: number | null;
1665
+ };
1666
+ type ProcessExitEvent = {
1667
+ process: ActorProcessId;
1668
+ status: ActorExitStatus;
1669
+ };
1670
+ type ProcessGet = {
1671
+ process: ActorProcessId;
1672
+ };
1673
+ type ProcessLimits = {
1674
+ maxSpawnFileActions?: number | bigint | null;
1675
+ maxSpawnFileActionBytes?: number | bigint | null;
1676
+ pendingStdinBytes?: number | bigint | null;
1677
+ pendingEventCount?: number | bigint | null;
1678
+ pendingEventBytes?: number | bigint | null;
1679
+ };
1680
+ type ProcessList = Record<string, never>;
1681
+ type ProcessOutputEvent = {
1682
+ process: ActorProcessId;
1683
+ sequence: number | bigint;
1684
+ stream: ProcessStream;
1685
+ data: FileBytes;
1686
+ timestampMs: number | bigint;
1687
+ };
1688
+ type ProcessOutputRead = {
1689
+ process: ActorProcessId;
1690
+ after?: number | bigint | null;
1691
+ maxEvents?: number | null;
1692
+ maxBytes?: number | null;
1693
+ };
1694
+ type ProcessPtyResize = {
1695
+ process: ActorProcessId;
1696
+ cols: number;
1697
+ rows: number;
1698
+ };
1699
+ type ProcessRun = {
1700
+ command: string;
1701
+ args?: Array<string>;
1702
+ options?: ActorExecOptions;
1703
+ };
1704
+ type ProcessSignal = {
1705
+ process: ActorProcessId;
1706
+ signal: ActorSignal;
1707
+ };
1708
+ type ProcessSpawn = {
1709
+ command: string;
1710
+ args?: Array<string>;
1711
+ options?: ActorSpawnOptions;
1712
+ };
1713
+ type ProcessStatus = "running" | "exited";
1714
+ type ProcessStdinClose = {
1715
+ process: ActorProcessId;
1716
+ };
1717
+ type ProcessStdinWrite = {
1718
+ process: ActorProcessId;
1719
+ data: FileContentInput;
1720
+ };
1721
+ type ProcessStream = "stdout" | "stderr";
1722
+ type ProcessTree = Record<string, never>;
1723
+ type ProcessWait = {
1724
+ process: ActorProcessId;
1725
+ };
1726
+ type PythonEvaluate = {
1727
+ expression: string;
1728
+ options?: ActorInlineExecutionOptions;
1729
+ };
1730
+ type PythonExecute = {
1731
+ source: string;
1732
+ options?: ActorInlineExecutionOptions;
1733
+ };
1734
+ type PythonExecuteFile = {
1735
+ path: string;
1736
+ options?: ActorLanguageExecutionOptions;
1737
+ };
1738
+ type PythonExecuteModule = {
1739
+ module: string;
1740
+ options?: ActorLanguageExecutionOptions;
1741
+ };
1742
+ type PythonInstall = {
1743
+ packages?: Array<string>;
1744
+ options?: ActorPythonInstallOptions;
1745
+ };
1746
+ type PythonLimits = {
1747
+ outputBufferMaxBytes?: number | bigint | null;
1748
+ executionTimeoutMs?: number | bigint | null;
1749
+ maxOldSpaceMb?: number | bigint | null;
1750
+ vfsRpcTimeoutMs?: number | bigint | null;
1751
+ };
1752
+ type PythonSpawn = {
1753
+ source: string;
1754
+ options?: ActorLanguageSpawnOptions;
1755
+ };
1756
+ type PythonSpawnFile = {
1757
+ path: string;
1758
+ options?: ActorLanguageSpawnOptions;
1759
+ };
1760
+ type PythonSpawnModule = {
1761
+ module: string;
1762
+ options?: ActorLanguageSpawnOptions;
1763
+ };
1764
+ type RemotePackageSource = {
1765
+ url: string;
1766
+ digest?: string | null;
1767
+ sizeBytes?: number | bigint | null;
1768
+ packageId?: string | null;
1769
+ };
1770
+ type RemotePackageSourceInput = {
1771
+ url: string;
1772
+ digest?: string | null;
1773
+ /**
1774
+ * Resolution metadata is accepted so a `v1.config.get` snapshot can be sent
1775
+ * back to `v1.config.set`. Core re-resolves the source and never trusts it.
1776
+ */
1777
+ sizeBytes?: number | bigint | null;
1778
+ packageId?: string | null;
1779
+ };
1780
+ type ResourceLimits = {
1781
+ cpuCount?: number | bigint | null;
1782
+ maxProcesses?: number | bigint | null;
1783
+ maxOpenFds?: number | bigint | null;
1784
+ maxPipes?: number | bigint | null;
1785
+ maxPtys?: number | bigint | null;
1786
+ maxSockets?: number | bigint | null;
1787
+ maxConnections?: number | bigint | null;
1788
+ maxSocketBufferedBytes?: number | bigint | null;
1789
+ maxSocketDatagramQueueLen?: number | bigint | null;
1790
+ maxFilesystemBytes?: number | bigint | null;
1791
+ maxInodeCount?: number | bigint | null;
1792
+ maxBlockingReadMs?: number | bigint | null;
1793
+ maxPreadBytes?: number | bigint | null;
1794
+ maxFdWriteBytes?: number | bigint | null;
1795
+ maxProcessArgvBytes?: number | bigint | null;
1796
+ maxProcessEnvBytes?: number | bigint | null;
1797
+ maxReaddirEntries?: number | bigint | null;
1798
+ maxWasmFuel?: number | bigint | null;
1799
+ maxWasmMemoryBytes?: number | bigint | null;
1800
+ maxWasmStackBytes?: number | bigint | null;
1801
+ };
1802
+ type RootSnapshotExport = {
1803
+ kind: SnapshotExportKind;
1804
+ source: FilesystemSnapshotExport;
1805
+ };
1806
+ type RulePermissions<T> = {
1807
+ default?: PermissionMode | null;
1808
+ rules: Array<T>;
1809
+ };
1810
+ type SnapshotExportKind = "snapshot-export";
1811
+ type SoftwareInstall = {
1812
+ source: RemotePackageSourceInput;
1813
+ expectedRevision?: number | bigint | null;
1814
+ };
1815
+ type SoftwareList = Record<string, never>;
1816
+ type SoftwareMutationResult = {
1817
+ software?: ActorInstalledSoftware | null;
1818
+ source: RemotePackageSource;
1819
+ config: ConfigSnapshot;
1820
+ };
1821
+ type SoftwareUninstall = {
1822
+ packageId: string;
1823
+ expectedRevision?: number | bigint | null;
1824
+ };
1825
+ type SpawnStdio = "pipe" | "inherit";
1826
+ type SqliteLimits = {
1827
+ maxResultBytes?: number | bigint | null;
1828
+ };
1829
+ type TerminalClose = {
1830
+ terminal: ActorTerminalId;
1831
+ };
1832
+ type TerminalExitEvent = {
1833
+ terminal: ActorTerminalId;
1834
+ status: ActorExitStatus;
1835
+ };
1836
+ type TerminalList = Record<string, never>;
1837
+ type TerminalOpen = {
1838
+ options?: ActorTerminalOptions;
1839
+ };
1840
+ type TerminalOutputEvent = {
1841
+ terminal: ActorTerminalId;
1842
+ sequence: number | bigint;
1843
+ stream: ProcessStream;
1844
+ data: FileBytes;
1845
+ timestampMs: number | bigint;
1846
+ };
1847
+ type TerminalOutputRead = {
1848
+ terminal: ActorTerminalId;
1849
+ after?: number | bigint | null;
1850
+ maxBytes?: number | null;
1851
+ maxEvents?: number | null;
1852
+ };
1853
+ type TerminalPtyResize = {
1854
+ terminal: ActorTerminalId;
1855
+ cols: number;
1856
+ rows: number;
1857
+ };
1858
+ type TerminalStdinWrite = {
1859
+ terminal: ActorTerminalId;
1860
+ data: FileContentInput;
1861
+ };
1862
+ type TerminalWait = {
1863
+ terminal: ActorTerminalId;
1864
+ };
1865
+ type TlsLimits = {
1866
+ maxBufferedBytes?: number | bigint;
1867
+ };
1868
+ type TypeScriptCheck = {
1869
+ source: string;
1870
+ options?: ActorTypeScriptCheckOptions;
1871
+ };
1872
+ type TypeScriptCheckProject = {
1873
+ options?: ActorTypeScriptCheckOptions;
1874
+ };
1875
+ type TypeScriptEvaluate = {
1876
+ expression: string;
1877
+ options?: ActorTypeScriptExecutionOptions;
1878
+ };
1879
+ type TypeScriptExecute = {
1880
+ source: string;
1881
+ options?: ActorTypeScriptExecutionOptions;
1882
+ };
1883
+ type TypeScriptExecuteFile = {
1884
+ path: string;
1885
+ options?: ActorTypeScriptExecutionOptions;
1886
+ };
1887
+ type TypeScriptSpawn = {
1888
+ source: string;
1889
+ options?: ActorLanguageSpawnOptions;
1890
+ };
1891
+ type TypeScriptSpawnFile = {
1892
+ path: string;
1893
+ options?: ActorLanguageSpawnOptions;
1894
+ };
1895
+ type VmBooted = {
1896
+ generation: number | bigint;
1897
+ configRevision: number | bigint;
1898
+ bootedAtMs: number | bigint;
1899
+ };
1900
+ type VmGroupConfig = {
1901
+ gid: number;
1902
+ name: string;
1903
+ members: Array<string>;
1904
+ };
1905
+ type VmIssue = {
1906
+ code: string;
1907
+ message: string;
1908
+ atMs: number | bigint;
1909
+ };
1910
+ type VmLifecycleState = "initializing" | "preloading" | "booting" | "ready" | "degraded" | "stopping" | "failed";
1911
+ type VmLimitWarning = {
1912
+ limit: string;
1913
+ observed: number | bigint;
1914
+ capacity: number | bigint;
1915
+ message: string;
1916
+ };
1917
+ type VmRestart = Record<string, never>;
1918
+ type VmShutdown = {
1919
+ generation: number | bigint;
1920
+ reason: string;
1921
+ shutdownAtMs: number | bigint;
1922
+ };
1923
+ type VmStatus = Record<string, never>;
1924
+ type VmStatusSnapshot = {
1925
+ lifecycle: VmLifecycleState;
1926
+ configState: ConfigApplyState;
1927
+ desiredConfigRevision: number | bigint;
1928
+ appliedConfigRevision?: number | bigint | null;
1929
+ generation: number | bigint;
1930
+ lastBootAtMs?: number | bigint | null;
1931
+ lastShutdownAtMs?: number | bigint | null;
1932
+ packages: PackageStartupStatus;
1933
+ issues: Array<VmIssue>;
1934
+ core?: CoreSidecarStatus | null;
1935
+ };
1936
+ type VmUserAccountConfig = {
1937
+ uid: number;
1938
+ gid: number;
1939
+ username: string;
1940
+ homedir: string;
1941
+ shell: string;
1942
+ gecos?: string;
1943
+ supplementaryGids: Array<number>;
1944
+ };
1945
+ type VmUserConfig = {
1946
+ uid?: number;
1947
+ gid?: number;
1948
+ euid?: number;
1949
+ egid?: number;
1950
+ username?: string;
1951
+ homedir?: string;
1952
+ shell?: string;
1953
+ gecos?: string;
1954
+ groupName?: string;
1955
+ supplementaryGids?: Array<number>;
1956
+ accounts?: Array<VmUserAccountConfig>;
1957
+ groups?: Array<VmGroupConfig>;
1958
+ };
1959
+ type WasmLimits = {
1960
+ maxModuleFileBytes?: number | bigint | null;
1961
+ capturedOutputLimitBytes?: number | bigint | null;
1962
+ syncReadLimitBytes?: number | bigint | null;
1963
+ prewarmTimeoutMs?: number | bigint | null;
1964
+ runnerHeapLimitMb?: number | bigint | null;
1965
+ runnerCpuTimeLimitMs?: number | bigint | null;
1966
+ };
98
1967
  }
99
- /** `RuntimeHealth.sidecar`: the non-waking sidecar descriptor subset. */
100
- interface RuntimeSidecarInfo {
1968
+ type AgentOsActorCreateInput = Input.AgentOsActorCreateInput;
1969
+ type AgentOsRivetError = {
1970
+ group: string;
1971
+ code: string;
1972
+ message: string;
1973
+ metadata: Output.JsonValue | null;
1974
+ };
1975
+ type V1ConfigGetInput = Record<string, never>;
1976
+ type V1ConfigGetOutput = {
1977
+ revision: number | bigint;
1978
+ desired: Output.AgentOsActorConfig;
1979
+ appliedRevision?: number | bigint | null;
1980
+ state: Output.ConfigApplyState;
1981
+ issues: Array<Output.VmIssue>;
1982
+ createdAtMs: number | bigint;
1983
+ updatedAtMs: number | bigint;
1984
+ };
1985
+ type V1ConfigPatchInput = {
1986
+ patch: Input.JsonValue;
1987
+ expectedRevision?: number | bigint | null;
1988
+ };
1989
+ type V1ConfigPatchOutput = {
1990
+ revision: number | bigint;
1991
+ desired: Output.AgentOsActorConfig;
1992
+ appliedRevision?: number | bigint | null;
1993
+ state: Output.ConfigApplyState;
1994
+ issues: Array<Output.VmIssue>;
1995
+ createdAtMs: number | bigint;
1996
+ updatedAtMs: number | bigint;
1997
+ };
1998
+ type V1ConfigSetInput = {
1999
+ config: Input.AgentOsActorConfigInput;
2000
+ expectedRevision?: number | bigint | null;
2001
+ };
2002
+ type V1ConfigSetOutput = {
2003
+ revision: number | bigint;
2004
+ desired: Output.AgentOsActorConfig;
2005
+ appliedRevision?: number | bigint | null;
2006
+ state: Output.ConfigApplyState;
2007
+ issues: Array<Output.VmIssue>;
2008
+ createdAtMs: number | bigint;
2009
+ updatedAtMs: number | bigint;
2010
+ };
2011
+ type V1ContextsCreateInput = {
2012
+ contextId: string;
2013
+ };
2014
+ type V1ContextsCreateOutput = {
2015
+ context: Output.ActorContextId;
101
2016
  state: string;
102
- activeVmCount: number;
103
- }
104
- /**
105
- * Reply of the observe-only `health` action. Reading it never boots the VM;
106
- * the post-mortem buffers survive VM sleep so warnings and crash exits stay
107
- * readable while `booted` is false.
108
- */
109
- interface RuntimeHealth {
110
- booted: boolean;
111
- /**
112
- * Count of sessions with live event subscriptions through this actor since
113
- * the last wake (not total loaded sessions); `null` while the VM is down.
114
- */
115
- sessions: number | null;
116
- /** Sidecar descriptor; `null` while the VM is down. */
117
- sidecar: RuntimeSidecarInfo | null;
118
- warnings: RuntimeLimitWarning[];
119
- agentExits: RuntimeAgentExit[];
120
- stderrTail: RuntimeStderrLine[];
121
- }
122
- /**
123
- * One live shell from the observe-only `listShells` action. A shell outlives
124
- * the page that opened it and keeps the VM awake until closed, so enumeration
125
- * is server-owned rather than tracked per client.
126
- */
127
- interface ShellInfo {
128
- shellId: string;
129
- /** Epoch ms when the shell was opened through this actor. */
130
- openedAt: number;
131
- }
132
- /**
133
- * How much of a shell's history a snapshot repaints.
134
- *
135
- * - `none` — sequence number only; the caller repaints nothing.
136
- * - `screen` — the visible viewport, cursor, and terminal modes.
137
- * - `scrollback` — the retained scrollback above the viewport, then `screen`.
138
- */
139
- type ShellReplayMode = "none" | "screen" | "scrollback";
140
- /**
141
- * Server-rendered repaint for a shell that is already running. `data` is an
142
- * ANSI stream to write verbatim into a fresh terminal.
143
- */
144
- interface ShellSnapshot {
145
- shellId: string;
146
- mode: ShellReplayMode;
147
- /**
148
- * Sequence of the last `shellData` chunk folded into this snapshot.
149
- * Broadcasts carry the same counter, so a client applies the snapshot and
150
- * then only the chunks whose `seq` is greater — no gap, no double-render.
151
- */
152
- seq: number;
153
- cols: number;
154
- rows: number;
155
- data: string;
156
- }
157
- type SerializableCronAction = {
158
- type: "session";
159
- agentType: string;
160
- prompt: string;
161
- cwd?: string;
162
- } | {
163
- type: "exec";
2017
+ language?: string | null;
2018
+ createdAtMs: number | bigint;
2019
+ lastStartedAtMs?: number | bigint | null;
2020
+ lastCompletedAtMs?: number | bigint | null;
2021
+ };
2022
+ type V1ContextsDeleteInput = {
2023
+ context: Input.ActorContextId;
2024
+ };
2025
+ type V1ContextsDeleteOutput = void;
2026
+ type V1ContextsGetInput = {
2027
+ context: Input.ActorContextId;
2028
+ };
2029
+ type V1ContextsGetOutput = {
2030
+ context: Output.ActorContextId;
2031
+ state: string;
2032
+ language?: string | null;
2033
+ createdAtMs: number | bigint;
2034
+ lastStartedAtMs?: number | bigint | null;
2035
+ lastCompletedAtMs?: number | bigint | null;
2036
+ };
2037
+ type V1ContextsListInput = Record<string, never>;
2038
+ type V1ContextsListOutput = Array<{
2039
+ context: Output.ActorContextId;
2040
+ state: string;
2041
+ language?: string | null;
2042
+ createdAtMs: number | bigint;
2043
+ lastStartedAtMs?: number | bigint | null;
2044
+ lastCompletedAtMs?: number | bigint | null;
2045
+ }>;
2046
+ type V1ContextsResetInput = {
2047
+ context: Input.ActorContextId;
2048
+ };
2049
+ type V1ContextsResetOutput = {
2050
+ context: Output.ActorContextId;
2051
+ state: string;
2052
+ language?: string | null;
2053
+ createdAtMs: number | bigint;
2054
+ lastStartedAtMs?: number | bigint | null;
2055
+ lastCompletedAtMs?: number | bigint | null;
2056
+ };
2057
+ type V1CronCancelInput = {
2058
+ name: string;
2059
+ };
2060
+ type V1CronCancelOutput = boolean;
2061
+ type V1CronListInput = Record<string, never>;
2062
+ type V1CronListOutput = Array<{
2063
+ name: string;
2064
+ expression: string;
2065
+ timezone?: string | null;
2066
+ command: string;
2067
+ args: Array<string>;
2068
+ options: Output.ActorSpawnOptions;
2069
+ configRevision: number | bigint;
2070
+ nextRunAtMs: number | bigint;
2071
+ lastRunAtMs?: number | bigint | null;
2072
+ maxHistory: number | bigint;
2073
+ }>;
2074
+ type V1CronScheduleInput = {
2075
+ name?: string | null;
2076
+ expression: string;
2077
+ timezone?: string | null;
164
2078
  command: string;
165
- args?: string[];
2079
+ args?: Array<string>;
2080
+ options?: Input.ActorSpawnOptions;
2081
+ maxHistory?: number | bigint | null;
166
2082
  };
167
- interface SerializableCronJobOptions {
168
- id?: string;
169
- schedule: string;
170
- action: SerializableCronAction;
171
- overlap?: "allow" | "skip" | "queue";
172
- }
173
- type SerializableCronJobInfo = CronJobInfo;
174
-
175
- type BuiltInEvents = {
176
- [K in keyof AgentOsEvents]: Type<AgentOsEvents[K]>;
177
- };
178
- type ActorDb = DatabaseProvider<RawAccess>;
179
- type EventSchemaConfig = Record<string, any>;
180
- type QueueSchemaConfig = Record<string, any>;
181
- type AnyContext = ActorContext<any, any, any, any, any, ActorDb, any, any>;
182
- interface VmFetchOptions {
183
- method?: string;
184
- headers?: Record<string, string>;
185
- body?: string | Uint8Array;
186
- }
187
- interface VmFetchResponse {
2083
+ type V1CronScheduleOutput = {
2084
+ name: string;
2085
+ expression: string;
2086
+ timezone?: string | null;
2087
+ command: string;
2088
+ args: Array<string>;
2089
+ options: Output.ActorSpawnOptions;
2090
+ configRevision: number | bigint;
2091
+ nextRunAtMs: number | bigint;
2092
+ lastRunAtMs?: number | bigint | null;
2093
+ maxHistory: number | bigint;
2094
+ };
2095
+ type V1FilesystemExistsInput = {
2096
+ path: string;
2097
+ };
2098
+ type V1FilesystemExistsOutput = boolean;
2099
+ type V1FilesystemExportInput = {
2100
+ maxBytes?: number | null;
2101
+ };
2102
+ type V1FilesystemExportOutput = {
2103
+ kind: Output.SnapshotExportKind;
2104
+ source: Output.FilesystemSnapshotExport;
2105
+ };
2106
+ type V1FilesystemListMountsInput = Record<string, never>;
2107
+ type V1FilesystemListMountsOutput = Array<{
2108
+ path: string;
2109
+ kind: string;
2110
+ readOnly: boolean;
2111
+ }>;
2112
+ type V1FilesystemMkdirInput = {
2113
+ path: string;
2114
+ recursive?: boolean;
2115
+ };
2116
+ type V1FilesystemMkdirOutput = void;
2117
+ type V1FilesystemMoveInput = {
2118
+ from: string;
2119
+ to: string;
2120
+ };
2121
+ type V1FilesystemMoveOutput = void;
2122
+ type V1FilesystemReadFileInput = {
2123
+ path: string;
2124
+ maxBytes?: number | null;
2125
+ };
2126
+ type V1FilesystemReadFileOutput = Uint8Array;
2127
+ type V1FilesystemReadFilesInput = {
2128
+ paths: Array<string>;
2129
+ maxBytes?: number | null;
2130
+ };
2131
+ type V1FilesystemReadFilesOutput = Array<{
2132
+ path: string;
2133
+ content?: Output.FileBytes | null;
2134
+ error?: string | null;
2135
+ }>;
2136
+ type V1FilesystemReaddirInput = {
2137
+ path: string;
2138
+ };
2139
+ type V1FilesystemReaddirOutput = Array<string>;
2140
+ type V1FilesystemReaddirEntriesInput = {
2141
+ path: string;
2142
+ };
2143
+ type V1FilesystemReaddirEntriesOutput = Array<{
2144
+ name: string;
2145
+ isDirectory: boolean;
2146
+ isSymbolicLink: boolean;
2147
+ }>;
2148
+ type V1FilesystemReaddirRecursiveInput = {
2149
+ path: string;
2150
+ maxDepth?: number | null;
2151
+ exclude?: Array<string>;
2152
+ };
2153
+ type V1FilesystemReaddirRecursiveOutput = Array<{
2154
+ path: string;
2155
+ type: Output.DirEntryType;
2156
+ sizeBytes: number | bigint;
2157
+ }>;
2158
+ type V1FilesystemRemoveInput = {
2159
+ path: string;
2160
+ recursive?: boolean;
2161
+ };
2162
+ type V1FilesystemRemoveOutput = void;
2163
+ type V1FilesystemStatInput = {
2164
+ path: string;
2165
+ };
2166
+ type V1FilesystemStatOutput = {
2167
+ mode: number;
2168
+ sizeBytes: number | bigint;
2169
+ blocks: number | bigint;
2170
+ dev: number | bigint;
2171
+ rdev: number | bigint;
2172
+ isDirectory: boolean;
2173
+ isSymbolicLink: boolean;
2174
+ atimeMs: number;
2175
+ mtimeMs: number;
2176
+ ctimeMs: number;
2177
+ birthtimeMs: number;
2178
+ ino: number | bigint;
2179
+ nlink: number | bigint;
2180
+ uid: number;
2181
+ gid: number;
2182
+ };
2183
+ type V1FilesystemWriteFileInput = {
2184
+ path: string;
2185
+ content: Input.FileContentInput;
2186
+ };
2187
+ type V1FilesystemWriteFileOutput = void;
2188
+ type V1FilesystemWriteFilesInput = {
2189
+ entries: Array<Input.FilesystemWriteEntry>;
2190
+ };
2191
+ type V1FilesystemWriteFilesOutput = Array<{
2192
+ path: string;
2193
+ success: boolean;
2194
+ error?: string | null;
2195
+ }>;
2196
+ type V1JavaScriptEvaluateInput = {
2197
+ expression: string;
2198
+ options?: Input.ActorJavaScriptExecutionOptions;
2199
+ };
2200
+ type V1JavaScriptEvaluateOutput = {
2201
+ result: Output.ActorCodeExecutionResult;
2202
+ value?: Output.JsonValue | null;
2203
+ };
2204
+ type V1JavaScriptExecuteInput = {
2205
+ source: string;
2206
+ options?: Input.ActorJavaScriptExecutionOptions;
2207
+ };
2208
+ type V1JavaScriptExecuteOutput = {
2209
+ execution?: Output.ActorExecutionDescriptor | null;
2210
+ outcome: Output.ActorExecutionOutcome;
2211
+ exitCode?: number | null;
2212
+ error?: Output.ActorExecutionError | null;
2213
+ stdout?: Output.FileBytes | null;
2214
+ stderr?: Output.FileBytes | null;
2215
+ stdoutTruncated?: boolean | null;
2216
+ stderrTruncated?: boolean | null;
2217
+ };
2218
+ type V1JavaScriptExecuteFileInput = {
2219
+ path: string;
2220
+ options?: Input.ActorLanguageExecutionOptions;
2221
+ };
2222
+ type V1JavaScriptExecuteFileOutput = {
2223
+ execution?: Output.ActorExecutionDescriptor | null;
2224
+ outcome: Output.ActorExecutionOutcome;
2225
+ exitCode?: number | null;
2226
+ error?: Output.ActorExecutionError | null;
2227
+ stdout?: Output.FileBytes | null;
2228
+ stderr?: Output.FileBytes | null;
2229
+ stdoutTruncated?: boolean | null;
2230
+ stderrTruncated?: boolean | null;
2231
+ };
2232
+ type V1JavaScriptNpmInstallInput = {
2233
+ packages?: Array<string>;
2234
+ options?: Input.ActorNpmInstallOptions;
2235
+ };
2236
+ type V1JavaScriptNpmInstallOutput = {
2237
+ execution?: Output.ActorExecutionDescriptor | null;
2238
+ outcome: Output.ActorExecutionOutcome;
2239
+ exitCode?: number | null;
2240
+ error?: Output.ActorExecutionError | null;
2241
+ stdout?: Output.FileBytes | null;
2242
+ stderr?: Output.FileBytes | null;
2243
+ stdoutTruncated?: boolean | null;
2244
+ stderrTruncated?: boolean | null;
2245
+ };
2246
+ type V1JavaScriptNpmRunPackageInput = {
2247
+ packageSpec: string;
2248
+ binary?: string | null;
2249
+ options?: Input.ActorLanguageExecutionOptions;
2250
+ };
2251
+ type V1JavaScriptNpmRunPackageOutput = {
2252
+ execution?: Output.ActorExecutionDescriptor | null;
2253
+ outcome: Output.ActorExecutionOutcome;
2254
+ exitCode?: number | null;
2255
+ error?: Output.ActorExecutionError | null;
2256
+ stdout?: Output.FileBytes | null;
2257
+ stderr?: Output.FileBytes | null;
2258
+ stdoutTruncated?: boolean | null;
2259
+ stderrTruncated?: boolean | null;
2260
+ };
2261
+ type V1JavaScriptNpmRunScriptInput = {
2262
+ script: string;
2263
+ options?: Input.ActorLanguageExecutionOptions;
2264
+ };
2265
+ type V1JavaScriptNpmRunScriptOutput = {
2266
+ execution?: Output.ActorExecutionDescriptor | null;
2267
+ outcome: Output.ActorExecutionOutcome;
2268
+ exitCode?: number | null;
2269
+ error?: Output.ActorExecutionError | null;
2270
+ stdout?: Output.FileBytes | null;
2271
+ stderr?: Output.FileBytes | null;
2272
+ stdoutTruncated?: boolean | null;
2273
+ stderrTruncated?: boolean | null;
2274
+ };
2275
+ type V1JavaScriptSpawnInput = {
2276
+ source: string;
2277
+ options?: Input.ActorLanguageSpawnOptions;
2278
+ };
2279
+ type V1JavaScriptSpawnOutput = {
2280
+ generation: number | bigint;
2281
+ pid: number;
2282
+ };
2283
+ type V1JavaScriptSpawnFileInput = {
2284
+ path: string;
2285
+ options?: Input.ActorLanguageSpawnOptions;
2286
+ };
2287
+ type V1JavaScriptSpawnFileOutput = {
2288
+ generation: number | bigint;
2289
+ pid: number;
2290
+ };
2291
+ type V1NetworkFetchInput = {
2292
+ request: Input.ActorHttpRequest;
2293
+ };
2294
+ type V1NetworkFetchOutput = {
188
2295
  status: number;
189
2296
  statusText: string;
190
- headers: Record<string, string>;
191
- rawHeaders?: Array<[string, string]>;
192
- body: Uint8Array;
193
- }
194
- interface VmFetchStreamHead {
195
- streamId: string;
2297
+ headers: Array<[string, string]>;
2298
+ body: Output.FileBytes;
2299
+ };
2300
+ type V1NetworkFetchStreamCancelInput = {
2301
+ stream: Input.ActorFetchStreamId;
2302
+ };
2303
+ type V1NetworkFetchStreamCancelOutput = void;
2304
+ type V1NetworkFetchStreamReadInput = {
2305
+ stream: Input.ActorFetchStreamId;
2306
+ maxBytes?: number | null;
2307
+ };
2308
+ type V1NetworkFetchStreamReadOutput = {
2309
+ body: Output.FileBytes;
2310
+ done: boolean;
2311
+ };
2312
+ type V1NetworkFetchStreamStartInput = {
2313
+ request: Input.ActorHttpRequest;
2314
+ };
2315
+ type V1NetworkFetchStreamStartOutput = {
2316
+ stream: Output.ActorFetchStreamId;
196
2317
  status: number;
197
2318
  statusText: string;
198
- headers: Record<string, string>;
199
- rawHeaders?: Array<[string, string]>;
200
- }
201
- interface VmFetchStreamChunk {
202
- body: Uint8Array;
203
- done: boolean;
204
- }
205
- interface AgentOsEventHooks<TContext = AnyContext> {
206
- onSessionEvent?: (c: TContext, sessionId: string, event: SessionStreamEntry) => void | Promise<void>;
2319
+ headers: Array<[string, string]>;
2320
+ };
2321
+ type V1NetworkPreviewCreateInput = {
2322
+ port: number;
2323
+ ttlMs?: number | bigint | null;
2324
+ };
2325
+ type V1NetworkPreviewCreateOutput = {
2326
+ token: string;
2327
+ path: string;
2328
+ port: number;
2329
+ expiresAtMs: number | bigint;
2330
+ };
2331
+ type V1NetworkPreviewExpireInput = {
2332
+ token: string;
2333
+ };
2334
+ type V1NetworkPreviewExpireOutput = boolean;
2335
+ type V1ProcessGetInput = {
2336
+ process: Input.ActorProcessId;
2337
+ };
2338
+ type V1ProcessGetOutput = {
2339
+ process: Output.ActorProcessId;
2340
+ command: string;
2341
+ args: Array<string>;
2342
+ running: boolean;
2343
+ exit?: Output.ActorExitStatus | null;
2344
+ startedAtMs: number | bigint;
2345
+ };
2346
+ type V1ProcessListInput = Record<string, never>;
2347
+ type V1ProcessListOutput = Array<{
2348
+ process: Output.ActorProcessId;
2349
+ command: string;
2350
+ args: Array<string>;
2351
+ running: boolean;
2352
+ exit?: Output.ActorExitStatus | null;
2353
+ startedAtMs: number | bigint;
2354
+ }>;
2355
+ type V1ProcessOutputReadInput = {
2356
+ process: Input.ActorProcessId;
2357
+ after?: number | bigint | null;
2358
+ maxEvents?: number | null;
2359
+ maxBytes?: number | null;
2360
+ };
2361
+ type V1ProcessOutputReadOutput = {
2362
+ generation: number | bigint;
2363
+ events: Array<Output.ActorOutputEvent>;
2364
+ nextCursor?: number | bigint | null;
2365
+ hasMore: boolean;
2366
+ truncated: boolean;
2367
+ end?: Output.ActorExitStatus | null;
2368
+ };
2369
+ type V1ProcessPtyResizeInput = {
2370
+ process: Input.ActorProcessId;
2371
+ cols: number;
2372
+ rows: number;
2373
+ };
2374
+ type V1ProcessPtyResizeOutput = void;
2375
+ type V1ProcessRunInput = {
2376
+ command: string;
2377
+ args?: Array<string>;
2378
+ options?: Input.ActorExecOptions;
2379
+ };
2380
+ type V1ProcessRunOutput = {
2381
+ status: Output.ActorExitStatus;
2382
+ stdout: string;
2383
+ stderr: string;
2384
+ };
2385
+ type V1ProcessSignalInput = {
2386
+ process: Input.ActorProcessId;
2387
+ signal: Input.ActorSignal;
2388
+ };
2389
+ type V1ProcessSignalOutput = void;
2390
+ type V1ProcessSpawnInput = {
2391
+ command: string;
2392
+ args?: Array<string>;
2393
+ options?: Input.ActorSpawnOptions;
2394
+ };
2395
+ type V1ProcessSpawnOutput = {
2396
+ generation: number | bigint;
2397
+ pid: number;
2398
+ };
2399
+ type V1ProcessStdinCloseInput = {
2400
+ process: Input.ActorProcessId;
2401
+ };
2402
+ type V1ProcessStdinCloseOutput = void;
2403
+ type V1ProcessStdinWriteInput = {
2404
+ process: Input.ActorProcessId;
2405
+ data: Input.FileContentInput;
2406
+ };
2407
+ type V1ProcessStdinWriteOutput = void;
2408
+ type V1ProcessTreeInput = Record<string, never>;
2409
+ type V1ProcessTreeOutput = {
2410
+ generation: number | bigint;
2411
+ roots: Array<Output.ActorProcessTreeNode>;
2412
+ };
2413
+ type V1ProcessWaitInput = {
2414
+ process: Input.ActorProcessId;
2415
+ };
2416
+ type V1ProcessWaitOutput = {
2417
+ process: Output.ActorProcessId;
2418
+ status: Output.ActorExitStatus;
2419
+ };
2420
+ type V1PythonEvaluateInput = {
2421
+ expression: string;
2422
+ options?: Input.ActorInlineExecutionOptions;
2423
+ };
2424
+ type V1PythonEvaluateOutput = {
2425
+ result: Output.ActorCodeExecutionResult;
2426
+ value?: Output.JsonValue | null;
2427
+ };
2428
+ type V1PythonExecuteInput = {
2429
+ source: string;
2430
+ options?: Input.ActorInlineExecutionOptions;
2431
+ };
2432
+ type V1PythonExecuteOutput = {
2433
+ execution?: Output.ActorExecutionDescriptor | null;
2434
+ outcome: Output.ActorExecutionOutcome;
2435
+ exitCode?: number | null;
2436
+ error?: Output.ActorExecutionError | null;
2437
+ stdout?: Output.FileBytes | null;
2438
+ stderr?: Output.FileBytes | null;
2439
+ stdoutTruncated?: boolean | null;
2440
+ stderrTruncated?: boolean | null;
2441
+ };
2442
+ type V1PythonExecuteFileInput = {
2443
+ path: string;
2444
+ options?: Input.ActorLanguageExecutionOptions;
2445
+ };
2446
+ type V1PythonExecuteFileOutput = {
2447
+ execution?: Output.ActorExecutionDescriptor | null;
2448
+ outcome: Output.ActorExecutionOutcome;
2449
+ exitCode?: number | null;
2450
+ error?: Output.ActorExecutionError | null;
2451
+ stdout?: Output.FileBytes | null;
2452
+ stderr?: Output.FileBytes | null;
2453
+ stdoutTruncated?: boolean | null;
2454
+ stderrTruncated?: boolean | null;
2455
+ };
2456
+ type V1PythonExecuteModuleInput = {
2457
+ module: string;
2458
+ options?: Input.ActorLanguageExecutionOptions;
2459
+ };
2460
+ type V1PythonExecuteModuleOutput = {
2461
+ execution?: Output.ActorExecutionDescriptor | null;
2462
+ outcome: Output.ActorExecutionOutcome;
2463
+ exitCode?: number | null;
2464
+ error?: Output.ActorExecutionError | null;
2465
+ stdout?: Output.FileBytes | null;
2466
+ stderr?: Output.FileBytes | null;
2467
+ stdoutTruncated?: boolean | null;
2468
+ stderrTruncated?: boolean | null;
2469
+ };
2470
+ type V1PythonInstallInput = {
2471
+ packages?: Array<string>;
2472
+ options?: Input.ActorPythonInstallOptions;
2473
+ };
2474
+ type V1PythonInstallOutput = {
2475
+ execution?: Output.ActorExecutionDescriptor | null;
2476
+ outcome: Output.ActorExecutionOutcome;
2477
+ exitCode?: number | null;
2478
+ error?: Output.ActorExecutionError | null;
2479
+ stdout?: Output.FileBytes | null;
2480
+ stderr?: Output.FileBytes | null;
2481
+ stdoutTruncated?: boolean | null;
2482
+ stderrTruncated?: boolean | null;
2483
+ };
2484
+ type V1PythonSpawnInput = {
2485
+ source: string;
2486
+ options?: Input.ActorLanguageSpawnOptions;
2487
+ };
2488
+ type V1PythonSpawnOutput = {
2489
+ generation: number | bigint;
2490
+ pid: number;
2491
+ };
2492
+ type V1PythonSpawnFileInput = {
2493
+ path: string;
2494
+ options?: Input.ActorLanguageSpawnOptions;
2495
+ };
2496
+ type V1PythonSpawnFileOutput = {
2497
+ generation: number | bigint;
2498
+ pid: number;
2499
+ };
2500
+ type V1PythonSpawnModuleInput = {
2501
+ module: string;
2502
+ options?: Input.ActorLanguageSpawnOptions;
2503
+ };
2504
+ type V1PythonSpawnModuleOutput = {
2505
+ generation: number | bigint;
2506
+ pid: number;
2507
+ };
2508
+ type V1SoftwareInstallInput = {
2509
+ source: Input.RemotePackageSourceInput;
2510
+ expectedRevision?: number | bigint | null;
2511
+ };
2512
+ type V1SoftwareInstallOutput = {
2513
+ software?: Output.ActorInstalledSoftware | null;
2514
+ source: Output.RemotePackageSource;
2515
+ config: Output.ConfigSnapshot;
2516
+ };
2517
+ type V1SoftwareListInput = Record<string, never>;
2518
+ type V1SoftwareListOutput = Array<{
2519
+ packageId: string;
2520
+ digest: string;
2521
+ sizeBytes: number | bigint;
2522
+ packageName: string;
2523
+ version: string;
2524
+ commands: Array<string>;
2525
+ }>;
2526
+ type V1SoftwareUninstallInput = {
2527
+ packageId: string;
2528
+ expectedRevision?: number | bigint | null;
2529
+ };
2530
+ type V1SoftwareUninstallOutput = {
2531
+ software?: Output.ActorInstalledSoftware | null;
2532
+ source: Output.RemotePackageSource;
2533
+ config: Output.ConfigSnapshot;
2534
+ };
2535
+ type V1TerminalCloseInput = {
2536
+ terminal: Input.ActorTerminalId;
2537
+ };
2538
+ type V1TerminalCloseOutput = void;
2539
+ type V1TerminalListInput = Record<string, never>;
2540
+ type V1TerminalListOutput = Array<{
2541
+ terminal: Output.ActorTerminalId;
2542
+ pid: number;
2543
+ running: boolean;
2544
+ exit?: Output.ActorExitStatus | null;
2545
+ }>;
2546
+ type V1TerminalOpenInput = {
2547
+ options?: Input.ActorTerminalOptions;
2548
+ };
2549
+ type V1TerminalOpenOutput = {
2550
+ generation: number | bigint;
2551
+ shellId: string;
2552
+ };
2553
+ type V1TerminalOutputReadInput = {
2554
+ terminal: Input.ActorTerminalId;
2555
+ after?: number | bigint | null;
2556
+ maxBytes?: number | null;
2557
+ maxEvents?: number | null;
2558
+ };
2559
+ type V1TerminalOutputReadOutput = {
2560
+ generation: number | bigint;
2561
+ events: Array<Output.ActorOutputEvent>;
2562
+ nextCursor?: number | bigint | null;
2563
+ hasMore: boolean;
2564
+ truncated: boolean;
2565
+ end?: Output.ActorExitStatus | null;
2566
+ };
2567
+ type V1TerminalPtyResizeInput = {
2568
+ terminal: Input.ActorTerminalId;
2569
+ cols: number;
2570
+ rows: number;
2571
+ };
2572
+ type V1TerminalPtyResizeOutput = void;
2573
+ type V1TerminalStdinWriteInput = {
2574
+ terminal: Input.ActorTerminalId;
2575
+ data: Input.FileContentInput;
2576
+ };
2577
+ type V1TerminalStdinWriteOutput = void;
2578
+ type V1TerminalWaitInput = {
2579
+ terminal: Input.ActorTerminalId;
2580
+ };
2581
+ type V1TerminalWaitOutput = {
2582
+ terminal: Output.ActorTerminalId;
2583
+ status: Output.ActorExitStatus;
2584
+ };
2585
+ type V1TypeScriptCheckInput = {
2586
+ source: string;
2587
+ options?: Input.ActorTypeScriptCheckOptions;
2588
+ };
2589
+ type V1TypeScriptCheckOutput = {
2590
+ result: Output.ActorCodeExecutionResult;
2591
+ hasErrors?: boolean | null;
2592
+ diagnostics: Array<Output.ActorTypeScriptDiagnostic>;
2593
+ };
2594
+ type V1TypeScriptCheckProjectInput = {
2595
+ options?: Input.ActorTypeScriptCheckOptions;
2596
+ };
2597
+ type V1TypeScriptCheckProjectOutput = {
2598
+ result: Output.ActorCodeExecutionResult;
2599
+ hasErrors?: boolean | null;
2600
+ diagnostics: Array<Output.ActorTypeScriptDiagnostic>;
2601
+ };
2602
+ type V1TypeScriptEvaluateInput = {
2603
+ expression: string;
2604
+ options?: Input.ActorTypeScriptExecutionOptions;
2605
+ };
2606
+ type V1TypeScriptEvaluateOutput = {
2607
+ result: Output.ActorCodeExecutionResult;
2608
+ value?: Output.JsonValue | null;
2609
+ };
2610
+ type V1TypeScriptExecuteInput = {
2611
+ source: string;
2612
+ options?: Input.ActorTypeScriptExecutionOptions;
2613
+ };
2614
+ type V1TypeScriptExecuteOutput = {
2615
+ execution?: Output.ActorExecutionDescriptor | null;
2616
+ outcome: Output.ActorExecutionOutcome;
2617
+ exitCode?: number | null;
2618
+ error?: Output.ActorExecutionError | null;
2619
+ stdout?: Output.FileBytes | null;
2620
+ stderr?: Output.FileBytes | null;
2621
+ stdoutTruncated?: boolean | null;
2622
+ stderrTruncated?: boolean | null;
2623
+ };
2624
+ type V1TypeScriptExecuteFileInput = {
2625
+ path: string;
2626
+ options?: Input.ActorTypeScriptExecutionOptions;
2627
+ };
2628
+ type V1TypeScriptExecuteFileOutput = {
2629
+ execution?: Output.ActorExecutionDescriptor | null;
2630
+ outcome: Output.ActorExecutionOutcome;
2631
+ exitCode?: number | null;
2632
+ error?: Output.ActorExecutionError | null;
2633
+ stdout?: Output.FileBytes | null;
2634
+ stderr?: Output.FileBytes | null;
2635
+ stdoutTruncated?: boolean | null;
2636
+ stderrTruncated?: boolean | null;
2637
+ };
2638
+ type V1TypeScriptSpawnInput = {
2639
+ source: string;
2640
+ options?: Input.ActorLanguageSpawnOptions;
2641
+ };
2642
+ type V1TypeScriptSpawnOutput = {
2643
+ generation: number | bigint;
2644
+ pid: number;
2645
+ };
2646
+ type V1TypeScriptSpawnFileInput = {
2647
+ path: string;
2648
+ options?: Input.ActorLanguageSpawnOptions;
2649
+ };
2650
+ type V1TypeScriptSpawnFileOutput = {
2651
+ generation: number | bigint;
2652
+ pid: number;
2653
+ };
2654
+ type V1VmRestartInput = Record<string, never>;
2655
+ type V1VmRestartOutput = {
2656
+ lifecycle: Output.VmLifecycleState;
2657
+ configState: Output.ConfigApplyState;
2658
+ desiredConfigRevision: number | bigint;
2659
+ appliedConfigRevision?: number | bigint | null;
2660
+ generation: number | bigint;
2661
+ lastBootAtMs?: number | bigint | null;
2662
+ lastShutdownAtMs?: number | bigint | null;
2663
+ packages: Output.PackageStartupStatus;
2664
+ issues: Array<Output.VmIssue>;
2665
+ core?: Output.CoreSidecarStatus | null;
2666
+ };
2667
+ type V1VmStatusInput = Record<string, never>;
2668
+ type V1VmStatusOutput = {
2669
+ lifecycle: Output.VmLifecycleState;
2670
+ configState: Output.ConfigApplyState;
2671
+ desiredConfigRevision: number | bigint;
2672
+ appliedConfigRevision?: number | bigint | null;
2673
+ generation: number | bigint;
2674
+ lastBootAtMs?: number | bigint | null;
2675
+ lastShutdownAtMs?: number | bigint | null;
2676
+ packages: Output.PackageStartupStatus;
2677
+ issues: Array<Output.VmIssue>;
2678
+ core?: Output.CoreSidecarStatus | null;
2679
+ };
2680
+ interface AgentOsActions {
2681
+ readonly v1: {
2682
+ readonly config: {
2683
+ readonly get: (input: V1ConfigGetInput) => Promise<V1ConfigGetOutput>;
2684
+ readonly patch: (input: V1ConfigPatchInput) => Promise<V1ConfigPatchOutput>;
2685
+ readonly set: (input: V1ConfigSetInput) => Promise<V1ConfigSetOutput>;
2686
+ };
2687
+ readonly contexts: {
2688
+ readonly create: (input: V1ContextsCreateInput) => Promise<V1ContextsCreateOutput>;
2689
+ readonly delete: (input: V1ContextsDeleteInput) => Promise<V1ContextsDeleteOutput>;
2690
+ readonly get: (input: V1ContextsGetInput) => Promise<V1ContextsGetOutput>;
2691
+ readonly list: (input: V1ContextsListInput) => Promise<V1ContextsListOutput>;
2692
+ readonly reset: (input: V1ContextsResetInput) => Promise<V1ContextsResetOutput>;
2693
+ };
2694
+ readonly cron: {
2695
+ readonly cancel: (input: V1CronCancelInput) => Promise<V1CronCancelOutput>;
2696
+ readonly list: (input: V1CronListInput) => Promise<V1CronListOutput>;
2697
+ readonly schedule: (input: V1CronScheduleInput) => Promise<V1CronScheduleOutput>;
2698
+ };
2699
+ readonly filesystem: {
2700
+ readonly exists: (input: V1FilesystemExistsInput) => Promise<V1FilesystemExistsOutput>;
2701
+ readonly export: (input: V1FilesystemExportInput) => Promise<V1FilesystemExportOutput>;
2702
+ readonly listMounts: (input: V1FilesystemListMountsInput) => Promise<V1FilesystemListMountsOutput>;
2703
+ readonly mkdir: (input: V1FilesystemMkdirInput) => Promise<V1FilesystemMkdirOutput>;
2704
+ readonly move: (input: V1FilesystemMoveInput) => Promise<V1FilesystemMoveOutput>;
2705
+ readonly readFile: (input: V1FilesystemReadFileInput) => Promise<V1FilesystemReadFileOutput>;
2706
+ readonly readFiles: (input: V1FilesystemReadFilesInput) => Promise<V1FilesystemReadFilesOutput>;
2707
+ readonly readdir: (input: V1FilesystemReaddirInput) => Promise<V1FilesystemReaddirOutput>;
2708
+ readonly readdirEntries: (input: V1FilesystemReaddirEntriesInput) => Promise<V1FilesystemReaddirEntriesOutput>;
2709
+ readonly readdirRecursive: (input: V1FilesystemReaddirRecursiveInput) => Promise<V1FilesystemReaddirRecursiveOutput>;
2710
+ readonly remove: (input: V1FilesystemRemoveInput) => Promise<V1FilesystemRemoveOutput>;
2711
+ readonly stat: (input: V1FilesystemStatInput) => Promise<V1FilesystemStatOutput>;
2712
+ readonly writeFile: (input: V1FilesystemWriteFileInput) => Promise<V1FilesystemWriteFileOutput>;
2713
+ readonly writeFiles: (input: V1FilesystemWriteFilesInput) => Promise<V1FilesystemWriteFilesOutput>;
2714
+ };
2715
+ readonly javascript: {
2716
+ readonly evaluate: (input: V1JavaScriptEvaluateInput) => Promise<V1JavaScriptEvaluateOutput>;
2717
+ readonly execute: (input: V1JavaScriptExecuteInput) => Promise<V1JavaScriptExecuteOutput>;
2718
+ readonly executeFile: (input: V1JavaScriptExecuteFileInput) => Promise<V1JavaScriptExecuteFileOutput>;
2719
+ readonly npm: {
2720
+ readonly install: (input: V1JavaScriptNpmInstallInput) => Promise<V1JavaScriptNpmInstallOutput>;
2721
+ readonly runPackage: (input: V1JavaScriptNpmRunPackageInput) => Promise<V1JavaScriptNpmRunPackageOutput>;
2722
+ readonly runScript: (input: V1JavaScriptNpmRunScriptInput) => Promise<V1JavaScriptNpmRunScriptOutput>;
2723
+ };
2724
+ readonly spawn: (input: V1JavaScriptSpawnInput) => Promise<V1JavaScriptSpawnOutput>;
2725
+ readonly spawnFile: (input: V1JavaScriptSpawnFileInput) => Promise<V1JavaScriptSpawnFileOutput>;
2726
+ };
2727
+ readonly network: {
2728
+ readonly fetch: (input: V1NetworkFetchInput) => Promise<V1NetworkFetchOutput>;
2729
+ readonly fetchStream: {
2730
+ readonly cancel: (input: V1NetworkFetchStreamCancelInput) => Promise<V1NetworkFetchStreamCancelOutput>;
2731
+ readonly read: (input: V1NetworkFetchStreamReadInput) => Promise<V1NetworkFetchStreamReadOutput>;
2732
+ readonly start: (input: V1NetworkFetchStreamStartInput) => Promise<V1NetworkFetchStreamStartOutput>;
2733
+ };
2734
+ readonly preview: {
2735
+ readonly create: (input: V1NetworkPreviewCreateInput) => Promise<V1NetworkPreviewCreateOutput>;
2736
+ readonly expire: (input: V1NetworkPreviewExpireInput) => Promise<V1NetworkPreviewExpireOutput>;
2737
+ };
2738
+ };
2739
+ readonly process: {
2740
+ readonly get: (input: V1ProcessGetInput) => Promise<V1ProcessGetOutput>;
2741
+ readonly list: (input: V1ProcessListInput) => Promise<V1ProcessListOutput>;
2742
+ readonly output: {
2743
+ readonly read: (input: V1ProcessOutputReadInput) => Promise<V1ProcessOutputReadOutput>;
2744
+ };
2745
+ readonly pty: {
2746
+ readonly resize: (input: V1ProcessPtyResizeInput) => Promise<V1ProcessPtyResizeOutput>;
2747
+ };
2748
+ readonly run: (input: V1ProcessRunInput) => Promise<V1ProcessRunOutput>;
2749
+ readonly signal: (input: V1ProcessSignalInput) => Promise<V1ProcessSignalOutput>;
2750
+ readonly spawn: (input: V1ProcessSpawnInput) => Promise<V1ProcessSpawnOutput>;
2751
+ readonly stdin: {
2752
+ readonly close: (input: V1ProcessStdinCloseInput) => Promise<V1ProcessStdinCloseOutput>;
2753
+ readonly write: (input: V1ProcessStdinWriteInput) => Promise<V1ProcessStdinWriteOutput>;
2754
+ };
2755
+ readonly tree: (input: V1ProcessTreeInput) => Promise<V1ProcessTreeOutput>;
2756
+ readonly wait: (input: V1ProcessWaitInput) => Promise<V1ProcessWaitOutput>;
2757
+ };
2758
+ readonly python: {
2759
+ readonly evaluate: (input: V1PythonEvaluateInput) => Promise<V1PythonEvaluateOutput>;
2760
+ readonly execute: (input: V1PythonExecuteInput) => Promise<V1PythonExecuteOutput>;
2761
+ readonly executeFile: (input: V1PythonExecuteFileInput) => Promise<V1PythonExecuteFileOutput>;
2762
+ readonly executeModule: (input: V1PythonExecuteModuleInput) => Promise<V1PythonExecuteModuleOutput>;
2763
+ readonly install: (input: V1PythonInstallInput) => Promise<V1PythonInstallOutput>;
2764
+ readonly spawn: (input: V1PythonSpawnInput) => Promise<V1PythonSpawnOutput>;
2765
+ readonly spawnFile: (input: V1PythonSpawnFileInput) => Promise<V1PythonSpawnFileOutput>;
2766
+ readonly spawnModule: (input: V1PythonSpawnModuleInput) => Promise<V1PythonSpawnModuleOutput>;
2767
+ };
2768
+ readonly software: {
2769
+ readonly install: (input: V1SoftwareInstallInput) => Promise<V1SoftwareInstallOutput>;
2770
+ readonly list: (input: V1SoftwareListInput) => Promise<V1SoftwareListOutput>;
2771
+ readonly uninstall: (input: V1SoftwareUninstallInput) => Promise<V1SoftwareUninstallOutput>;
2772
+ };
2773
+ readonly terminal: {
2774
+ readonly close: (input: V1TerminalCloseInput) => Promise<V1TerminalCloseOutput>;
2775
+ readonly list: (input: V1TerminalListInput) => Promise<V1TerminalListOutput>;
2776
+ readonly open: (input: V1TerminalOpenInput) => Promise<V1TerminalOpenOutput>;
2777
+ readonly output: {
2778
+ readonly read: (input: V1TerminalOutputReadInput) => Promise<V1TerminalOutputReadOutput>;
2779
+ };
2780
+ readonly pty: {
2781
+ readonly resize: (input: V1TerminalPtyResizeInput) => Promise<V1TerminalPtyResizeOutput>;
2782
+ };
2783
+ readonly stdin: {
2784
+ readonly write: (input: V1TerminalStdinWriteInput) => Promise<V1TerminalStdinWriteOutput>;
2785
+ };
2786
+ readonly wait: (input: V1TerminalWaitInput) => Promise<V1TerminalWaitOutput>;
2787
+ };
2788
+ readonly typescript: {
2789
+ readonly check: (input: V1TypeScriptCheckInput) => Promise<V1TypeScriptCheckOutput>;
2790
+ readonly checkProject: (input: V1TypeScriptCheckProjectInput) => Promise<V1TypeScriptCheckProjectOutput>;
2791
+ readonly evaluate: (input: V1TypeScriptEvaluateInput) => Promise<V1TypeScriptEvaluateOutput>;
2792
+ readonly execute: (input: V1TypeScriptExecuteInput) => Promise<V1TypeScriptExecuteOutput>;
2793
+ readonly executeFile: (input: V1TypeScriptExecuteFileInput) => Promise<V1TypeScriptExecuteFileOutput>;
2794
+ readonly spawn: (input: V1TypeScriptSpawnInput) => Promise<V1TypeScriptSpawnOutput>;
2795
+ readonly spawnFile: (input: V1TypeScriptSpawnFileInput) => Promise<V1TypeScriptSpawnFileOutput>;
2796
+ };
2797
+ readonly vm: {
2798
+ readonly restart: (input: V1VmRestartInput) => Promise<V1VmRestartOutput>;
2799
+ readonly status: (input: V1VmStatusInput) => Promise<V1VmStatusOutput>;
2800
+ };
2801
+ };
207
2802
  }
208
- declare function createAgentOsActions(options?: AgentOsOptions, hooks?: AgentOsEventHooks, preview?: AgentOsActorExtras["preview"], maxSessionSubscriptions?: number, maxDynamicMounts?: number, maxLinkedSoftware?: number): {
209
- readFile: (c: AnyContext, path: string) => Promise<Uint8Array<ArrayBufferLike>>;
210
- writeFile: (c: AnyContext, path: string, content: string | Uint8Array<ArrayBufferLike>) => Promise<void>;
211
- readFiles: (c: AnyContext, paths: string[]) => Promise<_rivet_dev_agentos_core.BatchReadResult[]>;
212
- writeFiles: (c: AnyContext, entries: _rivet_dev_agentos_core.BatchWriteEntry[]) => Promise<_rivet_dev_agentos_core.BatchWriteResult[]>;
213
- stat: (c: AnyContext, path: string) => Promise<_rivet_dev_agentos_core_internal_runtime_compat.VirtualStat>;
214
- mkdir: (c: AnyContext, path: string, options?: {
215
- recursive?: boolean;
216
- } | undefined) => Promise<void>;
217
- readdir: (c: AnyContext, path: string) => Promise<string[]>;
218
- readdirEntries: (c: AnyContext, path: string) => Promise<_rivet_dev_agentos_core.ReaddirEntry[]>;
219
- readdirRecursive: (c: AnyContext, path: string, options?: _rivet_dev_agentos_core.ReaddirRecursiveOptions | undefined) => Promise<_rivet_dev_agentos_core.DirEntry[]>;
220
- exists: (c: AnyContext, path: string) => Promise<boolean>;
221
- move: (c: AnyContext, from: string, to: string) => Promise<void>;
222
- remove: (c: AnyContext, path: string, options?: {
223
- recursive?: boolean;
224
- } | undefined) => Promise<void>;
225
- exportRootFilesystem: (c: AnyContext, options: _rivet_dev_agentos_core.ExportRootFilesystemOptions) => Promise<_rivet_dev_agentos_core.RootSnapshotExport>;
226
- mountFs: (c: AnyContext, descriptor: DynamicMountDescriptor) => Promise<void>;
227
- unmountFs: (c: AnyContext, path: string) => Promise<void>;
228
- listMounts: (c: AnyContext) => Promise<_rivet_dev_agentos_core.MountInfo[]>;
229
- exec: (c: AnyContext, command: string, options?: _rivet_dev_agentos_core_internal_runtime_compat.ExecOptions | undefined) => Promise<_rivet_dev_agentos_core_internal_runtime_compat.ExecResult>;
230
- execArgv: (c: AnyContext, command: string, args?: readonly string[] | undefined, options?: _rivet_dev_agentos_core_internal_runtime_compat.ExecOptions | undefined) => Promise<_rivet_dev_agentos_core_internal_runtime_compat.ExecResult>;
231
- spawn: (c: AnyContext, command: string, args?: string[], actorOptions?: ActorSpawnOptions) => Promise<ProcessDescriptor>;
232
- waitProcess: (c: AnyContext, pid: number) => Promise<_rivet_dev_agentos_core.ProcessExit>;
233
- killProcess: (c: AnyContext, pid: number) => Promise<void>;
234
- listProcesses: (c: AnyContext) => Promise<ProcessDescriptor[]>;
235
- processTree: (c: AnyContext) => Promise<_rivet_dev_agentos_core.ProcessTreeNode[]>;
236
- getProcess: (c: AnyContext, pid: number) => Promise<ProcessDescriptor>;
237
- writeProcessStdin: (c: AnyContext, pid: number, data: string | Uint8Array<ArrayBufferLike>) => Promise<void>;
238
- closeProcessStdin: (c: AnyContext, pid: number) => Promise<void>;
239
- openShell: (c: AnyContext, options?: _rivet_dev_agentos_core.ShellOptions | undefined) => Promise<{
240
- shellId: string;
2803
+ type AgentOsEvents = {
2804
+ readonly "vm.booted": Type<{
2805
+ generation: number | bigint;
2806
+ configRevision: number | bigint;
2807
+ bootedAtMs: number | bigint;
241
2808
  }>;
242
- listShells: (c: AnyContext) => Promise<ShellInfo[]>;
243
- shellSnapshot: (c: AnyContext, shellId: string, mode?: ShellReplayMode) => Promise<ShellSnapshot | null>;
244
- writeShell: (c: AnyContext, shellId: string, data: string | Uint8Array<ArrayBufferLike>) => Promise<void>;
245
- resizeShell: (c: AnyContext, shellId: string, cols: number, rows: number) => Promise<void>;
246
- closeShell: (c: AnyContext, shellId: string) => Promise<void>;
247
- waitShell: (c: AnyContext, shellId: string) => Promise<number>;
248
- httpRequest: (c: AnyContext, request: _rivet_dev_agentos_core.HttpRequest) => Promise<_rivet_dev_agentos_core.HttpResponse>;
249
- vmFetch: (c: AnyContext, port: number, url: string, requestOptions?: VmFetchOptions) => Promise<VmFetchResponse>;
250
- vmFetchStreamStart: (c: AnyContext, port: number, url: string, requestOptions?: VmFetchOptions) => Promise<VmFetchStreamHead>;
251
- vmFetchStreamRead: (c: AnyContext, streamId: string, maxBytes?: number) => Promise<VmFetchStreamChunk>;
252
- vmFetchStreamCancel: (c: AnyContext, streamId: string) => Promise<void>;
253
- scheduleCron: (c: AnyContext, cronOptions: SerializableCronJobOptions) => Promise<{
254
- id: string;
2809
+ readonly "vm.shutdown": Type<{
2810
+ generation: number | bigint;
2811
+ reason: string;
2812
+ shutdownAtMs: number | bigint;
255
2813
  }>;
256
- listCronJobs: (c: AnyContext) => Promise<_rivet_dev_agentos_core.CronJobInfo[]>;
257
- cancelCronJob: (c: AnyContext, id: string) => Promise<void>;
258
- listAgents: (c: AnyContext) => Promise<_rivet_dev_agentos_core.AgentRegistryEntry[]>;
259
- openSession: (c: AnyContext, input: OpenSessionInput) => Promise<void>;
260
- getSession: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<_rivet_dev_agentos_core.SessionInfo>;
261
- listSessions: (c: AnyContext, input?: _rivet_dev_agentos_core.ListSessionsInput | undefined) => Promise<_rivet_dev_agentos_core.SessionPage>;
262
- deleteSession: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<void>;
263
- unloadSession: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<void>;
264
- prompt: (c: AnyContext, input: PromptInput) => Promise<_rivet_dev_agentos_core.PromptResult>;
265
- cancelPrompt: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<_rivet_dev_agentos_core.CancelPromptResult>;
266
- respondPermission: (c: AnyContext, input: _rivet_dev_agentos_core.PermissionResponse) => Promise<_rivet_dev_agentos_core.PermissionResponseResult>;
267
- readHistory: (c: AnyContext, input?: _rivet_dev_agentos_core.ReadHistoryInput | undefined) => Promise<_rivet_dev_agentos_core.HistoryPage>;
268
- getSessionConfig: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<_rivet_dev_agentos_core.SessionConfig>;
269
- setSessionConfigOption: (c: AnyContext, input: _rivet_dev_agentos_core.SetSessionConfigOptionInput) => Promise<_rivet_dev_agentos_core.SessionConfig>;
270
- getSessionCapabilities: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<_rivet_dev_agentos_core.SessionCapabilities | null>;
271
- getSessionAgentInfo: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<_agentclientprotocol_sdk.Implementation | null>;
272
- listSoftware: (c: AnyContext) => Promise<{
273
- packageName: string;
274
- commands: string[];
275
- }[]>;
276
- linkSoftware: (c: AnyContext, descriptor: PackageDescriptor) => Promise<void>;
277
- createPreviewUrl: (c: AnyContext, port: number, ttlSeconds?: number) => Promise<{
278
- path: string;
279
- token: string;
280
- port: number;
281
- expiresAt: number;
2814
+ readonly "vm.limitWarning": Type<{
2815
+ limit: string;
2816
+ observed: number | bigint;
2817
+ capacity: number | bigint;
2818
+ message: string;
282
2819
  }>;
283
- expirePreviewUrl: (c: AnyContext, token: string) => Promise<void>;
284
- health: (c: AnyContext) => Promise<RuntimeHealth>;
285
- createContext: (c: AnyContext, contextId: string) => Promise<void>;
286
- process: {
287
- exec: (c: AnyContext, command: string, actorOptions?: ActorLanguageExecutionOptions) => Promise<CodeExecutionResult>;
288
- execFile: (c: AnyContext, command: string, args?: readonly string[], actorOptions?: Omit<ActorLanguageExecutionOptions, "args">) => Promise<CodeExecutionResult>;
289
- spawn: (c: AnyContext, command: string, args?: string[], actorOptions?: ActorSpawnOptions) => Promise<ProcessDescriptor>;
290
- get: (c: AnyContext, pid: number) => Promise<ProcessDescriptor>;
291
- list: (c: AnyContext) => Promise<ProcessDescriptor[]>;
292
- tree: (c: AnyContext) => Promise<_rivet_dev_agentos_core.ProcessTreeNode[]>;
293
- wait: (c: AnyContext, pid: number) => Promise<_rivet_dev_agentos_core.ProcessExit>;
294
- signal: (c: AnyContext, pid: number, signal: _rivet_dev_agentos_core.ExecutionSignal) => Promise<void>;
295
- kill: (c: AnyContext, pid: number) => Promise<void>;
296
- writeStdin: (c: AnyContext, pid: number, data: string | Uint8Array<ArrayBufferLike>) => Promise<void>;
297
- closeStdin: (c: AnyContext, pid: number) => Promise<void>;
298
- resizePty: (c: AnyContext, pid: number, size: {
299
- cols: number;
300
- rows: number;
301
- }) => Promise<void>;
302
- readOutput: (c: AnyContext, pid: number, options?: {
303
- after?: number;
304
- } | undefined) => Promise<{
305
- events: {
306
- chunk: {
307
- encoding: "base64";
308
- data: string;
309
- };
310
- pid: number;
311
- sequence: number;
312
- channel: "stdout" | "stderr" | "pty";
313
- timestampMs: number;
314
- }[];
315
- pid: number;
316
- nextCursor: string;
317
- hasMore: boolean;
318
- truncated: boolean;
319
- }>;
320
- };
321
- javascript: {
322
- execute: (c: AnyContext, source: string, actorOptions?: ActorJavaScriptExecutionOptions) => Promise<CodeExecutionResult>;
323
- evaluate: (c: AnyContext, expression: string, actorOptions?: ActorJavaScriptExecutionOptions) => Promise<_rivet_dev_agentos_core.CodeEvaluationResult<_rivet_dev_agentos_core.JsonValue>>;
324
- executeFile: (c: AnyContext, path: string, actorOptions?: ActorLanguageExecutionOptions) => Promise<CodeExecutionResult>;
325
- spawn: (c: AnyContext, source: string, actorOptions?: ActorLanguageSpawnOptions) => Promise<ProcessDescriptor>;
326
- spawnFile: (c: AnyContext, path: string, actorOptions?: ActorLanguageSpawnOptions) => Promise<ProcessDescriptor>;
327
- npm: {
328
- install: (c: AnyContext, ...args: [options?: ActorNpmProjectInstallOptions] | [packages: string | string[], options?: ActorNpmPackageInstallOptions]) => Promise<CodeExecutionResult>;
329
- runScript: (c: AnyContext, script: string, actorOptions?: ActorLanguageExecutionOptions) => Promise<CodeExecutionResult>;
330
- runPackage: (c: AnyContext, packageSpec: string, actorOptions?: ActorLanguageExecutionOptions & {
331
- binary?: string;
332
- }) => Promise<CodeExecutionResult>;
333
- };
334
- };
335
- typescript: {
336
- execute: (c: AnyContext, source: string, actorOptions?: ActorTypeScriptExecutionOptions) => Promise<CodeExecutionResult>;
337
- evaluate: (c: AnyContext, expression: string, actorOptions?: ActorTypeScriptExecutionOptions) => Promise<_rivet_dev_agentos_core.CodeEvaluationResult<_rivet_dev_agentos_core.JsonValue>>;
338
- executeFile: (c: AnyContext, path: string, actorOptions?: ActorTypeScriptFileExecutionOptions) => Promise<CodeExecutionResult>;
339
- spawn: (c: AnyContext, source: string, actorOptions?: ActorLanguageSpawnOptions) => Promise<ProcessDescriptor>;
340
- spawnFile: (c: AnyContext, path: string, actorOptions?: ActorLanguageSpawnOptions) => Promise<ProcessDescriptor>;
341
- check: (c: AnyContext, source: string, actorOptions?: ActorTypeScriptCheckOptions) => Promise<_rivet_dev_agentos_core.TypeScriptCheckResult>;
342
- checkProject: (c: AnyContext, actorOptions?: Omit<ActorTypeScriptCheckOptions, "filePath" | "compilerOptions">) => Promise<_rivet_dev_agentos_core.TypeScriptCheckResult>;
343
- };
344
- python: {
345
- execute: (c: AnyContext, source: string, actorOptions?: ActorInlineExecutionOptions) => Promise<CodeExecutionResult>;
346
- evaluate: (c: AnyContext, expression: string, actorOptions?: ActorInlineExecutionOptions) => Promise<_rivet_dev_agentos_core.CodeEvaluationResult<_rivet_dev_agentos_core.JsonValue>>;
347
- executeFile: (c: AnyContext, path: string, actorOptions?: ActorLanguageExecutionOptions) => Promise<CodeExecutionResult>;
348
- executeModule: (c: AnyContext, module: string, actorOptions?: ActorLanguageExecutionOptions) => Promise<CodeExecutionResult>;
349
- spawn: (c: AnyContext, source: string, actorOptions?: ActorLanguageSpawnOptions) => Promise<ProcessDescriptor>;
350
- spawnFile: (c: AnyContext, path: string, actorOptions?: ActorLanguageSpawnOptions) => Promise<ProcessDescriptor>;
351
- spawnModule: (c: AnyContext, module: string, actorOptions?: ActorLanguageSpawnOptions) => Promise<ProcessDescriptor>;
352
- install: (c: AnyContext, ...args: [options?: ActorPythonInstallOptions] | [packages: string | string[], options?: ActorPythonInstallOptions]) => Promise<CodeExecutionResult>;
353
- };
354
- contexts: {
355
- get: (c: AnyContext, contextId: string) => Promise<_rivet_dev_agentos_core.ContextDescriptor>;
356
- list: (c: AnyContext) => Promise<_rivet_dev_agentos_core.ContextDescriptor[]>;
357
- reset: (c: AnyContext, contextId: string) => Promise<void>;
358
- delete: (c: AnyContext, contextId: string) => Promise<void>;
359
- };
360
- terminal: {
361
- open: (c: AnyContext, options?: _rivet_dev_agentos_core.ShellOptions | undefined) => Promise<{
362
- shellId: string;
363
- }>;
364
- list: (c: AnyContext) => Promise<ShellInfo[]>;
365
- snapshot: (c: AnyContext, shellId: string, mode?: ShellReplayMode) => Promise<ShellSnapshot | null>;
366
- write: (c: AnyContext, shellId: string, data: string | Uint8Array<ArrayBufferLike>) => Promise<void>;
367
- resize: (c: AnyContext, shellId: string, cols: number, rows: number) => Promise<void>;
368
- wait: (c: AnyContext, shellId: string) => Promise<number>;
369
- close: (c: AnyContext, shellId: string) => Promise<void>;
370
- };
371
- filesystem: {
372
- readFile: (c: AnyContext, path: string) => Promise<Uint8Array<ArrayBufferLike>>;
373
- writeFile: (c: AnyContext, path: string, content: string | Uint8Array<ArrayBufferLike>) => Promise<void>;
374
- readFiles: (c: AnyContext, paths: string[]) => Promise<_rivet_dev_agentos_core.BatchReadResult[]>;
375
- writeFiles: (c: AnyContext, entries: _rivet_dev_agentos_core.BatchWriteEntry[]) => Promise<_rivet_dev_agentos_core.BatchWriteResult[]>;
376
- stat: (c: AnyContext, path: string) => Promise<_rivet_dev_agentos_core_internal_runtime_compat.VirtualStat>;
377
- mkdir: (c: AnyContext, path: string, options?: {
378
- recursive?: boolean;
379
- } | undefined) => Promise<void>;
380
- readdir: (c: AnyContext, path: string) => Promise<string[]>;
381
- readdirEntries: (c: AnyContext, path: string) => Promise<_rivet_dev_agentos_core.ReaddirEntry[]>;
382
- readdirRecursive: (c: AnyContext, path: string, options?: _rivet_dev_agentos_core.ReaddirRecursiveOptions | undefined) => Promise<_rivet_dev_agentos_core.DirEntry[]>;
383
- exists: (c: AnyContext, path: string) => Promise<boolean>;
384
- move: (c: AnyContext, from: string, to: string) => Promise<void>;
385
- remove: (c: AnyContext, path: string, options?: {
386
- recursive?: boolean;
387
- } | undefined) => Promise<void>;
388
- export: (c: AnyContext, options: _rivet_dev_agentos_core.ExportRootFilesystemOptions) => Promise<_rivet_dev_agentos_core.RootSnapshotExport>;
389
- mount: (c: AnyContext, descriptor: DynamicMountDescriptor) => Promise<void>;
390
- unmount: (c: AnyContext, path: string) => Promise<void>;
391
- listMounts: (c: AnyContext) => Promise<_rivet_dev_agentos_core.MountInfo[]>;
392
- };
393
- network: {
394
- httpRequest: (c: AnyContext, request: _rivet_dev_agentos_core.HttpRequest) => Promise<_rivet_dev_agentos_core.HttpResponse>;
395
- };
396
- software: {
397
- list: (c: AnyContext) => Promise<{
398
- packageName: string;
399
- commands: string[];
400
- }[]>;
401
- link: (c: AnyContext, descriptor: PackageDescriptor) => Promise<void>;
402
- };
403
- agents: {
404
- list: (c: AnyContext) => Promise<_rivet_dev_agentos_core.AgentRegistryEntry[]>;
405
- };
406
- sessions: {
407
- open: (c: AnyContext, input: OpenSessionInput) => Promise<void>;
408
- get: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<_rivet_dev_agentos_core.SessionInfo>;
409
- list: (c: AnyContext, input?: _rivet_dev_agentos_core.ListSessionsInput | undefined) => Promise<_rivet_dev_agentos_core.SessionPage>;
410
- delete: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<void>;
411
- unload: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<void>;
412
- prompt: (c: AnyContext, input: PromptInput) => Promise<_rivet_dev_agentos_core.PromptResult>;
413
- cancelPrompt: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<_rivet_dev_agentos_core.CancelPromptResult>;
414
- respondPermission: (c: AnyContext, input: _rivet_dev_agentos_core.PermissionResponse) => Promise<_rivet_dev_agentos_core.PermissionResponseResult>;
415
- readHistory: (c: AnyContext, input?: _rivet_dev_agentos_core.ReadHistoryInput | undefined) => Promise<_rivet_dev_agentos_core.HistoryPage>;
416
- getConfig: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<_rivet_dev_agentos_core.SessionConfig>;
417
- setConfigOption: (c: AnyContext, input: _rivet_dev_agentos_core.SetSessionConfigOptionInput) => Promise<_rivet_dev_agentos_core.SessionConfig>;
418
- getCapabilities: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<_rivet_dev_agentos_core.SessionCapabilities | null>;
419
- getAgentInfo: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<_agentclientprotocol_sdk.Implementation | null>;
420
- };
421
- cron: {
422
- schedule: (c: AnyContext, cronOptions: SerializableCronJobOptions) => Promise<{
423
- id: string;
424
- }>;
425
- list: (c: AnyContext) => Promise<_rivet_dev_agentos_core.CronJobInfo[]>;
426
- cancel: (c: AnyContext, id: string) => Promise<void>;
427
- };
428
- };
429
- type AgentOsActions = ReturnType<typeof createAgentOsActions>;
430
- interface AgentOsActorExtras<THostFunctions extends HostFunctionSchemas = HostFunctionSchemas> extends AgentOsOptions<THostFunctions> {
431
- /**
432
- * Resolve trusted VM options from actor state immediately before the VM's
433
- * first boot. Evaluated once per wake. The actor-owned root filesystem and
434
- * database cannot be replaced.
435
- */
436
- resolveOptions?: (c: AnyContext) => AgentOsOptions | Promise<AgentOsOptions>;
437
- /** Start long-lived processes after each VM boot. Trusted host code only. */
438
- onVmStart?: (c: AnyContext, vm: AgentOs) => void | Promise<void>;
439
- /** Gracefully stop long-lived processes before the VM is disposed. */
440
- onVmStop?: (c: AnyContext, vm: AgentOs, reason: "sleep" | "destroy" | "error") => void | Promise<void>;
441
- /** Clean up host resources after the VM and lazy mount readers close. */
442
- onVmDisposed?: (c: AnyContext, reason: "sleep" | "destroy" | "error") => void | Promise<void>;
443
- /** Maximum live session event subscriptions per actor VM. Default: 10,000. */
444
- maxSessionSubscriptions?: number;
445
- /** Maximum durable dynamic mount descriptors per actor. Default: 10,000. */
446
- maxDynamicMounts?: number;
447
- /** Maximum durable linked software descriptors per actor. Default: 10,000. */
448
- maxLinkedSoftware?: number;
449
- preview?: {
450
- defaultExpiresInSeconds?: number;
451
- maxExpiresInSeconds?: number;
452
- maxActiveTokens?: number;
453
- };
454
- }
455
- type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
456
- type AgentOsActorConfigInput<TState = undefined, TConnParams = undefined, TConnState = undefined, TVars = undefined, TInput = undefined, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>, TUserActions extends Actions<TState, TConnParams, TConnState, TVars, TInput, ActorDb, TEvents, TQueues> = Record<never, never>, THostFunctions extends HostFunctionSchemas = HostFunctionSchemas> = DistributiveOmit<ActorConfigInput<TState, TConnParams, TConnState, TVars, TInput, ActorDb, TEvents, TQueues, TUserActions>, "db"> & AgentOsActorExtras<THostFunctions> & AgentOsEventHooks<ActorContext<TState, TConnParams, TConnState, TVars, TInput, ActorDb, TEvents, TQueues>>;
457
- declare function createAgentOS<TState = undefined, TConnParams = undefined, TConnState = undefined, TVars = undefined, TInput = undefined, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>, TUserActions extends Actions<TState, TConnParams, TConnState, TVars, TInput, ActorDb, TEvents, TQueues> = Record<never, never>, THostFunctions extends HostFunctionSchemas = HostFunctionSchemas>(config?: AgentOsActorConfigInput<TState, TConnParams, TConnState, TVars, TInput, TEvents, TQueues, TUserActions, THostFunctions>): ActorDefinition<TState, TConnParams, TConnState, TVars, TInput, ActorDb, TEvents & BuiltInEvents, TQueues, TUserActions & AgentOsActions>;
458
-
2820
+ readonly "process.output": Type<{
2821
+ process: Output.ActorProcessId;
2822
+ sequence: number | bigint;
2823
+ stream: Output.ProcessStream;
2824
+ data: Output.FileBytes;
2825
+ timestampMs: number | bigint;
2826
+ }>;
2827
+ readonly "process.exit": Type<{
2828
+ process: Output.ActorProcessId;
2829
+ status: Output.ActorExitStatus;
2830
+ }>;
2831
+ readonly "terminal.output": Type<{
2832
+ terminal: Output.ActorTerminalId;
2833
+ sequence: number | bigint;
2834
+ stream: Output.ProcessStream;
2835
+ data: Output.FileBytes;
2836
+ timestampMs: number | bigint;
2837
+ }>;
2838
+ readonly "terminal.exit": Type<{
2839
+ terminal: Output.ActorTerminalId;
2840
+ status: Output.ActorExitStatus;
2841
+ }>;
2842
+ readonly "cron.fired": Type<{
2843
+ scheduleName: string;
2844
+ process?: Output.ActorProcessId | null;
2845
+ error?: Output.CronLaunchError | null;
2846
+ firedAtMs: number | bigint;
2847
+ }>;
2848
+ };
2849
+ type AgentOsActorDefinition = BaseActorDefinition<undefined, undefined, undefined, undefined, AgentOsActorCreateInput, undefined, AgentOsEvents, Record<never, never>, Record<never, never>>;
2850
+ type AgentOsActorConnection = ActorConn<AgentOsActorDefinition> & AgentOsActions;
2851
+ type AgentOsActorHandle = Omit<ActorHandle<AgentOsActorDefinition>, "connect"> & AgentOsActions & {
2852
+ connect(params?: unknown, options?: ActorConnectOptions): AgentOsActorConnection;
2853
+ };
2854
+ type AgentOsRegistry = Registry<{
2855
+ agentOS: AgentOsActorDefinition;
2856
+ }>;
2857
+ type AgentOsCreateOptions = Omit<CreateOptions, "input"> & {
2858
+ input?: AgentOsActorCreateInput;
2859
+ };
2860
+ type AgentOsGetOrCreateOptions = Omit<GetOptions, "createWithInput"> & {
2861
+ createWithInput?: AgentOsActorCreateInput;
2862
+ };
2863
+ type AgentOsActorAccessor = Omit<ActorAccessor<AgentOsActorDefinition>, "create" | "getOrCreate"> & {
2864
+ getOrCreate(key?: string | string[], options?: AgentOsGetOrCreateOptions): AgentOsActorHandle;
2865
+ create(key?: string | string[], options?: AgentOsCreateOptions): Promise<AgentOsActorHandle>;
2866
+ };
2867
+ type AgentOsClient = Omit<Client<AgentOsRegistry>, "agentOS" | "getForId"> & {
2868
+ readonly agentOS: AgentOsActorAccessor;
2869
+ getForId(name: "agentOS", actorId: string, options?: GetWithIdOptions): AgentOsActorHandle;
2870
+ };
459
2871
  /**
460
- * RivetKit setup with the direct actor SQLite UDS enabled. The UDS is consumed
461
- * by the AgentOS sidecar; filesystem SQL never crosses the JavaScript layer.
2872
+ * Creates a vanilla RivetKit client with the generated agentOS contract.
2873
+ * Services runs the agentOS actor in the `services` pool, so the client
2874
+ * uses that pool unless the config sets `poolName`.
462
2875
  */
463
- declare const setup: typeof setup$1;
2876
+ declare function createAgentOsClient(endpointOrConfig?: string | ClientConfigInput): AgentOsClient;
464
2877
 
465
- export { type ActorData, type ActorLanguageSpawnOptions, type ActorSpawnOptions, type AgentOsActorConfigInput as AgentOSActorConfigInput, type AgentOsActorConfigInput as AgentOSConfigInput, type AgentOsActions, type AgentOsActorConfigInput, type AgentOsActorExtras, type AgentOsEventHooks, type AgentOsEvents, type ProcessExitPayload, type ProcessOutputPayload, type RuntimeAgentExit, type RuntimeHealth, type RuntimeLimitWarning, type RuntimeSidecarInfo, type RuntimeStderrLine, type SerializableCronAction, type SerializableCronEvent, type SerializableCronJobInfo, type SerializableCronJobOptions, type ShellDataPayload, type ShellExitPayload, type ShellInfo, type ShellReplayMode, type ShellSnapshot, type VmBootedPayload, type VmFetchOptions, type VmFetchResponse, type VmFetchStreamChunk, type VmFetchStreamHead, type VmShutdownPayload, createAgentOS as agentOS, createAgentOS, createAgentOsActions, setup };
2878
+ export { AGENTOS_API_VERSION, AGENTOS_CAPABILITIES, AGENTOS_CONTRACT, AGENTOS_CONTRACT_HASH, AGENTOS_CONTRACT_MAJOR, type AgentOsActions, type AgentOsActorAccessor, type AgentOsActorConnection, type AgentOsActorCreateInput, type AgentOsActorDefinition, type AgentOsActorHandle, type AgentOsClient, type AgentOsCreateOptions, type AgentOsEvents, type AgentOsGetOrCreateOptions, type AgentOsRegistry, type AgentOsRivetError, Input, Output, type V1ConfigGetInput, type V1ConfigGetOutput, type V1ConfigPatchInput, type V1ConfigPatchOutput, type V1ConfigSetInput, type V1ConfigSetOutput, type V1ContextsCreateInput, type V1ContextsCreateOutput, type V1ContextsDeleteInput, type V1ContextsDeleteOutput, type V1ContextsGetInput, type V1ContextsGetOutput, type V1ContextsListInput, type V1ContextsListOutput, type V1ContextsResetInput, type V1ContextsResetOutput, type V1CronCancelInput, type V1CronCancelOutput, type V1CronListInput, type V1CronListOutput, type V1CronScheduleInput, type V1CronScheduleOutput, type V1FilesystemExistsInput, type V1FilesystemExistsOutput, type V1FilesystemExportInput, type V1FilesystemExportOutput, type V1FilesystemListMountsInput, type V1FilesystemListMountsOutput, type V1FilesystemMkdirInput, type V1FilesystemMkdirOutput, type V1FilesystemMoveInput, type V1FilesystemMoveOutput, type V1FilesystemReadFileInput, type V1FilesystemReadFileOutput, type V1FilesystemReadFilesInput, type V1FilesystemReadFilesOutput, type V1FilesystemReaddirEntriesInput, type V1FilesystemReaddirEntriesOutput, type V1FilesystemReaddirInput, type V1FilesystemReaddirOutput, type V1FilesystemReaddirRecursiveInput, type V1FilesystemReaddirRecursiveOutput, type V1FilesystemRemoveInput, type V1FilesystemRemoveOutput, type V1FilesystemStatInput, type V1FilesystemStatOutput, type V1FilesystemWriteFileInput, type V1FilesystemWriteFileOutput, type V1FilesystemWriteFilesInput, type V1FilesystemWriteFilesOutput, type V1JavaScriptEvaluateInput, type V1JavaScriptEvaluateOutput, type V1JavaScriptExecuteFileInput, type V1JavaScriptExecuteFileOutput, type V1JavaScriptExecuteInput, type V1JavaScriptExecuteOutput, type V1JavaScriptNpmInstallInput, type V1JavaScriptNpmInstallOutput, type V1JavaScriptNpmRunPackageInput, type V1JavaScriptNpmRunPackageOutput, type V1JavaScriptNpmRunScriptInput, type V1JavaScriptNpmRunScriptOutput, type V1JavaScriptSpawnFileInput, type V1JavaScriptSpawnFileOutput, type V1JavaScriptSpawnInput, type V1JavaScriptSpawnOutput, type V1NetworkFetchInput, type V1NetworkFetchOutput, type V1NetworkFetchStreamCancelInput, type V1NetworkFetchStreamCancelOutput, type V1NetworkFetchStreamReadInput, type V1NetworkFetchStreamReadOutput, type V1NetworkFetchStreamStartInput, type V1NetworkFetchStreamStartOutput, type V1NetworkPreviewCreateInput, type V1NetworkPreviewCreateOutput, type V1NetworkPreviewExpireInput, type V1NetworkPreviewExpireOutput, type V1ProcessGetInput, type V1ProcessGetOutput, type V1ProcessListInput, type V1ProcessListOutput, type V1ProcessOutputReadInput, type V1ProcessOutputReadOutput, type V1ProcessPtyResizeInput, type V1ProcessPtyResizeOutput, type V1ProcessRunInput, type V1ProcessRunOutput, type V1ProcessSignalInput, type V1ProcessSignalOutput, type V1ProcessSpawnInput, type V1ProcessSpawnOutput, type V1ProcessStdinCloseInput, type V1ProcessStdinCloseOutput, type V1ProcessStdinWriteInput, type V1ProcessStdinWriteOutput, type V1ProcessTreeInput, type V1ProcessTreeOutput, type V1ProcessWaitInput, type V1ProcessWaitOutput, type V1PythonEvaluateInput, type V1PythonEvaluateOutput, type V1PythonExecuteFileInput, type V1PythonExecuteFileOutput, type V1PythonExecuteInput, type V1PythonExecuteModuleInput, type V1PythonExecuteModuleOutput, type V1PythonExecuteOutput, type V1PythonInstallInput, type V1PythonInstallOutput, type V1PythonSpawnFileInput, type V1PythonSpawnFileOutput, type V1PythonSpawnInput, type V1PythonSpawnModuleInput, type V1PythonSpawnModuleOutput, type V1PythonSpawnOutput, type V1SoftwareInstallInput, type V1SoftwareInstallOutput, type V1SoftwareListInput, type V1SoftwareListOutput, type V1SoftwareUninstallInput, type V1SoftwareUninstallOutput, type V1TerminalCloseInput, type V1TerminalCloseOutput, type V1TerminalListInput, type V1TerminalListOutput, type V1TerminalOpenInput, type V1TerminalOpenOutput, type V1TerminalOutputReadInput, type V1TerminalOutputReadOutput, type V1TerminalPtyResizeInput, type V1TerminalPtyResizeOutput, type V1TerminalStdinWriteInput, type V1TerminalStdinWriteOutput, type V1TerminalWaitInput, type V1TerminalWaitOutput, type V1TypeScriptCheckInput, type V1TypeScriptCheckOutput, type V1TypeScriptCheckProjectInput, type V1TypeScriptCheckProjectOutput, type V1TypeScriptEvaluateInput, type V1TypeScriptEvaluateOutput, type V1TypeScriptExecuteFileInput, type V1TypeScriptExecuteFileOutput, type V1TypeScriptExecuteInput, type V1TypeScriptExecuteOutput, type V1TypeScriptSpawnFileInput, type V1TypeScriptSpawnFileOutput, type V1TypeScriptSpawnInput, type V1TypeScriptSpawnOutput, type V1VmRestartInput, type V1VmRestartOutput, type V1VmStatusInput, type V1VmStatusOutput, createAgentOsClient };