@rivet-dev/agentos 0.2.8-rc.2 → 0.2.8-rc.4

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 (25) hide show
  1. package/assets/inspector-tabs-app/assets/badge-CkqYPoD9.js +1 -0
  2. package/assets/inspector-tabs-app/assets/filesystem-DbXxNt-B.js +1 -0
  3. package/assets/inspector-tabs-app/assets/{index-C50G2vhD.js → index-nTg2hrne.js} +22 -22
  4. package/assets/inspector-tabs-app/assets/{mounts-C0eJmxpt.js → mounts-BlNRslup.js} +1 -1
  5. package/assets/inspector-tabs-app/assets/{processes-CvN1MFLy.js → processes-CjHQ_o8t.js} +1 -1
  6. package/assets/inspector-tabs-app/assets/scroll-area-DE-oi7a2.js +1 -0
  7. package/assets/inspector-tabs-app/assets/{software-BjGEcqMs.js → software-2sjLheLb.js} +1 -1
  8. package/assets/inspector-tabs-app/assets/transcript-Cz9DrFWK.js +1 -0
  9. package/assets/inspector-tabs-app/assets/{useSuspenseQuery-CpwiXRj_.js → useSuspenseQuery-V0HYenB_.js} +1 -1
  10. package/assets/inspector-tabs-app/index.html +1 -1
  11. package/dist/chunk-V6TY7KAL.js +8 -0
  12. package/dist/chunk-V6TY7KAL.js.map +1 -0
  13. package/dist/client.js.map +1 -1
  14. package/dist/index.d.ts +114 -730
  15. package/dist/index.js +818 -341
  16. package/dist/index.js.map +1 -1
  17. package/dist/node.d.ts +67 -0
  18. package/dist/node.js +275 -0
  19. package/dist/node.js.map +1 -0
  20. package/package.json +21 -16
  21. package/assets/inspector-tabs-app/assets/badge-Coq9s9H6.js +0 -1
  22. package/assets/inspector-tabs-app/assets/filesystem-_yeTmDH7.js +0 -1
  23. package/assets/inspector-tabs-app/assets/scroll-area-DzL-iGyn.js +0 -1
  24. package/assets/inspector-tabs-app/assets/transcript-BKLxbOF5.js +0 -1
  25. package/assets/inspector-tabs-app/assets/useQuery-RSkOi56s.js +0 -1
package/dist/index.d.ts CHANGED
@@ -1,72 +1,23 @@
1
- import { AgentExitEvent, AgentOs, JsonRpcResponse, JsonRpcNotification, PermissionRequest, AgentCapabilities, AgentInfo, AgentOsOptions, NativeMountConfig, VirtualStat, ExecResult, SpawnedProcessInfo, ProcessInfo, ProcessTreeNode, PermissionReply } from '@rivet-dev/agentos-core';
2
- export { defineSoftware } from '@rivet-dev/agentos-core';
3
- import { ActionContext, BeforeConnectContext, ActorContext, ActorDefinition, DatabaseProvider, RawAccess, setup as setup$1 } from 'rivetkit';
4
- import { z } from 'zod/v4';
1
+ import { Actions, ActorConfigInput, ActorContext, ActorDefinition, Type, setup as setup$1 } from 'rivetkit';
2
+ import * as _rivet_dev_agentos_core from '@rivet-dev/agentos-core';
3
+ import { SessionStreamEntry, AgentExitEvent, ProcessOutput, ProcessExit, ShellData, ShellExit, CronEvent, CronJobInfo, AgentOsOptions, OpenSessionInput, PromptInput, DynamicMountDescriptor, PackageDescriptor } from '@rivet-dev/agentos-core';
4
+ export { AgentOsOptions, DirEntry, DynamicMountDescriptor, ExportRootFilesystemOptions, HttpRequest, HttpResponse, MountInfo, NodeModulesMountConfig, PackageDescriptor, ProcessExit, ProcessOutput, PromptResult, ReaddirEntry, RootSnapshotExport, SessionInfo, ShellData, ShellExit, defineSoftware, nodeModulesMount } from '@rivet-dev/agentos-core';
5
+ import * as _agentclientprotocol_sdk from '@agentclientprotocol/sdk';
6
+ import * as _rivet_dev_agentos_core_internal_runtime_compat from '@rivet-dev/agentos-core/internal/runtime-compat';
7
+ import { DatabaseProvider, RawAccess } from 'rivetkit/db';
5
8
 
6
- type AgentOsActorState = {};
7
- interface AgentOsActorVars {
8
- agentOs: AgentOs | null;
9
- activeSessionIds: Set<string>;
10
- activeProcesses: Set<number>;
11
- activeHooks: Set<Promise<void>>;
12
- activeShells: Set<string>;
13
- sessions: Set<string>;
14
- }
15
- interface SessionEventPayload {
16
- sessionId: string;
17
- event: JsonRpcNotification;
18
- }
19
- interface PermissionRequestPayload {
20
- sessionId: string;
21
- request: PermissionRequest;
22
- }
23
- interface AgentCrashedPayload {
24
- sessionId: string;
25
- event: AgentExitEvent;
26
- }
27
9
  type VmBootedPayload = Record<string, never>;
28
10
  interface VmShutdownPayload {
29
11
  reason: "sleep" | "destroy" | "error";
30
12
  }
