@rivet-dev/agentos-core 0.0.0-abc-fixes-1.d8c4d95 → 0.0.0-agent-acp-codex-session-benchmark.62b1f46

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.
Files changed (128) hide show
  1. package/README.md +48 -48
  2. package/dist/agent-os.d.ts +215 -161
  3. package/dist/agent-os.js +1300 -2576
  4. package/dist/agentos-package.d.ts +27 -0
  5. package/dist/agentos-package.js +21 -0
  6. package/dist/base-filesystem.d.ts +1 -16
  7. package/dist/base-filesystem.js +1 -173
  8. package/dist/cron/cron-manager.d.ts +39 -14
  9. package/dist/cron/cron-manager.js +289 -128
  10. package/dist/cron/errors.d.ts +8 -0
  11. package/dist/cron/errors.js +16 -0
  12. package/dist/cron/index.d.ts +1 -3
  13. package/dist/cron/index.js +1 -2
  14. package/dist/cron/types.d.ts +2 -2
  15. package/dist/default-software.d.ts +8 -0
  16. package/dist/default-software.js +10 -0
  17. package/dist/filesystem-snapshot.d.ts +1 -1
  18. package/dist/filesystem-snapshot.js +1 -1
  19. package/dist/generated/AcpLimitsConfig.d.ts +4 -0
  20. package/dist/generated/AcpLimitsConfig.js +2 -0
  21. package/dist/generated/CreateVmConfig.d.ts +29 -0
  22. package/dist/generated/FsPermissionRule.d.ts +6 -0
  23. package/dist/generated/FsPermissionRule.js +1 -0
  24. package/dist/generated/FsPermissionRuleSet.d.ts +6 -0
  25. package/dist/generated/FsPermissionRuleSet.js +1 -0
  26. package/dist/generated/FsPermissionScope.d.ts +3 -0
  27. package/dist/generated/FsPermissionScope.js +1 -0
  28. package/dist/generated/HttpLimitsConfig.d.ts +3 -0
  29. package/dist/generated/HttpLimitsConfig.js +2 -0
  30. package/dist/generated/JsModuleResolution.d.ts +1 -0
  31. package/dist/generated/JsModuleResolution.js +2 -0
  32. package/dist/generated/JsRuntimeConfig.d.ts +31 -0
  33. package/dist/generated/JsRuntimeConfig.js +1 -0
  34. package/dist/generated/JsRuntimeLimitsConfig.d.ts +8 -0
  35. package/dist/generated/JsRuntimeLimitsConfig.js +2 -0
  36. package/dist/generated/JsRuntimePlatform.d.ts +1 -0
  37. package/dist/generated/JsRuntimePlatform.js +2 -0
  38. package/dist/generated/MountPluginDescriptor.d.ts +4 -0
  39. package/dist/generated/MountPluginDescriptor.js +2 -0
  40. package/dist/generated/NativeRootFilesystemConfig.d.ts +5 -0
  41. package/dist/generated/NativeRootFilesystemConfig.js +1 -0
  42. package/dist/generated/PatternPermissionRule.d.ts +6 -0
  43. package/dist/generated/PatternPermissionRule.js +1 -0
  44. package/dist/generated/PatternPermissionRuleSet.d.ts +6 -0
  45. package/dist/generated/PatternPermissionRuleSet.js +1 -0
  46. package/dist/generated/PatternPermissionScope.d.ts +3 -0
  47. package/dist/generated/PatternPermissionScope.js +1 -0
  48. package/dist/generated/PermissionMode.d.ts +1 -0
  49. package/dist/generated/PermissionMode.js +2 -0
  50. package/dist/generated/PermissionsPolicy.d.ts +10 -0
  51. package/dist/generated/PermissionsPolicy.js +1 -0
  52. package/dist/generated/PluginLimitsConfig.d.ts +4 -0
  53. package/dist/generated/PluginLimitsConfig.js +2 -0
  54. package/dist/generated/PythonLimitsConfig.d.ts +6 -0
  55. package/dist/generated/PythonLimitsConfig.js +2 -0
  56. package/dist/generated/ResourceLimitsConfig.d.ts +25 -0
  57. package/dist/generated/ResourceLimitsConfig.js +2 -0
  58. package/dist/generated/RootFilesystemConfig.d.ts +9 -0
  59. package/dist/generated/RootFilesystemConfig.js +1 -0
  60. package/dist/generated/RootFilesystemEntry.d.ts +13 -0
  61. package/dist/generated/RootFilesystemEntry.js +1 -0
  62. package/dist/generated/RootFilesystemEntryEncoding.d.ts +1 -0
  63. package/dist/generated/RootFilesystemEntryEncoding.js +2 -0
  64. package/dist/generated/RootFilesystemEntryKind.d.ts +1 -0
  65. package/dist/generated/RootFilesystemEntryKind.js +2 -0
  66. package/dist/generated/RootFilesystemLowerDescriptor.d.ts +7 -0
  67. package/dist/generated/RootFilesystemLowerDescriptor.js +1 -0
  68. package/dist/generated/RootFilesystemMode.d.ts +1 -0
  69. package/dist/generated/RootFilesystemMode.js +2 -0
  70. package/dist/generated/ToolLimitsConfig.d.ts +10 -0
  71. package/dist/generated/ToolLimitsConfig.js +2 -0
  72. package/dist/generated/VmDnsConfig.d.ts +6 -0
  73. package/dist/generated/VmDnsConfig.js +2 -0
  74. package/dist/generated/VmLimitsConfig.d.ts +18 -0
  75. package/dist/generated/VmLimitsConfig.js +1 -0
  76. package/dist/generated/VmListenPolicyConfig.d.ts +5 -0
  77. package/dist/generated/VmListenPolicyConfig.js +2 -0
  78. package/dist/generated/WasmLimitsConfig.d.ts +7 -0
  79. package/dist/generated/WasmLimitsConfig.js +2 -0
  80. package/dist/host-dir-mount.d.ts +5 -5
  81. package/dist/host-dir-mount.js +4 -4
  82. package/dist/host-tools-zod.js +27 -7
  83. package/dist/host-tools.d.ts +2 -9
  84. package/dist/host-tools.js +0 -18
  85. package/dist/index.d.ts +7 -4
  86. package/dist/index.js +6 -4
  87. package/dist/layers.d.ts +3 -3
  88. package/dist/layers.js +19 -10
  89. package/dist/memory-filesystem.d.ts +39 -0
  90. package/dist/memory-filesystem.js +375 -0
  91. package/dist/options-schema.d.ts +452 -0
  92. package/dist/options-schema.js +269 -0
  93. package/dist/overlay-filesystem.d.ts +1 -1
  94. package/dist/overlay-filesystem.js +3 -3
  95. package/dist/packages.d.ts +10 -123
  96. package/dist/packages.js +3 -329
  97. package/dist/runtime.d.ts +41 -184
  98. package/dist/sidecar/agentos-protocol.d.ts +232 -29
  99. package/dist/sidecar/agentos-protocol.js +456 -120
  100. package/dist/sidecar/binary.d.ts +2 -2
  101. package/dist/sidecar/binary.js +2 -2
  102. package/dist/sidecar/native-process-client.d.ts +5 -3
  103. package/dist/sidecar/native-process-client.js +5 -3
  104. package/dist/sidecar/permissions.d.ts +4 -3
  105. package/dist/sidecar/permissions.js +6 -23
  106. package/dist/sidecar/rpc-client.d.ts +74 -86
  107. package/dist/sidecar/rpc-client.js +422 -1418
  108. package/dist/test/file-system.d.ts +1 -1
  109. package/dist/test/file-system.js +3 -1
  110. package/dist/test/runtime.d.ts +2 -3
  111. package/dist/test/runtime.js +1 -1
  112. package/dist/test/terminal-harness.d.ts +5 -4
  113. package/dist/test/terminal-harness.js +12 -7
  114. package/dist/types.d.ts +12 -5
  115. package/package.json +37 -41
  116. package/dist/agents.d.ts +0 -63
  117. package/dist/agents.js +0 -42
  118. package/dist/cron/parse-schedule.d.ts +0 -25
  119. package/dist/cron/parse-schedule.js +0 -66
  120. package/dist/cron/schedule-driver.d.ts +0 -19
  121. package/dist/cron/timer-driver.d.ts +0 -17
  122. package/dist/cron/timer-driver.js +0 -61
  123. package/dist/runtime-compat.d.ts +0 -475
  124. package/dist/runtime-compat.js +0 -2010
  125. package/dist/sidecar/cargo.d.ts +0 -2
  126. package/dist/sidecar/cargo.js +0 -142
  127. package/fixtures/AGENTOS_SYSTEM_PROMPT.md +0 -21
  128. /package/dist/{cron/schedule-driver.js → generated/CreateVmConfig.js} +0 -0
