@rivet-dev/agentos 0.0.0-main.2f99c77 → 0.0.0-main.5ac5a14

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