@rivet-dev/agentos-core 0.0.0-feat-on-limit-warning.62a2bc2 → 0.0.0-main.ab2ce7c
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/README.md +4 -7
- package/dist/agent-os.d.ts +116 -46
- package/dist/agent-os.js +740 -541
- package/dist/agentos-package.d.ts +29 -0
- package/dist/agentos-package.js +88 -0
- package/dist/base-filesystem.d.ts +2 -15
- package/dist/base-filesystem.js +23 -171
- package/dist/cron/types.d.ts +1 -1
- package/dist/default-software.d.ts +8 -0
- package/dist/default-software.js +10 -0
- package/dist/generated/AcpLimitsConfig.d.ts +4 -0
- package/dist/generated/AcpLimitsConfig.js +2 -0
- package/dist/generated/CreateVmConfig.d.ts +26 -0
- package/dist/generated/CreateVmConfig.js +1 -0
- package/dist/generated/FsPermissionRule.d.ts +6 -0
- package/dist/generated/FsPermissionRule.js +1 -0
- package/dist/generated/FsPermissionRuleSet.d.ts +6 -0
- package/dist/generated/FsPermissionRuleSet.js +1 -0
- package/dist/generated/FsPermissionScope.d.ts +3 -0
- package/dist/generated/FsPermissionScope.js +1 -0
- package/dist/generated/HttpLimitsConfig.d.ts +3 -0
- package/dist/generated/HttpLimitsConfig.js +2 -0
- package/dist/generated/JsModuleResolution.d.ts +1 -0
- package/dist/generated/JsModuleResolution.js +2 -0
- package/dist/generated/JsRuntimeConfig.d.ts +31 -0
- package/dist/generated/JsRuntimeConfig.js +1 -0
- package/dist/generated/JsRuntimeLimitsConfig.d.ts +11 -0
- package/dist/generated/JsRuntimeLimitsConfig.js +2 -0
- package/dist/generated/JsRuntimePlatform.d.ts +1 -0
- package/dist/generated/JsRuntimePlatform.js +2 -0
- package/dist/generated/MountPluginDescriptor.d.ts +4 -0
- package/dist/generated/MountPluginDescriptor.js +2 -0
- package/dist/generated/NativeRootFilesystemConfig.d.ts +5 -0
- package/dist/generated/NativeRootFilesystemConfig.js +1 -0
- package/dist/generated/PatternPermissionRule.d.ts +6 -0
- package/dist/generated/PatternPermissionRule.js +1 -0
- package/dist/generated/PatternPermissionRuleSet.d.ts +6 -0
- package/dist/generated/PatternPermissionRuleSet.js +1 -0
- package/dist/generated/PatternPermissionScope.d.ts +3 -0
- package/dist/generated/PatternPermissionScope.js +1 -0
- package/dist/generated/PermissionMode.d.ts +1 -0
- package/dist/generated/PermissionMode.js +2 -0
- package/dist/generated/PermissionsPolicy.d.ts +10 -0
- package/dist/generated/PermissionsPolicy.js +1 -0
- package/dist/generated/PluginLimitsConfig.d.ts +4 -0
- package/dist/generated/PluginLimitsConfig.js +2 -0
- package/dist/generated/PythonLimitsConfig.d.ts +6 -0
- package/dist/generated/PythonLimitsConfig.js +2 -0
- package/dist/generated/ResourceLimitsConfig.d.ts +24 -0
- package/dist/generated/ResourceLimitsConfig.js +2 -0
- package/dist/generated/RootFilesystemConfig.d.ts +9 -0
- package/dist/generated/RootFilesystemConfig.js +1 -0
- package/dist/generated/RootFilesystemEntry.d.ts +13 -0
- package/dist/generated/RootFilesystemEntry.js +1 -0
- package/dist/generated/RootFilesystemEntryEncoding.d.ts +1 -0
- package/dist/generated/RootFilesystemEntryEncoding.js +2 -0
- package/dist/generated/RootFilesystemEntryKind.d.ts +1 -0
- package/dist/generated/RootFilesystemEntryKind.js +2 -0
- package/dist/generated/RootFilesystemLowerDescriptor.d.ts +7 -0
- package/dist/generated/RootFilesystemLowerDescriptor.js +1 -0
- package/dist/generated/RootFilesystemMode.d.ts +1 -0
- package/dist/generated/RootFilesystemMode.js +2 -0
- package/dist/generated/ToolLimitsConfig.d.ts +10 -0
- package/dist/generated/ToolLimitsConfig.js +2 -0
- package/dist/generated/VmDnsConfig.d.ts +6 -0
- package/dist/generated/VmDnsConfig.js +2 -0
- package/dist/generated/VmLimitsConfig.d.ts +18 -0
- package/dist/generated/VmLimitsConfig.js +1 -0
- package/dist/generated/VmListenPolicyConfig.d.ts +5 -0
- package/dist/generated/VmListenPolicyConfig.js +2 -0
- package/dist/generated/WasmLimitsConfig.d.ts +7 -0
- package/dist/generated/WasmLimitsConfig.js +2 -0
- package/dist/host-dir-mount.d.ts +1 -1
- package/dist/host-tools.js +9 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/layers.d.ts +2 -2
- package/dist/layers.js +19 -10
- package/dist/options-schema.d.ts +19 -4
- package/dist/options-schema.js +30 -22
- package/dist/packages.d.ts +17 -116
- package/dist/packages.js +35 -322
- package/dist/runtime-compat.d.ts +22 -9
- package/dist/runtime-compat.js +126 -141
- package/dist/runtime.d.ts +32 -5
- package/dist/sandbox.d.ts +112 -0
- package/dist/sandbox.js +264 -0
- package/dist/sidecar/agentos-protocol.d.ts +88 -1
- package/dist/sidecar/agentos-protocol.js +134 -18
- package/dist/sidecar/native-process-client.d.ts +6 -3
- package/dist/sidecar/native-process-client.js +5 -3
- package/dist/sidecar/permissions.d.ts +1 -1
- package/dist/sidecar/permissions.js +3 -3
- package/dist/sidecar/rpc-client.d.ts +62 -4
- package/dist/sidecar/rpc-client.js +339 -85
- package/dist/types.d.ts +10 -3
- package/package.json +36 -32
- package/dist/agents.d.ts +0 -63
- package/dist/agents.js +0 -42
- package/fixtures/AGENTOS_SYSTEM_PROMPT.md +0 -21
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RootFilesystemEntry } from "./RootFilesystemEntry.js";
|
|
2
|
+
import type { RootFilesystemLowerDescriptor } from "./RootFilesystemLowerDescriptor.js";
|
|
3
|
+
import type { RootFilesystemMode } from "./RootFilesystemMode.js";
|
|
4
|
+
export type RootFilesystemConfig = {
|
|
5
|
+
mode: RootFilesystemMode;
|
|
6
|
+
disableDefaultBaseLayer: boolean;
|
|
7
|
+
lowers: Array<RootFilesystemLowerDescriptor>;
|
|
8
|
+
bootstrapEntries: Array<RootFilesystemEntry>;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RootFilesystemEntryEncoding } from "./RootFilesystemEntryEncoding.js";
|
|
2
|
+
import type { RootFilesystemEntryKind } from "./RootFilesystemEntryKind.js";
|
|
3
|
+
export type RootFilesystemEntry = {
|
|
4
|
+
path: string;
|
|
5
|
+
kind: RootFilesystemEntryKind;
|
|
6
|
+
mode?: number;
|
|
7
|
+
uid?: number;
|
|
8
|
+
gid?: number;
|
|
9
|
+
content?: string;
|
|
10
|
+
encoding?: RootFilesystemEntryEncoding;
|
|
11
|
+
target?: string;
|
|
12
|
+
executable: boolean;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type RootFilesystemEntryEncoding = "utf8" | "base64";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type RootFilesystemEntryKind = "file" | "directory" | "symlink";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type RootFilesystemMode = "ephemeral" | "read-only";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ToolLimitsConfig = {
|
|
2
|
+
defaultToolTimeoutMs?: number;
|
|
3
|
+
maxToolTimeoutMs?: number;
|
|
4
|
+
maxRegisteredToolkits?: number;
|
|
5
|
+
maxRegisteredToolsPerVm?: number;
|
|
6
|
+
maxToolsPerToolkit?: number;
|
|
7
|
+
maxToolSchemaBytes?: number;
|
|
8
|
+
maxToolExamplesPerTool?: number;
|
|
9
|
+
maxToolExampleInputBytes?: number;
|
|
10
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AcpLimitsConfig } from "./AcpLimitsConfig.js";
|
|
2
|
+
import type { HttpLimitsConfig } from "./HttpLimitsConfig.js";
|
|
3
|
+
import type { JsRuntimeLimitsConfig } from "./JsRuntimeLimitsConfig.js";
|
|
4
|
+
import type { PluginLimitsConfig } from "./PluginLimitsConfig.js";
|
|
5
|
+
import type { PythonLimitsConfig } from "./PythonLimitsConfig.js";
|
|
6
|
+
import type { ResourceLimitsConfig } from "./ResourceLimitsConfig.js";
|
|
7
|
+
import type { ToolLimitsConfig } from "./ToolLimitsConfig.js";
|
|
8
|
+
import type { WasmLimitsConfig } from "./WasmLimitsConfig.js";
|
|
9
|
+
export type VmLimitsConfig = {
|
|
10
|
+
resources?: ResourceLimitsConfig;
|
|
11
|
+
http?: HttpLimitsConfig;
|
|
12
|
+
tools?: ToolLimitsConfig;
|
|
13
|
+
plugins?: PluginLimitsConfig;
|
|
14
|
+
acp?: AcpLimitsConfig;
|
|
15
|
+
jsRuntime?: JsRuntimeLimitsConfig;
|
|
16
|
+
python?: PythonLimitsConfig;
|
|
17
|
+
wasm?: WasmLimitsConfig;
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/host-dir-mount.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MountConfigJsonObject, NativeMountPluginDescriptor } from "@
|
|
1
|
+
import type { MountConfigJsonObject, NativeMountPluginDescriptor } from "@rivet-dev/agentos-runtime-core/descriptors";
|
|
2
2
|
export interface HostDirBackendOptions {
|
|
3
3
|
/** Absolute path to the host directory to project into the VM. */
|
|
4
4
|
hostPath: string;
|
package/dist/host-tools.js
CHANGED
|
@@ -8,16 +8,25 @@ export function hostTool(def) {
|
|
|
8
8
|
export function toolKit(def) {
|
|
9
9
|
return def;
|
|
10
10
|
}
|
|
11
|
+
const TOOLKIT_COMMAND_NAME_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
12
|
+
function validateToolCommandName(kind, name) {
|
|
13
|
+
if (TOOLKIT_COMMAND_NAME_RE.test(name)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
throw new Error(`${kind} name "${name}" must be lowercase alphanumeric with optional single hyphen separators`);
|
|
17
|
+
}
|
|
11
18
|
/**
|
|
12
19
|
* Validate all description lengths in the given toolkits.
|
|
13
20
|
* Throws if any toolkit or tool description exceeds MAX_TOOL_DESCRIPTION_LENGTH.
|
|
14
21
|
*/
|
|
15
22
|
export function validateToolkits(toolKits) {
|
|
16
23
|
for (const tk of toolKits) {
|
|
24
|
+
validateToolCommandName("Toolkit", tk.name);
|
|
17
25
|
if (tk.description.length > MAX_TOOL_DESCRIPTION_LENGTH) {
|
|
18
26
|
throw new Error(`Toolkit "${tk.name}" description is ${tk.description.length} characters, max is ${MAX_TOOL_DESCRIPTION_LENGTH}`);
|
|
19
27
|
}
|
|
20
28
|
for (const [toolName, tool] of Object.entries(tk.tools)) {
|
|
29
|
+
validateToolCommandName("Tool", toolName);
|
|
21
30
|
if (tool.description.length > MAX_TOOL_DESCRIPTION_LENGTH) {
|
|
22
31
|
throw new Error(`Tool "${tk.name}/${toolName}" description is ${tool.description.length} characters, max is ${MAX_TOOL_DESCRIPTION_LENGTH}`);
|
|
23
32
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export { AgentOs, AgentOsSidecar } from "./agent-os.js";
|
|
2
|
-
export { AGENT_CONFIGS } from "./agents.js";
|
|
3
2
|
export { CronManager, InvalidScheduleError, PastScheduleError, TimerScheduleDriver, } from "./cron/index.js";
|
|
4
3
|
export { createHostDirBackend, nodeModulesMount } from "./host-dir-mount.js";
|
|
5
4
|
export { hostTool, MAX_TOOL_DESCRIPTION_LENGTH, toolKit, validateToolkits, } from "./host-tools.js";
|
|
6
5
|
export { agentOsLimitsSchema, agentOsOptionFieldSchemas, agentOsOptionsSchema, hostToolSchema, mountConfigSchema, nativeMountConfigSchema, parseAgentOsOptions, permissionsSchema, rootFilesystemConfigSchema, sharedSidecarConfigSchema, sidecarConfigSchema, toolKitSchema, } from "./options-schema.js";
|
|
7
6
|
export { createInMemoryLayerStore, createSnapshotExport, } from "./layers.js";
|
|
8
7
|
export { defineSoftware } from "./packages.js";
|
|
8
|
+
export { isPackageDescriptor, OPT_AGENTOS_BIN, OPT_AGENTOS_ROOT, tryReadAgentosPackageManifest, } from "./agentos-package.js";
|
|
9
9
|
export { isAcpTimeoutErrorData, isUnknownSessionErrorData, } from "./json-rpc.js";
|
|
10
10
|
export { createInMemoryFileSystem, KernelError } from "./runtime-compat.js";
|
|
11
|
+
export type { ExecOptions, ExecResult, ManagedProcess, ProcessInfo, ShellHandle, VirtualDirEntry, VirtualStat, } from "./runtime.js";
|
|
11
12
|
export type * from "./types.js";
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// @rivet-dev/agentos
|
|
2
2
|
export { AgentOs, AgentOsSidecar } from "./agent-os.js";
|
|
3
|
-
export { AGENT_CONFIGS } from "./agents.js";
|
|
4
3
|
export { CronManager, InvalidScheduleError, PastScheduleError, TimerScheduleDriver, } from "./cron/index.js";
|
|
5
4
|
export { createHostDirBackend, nodeModulesMount } from "./host-dir-mount.js";
|
|
6
5
|
export { hostTool, MAX_TOOL_DESCRIPTION_LENGTH, toolKit, validateToolkits, } from "./host-tools.js";
|
|
7
6
|
export { agentOsLimitsSchema, agentOsOptionFieldSchemas, agentOsOptionsSchema, hostToolSchema, mountConfigSchema, nativeMountConfigSchema, parseAgentOsOptions, permissionsSchema, rootFilesystemConfigSchema, sharedSidecarConfigSchema, sidecarConfigSchema, toolKitSchema, } from "./options-schema.js";
|
|
8
7
|
export { createInMemoryLayerStore, createSnapshotExport, } from "./layers.js";
|
|
9
8
|
export { defineSoftware } from "./packages.js";
|
|
9
|
+
export { isPackageDescriptor, OPT_AGENTOS_BIN, OPT_AGENTOS_ROOT, tryReadAgentosPackageManifest, } from "./agentos-package.js";
|
|
10
10
|
export { isAcpTimeoutErrorData, isUnknownSessionErrorData, } from "./json-rpc.js";
|
|
11
11
|
export { createInMemoryFileSystem, KernelError } from "./runtime-compat.js";
|
package/dist/layers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BaseFilesystemSnapshot } from "./base-filesystem.js";
|
|
2
2
|
import { type FilesystemEntry } from "./filesystem-snapshot.js";
|
|
3
3
|
import type { VirtualFileSystem } from "./runtime-compat.js";
|
|
4
4
|
export type OverlayFilesystemMode = "ephemeral" | "read-only";
|
|
@@ -45,7 +45,7 @@ export interface LayerStore {
|
|
|
45
45
|
mode: "read-only";
|
|
46
46
|
lowers: SnapshotLayerHandle[];
|
|
47
47
|
}): VirtualFileSystem;
|
|
48
|
+
dispose(): void;
|
|
48
49
|
}
|
|
49
50
|
export declare function createSnapshotExport(entries: FilesystemEntry[]): RootSnapshotExport;
|
|
50
51
|
export declare function createInMemoryLayerStore(): LayerStore;
|
|
51
|
-
export declare function createDefaultRootLowerInput(): SnapshotImportSource;
|
package/dist/layers.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
-
import { getBaseFilesystemSnapshot, } from "./base-filesystem.js";
|
|
3
2
|
import { createFilesystemFromEntries, snapshotVirtualFilesystem, } from "./filesystem-snapshot.js";
|
|
4
3
|
import { createOverlayBackend } from "./overlay-filesystem.js";
|
|
5
4
|
function cloneSnapshotHandle(storeId, layerId) {
|
|
@@ -73,8 +72,11 @@ export function createInMemoryLayerStore() {
|
|
|
73
72
|
}
|
|
74
73
|
return state;
|
|
75
74
|
}
|
|
76
|
-
|
|
75
|
+
const store = {
|
|
77
76
|
storeId,
|
|
77
|
+
get retainedLayerCount() {
|
|
78
|
+
return layers.size;
|
|
79
|
+
},
|
|
78
80
|
async createWritableLayer() {
|
|
79
81
|
const layerId = randomUUID();
|
|
80
82
|
const leaseId = randomUUID();
|
|
@@ -117,10 +119,11 @@ export function createInMemoryLayerStore() {
|
|
|
117
119
|
if (state.kind !== "writable") {
|
|
118
120
|
throw new Error(`Layer ${layer.layerId} is not writable`);
|
|
119
121
|
}
|
|
120
|
-
|
|
122
|
+
const baseFs = state.activeOverlay ?? state.fs;
|
|
123
|
+
if (!state.valid || state.leaseId !== layer.leaseId || !baseFs) {
|
|
121
124
|
throw new Error(`Writable layer ${layer.layerId} is no longer valid`);
|
|
122
125
|
}
|
|
123
|
-
const entries = await snapshotVirtualFilesystem(
|
|
126
|
+
const entries = await snapshotVirtualFilesystem(baseFs);
|
|
124
127
|
const snapshot = createSnapshotExport(entries).source;
|
|
125
128
|
const layerId = randomUUID();
|
|
126
129
|
layers.set(layerId, {
|
|
@@ -128,8 +131,11 @@ export function createInMemoryLayerStore() {
|
|
|
128
131
|
snapshot,
|
|
129
132
|
fs: await createFilesystemFromEntries(snapshot.filesystem.entries),
|
|
130
133
|
});
|
|
134
|
+
// Release the writable layer's filesystem payload now that it is sealed;
|
|
135
|
+
// the invalid tombstone is retained so stale handles still report cleanly.
|
|
131
136
|
state.valid = false;
|
|
132
137
|
state.activeOverlay = null;
|
|
138
|
+
state.fs = null;
|
|
133
139
|
return cloneSnapshotHandle(storeId, layerId);
|
|
134
140
|
},
|
|
135
141
|
createOverlayFilesystem(options) {
|
|
@@ -162,6 +168,9 @@ export function createInMemoryLayerStore() {
|
|
|
162
168
|
if (upperState.activeOverlay) {
|
|
163
169
|
throw new Error(`Writable layer ${options.upper.layerId} is already attached to an overlay`);
|
|
164
170
|
}
|
|
171
|
+
if (!upperState.fs) {
|
|
172
|
+
throw new Error(`Writable layer ${options.upper.layerId} is no longer valid`);
|
|
173
|
+
}
|
|
165
174
|
const overlay = createOverlayBackend({
|
|
166
175
|
upper: upperState.fs,
|
|
167
176
|
lowers: lowers.map((lower) => {
|
|
@@ -175,11 +184,11 @@ export function createInMemoryLayerStore() {
|
|
|
175
184
|
upperState.activeOverlay = overlay;
|
|
176
185
|
return overlay;
|
|
177
186
|
},
|
|
187
|
+
dispose() {
|
|
188
|
+
// Release every retained layer's filesystem payload so the store does
|
|
189
|
+
// not accumulate snapshots/writable layers for the process lifetime.
|
|
190
|
+
layers.clear();
|
|
191
|
+
},
|
|
178
192
|
};
|
|
179
|
-
|
|
180
|
-
export function createDefaultRootLowerInput() {
|
|
181
|
-
return {
|
|
182
|
-
kind: "base-filesystem-artifact",
|
|
183
|
-
source: getBaseFilesystemSnapshot(),
|
|
184
|
-
};
|
|
193
|
+
return store;
|
|
185
194
|
}
|
package/dist/options-schema.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
|
-
import type { AgentOsOptions, AgentStderrHandler, LimitWarningHandler, NativeMountConfig } from "./agent-os.js";
|
|
2
|
+
import type { AgentExitHandler, AgentOsOptions, AgentStderrHandler, LimitWarningHandler, NativeMountConfig } from "./agent-os.js";
|
|
3
3
|
import type { HostTool, ToolKit } from "./host-tools.js";
|
|
4
4
|
export declare const permissionsSchema: z.ZodObject<{
|
|
5
5
|
fs: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
@@ -87,7 +87,7 @@ export declare const permissionsSchema: z.ZodObject<{
|
|
|
87
87
|
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
88
88
|
}, z.core.$strict>>;
|
|
89
89
|
}, z.core.$strict>]>>;
|
|
90
|
-
|
|
90
|
+
binding: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
91
91
|
allow: "allow";
|
|
92
92
|
deny: "deny";
|
|
93
93
|
}>, z.ZodObject<{
|
|
@@ -151,6 +151,10 @@ export declare const agentOsLimitsSchema: z.ZodObject<{
|
|
|
151
151
|
}, z.core.$strict>>;
|
|
152
152
|
jsRuntime: z.ZodOptional<z.ZodObject<{
|
|
153
153
|
v8HeapLimitMb: z.ZodOptional<z.ZodNumber>;
|
|
154
|
+
syncRpcWaitTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
155
|
+
cpuTimeLimitMs: z.ZodOptional<z.ZodNumber>;
|
|
156
|
+
wallClockLimitMs: z.ZodOptional<z.ZodNumber>;
|
|
157
|
+
importCacheMaterializeTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
154
158
|
capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
155
159
|
stdinBufferLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
156
160
|
eventPayloadLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
@@ -159,12 +163,15 @@ export declare const agentOsLimitsSchema: z.ZodObject<{
|
|
|
159
163
|
python: z.ZodOptional<z.ZodObject<{
|
|
160
164
|
outputBufferMaxBytes: z.ZodOptional<z.ZodNumber>;
|
|
161
165
|
executionTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
166
|
+
maxOldSpaceMb: z.ZodOptional<z.ZodNumber>;
|
|
162
167
|
vfsRpcTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
163
168
|
}, z.core.$strict>>;
|
|
164
169
|
wasm: z.ZodOptional<z.ZodObject<{
|
|
165
170
|
maxModuleFileBytes: z.ZodOptional<z.ZodNumber>;
|
|
166
171
|
capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
167
172
|
syncReadLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
prewarmTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
174
|
+
runnerHeapLimitMb: z.ZodOptional<z.ZodNumber>;
|
|
168
175
|
}, z.core.$strict>>;
|
|
169
176
|
}, z.core.$strict>;
|
|
170
177
|
export declare const rootFilesystemConfigSchema: z.ZodObject<{
|
|
@@ -224,6 +231,7 @@ export declare const agentOsOptionFieldSchemas: {
|
|
|
224
231
|
readonly defaultSoftware: z.ZodOptional<z.ZodBoolean>;
|
|
225
232
|
readonly loopbackExemptPorts: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
226
233
|
readonly allowedNodeBuiltins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
234
|
+
readonly highResolutionTime: z.ZodOptional<z.ZodBoolean>;
|
|
227
235
|
readonly rootFilesystem: z.ZodOptional<z.ZodObject<{
|
|
228
236
|
type: z.ZodOptional<z.ZodLiteral<"overlay">>;
|
|
229
237
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
@@ -254,7 +262,6 @@ export declare const agentOsOptionFieldSchemas: {
|
|
|
254
262
|
lowers: z.ZodArray<z.ZodUnknown>;
|
|
255
263
|
}, z.core.$strict>;
|
|
256
264
|
}, z.core.$strict>]>>>;
|
|
257
|
-
readonly moduleAccessCwd: z.ZodOptional<z.ZodString>;
|
|
258
265
|
readonly additionalInstructions: z.ZodOptional<z.ZodString>;
|
|
259
266
|
readonly scheduleDriver: z.ZodOptional<z.ZodCustom<unknown, unknown>>;
|
|
260
267
|
readonly toolKits: z.ZodOptional<z.ZodArray<z.ZodType<ToolKit, unknown, z.core.$ZodTypeInternals<ToolKit, unknown>>>>;
|
|
@@ -344,7 +351,7 @@ export declare const agentOsOptionFieldSchemas: {
|
|
|
344
351
|
patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
345
352
|
}, z.core.$strict>>;
|
|
346
353
|
}, z.core.$strict>]>>;
|
|
347
|
-
|
|
354
|
+
binding: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
348
355
|
allow: "allow";
|
|
349
356
|
deny: "deny";
|
|
350
357
|
}>, z.ZodObject<{
|
|
@@ -415,6 +422,10 @@ export declare const agentOsOptionFieldSchemas: {
|
|
|
415
422
|
}, z.core.$strict>>;
|
|
416
423
|
jsRuntime: z.ZodOptional<z.ZodObject<{
|
|
417
424
|
v8HeapLimitMb: z.ZodOptional<z.ZodNumber>;
|
|
425
|
+
syncRpcWaitTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
426
|
+
cpuTimeLimitMs: z.ZodOptional<z.ZodNumber>;
|
|
427
|
+
wallClockLimitMs: z.ZodOptional<z.ZodNumber>;
|
|
428
|
+
importCacheMaterializeTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
418
429
|
capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
419
430
|
stdinBufferLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
420
431
|
eventPayloadLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
@@ -423,15 +434,19 @@ export declare const agentOsOptionFieldSchemas: {
|
|
|
423
434
|
python: z.ZodOptional<z.ZodObject<{
|
|
424
435
|
outputBufferMaxBytes: z.ZodOptional<z.ZodNumber>;
|
|
425
436
|
executionTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
437
|
+
maxOldSpaceMb: z.ZodOptional<z.ZodNumber>;
|
|
426
438
|
vfsRpcTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
427
439
|
}, z.core.$strict>>;
|
|
428
440
|
wasm: z.ZodOptional<z.ZodObject<{
|
|
429
441
|
maxModuleFileBytes: z.ZodOptional<z.ZodNumber>;
|
|
430
442
|
capturedOutputLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
431
443
|
syncReadLimitBytes: z.ZodOptional<z.ZodNumber>;
|
|
444
|
+
prewarmTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
445
|
+
runnerHeapLimitMb: z.ZodOptional<z.ZodNumber>;
|
|
432
446
|
}, z.core.$strict>>;
|
|
433
447
|
}, z.core.$strict>>;
|
|
434
448
|
readonly onAgentStderr: z.ZodOptional<z.ZodCustom<AgentStderrHandler, AgentStderrHandler>>;
|
|
449
|
+
readonly onAgentExit: z.ZodOptional<z.ZodCustom<AgentExitHandler, AgentExitHandler>>;
|
|
435
450
|
readonly onLimitWarning: z.ZodOptional<z.ZodCustom<LimitWarningHandler, LimitWarningHandler>>;
|
|
436
451
|
};
|
|
437
452
|
export declare const agentOsOptionsSchema: z.ZodType<AgentOsOptions>;
|
package/dist/options-schema.js
CHANGED
|
@@ -42,7 +42,7 @@ export const permissionsSchema = z
|
|
|
42
42
|
childProcess: patternPermissionsSchema.optional(),
|
|
43
43
|
process: patternPermissionsSchema.optional(),
|
|
44
44
|
env: patternPermissionsSchema.optional(),
|
|
45
|
-
|
|
45
|
+
binding: patternPermissionsSchema.optional(),
|
|
46
46
|
})
|
|
47
47
|
.strict();
|
|
48
48
|
export const agentOsLimitsSchema = z
|
|
@@ -73,59 +73,66 @@ export const agentOsLimitsSchema = z
|
|
|
73
73
|
.strict()
|
|
74
74
|
.optional(),
|
|
75
75
|
http: z
|
|
76
|
-
.object({ maxFetchResponseBytes:
|
|
76
|
+
.object({ maxFetchResponseBytes: positiveInteger.optional() })
|
|
77
77
|
.strict()
|
|
78
78
|
.optional(),
|
|
79
79
|
tools: z
|
|
80
80
|
.object({
|
|
81
81
|
defaultToolTimeoutMs: nonNegativeInteger.optional(),
|
|
82
82
|
maxToolTimeoutMs: nonNegativeInteger.optional(),
|
|
83
|
-
maxRegisteredToolkits:
|
|
84
|
-
maxRegisteredToolsPerVm:
|
|
85
|
-
maxToolsPerToolkit:
|
|
86
|
-
maxToolSchemaBytes:
|
|
83
|
+
maxRegisteredToolkits: positiveInteger.optional(),
|
|
84
|
+
maxRegisteredToolsPerVm: positiveInteger.optional(),
|
|
85
|
+
maxToolsPerToolkit: positiveInteger.optional(),
|
|
86
|
+
maxToolSchemaBytes: positiveInteger.optional(),
|
|
87
87
|
maxToolExamplesPerTool: nonNegativeInteger.optional(),
|
|
88
|
-
maxToolExampleInputBytes:
|
|
88
|
+
maxToolExampleInputBytes: positiveInteger.optional(),
|
|
89
89
|
})
|
|
90
90
|
.strict()
|
|
91
91
|
.optional(),
|
|
92
92
|
plugins: z
|
|
93
93
|
.object({
|
|
94
|
-
maxPersistedManifestBytes:
|
|
94
|
+
maxPersistedManifestBytes: positiveInteger.optional(),
|
|
95
95
|
maxPersistedManifestFileBytes: nonNegativeInteger.optional(),
|
|
96
96
|
})
|
|
97
97
|
.strict()
|
|
98
98
|
.optional(),
|
|
99
99
|
acp: z
|
|
100
100
|
.object({
|
|
101
|
-
maxReadLineBytes:
|
|
102
|
-
stdoutBufferByteLimit:
|
|
101
|
+
maxReadLineBytes: positiveInteger.optional(),
|
|
102
|
+
stdoutBufferByteLimit: positiveInteger.optional(),
|
|
103
103
|
})
|
|
104
104
|
.strict()
|
|
105
105
|
.optional(),
|
|
106
106
|
jsRuntime: z
|
|
107
107
|
.object({
|
|
108
|
-
v8HeapLimitMb:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
108
|
+
v8HeapLimitMb: positiveInteger.optional(),
|
|
109
|
+
syncRpcWaitTimeoutMs: nonNegativeInteger.optional(),
|
|
110
|
+
cpuTimeLimitMs: nonNegativeInteger.optional(),
|
|
111
|
+
wallClockLimitMs: nonNegativeInteger.optional(),
|
|
112
|
+
importCacheMaterializeTimeoutMs: positiveInteger.optional(),
|
|
113
|
+
capturedOutputLimitBytes: positiveInteger.optional(),
|
|
114
|
+
stdinBufferLimitBytes: positiveInteger.optional(),
|
|
115
|
+
eventPayloadLimitBytes: positiveInteger.optional(),
|
|
116
|
+
v8IpcMaxFrameBytes: positiveInteger.optional(),
|
|
113
117
|
})
|
|
114
118
|
.strict()
|
|
115
119
|
.optional(),
|
|
116
120
|
python: z
|
|
117
121
|
.object({
|
|
118
|
-
outputBufferMaxBytes:
|
|
119
|
-
executionTimeoutMs:
|
|
120
|
-
|
|
122
|
+
outputBufferMaxBytes: positiveInteger.optional(),
|
|
123
|
+
executionTimeoutMs: positiveInteger.optional(),
|
|
124
|
+
maxOldSpaceMb: nonNegativeInteger.optional(),
|
|
125
|
+
vfsRpcTimeoutMs: positiveInteger.optional(),
|
|
121
126
|
})
|
|
122
127
|
.strict()
|
|
123
128
|
.optional(),
|
|
124
129
|
wasm: z
|
|
125
130
|
.object({
|
|
126
|
-
maxModuleFileBytes:
|
|
127
|
-
capturedOutputLimitBytes:
|
|
128
|
-
syncReadLimitBytes:
|
|
131
|
+
maxModuleFileBytes: positiveInteger.optional(),
|
|
132
|
+
capturedOutputLimitBytes: positiveInteger.optional(),
|
|
133
|
+
syncReadLimitBytes: positiveInteger.optional(),
|
|
134
|
+
prewarmTimeoutMs: positiveInteger.optional(),
|
|
135
|
+
runnerHeapLimitMb: positiveInteger.optional(),
|
|
129
136
|
})
|
|
130
137
|
.strict()
|
|
131
138
|
.optional(),
|
|
@@ -236,9 +243,9 @@ export const agentOsOptionFieldSchemas = {
|
|
|
236
243
|
defaultSoftware: z.boolean().optional(),
|
|
237
244
|
loopbackExemptPorts: z.array(z.number().int().min(0).max(65535)).optional(),
|
|
238
245
|
allowedNodeBuiltins: stringArray.optional(),
|
|
246
|
+
highResolutionTime: z.boolean().optional(),
|
|
239
247
|
rootFilesystem: rootFilesystemConfigSchema.optional(),
|
|
240
248
|
mounts: z.array(mountConfigSchema).optional(),
|
|
241
|
-
moduleAccessCwd: z.string().optional(),
|
|
242
249
|
additionalInstructions: z.string().optional(),
|
|
243
250
|
scheduleDriver: z
|
|
244
251
|
.custom((value) => typeof value === "object" && value !== null, {
|
|
@@ -250,6 +257,7 @@ export const agentOsOptionFieldSchemas = {
|
|
|
250
257
|
sidecar: sidecarConfigSchema.optional(),
|
|
251
258
|
limits: agentOsLimitsSchema.optional(),
|
|
252
259
|
onAgentStderr: z.custom((value) => typeof value === "function", { message: "Expected function" }).optional(),
|
|
260
|
+
onAgentExit: z.custom((value) => typeof value === "function", { message: "Expected function" }).optional(),
|
|
253
261
|
onLimitWarning: z.custom((value) => typeof value === "function", { message: "Expected function" }).optional(),
|
|
254
262
|
};
|
|
255
263
|
export const agentOsOptionsSchema = z
|