@rivet-dev/agentos 0.2.22 → 0.4.3
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/LICENSE +18 -0
- package/assets/inspector-tabs-app/assets/{agentos-hero-logo-E3fapwXM.svg → agentos-hero-logo-BL8gBiZH.svg} +1 -1
- package/assets/inspector-tabs-app/assets/{sed-BwsOyU9v.svg → coreutils-CQXb6ysD.svg} +1 -1
- package/assets/inspector-tabs-app/assets/filesystem-Dt4eKrkX.js +1 -0
- package/assets/inspector-tabs-app/assets/{hooks-DU8a-cwM.js → hooks-B_kCGlJx.js} +1 -1
- package/assets/inspector-tabs-app/assets/index-BQ48yGn7.css +1 -0
- package/assets/inspector-tabs-app/assets/index-CMgGagyE.js +126 -0
- package/assets/inspector-tabs-app/assets/processes-C3xk9hpI.js +4 -0
- package/assets/inspector-tabs-app/assets/scroll-area-DKdlhVEr.js +1 -0
- package/assets/inspector-tabs-app/assets/system-DOSmuuav.js +1 -0
- package/assets/inspector-tabs-app/assets/terminal-DbNlwtw-.js +13 -0
- package/assets/inspector-tabs-app/assets/useMutation-B4fxUbt-.js +1 -0
- package/assets/inspector-tabs-app/assets/vm-status-badges-QaK7sEZ4.js +1 -0
- package/assets/inspector-tabs-app/index.html +2 -2
- package/dist/index.d.ts +2925 -448
- package/dist/index.js +35 -1924
- package/dist/index.js.map +1 -1
- package/package.json +62 -114
- package/assets/inspector-tabs-app/assets/filesystem-C-x0K5sy.js +0 -1
- package/assets/inspector-tabs-app/assets/index-7G_DbdZ6.js +0 -110
- package/assets/inspector-tabs-app/assets/index-DG_s1YoH.css +0 -1
- package/assets/inspector-tabs-app/assets/scroll-area-kPbv4IGy.js +0 -1
- package/assets/inspector-tabs-app/assets/system-D98yBhMj.js +0 -2
- package/assets/inspector-tabs-app/assets/terminal-Bv9GKv4q.js +0 -13
- package/assets/inspector-tabs-app/assets/transcript-kMbm_tF8.js +0 -1
- package/assets/inspector-tabs-app/assets/useSuspenseQuery-ChN8rnBd.js +0 -1
- package/assets/inspector-tabs-app/assets/vm-boot-gate-rpuO0b5W.js +0 -1
- package/assets/inspector-tabs-app/assets/vm-status-badges-09qyfN_A.js +0 -5
- package/dist/chunk-V6TY7KAL.js +0 -8
- package/dist/chunk-V6TY7KAL.js.map +0 -1
- package/dist/client.d.ts +0 -2
- package/dist/client.js +0 -3
- package/dist/client.js.map +0 -1
- package/dist/node.d.ts +0 -67
- package/dist/node.js +0 -275
- package/dist/node.js.map +0 -1
- package/dist/react.d.ts +0 -1
- package/dist/react.js +0 -3
- package/dist/react.js.map +0 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/actor.ts","../src/shell-replay.ts"],"sourcesContent":["import { setup as rivetkitSetup } from \"rivetkit\";\n\nexport type { Registry } from \"rivetkit\";\n\nconst AGENTOS_REGISTRY_MESSAGE_SIZE_DEFAULT = 512 * 1024 * 1024;\n\n/**\n * RivetKit setup with the direct actor SQLite UDS enabled. The UDS is consumed\n * by the AgentOS sidecar; filesystem SQL never crosses the JavaScript layer.\n */\nexport const setup: typeof rivetkitSetup = ((\n\tinput: Parameters<typeof rivetkitSetup>[0],\n) =>\n\trivetkitSetup({\n\t\t...input,\n\t\tmaxIncomingMessageSize: AGENTOS_REGISTRY_MESSAGE_SIZE_DEFAULT,\n\t\tmaxOutgoingMessageSize: AGENTOS_REGISTRY_MESSAGE_SIZE_DEFAULT,\n\t\texperimentalActorUds: true,\n\t} as Parameters<typeof rivetkitSetup>[0])) as typeof rivetkitSetup;\n\nexport * from \"@rivet-dev/agentos-core\";\nexport type {\n\tAgentOsActorConfigInput as AgentOSActorConfigInput,\n\tAgentOsActorConfigInput as AgentOSConfigInput,\n} from \"./actor.js\";\nexport {\n\ttype AgentOsActions,\n\ttype AgentOsActorConfigInput,\n\ttype AgentOsActorExtras,\n\ttype AgentOsEventHooks,\n\tcreateAgentOS,\n\tcreateAgentOS as agentOS,\n\tcreateAgentOsActions,\n\ttype VmFetchOptions,\n\ttype VmFetchResponse,\n\ttype VmFetchStreamChunk,\n\ttype VmFetchStreamHead,\n} from \"./actor.js\";\nexport type {\n\tActorData,\n\tActorLanguageSpawnOptions,\n\tActorSpawnOptions,\n\tAgentOsEvents,\n\tProcessExitPayload,\n\tProcessOutputPayload,\n\tRuntimeAgentExit,\n\tRuntimeHealth,\n\tRuntimeLimitWarning,\n\tRuntimeSidecarInfo,\n\tRuntimeStderrLine,\n\tSerializableCronAction,\n\tSerializableCronEvent,\n\tSerializableCronJobInfo,\n\tSerializableCronJobOptions,\n\tShellDataPayload,\n\tShellExitPayload,\n\tShellInfo,\n\tShellReplayMode,\n\tShellSnapshot,\n\tVmBootedPayload,\n\tVmShutdownPayload,\n} from \"./types.js\";\n","import crypto from \"node:crypto\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport {\n\ttype AgentExitEvent,\n\tAgentOs,\n\ttype AgentOsOptions,\n\ttype CodeExecutionResult,\n\ttype CronEvent,\n\ttype DynamicMountDescriptor,\n\ttype HostFunctionSchemas,\n\ttype OpenSessionInput,\n\ttype PackageDescriptor,\n\ttype ProcessDescriptor,\n\ttype PromptInput,\n\ttype SessionStreamEntry,\n} from \"@rivet-dev/agentos-core\";\nimport {\n\ttype Actions,\n\ttype ActorConfigInput,\n\ttype ActorContext,\n\ttype ActorDefinition,\n\tactor,\n\tevent,\n\ttype Type,\n\tUserError,\n} from \"rivetkit\";\nimport { type DatabaseProvider, db, type RawAccess } from \"rivetkit/db\";\nimport { migrations } from \"rivetkit/unstable/migrations\";\nimport { ShellReplayStore } from \"./shell-replay.js\";\nimport type {\n\tActorData,\n\tActorInlineExecutionOptions,\n\tActorJavaScriptExecutionOptions,\n\tActorLanguageExecutionOptions,\n\tActorLanguageSpawnOptions,\n\tActorNpmPackageInstallOptions,\n\tActorNpmProjectInstallOptions,\n\tActorPythonInstallOptions,\n\tActorSpawnOptions,\n\tActorTypeScriptCheckOptions,\n\tActorTypeScriptExecutionOptions,\n\tActorTypeScriptFileExecutionOptions,\n\tAgentOsEvents,\n\tProcessExitPayload,\n\tProcessOutputPayload,\n\tRuntimeAgentExit,\n\tRuntimeHealth,\n\tRuntimeLimitWarning,\n\tSerializableCronJobOptions,\n\tShellDataPayload,\n\tShellExitPayload,\n\tShellInfo,\n\tShellReplayMode,\n\tShellSnapshot,\n\tVmBootedPayload,\n\tVmShutdownPayload,\n} from \"./types.js\";\n\n// Prompts may remain paused at a permission request for a long human review.\n// RivetKit currently exposes only one actor-wide action timeout, so use the\n// largest value Node timers can represent safely (~24.8 days). Callers may\n// still opt into a shorter timeout through actor options.\nconst DEFAULT_ACTION_TIMEOUT_MS = 2_147_483_647;\nconst DEFAULT_SLEEP_GRACE_PERIOD_MS = 15 * 60_000;\nconst DEFAULT_PREVIEW_TTL_SECONDS = 3_600;\nconst MAX_PREVIEW_TTL_SECONDS = 86_400;\nconst DEFAULT_MAX_ACTIVE_PREVIEW_TOKENS = 1_024;\nconst DEFAULT_MAX_SESSION_SUBSCRIPTIONS = 10_000;\nconst DEFAULT_MAX_DYNAMIC_MOUNTS = 10_000;\nconst DEFAULT_MAX_LINKED_SOFTWARE = 10_000;\nconst ACTOR_SQLITE_CHUNK_SIZE = 512 * 1024;\nconst ACTOR_SQLITE_INLINE_THRESHOLD = 64 * 1024;\nconst ROOT_NAMESPACE = \"agentos-root\";\nconst PREVIEW_PATH_PATTERN = /^\\/fetch\\/([a-f0-9]{48})(\\/.*)?$/;\nconst MAX_SQLITE_SAFE_INTEGER = Number.MAX_SAFE_INTEGER;\n// Each open shell holds the VM awake, so this bounds an unbounded wake-lock.\nconst MAX_OPEN_SHELLS = 32;\n\ninterface ActorSqliteMigration {\n\treadonly version: number;\n\treadonly sql: string;\n}\n\nconst ACTOR_SQLITE_MIGRATIONS = [\n\t{\n\t\tversion: 1,\n\t\tsql: `\n\t\t\tCREATE TABLE agentos_actor_preview_tokens (\n\t\t\t\ttoken TEXT PRIMARY KEY CHECK (length(token) = 48 AND token NOT GLOB '*[^0-9a-f]*'),\n\t\t\t\tport INTEGER NOT NULL CHECK (port BETWEEN 1 AND 65535),\n\t\t\t\tcreated_at_ms INTEGER NOT NULL CHECK (created_at_ms BETWEEN 0 AND ${MAX_SQLITE_SAFE_INTEGER}),\n\t\t\t\texpires_at_ms INTEGER NOT NULL CHECK (expires_at_ms > created_at_ms AND expires_at_ms <= ${MAX_SQLITE_SAFE_INTEGER})\n\t\t\t) STRICT;\n\t\t\tCREATE INDEX agentos_actor_preview_tokens_by_expiry\n\t\t\t\tON agentos_actor_preview_tokens(expires_at_ms);\n\t\t\tCREATE TABLE agentos_actor_dynamic_mounts (\n\t\t\t\tpath TEXT PRIMARY KEY CHECK (substr(path, 1, 1) = '/' AND instr(path, char(0)) = 0),\n\t\t\t\tdescriptor_json TEXT NOT NULL CHECK (json_valid(descriptor_json) AND json_type(descriptor_json) = 'object')\n\t\t\t) STRICT;\n\t\t\tCREATE TABLE agentos_actor_linked_software (\n\t\t\t\tpath TEXT PRIMARY KEY CHECK (length(path) > 0 AND instr(path, char(0)) = 0),\n\t\t\t\tdescriptor_json TEXT NOT NULL CHECK (json_valid(descriptor_json) AND json_type(descriptor_json) = 'object')\n\t\t\t) STRICT;\n\t\t`,\n\t},\n] as const satisfies readonly ActorSqliteMigration[];\n\ntype BuiltInEvents = {\n\t[K in keyof AgentOsEvents]: Type<AgentOsEvents[K]>;\n};\n\nconst builtInEvents: BuiltInEvents = {\n\tsessionEvent: event<SessionStreamEntry>(),\n\tvmBooted: event<VmBootedPayload>(),\n\tvmShutdown: event<VmShutdownPayload>(),\n\tprocessOutput: event<ProcessOutputPayload>(),\n\tprocessExit: event<ProcessExitPayload>(),\n\tshellData: event<ShellDataPayload>(),\n\tcronEvent: event<CronEvent>(),\n\tagentExit: event<AgentExitEvent>(),\n\tshellStderr: event<ShellDataPayload>(),\n\tshellExit: event<ShellExitPayload>(),\n};\ntype ActorDb = DatabaseProvider<RawAccess>;\ntype EventSchemaConfig = Record<string, any>;\ntype QueueSchemaConfig = Record<string, any>;\ntype AnyContext = ActorContext<any, any, any, any, any, ActorDb, any, any>;\n\ninterface RuntimeState {\n\tvm: Promise<AgentOs> | null;\n\t/** Set once `vm` resolves, cleared when it stops. Observe-only callers must\n\t * read this instead of sampling `vm`: any `.then`/`.catch` on a settled\n\t * promise still needs a microtask, so racing one against an immediate value\n\t * always loses and reports a booted VM as not booted. */\n\tbootedVm: AgentOs | null;\n\t/** Shells opened through this actor, in open order. Enumeration is\n\t * server-owned: a client that lost its page (or never had one) must be able\n\t * to find shells it is still keeping the VM awake for. Entries die with the\n\t * VM, so this is deliberately in-memory. */\n\topenShells: Map<string, { openedAt: number }>;\n\t/** Headless emulator per live shell, fed the same chunks this actor\n\t * broadcasts, so a reattaching client can be repainted. */\n\tshellReplay: ShellReplayStore;\n\tsubscribedSessions: Map<string, readonly (() => void)[]>;\n\tonVmStop?: (\n\t\tc: AnyContext,\n\t\tvm: AgentOs,\n\t\treason: \"sleep\" | \"destroy\" | \"error\",\n\t) => void | Promise<void>;\n\tonVmDisposed?: (\n\t\tc: AnyContext,\n\t\treason: \"sleep\" | \"destroy\" | \"error\",\n\t) => void | Promise<void>;\n\tvmCleanupRan: boolean;\n\tfetchStreamHolds: Map<string, () => void>;\n}\n\nconst runtimes = new Map<string, RuntimeState>();\nconst optionResolvers = new WeakMap<\n\tAgentOsOptions,\n\t(c: AnyContext) => AgentOsOptions | Promise<AgentOsOptions>\n>();\nconst vmStartResolvers = new WeakMap<\n\tAgentOsOptions,\n\t(c: AnyContext, vm: AgentOs) => void | Promise<void>\n>();\nconst vmStopResolvers = new WeakMap<\n\tAgentOsOptions,\n\t(\n\t\tc: AnyContext,\n\t\tvm: AgentOs,\n\t\treason: \"sleep\" | \"destroy\" | \"error\",\n\t) => void | Promise<void>\n>();\nconst vmDisposedResolvers = new WeakMap<\n\tAgentOsOptions,\n\t(c: AnyContext, reason: \"sleep\" | \"destroy\" | \"error\") => void | Promise<void>\n>();\n\n// Bounded post-mortem buffers for the observe-only `health` action. Kept in\n// their own map — not on RuntimeState — because `disposeVm` drops the runtime\n// entry on sleep while these must stay readable while `booted` is false. They\n// are cleared only when the actor is destroyed.\nconst HEALTH_WARNINGS_CAP = 50;\nconst HEALTH_AGENT_EXITS_CAP = 50;\n\ninterface HealthBuffers {\n\twarnings: RuntimeLimitWarning[];\n\tagentExits: RuntimeAgentExit[];\n}\n\nconst healthBuffers = new Map<string, HealthBuffers>();\n\nfunction healthBuffersFor(actorId: string): HealthBuffers {\n\tlet buffers = healthBuffers.get(actorId);\n\tif (!buffers) {\n\t\tbuffers = { warnings: [], agentExits: [] };\n\t\thealthBuffers.set(actorId, buffers);\n\t}\n\treturn buffers;\n}\n\nfunction pushCapped<T>(buffer: T[], item: T, cap: number): void {\n\tbuffer.push(item);\n\twhile (buffer.length > cap) buffer.shift();\n}\n\nfunction runtimeFor(c: AnyContext): RuntimeState {\n\tlet runtime = runtimes.get(c.actorId);\n\tif (!runtime) {\n\t\truntime = {\n\t\t\tvm: null,\n\t\t\tbootedVm: null,\n\t\t\topenShells: new Map(),\n\t\t\tshellReplay: new ShellReplayStore(),\n\t\t\tsubscribedSessions: new Map(),\n\t\t\tvmCleanupRan: false,\n\t\t\tfetchStreamHolds: new Map(),\n\t\t};\n\t\truntimes.set(c.actorId, runtime);\n\t}\n\treturn runtime;\n}\n\nasync function runVmDisposedHook(\n\truntime: RuntimeState,\n\tc: AnyContext,\n\treason: \"sleep\" | \"destroy\" | \"error\",\n): Promise<void> {\n\tif (runtime.vmCleanupRan) return;\n\truntime.vmCleanupRan = true;\n\tawait runtime.onVmDisposed?.(c, reason);\n}\n\nasync function ensureVm(\n\tc: AnyContext,\n\toptions?: AgentOsOptions,\n): Promise<AgentOs> {\n\tconst runtime = runtimeFor(c);\n\tif (runtime.vm !== null) return runtime.vm;\n\n\tconst startedAt = Date.now();\n\truntime.vmCleanupRan = false;\n\truntime.vm = (async () => {\n\t\truntime.onVmStop = options ? vmStopResolvers.get(options) : undefined;\n\t\truntime.onVmDisposed = options\n\t\t\t? vmDisposedResolvers.get(options)\n\t\t\t: undefined;\n\t\tconst resolvedOptions = {\n\t\t\t...options,\n\t\t\t...(options && optionResolvers.has(options)\n\t\t\t\t? await optionResolvers.get(options)?.(c)\n\t\t\t\t: undefined),\n\t\t};\n\t\tif (resolvedOptions.rootFilesystem) {\n\t\t\tthrow new Error(\n\t\t\t\t\"agentOS() owns rootFilesystem so it can persist directly through the actor SQLite UDS; resolveOptions may configure mounts but not rootFilesystem\",\n\t\t\t);\n\t\t}\n\t\tif (resolvedOptions.database) {\n\t\t\tthrow new Error(\n\t\t\t\t\"agentOS() owns database and injects the actor SQLite UDS descriptor; resolveOptions cannot replace it\",\n\t\t\t);\n\t\t}\n\t\tif (resolvedOptions.sandbox && \"client\" in resolvedOptions.sandbox) {\n\t\t\tthrow new Error(\n\t\t\t\t\"agentOS() cannot share sandbox: { client } across actor instances; resolveOptions must use sandbox: { provider }\",\n\t\t\t);\n\t\t}\n\t\tconst actorRuntimeSocket = (\n\t\t\tc as AnyContext & {\n\t\t\t\tactorRuntimeSocket(): Promise<{ path: string }>;\n\t\t\t}\n\t\t).actorRuntimeSocket;\n\t\tif (typeof actorRuntimeSocket !== \"function\") {\n\t\t\tthrow new Error(\n\t\t\t\t\"AgentOS actors require a RivetKit runtime with Actor Runtime Socket support\",\n\t\t\t);\n\t\t}\n\t\tconst { path } = await actorRuntimeSocket.call(c);\n\t\tconst mountRows = await c.db.execute<{ descriptor_json: string }>(\n\t\t\t\"SELECT descriptor_json FROM agentos_actor_dynamic_mounts ORDER BY path\",\n\t\t);\n\t\tconst softwareRows = await c.db.execute<{ descriptor_json: string }>(\n\t\t\t\"SELECT descriptor_json FROM agentos_actor_linked_software ORDER BY path\",\n\t\t);\n\t\tconst vm = await AgentOs.create({\n\t\t\t...resolvedOptions,\n\t\t\tdatabase: { type: \"actor_uds\", path },\n\t\t\tonAgentExit: (event) => {\n\t\t\t\tc.log.error({\n\t\t\t\t\tmsg: \"agent-os agent adapter exited unexpectedly\",\n\t\t\t\t\t...event,\n\t\t\t\t});\n\t\t\t\tpushCapped(\n\t\t\t\t\thealthBuffersFor(c.actorId).agentExits,\n\t\t\t\t\t{\n\t\t\t\t\t\tts: Date.now(),\n\t\t\t\t\t\tsessionId: event.sessionId,\n\t\t\t\t\t\tagentType: event.agentType,\n\t\t\t\t\t\texitCode: event.exitCode,\n\t\t\t\t\t\trestart: event.restart,\n\t\t\t\t\t\trestartCount: event.restartCount,\n\t\t\t\t\t},\n\t\t\t\t\tHEALTH_AGENT_EXITS_CAP,\n\t\t\t\t);\n\t\t\t\tc.broadcast(\"agentExit\", event);\n\t\t\t\ttry {\n\t\t\t\t\tresolvedOptions.onAgentExit?.(event);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tc.log.error({\n\t\t\t\t\t\tmsg: \"agent-os onAgentExit hook failed\",\n\t\t\t\t\t\tsessionId: event.sessionId,\n\t\t\t\t\t\terror,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t\tonLimitWarning: (warning) => {\n\t\t\t\tc.log.warn({\n\t\t\t\t\tmsg: \"agent-os runtime limit is near capacity\",\n\t\t\t\t\t...warning,\n\t\t\t\t});\n\t\t\t\tpushCapped(\n\t\t\t\t\thealthBuffersFor(c.actorId).warnings,\n\t\t\t\t\t{ ts: Date.now(), ...warning },\n\t\t\t\t\tHEALTH_WARNINGS_CAP,\n\t\t\t\t);\n\t\t\t\ttry {\n\t\t\t\t\toptions?.onLimitWarning?.(warning);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tc.log.error({\n\t\t\t\t\t\tmsg: \"agent-os onLimitWarning hook failed\",\n\t\t\t\t\t\tlimit: warning.limit,\n\t\t\t\t\t\terror,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t\trootFilesystem: {\n\t\t\t\ttype: \"native\",\n\t\t\t\tplugin: {\n\t\t\t\t\tid: \"chunked_actor_sqlite\",\n\t\t\t\t\tconfig: {\n\t\t\t\t\t\tnamespace: ROOT_NAMESPACE,\n\t\t\t\t\t\tchunkSize: ACTOR_SQLITE_CHUNK_SIZE,\n\t\t\t\t\t\tinlineThreshold: ACTOR_SQLITE_INLINE_THRESHOLD,\n\t\t\t\t\t\tuid:\n\t\t\t\t\t\t\tresolvedOptions.user?.euid ?? resolvedOptions.user?.uid ?? 1000,\n\t\t\t\t\t\tgid:\n\t\t\t\t\t\t\tresolvedOptions.user?.egid ?? resolvedOptions.user?.gid ?? 1000,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t\ttry {\n\t\t\tfor (const row of mountRows) {\n\t\t\t\tawait vm.filesystem.mount(\n\t\t\t\t\tJSON.parse(row.descriptor_json) as DynamicMountDescriptor,\n\t\t\t\t);\n\t\t\t}\n\t\t\tfor (const row of softwareRows) {\n\t\t\t\tawait vm.software.link(\n\t\t\t\t\tJSON.parse(row.descriptor_json) as PackageDescriptor,\n\t\t\t\t);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tawait vm.dispose();\n\t\t\tthrow error;\n\t\t}\n\t\tconst onVmStart = options ? vmStartResolvers.get(options) : undefined;\n\t\tif (onVmStart) {\n\t\t\ttry {\n\t\t\t\tawait onVmStart(c, vm);\n\t\t\t} catch (error) {\n\t\t\t\ttry {\n\t\t\t\t\tawait vm.dispose();\n\t\t\t\t} catch (disposeError) {\n\t\t\t\t\tc.log.error({\n\t\t\t\t\t\tmsg: \"failed to dispose AgentOS VM after start hook failure\",\n\t\t\t\t\t\tdisposeError,\n\t\t\t\t\t});\n\t\t\t\t} finally {\n\t\t\t\t\tawait runVmDisposedHook(runtime, c, \"error\");\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t\tvm.onCronEvent((cronEvent) => c.broadcast(\"cronEvent\", cronEvent));\n\t\truntime.bootedVm = vm;\n\t\tc.broadcast(\"vmBooted\", {});\n\t\tc.log.info({\n\t\t\tmsg: \"agent-os vm booted\",\n\t\t\tbootDurationMs: Date.now() - startedAt,\n\t\t});\n\t\treturn vm;\n\t})();\n\n\ttry {\n\t\treturn await runtime.vm;\n\t} catch (error) {\n\t\truntime.vm = null;\n\t\truntime.bootedVm = null;\n\t\tc.log.error({\n\t\t\tmsg: \"agent-os vm bootstrap failed\",\n\t\t\tactorId: c.actorId,\n\t\t\terror,\n\t\t});\n\t\tawait runVmDisposedHook(runtime, c, \"error\");\n\t\tthrow error;\n\t}\n}\n\nasync function disposeVm(c: AnyContext, reason: \"sleep\" | \"destroy\" | \"error\") {\n\t// Post-mortem health buffers survive sleep and error by design; only a\n\t// destroyed actor drops them.\n\tif (reason === \"destroy\") healthBuffers.delete(c.actorId);\n\tconst runtime = runtimes.get(c.actorId);\n\tif (!runtime) return;\n\tconst vm = runtime.vm;\n\truntime.bootedVm = null;\n\truntimes.delete(c.actorId);\n\tfor (const unsubscribers of runtime.subscribedSessions.values()) {\n\t\tfor (const unsubscribe of unsubscribers) unsubscribe();\n\t}\n\truntime.subscribedSessions.clear();\n\tfor (const release of runtime.fetchStreamHolds.values()) release();\n\truntime.fetchStreamHolds.clear();\n\tif (vm) {\n\t\tconst failures: unknown[] = [];\n\t\ttry {\n\t\t\tconst resolvedVm = await vm;\n\t\t\ttry {\n\t\t\t\tawait runtime.onVmStop?.(c, resolvedVm, reason);\n\t\t\t} catch (error) {\n\t\t\t\tfailures.push(error);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait resolvedVm.dispose();\n\t\t\t} catch (error) {\n\t\t\t\tfailures.push(error);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tfailures.push(error);\n\t\t}\n\t\ttry {\n\t\t\tawait runVmDisposedHook(runtime, c, reason);\n\t\t} catch (error) {\n\t\t\tfailures.push(error);\n\t\t}\n\t\tif (failures.length === 1) throw failures[0];\n\t\tif (failures.length > 1) {\n\t\t\tconst aggregate = new Error(\n\t\t\t\t\"failed to stop, dispose, or clean up AgentOS VM\",\n\t\t\t);\n\t\t\t(aggregate as Error & { errors: unknown[] }).errors = failures;\n\t\t\tthrow aggregate;\n\t\t}\n\t}\n\tc.broadcast(\"vmShutdown\", { reason });\n}\n\nfunction matchPreviewPath(pathname: string): RegExpMatchArray | null {\n\treturn pathname.match(PREVIEW_PATH_PATTERN);\n}\n\n/** @internal Exported only for focused migration-ladder tests. */\nexport function validateAgentOsActorMigrationLadder(\n\tmigrations: readonly ActorSqliteMigration[],\n): void {\n\tif (migrations.length === 0) {\n\t\tthrow new Error(\"AgentOS actor SQLite migration ladder must not be empty\");\n\t}\n\tfor (const [index, migration] of migrations.entries()) {\n\t\tconst expectedVersion = index + 1;\n\t\tif (migration.version !== expectedVersion) {\n\t\t\tthrow new Error(\n\t\t\t\t`invalid AgentOS actor SQLite migration ladder: expected version ${expectedVersion}, received ${migration.version}`,\n\t\t\t);\n\t\t}\n\t\tif (migration.sql.trim().length === 0) {\n\t\t\tthrow new Error(\n\t\t\t\t`invalid AgentOS actor SQLite migration ${migration.version}: SQL is empty`,\n\t\t\t);\n\t\t}\n\t\tif (\n\t\t\t/(?:^|;)\\s*(?:BEGIN|COMMIT|ROLLBACK|SAVEPOINT|RELEASE)\\b/im.test(\n\t\t\t\tmigration.sql,\n\t\t\t)\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t`invalid AgentOS actor SQLite migration ${migration.version}: transaction control belongs to the migration provider`,\n\t\t\t);\n\t\t}\n\t\tif (/\\b(?:FOREIGN\\s+KEY|REFERENCES)\\b/i.test(migration.sql)) {\n\t\t\tthrow new Error(\n\t\t\t\t`invalid AgentOS actor SQLite migration ${migration.version}: foreign keys are not used in the actor-owned schema`,\n\t\t\t);\n\t\t}\n\t\tfor (const statement of migration.sql.split(\";\")) {\n\t\t\tif (\n\t\t\t\t/^\\s*CREATE\\s+TABLE\\b/i.test(statement) &&\n\t\t\t\t!/[)]\\s*STRICT\\s*$/i.test(statement)\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`invalid AgentOS actor SQLite migration ${migration.version}: every actor-owned table must be STRICT`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tconst ownedIdentifiers = migration.sql.match(/\\bagentos_[a-z0-9_]+\\b/gi);\n\t\tif (\n\t\t\t!ownedIdentifiers ||\n\t\t\townedIdentifiers.some(\n\t\t\t\t(identifier) => !identifier.startsWith(\"agentos_actor_\"),\n\t\t\t)\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t`invalid AgentOS actor SQLite migration ${migration.version}: migrations may reference only agentos_actor_* tables and indexes`,\n\t\t\t);\n\t\t}\n\t}\n}\n\n/** @internal Exported only for focused migration tests. */\nexport async function migrateAgentOsActorTables(\n\tdatabase: RawAccess,\n): Promise<void> {\n\tvalidateAgentOsActorMigrationLadder(ACTOR_SQLITE_MIGRATIONS);\n\tawait runAgentOsActorMigrations(database);\n}\n\nconst runAgentOsActorMigrations = migrations({\n\ttableName: \"agentos_actor_schema_version\",\n\tmigrations: ACTOR_SQLITE_MIGRATIONS,\n});\n\nasync function assertActorCollectionCapacity(\n\tc: AnyContext,\n\ttable: \"agentos_actor_dynamic_mounts\" | \"agentos_actor_linked_software\",\n\tkey: string,\n\tlimit: number,\n\tlabel: \"dynamic mounts\" | \"linked software packages\",\n\tconfigKey: \"maxDynamicMounts\" | \"maxLinkedSoftware\",\n): Promise<void> {\n\tconst existing = await c.db.execute<{ present: number }>(\n\t\t`SELECT 1 AS present FROM ${table} WHERE path = ? LIMIT 1`,\n\t\tkey,\n\t);\n\tif (existing.length > 0) return;\n\tconst rows = await c.db.execute<{ count: number }>(\n\t\t`SELECT COUNT(*) AS count FROM ${table}`,\n\t);\n\tconst count = Number(rows[0]?.count ?? 0);\n\tif (count >= limit) {\n\t\tthrow new UserError(\n\t\t\t`${label} limit ${limit} reached; raise ${configKey} to persist more`,\n\t\t\t{\n\t\t\t\tcode: `agentos_${configKey === \"maxDynamicMounts\" ? \"dynamic_mount\" : \"linked_software\"}_limit`,\n\t\t\t\tmetadata: { limit },\n\t\t\t},\n\t\t);\n\t}\n\tif (count + 1 === Math.ceil(limit * 0.8)) {\n\t\tc.log.warn({\n\t\t\tmsg: `${label} are near the limit of ${limit}; raise ${configKey} to persist more`,\n\t\t\tcount: count + 1,\n\t\t\tlimit,\n\t\t});\n\t}\n}\n\nexport interface VmFetchOptions {\n\tmethod?: string;\n\theaders?: Record<string, string>;\n\tbody?: string | Uint8Array;\n}\n\nexport interface VmFetchResponse {\n\tstatus: number;\n\tstatusText: string;\n\theaders: Record<string, string>;\n\trawHeaders?: Array<[string, string]>;\n\tbody: Uint8Array;\n}\n\nexport interface VmFetchStreamHead {\n\tstreamId: string;\n\tstatus: number;\n\tstatusText: string;\n\theaders: Record<string, string>;\n\trawHeaders?: Array<[string, string]>;\n}\n\nexport interface VmFetchStreamChunk {\n\tbody: Uint8Array;\n\tdone: boolean;\n}\n\nexport interface AgentOsEventHooks<TContext = AnyContext> {\n\tonSessionEvent?: (\n\t\tc: TContext,\n\t\tsessionId: string,\n\t\tevent: SessionStreamEntry,\n\t) => void | Promise<void>;\n}\n\nfunction trackSessionEvents(\n\tc: AnyContext,\n\tvm: AgentOs,\n\tsessionId: string,\n\thooks: AgentOsEventHooks,\n\tmaxSessionSubscriptions: number,\n): void {\n\tconst runtime = runtimeFor(c);\n\tif (runtime.subscribedSessions.has(sessionId)) return;\n\tif (runtime.subscribedSessions.size >= maxSessionSubscriptions) {\n\t\tthrow new UserError(\n\t\t\t`session subscription limit ${maxSessionSubscriptions} reached; raise maxSessionSubscriptions to observe more sessions`,\n\t\t\t{\n\t\t\t\tcode: \"agentos_session_subscription_limit\",\n\t\t\t\tmetadata: { limit: maxSessionSubscriptions },\n\t\t\t},\n\t\t);\n\t}\n\tconst nextCount = runtime.subscribedSessions.size + 1;\n\tif (nextCount === Math.ceil(maxSessionSubscriptions * 0.8)) {\n\t\tc.log.warn({\n\t\t\tmsg: `session subscriptions are near the limit of ${maxSessionSubscriptions}; raise maxSessionSubscriptions to observe more sessions`,\n\t\t\tsubscriptionCount: nextCount,\n\t\t\tlimit: maxSessionSubscriptions,\n\t\t});\n\t}\n\tconst unsubscribeSession = vm.onSessionEvent(\n\t\tsessionId,\n\t\t(notification: SessionStreamEntry) => {\n\t\t\tconst serialized = JSON.parse(\n\t\t\t\tJSON.stringify(notification),\n\t\t\t) as SessionStreamEntry;\n\t\t\tc.broadcast(\"sessionEvent\", serialized);\n\t\t\tif (hooks.onSessionEvent) {\n\t\t\t\tvoid c.keepAwake(\n\t\t\t\t\tPromise.resolve()\n\t\t\t\t\t\t.then(() => hooks.onSessionEvent?.(c, sessionId, serialized))\n\t\t\t\t\t\t.catch((error) =>\n\t\t\t\t\t\t\tc.log.error({\n\t\t\t\t\t\t\t\tmsg: \"agent-os session event hook failed\",\n\t\t\t\t\t\t\t\tsessionId,\n\t\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t);\n\truntime.subscribedSessions.set(sessionId, [unsubscribeSession]);\n}\n\nfunction untrackSessionEvents(c: AnyContext, sessionId: string): void {\n\tconst unsubscribers = runtimeFor(c).subscribedSessions.get(sessionId);\n\tif (!unsubscribers) return;\n\tfor (const unsubscribe of unsubscribers) unsubscribe();\n\truntimeFor(c).subscribedSessions.delete(sessionId);\n}\n\nfunction trackFetchStream(c: AnyContext, streamId: string): void {\n\tconst runtime = runtimeFor(c);\n\tif (runtime.fetchStreamHolds.has(streamId)) return;\n\tconst hold = new Promise<void>((resolve) => {\n\t\truntime.fetchStreamHolds.set(streamId, resolve);\n\t});\n\tvoid c.keepAwake(hold).catch((error) =>\n\t\tc.log.error({\n\t\t\tmsg: \"agent-os fetch stream hold failed\",\n\t\t\tstreamId,\n\t\t\terror,\n\t\t}),\n\t);\n}\n\nfunction releaseFetchStream(c: AnyContext, streamId: string): void {\n\tconst runtime = runtimeFor(c);\n\truntime.fetchStreamHolds.get(streamId)?.();\n\truntime.fetchStreamHolds.delete(streamId);\n}\n\nfunction decodeActorData(value: ActorData): string | Uint8Array;\nfunction decodeActorData(value: unknown): string | Uint8Array | undefined;\nfunction decodeActorData(value: unknown): string | Uint8Array | undefined {\n\tif (value === undefined) return undefined;\n\tif (\n\t\ttypeof value !== \"object\" ||\n\t\tvalue === null ||\n\t\t!(\"encoding\" in value) ||\n\t\t!(\"data\" in value)\n\t) {\n\t\tthrow new UserError(\"stdin must be tagged UTF-8 or base64 actor data\", {\n\t\t\tcode: \"agentos_execution_invalid_actor_data\",\n\t\t});\n\t}\n\tconst input = value as { encoding: unknown; data: unknown };\n\tif (typeof input.data !== \"string\") {\n\t\tthrow new UserError(\"actor data must contain a string\", {\n\t\t\tcode: \"agentos_execution_invalid_actor_data\",\n\t\t});\n\t}\n\tif (input.encoding === \"utf8\") return input.data;\n\tif (input.encoding === \"base64\")\n\t\treturn new Uint8Array(Buffer.from(input.data, \"base64\"));\n\tthrow new UserError(\"actor data encoding must be utf8 or base64\", {\n\t\tcode: \"agentos_execution_invalid_actor_data\",\n\t});\n}\n\nfunction actorExecutionArgs(args: readonly unknown[]): unknown[] {\n\treturn args.map((arg) => {\n\t\tif (typeof arg !== \"object\" || arg === null || Array.isArray(arg))\n\t\t\treturn arg;\n\t\tconst options = arg as Record<string, unknown>;\n\t\tfor (const field of [\"signal\", \"onStdout\", \"onStderr\"] as const) {\n\t\t\tif (options[field] !== undefined) {\n\t\t\t\tthrow new UserError(`${field} is not available on actor actions`, {\n\t\t\t\t\tcode: \"agentos_execution_non_serializable_option\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tconst normalized = { ...options };\n\t\tif (\"stdin\" in normalized)\n\t\t\tnormalized.stdin = decodeActorData(normalized.stdin);\n\t\treturn normalized;\n\t});\n}\n\nfunction actorSpawnArgs(options: unknown): unknown[] {\n\treturn options === undefined ? [] : actorExecutionArgs([options]);\n}\n\nasync function runActorExecution<T>(\n\tc: AnyContext,\n\toperation: (vm: AgentOs) => Promise<T>,\n\toptions?: AgentOsOptions,\n): Promise<T> {\n\tconst vm = await ensureVm(c, options);\n\treturn c.keepAwake(operation(vm));\n}\n\nasync function runActorSpawn(\n\tc: AnyContext,\n\toperation: (vm: AgentOs) => Promise<ProcessDescriptor>,\n\toptions?: AgentOsOptions,\n): Promise<ProcessDescriptor> {\n\tconst vm = await ensureVm(c, options);\n\tconst process = await operation(vm);\n\tconst unsubscribeOutput = vm.onProcessOutput(process.pid, (event) =>\n\t\tc.broadcast(\"processOutput\", event),\n\t);\n\tconst unsubscribeExit = vm.onProcessExit(process.pid, (event) =>\n\t\tc.broadcast(\"processExit\", event),\n\t);\n\tvoid c\n\t\t.keepAwake(\n\t\t\tvm.process.wait(process.pid).finally(() => {\n\t\t\t\tunsubscribeOutput();\n\t\t\t\tunsubscribeExit();\n\t\t\t}),\n\t\t)\n\t\t.catch((error) =>\n\t\t\tc.log.error({\n\t\t\t\tmsg: \"agent-os process wait failed\",\n\t\t\t\tpid: process.pid,\n\t\t\t\terror,\n\t\t\t}),\n\t\t);\n\treturn process;\n}\n\nexport function createAgentOsActions(\n\toptions?: AgentOsOptions,\n\thooks: AgentOsEventHooks = {},\n\tpreview: AgentOsActorExtras[\"preview\"] = {},\n\tmaxSessionSubscriptions = DEFAULT_MAX_SESSION_SUBSCRIPTIONS,\n\tmaxDynamicMounts = DEFAULT_MAX_DYNAMIC_MOUNTS,\n\tmaxLinkedSoftware = DEFAULT_MAX_LINKED_SOFTWARE,\n) {\n\tconst defaultPreviewTtlSeconds =\n\t\tpreview.defaultExpiresInSeconds ?? DEFAULT_PREVIEW_TTL_SECONDS;\n\tconst maxPreviewTtlSeconds =\n\t\tpreview.maxExpiresInSeconds ?? MAX_PREVIEW_TTL_SECONDS;\n\tconst maxActivePreviewTokens =\n\t\tpreview.maxActiveTokens ?? DEFAULT_MAX_ACTIVE_PREVIEW_TOKENS;\n\tif (\n\t\t!Number.isFinite(defaultPreviewTtlSeconds) ||\n\t\tdefaultPreviewTtlSeconds <= 0 ||\n\t\t!Number.isFinite(maxPreviewTtlSeconds) ||\n\t\tmaxPreviewTtlSeconds <= 0 ||\n\t\tdefaultPreviewTtlSeconds > maxPreviewTtlSeconds\n\t) {\n\t\tthrow new UserError(\n\t\t\t\"preview expiry bounds must be positive and the default cannot exceed the maximum\",\n\t\t\t{ code: \"agentos_preview_invalid_config\" },\n\t\t);\n\t}\n\tif (!Number.isInteger(maxActivePreviewTokens) || maxActivePreviewTokens < 1) {\n\t\tthrow new UserError(\"preview.maxActiveTokens must be a positive integer\", {\n\t\t\tcode: \"agentos_preview_invalid_config\",\n\t\t});\n\t}\n\tif (\n\t\t!Number.isInteger(maxSessionSubscriptions) ||\n\t\tmaxSessionSubscriptions < 1\n\t) {\n\t\tthrow new UserError(\"maxSessionSubscriptions must be a positive integer\", {\n\t\t\tcode: \"agentos_session_subscription_invalid_config\",\n\t\t});\n\t}\n\tif (!Number.isInteger(maxDynamicMounts) || maxDynamicMounts < 1) {\n\t\tthrow new UserError(\"maxDynamicMounts must be a positive integer\", {\n\t\t\tcode: \"agentos_dynamic_mount_invalid_config\",\n\t\t});\n\t}\n\tif (!Number.isInteger(maxLinkedSoftware) || maxLinkedSoftware < 1) {\n\t\tthrow new UserError(\"maxLinkedSoftware must be a positive integer\", {\n\t\t\tcode: \"agentos_linked_software_invalid_config\",\n\t\t});\n\t}\n\tconst flat = {\n\t\treadFile: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"filesystem\"][\"readFile\"]>\n\t\t) => {\n\t\t\ttry {\n\t\t\t\treturn await (await ensureVm(c, options)).filesystem.readFile(...args);\n\t\t\t} catch (error) {\n\t\t\t\tc.log.error({\n\t\t\t\t\tmsg: \"agent-os readFile action failed\",\n\t\t\t\t\tpath: args[0],\n\t\t\t\t\terror,\n\t\t\t\t});\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t},\n\t\twriteFile: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"filesystem\"][\"writeFile\"]>\n\t\t) => (await ensureVm(c, options)).filesystem.writeFile(...args),\n\t\treadFiles: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"filesystem\"][\"readFiles\"]>\n\t\t) => (await ensureVm(c, options)).filesystem.readFiles(...args),\n\t\twriteFiles: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"filesystem\"][\"writeFiles\"]>\n\t\t) => (await ensureVm(c, options)).filesystem.writeFiles(...args),\n\t\tstat: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"filesystem\"][\"stat\"]>\n\t\t) => (await ensureVm(c, options)).filesystem.stat(...args),\n\t\tmkdir: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"filesystem\"][\"mkdir\"]>\n\t\t) => (await ensureVm(c, options)).filesystem.mkdir(...args),\n\t\treaddir: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"filesystem\"][\"readdir\"]>\n\t\t) => (await ensureVm(c, options)).filesystem.readdir(...args),\n\t\treaddirEntries: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"filesystem\"][\"readdirEntries\"]>\n\t\t) => (await ensureVm(c, options)).filesystem.readdirEntries(...args),\n\t\treaddirRecursive: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"filesystem\"][\"readdirRecursive\"]>\n\t\t) => (await ensureVm(c, options)).filesystem.readdirRecursive(...args),\n\t\texists: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"filesystem\"][\"exists\"]>\n\t\t) => (await ensureVm(c, options)).filesystem.exists(...args),\n\t\tmove: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"filesystem\"][\"move\"]>\n\t\t) => (await ensureVm(c, options)).filesystem.move(...args),\n\t\tremove: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"filesystem\"][\"remove\"]>\n\t\t) => (await ensureVm(c, options)).filesystem.remove(...args),\n\t\texec: async (\n\t\t\tc: AnyContext,\n\t\t\tcommand: string,\n\t\t\tactorOptions?: ActorLanguageExecutionOptions,\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.process.exec(\n\t\t\t\t\t\tcommand,\n\t\t\t\t\t\t...(actorExecutionArgs([actorOptions]) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\texecArgv: async (\n\t\t\tc: AnyContext,\n\t\t\tcommand: string,\n\t\t\targs: readonly string[] = [],\n\t\t\tactorOptions?: Omit<ActorLanguageExecutionOptions, \"args\">,\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.process.execFile(\n\t\t\t\t\t\tcommand,\n\t\t\t\t\t\targs,\n\t\t\t\t\t\t...(actorExecutionArgs([actorOptions]) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\tspawn: async (\n\t\t\tc: AnyContext,\n\t\t\tcommand: string,\n\t\t\targs: string[] = [],\n\t\t\tactorOptions?: ActorSpawnOptions,\n\t\t) =>\n\t\t\trunActorSpawn(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.process.spawn(\n\t\t\t\t\t\tcommand,\n\t\t\t\t\t\targs,\n\t\t\t\t\t\t...(actorSpawnArgs(actorOptions) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\tcreateContext: async (c: AnyContext, contextId: string) =>\n\t\t\t(await ensureVm(c, options)).createContext(contextId),\n\t\texecuteJavaScript: async (\n\t\t\tc: AnyContext,\n\t\t\tsource: string,\n\t\t\tactorOptions?: ActorJavaScriptExecutionOptions,\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.javascript.execute(\n\t\t\t\t\t\tsource,\n\t\t\t\t\t\t...(actorExecutionArgs([actorOptions]) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\tevaluateJavaScript: async (\n\t\t\tc: AnyContext,\n\t\t\texpression: string,\n\t\t\tactorOptions?: ActorJavaScriptExecutionOptions,\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.javascript.evaluate(\n\t\t\t\t\t\texpression,\n\t\t\t\t\t\t...(actorExecutionArgs([actorOptions]) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\texecuteJavaScriptFile: async (\n\t\t\tc: AnyContext,\n\t\t\tpath: string,\n\t\t\tactorOptions?: ActorLanguageExecutionOptions,\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.javascript.executeFile(\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\t...(actorExecutionArgs([actorOptions]) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\tspawnJavaScript: async (\n\t\t\tc: AnyContext,\n\t\t\tsource: string,\n\t\t\tactorOptions?: ActorLanguageSpawnOptions,\n\t\t) =>\n\t\t\trunActorSpawn(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.javascript.spawn(\n\t\t\t\t\t\tsource,\n\t\t\t\t\t\t...(actorSpawnArgs(actorOptions) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\tspawnJavaScriptFile: async (\n\t\t\tc: AnyContext,\n\t\t\tpath: string,\n\t\t\tactorOptions?: ActorLanguageSpawnOptions,\n\t\t) =>\n\t\t\trunActorSpawn(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.javascript.spawnFile(\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\t...(actorSpawnArgs(actorOptions) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\texecuteTypeScript: async (\n\t\t\tc: AnyContext,\n\t\t\tsource: string,\n\t\t\tactorOptions?: ActorTypeScriptExecutionOptions,\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.typescript.execute(\n\t\t\t\t\t\tsource,\n\t\t\t\t\t\t...(actorExecutionArgs([actorOptions]) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\tevaluateTypeScript: async (\n\t\t\tc: AnyContext,\n\t\t\texpression: string,\n\t\t\tactorOptions?: ActorTypeScriptExecutionOptions,\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.typescript.evaluate(\n\t\t\t\t\t\texpression,\n\t\t\t\t\t\t...(actorExecutionArgs([actorOptions]) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\texecuteTypeScriptFile: async (\n\t\t\tc: AnyContext,\n\t\t\tpath: string,\n\t\t\tactorOptions?: ActorTypeScriptFileExecutionOptions,\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.typescript.executeFile(\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\t...(actorExecutionArgs([actorOptions]) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\tspawnTypeScript: async (\n\t\t\tc: AnyContext,\n\t\t\tsource: string,\n\t\t\tactorOptions?: ActorLanguageSpawnOptions,\n\t\t) =>\n\t\t\trunActorSpawn(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.typescript.spawn(\n\t\t\t\t\t\tsource,\n\t\t\t\t\t\t...(actorSpawnArgs(actorOptions) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\tspawnTypeScriptFile: async (\n\t\t\tc: AnyContext,\n\t\t\tpath: string,\n\t\t\tactorOptions?: ActorLanguageSpawnOptions,\n\t\t) =>\n\t\t\trunActorSpawn(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.typescript.spawnFile(\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\t...(actorSpawnArgs(actorOptions) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\tcheckTypeScript: async (\n\t\t\tc: AnyContext,\n\t\t\tsource: string,\n\t\t\tactorOptions?: ActorTypeScriptCheckOptions,\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.typescript.check(\n\t\t\t\t\t\tsource,\n\t\t\t\t\t\t...(actorExecutionArgs([actorOptions]) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\tcheckTypeScriptProject: async (\n\t\t\tc: AnyContext,\n\t\t\tactorOptions?: Omit<\n\t\t\t\tActorTypeScriptCheckOptions,\n\t\t\t\t\"filePath\" | \"compilerOptions\"\n\t\t\t>,\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.typescript.checkProject(\n\t\t\t\t\t\t...(actorExecutionArgs([actorOptions]) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\tinstallNpmPackages: async (\n\t\t\tc: AnyContext,\n\t\t\t...args:\n\t\t\t\t| [options?: ActorNpmProjectInstallOptions]\n\t\t\t\t| [packages: string | string[], options?: ActorNpmPackageInstallOptions]\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\t(\n\t\t\t\t\t\tvm.javascript.npm.install as (\n\t\t\t\t\t\t\t...callArgs: unknown[]\n\t\t\t\t\t\t) => Promise<CodeExecutionResult>\n\t\t\t\t\t)(...actorExecutionArgs(args)),\n\t\t\t\toptions,\n\t\t\t),\n\t\texecuteNpmScript: async (\n\t\t\tc: AnyContext,\n\t\t\tscript: string,\n\t\t\tactorOptions?: ActorLanguageExecutionOptions,\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.javascript.npm.runScript(\n\t\t\t\t\t\tscript,\n\t\t\t\t\t\t...(actorExecutionArgs([actorOptions]) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\texecuteNpmPackage: async (\n\t\t\tc: AnyContext,\n\t\t\tpackageSpec: string,\n\t\t\tactorOptions?: ActorLanguageExecutionOptions & { binary?: string },\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.javascript.npm.runPackage(\n\t\t\t\t\t\tpackageSpec,\n\t\t\t\t\t\t...(actorExecutionArgs([actorOptions]) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\texecutePython: async (\n\t\t\tc: AnyContext,\n\t\t\tsource: string,\n\t\t\tactorOptions?: ActorInlineExecutionOptions,\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.python.execute(\n\t\t\t\t\t\tsource,\n\t\t\t\t\t\t...(actorExecutionArgs([actorOptions]) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\tevaluatePython: async (\n\t\t\tc: AnyContext,\n\t\t\texpression: string,\n\t\t\tactorOptions?: ActorInlineExecutionOptions,\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.python.evaluate(\n\t\t\t\t\t\texpression,\n\t\t\t\t\t\t...(actorExecutionArgs([actorOptions]) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\texecutePythonFile: async (\n\t\t\tc: AnyContext,\n\t\t\tpath: string,\n\t\t\tactorOptions?: ActorLanguageExecutionOptions,\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.python.executeFile(\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\t...(actorExecutionArgs([actorOptions]) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\texecutePythonModule: async (\n\t\t\tc: AnyContext,\n\t\t\tmodule: string,\n\t\t\tactorOptions?: ActorLanguageExecutionOptions,\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.python.executeModule(\n\t\t\t\t\t\tmodule,\n\t\t\t\t\t\t...(actorExecutionArgs([actorOptions]) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\tspawnPython: async (\n\t\t\tc: AnyContext,\n\t\t\tsource: string,\n\t\t\tactorOptions?: ActorLanguageSpawnOptions,\n\t\t) =>\n\t\t\trunActorSpawn(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.python.spawn(source, ...(actorSpawnArgs(actorOptions) as [never])),\n\t\t\t\toptions,\n\t\t\t),\n\t\tspawnPythonFile: async (\n\t\t\tc: AnyContext,\n\t\t\tpath: string,\n\t\t\tactorOptions?: ActorLanguageSpawnOptions,\n\t\t) =>\n\t\t\trunActorSpawn(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.python.spawnFile(\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\t...(actorSpawnArgs(actorOptions) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\tspawnPythonModule: async (\n\t\t\tc: AnyContext,\n\t\t\tmodule: string,\n\t\t\tactorOptions?: ActorLanguageSpawnOptions,\n\t\t) =>\n\t\t\trunActorSpawn(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\tvm.python.spawnModule(\n\t\t\t\t\t\tmodule,\n\t\t\t\t\t\t...(actorSpawnArgs(actorOptions) as [never]),\n\t\t\t\t\t),\n\t\t\t\toptions,\n\t\t\t),\n\t\tinstallPythonPackages: async (\n\t\t\tc: AnyContext,\n\t\t\t...args:\n\t\t\t\t| [options?: ActorPythonInstallOptions]\n\t\t\t\t| [packages: string | string[], options?: ActorPythonInstallOptions]\n\t\t) =>\n\t\t\trunActorExecution(\n\t\t\t\tc,\n\t\t\t\t(vm) =>\n\t\t\t\t\t(\n\t\t\t\t\t\tvm.python.install as (\n\t\t\t\t\t\t\t...callArgs: unknown[]\n\t\t\t\t\t\t) => Promise<CodeExecutionResult>\n\t\t\t\t\t)(...actorExecutionArgs(args)),\n\t\t\t\toptions,\n\t\t\t),\n\t\tgetContext: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"contexts\"][\"get\"]>\n\t\t) => (await ensureVm(c, options)).contexts.get(...args),\n\t\tlistContexts: async (c: AnyContext) =>\n\t\t\t(await ensureVm(c, options)).contexts.list(),\n\t\tresetContext: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"contexts\"][\"reset\"]>\n\t\t) => (await ensureVm(c, options)).contexts.reset(...args),\n\t\tdeleteContext: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"contexts\"][\"delete\"]>\n\t\t) => (await ensureVm(c, options)).contexts.delete(...args),\n\t\twaitProcess: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"process\"][\"wait\"]>\n\t\t) => (await ensureVm(c, options)).process.wait(...args),\n\t\tkillProcess: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"process\"][\"kill\"]>\n\t\t) => (await ensureVm(c, options)).process.kill(...args),\n\t\tsignalProcess: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"process\"][\"signal\"]>\n\t\t) => (await ensureVm(c, options)).process.signal(...args),\n\t\tlistProcesses: async (c: AnyContext) =>\n\t\t\t(await ensureVm(c, options)).process.list(),\n\t\tprocessTree: async (c: AnyContext) =>\n\t\t\t(await ensureVm(c, options)).process.tree(),\n\t\tgetProcess: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"process\"][\"get\"]>\n\t\t) => (await ensureVm(c, options)).process.get(...args),\n\t\twriteProcessStdin: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"process\"][\"writeStdin\"]>\n\t\t) => (await ensureVm(c, options)).process.writeStdin(...args),\n\t\tcloseProcessStdin: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"process\"][\"closeStdin\"]>\n\t\t) => (await ensureVm(c, options)).process.closeStdin(...args),\n\t\tresizeProcessPty: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"process\"][\"resizePty\"]>\n\t\t) => (await ensureVm(c, options)).process.resizePty(...args),\n\t\treadProcessOutput: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"process\"][\"readOutput\"]>\n\t\t) => {\n\t\t\tconst replay = await (await ensureVm(c, options)).process.readOutput(\n\t\t\t\t...args,\n\t\t\t);\n\t\t\treturn {\n\t\t\t\t...replay,\n\t\t\t\tevents: replay.events.map((event) => ({\n\t\t\t\t\t...event,\n\t\t\t\t\tchunk: {\n\t\t\t\t\t\tencoding: \"base64\" as const,\n\t\t\t\t\t\tdata: Buffer.from(event.chunk).toString(\"base64\"),\n\t\t\t\t\t},\n\t\t\t\t})),\n\t\t\t};\n\t\t},\n\t\topenShell: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"terminal\"][\"open\"]>\n\t\t) => {\n\t\t\tconst vm = await ensureVm(c, options);\n\t\t\tconst runtime = runtimeFor(c);\n\t\t\tif (runtime.openShells.size >= MAX_OPEN_SHELLS) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`agent-os shell limit reached (${MAX_OPEN_SHELLS} open); close a shell or raise MAX_OPEN_SHELLS`,\n\t\t\t\t);\n\t\t\t}\n\t\t\t// Warm the emulator module before the PTY exists: from `terminal.open`\n\t\t\t// to the subscription below, nothing may await, or the output produced\n\t\t\t// in that window is lost to every consumer.\n\t\t\tawait runtime.shellReplay.warm();\n\t\t\tconst shell = vm.terminal.open(...args);\n\t\t\truntime.openShells.set(shell.shellId, { openedAt: Date.now() });\n\t\t\truntime.shellReplay.open(shell.shellId, args[0]?.cols, args[0]?.rows);\n\t\t\tconst unsubscribeData = vm.onShellData(shell.shellId, (event) =>\n\t\t\t\tc.broadcast(\"shellData\", {\n\t\t\t\t\t...event,\n\t\t\t\t\tseq: runtime.shellReplay.feed(event.shellId, event.data),\n\t\t\t\t}),\n\t\t\t);\n\t\t\tconst unsubscribeStderr = vm.onShellStderr(shell.shellId, (event) =>\n\t\t\t\t// A diagnostic tap carrying bytes `shellData` already delivered, so\n\t\t\t\t// it is never folded into replay and carries no sequence.\n\t\t\t\tc.broadcast(\"shellStderr\", { ...event, seq: 0 }),\n\t\t\t);\n\t\t\tconst unsubscribeExit = vm.onShellExit(shell.shellId, (event) =>\n\t\t\t\tc.broadcast(\"shellExit\", event),\n\t\t\t);\n\t\t\tvoid c\n\t\t\t\t.keepAwake(\n\t\t\t\t\tvm.terminal.wait(shell.shellId).finally(() => {\n\t\t\t\t\t\truntime.openShells.delete(shell.shellId);\n\t\t\t\t\t\truntime.shellReplay.close(shell.shellId);\n\t\t\t\t\t\tunsubscribeData();\n\t\t\t\t\t\tunsubscribeStderr();\n\t\t\t\t\t\tunsubscribeExit();\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\t.catch((error) =>\n\t\t\t\t\tc.log.error({\n\t\t\t\t\t\tmsg: \"agent-os shell wait failed\",\n\t\t\t\t\t\tshellId: shell.shellId,\n\t\t\t\t\t\terror,\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\treturn shell;\n\t\t},\n\t\t// Observe-only: enumerates shells this actor opened without booting a\n\t\t// sleeping VM (a sleeping VM has none). Clients must not track shell ids\n\t\t// themselves — a shell outlives the page that opened it and keeps the VM\n\t\t// awake, so it has to stay discoverable.\n\t\tlistShells: async (c: AnyContext): Promise<ShellInfo[]> => {\n\t\t\tconst runtime = runtimes.get(c.actorId);\n\t\t\tif (!runtime?.bootedVm) return [];\n\t\t\treturn [...runtime.openShells.entries()]\n\t\t\t\t.map(([shellId, entry]) => ({ shellId, openedAt: entry.openedAt }))\n\t\t\t\t.sort((a, b) => a.openedAt - b.openedAt);\n\t\t},\n\t\twriteShell: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"terminal\"][\"write\"]>\n\t\t) => (await ensureVm(c, options)).terminal.write(...args),\n\t\tresizeShell: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"terminal\"][\"resize\"]>\n\t\t) => {\n\t\t\tconst result = (await ensureVm(c, options)).terminal.resize(...args);\n\t\t\truntimeFor(c).shellReplay.resize(args[0], args[1], args[2]);\n\t\t\treturn result;\n\t\t},\n\t\t// Observe-only, like `listShells`: repainting a shell must never boot a\n\t\t// VM, and a sleeping VM has no live shells to repaint. Returns `null`\n\t\t// for an unknown shell so a client falls back to no replay.\n\t\tshellSnapshot: async (\n\t\t\tc: AnyContext,\n\t\t\tshellId: string,\n\t\t\tmode: ShellReplayMode = \"screen\",\n\t\t): Promise<ShellSnapshot | null> => {\n\t\t\tconst runtime = runtimes.get(c.actorId);\n\t\t\tif (!runtime?.bootedVm) return null;\n\t\t\treturn runtime.shellReplay.snapshot(shellId, mode);\n\t\t},\n\t\tcloseShell: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"terminal\"][\"close\"]>\n\t\t) => (await ensureVm(c, options)).terminal.close(...args),\n\t\twaitShell: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"terminal\"][\"wait\"]>\n\t\t) => (await ensureVm(c, options)).terminal.wait(...args),\n\t\thttpRequest: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"network\"][\"httpRequest\"]>\n\t\t) => (await ensureVm(c, options)).network.httpRequest(...args),\n\t\tvmFetch: async (\n\t\t\tc: AnyContext,\n\t\t\tport: number,\n\t\t\turl: string,\n\t\t\trequestOptions?: VmFetchOptions,\n\t\t): Promise<VmFetchResponse> => {\n\t\t\tconst vm = await ensureVm(c, options);\n\t\t\tconst body =\n\t\t\t\trequestOptions?.body instanceof Uint8Array\n\t\t\t\t\t? Buffer.from(requestOptions.body)\n\t\t\t\t\t: requestOptions?.body;\n\t\t\tconst response = await vm.fetch(\n\t\t\t\tport,\n\t\t\t\tnew Request(url, {\n\t\t\t\t\tmethod: requestOptions?.method ?? \"GET\",\n\t\t\t\t\theaders: requestOptions?.headers,\n\t\t\t\t\tbody,\n\t\t\t\t}),\n\t\t\t);\n\t\t\tconst headers: Record<string, string> = {};\n\t\t\tconst rawHeaders: Array<[string, string]> = [];\n\t\t\tresponse.headers.forEach((value, key) => {\n\t\t\t\theaders[key] = value;\n\t\t\t\tif (key !== \"set-cookie\") rawHeaders.push([key, value]);\n\t\t\t});\n\t\t\tfor (const value of response.headers.getSetCookie?.() ?? []) {\n\t\t\t\trawHeaders.push([\"set-cookie\", value]);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tstatus: response.status,\n\t\t\t\tstatusText: response.statusText,\n\t\t\t\theaders,\n\t\t\t\trawHeaders,\n\t\t\t\tbody: new Uint8Array(await response.arrayBuffer()),\n\t\t\t};\n\t\t},\n\t\tvmFetchStreamStart: async (\n\t\t\tc: AnyContext,\n\t\t\tport: number,\n\t\t\turl: string,\n\t\t\trequestOptions?: VmFetchOptions,\n\t\t): Promise<VmFetchStreamHead> => {\n\t\t\tconst vm = await ensureVm(c, options);\n\t\t\tconst body =\n\t\t\t\trequestOptions?.body instanceof Uint8Array\n\t\t\t\t\t? Buffer.from(requestOptions.body)\n\t\t\t\t\t: requestOptions?.body;\n\t\t\tconst head = await vm.fetchStreamStart(\n\t\t\t\tport,\n\t\t\t\tnew Request(url, {\n\t\t\t\t\tmethod: requestOptions?.method ?? \"GET\",\n\t\t\t\t\theaders: requestOptions?.headers,\n\t\t\t\t\tbody,\n\t\t\t\t}),\n\t\t\t);\n\t\t\ttrackFetchStream(c, head.streamId);\n\t\t\tconst headers: Record<string, string> = {};\n\t\t\tfor (const [name, value] of head.headers) headers[name] = value;\n\t\t\treturn { ...head, headers, rawHeaders: head.headers };\n\t\t},\n\t\tvmFetchStreamRead: async (\n\t\t\tc: AnyContext,\n\t\t\tstreamId: string,\n\t\t\tmaxBytes?: number,\n\t\t): Promise<VmFetchStreamChunk> => {\n\t\t\ttry {\n\t\t\t\tconst chunk = await (await ensureVm(c, options)).fetchStreamRead(\n\t\t\t\t\tstreamId,\n\t\t\t\t\tmaxBytes,\n\t\t\t\t);\n\t\t\t\tif (chunk.done) releaseFetchStream(c, streamId);\n\t\t\t\treturn chunk;\n\t\t\t} catch (error) {\n\t\t\t\treleaseFetchStream(c, streamId);\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t},\n\t\tvmFetchStreamCancel: async (c: AnyContext, streamId: string) => {\n\t\t\ttry {\n\t\t\t\tawait (await ensureVm(c, options)).fetchStreamCancel(streamId);\n\t\t\t} finally {\n\t\t\t\treleaseFetchStream(c, streamId);\n\t\t\t}\n\t\t},\n\t\tscheduleCron: async (\n\t\t\tc: AnyContext,\n\t\t\tcronOptions: SerializableCronJobOptions,\n\t\t) => {\n\t\t\tconst job = (await ensureVm(c, options)).cron.schedule(\n\t\t\t\tcronOptions as Parameters<AgentOs[\"cron\"][\"schedule\"]>[0],\n\t\t\t);\n\t\t\treturn { id: job.id };\n\t\t},\n\t\tlistCronJobs: async (c: AnyContext) =>\n\t\t\t(await ensureVm(c, options)).cron.list(),\n\t\tcancelCronJob: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"cron\"][\"cancel\"]>\n\t\t) => (await ensureVm(c, options)).cron.cancel(...args),\n\t\tlistAgents: async (c: AnyContext) =>\n\t\t\t(await ensureVm(c, options)).agents.list(),\n\t\t// Observe-only: reports VM liveness and the post-mortem buffers without\n\t\t// ever booting the VM (deliberately no ensureVm).\n\t\thealth: async (c: AnyContext): Promise<RuntimeHealth> => {\n\t\t\tconst runtime = runtimes.get(c.actorId);\n\t\t\tconst buffers = healthBuffersFor(c.actorId);\n\t\t\tlet booted = false;\n\t\t\tlet sessions: number | null = null;\n\t\t\tlet sidecar: RuntimeHealth[\"sidecar\"] = null;\n\t\t\t// Read the settled VM synchronously: a VM still booting (or one whose\n\t\t\t// boot failed) reports not-booted rather than blocking the\n\t\t\t// observe-only action.\n\t\t\tconst vm = runtime?.bootedVm;\n\t\t\tif (runtime && vm) {\n\t\t\t\tbooted = true;\n\t\t\t\tsessions = runtime.subscribedSessions.size;\n\t\t\t\tconst description = vm.sidecar.describe();\n\t\t\t\tsidecar = {\n\t\t\t\t\tstate: description.state,\n\t\t\t\t\tactiveVmCount: description.activeVmCount,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tbooted,\n\t\t\t\tsessions,\n\t\t\t\tsidecar,\n\t\t\t\twarnings: [...buffers.warnings],\n\t\t\t\tagentExits: [...buffers.agentExits],\n\t\t\t\tstderrTail: [],\n\t\t\t};\n\t\t},\n\t\topenSession: async (c: AnyContext, input: OpenSessionInput) => {\n\t\t\tconst vm = await ensureVm(c, options);\n\t\t\ttry {\n\t\t\t\tawait vm.sessions.open(input);\n\t\t\t} catch (error) {\n\t\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\t\tconst causeCode =\n\t\t\t\t\ttypeof (error as { code?: unknown })?.code === \"string\"\n\t\t\t\t\t\t? (error as { code: string }).code\n\t\t\t\t\t\t: undefined;\n\t\t\t\tc.log.error({\n\t\t\t\t\tmsg: \"agent-os openSession action failed\",\n\t\t\t\t\tsessionId: input.sessionId ?? \"main\",\n\t\t\t\t\tagent: input.agent,\n\t\t\t\t\tcauseCode,\n\t\t\t\t\terror,\n\t\t\t\t});\n\t\t\t\tthrow new UserError(`AgentOS openSession failed: ${message}`, {\n\t\t\t\t\tcode: \"agentos_session_open_failed\",\n\t\t\t\t\tmetadata: causeCode ? { causeCode } : undefined,\n\t\t\t\t});\n\t\t\t}\n\t\t\ttrackSessionEvents(\n\t\t\t\tc,\n\t\t\t\tvm,\n\t\t\t\tinput.sessionId ?? \"main\",\n\t\t\t\thooks,\n\t\t\t\tmaxSessionSubscriptions,\n\t\t\t);\n\t\t},\n\t\tgetSession: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"sessions\"][\"get\"]>\n\t\t) => (await ensureVm(c, options)).sessions.get(...args),\n\t\tlistSessions: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"sessions\"][\"list\"]>\n\t\t) => (await ensureVm(c, options)).sessions.list(...args),\n\t\tdeleteSession: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"sessions\"][\"delete\"]>\n\t\t) => {\n\t\t\tconst result = await (await ensureVm(c, options)).sessions.delete(\n\t\t\t\t...args,\n\t\t\t);\n\t\t\tuntrackSessionEvents(c, args[0]?.sessionId ?? \"main\");\n\t\t\treturn result;\n\t\t},\n\t\tunloadSession: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"sessions\"][\"unload\"]>\n\t\t) => {\n\t\t\tconst result = await (await ensureVm(c, options)).sessions.unload(\n\t\t\t\t...args,\n\t\t\t);\n\t\t\tuntrackSessionEvents(c, args[0]?.sessionId ?? \"main\");\n\t\t\treturn result;\n\t\t},\n\t\tprompt: async (c: AnyContext, input: PromptInput) => {\n\t\t\tconst vm = await ensureVm(c, options);\n\t\t\tconst sessionId = input.sessionId ?? \"main\";\n\t\t\ttrackSessionEvents(c, vm, sessionId, hooks, maxSessionSubscriptions);\n\t\t\t// The actor is held only through the terminal SQLite commit for this\n\t\t\t// active turn. Merely having an idle durable session holds nothing.\n\t\t\ttry {\n\t\t\t\treturn await c.keepAwake(vm.sessions.prompt(input));\n\t\t\t} catch (error) {\n\t\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\t\tconst causeCode =\n\t\t\t\t\ttypeof (error as { code?: unknown })?.code === \"string\"\n\t\t\t\t\t\t? (error as { code: string }).code\n\t\t\t\t\t\t: undefined;\n\t\t\t\tc.log.error({\n\t\t\t\t\tmsg: \"agent-os prompt action failed\",\n\t\t\t\t\tsessionId,\n\t\t\t\t\tcauseCode,\n\t\t\t\t\terror,\n\t\t\t\t});\n\t\t\t\tthrow new UserError(`AgentOS prompt failed: ${message}`, {\n\t\t\t\t\tcode: \"agentos_prompt_failed\",\n\t\t\t\t\tmetadata: causeCode ? { causeCode } : undefined,\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tcancelPrompt: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"sessions\"][\"cancelPrompt\"]>\n\t\t) => (await ensureVm(c, options)).sessions.cancelPrompt(...args),\n\t\trespondPermission: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"sessions\"][\"respondPermission\"]>\n\t\t) => (await ensureVm(c, options)).sessions.respondPermission(...args),\n\t\treadHistory: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"sessions\"][\"readHistory\"]>\n\t\t) => (await ensureVm(c, options)).sessions.readHistory(...args),\n\t\tgetSessionConfig: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"sessions\"][\"getConfig\"]>\n\t\t) => (await ensureVm(c, options)).sessions.getConfig(...args),\n\t\tsetSessionConfigOption: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"sessions\"][\"setConfigOption\"]>\n\t\t) => (await ensureVm(c, options)).sessions.setConfigOption(...args),\n\t\tgetSessionCapabilities: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"sessions\"][\"getCapabilities\"]>\n\t\t) => (await ensureVm(c, options)).sessions.getCapabilities(...args),\n\t\tgetSessionAgentInfo: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"sessions\"][\"getAgentInfo\"]>\n\t\t) => (await ensureVm(c, options)).sessions.getAgentInfo(...args),\n\t\tcreatePreviewUrl: async (\n\t\t\tc: AnyContext,\n\t\t\tport: number,\n\t\t\tttlSeconds = defaultPreviewTtlSeconds,\n\t\t) => {\n\t\t\tif (!Number.isInteger(port) || port < 1 || port > 65_535)\n\t\t\t\tthrow new UserError(\n\t\t\t\t\t\"port must be an integer between 1 and 65535; pass a valid VM listener port\",\n\t\t\t\t\t{ code: \"agentos_preview_invalid_port\" },\n\t\t\t\t);\n\t\t\tif (\n\t\t\t\t!Number.isFinite(ttlSeconds) ||\n\t\t\t\tttlSeconds <= 0 ||\n\t\t\t\tttlSeconds > maxPreviewTtlSeconds\n\t\t\t)\n\t\t\t\tthrow new UserError(\n\t\t\t\t\t`ttlSeconds must be greater than 0 and at most ${maxPreviewTtlSeconds}; raise preview.maxExpiresInSeconds to allow a longer lifetime`,\n\t\t\t\t\t{ code: \"agentos_preview_invalid_ttl\" },\n\t\t\t\t);\n\t\t\tconst token = crypto.randomBytes(24).toString(\"hex\");\n\t\t\tconst createdAt = Date.now();\n\t\t\tconst expiresAt = createdAt + ttlSeconds * 1_000;\n\t\t\tawait c.db.execute(\n\t\t\t\t\"DELETE FROM agentos_actor_preview_tokens WHERE expires_at_ms <= ?\",\n\t\t\t\tcreatedAt,\n\t\t\t);\n\t\t\tconst counts = await c.db.execute<{ count: number }>(\n\t\t\t\t\"SELECT COUNT(*) AS count FROM agentos_actor_preview_tokens\",\n\t\t\t);\n\t\t\tconst activeTokenCount = Number(counts[0]?.count ?? 0);\n\t\t\tif (activeTokenCount >= maxActivePreviewTokens) {\n\t\t\t\tthrow new UserError(\n\t\t\t\t\t`preview token limit ${maxActivePreviewTokens} reached; raise preview.maxActiveTokens to allow more`,\n\t\t\t\t\t{\n\t\t\t\t\t\tcode: \"agentos_preview_token_limit\",\n\t\t\t\t\t\tmetadata: { limit: maxActivePreviewTokens },\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst nextActiveTokenCount = activeTokenCount + 1;\n\t\t\tconst warningThreshold = Math.ceil(maxActivePreviewTokens * 0.8);\n\t\t\tif (nextActiveTokenCount === warningThreshold) {\n\t\t\t\tc.log.warn({\n\t\t\t\t\tmsg: `preview tokens are near the limit of ${maxActivePreviewTokens}; raise preview.maxActiveTokens to allow more`,\n\t\t\t\t\tactiveTokenCount: nextActiveTokenCount,\n\t\t\t\t\tlimit: maxActivePreviewTokens,\n\t\t\t\t});\n\t\t\t}\n\t\t\tawait c.db.execute(\n\t\t\t\t\"INSERT INTO agentos_actor_preview_tokens (token, port, created_at_ms, expires_at_ms) VALUES (?, ?, ?, ?)\",\n\t\t\t\ttoken,\n\t\t\t\tport,\n\t\t\t\tcreatedAt,\n\t\t\t\texpiresAt,\n\t\t\t);\n\t\t\treturn { path: `/fetch/${token}`, token, port, expiresAt };\n\t\t},\n\t\texpirePreviewUrl: async (c: AnyContext, token: string) => {\n\t\t\tawait c.db.execute(\n\t\t\t\t\"DELETE FROM agentos_actor_preview_tokens WHERE token = ?\",\n\t\t\t\ttoken,\n\t\t\t);\n\t\t},\n\t\texportRootFilesystem: async (\n\t\t\tc: AnyContext,\n\t\t\t...args: Parameters<AgentOs[\"filesystem\"][\"export\"]>\n\t\t) => (await ensureVm(c, options)).filesystem.export(...args),\n\t\tmountFs: async (c: AnyContext, descriptor: DynamicMountDescriptor) => {\n\t\t\tawait assertActorCollectionCapacity(\n\t\t\t\tc,\n\t\t\t\t\"agentos_actor_dynamic_mounts\",\n\t\t\t\tdescriptor.path,\n\t\t\t\tmaxDynamicMounts,\n\t\t\t\t\"dynamic mounts\",\n\t\t\t\t\"maxDynamicMounts\",\n\t\t\t);\n\t\t\tconst vm = await ensureVm(c, options);\n\t\t\tawait vm.filesystem.mount(descriptor);\n\t\t\ttry {\n\t\t\t\tawait c.db.execute(\n\t\t\t\t\t\"INSERT INTO agentos_actor_dynamic_mounts (path, descriptor_json) VALUES (?, ?) ON CONFLICT(path) DO UPDATE SET descriptor_json = excluded.descriptor_json\",\n\t\t\t\t\tdescriptor.path,\n\t\t\t\t\tJSON.stringify(descriptor),\n\t\t\t\t);\n\t\t\t} catch (error) {\n\t\t\t\ttry {\n\t\t\t\t\tawait vm.filesystem.unmount(descriptor.path);\n\t\t\t\t} catch (rollbackError) {\n\t\t\t\t\tc.log.error({\n\t\t\t\t\t\tmsg: \"agent-os dynamic mount rollback failed\",\n\t\t\t\t\t\tpath: descriptor.path,\n\t\t\t\t\t\terror: rollbackError,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t},\n\t\tunmountFs: async (c: AnyContext, path: string) => {\n\t\t\tconst rows = await c.db.execute<{ descriptor_json: string }>(\n\t\t\t\t\"SELECT descriptor_json FROM agentos_actor_dynamic_mounts WHERE path = ?\",\n\t\t\t\tpath,\n\t\t\t);\n\t\t\tconst vm = await ensureVm(c, options);\n\t\t\tawait vm.filesystem.unmount(path);\n\t\t\ttry {\n\t\t\t\tawait c.db.execute(\n\t\t\t\t\t\"DELETE FROM agentos_actor_dynamic_mounts WHERE path = ?\",\n\t\t\t\t\tpath,\n\t\t\t\t);\n\t\t\t} catch (error) {\n\t\t\t\tif (rows[0]) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait vm.filesystem.mount(\n\t\t\t\t\t\t\tJSON.parse(rows[0].descriptor_json) as DynamicMountDescriptor,\n\t\t\t\t\t\t);\n\t\t\t\t\t} catch (rollbackError) {\n\t\t\t\t\t\tc.log.error({\n\t\t\t\t\t\t\tmsg: \"agent-os dynamic unmount rollback failed\",\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\terror: rollbackError,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t},\n\t\tlistMounts: async (c: AnyContext) =>\n\t\t\t(await ensureVm(c, options)).filesystem.listMounts(),\n\t\tlistSoftware: async (c: AnyContext) =>\n\t\t\t(await ensureVm(c, options)).software.list(),\n\t\tlinkSoftware: async (c: AnyContext, descriptor: PackageDescriptor) => {\n\t\t\tawait assertActorCollectionCapacity(\n\t\t\t\tc,\n\t\t\t\t\"agentos_actor_linked_software\",\n\t\t\t\tdescriptor.path,\n\t\t\t\tmaxLinkedSoftware,\n\t\t\t\t\"linked software packages\",\n\t\t\t\t\"maxLinkedSoftware\",\n\t\t\t);\n\t\t\tawait c.db.execute(\n\t\t\t\t\"INSERT INTO agentos_actor_linked_software (path, descriptor_json) VALUES (?, ?) ON CONFLICT(path) DO UPDATE SET descriptor_json = excluded.descriptor_json\",\n\t\t\t\tdescriptor.path,\n\t\t\t\tJSON.stringify(descriptor),\n\t\t\t);\n\t\t\ttry {\n\t\t\t\tawait (await ensureVm(c, options)).software.link(descriptor);\n\t\t\t} catch (error) {\n\t\t\t\ttry {\n\t\t\t\t\tawait c.db.execute(\n\t\t\t\t\t\t\"DELETE FROM agentos_actor_linked_software WHERE path = ?\",\n\t\t\t\t\t\tdescriptor.path,\n\t\t\t\t\t);\n\t\t\t\t} catch (rollbackError) {\n\t\t\t\t\tc.log.error({\n\t\t\t\t\t\tmsg: \"agent-os linked software rollback failed\",\n\t\t\t\t\t\tpath: descriptor.path,\n\t\t\t\t\t\terror: rollbackError,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t},\n\t};\n\n\tconst nested = {\n\t\tcreateContext: flat.createContext,\n\t\tprocess: {\n\t\t\texec: flat.exec,\n\t\t\texecFile: flat.execArgv,\n\t\t\tspawn: flat.spawn,\n\t\t\tget: flat.getProcess,\n\t\t\tlist: flat.listProcesses,\n\t\t\ttree: flat.processTree,\n\t\t\twait: flat.waitProcess,\n\t\t\tsignal: flat.signalProcess,\n\t\t\tkill: flat.killProcess,\n\t\t\twriteStdin: flat.writeProcessStdin,\n\t\t\tcloseStdin: flat.closeProcessStdin,\n\t\t\tresizePty: flat.resizeProcessPty,\n\t\t\treadOutput: flat.readProcessOutput,\n\t\t},\n\t\tjavascript: {\n\t\t\texecute: flat.executeJavaScript,\n\t\t\tevaluate: flat.evaluateJavaScript,\n\t\t\texecuteFile: flat.executeJavaScriptFile,\n\t\t\tspawn: flat.spawnJavaScript,\n\t\t\tspawnFile: flat.spawnJavaScriptFile,\n\t\t\tnpm: {\n\t\t\t\tinstall: flat.installNpmPackages,\n\t\t\t\trunScript: flat.executeNpmScript,\n\t\t\t\trunPackage: flat.executeNpmPackage,\n\t\t\t},\n\t\t},\n\t\ttypescript: {\n\t\t\texecute: flat.executeTypeScript,\n\t\t\tevaluate: flat.evaluateTypeScript,\n\t\t\texecuteFile: flat.executeTypeScriptFile,\n\t\t\tspawn: flat.spawnTypeScript,\n\t\t\tspawnFile: flat.spawnTypeScriptFile,\n\t\t\tcheck: flat.checkTypeScript,\n\t\t\tcheckProject: flat.checkTypeScriptProject,\n\t\t},\n\t\tpython: {\n\t\t\texecute: flat.executePython,\n\t\t\tevaluate: flat.evaluatePython,\n\t\t\texecuteFile: flat.executePythonFile,\n\t\t\texecuteModule: flat.executePythonModule,\n\t\t\tspawn: flat.spawnPython,\n\t\t\tspawnFile: flat.spawnPythonFile,\n\t\t\tspawnModule: flat.spawnPythonModule,\n\t\t\tinstall: flat.installPythonPackages,\n\t\t},\n\t\tcontexts: {\n\t\t\tget: flat.getContext,\n\t\t\tlist: flat.listContexts,\n\t\t\treset: flat.resetContext,\n\t\t\tdelete: flat.deleteContext,\n\t\t},\n\t\tterminal: {\n\t\t\topen: flat.openShell,\n\t\t\tlist: flat.listShells,\n\t\t\tsnapshot: flat.shellSnapshot,\n\t\t\twrite: flat.writeShell,\n\t\t\tresize: flat.resizeShell,\n\t\t\twait: flat.waitShell,\n\t\t\tclose: flat.closeShell,\n\t\t},\n\t\tfilesystem: {\n\t\t\treadFile: flat.readFile,\n\t\t\twriteFile: flat.writeFile,\n\t\t\treadFiles: flat.readFiles,\n\t\t\twriteFiles: flat.writeFiles,\n\t\t\tstat: flat.stat,\n\t\t\tmkdir: flat.mkdir,\n\t\t\treaddir: flat.readdir,\n\t\t\treaddirEntries: flat.readdirEntries,\n\t\t\treaddirRecursive: flat.readdirRecursive,\n\t\t\texists: flat.exists,\n\t\t\tmove: flat.move,\n\t\t\tremove: flat.remove,\n\t\t\texport: flat.exportRootFilesystem,\n\t\t\tmount: flat.mountFs,\n\t\t\tunmount: flat.unmountFs,\n\t\t\tlistMounts: flat.listMounts,\n\t\t},\n\t\tnetwork: {\n\t\t\thttpRequest: flat.httpRequest,\n\t\t},\n\t\tsoftware: {\n\t\t\tlist: flat.listSoftware,\n\t\t\tlink: flat.linkSoftware,\n\t\t},\n\t\tagents: {\n\t\t\tlist: flat.listAgents,\n\t\t},\n\t\tsessions: {\n\t\t\topen: flat.openSession,\n\t\t\tget: flat.getSession,\n\t\t\tlist: flat.listSessions,\n\t\t\tdelete: flat.deleteSession,\n\t\t\tunload: flat.unloadSession,\n\t\t\tprompt: flat.prompt,\n\t\t\tcancelPrompt: flat.cancelPrompt,\n\t\t\trespondPermission: flat.respondPermission,\n\t\t\treadHistory: flat.readHistory,\n\t\t\tgetConfig: flat.getSessionConfig,\n\t\t\tsetConfigOption: flat.setSessionConfigOption,\n\t\t\tgetCapabilities: flat.getSessionCapabilities,\n\t\t\tgetAgentInfo: flat.getSessionAgentInfo,\n\t\t},\n\t\tcron: {\n\t\t\tschedule: flat.scheduleCron,\n\t\t\tlist: flat.listCronJobs,\n\t\t\tcancel: flat.cancelCronJob,\n\t\t},\n\t};\n\n\treturn {\n\t\t...nested,\n\n\t\t// Legacy flat actions from the pre-language-execution API. Keep these\n\t\t// as aliases to the canonical nested handlers.\n\t\treadFile: nested.filesystem.readFile,\n\t\twriteFile: nested.filesystem.writeFile,\n\t\treadFiles: nested.filesystem.readFiles,\n\t\twriteFiles: nested.filesystem.writeFiles,\n\t\tstat: nested.filesystem.stat,\n\t\tmkdir: nested.filesystem.mkdir,\n\t\treaddir: nested.filesystem.readdir,\n\t\treaddirEntries: nested.filesystem.readdirEntries,\n\t\treaddirRecursive: nested.filesystem.readdirRecursive,\n\t\texists: nested.filesystem.exists,\n\t\tmove: nested.filesystem.move,\n\t\tremove: nested.filesystem.remove,\n\t\texportRootFilesystem: nested.filesystem.export,\n\t\tmountFs: nested.filesystem.mount,\n\t\tunmountFs: nested.filesystem.unmount,\n\t\tlistMounts: nested.filesystem.listMounts,\n\t\texec: async (c: AnyContext, ...args: Parameters<AgentOs[\"exec\"]>) =>\n\t\t\t(await ensureVm(c, options)).exec(...args),\n\t\texecArgv: async (c: AnyContext, ...args: Parameters<AgentOs[\"execArgv\"]>) =>\n\t\t\t(await ensureVm(c, options)).execArgv(...args),\n\t\tspawn: nested.process.spawn,\n\t\twaitProcess: nested.process.wait,\n\t\tkillProcess: nested.process.kill,\n\t\tlistProcesses: nested.process.list,\n\t\tprocessTree: nested.process.tree,\n\t\tgetProcess: nested.process.get,\n\t\twriteProcessStdin: nested.process.writeStdin,\n\t\tcloseProcessStdin: nested.process.closeStdin,\n\t\topenShell: nested.terminal.open,\n\t\tlistShells: nested.terminal.list,\n\t\tshellSnapshot: nested.terminal.snapshot,\n\t\twriteShell: nested.terminal.write,\n\t\tresizeShell: nested.terminal.resize,\n\t\tcloseShell: nested.terminal.close,\n\t\twaitShell: nested.terminal.wait,\n\t\thttpRequest: nested.network.httpRequest,\n\t\tvmFetch: flat.vmFetch,\n\t\tvmFetchStreamStart: flat.vmFetchStreamStart,\n\t\tvmFetchStreamRead: flat.vmFetchStreamRead,\n\t\tvmFetchStreamCancel: flat.vmFetchStreamCancel,\n\t\tscheduleCron: nested.cron.schedule,\n\t\tlistCronJobs: nested.cron.list,\n\t\tcancelCronJob: nested.cron.cancel,\n\t\tlistAgents: nested.agents.list,\n\t\topenSession: nested.sessions.open,\n\t\tgetSession: nested.sessions.get,\n\t\tlistSessions: nested.sessions.list,\n\t\tdeleteSession: nested.sessions.delete,\n\t\tunloadSession: nested.sessions.unload,\n\t\tprompt: nested.sessions.prompt,\n\t\tcancelPrompt: nested.sessions.cancelPrompt,\n\t\trespondPermission: nested.sessions.respondPermission,\n\t\treadHistory: nested.sessions.readHistory,\n\t\tgetSessionConfig: nested.sessions.getConfig,\n\t\tsetSessionConfigOption: nested.sessions.setConfigOption,\n\t\tgetSessionCapabilities: nested.sessions.getCapabilities,\n\t\tgetSessionAgentInfo: nested.sessions.getAgentInfo,\n\t\tlistSoftware: nested.software.list,\n\t\tlinkSoftware: nested.software.link,\n\n\t\t// Preview URLs are RivetKit-specific and intentionally stay flat.\n\t\tcreatePreviewUrl: flat.createPreviewUrl,\n\t\texpirePreviewUrl: flat.expirePreviewUrl,\n\t\t// Observe-only runtime health, also RivetKit-specific.\n\t\thealth: flat.health,\n\t};\n}\n\nexport type AgentOsActions = ReturnType<typeof createAgentOsActions>;\nexport type AgentOsActorDefinition<TConnParams = undefined> = ActorDefinition<\n\tundefined,\n\tTConnParams,\n\tundefined,\n\tundefined,\n\tundefined,\n\tActorDb,\n\tBuiltInEvents,\n\tRecord<never, never>,\n\tAgentOsActions\n>;\n\nexport interface AgentOsActorExtras<\n\tTHostFunctions extends HostFunctionSchemas = HostFunctionSchemas,\n> extends AgentOsOptions<THostFunctions> {\n\t/**\n\t * Resolve trusted VM options from actor state immediately before the VM's\n\t * first boot. Evaluated once per wake. The actor-owned root filesystem and\n\t * database cannot be replaced.\n\t */\n\tresolveOptions?: (c: AnyContext) => AgentOsOptions | Promise<AgentOsOptions>;\n\t/** Start long-lived processes after each VM boot. Trusted host code only. */\n\tonVmStart?: (c: AnyContext, vm: AgentOs) => void | Promise<void>;\n\t/** Gracefully stop long-lived processes before the VM is disposed. */\n\tonVmStop?: (\n\t\tc: AnyContext,\n\t\tvm: AgentOs,\n\t\treason: \"sleep\" | \"destroy\" | \"error\",\n\t) => void | Promise<void>;\n\t/** Clean up host resources after the VM and lazy mount readers close. */\n\tonVmDisposed?: (\n\t\tc: AnyContext,\n\t\treason: \"sleep\" | \"destroy\" | \"error\",\n\t) => void | Promise<void>;\n\t/** Maximum live session event subscriptions per actor VM. Default: 10,000. */\n\tmaxSessionSubscriptions?: number;\n\t/** Maximum durable dynamic mount descriptors per actor. Default: 10,000. */\n\tmaxDynamicMounts?: number;\n\t/** Maximum durable linked software descriptors per actor. Default: 10,000. */\n\tmaxLinkedSoftware?: number;\n\tpreview?: {\n\t\tdefaultExpiresInSeconds?: number;\n\t\tmaxExpiresInSeconds?: number;\n\t\tmaxActiveTokens?: number;\n\t};\n}\n\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown\n\t? Omit<T, K>\n\t: never;\n\nexport type AgentOsActorConfigInput<\n\tTState = undefined,\n\tTConnParams = undefined,\n\tTConnState = undefined,\n\tTVars = undefined,\n\tTInput = undefined,\n\tTEvents extends EventSchemaConfig = Record<never, never>,\n\tTQueues extends QueueSchemaConfig = Record<never, never>,\n\tTUserActions extends Actions<\n\t\tTState,\n\t\tTConnParams,\n\t\tTConnState,\n\t\tTVars,\n\t\tTInput,\n\t\tActorDb,\n\t\tTEvents,\n\t\tTQueues\n\t> = Record<never, never>,\n\tTHostFunctions extends HostFunctionSchemas = HostFunctionSchemas,\n> = DistributiveOmit<\n\tActorConfigInput<\n\t\tTState,\n\t\tTConnParams,\n\t\tTConnState,\n\t\tTVars,\n\t\tTInput,\n\t\tActorDb,\n\t\tTEvents,\n\t\tTQueues,\n\t\tTUserActions\n\t>,\n\t\"db\"\n> &\n\tAgentOsActorExtras<THostFunctions> &\n\tAgentOsEventHooks<\n\t\tActorContext<\n\t\t\tTState,\n\t\t\tTConnParams,\n\t\t\tTConnState,\n\t\t\tTVars,\n\t\t\tTInput,\n\t\t\tActorDb,\n\t\t\tTEvents,\n\t\t\tTQueues\n\t\t>\n\t>;\n\nconst agentOsOptionKeys = [\n\t\"software\",\n\t\"defaultSoftware\",\n\t\"loopbackExemptPorts\",\n\t\"allowedNodeBuiltins\",\n\t\"highResolutionTime\",\n\t\"database\",\n\t\"rootFilesystem\",\n\t\"mounts\",\n\t\"sandbox\",\n\t\"scheduleDriver\",\n\t\"hostFunctions\",\n\t\"permissions\",\n\t\"sidecar\",\n\t\"limits\",\n\t\"onAgentStderr\",\n\t\"onAgentExit\",\n\t\"onLimitWarning\",\n] as const satisfies readonly (keyof AgentOsOptions)[];\n\nfunction splitConfig(\n\tconfig: AgentOsActorConfigInput<any, any, any, any, any, any, any, any>,\n) {\n\tconst actorConfig = { ...config } as Record<string, unknown>;\n\tconst agentOsOptions: AgentOsOptions = {};\n\tfor (const key of agentOsOptionKeys) {\n\t\tif (key in actorConfig) {\n\t\t\t(agentOsOptions as Record<string, unknown>)[key] = actorConfig[key];\n\t\t\tdelete actorConfig[key];\n\t\t}\n\t}\n\tconst onSessionEvent =\n\t\tactorConfig.onSessionEvent as AgentOsEventHooks<AnyContext>[\"onSessionEvent\"];\n\tconst preview = actorConfig.preview as AgentOsActorExtras[\"preview\"];\n\tconst resolveOptions = actorConfig.resolveOptions as\n\t\t| AgentOsActorExtras[\"resolveOptions\"]\n\t\t| undefined;\n\tconst onVmStart = actorConfig.onVmStart as AgentOsActorExtras[\"onVmStart\"];\n\tconst onVmStop = actorConfig.onVmStop as AgentOsActorExtras[\"onVmStop\"];\n\tconst onVmDisposed =\n\t\tactorConfig.onVmDisposed as AgentOsActorExtras[\"onVmDisposed\"];\n\tconst maxSessionSubscriptions = actorConfig.maxSessionSubscriptions as\n\t\t| number\n\t\t| undefined;\n\tconst maxDynamicMounts = actorConfig.maxDynamicMounts as number | undefined;\n\tconst maxLinkedSoftware = actorConfig.maxLinkedSoftware as number | undefined;\n\tdelete actorConfig.onSessionEvent;\n\tdelete actorConfig.preview;\n\tdelete actorConfig.resolveOptions;\n\tdelete actorConfig.onVmStart;\n\tdelete actorConfig.onVmStop;\n\tdelete actorConfig.onVmDisposed;\n\tdelete actorConfig.maxSessionSubscriptions;\n\tdelete actorConfig.maxDynamicMounts;\n\tdelete actorConfig.maxLinkedSoftware;\n\treturn {\n\t\tactorConfig,\n\t\tagentOsOptions,\n\t\thooks: { onSessionEvent },\n\t\tpreview,\n\t\tresolveOptions,\n\t\tonVmStart,\n\t\tonVmStop,\n\t\tonVmDisposed,\n\t\tmaxSessionSubscriptions,\n\t\tmaxDynamicMounts,\n\t\tmaxLinkedSoftware,\n\t};\n}\n\nfunction assertNoReservedKeys(\n\tkind: string,\n\tcustom: object | undefined,\n\tbuiltIns: object,\n) {\n\tfor (const key of Object.keys(custom ?? {})) {\n\t\tif (key in builtIns)\n\t\t\tthrow new Error(`agentOS() ${kind} name is reserved: ${key}`);\n\t}\n}\n\n// Absolute path to the built inspector-tabs app (the shared Vite bundle). All\n// custom tabs share this one `source` dir; the app routes on the\n// `/inspector/custom-tabs/<id>/` URL segment. Resolves from both `src/` (tsx\n// dev) and the published `dist/`, since `assets/` sits at the package root in\n// both layouts.\nconst INSPECTOR_TABS_ASSET_DIR = join(\n\tdirname(fileURLToPath(import.meta.url)),\n\t\"..\",\n\t\"assets\",\n\t\"inspector-tabs-app\",\n);\n\n// Custom inspector tabs shipped by agent-os. Ids MUST match the `TABS`\n// registry in `src/inspector-tabs/main.tsx`. The built-in rivetkit tabs are\n// hidden so the dashboard shows only the agent-os tabs.\nconst AGENTOS_INSPECTOR_CONFIG = {\n\ttabs: [\n\t\t{\n\t\t\tid: \"transcript\",\n\t\t\tlabel: \"Transcript\",\n\t\t\tsource: INSPECTOR_TABS_ASSET_DIR,\n\t\t\ticon: \"comments\",\n\t\t},\n\t\t{\n\t\t\tid: \"filesystem\",\n\t\t\tlabel: \"Filesystem\",\n\t\t\tsource: INSPECTOR_TABS_ASSET_DIR,\n\t\t\ticon: \"folder-tree\",\n\t\t},\n\t\t{\n\t\t\tid: \"terminal\",\n\t\t\tlabel: \"Terminal\",\n\t\t\tsource: INSPECTOR_TABS_ASSET_DIR,\n\t\t\ticon: \"terminal\",\n\t\t},\n\t\t{\n\t\t\tid: \"system\",\n\t\t\tlabel: \"System\",\n\t\t\tsource: INSPECTOR_TABS_ASSET_DIR,\n\t\t\ticon: \"layer-group\",\n\t\t},\n\t\t// Processes/software/mounts live as sections inside the System tab.\n\t\t// `metadata` is dashboard-owned and not hideable (the schema only\n\t\t// accepts the six built-in ids below), so it stays.\n\t\t...[\"workflow\", \"database\", \"state\", \"queue\", \"connections\", \"console\"].map(\n\t\t\t(id) => ({ id, hidden: true as const }),\n\t\t),\n\t],\n};\n\nexport function createAgentOS<\n\tTState = undefined,\n\tTConnParams = undefined,\n\tTConnState = undefined,\n\tTVars = undefined,\n\tTInput = undefined,\n\tTEvents extends EventSchemaConfig = Record<never, never>,\n\tTQueues extends QueueSchemaConfig = Record<never, never>,\n\tTUserActions extends Actions<\n\t\tTState,\n\t\tTConnParams,\n\t\tTConnState,\n\t\tTVars,\n\t\tTInput,\n\t\tActorDb,\n\t\tTEvents,\n\t\tTQueues\n\t> = Record<never, never>,\n\tTHostFunctions extends HostFunctionSchemas = HostFunctionSchemas,\n>(\n\tconfig: AgentOsActorConfigInput<\n\t\tTState,\n\t\tTConnParams,\n\t\tTConnState,\n\t\tTVars,\n\t\tTInput,\n\t\tTEvents,\n\t\tTQueues,\n\t\tTUserActions,\n\t\tTHostFunctions\n\t> = {} as AgentOsActorConfigInput<\n\t\tTState,\n\t\tTConnParams,\n\t\tTConnState,\n\t\tTVars,\n\t\tTInput,\n\t\tTEvents,\n\t\tTQueues,\n\t\tTUserActions,\n\t\tTHostFunctions\n\t>,\n): ActorDefinition<\n\tTState,\n\tTConnParams,\n\tTConnState,\n\tTVars,\n\tTInput,\n\tActorDb,\n\tTEvents & BuiltInEvents,\n\tTQueues,\n\tTUserActions & AgentOsActions\n> {\n\tconst split = splitConfig(config);\n\tconst actorConfig = split.actorConfig as Omit<\n\t\ttypeof config,\n\t\tkeyof AgentOsActorExtras\n\t>;\n\tconst {\n\t\tagentOsOptions,\n\t\thooks,\n\t\tpreview,\n\t\tmaxSessionSubscriptions,\n\t\tmaxDynamicMounts,\n\t\tmaxLinkedSoftware,\n\t} = split;\n\tif (split.resolveOptions)\n\t\toptionResolvers.set(agentOsOptions, split.resolveOptions);\n\tif (split.onVmStart) vmStartResolvers.set(agentOsOptions, split.onVmStart);\n\tif (split.onVmStop) vmStopResolvers.set(agentOsOptions, split.onVmStop);\n\tif (split.onVmDisposed)\n\t\tvmDisposedResolvers.set(agentOsOptions, split.onVmDisposed);\n\tif (agentOsOptions.sandbox && \"client\" in agentOsOptions.sandbox) {\n\t\tthrow new Error(\n\t\t\t\"agentOS() cannot share sandbox: { client } across actor instances; use sandbox: { provider } so each actor VM starts its own client\",\n\t\t);\n\t}\n\tif (agentOsOptions.rootFilesystem) {\n\t\tthrow new Error(\n\t\t\t\"agentOS() owns rootFilesystem so it can persist directly through the actor SQLite UDS; use mounts for additional filesystems\",\n\t\t);\n\t}\n\tif (agentOsOptions.database) {\n\t\tthrow new Error(\n\t\t\t\"agentOS() owns database and injects the actor SQLite UDS descriptor; standalone AgentOs clients may choose a SQLite file\",\n\t\t);\n\t}\n\tconst actions = createAgentOsActions(\n\t\tagentOsOptions,\n\t\thooks,\n\t\tpreview,\n\t\tmaxSessionSubscriptions,\n\t\tmaxDynamicMounts,\n\t\tmaxLinkedSoftware,\n\t);\n\tassertNoReservedKeys(\"action\", actorConfig.actions, actions);\n\tassertNoReservedKeys(\"event\", actorConfig.events, builtInEvents);\n\n\tconst userOnWake = actorConfig.onWake;\n\tconst userOnSleep = actorConfig.onSleep;\n\tconst userOnDestroy = actorConfig.onDestroy;\n\tconst userOnRequest = actorConfig.onRequest;\n\tconst userOnBeforeConnect = actorConfig.onBeforeConnect;\n\n\treturn actor({\n\t\t...actorConfig,\n\t\toptions: {\n\t\t\tactionTimeout: DEFAULT_ACTION_TIMEOUT_MS,\n\t\t\tsleepGracePeriod: DEFAULT_SLEEP_GRACE_PERIOD_MS,\n\t\t\t...actorConfig.options,\n\t\t\tenableActorRuntimeSocket: true,\n\t\t},\n\t\t// Register the custom agent-os inspector tabs (and hide the built-in\n\t\t// rivetkit tabs) so the dashboard renders the agent-os UI. Without\n\t\t// this the shipped tab assets are never surfaced. A caller-supplied\n\t\t// inspector config wins.\n\t\tinspector:\n\t\t\t(actorConfig as { inspector?: unknown }).inspector ??\n\t\t\tAGENTOS_INSPECTOR_CONFIG,\n\t\tdb: db({ onMigrate: migrateAgentOsActorTables }),\n\t\tevents: { ...(actorConfig.events ?? {}), ...builtInEvents },\n\t\tactions: { ...(actorConfig.actions ?? {}), ...actions },\n\t\tonBeforeConnect: async (\n\t\t\tc: Parameters<NonNullable<typeof userOnBeforeConnect>>[0],\n\t\t\tparams: Parameters<NonNullable<typeof userOnBeforeConnect>>[1],\n\t\t) => {\n\t\t\tif (\n\t\t\t\tc.request &&\n\t\t\t\tmatchPreviewPath(new URL(c.request.url).pathname) !== null\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tawait userOnBeforeConnect?.(c, params);\n\t\t},\n\t\tonWake: async (c: AnyContext) => {\n\t\t\ttry {\n\t\t\t\tawait userOnWake?.(c);\n\t\t\t} catch (error) {\n\t\t\t\tawait disposeVm(c as AnyContext, \"error\");\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t},\n\t\tonSleep: async (c: AnyContext) => {\n\t\t\ttry {\n\t\t\t\tawait userOnSleep?.(c);\n\t\t\t} finally {\n\t\t\t\tawait disposeVm(c as AnyContext, \"sleep\");\n\t\t\t}\n\t\t},\n\t\tonDestroy: async (c: AnyContext) => {\n\t\t\ttry {\n\t\t\t\tawait userOnDestroy?.(c);\n\t\t\t} finally {\n\t\t\t\tawait disposeVm(c as AnyContext, \"destroy\");\n\t\t\t}\n\t\t},\n\t\tonRequest: async (c: AnyContext, request: Request) => {\n\t\t\tconst url = new URL(request.url);\n\t\t\tconst match = matchPreviewPath(url.pathname);\n\t\t\tif (!match) {\n\t\t\t\tconst response = await userOnRequest?.(c as never, request);\n\t\t\t\treturn response ?? new Response(\"Not Found\", { status: 404 });\n\t\t\t}\n\t\t\tif (request.method === \"OPTIONS\")\n\t\t\t\treturn new Response(null, {\n\t\t\t\t\tstatus: 204,\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t\"access-control-allow-origin\": \"*\",\n\t\t\t\t\t\t\"access-control-allow-methods\":\n\t\t\t\t\t\t\t\"GET, POST, PUT, PATCH, DELETE, OPTIONS\",\n\t\t\t\t\t\t\"access-control-allow-headers\": \"*\",\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\tconst now = Date.now();\n\t\t\tawait c.db.execute(\n\t\t\t\t\"DELETE FROM agentos_actor_preview_tokens WHERE expires_at_ms <= ?\",\n\t\t\t\tnow,\n\t\t\t);\n\t\t\tconst rows = await c.db.execute<{ port: number }>(\n\t\t\t\t\"SELECT port FROM agentos_actor_preview_tokens WHERE token = ? AND expires_at_ms > ?\",\n\t\t\t\tmatch[1],\n\t\t\t\tnow,\n\t\t\t);\n\t\t\tif (!rows[0])\n\t\t\t\treturn new Response(\"Preview URL expired or invalid\", { status: 403 });\n\t\t\tconst target = new URL(request.url);\n\t\t\ttarget.pathname = match[2] ?? \"/\";\n\t\t\tconst vm = await ensureVm(c as AnyContext, agentOsOptions);\n\t\t\tconst requestHeaders: Record<string, string> = {};\n\t\t\trequest.headers.forEach((value, key) => {\n\t\t\t\trequestHeaders[key] = value;\n\t\t\t});\n\t\t\tconst response = await vm.network.httpRequest({\n\t\t\t\tport: rows[0].port,\n\t\t\t\tpath: `${target.pathname}${target.search}`,\n\t\t\t\tmethod: request.method,\n\t\t\t\theaders: requestHeaders,\n\t\t\t\t...(request.method === \"GET\" || request.method === \"HEAD\"\n\t\t\t\t\t? {}\n\t\t\t\t\t: { body: new Uint8Array(await request.arrayBuffer()) }),\n\t\t\t});\n\t\t\tconst headers = new Headers(response.headers);\n\t\t\theaders.set(\"access-control-allow-origin\", \"*\");\n\t\t\treturn new Response(Buffer.from(response.body), {\n\t\t\t\tstatus: response.status,\n\t\t\t\tstatusText: response.statusText,\n\t\t\t\theaders,\n\t\t\t});\n\t\t},\n\t} as any) as ActorDefinition<\n\t\tTState,\n\t\tTConnParams,\n\t\tTConnState,\n\t\tTVars,\n\t\tTInput,\n\t\tActorDb,\n\t\tTEvents & BuiltInEvents,\n\t\tTQueues,\n\t\tTUserActions & AgentOsActions\n\t>;\n}\n","// Server-side terminal state for shell replay.\n//\n// A shell outlives the page that opened it, and the dashboard reboots the tab\n// iframe on every tab switch. Without state on this side, a reattaching client\n// sees a blank pane until the guest happens to repaint — which a full-screen\n// program (vim, less) never does unprompted. So the actor keeps a headless\n// Ghostty emulator per shell, fed from the same chunks it broadcasts, and\n// serializes it back to ANSI on demand.\nimport { readFile } from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport type { ShellReplayMode, ShellSnapshot } from \"./types.js\";\n\n/** Emulators alive at once. Matches the actor's open-shell ceiling. */\nconst MAX_REPLAY_SHELLS = 32;\n/** Scrollback retained per shell. Bounds the `scrollback` snapshot mode and\n * the emulator's own memory; the screen itself is bounded by cols × rows. */\nconst MAX_SCROLLBACK_LINES = 1_000;\n/** Rejects an absurd resize before it becomes a cols × rows allocation. */\nconst MAX_COLS = 1_000;\nconst MAX_ROWS = 1_000;\n\nconst DEFAULT_COLS = 80;\nconst DEFAULT_ROWS = 24;\n\n// ── WASM loading ───────────────────────────────────────────────────────────\n// ghostty-web's own loader resolves its inlined wasm against `self.location`,\n// which does not exist outside a browser. Instantiating the shipped .wasm\n// directly avoids both the missing global and a multi-megabyte base64 decode.\ninterface GhosttyModule {\n\tcreateTerminal(\n\t\tcols: number,\n\t\trows: number,\n\t\tconfig?: { scrollbackLimit?: number },\n\t): HeadlessTerminal;\n}\n\ninterface WebAssemblyRuntime {\n\tinstantiate(\n\t\tbytes: Uint8Array,\n\t\timports: Record<string, Record<string, () => void>>,\n\t): Promise<{ instance: object }>;\n}\n\ninterface GhosttyCell {\n\tcodepoint: number;\n\tfg_r: number;\n\tfg_g: number;\n\tfg_b: number;\n\tbg_r: number;\n\tbg_g: number;\n\tbg_b: number;\n\tflags: number;\n\twidth: number;\n\tgrapheme_len: number;\n}\n\ninterface HeadlessTerminal {\n\twrite(data: string | Uint8Array): void;\n\tresize(cols: number, rows: number): void;\n\tfree(): void;\n\tupdate(): number;\n\tgetViewport(): GhosttyCell[];\n\tgetCursor(): { viewportX: number; viewportY: number; visible: number };\n\tgetColors(): {\n\t\tforeground: { r: number; g: number; b: number };\n\t\tbackground: { r: number; g: number; b: number };\n\t};\n\tgetGraphemeString(row: number, col: number): string;\n\tgetScrollbackLength(): number;\n\tgetScrollbackLine(offset: number): GhosttyCell[] | null;\n\tgetScrollbackGraphemeString(offset: number, col: number): string;\n\tisAlternateScreen(): boolean;\n\tgetMode(mode: number, isAnsi?: boolean): boolean;\n}\n\nlet ghosttyPromise: Promise<GhosttyModule> | undefined;\n\nasync function loadGhostty(): Promise<GhosttyModule> {\n\tghosttyPromise ??= (async () => {\n\t\tconst require = createRequire(import.meta.url);\n\t\tconst { Ghostty } = await import(\"ghostty-web\");\n\t\tconst bytes = await readFile(\n\t\t\trequire.resolve(\"ghostty-web/ghostty-vt.wasm\"),\n\t\t);\n\t\tconst webAssembly = Reflect.get(globalThis, \"WebAssembly\") as\n\t\t\t| WebAssemblyRuntime\n\t\t\t| undefined;\n\t\tif (!webAssembly) {\n\t\t\tthrow new Error(\"WebAssembly is unavailable in this runtime\");\n\t\t}\n\t\tconst { instance } = await webAssembly.instantiate(bytes, {\n\t\t\tenv: { log: () => {} },\n\t\t});\n\t\tconst GhosttyConstructor = Ghostty as unknown as new (\n\t\t\tinstance: object,\n\t\t) => GhosttyModule;\n\t\treturn new GhosttyConstructor(instance);\n\t})();\n\treturn ghosttyPromise;\n}\n\n// ── ANSI serialization ─────────────────────────────────────────────────────\nconst CELL_BOLD = 1;\nconst CELL_ITALIC = 2;\nconst CELL_UNDERLINE = 4;\nconst CELL_STRIKETHROUGH = 8;\nconst CELL_INVERSE = 16;\nconst CELL_INVISIBLE = 32;\nconst CELL_BLINK = 64;\nconst CELL_FAINT = 128;\n\n/** DEC private modes worth restoring: getting these wrong strands the guest in\n * a state its client no longer agrees with — arrow keys emitting the wrong\n * prefix, or a paste arriving unbracketed and executing as commands. Each is\n * read back individually rather than inferred, so the exact mouse protocol\n * survives too. Alt-screen (1049) and cursor visibility (25) are restored\n * separately, in a fixed order relative to the repaint. */\nconst RESTORED_DEC_MODES = [\n\t1, // DECCKM — application cursor keys\n\t7, // DECAWM — autowrap\n\t1000, // mouse: click tracking\n\t1002, // mouse: button-event tracking\n\t1003, // mouse: any-event tracking\n\t1004, // focus in/out reporting\n\t1005, // mouse: UTF-8 coordinates\n\t1006, // mouse: SGR coordinates\n\t1015, // mouse: urxvt coordinates\n\t2004, // bracketed paste\n];\n\ninterface CellStyle {\n\tfg: number | null;\n\tbg: number | null;\n\tflags: number;\n}\n\nconst DEFAULT_STYLE: CellStyle = { fg: null, bg: null, flags: 0 };\n\nfunction rgb(r: number, g: number, b: number): number {\n\treturn (r << 16) | (g << 8) | b;\n}\n\nfunction styleOf(\n\tcell: GhosttyCell,\n\tdefaultFg: number,\n\tdefaultBg: number,\n): CellStyle {\n\tconst fg = rgb(cell.fg_r, cell.fg_g, cell.fg_b);\n\tconst bg = rgb(cell.bg_r, cell.bg_g, cell.bg_b);\n\treturn {\n\t\tfg: fg === defaultFg ? null : fg,\n\t\tbg: bg === defaultBg ? null : bg,\n\t\tflags: cell.flags,\n\t};\n}\n\nfunction sameStyle(a: CellStyle, b: CellStyle): boolean {\n\treturn a.fg === b.fg && a.bg === b.bg && a.flags === b.flags;\n}\n\n/** Full SGR for a style, always prefixed with a reset so it never inherits\n * attributes from whatever the client last rendered. */\nfunction sgr(style: CellStyle): string {\n\tconst params: number[] = [0];\n\tif (style.flags & CELL_BOLD) params.push(1);\n\tif (style.flags & CELL_FAINT) params.push(2);\n\tif (style.flags & CELL_ITALIC) params.push(3);\n\tif (style.flags & CELL_UNDERLINE) params.push(4);\n\tif (style.flags & CELL_BLINK) params.push(5);\n\tif (style.flags & CELL_INVERSE) params.push(7);\n\tif (style.flags & CELL_INVISIBLE) params.push(8);\n\tif (style.flags & CELL_STRIKETHROUGH) params.push(9);\n\tif (style.fg !== null) {\n\t\tparams.push(\n\t\t\t38,\n\t\t\t2,\n\t\t\t(style.fg >> 16) & 0xff,\n\t\t\t(style.fg >> 8) & 0xff,\n\t\t\tstyle.fg & 0xff,\n\t\t);\n\t}\n\tif (style.bg !== null) {\n\t\tparams.push(\n\t\t\t48,\n\t\t\t2,\n\t\t\t(style.bg >> 16) & 0xff,\n\t\t\t(style.bg >> 8) & 0xff,\n\t\t\tstyle.bg & 0xff,\n\t\t);\n\t}\n\treturn `\\x1b[${params.join(\";\")}m`;\n}\n\n/** One row of cells → text plus SGR changes. `graphemeAt` supplies the full\n * cluster for cells that carry combining marks. Trailing default-styled blanks\n * are dropped in favour of an erase-to-end-of-line. */\nfunction serializeRow(\n\tcells: GhosttyCell[],\n\tcols: number,\n\tdefaultFg: number,\n\tdefaultBg: number,\n\tgraphemeAt: (col: number) => string,\n): string {\n\tlet lastMeaningful = -1;\n\tfor (let x = 0; x < cols; x++) {\n\t\tconst cell = cells[x];\n\t\tif (!cell) continue;\n\t\tconst blank = cell.codepoint === 0 || cell.codepoint === 32;\n\t\tif (\n\t\t\t!blank ||\n\t\t\t!sameStyle(styleOf(cell, defaultFg, defaultBg), DEFAULT_STYLE)\n\t\t) {\n\t\t\tlastMeaningful = x;\n\t\t}\n\t}\n\tif (lastMeaningful < 0) return \"\\x1b[0m\\x1b[K\";\n\n\tlet out = \"\";\n\tlet current = DEFAULT_STYLE;\n\tout += sgr(current);\n\tfor (let x = 0; x <= lastMeaningful; x++) {\n\t\tconst cell = cells[x];\n\t\tif (!cell) {\n\t\t\tout += \" \";\n\t\t\tcontinue;\n\t\t}\n\t\t// Width 0 is the trailing half of a wide character; the preceding cell\n\t\t// already emitted the whole glyph.\n\t\tif (cell.width === 0) continue;\n\t\tconst style = styleOf(cell, defaultFg, defaultBg);\n\t\tif (!sameStyle(style, current)) {\n\t\t\tout += sgr(style);\n\t\t\tcurrent = style;\n\t\t}\n\t\tif (cell.grapheme_len > 0) {\n\t\t\tout += graphemeAt(x);\n\t\t} else if (cell.codepoint === 0) {\n\t\t\tout += \" \";\n\t\t} else {\n\t\t\tout += String.fromCodePoint(cell.codepoint);\n\t\t}\n\t}\n\treturn `${out}\\x1b[0m\\x1b[K`;\n}\n\n// ── Store ──────────────────────────────────────────────────────────────────\ninterface ReplayEntry {\n\tterm: HeadlessTerminal;\n\tcols: number;\n\trows: number;\n\tseq: number;\n}\n\nfunction clamp(\n\tvalue: number | undefined,\n\tfallback: number,\n\tmax: number,\n): number {\n\tif (!Number.isFinite(value) || value === undefined || value <= 0)\n\t\treturn fallback;\n\treturn Math.min(Math.floor(value), max);\n}\n\n/**\n * One headless emulator per live shell, fed the same bytes the actor\n * broadcasts. All methods are no-ops for unknown shell ids so a shell opened\n * before replay existed (or one whose emulator failed to start) degrades to\n * the previous behaviour instead of failing the write path.\n */\nexport class ShellReplayStore {\n\tprivate entries = new Map<string, ReplayEntry>();\n\tprivate ghostty: GhosttyModule | null = null;\n\n\t/** Instantiates the WASM module. Callers must await this before opening a\n\t * shell so that `open` itself can be synchronous: a PTY starts producing\n\t * output the moment it exists, and any await between opening it and\n\t * subscribing is a window where output is lost to every consumer. */\n\tasync warm(): Promise<void> {\n\t\tthis.ghostty ??= await loadGhostty();\n\t}\n\n\topen(shellId: string, cols?: number, rows?: number): void {\n\t\tif (this.entries.has(shellId)) return;\n\t\tif (this.entries.size >= MAX_REPLAY_SHELLS) {\n\t\t\tthrow new Error(\n\t\t\t\t`agent-os shell replay limit reached (${MAX_REPLAY_SHELLS} emulators); close a shell or raise MAX_REPLAY_SHELLS in shell-replay.ts`,\n\t\t\t);\n\t\t}\n\t\tif (!this.ghostty) {\n\t\t\tthrow new Error(\"agent-os shell replay used before warm() resolved\");\n\t\t}\n\t\tconst width = clamp(cols, DEFAULT_COLS, MAX_COLS);\n\t\tconst height = clamp(rows, DEFAULT_ROWS, MAX_ROWS);\n\t\tconst term = this.ghostty.createTerminal(width, height, {\n\t\t\tscrollbackLimit: MAX_SCROLLBACK_LINES,\n\t\t});\n\t\t// A freed terminal's handle is recycled without its screen being cleared,\n\t\t// so a new emulator can start holding the previous shell's contents — and\n\t\t// serve them to whoever attaches next. Reset before anything is fed in.\n\t\tterm.write(\"\\x1bc\");\n\t\tthis.entries.set(shellId, { term, cols: width, rows: height, seq: 0 });\n\t}\n\n\t/** Feeds one broadcast chunk and returns its sequence number. Clients use\n\t * it to drop chunks a snapshot already contains. Returns 0 when this shell\n\t * has no emulator, which clients read as \"no replay available\". */\n\tfeed(shellId: string, data: Uint8Array): number {\n\t\tconst entry = this.entries.get(shellId);\n\t\tif (!entry) return 0;\n\t\tentry.term.write(data);\n\t\treturn ++entry.seq;\n\t}\n\n\tresize(shellId: string, cols: number, rows: number): void {\n\t\tconst entry = this.entries.get(shellId);\n\t\tif (!entry) return;\n\t\tentry.cols = clamp(cols, entry.cols, MAX_COLS);\n\t\tentry.rows = clamp(rows, entry.rows, MAX_ROWS);\n\t\tentry.term.resize(entry.cols, entry.rows);\n\t}\n\n\tclose(shellId: string): void {\n\t\tconst entry = this.entries.get(shellId);\n\t\tif (!entry) return;\n\t\tthis.entries.delete(shellId);\n\t\tentry.term.free();\n\t}\n\n\thas(shellId: string): boolean {\n\t\treturn this.entries.has(shellId);\n\t}\n\n\tsnapshot(shellId: string, mode: ShellReplayMode): ShellSnapshot | null {\n\t\tconst entry = this.entries.get(shellId);\n\t\tif (!entry) return null;\n\t\tconst { term, cols, rows, seq } = entry;\n\t\tconst base = { shellId, seq, cols, rows };\n\t\tif (mode === \"none\") return { ...base, mode, data: \"\" };\n\n\t\tterm.update();\n\t\tconst colors = term.getColors();\n\t\tconst defaultFg = rgb(\n\t\t\tcolors.foreground.r,\n\t\t\tcolors.foreground.g,\n\t\t\tcolors.foreground.b,\n\t\t);\n\t\tconst defaultBg = rgb(\n\t\t\tcolors.background.r,\n\t\t\tcolors.background.g,\n\t\t\tcolors.background.b,\n\t\t);\n\t\tconst alternate = term.isAlternateScreen();\n\n\t\t// RIS first: the client pane may be reused, and a repaint that inherits\n\t\t// stale modes or attributes is worse than no repaint at all.\n\t\tlet out = \"\\x1bc\";\n\n\t\t// Scrollback is written first and scrolled off by the screen paint that\n\t\t// follows, so it lands in the client's scrollback rather than on screen.\n\t\t// It belongs to the primary screen, so it precedes the alt-screen switch.\n\t\tif (mode === \"scrollback\" && !alternate) {\n\t\t\tconst available = Math.min(\n\t\t\t\tterm.getScrollbackLength(),\n\t\t\t\tMAX_SCROLLBACK_LINES,\n\t\t\t);\n\t\t\tfor (let i = available; i > 0; i--) {\n\t\t\t\tconst offset = i - 1;\n\t\t\t\tconst line = term.getScrollbackLine(offset);\n\t\t\t\tif (!line) continue;\n\t\t\t\tout += serializeRow(line, cols, defaultFg, defaultBg, (col) =>\n\t\t\t\t\tterm.getScrollbackGraphemeString(offset, col),\n\t\t\t\t);\n\t\t\t\tout += \"\\r\\n\";\n\t\t\t}\n\t\t}\n\n\t\t// Modes go on before the repaint so the client is already in the right\n\t\t// screen when cells land; 1049 also clears, which would undo the paint.\n\t\tif (alternate) out += \"\\x1b[?1049h\";\n\t\tfor (const decMode of RESTORED_DEC_MODES) {\n\t\t\tout += term.getMode(decMode) ? `\\x1b[?${decMode}h` : `\\x1b[?${decMode}l`;\n\t\t}\n\n\t\t// Rows are painted sequentially from home rather than by absolute\n\t\t// address: each `\\r\\n` scrolls whatever preceded it into scrollback,\n\t\t// which is what carries the dump above off-screen intact.\n\t\tconst viewport = term.getViewport();\n\t\tout += \"\\x1b[H\";\n\t\tfor (let y = 0; y < rows; y++) {\n\t\t\tif (y > 0) out += \"\\r\\n\";\n\t\t\tconst row = viewport.slice(y * cols, (y + 1) * cols);\n\t\t\tout += serializeRow(row, cols, defaultFg, defaultBg, (col) =>\n\t\t\t\tterm.getGraphemeString(y, col),\n\t\t\t);\n\t\t}\n\n\t\tconst cursor = term.getCursor();\n\t\tconst cy = Math.min(Math.max(cursor.viewportY, 0), rows - 1) + 1;\n\t\tconst cx = Math.min(Math.max(cursor.viewportX, 0), cols - 1) + 1;\n\t\tout += `\\x1b[0m\\x1b[${cy};${cx}H`;\n\t\tout += cursor.visible ? \"\\x1b[?25h\" : \"\\x1b[?25l\";\n\n\t\treturn { ...base, mode, data: out };\n\t}\n}\n"],"mappings":";;;;;AAAA,SAAS,SAAS,qBAAqB;AAoBvC,cAAc;;;ACpBd,OAAO,YAAY;AACnB,SAAS,SAAS,YAAY;AAC9B,SAAS,qBAAqB;AAC9B;AAAA,EAEC;AAAA,OAWM;AACP;AAAA,EAKC;AAAA,EACA;AAAA,EAEA;AAAA,OACM;AACP,SAAgC,UAA0B;AAC1D,SAAS,kBAAkB;;;ACpB3B,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAI9B,IAAM,oBAAoB;AAG1B,IAAM,uBAAuB;AAE7B,IAAM,WAAW;AACjB,IAAM,WAAW;AAEjB,IAAM,eAAe;AACrB,IAAM,eAAe;AAqDrB,IAAI;AAEJ,eAAe,cAAsC;AACpD,uCAAoB,YAAY;AAC/B,UAAMA,WAAU,cAAc,YAAY,GAAG;AAC7C,UAAM,EAAE,QAAQ,IAAI,MAAM,OAAO,aAAa;AAC9C,UAAM,QAAQ,MAAM;AAAA,MACnBA,SAAQ,QAAQ,6BAA6B;AAAA,IAC9C;AACA,UAAM,cAAc,QAAQ,IAAI,YAAY,aAAa;AAGzD,QAAI,CAAC,aAAa;AACjB,YAAM,IAAI,MAAM,4CAA4C;AAAA,IAC7D;AACA,UAAM,EAAE,SAAS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AAQ,IAAI,+BAA+B,GAAG;AAC9C,aAAO,IAAI,SAAS,OAAO,KAAK,SAAS,IAAI,GAAG;AAAA,QAC/C,QAAQ,SAAS;AAAA,QACjB,YAAY,SAAS;AAAA,QACrB;AAAA,MACD,CAAC;AAAA,IACF;AAAA,EACD,CAAQ;AAWT;;;ADv5EA,IAAM,wCAAwC,MAAM,OAAO;AAMpD,IAAM,SAA+B,CAC3C,UAEA,cAAc;AAAA,EACb,GAAG;AAAA,EACH,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,EACxB,sBAAsB;AACvB,CAAwC;","names":["require","event","migrations","response"]}
|
|
1
|
+
{"version":3,"sources":["../src/generated/contract.ts"],"sourcesContent":["// Generated by @rivet-dev/agentos-bindgen. Do not edit.\nimport type { BaseActorDefinition, Client, Registry, Type } from \"rivetkit\";\nimport { createClient } from \"rivetkit/client\";\nimport type {\n\tActorAccessor,\n\tActorConnectOptions,\n\tActorConn,\n\tActorHandle,\n\tClientConfigInput,\n\tCreateOptions,\n\tGetOptions,\n\tGetWithIdOptions,\n} from \"rivetkit/client\";\n\nexport const AGENTOS_API_VERSION = \"agentos-sdk.dev/v1alpha1\" as const;\nexport const AGENTOS_CONTRACT_MAJOR = 1 as const;\nexport const AGENTOS_CONTRACT_HASH =\n\t\"sha256:06086c42788602d49d762f2b3003a8fe89a3d136219611cdbbc84d0fc4c267ca\" as const;\nexport const AGENTOS_CAPABILITIES = [\n\t\"config.merge-patch\",\n\t\"network.pull-streaming\",\n\t\"output.replay\",\n\t\"inspector.filesystem\",\n\t\"inspector.processes\",\n\t\"inspector.software\",\n\t\"inspector.terminals\",\n\t\"inspector.vm\",\n\t\"language.javascript\",\n\t\"language.python\",\n\t\"language.typescript\",\n\t\"software.registry\",\n] as const;\nexport const AGENTOS_CONTRACT = {\n\tapiVersion: AGENTOS_API_VERSION,\n\tcontractMajor: AGENTOS_CONTRACT_MAJOR,\n\tcontractHash: AGENTOS_CONTRACT_HASH,\n\tcapabilities: AGENTOS_CAPABILITIES,\n} as const;\n\nexport namespace Input {\n\texport type ActorCodeEvaluationResult = {\n\t\tresult: ActorCodeExecutionResult;\n\t\tvalue?: JsonValue | null;\n\t};\n\texport type ActorCodeExecutionResult = {\n\t\texecution?: ActorExecutionDescriptor | null;\n\t\toutcome: ActorExecutionOutcome;\n\t\texitCode?: number | null;\n\t\terror?: ActorExecutionError | null;\n\t\tstdout?: FileBytes | null;\n\t\tstderr?: FileBytes | null;\n\t\tstdoutTruncated?: boolean | null;\n\t\tstderrTruncated?: boolean | null;\n\t};\n\texport type ActorContextDescriptor = {\n\t\tcontext: ActorContextId;\n\t\tstate: string;\n\t\tlanguage?: string | null;\n\t\tcreatedAtMs: number | bigint;\n\t\tlastStartedAtMs?: number | bigint | null;\n\t\tlastCompletedAtMs?: number | bigint | null;\n\t};\n\texport type ActorContextId = {\n\t\tgeneration: number | bigint;\n\t\tcontextId: string;\n\t};\n\texport type ActorCronJob = {\n\t\tname: string;\n\t\texpression: string;\n\t\ttimezone?: string | null;\n\t\tcommand: string;\n\t\targs: Array<string>;\n\t\toptions: ActorSpawnOptions;\n\t\tconfigRevision: number | bigint;\n\t\tnextRunAtMs: number | bigint;\n\t\tlastRunAtMs?: number | bigint | null;\n\t\tmaxHistory: number | bigint;\n\t};\n\texport type ActorExecOptions = {\n\t\tenv?: { [key in string]?: string };\n\t\tcwd?: string | null;\n\t\tstdin?: FileContentInput | null;\n\t\ttimeoutMs?: number | bigint | null;\n\t\tcaptureStdio?: boolean | null;\n\t};\n\texport type ActorExecResult = {\n\t\tstatus: ActorExitStatus;\n\t\tstdout: string;\n\t\tstderr: string;\n\t};\n\texport type ActorExecutionDescriptor = {\n\t\texecutionId: string;\n\t\tgeneration: number | bigint;\n\t\tstate: string;\n\t\tlanguage?: string | null;\n\t\tprocessId?: string | null;\n\t\tpid?: number | null;\n\t\tcreatedAtMs: number | bigint;\n\t\tlastStartedAtMs?: number | bigint | null;\n\t\tlastCompletedAtMs?: number | bigint | null;\n\t\tlastOutcome?: ActorExecutionOutcome | null;\n\t\tlastExitCode?: number | null;\n\t};\n\texport type ActorExecutionError = {\n\t\tcode: string;\n\t\tname: string;\n\t\tmessage: string;\n\t\tstack?: string | null;\n\t\tdetails?: JsonValue | null;\n\t};\n\texport type ActorExecutionOutcome =\n\t\t| \"succeeded\"\n\t\t| \"failed\"\n\t\t| \"cancelled\"\n\t\t| \"timedOut\";\n\texport type ActorExecutionOutputOptions = {\n\t\tcapture?: ActorOutputCapture | null;\n\t\tretainEvents?: boolean | null;\n\t};\n\texport type ActorExecutionPtyOptions = {\n\t\tcols?: number | null;\n\t\trows?: number | null;\n\t};\n\texport type ActorExitStatus = {\n\t\texitCode: number;\n\t\tsignal?: ActorSignal | null;\n\t};\n\texport type ActorFetchStreamChunk = { body: FileBytes; done: boolean };\n\texport type ActorFetchStreamHead = {\n\t\tstream: ActorFetchStreamId;\n\t\tstatus: number;\n\t\tstatusText: string;\n\t\theaders: Array<[string, string]>;\n\t};\n\texport type ActorFetchStreamId = {\n\t\tgeneration: number | bigint;\n\t\tstreamId: string;\n\t\texpiresAtMs: number | bigint;\n\t};\n\texport type ActorFileStat = {\n\t\tmode: number;\n\t\tsizeBytes: number | bigint;\n\t\tblocks: number | bigint;\n\t\tdev: number | bigint;\n\t\trdev: number | bigint;\n\t\tisDirectory: boolean;\n\t\tisSymbolicLink: boolean;\n\t\tatimeMs: number;\n\t\tmtimeMs: number;\n\t\tctimeMs: number;\n\t\tbirthtimeMs: number;\n\t\tino: number | bigint;\n\t\tnlink: number | bigint;\n\t\tuid: number;\n\t\tgid: number;\n\t};\n\texport type ActorHttpRequest = {\n\t\tport: number;\n\t\tpath: string;\n\t\tmethod?: string;\n\t\theaders?: { [key in string]?: string };\n\t\tbody?: FileContentInput | null;\n\t};\n\texport type ActorHttpResponse = {\n\t\tstatus: number;\n\t\tstatusText: string;\n\t\theaders: Array<[string, string]>;\n\t\tbody: FileBytes;\n\t};\n\texport type ActorInlineExecutionOptions = {\n\t\tprocess?: ActorLanguageExecutionOptions;\n\t\tinputs?: { [key in string]?: JsonValue } | null;\n\t};\n\texport type ActorInstalledSoftware = {\n\t\tpackageId: string;\n\t\tdigest: string;\n\t\tsizeBytes: number | bigint;\n\t\tpackageName: string;\n\t\tversion: string;\n\t\tcommands: Array<string>;\n\t};\n\texport type ActorJavaScriptExecutionOptions = {\n\t\tinline?: ActorInlineExecutionOptions;\n\t\tformat?: ActorJavaScriptModuleFormat | null;\n\t\tfilePath?: string | null;\n\t};\n\texport type ActorJavaScriptModuleFormat = \"module\" | \"commonJs\";\n\texport type ActorLanguageExecutionOptions = {\n\t\tcontext?: ActorContextId | null;\n\t\tcwd?: string | null;\n\t\tenv?: { [key in string]?: string };\n\t\targs?: Array<string>;\n\t\tstdin?: FileContentInput | null;\n\t\ttimeoutMs?: number | bigint | null;\n\t\tpty?: ActorExecutionPtyOptions | null;\n\t\toutput?: ActorExecutionOutputOptions;\n\t};\n\texport type ActorLanguageSpawnOptions = {\n\t\tcwd?: string | null;\n\t\tenv?: { [key in string]?: string };\n\t\targs?: Array<string>;\n\t\tstdin?: FileContentInput | null;\n\t\ttimeoutMs?: number | bigint | null;\n\t\tpty?: ActorExecutionPtyOptions | null;\n\t};\n\texport type ActorNpmInstallOptions = {\n\t\tcontext?: ActorContextId | null;\n\t\tcwd?: string | null;\n\t\tenv?: { [key in string]?: string };\n\t\ttimeoutMs?: number | bigint | null;\n\t\tfrozen?: boolean | null;\n\t\tdev?: boolean | null;\n\t\tglobal?: boolean | null;\n\t\toutput?: ActorExecutionOutputOptions;\n\t};\n\texport type ActorOutputCapture = \"none\" | \"stderr\" | \"all\";\n\texport type ActorOutputEvent = {\n\t\tsequence: number | bigint;\n\t\tstream: ProcessStream;\n\t\tdata: FileBytes;\n\t\ttimestampMs: number | bigint;\n\t};\n\texport type ActorOutputReplay = {\n\t\tgeneration: number | bigint;\n\t\tevents: Array<ActorOutputEvent>;\n\t\tnextCursor?: number | bigint | null;\n\t\thasMore: boolean;\n\t\ttruncated: boolean;\n\t\tend?: ActorExitStatus | null;\n\t};\n\texport type ActorPreview = {\n\t\ttoken: string;\n\t\tpath: string;\n\t\tport: number;\n\t\texpiresAtMs: number | bigint;\n\t};\n\texport type ActorProcessExit = {\n\t\tprocess: ActorProcessId;\n\t\tstatus: ActorExitStatus;\n\t};\n\texport type ActorProcessId = { generation: number | bigint; pid: number };\n\texport type ActorProcessInfo = {\n\t\tprocess: ActorProcessId;\n\t\tcommand: string;\n\t\targs: Array<string>;\n\t\trunning: boolean;\n\t\texit?: ActorExitStatus | null;\n\t\tstartedAtMs: number | bigint;\n\t};\n\texport type ActorProcessTree = {\n\t\tgeneration: number | bigint;\n\t\troots: Array<ActorProcessTreeNode>;\n\t};\n\texport type ActorProcessTreeNode = {\n\t\tprocess?: ActorProcessId | null;\n\t\tpid: number;\n\t\tppid: number;\n\t\tpgid: number;\n\t\tsid: number;\n\t\tdriver: string;\n\t\tcommand: string;\n\t\targs: Array<string>;\n\t\tcwd: string;\n\t\tstatus: ProcessStatus;\n\t\texit?: ActorExitStatus | null;\n\t\tstartTimeMs: number;\n\t\texitTimeMs?: number | null;\n\t\tchildren: Array<ActorProcessTreeNode>;\n\t};\n\texport type ActorPythonInstallOptions = {\n\t\tcontext?: ActorContextId | null;\n\t\tcwd?: string | null;\n\t\tenv?: { [key in string]?: string };\n\t\ttimeoutMs?: number | bigint | null;\n\t\tupgrade?: boolean | null;\n\t\trequirementsFile?: string | null;\n\t\tindexUrl?: string | null;\n\t\textraIndexUrls?: Array<string>;\n\t\toutput?: ActorExecutionOutputOptions;\n\t};\n\texport type ActorSignal = \"SIGTERM\" | \"SIGINT\" | \"SIGKILL\";\n\texport type ActorSpawnOptions = {\n\t\tenv?: { [key in string]?: string };\n\t\tcwd?: string | null;\n\t\tstdio?: SpawnStdio | null;\n\t\t/**\n\t\t * Keep stdin open for `v1.process.stdin.write`. Without it the process reads EOF, as under\n\t\t * `docker exec` without `-i`, so a command that reads stdin cannot wait forever, and\n\t\t * `v1.process.stdin.write` fails with `invalid_input`.\n\t\t */\n\t\topenStdin?: boolean | null;\n\t\tstdinFd?: number | null;\n\t\tstdoutFd?: number | null;\n\t\tstderrFd?: number | null;\n\t};\n\texport type ActorTerminalExit = {\n\t\tterminal: ActorTerminalId;\n\t\tstatus: ActorExitStatus;\n\t};\n\texport type ActorTerminalId = {\n\t\tgeneration: number | bigint;\n\t\tshellId: string;\n\t};\n\texport type ActorTerminalOptions = {\n\t\tcommand?: string | null;\n\t\targs?: Array<string>;\n\t\tenv?: { [key in string]?: string };\n\t\tcwd?: string | null;\n\t\tcols?: number | null;\n\t\trows?: number | null;\n\t};\n\texport type ActorTypeScriptCheckOptions = {\n\t\tcontext?: ActorContextId | null;\n\t\tcwd?: string | null;\n\t\tfilePath?: string | null;\n\t\ttsconfigPath?: string | null;\n\t\tcompilerOptions?: { [key in string]?: JsonValue } | null;\n\t\ttimeoutMs?: number | bigint | null;\n\t\toutput?: ActorExecutionOutputOptions;\n\t};\n\texport type ActorTypeScriptCheckResult = {\n\t\tresult: ActorCodeExecutionResult;\n\t\thasErrors?: boolean | null;\n\t\tdiagnostics: Array<ActorTypeScriptDiagnostic>;\n\t};\n\texport type ActorTypeScriptDiagnostic = {\n\t\tcode: number;\n\t\tcategory: string;\n\t\tmessage: string;\n\t\tfilePath?: string | null;\n\t\tline?: number | null;\n\t\tcolumn?: number | null;\n\t};\n\texport type ActorTypeScriptExecutionOptions = {\n\t\tinline?: ActorInlineExecutionOptions;\n\t\tfilePath?: string | null;\n\t\ttsconfigPath?: string | null;\n\t\tcompilerOptions?: { [key in string]?: JsonValue } | null;\n\t};\n\texport type AgentOsActorConfig = {\n\t\tuser?: VmUserConfig | null;\n\t\tenvironment?: { [key in string]?: string } | null;\n\t\tallowedNodeBuiltins?: Array<string> | null;\n\t\thighResolutionTime?: boolean | null;\n\t\tloopbackExemptPorts: Array<number>;\n\t\tlimits?: AgentOsLimits | null;\n\t\tpermissions?: Permissions | null;\n\t\tfilesystem: HostedFilesystemConfig;\n\t\tdefaultSoftware?: boolean | null;\n\t\tsoftware: Array<RemotePackageSource>;\n\t\tpreview: PreviewPolicy;\n\t};\n\texport type AgentOsActorConfigInput = {\n\t\tuser?: VmUserConfig | null;\n\t\tenvironment?: { [key in string]?: string } | null;\n\t\tallowedNodeBuiltins?: Array<string> | null;\n\t\thighResolutionTime?: boolean | null;\n\t\tloopbackExemptPorts?: Array<number> | null;\n\t\tlimits?: AgentOsLimits | null;\n\t\tpermissions?: Permissions | null;\n\t\tfilesystem?: HostedFilesystemConfigInput | null;\n\t\t/**\n\t\t * Install agentOS default software (coreutils, sed, grep, gawk, findutils,\n\t\t * diffutils, tar, gzip) before `software`. Defaults to true.\n\t\t */\n\t\tdefaultSoftware?: boolean | null;\n\t\t/**\n\t\t * Software installed after the default software, in order. Registry\n\t\t * entries are resolved to an exact URL and digest when the config is\n\t\t * accepted, so the durable config never follows a moving manifest.\n\t\t */\n\t\tsoftware?: Array<SoftwareSourceInput> | null;\n\t\tpreview?: PreviewPolicyInput | null;\n\t};\n\texport type AgentOsActorCreateInput = {\n\t\tconfig?: AgentOsActorConfigInput | null;\n\t};\n\texport type AgentOsLimits = {\n\t\tagentosPackages?: AgentOsPackageLimits;\n\t\tresources?: ResourceLimits | null;\n\t\thttp?: HttpLimits | null;\n\t\ttls?: TlsLimits;\n\t\thostFunctions?: HostFunctionLimits | null;\n\t\tplugins?: PluginLimits | null;\n\t\tsqlite?: SqliteLimits | null;\n\t\tjsRuntime?: JsRuntimeLimits | null;\n\t\tpython?: PythonLimits | null;\n\t\twasm?: WasmLimits | null;\n\t\texecution?: ExecutionLimits;\n\t\tprocess?: ProcessLimits | null;\n\t};\n\texport type AgentOsPackageLimits = { maxMounts?: number | bigint };\n\texport type ConfigApplyState =\n\t\t| \"applying\"\n\t\t| \"ready\"\n\t\t| \"restart_required\"\n\t\t| \"failed\";\n\texport type ConfigGet = Record<string, never>;\n\texport type ConfigPatch = {\n\t\tpatch: JsonValue;\n\t\texpectedRevision?: number | bigint | null;\n\t};\n\texport type ConfigSet = {\n\t\tconfig: AgentOsActorConfigInput;\n\t\texpectedRevision?: number | bigint | null;\n\t};\n\texport type ConfigSnapshot = {\n\t\trevision: number | bigint;\n\t\tdesired: AgentOsActorConfig;\n\t\tappliedRevision?: number | bigint | null;\n\t\tstate: ConfigApplyState;\n\t\tissues: Array<VmIssue>;\n\t\tcreatedAtMs: number | bigint;\n\t\tupdatedAtMs: number | bigint;\n\t};\n\texport type ContextsCreate = { contextId: string };\n\texport type ContextsDelete = { context: ActorContextId };\n\texport type ContextsGet = { context: ActorContextId };\n\texport type ContextsList = Record<string, never>;\n\texport type ContextsReset = { context: ActorContextId };\n\texport type CoreSidecarStatus = { state: string; activeVmCount: number };\n\texport type CronCancel = { name: string };\n\texport type CronFiredEvent = {\n\t\tscheduleName: string;\n\t\tprocess?: ActorProcessId | null;\n\t\terror?: CronLaunchError | null;\n\t\tfiredAtMs: number | bigint;\n\t};\n\texport type CronLaunchError = { code: string; message: string };\n\texport type CronList = Record<string, never>;\n\texport type CronSchedule = {\n\t\tname?: string | null;\n\t\texpression: string;\n\t\ttimezone?: string | null;\n\t\tcommand: string;\n\t\targs?: Array<string>;\n\t\toptions?: ActorSpawnOptions;\n\t\tmaxHistory?: number | bigint | null;\n\t};\n\texport type DirEntryType = \"file\" | \"directory\" | \"symlink\";\n\texport type ExecutionLimits = {\n\t\tcompletedTtlMs?: number | bigint;\n\t\tmaxCompletedExecutions?: number | bigint;\n\t\tliveExecutionWarningThreshold?: number | bigint;\n\t};\n\texport type FileBytes = Uint8Array;\n\texport type FileContentInput = string | Uint8Array;\n\texport type FilesystemEntry = {\n\t\tpath: string;\n\t\ttype: DirEntryType;\n\t\tmode: string;\n\t\tuid: number;\n\t\tgid: number;\n\t\tcontent?: string | null;\n\t\tencoding?: FilesystemEntryEncoding | null;\n\t\ttarget?: string | null;\n\t};\n\texport type FilesystemEntryEncoding = \"utf8\" | \"base64\";\n\texport type FilesystemExists = { path: string };\n\texport type FilesystemExport = { maxBytes?: number | null };\n\texport type FilesystemListMounts = Record<string, never>;\n\texport type FilesystemMkdir = { path: string; recursive?: boolean };\n\texport type FilesystemMove = { from: string; to: string };\n\texport type FilesystemReadFile = { path: string; maxBytes?: number | null };\n\texport type FilesystemReadFiles = {\n\t\tpaths: Array<string>;\n\t\tmaxBytes?: number | null;\n\t};\n\texport type FilesystemReaddir = { path: string };\n\texport type FilesystemReaddirEntries = { path: string };\n\texport type FilesystemReaddirRecursive = {\n\t\tpath: string;\n\t\tmaxDepth?: number | null;\n\t\texclude?: Array<string>;\n\t};\n\texport type FilesystemRemove = { path: string; recursive?: boolean };\n\texport type FilesystemSnapshotEntries = { entries: Array<FilesystemEntry> };\n\texport type FilesystemSnapshotExport = {\n\t\tformat: string;\n\t\tfilesystem: FilesystemSnapshotEntries;\n\t};\n\texport type FilesystemStat = { path: string };\n\texport type FilesystemWriteEntry = {\n\t\tpath: string;\n\t\tcontent: FileContentInput;\n\t};\n\texport type FilesystemWriteFile = { path: string; content: FileContentInput };\n\texport type FilesystemWriteFiles = { entries: Array<FilesystemWriteEntry> };\n\texport type FsPermissionRule = {\n\t\tmode: PermissionMode;\n\t\toperations?: Array<string> | null;\n\t\tpaths?: Array<string> | null;\n\t};\n\texport type FsPermissions =\n\t\t| PermissionMode\n\t\t| RulePermissions<FsPermissionRule>;\n\texport type HostFunctionLimits = {\n\t\tdefaultTimeoutMs?: number | bigint | null;\n\t\tmaxTimeoutMs?: number | bigint | null;\n\t\tmaxRegisteredCollections?: number | bigint | null;\n\t\tmaxRegisteredFunctionsPerVm?: number | bigint | null;\n\t\tmaxFunctionsPerCollection?: number | bigint | null;\n\t\tmaxSchemaBytes?: number | bigint | null;\n\t\tmaxExamplesPerFunction?: number | bigint | null;\n\t\tmaxExampleInputBytes?: number | bigint | null;\n\t};\n\texport type HostedFilesystemBackend = { type: \"durable\"; namespace: string };\n\texport type HostedFilesystemBackendInput = {\n\t\ttype: \"durable\";\n\t\tnamespace?: string | null;\n\t};\n\texport type HostedFilesystemConfig = {\n\t\troot: HostedRootFilesystem;\n\t\tmounts: Array<HostedFilesystemMount>;\n\t};\n\texport type HostedFilesystemConfigInput = {\n\t\troot?: HostedRootFilesystemInput | null;\n\t\tmounts?: Array<HostedFilesystemMountInput>;\n\t};\n\texport type HostedFilesystemMount = {\n\t\tpath: string;\n\t\tbackend: HostedFilesystemBackend;\n\t\treadOnly: boolean;\n\t};\n\texport type HostedFilesystemMountInput = {\n\t\tpath: string;\n\t\tbackend: HostedFilesystemBackendInput;\n\t\treadOnly?: boolean;\n\t};\n\texport type HostedRootFilesystem =\n\t\t| { type: \"default\" }\n\t\t| { type: \"durable\"; namespace: string; readOnly: boolean };\n\texport type HostedRootFilesystemInput =\n\t\t| { type: \"default\" }\n\t\t| { type: \"durable\"; namespace?: string | null; readOnly?: boolean };\n\texport type HttpLimits = { maxFetchResponseBytes?: number | bigint | null };\n\texport type JavaScriptEvaluate = {\n\t\texpression: string;\n\t\toptions?: ActorJavaScriptExecutionOptions;\n\t};\n\texport type JavaScriptExecute = {\n\t\tsource: string;\n\t\toptions?: ActorJavaScriptExecutionOptions;\n\t};\n\texport type JavaScriptExecuteFile = {\n\t\tpath: string;\n\t\toptions?: ActorLanguageExecutionOptions;\n\t};\n\texport type JavaScriptNpmInstall = {\n\t\tpackages?: Array<string>;\n\t\toptions?: ActorNpmInstallOptions;\n\t};\n\texport type JavaScriptNpmRunPackage = {\n\t\tpackageSpec: string;\n\t\tbinary?: string | null;\n\t\toptions?: ActorLanguageExecutionOptions;\n\t};\n\texport type JavaScriptNpmRunScript = {\n\t\tscript: string;\n\t\toptions?: ActorLanguageExecutionOptions;\n\t};\n\texport type JavaScriptSpawn = {\n\t\tsource: string;\n\t\toptions?: ActorLanguageSpawnOptions;\n\t};\n\texport type JavaScriptSpawnFile = {\n\t\tpath: string;\n\t\toptions?: ActorLanguageSpawnOptions;\n\t};\n\texport type JsRuntimeLimits = {\n\t\tv8HeapLimitMb?: number | bigint | null;\n\t\tsyncRpcWaitTimeoutMs?: number | bigint | null;\n\t\tcpuTimeLimitMs?: number | bigint | null;\n\t\twallClockLimitMs?: number | bigint | null;\n\t\timportCacheMaterializeTimeoutMs?: number | bigint | null;\n\t\tcapturedOutputLimitBytes?: number | bigint | null;\n\t\tstdinBufferLimitBytes?: number | bigint | null;\n\t\teventPayloadLimitBytes?: number | bigint | null;\n\t\tv8IpcMaxFrameBytes?: number | bigint | null;\n\t};\n\texport type JsonValue =\n\t\t| number\n\t\t| string\n\t\t| boolean\n\t\t| Array<JsonValue>\n\t\t| { [key in string]?: JsonValue }\n\t\t| null;\n\texport type NetworkFetch = { request: ActorHttpRequest };\n\texport type NetworkFetchStreamCancel = { stream: ActorFetchStreamId };\n\texport type NetworkFetchStreamRead = {\n\t\tstream: ActorFetchStreamId;\n\t\tmaxBytes?: number | null;\n\t};\n\texport type NetworkFetchStreamStart = { request: ActorHttpRequest };\n\texport type NetworkPreviewCreate = {\n\t\tport: number;\n\t\tttlMs?: number | bigint | null;\n\t};\n\texport type NetworkPreviewExpire = { token: string };\n\texport type PackageStartupStatus = {\n\t\trequiredTotal: number;\n\t\trequiredReady: number;\n\t\toptionalPreloadTotal: number;\n\t\toptionalPreloadReady: number;\n\t\toptionalPreloadFailed: number;\n\t\toptionalPreloadSkipped: number;\n\t\toptionalPreloadWarmedBytes: number | bigint;\n\t\toptionalPreloadDeadlineHit: boolean;\n\t\toptionalPreloadCoordinatorAvailable: boolean;\n\t};\n\texport type PatternPermissionRule = {\n\t\tmode: PermissionMode;\n\t\toperations?: Array<string> | null;\n\t\tpatterns?: Array<string> | null;\n\t};\n\texport type PatternPermissions =\n\t\t| PermissionMode\n\t\t| RulePermissions<PatternPermissionRule>;\n\texport type PermissionMode = \"allow\" | \"deny\";\n\texport type Permissions = {\n\t\tfs?: FsPermissions | null;\n\t\tnetwork?: PatternPermissions | null;\n\t\tchildProcess?: PatternPermissions | null;\n\t\tprocess?: PatternPermissions | null;\n\t\tenv?: PatternPermissions | null;\n\t\thostFunction?: PatternPermissions | null;\n\t};\n\texport type PluginLimits = {\n\t\tmaxPersistedManifestBytes?: number | bigint | null;\n\t\tmaxPersistedManifestFileBytes?: number | bigint | null;\n\t};\n\texport type PreviewPolicy = {\n\t\tdefaultTtlMs: number | bigint;\n\t\tmaxTtlMs: number | bigint;\n\t\tmaxActive: number;\n\t};\n\texport type PreviewPolicyInput = {\n\t\tdefaultTtlMs?: number | bigint | null;\n\t\tmaxTtlMs?: number | bigint | null;\n\t\tmaxActive?: number | null;\n\t};\n\texport type ProcessExitEvent = {\n\t\tprocess: ActorProcessId;\n\t\tstatus: ActorExitStatus;\n\t};\n\texport type ProcessGet = { process: ActorProcessId };\n\texport type ProcessLimits = {\n\t\tmaxSpawnFileActions?: number | bigint | null;\n\t\tmaxSpawnFileActionBytes?: number | bigint | null;\n\t\tpendingStdinBytes?: number | bigint | null;\n\t\tpendingEventCount?: number | bigint | null;\n\t\tpendingEventBytes?: number | bigint | null;\n\t};\n\texport type ProcessList = Record<string, never>;\n\texport type ProcessOutputEvent = {\n\t\tprocess: ActorProcessId;\n\t\tsequence: number | bigint;\n\t\tstream: ProcessStream;\n\t\tdata: FileBytes;\n\t\ttimestampMs: number | bigint;\n\t};\n\texport type ProcessOutputRead = {\n\t\tprocess: ActorProcessId;\n\t\tafter?: number | bigint | null;\n\t\tmaxEvents?: number | null;\n\t\tmaxBytes?: number | null;\n\t};\n\texport type ProcessPtyResize = {\n\t\tprocess: ActorProcessId;\n\t\tcols: number;\n\t\trows: number;\n\t};\n\texport type ProcessRun = {\n\t\tcommand: string;\n\t\targs?: Array<string>;\n\t\toptions?: ActorExecOptions;\n\t};\n\texport type ProcessSignal = { process: ActorProcessId; signal: ActorSignal };\n\texport type ProcessSpawn = {\n\t\tcommand: string;\n\t\targs?: Array<string>;\n\t\toptions?: ActorSpawnOptions;\n\t};\n\texport type ProcessStatus = \"running\" | \"exited\";\n\texport type ProcessStdinClose = { process: ActorProcessId };\n\texport type ProcessStdinWrite = {\n\t\tprocess: ActorProcessId;\n\t\tdata: FileContentInput;\n\t};\n\texport type ProcessStream = \"stdout\" | \"stderr\";\n\texport type ProcessTree = Record<string, never>;\n\texport type ProcessWait = { process: ActorProcessId };\n\texport type PythonEvaluate = {\n\t\texpression: string;\n\t\toptions?: ActorInlineExecutionOptions;\n\t};\n\texport type PythonExecute = {\n\t\tsource: string;\n\t\toptions?: ActorInlineExecutionOptions;\n\t};\n\texport type PythonExecuteFile = {\n\t\tpath: string;\n\t\toptions?: ActorLanguageExecutionOptions;\n\t};\n\texport type PythonExecuteModule = {\n\t\tmodule: string;\n\t\toptions?: ActorLanguageExecutionOptions;\n\t};\n\texport type PythonInstall = {\n\t\tpackages?: Array<string>;\n\t\toptions?: ActorPythonInstallOptions;\n\t};\n\texport type PythonLimits = {\n\t\toutputBufferMaxBytes?: number | bigint | null;\n\t\texecutionTimeoutMs?: number | bigint | null;\n\t\tmaxOldSpaceMb?: number | bigint | null;\n\t\tvfsRpcTimeoutMs?: number | bigint | null;\n\t};\n\texport type PythonSpawn = {\n\t\tsource: string;\n\t\toptions?: ActorLanguageSpawnOptions;\n\t};\n\texport type PythonSpawnFile = {\n\t\tpath: string;\n\t\toptions?: ActorLanguageSpawnOptions;\n\t};\n\texport type PythonSpawnModule = {\n\t\tmodule: string;\n\t\toptions?: ActorLanguageSpawnOptions;\n\t};\n\texport type RegistrySoftwareSourceInput = {\n\t\t/**\n\t\t * Registry package name, such as `git` or `ripgrep`.\n\t\t */\n\t\tregistry: string;\n\t\t/**\n\t\t * agentOS release whose manifest lists the package, such as `0.4.3` or\n\t\t * `latest`. Defaults to the agentOS release the actor is built with.\n\t\t */\n\t\tversion?: string | null;\n\t};\n\texport type RemotePackageSource = {\n\t\turl: string;\n\t\tdigest?: string | null;\n\t\tsizeBytes?: number | bigint | null;\n\t\tpackageId?: string | null;\n\t};\n\texport type RemotePackageSourceInput = {\n\t\turl: string;\n\t\tdigest?: string | null;\n\t\t/**\n\t\t * Resolution metadata is accepted so a `v1.config.get` snapshot can be sent\n\t\t * back to `v1.config.set`. Core re-resolves the source and never trusts it.\n\t\t */\n\t\tsizeBytes?: number | bigint | null;\n\t\tpackageId?: string | null;\n\t};\n\texport type ResourceLimits = {\n\t\tcpuCount?: number | bigint | null;\n\t\tmaxProcesses?: number | bigint | null;\n\t\tmaxOpenFds?: number | bigint | null;\n\t\tmaxPipes?: number | bigint | null;\n\t\tmaxPtys?: number | bigint | null;\n\t\tmaxSockets?: number | bigint | null;\n\t\tmaxConnections?: number | bigint | null;\n\t\tmaxSocketBufferedBytes?: number | bigint | null;\n\t\tmaxSocketDatagramQueueLen?: number | bigint | null;\n\t\tmaxFilesystemBytes?: number | bigint | null;\n\t\tmaxInodeCount?: number | bigint | null;\n\t\tmaxBlockingReadMs?: number | bigint | null;\n\t\tmaxPreadBytes?: number | bigint | null;\n\t\tmaxFdWriteBytes?: number | bigint | null;\n\t\tmaxProcessArgvBytes?: number | bigint | null;\n\t\tmaxProcessEnvBytes?: number | bigint | null;\n\t\tmaxReaddirEntries?: number | bigint | null;\n\t\tmaxWasmFuel?: number | bigint | null;\n\t\tmaxWasmMemoryBytes?: number | bigint | null;\n\t\tmaxWasmStackBytes?: number | bigint | null;\n\t};\n\texport type RootSnapshotExport = {\n\t\tkind: SnapshotExportKind;\n\t\tsource: FilesystemSnapshotExport;\n\t};\n\texport type RulePermissions<T> = {\n\t\tdefault?: PermissionMode | null;\n\t\trules: Array<T>;\n\t};\n\texport type SnapshotExportKind = \"snapshot-export\";\n\texport type SoftwareInstall = {\n\t\t/**\n\t\t * A `{ url, digest? }` artifact or a `{ registry, version? }` package. The\n\t\t * result's `source` is the resolved, digest-pinned URL that is persisted.\n\t\t */\n\t\tsource: SoftwareSourceInput;\n\t\texpectedRevision?: number | bigint | null;\n\t};\n\texport type SoftwareList = Record<string, never>;\n\texport type SoftwareMutationResult = {\n\t\tsoftware?: ActorInstalledSoftware | null;\n\t\tsource: RemotePackageSource;\n\t\tconfig: ConfigSnapshot;\n\t};\n\texport type SoftwareSourceInput =\n\t\t| RegistrySoftwareSourceInput\n\t\t| RemotePackageSourceInput;\n\texport type SoftwareUninstall = {\n\t\tpackageId: string;\n\t\texpectedRevision?: number | bigint | null;\n\t};\n\texport type SpawnStdio = \"pipe\" | \"inherit\";\n\texport type SqliteLimits = { maxResultBytes?: number | bigint | null };\n\texport type TerminalClose = { terminal: ActorTerminalId };\n\texport type TerminalExitEvent = {\n\t\tterminal: ActorTerminalId;\n\t\tstatus: ActorExitStatus;\n\t};\n\texport type TerminalList = Record<string, never>;\n\texport type TerminalOpen = { options?: ActorTerminalOptions };\n\texport type TerminalOutputEvent = {\n\t\tterminal: ActorTerminalId;\n\t\tsequence: number | bigint;\n\t\tstream: ProcessStream;\n\t\tdata: FileBytes;\n\t\ttimestampMs: number | bigint;\n\t};\n\texport type TerminalOutputRead = {\n\t\tterminal: ActorTerminalId;\n\t\tafter?: number | bigint | null;\n\t\tmaxBytes?: number | null;\n\t\tmaxEvents?: number | null;\n\t};\n\texport type TerminalPtyResize = {\n\t\tterminal: ActorTerminalId;\n\t\tcols: number;\n\t\trows: number;\n\t};\n\texport type TerminalStdinWrite = {\n\t\tterminal: ActorTerminalId;\n\t\tdata: FileContentInput;\n\t};\n\texport type TerminalWait = { terminal: ActorTerminalId };\n\texport type TlsLimits = { maxBufferedBytes?: number | bigint };\n\texport type TypeScriptCheck = {\n\t\tsource: string;\n\t\toptions?: ActorTypeScriptCheckOptions;\n\t};\n\texport type TypeScriptCheckProject = {\n\t\toptions?: ActorTypeScriptCheckOptions;\n\t};\n\texport type TypeScriptEvaluate = {\n\t\texpression: string;\n\t\toptions?: ActorTypeScriptExecutionOptions;\n\t};\n\texport type TypeScriptExecute = {\n\t\tsource: string;\n\t\toptions?: ActorTypeScriptExecutionOptions;\n\t};\n\texport type TypeScriptExecuteFile = {\n\t\tpath: string;\n\t\toptions?: ActorTypeScriptExecutionOptions;\n\t};\n\texport type TypeScriptSpawn = {\n\t\tsource: string;\n\t\toptions?: ActorLanguageSpawnOptions;\n\t};\n\texport type TypeScriptSpawnFile = {\n\t\tpath: string;\n\t\toptions?: ActorLanguageSpawnOptions;\n\t};\n\texport type VmBooted = {\n\t\tgeneration: number | bigint;\n\t\tconfigRevision: number | bigint;\n\t\tbootedAtMs: number | bigint;\n\t};\n\texport type VmGroupConfig = {\n\t\tgid: number;\n\t\tname: string;\n\t\tmembers: Array<string>;\n\t};\n\texport type VmIssue = {\n\t\tcode: string;\n\t\tmessage: string;\n\t\tatMs: number | bigint;\n\t};\n\texport type VmLifecycleState =\n\t\t| \"initializing\"\n\t\t| \"preloading\"\n\t\t| \"booting\"\n\t\t| \"ready\"\n\t\t| \"degraded\"\n\t\t| \"stopping\"\n\t\t| \"failed\";\n\texport type VmLimitWarning = {\n\t\tlimit: string;\n\t\tobserved: number | bigint;\n\t\tcapacity: number | bigint;\n\t\tmessage: string;\n\t};\n\texport type VmRestart = Record<string, never>;\n\texport type VmShutdown = {\n\t\tgeneration: number | bigint;\n\t\treason: string;\n\t\tshutdownAtMs: number | bigint;\n\t};\n\texport type VmStatus = Record<string, never>;\n\texport type VmStatusSnapshot = {\n\t\tlifecycle: VmLifecycleState;\n\t\tconfigState: ConfigApplyState;\n\t\tdesiredConfigRevision: number | bigint;\n\t\tappliedConfigRevision?: number | bigint | null;\n\t\tgeneration: number | bigint;\n\t\tlastBootAtMs?: number | bigint | null;\n\t\tlastShutdownAtMs?: number | bigint | null;\n\t\tpackages: PackageStartupStatus;\n\t\tissues: Array<VmIssue>;\n\t\tcore?: CoreSidecarStatus | null;\n\t};\n\texport type VmUserAccountConfig = {\n\t\tuid: number;\n\t\tgid: number;\n\t\tusername: string;\n\t\thomedir: string;\n\t\tshell: string;\n\t\tgecos?: string;\n\t\tsupplementaryGids: Array<number>;\n\t};\n\texport type VmUserConfig = {\n\t\tuid?: number;\n\t\tgid?: number;\n\t\teuid?: number;\n\t\tegid?: number;\n\t\tusername?: string;\n\t\thomedir?: string;\n\t\tshell?: string;\n\t\tgecos?: string;\n\t\tgroupName?: string;\n\t\tsupplementaryGids?: Array<number>;\n\t\taccounts?: Array<VmUserAccountConfig>;\n\t\tgroups?: Array<VmGroupConfig>;\n\t};\n\texport type WasmLimits = {\n\t\tmaxModuleFileBytes?: number | bigint | null;\n\t\tcapturedOutputLimitBytes?: number | bigint | null;\n\t\tsyncReadLimitBytes?: number | bigint | null;\n\t\tprewarmTimeoutMs?: number | bigint | null;\n\t\trunnerHeapLimitMb?: number | bigint | null;\n\t\trunnerCpuTimeLimitMs?: number | bigint | null;\n\t};\n}\n\nexport namespace Output {\n\texport type ActorCodeEvaluationResult = {\n\t\tresult: ActorCodeExecutionResult;\n\t\tvalue?: JsonValue | null;\n\t};\n\texport type ActorCodeExecutionResult = {\n\t\texecution?: ActorExecutionDescriptor | null;\n\t\toutcome: ActorExecutionOutcome;\n\t\texitCode?: number | null;\n\t\terror?: ActorExecutionError | null;\n\t\tstdout?: FileBytes | null;\n\t\tstderr?: FileBytes | null;\n\t\tstdoutTruncated?: boolean | null;\n\t\tstderrTruncated?: boolean | null;\n\t};\n\texport type ActorContextDescriptor = {\n\t\tcontext: ActorContextId;\n\t\tstate: string;\n\t\tlanguage?: string | null;\n\t\tcreatedAtMs: number | bigint;\n\t\tlastStartedAtMs?: number | bigint | null;\n\t\tlastCompletedAtMs?: number | bigint | null;\n\t};\n\texport type ActorContextId = {\n\t\tgeneration: number | bigint;\n\t\tcontextId: string;\n\t};\n\texport type ActorCronJob = {\n\t\tname: string;\n\t\texpression: string;\n\t\ttimezone?: string | null;\n\t\tcommand: string;\n\t\targs: Array<string>;\n\t\toptions: ActorSpawnOptions;\n\t\tconfigRevision: number | bigint;\n\t\tnextRunAtMs: number | bigint;\n\t\tlastRunAtMs?: number | bigint | null;\n\t\tmaxHistory: number | bigint;\n\t};\n\texport type ActorExecOptions = {\n\t\tenv?: { [key in string]?: string };\n\t\tcwd?: string | null;\n\t\tstdin?: FileContentInput | null;\n\t\ttimeoutMs?: number | bigint | null;\n\t\tcaptureStdio?: boolean | null;\n\t};\n\texport type ActorExecResult = {\n\t\tstatus: ActorExitStatus;\n\t\tstdout: string;\n\t\tstderr: string;\n\t};\n\texport type ActorExecutionDescriptor = {\n\t\texecutionId: string;\n\t\tgeneration: number | bigint;\n\t\tstate: string;\n\t\tlanguage?: string | null;\n\t\tprocessId?: string | null;\n\t\tpid?: number | null;\n\t\tcreatedAtMs: number | bigint;\n\t\tlastStartedAtMs?: number | bigint | null;\n\t\tlastCompletedAtMs?: number | bigint | null;\n\t\tlastOutcome?: ActorExecutionOutcome | null;\n\t\tlastExitCode?: number | null;\n\t};\n\texport type ActorExecutionError = {\n\t\tcode: string;\n\t\tname: string;\n\t\tmessage: string;\n\t\tstack?: string | null;\n\t\tdetails?: JsonValue | null;\n\t};\n\texport type ActorExecutionOutcome =\n\t\t| \"succeeded\"\n\t\t| \"failed\"\n\t\t| \"cancelled\"\n\t\t| \"timedOut\";\n\texport type ActorExecutionOutputOptions = {\n\t\tcapture?: ActorOutputCapture | null;\n\t\tretainEvents?: boolean | null;\n\t};\n\texport type ActorExecutionPtyOptions = {\n\t\tcols?: number | null;\n\t\trows?: number | null;\n\t};\n\texport type ActorExitStatus = {\n\t\texitCode: number;\n\t\tsignal?: ActorSignal | null;\n\t};\n\texport type ActorFetchStreamChunk = { body: FileBytes; done: boolean };\n\texport type ActorFetchStreamHead = {\n\t\tstream: ActorFetchStreamId;\n\t\tstatus: number;\n\t\tstatusText: string;\n\t\theaders: Array<[string, string]>;\n\t};\n\texport type ActorFetchStreamId = {\n\t\tgeneration: number | bigint;\n\t\tstreamId: string;\n\t\texpiresAtMs: number | bigint;\n\t};\n\texport type ActorFileStat = {\n\t\tmode: number;\n\t\tsizeBytes: number | bigint;\n\t\tblocks: number | bigint;\n\t\tdev: number | bigint;\n\t\trdev: number | bigint;\n\t\tisDirectory: boolean;\n\t\tisSymbolicLink: boolean;\n\t\tatimeMs: number;\n\t\tmtimeMs: number;\n\t\tctimeMs: number;\n\t\tbirthtimeMs: number;\n\t\tino: number | bigint;\n\t\tnlink: number | bigint;\n\t\tuid: number;\n\t\tgid: number;\n\t};\n\texport type ActorHttpRequest = {\n\t\tport: number;\n\t\tpath: string;\n\t\tmethod?: string;\n\t\theaders?: { [key in string]?: string };\n\t\tbody?: FileContentInput | null;\n\t};\n\texport type ActorHttpResponse = {\n\t\tstatus: number;\n\t\tstatusText: string;\n\t\theaders: Array<[string, string]>;\n\t\tbody: FileBytes;\n\t};\n\texport type ActorInlineExecutionOptions = {\n\t\tprocess?: ActorLanguageExecutionOptions;\n\t\tinputs?: { [key in string]?: JsonValue } | null;\n\t};\n\texport type ActorInstalledSoftware = {\n\t\tpackageId: string;\n\t\tdigest: string;\n\t\tsizeBytes: number | bigint;\n\t\tpackageName: string;\n\t\tversion: string;\n\t\tcommands: Array<string>;\n\t};\n\texport type ActorJavaScriptExecutionOptions = {\n\t\tinline?: ActorInlineExecutionOptions;\n\t\tformat?: ActorJavaScriptModuleFormat | null;\n\t\tfilePath?: string | null;\n\t};\n\texport type ActorJavaScriptModuleFormat = \"module\" | \"commonJs\";\n\texport type ActorLanguageExecutionOptions = {\n\t\tcontext?: ActorContextId | null;\n\t\tcwd?: string | null;\n\t\tenv?: { [key in string]?: string };\n\t\targs?: Array<string>;\n\t\tstdin?: FileContentInput | null;\n\t\ttimeoutMs?: number | bigint | null;\n\t\tpty?: ActorExecutionPtyOptions | null;\n\t\toutput?: ActorExecutionOutputOptions;\n\t};\n\texport type ActorLanguageSpawnOptions = {\n\t\tcwd?: string | null;\n\t\tenv?: { [key in string]?: string };\n\t\targs?: Array<string>;\n\t\tstdin?: FileContentInput | null;\n\t\ttimeoutMs?: number | bigint | null;\n\t\tpty?: ActorExecutionPtyOptions | null;\n\t};\n\texport type ActorNpmInstallOptions = {\n\t\tcontext?: ActorContextId | null;\n\t\tcwd?: string | null;\n\t\tenv?: { [key in string]?: string };\n\t\ttimeoutMs?: number | bigint | null;\n\t\tfrozen?: boolean | null;\n\t\tdev?: boolean | null;\n\t\tglobal?: boolean | null;\n\t\toutput?: ActorExecutionOutputOptions;\n\t};\n\texport type ActorOutputCapture = \"none\" | \"stderr\" | \"all\";\n\texport type ActorOutputEvent = {\n\t\tsequence: number | bigint;\n\t\tstream: ProcessStream;\n\t\tdata: FileBytes;\n\t\ttimestampMs: number | bigint;\n\t};\n\texport type ActorOutputReplay = {\n\t\tgeneration: number | bigint;\n\t\tevents: Array<ActorOutputEvent>;\n\t\tnextCursor?: number | bigint | null;\n\t\thasMore: boolean;\n\t\ttruncated: boolean;\n\t\tend?: ActorExitStatus | null;\n\t};\n\texport type ActorPreview = {\n\t\ttoken: string;\n\t\tpath: string;\n\t\tport: number;\n\t\texpiresAtMs: number | bigint;\n\t};\n\texport type ActorProcessExit = {\n\t\tprocess: ActorProcessId;\n\t\tstatus: ActorExitStatus;\n\t};\n\texport type ActorProcessId = { generation: number | bigint; pid: number };\n\texport type ActorProcessInfo = {\n\t\tprocess: ActorProcessId;\n\t\tcommand: string;\n\t\targs: Array<string>;\n\t\trunning: boolean;\n\t\texit?: ActorExitStatus | null;\n\t\tstartedAtMs: number | bigint;\n\t};\n\texport type ActorProcessTree = {\n\t\tgeneration: number | bigint;\n\t\troots: Array<ActorProcessTreeNode>;\n\t};\n\texport type ActorProcessTreeNode = {\n\t\tprocess?: ActorProcessId | null;\n\t\tpid: number;\n\t\tppid: number;\n\t\tpgid: number;\n\t\tsid: number;\n\t\tdriver: string;\n\t\tcommand: string;\n\t\targs: Array<string>;\n\t\tcwd: string;\n\t\tstatus: ProcessStatus;\n\t\texit?: ActorExitStatus | null;\n\t\tstartTimeMs: number;\n\t\texitTimeMs?: number | null;\n\t\tchildren: Array<ActorProcessTreeNode>;\n\t};\n\texport type ActorPythonInstallOptions = {\n\t\tcontext?: ActorContextId | null;\n\t\tcwd?: string | null;\n\t\tenv?: { [key in string]?: string };\n\t\ttimeoutMs?: number | bigint | null;\n\t\tupgrade?: boolean | null;\n\t\trequirementsFile?: string | null;\n\t\tindexUrl?: string | null;\n\t\textraIndexUrls?: Array<string>;\n\t\toutput?: ActorExecutionOutputOptions;\n\t};\n\texport type ActorSignal = \"SIGTERM\" | \"SIGINT\" | \"SIGKILL\";\n\texport type ActorSpawnOptions = {\n\t\tenv?: { [key in string]?: string };\n\t\tcwd?: string | null;\n\t\tstdio?: SpawnStdio | null;\n\t\t/**\n\t\t * Keep stdin open for `v1.process.stdin.write`. Without it the process reads EOF, as under\n\t\t * `docker exec` without `-i`, so a command that reads stdin cannot wait forever, and\n\t\t * `v1.process.stdin.write` fails with `invalid_input`.\n\t\t */\n\t\topenStdin?: boolean | null;\n\t\tstdinFd?: number | null;\n\t\tstdoutFd?: number | null;\n\t\tstderrFd?: number | null;\n\t};\n\texport type ActorTerminalExit = {\n\t\tterminal: ActorTerminalId;\n\t\tstatus: ActorExitStatus;\n\t};\n\texport type ActorTerminalId = {\n\t\tgeneration: number | bigint;\n\t\tshellId: string;\n\t};\n\texport type ActorTerminalOptions = {\n\t\tcommand?: string | null;\n\t\targs?: Array<string>;\n\t\tenv?: { [key in string]?: string };\n\t\tcwd?: string | null;\n\t\tcols?: number | null;\n\t\trows?: number | null;\n\t};\n\texport type ActorTypeScriptCheckOptions = {\n\t\tcontext?: ActorContextId | null;\n\t\tcwd?: string | null;\n\t\tfilePath?: string | null;\n\t\ttsconfigPath?: string | null;\n\t\tcompilerOptions?: { [key in string]?: JsonValue } | null;\n\t\ttimeoutMs?: number | bigint | null;\n\t\toutput?: ActorExecutionOutputOptions;\n\t};\n\texport type ActorTypeScriptCheckResult = {\n\t\tresult: ActorCodeExecutionResult;\n\t\thasErrors?: boolean | null;\n\t\tdiagnostics: Array<ActorTypeScriptDiagnostic>;\n\t};\n\texport type ActorTypeScriptDiagnostic = {\n\t\tcode: number;\n\t\tcategory: string;\n\t\tmessage: string;\n\t\tfilePath?: string | null;\n\t\tline?: number | null;\n\t\tcolumn?: number | null;\n\t};\n\texport type ActorTypeScriptExecutionOptions = {\n\t\tinline?: ActorInlineExecutionOptions;\n\t\tfilePath?: string | null;\n\t\ttsconfigPath?: string | null;\n\t\tcompilerOptions?: { [key in string]?: JsonValue } | null;\n\t};\n\texport type AgentOsActorConfig = {\n\t\tuser?: VmUserConfig | null;\n\t\tenvironment?: { [key in string]?: string } | null;\n\t\tallowedNodeBuiltins?: Array<string> | null;\n\t\thighResolutionTime?: boolean | null;\n\t\tloopbackExemptPorts: Array<number>;\n\t\tlimits?: AgentOsLimits | null;\n\t\tpermissions?: Permissions | null;\n\t\tfilesystem: HostedFilesystemConfig;\n\t\tdefaultSoftware?: boolean | null;\n\t\tsoftware: Array<RemotePackageSource>;\n\t\tpreview: PreviewPolicy;\n\t};\n\texport type AgentOsActorConfigInput = {\n\t\tuser?: VmUserConfig | null;\n\t\tenvironment?: { [key in string]?: string } | null;\n\t\tallowedNodeBuiltins?: Array<string> | null;\n\t\thighResolutionTime?: boolean | null;\n\t\tloopbackExemptPorts?: Array<number> | null;\n\t\tlimits?: AgentOsLimits | null;\n\t\tpermissions?: Permissions | null;\n\t\tfilesystem?: HostedFilesystemConfigInput | null;\n\t\t/**\n\t\t * Install agentOS default software (coreutils, sed, grep, gawk, findutils,\n\t\t * diffutils, tar, gzip) before `software`. Defaults to true.\n\t\t */\n\t\tdefaultSoftware?: boolean | null;\n\t\t/**\n\t\t * Software installed after the default software, in order. Registry\n\t\t * entries are resolved to an exact URL and digest when the config is\n\t\t * accepted, so the durable config never follows a moving manifest.\n\t\t */\n\t\tsoftware?: Array<SoftwareSourceInput> | null;\n\t\tpreview?: PreviewPolicyInput | null;\n\t};\n\texport type AgentOsActorCreateInput = {\n\t\tconfig?: AgentOsActorConfigInput | null;\n\t};\n\texport type AgentOsLimits = {\n\t\tagentosPackages?: AgentOsPackageLimits;\n\t\tresources?: ResourceLimits | null;\n\t\thttp?: HttpLimits | null;\n\t\ttls?: TlsLimits;\n\t\thostFunctions?: HostFunctionLimits | null;\n\t\tplugins?: PluginLimits | null;\n\t\tsqlite?: SqliteLimits | null;\n\t\tjsRuntime?: JsRuntimeLimits | null;\n\t\tpython?: PythonLimits | null;\n\t\twasm?: WasmLimits | null;\n\t\texecution?: ExecutionLimits;\n\t\tprocess?: ProcessLimits | null;\n\t};\n\texport type AgentOsPackageLimits = { maxMounts?: number | bigint };\n\texport type ConfigApplyState =\n\t\t| \"applying\"\n\t\t| \"ready\"\n\t\t| \"restart_required\"\n\t\t| \"failed\";\n\texport type ConfigGet = Record<string, never>;\n\texport type ConfigPatch = {\n\t\tpatch: JsonValue;\n\t\texpectedRevision?: number | bigint | null;\n\t};\n\texport type ConfigSet = {\n\t\tconfig: AgentOsActorConfigInput;\n\t\texpectedRevision?: number | bigint | null;\n\t};\n\texport type ConfigSnapshot = {\n\t\trevision: number | bigint;\n\t\tdesired: AgentOsActorConfig;\n\t\tappliedRevision?: number | bigint | null;\n\t\tstate: ConfigApplyState;\n\t\tissues: Array<VmIssue>;\n\t\tcreatedAtMs: number | bigint;\n\t\tupdatedAtMs: number | bigint;\n\t};\n\texport type ContextsCreate = { contextId: string };\n\texport type ContextsDelete = { context: ActorContextId };\n\texport type ContextsGet = { context: ActorContextId };\n\texport type ContextsList = Record<string, never>;\n\texport type ContextsReset = { context: ActorContextId };\n\texport type CoreSidecarStatus = { state: string; activeVmCount: number };\n\texport type CronCancel = { name: string };\n\texport type CronFiredEvent = {\n\t\tscheduleName: string;\n\t\tprocess?: ActorProcessId | null;\n\t\terror?: CronLaunchError | null;\n\t\tfiredAtMs: number | bigint;\n\t};\n\texport type CronLaunchError = { code: string; message: string };\n\texport type CronList = Record<string, never>;\n\texport type CronSchedule = {\n\t\tname?: string | null;\n\t\texpression: string;\n\t\ttimezone?: string | null;\n\t\tcommand: string;\n\t\targs?: Array<string>;\n\t\toptions?: ActorSpawnOptions;\n\t\tmaxHistory?: number | bigint | null;\n\t};\n\texport type DirEntryType = \"file\" | \"directory\" | \"symlink\";\n\texport type ExecutionLimits = {\n\t\tcompletedTtlMs?: number | bigint;\n\t\tmaxCompletedExecutions?: number | bigint;\n\t\tliveExecutionWarningThreshold?: number | bigint;\n\t};\n\texport type FileBytes = Uint8Array;\n\texport type FileContentInput = string | Uint8Array;\n\texport type FilesystemEntry = {\n\t\tpath: string;\n\t\ttype: DirEntryType;\n\t\tmode: string;\n\t\tuid: number;\n\t\tgid: number;\n\t\tcontent?: string | null;\n\t\tencoding?: FilesystemEntryEncoding | null;\n\t\ttarget?: string | null;\n\t};\n\texport type FilesystemEntryEncoding = \"utf8\" | \"base64\";\n\texport type FilesystemExists = { path: string };\n\texport type FilesystemExport = { maxBytes?: number | null };\n\texport type FilesystemListMounts = Record<string, never>;\n\texport type FilesystemMkdir = { path: string; recursive?: boolean };\n\texport type FilesystemMove = { from: string; to: string };\n\texport type FilesystemReadFile = { path: string; maxBytes?: number | null };\n\texport type FilesystemReadFiles = {\n\t\tpaths: Array<string>;\n\t\tmaxBytes?: number | null;\n\t};\n\texport type FilesystemReaddir = { path: string };\n\texport type FilesystemReaddirEntries = { path: string };\n\texport type FilesystemReaddirRecursive = {\n\t\tpath: string;\n\t\tmaxDepth?: number | null;\n\t\texclude?: Array<string>;\n\t};\n\texport type FilesystemRemove = { path: string; recursive?: boolean };\n\texport type FilesystemSnapshotEntries = { entries: Array<FilesystemEntry> };\n\texport type FilesystemSnapshotExport = {\n\t\tformat: string;\n\t\tfilesystem: FilesystemSnapshotEntries;\n\t};\n\texport type FilesystemStat = { path: string };\n\texport type FilesystemWriteEntry = {\n\t\tpath: string;\n\t\tcontent: FileContentInput;\n\t};\n\texport type FilesystemWriteFile = { path: string; content: FileContentInput };\n\texport type FilesystemWriteFiles = { entries: Array<FilesystemWriteEntry> };\n\texport type FsPermissionRule = {\n\t\tmode: PermissionMode;\n\t\toperations?: Array<string> | null;\n\t\tpaths?: Array<string> | null;\n\t};\n\texport type FsPermissions =\n\t\t| PermissionMode\n\t\t| RulePermissions<FsPermissionRule>;\n\texport type HostFunctionLimits = {\n\t\tdefaultTimeoutMs?: number | bigint | null;\n\t\tmaxTimeoutMs?: number | bigint | null;\n\t\tmaxRegisteredCollections?: number | bigint | null;\n\t\tmaxRegisteredFunctionsPerVm?: number | bigint | null;\n\t\tmaxFunctionsPerCollection?: number | bigint | null;\n\t\tmaxSchemaBytes?: number | bigint | null;\n\t\tmaxExamplesPerFunction?: number | bigint | null;\n\t\tmaxExampleInputBytes?: number | bigint | null;\n\t};\n\texport type HostedFilesystemBackend = { type: \"durable\"; namespace: string };\n\texport type HostedFilesystemBackendInput = {\n\t\ttype: \"durable\";\n\t\tnamespace?: string | null;\n\t};\n\texport type HostedFilesystemConfig = {\n\t\troot: HostedRootFilesystem;\n\t\tmounts: Array<HostedFilesystemMount>;\n\t};\n\texport type HostedFilesystemConfigInput = {\n\t\troot?: HostedRootFilesystemInput | null;\n\t\tmounts?: Array<HostedFilesystemMountInput>;\n\t};\n\texport type HostedFilesystemMount = {\n\t\tpath: string;\n\t\tbackend: HostedFilesystemBackend;\n\t\treadOnly: boolean;\n\t};\n\texport type HostedFilesystemMountInput = {\n\t\tpath: string;\n\t\tbackend: HostedFilesystemBackendInput;\n\t\treadOnly?: boolean;\n\t};\n\texport type HostedRootFilesystem =\n\t\t| { type: \"default\" }\n\t\t| { type: \"durable\"; namespace: string; readOnly: boolean };\n\texport type HostedRootFilesystemInput =\n\t\t| { type: \"default\" }\n\t\t| { type: \"durable\"; namespace?: string | null; readOnly?: boolean };\n\texport type HttpLimits = { maxFetchResponseBytes?: number | bigint | null };\n\texport type JavaScriptEvaluate = {\n\t\texpression: string;\n\t\toptions?: ActorJavaScriptExecutionOptions;\n\t};\n\texport type JavaScriptExecute = {\n\t\tsource: string;\n\t\toptions?: ActorJavaScriptExecutionOptions;\n\t};\n\texport type JavaScriptExecuteFile = {\n\t\tpath: string;\n\t\toptions?: ActorLanguageExecutionOptions;\n\t};\n\texport type JavaScriptNpmInstall = {\n\t\tpackages?: Array<string>;\n\t\toptions?: ActorNpmInstallOptions;\n\t};\n\texport type JavaScriptNpmRunPackage = {\n\t\tpackageSpec: string;\n\t\tbinary?: string | null;\n\t\toptions?: ActorLanguageExecutionOptions;\n\t};\n\texport type JavaScriptNpmRunScript = {\n\t\tscript: string;\n\t\toptions?: ActorLanguageExecutionOptions;\n\t};\n\texport type JavaScriptSpawn = {\n\t\tsource: string;\n\t\toptions?: ActorLanguageSpawnOptions;\n\t};\n\texport type JavaScriptSpawnFile = {\n\t\tpath: string;\n\t\toptions?: ActorLanguageSpawnOptions;\n\t};\n\texport type JsRuntimeLimits = {\n\t\tv8HeapLimitMb?: number | bigint | null;\n\t\tsyncRpcWaitTimeoutMs?: number | bigint | null;\n\t\tcpuTimeLimitMs?: number | bigint | null;\n\t\twallClockLimitMs?: number | bigint | null;\n\t\timportCacheMaterializeTimeoutMs?: number | bigint | null;\n\t\tcapturedOutputLimitBytes?: number | bigint | null;\n\t\tstdinBufferLimitBytes?: number | bigint | null;\n\t\teventPayloadLimitBytes?: number | bigint | null;\n\t\tv8IpcMaxFrameBytes?: number | bigint | null;\n\t};\n\texport type JsonValue =\n\t\t| number\n\t\t| string\n\t\t| boolean\n\t\t| Array<JsonValue>\n\t\t| { [key in string]?: JsonValue }\n\t\t| null;\n\texport type NetworkFetch = { request: ActorHttpRequest };\n\texport type NetworkFetchStreamCancel = { stream: ActorFetchStreamId };\n\texport type NetworkFetchStreamRead = {\n\t\tstream: ActorFetchStreamId;\n\t\tmaxBytes?: number | null;\n\t};\n\texport type NetworkFetchStreamStart = { request: ActorHttpRequest };\n\texport type NetworkPreviewCreate = {\n\t\tport: number;\n\t\tttlMs?: number | bigint | null;\n\t};\n\texport type NetworkPreviewExpire = { token: string };\n\texport type PackageStartupStatus = {\n\t\trequiredTotal: number;\n\t\trequiredReady: number;\n\t\toptionalPreloadTotal: number;\n\t\toptionalPreloadReady: number;\n\t\toptionalPreloadFailed: number;\n\t\toptionalPreloadSkipped: number;\n\t\toptionalPreloadWarmedBytes: number | bigint;\n\t\toptionalPreloadDeadlineHit: boolean;\n\t\toptionalPreloadCoordinatorAvailable: boolean;\n\t};\n\texport type PatternPermissionRule = {\n\t\tmode: PermissionMode;\n\t\toperations?: Array<string> | null;\n\t\tpatterns?: Array<string> | null;\n\t};\n\texport type PatternPermissions =\n\t\t| PermissionMode\n\t\t| RulePermissions<PatternPermissionRule>;\n\texport type PermissionMode = \"allow\" | \"deny\";\n\texport type Permissions = {\n\t\tfs?: FsPermissions | null;\n\t\tnetwork?: PatternPermissions | null;\n\t\tchildProcess?: PatternPermissions | null;\n\t\tprocess?: PatternPermissions | null;\n\t\tenv?: PatternPermissions | null;\n\t\thostFunction?: PatternPermissions | null;\n\t};\n\texport type PluginLimits = {\n\t\tmaxPersistedManifestBytes?: number | bigint | null;\n\t\tmaxPersistedManifestFileBytes?: number | bigint | null;\n\t};\n\texport type PreviewPolicy = {\n\t\tdefaultTtlMs: number | bigint;\n\t\tmaxTtlMs: number | bigint;\n\t\tmaxActive: number;\n\t};\n\texport type PreviewPolicyInput = {\n\t\tdefaultTtlMs?: number | bigint | null;\n\t\tmaxTtlMs?: number | bigint | null;\n\t\tmaxActive?: number | null;\n\t};\n\texport type ProcessExitEvent = {\n\t\tprocess: ActorProcessId;\n\t\tstatus: ActorExitStatus;\n\t};\n\texport type ProcessGet = { process: ActorProcessId };\n\texport type ProcessLimits = {\n\t\tmaxSpawnFileActions?: number | bigint | null;\n\t\tmaxSpawnFileActionBytes?: number | bigint | null;\n\t\tpendingStdinBytes?: number | bigint | null;\n\t\tpendingEventCount?: number | bigint | null;\n\t\tpendingEventBytes?: number | bigint | null;\n\t};\n\texport type ProcessList = Record<string, never>;\n\texport type ProcessOutputEvent = {\n\t\tprocess: ActorProcessId;\n\t\tsequence: number | bigint;\n\t\tstream: ProcessStream;\n\t\tdata: FileBytes;\n\t\ttimestampMs: number | bigint;\n\t};\n\texport type ProcessOutputRead = {\n\t\tprocess: ActorProcessId;\n\t\tafter?: number | bigint | null;\n\t\tmaxEvents?: number | null;\n\t\tmaxBytes?: number | null;\n\t};\n\texport type ProcessPtyResize = {\n\t\tprocess: ActorProcessId;\n\t\tcols: number;\n\t\trows: number;\n\t};\n\texport type ProcessRun = {\n\t\tcommand: string;\n\t\targs?: Array<string>;\n\t\toptions?: ActorExecOptions;\n\t};\n\texport type ProcessSignal = { process: ActorProcessId; signal: ActorSignal };\n\texport type ProcessSpawn = {\n\t\tcommand: string;\n\t\targs?: Array<string>;\n\t\toptions?: ActorSpawnOptions;\n\t};\n\texport type ProcessStatus = \"running\" | \"exited\";\n\texport type ProcessStdinClose = { process: ActorProcessId };\n\texport type ProcessStdinWrite = {\n\t\tprocess: ActorProcessId;\n\t\tdata: FileContentInput;\n\t};\n\texport type ProcessStream = \"stdout\" | \"stderr\";\n\texport type ProcessTree = Record<string, never>;\n\texport type ProcessWait = { process: ActorProcessId };\n\texport type PythonEvaluate = {\n\t\texpression: string;\n\t\toptions?: ActorInlineExecutionOptions;\n\t};\n\texport type PythonExecute = {\n\t\tsource: string;\n\t\toptions?: ActorInlineExecutionOptions;\n\t};\n\texport type PythonExecuteFile = {\n\t\tpath: string;\n\t\toptions?: ActorLanguageExecutionOptions;\n\t};\n\texport type PythonExecuteModule = {\n\t\tmodule: string;\n\t\toptions?: ActorLanguageExecutionOptions;\n\t};\n\texport type PythonInstall = {\n\t\tpackages?: Array<string>;\n\t\toptions?: ActorPythonInstallOptions;\n\t};\n\texport type PythonLimits = {\n\t\toutputBufferMaxBytes?: number | bigint | null;\n\t\texecutionTimeoutMs?: number | bigint | null;\n\t\tmaxOldSpaceMb?: number | bigint | null;\n\t\tvfsRpcTimeoutMs?: number | bigint | null;\n\t};\n\texport type PythonSpawn = {\n\t\tsource: string;\n\t\toptions?: ActorLanguageSpawnOptions;\n\t};\n\texport type PythonSpawnFile = {\n\t\tpath: string;\n\t\toptions?: ActorLanguageSpawnOptions;\n\t};\n\texport type PythonSpawnModule = {\n\t\tmodule: string;\n\t\toptions?: ActorLanguageSpawnOptions;\n\t};\n\texport type RegistrySoftwareSourceInput = {\n\t\t/**\n\t\t * Registry package name, such as `git` or `ripgrep`.\n\t\t */\n\t\tregistry: string;\n\t\t/**\n\t\t * agentOS release whose manifest lists the package, such as `0.4.3` or\n\t\t * `latest`. Defaults to the agentOS release the actor is built with.\n\t\t */\n\t\tversion?: string | null;\n\t};\n\texport type RemotePackageSource = {\n\t\turl: string;\n\t\tdigest?: string | null;\n\t\tsizeBytes?: number | bigint | null;\n\t\tpackageId?: string | null;\n\t};\n\texport type RemotePackageSourceInput = {\n\t\turl: string;\n\t\tdigest?: string | null;\n\t\t/**\n\t\t * Resolution metadata is accepted so a `v1.config.get` snapshot can be sent\n\t\t * back to `v1.config.set`. Core re-resolves the source and never trusts it.\n\t\t */\n\t\tsizeBytes?: number | bigint | null;\n\t\tpackageId?: string | null;\n\t};\n\texport type ResourceLimits = {\n\t\tcpuCount?: number | bigint | null;\n\t\tmaxProcesses?: number | bigint | null;\n\t\tmaxOpenFds?: number | bigint | null;\n\t\tmaxPipes?: number | bigint | null;\n\t\tmaxPtys?: number | bigint | null;\n\t\tmaxSockets?: number | bigint | null;\n\t\tmaxConnections?: number | bigint | null;\n\t\tmaxSocketBufferedBytes?: number | bigint | null;\n\t\tmaxSocketDatagramQueueLen?: number | bigint | null;\n\t\tmaxFilesystemBytes?: number | bigint | null;\n\t\tmaxInodeCount?: number | bigint | null;\n\t\tmaxBlockingReadMs?: number | bigint | null;\n\t\tmaxPreadBytes?: number | bigint | null;\n\t\tmaxFdWriteBytes?: number | bigint | null;\n\t\tmaxProcessArgvBytes?: number | bigint | null;\n\t\tmaxProcessEnvBytes?: number | bigint | null;\n\t\tmaxReaddirEntries?: number | bigint | null;\n\t\tmaxWasmFuel?: number | bigint | null;\n\t\tmaxWasmMemoryBytes?: number | bigint | null;\n\t\tmaxWasmStackBytes?: number | bigint | null;\n\t};\n\texport type RootSnapshotExport = {\n\t\tkind: SnapshotExportKind;\n\t\tsource: FilesystemSnapshotExport;\n\t};\n\texport type RulePermissions<T> = {\n\t\tdefault?: PermissionMode | null;\n\t\trules: Array<T>;\n\t};\n\texport type SnapshotExportKind = \"snapshot-export\";\n\texport type SoftwareInstall = {\n\t\t/**\n\t\t * A `{ url, digest? }` artifact or a `{ registry, version? }` package. The\n\t\t * result's `source` is the resolved, digest-pinned URL that is persisted.\n\t\t */\n\t\tsource: SoftwareSourceInput;\n\t\texpectedRevision?: number | bigint | null;\n\t};\n\texport type SoftwareList = Record<string, never>;\n\texport type SoftwareMutationResult = {\n\t\tsoftware?: ActorInstalledSoftware | null;\n\t\tsource: RemotePackageSource;\n\t\tconfig: ConfigSnapshot;\n\t};\n\texport type SoftwareSourceInput =\n\t\t| RegistrySoftwareSourceInput\n\t\t| RemotePackageSourceInput;\n\texport type SoftwareUninstall = {\n\t\tpackageId: string;\n\t\texpectedRevision?: number | bigint | null;\n\t};\n\texport type SpawnStdio = \"pipe\" | \"inherit\";\n\texport type SqliteLimits = { maxResultBytes?: number | bigint | null };\n\texport type TerminalClose = { terminal: ActorTerminalId };\n\texport type TerminalExitEvent = {\n\t\tterminal: ActorTerminalId;\n\t\tstatus: ActorExitStatus;\n\t};\n\texport type TerminalList = Record<string, never>;\n\texport type TerminalOpen = { options?: ActorTerminalOptions };\n\texport type TerminalOutputEvent = {\n\t\tterminal: ActorTerminalId;\n\t\tsequence: number | bigint;\n\t\tstream: ProcessStream;\n\t\tdata: FileBytes;\n\t\ttimestampMs: number | bigint;\n\t};\n\texport type TerminalOutputRead = {\n\t\tterminal: ActorTerminalId;\n\t\tafter?: number | bigint | null;\n\t\tmaxBytes?: number | null;\n\t\tmaxEvents?: number | null;\n\t};\n\texport type TerminalPtyResize = {\n\t\tterminal: ActorTerminalId;\n\t\tcols: number;\n\t\trows: number;\n\t};\n\texport type TerminalStdinWrite = {\n\t\tterminal: ActorTerminalId;\n\t\tdata: FileContentInput;\n\t};\n\texport type TerminalWait = { terminal: ActorTerminalId };\n\texport type TlsLimits = { maxBufferedBytes?: number | bigint };\n\texport type TypeScriptCheck = {\n\t\tsource: string;\n\t\toptions?: ActorTypeScriptCheckOptions;\n\t};\n\texport type TypeScriptCheckProject = {\n\t\toptions?: ActorTypeScriptCheckOptions;\n\t};\n\texport type TypeScriptEvaluate = {\n\t\texpression: string;\n\t\toptions?: ActorTypeScriptExecutionOptions;\n\t};\n\texport type TypeScriptExecute = {\n\t\tsource: string;\n\t\toptions?: ActorTypeScriptExecutionOptions;\n\t};\n\texport type TypeScriptExecuteFile = {\n\t\tpath: string;\n\t\toptions?: ActorTypeScriptExecutionOptions;\n\t};\n\texport type TypeScriptSpawn = {\n\t\tsource: string;\n\t\toptions?: ActorLanguageSpawnOptions;\n\t};\n\texport type TypeScriptSpawnFile = {\n\t\tpath: string;\n\t\toptions?: ActorLanguageSpawnOptions;\n\t};\n\texport type VmBooted = {\n\t\tgeneration: number | bigint;\n\t\tconfigRevision: number | bigint;\n\t\tbootedAtMs: number | bigint;\n\t};\n\texport type VmGroupConfig = {\n\t\tgid: number;\n\t\tname: string;\n\t\tmembers: Array<string>;\n\t};\n\texport type VmIssue = {\n\t\tcode: string;\n\t\tmessage: string;\n\t\tatMs: number | bigint;\n\t};\n\texport type VmLifecycleState =\n\t\t| \"initializing\"\n\t\t| \"preloading\"\n\t\t| \"booting\"\n\t\t| \"ready\"\n\t\t| \"degraded\"\n\t\t| \"stopping\"\n\t\t| \"failed\";\n\texport type VmLimitWarning = {\n\t\tlimit: string;\n\t\tobserved: number | bigint;\n\t\tcapacity: number | bigint;\n\t\tmessage: string;\n\t};\n\texport type VmRestart = Record<string, never>;\n\texport type VmShutdown = {\n\t\tgeneration: number | bigint;\n\t\treason: string;\n\t\tshutdownAtMs: number | bigint;\n\t};\n\texport type VmStatus = Record<string, never>;\n\texport type VmStatusSnapshot = {\n\t\tlifecycle: VmLifecycleState;\n\t\tconfigState: ConfigApplyState;\n\t\tdesiredConfigRevision: number | bigint;\n\t\tappliedConfigRevision?: number | bigint | null;\n\t\tgeneration: number | bigint;\n\t\tlastBootAtMs?: number | bigint | null;\n\t\tlastShutdownAtMs?: number | bigint | null;\n\t\tpackages: PackageStartupStatus;\n\t\tissues: Array<VmIssue>;\n\t\tcore?: CoreSidecarStatus | null;\n\t};\n\texport type VmUserAccountConfig = {\n\t\tuid: number;\n\t\tgid: number;\n\t\tusername: string;\n\t\thomedir: string;\n\t\tshell: string;\n\t\tgecos?: string;\n\t\tsupplementaryGids: Array<number>;\n\t};\n\texport type VmUserConfig = {\n\t\tuid?: number;\n\t\tgid?: number;\n\t\teuid?: number;\n\t\tegid?: number;\n\t\tusername?: string;\n\t\thomedir?: string;\n\t\tshell?: string;\n\t\tgecos?: string;\n\t\tgroupName?: string;\n\t\tsupplementaryGids?: Array<number>;\n\t\taccounts?: Array<VmUserAccountConfig>;\n\t\tgroups?: Array<VmGroupConfig>;\n\t};\n\texport type WasmLimits = {\n\t\tmaxModuleFileBytes?: number | bigint | null;\n\t\tcapturedOutputLimitBytes?: number | bigint | null;\n\t\tsyncReadLimitBytes?: number | bigint | null;\n\t\tprewarmTimeoutMs?: number | bigint | null;\n\t\trunnerHeapLimitMb?: number | bigint | null;\n\t\trunnerCpuTimeLimitMs?: number | bigint | null;\n\t};\n}\n\nexport type AgentOsActorCreateInput = Input.AgentOsActorCreateInput;\nexport type AgentOsRivetError = {\n\tgroup: string;\n\tcode: string;\n\tmessage: string;\n\tmetadata: Output.JsonValue | null;\n};\n\nexport type V1ConfigGetInput = Record<string, never>;\nexport type V1ConfigGetOutput = {\n\trevision: number | bigint;\n\tdesired: Output.AgentOsActorConfig;\n\tappliedRevision?: number | bigint | null;\n\tstate: Output.ConfigApplyState;\n\tissues: Array<Output.VmIssue>;\n\tcreatedAtMs: number | bigint;\n\tupdatedAtMs: number | bigint;\n};\nexport type V1ConfigPatchInput = {\n\tpatch: Input.JsonValue;\n\texpectedRevision?: number | bigint | null;\n};\nexport type V1ConfigPatchOutput = {\n\trevision: number | bigint;\n\tdesired: Output.AgentOsActorConfig;\n\tappliedRevision?: number | bigint | null;\n\tstate: Output.ConfigApplyState;\n\tissues: Array<Output.VmIssue>;\n\tcreatedAtMs: number | bigint;\n\tupdatedAtMs: number | bigint;\n};\nexport type V1ConfigSetInput = {\n\tconfig: Input.AgentOsActorConfigInput;\n\texpectedRevision?: number | bigint | null;\n};\nexport type V1ConfigSetOutput = {\n\trevision: number | bigint;\n\tdesired: Output.AgentOsActorConfig;\n\tappliedRevision?: number | bigint | null;\n\tstate: Output.ConfigApplyState;\n\tissues: Array<Output.VmIssue>;\n\tcreatedAtMs: number | bigint;\n\tupdatedAtMs: number | bigint;\n};\nexport type V1ContextsCreateInput = { contextId: string };\nexport type V1ContextsCreateOutput = {\n\tcontext: Output.ActorContextId;\n\tstate: string;\n\tlanguage?: string | null;\n\tcreatedAtMs: number | bigint;\n\tlastStartedAtMs?: number | bigint | null;\n\tlastCompletedAtMs?: number | bigint | null;\n};\nexport type V1ContextsDeleteInput = { context: Input.ActorContextId };\nexport type V1ContextsDeleteOutput = void;\nexport type V1ContextsGetInput = { context: Input.ActorContextId };\nexport type V1ContextsGetOutput = {\n\tcontext: Output.ActorContextId;\n\tstate: string;\n\tlanguage?: string | null;\n\tcreatedAtMs: number | bigint;\n\tlastStartedAtMs?: number | bigint | null;\n\tlastCompletedAtMs?: number | bigint | null;\n};\nexport type V1ContextsListInput = Record<string, never>;\nexport type V1ContextsListOutput = Array<{\n\tcontext: Output.ActorContextId;\n\tstate: string;\n\tlanguage?: string | null;\n\tcreatedAtMs: number | bigint;\n\tlastStartedAtMs?: number | bigint | null;\n\tlastCompletedAtMs?: number | bigint | null;\n}>;\nexport type V1ContextsResetInput = { context: Input.ActorContextId };\nexport type V1ContextsResetOutput = {\n\tcontext: Output.ActorContextId;\n\tstate: string;\n\tlanguage?: string | null;\n\tcreatedAtMs: number | bigint;\n\tlastStartedAtMs?: number | bigint | null;\n\tlastCompletedAtMs?: number | bigint | null;\n};\nexport type V1CronCancelInput = { name: string };\nexport type V1CronCancelOutput = boolean;\nexport type V1CronListInput = Record<string, never>;\nexport type V1CronListOutput = Array<{\n\tname: string;\n\texpression: string;\n\ttimezone?: string | null;\n\tcommand: string;\n\targs: Array<string>;\n\toptions: Output.ActorSpawnOptions;\n\tconfigRevision: number | bigint;\n\tnextRunAtMs: number | bigint;\n\tlastRunAtMs?: number | bigint | null;\n\tmaxHistory: number | bigint;\n}>;\nexport type V1CronScheduleInput = {\n\tname?: string | null;\n\texpression: string;\n\ttimezone?: string | null;\n\tcommand: string;\n\targs?: Array<string>;\n\toptions?: Input.ActorSpawnOptions;\n\tmaxHistory?: number | bigint | null;\n};\nexport type V1CronScheduleOutput = {\n\tname: string;\n\texpression: string;\n\ttimezone?: string | null;\n\tcommand: string;\n\targs: Array<string>;\n\toptions: Output.ActorSpawnOptions;\n\tconfigRevision: number | bigint;\n\tnextRunAtMs: number | bigint;\n\tlastRunAtMs?: number | bigint | null;\n\tmaxHistory: number | bigint;\n};\nexport type V1FilesystemExistsInput = { path: string };\nexport type V1FilesystemExistsOutput = boolean;\nexport type V1FilesystemExportInput = { maxBytes?: number | null };\nexport type V1FilesystemExportOutput = {\n\tkind: Output.SnapshotExportKind;\n\tsource: Output.FilesystemSnapshotExport;\n};\nexport type V1FilesystemListMountsInput = Record<string, never>;\nexport type V1FilesystemListMountsOutput = Array<{\n\tpath: string;\n\tkind: string;\n\treadOnly: boolean;\n}>;\nexport type V1FilesystemMkdirInput = { path: string; recursive?: boolean };\nexport type V1FilesystemMkdirOutput = void;\nexport type V1FilesystemMoveInput = { from: string; to: string };\nexport type V1FilesystemMoveOutput = void;\nexport type V1FilesystemReadFileInput = {\n\tpath: string;\n\tmaxBytes?: number | null;\n};\nexport type V1FilesystemReadFileOutput = Uint8Array;\nexport type V1FilesystemReadFilesInput = {\n\tpaths: Array<string>;\n\tmaxBytes?: number | null;\n};\nexport type V1FilesystemReadFilesOutput = Array<{\n\tpath: string;\n\tcontent?: Output.FileBytes | null;\n\terror?: string | null;\n}>;\nexport type V1FilesystemReaddirInput = { path: string };\nexport type V1FilesystemReaddirOutput = Array<string>;\nexport type V1FilesystemReaddirEntriesInput = { path: string };\nexport type V1FilesystemReaddirEntriesOutput = Array<{\n\tname: string;\n\tisDirectory: boolean;\n\tisSymbolicLink: boolean;\n}>;\nexport type V1FilesystemReaddirRecursiveInput = {\n\tpath: string;\n\tmaxDepth?: number | null;\n\texclude?: Array<string>;\n};\nexport type V1FilesystemReaddirRecursiveOutput = Array<{\n\tpath: string;\n\ttype: Output.DirEntryType;\n\tsizeBytes: number | bigint;\n}>;\nexport type V1FilesystemRemoveInput = { path: string; recursive?: boolean };\nexport type V1FilesystemRemoveOutput = void;\nexport type V1FilesystemStatInput = { path: string };\nexport type V1FilesystemStatOutput = {\n\tmode: number;\n\tsizeBytes: number | bigint;\n\tblocks: number | bigint;\n\tdev: number | bigint;\n\trdev: number | bigint;\n\tisDirectory: boolean;\n\tisSymbolicLink: boolean;\n\tatimeMs: number;\n\tmtimeMs: number;\n\tctimeMs: number;\n\tbirthtimeMs: number;\n\tino: number | bigint;\n\tnlink: number | bigint;\n\tuid: number;\n\tgid: number;\n};\nexport type V1FilesystemWriteFileInput = {\n\tpath: string;\n\tcontent: Input.FileContentInput;\n};\nexport type V1FilesystemWriteFileOutput = void;\nexport type V1FilesystemWriteFilesInput = {\n\tentries: Array<Input.FilesystemWriteEntry>;\n};\nexport type V1FilesystemWriteFilesOutput = Array<{\n\tpath: string;\n\tsuccess: boolean;\n\terror?: string | null;\n}>;\nexport type V1JavaScriptEvaluateInput = {\n\texpression: string;\n\toptions?: Input.ActorJavaScriptExecutionOptions;\n};\nexport type V1JavaScriptEvaluateOutput = {\n\tresult: Output.ActorCodeExecutionResult;\n\tvalue?: Output.JsonValue | null;\n};\nexport type V1JavaScriptExecuteInput = {\n\tsource: string;\n\toptions?: Input.ActorJavaScriptExecutionOptions;\n};\nexport type V1JavaScriptExecuteOutput = {\n\texecution?: Output.ActorExecutionDescriptor | null;\n\toutcome: Output.ActorExecutionOutcome;\n\texitCode?: number | null;\n\terror?: Output.ActorExecutionError | null;\n\tstdout?: Output.FileBytes | null;\n\tstderr?: Output.FileBytes | null;\n\tstdoutTruncated?: boolean | null;\n\tstderrTruncated?: boolean | null;\n};\nexport type V1JavaScriptExecuteFileInput = {\n\tpath: string;\n\toptions?: Input.ActorLanguageExecutionOptions;\n};\nexport type V1JavaScriptExecuteFileOutput = {\n\texecution?: Output.ActorExecutionDescriptor | null;\n\toutcome: Output.ActorExecutionOutcome;\n\texitCode?: number | null;\n\terror?: Output.ActorExecutionError | null;\n\tstdout?: Output.FileBytes | null;\n\tstderr?: Output.FileBytes | null;\n\tstdoutTruncated?: boolean | null;\n\tstderrTruncated?: boolean | null;\n};\nexport type V1JavaScriptNpmInstallInput = {\n\tpackages?: Array<string>;\n\toptions?: Input.ActorNpmInstallOptions;\n};\nexport type V1JavaScriptNpmInstallOutput = {\n\texecution?: Output.ActorExecutionDescriptor | null;\n\toutcome: Output.ActorExecutionOutcome;\n\texitCode?: number | null;\n\terror?: Output.ActorExecutionError | null;\n\tstdout?: Output.FileBytes | null;\n\tstderr?: Output.FileBytes | null;\n\tstdoutTruncated?: boolean | null;\n\tstderrTruncated?: boolean | null;\n};\nexport type V1JavaScriptNpmRunPackageInput = {\n\tpackageSpec: string;\n\tbinary?: string | null;\n\toptions?: Input.ActorLanguageExecutionOptions;\n};\nexport type V1JavaScriptNpmRunPackageOutput = {\n\texecution?: Output.ActorExecutionDescriptor | null;\n\toutcome: Output.ActorExecutionOutcome;\n\texitCode?: number | null;\n\terror?: Output.ActorExecutionError | null;\n\tstdout?: Output.FileBytes | null;\n\tstderr?: Output.FileBytes | null;\n\tstdoutTruncated?: boolean | null;\n\tstderrTruncated?: boolean | null;\n};\nexport type V1JavaScriptNpmRunScriptInput = {\n\tscript: string;\n\toptions?: Input.ActorLanguageExecutionOptions;\n};\nexport type V1JavaScriptNpmRunScriptOutput = {\n\texecution?: Output.ActorExecutionDescriptor | null;\n\toutcome: Output.ActorExecutionOutcome;\n\texitCode?: number | null;\n\terror?: Output.ActorExecutionError | null;\n\tstdout?: Output.FileBytes | null;\n\tstderr?: Output.FileBytes | null;\n\tstdoutTruncated?: boolean | null;\n\tstderrTruncated?: boolean | null;\n};\nexport type V1JavaScriptSpawnInput = {\n\tsource: string;\n\toptions?: Input.ActorLanguageSpawnOptions;\n};\nexport type V1JavaScriptSpawnOutput = {\n\tgeneration: number | bigint;\n\tpid: number;\n};\nexport type V1JavaScriptSpawnFileInput = {\n\tpath: string;\n\toptions?: Input.ActorLanguageSpawnOptions;\n};\nexport type V1JavaScriptSpawnFileOutput = {\n\tgeneration: number | bigint;\n\tpid: number;\n};\nexport type V1NetworkFetchInput = { request: Input.ActorHttpRequest };\nexport type V1NetworkFetchOutput = {\n\tstatus: number;\n\tstatusText: string;\n\theaders: Array<[string, string]>;\n\tbody: Output.FileBytes;\n};\nexport type V1NetworkFetchStreamCancelInput = {\n\tstream: Input.ActorFetchStreamId;\n};\nexport type V1NetworkFetchStreamCancelOutput = void;\nexport type V1NetworkFetchStreamReadInput = {\n\tstream: Input.ActorFetchStreamId;\n\tmaxBytes?: number | null;\n};\nexport type V1NetworkFetchStreamReadOutput = {\n\tbody: Output.FileBytes;\n\tdone: boolean;\n};\nexport type V1NetworkFetchStreamStartInput = {\n\trequest: Input.ActorHttpRequest;\n};\nexport type V1NetworkFetchStreamStartOutput = {\n\tstream: Output.ActorFetchStreamId;\n\tstatus: number;\n\tstatusText: string;\n\theaders: Array<[string, string]>;\n};\nexport type V1NetworkPreviewCreateInput = {\n\tport: number;\n\tttlMs?: number | bigint | null;\n};\nexport type V1NetworkPreviewCreateOutput = {\n\ttoken: string;\n\tpath: string;\n\tport: number;\n\texpiresAtMs: number | bigint;\n};\nexport type V1NetworkPreviewExpireInput = { token: string };\nexport type V1NetworkPreviewExpireOutput = boolean;\nexport type V1ProcessGetInput = { process: Input.ActorProcessId };\nexport type V1ProcessGetOutput = {\n\tprocess: Output.ActorProcessId;\n\tcommand: string;\n\targs: Array<string>;\n\trunning: boolean;\n\texit?: Output.ActorExitStatus | null;\n\tstartedAtMs: number | bigint;\n};\nexport type V1ProcessListInput = Record<string, never>;\nexport type V1ProcessListOutput = Array<{\n\tprocess: Output.ActorProcessId;\n\tcommand: string;\n\targs: Array<string>;\n\trunning: boolean;\n\texit?: Output.ActorExitStatus | null;\n\tstartedAtMs: number | bigint;\n}>;\nexport type V1ProcessOutputReadInput = {\n\tprocess: Input.ActorProcessId;\n\tafter?: number | bigint | null;\n\tmaxEvents?: number | null;\n\tmaxBytes?: number | null;\n};\nexport type V1ProcessOutputReadOutput = {\n\tgeneration: number | bigint;\n\tevents: Array<Output.ActorOutputEvent>;\n\tnextCursor?: number | bigint | null;\n\thasMore: boolean;\n\ttruncated: boolean;\n\tend?: Output.ActorExitStatus | null;\n};\nexport type V1ProcessPtyResizeInput = {\n\tprocess: Input.ActorProcessId;\n\tcols: number;\n\trows: number;\n};\nexport type V1ProcessPtyResizeOutput = void;\nexport type V1ProcessRunInput = {\n\tcommand: string;\n\targs?: Array<string>;\n\toptions?: Input.ActorExecOptions;\n};\nexport type V1ProcessRunOutput = {\n\tstatus: Output.ActorExitStatus;\n\tstdout: string;\n\tstderr: string;\n};\nexport type V1ProcessSignalInput = {\n\tprocess: Input.ActorProcessId;\n\tsignal: Input.ActorSignal;\n};\nexport type V1ProcessSignalOutput = void;\nexport type V1ProcessSpawnInput = {\n\tcommand: string;\n\targs?: Array<string>;\n\toptions?: Input.ActorSpawnOptions;\n};\nexport type V1ProcessSpawnOutput = { generation: number | bigint; pid: number };\nexport type V1ProcessStdinCloseInput = { process: Input.ActorProcessId };\nexport type V1ProcessStdinCloseOutput = void;\nexport type V1ProcessStdinWriteInput = {\n\tprocess: Input.ActorProcessId;\n\tdata: Input.FileContentInput;\n};\nexport type V1ProcessStdinWriteOutput = void;\nexport type V1ProcessTreeInput = Record<string, never>;\nexport type V1ProcessTreeOutput = {\n\tgeneration: number | bigint;\n\troots: Array<Output.ActorProcessTreeNode>;\n};\nexport type V1ProcessWaitInput = { process: Input.ActorProcessId };\nexport type V1ProcessWaitOutput = {\n\tprocess: Output.ActorProcessId;\n\tstatus: Output.ActorExitStatus;\n};\nexport type V1PythonEvaluateInput = {\n\texpression: string;\n\toptions?: Input.ActorInlineExecutionOptions;\n};\nexport type V1PythonEvaluateOutput = {\n\tresult: Output.ActorCodeExecutionResult;\n\tvalue?: Output.JsonValue | null;\n};\nexport type V1PythonExecuteInput = {\n\tsource: string;\n\toptions?: Input.ActorInlineExecutionOptions;\n};\nexport type V1PythonExecuteOutput = {\n\texecution?: Output.ActorExecutionDescriptor | null;\n\toutcome: Output.ActorExecutionOutcome;\n\texitCode?: number | null;\n\terror?: Output.ActorExecutionError | null;\n\tstdout?: Output.FileBytes | null;\n\tstderr?: Output.FileBytes | null;\n\tstdoutTruncated?: boolean | null;\n\tstderrTruncated?: boolean | null;\n};\nexport type V1PythonExecuteFileInput = {\n\tpath: string;\n\toptions?: Input.ActorLanguageExecutionOptions;\n};\nexport type V1PythonExecuteFileOutput = {\n\texecution?: Output.ActorExecutionDescriptor | null;\n\toutcome: Output.ActorExecutionOutcome;\n\texitCode?: number | null;\n\terror?: Output.ActorExecutionError | null;\n\tstdout?: Output.FileBytes | null;\n\tstderr?: Output.FileBytes | null;\n\tstdoutTruncated?: boolean | null;\n\tstderrTruncated?: boolean | null;\n};\nexport type V1PythonExecuteModuleInput = {\n\tmodule: string;\n\toptions?: Input.ActorLanguageExecutionOptions;\n};\nexport type V1PythonExecuteModuleOutput = {\n\texecution?: Output.ActorExecutionDescriptor | null;\n\toutcome: Output.ActorExecutionOutcome;\n\texitCode?: number | null;\n\terror?: Output.ActorExecutionError | null;\n\tstdout?: Output.FileBytes | null;\n\tstderr?: Output.FileBytes | null;\n\tstdoutTruncated?: boolean | null;\n\tstderrTruncated?: boolean | null;\n};\nexport type V1PythonInstallInput = {\n\tpackages?: Array<string>;\n\toptions?: Input.ActorPythonInstallOptions;\n};\nexport type V1PythonInstallOutput = {\n\texecution?: Output.ActorExecutionDescriptor | null;\n\toutcome: Output.ActorExecutionOutcome;\n\texitCode?: number | null;\n\terror?: Output.ActorExecutionError | null;\n\tstdout?: Output.FileBytes | null;\n\tstderr?: Output.FileBytes | null;\n\tstdoutTruncated?: boolean | null;\n\tstderrTruncated?: boolean | null;\n};\nexport type V1PythonSpawnInput = {\n\tsource: string;\n\toptions?: Input.ActorLanguageSpawnOptions;\n};\nexport type V1PythonSpawnOutput = { generation: number | bigint; pid: number };\nexport type V1PythonSpawnFileInput = {\n\tpath: string;\n\toptions?: Input.ActorLanguageSpawnOptions;\n};\nexport type V1PythonSpawnFileOutput = {\n\tgeneration: number | bigint;\n\tpid: number;\n};\nexport type V1PythonSpawnModuleInput = {\n\tmodule: string;\n\toptions?: Input.ActorLanguageSpawnOptions;\n};\nexport type V1PythonSpawnModuleOutput = {\n\tgeneration: number | bigint;\n\tpid: number;\n};\nexport type V1SoftwareInstallInput = {\n\t/**\n\t * A `{ url, digest? }` artifact or a `{ registry, version? }` package. The\n\t * result's `source` is the resolved, digest-pinned URL that is persisted.\n\t */\n\tsource: Input.SoftwareSourceInput;\n\texpectedRevision?: number | bigint | null;\n};\nexport type V1SoftwareInstallOutput = {\n\tsoftware?: Output.ActorInstalledSoftware | null;\n\tsource: Output.RemotePackageSource;\n\tconfig: Output.ConfigSnapshot;\n};\nexport type V1SoftwareListInput = Record<string, never>;\nexport type V1SoftwareListOutput = Array<{\n\tpackageId: string;\n\tdigest: string;\n\tsizeBytes: number | bigint;\n\tpackageName: string;\n\tversion: string;\n\tcommands: Array<string>;\n}>;\nexport type V1SoftwareUninstallInput = {\n\tpackageId: string;\n\texpectedRevision?: number | bigint | null;\n};\nexport type V1SoftwareUninstallOutput = {\n\tsoftware?: Output.ActorInstalledSoftware | null;\n\tsource: Output.RemotePackageSource;\n\tconfig: Output.ConfigSnapshot;\n};\nexport type V1TerminalCloseInput = { terminal: Input.ActorTerminalId };\nexport type V1TerminalCloseOutput = void;\nexport type V1TerminalListInput = Record<string, never>;\nexport type V1TerminalListOutput = Array<{\n\tterminal: Output.ActorTerminalId;\n\tpid: number;\n\trunning: boolean;\n\texit?: Output.ActorExitStatus | null;\n}>;\nexport type V1TerminalOpenInput = { options?: Input.ActorTerminalOptions };\nexport type V1TerminalOpenOutput = {\n\tgeneration: number | bigint;\n\tshellId: string;\n};\nexport type V1TerminalOutputReadInput = {\n\tterminal: Input.ActorTerminalId;\n\tafter?: number | bigint | null;\n\tmaxBytes?: number | null;\n\tmaxEvents?: number | null;\n};\nexport type V1TerminalOutputReadOutput = {\n\tgeneration: number | bigint;\n\tevents: Array<Output.ActorOutputEvent>;\n\tnextCursor?: number | bigint | null;\n\thasMore: boolean;\n\ttruncated: boolean;\n\tend?: Output.ActorExitStatus | null;\n};\nexport type V1TerminalPtyResizeInput = {\n\tterminal: Input.ActorTerminalId;\n\tcols: number;\n\trows: number;\n};\nexport type V1TerminalPtyResizeOutput = void;\nexport type V1TerminalStdinWriteInput = {\n\tterminal: Input.ActorTerminalId;\n\tdata: Input.FileContentInput;\n};\nexport type V1TerminalStdinWriteOutput = void;\nexport type V1TerminalWaitInput = { terminal: Input.ActorTerminalId };\nexport type V1TerminalWaitOutput = {\n\tterminal: Output.ActorTerminalId;\n\tstatus: Output.ActorExitStatus;\n};\nexport type V1TypeScriptCheckInput = {\n\tsource: string;\n\toptions?: Input.ActorTypeScriptCheckOptions;\n};\nexport type V1TypeScriptCheckOutput = {\n\tresult: Output.ActorCodeExecutionResult;\n\thasErrors?: boolean | null;\n\tdiagnostics: Array<Output.ActorTypeScriptDiagnostic>;\n};\nexport type V1TypeScriptCheckProjectInput = {\n\toptions?: Input.ActorTypeScriptCheckOptions;\n};\nexport type V1TypeScriptCheckProjectOutput = {\n\tresult: Output.ActorCodeExecutionResult;\n\thasErrors?: boolean | null;\n\tdiagnostics: Array<Output.ActorTypeScriptDiagnostic>;\n};\nexport type V1TypeScriptEvaluateInput = {\n\texpression: string;\n\toptions?: Input.ActorTypeScriptExecutionOptions;\n};\nexport type V1TypeScriptEvaluateOutput = {\n\tresult: Output.ActorCodeExecutionResult;\n\tvalue?: Output.JsonValue | null;\n};\nexport type V1TypeScriptExecuteInput = {\n\tsource: string;\n\toptions?: Input.ActorTypeScriptExecutionOptions;\n};\nexport type V1TypeScriptExecuteOutput = {\n\texecution?: Output.ActorExecutionDescriptor | null;\n\toutcome: Output.ActorExecutionOutcome;\n\texitCode?: number | null;\n\terror?: Output.ActorExecutionError | null;\n\tstdout?: Output.FileBytes | null;\n\tstderr?: Output.FileBytes | null;\n\tstdoutTruncated?: boolean | null;\n\tstderrTruncated?: boolean | null;\n};\nexport type V1TypeScriptExecuteFileInput = {\n\tpath: string;\n\toptions?: Input.ActorTypeScriptExecutionOptions;\n};\nexport type V1TypeScriptExecuteFileOutput = {\n\texecution?: Output.ActorExecutionDescriptor | null;\n\toutcome: Output.ActorExecutionOutcome;\n\texitCode?: number | null;\n\terror?: Output.ActorExecutionError | null;\n\tstdout?: Output.FileBytes | null;\n\tstderr?: Output.FileBytes | null;\n\tstdoutTruncated?: boolean | null;\n\tstderrTruncated?: boolean | null;\n};\nexport type V1TypeScriptSpawnInput = {\n\tsource: string;\n\toptions?: Input.ActorLanguageSpawnOptions;\n};\nexport type V1TypeScriptSpawnOutput = {\n\tgeneration: number | bigint;\n\tpid: number;\n};\nexport type V1TypeScriptSpawnFileInput = {\n\tpath: string;\n\toptions?: Input.ActorLanguageSpawnOptions;\n};\nexport type V1TypeScriptSpawnFileOutput = {\n\tgeneration: number | bigint;\n\tpid: number;\n};\nexport type V1VmRestartInput = Record<string, never>;\nexport type V1VmRestartOutput = {\n\tlifecycle: Output.VmLifecycleState;\n\tconfigState: Output.ConfigApplyState;\n\tdesiredConfigRevision: number | bigint;\n\tappliedConfigRevision?: number | bigint | null;\n\tgeneration: number | bigint;\n\tlastBootAtMs?: number | bigint | null;\n\tlastShutdownAtMs?: number | bigint | null;\n\tpackages: Output.PackageStartupStatus;\n\tissues: Array<Output.VmIssue>;\n\tcore?: Output.CoreSidecarStatus | null;\n};\nexport type V1VmStatusInput = Record<string, never>;\nexport type V1VmStatusOutput = {\n\tlifecycle: Output.VmLifecycleState;\n\tconfigState: Output.ConfigApplyState;\n\tdesiredConfigRevision: number | bigint;\n\tappliedConfigRevision?: number | bigint | null;\n\tgeneration: number | bigint;\n\tlastBootAtMs?: number | bigint | null;\n\tlastShutdownAtMs?: number | bigint | null;\n\tpackages: Output.PackageStartupStatus;\n\tissues: Array<Output.VmIssue>;\n\tcore?: Output.CoreSidecarStatus | null;\n};\n\nexport interface AgentOsActions {\n\treadonly v1: {\n\t\treadonly config: {\n\t\t\treadonly get: (input: V1ConfigGetInput) => Promise<V1ConfigGetOutput>;\n\t\t\treadonly patch: (\n\t\t\t\tinput: V1ConfigPatchInput,\n\t\t\t) => Promise<V1ConfigPatchOutput>;\n\t\t\treadonly set: (input: V1ConfigSetInput) => Promise<V1ConfigSetOutput>;\n\t\t};\n\t\treadonly contexts: {\n\t\t\treadonly create: (\n\t\t\t\tinput: V1ContextsCreateInput,\n\t\t\t) => Promise<V1ContextsCreateOutput>;\n\t\t\treadonly delete: (\n\t\t\t\tinput: V1ContextsDeleteInput,\n\t\t\t) => Promise<V1ContextsDeleteOutput>;\n\t\t\treadonly get: (input: V1ContextsGetInput) => Promise<V1ContextsGetOutput>;\n\t\t\treadonly list: (\n\t\t\t\tinput: V1ContextsListInput,\n\t\t\t) => Promise<V1ContextsListOutput>;\n\t\t\treadonly reset: (\n\t\t\t\tinput: V1ContextsResetInput,\n\t\t\t) => Promise<V1ContextsResetOutput>;\n\t\t};\n\t\treadonly cron: {\n\t\t\treadonly cancel: (\n\t\t\t\tinput: V1CronCancelInput,\n\t\t\t) => Promise<V1CronCancelOutput>;\n\t\t\treadonly list: (input: V1CronListInput) => Promise<V1CronListOutput>;\n\t\t\treadonly schedule: (\n\t\t\t\tinput: V1CronScheduleInput,\n\t\t\t) => Promise<V1CronScheduleOutput>;\n\t\t};\n\t\treadonly filesystem: {\n\t\t\treadonly exists: (\n\t\t\t\tinput: V1FilesystemExistsInput,\n\t\t\t) => Promise<V1FilesystemExistsOutput>;\n\t\t\treadonly export: (\n\t\t\t\tinput: V1FilesystemExportInput,\n\t\t\t) => Promise<V1FilesystemExportOutput>;\n\t\t\treadonly listMounts: (\n\t\t\t\tinput: V1FilesystemListMountsInput,\n\t\t\t) => Promise<V1FilesystemListMountsOutput>;\n\t\t\treadonly mkdir: (\n\t\t\t\tinput: V1FilesystemMkdirInput,\n\t\t\t) => Promise<V1FilesystemMkdirOutput>;\n\t\t\treadonly move: (\n\t\t\t\tinput: V1FilesystemMoveInput,\n\t\t\t) => Promise<V1FilesystemMoveOutput>;\n\t\t\treadonly readFile: (\n\t\t\t\tinput: V1FilesystemReadFileInput,\n\t\t\t) => Promise<V1FilesystemReadFileOutput>;\n\t\t\treadonly readFiles: (\n\t\t\t\tinput: V1FilesystemReadFilesInput,\n\t\t\t) => Promise<V1FilesystemReadFilesOutput>;\n\t\t\treadonly readdir: (\n\t\t\t\tinput: V1FilesystemReaddirInput,\n\t\t\t) => Promise<V1FilesystemReaddirOutput>;\n\t\t\treadonly readdirEntries: (\n\t\t\t\tinput: V1FilesystemReaddirEntriesInput,\n\t\t\t) => Promise<V1FilesystemReaddirEntriesOutput>;\n\t\t\treadonly readdirRecursive: (\n\t\t\t\tinput: V1FilesystemReaddirRecursiveInput,\n\t\t\t) => Promise<V1FilesystemReaddirRecursiveOutput>;\n\t\t\treadonly remove: (\n\t\t\t\tinput: V1FilesystemRemoveInput,\n\t\t\t) => Promise<V1FilesystemRemoveOutput>;\n\t\t\treadonly stat: (\n\t\t\t\tinput: V1FilesystemStatInput,\n\t\t\t) => Promise<V1FilesystemStatOutput>;\n\t\t\treadonly writeFile: (\n\t\t\t\tinput: V1FilesystemWriteFileInput,\n\t\t\t) => Promise<V1FilesystemWriteFileOutput>;\n\t\t\treadonly writeFiles: (\n\t\t\t\tinput: V1FilesystemWriteFilesInput,\n\t\t\t) => Promise<V1FilesystemWriteFilesOutput>;\n\t\t};\n\t\treadonly javascript: {\n\t\t\treadonly evaluate: (\n\t\t\t\tinput: V1JavaScriptEvaluateInput,\n\t\t\t) => Promise<V1JavaScriptEvaluateOutput>;\n\t\t\treadonly execute: (\n\t\t\t\tinput: V1JavaScriptExecuteInput,\n\t\t\t) => Promise<V1JavaScriptExecuteOutput>;\n\t\t\treadonly executeFile: (\n\t\t\t\tinput: V1JavaScriptExecuteFileInput,\n\t\t\t) => Promise<V1JavaScriptExecuteFileOutput>;\n\t\t\treadonly npm: {\n\t\t\t\treadonly install: (\n\t\t\t\t\tinput: V1JavaScriptNpmInstallInput,\n\t\t\t\t) => Promise<V1JavaScriptNpmInstallOutput>;\n\t\t\t\treadonly runPackage: (\n\t\t\t\t\tinput: V1JavaScriptNpmRunPackageInput,\n\t\t\t\t) => Promise<V1JavaScriptNpmRunPackageOutput>;\n\t\t\t\treadonly runScript: (\n\t\t\t\t\tinput: V1JavaScriptNpmRunScriptInput,\n\t\t\t\t) => Promise<V1JavaScriptNpmRunScriptOutput>;\n\t\t\t};\n\t\t\treadonly spawn: (\n\t\t\t\tinput: V1JavaScriptSpawnInput,\n\t\t\t) => Promise<V1JavaScriptSpawnOutput>;\n\t\t\treadonly spawnFile: (\n\t\t\t\tinput: V1JavaScriptSpawnFileInput,\n\t\t\t) => Promise<V1JavaScriptSpawnFileOutput>;\n\t\t};\n\t\treadonly network: {\n\t\t\treadonly fetch: (\n\t\t\t\tinput: V1NetworkFetchInput,\n\t\t\t) => Promise<V1NetworkFetchOutput>;\n\t\t\treadonly fetchStream: {\n\t\t\t\treadonly cancel: (\n\t\t\t\t\tinput: V1NetworkFetchStreamCancelInput,\n\t\t\t\t) => Promise<V1NetworkFetchStreamCancelOutput>;\n\t\t\t\treadonly read: (\n\t\t\t\t\tinput: V1NetworkFetchStreamReadInput,\n\t\t\t\t) => Promise<V1NetworkFetchStreamReadOutput>;\n\t\t\t\treadonly start: (\n\t\t\t\t\tinput: V1NetworkFetchStreamStartInput,\n\t\t\t\t) => Promise<V1NetworkFetchStreamStartOutput>;\n\t\t\t};\n\t\t\treadonly preview: {\n\t\t\t\treadonly create: (\n\t\t\t\t\tinput: V1NetworkPreviewCreateInput,\n\t\t\t\t) => Promise<V1NetworkPreviewCreateOutput>;\n\t\t\t\treadonly expire: (\n\t\t\t\t\tinput: V1NetworkPreviewExpireInput,\n\t\t\t\t) => Promise<V1NetworkPreviewExpireOutput>;\n\t\t\t};\n\t\t};\n\t\treadonly process: {\n\t\t\treadonly get: (input: V1ProcessGetInput) => Promise<V1ProcessGetOutput>;\n\t\t\treadonly list: (\n\t\t\t\tinput: V1ProcessListInput,\n\t\t\t) => Promise<V1ProcessListOutput>;\n\t\t\treadonly output: {\n\t\t\t\treadonly read: (\n\t\t\t\t\tinput: V1ProcessOutputReadInput,\n\t\t\t\t) => Promise<V1ProcessOutputReadOutput>;\n\t\t\t};\n\t\t\treadonly pty: {\n\t\t\t\treadonly resize: (\n\t\t\t\t\tinput: V1ProcessPtyResizeInput,\n\t\t\t\t) => Promise<V1ProcessPtyResizeOutput>;\n\t\t\t};\n\t\t\treadonly run: (input: V1ProcessRunInput) => Promise<V1ProcessRunOutput>;\n\t\t\treadonly signal: (\n\t\t\t\tinput: V1ProcessSignalInput,\n\t\t\t) => Promise<V1ProcessSignalOutput>;\n\t\t\treadonly spawn: (\n\t\t\t\tinput: V1ProcessSpawnInput,\n\t\t\t) => Promise<V1ProcessSpawnOutput>;\n\t\t\treadonly stdin: {\n\t\t\t\treadonly close: (\n\t\t\t\t\tinput: V1ProcessStdinCloseInput,\n\t\t\t\t) => Promise<V1ProcessStdinCloseOutput>;\n\t\t\t\treadonly write: (\n\t\t\t\t\tinput: V1ProcessStdinWriteInput,\n\t\t\t\t) => Promise<V1ProcessStdinWriteOutput>;\n\t\t\t};\n\t\t\treadonly tree: (\n\t\t\t\tinput: V1ProcessTreeInput,\n\t\t\t) => Promise<V1ProcessTreeOutput>;\n\t\t\treadonly wait: (\n\t\t\t\tinput: V1ProcessWaitInput,\n\t\t\t) => Promise<V1ProcessWaitOutput>;\n\t\t};\n\t\treadonly python: {\n\t\t\treadonly evaluate: (\n\t\t\t\tinput: V1PythonEvaluateInput,\n\t\t\t) => Promise<V1PythonEvaluateOutput>;\n\t\t\treadonly execute: (\n\t\t\t\tinput: V1PythonExecuteInput,\n\t\t\t) => Promise<V1PythonExecuteOutput>;\n\t\t\treadonly executeFile: (\n\t\t\t\tinput: V1PythonExecuteFileInput,\n\t\t\t) => Promise<V1PythonExecuteFileOutput>;\n\t\t\treadonly executeModule: (\n\t\t\t\tinput: V1PythonExecuteModuleInput,\n\t\t\t) => Promise<V1PythonExecuteModuleOutput>;\n\t\t\treadonly install: (\n\t\t\t\tinput: V1PythonInstallInput,\n\t\t\t) => Promise<V1PythonInstallOutput>;\n\t\t\treadonly spawn: (\n\t\t\t\tinput: V1PythonSpawnInput,\n\t\t\t) => Promise<V1PythonSpawnOutput>;\n\t\t\treadonly spawnFile: (\n\t\t\t\tinput: V1PythonSpawnFileInput,\n\t\t\t) => Promise<V1PythonSpawnFileOutput>;\n\t\t\treadonly spawnModule: (\n\t\t\t\tinput: V1PythonSpawnModuleInput,\n\t\t\t) => Promise<V1PythonSpawnModuleOutput>;\n\t\t};\n\t\treadonly software: {\n\t\t\treadonly install: (\n\t\t\t\tinput: V1SoftwareInstallInput,\n\t\t\t) => Promise<V1SoftwareInstallOutput>;\n\t\t\treadonly list: (\n\t\t\t\tinput: V1SoftwareListInput,\n\t\t\t) => Promise<V1SoftwareListOutput>;\n\t\t\treadonly uninstall: (\n\t\t\t\tinput: V1SoftwareUninstallInput,\n\t\t\t) => Promise<V1SoftwareUninstallOutput>;\n\t\t};\n\t\treadonly terminal: {\n\t\t\treadonly close: (\n\t\t\t\tinput: V1TerminalCloseInput,\n\t\t\t) => Promise<V1TerminalCloseOutput>;\n\t\t\treadonly list: (\n\t\t\t\tinput: V1TerminalListInput,\n\t\t\t) => Promise<V1TerminalListOutput>;\n\t\t\treadonly open: (\n\t\t\t\tinput: V1TerminalOpenInput,\n\t\t\t) => Promise<V1TerminalOpenOutput>;\n\t\t\treadonly output: {\n\t\t\t\treadonly read: (\n\t\t\t\t\tinput: V1TerminalOutputReadInput,\n\t\t\t\t) => Promise<V1TerminalOutputReadOutput>;\n\t\t\t};\n\t\t\treadonly pty: {\n\t\t\t\treadonly resize: (\n\t\t\t\t\tinput: V1TerminalPtyResizeInput,\n\t\t\t\t) => Promise<V1TerminalPtyResizeOutput>;\n\t\t\t};\n\t\t\treadonly stdin: {\n\t\t\t\treadonly write: (\n\t\t\t\t\tinput: V1TerminalStdinWriteInput,\n\t\t\t\t) => Promise<V1TerminalStdinWriteOutput>;\n\t\t\t};\n\t\t\treadonly wait: (\n\t\t\t\tinput: V1TerminalWaitInput,\n\t\t\t) => Promise<V1TerminalWaitOutput>;\n\t\t};\n\t\treadonly typescript: {\n\t\t\treadonly check: (\n\t\t\t\tinput: V1TypeScriptCheckInput,\n\t\t\t) => Promise<V1TypeScriptCheckOutput>;\n\t\t\treadonly checkProject: (\n\t\t\t\tinput: V1TypeScriptCheckProjectInput,\n\t\t\t) => Promise<V1TypeScriptCheckProjectOutput>;\n\t\t\treadonly evaluate: (\n\t\t\t\tinput: V1TypeScriptEvaluateInput,\n\t\t\t) => Promise<V1TypeScriptEvaluateOutput>;\n\t\t\treadonly execute: (\n\t\t\t\tinput: V1TypeScriptExecuteInput,\n\t\t\t) => Promise<V1TypeScriptExecuteOutput>;\n\t\t\treadonly executeFile: (\n\t\t\t\tinput: V1TypeScriptExecuteFileInput,\n\t\t\t) => Promise<V1TypeScriptExecuteFileOutput>;\n\t\t\treadonly spawn: (\n\t\t\t\tinput: V1TypeScriptSpawnInput,\n\t\t\t) => Promise<V1TypeScriptSpawnOutput>;\n\t\t\treadonly spawnFile: (\n\t\t\t\tinput: V1TypeScriptSpawnFileInput,\n\t\t\t) => Promise<V1TypeScriptSpawnFileOutput>;\n\t\t};\n\t\treadonly vm: {\n\t\t\treadonly restart: (input: V1VmRestartInput) => Promise<V1VmRestartOutput>;\n\t\t\treadonly status: (input: V1VmStatusInput) => Promise<V1VmStatusOutput>;\n\t\t};\n\t};\n}\n\nexport type AgentOsEvents = {\n\treadonly \"vm.booted\": Type<{\n\t\tgeneration: number | bigint;\n\t\tconfigRevision: number | bigint;\n\t\tbootedAtMs: number | bigint;\n\t}>;\n\treadonly \"vm.shutdown\": Type<{\n\t\tgeneration: number | bigint;\n\t\treason: string;\n\t\tshutdownAtMs: number | bigint;\n\t}>;\n\treadonly \"vm.limitWarning\": Type<{\n\t\tlimit: string;\n\t\tobserved: number | bigint;\n\t\tcapacity: number | bigint;\n\t\tmessage: string;\n\t}>;\n\treadonly \"process.output\": Type<{\n\t\tprocess: Output.ActorProcessId;\n\t\tsequence: number | bigint;\n\t\tstream: Output.ProcessStream;\n\t\tdata: Output.FileBytes;\n\t\ttimestampMs: number | bigint;\n\t}>;\n\treadonly \"process.exit\": Type<{\n\t\tprocess: Output.ActorProcessId;\n\t\tstatus: Output.ActorExitStatus;\n\t}>;\n\treadonly \"terminal.output\": Type<{\n\t\tterminal: Output.ActorTerminalId;\n\t\tsequence: number | bigint;\n\t\tstream: Output.ProcessStream;\n\t\tdata: Output.FileBytes;\n\t\ttimestampMs: number | bigint;\n\t}>;\n\treadonly \"terminal.exit\": Type<{\n\t\tterminal: Output.ActorTerminalId;\n\t\tstatus: Output.ActorExitStatus;\n\t}>;\n\treadonly \"cron.fired\": Type<{\n\t\tscheduleName: string;\n\t\tprocess?: Output.ActorProcessId | null;\n\t\terror?: Output.CronLaunchError | null;\n\t\tfiredAtMs: number | bigint;\n\t}>;\n};\n\nexport type AgentOsActorDefinition = BaseActorDefinition<\n\tundefined,\n\tundefined,\n\tundefined,\n\tundefined,\n\tAgentOsActorCreateInput,\n\tundefined,\n\tAgentOsEvents,\n\tRecord<never, never>,\n\tRecord<never, never>\n>;\nexport type AgentOsActorConnection = ActorConn<AgentOsActorDefinition> &\n\tAgentOsActions;\nexport type AgentOsActorHandle = Omit<\n\tActorHandle<AgentOsActorDefinition>,\n\t\"connect\"\n> &\n\tAgentOsActions & {\n\t\tconnect(\n\t\t\tparams?: unknown,\n\t\t\toptions?: ActorConnectOptions,\n\t\t): AgentOsActorConnection;\n\t};\nexport type AgentOsRegistry = Registry<{ agentOS: AgentOsActorDefinition }>;\n\nexport type AgentOsCreateOptions = Omit<CreateOptions, \"input\"> & {\n\tinput?: AgentOsActorCreateInput;\n};\nexport type AgentOsGetOrCreateOptions = Omit<GetOptions, \"createWithInput\"> & {\n\tcreateWithInput?: AgentOsActorCreateInput;\n};\nexport type AgentOsActorAccessor = Omit<\n\tActorAccessor<AgentOsActorDefinition>,\n\t\"create\" | \"getOrCreate\"\n> & {\n\tgetOrCreate(\n\t\tkey?: string | string[],\n\t\toptions?: AgentOsGetOrCreateOptions,\n\t): AgentOsActorHandle;\n\tcreate(\n\t\tkey?: string | string[],\n\t\toptions?: AgentOsCreateOptions,\n\t): Promise<AgentOsActorHandle>;\n};\nexport type AgentOsClient = Omit<\n\tClient<AgentOsRegistry>,\n\t\"agentOS\" | \"getForId\"\n> & {\n\treadonly agentOS: AgentOsActorAccessor;\n\tgetForId(\n\t\tname: \"agentOS\",\n\t\tactorId: string,\n\t\toptions?: GetWithIdOptions,\n\t): AgentOsActorHandle;\n};\n\n/**\n * Creates a vanilla RivetKit client with the generated agentOS contract.\n * Services runs the agentOS actor in the `services` pool, so the client\n * uses that pool unless the config sets `poolName`.\n *\n * The client talks to the engine, whose `/metadata` has no client endpoint to\n * redirect to, so it skips that lookup unless the config sets\n * `disableMetadataLookup: false`. RivetKit retries the lookup forever, which\n * makes every call hang when the endpoint is unreachable. A RivetKit app URL\n * that redirects through `/metadata` needs `disableMetadataLookup: false`.\n */\nexport function createAgentOsClient(\n\tendpointOrConfig?: string | ClientConfigInput,\n): AgentOsClient {\n\tconst config =\n\t\ttypeof endpointOrConfig === \"string\"\n\t\t\t? { endpoint: endpointOrConfig }\n\t\t\t: (endpointOrConfig ?? {});\n\treturn createClient<AgentOsRegistry>({\n\t\tpoolName: \"services\",\n\t\tdisableMetadataLookup: true,\n\t\t...config,\n\t}) as unknown as AgentOsClient;\n}\n"],"mappings":";AAEA,SAAS,oBAAoB;AAYtB,IAAM,sBAAsB;AAC5B,IAAM,yBAAyB;AAC/B,IAAM,wBACZ;AACM,IAAM,uBAAuB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AACO,IAAM,mBAAmB;AAAA,EAC/B,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,cAAc;AAAA,EACd,cAAc;AACf;AAmzFO,SAAS,oBACf,kBACgB;AAChB,QAAM,SACL,OAAO,qBAAqB,WACzB,EAAE,UAAU,iBAAiB,IAC5B,oBAAoB,CAAC;AAC1B,SAAO,aAA8B;AAAA,IACpC,UAAU;AAAA,IACV,uBAAuB;AAAA,IACvB,GAAG;AAAA,EACJ,CAAC;AACF;","names":[]}
|