@rivet-dev/agentos 0.0.0-integrate-dylib-into-main.815fcda → 0.0.0-max-listeners.44bc9a2

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.
@@ -0,0 +1,2 @@
1
+ export * from 'rivetkit/client';
2
+ import '@rivetkit/react';
package/dist/client.js ADDED
@@ -0,0 +1,3 @@
1
+ // src/client.ts
2
+ export * from "rivetkit/client";
3
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/client.ts"],"sourcesContent":["/**\n * `@rivet-dev/agentos/client` — Agent OS client surface.\n *\n * Re-exports RivetKit's client entry (`createClient`, `ActorHandle`,\n * `ActorConn`, etc.). This is deliberately kept OFF the root module so that\n * server/Node actor code that imports `@rivet-dev/agentos` never transitively\n * pulls in the browser/client bundle.\n *\n * The browser export condition is preserved through to `rivetkit/client`\n * (which is external here), so consumers resolving this subpath in a browser\n * environment still get RivetKit's browser client build.\n */\n\nexport * from \"rivetkit/client\";\n"],"mappings":";AAaA,cAAc;","names":[]}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,603 @@
1
- export { agentOs, type AgentOsActorDefinition, buildConfigJson, nodeModulesMount, type NodeModulesMountConfig, } from "./actor.js";
2
- export { type AgentOsActorConfig, type AgentOsActorConfigInput, agentOsActorConfigSchema, } from "./config.js";
3
- export { getPluginPath } from "./plugin-binary.js";
4
- export type { AgentOsActionContext, AgentOsActorState, AgentOsActorVars, AgentOsEvents, CronEventPayload, PermissionRequestPayload, PersistedSessionEvent, PersistedSessionRecord, ProcessExitPayload, ProcessOutputPayload, PromptResult, SerializableCronAction, SerializableCronJobInfo, SerializableCronJobOptions, SessionEventPayload, SessionRecord, ShellDataPayload, VmBootedPayload, VmShutdownPayload, } from "./types.js";
1
+ import { AgentOs, JsonRpcNotification, PermissionRequest, CronEvent, AgentCapabilities, AgentInfo, JsonRpcResponse, AgentOsOptions, NativeMountConfig } 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';
5
+
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
+ type VmBootedPayload = Record<string, never>;
24
+ interface VmShutdownPayload {
25
+ reason: "sleep" | "destroy" | "error";
26
+ }
27
+ interface ProcessOutputPayload {
28
+ pid: number;
29
+ stream: "stdout" | "stderr";
30
+ data: Uint8Array;
31
+ }
32
+ interface ProcessExitPayload {
33
+ pid: number;
34
+ exitCode: number;
35
+ }
36
+ interface ShellDataPayload {
37
+ shellId: string;
38
+ data: Uint8Array;
39
+ }
40
+ interface CronEventPayload {
41
+ event: CronEvent;
42
+ }
43
+ interface AgentOsEvents {
44
+ sessionEvent: SessionEventPayload;
45
+ permissionRequest: PermissionRequestPayload;
46
+ vmBooted: VmBootedPayload;
47
+ vmShutdown: VmShutdownPayload;
48
+ processOutput: ProcessOutputPayload;
49
+ processExit: ProcessExitPayload;
50
+ shellData: ShellDataPayload;
51
+ cronEvent: CronEventPayload;
52
+ }
53
+ /** Result from sendPrompt. */
54
+ interface PromptResult {
55
+ /** Raw JSON-RPC response from the ACP adapter. */
56
+ response: JsonRpcResponse;
57
+ /** Accumulated agent text output from streamed message chunks. */
58
+ text: string;
59
+ }
60
+ interface SessionRecord {
61
+ sessionId: string;
62
+ agentType: string;
63
+ capabilities: AgentCapabilities;
64
+ agentInfo: AgentInfo | null;
65
+ }
66
+ interface PersistedSessionRecord {
67
+ sessionId: string;
68
+ agentType: string;
69
+ capabilities: AgentCapabilities;
70
+ agentInfo: AgentInfo | null;
71
+ createdAt: number;
72
+ }
73
+ interface PersistedSessionEvent {
74
+ sessionId: string;
75
+ seq: number;
76
+ event: JsonRpcNotification;
77
+ createdAt: number;
78
+ }
79
+ type SerializableCronAction = {
80
+ type: "session";
81
+ agentType: string;
82
+ prompt: string;
83
+ cwd?: string;
84
+ } | {
85
+ type: "exec";
86
+ command: string;
87
+ args?: string[];
88
+ };
89
+ interface SerializableCronJobOptions {
90
+ id?: string;
91
+ schedule: string;
92
+ action: SerializableCronAction;
93
+ overlap?: "allow" | "skip" | "queue";
94
+ }
95
+ interface SerializableCronJobInfo {
96
+ id: string;
97
+ schedule: string;
98
+ action: SerializableCronAction;
99
+ overlap: "allow" | "skip" | "queue";
100
+ lastRun?: string;
101
+ nextRun?: string;
102
+ runCount: number;
103
+ running: boolean;
104
+ }
105
+ type AgentOsActionContext<TConnParams = undefined> = ActionContext<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, any>;
106
+
107
+ declare const nativeAgentOsOptionsSchema: z.ZodObject<{
108
+ software: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
109
+ defaultSoftware: z.ZodOptional<z.ZodBoolean>;
110
+ loopbackExemptPorts: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
111
+ allowedNodeBuiltins: z.ZodOptional<z.ZodArray<z.ZodString>>;
112
+ rootFilesystem: z.ZodOptional<z.ZodObject<{
113
+ type: z.ZodOptional<z.ZodLiteral<"overlay">>;
114
+ mode: z.ZodOptional<z.ZodEnum<{
115
+ ephemeral: "ephemeral";
116
+ "read-only": "read-only";
117
+ }>>;
118
+ disableDefaultBaseLayer: z.ZodOptional<z.ZodBoolean>;
119
+ lowers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
120
+ kind: z.ZodLiteral<"bundled-base-filesystem">;
121
+ }, z.core.$strict>, z.ZodObject<{
122
+ kind: z.ZodLiteral<"snapshot-export">;
123
+ source: z.ZodUnknown;
124
+ }, z.core.$strict>]>>>;
125
+ }, z.core.$strict>>;
126
+ mounts: z.ZodOptional<z.ZodArray<z.ZodType<NativeMountConfig, unknown, z.core.$ZodTypeInternals<NativeMountConfig, unknown>>>>;
127
+ moduleAccessCwd: z.ZodOptional<z.ZodString>;
128
+ additionalInstructions: z.ZodOptional<z.ZodString>;
129
+ permissions: z.ZodOptional<z.ZodObject<{
130
+ fs: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
131
+ allow: "allow";
132
+ deny: "deny";
133
+ }>, z.ZodObject<{
134
+ default: z.ZodOptional<z.ZodEnum<{
135
+ allow: "allow";
136
+ deny: "deny";
137
+ }>>;
138
+ rules: z.ZodArray<z.ZodObject<{
139
+ mode: z.ZodEnum<{
140
+ allow: "allow";
141
+ deny: "deny";
142
+ }>;
143
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
144
+ paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
145
+ }, z.core.$strict>>;
146
+ }, z.core.$strict>]>>;
147
+ network: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
148
+ allow: "allow";
149
+ deny: "deny";
150
+ }>, z.ZodObject<{
151
+ default: z.ZodOptional<z.ZodEnum<{
152
+ allow: "allow";
153
+ deny: "deny";
154
+ }>>;
155
+ rules: z.ZodArray<z.ZodObject<{
156
+ mode: z.ZodEnum<{
157
+ allow: "allow";
158
+ deny: "deny";
159
+ }>;
160
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
161
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
162
+ }, z.core.$strict>>;
163
+ }, z.core.$strict>]>>;
164
+ childProcess: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
165
+ allow: "allow";
166
+ deny: "deny";
167
+ }>, z.ZodObject<{
168
+ default: z.ZodOptional<z.ZodEnum<{
169
+ allow: "allow";
170
+ deny: "deny";
171
+ }>>;
172
+ rules: z.ZodArray<z.ZodObject<{
173
+ mode: z.ZodEnum<{
174
+ allow: "allow";
175
+ deny: "deny";
176
+ }>;
177
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
178
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
179
+ }, z.core.$strict>>;
180
+ }, z.core.$strict>]>>;
181
+ process: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
182
+ allow: "allow";
183
+ deny: "deny";
184
+ }>, z.ZodObject<{
185
+ default: z.ZodOptional<z.ZodEnum<{
186
+ allow: "allow";
187
+ deny: "deny";
188
+ }>>;
189
+ rules: z.ZodArray<z.ZodObject<{
190
+ mode: z.ZodEnum<{
191
+ allow: "allow";
192
+ deny: "deny";
193
+ }>;
194
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
195
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
196
+ }, z.core.$strict>>;
197
+ }, z.core.$strict>]>>;
198
+ env: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
199
+ allow: "allow";
200
+ deny: "deny";
201
+ }>, z.ZodObject<{
202
+ default: z.ZodOptional<z.ZodEnum<{
203
+ allow: "allow";
204
+ deny: "deny";
205
+ }>>;
206
+ rules: z.ZodArray<z.ZodObject<{
207
+ mode: z.ZodEnum<{
208
+ allow: "allow";
209
+ deny: "deny";
210
+ }>;
211
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
212
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
213
+ }, z.core.$strict>>;
214
+ }, z.core.$strict>]>>;
215
+ binding: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
216
+ allow: "allow";
217
+ deny: "deny";
218
+ }>, z.ZodObject<{
219
+ default: z.ZodOptional<z.ZodEnum<{
220
+ allow: "allow";
221
+ deny: "deny";
222
+ }>>;
223
+ rules: z.ZodArray<z.ZodObject<{
224
+ mode: z.ZodEnum<{
225
+ allow: "allow";
226
+ deny: "deny";
227
+ }>;
228
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
229
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
230
+ }, z.core.$strict>>;
231
+ }, z.core.$strict>]>>;
232
+ }, z.core.$strict>>;
233
+ sidecar: z.ZodOptional<z.ZodObject<{
234
+ kind: z.ZodLiteral<"shared">;
235
+ pool: z.ZodOptional<z.ZodString>;
236
+ }, z.core.$strict>>;
237
+ limits: z.ZodOptional<z.ZodObject<{
238
+ resources: z.ZodOptional<z.ZodObject<{
239
+ cpuCount: z.ZodOptional<z.ZodNumber>;
240
+ maxProcesses: z.ZodOptional<z.ZodNumber>;
241
+ maxOpenFds: z.ZodOptional<z.ZodNumber>;
242
+ maxPipes: z.ZodOptional<z.ZodNumber>;
243
+ maxPtys: z.ZodOptional<z.ZodNumber>;
244
+ maxSockets: z.ZodOptional<z.ZodNumber>;
245
+ maxConnections: z.ZodOptional<z.ZodNumber>;
246
+ maxSocketBufferedBytes: z.ZodOptional<z.ZodNumber>;
247
+ maxSocketDatagramQueueLen: z.ZodOptional<z.ZodNumber>;
248
+ maxFilesystemBytes: z.ZodOptional<z.ZodNumber>;
249
+ maxInodeCount: z.ZodOptional<z.ZodNumber>;
250
+ maxBlockingReadMs: z.ZodOptional<z.ZodNumber>;
251
+ maxPreadBytes: z.ZodOptional<z.ZodNumber>;
252
+ maxFdWriteBytes: z.ZodOptional<z.ZodNumber>;
253
+ maxProcessArgvBytes: z.ZodOptional<z.ZodNumber>;
254
+ maxProcessEnvBytes: z.ZodOptional<z.ZodNumber>;
255
+ maxReaddirEntries: z.ZodOptional<z.ZodNumber>;
256
+ maxWasmFuel: z.ZodOptional<z.ZodNumber>;
257
+ maxWasmMemoryBytes: z.ZodOptional<z.ZodNumber>;
258
+ maxWasmStackBytes: z.ZodOptional<z.ZodNumber>;
259
+ }, z.core.$strict>>;
260
+ http: z.ZodOptional<z.ZodObject<{
261
+ maxFetchResponseBytes: z.ZodOptional<z.ZodNumber>;
262
+ }, z.core.$strict>>;
263
+ tools: z.ZodOptional<z.ZodObject<{
264
+ defaultToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
265
+ maxToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
266
+ maxRegisteredToolkits: z.ZodOptional<z.ZodNumber>;
267
+ maxRegisteredToolsPerVm: z.ZodOptional<z.ZodNumber>;
268
+ maxToolsPerToolkit: z.ZodOptional<z.ZodNumber>;
269
+ maxToolSchemaBytes: z.ZodOptional<z.ZodNumber>;
270
+ maxToolExamplesPerTool: z.ZodOptional<z.ZodNumber>;
271
+ maxToolExampleInputBytes: z.ZodOptional<z.ZodNumber>;
272
+ }, z.core.$strict>>;
273
+ plugins: z.ZodOptional<z.ZodObject<{
274
+ maxPersistedManifestBytes: z.ZodOptional<z.ZodNumber>;
275
+ maxPersistedManifestFileBytes: z.ZodOptional<z.ZodNumber>;
276
+ }, z.core.$strict>>;
277
+ acp: z.ZodOptional<z.ZodObject<{
278
+ maxReadLineBytes: z.ZodOptional<z.ZodNumber>;
279
+ stdoutBufferByteLimit: z.ZodOptional<z.ZodNumber>;
280
+ }, z.core.$strict>>;
281
+ jsRuntime: z.ZodOptional<z.ZodObject<{
282
+ v8HeapLimitMb: z.ZodOptional<z.ZodNumber>;
283
+ capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
284
+ stdinBufferLimitBytes: z.ZodOptional<z.ZodNumber>;
285
+ eventPayloadLimitBytes: z.ZodOptional<z.ZodNumber>;
286
+ v8IpcMaxFrameBytes: z.ZodOptional<z.ZodNumber>;
287
+ }, z.core.$strict>>;
288
+ python: z.ZodOptional<z.ZodObject<{
289
+ outputBufferMaxBytes: z.ZodOptional<z.ZodNumber>;
290
+ executionTimeoutMs: z.ZodOptional<z.ZodNumber>;
291
+ vfsRpcTimeoutMs: z.ZodOptional<z.ZodNumber>;
292
+ }, z.core.$strict>>;
293
+ wasm: z.ZodOptional<z.ZodObject<{
294
+ maxModuleFileBytes: z.ZodOptional<z.ZodNumber>;
295
+ capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
296
+ syncReadLimitBytes: z.ZodOptional<z.ZodNumber>;
297
+ }, z.core.$strict>>;
298
+ }, z.core.$strict>>;
299
+ }, z.core.$strict>;
300
+ declare const agentOsActorConfigSchema: z.ZodObject<{
301
+ options: z.ZodOptional<z.ZodObject<{
302
+ software: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
303
+ defaultSoftware: z.ZodOptional<z.ZodBoolean>;
304
+ loopbackExemptPorts: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
305
+ allowedNodeBuiltins: z.ZodOptional<z.ZodArray<z.ZodString>>;
306
+ rootFilesystem: z.ZodOptional<z.ZodObject<{
307
+ type: z.ZodOptional<z.ZodLiteral<"overlay">>;
308
+ mode: z.ZodOptional<z.ZodEnum<{
309
+ ephemeral: "ephemeral";
310
+ "read-only": "read-only";
311
+ }>>;
312
+ disableDefaultBaseLayer: z.ZodOptional<z.ZodBoolean>;
313
+ lowers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
314
+ kind: z.ZodLiteral<"bundled-base-filesystem">;
315
+ }, z.core.$strict>, z.ZodObject<{
316
+ kind: z.ZodLiteral<"snapshot-export">;
317
+ source: z.ZodUnknown;
318
+ }, z.core.$strict>]>>>;
319
+ }, z.core.$strict>>;
320
+ mounts: z.ZodOptional<z.ZodArray<z.ZodType<NativeMountConfig, unknown, z.core.$ZodTypeInternals<NativeMountConfig, unknown>>>>;
321
+ moduleAccessCwd: z.ZodOptional<z.ZodString>;
322
+ additionalInstructions: z.ZodOptional<z.ZodString>;
323
+ permissions: z.ZodOptional<z.ZodObject<{
324
+ fs: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
325
+ allow: "allow";
326
+ deny: "deny";
327
+ }>, z.ZodObject<{
328
+ default: z.ZodOptional<z.ZodEnum<{
329
+ allow: "allow";
330
+ deny: "deny";
331
+ }>>;
332
+ rules: z.ZodArray<z.ZodObject<{
333
+ mode: z.ZodEnum<{
334
+ allow: "allow";
335
+ deny: "deny";
336
+ }>;
337
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
338
+ paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
339
+ }, z.core.$strict>>;
340
+ }, z.core.$strict>]>>;
341
+ network: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
342
+ allow: "allow";
343
+ deny: "deny";
344
+ }>, z.ZodObject<{
345
+ default: z.ZodOptional<z.ZodEnum<{
346
+ allow: "allow";
347
+ deny: "deny";
348
+ }>>;
349
+ rules: z.ZodArray<z.ZodObject<{
350
+ mode: z.ZodEnum<{
351
+ allow: "allow";
352
+ deny: "deny";
353
+ }>;
354
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
355
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
356
+ }, z.core.$strict>>;
357
+ }, z.core.$strict>]>>;
358
+ childProcess: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
359
+ allow: "allow";
360
+ deny: "deny";
361
+ }>, z.ZodObject<{
362
+ default: z.ZodOptional<z.ZodEnum<{
363
+ allow: "allow";
364
+ deny: "deny";
365
+ }>>;
366
+ rules: z.ZodArray<z.ZodObject<{
367
+ mode: z.ZodEnum<{
368
+ allow: "allow";
369
+ deny: "deny";
370
+ }>;
371
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
372
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
373
+ }, z.core.$strict>>;
374
+ }, z.core.$strict>]>>;
375
+ process: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
376
+ allow: "allow";
377
+ deny: "deny";
378
+ }>, z.ZodObject<{
379
+ default: z.ZodOptional<z.ZodEnum<{
380
+ allow: "allow";
381
+ deny: "deny";
382
+ }>>;
383
+ rules: z.ZodArray<z.ZodObject<{
384
+ mode: z.ZodEnum<{
385
+ allow: "allow";
386
+ deny: "deny";
387
+ }>;
388
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
389
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
390
+ }, z.core.$strict>>;
391
+ }, z.core.$strict>]>>;
392
+ env: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
393
+ allow: "allow";
394
+ deny: "deny";
395
+ }>, z.ZodObject<{
396
+ default: z.ZodOptional<z.ZodEnum<{
397
+ allow: "allow";
398
+ deny: "deny";
399
+ }>>;
400
+ rules: z.ZodArray<z.ZodObject<{
401
+ mode: z.ZodEnum<{
402
+ allow: "allow";
403
+ deny: "deny";
404
+ }>;
405
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
406
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
407
+ }, z.core.$strict>>;
408
+ }, z.core.$strict>]>>;
409
+ binding: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
410
+ allow: "allow";
411
+ deny: "deny";
412
+ }>, z.ZodObject<{
413
+ default: z.ZodOptional<z.ZodEnum<{
414
+ allow: "allow";
415
+ deny: "deny";
416
+ }>>;
417
+ rules: z.ZodArray<z.ZodObject<{
418
+ mode: z.ZodEnum<{
419
+ allow: "allow";
420
+ deny: "deny";
421
+ }>;
422
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
423
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
424
+ }, z.core.$strict>>;
425
+ }, z.core.$strict>]>>;
426
+ }, z.core.$strict>>;
427
+ sidecar: z.ZodOptional<z.ZodObject<{
428
+ kind: z.ZodLiteral<"shared">;
429
+ pool: z.ZodOptional<z.ZodString>;
430
+ }, z.core.$strict>>;
431
+ limits: z.ZodOptional<z.ZodObject<{
432
+ resources: z.ZodOptional<z.ZodObject<{
433
+ cpuCount: z.ZodOptional<z.ZodNumber>;
434
+ maxProcesses: z.ZodOptional<z.ZodNumber>;
435
+ maxOpenFds: z.ZodOptional<z.ZodNumber>;
436
+ maxPipes: z.ZodOptional<z.ZodNumber>;
437
+ maxPtys: z.ZodOptional<z.ZodNumber>;
438
+ maxSockets: z.ZodOptional<z.ZodNumber>;
439
+ maxConnections: z.ZodOptional<z.ZodNumber>;
440
+ maxSocketBufferedBytes: z.ZodOptional<z.ZodNumber>;
441
+ maxSocketDatagramQueueLen: z.ZodOptional<z.ZodNumber>;
442
+ maxFilesystemBytes: z.ZodOptional<z.ZodNumber>;
443
+ maxInodeCount: z.ZodOptional<z.ZodNumber>;
444
+ maxBlockingReadMs: z.ZodOptional<z.ZodNumber>;
445
+ maxPreadBytes: z.ZodOptional<z.ZodNumber>;
446
+ maxFdWriteBytes: z.ZodOptional<z.ZodNumber>;
447
+ maxProcessArgvBytes: z.ZodOptional<z.ZodNumber>;
448
+ maxProcessEnvBytes: z.ZodOptional<z.ZodNumber>;
449
+ maxReaddirEntries: z.ZodOptional<z.ZodNumber>;
450
+ maxWasmFuel: z.ZodOptional<z.ZodNumber>;
451
+ maxWasmMemoryBytes: z.ZodOptional<z.ZodNumber>;
452
+ maxWasmStackBytes: z.ZodOptional<z.ZodNumber>;
453
+ }, z.core.$strict>>;
454
+ http: z.ZodOptional<z.ZodObject<{
455
+ maxFetchResponseBytes: z.ZodOptional<z.ZodNumber>;
456
+ }, z.core.$strict>>;
457
+ tools: z.ZodOptional<z.ZodObject<{
458
+ defaultToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
459
+ maxToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
460
+ maxRegisteredToolkits: z.ZodOptional<z.ZodNumber>;
461
+ maxRegisteredToolsPerVm: z.ZodOptional<z.ZodNumber>;
462
+ maxToolsPerToolkit: z.ZodOptional<z.ZodNumber>;
463
+ maxToolSchemaBytes: z.ZodOptional<z.ZodNumber>;
464
+ maxToolExamplesPerTool: z.ZodOptional<z.ZodNumber>;
465
+ maxToolExampleInputBytes: z.ZodOptional<z.ZodNumber>;
466
+ }, z.core.$strict>>;
467
+ plugins: z.ZodOptional<z.ZodObject<{
468
+ maxPersistedManifestBytes: z.ZodOptional<z.ZodNumber>;
469
+ maxPersistedManifestFileBytes: z.ZodOptional<z.ZodNumber>;
470
+ }, z.core.$strict>>;
471
+ acp: z.ZodOptional<z.ZodObject<{
472
+ maxReadLineBytes: z.ZodOptional<z.ZodNumber>;
473
+ stdoutBufferByteLimit: z.ZodOptional<z.ZodNumber>;
474
+ }, z.core.$strict>>;
475
+ jsRuntime: z.ZodOptional<z.ZodObject<{
476
+ v8HeapLimitMb: z.ZodOptional<z.ZodNumber>;
477
+ capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
478
+ stdinBufferLimitBytes: z.ZodOptional<z.ZodNumber>;
479
+ eventPayloadLimitBytes: z.ZodOptional<z.ZodNumber>;
480
+ v8IpcMaxFrameBytes: z.ZodOptional<z.ZodNumber>;
481
+ }, z.core.$strict>>;
482
+ python: z.ZodOptional<z.ZodObject<{
483
+ outputBufferMaxBytes: z.ZodOptional<z.ZodNumber>;
484
+ executionTimeoutMs: z.ZodOptional<z.ZodNumber>;
485
+ vfsRpcTimeoutMs: z.ZodOptional<z.ZodNumber>;
486
+ }, z.core.$strict>>;
487
+ wasm: z.ZodOptional<z.ZodObject<{
488
+ maxModuleFileBytes: z.ZodOptional<z.ZodNumber>;
489
+ capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
490
+ syncReadLimitBytes: z.ZodOptional<z.ZodNumber>;
491
+ }, z.core.$strict>>;
492
+ }, z.core.$strict>>;
493
+ }, z.core.$strict>>;
494
+ actorOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
495
+ preview: z.ZodPrefault<z.ZodObject<{
496
+ defaultExpiresInSeconds: z.ZodDefault<z.ZodNumber>;
497
+ maxExpiresInSeconds: z.ZodDefault<z.ZodNumber>;
498
+ }, z.core.$strict>>;
499
+ onBeforeConnect: z.ZodOptional<z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>>;
500
+ onSessionEvent: z.ZodOptional<z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>>;
501
+ onPermissionRequest: z.ZodOptional<z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>>;
502
+ }, z.core.$strict>;
503
+ /**
504
+ * Type mirror of `nativeAgentOsOptionsSchema`.
505
+ *
506
+ * Keep this in sync with the schema above and the Rust serde mirror at
507
+ * `crates/agentos-actor-plugin/src/config.rs::AgentOsConfigJson`.
508
+ */
509
+ type NativeAgentOsOptions = Pick<AgentOsOptions, "software" | "defaultSoftware" | "loopbackExemptPorts" | "allowedNodeBuiltins" | "rootFilesystem" | "moduleAccessCwd" | "additionalInstructions" | "permissions" | "limits"> & {
510
+ mounts?: NativeMountConfig[];
511
+ sidecar?: {
512
+ kind: "shared";
513
+ pool?: string;
514
+ };
515
+ };
516
+ type AgentOsActorContext<TConnParams> = ActorContext<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, any>;
517
+ interface AgentOsActorConfigCallbacks<TConnParams> {
518
+ onBeforeConnect?: (c: BeforeConnectContext<AgentOsActorState, AgentOsActorVars, undefined, any>, params: TConnParams) => void | Promise<void>;
519
+ onSessionEvent?: (c: AgentOsActorContext<TConnParams>, sessionId: string, event: JsonRpcNotification) => void | Promise<void>;
520
+ onPermissionRequest?: (c: AgentOsActorContext<TConnParams>, sessionId: string, request: PermissionRequest) => void | Promise<void>;
521
+ }
522
+ type AgentOsActorConfig<TConnParams = undefined> = Omit<z.infer<typeof agentOsActorConfigSchema>, "options" | "onBeforeConnect" | "onSessionEvent" | "onPermissionRequest"> & {
523
+ options?: NativeAgentOsOptions;
524
+ } & AgentOsActorConfigCallbacks<TConnParams>;
525
+ type AgentOsActorConfigInput<TConnParams = undefined> = Omit<z.input<typeof agentOsActorConfigSchema>, "options" | "onBeforeConnect" | "onSessionEvent" | "onPermissionRequest"> & {
526
+ options?: NativeAgentOsOptions;
527
+ } & AgentOsActorConfigCallbacks<TConnParams>;
528
+
529
+ /**
530
+ * Rust-backed `agentOs(...)` definition.
531
+ *
532
+ * Produces an `ActorDefinition` whose `nativeFactoryBuilder` constructs a
533
+ * native-actor-plugin factory through `runtime.createNativePluginFactory(...)`
534
+ * (NAPI → `dlopen` of the agent-os actor plugin cdylib, the inverse of the
535
+ * generic host loader). All lifecycle, state, and action dispatch live in the
536
+ * Rust plugin (`crates/agentos-actor-plugin`). This JS shim only validates
537
+ * configuration, resolves the plugin + sidecar binaries, and hands the opaque
538
+ * config envelope across the bridge — it owns no agent-os runtime logic.
539
+ */
540
+
541
+ /**
542
+ * A native `host_dir` mount of a host `node_modules` directory at
543
+ * `/root/node_modules`, the serializable form `agentOs({ options: { mounts } })`
544
+ * accepts across the NAPI boundary.
545
+ */
546
+ interface NodeModulesMountConfig {
547
+ path: "/root/node_modules";
548
+ plugin: {
549
+ id: "host_dir";
550
+ config: {
551
+ hostPath: string;
552
+ readOnly: boolean;
553
+ };
554
+ };
555
+ readOnly: boolean;
556
+ }
557
+ /**
558
+ * Mount a host `node_modules` directory into the VM at `/root/node_modules`.
559
+ *
560
+ * This is the explicit, mount-based replacement for the removed `moduleAccessCwd`
561
+ * mechanism: the VM module resolver reads the mounted tree through the kernel
562
+ * VFS, so the caller supplies exactly the `node_modules` directory whose
563
+ * packages should resolve in the guest.
564
+ *
565
+ * @param hostNodeModulesDir Absolute host path to a `node_modules` directory.
566
+ * @param opts.readOnly Defaults to `true`; the mount is read-only.
567
+ */
568
+ declare function nodeModulesMount(hostNodeModulesDir: string, opts?: {
569
+ readOnly?: boolean;
570
+ }): NodeModulesMountConfig;
571
+ declare function buildConfigJson<TConnParams>(parsed: AgentOsActorConfig<TConnParams>): string;
572
+ /**
573
+ * Type alias for the `agentOs(...)` return type. Events are not typed at the
574
+ * TS surface because the Rust plugin owns the broadcast set and the
575
+ * test/client surface uses `any` for actions.
576
+ */
577
+ type AgentOsActorDefinition<TConnParams> = ActorDefinition<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, DatabaseProvider<RawAccess>, Record<never, never>, Record<never, never>, any>;
578
+ declare function agentOs<TConnParams = undefined>(config: AgentOsActorConfigInput<TConnParams>): AgentOsActorDefinition<TConnParams>;
579
+
580
+ /**
581
+ * Resolve the absolute path to the agent-os actor plugin cdylib. RivetKit
582
+ * `dlopen`s this path through the generic native-plugin ABI.
583
+ */
584
+ declare function getPluginPath(): string;
585
+
586
+ /**
587
+ * `setup()` wrapper that defaults the registry transport message-size caps to
588
+ * never-hit-by-normal-use values for AgentOS apps, mirroring the per-actor crank
589
+ * in `DEFAULT_AGENTOS_ACTOR_OPTIONS`. Any caller-supplied value wins, so an app
590
+ * can still tighten the bound when it wants one.
591
+ */
592
+ declare const setup: typeof setup$1;
593
+
594
+ type AgentOSActorConfigInput<TConnParams = undefined> = NativeAgentOsOptions & Omit<AgentOsActorConfigInput<TConnParams>, "options">;
595
+ type AgentOSConfigInput<TConnParams = undefined> = AgentOsOptions & {
596
+ preview?: AgentOsActorConfigInput<TConnParams>["preview"];
597
+ onBeforeConnect?: AgentOsActorConfigInput<TConnParams>["onBeforeConnect"];
598
+ onSessionEvent?: (sessionId: string, event: JsonRpcNotification) => void | Promise<void>;
599
+ onPermissionRequest?: (sessionId: string, request: PermissionRequest) => void | Promise<void>;
600
+ };
601
+ declare function agentOS<TConnParams = undefined>(config?: AgentOSConfigInput<TConnParams>): AgentOsActorDefinition<TConnParams>;
602
+
603
+ export { type AgentOSActorConfigInput, type AgentOSConfigInput, type AgentOsActionContext, type AgentOsActorConfig, type AgentOsActorConfigInput, type AgentOsActorState, type AgentOsActorVars, type AgentOsEvents, type CronEventPayload, type NativeAgentOsOptions, type NodeModulesMountConfig, type PermissionRequestPayload, type PersistedSessionEvent, type PersistedSessionRecord, type ProcessExitPayload, type ProcessOutputPayload, type PromptResult, type SerializableCronAction, type SerializableCronJobInfo, type SerializableCronJobOptions, type SessionEventPayload, type SessionRecord, type ShellDataPayload, type VmBootedPayload, type VmShutdownPayload, agentOS, agentOs, agentOsActorConfigSchema, buildConfigJson, getPluginPath, nativeAgentOsOptionsSchema, nodeModulesMount, setup };