@rivet-dev/agentos-core 0.2.16-rc.3 → 0.2.18

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.
@@ -109,13 +109,23 @@ import type { SoftwareInput } from "./packages.js";
109
109
  import { type AgentOsSidecarPlacement } from "./sidecar/rpc-client.js";
110
110
  export interface AgentOsSharedSidecarOptions {
111
111
  pool?: string;
112
+ runtime?: AgentOsSidecarRuntimeConfig;
112
113
  }
113
114
  export interface AgentOsCreateSidecarOptions {
114
115
  sidecarId?: string;
116
+ runtime?: AgentOsSidecarRuntimeConfig;
117
+ }
118
+ /** Process-wide runtime settings applied when the native sidecar starts. */
119
+ export interface AgentOsSidecarRuntimeConfig {
120
+ executor?: {
121
+ /** Optional ceiling for concurrent V8 executors. Omit to leave admission uncapped. */
122
+ maxActiveVms?: number;
123
+ };
115
124
  }
116
125
  export type AgentOsSidecarConfig = {
117
126
  kind: "shared";
118
127
  pool?: string;
128
+ runtime?: AgentOsSidecarRuntimeConfig;
119
129
  } | {
120
130
  kind: "explicit";
121
131
  handle: AgentOsSidecar;
@@ -925,7 +935,7 @@ export declare class AgentOs {
925
935
  export declare function getAgentOsRuntimeAdmin(vm: AgentOs): AgentOsRuntimeAdmin;
926
936
  export declare function getAgentOsKernel(vm: AgentOs): Kernel;
927
937
  export declare class AgentOsSidecar {
928
- constructor(sidecarId: string, placement: AgentOsSidecarPlacement, sharedPool?: string);
938
+ constructor(sidecarId: string, placement: AgentOsSidecarPlacement, sharedPool?: string, runtime?: AgentOsSidecarRuntimeConfig);
929
939
  describe(): AgentOsSidecarDescription;
930
940
  dispose(): Promise<void>;
931
941
  }
package/dist/agent-os.js CHANGED
@@ -4566,7 +4566,9 @@ export function getAgentOsKernel(vm) {
4566
4566
  }
4567
4567
  function resolveAgentOsSidecar(config) {
4568
4568
  if (!config || config.kind === "shared") {
4569
- return getSharedAgentOsSidecarInternal(config?.kind === "shared" ? { pool: config.pool } : undefined);
4569
+ return getSharedAgentOsSidecarInternal(config?.kind === "shared"
4570
+ ? { pool: config.pool, runtime: config.runtime }
4571
+ : undefined);
4570
4572
  }
4571
4573
  return config.handle;
4572
4574
  }
@@ -4677,7 +4679,7 @@ function ensureSharedSidecarNativeProcess(sidecar) {
4677
4679
  const client = SidecarProcess.spawn({
4678
4680
  cwd: REPO_ROOT,
4679
4681
  command: ensureNativeSidecarBinary(),
4680
- args: [],
4682
+ args: sidecarRuntimeArgs(state.runtime),
4681
4683
  });
4682
4684
  // Track the child immediately — BEFORE the handshake await — so a
4683
4685
  // failed `authenticateAndOpenSession()` can still reap it (otherwise
@@ -4740,7 +4742,7 @@ async function disposeSharedSidecarNativeProcess(state) {
4740
4742
  }
4741
4743
  }
4742
4744
  export class AgentOsSidecar {
4743
- constructor(sidecarId, placement, sharedPool) {
4745
+ constructor(sidecarId, placement, sharedPool, runtime) {
4744
4746
  sidecarStates.set(this, {
4745
4747
  description: {
4746
4748
  sidecarId,
@@ -4750,6 +4752,7 @@ export class AgentOsSidecar {
4750
4752
  },
4751
4753
  activeLeases: new Set(),
4752
4754
  sharedPool,
4755
+ runtime: normalizeSidecarRuntimeConfig(runtime),
4753
4756
  });
4754
4757
  }
4755
4758
  describe() {
@@ -4789,7 +4792,7 @@ function createAgentOsSidecarInternal(options = {}) {
4789
4792
  return new AgentOsSidecar(sidecarId, {
4790
4793
  kind: "explicit",
4791
4794
  sidecarId,
4792
- });
4795
+ }, undefined, options.runtime);
4793
4796
  }
4794
4797
  /**
4795
4798
  * Test-only escape hatch: dispose every cached shared sidecar so vitest
@@ -4818,12 +4821,37 @@ function getSharedAgentOsSidecarInternal(options = {}) {
4818
4821
  const pool = options.pool ?? "default";
4819
4822
  const existing = sharedSidecars.get(pool);
4820
4823
  if (existing && existing.describe().state !== "disposed") {
4824
+ if (options.runtime !== undefined) {
4825
+ const requested = normalizeSidecarRuntimeConfig(options.runtime);
4826
+ const configured = getSidecarState(existing).runtime;
4827
+ if (!sidecarRuntimeConfigsEqual(requested, configured)) {
4828
+ throw new Error(`Shared sidecar pool ${JSON.stringify(pool)} already exists with different runtime settings`);
4829
+ }
4830
+ }
4821
4831
  return existing;
4822
4832
  }
4823
- const sidecar = new AgentOsSidecar(`agentos-shared-sidecar:${pool}`, { kind: "shared", ...(pool ? { pool } : {}) }, pool);
4833
+ const sidecar = new AgentOsSidecar(`agentos-shared-sidecar:${pool}`, { kind: "shared", ...(pool ? { pool } : {}) }, pool, options.runtime);
4824
4834
  sharedSidecars.set(pool, sidecar);
4825
4835
  return sidecar;
4826
4836
  }
4837
+ function normalizeSidecarRuntimeConfig(runtime) {
4838
+ const maxActiveVms = runtime?.executor?.maxActiveVms;
4839
+ if (maxActiveVms === undefined)
4840
+ return {};
4841
+ if (!Number.isSafeInteger(maxActiveVms) || maxActiveVms <= 0) {
4842
+ throw new Error("runtime.executor.maxActiveVms must be a positive safe integer");
4843
+ }
4844
+ return { executor: { maxActiveVms } };
4845
+ }
4846
+ function sidecarRuntimeConfigsEqual(left, right) {
4847
+ return left.executor?.maxActiveVms === right.executor?.maxActiveVms;
4848
+ }
4849
+ function sidecarRuntimeArgs(runtime) {
4850
+ const maxActiveVms = runtime.executor?.maxActiveVms;
4851
+ return maxActiveVms === undefined
4852
+ ? []
4853
+ : ["--max-active-vms", String(maxActiveVms)];
4854
+ }
4827
4855
  async function leaseAgentOsSidecarVm(sidecar, options) {
4828
4856
  const state = getSidecarState(sidecar);
4829
4857
  if (state.description.state !== "ready") {
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export { CronManager, InvalidScheduleError, PastScheduleError, TimerScheduleDriv
4
4
  export { createHostDirBackend, nodeModulesMount } from "./host-dir-mount.js";
5
5
  export { binding, MAX_BINDING_DESCRIPTION_LENGTH, bindings, validateBindings, } from "./bindings.js";
6
6
  export type { Binding, BindingExample, Bindings } from "./bindings.js";
7
- export { agentOsLimitsSchema, agentOsOptionFieldSchemas, agentOsOptionsSchema, bindingSchema, mountConfigSchema, nativeMountConfigSchema, parseAgentOsOptions, permissionsSchema, rootFilesystemConfigSchema, sharedSidecarConfigSchema, sidecarConfigSchema, bindingsSchema, } from "./options-schema.js";
7
+ export { agentOsLimitsSchema, agentOsOptionFieldSchemas, agentOsOptionsSchema, bindingSchema, mountConfigSchema, nativeMountConfigSchema, parseAgentOsOptions, permissionsSchema, rootFilesystemConfigSchema, sharedSidecarConfigSchema, sidecarConfigSchema, bindingsSchema, sidecarRuntimeConfigSchema, } from "./options-schema.js";
8
8
  export { createSnapshotExport } from "./layers.js";
9
9
  export { defineSoftware } from "./packages.js";
10
10
  export { isPackageDescriptor, OPT_AGENTOS_BIN, OPT_AGENTOS_ROOT, tryReadAgentosPackageManifest, } from "./agentos-package.js";
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ export { AgentOs, AgentOsSidecar } from "./agent-os.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 { binding, MAX_BINDING_DESCRIPTION_LENGTH, bindings, validateBindings, } from "./bindings.js";
6
- export { agentOsLimitsSchema, agentOsOptionFieldSchemas, agentOsOptionsSchema, bindingSchema, mountConfigSchema, nativeMountConfigSchema, parseAgentOsOptions, permissionsSchema, rootFilesystemConfigSchema, sharedSidecarConfigSchema, sidecarConfigSchema, bindingsSchema, } from "./options-schema.js";
6
+ export { agentOsLimitsSchema, agentOsOptionFieldSchemas, agentOsOptionsSchema, bindingSchema, mountConfigSchema, nativeMountConfigSchema, parseAgentOsOptions, permissionsSchema, rootFilesystemConfigSchema, sharedSidecarConfigSchema, sidecarConfigSchema, bindingsSchema, sidecarRuntimeConfigSchema, } from "./options-schema.js";
7
7
  export { createSnapshotExport } from "./layers.js";
8
8
  export { defineSoftware } from "./packages.js";
9
9
  export { isPackageDescriptor, OPT_AGENTOS_BIN, OPT_AGENTOS_ROOT, tryReadAgentosPackageManifest, } from "./agentos-package.js";
@@ -249,13 +249,28 @@ export declare const mountConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
249
249
  lowers: z.ZodArray<z.ZodUnknown>;
250
250
  }, z.core.$strict>;
251
251
  }, z.core.$strict>]>;
252
+ export declare const sidecarRuntimeConfigSchema: z.ZodObject<{
253
+ executor: z.ZodOptional<z.ZodObject<{
254
+ maxActiveVms: z.ZodOptional<z.ZodNumber>;
255
+ }, z.core.$strict>>;
256
+ }, z.core.$strict>;
252
257
  export declare const sharedSidecarConfigSchema: z.ZodObject<{
253
258
  kind: z.ZodLiteral<"shared">;
254
259
  pool: z.ZodOptional<z.ZodString>;
260
+ runtime: z.ZodOptional<z.ZodObject<{
261
+ executor: z.ZodOptional<z.ZodObject<{
262
+ maxActiveVms: z.ZodOptional<z.ZodNumber>;
263
+ }, z.core.$strict>>;
264
+ }, z.core.$strict>>;
255
265
  }, z.core.$strict>;
256
266
  export declare const sidecarConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
257
267
  kind: z.ZodLiteral<"shared">;
258
268
  pool: z.ZodOptional<z.ZodString>;
269
+ runtime: z.ZodOptional<z.ZodObject<{
270
+ executor: z.ZodOptional<z.ZodObject<{
271
+ maxActiveVms: z.ZodOptional<z.ZodNumber>;
272
+ }, z.core.$strict>>;
273
+ }, z.core.$strict>>;
259
274
  }, z.core.$strict>, z.ZodObject<{
260
275
  kind: z.ZodLiteral<"explicit">;
261
276
  handle: z.ZodUnknown;
@@ -456,6 +471,11 @@ export declare const agentOsOptionFieldSchemas: {
456
471
  readonly sidecar: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
457
472
  kind: z.ZodLiteral<"shared">;
458
473
  pool: z.ZodOptional<z.ZodString>;
474
+ runtime: z.ZodOptional<z.ZodObject<{
475
+ executor: z.ZodOptional<z.ZodObject<{
476
+ maxActiveVms: z.ZodOptional<z.ZodNumber>;
477
+ }, z.core.$strict>>;
478
+ }, z.core.$strict>>;
459
479
  }, z.core.$strict>, z.ZodObject<{
460
480
  kind: z.ZodLiteral<"explicit">;
461
481
  handle: z.ZodUnknown;
@@ -293,10 +293,21 @@ export const mountConfigSchema = z.union([
293
293
  nativeMountConfigSchema,
294
294
  overlayMountConfigSchema,
295
295
  ]);
296
+ export const sidecarRuntimeConfigSchema = z
297
+ .object({
298
+ executor: z
299
+ .object({
300
+ maxActiveVms: positiveInteger.max(Number.MAX_SAFE_INTEGER).optional(),
301
+ })
302
+ .strict()
303
+ .optional(),
304
+ })
305
+ .strict();
296
306
  export const sharedSidecarConfigSchema = z
297
307
  .object({
298
308
  kind: z.literal("shared"),
299
309
  pool: z.string().optional(),
310
+ runtime: sidecarRuntimeConfigSchema.optional(),
300
311
  })
301
312
  .strict();
302
313
  const explicitSidecarSchema = z
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type { AgentExitEvent, AgentExitHandler, AgentOsCreateSidecarOptions, AgentOsLimits, AgentOsOptions, AgentOsSharedSidecarOptions, AgentOsSidecarConfig, AgentOsSidecarDescription, AgentRegistryEntry, AgentRestartOutcome, AgentStderrEvent, AgentStderrHandler, BatchReadResult, BatchWriteEntry, BatchWriteResult, DirEntry, DynamicMountDescriptor, ExportRootFilesystemOptions, HttpRequest, HttpResponse, LimitWarning, LimitWarningHandler, MountConfig, MountConfigJsonObject, MountConfigJsonPrimitive, MountConfigJsonValue, MountInfo, NativeMountConfig, NativeMountPluginDescriptor, NativeRootFilesystemConfig, OverlayMountConfig, OverlayRootFilesystemConfig, PlainMountConfig, ProcessOutput, ProcessTreeNode, ReaddirEntry, ReaddirRecursiveOptions, RootFilesystemConfig, RootLowerInput, ShellData, ShellExit, ShellOptions, } from "./agent-os.js";
1
+ export type { AgentExitEvent, AgentExitHandler, AgentOsCreateSidecarOptions, AgentOsLimits, AgentOsOptions, AgentOsSharedSidecarOptions, AgentOsSidecarConfig, AgentOsSidecarDescription, AgentOsSidecarRuntimeConfig, AgentRegistryEntry, AgentRestartOutcome, AgentStderrEvent, AgentStderrHandler, BatchReadResult, BatchWriteEntry, BatchWriteResult, DirEntry, DynamicMountDescriptor, ExportRootFilesystemOptions, HttpRequest, HttpResponse, LimitWarning, LimitWarningHandler, MountConfig, MountConfigJsonObject, MountConfigJsonPrimitive, MountConfigJsonValue, MountInfo, NativeMountConfig, NativeMountPluginDescriptor, NativeRootFilesystemConfig, OverlayMountConfig, OverlayRootFilesystemConfig, PlainMountConfig, ProcessOutput, ProcessTreeNode, ReaddirEntry, ReaddirRecursiveOptions, RootFilesystemConfig, RootLowerInput, ShellData, ShellExit, ShellOptions, } from "./agent-os.js";
2
2
  export type { CodeEvaluationResult, CodeExecutionResult, ContextDescriptor, ContextState, ExecutionErrorData, ExecutionSignal, InlineExecutionOptions, JavaScriptEvaluationOptions, JavaScriptExecutionOptions, LanguageExecutionOptions, LanguageSpawnOptions, NpmPackageInstallOptions, NpmProjectInstallOptions, OutputCapture, OutputReplay, ProcessDescriptor, ProcessExit, ProcessOutputEvent, PythonInstallOptions, SpawnOptions, TypeScriptCheckOptions, TypeScriptCheckResult, TypeScriptDiagnostic, TypeScriptEvaluationOptions, TypeScriptExecutionOptions, TypeScriptFileExecutionOptions, } from "./language-execution.js";
3
3
  export type * from "./session-api.js";
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivet-dev/agentos-core",
3
- "version": "0.2.16-rc.3",
3
+ "version": "0.2.18",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./dist/index.js",
@@ -64,14 +64,14 @@
64
64
  "@agentclientprotocol/sdk": "0.16.1",
65
65
  "@agentos-software/claude-code": "0.2.7",
66
66
  "@agentos-software/codex-cli": "0.3.4",
67
- "@agentos-software/common": "0.2.16-rc.3",
68
- "@agentos-software/manifest": "0.2.16-rc.3",
67
+ "@agentos-software/common": "0.2.18",
68
+ "@agentos-software/manifest": "0.2.18",
69
69
  "@agentos-software/opencode": "0.2.7",
70
70
  "@agentos-software/pi": "0.2.7",
71
71
  "@aws-sdk/client-s3": "^3.1019.0",
72
- "@rivet-dev/agentos-sidecar": "0.2.16-rc.3",
72
+ "@rivet-dev/agentos-sidecar": "0.2.18",
73
73
  "@rivetkit/bare-ts": "^0.6.2",
74
- "@rivet-dev/agentos-runtime-core": "0.2.16-rc.3",
74
+ "@rivet-dev/agentos-runtime-core": "0.2.18",
75
75
  "@xterm/headless": "^6.0.0",
76
76
  "better-sqlite3": "^12.8.0",
77
77
  "croner": "^10.0.1",
@@ -105,7 +105,7 @@
105
105
  "@agentos-software/vim": "0.3.3",
106
106
  "@agentos-software/wget": "0.3.3",
107
107
  "@agentos-software/yq": "0.3.3",
108
- "@rivet-dev/agentos-test-harness": "0.2.16-rc.3",
108
+ "@rivet-dev/agentos-test-harness": "0.2.18",
109
109
  "@anthropic-ai/claude-agent-sdk": "^0.2.87",
110
110
  "@anthropic-ai/claude-code": "^2.1.86",
111
111
  "@bare-ts/tools": "0.15.0",