@rivet-dev/agentos-core 0.0.0-codex-agentos-native-platform-e2e.78ef941 → 0.0.0-feat-on-limit-warning.62a2bc2

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.
@@ -198,6 +198,33 @@ export interface AgentStderrEvent {
198
198
  chunk: Uint8Array;
199
199
  }
200
200
  export type AgentStderrHandler = (event: AgentStderrEvent) => void;
201
+ /**
202
+ * A near-capacity warning for one bounded limit (a queue/buffer, a saturating
203
+ * resource cap, or a memory envelope) inside the VM runtime. Delivered the moment
204
+ * usage crosses the runtime's warning threshold (~80%), once per crossing — the
205
+ * runtime applies edge-triggering + hysteresis, so this never spams.
206
+ */
207
+ export interface LimitWarning {
208
+ /** Stable limit name, e.g. `"v8_event_channel"` or `"vm_open_fds"`. */
209
+ limit: string;
210
+ /** Limit class: `"queue"`, `"resource"`, or `"memory"`. */
211
+ category: string;
212
+ /** Current observed usage. */
213
+ observed: number;
214
+ /** Configured capacity. */
215
+ capacity: number;
216
+ /** Observed fill as a percentage of capacity (0–100). */
217
+ fillPercent: number;
218
+ }
219
+ export type LimitWarningHandler = (warning: LimitWarning) => void;
220
+ /**
221
+ * Public core VM options.
222
+ *
223
+ * Keep this interface in sync with
224
+ * `packages/core/src/options-schema.ts::agentOsOptionsSchema`. The Rivet
225
+ * native actor intentionally accepts only a subset via
226
+ * `packages/agentos/src/config.ts::nativeAgentOsOptionsSchema`.
227
+ */
201
228
  export interface AgentOsOptions {
202
229
  /**
203
230
  * Software to install in the VM. Each entry provides agents, tools,
@@ -259,6 +286,12 @@ export interface AgentOsOptions {
259
286
  * `process.stderr`.
260
287
  */
261
288
  onAgentStderr?: AgentStderrHandler;
289
+ /**
290
+ * Called when a bounded limit inside the VM runtime approaches capacity
291
+ * (~80%, edge-triggered with hysteresis so it does not spam). Use it to alert
292
+ * on a slow consumer or a runaway guest before the limit is actually hit.
293
+ */
294
+ onLimitWarning?: LimitWarningHandler;
262
295
  }
263
296
  /** Configuration for a local MCP server (spawned as a child process). */