@@ -0,0 +1,31 @@
1
+ import type { JsModuleResolution } from "./JsModuleResolution.js";
2
+ import type { JsRuntimePlatform } from "./JsRuntimePlatform.js";
3
+ /**
4
+ * Guest JavaScript host-environment configuration.
5
+ *
6
+ * Selects which globals/builtins/module-resolution surface guest JS sees,
7
+ * modeled on esbuild's `platform`. Omitting this preserves full Node.js
8
+ * emulation (`platform = node`).
9
+ */
10
+ export type JsRuntimeConfig = {
11
+ /**
12
+ * Which host environment to emulate for guest JS. Default `node`.
13
+ */
14
+ platform?: JsRuntimePlatform;
15
+ /**
16
+ * How bare import specifiers resolve. Independent of `platform`.
17
+ * Default `node`.
18
+ */
19
+ moduleResolution?: JsModuleResolution;
20
+ /**
21
+ * Node builtin-module allow-list. Only valid when `platform = node`.
22
+ * `None` => engine default allow-list. `Some([])` => deny all builtins.
23
+ * `Some([..])` => exactly those.
24
+ */
25
+ allowedBuiltins?: Array<string>;
26
+ /**
27
+ * Opt in to a high-resolution monotonic guest clock. Default false keeps
28
+ * the security-oriented 1ms timer resolution.
29
+ */
30
+ highResolutionTime?: boolean;
31
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export type JsRuntimeLimitsConfig = {
2
+ v8HeapLimitMb?: number;
3
+ syncRpcWaitTimeoutMs?: number;
4
+ cpuTimeLimitMs?: number;
5
+ wallClockLimitMs?: number;
6
+ importCacheMaterializeTimeoutMs?: number;
7
+ capturedOutputLimitBytes?: number;
8
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type JsRuntimePlatform = "node" | "browser" | "neutral" | "bare";
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,4 @@
1
+ export type MountPluginDescriptor = {
2
+ id: string;
3
+ config?: import("@rivet-dev/agentos-runtime-core/descriptors").MountConfigJsonValue;
4
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { MountPluginDescriptor } from "./MountPluginDescriptor.js";
2
+ export type NativeRootFilesystemConfig = {
3
+ plugin: MountPluginDescriptor;
4
+ readOnly?: boolean;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { PermissionMode } from "./PermissionMode.js";
2
+ export type PatternPermissionRule = {
3
+ mode: PermissionMode;
4
+ operations?: Array<string>;
5
+ patterns?: Array<string>;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { PatternPermissionRule } from "./PatternPermissionRule.js";
2
+ import type { PermissionMode } from "./PermissionMode.js";
3
+ export type PatternPermissionRuleSet = {
4
+ default?: PermissionMode;
5
+ rules: Array<PatternPermissionRule>;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { PatternPermissionRuleSet } from "./PatternPermissionRuleSet.js";
2
+ import type { PermissionMode } from "./PermissionMode.js";
3
+ export type PatternPermissionScope = PermissionMode | PatternPermissionRuleSet;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export type PermissionMode = "allow" | "ask" | "deny";
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { FsPermissionScope } from "./FsPermissionScope.js";
2
+ import type { PatternPermissionScope } from "./PatternPermissionScope.js";
3
+ export type PermissionsPolicy = {
4
+ fs?: FsPermissionScope;
5
+ network?: PatternPermissionScope;
6
+ childProcess?: PatternPermissionScope;
7
+ process?: PatternPermissionScope;
8
+ env?: PatternPermissionScope;
9
+ binding?: PatternPermissionScope;
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export type PluginLimitsConfig = {
2
+ maxPersistedManifestBytes?: number;
3
+ maxPersistedManifestFileBytes?: number;
4
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,6 @@
1
+ export type PythonLimitsConfig = {
2
+ outputBufferMaxBytes?: number;
3
+ executionTimeoutMs?: number;
4
+ maxOldSpaceMb?: number;
5
+ vfsRpcTimeoutMs?: number;
6
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,25 @@
1
+ export type ResourceLimitsConfig = {
2
+ cpuCount?: number;
3
+ maxProcesses?: number;
4
+ maxCapturedOutputBytes?: number;
5
+ maxOpenFds?: number;
6
+ maxPipes?: number;
7
+ maxPtys?: number;
8
+ maxSockets?: number;
9
+ maxConnections?: number;
10
+ maxSocketBufferedBytes?: number;
11
+ maxSocketDatagramQueueLen?: number;
12
+ maxFilesystemBytes?: number;
13
+ maxInodeCount?: number;
14
+ maxBlockingReadMs?: number;
15
+ maxPreadBytes?: number;
16
+ maxFdWriteBytes?: number;
17
+ maxProcessArgvBytes?: number;
18
+ maxProcessEnvBytes?: number;
19
+ maxReaddirEntries?: number;
20
+ maxRecursiveFsDepth?: number;
21
+ maxRecursiveFsEntries?: number;
22
+ maxWasmFuel?: number;
23
+ maxWasmMemoryBytes?: number;
24
+ maxWasmStackBytes?: number;
25
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -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,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type RootFilesystemEntryKind = "file" | "directory" | "symlink";
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { RootFilesystemEntry } from "./RootFilesystemEntry.js";
2
+ export type RootFilesystemLowerDescriptor = {
3
+ "kind": "snapshot";
4
+ entries: Array<RootFilesystemEntry>;
5
+ } | {
6
+ "kind": "bundledBaseFilesystem";
7
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export type RootFilesystemMode = "ephemeral" | "read-only";
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -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,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,6 @@
1
+ export type VmDnsConfig = {
2
+ nameServers: Array<string>;
3
+ overrides: {
4
+ [key in string]?: Array<string>;
5
+ };
6
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -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 {};
@@ -0,0 +1,5 @@
1
+ export type VmListenPolicyConfig = {
2
+ portMin?: number;
3
+ portMax?: number;
4
+ allowPrivileged?: boolean;
5
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,7 @@
1
+ export type WasmLimitsConfig = {
2
+ maxModuleFileBytes?: number;
3
+ capturedOutputLimitBytes?: number;
4
+ syncReadLimitBytes?: number;
5
+ prewarmTimeoutMs?: number;
6
+ runnerHeapLimitMb?: number;
7
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -1,13 +1,13 @@
1
- import type { MountConfigJsonObject, NativeMountPluginDescriptor } from "@secure-exec/core/descriptors";
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;
5
- /** If true (default), write operations are blocked for the mount. */
5
+ /** If true, write operations are blocked for the mount. */
6
6
  readOnly?: boolean;
7
7
  }
8
8
  export interface HostDirMountPluginConfig extends MountConfigJsonObject {
9
9
  hostPath: string;
10
- readOnly: boolean;
10
+ readOnly?: boolean;
11
11
  }
12
12
  /**
13
13
  * Create a declarative host-dir mount plugin descriptor.
@@ -20,7 +20,7 @@ export declare function createHostDirBackend(options: HostDirBackendOptions): Na
20
20
  export interface NodeModulesMountConfig {
21
21
  path: string;
22
22
  plugin: NativeMountPluginDescriptor<HostDirMountPluginConfig>;
23
- readOnly: boolean;
23
+ readOnly?: boolean;
24
24
  }
25
25
  /**
26
26
  * Mount a host `node_modules` directory into the VM at `/root/node_modules`.
@@ -31,7 +31,7 @@ export interface NodeModulesMountConfig {
31
31
  * resolvable in the guest (e.g. the agent SDK + its transitive deps).
32
32
  *
33
33
  * @param hostNodeModulesDir Absolute host path to a `node_modules` directory.
34
- * @param opts.readOnly Defaults to `true`; the mount is read-only.
34
+ * @param opts.readOnly Marks the mount read-only when explicitly true.
35
35
  */
36
36
  export declare function nodeModulesMount(hostNodeModulesDir: string, opts?: {
37
37
  readOnly?: boolean;
@@ -9,7 +9,7 @@ export function createHostDirBackend(options) {
9
9
  id: "host_dir",
10
10
  config: {
11
11
  hostPath: options.hostPath,
12
- readOnly: options.readOnly ?? true,
12
+ ...(options.readOnly === undefined ? {} : { readOnly: options.readOnly }),
13
13
  },
14
14
  };
15
15
  }
@@ -22,13 +22,13 @@ export function createHostDirBackend(options) {
22
22
  * resolvable in the guest (e.g. the agent SDK + its transitive deps).
23
23
  *
24
24
  * @param hostNodeModulesDir Absolute host path to a `node_modules` directory.
25
- * @param opts.readOnly Defaults to `true`; the mount is read-only.
25
+ * @param opts.readOnly Marks the mount read-only when explicitly true.
26
26
  */
27
27
  export function nodeModulesMount(hostNodeModulesDir, opts) {
28
- const readOnly = opts?.readOnly ?? true;
28
+ const readOnly = opts?.readOnly;
29
29
  return {
30
30
  path: "/root/node_modules",
31
31
  plugin: createHostDirBackend({ hostPath: hostNodeModulesDir, readOnly }),
32
- readOnly,
32
+ ...(readOnly === undefined ? {} : { readOnly }),
33
33
  };
34
34
  }
@@ -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`);
@@ -1,12 +1,10 @@
1
1
  import type { ZodType } from "zod";
2
- /** Maximum length for tool and toolkit descriptions (characters). */
3
- export declare const MAX_TOOL_DESCRIPTION_LENGTH = 200;
4
2
  /**
5
3
  * A single tool that executes on the host.
6
4
  * Mirrors the shape of AI SDK's tool() but with host-execution semantics.
7
5
  */
8
6
  export interface HostTool<INPUT = any, OUTPUT = any> {
9
- /** Description shown to the agent in --help and prompt docs. Max 200 characters. */
7
+ /** Description shown to the agent in --help and prompt docs. */
10
8
  description: string;
11
9
  /** Zod schema for the input. Drives CLI flag generation and validation. */
12
10
  inputSchema: ZodType<INPUT>;
@@ -14,7 +12,7 @@ export interface HostTool<INPUT = any, OUTPUT = any> {
14
12
  execute: (input: INPUT) => Promise<OUTPUT> | OUTPUT;
15
13
  /** Examples included in auto-generated prompt docs. */
16
14
  examples?: ToolExample<INPUT>[];
17
- /** Timeout in ms. Default: 30000. */
15
+ /** Explicit timeout override in milliseconds. */
18
16
  timeout?: number;
19
17
  }
20
18
  export interface ToolExample<INPUT = any> {
@@ -38,8 +36,3 @@ export interface ToolKit {
38
36
  export declare function hostTool<INPUT, OUTPUT>(def: HostTool<INPUT, OUTPUT>): HostTool<INPUT, OUTPUT>;
39
37
  /** Helper to create a ToolKit. */
40
38
  export declare function toolKit(def: ToolKit): ToolKit;
41
- /**
42
- * Validate all description lengths in the given toolkits.
43
- * Throws if any toolkit or tool description exceeds MAX_TOOL_DESCRIPTION_LENGTH.
44
- */
45
- export declare function validateToolkits(toolKits: ToolKit[]): void;
@@ -1,5 +1,3 @@
1
- /** Maximum length for tool and toolkit descriptions (characters). */
2
- export const MAX_TOOL_DESCRIPTION_LENGTH = 200;
3
1
  /** Helper to create a HostTool with type inference. */
4
2
  export function hostTool(def) {
5
3
  return def;
@@ -8,19 +6,3 @@ export function hostTool(def) {
8
6
  export function toolKit(def) {
9
7
  return def;
10
8
  }
11
- /**
12
- * Validate all description lengths in the given toolkits.
13
- * Throws if any toolkit or tool description exceeds MAX_TOOL_DESCRIPTION_LENGTH.
14
- */
15
- export function validateToolkits(toolKits) {
16
- for (const tk of toolKits) {
17
- if (tk.description.length > MAX_TOOL_DESCRIPTION_LENGTH) {
18
- throw new Error(`Toolkit "${tk.name}" description is ${tk.description.length} characters, max is ${MAX_TOOL_DESCRIPTION_LENGTH}`);
19
- }
20
- for (const [toolName, tool] of Object.entries(tk.tools)) {
21
- if (tool.description.length > MAX_TOOL_DESCRIPTION_LENGTH) {
22
- throw new Error(`Tool "${tk.name}/${toolName}" description is ${tool.description.length} characters, max is ${MAX_TOOL_DESCRIPTION_LENGTH}`);
23
- }
24
- }
25
- }
26
- }
package/dist/index.d.ts CHANGED
@@ -1,10 +1,13 @@
1
1
  export { AgentOs, AgentOsSidecar } from "./agent-os.js";
2
- export { AGENT_CONFIGS } from "./agents.js";
3
- export { CronManager, InvalidScheduleError, PastScheduleError, TimerScheduleDriver, } from "./cron/index.js";
2
+ export { CronManager, InvalidScheduleError, PastScheduleError, } from "./cron/index.js";
4
3
  export { createHostDirBackend, nodeModulesMount } from "./host-dir-mount.js";
5
- export { hostTool, MAX_TOOL_DESCRIPTION_LENGTH, toolKit, validateToolkits, } from "./host-tools.js";
4
+ export { hostTool, toolKit, } from "./host-tools.js";
5
+ export { agentOsLimitsSchema, agentOsOptionFieldSchemas, agentOsOptionsSchema, hostToolSchema, mountConfigSchema, nativeMountConfigSchema, parseAgentOsOptions, permissionsSchema, rootFilesystemConfigSchema, sharedSidecarConfigSchema, sidecarConfigSchema, toolKitSchema, } from "./options-schema.js";
6
6
  export { createInMemoryLayerStore, createSnapshotExport, } from "./layers.js";
7
7
  export { defineSoftware } from "./packages.js";
8
+ export { isPackageDescriptor, OPT_AGENTOS_BIN, OPT_AGENTOS_ROOT, } from "./agentos-package.js";
8
9
  export { isAcpTimeoutErrorData, isUnknownSessionErrorData, } from "./json-rpc.js";
9
- export { createInMemoryFileSystem, KernelError } from "./runtime-compat.js";
10
+ export { createInMemoryFileSystem, KernelError } from "./memory-filesystem.js";
11
+ export { SidecarRequestRejected } from "@rivet-dev/agentos-runtime-core/sidecar-errors";
12
+ export type { ExecOptions, ExecResult, ManagedProcess, ProcessInfo, ShellHandle, VirtualDirEntry, VirtualStat, } from "./runtime.js";
10
13
  export type * from "./types.js";
package/dist/index.js CHANGED
@@ -1,10 +1,12 @@
1
1
  // @rivet-dev/agentos
2
2
  export { AgentOs, AgentOsSidecar } from "./agent-os.js";
3
- export { AGENT_CONFIGS } from "./agents.js";
4
- export { CronManager, InvalidScheduleError, PastScheduleError, TimerScheduleDriver, } from "./cron/index.js";
3
+ export { CronManager, InvalidScheduleError, PastScheduleError, } from "./cron/index.js";
5
4
  export { createHostDirBackend, nodeModulesMount } from "./host-dir-mount.js";
6
- export { hostTool, MAX_TOOL_DESCRIPTION_LENGTH, toolKit, validateToolkits, } from "./host-tools.js";
5
+ export { hostTool, toolKit, } from "./host-tools.js";
6
+ export { agentOsLimitsSchema, agentOsOptionFieldSchemas, agentOsOptionsSchema, hostToolSchema, mountConfigSchema, nativeMountConfigSchema, parseAgentOsOptions, permissionsSchema, rootFilesystemConfigSchema, sharedSidecarConfigSchema, sidecarConfigSchema, toolKitSchema, } from "./options-schema.js";
7
7
  export { createInMemoryLayerStore, createSnapshotExport, } from "./layers.js";
8
8
  export { defineSoftware } from "./packages.js";
9
+ export { isPackageDescriptor, OPT_AGENTOS_BIN, OPT_AGENTOS_ROOT, } from "./agentos-package.js";
9
10
  export { isAcpTimeoutErrorData, isUnknownSessionErrorData, } from "./json-rpc.js";
10
- export { createInMemoryFileSystem, KernelError } from "./runtime-compat.js";
11
+ export { createInMemoryFileSystem, KernelError } from "./memory-filesystem.js";
12
+ export { SidecarRequestRejected } from "@rivet-dev/agentos-runtime-core/sidecar-errors";
package/dist/layers.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { type BaseFilesystemSnapshot } from "./base-filesystem.js";
1
+ import type { BaseFilesystemSnapshot } from "./base-filesystem.js";
2
2
  import { type FilesystemEntry } from "./filesystem-snapshot.js";
3
- import type { VirtualFileSystem } from "./runtime-compat.js";
3
+ import type { VirtualFileSystem } from "./runtime.js";
4
4
  export type OverlayFilesystemMode = "ephemeral" | "read-only";
5
5
  export interface FilesystemSnapshotExport {
6
6
  format: "agentos-filesystem-snapshot-v1";
@@ -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;