@rivet-dev/agentos 0.0.0-feat-on-limit-warning.62a2bc2 → 0.0.0-glibc.928bc3a

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 CHANGED
@@ -1,7 +1,6 @@
1
- import { ActionContext, BeforeConnectContext, ActorContext, ActorDefinition, DatabaseProvider, RawAccess } from 'rivetkit';
2
- export { setup } from 'rivetkit';
3
- import { AgentOs, JsonRpcNotification, PermissionRequest, CronEvent, AgentCapabilities, AgentInfo, JsonRpcResponse, AgentOsOptions, NativeMountConfig } from '@rivet-dev/agentos-core';
1
+ import { AgentExitEvent, AgentOs, JsonRpcResponse, JsonRpcNotification, PermissionRequest, AgentCapabilities, AgentInfo, AgentOsOptions, NativeMountConfig, VirtualStat, ExecResult, SpawnedProcessInfo, ProcessInfo, ProcessTreeNode, PermissionReply } from '@rivet-dev/agentos-core';
4
2
  export { defineSoftware } from '@rivet-dev/agentos-core';
3
+ import { ActionContext, BeforeConnectContext, ActorContext, ActorDefinition, DatabaseProvider, RawAccess, setup as setup$1 } from 'rivetkit';
5
4
  import { z } from 'zod/v4';
6
5
 
7
6
  type AgentOsActorState = {};
@@ -21,6 +20,10 @@ interface PermissionRequestPayload {
21
20
  sessionId: string;
22
21
  request: PermissionRequest;
23
22
  }
23
+ interface AgentCrashedPayload {
24
+ sessionId: string;
25
+ event: AgentExitEvent;
26
+ }
24
27
  type VmBootedPayload = Record<string, never>;
