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