31
- interface ProcessOutputPayload {
32
- pid: number;
33
- stream: "stdout" | "stderr";
34
- data: Uint8Array;
35
- }
36
- interface ProcessExitPayload {
37
- pid: number;
38
- exitCode: number;
39
- }
40
- interface ShellDataPayload {
41
- shellId: string;
42
- data: Uint8Array;
43
- }
44
- interface ShellExitPayload {
45
- shellId: string;
46
- exitCode: number;
47
- }
48
- type SerializableCronEvent = {
49
- type: "cron:fire";
50
- jobId: string;
51
- time: number;
52
- } | {
53
- type: "cron:complete";
54
- jobId: string;
55
- time: number;
56
- durationMs: number;
57
- } | {
58
- type: "cron:error";
59
- jobId: string;
60
- time: number;
61
- error: string;
62
- };
63
- interface CronEventPayload {
64
- event: SerializableCronEvent;
65
- }
13
+ type ProcessOutputPayload = ProcessOutput;
14
+ type ProcessExitPayload = ProcessExit;
15
+ type ShellDataPayload = ShellData;
16
+ type ShellExitPayload = ShellExit;
17
+ type SerializableCronEvent = CronEvent;
66
18
  interface AgentOsEvents {
67
- sessionEvent: SessionEventPayload;
68
- permissionRequest: PermissionRequestPayload;
69
- agentCrashed: AgentCrashedPayload;
19
+ sessionEvent: SessionStreamEntry;
20
+ agentExit: AgentExitEvent;
70
21
  vmBooted: VmBootedPayload;
71
22
  vmShutdown: VmShutdownPayload;
72
23
  processOutput: ProcessOutputPayload;
@@ -77,32 +28,7 @@ interface AgentOsEvents {
77
28
  shellStderr: ShellDataPayload;
78
29
  /** Shell process exit (mirrors `waitShell` resolution). */
79
30
  shellExit: ShellExitPayload;
80
- cronEvent: CronEventPayload;
81
- }
82
- /** Result from sendPrompt. */
83
- interface PromptResult {
84
- /** Raw JSON-RPC response from the ACP adapter. */
85
- response: JsonRpcResponse;
86
- /** Accumulated agent text output from streamed message chunks. */
87
- text: string;
88
- }
89
- interface SessionRecord {
90
- sessionId: string;
91
- agentType: string;
92
- capabilities: AgentCapabilities;
93
- agentInfo: AgentInfo | null;
94
- }
95
- interface PersistedSessionRecord {
96
- sessionId: string;
97
- agentType: string;
98
- createdAt: number;
99
- status: "running" | "idle";
100
- }
101
- interface PersistedSessionEvent {
102
- sessionId: string;
103
- seq: number;
104
- event: JsonRpcNotification;
105
- createdAt: number;
31
+ cronEvent: SerializableCronEvent;
106
32
  }
107
33
  type SerializableCronAction = {
108
34
  type: "session";
@@ -120,656 +46,114 @@ interface SerializableCronJobOptions {
120
46
  action: SerializableCronAction;
121
47
  overlap?: "allow" | "skip" | "queue";
122
48
  }
123
- interface SerializableCronJobInfo {
124
- id: string;
125
- schedule: string;
126
- overlap: "allow" | "skip" | "queue";
127
- lastRun?: number;
128
- nextRun?: number;
129
- }
130
- type AgentOsActionContext<TConnParams = undefined> = ActionContext<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, any>;
49
+ type SerializableCronJobInfo = CronJobInfo;
131
50
 
132
- declare const nativeAgentOsOptionsSchema: z.ZodObject<{
133
- software: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
134
- defaultSoftware: z.ZodOptional<z.ZodBoolean>;
135
- loopbackExemptPorts: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
136
- allowedNodeBuiltins: z.ZodOptional<z.ZodArray<z.ZodString>>;
137
- rootFilesystem: z.ZodOptional<z.ZodObject<{
138
- type: z.ZodOptional<z.ZodLiteral<"overlay">>;
139
- mode: z.ZodOptional<z.ZodEnum<{
140
- ephemeral: "ephemeral";
141
- "read-only": "read-only";
142
- }>>;
143
- disableDefaultBaseLayer: z.ZodOptional<z.ZodBoolean>;
144
- lowers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
145
- kind: z.ZodLiteral<"bundled-base-filesystem">;
146
- }, z.core.$strict>, z.ZodObject<{
147
- kind: z.ZodLiteral<"snapshot-export">;
148
- source: z.ZodUnknown;
149
- }, z.core.$strict>]>>>;
150
- }, z.core.$strict>>;
151
- mounts: z.ZodOptional<z.ZodArray<z.ZodType<NativeMountConfig, unknown, z.core.$ZodTypeInternals<NativeMountConfig, unknown>>>>;
152
- additionalInstructions: z.ZodOptional<z.ZodString>;
153
- permissions: z.ZodOptional<z.ZodObject<{
154
- fs: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
155
- allow: "allow";
156
- deny: "deny";
157
- }>, z.ZodObject<{
158
- default: z.ZodOptional<z.ZodEnum<{
159
- allow: "allow";
160
- deny: "deny";
161
- }>>;
162
- rules: z.ZodArray<z.ZodObject<{
163
- mode: z.ZodEnum<{
164
- allow: "allow";
165
- deny: "deny";
166
- }>;
167
- operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
168
- paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
169
- }, z.core.$strict>>;
170
- }, z.core.$strict>]>>;
171
- network: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
172
- allow: "allow";
173
- deny: "deny";
174
- }>, z.ZodObject<{
175
- default: z.ZodOptional<z.ZodEnum<{
176
- allow: "allow";
177
- deny: "deny";
178
- }>>;
179
- rules: z.ZodArray<z.ZodObject<{
180
- mode: z.ZodEnum<{
181
- allow: "allow";
182
- deny: "deny";
183
- }>;
184
- operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
185
- patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
186
- }, z.core.$strict>>;
187
- }, z.core.$strict>]>>;
188
- childProcess: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
189
- allow: "allow";
190
- deny: "deny";
191
- }>, z.ZodObject<{
192
- default: z.ZodOptional<z.ZodEnum<{
193
- allow: "allow";
194
- deny: "deny";
195
- }>>;
196
- rules: z.ZodArray<z.ZodObject<{
197
- mode: z.ZodEnum<{
198
- allow: "allow";
199
- deny: "deny";
200
- }>;
201
- operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
202
- patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
203
- }, z.core.$strict>>;
204
- }, z.core.$strict>]>>;
205
- process: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
206
- allow: "allow";
207
- deny: "deny";
208
- }>, z.ZodObject<{
209
- default: z.ZodOptional<z.ZodEnum<{
210
- allow: "allow";
211
- deny: "deny";
212
- }>>;
213
- rules: z.ZodArray<z.ZodObject<{
214
- mode: z.ZodEnum<{
215
- allow: "allow";
216
- deny: "deny";
217
- }>;
218
- operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
219
- patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
220
- }, z.core.$strict>>;
221
- }, z.core.$strict>]>>;
222
- env: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
223
- allow: "allow";
224
- deny: "deny";
225
- }>, z.ZodObject<{
226
- default: z.ZodOptional<z.ZodEnum<{
227
- allow: "allow";
228
- deny: "deny";
229
- }>>;
230
- rules: z.ZodArray<z.ZodObject<{
231
- mode: z.ZodEnum<{
232
- allow: "allow";
233
- deny: "deny";
234
- }>;
235
- operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
236
- patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
237
- }, z.core.$strict>>;
238
- }, z.core.$strict>]>>;
239
- binding: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
240
- allow: "allow";
241
- deny: "deny";
242
- }>, z.ZodObject<{
243
- default: z.ZodOptional<z.ZodEnum<{
244
- allow: "allow";
245
- deny: "deny";
246
- }>>;
247
- rules: z.ZodArray<z.ZodObject<{
248
- mode: z.ZodEnum<{
249
- allow: "allow";
250
- deny: "deny";
251
- }>;
252
- operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
253
- patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
254
- }, z.core.$strict>>;
255
- }, z.core.$strict>]>>;
256
- }, z.core.$strict>>;
257
- sidecar: z.ZodOptional<z.ZodObject<{
258
- kind: z.ZodLiteral<"shared">;
259
- pool: z.ZodOptional<z.ZodString>;
260
- }, z.core.$strict>>;
261
- limits: z.ZodOptional<z.ZodObject<{
262
- resources: z.ZodOptional<z.ZodObject<{
263
- cpuCount: z.ZodOptional<z.ZodNumber>;
264
- maxProcesses: z.ZodOptional<z.ZodNumber>;
265
- maxOpenFds: z.ZodOptional<z.ZodNumber>;
266
- maxPipes: z.ZodOptional<z.ZodNumber>;
267
- maxPtys: z.ZodOptional<z.ZodNumber>;
268
- maxSockets: z.ZodOptional<z.ZodNumber>;
269
- maxConnections: z.ZodOptional<z.ZodNumber>;
270
- maxSocketBufferedBytes: z.ZodOptional<z.ZodNumber>;
271
- maxSocketDatagramQueueLen: z.ZodOptional<z.ZodNumber>;
272
- maxFilesystemBytes: z.ZodOptional<z.ZodNumber>;
273
- maxInodeCount: z.ZodOptional<z.ZodNumber>;
274
- maxBlockingReadMs: z.ZodOptional<z.ZodNumber>;
275
- maxPreadBytes: z.ZodOptional<z.ZodNumber>;
276
- maxFdWriteBytes: z.ZodOptional<z.ZodNumber>;
277
- maxProcessArgvBytes: z.ZodOptional<z.ZodNumber>;
278
- maxProcessEnvBytes: z.ZodOptional<z.ZodNumber>;
279
- maxReaddirEntries: z.ZodOptional<z.ZodNumber>;
280
- maxWasmFuel: z.ZodOptional<z.ZodNumber>;
281
- maxWasmMemoryBytes: z.ZodOptional<z.ZodNumber>;
282
- maxWasmStackBytes: z.ZodOptional<z.ZodNumber>;
283
- }, z.core.$strict>>;
284
- http: z.ZodOptional<z.ZodObject<{
285
- maxFetchResponseBytes: z.ZodOptional<z.ZodNumber>;
286
- }, z.core.$strict>>;
287
- tools: z.ZodOptional<z.ZodObject<{
288
- defaultToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
289
- maxToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
290
- maxRegisteredToolkits: z.ZodOptional<z.ZodNumber>;
291
- maxRegisteredToolsPerVm: z.ZodOptional<z.ZodNumber>;
292
- maxToolsPerToolkit: z.ZodOptional<z.ZodNumber>;
293
- maxToolSchemaBytes: z.ZodOptional<z.ZodNumber>;
294
- maxToolExamplesPerTool: z.ZodOptional<z.ZodNumber>;
295
- maxToolExampleInputBytes: z.ZodOptional<z.ZodNumber>;
296
- }, z.core.$strict>>;
297
- plugins: z.ZodOptional<z.ZodObject<{
298
- maxPersistedManifestBytes: z.ZodOptional<z.ZodNumber>;
299
- maxPersistedManifestFileBytes: z.ZodOptional<z.ZodNumber>;
300
- }, z.core.$strict>>;
301
- acp: z.ZodOptional<z.ZodObject<{
302
- maxReadLineBytes: z.ZodOptional<z.ZodNumber>;
303
- stdoutBufferByteLimit: z.ZodOptional<z.ZodNumber>;
304
- }, z.core.$strict>>;
305
- jsRuntime: z.ZodOptional<z.ZodObject<{
306
- v8HeapLimitMb: z.ZodOptional<z.ZodNumber>;
307
- syncRpcWaitTimeoutMs: z.ZodOptional<z.ZodNumber>;
308
- cpuTimeLimitMs: z.ZodOptional<z.ZodNumber>;
309
- wallClockLimitMs: z.ZodOptional<z.ZodNumber>;
310
- importCacheMaterializeTimeoutMs: z.ZodOptional<z.ZodNumber>;
311
- capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
312
- stdinBufferLimitBytes: z.ZodOptional<z.ZodNumber>;
313
- eventPayloadLimitBytes: z.ZodOptional<z.ZodNumber>;
314
- v8IpcMaxFrameBytes: z.ZodOptional<z.ZodNumber>;
315
- }, z.core.$strict>>;
316
- python: z.ZodOptional<z.ZodObject<{
317
- outputBufferMaxBytes: z.ZodOptional<z.ZodNumber>;
318
- executionTimeoutMs: z.ZodOptional<z.ZodNumber>;
319
- maxOldSpaceMb: z.ZodOptional<z.ZodNumber>;
320
- vfsRpcTimeoutMs: z.ZodOptional<z.ZodNumber>;
321
- }, z.core.$strict>>;
322
- wasm: z.ZodOptional<z.ZodObject<{
323
- maxModuleFileBytes: z.ZodOptional<z.ZodNumber>;
324
- capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
325
- syncReadLimitBytes: z.ZodOptional<z.ZodNumber>;
326
- prewarmTimeoutMs: z.ZodOptional<z.ZodNumber>;
327
- runnerHeapLimitMb: z.ZodOptional<z.ZodNumber>;
328
- }, z.core.$strict>>;
329
- }, z.core.$strict>>;
330
- }, z.core.$strict>;
331
- declare const agentOsActorConfigSchema: z.ZodObject<{
332
- options: z.ZodOptional<z.ZodObject<{
333
- software: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
334
- defaultSoftware: z.ZodOptional<z.ZodBoolean>;
335
- loopbackExemptPorts: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
336
- allowedNodeBuiltins: z.ZodOptional<z.ZodArray<z.ZodString>>;
337
- rootFilesystem: z.ZodOptional<z.ZodObject<{
338
- type: z.ZodOptional<z.ZodLiteral<"overlay">>;
339
- mode: z.ZodOptional<z.ZodEnum<{
340
- ephemeral: "ephemeral";
341
- "read-only": "read-only";
342
- }>>;
343
- disableDefaultBaseLayer: z.ZodOptional<z.ZodBoolean>;
344
- lowers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
345
- kind: z.ZodLiteral<"bundled-base-filesystem">;
346
- }, z.core.$strict>, z.ZodObject<{
347
- kind: z.ZodLiteral<"snapshot-export">;
348
- source: z.ZodUnknown;
349
- }, z.core.$strict>]>>>;
350
- }, z.core.$strict>>;
351
- mounts: z.ZodOptional<z.ZodArray<z.ZodType<NativeMountConfig, unknown, z.core.$ZodTypeInternals<NativeMountConfig, unknown>>>>;
352
- additionalInstructions: z.ZodOptional<z.ZodString>;
353
- permissions: z.ZodOptional<z.ZodObject<{
354
- fs: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
355
- allow: "allow";
356
- deny: "deny";
357
- }>, z.ZodObject<{
358
- default: z.ZodOptional<z.ZodEnum<{
359
- allow: "allow";
360
- deny: "deny";
361
- }>>;
362
- rules: z.ZodArray<z.ZodObject<{
363
- mode: z.ZodEnum<{
364
- allow: "allow";
365
- deny: "deny";
366
- }>;
367
- operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
368
- paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
369
- }, z.core.$strict>>;
370
- }, z.core.$strict>]>>;
371
- network: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
372
- allow: "allow";
373
- deny: "deny";
374
- }>, z.ZodObject<{
375
- default: z.ZodOptional<z.ZodEnum<{
376
- allow: "allow";
377
- deny: "deny";
378
- }>>;
379
- rules: z.ZodArray<z.ZodObject<{
380
- mode: z.ZodEnum<{
381
- allow: "allow";
382
- deny: "deny";
383
- }>;
384
- operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
385
- patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
386
- }, z.core.$strict>>;
387
- }, z.core.$strict>]>>;
388
- childProcess: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
389
- allow: "allow";
390
- deny: "deny";
391
- }>, z.ZodObject<{
392
- default: z.ZodOptional<z.ZodEnum<{
393
- allow: "allow";
394
- deny: "deny";
395
- }>>;
396
- rules: z.ZodArray<z.ZodObject<{
397
- mode: z.ZodEnum<{
398
- allow: "allow";
399
- deny: "deny";
400
- }>;
401
- operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
402
- patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
403
- }, z.core.$strict>>;
404
- }, z.core.$strict>]>>;
405
- process: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
406
- allow: "allow";
407
- deny: "deny";
408
- }>, z.ZodObject<{
409
- default: z.ZodOptional<z.ZodEnum<{
410
- allow: "allow";
411
- deny: "deny";
412
- }>>;
413
- rules: z.ZodArray<z.ZodObject<{
414
- mode: z.ZodEnum<{
415
- allow: "allow";
416
- deny: "deny";
417
- }>;
418
- operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
419
- patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
420
- }, z.core.$strict>>;
421
- }, z.core.$strict>]>>;
422
- env: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
423
- allow: "allow";
424
- deny: "deny";
425
- }>, z.ZodObject<{
426
- default: z.ZodOptional<z.ZodEnum<{
427
- allow: "allow";
428
- deny: "deny";
429
- }>>;
430
- rules: z.ZodArray<z.ZodObject<{
431
- mode: z.ZodEnum<{
432
- allow: "allow";
433
- deny: "deny";
434
- }>;
435
- operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
436
- patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
437
- }, z.core.$strict>>;
438
- }, z.core.$strict>]>>;
439
- binding: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
440
- allow: "allow";
441
- deny: "deny";
442
- }>, z.ZodObject<{
443
- default: z.ZodOptional<z.ZodEnum<{
444
- allow: "allow";
445
- deny: "deny";
446
- }>>;
447
- rules: z.ZodArray<z.ZodObject<{
448
- mode: z.ZodEnum<{
449
- allow: "allow";
450
- deny: "deny";
451
- }>;
452
- operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
453
- patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
454
- }, z.core.$strict>>;
455
- }, z.core.$strict>]>>;
456
- }, z.core.$strict>>;
457
- sidecar: z.ZodOptional<z.ZodObject<{
458
- kind: z.ZodLiteral<"shared">;
459
- pool: z.ZodOptional<z.ZodString>;
460
- }, z.core.$strict>>;
461
- limits: z.ZodOptional<z.ZodObject<{
462
- resources: z.ZodOptional<z.ZodObject<{
463
- cpuCount: z.ZodOptional<z.ZodNumber>;
464
- maxProcesses: z.ZodOptional<z.ZodNumber>;
465
- maxOpenFds: z.ZodOptional<z.ZodNumber>;
466
- maxPipes: z.ZodOptional<z.ZodNumber>;
467
- maxPtys: z.ZodOptional<z.ZodNumber>;
468
- maxSockets: z.ZodOptional<z.ZodNumber>;
469
- maxConnections: z.ZodOptional<z.ZodNumber>;
470
- maxSocketBufferedBytes: z.ZodOptional<z.ZodNumber>;
471
- maxSocketDatagramQueueLen: z.ZodOptional<z.ZodNumber>;
472
- maxFilesystemBytes: z.ZodOptional<z.ZodNumber>;
473
- maxInodeCount: z.ZodOptional<z.ZodNumber>;
474
- maxBlockingReadMs: z.ZodOptional<z.ZodNumber>;
475
- maxPreadBytes: z.ZodOptional<z.ZodNumber>;
476
- maxFdWriteBytes: z.ZodOptional<z.ZodNumber>;
477
- maxProcessArgvBytes: z.ZodOptional<z.ZodNumber>;
478
- maxProcessEnvBytes: z.ZodOptional<z.ZodNumber>;
479
- maxReaddirEntries: z.ZodOptional<z.ZodNumber>;
480
- maxWasmFuel: z.ZodOptional<z.ZodNumber>;
481
- maxWasmMemoryBytes: z.ZodOptional<z.ZodNumber>;
482
- maxWasmStackBytes: z.ZodOptional<z.ZodNumber>;
483
- }, z.core.$strict>>;
484
- http: z.ZodOptional<z.ZodObject<{
485
- maxFetchResponseBytes: z.ZodOptional<z.ZodNumber>;
486
- }, z.core.$strict>>;
487
- tools: z.ZodOptional<z.ZodObject<{
488
- defaultToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
489
- maxToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
490
- maxRegisteredToolkits: z.ZodOptional<z.ZodNumber>;
491
- maxRegisteredToolsPerVm: z.ZodOptional<z.ZodNumber>;
492
- maxToolsPerToolkit: z.ZodOptional<z.ZodNumber>;
493
- maxToolSchemaBytes: z.ZodOptional<z.ZodNumber>;
494
- maxToolExamplesPerTool: z.ZodOptional<z.ZodNumber>;
495
- maxToolExampleInputBytes: z.ZodOptional<z.ZodNumber>;
496
- }, z.core.$strict>>;
497
- plugins: z.ZodOptional<z.ZodObject<{
498
- maxPersistedManifestBytes: z.ZodOptional<z.ZodNumber>;
499
- maxPersistedManifestFileBytes: z.ZodOptional<z.ZodNumber>;
500
- }, z.core.$strict>>;
501
- acp: z.ZodOptional<z.ZodObject<{
502
- maxReadLineBytes: z.ZodOptional<z.ZodNumber>;
503
- stdoutBufferByteLimit: z.ZodOptional<z.ZodNumber>;
504
- }, z.core.$strict>>;
505
- jsRuntime: z.ZodOptional<z.ZodObject<{
506
- v8HeapLimitMb: z.ZodOptional<z.ZodNumber>;
507
- syncRpcWaitTimeoutMs: z.ZodOptional<z.ZodNumber>;
508
- cpuTimeLimitMs: z.ZodOptional<z.ZodNumber>;
509
- wallClockLimitMs: z.ZodOptional<z.ZodNumber>;
510
- importCacheMaterializeTimeoutMs: z.ZodOptional<z.ZodNumber>;
511
- capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
512
- stdinBufferLimitBytes: z.ZodOptional<z.ZodNumber>;
513
- eventPayloadLimitBytes: z.ZodOptional<z.ZodNumber>;
514
- v8IpcMaxFrameBytes: z.ZodOptional<z.ZodNumber>;
515
- }, z.core.$strict>>;
516
- python: z.ZodOptional<z.ZodObject<{
517
- outputBufferMaxBytes: z.ZodOptional<z.ZodNumber>;
518
- executionTimeoutMs: z.ZodOptional<z.ZodNumber>;
519
- maxOldSpaceMb: z.ZodOptional<z.ZodNumber>;
520
- vfsRpcTimeoutMs: z.ZodOptional<z.ZodNumber>;
521
- }, z.core.$strict>>;
522
- wasm: z.ZodOptional<z.ZodObject<{
523
- maxModuleFileBytes: z.ZodOptional<z.ZodNumber>;
524
- capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
525
- syncReadLimitBytes: z.ZodOptional<z.ZodNumber>;
526
- prewarmTimeoutMs: z.ZodOptional<z.ZodNumber>;
527
- runnerHeapLimitMb: z.ZodOptional<z.ZodNumber>;
528
- }, z.core.$strict>>;
529
- }, z.core.$strict>>;
530
- }, z.core.$strict>>;
531
- actorOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
532
- preview: z.ZodPrefault<z.ZodObject<{
533
- defaultExpiresInSeconds: z.ZodDefault<z.ZodNumber>;
534
- maxExpiresInSeconds: z.ZodDefault<z.ZodNumber>;
535
- }, z.core.$strict>>;
536
- onBeforeConnect: z.ZodOptional<z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>>;
537
- onSessionEvent: z.ZodOptional<z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>>;
538
- onPermissionRequest: z.ZodOptional<z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>>;
539
- }, z.core.$strict>;
540
- /**
541
- * Type mirror of `nativeAgentOsOptionsSchema`.
542
- *
543
- * Keep this in sync with the schema above and the Rust serde mirror at
544
- * `crates/agentos-actor-plugin/src/config.rs::AgentOsConfigJson`.
545
- */
546
- type NativeAgentOsOptions = Pick<AgentOsOptions, "software" | "defaultSoftware" | "loopbackExemptPorts" | "allowedNodeBuiltins" | "rootFilesystem" | "additionalInstructions" | "permissions" | "limits"> & {
547
- mounts?: NativeMountConfig[];
548
- sidecar?: {
549
- kind: "shared";
550
- pool?: string;
551
- };
51
+ type BuiltInEvents = {
52
+ [K in keyof AgentOsEvents]: Type<AgentOsEvents[K]>;
552
53
  };
553
- type AgentOsActorContext<TConnParams> = ActorContext<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, any>;
554
- interface AgentOsActorConfigCallbacks<TConnParams> {
555
- onBeforeConnect?: (c: BeforeConnectContext<AgentOsActorState, AgentOsActorVars, undefined, any>, params: TConnParams) => void | Promise<void>;
556
- onSessionEvent?: (c: AgentOsActorContext<TConnParams>, sessionId: string, event: JsonRpcNotification) => void | Promise<void>;
557
- onPermissionRequest?: (c: AgentOsActorContext<TConnParams>, sessionId: string, request: PermissionRequest) => void | Promise<void>;
558
- }
559
- type AgentOsActorConfig<TConnParams = undefined> = Omit<z.infer<typeof agentOsActorConfigSchema>, "options" | "onBeforeConnect" | "onSessionEvent" | "onPermissionRequest"> & {
560
- options?: NativeAgentOsOptions;
561
- } & AgentOsActorConfigCallbacks<TConnParams>;
562
- type AgentOsActorConfigInput<TConnParams = undefined> = Omit<z.input<typeof agentOsActorConfigSchema>, "options" | "onBeforeConnect" | "onSessionEvent" | "onPermissionRequest"> & {
563
- options?: NativeAgentOsOptions;
564
- } & AgentOsActorConfigCallbacks<TConnParams>;
565
-
566
- type Ctx = any;
567
- interface DirEntry {
568
- path: string;
569
- type: "file" | "directory" | "symlink";
570
- size: number;
571
- }
572
- interface ReaddirEntry {
573
- name: string;
574
- isDirectory: boolean;
575
- isSymbolicLink: boolean;
576
- }
577
- interface SpawnedProcess {
578
- pid: number;
579
- }
580
- interface ExecActionOptions {
581
- env?: Record<string, string>;
582
- cwd?: string;
583
- }
584
- interface SpawnActionOptions {
585
- env?: Record<string, string>;
586
- cwd?: string;
587
- streamStdin?: boolean;
588
- }
589
- interface ScheduledCronJob {
590
- id: string;
591
- }
592
- interface VmFetchOptions {
593
- method?: string;
594
- headers?: Record<string, string>;
595
- body?: string | Uint8Array;
596
- }
597
- interface VmFetchResponse {
598
- status: number;
599
- statusText: string;
600
- headers: Record<string, string>;
601
- body: Uint8Array;
602
- }
603
- interface CreateSessionOptions {
604
- cwd?: string;
605
- env?: Record<string, string>;
606
- skipOsInstructions?: boolean;
607
- additionalInstructions?: string;
608
- }
609
- interface SignedPreviewUrl {
610
- path: string;
611
- token: string;
612
- port: number;
613
- expiresAt: number;
614
- }
615
- interface OpenShellActionOptions {
616
- command?: string;
617
- args?: string[];
618
- env?: Record<string, string>;
619
- cwd?: string;
620
- cols?: number;
621
- rows?: number;
622
- }
623
- interface OpenShellResult {
624
- shellId: string;
625
- }
626
- interface WriteFileResult {
627
- path: string;
628
- success: boolean;
629
- error?: string;
630
- }
631
- interface ReadFileResult {
632
- path: string;
633
- content?: Uint8Array;
634
- error?: string;
635
- }
636
- interface MountInfo {
637
- path: string;
638
- kind: "host_dir" | "s3" | "google_drive" | "sandbox_agent";
639
- config: unknown;
640
- readOnly: boolean;
641
- }
642
- interface SoftwareInfo {
643
- package: string;
644
- kind: "wasm-commands" | "agent" | "tool";
645
- version: string | null;
646
- commands: string[];
647
- }
648
- type AgentOsActions = {
649
- readFile: (c: Ctx, path: string) => Promise<Uint8Array>;
650
- writeFile: (c: Ctx, path: string, content: string | Uint8Array) => Promise<void>;
651
- stat: (c: Ctx, path: string) => Promise<VirtualStat>;
652
- mkdir: (c: Ctx, path: string) => Promise<void>;
653
- readdir: (c: Ctx, path: string) => Promise<string[]>;
654
- readdirEntries: (c: Ctx, path: string) => Promise<ReaddirEntry[] | null>;
655
- exists: (c: Ctx, path: string) => Promise<boolean>;
656
- move: (c: Ctx, from: string, to: string) => Promise<void>;
657
- deleteFile: (c: Ctx, path: string, options?: {
54
+ type ActorDb = DatabaseProvider<RawAccess>;
55
+ type EventSchemaConfig = Record<string, any>;
56
+ type QueueSchemaConfig = Record<string, any>;
57
+ type AnyContext = ActorContext<any, any, any, any, any, ActorDb, any, any>;
58
+ interface AgentOsEventHooks<TContext = AnyContext> {
59
+ onSessionEvent?: (c: TContext, sessionId: string, event: SessionStreamEntry) => void | Promise<void>;
60
+ }
61
+ declare function createAgentOsActions(options?: AgentOsOptions, hooks?: AgentOsEventHooks, preview?: AgentOsActorExtras["preview"], maxSessionSubscriptions?: number, maxDynamicMounts?: number, maxLinkedSoftware?: number): {
62
+ readFile: (c: AnyContext, path: string) => Promise<Uint8Array<ArrayBufferLike>>;
63
+ writeFile: (c: AnyContext, path: string, content: string | Uint8Array<ArrayBufferLike>) => Promise<void>;
64
+ readFiles: (c: AnyContext, paths: string[]) => Promise<_rivet_dev_agentos_core.BatchReadResult[]>;
65
+ writeFiles: (c: AnyContext, entries: _rivet_dev_agentos_core.BatchWriteEntry[]) => Promise<_rivet_dev_agentos_core.BatchWriteResult[]>;
66
+ stat: (c: AnyContext, path: string) => Promise<_rivet_dev_agentos_core_internal_runtime_compat.VirtualStat>;
67
+ mkdir: (c: AnyContext, path: string, options?: {
68
+ recursive?: boolean;
69
+ } | undefined) => Promise<void>;
70
+ readdir: (c: AnyContext, path: string) => Promise<string[]>;
71
+ readdirEntries: (c: AnyContext, path: string) => Promise<_rivet_dev_agentos_core.ReaddirEntry[]>;
72
+ readdirRecursive: (c: AnyContext, path: string, options?: _rivet_dev_agentos_core.ReaddirRecursiveOptions | undefined) => Promise<_rivet_dev_agentos_core.DirEntry[]>;
73
+ exists: (c: AnyContext, path: string) => Promise<boolean>;
74
+ move: (c: AnyContext, from: string, to: string) => Promise<void>;
75
+ remove: (c: AnyContext, path: string, options?: {
658
76
  recursive?: boolean;
659
- }) => Promise<void>;
660
- writeFiles: (c: Ctx, entries: {
77
+ } | undefined) => Promise<void>;
78
+ exec: (c: AnyContext, command: string, options?: _rivet_dev_agentos_core_internal_runtime_compat.ExecOptions | undefined) => Promise<_rivet_dev_agentos_core_internal_runtime_compat.ExecResult>;
79
+ 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>;
80
+ spawn: (c: AnyContext, command: string, args: string[], options?: _rivet_dev_agentos_core_internal_runtime_compat.KernelSpawnOptions | undefined) => Promise<{
81
+ pid: number;
82
+ }>;
83
+ waitProcess: (c: AnyContext, pid: number) => Promise<number>;
84
+ killProcess: (c: AnyContext, pid: number) => Promise<void>;
85
+ stopProcess: (c: AnyContext, pid: number) => Promise<void>;
86
+ listProcesses: (c: AnyContext) => Promise<_rivet_dev_agentos_core.SpawnedProcessInfo[]>;
87
+ allProcesses: (c: AnyContext) => Promise<_rivet_dev_agentos_core_internal_runtime_compat.ProcessInfo[]>;
88
+ processTree: (c: AnyContext) => Promise<_rivet_dev_agentos_core.ProcessTreeNode[]>;
89
+ getProcess: (c: AnyContext, pid: number) => Promise<_rivet_dev_agentos_core.SpawnedProcessInfo>;
90
+ writeProcessStdin: (c: AnyContext, pid: number, data: string | Uint8Array<ArrayBufferLike>) => Promise<void>;
91
+ closeProcessStdin: (c: AnyContext, pid: number) => Promise<void>;
92
+ openShell: (c: AnyContext, options?: _rivet_dev_agentos_core.ShellOptions | undefined) => Promise<{
93
+ shellId: string;
94
+ }>;
95
+ writeShell: (c: AnyContext, shellId: string, data: string | Uint8Array<ArrayBufferLike>) => Promise<void>;
96
+ resizeShell: (c: AnyContext, shellId: string, cols: number, rows: number) => Promise<void>;
97
+ closeShell: (c: AnyContext, shellId: string) => Promise<void>;
98
+ waitShell: (c: AnyContext, shellId: string) => Promise<number>;
99
+ httpRequest: (c: AnyContext, request: _rivet_dev_agentos_core.HttpRequest) => Promise<_rivet_dev_agentos_core.HttpResponse>;
100
+ scheduleCron: (c: AnyContext, cronOptions: SerializableCronJobOptions) => Promise<{
101
+ id: string;
102
+ }>;
103
+ listCronJobs: (c: AnyContext) => Promise<_rivet_dev_agentos_core.CronJobInfo[]>;
104
+ cancelCronJob: (c: AnyContext, id: string) => Promise<void>;
105
+ listAgents: (c: AnyContext) => Promise<_rivet_dev_agentos_core.AgentRegistryEntry[]>;
106
+ openSession: (c: AnyContext, input: OpenSessionInput) => Promise<void>;
107
+ getSession: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<_rivet_dev_agentos_core.SessionInfo>;
108
+ listSessions: (c: AnyContext, input?: _rivet_dev_agentos_core.ListSessionsInput | undefined) => Promise<_rivet_dev_agentos_core.SessionPage>;
109
+ deleteSession: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<void>;
110
+ unloadSession: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<void>;
111
+ prompt: (c: AnyContext, input: PromptInput) => Promise<_rivet_dev_agentos_core.PromptResult>;
112
+ cancelPrompt: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<_rivet_dev_agentos_core.CancelPromptResult>;
113
+ respondPermission: (c: AnyContext, input: _rivet_dev_agentos_core.PermissionResponse) => Promise<_rivet_dev_agentos_core.PermissionResponseResult>;
114
+ readHistory: (c: AnyContext, input?: _rivet_dev_agentos_core.ReadHistoryInput | undefined) => Promise<_rivet_dev_agentos_core.HistoryPage>;
115
+ getSessionConfig: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<_rivet_dev_agentos_core.SessionConfig>;
116
+ setSessionConfigOption: (c: AnyContext, input: _rivet_dev_agentos_core.SetSessionConfigOptionInput) => Promise<_rivet_dev_agentos_core.SessionConfig>;
117
+ getSessionCapabilities: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<_rivet_dev_agentos_core.SessionCapabilities | null>;
118
+ getSessionAgentInfo: (c: AnyContext, input?: _rivet_dev_agentos_core.SessionTarget | undefined) => Promise<_agentclientprotocol_sdk.Implementation | null>;
119
+ createPreviewUrl: (c: AnyContext, port: number, ttlSeconds?: number) => Promise<{
661
120
  path: string;
662
- content: string | Uint8Array;
663
- }[]) => Promise<WriteFileResult[]>;
664
- readFiles: (c: Ctx, paths: string[]) => Promise<ReadFileResult[]>;
665
- readdirRecursive: (c: Ctx, path: string) => Promise<DirEntry[]>;
666
- exec: (c: Ctx, command: string, options?: ExecActionOptions) => Promise<ExecResult>;
667
- spawn: (c: Ctx, command: string, args: string[], options?: SpawnActionOptions) => Promise<SpawnedProcess>;
668
- waitProcess: (c: Ctx, pid: number) => Promise<number>;
669
- killProcess: (c: Ctx, pid: number) => Promise<void>;
670
- stopProcess: (c: Ctx, pid: number) => Promise<void>;
671
- listProcesses: (c: Ctx) => Promise<SpawnedProcessInfo[]>;
672
- allProcesses: (c: Ctx) => Promise<ProcessInfo[]>;
673
- processTree: (c: Ctx) => Promise<ProcessTreeNode[]>;
674
- getProcess: (c: Ctx, pid: number) => Promise<SpawnedProcessInfo>;
675
- writeProcessStdin: (c: Ctx, pid: number, data: string | Uint8Array) => Promise<void>;
676
- closeProcessStdin: (c: Ctx, pid: number) => Promise<void>;
677
- openShell: (c: Ctx, options?: OpenShellActionOptions) => Promise<OpenShellResult>;
678
- writeShell: (c: Ctx, shellId: string, data: string | Uint8Array) => Promise<void>;
679
- resizeShell: (c: Ctx, shellId: string, cols: number, rows: number) => Promise<void>;
680
- closeShell: (c: Ctx, shellId: string) => Promise<void>;
681
- waitShell: (c: Ctx, shellId: string) => Promise<number>;
682
- vmFetch: (c: Ctx, port: number, url: string, options?: VmFetchOptions) => Promise<VmFetchResponse>;
683
- scheduleCron: (c: Ctx, options: SerializableCronJobOptions) => Promise<ScheduledCronJob>;
684
- listCronJobs: (c: Ctx) => Promise<SerializableCronJobInfo[]>;
685
- cancelCronJob: (c: Ctx, id: string) => Promise<void>;
686
- createSession: (c: Ctx, agentType: string, options?: CreateSessionOptions) => Promise<string>;
687
- sendPrompt: (c: Ctx, sessionId: string, text: string) => Promise<PromptResult>;
688
- closeSession: (c: Ctx, sessionId: string) => Promise<void>;
689
- listPersistedSessions: (c: Ctx) => Promise<PersistedSessionRecord[]>;
690
- getSessionEvents: (c: Ctx, sessionId: string) => Promise<PersistedSessionEvent[]>;
691
- respondPermission: (c: Ctx, sessionId: string, permissionId: string, reply: PermissionReply) => Promise<void>;
692
- createSignedPreviewUrl: (c: Ctx, port: number, ttlSeconds: number) => Promise<SignedPreviewUrl>;
693
- expireSignedPreviewUrl: (c: Ctx, token: string) => Promise<void>;
694
- listMounts: (c: Ctx) => Promise<MountInfo[]>;
695
- listSoftware: (c: Ctx) => Promise<SoftwareInfo[]>;
121
+ token: string;
122
+ port: number;
123
+ expiresAt: number;
124
+ }>;
125
+ expirePreviewUrl: (c: AnyContext, token: string) => Promise<void>;
126
+ exportRootFilesystem: (c: AnyContext, options: _rivet_dev_agentos_core.ExportRootFilesystemOptions) => Promise<_rivet_dev_agentos_core.RootSnapshotExport>;
127
+ mountFs: (c: AnyContext, descriptor: DynamicMountDescriptor) => Promise<void>;
128
+ unmountFs: (c: AnyContext, path: string) => Promise<void>;
129
+ listMounts: (c: AnyContext) => Promise<_rivet_dev_agentos_core.MountInfo[]>;
130
+ listSoftware: (c: AnyContext) => Promise<{
131
+ packageName: string;
132
+ commands: string[];
133
+ }[]>;
134
+ linkSoftware: (c: AnyContext, descriptor: PackageDescriptor) => Promise<void>;
696
135
  };
697
-
698
- /**
699
- * Rust-backed `agentOS(...)` definition.
700
- *
701
- * Produces an `ActorDefinition` whose `nativeFactoryBuilder` constructs a
702
- * native-actor-plugin factory through `runtime.createNativePluginFactory(...)`
703
- * (NAPI → `dlopen` of the agent-os actor plugin cdylib, the inverse of the
704
- * generic host loader). All lifecycle, state, and action dispatch live in the
705
- * Rust plugin (`crates/agentos-actor-plugin`). This JS shim only validates
706
- * configuration, resolves the plugin + sidecar binaries, and hands the opaque
707
- * config envelope across the bridge — it owns no agent-os runtime logic.
708
- */
709
-
710
- /**
711
- * A native `host_dir` mount of a host `node_modules` directory at
712
- * `/root/node_modules`, the serializable form `agentOS({ options: { mounts } })`
713
- * accepts across the NAPI boundary.
714
- */
715
- interface NodeModulesMountConfig {
716
- path: "/root/node_modules";
717
- plugin: {
718
- id: "host_dir";
719
- config: {
720
- hostPath: string;
721
- readOnly: boolean;
722
- };
136
+ type AgentOsActions = ReturnType<typeof createAgentOsActions>;
137
+ interface AgentOsActorExtras extends AgentOsOptions {
138
+ /** Maximum live session event subscriptions per actor VM. Default: 10,000. */
139
+ maxSessionSubscriptions?: number;
140
+ /** Maximum durable dynamic mount descriptors per actor. Default: 10,000. */
141
+ maxDynamicMounts?: number;
142
+ /** Maximum durable linked software descriptors per actor. Default: 10,000. */
143
+ maxLinkedSoftware?: number;
144
+ preview?: {
145
+ defaultExpiresInSeconds?: number;
146
+ maxExpiresInSeconds?: number;
147
+ maxActiveTokens?: number;
723
148
  };
724
- readOnly: boolean;
725
149
  }
726
- /**
727
- * Mount a host `node_modules` directory into the VM at `/root/node_modules`.
728
- *
729
- * This is the explicit, mount-based replacement for the removed `moduleAccessCwd`
730
- * mechanism: the VM module resolver reads the mounted tree through the kernel
731
- * VFS, so the caller supplies exactly the `node_modules` directory whose
732
- * packages should resolve in the guest.
733
- *
734
- * @param hostNodeModulesDir Absolute host path to a `node_modules` directory.
735
- * @param opts.readOnly Defaults to `true`; the mount is read-only.
736
- */
737
- declare function nodeModulesMount(hostNodeModulesDir: string, opts?: {
738
- readOnly?: boolean;
739
- }): NodeModulesMountConfig;
740
- declare function buildConfigJson<TConnParams>(parsed: AgentOsActorConfig<TConnParams>): string;
741
- /**
742
- * Type alias for the `agentOS(...)` return type. Events are not typed at the TS
743
- * surface because the Rust plugin owns the broadcast set, but the ACTIONS are
744
- * typed via {@link AgentOsActions} — generated from the Rust dispatch contract
745
- * table in `crates/agentos-actor-plugin/src/actions/contract_surface.rs`.
746
- * That is what gives `createClient<typeof registry>()` a fully-typed handle
747
- * (e.g. `handle.exec()` returns `ExecResult`, not `unknown`).
748
- */
749
- type AgentOsActorDefinition<TConnParams> = ActorDefinition<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, DatabaseProvider<RawAccess>, Record<never, never>, Record<never, never>, AgentOsActions>;
150
+ 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>> = Omit<ActorConfigInput<TState, TConnParams, TConnState, TVars, TInput, ActorDb, TEvents, TQueues, TUserActions>, "db"> & AgentOsActorExtras & AgentOsEventHooks<ActorContext<TState, TConnParams, TConnState, TVars, TInput, ActorDb, TEvents, TQueues>>;
151
+ 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>>(config?: AgentOsActorConfigInput<TState, TConnParams, TConnState, TVars, TInput, TEvents, TQueues, TUserActions>): ActorDefinition<TState, TConnParams, TConnState, TVars, TInput, ActorDb, TEvents & BuiltInEvents, TQueues, TUserActions & AgentOsActions>;
750
152
 
751
153
  /**
752
- * Resolve the absolute path to the agent-os actor plugin cdylib. RivetKit
753
- * `dlopen`s this path through the generic native-plugin ABI.
754
- */
755
- declare function getPluginPath(): string;
756
-
757
- /**
758
- * `setup()` wrapper that defaults the registry transport message-size caps to
759
- * never-hit-by-normal-use values for AgentOS apps, mirroring the per-actor crank
760
- * in `DEFAULT_AGENTOS_ACTOR_OPTIONS`. Any caller-supplied value wins, so an app
761
- * can still tighten the bound when it wants one.
154
+ * RivetKit setup with the direct actor SQLite UDS enabled. The UDS is consumed
155
+ * by the AgentOS sidecar; filesystem SQL never crosses the JavaScript layer.
762
156
  */
763
157
  declare const setup: typeof setup$1;
764
158
 
765
- type AgentOSActorConfigInput<TConnParams = undefined> = NativeAgentOsOptions & Omit<AgentOsActorConfigInput<TConnParams>, "options">;
766
- type AgentOSConfigInput<TConnParams = undefined> = AgentOsOptions & {
767
- preview?: AgentOsActorConfigInput<TConnParams>["preview"];
768
- actorOptions?: AgentOsActorConfigInput<TConnParams>["actorOptions"];
769
- onBeforeConnect?: AgentOsActorConfigInput<TConnParams>["onBeforeConnect"];
770
- onSessionEvent?: (sessionId: string, event: JsonRpcNotification) => void | Promise<void>;
771
- onPermissionRequest?: (sessionId: string, request: PermissionRequest) => void | Promise<void>;
772
- };
773
- declare function agentOS<TConnParams = undefined>(config?: AgentOSConfigInput<TConnParams>): AgentOsActorDefinition<TConnParams>;
774
-
775
- export { type AgentCrashedPayload, type AgentOSActorConfigInput, type AgentOSConfigInput, type AgentOsActionContext, type AgentOsActions, type AgentOsActorConfig, type AgentOsActorConfigInput, type AgentOsActorState, type AgentOsActorVars, type AgentOsEvents, type CreateSessionOptions, type CronEventPayload, type DirEntry, type NativeAgentOsOptions, type NodeModulesMountConfig, type PermissionRequestPayload, type PersistedSessionEvent, type PersistedSessionRecord, type ProcessExitPayload, type ProcessOutputPayload, type PromptResult, type ReadFileResult, type ScheduledCronJob, type SerializableCronAction, type SerializableCronEvent, type SerializableCronJobInfo, type SerializableCronJobOptions, type SessionEventPayload, type SessionRecord, type ShellDataPayload, type SignedPreviewUrl, type SpawnedProcess, type VmBootedPayload, type VmFetchOptions, type VmFetchResponse, type VmShutdownPayload, type WriteFileResult, agentOS, agentOsActorConfigSchema, buildConfigJson, getPluginPath, nativeAgentOsOptionsSchema, nodeModulesMount, setup };
159
+ export { type AgentOsActorConfigInput as AgentOSActorConfigInput, type AgentOsActorConfigInput as AgentOSConfigInput, type AgentOsActions, type AgentOsActorConfigInput, type AgentOsActorExtras, type AgentOsEventHooks, type AgentOsEvents, type ProcessExitPayload, type ProcessOutputPayload, type SerializableCronAction, type SerializableCronEvent, type SerializableCronJobInfo, type SerializableCronJobOptions, type ShellDataPayload, type ShellExitPayload, type VmBootedPayload, type VmShutdownPayload, createAgentOS as agentOS, createAgentOS, createAgentOsActions, setup };