25
28
  interface VmShutdownPayload {
26
29
  reason: "sleep" | "destroy" | "error";
@@ -38,17 +41,41 @@ interface ShellDataPayload {
38
41
  shellId: string;
39
42
  data: Uint8Array;
40
43
  }
44
+ interface ShellExitPayload {
45
+ shellId: string;
46
+ exitCode: number;
47
+ }
48
+ type SerializableCronEvent = {
49
+ type: "cron:fire";
50
+ jobId: string;
51
+ time: number;
52
+ } | {
53
+ type: "cron:complete";
54
+ jobId: string;
55
+ time: number;
56
+ durationMs: number;
57
+ } | {
58
+ type: "cron:error";
59
+ jobId: string;
60
+ time: number;
61
+ error: string;
62
+ };
41
63
  interface CronEventPayload {
42
- event: CronEvent;
64
+ event: SerializableCronEvent;
43
65
  }
44
66
  interface AgentOsEvents {
45
67
  sessionEvent: SessionEventPayload;
46
68
  permissionRequest: PermissionRequestPayload;
69
+ agentCrashed: AgentCrashedPayload;
47
70
  vmBooted: VmBootedPayload;
48
71
  vmShutdown: VmShutdownPayload;
49
72
  processOutput: ProcessOutputPayload;
50
73
  processExit: ProcessExitPayload;
51
74
  shellData: ShellDataPayload;
75
+ /** Shell stderr (the dedicated channel backing the TS `onStderr` option). */
76
+ shellStderr: ShellDataPayload;
77
+ /** Shell process exit (mirrors `waitShell` resolution). */
78
+ shellExit: ShellExitPayload;
52
79
  cronEvent: CronEventPayload;
53
80
  }
54
81
  /** Result from sendPrompt. */
@@ -67,9 +94,8 @@ interface SessionRecord {
67
94
  interface PersistedSessionRecord {
68
95
  sessionId: string;
69
96
  agentType: string;
70
- capabilities: AgentCapabilities;
71
- agentInfo: AgentInfo | null;
72
97
  createdAt: number;
98
+ status: "running" | "idle";
73
99
  }
74
100
  interface PersistedSessionEvent {
75
101
  sessionId: string;
@@ -96,12 +122,9 @@ interface SerializableCronJobOptions {
96
122
  interface SerializableCronJobInfo {
97
123
  id: string;
98
124
  schedule: string;
99
- action: SerializableCronAction;
100
125
  overlap: "allow" | "skip" | "queue";
101
- lastRun?: string;
102
- nextRun?: string;
103
- runCount: number;
104
- running: boolean;
126
+ lastRun?: number;
127
+ nextRun?: number;
105
128
  }
106
129
  type AgentOsActionContext<TConnParams = undefined> = ActionContext<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, any>;
107
130
 
@@ -125,7 +148,6 @@ declare const nativeAgentOsOptionsSchema: z.ZodObject<{
125
148
  }, z.core.$strict>]>>>;
126
149
  }, z.core.$strict>>;
127
150
  mounts: z.ZodOptional<z.ZodArray<z.ZodType<NativeMountConfig, unknown, z.core.$ZodTypeInternals<NativeMountConfig, unknown>>>>;
128
- moduleAccessCwd: z.ZodOptional<z.ZodString>;
129
151
  additionalInstructions: z.ZodOptional<z.ZodString>;
130
152
  permissions: z.ZodOptional<z.ZodObject<{
131
153
  fs: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
@@ -213,7 +235,7 @@ declare const nativeAgentOsOptionsSchema: z.ZodObject<{
213
235
  patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
214
236
  }, z.core.$strict>>;
215
237
  }, z.core.$strict>]>>;
216
- tool: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
238
+ binding: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
217
239
  allow: "allow";
218
240
  deny: "deny";
219
241
  }>, z.ZodObject<{
@@ -281,6 +303,10 @@ declare const nativeAgentOsOptionsSchema: z.ZodObject<{
281
303
  }, z.core.$strict>>;
282
304
  jsRuntime: z.ZodOptional<z.ZodObject<{
283
305
  v8HeapLimitMb: z.ZodOptional<z.ZodNumber>;
306
+ syncRpcWaitTimeoutMs: z.ZodOptional<z.ZodNumber>;
307
+ cpuTimeLimitMs: z.ZodOptional<z.ZodNumber>;
308
+ wallClockLimitMs: z.ZodOptional<z.ZodNumber>;
309
+ importCacheMaterializeTimeoutMs: z.ZodOptional<z.ZodNumber>;
284
310
  capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
285
311
  stdinBufferLimitBytes: z.ZodOptional<z.ZodNumber>;
286
312
  eventPayloadLimitBytes: z.ZodOptional<z.ZodNumber>;
@@ -289,12 +315,15 @@ declare const nativeAgentOsOptionsSchema: z.ZodObject<{
289
315
  python: z.ZodOptional<z.ZodObject<{
290
316
  outputBufferMaxBytes: z.ZodOptional<z.ZodNumber>;
291
317
  executionTimeoutMs: z.ZodOptional<z.ZodNumber>;
318
+ maxOldSpaceMb: z.ZodOptional<z.ZodNumber>;
292
319
  vfsRpcTimeoutMs: z.ZodOptional<z.ZodNumber>;
293
320
  }, z.core.$strict>>;
294
321
  wasm: z.ZodOptional<z.ZodObject<{
295
322
  maxModuleFileBytes: z.ZodOptional<z.ZodNumber>;
296
323
  capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
297
324
  syncReadLimitBytes: z.ZodOptional<z.ZodNumber>;
325
+ prewarmTimeoutMs: z.ZodOptional<z.ZodNumber>;
326
+ runnerHeapLimitMb: z.ZodOptional<z.ZodNumber>;
298
327
  }, z.core.$strict>>;
299
328
  }, z.core.$strict>>;
300
329
  }, z.core.$strict>;
@@ -319,7 +348,6 @@ declare const agentOsActorConfigSchema: z.ZodObject<{
319
348
  }, z.core.$strict>]>>>;
320
349
  }, z.core.$strict>>;
321
350
  mounts: z.ZodOptional<z.ZodArray<z.ZodType<NativeMountConfig, unknown, z.core.$ZodTypeInternals<NativeMountConfig, unknown>>>>;
