@rivet-dev/agentos 0.0.0-abc-fixes-1.d8c4d95 → 0.0.0-agent-acp-codex-session-benchmark.d578a31
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/index.d.ts +609 -24
- package/dist/index.js +185 -93
- package/dist/index.js.map +1 -1
- package/package.json +30 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
1
|
+
import { AgentExitEvent, AgentOs, JsonRpcResponse, JsonRpcNotification, PermissionRequest, AgentCapabilities, AgentInfo, AgentOsOptions, NativeMountConfig, VirtualStat, ExecResult, SpawnedProcessInfo, ProcessInfo, 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
4
|
import { z } from 'zod/v4';
|
|
5
5
|
|
|
6
6
|
type AgentOsActorState = {};
|
|
@@ -20,6 +20,10 @@ interface PermissionRequestPayload {
|
|
|
20
20
|
sessionId: string;
|
|
21
21
|
request: PermissionRequest;
|
|
22
22
|
}
|
|
23
|
+
interface AgentCrashedPayload {
|
|
24
|
+
sessionId: string;
|
|
25
|
+
event: AgentExitEvent;
|
|
26
|
+
}
|
|
23
27
|
type VmBootedPayload = Record<string, never>;
|
|
24
28
|
interface VmShutdownPayload {
|
|
25
29
|
reason: "sleep" | "destroy" | "error";
|
|
@@ -37,17 +41,50 @@ interface ShellDataPayload {
|
|
|
37
41
|
shellId: string;
|
|
38
42
|
data: Uint8Array;
|
|
39
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
|
+
};
|
|
40
63
|
interface CronEventPayload {
|
|
41
|
-
event:
|
|
64
|
+
event: SerializableCronEvent;
|
|
65
|
+
}
|
|
66
|
+
interface StreamErrorPayload {
|
|
67
|
+
scope: "process" | "shell" | "session" | "cron";
|
|
68
|
+
id?: string;
|
|
69
|
+
code: "event_stream_lagged" | "event_stream_closed" | "stream_failed";
|
|
70
|
+
skipped?: number;
|
|
71
|
+
message: string;
|
|
42
72
|
}
|
|
43
73
|
interface AgentOsEvents {
|
|
74
|
+
/** A bounded actor stream lost continuity or closed before its terminal event. */
|
|
75
|
+
streamError: StreamErrorPayload;
|
|
44
76
|
sessionEvent: SessionEventPayload;
|
|
45
77
|
permissionRequest: PermissionRequestPayload;
|
|
78
|
+
agentCrashed: AgentCrashedPayload;
|
|
46
79
|
vmBooted: VmBootedPayload;
|
|
47
80
|
vmShutdown: VmShutdownPayload;
|
|
48
81
|
processOutput: ProcessOutputPayload;
|
|
49
82
|
processExit: ProcessExitPayload;
|
|
50
83
|
shellData: ShellDataPayload;
|
|
84
|
+
/** Shell stderr (the dedicated channel backing the TS `onStderr` option). */
|
|
85
|
+
shellStderr: ShellDataPayload;
|
|
86
|
+
/** Shell process exit (mirrors `waitShell` resolution). */
|
|
87
|
+
shellExit: ShellExitPayload;
|
|
51
88
|
cronEvent: CronEventPayload;
|
|
52
89
|
}
|
|
53
90
|
/** Result from sendPrompt. */
|
|
@@ -66,9 +103,8 @@ interface SessionRecord {
|
|
|
66
103
|
interface PersistedSessionRecord {
|
|
67
104
|
sessionId: string;
|
|
68
105
|
agentType: string;
|
|
69
|
-
capabilities: AgentCapabilities;
|
|
70
|
-
agentInfo: AgentInfo | null;
|
|
71
106
|
createdAt: number;
|
|
107
|
+
status: "running" | "idle";
|
|
72
108
|
}
|
|
73
109
|
interface PersistedSessionEvent {
|
|
74
110
|
sessionId: string;
|
|
@@ -95,17 +131,416 @@ interface SerializableCronJobOptions {
|
|
|
95
131
|
interface SerializableCronJobInfo {
|
|
96
132
|
id: string;
|
|
97
133
|
schedule: string;
|
|
98
|
-
action: SerializableCronAction;
|
|
99
134
|
overlap: "allow" | "skip" | "queue";
|
|
100
|
-
lastRun?:
|
|
101
|
-
nextRun?:
|
|
102
|
-
runCount: number;
|
|
103
|
-
running: boolean;
|
|
135
|
+
lastRun?: number;
|
|
136
|
+
nextRun?: number;
|
|
104
137
|
}
|
|
105
138
|
type AgentOsActionContext<TConnParams = undefined> = ActionContext<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, any>;
|
|
106
139
|
|
|
140
|
+
declare const nativeAgentOsOptionsSchema: z.ZodObject<{
|
|
141
|
+
software: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
142
|
+
packagePath: z.ZodString;
|
|
143
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
144
|
+
packagePath: z.ZodString;
|
|
145
|
+
}, z.core.$strip>]>>]>>>;
|
|
146
|
+
defaultSoftware: z.ZodOptional<z.ZodBoolean>;
|
|
147
|
+
loopbackExemptPorts: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
148
|
+
allowedNodeBuiltins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
149
|
+
rootFilesystem: z.ZodOptional<z.ZodObject<{
|
|
150
|
+
type: z.ZodOptional<z.ZodLiteral<"overlay">>;
|
|
151
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
152
|
+
ephemeral: "ephemeral";
|
|
153
|
+
"read-only": "read-only";
|
|
154
|
+
}>>;
|
|
155
|
+
disableDefaultBaseLayer: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
+
lowers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
157
|
+
kind: z.ZodLiteral<"bundled-base-filesystem">;
|
|
158
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
159
|
+
kind: z.ZodLiteral<"snapshot-export">;
|
|
160
|
+
source: z.ZodUnknown;
|
|
161
|
+
}, z.core.$strict>]>>>;
|
|
162
|
+
}, z.core.$strict>>;
|
|
163
|
+
mounts: z.ZodOptional<z.ZodArray<z.ZodType<NativeMountConfig, unknown, z.core.$ZodTypeInternals<NativeMountConfig, unknown>>>>;
|
|
164
|
+
additionalInstructions: z.ZodOptional<z.ZodString>;
|
|
165
|
+
permissions: z.ZodOptional<z.ZodObject<{
|
|
166
|
+
fs: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
167
|
+
allow: "allow";
|
|
168
|
+
deny: "deny";
|
|
169
|
+
}>, z.ZodObject<{
|
|
170
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
171
|
+
allow: "allow";
|
|
172
|
+
deny: "deny";
|
|
173
|
+
}>>;
|
|
174
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
175
|
+
mode: z.ZodEnum<{
|
|
176
|
+
allow: "allow";
|
|
177
|
+
deny: "deny";
|
|
178
|
+
}>;
|
|
179
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
180
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
181
|
+
}, z.core.$strict>>;
|
|
182
|
+
}, z.core.$strict>]>>;
|
|
183
|
+
network: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
184
|
+
allow: "allow";
|
|
185
|
+
deny: "deny";
|
|
186
|
+
}>, z.ZodObject<{
|
|
187
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
188
|
+
allow: "allow";
|
|
189
|
+
deny: "deny";
|
|
190
|
+
}>>;
|
|
191
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
192
|
+
mode: z.ZodEnum<{
|
|
193
|
+
allow: "allow";
|
|
194
|
+
deny: "deny";
|
|
195
|
+
}>;
|
|
196
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
197
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
198
|
+
}, z.core.$strict>>;
|
|
199
|
+
}, z.core.$strict>]>>;
|
|
200
|
+
childProcess: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
201
|
+
allow: "allow";
|
|
202
|
+
deny: "deny";
|
|
203
|
+
}>, z.ZodObject<{
|
|
204
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
205
|
+
allow: "allow";
|
|
206
|
+
deny: "deny";
|
|
207
|
+
}>>;
|
|
208
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
209
|
+
mode: z.ZodEnum<{
|
|
210
|
+
allow: "allow";
|
|
211
|
+
deny: "deny";
|
|
212
|
+
}>;
|
|
213
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
214
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
215
|
+
}, z.core.$strict>>;
|
|
216
|
+
}, z.core.$strict>]>>;
|
|
217
|
+
process: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
218
|
+
allow: "allow";
|
|
219
|
+
deny: "deny";
|
|
220
|
+
}>, z.ZodObject<{
|
|
221
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
222
|
+
allow: "allow";
|
|
223
|
+
deny: "deny";
|
|
224
|
+
}>>;
|
|
225
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
226
|
+
mode: z.ZodEnum<{
|
|
227
|
+
allow: "allow";
|
|
228
|
+
deny: "deny";
|
|
229
|
+
}>;
|
|
230
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
231
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
232
|
+
}, z.core.$strict>>;
|
|
233
|
+
}, z.core.$strict>]>>;
|
|
234
|
+
env: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
235
|
+
allow: "allow";
|
|
236
|
+
deny: "deny";
|
|
237
|
+
}>, z.ZodObject<{
|
|
238
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
239
|
+
allow: "allow";
|
|
240
|
+
deny: "deny";
|
|
241
|
+
}>>;
|
|
242
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
243
|
+
mode: z.ZodEnum<{
|
|
244
|
+
allow: "allow";
|
|
245
|
+
deny: "deny";
|
|
246
|
+
}>;
|
|
247
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
248
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
249
|
+
}, z.core.$strict>>;
|
|
250
|
+
}, z.core.$strict>]>>;
|
|
251
|
+
binding: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
252
|
+
allow: "allow";
|
|
253
|
+
deny: "deny";
|
|
254
|
+
}>, z.ZodObject<{
|
|
255
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
256
|
+
allow: "allow";
|
|
257
|
+
deny: "deny";
|
|
258
|
+
}>>;
|
|
259
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
260
|
+
mode: z.ZodEnum<{
|
|
261
|
+
allow: "allow";
|
|
262
|
+
deny: "deny";
|
|
263
|
+
}>;
|
|
264
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
265
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
266
|
+
}, z.core.$strict>>;
|
|
267
|
+
}, z.core.$strict>]>>;
|
|
268
|
+
}, z.core.$strict>>;
|
|
269
|
+
sidecar: z.ZodOptional<z.ZodObject<{
|
|
270
|
+
kind: z.ZodLiteral<"shared">;
|
|
271
|
+
pool: z.ZodOptional<z.ZodString>;
|
|
272
|
+
}, z.core.$strict>>;
|
|
273
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
274
|
+
resources: z.ZodOptional<z.ZodObject<{
|
|
275
|
+
cpuCount: z.ZodOptional<z.ZodNumber>;
|
|
276
|
+
maxProcesses: z.ZodOptional<z.ZodNumber>;
|
|
277
|
+
maxCapturedOutputBytes: z.ZodOptional<z.ZodNumber>;
|
|
278
|
+
maxOpenFds: z.ZodOptional<z.ZodNumber>;
|
|
279
|
+
maxPipes: z.ZodOptional<z.ZodNumber>;
|
|
280
|
+
maxPtys: z.ZodOptional<z.ZodNumber>;
|
|
281
|
+
maxSockets: z.ZodOptional<z.ZodNumber>;
|
|
282
|
+
maxConnections: z.ZodOptional<z.ZodNumber>;
|
|
283
|
+
maxSocketBufferedBytes: z.ZodOptional<z.ZodNumber>;
|
|
284
|
+
maxSocketDatagramQueueLen: z.ZodOptional<z.ZodNumber>;
|
|
285
|
+
maxFilesystemBytes: z.ZodOptional<z.ZodNumber>;
|
|
286
|
+
maxInodeCount: z.ZodOptional<z.ZodNumber>;
|
|
287
|
+
maxBlockingReadMs: z.ZodOptional<z.ZodNumber>;
|
|
288
|
+
maxPreadBytes: z.ZodOptional<z.ZodNumber>;
|
|
289
|
+
maxFdWriteBytes: z.ZodOptional<z.ZodNumber>;
|
|
290
|
+
maxProcessArgvBytes: z.ZodOptional<z.ZodNumber>;
|
|
291
|
+
maxProcessEnvBytes: z.ZodOptional<z.ZodNumber>;
|
|
292
|
+
maxReaddirEntries: z.ZodOptional<z.ZodNumber>;
|
|
293
|
+
maxWasmFuel: z.ZodOptional<z.ZodNumber>;
|
|
294
|
+
maxWasmMemoryBytes: z.ZodOptional<z.ZodNumber>;
|
|
295
|
+
maxWasmStackBytes: z.ZodOptional<z.ZodNumber>;
|
|
296
|
+
}, z.core.$strict>>;
|
|
297
|
+
http: z.ZodOptional<z.ZodObject<{
|
|
298
|
+
maxFetchResponseBytes: z.ZodOptional<z.ZodNumber>;
|
|
299
|
+
}, z.core.$strict>>;
|
|
300
|
+
tools: z.ZodOptional<z.ZodObject<{
|
|
301
|
+
defaultToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
302
|
+
maxToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
303
|
+
maxRegisteredToolkits: z.ZodOptional<z.ZodNumber>;
|
|
304
|
+
maxRegisteredToolsPerVm: z.ZodOptional<z.ZodNumber>;
|
|
305
|
+
maxToolsPerToolkit: z.ZodOptional<z.ZodNumber>;
|
|
306
|
+
maxToolSchemaBytes: z.ZodOptional<z.ZodNumber>;
|
|
307
|
+
maxToolExamplesPerTool: z.ZodOptional<z.ZodNumber>;
|
|
308
|
+
maxToolExampleInputBytes: z.ZodOptional<z.ZodNumber>;
|
|
309
|
+
}, z.core.$strict>>;
|
|
310
|
+
plugins: z.ZodOptional<z.ZodObject<{
|
|
311
|
+
maxPersistedManifestBytes: z.ZodOptional<z.ZodNumber>;
|
|
312
|
+
maxPersistedManifestFileBytes: z.ZodOptional<z.ZodNumber>;
|
|
313
|
+
}, z.core.$strict>>;
|
|
314
|
+
acp: z.ZodOptional<z.ZodObject<{
|
|
315
|
+
maxReadLineBytes: z.ZodOptional<z.ZodNumber>;
|
|
316
|
+
stdoutBufferByteLimit: z.ZodOptional<z.ZodNumber>;
|
|
317
|
+
}, z.core.$strict>>;
|
|
318
|
+
jsRuntime: z.ZodOptional<z.ZodObject<{
|
|
319
|
+
v8HeapLimitMb: z.ZodOptional<z.ZodNumber>;
|
|
320
|
+
syncRpcWaitTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
321
|
+
cpuTimeLimitMs: z.ZodOptional<z.ZodNumber>;
|
|
322
|
+
wallClockLimitMs: z.ZodOptional<z.ZodNumber>;
|
|
323
|
+
importCacheMaterializeTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
324
|
+
capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
325
|
+
}, z.core.$strict>>;
|
|
326
|
+
python: z.ZodOptional<z.ZodObject<{
|
|
327
|
+
outputBufferMaxBytes: z.ZodOptional<z.ZodNumber>;
|
|
328
|
+
executionTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
329
|
+
maxOldSpaceMb: z.ZodOptional<z.ZodNumber>;
|
|
330
|
+
vfsRpcTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
331
|
+
}, z.core.$strict>>;
|
|
332
|
+
wasm: z.ZodOptional<z.ZodObject<{
|
|
333
|
+
maxModuleFileBytes: z.ZodOptional<z.ZodNumber>;
|
|
334
|
+
capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
335
|
+
syncReadLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
336
|
+
prewarmTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
337
|
+
runnerHeapLimitMb: z.ZodOptional<z.ZodNumber>;
|
|
338
|
+
}, z.core.$strict>>;
|
|
339
|
+
}, z.core.$strict>>;
|
|
340
|
+
}, z.core.$strict>;
|
|
107
341
|
declare const agentOsActorConfigSchema: z.ZodObject<{
|
|
108
|
-
options: z.ZodOptional<z.
|
|
342
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
343
|
+
software: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
344
|
+
packagePath: z.ZodString;
|
|
345
|
+
}, z.core.$strip>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
346
|
+
packagePath: z.ZodString;
|
|
347
|
+
}, z.core.$strip>]>>]>>>;
|
|
348
|
+
defaultSoftware: z.ZodOptional<z.ZodBoolean>;
|
|
349
|
+
loopbackExemptPorts: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
350
|
+
allowedNodeBuiltins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
351
|
+
rootFilesystem: z.ZodOptional<z.ZodObject<{
|
|
352
|
+
type: z.ZodOptional<z.ZodLiteral<"overlay">>;
|
|
353
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
354
|
+
ephemeral: "ephemeral";
|
|
355
|
+
"read-only": "read-only";
|
|
356
|
+
}>>;
|
|
357
|
+
disableDefaultBaseLayer: z.ZodOptional<z.ZodBoolean>;
|
|
358
|
+
lowers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
359
|
+
kind: z.ZodLiteral<"bundled-base-filesystem">;
|
|
360
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
361
|
+
kind: z.ZodLiteral<"snapshot-export">;
|
|
362
|
+
source: z.ZodUnknown;
|
|
363
|
+
}, z.core.$strict>]>>>;
|
|
364
|
+
}, z.core.$strict>>;
|
|
365
|
+
mounts: z.ZodOptional<z.ZodArray<z.ZodType<NativeMountConfig, unknown, z.core.$ZodTypeInternals<NativeMountConfig, unknown>>>>;
|
|
366
|
+
additionalInstructions: z.ZodOptional<z.ZodString>;
|
|
367
|
+
permissions: z.ZodOptional<z.ZodObject<{
|
|
368
|
+
fs: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
369
|
+
allow: "allow";
|
|
370
|
+
deny: "deny";
|
|
371
|
+
}>, z.ZodObject<{
|
|
372
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
373
|
+
allow: "allow";
|
|
374
|
+
deny: "deny";
|
|
375
|
+
}>>;
|
|
376
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
377
|
+
mode: z.ZodEnum<{
|
|
378
|
+
allow: "allow";
|
|
379
|
+
deny: "deny";
|
|
380
|
+
}>;
|
|
381
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
382
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
383
|
+
}, z.core.$strict>>;
|
|
384
|
+
}, z.core.$strict>]>>;
|
|
385
|
+
network: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
386
|
+
allow: "allow";
|
|
387
|
+
deny: "deny";
|
|
388
|
+
}>, z.ZodObject<{
|
|
389
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
390
|
+
allow: "allow";
|
|
391
|
+
deny: "deny";
|
|
392
|
+
}>>;
|
|
393
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
394
|
+
mode: z.ZodEnum<{
|
|
395
|
+
allow: "allow";
|
|
396
|
+
deny: "deny";
|
|
397
|
+
}>;
|
|
398
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
399
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
400
|
+
}, z.core.$strict>>;
|
|
401
|
+
}, z.core.$strict>]>>;
|
|
402
|
+
childProcess: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
403
|
+
allow: "allow";
|
|
404
|
+
deny: "deny";
|
|
405
|
+
}>, z.ZodObject<{
|
|
406
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
407
|
+
allow: "allow";
|
|
408
|
+
deny: "deny";
|
|
409
|
+
}>>;
|
|
410
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
411
|
+
mode: z.ZodEnum<{
|
|
412
|
+
allow: "allow";
|
|
413
|
+
deny: "deny";
|
|
414
|
+
}>;
|
|
415
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
416
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
417
|
+
}, z.core.$strict>>;
|
|
418
|
+
}, z.core.$strict>]>>;
|
|
419
|
+
process: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
420
|
+
allow: "allow";
|
|
421
|
+
deny: "deny";
|
|
422
|
+
}>, z.ZodObject<{
|
|
423
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
424
|
+
allow: "allow";
|
|
425
|
+
deny: "deny";
|
|
426
|
+
}>>;
|
|
427
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
428
|
+
mode: z.ZodEnum<{
|
|
429
|
+
allow: "allow";
|
|
430
|
+
deny: "deny";
|
|
431
|
+
}>;
|
|
432
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
433
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
434
|
+
}, z.core.$strict>>;
|
|
435
|
+
}, z.core.$strict>]>>;
|
|
436
|
+
env: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
437
|
+
allow: "allow";
|
|
438
|
+
deny: "deny";
|
|
439
|
+
}>, z.ZodObject<{
|
|
440
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
441
|
+
allow: "allow";
|
|
442
|
+
deny: "deny";
|
|
443
|
+
}>>;
|
|
444
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
445
|
+
mode: z.ZodEnum<{
|
|
446
|
+
allow: "allow";
|
|
447
|
+
deny: "deny";
|
|
448
|
+
}>;
|
|
449
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
450
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
451
|
+
}, z.core.$strict>>;
|
|
452
|
+
}, z.core.$strict>]>>;
|
|
453
|
+
binding: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
454
|
+
allow: "allow";
|
|
455
|
+
deny: "deny";
|
|
456
|
+
}>, z.ZodObject<{
|
|
457
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
458
|
+
allow: "allow";
|
|
459
|
+
deny: "deny";
|
|
460
|
+
}>>;
|
|
461
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
462
|
+
mode: z.ZodEnum<{
|
|
463
|
+
allow: "allow";
|
|
464
|
+
deny: "deny";
|
|
465
|
+
}>;
|
|
466
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
467
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
468
|
+
}, z.core.$strict>>;
|
|
469
|
+
}, z.core.$strict>]>>;
|
|
470
|
+
}, z.core.$strict>>;
|
|
471
|
+
sidecar: z.ZodOptional<z.ZodObject<{
|
|
472
|
+
kind: z.ZodLiteral<"shared">;
|
|
473
|
+
pool: z.ZodOptional<z.ZodString>;
|
|
474
|
+
}, z.core.$strict>>;
|
|
475
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
476
|
+
resources: z.ZodOptional<z.ZodObject<{
|
|
477
|
+
cpuCount: z.ZodOptional<z.ZodNumber>;
|
|
478
|
+
maxProcesses: z.ZodOptional<z.ZodNumber>;
|
|
479
|
+
maxCapturedOutputBytes: z.ZodOptional<z.ZodNumber>;
|
|
480
|
+
maxOpenFds: z.ZodOptional<z.ZodNumber>;
|
|
481
|
+
maxPipes: z.ZodOptional<z.ZodNumber>;
|
|
482
|
+
maxPtys: z.ZodOptional<z.ZodNumber>;
|
|
483
|
+
maxSockets: z.ZodOptional<z.ZodNumber>;
|
|
484
|
+
maxConnections: z.ZodOptional<z.ZodNumber>;
|
|
485
|
+
maxSocketBufferedBytes: z.ZodOptional<z.ZodNumber>;
|
|
486
|
+
maxSocketDatagramQueueLen: z.ZodOptional<z.ZodNumber>;
|
|
487
|
+
maxFilesystemBytes: z.ZodOptional<z.ZodNumber>;
|
|
488
|
+
maxInodeCount: z.ZodOptional<z.ZodNumber>;
|
|
489
|
+
maxBlockingReadMs: z.ZodOptional<z.ZodNumber>;
|
|
490
|
+
maxPreadBytes: z.ZodOptional<z.ZodNumber>;
|
|
491
|
+
maxFdWriteBytes: z.ZodOptional<z.ZodNumber>;
|
|
492
|
+
maxProcessArgvBytes: z.ZodOptional<z.ZodNumber>;
|
|
493
|
+
maxProcessEnvBytes: z.ZodOptional<z.ZodNumber>;
|
|
494
|
+
maxReaddirEntries: z.ZodOptional<z.ZodNumber>;
|
|
495
|
+
maxWasmFuel: z.ZodOptional<z.ZodNumber>;
|
|
496
|
+
maxWasmMemoryBytes: z.ZodOptional<z.ZodNumber>;
|
|
497
|
+
maxWasmStackBytes: z.ZodOptional<z.ZodNumber>;
|
|
498
|
+
}, z.core.$strict>>;
|
|
499
|
+
http: z.ZodOptional<z.ZodObject<{
|
|
500
|
+
maxFetchResponseBytes: z.ZodOptional<z.ZodNumber>;
|
|
501
|
+
}, z.core.$strict>>;
|
|
502
|
+
tools: z.ZodOptional<z.ZodObject<{
|
|
503
|
+
defaultToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
504
|
+
maxToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
505
|
+
maxRegisteredToolkits: z.ZodOptional<z.ZodNumber>;
|
|
506
|
+
maxRegisteredToolsPerVm: z.ZodOptional<z.ZodNumber>;
|
|
507
|
+
maxToolsPerToolkit: z.ZodOptional<z.ZodNumber>;
|
|
508
|
+
maxToolSchemaBytes: z.ZodOptional<z.ZodNumber>;
|
|
509
|
+
maxToolExamplesPerTool: z.ZodOptional<z.ZodNumber>;
|
|
510
|
+
maxToolExampleInputBytes: z.ZodOptional<z.ZodNumber>;
|
|
511
|
+
}, z.core.$strict>>;
|
|
512
|
+
plugins: z.ZodOptional<z.ZodObject<{
|
|
513
|
+
maxPersistedManifestBytes: z.ZodOptional<z.ZodNumber>;
|
|
514
|
+
maxPersistedManifestFileBytes: z.ZodOptional<z.ZodNumber>;
|
|
515
|
+
}, z.core.$strict>>;
|
|
516
|
+
acp: z.ZodOptional<z.ZodObject<{
|
|
517
|
+
maxReadLineBytes: z.ZodOptional<z.ZodNumber>;
|
|
518
|
+
stdoutBufferByteLimit: z.ZodOptional<z.ZodNumber>;
|
|
519
|
+
}, z.core.$strict>>;
|
|
520
|
+
jsRuntime: z.ZodOptional<z.ZodObject<{
|
|
521
|
+
v8HeapLimitMb: z.ZodOptional<z.ZodNumber>;
|
|
522
|
+
syncRpcWaitTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
523
|
+
cpuTimeLimitMs: z.ZodOptional<z.ZodNumber>;
|
|
524
|
+
wallClockLimitMs: z.ZodOptional<z.ZodNumber>;
|
|
525
|
+
importCacheMaterializeTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
526
|
+
capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
527
|
+
}, z.core.$strict>>;
|
|
528
|
+
python: z.ZodOptional<z.ZodObject<{
|
|
529
|
+
outputBufferMaxBytes: z.ZodOptional<z.ZodNumber>;
|
|
530
|
+
executionTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
531
|
+
maxOldSpaceMb: z.ZodOptional<z.ZodNumber>;
|
|
532
|
+
vfsRpcTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
533
|
+
}, z.core.$strict>>;
|
|
534
|
+
wasm: z.ZodOptional<z.ZodObject<{
|
|
535
|
+
maxModuleFileBytes: z.ZodOptional<z.ZodNumber>;
|
|
536
|
+
capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
537
|
+
syncReadLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
538
|
+
prewarmTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
539
|
+
runnerHeapLimitMb: z.ZodOptional<z.ZodNumber>;
|
|
540
|
+
}, z.core.$strict>>;
|
|
541
|
+
}, z.core.$strict>>;
|
|
542
|
+
}, z.core.$strict>>;
|
|
543
|
+
actorOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
109
544
|
preview: z.ZodPrefault<z.ZodObject<{
|
|
110
545
|
defaultExpiresInSeconds: z.ZodDefault<z.ZodNumber>;
|
|
111
546
|
maxExpiresInSeconds: z.ZodDefault<z.ZodNumber>;
|
|
@@ -114,17 +549,150 @@ declare const agentOsActorConfigSchema: z.ZodObject<{
|
|
|
114
549
|
onSessionEvent: z.ZodOptional<z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>>;
|
|
115
550
|
onPermissionRequest: z.ZodOptional<z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>>;
|
|
116
551
|
}, z.core.$strict>;
|
|
552
|
+
/**
|
|
553
|
+
* Type mirror of `nativeAgentOsOptionsSchema`.
|
|
554
|
+
*
|
|
555
|
+
* Keep this in sync with the schema above and the Rust serde mirror at
|
|
556
|
+
* `crates/agentos-actor-plugin/src/config.rs::AgentOsConfigJson`.
|
|
557
|
+
*/
|
|
558
|
+
type NativeAgentOsOptions = Pick<AgentOsOptions, "software" | "defaultSoftware" | "loopbackExemptPorts" | "allowedNodeBuiltins" | "rootFilesystem" | "additionalInstructions" | "permissions" | "limits"> & {
|
|
559
|
+
mounts?: NativeMountConfig[];
|
|
560
|
+
sidecar?: {
|
|
561
|
+
kind: "shared";
|
|
562
|
+
pool?: string;
|
|
563
|
+
};
|
|
564
|
+
};
|
|
117
565
|
type AgentOsActorContext<TConnParams> = ActorContext<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, any>;
|
|
118
566
|
interface AgentOsActorConfigCallbacks<TConnParams> {
|
|
119
567
|
onBeforeConnect?: (c: BeforeConnectContext<AgentOsActorState, AgentOsActorVars, undefined, any>, params: TConnParams) => void | Promise<void>;
|
|
120
568
|
onSessionEvent?: (c: AgentOsActorContext<TConnParams>, sessionId: string, event: JsonRpcNotification) => void | Promise<void>;
|
|
121
569
|
onPermissionRequest?: (c: AgentOsActorContext<TConnParams>, sessionId: string, request: PermissionRequest) => void | Promise<void>;
|
|
122
570
|
}
|
|
123
|
-
type AgentOsActorConfig<TConnParams = undefined> = Omit<z.infer<typeof agentOsActorConfigSchema>, "onBeforeConnect" | "onSessionEvent" | "onPermissionRequest"> &
|
|
124
|
-
|
|
571
|
+
type AgentOsActorConfig<TConnParams = undefined> = Omit<z.infer<typeof agentOsActorConfigSchema>, "options" | "onBeforeConnect" | "onSessionEvent" | "onPermissionRequest"> & {
|
|
572
|
+
options?: NativeAgentOsOptions;
|
|
573
|
+
} & AgentOsActorConfigCallbacks<TConnParams>;
|
|
574
|
+
type AgentOsActorConfigInput<TConnParams = undefined> = Omit<z.input<typeof agentOsActorConfigSchema>, "options" | "onBeforeConnect" | "onSessionEvent" | "onPermissionRequest"> & {
|
|
575
|
+
options?: NativeAgentOsOptions;
|
|
576
|
+
} & AgentOsActorConfigCallbacks<TConnParams>;
|
|
577
|
+
|
|
578
|
+
type Ctx = any;
|
|
579
|
+
interface DirEntry {
|
|
580
|
+
path: string;
|
|
581
|
+
type: "file" | "directory" | "symlink";
|
|
582
|
+
size: number;
|
|
583
|
+
}
|
|
584
|
+
interface ReaddirEntry {
|
|
585
|
+
name: string;
|
|
586
|
+
isDirectory: boolean;
|
|
587
|
+
isSymbolicLink: boolean;
|
|
588
|
+
}
|
|
589
|
+
interface SpawnedProcess {
|
|
590
|
+
pid: number;
|
|
591
|
+
}
|
|
592
|
+
interface ExecActionOptions {
|
|
593
|
+
env?: Record<string, string>;
|
|
594
|
+
cwd?: string;
|
|
595
|
+
}
|
|
596
|
+
interface SpawnActionOptions {
|
|
597
|
+
env?: Record<string, string>;
|
|
598
|
+
cwd?: string;
|
|
599
|
+
streamStdin?: boolean;
|
|
600
|
+
}
|
|
601
|
+
interface ScheduledCronJob {
|
|
602
|
+
id: string;
|
|
603
|
+
}
|
|
604
|
+
interface VmFetchOptions {
|
|
605
|
+
method?: string;
|
|
606
|
+
headers?: Record<string, string>;
|
|
607
|
+
body?: string | Uint8Array;
|
|
608
|
+
}
|
|
609
|
+
interface VmFetchResponse {
|
|
610
|
+
status: number;
|
|
611
|
+
statusText: string;
|
|
612
|
+
headers: Record<string, string>;
|
|
613
|
+
body: Uint8Array;
|
|
614
|
+
}
|
|
615
|
+
interface CreateSessionOptions {
|
|
616
|
+
cwd?: string;
|
|
617
|
+
env?: Record<string, string>;
|
|
618
|
+
skipOsInstructions?: boolean;
|
|
619
|
+
additionalInstructions?: string;
|
|
620
|
+
}
|
|
621
|
+
interface SignedPreviewUrl {
|
|
622
|
+
path: string;
|
|
623
|
+
token: string;
|
|
624
|
+
port: number;
|
|
625
|
+
expiresAt: number;
|
|
626
|
+
}
|
|
627
|
+
interface OpenShellActionOptions {
|
|
628
|
+
command?: string;
|
|
629
|
+
args?: string[];
|
|
630
|
+
env?: Record<string, string>;
|
|
631
|
+
cwd?: string;
|
|
632
|
+
cols?: number;
|
|
633
|
+
rows?: number;
|
|
634
|
+
}
|
|
635
|
+
interface OpenShellResult {
|
|
636
|
+
shellId: string;
|
|
637
|
+
}
|
|
638
|
+
interface MountInfo {
|
|
639
|
+
path: string;
|
|
640
|
+
kind: "host_dir" | "s3" | "google_drive" | "sandbox_agent";
|
|
641
|
+
config: unknown;
|
|
642
|
+
readOnly: boolean;
|
|
643
|
+
}
|
|
644
|
+
interface SoftwareInfo {
|
|
645
|
+
package: string;
|
|
646
|
+
kind: "wasm-commands" | "agent" | "tool";
|
|
647
|
+
version: string | null;
|
|
648
|
+
commands: string[];
|
|
649
|
+
}
|
|
650
|
+
type AgentOsActions = {
|
|
651
|
+
readFile: (c: Ctx, path: string) => Promise<Uint8Array>;
|
|
652
|
+
writeFile: (c: Ctx, path: string, content: string | Uint8Array) => Promise<void>;
|
|
653
|
+
stat: (c: Ctx, path: string) => Promise<VirtualStat>;
|
|
654
|
+
mkdir: (c: Ctx, path: string) => Promise<void>;
|
|
655
|
+
readdir: (c: Ctx, path: string) => Promise<string[]>;
|
|
656
|
+
readdirEntries: (c: Ctx, path: string) => Promise<ReaddirEntry[] | null>;
|
|
657
|
+
exists: (c: Ctx, path: string) => Promise<boolean>;
|
|
658
|
+
move: (c: Ctx, from: string, to: string) => Promise<void>;
|
|
659
|
+
deleteFile: (c: Ctx, path: string, options?: {
|
|
660
|
+
recursive?: boolean;
|
|
661
|
+
}) => Promise<void>;
|
|
662
|
+
readdirRecursive: (c: Ctx, path: string) => Promise<DirEntry[]>;
|
|
663
|
+
exec: (c: Ctx, command: string, options?: ExecActionOptions) => Promise<ExecResult>;
|
|
664
|
+
spawn: (c: Ctx, command: string, args: string[], options?: SpawnActionOptions) => Promise<SpawnedProcess>;
|
|
665
|
+
waitProcess: (c: Ctx, pid: number) => Promise<number>;
|
|
666
|
+
killProcess: (c: Ctx, pid: number) => Promise<void>;
|
|
667
|
+
stopProcess: (c: Ctx, pid: number) => Promise<void>;
|
|
668
|
+
listProcesses: (c: Ctx) => Promise<SpawnedProcessInfo[]>;
|
|
669
|
+
allProcesses: (c: Ctx) => Promise<ProcessInfo[]>;
|
|
670
|
+
getProcess: (c: Ctx, pid: number) => Promise<SpawnedProcessInfo>;
|
|
671
|
+
writeProcessStdin: (c: Ctx, pid: number, data: string | Uint8Array) => Promise<void>;
|
|
672
|
+
closeProcessStdin: (c: Ctx, pid: number) => Promise<void>;
|
|
673
|
+
openShell: (c: Ctx, options?: OpenShellActionOptions) => Promise<OpenShellResult>;
|
|
674
|
+
writeShell: (c: Ctx, shellId: string, data: string | Uint8Array) => Promise<void>;
|
|
675
|
+
resizeShell: (c: Ctx, shellId: string, cols: number, rows: number) => Promise<void>;
|
|
676
|
+
closeShell: (c: Ctx, shellId: string) => Promise<void>;
|
|
677
|
+
waitShell: (c: Ctx, shellId: string) => Promise<number>;
|
|
678
|
+
vmFetch: (c: Ctx, port: number, url: string, options?: VmFetchOptions) => Promise<VmFetchResponse>;
|
|
679
|
+
scheduleCron: (c: Ctx, options: SerializableCronJobOptions) => Promise<ScheduledCronJob>;
|
|
680
|
+
listCronJobs: (c: Ctx) => Promise<SerializableCronJobInfo[]>;
|
|
681
|
+
cancelCronJob: (c: Ctx, id: string) => Promise<void>;
|
|
682
|
+
createSession: (c: Ctx, agentType: string, options?: CreateSessionOptions) => Promise<string>;
|
|
683
|
+
sendPrompt: (c: Ctx, sessionId: string, text: string) => Promise<PromptResult>;
|
|
684
|
+
closeSession: (c: Ctx, sessionId: string) => Promise<void>;
|
|
685
|
+
listPersistedSessions: (c: Ctx) => Promise<PersistedSessionRecord[]>;
|
|
686
|
+
getSessionEvents: (c: Ctx, sessionId: string) => Promise<PersistedSessionEvent[]>;
|
|
687
|
+
respondPermission: (c: Ctx, sessionId: string, permissionId: string, reply: PermissionReply) => Promise<void>;
|
|
688
|
+
createSignedPreviewUrl: (c: Ctx, port: number, ttlSeconds: number) => Promise<SignedPreviewUrl>;
|
|
689
|
+
expireSignedPreviewUrl: (c: Ctx, token: string) => Promise<void>;
|
|
690
|
+
listMounts: (c: Ctx) => Promise<MountInfo[]>;
|
|
691
|
+
listSoftware: (c: Ctx) => Promise<SoftwareInfo[]>;
|
|
692
|
+
};
|
|
125
693
|
|
|
126
694
|
/**
|
|
127
|
-
* Rust-backed `
|
|
695
|
+
* Rust-backed `agentOS(...)` definition.
|
|
128
696
|
*
|
|
129
697
|
* Produces an `ActorDefinition` whose `nativeFactoryBuilder` constructs a
|
|
130
698
|
* native-actor-plugin factory through `runtime.createNativePluginFactory(...)`
|
|
@@ -137,7 +705,7 @@ type AgentOsActorConfigInput<TConnParams = undefined> = Omit<z.input<typeof agen
|
|
|
137
705
|
|
|
138
706
|
/**
|
|
139
707
|
* A native `host_dir` mount of a host `node_modules` directory at
|
|
140
|
-
* `/root/node_modules`, the serializable form `
|
|
708
|
+
* `/root/node_modules`, the serializable form `agentOS({ options: { mounts } })`
|
|
141
709
|
* accepts across the NAPI boundary.
|
|
142
710
|
*/
|
|
143
711
|
interface NodeModulesMountConfig {
|
|
@@ -167,12 +735,14 @@ declare function nodeModulesMount(hostNodeModulesDir: string, opts?: {
|
|
|
167
735
|
}): NodeModulesMountConfig;
|
|
168
736
|
declare function buildConfigJson<TConnParams>(parsed: AgentOsActorConfig<TConnParams>): string;
|
|
169
737
|
/**
|
|
170
|
-
* Type alias for the `
|
|
171
|
-
*
|
|
172
|
-
*
|
|
738
|
+
* Type alias for the `agentOS(...)` return type. Events are not typed at the TS
|
|
739
|
+
* surface because the Rust plugin owns the broadcast set, but the ACTIONS are
|
|
740
|
+
* typed via {@link AgentOsActions} — generated from the Rust dispatch contract
|
|
741
|
+
* table in `crates/agentos-actor-plugin/src/actions/contract_surface.rs`.
|
|
742
|
+
* That is what gives `createClient<typeof registry>()` a fully-typed handle
|
|
743
|
+
* (e.g. `handle.exec()` returns `ExecResult`, not `unknown`).
|
|
173
744
|
*/
|
|
174
|
-
type AgentOsActorDefinition<TConnParams> = ActorDefinition<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, DatabaseProvider<RawAccess>, Record<never, never>, Record<never, never>,
|
|
175
|
-
declare function agentOs<TConnParams = undefined>(config: AgentOsActorConfigInput<TConnParams>): AgentOsActorDefinition<TConnParams>;
|
|
745
|
+
type AgentOsActorDefinition<TConnParams> = ActorDefinition<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, DatabaseProvider<RawAccess>, Record<never, never>, Record<never, never>, AgentOsActions>;
|
|
176
746
|
|
|
177
747
|
/**
|
|
178
748
|
* Resolve the absolute path to the agent-os actor plugin cdylib. RivetKit
|
|
@@ -180,7 +750,22 @@ declare function agentOs<TConnParams = undefined>(config: AgentOsActorConfigInpu
|
|
|
180
750
|
*/
|
|
181
751
|
declare function getPluginPath(): string;
|
|
182
752
|
|
|
183
|
-
|
|
184
|
-
|
|
753
|
+
/**
|
|
754
|
+
* `setup()` wrapper that defaults the registry transport message-size caps to
|
|
755
|
+
* never-hit-by-normal-use values for AgentOS apps, mirroring the per-actor crank
|
|
756
|
+
* in `DEFAULT_AGENTOS_ACTOR_OPTIONS`. Any caller-supplied value wins, so an app
|
|
757
|
+
* can still tighten the bound when it wants one.
|
|
758
|
+
*/
|
|
759
|
+
declare const setup: typeof setup$1;
|
|
760
|
+
|
|
761
|
+
type AgentOSActorConfigInput<TConnParams = undefined> = NativeAgentOsOptions & Omit<AgentOsActorConfigInput<TConnParams>, "options">;
|
|
762
|
+
type AgentOSConfigInput<TConnParams = undefined> = AgentOsOptions & {
|
|
763
|
+
preview?: AgentOsActorConfigInput<TConnParams>["preview"];
|
|
764
|
+
actorOptions?: AgentOsActorConfigInput<TConnParams>["actorOptions"];
|
|
765
|
+
onBeforeConnect?: AgentOsActorConfigInput<TConnParams>["onBeforeConnect"];
|
|
766
|
+
onSessionEvent?: (sessionId: string, event: JsonRpcNotification) => void | Promise<void>;
|
|
767
|
+
onPermissionRequest?: (sessionId: string, request: PermissionRequest) => void | Promise<void>;
|
|
768
|
+
};
|
|
769
|
+
declare function agentOS<TConnParams = undefined>(config?: AgentOSConfigInput<TConnParams>): AgentOsActorDefinition<TConnParams>;
|
|
185
770
|
|
|
186
|
-
export { type AgentOSActorConfigInput, type AgentOsActionContext, type AgentOsActorConfig, type AgentOsActorConfigInput, type AgentOsActorState, type AgentOsActorVars, type AgentOsEvents, type CronEventPayload, type NodeModulesMountConfig, type PermissionRequestPayload, type PersistedSessionEvent, type PersistedSessionRecord, type ProcessExitPayload, type ProcessOutputPayload, type PromptResult, type SerializableCronAction, type SerializableCronJobInfo, type SerializableCronJobOptions, type SessionEventPayload, type SessionRecord, type ShellDataPayload, type VmBootedPayload, type VmShutdownPayload, agentOS,
|
|
771
|
+
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 ScheduledCronJob, type SerializableCronAction, type SerializableCronEvent, type SerializableCronJobInfo, type SerializableCronJobOptions, type SessionEventPayload, type SessionRecord, type ShellDataPayload, type SignedPreviewUrl, type SpawnedProcess, type StreamErrorPayload, type VmBootedPayload, type VmFetchOptions, type VmFetchResponse, type VmShutdownPayload, agentOS, agentOsActorConfigSchema, buildConfigJson, getPluginPath, nativeAgentOsOptionsSchema, nodeModulesMount, setup };
|