264
297
  export interface McpServerConfigLocal {
@@ -376,6 +409,7 @@ export declare class AgentOs {
376
409
  private readonly _sidecarVm;
377
410
  private readonly _disposeSidecarEventListener;
378
411
  private readonly _agentStderrHandler?;
412
+ private readonly _limitWarningHandler?;
379
413
  private constructor();
380
414
  static createSidecar(options?: AgentOsCreateSidecarOptions): Promise<AgentOsSidecar>;
381
415
  static getSharedSidecar(options?: AgentOsSharedSidecarOptions): Promise<AgentOsSidecar>;
@@ -464,6 +498,7 @@ export declare class AgentOs {
464
498
  private _recordAgentStderr;
465
499
  private _applySyntheticConfigOverrides;
466
500
  private _handleSidecarEvent;
501
+ private _handleLimitWarning;
467
502
  private _handleAcpExtEvent;
468
503
  private _unsupportedConfigResponse;
469
504
  private _sendAcpRequest;
package/dist/agent-os.js CHANGED
@@ -7,6 +7,7 @@ import { fileURLToPath } from "node:url";
7
7
  import commonSoftware from "@agentos-software/common";
8
8
  import { validateToolkits } from "./host-tools.js";
9
9
  import { zodToJsonSchema } from "./host-tools-zod.js";
10
+ import { parseAgentOsOptions } from "./options-schema.js";
10
11
  import { resolvePublishedSidecarBinary } from "./sidecar/binary.js";
11
12
  import { findCargoBinary, resolveCargoBinary } from "./sidecar/cargo.js";
12
13
  export { isAcpTimeoutErrorData } from "./json-rpc.js";
@@ -1408,7 +1409,8 @@ export class AgentOs {
1408
1409
  _sidecarVm;
1409
1410
  _disposeSidecarEventListener;
1410
1411
  _agentStderrHandler;
1411
- constructor(kernel, sidecar, softwareRoots, softwareAgentConfigs, hostMounts, env, rootFilesystem, sidecarClient, sidecarSession, sidecarVm, agentStderrHandler) {
1412
+ _limitWarningHandler;
1413
+ constructor(kernel, sidecar, softwareRoots, softwareAgentConfigs, hostMounts, env, rootFilesystem, sidecarClient, sidecarSession, sidecarVm, agentStderrHandler, limitWarningHandler) {
1412
1414
  this.#kernel = kernel;
1413
1415
  this.sidecar = sidecar;
1414
1416
  this._softwareRoots = softwareRoots;
@@ -1420,6 +1422,7 @@ export class AgentOs {
1420
1422
  this._sidecarSession = sidecarSession;
1421
1423
  this._sidecarVm = sidecarVm;
1422
1424
  this._agentStderrHandler = agentStderrHandler;
1425
+ this._limitWarningHandler = limitWarningHandler;
1423
1426
  this._disposeSidecarEventListener = this._sidecarClient.onEvent((event) => {
1424
1427
  this._handleSidecarEvent(event);
1425
1428
  });
@@ -1437,6 +1440,7 @@ export class AgentOs {
1437
1440
  return getSharedAgentOsSidecarInternal(options);
1438
1441
  }
1439
1442
  static async create(options) {
1443
+ options = parseAgentOsOptions(options);
1440
1444
  const software = options?.defaultSoftware === false
1441
1445
  ? (options.software ?? [])
1442
1446
  : [commonSoftware, ...(options?.software ?? [])];
@@ -1611,7 +1615,7 @@ export class AgentOs {
1611
1615
  createVm: async () => createVmAdmin(),
1612
1616
  });
1613
1617
  const vmAdmin = sidecarLease.admin;
1614
- const vm = new AgentOs(vmAdmin.kernel, sidecar, processed.softwareRoots, processed.agentConfigs, vmAdmin.hostMounts, vmAdmin.env, vmAdmin.rootView, vmAdmin.sidecarClient, vmAdmin.sidecarSession, vmAdmin.sidecarVm, options?.onAgentStderr ?? defaultAgentStderrHandler);
1618
+ const vm = new AgentOs(vmAdmin.kernel, sidecar, processed.softwareRoots, processed.agentConfigs, vmAdmin.hostMounts, vmAdmin.env, vmAdmin.rootView, vmAdmin.sidecarClient, vmAdmin.sidecarSession, vmAdmin.sidecarVm, options?.onAgentStderr ?? defaultAgentStderrHandler, options?.onLimitWarning);
1615
1619
  vm._sidecarLease = sidecarLease;
1616
1620
  vm._toolKits = vmAdmin.toolKits;
1617
1621
  vm._toolReference = vmAdmin.toolReference;
@@ -2300,6 +2304,10 @@ export class AgentOs {
2300
2304
  if (event.payload.type !== "structured") {
2301
2305
  return;
2302
2306
  }
2307
+ if (event.payload.name === "limit_warning") {
2308
+ this._handleLimitWarning(event.payload.detail);
2309
+ return;
2310
+ }
2303
2311
  if (event.payload.name !== "acp.session_event") {
2304
2312
  return;
2305
2313
  }
@@ -2319,6 +2327,27 @@ export class AgentOs {
2319
2327
  // Ignore malformed event payloads from the sidecar.
2320
2328
  }
2321
2329
  }
2330
+ _handleLimitWarning(detail) {
2331
+ if (!this._limitWarningHandler) {
2332
+ return;
2333
+ }
2334
+ const toNumber = (value) => {
2335
+ const parsed = Number(value);
2336
+ return Number.isFinite(parsed) ? parsed : 0;
2337
+ };
2338
+ try {
2339
+ this._limitWarningHandler({
2340
+ limit: detail.limit ?? "",
2341
+ category: detail.category ?? "",
2342
+ observed: toNumber(detail.observed),
2343
+ capacity: toNumber(detail.capacity),
2344
+ fillPercent: toNumber(detail.fillPercent),
2345
+ });
2346
+ }
2347
+ catch {
2348
+ // A throwing handler must never break the sidecar event loop.
2349
+ }
2350
+ }
2322
2351
  _handleAcpExtEvent(envelope) {
2323
2352
  if (envelope.namespace !== ACP_EXTENSION_NAMESPACE) {
2324
2353
  return;
@@ -1,3 +1,4 @@
1
+ import { zodToJsonSchema as zodV3ToJsonSchema } from "zod-to-json-schema";
1
2
  const OPTIONAL_WRAPPER_TYPES = new Set(["default", "optional"]);
2
3
  const TRANSPARENT_WRAPPER_TYPES = new Set([
3
4
  ...OPTIONAL_WRAPPER_TYPES,
@@ -30,6 +31,9 @@ export class HostToolSchemaConversionError extends Error {
30
31
  }
31
32
  }
32
33
  function getSchemaDef(schema) {
34
+ if (!schema || typeof schema !== "object") {
35
+ return {};
36
+ }
33
37
  return (schema._def ??
34
38
  schema.def ??
35
39
  {});
@@ -131,7 +135,8 @@ function validateSchema(schema, path) {
131
135
  return;
132
136
  }
133
137
  if (typeName === "array") {
134
- const itemSchema = getSchemaDef(schema).element;
138
+ const def = getSchemaDef(schema);
139
+ const itemSchema = (def.element ?? def.type);
135
140
  if (!itemSchema) {
136
141
  throw new HostToolSchemaConversionError(path, displayTypeName(typeName), "array schema is missing its item schema");
137
142
  }
@@ -163,8 +168,12 @@ function validateSchema(schema, path) {
163
168
  return;
164
169
  }
165
170
  if (typeName === "literal") {
166
- const values = getSchemaDef(schema).values;
167
- const literalValues = Array.isArray(values) ? values : [];
171
+ const def = getSchemaDef(schema);
172
+ const literalValues = Array.isArray(def.values)
173
+ ? def.values
174
+ : "value" in def
175
+ ? [def.value]
176
+ : [];
168
177
  const [literalValue] = literalValues;
169
178
  if (literalValues.length !== 1 ||
170
179
  !("string number boolean".split(" ").includes(typeof literalValue) || literalValue === null)) {
@@ -225,12 +234,23 @@ function findUnsupportedGeneratedKeyword(value, path) {
225
234
  }
226
235
  return null;
227
236
  }
237
+ function generateJsonSchema(schema) {
238
+ const nativeJsonSchema = schema.toJSONSchema?.();
239
+ if (nativeJsonSchema) {
240
+ return nativeJsonSchema;
241
+ }
242
+ const generated = zodV3ToJsonSchema(schema, {
243
+ $refStrategy: "none",
244
+ target: "jsonSchema7",
245
+ });
246
+ if (!generated || (typeof generated === "object" && Object.keys(generated).length === 0)) {
247
+ throw new HostToolSchemaConversionError("$", displayTypeName(normalizeTypeName(schema)), "schema cannot be converted to JSON Schema");
248
+ }
249
+ return generated;
250
+ }
228
251
  export function zodToJsonSchema(schema) {
229
252
  validateSchema(schema, "$");
230
- const jsonSchema = schema.toJSONSchema?.();
231
- if (!jsonSchema) {
232
- throw new HostToolSchemaConversionError("$", displayTypeName(normalizeTypeName(schema)), "schema does not expose toJSONSchema()");
233
- }
253
+ const jsonSchema = generateJsonSchema(schema);
234
254
  const unsupportedKeyword = findUnsupportedGeneratedKeyword(jsonSchema, "$");
235
255
  if (unsupportedKeyword) {
236
256
  throw new HostToolSchemaConversionError("$", displayTypeName(normalizeTypeName(schema)), `${unsupportedKeyword.keyword} emitted at ${unsupportedKeyword.path} is not supported`);
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export { AGENT_CONFIGS } from "./agents.js";
3
3
  export { CronManager, InvalidScheduleError, PastScheduleError, TimerScheduleDriver, } from "./cron/index.js";
4
4
  export { createHostDirBackend, nodeModulesMount } from "./host-dir-mount.js";
5
5
  export { hostTool, MAX_TOOL_DESCRIPTION_LENGTH, toolKit, validateToolkits, } from "./host-tools.js";
6
+ export { agentOsLimitsSchema, agentOsOptionFieldSchemas, agentOsOptionsSchema, hostToolSchema, mountConfigSchema, nativeMountConfigSchema, parseAgentOsOptions, permissionsSchema, rootFilesystemConfigSchema, sharedSidecarConfigSchema, sidecarConfigSchema, toolKitSchema, } from "./options-schema.js";
6
7
  export { createInMemoryLayerStore, createSnapshotExport, } from "./layers.js";
7
8
  export { defineSoftware } from "./packages.js";
8
9
  export { isAcpTimeoutErrorData, isUnknownSessionErrorData, } from "./json-rpc.js";
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ export { AGENT_CONFIGS } from "./agents.js";
4
4
  export { CronManager, InvalidScheduleError, PastScheduleError, TimerScheduleDriver, } from "./cron/index.js";
5
5
  export { createHostDirBackend, nodeModulesMount } from "./host-dir-mount.js";
6
6
  export { hostTool, MAX_TOOL_DESCRIPTION_LENGTH, toolKit, validateToolkits, } from "./host-tools.js";
7
+ export { agentOsLimitsSchema, agentOsOptionFieldSchemas, agentOsOptionsSchema, hostToolSchema, mountConfigSchema, nativeMountConfigSchema, parseAgentOsOptions, permissionsSchema, rootFilesystemConfigSchema, sharedSidecarConfigSchema, sidecarConfigSchema, toolKitSchema, } from "./options-schema.js";
7
8
  export { createInMemoryLayerStore, createSnapshotExport, } from "./layers.js";
8
9
  export { defineSoftware } from "./packages.js";
9
10
  export { isAcpTimeoutErrorData, isUnknownSessionErrorData, } from "./json-rpc.js";
@@ -0,0 +1,438 @@
1
+ import { z } from "zod/v4";
2
+ import type { AgentOsOptions, AgentStderrHandler, LimitWarningHandler, NativeMountConfig } from "./agent-os.js";
3
+ import type { HostTool, ToolKit } from "./host-tools.js";
4
+ export declare const permissionsSchema: z.ZodObject<{
5
+ fs: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
6
+ allow: "allow";
7
+ deny: "deny";
8
+ }>, z.ZodObject<{
9
+ default: z.ZodOptional<z.ZodEnum<{
10
+ allow: "allow";
11
+ deny: "deny";
12
+ }>>;
13
+ rules: z.ZodArray<z.ZodObject<{
14
+ mode: z.ZodEnum<{
15
+ allow: "allow";
16
+ deny: "deny";
17
+ }>;
18
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
+ paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
20
+ }, z.core.$strict>>;
21
+ }, z.core.$strict>]>>;
22
+ network: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
23
+ allow: "allow";
24
+ deny: "deny";
25
+ }>, z.ZodObject<{
26
+ default: z.ZodOptional<z.ZodEnum<{
27
+ allow: "allow";
28
+ deny: "deny";
29
+ }>>;
30
+ rules: z.ZodArray<z.ZodObject<{
31
+ mode: z.ZodEnum<{
32
+ allow: "allow";
33
+ deny: "deny";
34
+ }>;
35
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
37
+ }, z.core.$strict>>;
38
+ }, z.core.$strict>]>>;
39
+ childProcess: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
40
+ allow: "allow";
41
+ deny: "deny";
42
+ }>, z.ZodObject<{
43
+ default: z.ZodOptional<z.ZodEnum<{
44
+ allow: "allow";
45
+ deny: "deny";
46
+ }>>;
47
+ rules: z.ZodArray<z.ZodObject<{
48
+ mode: z.ZodEnum<{
49
+ allow: "allow";
50
+ deny: "deny";
51
+ }>;
52
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
53
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
54
+ }, z.core.$strict>>;
55
+ }, z.core.$strict>]>>;
56
+ process: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
57
+ allow: "allow";
58
+ deny: "deny";
59
+ }>, z.ZodObject<{
60
+ default: z.ZodOptional<z.ZodEnum<{
61
+ allow: "allow";
62
+ deny: "deny";
63
+ }>>;
64
+ rules: z.ZodArray<z.ZodObject<{
65
+ mode: z.ZodEnum<{
66
+ allow: "allow";
67
+ deny: "deny";
68
+ }>;
69
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
70
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
71
+ }, z.core.$strict>>;
72
+ }, z.core.$strict>]>>;
73
+ env: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
74
+ allow: "allow";
75
+ deny: "deny";
76
+ }>, z.ZodObject<{
77
+ default: z.ZodOptional<z.ZodEnum<{
78
+ allow: "allow";
79
+ deny: "deny";
80
+ }>>;
81
+ rules: z.ZodArray<z.ZodObject<{
82
+ mode: z.ZodEnum<{
83
+ allow: "allow";
84
+ deny: "deny";
85
+ }>;
86
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
87
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
88
+ }, z.core.$strict>>;
89
+ }, z.core.$strict>]>>;
90
+ tool: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
91
+ allow: "allow";
92
+ deny: "deny";
93
+ }>, z.ZodObject<{
94
+ default: z.ZodOptional<z.ZodEnum<{
95
+ allow: "allow";
96
+ deny: "deny";
97
+ }>>;
98
+ rules: z.ZodArray<z.ZodObject<{
99
+ mode: z.ZodEnum<{
100
+ allow: "allow";
101
+ deny: "deny";
102
+ }>;
103
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
104
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
105
+ }, z.core.$strict>>;
106
+ }, z.core.$strict>]>>;
107
+ }, z.core.$strict>;
108
+ export declare const agentOsLimitsSchema: z.ZodObject<{
109
+ resources: z.ZodOptional<z.ZodObject<{
110
+ cpuCount: z.ZodOptional<z.ZodNumber>;
111
+ maxProcesses: z.ZodOptional<z.ZodNumber>;
112
+ maxOpenFds: z.ZodOptional<z.ZodNumber>;
113
+ maxPipes: z.ZodOptional<z.ZodNumber>;
114
+ maxPtys: z.ZodOptional<z.ZodNumber>;
115
+ maxSockets: z.ZodOptional<z.ZodNumber>;
116
+ maxConnections: z.ZodOptional<z.ZodNumber>;
117
+ maxSocketBufferedBytes: z.ZodOptional<z.ZodNumber>;
118
+ maxSocketDatagramQueueLen: z.ZodOptional<z.ZodNumber>;
119
+ maxFilesystemBytes: z.ZodOptional<z.ZodNumber>;
120
+ maxInodeCount: z.ZodOptional<z.ZodNumber>;
121
+ maxBlockingReadMs: z.ZodOptional<z.ZodNumber>;
122
+ maxPreadBytes: z.ZodOptional<z.ZodNumber>;
123
+ maxFdWriteBytes: z.ZodOptional<z.ZodNumber>;
124
+ maxProcessArgvBytes: z.ZodOptional<z.ZodNumber>;
125
+ maxProcessEnvBytes: z.ZodOptional<z.ZodNumber>;
126
+ maxReaddirEntries: z.ZodOptional<z.ZodNumber>;
127
+ maxWasmFuel: z.ZodOptional<z.ZodNumber>;
128
+ maxWasmMemoryBytes: z.ZodOptional<z.ZodNumber>;
129
+ maxWasmStackBytes: z.ZodOptional<z.ZodNumber>;
130
+ }, z.core.$strict>>;
131
+ http: z.ZodOptional<z.ZodObject<{
132
+ maxFetchResponseBytes: z.ZodOptional<z.ZodNumber>;
133
+ }, z.core.$strict>>;
134
+ tools: z.ZodOptional<z.ZodObject<{
135
+ defaultToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
136
+ maxToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
137
+ maxRegisteredToolkits: z.ZodOptional<z.ZodNumber>;
138
+ maxRegisteredToolsPerVm: z.ZodOptional<z.ZodNumber>;
139
+ maxToolsPerToolkit: z.ZodOptional<z.ZodNumber>;
140
+ maxToolSchemaBytes: z.ZodOptional<z.ZodNumber>;
141
+ maxToolExamplesPerTool: z.ZodOptional<z.ZodNumber>;
142
+ maxToolExampleInputBytes: z.ZodOptional<z.ZodNumber>;
143
+ }, z.core.$strict>>;
144
+ plugins: z.ZodOptional<z.ZodObject<{
145
+ maxPersistedManifestBytes: z.ZodOptional<z.ZodNumber>;
146
+ maxPersistedManifestFileBytes: z.ZodOptional<z.ZodNumber>;
147
+ }, z.core.$strict>>;
148
+ acp: z.ZodOptional<z.ZodObject<{
149
+ maxReadLineBytes: z.ZodOptional<z.ZodNumber>;
150
+ stdoutBufferByteLimit: z.ZodOptional<z.ZodNumber>;
151
+ }, z.core.$strict>>;
152
+ jsRuntime: z.ZodOptional<z.ZodObject<{
153
+ v8HeapLimitMb: z.ZodOptional<z.ZodNumber>;
154
+ capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
155
+ stdinBufferLimitBytes: z.ZodOptional<z.ZodNumber>;
156
+ eventPayloadLimitBytes: z.ZodOptional<z.ZodNumber>;
157
+ v8IpcMaxFrameBytes: z.ZodOptional<z.ZodNumber>;
158
+ }, z.core.$strict>>;
159
+ python: z.ZodOptional<z.ZodObject<{
160
+ outputBufferMaxBytes: z.ZodOptional<z.ZodNumber>;
161
+ executionTimeoutMs: z.ZodOptional<z.ZodNumber>;
162
+ vfsRpcTimeoutMs: z.ZodOptional<z.ZodNumber>;
163
+ }, z.core.$strict>>;
164
+ wasm: z.ZodOptional<z.ZodObject<{
165
+ maxModuleFileBytes: z.ZodOptional<z.ZodNumber>;
166
+ capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
167
+ syncReadLimitBytes: z.ZodOptional<z.ZodNumber>;
168
+ }, z.core.$strict>>;
169
+ }, z.core.$strict>;
170
+ export declare const rootFilesystemConfigSchema: z.ZodObject<{
171
+ type: z.ZodOptional<z.ZodLiteral<"overlay">>;
172
+ mode: z.ZodOptional<z.ZodEnum<{
173
+ ephemeral: "ephemeral";
174
+ "read-only": "read-only";
175
+ }>>;
176
+ disableDefaultBaseLayer: z.ZodOptional<z.ZodBoolean>;
177
+ lowers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
178
+ kind: z.ZodLiteral<"bundled-base-filesystem">;
179
+ }, z.core.$strict>, z.ZodObject<{
180
+ kind: z.ZodLiteral<"snapshot-export">;
181
+ source: z.ZodUnknown;
182
+ }, z.core.$strict>]>>>;
183
+ }, z.core.$strict>;
184
+ export declare const nativeMountConfigSchema: z.ZodType<NativeMountConfig>;
185
+ export declare const mountConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
186
+ path: z.ZodString;
187
+ driver: z.ZodCustom<unknown, unknown>;
188
+ readOnly: z.ZodOptional<z.ZodBoolean>;
189
+ }, z.core.$strict>, z.ZodType<NativeMountConfig, unknown, z.core.$ZodTypeInternals<NativeMountConfig, unknown>>, z.ZodObject<{
190
+ path: z.ZodString;
191
+ filesystem: z.ZodObject<{
192
+ type: z.ZodLiteral<"overlay">;
193
+ store: z.ZodUnknown;
194
+ mode: z.ZodOptional<z.ZodEnum<{
195
+ ephemeral: "ephemeral";
196
+ "read-only": "read-only";
197
+ }>>;
198
+ lowers: z.ZodArray<z.ZodUnknown>;
199
+ }, z.core.$strict>;
200
+ }, z.core.$strict>]>;
201
+ export declare const sharedSidecarConfigSchema: z.ZodObject<{
202
+ kind: z.ZodLiteral<"shared">;
203
+ pool: z.ZodOptional<z.ZodString>;
204
+ }, z.core.$strict>;
205
+ export declare const sidecarConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
206
+ kind: z.ZodLiteral<"shared">;
207
+ pool: z.ZodOptional<z.ZodString>;
208
+ }, z.core.$strict>, z.ZodObject<{
209
+ kind: z.ZodLiteral<"explicit">;
210
+ handle: z.ZodUnknown;
211
+ }, z.core.$strict>]>;
212
+ export declare const hostToolSchema: z.ZodType<HostTool>;
213
+ export declare const toolKitSchema: z.ZodType<ToolKit>;
214
+ /**
215
+ * Shared AgentOsOptions field schemas.
216
+ *
217
+ * Core uses the full object. The Rivet/native actor composes a narrower
218
+ * native-safe subset in `packages/agentos/src/config.ts`; keep that subset and
219
+ * `crates/agentos-actor-plugin/src/config.rs::AgentOsConfigJson` aligned when
220
+ * adding options that cross the native boundary.
221
+ */
222
+ export declare const agentOsOptionFieldSchemas: {
223
+ readonly software: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
224
+ readonly defaultSoftware: z.ZodOptional<z.ZodBoolean>;
225
+ readonly loopbackExemptPorts: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
226
+ readonly allowedNodeBuiltins: z.ZodOptional<z.ZodArray<z.ZodString>>;
227
+ readonly rootFilesystem: z.ZodOptional<z.ZodObject<{
228
+ type: z.ZodOptional<z.ZodLiteral<"overlay">>;
229
+ mode: z.ZodOptional<z.ZodEnum<{
230
+ ephemeral: "ephemeral";
231
+ "read-only": "read-only";
232
+ }>>;
233
+ disableDefaultBaseLayer: z.ZodOptional<z.ZodBoolean>;
234
+ lowers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
235
+ kind: z.ZodLiteral<"bundled-base-filesystem">;
236
+ }, z.core.$strict>, z.ZodObject<{
237
+ kind: z.ZodLiteral<"snapshot-export">;
238
+ source: z.ZodUnknown;
239
+ }, z.core.$strict>]>>>;
240
+ }, z.core.$strict>>;
241
+ readonly mounts: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
242
+ path: z.ZodString;
243
+ driver: z.ZodCustom<unknown, unknown>;
244
+ readOnly: z.ZodOptional<z.ZodBoolean>;
245
+ }, z.core.$strict>, z.ZodType<NativeMountConfig, unknown, z.core.$ZodTypeInternals<NativeMountConfig, unknown>>, z.ZodObject<{
246
+ path: z.ZodString;
247
+ filesystem: z.ZodObject<{
248
+ type: z.ZodLiteral<"overlay">;
249
+ store: z.ZodUnknown;
250
+ mode: z.ZodOptional<z.ZodEnum<{
251
+ ephemeral: "ephemeral";
252
+ "read-only": "read-only";
253
+ }>>;
254
+ lowers: z.ZodArray<z.ZodUnknown>;
255
+ }, z.core.$strict>;
256
+ }, z.core.$strict>]>>>;
257
+ readonly moduleAccessCwd: z.ZodOptional<z.ZodString>;
258
+ readonly additionalInstructions: z.ZodOptional<z.ZodString>;
259
+ readonly scheduleDriver: z.ZodOptional<z.ZodCustom<unknown, unknown>>;
260
+ readonly toolKits: z.ZodOptional<z.ZodArray<z.ZodType<ToolKit, unknown, z.core.$ZodTypeInternals<ToolKit, unknown>>>>;
261
+ readonly permissions: z.ZodOptional<z.ZodObject<{
262
+ fs: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
263
+ allow: "allow";
264
+ deny: "deny";
265
+ }>, z.ZodObject<{
266
+ default: z.ZodOptional<z.ZodEnum<{
267
+ allow: "allow";
268
+ deny: "deny";
269
+ }>>;
270
+ rules: z.ZodArray<z.ZodObject<{
271
+ mode: z.ZodEnum<{
272
+ allow: "allow";
273
+ deny: "deny";
274
+ }>;
275
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
276
+ paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
277
+ }, z.core.$strict>>;
278
+ }, z.core.$strict>]>>;
279
+ network: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
280
+ allow: "allow";
281
+ deny: "deny";
282
+ }>, z.ZodObject<{
283
+ default: z.ZodOptional<z.ZodEnum<{
284
+ allow: "allow";
285
+ deny: "deny";
286
+ }>>;
287
+ rules: z.ZodArray<z.ZodObject<{
288
+ mode: z.ZodEnum<{
289
+ allow: "allow";
290
+ deny: "deny";
291
+ }>;
292
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
293
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
294
+ }, z.core.$strict>>;
295
+ }, z.core.$strict>]>>;
296
+ childProcess: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
297
+ allow: "allow";
298
+ deny: "deny";
299
+ }>, z.ZodObject<{
300
+ default: z.ZodOptional<z.ZodEnum<{
301
+ allow: "allow";
302
+ deny: "deny";
303
+ }>>;
304
+ rules: z.ZodArray<z.ZodObject<{
305
+ mode: z.ZodEnum<{
306
+ allow: "allow";
307
+ deny: "deny";
308
+ }>;
309
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
310
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
311
+ }, z.core.$strict>>;
312
+ }, z.core.$strict>]>>;
313
+ process: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
314
+ allow: "allow";
315
+ deny: "deny";
316
+ }>, z.ZodObject<{
317
+ default: z.ZodOptional<z.ZodEnum<{
318
+ allow: "allow";
319
+ deny: "deny";
320
+ }>>;
321
+ rules: z.ZodArray<z.ZodObject<{
322
+ mode: z.ZodEnum<{
323
+ allow: "allow";
324
+ deny: "deny";
325
+ }>;
326
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
327
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
328
+ }, z.core.$strict>>;
329
+ }, z.core.$strict>]>>;
330
+ env: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
331
+ allow: "allow";
332
+ deny: "deny";
333
+ }>, z.ZodObject<{
334
+ default: z.ZodOptional<z.ZodEnum<{
335
+ allow: "allow";
336
+ deny: "deny";
337
+ }>>;
338
+ rules: z.ZodArray<z.ZodObject<{
339
+ mode: z.ZodEnum<{
340
+ allow: "allow";
341
+ deny: "deny";
342
+ }>;
343
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
344
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
345
+ }, z.core.$strict>>;
346
+ }, z.core.$strict>]>>;
347
+ tool: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
348
+ allow: "allow";
349
+ deny: "deny";
350
+ }>, z.ZodObject<{
351
+ default: z.ZodOptional<z.ZodEnum<{
352
+ allow: "allow";
353
+ deny: "deny";
354
+ }>>;
355
+ rules: z.ZodArray<z.ZodObject<{
356
+ mode: z.ZodEnum<{
357
+ allow: "allow";
358
+ deny: "deny";
359
+ }>;
360
+ operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
361
+ patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
362
+ }, z.core.$strict>>;
363
+ }, z.core.$strict>]>>;
364
+ }, z.core.$strict>>;
365
+ readonly sidecar: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
366
+ kind: z.ZodLiteral<"shared">;
367
+ pool: z.ZodOptional<z.ZodString>;
368
+ }, z.core.$strict>, z.ZodObject<{
369
+ kind: z.ZodLiteral<"explicit">;
370
+ handle: z.ZodUnknown;
371
+ }, z.core.$strict>]>>;
372
+ readonly limits: z.ZodOptional<z.ZodObject<{
373
+ resources: z.ZodOptional<z.ZodObject<{
374
+ cpuCount: z.ZodOptional<z.ZodNumber>;
375
+ maxProcesses: z.ZodOptional<z.ZodNumber>;
376
+ maxOpenFds: z.ZodOptional<z.ZodNumber>;
377
+ maxPipes: z.ZodOptional<z.ZodNumber>;
378
+ maxPtys: z.ZodOptional<z.ZodNumber>;
379
+ maxSockets: z.ZodOptional<z.ZodNumber>;
380
+ maxConnections: z.ZodOptional<z.ZodNumber>;
381
+ maxSocketBufferedBytes: z.ZodOptional<z.ZodNumber>;
382
+ maxSocketDatagramQueueLen: z.ZodOptional<z.ZodNumber>;
383
+ maxFilesystemBytes: z.ZodOptional<z.ZodNumber>;
384
+ maxInodeCount: z.ZodOptional<z.ZodNumber>;
385
+ maxBlockingReadMs: z.ZodOptional<z.ZodNumber>;
386
+ maxPreadBytes: z.ZodOptional<z.ZodNumber>;
387
+ maxFdWriteBytes: z.ZodOptional<z.ZodNumber>;
388
+ maxProcessArgvBytes: z.ZodOptional<z.ZodNumber>;
389
+ maxProcessEnvBytes: z.ZodOptional<z.ZodNumber>;
390
+ maxReaddirEntries: z.ZodOptional<z.ZodNumber>;
391
+ maxWasmFuel: z.ZodOptional<z.ZodNumber>;
392
+ maxWasmMemoryBytes: z.ZodOptional<z.ZodNumber>;
393
+ maxWasmStackBytes: z.ZodOptional<z.ZodNumber>;
394
+ }, z.core.$strict>>;
395
+ http: z.ZodOptional<z.ZodObject<{
396
+ maxFetchResponseBytes: z.ZodOptional<z.ZodNumber>;
397
+ }, z.core.$strict>>;
398
+ tools: z.ZodOptional<z.ZodObject<{
399
+ defaultToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
400
+ maxToolTimeoutMs: z.ZodOptional<z.ZodNumber>;
401
+ maxRegisteredToolkits: z.ZodOptional<z.ZodNumber>;
402
+ maxRegisteredToolsPerVm: z.ZodOptional<z.ZodNumber>;
403
+ maxToolsPerToolkit: z.ZodOptional<z.ZodNumber>;
404
+ maxToolSchemaBytes: z.ZodOptional<z.ZodNumber>;
405
+ maxToolExamplesPerTool: z.ZodOptional<z.ZodNumber>;
406
+ maxToolExampleInputBytes: z.ZodOptional<z.ZodNumber>;
407
+ }, z.core.$strict>>;
408
+ plugins: z.ZodOptional<z.ZodObject<{
409
+ maxPersistedManifestBytes: z.ZodOptional<z.ZodNumber>;
410
+ maxPersistedManifestFileBytes: z.ZodOptional<z.ZodNumber>;
411
+ }, z.core.$strict>>;
412
+ acp: z.ZodOptional<z.ZodObject<{
413
+ maxReadLineBytes: z.ZodOptional<z.ZodNumber>;
414
+ stdoutBufferByteLimit: z.ZodOptional<z.ZodNumber>;
415
+ }, z.core.$strict>>;
416
+ jsRuntime: z.ZodOptional<z.ZodObject<{
417
+ v8HeapLimitMb: z.ZodOptional<z.ZodNumber>;
418
+ capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
419
+ stdinBufferLimitBytes: z.ZodOptional<z.ZodNumber>;
420
+ eventPayloadLimitBytes: z.ZodOptional<z.ZodNumber>;
421
+ v8IpcMaxFrameBytes: z.ZodOptional<z.ZodNumber>;
422
+ }, z.core.$strict>>;
423
+ python: z.ZodOptional<z.ZodObject<{
424
+ outputBufferMaxBytes: z.ZodOptional<z.ZodNumber>;
425
+ executionTimeoutMs: z.ZodOptional<z.ZodNumber>;
426
+ vfsRpcTimeoutMs: z.ZodOptional<z.ZodNumber>;
427
+ }, z.core.$strict>>;
428
+ wasm: z.ZodOptional<z.ZodObject<{
429
+ maxModuleFileBytes: z.ZodOptional<z.ZodNumber>;
430
+ capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
431
+ syncReadLimitBytes: z.ZodOptional<z.ZodNumber>;
432
+ }, z.core.$strict>>;
433
+ }, z.core.$strict>>;
434
+ readonly onAgentStderr: z.ZodOptional<z.ZodCustom<AgentStderrHandler, AgentStderrHandler>>;
435
+ readonly onLimitWarning: z.ZodOptional<z.ZodCustom<LimitWarningHandler, LimitWarningHandler>>;
436
+ };
437
+ export declare const agentOsOptionsSchema: z.ZodType<AgentOsOptions>;
438
+ export declare function parseAgentOsOptions(options?: AgentOsOptions): AgentOsOptions;
@@ -0,0 +1,260 @@
1
+ import { z } from "zod/v4";
2
+ const stringArray = z.array(z.string());
3
+ const nonNegativeInteger = z.number().int().nonnegative();
4
+ const positiveInteger = z.number().int().positive();
5
+ const functionSchema = z.custom((value) => typeof value === "function", { message: "Expected function" });
6
+ const permissionModeSchema = z.enum(["allow", "deny"]);
7
+ const fsPermissionRuleSchema = z
8
+ .object({
9
+ mode: permissionModeSchema,
10
+ operations: stringArray.optional(),
11
+ paths: stringArray.optional(),
12
+ })
13
+ .strict();
14
+ const patternPermissionRuleSchema = z
15
+ .object({
16
+ mode: permissionModeSchema,
17
+ operations: stringArray.optional(),
18
+ patterns: stringArray.optional(),
19
+ })
20
+ .strict();
21
+ const fsRulePermissionsSchema = z
22
+ .object({
23
+ default: permissionModeSchema.optional(),
24
+ rules: z.array(fsPermissionRuleSchema),
25
+ })
26
+ .strict();
27
+ const patternRulePermissionsSchema = z
28
+ .object({
29
+ default: permissionModeSchema.optional(),
30
+ rules: z.array(patternPermissionRuleSchema),
31
+ })
32
+ .strict();
33
+ const fsPermissionsSchema = z.union([permissionModeSchema, fsRulePermissionsSchema]);
34
+ const patternPermissionsSchema = z.union([
35
+ permissionModeSchema,
36
+ patternRulePermissionsSchema,
37
+ ]);
38
+ export const permissionsSchema = z
39
+ .object({
40
+ fs: fsPermissionsSchema.optional(),
41
+ network: patternPermissionsSchema.optional(),
42
+ childProcess: patternPermissionsSchema.optional(),
43
+ process: patternPermissionsSchema.optional(),
44
+ env: patternPermissionsSchema.optional(),
45
+ tool: patternPermissionsSchema.optional(),
46
+ })
47
+ .strict();
48
+ export const agentOsLimitsSchema = z
49
+ .object({
50
+ resources: z
51
+ .object({
52
+ cpuCount: positiveInteger.optional(),
53
+ maxProcesses: nonNegativeInteger.optional(),
54
+ maxOpenFds: nonNegativeInteger.optional(),
55
+ maxPipes: nonNegativeInteger.optional(),
56
+ maxPtys: nonNegativeInteger.optional(),
57
+ maxSockets: nonNegativeInteger.optional(),
58
+ maxConnections: nonNegativeInteger.optional(),
59
+ maxSocketBufferedBytes: nonNegativeInteger.optional(),
60
+ maxSocketDatagramQueueLen: nonNegativeInteger.optional(),
61
+ maxFilesystemBytes: nonNegativeInteger.optional(),
62
+ maxInodeCount: nonNegativeInteger.optional(),
63
+ maxBlockingReadMs: nonNegativeInteger.optional(),
64
+ maxPreadBytes: nonNegativeInteger.optional(),
65
+ maxFdWriteBytes: nonNegativeInteger.optional(),
66
+ maxProcessArgvBytes: nonNegativeInteger.optional(),
67
+ maxProcessEnvBytes: nonNegativeInteger.optional(),
68
+ maxReaddirEntries: nonNegativeInteger.optional(),
69
+ maxWasmFuel: nonNegativeInteger.optional(),
70
+ maxWasmMemoryBytes: nonNegativeInteger.optional(),
71
+ maxWasmStackBytes: nonNegativeInteger.optional(),
72
+ })
73
+ .strict()
74
+ .optional(),
75
+ http: z
76
+ .object({ maxFetchResponseBytes: nonNegativeInteger.optional() })
77
+ .strict()
78
+ .optional(),
79
+ tools: z
80
+ .object({
81
+ defaultToolTimeoutMs: nonNegativeInteger.optional(),
82
+ maxToolTimeoutMs: nonNegativeInteger.optional(),
83
+ maxRegisteredToolkits: nonNegativeInteger.optional(),
84
+ maxRegisteredToolsPerVm: nonNegativeInteger.optional(),
85
+ maxToolsPerToolkit: nonNegativeInteger.optional(),
86
+ maxToolSchemaBytes: nonNegativeInteger.optional(),
87
+ maxToolExamplesPerTool: nonNegativeInteger.optional(),
88
+ maxToolExampleInputBytes: nonNegativeInteger.optional(),
89
+ })
90
+ .strict()
91
+ .optional(),
92
+ plugins: z
93
+ .object({
94
+ maxPersistedManifestBytes: nonNegativeInteger.optional(),
95
+ maxPersistedManifestFileBytes: nonNegativeInteger.optional(),
96
+ })
97
+ .strict()
98
+ .optional(),
99
+ acp: z
100
+ .object({
101
+ maxReadLineBytes: nonNegativeInteger.optional(),
102
+ stdoutBufferByteLimit: nonNegativeInteger.optional(),
103
+ })
104
+ .strict()
105
+ .optional(),
106
+ jsRuntime: z
107
+ .object({
108
+ v8HeapLimitMb: nonNegativeInteger.optional(),
109
+ capturedOutputLimitBytes: nonNegativeInteger.optional(),
110
+ stdinBufferLimitBytes: nonNegativeInteger.optional(),
111
+ eventPayloadLimitBytes: nonNegativeInteger.optional(),
112
+ v8IpcMaxFrameBytes: nonNegativeInteger.optional(),
113
+ })
114
+ .strict()
115
+ .optional(),
116
+ python: z
117
+ .object({
118
+ outputBufferMaxBytes: nonNegativeInteger.optional(),
119
+ executionTimeoutMs: nonNegativeInteger.optional(),
120
+ vfsRpcTimeoutMs: nonNegativeInteger.optional(),
121
+ })
122
+ .strict()
123
+ .optional(),
124
+ wasm: z
125
+ .object({
126
+ maxModuleFileBytes: nonNegativeInteger.optional(),
127
+ capturedOutputLimitBytes: nonNegativeInteger.optional(),
128
+ syncReadLimitBytes: nonNegativeInteger.optional(),
129
+ })
130
+ .strict()
131
+ .optional(),
132
+ })
133
+ .strict();
134
+ const rootLowerInputSchema = z.union([
135
+ z.object({ kind: z.literal("bundled-base-filesystem") }).strict(),
136
+ z.object({ kind: z.literal("snapshot-export"), source: z.unknown() }).strict(),
137
+ ]);
138
+ export const rootFilesystemConfigSchema = z
139
+ .object({
140
+ type: z.literal("overlay").optional(),
141
+ mode: z.enum(["ephemeral", "read-only"]).optional(),
142
+ disableDefaultBaseLayer: z.boolean().optional(),
143
+ lowers: z.array(rootLowerInputSchema).optional(),
144
+ })
145
+ .strict();
146
+ const nativeMountPluginSchema = z
147
+ .object({
148
+ id: z.string(),
149
+ config: z.unknown().optional(),
150
+ })
151
+ .strict();
152
+ const plainMountConfigSchema = z
153
+ .object({
154
+ path: z.string(),
155
+ driver: z.custom((value) => typeof value === "object" && value !== null, {
156
+ message: "Expected filesystem driver object",
157
+ }),
158
+ readOnly: z.boolean().optional(),
159
+ })
160
+ .strict();
161
+ export const nativeMountConfigSchema = z
162
+ .object({
163
+ path: z.string(),
164
+ plugin: nativeMountPluginSchema,
165
+ readOnly: z.boolean().optional(),
166
+ })
167
+ .strict();
168
+ const overlayMountConfigSchema = z
169
+ .object({
170
+ path: z.string(),
171
+ filesystem: z
172
+ .object({
173
+ type: z.literal("overlay"),
174
+ store: z.unknown(),
175
+ mode: z.enum(["ephemeral", "read-only"]).optional(),
176
+ lowers: z.array(z.unknown()),
177
+ })
178
+ .strict(),
179
+ })
180
+ .strict();
181
+ export const mountConfigSchema = z.union([
182
+ plainMountConfigSchema,
183
+ nativeMountConfigSchema,
184
+ overlayMountConfigSchema,
185
+ ]);
186
+ export const sharedSidecarConfigSchema = z
187
+ .object({
188
+ kind: z.literal("shared"),
189
+ pool: z.string().optional(),
190
+ })
191
+ .strict();
192
+ const explicitSidecarSchema = z
193
+ .object({
194
+ kind: z.literal("explicit"),
195
+ handle: z.unknown(),
196
+ })
197
+ .strict();
198
+ export const sidecarConfigSchema = z.union([
199
+ sharedSidecarConfigSchema,
200
+ explicitSidecarSchema,
201
+ ]);
202
+ const toolExampleSchema = z
203
+ .object({
204
+ description: z.string(),
205
+ input: z.unknown(),
206
+ })
207
+ .strict();
208
+ export const hostToolSchema = z
209
+ .object({
210
+ description: z.string(),
211
+ inputSchema: z.custom((value) => typeof value === "object" && value !== null, {
212
+ message: "Expected Zod schema object",
213
+ }),
214
+ execute: functionSchema,
215
+ examples: z.array(toolExampleSchema).optional(),
216
+ timeout: nonNegativeInteger.optional(),
217
+ })
218
+ .strict();
219
+ export const toolKitSchema = z
220
+ .object({
221
+ name: z.string(),
222
+ description: z.string(),
223
+ tools: z.record(z.string(), hostToolSchema),
224
+ })
225
+ .strict();
226
+ /**
227
+ * Shared AgentOsOptions field schemas.
228
+ *
229
+ * Core uses the full object. The Rivet/native actor composes a narrower
230
+ * native-safe subset in `packages/agentos/src/config.ts`; keep that subset and
231
+ * `crates/agentos-actor-plugin/src/config.rs::AgentOsConfigJson` aligned when
232
+ * adding options that cross the native boundary.
233
+ */
234
+ export const agentOsOptionFieldSchemas = {
235
+ software: z.array(z.unknown()).optional(),
236
+ defaultSoftware: z.boolean().optional(),
237
+ loopbackExemptPorts: z.array(z.number().int().min(0).max(65535)).optional(),
238
+ allowedNodeBuiltins: stringArray.optional(),
239
+ rootFilesystem: rootFilesystemConfigSchema.optional(),
240
+ mounts: z.array(mountConfigSchema).optional(),
241
+ moduleAccessCwd: z.string().optional(),
242
+ additionalInstructions: z.string().optional(),
243
+ scheduleDriver: z
244
+ .custom((value) => typeof value === "object" && value !== null, {
245
+ message: "Expected schedule driver object",
246
+ })
247
+ .optional(),
248
+ toolKits: z.array(toolKitSchema).optional(),
249
+ permissions: permissionsSchema.optional(),
250
+ sidecar: sidecarConfigSchema.optional(),
251
+ limits: agentOsLimitsSchema.optional(),
252
+ onAgentStderr: z.custom((value) => typeof value === "function", { message: "Expected function" }).optional(),
253
+ onLimitWarning: z.custom((value) => typeof value === "function", { message: "Expected function" }).optional(),
254
+ };
255
+ export const agentOsOptionsSchema = z
256
+ .object(agentOsOptionFieldSchemas)
257
+ .strict();
258
+ export function parseAgentOsOptions(options) {
259
+ return agentOsOptionsSchema.parse(options ?? {});
260
+ }
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type { AgentCapabilities, AgentInfo, AgentOsCreateSidecarOptions, AgentOsLimits, AgentOsOptions, AgentOsSharedSidecarOptions, AgentOsSidecarConfig, AgentOsSidecarDescription, AgentStderrEvent, AgentStderrHandler, AgentRegistryEntry, BatchReadResult, BatchWriteEntry, BatchWriteResult, CreateSessionOptions, DirEntry, McpServerConfig, McpServerConfigLocal, McpServerConfigRemote, MountConfig, MountConfigJsonObject, MountConfigJsonPrimitive, MountConfigJsonValue, NativeMountConfig, NativeMountPluginDescriptor, OverlayMountConfig, PermissionReply, PermissionRequest, PermissionRequestHandler, PlainMountConfig, ProcessTreeNode, PromptResult, ReaddirRecursiveOptions, ResumeSessionOptions, ResumeSessionResult, RootFilesystemConfig, RootLowerInput, SessionConfigOption, SessionEventHandler, SessionInfo, SessionInitData, SessionMode, SessionModeState, SpawnedProcessInfo, } from "./agent-os.js";
1
+ export type { AgentCapabilities, AgentInfo, AgentOsCreateSidecarOptions, AgentOsLimits, AgentOsOptions, AgentOsSharedSidecarOptions, AgentOsSidecarConfig, AgentOsSidecarDescription, AgentStderrEvent, AgentStderrHandler, AgentRegistryEntry, BatchReadResult, BatchWriteEntry, BatchWriteResult, CreateSessionOptions, DirEntry, LimitWarning, LimitWarningHandler, McpServerConfig, McpServerConfigLocal, McpServerConfigRemote, MountConfig, MountConfigJsonObject, MountConfigJsonPrimitive, MountConfigJsonValue, NativeMountConfig, NativeMountPluginDescriptor, OverlayMountConfig, PermissionReply, PermissionRequest, PermissionRequestHandler, PlainMountConfig, ProcessTreeNode, PromptResult, ReaddirRecursiveOptions, ResumeSessionOptions, ResumeSessionResult, RootFilesystemConfig, RootLowerInput, SessionConfigOption, SessionEventHandler, SessionInfo, SessionInitData, SessionMode, SessionModeState, SpawnedProcessInfo, } from "./agent-os.js";
2
2
  export type { AgentConfig, AgentType } from "./agents.js";
