@rivet-dev/agentos 0.0.0-nathan-secure-exec-pinned-deps.d327f14 → 0.0.0-nathan-agentos-package-resolution.4347e69
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/dist/index.d.ts +551 -13
- package/dist/index.js +79 -14
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
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
4
|
import { z } from 'zod/v4';
|
|
5
5
|
|
|
6
6
|
type AgentOsActorState = {};
|
|
@@ -104,8 +104,394 @@ interface SerializableCronJobInfo {
|
|
|
104
104
|
}
|
|
105
105
|
type AgentOsActionContext<TConnParams = undefined> = ActionContext<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, any>;
|
|
106
106
|
|
|
107
|
+
declare const nativeAgentOsOptionsSchema: z.ZodObject<{
|
|
108
|
+
software: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
109
|
+
defaultSoftware: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
+
loopbackExemptPorts: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
111
|
+
allowedNodeBuiltins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
112
|
+
rootFilesystem: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
type: z.ZodOptional<z.ZodLiteral<"overlay">>;
|
|
114
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
115
|
+
ephemeral: "ephemeral";
|
|
116
|
+
"read-only": "read-only";
|
|
117
|
+
}>>;
|
|
118
|
+
disableDefaultBaseLayer: z.ZodOptional<z.ZodBoolean>;
|
|
119
|
+
lowers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
120
|
+
kind: z.ZodLiteral<"bundled-base-filesystem">;
|
|
121
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
122
|
+
kind: z.ZodLiteral<"snapshot-export">;
|
|
123
|
+
source: z.ZodUnknown;
|
|
124
|
+
}, z.core.$strict>]>>>;
|
|
125
|
+
}, z.core.$strict>>;
|
|
126
|
+
mounts: z.ZodOptional<z.ZodArray<z.ZodType<NativeMountConfig, unknown, z.core.$ZodTypeInternals<NativeMountConfig, unknown>>>>;
|
|
127
|
+
moduleAccessCwd: z.ZodOptional<z.ZodString>;
|
|
128
|
+
additionalInstructions: z.ZodOptional<z.ZodString>;
|
|
129
|
+
permissions: z.ZodOptional<z.ZodObject<{
|
|
130
|
+
fs: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
131
|
+
allow: "allow";
|
|
132
|
+
deny: "deny";
|
|
133
|
+
}>, z.ZodObject<{
|
|
134
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
135
|
+
allow: "allow";
|
|
136
|
+
deny: "deny";
|
|
137
|
+
}>>;
|
|
138
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
139
|
+
mode: z.ZodEnum<{
|
|
140
|
+
allow: "allow";
|
|
141
|
+
deny: "deny";
|
|
142
|
+
}>;
|
|
143
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
144
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
145
|
+
}, z.core.$strict>>;
|
|
146
|
+
}, z.core.$strict>]>>;
|
|
147
|
+
network: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
148
|
+
allow: "allow";
|
|
149
|
+
deny: "deny";
|
|
150
|
+
}>, z.ZodObject<{
|
|
151
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
152
|
+
allow: "allow";
|
|
153
|
+
deny: "deny";
|
|
154
|
+
}>>;
|
|
155
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
156
|
+
mode: z.ZodEnum<{
|
|
157
|
+
allow: "allow";
|
|
158
|
+
deny: "deny";
|
|
159
|
+
}>;
|
|
160
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
161
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
162
|
+
}, z.core.$strict>>;
|
|
163
|
+
}, z.core.$strict>]>>;
|
|
164
|
+
childProcess: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
165
|
+
allow: "allow";
|
|
166
|
+
deny: "deny";
|
|
167
|
+
}>, z.ZodObject<{
|
|
168
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
169
|
+
allow: "allow";
|
|
170
|
+
deny: "deny";
|
|
171
|
+
}>>;
|
|
172
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
173
|
+
mode: z.ZodEnum<{
|
|
174
|
+
allow: "allow";
|
|
175
|
+
deny: "deny";
|
|
176
|
+
}>;
|
|
177
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
178
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
179
|
+
}, z.core.$strict>>;
|
|
180
|
+
}, z.core.$strict>]>>;
|
|
181
|
+
process: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
182
|
+
allow: "allow";
|
|
183
|
+
deny: "deny";
|
|
184
|
+
}>, z.ZodObject<{
|
|
185
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
186
|
+
allow: "allow";
|
|
187
|
+
deny: "deny";
|
|
188
|
+
}>>;
|
|
189
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
190
|
+
mode: z.ZodEnum<{
|
|
191
|
+
allow: "allow";
|
|
192
|
+
deny: "deny";
|
|
193
|
+
}>;
|
|
194
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
195
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
196
|
+
}, z.core.$strict>>;
|
|
197
|
+
}, z.core.$strict>]>>;
|
|
198
|
+
env: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
199
|
+
allow: "allow";
|
|
200
|
+
deny: "deny";
|
|
201
|
+
}>, z.ZodObject<{
|
|
202
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
203
|
+
allow: "allow";
|
|
204
|
+
deny: "deny";
|
|
205
|
+
}>>;
|
|
206
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
207
|
+
mode: z.ZodEnum<{
|
|
208
|
+
allow: "allow";
|
|
209
|
+
deny: "deny";
|
|
210
|
+
}>;
|
|
211
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
212
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
213
|
+
}, z.core.$strict>>;
|
|
214
|
+
}, z.core.$strict>]>>;
|
|
215
|
+
binding: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
216
|
+
allow: "allow";
|
|
217
|
+
deny: "deny";
|
|
218
|
+
}>, z.ZodObject<{
|
|
219
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
220
|
+
allow: "allow";
|
|
221
|
+
deny: "deny";
|
|
222
|
+
}>>;
|
|
223
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
224
|
+
mode: z.ZodEnum<{
|
|
225
|
+
allow: "allow";
|
|
226
|
+
deny: "deny";
|
|
227
|
+
}>;
|
|
228
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
229
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
230
|
+
}, z.core.$strict>>;
|
|
231
|
+
}, z.core.$strict>]>>;
|
|
232
|
+
}, z.core.$strict>>;
|
|
233
|
+
sidecar: z.ZodOptional<z.ZodObject<{
|
|
234
|
+
kind: z.ZodLiteral<"shared">;
|
|
235
|
+
pool: z.ZodOptional<z.ZodString>;
|
|
236
|
+
}, z.core.$strict>>;
|
|
237
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
238
|
+
resources: z.ZodOptional<z.ZodObject<{
|
|
239
|
+
cpuCount: z.ZodOptional<z.ZodNumber>;
|
|
240
|
+
maxProcesses: z.ZodOptional<z.ZodNumber>;
|
|
241
|
+
maxOpenFds: z.ZodOptional<z.ZodNumber>;
|
|
242
|
+
maxPipes: z.ZodOptional<z.ZodNumber>;
|
|
243
|
+
maxPtys: z.ZodOptional<z.ZodNumber>;
|
|
244
|
+
maxSockets: z.ZodOptional<z.ZodNumber>;
|
|
245
|
+
maxConnections: z.ZodOptional<z.ZodNumber>;
|
|
246
|
+
maxSocketBufferedBytes: z.ZodOptional<z.ZodNumber>;
|
|
247
|
+
maxSocketDatagramQueueLen: z.ZodOptional<z.ZodNumber>;
|
|
248
|
+
maxFilesystemBytes: z.ZodOptional<z.ZodNumber>;
|
|
249
|
+
maxInodeCount: z.ZodOptional<z.ZodNumber>;
|
|
250
|
+
maxBlockingReadMs: z.ZodOptional<z.ZodNumber>;
|
|
251
|
+
maxPreadBytes: z.ZodOptional<z.ZodNumber>;
|
|
252
|
+
maxFdWriteBytes: z.ZodOptional<z.ZodNumber>;
|
|
253
|
+
maxProcessArgvBytes: z.ZodOptional<z.ZodNumber>;
|
|
254
|
+
maxProcessEnvBytes: z.ZodOptional<z.ZodNumber>;
|
|
255
|
+
maxReaddirEntries: z.ZodOptional<z.ZodNumber>;
|
|
256
|
+
maxWasmFuel: z.ZodOptional<z.ZodNumber>;
|
|
257
|
+
maxWasmMemoryBytes: z.ZodOptional<z.ZodNumber>;
|
|
258
|
+
maxWasmStackBytes: z.ZodOptional<z.ZodNumber>;
|
|
259
|
+
}, z.core.$strict>>;
|
|
260
|
+
http: z.ZodOptional<z.ZodObject<{
|
|
261
|
+
maxFetchResponseBytes: z.ZodOptional<z.ZodNumber>;
|
|
262
|
+
}, z.core.$strict>>;
|
|
263
|
+
tools: z.ZodOptional<z.ZodObject<{
|
|
264
|
+
defaultToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
265
|
+
maxToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
266
|
+
maxRegisteredToolkits: z.ZodOptional<z.ZodNumber>;
|
|
267
|
+
maxRegisteredToolsPerVm: z.ZodOptional<z.ZodNumber>;
|
|
268
|
+
maxToolsPerToolkit: z.ZodOptional<z.ZodNumber>;
|
|
269
|
+
maxToolSchemaBytes: z.ZodOptional<z.ZodNumber>;
|
|
270
|
+
maxToolExamplesPerTool: z.ZodOptional<z.ZodNumber>;
|
|
271
|
+
maxToolExampleInputBytes: z.ZodOptional<z.ZodNumber>;
|
|
272
|
+
}, z.core.$strict>>;
|
|
273
|
+
plugins: z.ZodOptional<z.ZodObject<{
|
|
274
|
+
maxPersistedManifestBytes: z.ZodOptional<z.ZodNumber>;
|
|
275
|
+
maxPersistedManifestFileBytes: z.ZodOptional<z.ZodNumber>;
|
|
276
|
+
}, z.core.$strict>>;
|
|
277
|
+
acp: z.ZodOptional<z.ZodObject<{
|
|
278
|
+
maxReadLineBytes: z.ZodOptional<z.ZodNumber>;
|
|
279
|
+
stdoutBufferByteLimit: z.ZodOptional<z.ZodNumber>;
|
|
280
|
+
}, z.core.$strict>>;
|
|
281
|
+
jsRuntime: z.ZodOptional<z.ZodObject<{
|
|
282
|
+
v8HeapLimitMb: z.ZodOptional<z.ZodNumber>;
|
|
283
|
+
capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
284
|
+
stdinBufferLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
285
|
+
eventPayloadLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
286
|
+
v8IpcMaxFrameBytes: z.ZodOptional<z.ZodNumber>;
|
|
287
|
+
}, z.core.$strict>>;
|
|
288
|
+
python: z.ZodOptional<z.ZodObject<{
|
|
289
|
+
outputBufferMaxBytes: z.ZodOptional<z.ZodNumber>;
|
|
290
|
+
executionTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
291
|
+
vfsRpcTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
292
|
+
}, z.core.$strict>>;
|
|
293
|
+
wasm: z.ZodOptional<z.ZodObject<{
|
|
294
|
+
maxModuleFileBytes: z.ZodOptional<z.ZodNumber>;
|
|
295
|
+
capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
296
|
+
syncReadLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
297
|
+
}, z.core.$strict>>;
|
|
298
|
+
}, z.core.$strict>>;
|
|
299
|
+
}, z.core.$strict>;
|
|
107
300
|
declare const agentOsActorConfigSchema: z.ZodObject<{
|
|
108
|
-
options: z.ZodOptional<z.
|
|
301
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
302
|
+
software: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
303
|
+
defaultSoftware: z.ZodOptional<z.ZodBoolean>;
|
|
304
|
+
loopbackExemptPorts: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
305
|
+
allowedNodeBuiltins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
306
|
+
rootFilesystem: z.ZodOptional<z.ZodObject<{
|
|
307
|
+
type: z.ZodOptional<z.ZodLiteral<"overlay">>;
|
|
308
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
309
|
+
ephemeral: "ephemeral";
|
|
310
|
+
"read-only": "read-only";
|
|
311
|
+
}>>;
|
|
312
|
+
disableDefaultBaseLayer: z.ZodOptional<z.ZodBoolean>;
|
|
313
|
+
lowers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
314
|
+
kind: z.ZodLiteral<"bundled-base-filesystem">;
|
|
315
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
316
|
+
kind: z.ZodLiteral<"snapshot-export">;
|
|
317
|
+
source: z.ZodUnknown;
|
|
318
|
+
}, z.core.$strict>]>>>;
|
|
319
|
+
}, z.core.$strict>>;
|
|
320
|
+
mounts: z.ZodOptional<z.ZodArray<z.ZodType<NativeMountConfig, unknown, z.core.$ZodTypeInternals<NativeMountConfig, unknown>>>>;
|
|
321
|
+
moduleAccessCwd: z.ZodOptional<z.ZodString>;
|
|
322
|
+
additionalInstructions: z.ZodOptional<z.ZodString>;
|
|
323
|
+
permissions: z.ZodOptional<z.ZodObject<{
|
|
324
|
+
fs: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
325
|
+
allow: "allow";
|
|
326
|
+
deny: "deny";
|
|
327
|
+
}>, z.ZodObject<{
|
|
328
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
329
|
+
allow: "allow";
|
|
330
|
+
deny: "deny";
|
|
331
|
+
}>>;
|
|
332
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
333
|
+
mode: z.ZodEnum<{
|
|
334
|
+
allow: "allow";
|
|
335
|
+
deny: "deny";
|
|
336
|
+
}>;
|
|
337
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
338
|
+
paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
339
|
+
}, z.core.$strict>>;
|
|
340
|
+
}, z.core.$strict>]>>;
|
|
341
|
+
network: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
342
|
+
allow: "allow";
|
|
343
|
+
deny: "deny";
|
|
344
|
+
}>, z.ZodObject<{
|
|
345
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
346
|
+
allow: "allow";
|
|
347
|
+
deny: "deny";
|
|
348
|
+
}>>;
|
|
349
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
350
|
+
mode: z.ZodEnum<{
|
|
351
|
+
allow: "allow";
|
|
352
|
+
deny: "deny";
|
|
353
|
+
}>;
|
|
354
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
355
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
356
|
+
}, z.core.$strict>>;
|
|
357
|
+
}, z.core.$strict>]>>;
|
|
358
|
+
childProcess: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
359
|
+
allow: "allow";
|
|
360
|
+
deny: "deny";
|
|
361
|
+
}>, z.ZodObject<{
|
|
362
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
363
|
+
allow: "allow";
|
|
364
|
+
deny: "deny";
|
|
365
|
+
}>>;
|
|
366
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
367
|
+
mode: z.ZodEnum<{
|
|
368
|
+
allow: "allow";
|
|
369
|
+
deny: "deny";
|
|
370
|
+
}>;
|
|
371
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
372
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
373
|
+
}, z.core.$strict>>;
|
|
374
|
+
}, z.core.$strict>]>>;
|
|
375
|
+
process: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
376
|
+
allow: "allow";
|
|
377
|
+
deny: "deny";
|
|
378
|
+
}>, z.ZodObject<{
|
|
379
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
380
|
+
allow: "allow";
|
|
381
|
+
deny: "deny";
|
|
382
|
+
}>>;
|
|
383
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
384
|
+
mode: z.ZodEnum<{
|
|
385
|
+
allow: "allow";
|
|
386
|
+
deny: "deny";
|
|
387
|
+
}>;
|
|
388
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
389
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
390
|
+
}, z.core.$strict>>;
|
|
391
|
+
}, z.core.$strict>]>>;
|
|
392
|
+
env: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
393
|
+
allow: "allow";
|
|
394
|
+
deny: "deny";
|
|
395
|
+
}>, z.ZodObject<{
|
|
396
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
397
|
+
allow: "allow";
|
|
398
|
+
deny: "deny";
|
|
399
|
+
}>>;
|
|
400
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
401
|
+
mode: z.ZodEnum<{
|
|
402
|
+
allow: "allow";
|
|
403
|
+
deny: "deny";
|
|
404
|
+
}>;
|
|
405
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
406
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
407
|
+
}, z.core.$strict>>;
|
|
408
|
+
}, z.core.$strict>]>>;
|
|
409
|
+
binding: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
410
|
+
allow: "allow";
|
|
411
|
+
deny: "deny";
|
|
412
|
+
}>, z.ZodObject<{
|
|
413
|
+
default: z.ZodOptional<z.ZodEnum<{
|
|
414
|
+
allow: "allow";
|
|
415
|
+
deny: "deny";
|
|
416
|
+
}>>;
|
|
417
|
+
rules: z.ZodArray<z.ZodObject<{
|
|
418
|
+
mode: z.ZodEnum<{
|
|
419
|
+
allow: "allow";
|
|
420
|
+
deny: "deny";
|
|
421
|
+
}>;
|
|
422
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
423
|
+
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
424
|
+
}, z.core.$strict>>;
|
|
425
|
+
}, z.core.$strict>]>>;
|
|
426
|
+
}, z.core.$strict>>;
|
|
427
|
+
sidecar: z.ZodOptional<z.ZodObject<{
|
|
428
|
+
kind: z.ZodLiteral<"shared">;
|
|
429
|
+
pool: z.ZodOptional<z.ZodString>;
|
|
430
|
+
}, z.core.$strict>>;
|
|
431
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
432
|
+
resources: z.ZodOptional<z.ZodObject<{
|
|
433
|
+
cpuCount: z.ZodOptional<z.ZodNumber>;
|
|
434
|
+
maxProcesses: z.ZodOptional<z.ZodNumber>;
|
|
435
|
+
maxOpenFds: z.ZodOptional<z.ZodNumber>;
|
|
436
|
+
maxPipes: z.ZodOptional<z.ZodNumber>;
|
|
437
|
+
maxPtys: z.ZodOptional<z.ZodNumber>;
|
|
438
|
+
maxSockets: z.ZodOptional<z.ZodNumber>;
|
|
439
|
+
maxConnections: z.ZodOptional<z.ZodNumber>;
|
|
440
|
+
maxSocketBufferedBytes: z.ZodOptional<z.ZodNumber>;
|
|
441
|
+
maxSocketDatagramQueueLen: z.ZodOptional<z.ZodNumber>;
|
|
442
|
+
maxFilesystemBytes: z.ZodOptional<z.ZodNumber>;
|
|
443
|
+
maxInodeCount: z.ZodOptional<z.ZodNumber>;
|
|
444
|
+
maxBlockingReadMs: z.ZodOptional<z.ZodNumber>;
|
|
445
|
+
maxPreadBytes: z.ZodOptional<z.ZodNumber>;
|
|
446
|
+
maxFdWriteBytes: z.ZodOptional<z.ZodNumber>;
|
|
447
|
+
maxProcessArgvBytes: z.ZodOptional<z.ZodNumber>;
|
|
448
|
+
maxProcessEnvBytes: z.ZodOptional<z.ZodNumber>;
|
|
449
|
+
maxReaddirEntries: z.ZodOptional<z.ZodNumber>;
|
|
450
|
+
maxWasmFuel: z.ZodOptional<z.ZodNumber>;
|
|
451
|
+
maxWasmMemoryBytes: z.ZodOptional<z.ZodNumber>;
|
|
452
|
+
maxWasmStackBytes: z.ZodOptional<z.ZodNumber>;
|
|
453
|
+
}, z.core.$strict>>;
|
|
454
|
+
http: z.ZodOptional<z.ZodObject<{
|
|
455
|
+
maxFetchResponseBytes: z.ZodOptional<z.ZodNumber>;
|
|
456
|
+
}, z.core.$strict>>;
|
|
457
|
+
tools: z.ZodOptional<z.ZodObject<{
|
|
458
|
+
defaultToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
459
|
+
maxToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
460
|
+
maxRegisteredToolkits: z.ZodOptional<z.ZodNumber>;
|
|
461
|
+
maxRegisteredToolsPerVm: z.ZodOptional<z.ZodNumber>;
|
|
462
|
+
maxToolsPerToolkit: z.ZodOptional<z.ZodNumber>;
|
|
463
|
+
maxToolSchemaBytes: z.ZodOptional<z.ZodNumber>;
|
|
464
|
+
maxToolExamplesPerTool: z.ZodOptional<z.ZodNumber>;
|
|
465
|
+
maxToolExampleInputBytes: z.ZodOptional<z.ZodNumber>;
|
|
466
|
+
}, z.core.$strict>>;
|
|
467
|
+
plugins: z.ZodOptional<z.ZodObject<{
|
|
468
|
+
maxPersistedManifestBytes: z.ZodOptional<z.ZodNumber>;
|
|
469
|
+
maxPersistedManifestFileBytes: z.ZodOptional<z.ZodNumber>;
|
|
470
|
+
}, z.core.$strict>>;
|
|
471
|
+
acp: z.ZodOptional<z.ZodObject<{
|
|
472
|
+
maxReadLineBytes: z.ZodOptional<z.ZodNumber>;
|
|
473
|
+
stdoutBufferByteLimit: z.ZodOptional<z.ZodNumber>;
|
|
474
|
+
}, z.core.$strict>>;
|
|
475
|
+
jsRuntime: z.ZodOptional<z.ZodObject<{
|
|
476
|
+
v8HeapLimitMb: z.ZodOptional<z.ZodNumber>;
|
|
477
|
+
capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
478
|
+
stdinBufferLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
479
|
+
eventPayloadLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
480
|
+
v8IpcMaxFrameBytes: z.ZodOptional<z.ZodNumber>;
|
|
481
|
+
}, z.core.$strict>>;
|
|
482
|
+
python: z.ZodOptional<z.ZodObject<{
|
|
483
|
+
outputBufferMaxBytes: z.ZodOptional<z.ZodNumber>;
|
|
484
|
+
executionTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
485
|
+
vfsRpcTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
486
|
+
}, z.core.$strict>>;
|
|
487
|
+
wasm: z.ZodOptional<z.ZodObject<{
|
|
488
|
+
maxModuleFileBytes: z.ZodOptional<z.ZodNumber>;
|
|
489
|
+
capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
490
|
+
syncReadLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
491
|
+
}, z.core.$strict>>;
|
|
492
|
+
}, z.core.$strict>>;
|
|
493
|
+
}, z.core.$strict>>;
|
|
494
|
+
actorOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
109
495
|
preview: z.ZodPrefault<z.ZodObject<{
|
|
110
496
|
defaultExpiresInSeconds: z.ZodDefault<z.ZodNumber>;
|
|
111
497
|
maxExpiresInSeconds: z.ZodDefault<z.ZodNumber>;
|
|
@@ -114,14 +500,149 @@ declare const agentOsActorConfigSchema: z.ZodObject<{
|
|
|
114
500
|
onSessionEvent: z.ZodOptional<z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>>;
|
|
115
501
|
onPermissionRequest: z.ZodOptional<z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>>;
|
|
116
502
|
}, z.core.$strict>;
|
|
503
|
+
/**
|
|
504
|
+
* Type mirror of `nativeAgentOsOptionsSchema`.
|
|
505
|
+
*
|
|
506
|
+
* Keep this in sync with the schema above and the Rust serde mirror at
|
|
507
|
+
* `crates/agentos-actor-plugin/src/config.rs::AgentOsConfigJson`.
|
|
508
|
+
*/
|
|
509
|
+
type NativeAgentOsOptions = Pick<AgentOsOptions, "software" | "defaultSoftware" | "loopbackExemptPorts" | "allowedNodeBuiltins" | "rootFilesystem" | "moduleAccessCwd" | "additionalInstructions" | "permissions" | "limits"> & {
|
|
510
|
+
mounts?: NativeMountConfig[];
|
|
511
|
+
sidecar?: {
|
|
512
|
+
kind: "shared";
|
|
513
|
+
pool?: string;
|
|
514
|
+
};
|
|
515
|
+
};
|
|
117
516
|
type AgentOsActorContext<TConnParams> = ActorContext<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, any>;
|
|
118
517
|
interface AgentOsActorConfigCallbacks<TConnParams> {
|
|
119
518
|
onBeforeConnect?: (c: BeforeConnectContext<AgentOsActorState, AgentOsActorVars, undefined, any>, params: TConnParams) => void | Promise<void>;
|
|
120
519
|
onSessionEvent?: (c: AgentOsActorContext<TConnParams>, sessionId: string, event: JsonRpcNotification) => void | Promise<void>;
|
|
121
520
|
onPermissionRequest?: (c: AgentOsActorContext<TConnParams>, sessionId: string, request: PermissionRequest) => void | Promise<void>;
|
|
122
521
|
}
|
|
123
|
-
type AgentOsActorConfig<TConnParams = undefined> = Omit<z.infer<typeof agentOsActorConfigSchema>, "onBeforeConnect" | "onSessionEvent" | "onPermissionRequest"> &
|
|
124
|
-
|
|
522
|
+
type AgentOsActorConfig<TConnParams = undefined> = Omit<z.infer<typeof agentOsActorConfigSchema>, "options" | "onBeforeConnect" | "onSessionEvent" | "onPermissionRequest"> & {
|
|
523
|
+
options?: NativeAgentOsOptions;
|
|
524
|
+
} & AgentOsActorConfigCallbacks<TConnParams>;
|
|
525
|
+
type AgentOsActorConfigInput<TConnParams = undefined> = Omit<z.input<typeof agentOsActorConfigSchema>, "options" | "onBeforeConnect" | "onSessionEvent" | "onPermissionRequest"> & {
|
|
526
|
+
options?: NativeAgentOsOptions;
|
|
527
|
+
} & AgentOsActorConfigCallbacks<TConnParams>;
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Typed action surface for the agentOS VM actor.
|
|
531
|
+
*
|
|
532
|
+
* ⚠️ SOURCE OF TRUTH / KEEP IN SYNC ⚠️
|
|
533
|
+
* The actual dispatch is implemented in Rust at
|
|
534
|
+
* crates/agentos-actor-plugin/src/actions/mod.rs (fn `dispatch`)
|
|
535
|
+
* This interface MUST mirror that match statement one-to-one: every `"name" =>`
|
|
536
|
+
* arm there needs a corresponding method here with matching positional args and
|
|
537
|
+
* the serialized return type. When you add/rename/retype an action in
|
|
538
|
+
* `mod.rs`, update this interface in the same change (and vice-versa).
|
|
539
|
+
*
|
|
540
|
+
* RivetKit turns each `(ctx, ...args) => Promise<R>` entry into a client handle
|
|
541
|
+
* method `(...args) => Promise<R>` (it strips the leading context arg). Wiring
|
|
542
|
+
* this as the actions type param of `AgentOsActorDefinition` is what makes
|
|
543
|
+
* `createClient<typeof registry>()` return a fully-typed handle instead of the
|
|
544
|
+
* old `any`/`unknown` surface.
|
|
545
|
+
*/
|
|
546
|
+
|
|
547
|
+
/** The leading actor context arg; stripped from the client-facing method. */
|
|
548
|
+
type Ctx = any;
|
|
549
|
+
/** Directory entry returned by `readdir` / `readdirRecursive`. */
|
|
550
|
+
interface DirEntry {
|
|
551
|
+
path: string;
|
|
552
|
+
name: string;
|
|
553
|
+
type: "file" | "directory" | "symlink";
|
|
554
|
+
}
|
|
555
|
+
/** A process started via `spawn` (mirrors the Rust spawn handle DTO). */
|
|
556
|
+
interface SpawnedProcess {
|
|
557
|
+
pid: number;
|
|
558
|
+
}
|
|
559
|
+
/** Handle returned by `scheduleCron` (mirrors `ScheduledCronDto`). */
|
|
560
|
+
interface ScheduledCronJob {
|
|
561
|
+
id: string;
|
|
562
|
+
}
|
|
563
|
+
/** Options accepted by `vmFetch` (mirrors the Rust `FetchOptions`). */
|
|
564
|
+
interface VmFetchOptions {
|
|
565
|
+
method?: string;
|
|
566
|
+
headers?: Record<string, string>;
|
|
567
|
+
body?: string | Uint8Array;
|
|
568
|
+
}
|
|
569
|
+
/** Response from `vmFetch` (mirrors `FetchResponseDto`). */
|
|
570
|
+
interface VmFetchResponse {
|
|
571
|
+
status: number;
|
|
572
|
+
statusText: string;
|
|
573
|
+
headers: Record<string, string>;
|
|
574
|
+
body: Uint8Array;
|
|
575
|
+
}
|
|
576
|
+
/** Options accepted by `createSession` (mirrors `CreateSessionOptionsDto`). */
|
|
577
|
+
interface CreateSessionOptions {
|
|
578
|
+
cwd?: string;
|
|
579
|
+
env?: Record<string, string>;
|
|
580
|
+
skipOsInstructions?: boolean;
|
|
581
|
+
additionalInstructions?: string;
|
|
582
|
+
}
|
|
583
|
+
/** Result of `createSignedPreviewUrl` (mirrors `SignedPreviewUrlDto`). */
|
|
584
|
+
interface SignedPreviewUrl {
|
|
585
|
+
url: string;
|
|
586
|
+
token: string;
|
|
587
|
+
expiresAt: number;
|
|
588
|
+
}
|
|
589
|
+
/** Per-entry result of the batch `writeFiles` / `readFiles` actions. */
|
|
590
|
+
interface WriteFileResult {
|
|
591
|
+
path: string;
|
|
592
|
+
ok: boolean;
|
|
593
|
+
error?: string;
|
|
594
|
+
}
|
|
595
|
+
interface ReadFileResult {
|
|
596
|
+
path: string;
|
|
597
|
+
content?: Uint8Array;
|
|
598
|
+
error?: string;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* The agentOS VM actor's action map. Keep one method per Rust `dispatch` arm.
|
|
602
|
+
*
|
|
603
|
+
* Declared as a `type` (not `interface`) so it satisfies RivetKit's
|
|
604
|
+
* `Actions<…>` constraint, which expects an implicit string index signature.
|
|
605
|
+
*/
|
|
606
|
+
type AgentOsActions = {
|
|
607
|
+
readFile: (c: Ctx, path: string) => Promise<Uint8Array>;
|
|
608
|
+
writeFile: (c: Ctx, path: string, content: string | Uint8Array) => Promise<void>;
|
|
609
|
+
stat: (c: Ctx, path: string) => Promise<VirtualStat>;
|
|
610
|
+
mkdir: (c: Ctx, path: string) => Promise<void>;
|
|
611
|
+
readdir: (c: Ctx, path: string) => Promise<DirEntry[]>;
|
|
612
|
+
exists: (c: Ctx, path: string) => Promise<boolean>;
|
|
613
|
+
move: (c: Ctx, from: string, to: string) => Promise<void>;
|
|
614
|
+
deleteFile: (c: Ctx, path: string, options?: {
|
|
615
|
+
recursive?: boolean;
|
|
616
|
+
}) => Promise<void>;
|
|
617
|
+
writeFiles: (c: Ctx, entries: {
|
|
618
|
+
path: string;
|
|
619
|
+
content: string | Uint8Array;
|
|
620
|
+
}[]) => Promise<WriteFileResult[]>;
|
|
621
|
+
readFiles: (c: Ctx, paths: string[]) => Promise<ReadFileResult[]>;
|
|
622
|
+
readdirRecursive: (c: Ctx, path: string) => Promise<DirEntry[]>;
|
|
623
|
+
exec: (c: Ctx, command: string) => Promise<ExecResult>;
|
|
624
|
+
spawn: (c: Ctx, command: string, args: string[]) => Promise<SpawnedProcess>;
|
|
625
|
+
waitProcess: (c: Ctx, pid: number) => Promise<number>;
|
|
626
|
+
killProcess: (c: Ctx, pid: number) => Promise<void>;
|
|
627
|
+
stopProcess: (c: Ctx, pid: number) => Promise<void>;
|
|
628
|
+
listProcesses: (c: Ctx) => Promise<ProcessInfo[]>;
|
|
629
|
+
allProcesses: (c: Ctx) => Promise<ProcessInfo[]>;
|
|
630
|
+
processTree: (c: Ctx) => Promise<ProcessInfo[]>;
|
|
631
|
+
getProcess: (c: Ctx, pid: number) => Promise<ProcessInfo>;
|
|
632
|
+
writeProcessStdin: (c: Ctx, pid: number, data: string | Uint8Array) => Promise<void>;
|
|
633
|
+
closeProcessStdin: (c: Ctx, pid: number) => Promise<void>;
|
|
634
|
+
vmFetch: (c: Ctx, port: number, url: string, options?: VmFetchOptions) => Promise<VmFetchResponse>;
|
|
635
|
+
scheduleCron: (c: Ctx, options: SerializableCronJobOptions) => Promise<ScheduledCronJob>;
|
|
636
|
+
listCronJobs: (c: Ctx) => Promise<SerializableCronJobInfo[]>;
|
|
637
|
+
cancelCronJob: (c: Ctx, id: string) => Promise<void>;
|
|
638
|
+
createSession: (c: Ctx, agentType: string, options?: CreateSessionOptions) => Promise<string>;
|
|
639
|
+
sendPrompt: (c: Ctx, sessionId: string, text: string) => Promise<PromptResult>;
|
|
640
|
+
closeSession: (c: Ctx, sessionId: string) => Promise<void>;
|
|
641
|
+
listPersistedSessions: (c: Ctx) => Promise<PersistedSessionRecord[]>;
|
|
642
|
+
getSessionEvents: (c: Ctx, sessionId: string) => Promise<PersistedSessionEvent[]>;
|
|
643
|
+
createSignedPreviewUrl: (c: Ctx, port: number, ttlSeconds: number) => Promise<SignedPreviewUrl>;
|
|
644
|
+
expireSignedPreviewUrl: (c: Ctx, token: string) => Promise<void>;
|
|
645
|
+
};
|
|
125
646
|
|
|
126
647
|
/**
|
|
127
648
|
* Rust-backed `agentOs(...)` definition.
|
|
@@ -167,11 +688,14 @@ declare function nodeModulesMount(hostNodeModulesDir: string, opts?: {
|
|
|
167
688
|
}): NodeModulesMountConfig;
|
|
168
689
|
declare function buildConfigJson<TConnParams>(parsed: AgentOsActorConfig<TConnParams>): string;
|
|
169
690
|
/**
|
|
170
|
-
* Type alias for the `agentOs(...)` return type. Events are not typed at the
|
|
171
|
-
*
|
|
172
|
-
*
|
|
691
|
+
* Type alias for the `agentOs(...)` return type. Events are not typed at the TS
|
|
692
|
+
* surface because the Rust plugin owns the broadcast set, but the ACTIONS are
|
|
693
|
+
* typed via {@link AgentOsActions} — a TS mirror of the Rust dispatch in
|
|
694
|
+
* `crates/agentos-actor-plugin/src/actions/mod.rs`. That is what gives
|
|
695
|
+
* `createClient<typeof registry>()` a fully-typed handle (e.g. `handle.exec()`
|
|
696
|
+
* returns `ExecResult`, not `unknown`). Keep the two in sync.
|
|
173
697
|
*/
|
|
174
|
-
type AgentOsActorDefinition<TConnParams> = ActorDefinition<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, DatabaseProvider<RawAccess>, Record<never, never>, Record<never, never>,
|
|
698
|
+
type AgentOsActorDefinition<TConnParams> = ActorDefinition<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, DatabaseProvider<RawAccess>, Record<never, never>, Record<never, never>, AgentOsActions>;
|
|
175
699
|
declare function agentOs<TConnParams = undefined>(config: AgentOsActorConfigInput<TConnParams>): AgentOsActorDefinition<TConnParams>;
|
|
176
700
|
|
|
177
701
|
/**
|
|
@@ -180,7 +704,21 @@ declare function agentOs<TConnParams = undefined>(config: AgentOsActorConfigInpu
|
|
|
180
704
|
*/
|
|
181
705
|
declare function getPluginPath(): string;
|
|
182
706
|
|
|
183
|
-
|
|
184
|
-
|
|
707
|
+
/**
|
|
708
|
+
* `setup()` wrapper that defaults the registry transport message-size caps to
|
|
709
|
+
* never-hit-by-normal-use values for AgentOS apps, mirroring the per-actor crank
|
|
710
|
+
* in `DEFAULT_AGENTOS_ACTOR_OPTIONS`. Any caller-supplied value wins, so an app
|
|
711
|
+
* can still tighten the bound when it wants one.
|
|
712
|
+
*/
|
|
713
|
+
declare const setup: typeof setup$1;
|
|
714
|
+
|
|
715
|
+
type AgentOSActorConfigInput<TConnParams = undefined> = NativeAgentOsOptions & Omit<AgentOsActorConfigInput<TConnParams>, "options">;
|
|
716
|
+
type AgentOSConfigInput<TConnParams = undefined> = AgentOsOptions & {
|
|
717
|
+
preview?: AgentOsActorConfigInput<TConnParams>["preview"];
|
|
718
|
+
onBeforeConnect?: AgentOsActorConfigInput<TConnParams>["onBeforeConnect"];
|
|
719
|
+
onSessionEvent?: (sessionId: string, event: JsonRpcNotification) => void | Promise<void>;
|
|
720
|
+
onPermissionRequest?: (sessionId: string, request: PermissionRequest) => void | Promise<void>;
|
|
721
|
+
};
|
|
722
|
+
declare function agentOS<TConnParams = undefined>(config?: AgentOSConfigInput<TConnParams>): AgentOsActorDefinition<TConnParams>;
|
|
185
723
|
|
|
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, agentOs, agentOsActorConfigSchema, buildConfigJson, getPluginPath, nodeModulesMount };
|
|
724
|
+
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, agentOs, agentOsActorConfigSchema, buildConfigJson, getPluginPath, nativeAgentOsOptionsSchema, nodeModulesMount, setup };
|
package/dist/index.js
CHANGED
|
@@ -7,13 +7,30 @@ import {
|
|
|
7
7
|
} from "rivetkit";
|
|
8
8
|
|
|
9
9
|
// src/config.ts
|
|
10
|
+
import {
|
|
11
|
+
agentOsOptionFieldSchemas,
|
|
12
|
+
nativeMountConfigSchema,
|
|
13
|
+
sharedSidecarConfigSchema
|
|
14
|
+
} from "@rivet-dev/agentos-core";
|
|
10
15
|
import { z } from "zod/v4";
|
|
11
16
|
var zFunction = () => z.custom((val) => typeof val === "function");
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
var nativeAgentOsOptionsSchema = z.object({
|
|
18
|
+
software: agentOsOptionFieldSchemas.software,
|
|
19
|
+
defaultSoftware: agentOsOptionFieldSchemas.defaultSoftware,
|
|
20
|
+
loopbackExemptPorts: agentOsOptionFieldSchemas.loopbackExemptPorts,
|
|
21
|
+
allowedNodeBuiltins: agentOsOptionFieldSchemas.allowedNodeBuiltins,
|
|
22
|
+
rootFilesystem: agentOsOptionFieldSchemas.rootFilesystem,
|
|
23
|
+
mounts: z.array(nativeMountConfigSchema).optional(),
|
|
24
|
+
moduleAccessCwd: agentOsOptionFieldSchemas.moduleAccessCwd,
|
|
25
|
+
additionalInstructions: agentOsOptionFieldSchemas.additionalInstructions,
|
|
26
|
+
permissions: agentOsOptionFieldSchemas.permissions,
|
|
27
|
+
sidecar: sharedSidecarConfigSchema.optional(),
|
|
28
|
+
limits: agentOsOptionFieldSchemas.limits
|
|
29
|
+
}).strict();
|
|
30
|
+
var agentOsActorOptionsSchema = z.record(z.string(), z.unknown()).optional();
|
|
15
31
|
var agentOsActorConfigSchema = z.object({
|
|
16
|
-
options:
|
|
32
|
+
options: nativeAgentOsOptionsSchema.optional(),
|
|
33
|
+
actorOptions: agentOsActorOptionsSchema,
|
|
17
34
|
preview: z.object({
|
|
18
35
|
defaultExpiresInSeconds: z.number().positive().default(3600),
|
|
19
36
|
maxExpiresInSeconds: z.number().positive().default(86400)
|
|
@@ -155,12 +172,12 @@ function flattenSoftware(input, out) {
|
|
|
155
172
|
if (typeof input === "object") out.push(input);
|
|
156
173
|
}
|
|
157
174
|
function buildConfigJson(parsed) {
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
parsed.options?.software,
|
|
161
|
-
descriptors
|
|
175
|
+
const options = nativeAgentOsOptionsSchema.parse(
|
|
176
|
+
parsed.options ?? {}
|
|
162
177
|
);
|
|
163
|
-
const
|
|
178
|
+
const descriptors = [];
|
|
179
|
+
flattenSoftware(options.software, descriptors);
|
|
180
|
+
const defaultSoftwareEnabled = options.defaultSoftware !== false;
|
|
164
181
|
if (defaultSoftwareEnabled) {
|
|
165
182
|
const defaults = [];
|
|
166
183
|
flattenSoftware(common, defaults);
|
|
@@ -179,7 +196,6 @@ function buildConfigJson(parsed) {
|
|
|
179
196
|
});
|
|
180
197
|
}
|
|
181
198
|
}
|
|
182
|
-
const options = parsed.options ?? {};
|
|
183
199
|
const mounts = withAutoAgentNodeModulesMount(
|
|
184
200
|
serializeNativeMounts(options.mounts),
|
|
185
201
|
descriptors
|
|
@@ -188,6 +204,7 @@ function buildConfigJson(parsed) {
|
|
|
188
204
|
return JSON.stringify({
|
|
189
205
|
software,
|
|
190
206
|
additionalInstructions: options.additionalInstructions,
|
|
207
|
+
moduleAccessCwd: options.moduleAccessCwd,
|
|
191
208
|
loopbackExemptPorts: options.loopbackExemptPorts,
|
|
192
209
|
allowedNodeBuiltins: options.allowedNodeBuiltins,
|
|
193
210
|
permissions: options.permissions,
|
|
@@ -275,24 +292,70 @@ function buildNativeFactoryBuilder(parsed) {
|
|
|
275
292
|
return runtime.createNativePluginFactory(options);
|
|
276
293
|
};
|
|
277
294
|
}
|
|
295
|
+
var ACTOR_NEVER_HIT_MS = 60 * 60 * 1e3;
|
|
296
|
+
var ACTOR_NEVER_HIT_MESSAGE_BYTES = 512 * 1024 * 1024;
|
|
297
|
+
var DEFAULT_AGENTOS_ACTOR_OPTIONS = {
|
|
298
|
+
// Connection/setup lifecycle (stock 5s each) — the websocket setup path that
|
|
299
|
+
// was timing out at 5000ms and dropping all streamed events.
|
|
300
|
+
onBeforeConnectTimeout: ACTOR_NEVER_HIT_MS,
|
|
301
|
+
onConnectTimeout: ACTOR_NEVER_HIT_MS,
|
|
302
|
+
createVarsTimeout: ACTOR_NEVER_HIT_MS,
|
|
303
|
+
createConnStateTimeout: ACTOR_NEVER_HIT_MS,
|
|
304
|
+
onMigrateTimeout: ACTOR_NEVER_HIT_MS,
|
|
305
|
+
// Action/RPC lifecycle (stock 60s) — long multi-step prompt turns.
|
|
306
|
+
actionTimeout: ACTOR_NEVER_HIT_MS,
|
|
307
|
+
// Idle/keepalive — don't reap a live session or sleep mid-turn (stock
|
|
308
|
+
// connectionLivenessTimeout 2.5s, sleepTimeout 30s). The liveness *interval*
|
|
309
|
+
// (ping cadence) is intentionally left at its small default.
|
|
310
|
+
connectionLivenessTimeout: ACTOR_NEVER_HIT_MS,
|
|
311
|
+
sleepTimeout: ACTOR_NEVER_HIT_MS,
|
|
312
|
+
// Payload sizes — large prompts/results. `maxQueueMessageSize` is the
|
|
313
|
+
// per-actor message cap (stock 64 KiB); the transport-level
|
|
314
|
+
// max{Incoming,Outgoing}MessageSize live on the registry/setup config (see
|
|
315
|
+
// AGENTOS_REGISTRY_MESSAGE_SIZE_DEFAULTS), not on per-actor options.
|
|
316
|
+
maxQueueSize: 1e6,
|
|
317
|
+
maxQueueMessageSize: ACTOR_NEVER_HIT_MESSAGE_BYTES
|
|
318
|
+
};
|
|
278
319
|
function agentOs(config) {
|
|
279
320
|
const parsed = agentOsActorConfigSchema.parse(
|
|
280
321
|
config
|
|
281
322
|
);
|
|
282
|
-
const
|
|
323
|
+
const userActorOptions = parsed.actorOptions;
|
|
324
|
+
const actorOptions = {
|
|
325
|
+
...DEFAULT_AGENTOS_ACTOR_OPTIONS,
|
|
326
|
+
...userActorOptions ?? {}
|
|
327
|
+
};
|
|
283
328
|
const definition = actor({
|
|
284
329
|
actions: {},
|
|
285
|
-
|
|
330
|
+
options: actorOptions
|
|
286
331
|
});
|
|
287
332
|
definition.nativeFactoryBuilder = buildNativeFactoryBuilder(parsed);
|
|
288
333
|
return definition;
|
|
289
334
|
}
|
|
290
335
|
|
|
291
336
|
// src/index.ts
|
|
292
|
-
import { setup } from "rivetkit";
|
|
337
|
+
import { setup as rivetkitSetup } from "rivetkit";
|
|
338
|
+
import { defineSoftware } from "@rivet-dev/agentos-core";
|
|
339
|
+
var AGENTOS_REGISTRY_MESSAGE_SIZE_DEFAULT = 512 * 1024 * 1024;
|
|
340
|
+
var setup = ((input) => rivetkitSetup({
|
|
341
|
+
maxIncomingMessageSize: AGENTOS_REGISTRY_MESSAGE_SIZE_DEFAULT,
|
|
342
|
+
maxOutgoingMessageSize: AGENTOS_REGISTRY_MESSAGE_SIZE_DEFAULT,
|
|
343
|
+
...input
|
|
344
|
+
}));
|
|
293
345
|
function agentOS(config = {}) {
|
|
346
|
+
const {
|
|
347
|
+
preview,
|
|
348
|
+
onBeforeConnect,
|
|
349
|
+
onSessionEvent,
|
|
350
|
+
onPermissionRequest,
|
|
351
|
+
...options
|
|
352
|
+
} = config;
|
|
294
353
|
return agentOs({
|
|
295
|
-
options
|
|
354
|
+
options,
|
|
355
|
+
preview,
|
|
356
|
+
onBeforeConnect,
|
|
357
|
+
onSessionEvent: onSessionEvent ? (_ctx, sessionId, event) => onSessionEvent(sessionId, event) : void 0,
|
|
358
|
+
onPermissionRequest: onPermissionRequest ? (_ctx, sessionId, request) => onPermissionRequest(sessionId, request) : void 0
|
|
296
359
|
});
|
|
297
360
|
}
|
|
298
361
|
export {
|
|
@@ -300,7 +363,9 @@ export {
|
|
|
300
363
|
agentOs,
|
|
301
364
|
agentOsActorConfigSchema,
|
|
302
365
|
buildConfigJson,
|
|
366
|
+
defineSoftware,
|
|
303
367
|
getPluginPath,
|
|
368
|
+
nativeAgentOsOptionsSchema,
|
|
304
369
|
nodeModulesMount,
|
|
305
370
|
setup
|
|
306
371
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/actor.ts","../src/config.ts","../src/plugin-binary.ts","../src/index.ts"],"sourcesContent":["/**\n * Rust-backed `agentOs(...)` definition.\n *\n * Produces an `ActorDefinition` whose `nativeFactoryBuilder` constructs a\n * native-actor-plugin factory through `runtime.createNativePluginFactory(...)`\n * (NAPI → `dlopen` of the agent-os actor plugin cdylib, the inverse of the\n * generic host loader). All lifecycle, state, and action dispatch live in the\n * Rust plugin (`crates/agentos-actor-plugin`). This JS shim only validates\n * configuration, resolves the plugin + sidecar binaries, and hands the opaque\n * config envelope across the bridge — it owns no agent-os runtime logic.\n */\n\nimport { sep } from \"node:path\";\nimport common from \"@agentos-software/common\";\nimport { getSidecarPath } from \"@rivet-dev/agentos-sidecar\";\nimport {\n\tactor,\n\ttype ActorDefinition,\n\ttype ActorFactoryHandle,\n\ttype CoreRuntime,\n\ttype DatabaseProvider,\n\ttype NapiNativePluginOptions,\n\ttype RawAccess,\n} from \"rivetkit\";\nimport {\n\ttype AgentOsActorConfig,\n\ttype AgentOsActorConfigInput,\n\tagentOsActorConfigSchema,\n} from \"./config.js\";\nimport { getPluginPath } from \"./plugin-binary.js\";\nimport type { AgentOsActorState, AgentOsActorVars } from \"./types.js\";\n\n/**\n * Build the JSON envelope the Rust plugin consumes. The Rust deserializer\n * uses `deny_unknown_fields`, so the envelope must stay in lock-step with\n * `crates/agentos-actor-plugin/src/config.rs::AgentOsConfigJson`.\n *\n * Software threading: each software descriptor is flattened (meta packages\n * such as `common` are arrays of descriptors) and mapped to the Rust\n * `SoftwareInput { package, kind }`. The agentos-client resolves an\n * ABSOLUTE `package` directly (its `resolve_software` lets an absolute path\n * bypass the `node_modules` prefix), so the descriptor's already-resolved\n * `commandDir` (wasm commands) / `packageDir` (agents/tools) is forwarded as\n * `package`.\n */\ninterface SoftwareDescriptorLike {\n\tcommandDir?: string;\n\tpackageDir?: string;\n\trequires?: string[];\n\tagent?: unknown;\n\thostTool?: unknown;\n\ttoolkit?: unknown;\n}\n\ninterface NativeMountLike {\n\tpath: string;\n\tplugin: {\n\t\tid: string;\n\t\tconfig?: unknown;\n\t};\n\treadOnly?: boolean;\n}\n\n/**\n * A native `host_dir` mount of a host `node_modules` directory at\n * `/root/node_modules`, the serializable form `agentOs({ options: { mounts } })`\n * accepts across the NAPI boundary.\n */\nexport interface NodeModulesMountConfig {\n\tpath: \"/root/node_modules\";\n\tplugin: { id: \"host_dir\"; config: { hostPath: string; readOnly: boolean } };\n\treadOnly: boolean;\n}\n\n/**\n * Mount a host `node_modules` directory into the VM at `/root/node_modules`.\n *\n * This is the explicit, mount-based replacement for the removed `moduleAccessCwd`\n * mechanism: the VM module resolver reads the mounted tree through the kernel\n * VFS, so the caller supplies exactly the `node_modules` directory whose\n * packages should resolve in the guest.\n *\n * @param hostNodeModulesDir Absolute host path to a `node_modules` directory.\n * @param opts.readOnly Defaults to `true`; the mount is read-only.\n */\nexport function nodeModulesMount(\n\thostNodeModulesDir: string,\n\topts?: { readOnly?: boolean },\n): NodeModulesMountConfig {\n\tconst readOnly = opts?.readOnly ?? true;\n\treturn {\n\t\tpath: \"/root/node_modules\",\n\t\tplugin: {\n\t\t\tid: \"host_dir\",\n\t\t\tconfig: { hostPath: hostNodeModulesDir, readOnly },\n\t\t},\n\t\treadOnly,\n\t};\n}\n\n/**\n * Derive the `node_modules` root that contains an installed package directory.\n * For an agent descriptor whose `packageDir` is `<root>/node_modules/@scope/pkg`,\n * this returns `<root>/node_modules` — the hoist root that also holds the agent's\n * `requires` (the ACP adapter + agent SDK) and their transitive deps under a\n * flat (npm) install. Returns `undefined` when `packageDir` is not inside a\n * `node_modules` tree (e.g. a linked monorepo checkout), where the caller must\n * supply an explicit `nodeModulesMount(...)`.\n */\nfunction nodeModulesRootOf(packageDir: string): string | undefined {\n\tconst parts = packageDir.split(sep);\n\tconst idx = parts.lastIndexOf(\"node_modules\");\n\tif (idx === -1) return undefined;\n\treturn parts.slice(0, idx + 1).join(sep);\n}\n\n/**\n * Agents run their ACP adapter + SDK inside the VM from `/root/node_modules`.\n * Rather than make the caller hand-write `nodeModulesMount(...)`, auto-derive a\n * read-only `host_dir` mount of the `node_modules` root that holds the agent\n * packages (`requires`) from each agent descriptor's installed `packageDir`.\n *\n * An explicit `/root/node_modules` mount in `options.mounts` always wins. If\n * agents resolve to more than one distinct `node_modules` root the derivation is\n * ambiguous and the caller must mount explicitly.\n */\nfunction withAutoAgentNodeModulesMount(\n\tmounts: NativeMountLike[] | undefined,\n\tdescriptors: SoftwareDescriptorLike[],\n): NativeMountLike[] | undefined {\n\tif (mounts?.some((mount) => mount.path === \"/root/node_modules\")) {\n\t\treturn mounts;\n\t}\n\n\tconst roots = new Set<string>();\n\tfor (const d of descriptors) {\n\t\tif (!d.agent || typeof d.packageDir !== \"string\") continue;\n\t\tconst root = nodeModulesRootOf(d.packageDir);\n\t\tif (root) {\n\t\t\troots.add(root);\n\t\t\tcontinue;\n\t\t}\n\t\tconst requires = d.requires?.length\n\t\t\t? ` Required packages: ${d.requires.join(\", \")}.`\n\t\t\t: \"\";\n\t\tthrow new Error(\n\t\t\t\"agentOs() could not auto-mount agent node_modules: agent \" +\n\t\t\t\t`packageDir ${d.packageDir} is not inside a node_modules install. ` +\n\t\t\t\t\"Run from an npm-installed package tree, or pass an explicit \" +\n\t\t\t\t\"nodeModulesMount(<absolute node_modules path>) in options.mounts.\" +\n\t\t\t\trequires,\n\t\t);\n\t}\n\n\tif (roots.size === 0) return mounts;\n\tif (roots.size > 1) {\n\t\tthrow new Error(\n\t\t\t\"agentOs() could not auto-mount agent node_modules: agents resolved to \" +\n\t\t\t\t`multiple node_modules roots (${[...roots].join(\", \")}). Pass an ` +\n\t\t\t\t\"explicit nodeModulesMount(...) in options.mounts.\",\n\t\t);\n\t}\n\n\tconst [hostNodeModulesDir] = [...roots];\n\treturn [...(mounts ?? []), nodeModulesMount(hostNodeModulesDir)];\n}\n\n/**\n * Stable identity for a software descriptor, used to de-duplicate the\n * auto-injected default bundle against software the caller passed explicitly.\n * Resolved `commandDir`/`packageDir` paths are the most reliable key; `name`\n * is the fallback for descriptors without a directory.\n */\nfunction softwareIdentity(d: SoftwareDescriptorLike): string {\n\tif (typeof d.commandDir === \"string\") return `dir:${d.commandDir}`;\n\tif (typeof d.packageDir === \"string\") return `dir:${d.packageDir}`;\n\tconst name = (d as { name?: unknown }).name;\n\tif (typeof name === \"string\") return `name:${name}`;\n\treturn JSON.stringify(d);\n}\n\nfunction flattenSoftware(input: unknown, out: SoftwareDescriptorLike[]): void {\n\tif (input == null) return;\n\tif (Array.isArray(input)) {\n\t\tfor (const item of input) flattenSoftware(item, out);\n\t\treturn;\n\t}\n\tif (typeof input === \"object\") out.push(input as SoftwareDescriptorLike);\n}\n\nexport function buildConfigJson<TConnParams>(\n\tparsed: AgentOsActorConfig<TConnParams>,\n): string {\n\tconst descriptors: SoftwareDescriptorLike[] = [];\n\tflattenSoftware(\n\t\t(parsed.options as { software?: unknown })?.software,\n\t\tdescriptors,\n\t);\n\n\t// Auto-include the default software bundle (`@agentos-software/common`: `sh` +\n\t// coreutils + the standard CLI tools agents rely on) unless the caller opted\n\t// out with `defaultSoftware: false`. Anything already listed in `software`\n\t// (e.g. an explicit `common`) is not duplicated. Prepended so the baseline\n\t// tools come first, matching the previous explicit `[common, ...]` ordering.\n\tconst defaultSoftwareEnabled =\n\t\t(parsed.options as { defaultSoftware?: unknown })?.defaultSoftware !== false;\n\tif (defaultSoftwareEnabled) {\n\t\tconst defaults: SoftwareDescriptorLike[] = [];\n\t\tflattenSoftware(common, defaults);\n\t\tconst seen = new Set(descriptors.map(softwareIdentity));\n\t\tconst toPrepend = defaults.filter((d) => !seen.has(softwareIdentity(d)));\n\t\tdescriptors.unshift(...toPrepend);\n\t}\n\n\tconst software: Array<{ package: string; kind?: string }> = [];\n\tfor (const d of descriptors) {\n\t\tif (typeof d.commandDir === \"string\") {\n\t\t\t// Wasm command directory (kind defaults to WasmCommands on the Rust side).\n\t\t\tsoftware.push({ package: d.commandDir });\n\t\t} else if (typeof d.packageDir === \"string\") {\n\t\t\t// Agent SDK / host-tool package: forwarded but not mounted as commands.\n\t\t\t// `kind` matches the kebab-case serde tags of the Rust `SoftwareKind`\n\t\t\t// enum (`wasm-commands` / `agent` / `tool`).\n\t\t\tsoftware.push({\n\t\t\t\tpackage: d.packageDir,\n\t\t\t\tkind: d.hostTool || d.toolkit ? \"tool\" : \"agent\",\n\t\t\t});\n\t\t}\n\t}\n\n\t// `/root/node_modules` (agent ACP adapter + SDK + transitive dep resolution)\n\t// is auto-derived from the agent descriptors so the standard quickstart needs\n\t// no manual `nodeModulesMount(...)`: see `withAutoAgentNodeModulesMount`. An\n\t// explicit `/root/node_modules` mount in `options.mounts` always wins. The VM\n\t// module resolver reads the mounted tree through the kernel VFS.\n\tconst options = (parsed.options ?? {}) as Record<string, unknown>;\n\tconst mounts = withAutoAgentNodeModulesMount(\n\t\tserializeNativeMounts(options.mounts),\n\t\tdescriptors,\n\t);\n\tconst sidecar = serializeSidecar(options.sidecar);\n\treturn JSON.stringify({\n\t\tsoftware,\n\t\tadditionalInstructions: options.additionalInstructions,\n\t\tloopbackExemptPorts: options.loopbackExemptPorts,\n\t\tallowedNodeBuiltins: options.allowedNodeBuiltins,\n\t\tpermissions: options.permissions,\n\t\trootFilesystem: options.rootFilesystem,\n\t\tmounts,\n\t\tlimits: options.limits,\n\t\tsidecar,\n\t});\n}\n\nfunction serializeNativeMounts(input: unknown): NativeMountLike[] | undefined {\n\tif (input == null) return undefined;\n\tif (!Array.isArray(input)) {\n\t\tthrow new Error(\"agentOs() options.mounts must be an array\");\n\t}\n\treturn input.map((mount, index) => {\n\t\tif (!mount || typeof mount !== \"object\") {\n\t\t\tthrow new Error(`agentOs() options.mounts[${index}] must be an object`);\n\t\t}\n\t\tconst record = mount as Record<string, unknown>;\n\t\tif (record.driver !== undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t\"agentOs() only supports Native mounts across the NAPI boundary; Plain mounts with driver callbacks are not serializable\",\n\t\t\t);\n\t\t}\n\t\tif (record.filesystem !== undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t\"agentOs() only supports Native mounts across the NAPI boundary; Overlay mounts are not serializable\",\n\t\t\t);\n\t\t}\n\t\tconst plugin = record.plugin;\n\t\tif (\n\t\t\ttypeof record.path !== \"string\" ||\n\t\t\t!plugin ||\n\t\t\ttypeof plugin !== \"object\" ||\n\t\t\ttypeof (plugin as Record<string, unknown>).id !== \"string\"\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t`agentOs() options.mounts[${index}] must be a Native mount with { path, plugin: { id, config? } }`,\n\t\t\t);\n\t\t}\n\t\treturn {\n\t\t\tpath: record.path,\n\t\t\tplugin: {\n\t\t\t\tid: (plugin as Record<string, unknown>).id as string,\n\t\t\t\tconfig: (plugin as Record<string, unknown>).config,\n\t\t\t},\n\t\t\treadOnly:\n\t\t\t\ttypeof record.readOnly === \"boolean\" ? record.readOnly : undefined,\n\t\t};\n\t});\n}\n\nfunction serializeSidecar(input: unknown): { pool?: string } | undefined {\n\tif (input == null) return undefined;\n\tif (!input || typeof input !== \"object\") {\n\t\tthrow new Error(\"agentOs() options.sidecar must be an object\");\n\t}\n\tconst record = input as Record<string, unknown>;\n\tif (record.kind === \"explicit\" || record.handle !== undefined) {\n\t\tthrow new Error(\n\t\t\t\"agentOs() only supports sidecar shared pool configuration across the NAPI boundary; explicit sidecar handles are not serializable\",\n\t\t);\n\t}\n\tif (record.kind !== undefined && record.kind !== \"shared\") {\n\t\tthrow new Error('agentOs() options.sidecar.kind must be \"shared\"');\n\t}\n\treturn typeof record.pool === \"string\" ? { pool: record.pool } : {};\n}\n\nfunction buildNativeFactoryBuilder<TConnParams>(\n\tparsed: AgentOsActorConfig<TConnParams>,\n): (runtime: CoreRuntime) => ActorFactoryHandle {\n\treturn (runtime) => {\n\t\tif (runtime.kind !== \"napi\") {\n\t\t\tthrow new Error(\n\t\t\t\t`agentOs() is only supported on the native NAPI runtime (current runtime kind: ${runtime.kind})`,\n\t\t\t);\n\t\t}\n\t\tif (!runtime.createNativePluginFactory) {\n\t\t\tthrow new Error(\n\t\t\t\t\"runtime.createNativePluginFactory is not implemented on the active CoreRuntime\",\n\t\t\t);\n\t\t}\n\t\tconst options: NapiNativePluginOptions = {\n\t\t\t// Resolve the prebuilt agent-os actor plugin cdylib; RivetKit `dlopen`s\n\t\t\t// it through the generic native-plugin ABI.\n\t\t\tpluginPath: getPluginPath(),\n\t\t\t// Opaque config envelope the plugin parses (config.rs::AgentOsConfigJson).\n\t\t\tconfigJson: buildConfigJson(parsed),\n\t\t\t// Resolve the prebuilt sidecar binary from the npm package so the plugin\n\t\t\t// spawns the bundled binary rather than relying on `agentos-sidecar`\n\t\t\t// being on PATH.\n\t\t\tsidecarPath: getSidecarPath(),\n\t\t};\n\t\treturn runtime.createNativePluginFactory(options);\n\t};\n}\n\n/**\n * Type alias for the `agentOs(...)` return type. Events are not typed at the\n * TS surface because the Rust plugin owns the broadcast set and the\n * test/client surface uses `any` for actions.\n */\nexport type AgentOsActorDefinition<TConnParams> = ActorDefinition<\n\tAgentOsActorState,\n\tTConnParams,\n\tundefined,\n\tAgentOsActorVars,\n\tundefined,\n\tDatabaseProvider<RawAccess>,\n\tRecord<never, never>,\n\tRecord<never, never>,\n\tany\n>;\n\nexport function agentOs<TConnParams = undefined>(\n\tconfig: AgentOsActorConfigInput<TConnParams>,\n): AgentOsActorDefinition<TConnParams> {\n\tconst parsed = agentOsActorConfigSchema.parse(\n\t\tconfig,\n\t) as AgentOsActorConfig<TConnParams>;\n\n\t// Construct a minimal definition through the existing actor() helper, then\n\t// attach the Rust factory builder marker. The actions block stays empty\n\t// because no JS-side action ever runs: the engine driver branches on\n\t// `nativeFactoryBuilder` before reaching the JS dispatch path.\n\tconst actorOptions = (parsed as { actorOptions?: Record<string, unknown> })\n\t\t.actorOptions;\n\tconst definition = actor({\n\t\tactions: {},\n\t\t...(actorOptions ? { options: actorOptions } : {}),\n\t} as Parameters<\n\t\ttypeof actor\n\t>[0]) as unknown as AgentOsActorDefinition<TConnParams>;\n\tdefinition.nativeFactoryBuilder = buildNativeFactoryBuilder(parsed);\n\treturn definition;\n}\n","import type {\n\tAgentOsOptions,\n\tJsonRpcNotification,\n\tPermissionRequest,\n} from \"@rivet-dev/agentos-core\";\nimport type { ActorContext, BeforeConnectContext } from \"rivetkit\";\nimport { z } from \"zod/v4\";\nimport type { AgentOsActorState, AgentOsActorVars } from \"./types.js\";\n\nconst zFunction = <\n\tT extends (...args: any[]) => any = (...args: unknown[]) => unknown,\n>() => z.custom<T>((val) => typeof val === \"function\");\n\nconst AgentOsOptionsSchema = z.custom<AgentOsOptions>(\n\t(val) => typeof val === \"object\" && val !== null,\n);\n\nexport const agentOsActorConfigSchema = z\n\t.object({\n\t\toptions: AgentOsOptionsSchema.optional(),\n\t\tpreview: z\n\t\t\t.object({\n\t\t\t\tdefaultExpiresInSeconds: z.number().positive().default(3600),\n\t\t\t\tmaxExpiresInSeconds: z.number().positive().default(86400),\n\t\t\t})\n\t\t\t.strict()\n\t\t\t.prefault(() => ({})),\n\t\tonBeforeConnect: zFunction().optional(),\n\t\tonSessionEvent: zFunction().optional(),\n\t\tonPermissionRequest: zFunction().optional(),\n\t})\n\t.strict();\n\n// --- Typed config types (generic callbacks overlaid on the Zod schema) ---\n\ntype AgentOsActorContext<TConnParams> = ActorContext<\n\tAgentOsActorState,\n\tTConnParams,\n\tundefined,\n\tAgentOsActorVars,\n\tundefined,\n\tany\n>;\n\ninterface AgentOsActorConfigCallbacks<TConnParams> {\n\tonBeforeConnect?: (\n\t\tc: BeforeConnectContext<\n\t\t\tAgentOsActorState,\n\t\t\tAgentOsActorVars,\n\t\t\tundefined,\n\t\t\tany\n\t\t>,\n\t\tparams: TConnParams,\n\t) => void | Promise<void>;\n\tonSessionEvent?: (\n\t\tc: AgentOsActorContext<TConnParams>,\n\t\tsessionId: string,\n\t\tevent: JsonRpcNotification,\n\t) => void | Promise<void>;\n\tonPermissionRequest?: (\n\t\tc: AgentOsActorContext<TConnParams>,\n\t\tsessionId: string,\n\t\trequest: PermissionRequest,\n\t) => void | Promise<void>;\n}\n\n// Parsed config (after Zod defaults/transforms applied).\nexport type AgentOsActorConfig<TConnParams = undefined> = Omit<\n\tz.infer<typeof agentOsActorConfigSchema>,\n\t\"onBeforeConnect\" | \"onSessionEvent\" | \"onPermissionRequest\"\n> &\n\tAgentOsActorConfigCallbacks<TConnParams>;\n\n// Input config (what users pass in before Zod transforms).\nexport type AgentOsActorConfigInput<TConnParams = undefined> = Omit<\n\tz.input<typeof agentOsActorConfigSchema>,\n\t\"onBeforeConnect\" | \"onSessionEvent\" | \"onPermissionRequest\"\n> &\n\tAgentOsActorConfigCallbacks<TConnParams>;\n","// Platform-specific resolver for the prebuilt agent-os actor plugin cdylib\n// (`libagentos_actor_plugin.{so,dylib,dll}`). Mirrors the sidecar-binary\n// resolver (`@rivet-dev/agentos-sidecar`): the library ships inside one of the\n// `@rivet-dev/agentos-plugin-<platform>` packages, declared as\n// optionalDependencies so npm installs only the one matching the current\n// `os`/`cpu`/`libc` at install time (spec phase 6).\n//\n// Resolution priority:\n// 1. `AGENTOS_PLUGIN_BIN` env var (absolute path override).\n// 2. A cargo build output under the repo `target/{release,debug}/` (dev).\n// 3. The platform-specific `@rivet-dev/agentos-plugin-<platform>` package.\n\nimport { existsSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst PLUGIN_BIN_ENV = \"AGENTOS_PLUGIN_BIN\";\n\n/** The cdylib filename for the current platform. */\nfunction libraryName(): string {\n\tswitch (process.platform) {\n\t\tcase \"darwin\":\n\t\t\treturn \"libagentos_actor_plugin.dylib\";\n\t\tcase \"win32\":\n\t\t\treturn \"agentos_actor_plugin.dll\";\n\t\tdefault:\n\t\t\treturn \"libagentos_actor_plugin.so\";\n\t}\n}\n\nfunction getPlatformPackageName(): string | null {\n\tconst { platform, arch } = process;\n\tswitch (platform) {\n\t\tcase \"linux\":\n\t\t\tif (arch === \"x64\") return \"@rivet-dev/agentos-plugin-linux-x64-gnu\";\n\t\t\tif (arch === \"arm64\") return \"@rivet-dev/agentos-plugin-linux-arm64-gnu\";\n\t\t\tbreak;\n\t\tcase \"darwin\":\n\t\t\tif (arch === \"x64\") return \"@rivet-dev/agentos-plugin-darwin-x64\";\n\t\t\tif (arch === \"arm64\") return \"@rivet-dev/agentos-plugin-darwin-arm64\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\treturn null;\n}\n\n/**\n * Resolve the absolute path to the agent-os actor plugin cdylib. RivetKit\n * `dlopen`s this path through the generic native-plugin ABI.\n */\nexport function getPluginPath(): string {\n\tconst override = process.env[PLUGIN_BIN_ENV];\n\tif (override) {\n\t\tif (!existsSync(override)) {\n\t\t\tthrow new Error(\n\t\t\t\t`${PLUGIN_BIN_ENV} is set to ${override} but the file does not exist`,\n\t\t\t);\n\t\t}\n\t\treturn override;\n\t}\n\n\tconst lib = libraryName();\n\n\t// Dev: a cargo build output under the repo `target/`. `import.meta.url` is\n\t// `packages/agentos/dist/plugin-binary.js`, so the repo root is three levels up.\n\tconst here = dirname(fileURLToPath(import.meta.url));\n\tfor (const profile of [\"release\", \"debug\"]) {\n\t\tconst candidate = join(here, \"..\", \"..\", \"..\", \"target\", profile, lib);\n\t\tif (existsSync(candidate)) {\n\t\t\treturn candidate;\n\t\t}\n\t}\n\n\t// Prod: the platform-specific package.\n\tconst platformPkg = getPlatformPackageName();\n\tif (!platformPkg) {\n\t\tthrow new Error(\n\t\t\t`@rivet-dev/agentos: unsupported platform ${process.platform}/${process.arch}. ` +\n\t\t\t\t\"The Agent OS actor plugin currently supports linux and darwin on x64 and arm64. \" +\n\t\t\t\t`Set ${PLUGIN_BIN_ENV} to a local cdylib to override.`,\n\t\t);\n\t}\n\n\tconst require = createRequire(import.meta.url);\n\tlet pkgJsonPath: string;\n\ttry {\n\t\tpkgJsonPath = require.resolve(`${platformPkg}/package.json`);\n\t} catch {\n\t\tthrow new Error(\n\t\t\t`@rivet-dev/agentos: platform package ${platformPkg} is not installed.\\n` +\n\t\t\t\t\"This usually means the platform is unsupported or optionalDependencies\\n\" +\n\t\t\t\t`were skipped during install. Try: npm install --include=optional ${platformPkg}\\n` +\n\t\t\t\t`Or set ${PLUGIN_BIN_ENV} to a local cdylib, or build it with\\n` +\n\t\t\t\t\"`cargo build -p agentos-actor-plugin`.\",\n\t\t);\n\t}\n\n\treturn join(dirname(pkgJsonPath), lib);\n}\n","// Rust-backed agent-os actor surface (native actor plugin / cdylib).\n//\n// Only the `agentOs()` definition function, the config schema, the\n// `nodeModulesMount` helper, the plugin-path resolver, and the public domain\n// types are exported. All actor lifecycle + action dispatch live in the Rust\n// plugin (`crates/agentos-actor-plugin`), loaded by RivetKit via the generic\n// native-plugin ABI.\n\nimport {\n\tagentOs as createAgentOs,\n\ttype AgentOsActorDefinition,\n} from \"./actor.js\";\nimport type { AgentOsActorConfigInput } from \"./config.js\";\n\nexport { setup } from \"rivetkit\";\n\nexport {\n\tbuildConfigJson,\n\tnodeModulesMount,\n\ttype NodeModulesMountConfig,\n} from \"./actor.js\";\nexport { createAgentOs as agentOs };\n\nexport {\n\ttype AgentOsActorConfig,\n\ttype AgentOsActorConfigInput,\n\tagentOsActorConfigSchema,\n} from \"./config.js\";\n\nexport { getPluginPath } from \"./plugin-binary.js\";\n\nexport type {\n\tAgentOsActionContext,\n\tAgentOsActorState,\n\tAgentOsActorVars,\n\tAgentOsEvents,\n\tCronEventPayload,\n\tPermissionRequestPayload,\n\tPersistedSessionEvent,\n\tPersistedSessionRecord,\n\tProcessExitPayload,\n\tProcessOutputPayload,\n\tPromptResult,\n\tSerializableCronAction,\n\tSerializableCronJobInfo,\n\tSerializableCronJobOptions,\n\tSessionEventPayload,\n\tSessionRecord,\n\tShellDataPayload,\n\tVmBootedPayload,\n\tVmShutdownPayload,\n} from \"./types.js\";\n\nexport type AgentOSActorConfigInput<TConnParams = undefined> =\n\tAgentOsActorConfigInput<TConnParams>[\"options\"];\n\nexport function agentOS<TConnParams = undefined>(\n\tconfig: AgentOSActorConfigInput<TConnParams> = {},\n): AgentOsActorDefinition<TConnParams> {\n\treturn createAgentOs({\n\t\toptions: config,\n\t} as AgentOsActorConfigInput<TConnParams>);\n}\n"],"mappings":";AAYA,SAAS,WAAW;AACpB,OAAO,YAAY;AACnB,SAAS,sBAAsB;AAC/B;AAAA,EACC;AAAA,OAOM;;;ACjBP,SAAS,SAAS;AAGlB,IAAM,YAAY,MAEX,EAAE,OAAU,CAAC,QAAQ,OAAO,QAAQ,UAAU;AAErD,IAAM,uBAAuB,EAAE;AAAA,EAC9B,CAAC,QAAQ,OAAO,QAAQ,YAAY,QAAQ;AAC7C;AAEO,IAAM,2BAA2B,EACtC,OAAO;AAAA,EACP,SAAS,qBAAqB,SAAS;AAAA,EACvC,SAAS,EACP,OAAO;AAAA,IACP,yBAAyB,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,IAAI;AAAA,IAC3D,qBAAqB,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,KAAK;AAAA,EACzD,CAAC,EACA,OAAO,EACP,SAAS,OAAO,CAAC,EAAE;AAAA,EACrB,iBAAiB,UAAU,EAAE,SAAS;AAAA,EACtC,gBAAgB,UA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,IACxB,SAAS,CAAC;AAAA,IACV,GAAI,eAAe,EAAE,SAAS,aAAa,IAAI,CAAC;AAAA,EACjD,CAEI;AACJ,aAAW,uBAAuB,0BAA0B,MAAM;AAClE,SAAO;AACR;;;AG/WA,SAAS,aAAa;AA0Cf,SAAS,QACf,SAA+C,CAAC,GACV;AACtC,SAAO,QAAc;AAAA,IACpB,SAAS;AAAA,EACV,CAAyC;AAC1C;","names":["require"]}
|
|
1
|
+
{"version":3,"sources":["../src/actor.ts","../src/config.ts","../src/plugin-binary.ts","../src/index.ts"],"sourcesContent":["/**\n * Rust-backed `agentOs(...)` definition.\n *\n * Produces an `ActorDefinition` whose `nativeFactoryBuilder` constructs a\n * native-actor-plugin factory through `runtime.createNativePluginFactory(...)`\n * (NAPI → `dlopen` of the agent-os actor plugin cdylib, the inverse of the\n * generic host loader). All lifecycle, state, and action dispatch live in the\n * Rust plugin (`crates/agentos-actor-plugin`). This JS shim only validates\n * configuration, resolves the plugin + sidecar binaries, and hands the opaque\n * config envelope across the bridge — it owns no agent-os runtime logic.\n */\n\nimport { sep } from \"node:path\";\nimport common from \"@agentos-software/common\";\nimport { getSidecarPath } from \"@rivet-dev/agentos-sidecar\";\nimport {\n\tactor,\n\ttype ActorDefinition,\n\ttype ActorFactoryHandle,\n\ttype CoreRuntime,\n\ttype DatabaseProvider,\n\ttype NapiNativePluginOptions,\n\ttype RawAccess,\n} from \"rivetkit\";\nimport {\n\ttype AgentOsActorConfig,\n\ttype AgentOsActorConfigInput,\n\tagentOsActorConfigSchema,\n\tnativeAgentOsOptionsSchema,\n} from \"./config.js\";\nimport { getPluginPath } from \"./plugin-binary.js\";\nimport type { AgentOsActions } from \"./actor-actions.js\";\nimport type { AgentOsActorState, AgentOsActorVars } from \"./types.js\";\n\n/**\n * Build the JSON envelope the Rust plugin consumes. The Rust deserializer\n * uses `deny_unknown_fields`, so the envelope must stay in lock-step with\n * `crates/agentos-actor-plugin/src/config.rs::AgentOsConfigJson`.\n *\n * Software threading: each software descriptor is flattened (meta packages\n * such as `common` are arrays of descriptors) and mapped to the Rust\n * `SoftwareInput { package, kind }`. The agentos-client resolves an\n * ABSOLUTE `package` directly (its `resolve_software` lets an absolute path\n * bypass the `node_modules` prefix), so the descriptor's already-resolved\n * `commandDir` (wasm commands) / `packageDir` (agents/tools) is forwarded as\n * `package`.\n */\ninterface SoftwareDescriptorLike {\n\tcommandDir?: string;\n\tpackageDir?: string;\n\trequires?: string[];\n\tagent?: unknown;\n\thostTool?: unknown;\n\ttoolkit?: unknown;\n}\n\ninterface NativeMountLike {\n\tpath: string;\n\tplugin: {\n\t\tid: string;\n\t\tconfig?: unknown;\n\t};\n\treadOnly?: boolean;\n}\n\n/**\n * A native `host_dir` mount of a host `node_modules` directory at\n * `/root/node_modules`, the serializable form `agentOs({ options: { mounts } })`\n * accepts across the NAPI boundary.\n */\nexport interface NodeModulesMountConfig {\n\tpath: \"/root/node_modules\";\n\tplugin: { id: \"host_dir\"; config: { hostPath: string; readOnly: boolean } };\n\treadOnly: boolean;\n}\n\n/**\n * Mount a host `node_modules` directory into the VM at `/root/node_modules`.\n *\n * This is the explicit, mount-based replacement for the removed `moduleAccessCwd`\n * mechanism: the VM module resolver reads the mounted tree through the kernel\n * VFS, so the caller supplies exactly the `node_modules` directory whose\n * packages should resolve in the guest.\n *\n * @param hostNodeModulesDir Absolute host path to a `node_modules` directory.\n * @param opts.readOnly Defaults to `true`; the mount is read-only.\n */\nexport function nodeModulesMount(\n\thostNodeModulesDir: string,\n\topts?: { readOnly?: boolean },\n): NodeModulesMountConfig {\n\tconst readOnly = opts?.readOnly ?? true;\n\treturn {\n\t\tpath: \"/root/node_modules\",\n\t\tplugin: {\n\t\t\tid: \"host_dir\",\n\t\t\tconfig: { hostPath: hostNodeModulesDir, readOnly },\n\t\t},\n\t\treadOnly,\n\t};\n}\n\n/**\n * Derive the `node_modules` root that contains an installed package directory.\n * For an agent descriptor whose `packageDir` is `<root>/node_modules/@scope/pkg`,\n * this returns `<root>/node_modules` — the hoist root that also holds the agent's\n * `requires` (the ACP adapter + agent SDK) and their transitive deps under a\n * flat (npm) install. Returns `undefined` when `packageDir` is not inside a\n * `node_modules` tree (e.g. a linked monorepo checkout), where the caller must\n * supply an explicit `nodeModulesMount(...)`.\n */\nfunction nodeModulesRootOf(packageDir: string): string | undefined {\n\tconst parts = packageDir.split(sep);\n\tconst idx = parts.lastIndexOf(\"node_modules\");\n\tif (idx === -1) return undefined;\n\treturn parts.slice(0, idx + 1).join(sep);\n}\n\n/**\n * Agents run their ACP adapter + SDK inside the VM from `/root/node_modules`.\n * Rather than make the caller hand-write `nodeModulesMount(...)`, auto-derive a\n * read-only `host_dir` mount of the `node_modules` root that holds the agent\n * packages (`requires`) from each agent descriptor's installed `packageDir`.\n *\n * An explicit `/root/node_modules` mount in `options.mounts` always wins. If\n * agents resolve to more than one distinct `node_modules` root the derivation is\n * ambiguous and the caller must mount explicitly.\n */\nfunction withAutoAgentNodeModulesMount(\n\tmounts: NativeMountLike[] | undefined,\n\tdescriptors: SoftwareDescriptorLike[],\n): NativeMountLike[] | undefined {\n\tif (mounts?.some((mount) => mount.path === \"/root/node_modules\")) {\n\t\treturn mounts;\n\t}\n\n\tconst roots = new Set<string>();\n\tfor (const d of descriptors) {\n\t\tif (!d.agent || typeof d.packageDir !== \"string\") continue;\n\t\tconst root = nodeModulesRootOf(d.packageDir);\n\t\tif (root) {\n\t\t\troots.add(root);\n\t\t\tcontinue;\n\t\t}\n\t\tconst requires = d.requires?.length\n\t\t\t? ` Required packages: ${d.requires.join(\", \")}.`\n\t\t\t: \"\";\n\t\tthrow new Error(\n\t\t\t\"agentOs() could not auto-mount agent node_modules: agent \" +\n\t\t\t\t`packageDir ${d.packageDir} is not inside a node_modules install. ` +\n\t\t\t\t\"Run from an npm-installed package tree, or pass an explicit \" +\n\t\t\t\t\"nodeModulesMount(<absolute node_modules path>) in options.mounts.\" +\n\t\t\t\trequires,\n\t\t);\n\t}\n\n\tif (roots.size === 0) return mounts;\n\tif (roots.size > 1) {\n\t\tthrow new Error(\n\t\t\t\"agentOs() could not auto-mount agent node_modules: agents resolved to \" +\n\t\t\t\t`multiple node_modules roots (${[...roots].join(\", \")}). Pass an ` +\n\t\t\t\t\"explicit nodeModulesMount(...) in options.mounts.\",\n\t\t);\n\t}\n\n\tconst [hostNodeModulesDir] = [...roots];\n\treturn [...(mounts ?? []), nodeModulesMount(hostNodeModulesDir)];\n}\n\n/**\n * Stable identity for a software descriptor, used to de-duplicate the\n * auto-injected default bundle against software the caller passed explicitly.\n * Resolved `commandDir`/`packageDir` paths are the most reliable key; `name`\n * is the fallback for descriptors without a directory.\n */\nfunction softwareIdentity(d: SoftwareDescriptorLike): string {\n\tif (typeof d.commandDir === \"string\") return `dir:${d.commandDir}`;\n\tif (typeof d.packageDir === \"string\") return `dir:${d.packageDir}`;\n\tconst name = (d as { name?: unknown }).name;\n\tif (typeof name === \"string\") return `name:${name}`;\n\treturn JSON.stringify(d);\n}\n\nfunction flattenSoftware(input: unknown, out: SoftwareDescriptorLike[]): void {\n\tif (input == null) return;\n\tif (Array.isArray(input)) {\n\t\tfor (const item of input) flattenSoftware(item, out);\n\t\treturn;\n\t}\n\tif (typeof input === \"object\") out.push(input as SoftwareDescriptorLike);\n}\n\nexport function buildConfigJson<TConnParams>(\n\tparsed: AgentOsActorConfig<TConnParams>,\n): string {\n\tconst options = nativeAgentOsOptionsSchema.parse(\n\t\tparsed.options ?? {},\n\t) as Record<string, unknown>;\n\tconst descriptors: SoftwareDescriptorLike[] = [];\n\tflattenSoftware(options.software, descriptors);\n\n\t// Auto-include the default software bundle (`@agentos-software/common`: `sh` +\n\t// coreutils + the standard CLI tools agents rely on) unless the caller opted\n\t// out with `defaultSoftware: false`. Anything already listed in `software`\n\t// (e.g. an explicit `common`) is not duplicated. Prepended so the baseline\n\t// tools come first, matching the previous explicit `[common, ...]` ordering.\n\tconst defaultSoftwareEnabled = options.defaultSoftware !== false;\n\tif (defaultSoftwareEnabled) {\n\t\tconst defaults: SoftwareDescriptorLike[] = [];\n\t\tflattenSoftware(common, defaults);\n\t\tconst seen = new Set(descriptors.map(softwareIdentity));\n\t\tconst toPrepend = defaults.filter((d) => !seen.has(softwareIdentity(d)));\n\t\tdescriptors.unshift(...toPrepend);\n\t}\n\n\tconst software: Array<{ package: string; kind?: string }> = [];\n\tfor (const d of descriptors) {\n\t\tif (typeof d.commandDir === \"string\") {\n\t\t\t// Wasm command directory (kind defaults to WasmCommands on the Rust side).\n\t\t\tsoftware.push({ package: d.commandDir });\n\t\t} else if (typeof d.packageDir === \"string\") {\n\t\t\t// Agent SDK / host-tool package: forwarded but not mounted as commands.\n\t\t\t// `kind` matches the kebab-case serde tags of the Rust `SoftwareKind`\n\t\t\t// enum (`wasm-commands` / `agent` / `tool`).\n\t\t\tsoftware.push({\n\t\t\t\tpackage: d.packageDir,\n\t\t\t\tkind: d.hostTool || d.toolkit ? \"tool\" : \"agent\",\n\t\t\t});\n\t\t}\n\t}\n\n\t// `/root/node_modules` (agent ACP adapter + SDK + transitive dep resolution)\n\t// is auto-derived from the agent descriptors so the standard quickstart needs\n\t// no manual `nodeModulesMount(...)`: see `withAutoAgentNodeModulesMount`. An\n\t// explicit `/root/node_modules` mount in `options.mounts` always wins. The VM\n\t// module resolver reads the mounted tree through the kernel VFS.\n\tconst mounts = withAutoAgentNodeModulesMount(\n\t\tserializeNativeMounts(options.mounts),\n\t\tdescriptors,\n\t);\n\tconst sidecar = serializeSidecar(options.sidecar);\n\treturn JSON.stringify({\n\t\tsoftware,\n\t\tadditionalInstructions: options.additionalInstructions,\n\t\tmoduleAccessCwd: options.moduleAccessCwd,\n\t\tloopbackExemptPorts: options.loopbackExemptPorts,\n\t\tallowedNodeBuiltins: options.allowedNodeBuiltins,\n\t\tpermissions: options.permissions,\n\t\trootFilesystem: options.rootFilesystem,\n\t\tmounts,\n\t\tlimits: options.limits,\n\t\tsidecar,\n\t});\n}\n\nfunction serializeNativeMounts(input: unknown): NativeMountLike[] | undefined {\n\tif (input == null) return undefined;\n\tif (!Array.isArray(input)) {\n\t\tthrow new Error(\"agentOs() options.mounts must be an array\");\n\t}\n\treturn input.map((mount, index) => {\n\t\tif (!mount || typeof mount !== \"object\") {\n\t\t\tthrow new Error(`agentOs() options.mounts[${index}] must be an object`);\n\t\t}\n\t\tconst record = mount as Record<string, unknown>;\n\t\tif (record.driver !== undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t\"agentOs() only supports Native mounts across the NAPI boundary; Plain mounts with driver callbacks are not serializable\",\n\t\t\t);\n\t\t}\n\t\tif (record.filesystem !== undefined) {\n\t\t\tthrow new Error(\n\t\t\t\t\"agentOs() only supports Native mounts across the NAPI boundary; Overlay mounts are not serializable\",\n\t\t\t);\n\t\t}\n\t\tconst plugin = record.plugin;\n\t\tif (\n\t\t\ttypeof record.path !== \"string\" ||\n\t\t\t!plugin ||\n\t\t\ttypeof plugin !== \"object\" ||\n\t\t\ttypeof (plugin as Record<string, unknown>).id !== \"string\"\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t`agentOs() options.mounts[${index}] must be a Native mount with { path, plugin: { id, config? } }`,\n\t\t\t);\n\t\t}\n\t\treturn {\n\t\t\tpath: record.path,\n\t\t\tplugin: {\n\t\t\t\tid: (plugin as Record<string, unknown>).id as string,\n\t\t\t\tconfig: (plugin as Record<string, unknown>).config,\n\t\t\t},\n\t\t\treadOnly:\n\t\t\t\ttypeof record.readOnly === \"boolean\" ? record.readOnly : undefined,\n\t\t};\n\t});\n}\n\nfunction serializeSidecar(input: unknown): { pool?: string } | undefined {\n\tif (input == null) return undefined;\n\tif (!input || typeof input !== \"object\") {\n\t\tthrow new Error(\"agentOs() options.sidecar must be an object\");\n\t}\n\tconst record = input as Record<string, unknown>;\n\tif (record.kind === \"explicit\" || record.handle !== undefined) {\n\t\tthrow new Error(\n\t\t\t\"agentOs() only supports sidecar shared pool configuration across the NAPI boundary; explicit sidecar handles are not serializable\",\n\t\t);\n\t}\n\tif (record.kind !== undefined && record.kind !== \"shared\") {\n\t\tthrow new Error('agentOs() options.sidecar.kind must be \"shared\"');\n\t}\n\treturn typeof record.pool === \"string\" ? { pool: record.pool } : {};\n}\n\nfunction buildNativeFactoryBuilder<TConnParams>(\n\tparsed: AgentOsActorConfig<TConnParams>,\n): (runtime: CoreRuntime) => ActorFactoryHandle {\n\treturn (runtime) => {\n\t\tif (runtime.kind !== \"napi\") {\n\t\t\tthrow new Error(\n\t\t\t\t`agentOs() is only supported on the native NAPI runtime (current runtime kind: ${runtime.kind})`,\n\t\t\t);\n\t\t}\n\t\tif (!runtime.createNativePluginFactory) {\n\t\t\tthrow new Error(\n\t\t\t\t\"runtime.createNativePluginFactory is not implemented on the active CoreRuntime\",\n\t\t\t);\n\t\t}\n\t\tconst options: NapiNativePluginOptions = {\n\t\t\t// Resolve the prebuilt agent-os actor plugin cdylib; RivetKit `dlopen`s\n\t\t\t// it through the generic native-plugin ABI.\n\t\t\tpluginPath: getPluginPath(),\n\t\t\t// Opaque config envelope the plugin parses (config.rs::AgentOsConfigJson).\n\t\t\tconfigJson: buildConfigJson(parsed),\n\t\t\t// Resolve the prebuilt sidecar binary from the npm package so the plugin\n\t\t\t// spawns the bundled binary rather than relying on `agentos-sidecar`\n\t\t\t// being on PATH.\n\t\t\tsidecarPath: getSidecarPath(),\n\t\t};\n\t\treturn runtime.createNativePluginFactory(options);\n\t};\n}\n\n/**\n * Type alias for the `agentOs(...)` return type. Events are not typed at the TS\n * surface because the Rust plugin owns the broadcast set, but the ACTIONS are\n * typed via {@link AgentOsActions} — a TS mirror of the Rust dispatch in\n * `crates/agentos-actor-plugin/src/actions/mod.rs`. That is what gives\n * `createClient<typeof registry>()` a fully-typed handle (e.g. `handle.exec()`\n * returns `ExecResult`, not `unknown`). Keep the two in sync.\n */\nexport type AgentOsActorDefinition<TConnParams> = ActorDefinition<\n\tAgentOsActorState,\n\tTConnParams,\n\tundefined,\n\tAgentOsActorVars,\n\tundefined,\n\tDatabaseProvider<RawAccess>,\n\tRecord<never, never>,\n\tRecord<never, never>,\n\tAgentOsActions\n>;\n\n// One hour — far past any normal agent turn, connection setup, or idle gap, but\n// still a finite bound (never `0`/Infinity) per the limits-and-observability\n// policy. Agent turns routinely run minutes; the stock RivetKit defaults\n// (actionTimeout 60s, on{Before,}ConnectTimeout 5s, sleepTimeout 30s) cut them\n// off mid-flight and broke live `sessionEvent` streaming with\n// \"actor websocket connection setup timed out after 5000 ms\".\nconst ACTOR_NEVER_HIT_MS = 60 * 60 * 1000;\n// 512 MiB — large prompts/results stream as single actor messages; the stock\n// 64 KiB incoming / 1 MiB outgoing caps truncate real agent payloads.\nconst ACTOR_NEVER_HIT_MESSAGE_BYTES = 512 * 1024 * 1024;\n\n/**\n * Never-hit-by-normal-use defaults for the AgentOS actor. Every value is a high\n * but finite bound so a long multi-step agent turn, a slow connection setup, a\n * large prompt/result, and live `sessionEvent` streaming all complete without\n * tripping a RivetKit actor default. Callers can still override any single knob\n * via `actorOptions` (their value wins over these defaults).\n */\nexport const DEFAULT_AGENTOS_ACTOR_OPTIONS = {\n\t// Connection/setup lifecycle (stock 5s each) — the websocket setup path that\n\t// was timing out at 5000ms and dropping all streamed events.\n\tonBeforeConnectTimeout: ACTOR_NEVER_HIT_MS,\n\tonConnectTimeout: ACTOR_NEVER_HIT_MS,\n\tcreateVarsTimeout: ACTOR_NEVER_HIT_MS,\n\tcreateConnStateTimeout: ACTOR_NEVER_HIT_MS,\n\tonMigrateTimeout: ACTOR_NEVER_HIT_MS,\n\t// Action/RPC lifecycle (stock 60s) — long multi-step prompt turns.\n\tactionTimeout: ACTOR_NEVER_HIT_MS,\n\t// Idle/keepalive — don't reap a live session or sleep mid-turn (stock\n\t// connectionLivenessTimeout 2.5s, sleepTimeout 30s). The liveness *interval*\n\t// (ping cadence) is intentionally left at its small default.\n\tconnectionLivenessTimeout: ACTOR_NEVER_HIT_MS,\n\tsleepTimeout: ACTOR_NEVER_HIT_MS,\n\t// Payload sizes — large prompts/results. `maxQueueMessageSize` is the\n\t// per-actor message cap (stock 64 KiB); the transport-level\n\t// max{Incoming,Outgoing}MessageSize live on the registry/setup config (see\n\t// AGENTOS_REGISTRY_MESSAGE_SIZE_DEFAULTS), not on per-actor options.\n\tmaxQueueSize: 1_000_000,\n\tmaxQueueMessageSize: ACTOR_NEVER_HIT_MESSAGE_BYTES,\n} as const;\n\nexport function agentOs<TConnParams = undefined>(\n\tconfig: AgentOsActorConfigInput<TConnParams>,\n): AgentOsActorDefinition<TConnParams> {\n\tconst parsed = agentOsActorConfigSchema.parse(\n\t\tconfig,\n\t) as AgentOsActorConfig<TConnParams>;\n\n\t// Construct a minimal definition through the existing actor() helper, then\n\t// attach the Rust factory builder marker. The actions block stays empty\n\t// because no JS-side action ever runs: the engine driver branches on\n\t// `nativeFactoryBuilder` before reaching the JS dispatch path.\n\tconst userActorOptions = (\n\t\tparsed as { actorOptions?: Record<string, unknown> }\n\t).actorOptions;\n\t// High never-hit defaults, with any caller-supplied option winning.\n\tconst actorOptions = {\n\t\t...DEFAULT_AGENTOS_ACTOR_OPTIONS,\n\t\t...(userActorOptions ?? {}),\n\t};\n\tconst definition = actor({\n\t\tactions: {},\n\t\toptions: actorOptions,\n\t} as Parameters<\n\t\ttypeof actor\n\t>[0]) as unknown as AgentOsActorDefinition<TConnParams>;\n\tdefinition.nativeFactoryBuilder = buildNativeFactoryBuilder(parsed);\n\treturn definition;\n}\n","import type {\n\tAgentOsOptions,\n\tJsonRpcNotification,\n\tNativeMountConfig,\n\tPermissionRequest,\n} from \"@rivet-dev/agentos-core\";\nimport {\n\tagentOsOptionFieldSchemas,\n\tnativeMountConfigSchema,\n\tsharedSidecarConfigSchema,\n} from \"@rivet-dev/agentos-core\";\nimport type { ActorContext, BeforeConnectContext } from \"rivetkit\";\nimport { z } from \"zod/v4\";\nimport type { AgentOsActorState, AgentOsActorVars } from \"./types.js\";\n\nconst zFunction = <\n\tT extends (...args: any[]) => any = (...args: unknown[]) => unknown,\n>() => z.custom<T>((val) => typeof val === \"function\");\n\nexport const nativeAgentOsOptionsSchema = z\n\t// Native actor options are a JSON-serializable subset of AgentOsOptions.\n\t// Keep this allow-list in sync with buildConfigJson() and\n\t// crates/agentos-actor-plugin/src/config.rs::AgentOsConfigJson.\n\t.object({\n\t\tsoftware: agentOsOptionFieldSchemas.software,\n\t\tdefaultSoftware: agentOsOptionFieldSchemas.defaultSoftware,\n\t\tloopbackExemptPorts: agentOsOptionFieldSchemas.loopbackExemptPorts,\n\t\tallowedNodeBuiltins: agentOsOptionFieldSchemas.allowedNodeBuiltins,\n\t\trootFilesystem: agentOsOptionFieldSchemas.rootFilesystem,\n\t\tmounts: z.array(nativeMountConfigSchema).optional(),\n\t\tmoduleAccessCwd: agentOsOptionFieldSchemas.moduleAccessCwd,\n\t\tadditionalInstructions: agentOsOptionFieldSchemas.additionalInstructions,\n\t\tpermissions: agentOsOptionFieldSchemas.permissions,\n\t\tsidecar: sharedSidecarConfigSchema.optional(),\n\t\tlimits: agentOsOptionFieldSchemas.limits,\n\t})\n\t.strict();\n\n/**\n * RivetKit actor lifecycle/transport options forwarded to `actor({ options })`.\n *\n * Validated downstream by RivetKit's own actor config schema, so this stays a\n * permissive pass-through allow-list. `agentOs()` overlays the never-hit\n * defaults in `DEFAULT_AGENTOS_ACTOR_OPTIONS` (see actor.ts) and lets any value\n * here win, so callers can still tighten a bound when they want one.\n */\nexport const agentOsActorOptionsSchema = z\n\t.record(z.string(), z.unknown())\n\t.optional();\n\nexport const agentOsActorConfigSchema = z\n\t.object({\n\t\toptions: nativeAgentOsOptionsSchema.optional(),\n\t\tactorOptions: agentOsActorOptionsSchema,\n\t\tpreview: z\n\t\t\t.object({\n\t\t\t\tdefaultExpiresInSeconds: z.number().positive().default(3600),\n\t\t\t\tmaxExpiresInSeconds: z.number().positive().default(86400),\n\t\t\t})\n\t\t\t.strict()\n\t\t\t.prefault(() => ({})),\n\t\tonBeforeConnect: zFunction().optional(),\n\t\tonSessionEvent: zFunction().optional(),\n\t\tonPermissionRequest: zFunction().optional(),\n\t})\n\t.strict();\n\n// --- Typed config types (generic callbacks overlaid on the Zod schema) ---\n\n/**\n * Type mirror of `nativeAgentOsOptionsSchema`.\n *\n * Keep this in sync with the schema above and the Rust serde mirror at\n * `crates/agentos-actor-plugin/src/config.rs::AgentOsConfigJson`.\n */\nexport type NativeAgentOsOptions = Pick<\n\tAgentOsOptions,\n\t| \"software\"\n\t| \"defaultSoftware\"\n\t| \"loopbackExemptPorts\"\n\t| \"allowedNodeBuiltins\"\n\t| \"rootFilesystem\"\n\t| \"moduleAccessCwd\"\n\t| \"additionalInstructions\"\n\t| \"permissions\"\n\t| \"limits\"\n> & {\n\tmounts?: NativeMountConfig[];\n\tsidecar?: { kind: \"shared\"; pool?: string };\n};\n\ntype AgentOsActorContext<TConnParams> = ActorContext<\n\tAgentOsActorState,\n\tTConnParams,\n\tundefined,\n\tAgentOsActorVars,\n\tundefined,\n\tany\n>;\n\ninterface AgentOsActorConfigCallbacks<TConnParams> {\n\tonBeforeConnect?: (\n\t\tc: BeforeConnectContext<\n\t\t\tAgentOsActorState,\n\t\t\tAgentOsActorVars,\n\t\t\tundefined,\n\t\t\tany\n\t\t>,\n\t\tparams: TConnParams,\n\t) => void | Promise<void>;\n\tonSessionEvent?: (\n\t\tc: AgentOsActorContext<TConnParams>,\n\t\tsessionId: string,\n\t\tevent: JsonRpcNotification,\n\t) => void | Promise<void>;\n\tonPermissionRequest?: (\n\t\tc: AgentOsActorContext<TConnParams>,\n\t\tsessionId: string,\n\t\trequest: PermissionRequest,\n\t) => void | Promise<void>;\n}\n\n// Parsed config (after Zod defaults/transforms applied).\nexport type AgentOsActorConfig<TConnParams = undefined> = Omit<\n\tz.infer<typeof agentOsActorConfigSchema>,\n\t\"options\" | \"onBeforeConnect\" | \"onSessionEvent\" | \"onPermissionRequest\"\n> &\n\t{ options?: NativeAgentOsOptions } &\n\tAgentOsActorConfigCallbacks<TConnParams>;\n\n// Input config (what users pass in before Zod transforms).\nexport type AgentOsActorConfigInput<TConnParams = undefined> = Omit<\n\tz.input<typeof agentOsActorConfigSchema>,\n\t\"options\" | \"onBeforeConnect\" | \"onSessionEvent\" | \"onPermissionRequest\"\n> &\n\t{ options?: NativeAgentOsOptions } &\n\tAgentOsActorConfigCallbacks<TConnParams>;\n","// Platform-specific resolver for the prebuilt agent-os actor plugin cdylib\n// (`libagentos_actor_plugin.{so,dylib,dll}`). Mirrors the sidecar-binary\n// resolver (`@rivet-dev/agentos-sidecar`): the library ships inside one of the\n// `@rivet-dev/agentos-plugin-<platform>` packages, declared as\n// optionalDependencies so npm installs only the one matching the current\n// `os`/`cpu`/`libc` at install time (spec phase 6).\n//\n// Resolution priority:\n// 1. `AGENTOS_PLUGIN_BIN` env var (absolute path override).\n// 2. A cargo build output under the repo `target/{release,debug}/` (dev).\n// 3. The platform-specific `@rivet-dev/agentos-plugin-<platform>` package.\n\nimport { existsSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst PLUGIN_BIN_ENV = \"AGENTOS_PLUGIN_BIN\";\n\n/** The cdylib filename for the current platform. */\nfunction libraryName(): string {\n\tswitch (process.platform) {\n\t\tcase \"darwin\":\n\t\t\treturn \"libagentos_actor_plugin.dylib\";\n\t\tcase \"win32\":\n\t\t\treturn \"agentos_actor_plugin.dll\";\n\t\tdefault:\n\t\t\treturn \"libagentos_actor_plugin.so\";\n\t}\n}\n\nfunction getPlatformPackageName(): string | null {\n\tconst { platform, arch } = process;\n\tswitch (platform) {\n\t\tcase \"linux\":\n\t\t\tif (arch === \"x64\") return \"@rivet-dev/agentos-plugin-linux-x64-gnu\";\n\t\t\tif (arch === \"arm64\") return \"@rivet-dev/agentos-plugin-linux-arm64-gnu\";\n\t\t\tbreak;\n\t\tcase \"darwin\":\n\t\t\tif (arch === \"x64\") return \"@rivet-dev/agentos-plugin-darwin-x64\";\n\t\t\tif (arch === \"arm64\") return \"@rivet-dev/agentos-plugin-darwin-arm64\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\treturn null;\n}\n\n/**\n * Resolve the absolute path to the agent-os actor plugin cdylib. RivetKit\n * `dlopen`s this path through the generic native-plugin ABI.\n */\nexport function getPluginPath(): string {\n\tconst override = process.env[PLUGIN_BIN_ENV];\n\tif (override) {\n\t\tif (!existsSync(override)) {\n\t\t\tthrow new Error(\n\t\t\t\t`${PLUGIN_BIN_ENV} is set to ${override} but the file does not exist`,\n\t\t\t);\n\t\t}\n\t\treturn override;\n\t}\n\n\tconst lib = libraryName();\n\n\t// Dev: a cargo build output under the repo `target/`. `import.meta.url` is\n\t// `packages/agentos/dist/plugin-binary.js`, so the repo root is three levels up.\n\tconst here = dirname(fileURLToPath(import.meta.url));\n\tfor (const profile of [\"release\", \"debug\"]) {\n\t\tconst candidate = join(here, \"..\", \"..\", \"..\", \"target\", profile, lib);\n\t\tif (existsSync(candidate)) {\n\t\t\treturn candidate;\n\t\t}\n\t}\n\n\t// Prod: the platform-specific package.\n\tconst platformPkg = getPlatformPackageName();\n\tif (!platformPkg) {\n\t\tthrow new Error(\n\t\t\t`@rivet-dev/agentos: unsupported platform ${process.platform}/${process.arch}. ` +\n\t\t\t\t\"The Agent OS actor plugin currently supports linux and darwin on x64 and arm64. \" +\n\t\t\t\t`Set ${PLUGIN_BIN_ENV} to a local cdylib to override.`,\n\t\t);\n\t}\n\n\tconst require = createRequire(import.meta.url);\n\tlet pkgJsonPath: string;\n\ttry {\n\t\tpkgJsonPath = require.resolve(`${platformPkg}/package.json`);\n\t} catch {\n\t\tthrow new Error(\n\t\t\t`@rivet-dev/agentos: platform package ${platformPkg} is not installed.\\n` +\n\t\t\t\t\"This usually means the platform is unsupported or optionalDependencies\\n\" +\n\t\t\t\t`were skipped during install. Try: npm install --include=optional ${platformPkg}\\n` +\n\t\t\t\t`Or set ${PLUGIN_BIN_ENV} to a local cdylib, or build it with\\n` +\n\t\t\t\t\"`cargo build -p agentos-actor-plugin`.\",\n\t\t);\n\t}\n\n\treturn join(dirname(pkgJsonPath), lib);\n}\n","// Rust-backed agent-os actor surface (native actor plugin / cdylib).\n//\n// Only the `agentOs()` definition function, the config schema, the\n// `nodeModulesMount` helper, the plugin-path resolver, and the public domain\n// types are exported. All actor lifecycle + action dispatch live in the Rust\n// plugin (`crates/agentos-actor-plugin`), loaded by RivetKit via the generic\n// native-plugin ABI.\n\nimport type {\n\tAgentOsOptions,\n\tJsonRpcNotification,\n\tPermissionRequest,\n} from \"@rivet-dev/agentos-core\";\nimport {\n\ttype AgentOsActorDefinition,\n\tagentOs as createAgentOs,\n} from \"./actor.js\";\nimport type {\n\tAgentOsActorConfigInput,\n\tNativeAgentOsOptions,\n} from \"./config.js\";\n\nimport { setup as rivetkitSetup } from \"rivetkit\";\n\n// 512 MiB — large agent prompts/results cross the actor websocket transport as\n// single messages; RivetKit's registry-level defaults (maxIncomingMessageSize\n// 64 KiB, maxOutgoingMessageSize 1 MiB) truncate real payloads. Still a finite\n// bound per the limits-and-observability policy.\nconst AGENTOS_REGISTRY_MESSAGE_SIZE_DEFAULT = 512 * 1024 * 1024;\n\n/**\n * `setup()` wrapper that defaults the registry transport message-size caps to\n * never-hit-by-normal-use values for AgentOS apps, mirroring the per-actor crank\n * in `DEFAULT_AGENTOS_ACTOR_OPTIONS`. Any caller-supplied value wins, so an app\n * can still tighten the bound when it wants one.\n */\nexport const setup: typeof rivetkitSetup = ((\n\tinput: Parameters<typeof rivetkitSetup>[0],\n) =>\n\trivetkitSetup({\n\t\tmaxIncomingMessageSize: AGENTOS_REGISTRY_MESSAGE_SIZE_DEFAULT,\n\t\tmaxOutgoingMessageSize: AGENTOS_REGISTRY_MESSAGE_SIZE_DEFAULT,\n\t\t...input,\n\t})) as typeof rivetkitSetup;\n\nexport {\n\tbuildConfigJson,\n\ttype NodeModulesMountConfig,\n\tnodeModulesMount,\n} from \"./actor.js\";\nexport {\n\ttype AgentOsActorConfig,\n\ttype AgentOsActorConfigInput,\n\ttype NativeAgentOsOptions,\n\tagentOsActorConfigSchema,\n\tnativeAgentOsOptionsSchema,\n} from \"./config.js\";\nexport { getPluginPath } from \"./plugin-binary.js\";\n\n// Re-export the software-definition helper so custom agents/tools/commands can\n// be defined without importing @rivet-dev/agentos-core directly.\nexport { defineSoftware } from \"@rivet-dev/agentos-core\";\n\nexport type {\n\tAgentOsActionContext,\n\tAgentOsActorState,\n\tAgentOsActorVars,\n\tAgentOsEvents,\n\tCronEventPayload,\n\tPermissionRequestPayload,\n\tPersistedSessionEvent,\n\tPersistedSessionRecord,\n\tProcessExitPayload,\n\tProcessOutputPayload,\n\tPromptResult,\n\tSerializableCronAction,\n\tSerializableCronJobInfo,\n\tSerializableCronJobOptions,\n\tSessionEventPayload,\n\tSessionRecord,\n\tShellDataPayload,\n\tVmBootedPayload,\n\tVmShutdownPayload,\n} from \"./types.js\";\nexport type {\n\tAgentOsActions,\n\tCreateSessionOptions,\n\tDirEntry,\n\tReadFileResult,\n\tScheduledCronJob,\n\tSignedPreviewUrl,\n\tSpawnedProcess,\n\tVmFetchOptions,\n\tVmFetchResponse,\n\tWriteFileResult,\n} from \"./actor-actions.js\";\nexport { createAgentOs as agentOs };\n\nexport type AgentOSActorConfigInput<TConnParams = undefined> =\n\tNativeAgentOsOptions &\n\t\tOmit<AgentOsActorConfigInput<TConnParams>, \"options\">;\n\nexport type AgentOSConfigInput<TConnParams = undefined> = AgentOsOptions & {\n\tpreview?: AgentOsActorConfigInput<TConnParams>[\"preview\"];\n\tonBeforeConnect?: AgentOsActorConfigInput<TConnParams>[\"onBeforeConnect\"];\n\tonSessionEvent?: (\n\t\tsessionId: string,\n\t\tevent: JsonRpcNotification,\n\t) => void | Promise<void>;\n\tonPermissionRequest?: (\n\t\tsessionId: string,\n\t\trequest: PermissionRequest,\n\t) => void | Promise<void>;\n};\n\nexport function agentOS<TConnParams = undefined>(\n\tconfig: AgentOSConfigInput<TConnParams> = {},\n): AgentOsActorDefinition<TConnParams> {\n\tconst {\n\t\tpreview,\n\t\tonBeforeConnect,\n\t\tonSessionEvent,\n\t\tonPermissionRequest,\n\t\t...options\n\t} = config;\n\n\treturn createAgentOs({\n\t\toptions,\n\t\tpreview,\n\t\tonBeforeConnect,\n\t\tonSessionEvent: onSessionEvent\n\t\t\t? (_ctx, sessionId, event) => onSessionEvent(sessionId, event)\n\t\t\t: undefined,\n\t\tonPermissionRequest: onPermissionRequest\n\t\t\t? (_ctx, sessionId, request) => onPermissionRequest(sessionId, request)\n\t\t\t: undefined,\n\t} as AgentOsActorConfigInput<TConnParams>);\n}\n"],"mappings":";AAYA,SAAS,WAAW;AACpB,OAAO,YAAY;AACnB,SAAS,sBAAsB;AAC/B;AAAA,EACC;AAAA,OAOM;;;ACjBP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEP,SAAS,SAAS;AAGlB,IAAM,YAAY,MAEX,EAAE,OAAU,CAAC,QAAQ,OAAO,QAAQ,UAAU;AAE9C,IAAM,6BAA6B,EAIxC,OAAO;AAAA,EACP,UAAU,0BAA0B;AAAA,EACpC,iBAAiB,0BAA0B;AAAA,EAC3C,qBAAqB,0BAA0B;AAAA,EAC/C,qBAAqB,0BAA0B;AAAA,EAC/C,gBAAgB,0BAA0B;AAAA,EAC1C,QAAQ,EAAE,MAAM,uBAAuB,EAAE,SAAS;AAAA,EAClD,iBAAiB,0BAA0B;AAAA,EAC3C,wBAAwB,0BAA0B;AAAA,EAClD,aAAa,0BAA0B;AAAA,EACvC,SAAS,0BAA0B,SAAS;AAAA,EAC5C,QAAQ,0BAA0B;AACnC,CAAC,EACA,OAAO;AAUF,IAAM,4BAA4B,EACvC,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,EAC9B,SAAS;AAEJ,IAAM,2BAA2B,EACtC,OAAO;AAAA,EACP,SAAS,2BAA2B,SAAS;AAAA,EAC7C,cAAc;AAAA,EACd,SAAS,EACP,OAAO;AAAA,IACP,yBAAyB,EAAE,OAAO,EA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AC3D;AAAA,IACH,qBAAqB,sBAClB,CAAC,MAAM,WAAW,YAAY,oBAAoB,WAAW,OAAO,IACpE;AAAA,EACJ,CAAyC;AAC1C;","names":["require"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivet-dev/agentos",
|
|
3
|
-
"version": "0.0.0-nathan-
|
|
3
|
+
"version": "0.0.0-nathan-agentos-package-resolution.4347e69",
|
|
4
4
|
"description": "Agent OS actor for RivetKit - thin TS forwarder that loads the native actor plugin via RivetKit's native-plugin ABI.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"test": "vitest run"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@agentos-software/common": "0.
|
|
55
|
-
"@rivet-dev/agentos-core": "0.0.0-nathan-
|
|
56
|
-
"@rivet-dev/agentos-sidecar": "0.0.0-nathan-
|
|
54
|
+
"@agentos-software/common": "0.0.0-nathan-agentos-package-resolution.efc374f",
|
|
55
|
+
"@rivet-dev/agentos-core": "0.0.0-nathan-agentos-package-resolution.4347e69",
|
|
56
|
+
"@rivet-dev/agentos-sidecar": "0.0.0-nathan-agentos-package-resolution.4347e69",
|
|
57
57
|
"@rivetkit/react": "0.0.0-feat-dylib-actor-plugin.c44621f",
|
|
58
58
|
"rivetkit": "0.0.0-feat-dylib-actor-plugin.c44621f",
|
|
59
59
|
"zod": "^4.1.11"
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
"vitest": "^2.1.8"
|
|
78
78
|
},
|
|
79
79
|
"optionalDependencies": {
|
|
80
|
-
"@rivet-dev/agentos-plugin-darwin-arm64": "0.0.0-nathan-
|
|
81
|
-
"@rivet-dev/agentos-plugin-darwin-x64": "0.0.0-nathan-
|
|
82
|
-
"@rivet-dev/agentos-plugin-linux-arm64-gnu": "0.0.0-nathan-
|
|
83
|
-
"@rivet-dev/agentos-plugin-linux-x64-gnu": "0.0.0-nathan-
|
|
80
|
+
"@rivet-dev/agentos-plugin-darwin-arm64": "0.0.0-nathan-agentos-package-resolution.4347e69",
|
|
81
|
+
"@rivet-dev/agentos-plugin-darwin-x64": "0.0.0-nathan-agentos-package-resolution.4347e69",
|
|
82
|
+
"@rivet-dev/agentos-plugin-linux-arm64-gnu": "0.0.0-nathan-agentos-package-resolution.4347e69",
|
|
83
|
+
"@rivet-dev/agentos-plugin-linux-x64-gnu": "0.0.0-nathan-agentos-package-resolution.4347e69"
|
|
84
84
|
}
|
|
85
85
|
}
|