@rivet-dev/agentos 0.0.0-glibc.9438c58 → 0.0.0-main.29b0797
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/inspector-tabs-app/assets/badge-NKTqivIc.js +1 -0
- package/assets/inspector-tabs-app/assets/filesystem-CyIvO-1j.js +1 -0
- package/assets/inspector-tabs-app/assets/{index-C50G2vhD.js → index-DcBRn-yP.js} +20 -20
- package/assets/inspector-tabs-app/assets/{mounts-C0eJmxpt.js → mounts-DWpTN-N6.js} +1 -1
- package/assets/inspector-tabs-app/assets/{processes-CvN1MFLy.js → processes-CUocx7Ya.js} +1 -1
- package/assets/inspector-tabs-app/assets/scroll-area-C07uoUZ4.js +1 -0
- package/assets/inspector-tabs-app/assets/{software-BjGEcqMs.js → software-ftDfKuwh.js} +1 -1
- package/assets/inspector-tabs-app/assets/transcript-7Ao7EjSb.js +1 -0
- package/assets/inspector-tabs-app/assets/{useSuspenseQuery-CpwiXRj_.js → useSuspenseQuery-DBzwnHO3.js} +1 -1
- package/assets/inspector-tabs-app/index.html +1 -1
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +116 -773
- package/dist/index.js +773 -313
- package/dist/index.js.map +1 -1
- package/package.json +14 -14
- package/assets/inspector-tabs-app/assets/badge-Coq9s9H6.js +0 -1
- package/assets/inspector-tabs-app/assets/filesystem-_yeTmDH7.js +0 -1
- package/assets/inspector-tabs-app/assets/scroll-area-DzL-iGyn.js +0 -1
- package/assets/inspector-tabs-app/assets/transcript-BKLxbOF5.js +0 -1
- package/assets/inspector-tabs-app/assets/useQuery-RSkOi56s.js +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,107 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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:
|
|
68
|
-
|
|
69
|
-
agentCrashed: AgentCrashedPayload;
|
|
19
|
+
sessionEvent: SessionStreamEntry;
|
|
20
|
+
agentExit: AgentExitEvent;
|
|
70
21
|
vmBooted: VmBootedPayload;
|
|
71
22
|
vmShutdown: VmShutdownPayload;
|
|
72
23
|
processOutput: ProcessOutputPayload;
|
|
73
24
|
processExit: ProcessExitPayload;
|
|
25
|
+
/** Ordered PTY output containing stdout and stderr exactly once. */
|
|
74
26
|
shellData: ShellDataPayload;
|
|
75
|
-
/**
|
|
27
|
+
/** Optional stderr-only diagnostic tap; do not render it with `shellData`. */
|
|
76
28
|
shellStderr: ShellDataPayload;
|
|
77
29
|
/** Shell process exit (mirrors `waitShell` resolution). */
|
|
78
30
|
shellExit: ShellExitPayload;
|
|
79
|
-
cronEvent:
|
|
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 {
|
|
89
|
-
sessionId: string;
|
|
90
|
-
agentType: string;
|
|
91
|
-
capabilities: AgentCapabilities;
|
|
92
|
-
agentInfo: AgentInfo | null;
|
|
93
|
-
}
|
|
94
|
-
interface PersistedSessionRecord {
|
|
95
|
-
sessionId: string;
|
|
96
|
-
agentType: string;
|
|
97
|
-
createdAt: number;
|
|
98
|
-
status: "running" | "idle";
|
|
99
|
-
}
|
|
100
|
-
interface PersistedSessionEvent {
|
|
101
|
-
sessionId: string;
|
|
102
|
-
seq: number;
|
|
103
|
-
event: JsonRpcNotification;
|
|
104
|
-
createdAt: number;
|
|
31
|
+
cronEvent: SerializableCronEvent;
|
|
105
32
|
}
|
|
106
33
|
type SerializableCronAction = {
|
|
107
34
|
type: "session";
|
|
@@ -119,698 +46,114 @@ interface SerializableCronJobOptions {
|
|
|
119
46
|
action: SerializableCronAction;
|
|
120
47
|
overlap?: "allow" | "skip" | "queue";
|
|
121
48
|
}
|
|
122
|
-
|
|
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>;
|
|
49
|
+
type SerializableCronJobInfo = CronJobInfo;
|
|
130
50
|
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
};
|
|
51
|
+
type BuiltInEvents = {
|
|
52
|
+
[K in keyof AgentOsEvents]: Type<AgentOsEvents[K]>;
|
|
551
53
|
};
|
|
552
|
-
type
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
* Typed action surface for the agentOS VM actor.
|
|
567
|
-
*
|
|
568
|
-
* ⚠️ SOURCE OF TRUTH / KEEP IN SYNC ⚠️
|
|
569
|
-
* The actual dispatch is implemented in Rust at
|
|
570
|
-
* crates/agentos-actor-plugin/src/actions/mod.rs (fn `dispatch`)
|
|
571
|
-
* This interface MUST mirror that match statement one-to-one: every `"name" =>`
|
|
572
|
-
* arm there needs a corresponding method here with matching positional args and
|
|
573
|
-
* the serialized return type. When you add/rename/retype an action in
|
|
574
|
-
* `mod.rs`, update this interface in the same change (and vice-versa).
|
|
575
|
-
*
|
|
576
|
-
* RivetKit turns each `(ctx, ...args) => Promise<R>` entry into a client handle
|
|
577
|
-
* method `(...args) => Promise<R>` (it strips the leading context arg). Wiring
|
|
578
|
-
* this as the actions type param of `AgentOsActorDefinition` is what makes
|
|
579
|
-
* `createClient<typeof registry>()` return a fully-typed handle instead of the
|
|
580
|
-
* old `any`/`unknown` surface.
|
|
581
|
-
*/
|
|
582
|
-
|
|
583
|
-
/** The leading actor context arg; stripped from the client-facing method. */
|
|
584
|
-
type Ctx = any;
|
|
585
|
-
/** Directory entry returned by `readdir` / `readdirRecursive`. */
|
|
586
|
-
interface DirEntry {
|
|
587
|
-
path: string;
|
|
588
|
-
type: "file" | "directory" | "symlink";
|
|
589
|
-
size: number;
|
|
590
|
-
}
|
|
591
|
-
/** Raw `readdirEntries` entry — one typed child in a single round-trip. */
|
|
592
|
-
interface ReaddirEntry {
|
|
593
|
-
name: string;
|
|
594
|
-
isDirectory: boolean;
|
|
595
|
-
isSymbolicLink: boolean;
|
|
596
|
-
}
|
|
597
|
-
/** A process started via `spawn` (mirrors the Rust spawn handle DTO). */
|
|
598
|
-
interface SpawnedProcess {
|
|
599
|
-
pid: number;
|
|
600
|
-
}
|
|
601
|
-
/** Options accepted by `exec` (mirrors the env/cwd subset of `ExecOptions`). */
|
|
602
|
-
interface ExecActionOptions {
|
|
603
|
-
env?: Record<string, string>;
|
|
604
|
-
cwd?: string;
|
|
605
|
-
}
|
|
606
|
-
/** Options accepted by `spawn` (mirrors `SpawnActionOptions`). */
|
|
607
|
-
interface SpawnActionOptions {
|
|
608
|
-
env?: Record<string, string>;
|
|
609
|
-
cwd?: string;
|
|
610
|
-
streamStdin?: boolean;
|
|
611
|
-
}
|
|
612
|
-
/** Handle returned by `scheduleCron` (mirrors `ScheduledCronDto`). */
|
|
613
|
-
interface ScheduledCronJob {
|
|
614
|
-
id: string;
|
|
615
|
-
}
|
|
616
|
-
/** Options accepted by `vmFetch` (mirrors the Rust `FetchOptions`). */
|
|
617
|
-
interface VmFetchOptions {
|
|
618
|
-
method?: string;
|
|
619
|
-
headers?: Record<string, string>;
|
|
620
|
-
body?: string | Uint8Array;
|
|
621
|
-
}
|
|
622
|
-
/** Response from `vmFetch` (mirrors `FetchResponseDto`). */
|
|
623
|
-
interface VmFetchResponse {
|
|
624
|
-
status: number;
|
|
625
|
-
statusText: string;
|
|
626
|
-
headers: Record<string, string>;
|
|
627
|
-
body: Uint8Array;
|
|
628
|
-
}
|
|
629
|
-
/** Options accepted by `createSession` (mirrors `CreateSessionOptionsDto`). */
|
|
630
|
-
interface CreateSessionOptions {
|
|
631
|
-
cwd?: string;
|
|
632
|
-
env?: Record<string, string>;
|
|
633
|
-
skipOsInstructions?: boolean;
|
|
634
|
-
additionalInstructions?: string;
|
|
635
|
-
}
|
|
636
|
-
/** Result of `createSignedPreviewUrl` (mirrors `SignedPreviewUrlDto`). */
|
|
637
|
-
interface SignedPreviewUrl {
|
|
638
|
-
path: string;
|
|
639
|
-
token: string;
|
|
640
|
-
port: number;
|
|
641
|
-
expiresAt: number;
|
|
642
|
-
}
|
|
643
|
-
/** Options accepted by `openShell` (mirrors `OpenShellActionOptions`). */
|
|
644
|
-
interface OpenShellActionOptions {
|
|
645
|
-
command?: string;
|
|
646
|
-
args?: string[];
|
|
647
|
-
env?: Record<string, string>;
|
|
648
|
-
cwd?: string;
|
|
649
|
-
cols?: number;
|
|
650
|
-
rows?: number;
|
|
651
|
-
}
|
|
652
|
-
/** Handle returned by `openShell` (mirrors `OpenShellDto`). */
|
|
653
|
-
interface OpenShellResult {
|
|
654
|
-
shellId: string;
|
|
655
|
-
}
|
|
656
|
-
/** Per-entry result of the batch `writeFiles` / `readFiles` actions. */
|
|
657
|
-
interface WriteFileResult {
|
|
658
|
-
path: string;
|
|
659
|
-
ok: boolean;
|
|
660
|
-
error?: string;
|
|
661
|
-
}
|
|
662
|
-
interface ReadFileResult {
|
|
663
|
-
path: string;
|
|
664
|
-
content?: Uint8Array;
|
|
665
|
-
error?: string;
|
|
666
|
-
}
|
|
667
|
-
/** One configured mount, returned by `listMounts`. Mirrors `MountInfoDto`. */
|
|
668
|
-
interface MountInfo {
|
|
669
|
-
path: string;
|
|
670
|
-
/** Native mount plugin id. */
|
|
671
|
-
kind: "host_dir" | "s3" | "google_drive" | "sandbox_agent";
|
|
672
|
-
/** Provider-specific config detail (null when the plugin carries none). */
|
|
673
|
-
config: unknown;
|
|
674
|
-
readOnly: boolean;
|
|
675
|
-
}
|
|
676
|
-
/** One configured software package, returned by `listSoftware`. Mirrors `SoftwareInfoDto`. */
|
|
677
|
-
interface SoftwareInfo {
|
|
678
|
-
package: string;
|
|
679
|
-
/** Kebab-case `SoftwareKind` tag. */
|
|
680
|
-
kind: "wasm-commands" | "agent" | "tool";
|
|
681
|
-
version: string | null;
|
|
682
|
-
commands: string[];
|
|
683
|
-
}
|
|
684
|
-
/**
|
|
685
|
-
* The agentOS VM actor's action map. Keep one method per Rust `dispatch` arm.
|
|
686
|
-
*
|
|
687
|
-
* Declared as a `type` (not `interface`) so it satisfies RivetKit's
|
|
688
|
-
* `Actions<…>` constraint, which expects an implicit string index signature.
|
|
689
|
-
*/
|
|
690
|
-
type AgentOsActions = {
|
|
691
|
-
readFile: (c: Ctx, path: string) => Promise<Uint8Array>;
|
|
692
|
-
writeFile: (c: Ctx, path: string, content: string | Uint8Array) => Promise<void>;
|
|
693
|
-
stat: (c: Ctx, path: string) => Promise<VirtualStat>;
|
|
694
|
-
mkdir: (c: Ctx, path: string) => Promise<void>;
|
|
695
|
-
readdir: (c: Ctx, path: string) => Promise<string[]>;
|
|
696
|
-
readdirEntries: (c: Ctx, path: string) => Promise<ReaddirEntry[] | null>;
|
|
697
|
-
exists: (c: Ctx, path: string) => Promise<boolean>;
|
|
698
|
-
move: (c: Ctx, from: string, to: string) => Promise<void>;
|
|
699
|
-
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?: {
|
|
700
68
|
recursive?: boolean;
|
|
701
|
-
}) => Promise<void>;
|
|
702
|
-
|
|
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?: {
|
|
76
|
+
recursive?: boolean;
|
|
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.SpawnOptions | 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<{
|
|
703
120
|
path: string;
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
closeProcessStdin: (c: Ctx, pid: number) => Promise<void>;
|
|
719
|
-
openShell: (c: Ctx, options?: OpenShellActionOptions) => Promise<OpenShellResult>;
|
|
720
|
-
writeShell: (c: Ctx, shellId: string, data: string | Uint8Array) => Promise<void>;
|
|
721
|
-
resizeShell: (c: Ctx, shellId: string, cols: number, rows: number) => Promise<void>;
|
|
722
|
-
closeShell: (c: Ctx, shellId: string) => Promise<void>;
|
|
723
|
-
waitShell: (c: Ctx, shellId: string) => Promise<number>;
|
|
724
|
-
vmFetch: (c: Ctx, port: number, url: string, options?: VmFetchOptions) => Promise<VmFetchResponse>;
|
|
725
|
-
scheduleCron: (c: Ctx, options: SerializableCronJobOptions) => Promise<ScheduledCronJob>;
|
|
726
|
-
listCronJobs: (c: Ctx) => Promise<SerializableCronJobInfo[]>;
|
|
727
|
-
cancelCronJob: (c: Ctx, id: string) => Promise<void>;
|
|
728
|
-
createSession: (c: Ctx, agentType: string, options?: CreateSessionOptions) => Promise<string>;
|
|
729
|
-
sendPrompt: (c: Ctx, sessionId: string, text: string) => Promise<PromptResult>;
|
|
730
|
-
closeSession: (c: Ctx, sessionId: string) => Promise<void>;
|
|
731
|
-
listPersistedSessions: (c: Ctx) => Promise<PersistedSessionRecord[]>;
|
|
732
|
-
getSessionEvents: (c: Ctx, sessionId: string) => Promise<PersistedSessionEvent[]>;
|
|
733
|
-
respondPermission: (c: Ctx, sessionId: string, permissionId: string, reply: PermissionReply) => Promise<void>;
|
|
734
|
-
createSignedPreviewUrl: (c: Ctx, port: number, ttlSeconds: number) => Promise<SignedPreviewUrl>;
|
|
735
|
-
expireSignedPreviewUrl: (c: Ctx, token: string) => Promise<void>;
|
|
736
|
-
listMounts: (c: Ctx) => Promise<MountInfo[]>;
|
|
737
|
-
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>;
|
|
738
135
|
};
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
/**
|
|
753
|
-
* A native `host_dir` mount of a host `node_modules` directory at
|
|
754
|
-
* `/root/node_modules`, the serializable form `agentOS({ options: { mounts } })`
|
|
755
|
-
* accepts across the NAPI boundary.
|
|
756
|
-
*/
|
|
757
|
-
interface NodeModulesMountConfig {
|
|
758
|
-
path: "/root/node_modules";
|
|
759
|
-
plugin: {
|
|
760
|
-
id: "host_dir";
|
|
761
|
-
config: {
|
|
762
|
-
hostPath: string;
|
|
763
|
-
readOnly: boolean;
|
|
764
|
-
};
|
|
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;
|
|
765
148
|
};
|
|
766
|
-
readOnly: boolean;
|
|
767
149
|
}
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
*
|
|
771
|
-
* This is the explicit, mount-based replacement for the removed `moduleAccessCwd`
|
|
772
|
-
* mechanism: the VM module resolver reads the mounted tree through the kernel
|
|
773
|
-
* VFS, so the caller supplies exactly the `node_modules` directory whose
|
|
774
|
-
* packages should resolve in the guest.
|
|
775
|
-
*
|
|
776
|
-
* @param hostNodeModulesDir Absolute host path to a `node_modules` directory.
|
|
777
|
-
* @param opts.readOnly Defaults to `true`; the mount is read-only.
|
|
778
|
-
*/
|
|
779
|
-
declare function nodeModulesMount(hostNodeModulesDir: string, opts?: {
|
|
780
|
-
readOnly?: boolean;
|
|
781
|
-
}): NodeModulesMountConfig;
|
|
782
|
-
declare function buildConfigJson<TConnParams>(parsed: AgentOsActorConfig<TConnParams>): string;
|
|
783
|
-
/**
|
|
784
|
-
* Type alias for the `agentOS(...)` return type. Events are not typed at the TS
|
|
785
|
-
* surface because the Rust plugin owns the broadcast set, but the ACTIONS are
|
|
786
|
-
* typed via {@link AgentOsActions} — a TS mirror of the Rust dispatch in
|
|
787
|
-
* `crates/agentos-actor-plugin/src/actions/mod.rs`. That is what gives
|
|
788
|
-
* `createClient<typeof registry>()` a fully-typed handle (e.g. `handle.exec()`
|
|
789
|
-
* returns `ExecResult`, not `unknown`). Keep the two in sync.
|
|
790
|
-
*/
|
|
791
|
-
type AgentOsActorDefinition<TConnParams> = ActorDefinition<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, DatabaseProvider<RawAccess>, Record<never, never>, Record<never, never>, AgentOsActions>;
|
|
792
|
-
|
|
793
|
-
/**
|
|
794
|
-
* Resolve the absolute path to the agent-os actor plugin cdylib. RivetKit
|
|
795
|
-
* `dlopen`s this path through the generic native-plugin ABI.
|
|
796
|
-
*/
|
|
797
|
-
declare function getPluginPath(): string;
|
|
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>;
|
|
798
152
|
|
|
799
153
|
/**
|
|
800
|
-
*
|
|
801
|
-
*
|
|
802
|
-
* in `DEFAULT_AGENTOS_ACTOR_OPTIONS`. Any caller-supplied value wins, so an app
|
|
803
|
-
* 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.
|
|
804
156
|
*/
|
|
805
157
|
declare const setup: typeof setup$1;
|
|
806
158
|
|
|
807
|
-
type AgentOSActorConfigInput
|
|
808
|
-
type AgentOSConfigInput<TConnParams = undefined> = AgentOsOptions & {
|
|
809
|
-
preview?: AgentOsActorConfigInput<TConnParams>["preview"];
|
|
810
|
-
onBeforeConnect?: AgentOsActorConfigInput<TConnParams>["onBeforeConnect"];
|
|
811
|
-
onSessionEvent?: (sessionId: string, event: JsonRpcNotification) => void | Promise<void>;
|
|
812
|
-
onPermissionRequest?: (sessionId: string, request: PermissionRequest) => void | Promise<void>;
|
|
813
|
-
};
|
|
814
|
-
declare function agentOS<TConnParams = undefined>(config?: AgentOSConfigInput<TConnParams>): AgentOsActorDefinition<TConnParams>;
|
|
815
|
-
|
|
816
|
-
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 };
|