322
- moduleAccessCwd: z.ZodOptional<z.ZodString>;
323
351
  additionalInstructions: z.ZodOptional<z.ZodString>;
324
352
  permissions: z.ZodOptional<z.ZodObject<{
325
353
  fs: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
@@ -407,7 +435,7 @@ declare const agentOsActorConfigSchema: z.ZodObject<{
407
435
  patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
408
436
  }, z.core.$strict>>;
409
437
  }, z.core.$strict>]>>;
410
- tool: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
438
+ binding: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
411
439
  allow: "allow";
412
440
  deny: "deny";
413
441
  }>, z.ZodObject<{
@@ -475,6 +503,10 @@ declare const agentOsActorConfigSchema: z.ZodObject<{
475
503
  }, z.core.$strict>>;
476
504
  jsRuntime: z.ZodOptional<z.ZodObject<{
477
505
  v8HeapLimitMb: z.ZodOptional<z.ZodNumber>;
506
+ syncRpcWaitTimeoutMs: z.ZodOptional<z.ZodNumber>;
507
+ cpuTimeLimitMs: z.ZodOptional<z.ZodNumber>;
508
+ wallClockLimitMs: z.ZodOptional<z.ZodNumber>;
509
+ importCacheMaterializeTimeoutMs: z.ZodOptional<z.ZodNumber>;
478
510
  capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
479
511
  stdinBufferLimitBytes: z.ZodOptional<z.ZodNumber>;
480
512
  eventPayloadLimitBytes: z.ZodOptional<z.ZodNumber>;
@@ -483,15 +515,19 @@ declare const agentOsActorConfigSchema: z.ZodObject<{
483
515
  python: z.ZodOptional<z.ZodObject<{
484
516
  outputBufferMaxBytes: z.ZodOptional<z.ZodNumber>;
485
517
  executionTimeoutMs: z.ZodOptional<z.ZodNumber>;
518
+ maxOldSpaceMb: z.ZodOptional<z.ZodNumber>;
486
519
  vfsRpcTimeoutMs: z.ZodOptional<z.ZodNumber>;
487
520
  }, z.core.$strict>>;
488
521
  wasm: z.ZodOptional<z.ZodObject<{
489
522
  maxModuleFileBytes: z.ZodOptional<z.ZodNumber>;
490
523
  capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
491
524
  syncReadLimitBytes: z.ZodOptional<z.ZodNumber>;
525
+ prewarmTimeoutMs: z.ZodOptional<z.ZodNumber>;
526
+ runnerHeapLimitMb: z.ZodOptional<z.ZodNumber>;
492
527
  }, z.core.$strict>>;
493
528
  }, z.core.$strict>>;
494
529
  }, z.core.$strict>>;
530
+ actorOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
495
531
  preview: z.ZodPrefault<z.ZodObject<{
496
532
  defaultExpiresInSeconds: z.ZodDefault<z.ZodNumber>;
497
533
  maxExpiresInSeconds: z.ZodDefault<z.ZodNumber>;
@@ -506,7 +542,7 @@ declare const agentOsActorConfigSchema: z.ZodObject<{
506
542
  * Keep this in sync with the schema above and the Rust serde mirror at
507
543
  * `crates/agentos-actor-plugin/src/config.rs::AgentOsConfigJson`.
508
544
  */
509
- type NativeAgentOsOptions = Pick<AgentOsOptions, "software" | "defaultSoftware" | "loopbackExemptPorts" | "allowedNodeBuiltins" | "rootFilesystem" | "moduleAccessCwd" | "additionalInstructions" | "permissions" | "limits"> & {
545
+ type NativeAgentOsOptions = Pick<AgentOsOptions, "software" | "defaultSoftware" | "loopbackExemptPorts" | "allowedNodeBuiltins" | "rootFilesystem" | "additionalInstructions" | "permissions" | "limits"> & {
510
546
  mounts?: NativeMountConfig[];
511
547
  sidecar?: {
512
548
  kind: "shared";
@@ -527,7 +563,182 @@ type AgentOsActorConfigInput<TConnParams = undefined> = Omit<z.input<typeof agen
527
563
  } & AgentOsActorConfigCallbacks<TConnParams>;
528
564
 
529
565
  /**
530
- * Rust-backed `agentOs(...)` definition.
566
+ * Typed action surface for the agentOS VM actor.
567
+ *
568
+ * ⚠️ SOURCE OF TRUTH / KEEP IN SYNC ⚠️
569
+ * The actual dispatch is implemented in Rust at
570
+ * crates/agentos-actor-plugin/src/actions/mod.rs (fn `dispatch`)
571
+ * This interface MUST mirror that match statement one-to-one: every `"name" =>`
572
+ * arm there needs a corresponding method here with matching positional args and
573
+ * the serialized return type. When you add/rename/retype an action in
574
+ * `mod.rs`, update this interface in the same change (and vice-versa).
575
+ *
576
+ * RivetKit turns each `(ctx, ...args) => Promise<R>` entry into a client handle
577
+ * method `(...args) => Promise<R>` (it strips the leading context arg). Wiring
578
+ * this as the actions type param of `AgentOsActorDefinition` is what makes
579
+ * `createClient<typeof registry>()` return a fully-typed handle instead of the
580
+ * old `any`/`unknown` surface.
581
+ */
582
+
583
+ /** The leading actor context arg; stripped from the client-facing method. */
584
+ type Ctx = any;
585
+ /** Directory entry returned by `readdir` / `readdirRecursive`. */
586
+ interface DirEntry {
587
+ path: string;
588
+ type: "file" | "directory" | "symlink";
589
+ size: number;
590
+ }
591
+ /** Raw `readdirEntries` entry — one typed child in a single round-trip. */
592
+ interface ReaddirEntry {
593
+ name: string;
594
+ isDirectory: boolean;
595
+ isSymbolicLink: boolean;
596
+ }
597
+ /** A process started via `spawn` (mirrors the Rust spawn handle DTO). */
598
+ interface SpawnedProcess {
599
+ pid: number;
600
+ }
601
+ /** Options accepted by `exec` (mirrors the env/cwd subset of `ExecOptions`). */
602
+ interface ExecActionOptions {
603
+ env?: Record<string, string>;
604
+ cwd?: string;
605
+ }
606
+ /** Options accepted by `spawn` (mirrors `SpawnActionOptions`). */
607
+ interface SpawnActionOptions {
608
+ env?: Record<string, string>;
609
+ cwd?: string;
610
+ streamStdin?: boolean;
611
+ }
612
+ /** Handle returned by `scheduleCron` (mirrors `ScheduledCronDto`). */
613
+ interface ScheduledCronJob {
614
+ id: string;
615
+ }
616
+ /** Options accepted by `vmFetch` (mirrors the Rust `FetchOptions`). */
617
+ interface VmFetchOptions {
618
+ method?: string;
619
+ headers?: Record<string, string>;
620
+ body?: string | Uint8Array;
621
+ }
622
+ /** Response from `vmFetch` (mirrors `FetchResponseDto`). */
623
+ interface VmFetchResponse {
624
+ status: number;
625
+ statusText: string;
626
+ headers: Record<string, string>;
627
+ body: Uint8Array;
628
+ }
629
+ /** Options accepted by `createSession` (mirrors `CreateSessionOptionsDto`). */
630
+ interface CreateSessionOptions {
631
+ cwd?: string;
632
+ env?: Record<string, string>;
633
+ skipOsInstructions?: boolean;
634
+ additionalInstructions?: string;
635
+ }
636
+ /** Result of `createSignedPreviewUrl` (mirrors `SignedPreviewUrlDto`). */
637
+ interface SignedPreviewUrl {
638
+ path: string;
639
+ token: string;
640
+ port: number;
641
+ expiresAt: number;
642
+ }
643
+ /** Options accepted by `openShell` (mirrors `OpenShellActionOptions`). */
644
+ interface OpenShellActionOptions {
645
+ command?: string;
646
+ args?: string[];
647
+ env?: Record<string, string>;
648
+ cwd?: string;
649
+ cols?: number;
650
+ rows?: number;
651
+ }
652
+ /** Handle returned by `openShell` (mirrors `OpenShellDto`). */
653
+ interface OpenShellResult {
654
+ shellId: string;
655
+ }
656
+ /** Per-entry result of the batch `writeFiles` / `readFiles` actions. */
657
+ interface WriteFileResult {
658
+ path: string;
659
+ ok: boolean;
660
+ error?: string;
661
+ }
662
+ interface ReadFileResult {
663
+ path: string;
664
+ content?: Uint8Array;
665
+ error?: string;
666
+ }
667
+ /** One configured mount, returned by `listMounts`. Mirrors `MountInfoDto`. */
668
+ interface MountInfo {
669
+ path: string;
670
+ /** Native mount plugin id. */
671
+ kind: "host_dir" | "s3" | "google_drive" | "sandbox_agent";
672
+ /** Provider-specific config detail (null when the plugin carries none). */
673
+ config: unknown;
674
+ readOnly: boolean;
675
+ }
676
+ /** One configured software package, returned by `listSoftware`. Mirrors `SoftwareInfoDto`. */
677
+ interface SoftwareInfo {
678
+ package: string;
679
+ /** Kebab-case `SoftwareKind` tag. */
680
+ kind: "wasm-commands" | "agent" | "tool";
681
+ version: string | null;
682
+ commands: string[];
683
+ }
684
+ /**
685
+ * The agentOS VM actor's action map. Keep one method per Rust `dispatch` arm.
686
+ *
687
+ * Declared as a `type` (not `interface`) so it satisfies RivetKit's
688
+ * `Actions<…>` constraint, which expects an implicit string index signature.
689
+ */
690
+ type AgentOsActions = {
691
+ readFile: (c: Ctx, path: string) => Promise<Uint8Array>;
692
+ writeFile: (c: Ctx, path: string, content: string | Uint8Array) => Promise<void>;
693
+ stat: (c: Ctx, path: string) => Promise<VirtualStat>;
694
+ mkdir: (c: Ctx, path: string) => Promise<void>;
695
+ readdir: (c: Ctx, path: string) => Promise<string[]>;
696
+ readdirEntries: (c: Ctx, path: string) => Promise<ReaddirEntry[] | null>;
697
+ exists: (c: Ctx, path: string) => Promise<boolean>;
698
+ move: (c: Ctx, from: string, to: string) => Promise<void>;
699
+ deleteFile: (c: Ctx, path: string, options?: {
700
+ recursive?: boolean;
701
+ }) => Promise<void>;
702
+ writeFiles: (c: Ctx, entries: {
703
+ path: string;
704
+ content: string | Uint8Array;
705
+ }[]) => Promise<WriteFileResult[]>;
706
+ readFiles: (c: Ctx, paths: string[]) => Promise<ReadFileResult[]>;
707
+ readdirRecursive: (c: Ctx, path: string) => Promise<DirEntry[]>;
708
+ exec: (c: Ctx, command: string, options?: ExecActionOptions) => Promise<ExecResult>;
709
+ spawn: (c: Ctx, command: string, args: string[], options?: SpawnActionOptions) => Promise<SpawnedProcess>;
710
+ waitProcess: (c: Ctx, pid: number) => Promise<number>;
711
+ killProcess: (c: Ctx, pid: number) => Promise<void>;
712
+ stopProcess: (c: Ctx, pid: number) => Promise<void>;
713
+ listProcesses: (c: Ctx) => Promise<SpawnedProcessInfo[]>;
714
+ allProcesses: (c: Ctx) => Promise<ProcessInfo[]>;
715
+ processTree: (c: Ctx) => Promise<ProcessTreeNode[]>;
716
+ getProcess: (c: Ctx, pid: number) => Promise<SpawnedProcessInfo>;
717
+ writeProcessStdin: (c: Ctx, pid: number, data: string | Uint8Array) => Promise<void>;
718
+ closeProcessStdin: (c: Ctx, pid: number) => Promise<void>;
719
+ openShell: (c: Ctx, options?: OpenShellActionOptions) => Promise<OpenShellResult>;
720
+ writeShell: (c: Ctx, shellId: string, data: string | Uint8Array) => Promise<void>;
721
+ resizeShell: (c: Ctx, shellId: string, cols: number, rows: number) => Promise<void>;
722
+ closeShell: (c: Ctx, shellId: string) => Promise<void>;
723
+ waitShell: (c: Ctx, shellId: string) => Promise<number>;
724
+ vmFetch: (c: Ctx, port: number, url: string, options?: VmFetchOptions) => Promise<VmFetchResponse>;
725
+ scheduleCron: (c: Ctx, options: SerializableCronJobOptions) => Promise<ScheduledCronJob>;
726
+ listCronJobs: (c: Ctx) => Promise<SerializableCronJobInfo[]>;
727
+ cancelCronJob: (c: Ctx, id: string) => Promise<void>;
728
+ createSession: (c: Ctx, agentType: string, options?: CreateSessionOptions) => Promise<string>;
729
+ sendPrompt: (c: Ctx, sessionId: string, text: string) => Promise<PromptResult>;
730
+ closeSession: (c: Ctx, sessionId: string) => Promise<void>;
731
+ listPersistedSessions: (c: Ctx) => Promise<PersistedSessionRecord[]>;
732
+ getSessionEvents: (c: Ctx, sessionId: string) => Promise<PersistedSessionEvent[]>;
733
+ respondPermission: (c: Ctx, sessionId: string, permissionId: string, reply: PermissionReply) => Promise<void>;
734
+ createSignedPreviewUrl: (c: Ctx, port: number, ttlSeconds: number) => Promise<SignedPreviewUrl>;
735
+ expireSignedPreviewUrl: (c: Ctx, token: string) => Promise<void>;
736
+ listMounts: (c: Ctx) => Promise<MountInfo[]>;
737
+ listSoftware: (c: Ctx) => Promise<SoftwareInfo[]>;
738
+ };
739
+
740
+ /**
741
+ * Rust-backed `agentOS(...)` definition.
531
742
  *
532
743
  * Produces an `ActorDefinition` whose `nativeFactoryBuilder` constructs a
533
744
  * native-actor-plugin factory through `runtime.createNativePluginFactory(...)`
@@ -540,7 +751,7 @@ type AgentOsActorConfigInput<TConnParams = undefined> = Omit<z.input<typeof agen
540
751
 
541
752
  /**
542
753
  * A native `host_dir` mount of a host `node_modules` directory at
543
- * `/root/node_modules`, the serializable form `agentOs({ options: { mounts } })`
754
+ * `/root/node_modules`, the serializable form `agentOS({ options: { mounts } })`
544
755
  * accepts across the NAPI boundary.
545
756
  */
546
757
  interface NodeModulesMountConfig {
@@ -570,12 +781,14 @@ declare function nodeModulesMount(hostNodeModulesDir: string, opts?: {
570
781
  }): NodeModulesMountConfig;
571
782
  declare function buildConfigJson<TConnParams>(parsed: AgentOsActorConfig<TConnParams>): string;
572
783
  /**
573
- * Type alias for the `agentOs(...)` return type. Events are not typed at the
574
- * TS surface because the Rust plugin owns the broadcast set and the
575
- * test/client surface uses `any` for actions.
784
+ * Type alias for the `agentOS(...)` return type. Events are not typed at the TS
785
+ * surface because the Rust plugin owns the broadcast set, but the ACTIONS are
786
+ * typed via {@link AgentOsActions} — a TS mirror of the Rust dispatch in
787
+ * `crates/agentos-actor-plugin/src/actions/mod.rs`. That is what gives
788
+ * `createClient<typeof registry>()` a fully-typed handle (e.g. `handle.exec()`
789
+ * returns `ExecResult`, not `unknown`). Keep the two in sync.
576
790
  */
577
- type AgentOsActorDefinition<TConnParams> = ActorDefinition<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, DatabaseProvider<RawAccess>, Record<never, never>, Record<never, never>, any>;
578
- declare function agentOs<TConnParams = undefined>(config: AgentOsActorConfigInput<TConnParams>): AgentOsActorDefinition<TConnParams>;
791
+ type AgentOsActorDefinition<TConnParams> = ActorDefinition<AgentOsActorState, TConnParams, undefined, AgentOsActorVars, undefined, DatabaseProvider<RawAccess>, Record<never, never>, Record<never, never>, AgentOsActions>;
579
792
 
580
793
  /**
581
794
  * Resolve the absolute path to the agent-os actor plugin cdylib. RivetKit
@@ -583,7 +796,21 @@ declare function agentOs<TConnParams = undefined>(config: AgentOsActorConfigInpu
583
796
  */
584
797
  declare function getPluginPath(): string;
585
798
 
799
+ /**
800
+ * `setup()` wrapper that defaults the registry transport message-size caps to
801
+ * never-hit-by-normal-use values for AgentOS apps, mirroring the per-actor crank
802
+ * in `DEFAULT_AGENTOS_ACTOR_OPTIONS`. Any caller-supplied value wins, so an app
803
+ * can still tighten the bound when it wants one.
804
+ */
805
+ declare const setup: typeof setup$1;
806
+
586
807
  type AgentOSActorConfigInput<TConnParams = undefined> = NativeAgentOsOptions & Omit<AgentOsActorConfigInput<TConnParams>, "options">;
587
- declare function agentOS<TConnParams = undefined>(config?: AgentOSActorConfigInput<TConnParams>): AgentOsActorDefinition<TConnParams>;
808
+ type AgentOSConfigInput<TConnParams = undefined> = AgentOsOptions & {
809
+ preview?: AgentOsActorConfigInput<TConnParams>["preview"];
810
+ onBeforeConnect?: AgentOsActorConfigInput<TConnParams>["onBeforeConnect"];
811
+ onSessionEvent?: (sessionId: string, event: JsonRpcNotification) => void | Promise<void>;
812
+ onPermissionRequest?: (sessionId: string, request: PermissionRequest) => void | Promise<void>;
813
+ };
814
+ declare function agentOS<TConnParams = undefined>(config?: AgentOSConfigInput<TConnParams>): AgentOsActorDefinition<TConnParams>;
588
815
 
589
- export { type AgentOSActorConfigInput, type AgentOsActionContext, type AgentOsActorConfig, type AgentOsActorConfigInput, type AgentOsActorState, type AgentOsActorVars, type AgentOsEvents, type CronEventPayload, type NativeAgentOsOptions, 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, nativeAgentOsOptionsSchema, nodeModulesMount };
816
+ export { type AgentCrashedPayload, type AgentOSActorConfigInput, type AgentOSConfigInput, type AgentOsActionContext, type AgentOsActions, type AgentOsActorConfig, type AgentOsActorConfigInput, type AgentOsActorState, type AgentOsActorVars, type AgentOsEvents, type CreateSessionOptions, type CronEventPayload, type DirEntry, type NativeAgentOsOptions, type NodeModulesMountConfig, type PermissionRequestPayload, type PersistedSessionEvent, type PersistedSessionRecord, type ProcessExitPayload, type ProcessOutputPayload, type PromptResult, type ReadFileResult, type ScheduledCronJob, type SerializableCronAction, type SerializableCronEvent, type SerializableCronJobInfo, type SerializableCronJobOptions, type SessionEventPayload, type SessionRecord, type ShellDataPayload, type SignedPreviewUrl, type SpawnedProcess, type VmBootedPayload, type VmFetchOptions, type VmFetchResponse, type VmShutdownPayload, type WriteFileResult, agentOS, agentOsActorConfigSchema, buildConfigJson, getPluginPath, nativeAgentOsOptionsSchema, nodeModulesMount, setup };