3
3
  export type { CronAction, CronEvent, CronEventHandler, CronJob, CronJobInfo, CronJobOptions, ScheduleDriver, ScheduleEntry, ScheduleHandle, } from "./cron/index.js";
4
4
  export type { HostDirBackendOptions, HostDirMountPluginConfig, NodeModulesMountConfig, } from "./host-dir-mount.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivet-dev/agentos-core",
3
- "version": "0.0.0-codex-agentos-native-platform-e2e.78ef941",
3
+ "version": "0.0.0-feat-on-limit-warning.62a2bc2",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./dist/index.js",
@@ -56,16 +56,18 @@
56
56
  "dependencies": {
57
57
  "@agentos-software/common": "0.3.0-rc.2",
58
58
  "@aws-sdk/client-s3": "^3.1019.0",
59
- "@rivet-dev/agentos-sidecar": "0.0.0-codex-agentos-native-platform-e2e.78ef941",
59
+ "@rivet-dev/agentos-sidecar": "0.0.0-feat-on-limit-warning.62a2bc2",
60
60
  "@rivetkit/bare-ts": "^0.6.2",
61
- "@secure-exec/core": "0.0.0-nathan-workspace-binding-agentos.83db3e3",
61
+ "@secure-exec/core": "0.0.0-fix-queue-backpressure-and-tracker.f7cc68e",
62
62
  "@xterm/headless": "^6.0.0",
63
63
  "better-sqlite3": "^12.8.0",
64
64
  "croner": "^10.0.1",
65
65
  "googleapis": "^144.0.0",
66
66
  "isolated-vm": "^6.0.0",
67
67
  "long-timeout": "^0.1.1",
68
- "minimatch": "^10.2.4"
68
+ "minimatch": "^10.2.4",
69
+ "zod": "^4.1.11",
70
+ "zod-to-json-schema": "^3.25.2"
69
71
  },
70
72
  "devDependencies": {
71
73
  "@anthropic-ai/claude-agent-sdk": "^0.2.87",
@@ -77,8 +79,8 @@
77
79
  "@copilotkit/llmock": "^1.6.0",
78
80
  "@rivet-dev/agentos-sandbox": "link:../agentos-sandbox",
79
81
  "@agentos-software/git": "0.3.0-rc.2",
80
- "@secure-exec/google-drive": "0.0.0-nathan-workspace-binding-agentos.83db3e3",
81
- "@secure-exec/s3": "0.0.0-nathan-workspace-binding-agentos.83db3e3",
82
+ "@secure-exec/google-drive": "0.0.0-fix-queue-backpressure-and-tracker.f7cc68e",
83
+ "@secure-exec/s3": "0.0.0-fix-queue-backpressure-and-tracker.f7cc68e",
82
84
  "@mariozechner/pi-coding-agent": "^0.60.0",
83
85
  "@agentos-software/claude-code": "0.0.0-nathan-binding-workspace.9be0a88",
84
86
  "@agentos-software/codex-cli": "0.3.0-rc.2",
@@ -107,6 +109,6 @@
107
109
  "typescript": "^5.7.2",
108
110
  "vitest": "^2.1.8",
109
111
  "ws": "^8.18.0",
110
- "zod": "^4.1.11"
112
+ "zod3": "npm:zod@^3.25.76"
111
113
  }
112
114
  }