@rivet-dev/agentos-core 0.0.0-agentos-dylib-plugin.473700e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +204 -0
  2. package/dist/agent-os.d.ts +560 -0
  3. package/dist/agent-os.js +3624 -0
  4. package/dist/agent-session-types.d.ts +67 -0
  5. package/dist/agent-session-types.js +1 -0
  6. package/dist/agents.d.ts +63 -0
  7. package/dist/agents.js +42 -0
  8. package/dist/base-filesystem.d.ts +34 -0
  9. package/dist/base-filesystem.js +173 -0
  10. package/dist/cron/cron-manager.d.ts +22 -0
  11. package/dist/cron/cron-manager.js +160 -0
  12. package/dist/cron/index.d.ts +5 -0
  13. package/dist/cron/index.js +3 -0
  14. package/dist/cron/parse-schedule.d.ts +25 -0
  15. package/dist/cron/parse-schedule.js +66 -0
  16. package/dist/cron/schedule-driver.d.ts +19 -0
  17. package/dist/cron/schedule-driver.js +1 -0
  18. package/dist/cron/timer-driver.d.ts +17 -0
  19. package/dist/cron/timer-driver.js +61 -0
  20. package/dist/cron/types.d.ts +55 -0
  21. package/dist/cron/types.js +1 -0
  22. package/dist/filesystem-snapshot.d.ts +14 -0
  23. package/dist/filesystem-snapshot.js +105 -0
  24. package/dist/host-dir-mount.d.ts +38 -0
  25. package/dist/host-dir-mount.js +34 -0
  26. package/dist/host-tools-zod.d.ts +7 -0
  27. package/dist/host-tools-zod.js +243 -0
  28. package/dist/host-tools.d.ts +45 -0
  29. package/dist/host-tools.js +26 -0
  30. package/dist/index.d.ts +10 -0
  31. package/dist/index.js +10 -0
  32. package/dist/js-bridge.d.ts +3 -0
  33. package/dist/js-bridge.js +2 -0
  34. package/dist/json-rpc.d.ts +50 -0
  35. package/dist/json-rpc.js +22 -0
  36. package/dist/layers.d.ts +51 -0
  37. package/dist/layers.js +185 -0
  38. package/dist/overlay-filesystem.d.ts +19 -0
  39. package/dist/overlay-filesystem.js +645 -0
  40. package/dist/packages.d.ts +127 -0
  41. package/dist/packages.js +335 -0
  42. package/dist/runtime-compat.d.ts +471 -0
  43. package/dist/runtime-compat.js +2009 -0
  44. package/dist/runtime.d.ts +336 -0
  45. package/dist/runtime.js +1 -0
  46. package/dist/sidecar/agent-os-protocol.d.ts +219 -0
  47. package/dist/sidecar/agent-os-protocol.js +594 -0
  48. package/dist/sidecar/binary.d.ts +9 -0
  49. package/dist/sidecar/binary.js +30 -0
  50. package/dist/sidecar/cargo.d.ts +2 -0
  51. package/dist/sidecar/cargo.js +142 -0
  52. package/dist/sidecar/native-process-client.d.ts +2 -0
  53. package/dist/sidecar/native-process-client.js +1 -0
  54. package/dist/sidecar/permissions.d.ts +3 -0
  55. package/dist/sidecar/permissions.js +54 -0
  56. package/dist/sidecar/process.d.ts +6 -0
  57. package/dist/sidecar/process.js +8 -0
  58. package/dist/sidecar/rpc-client.d.ts +244 -0
  59. package/dist/sidecar/rpc-client.js +2028 -0
  60. package/dist/test/docker.d.ts +133 -0
  61. package/dist/test/docker.js +336 -0
  62. package/dist/test/file-system.d.ts +39 -0
  63. package/dist/test/file-system.js +562 -0
  64. package/dist/test/mock-s3.d.ts +42 -0
  65. package/dist/test/mock-s3.js +292 -0
  66. package/dist/test/runtime.d.ts +11 -0
  67. package/dist/test/runtime.js +9 -0
  68. package/dist/test/sandbox-agent.d.ts +9 -0
  69. package/dist/test/sandbox-agent.js +395 -0
  70. package/dist/test/terminal-harness.d.ts +27 -0
  71. package/dist/test/terminal-harness.js +122 -0
  72. package/dist/types.d.ts +10 -0
  73. package/dist/types.js +1 -0
  74. package/fixtures/AGENTOS_SYSTEM_PROMPT.md +21 -0
  75. package/package.json +111 -0
@@ -0,0 +1,142 @@
1
+ import { accessSync, constants as fsConstants, existsSync, readFileSync, readdirSync, statSync } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import path from "node:path";
4
+ const CARGO_BINARY_NAME = process.platform === "win32" ? "cargo.exe" : "cargo";
5
+ function hasPathSeparator(candidate) {
6
+ return candidate.includes("/") || candidate.includes("\\");
7
+ }
8
+ function isExecutableFile(candidate) {
9
+ try {
10
+ if (!statSync(candidate).isFile()) {
11
+ return false;
12
+ }
13
+ accessSync(candidate, fsConstants.X_OK);
14
+ return true;
15
+ }
16
+ catch {
17
+ return false;
18
+ }
19
+ }
20
+ function resolveExecutableOnPath(binaryName) {
21
+ const pathEntries = (process.env.PATH ?? "")
22
+ .split(path.delimiter)
23
+ .map((entry) => entry.trim())
24
+ .filter(Boolean);
25
+ for (const entry of pathEntries) {
26
+ const candidate = path.join(entry, binaryName);
27
+ if (isExecutableFile(candidate)) {
28
+ return candidate;
29
+ }
30
+ }
31
+ return null;
32
+ }
33
+ function resolveExecutableCandidate(candidate) {
34
+ if (hasPathSeparator(candidate)) {
35
+ return isExecutableFile(candidate) ? candidate : null;
36
+ }
37
+ return resolveExecutableOnPath(candidate);
38
+ }
39
+ function getToolchainCargoFromRustupHome(rustupHome) {
40
+ const toolchainsDir = path.join(rustupHome, "toolchains");
41
+ if (!existsSync(toolchainsDir)) {
42
+ return null;
43
+ }
44
+ const settingsPath = path.join(rustupHome, "settings.toml");
45
+ const orderedToolchains = [];
46
+ if (existsSync(settingsPath)) {
47
+ const defaultToolchain = readFileSync(settingsPath, "utf8")
48
+ .match(/^default_toolchain\s*=\s*"([^"]+)"/m)?.[1]
49
+ ?.trim();
50
+ if (defaultToolchain) {
51
+ orderedToolchains.push(defaultToolchain);
52
+ }
53
+ }
54
+ for (const entry of readdirSync(toolchainsDir)) {
55
+ if (!orderedToolchains.includes(entry)) {
56
+ orderedToolchains.push(entry);
57
+ }
58
+ }
59
+ for (const toolchain of orderedToolchains) {
60
+ const cargoPath = path.join(toolchainsDir, toolchain, "bin", CARGO_BINARY_NAME);
61
+ if (existsSync(cargoPath)) {
62
+ return { cargoPath, rustupHome };
63
+ }
64
+ }
65
+ return null;
66
+ }
67
+ function inferRustupHomesFromPath() {
68
+ const rustupHomes = new Set();
69
+ const pathEntries = (process.env.PATH ?? "")
70
+ .split(path.delimiter)
71
+ .map((entry) => entry.trim())
72
+ .filter(Boolean);
73
+ for (const entry of pathEntries) {
74
+ if (path.basename(entry) !== "bin") {
75
+ continue;
76
+ }
77
+ const parentDir = path.dirname(entry);
78
+ if (existsSync(path.join(parentDir, "toolchains"))) {
79
+ rustupHomes.add(parentDir);
80
+ }
81
+ const siblingRoot = path.dirname(parentDir);
82
+ try {
83
+ for (const sibling of readdirSync(siblingRoot, { withFileTypes: true })) {
84
+ if (!sibling.isDirectory()) {
85
+ continue;
86
+ }
87
+ const siblingPath = path.join(siblingRoot, sibling.name);
88
+ if (existsSync(path.join(siblingPath, "toolchains"))) {
89
+ rustupHomes.add(siblingPath);
90
+ }
91
+ }
92
+ }
93
+ catch { }
94
+ }
95
+ return [...rustupHomes];
96
+ }
97
+ function ensureToolchainEnvironment(toolchainCargo) {
98
+ const toolchainBin = path.dirname(toolchainCargo.cargoPath);
99
+ const currentPathEntries = (process.env.PATH ?? "")
100
+ .split(path.delimiter)
101
+ .filter(Boolean);
102
+ if (!currentPathEntries.includes(toolchainBin)) {
103
+ process.env.PATH = [toolchainBin, ...currentPathEntries].join(path.delimiter);
104
+ }
105
+ if (!process.env.RUSTUP_HOME) {
106
+ process.env.RUSTUP_HOME = toolchainCargo.rustupHome;
107
+ }
108
+ const toolchainName = path.basename(path.dirname(toolchainBin));
109
+ if (!process.env.RUSTUP_TOOLCHAIN) {
110
+ process.env.RUSTUP_TOOLCHAIN = toolchainName;
111
+ }
112
+ }
113
+ export function findCargoBinary() {
114
+ const explicitCargo = process.env.CARGO?.trim();
115
+ const rustupHomes = [
116
+ process.env.RUSTUP_HOME?.trim(),
117
+ path.join(homedir(), ".rustup"),
118
+ ...inferRustupHomesFromPath(),
119
+ ].filter((candidate) => Boolean(candidate));
120
+ const toolchainCargoCandidates = rustupHomes
121
+ .map((rustupHome) => getToolchainCargoFromRustupHome(rustupHome))
122
+ .filter((candidate) => Boolean(candidate));
123
+ if (toolchainCargoCandidates.length > 0) {
124
+ ensureToolchainEnvironment(toolchainCargoCandidates[0]);
125
+ }
126
+ const candidates = [
127
+ explicitCargo,
128
+ ...toolchainCargoCandidates.map((candidate) => candidate.cargoPath),
129
+ path.join(homedir(), ".cargo", "bin", CARGO_BINARY_NAME),
130
+ CARGO_BINARY_NAME,
131
+ ].filter((candidate) => Boolean(candidate));
132
+ for (const candidate of candidates) {
133
+ const resolved = resolveExecutableCandidate(candidate);
134
+ if (resolved) {
135
+ return resolved;
136
+ }
137
+ }
138
+ return null;
139
+ }
140
+ export function resolveCargoBinary() {
141
+ return findCargoBinary() ?? CARGO_BINARY_NAME;
142
+ }
@@ -0,0 +1,2 @@
1
+ export { NATIVE_SIDECAR_FRAME_TIMEOUT_MS, NativeSidecarProcessClient as SidecarProcess, SidecarEventBufferOverflow, SidecarProcessError, SidecarProcessExited, } from "@secure-exec/core/sidecar-client";
2
+ export type { AuthenticatedSession, CreatedVm, ExtEnvelope, GuestFilesystemStat, NativeSidecarSpawnOptions as SidecarSpawnOptions, RootFilesystemEntry, RootFilesystemLowerDescriptor, SidecarEventSelector, SidecarFsPermissionRule, SidecarMountDescriptor, SidecarMountPluginDescriptor, SidecarPatternPermissionRule, SidecarPermissionMode, SidecarPermissionScope, SidecarPermissionsPolicy, SidecarProcessSnapshotEntry, SidecarProjectedModuleDescriptor, SidecarRegisteredHostCallbackDefinition, SidecarRegisteredHostCallbackExample, SidecarRequestFrame, SidecarRequestHandler, SidecarRequestPayload, SidecarResponseFrame, SidecarResponsePayload, SidecarRulePermissions, SidecarSessionState, SidecarSignalHandlerRegistration, SidecarSignalState, SidecarSocketStateEntry, SidecarSoftwareDescriptor, SidecarZombieTimerCount, } from "@secure-exec/core/sidecar-client";
@@ -0,0 +1 @@
1
+ export { NATIVE_SIDECAR_FRAME_TIMEOUT_MS, NativeSidecarProcessClient as SidecarProcess, SidecarEventBufferOverflow, SidecarProcessError, SidecarProcessExited, } from "@secure-exec/core/sidecar-client";
@@ -0,0 +1,3 @@
1
+ import type { PermissionsPolicy } from "@secure-exec/core/vm-config";
2
+ import type { Permissions } from "../runtime-compat.js";
3
+ export declare function serializePermissionsForSidecar(permissions?: Permissions): PermissionsPolicy;
@@ -0,0 +1,54 @@
1
+ const ALL_OPERATIONS = ["*"];
2
+ const ALL_RESOURCES = ["**"];
3
+ function serializeFilesystemScope(scope) {
4
+ return {
5
+ ...(scope.default === undefined ? {} : { default: scope.default }),
6
+ rules: scope.rules.map((rule) => ({
7
+ ...rule,
8
+ operations: rule.operations ?? ALL_OPERATIONS,
9
+ paths: rule.paths ?? ALL_RESOURCES,
10
+ })),
11
+ };
12
+ }
13
+ function serializePatternScope(scope) {
14
+ return {
15
+ ...(scope.default === undefined ? {} : { default: scope.default }),
16
+ rules: scope.rules.map((rule) => ({
17
+ ...rule,
18
+ operations: rule.operations ?? ALL_OPERATIONS,
19
+ patterns: rule.patterns ?? ALL_RESOURCES,
20
+ })),
21
+ };
22
+ }
23
+ export function serializePermissionsForSidecar(permissions) {
24
+ if (!permissions) {
25
+ return {
26
+ fs: "deny",
27
+ network: "deny",
28
+ childProcess: "deny",
29
+ process: "deny",
30
+ env: "deny",
31
+ tool: "deny",
32
+ };
33
+ }
34
+ return {
35
+ fs: typeof permissions.fs === "string" || !permissions.fs
36
+ ? permissions.fs
37
+ : serializeFilesystemScope(permissions.fs),
38
+ network: typeof permissions.network === "string" || !permissions.network
39
+ ? permissions.network
40
+ : serializePatternScope(permissions.network),
41
+ childProcess: typeof permissions.childProcess === "string" || !permissions.childProcess
42
+ ? permissions.childProcess
43
+ : serializePatternScope(permissions.childProcess),
44
+ process: typeof permissions.process === "string" || !permissions.process
45
+ ? permissions.process
46
+ : serializePatternScope(permissions.process),
47
+ env: typeof permissions.env === "string" || !permissions.env
48
+ ? permissions.env
49
+ : serializePatternScope(permissions.env),
50
+ tool: typeof permissions.tool === "string" || !permissions.tool
51
+ ? permissions.tool
52
+ : serializePatternScope(permissions.tool),
53
+ };
54
+ }
@@ -0,0 +1,6 @@
1
+ import { SidecarProcess, type SidecarSpawnOptions } from "./native-process-client.js";
2
+ export interface AgentOsSidecarProcessHandle {
3
+ client: SidecarProcess;
4
+ dispose(): Promise<void>;
5
+ }
6
+ export declare function spawnAgentOsSidecar(options: SidecarSpawnOptions): AgentOsSidecarProcessHandle;
@@ -0,0 +1,8 @@
1
+ import { SidecarProcess, } from "./native-process-client.js";
2
+ export function spawnAgentOsSidecar(options) {
3
+ const client = SidecarProcess.spawn(options);
4
+ return {
5
+ client,
6
+ dispose: () => client.dispose(),
7
+ };
8
+ }
@@ -0,0 +1,244 @@
1
+ import type { RootFilesystemConfig as VmConfigRootFilesystemConfig, RootFilesystemEntry as VmConfigRootFilesystemEntry, RootFilesystemLowerDescriptor as VmConfigRootFilesystemLowerDescriptor } from "@secure-exec/core/vm-config";
2
+ import type { NativeMountConfig, PlainMountConfig, RootFilesystemConfig } from "../agent-os.js";
3
+ import type { RootSnapshotExport } from "../layers.js";
4
+ import type { ConnectTerminalOptions, KernelExecOptions, KernelExecResult, KernelSpawnOptions, ManagedProcess, OpenShellOptions, ProcessInfo, ShellHandle, VirtualFileSystem, VirtualStat } from "../runtime-compat.js";
5
+ import type { AuthenticatedSession, CreatedVm, SidecarProcess, SidecarSignalHandlerRegistration } from "./native-process-client.js";
6
+ export declare function toSidecarSignalName(signal: number): string;
7
+ export interface LocalCompatMount {
8
+ path: string;
9
+ fs: VirtualFileSystem;
10
+ readOnly: boolean;
11
+ }
12
+ interface KernelSocketSnapshot {
13
+ processId: string;
14
+ host?: string;
15
+ port?: number;
16
+ path?: string;
17
+ }
18
+ interface KernelSignalState {
19
+ handlers: Map<number, {
20
+ action: SidecarSignalHandlerRegistration["action"];
21
+ mask: Set<number>;
22
+ flags: number;
23
+ }>;
24
+ }
25
+ interface NativeSidecarKernelProxyOptions {
26
+ client: SidecarProcess;
27
+ session: AuthenticatedSession;
28
+ vm: CreatedVm;
29
+ env: Record<string, string>;
30
+ cwd: string;
31
+ defaultExecCwd?: string;
32
+ localMounts: LocalCompatMount[];
33
+ commandGuestPaths: ReadonlyMap<string, string>;
34
+ onWasmCommandResolved?: (command: string) => void;
35
+ onDispose?: () => Promise<void>;
36
+ }
37
+ export declare class NativeSidecarKernelProxy {
38
+ readonly env: Record<string, string>;
39
+ readonly cwd: string;
40
+ readonly commands: ReadonlyMap<string, string>;
41
+ readonly vfs: VirtualFileSystem;
42
+ readonly processes: Map<number, ProcessInfo>;
43
+ private readonly defaultExecCwd;
44
+ private readonly client;
45
+ private readonly session;
46
+ private readonly vm;
47
+ private readonly localMounts;
48
+ private readonly commandDrivers;
49
+ private readonly onWasmCommandResolved;
50
+ private readonly onDispose;
51
+ private readonly trackedProcesses;
52
+ private readonly trackedProcessesById;
53
+ private readonly listenerLookups;
54
+ private readonly boundUdpLookups;
55
+ private readonly signalStates;
56
+ private readonly signalRefreshes;
57
+ private sidecarProcessSnapshot;
58
+ private processSnapshotRefresh;
59
+ private readonly observedProcessStartTimes;
60
+ private readonly rootView;
61
+ private zombieTimerCountValue;
62
+ private zombieTimerCountRefresh;
63
+ private disposed;
64
+ private pumpError;
65
+ private nextSyntheticPid;
66
+ private readonly eventPumpAbortController;
67
+ private readonly eventPump;
68
+ constructor(options: NativeSidecarKernelProxyOptions);
69
+ createRootView(): VirtualFileSystem;
70
+ get zombieTimerCount(): number;
71
+ registerCommandGuestPaths(commandGuestPaths: ReadonlyMap<string, string>): void;
72
+ dispose(): Promise<void>;
73
+ exec(command: string, options?: KernelExecOptions): Promise<KernelExecResult>;
74
+ spawn(command: string, args: string[], options?: KernelSpawnOptions): ManagedProcess;
75
+ openShell(options?: OpenShellOptions): ShellHandle;
76
+ connectTerminal(options?: ConnectTerminalOptions): Promise<number>;
77
+ readFile(path: string): Promise<Uint8Array>;
78
+ writeFile(path: string, content: string | Uint8Array): Promise<void>;
79
+ mkdir(path: string, recursive?: boolean): Promise<void>;
80
+ exists(path: string): Promise<boolean>;
81
+ stat(path: string): Promise<VirtualStat>;
82
+ readdir(path: string): Promise<string[]>;
83
+ removeFile(path: string): Promise<void>;
84
+ removeDir(path: string): Promise<void>;
85
+ rename(oldPath: string, newPath: string): Promise<void>;
86
+ mountFs(path: string, driver: VirtualFileSystem, options?: {
87
+ readOnly?: boolean;
88
+ }): void;
89
+ unmountFs(path: string): void;
90
+ snapshotProcesses(): ProcessInfo[];
91
+ findListener(request: {
92
+ host?: string;
93
+ port?: number;
94
+ path?: string;
95
+ }): KernelSocketSnapshot | null;
96
+ findBoundUdp(request: {
97
+ host?: string;
98
+ port?: number;
99
+ }): KernelSocketSnapshot | null;
100
+ getSignalState(pid: number): KernelSignalState;
101
+ private refreshSocketLookup;
102
+ private refreshSignalState;
103
+ private refreshProcessSnapshot;
104
+ private refreshZombieTimerCount;
105
+ private drainTrailingProcessOutput;
106
+ private startTrackedProcess;
107
+ private runEventPump;
108
+ private finishProcess;
109
+ private waitForTrackedProcess;
110
+ private signalProcess;
111
+ private flushPendingStdin;
112
+ private closeTrackedStdin;
113
+ private handleBackgroundProcessError;
114
+ private recordCompletedProcessError;
115
+ private emitBackgroundProcessError;
116
+ private createFilesystemView;
117
+ private buildProcessSnapshot;
118
+ private dispatchRead;
119
+ private dispatchNativeRead;
120
+ private dispatchWrite;
121
+ private resolveLocalMount;
122
+ private assertGuestPathWritable;
123
+ private mountedChildNames;
124
+ private assertLocalWritable;
125
+ private updateTrackedProcessSnapshot;
126
+ }
127
+ export type { AuthenticatedSession, CreatedVm, GuestFilesystemStat, SidecarSpawnOptions, RootFilesystemEntry, SidecarEventSelector, SidecarPermissionsPolicy, SidecarRegisteredHostCallbackDefinition, SidecarRequestFrame, SidecarResponsePayload, SidecarSessionState, SidecarSignalHandlerRegistration, SidecarSocketStateEntry, } from "./native-process-client.js";
128
+ export { NATIVE_SIDECAR_FRAME_TIMEOUT_MS, SidecarProcess, SidecarEventBufferOverflow, SidecarProcessError, SidecarProcessExited, } from "./native-process-client.js";
129
+ export type AgentOsSidecarPlacement = {
130
+ kind: "shared";
131
+ pool?: string;
132
+ } | {
133
+ kind: "explicit";
134
+ sidecarId: string;
135
+ };
136
+ export type AgentOsSidecarSessionState = "connecting" | "ready" | "disposing" | "disposed" | "failed";
137
+ export type AgentOsSidecarVmState = "creating" | "ready" | "disposing" | "disposed" | "failed";
138
+ export interface AgentOsSidecarSessionLifecycle {
139
+ sessionId: string;
140
+ placement: AgentOsSidecarPlacement;
141
+ state: AgentOsSidecarSessionState;
142
+ createdAt: number;
143
+ connectedAt?: number;
144
+ disposedAt?: number;
145
+ lastError?: string;
146
+ metadata: Record<string, string>;
147
+ vmIds: string[];
148
+ }
149
+ export interface AgentOsSidecarVmLifecycle {
150
+ vmId: string;
151
+ sessionId: string;
152
+ state: AgentOsSidecarVmState;
153
+ createdAt: number;
154
+ readyAt?: number;
155
+ disposedAt?: number;
156
+ lastError?: string;
157
+ metadata: Record<string, string>;
158
+ }
159
+ export interface AgentOsSidecarSessionOptions {
160
+ placement?: AgentOsSidecarPlacement;
161
+ metadata?: Record<string, string>;
162
+ signal?: AbortSignal;
163
+ }
164
+ export interface AgentOsSidecarVmOptions {
165
+ metadata?: Record<string, string>;
166
+ }
167
+ export interface AgentOsSidecarSessionBootstrap {
168
+ sessionId: string;
169
+ placement: AgentOsSidecarPlacement;
170
+ metadata: Record<string, string>;
171
+ signal?: AbortSignal;
172
+ }
173
+ export interface AgentOsSidecarVmBootstrap {
174
+ vmId: string;
175
+ sessionId: string;
176
+ metadata: Record<string, string>;
177
+ }
178
+ export interface AgentOsSidecarTransport {
179
+ createVm?(bootstrap: AgentOsSidecarVmBootstrap): Promise<void>;
180
+ disposeVm?(vmId: string): Promise<void>;
181
+ dispose(): Promise<void>;
182
+ }
183
+ export interface AgentOsSidecarClientOptions {
184
+ createSessionTransport(bootstrap: AgentOsSidecarSessionBootstrap): Promise<AgentOsSidecarTransport>;
185
+ createId?: () => string;
186
+ now?: () => number;
187
+ }
188
+ export declare class AgentOsSidecarVmHandle {
189
+ private readonly client;
190
+ readonly sessionId: string;
191
+ readonly vmId: string;
192
+ constructor(client: AgentOsSidecarClient, sessionId: string, vmId: string);
193
+ describe(): AgentOsSidecarVmLifecycle;
194
+ dispose(): Promise<void>;
195
+ }
196
+ export declare class AgentOsSidecarSessionHandle {
197
+ private readonly client;
198
+ readonly sessionId: string;
199
+ constructor(client: AgentOsSidecarClient, sessionId: string);
200
+ describe(): AgentOsSidecarSessionLifecycle;
201
+ listVms(): AgentOsSidecarVmLifecycle[];
202
+ createVm(options?: AgentOsSidecarVmOptions): Promise<AgentOsSidecarVmHandle>;
203
+ dispose(): Promise<void>;
204
+ }
205
+ export declare class AgentOsSidecarClient {
206
+ private readonly createSessionTransport;
207
+ private readonly createId;
208
+ private readonly now;
209
+ private readonly sessions;
210
+ private disposed;
211
+ constructor(options: AgentOsSidecarClientOptions);
212
+ createSession(options?: AgentOsSidecarSessionOptions): Promise<AgentOsSidecarSessionHandle>;
213
+ listSessions(): AgentOsSidecarSessionLifecycle[];
214
+ requireSessionLifecycle(sessionId: string): AgentOsSidecarSessionLifecycle;
215
+ listVms(sessionId: string): AgentOsSidecarVmLifecycle[];
216
+ requireVmLifecycle(sessionId: string, vmId: string): AgentOsSidecarVmLifecycle;
217
+ createVm(sessionId: string, options?: AgentOsSidecarVmOptions): Promise<AgentOsSidecarVmHandle>;
218
+ disposeVm(sessionId: string, vmId: string): Promise<void>;
219
+ disposeSession(sessionId: string): Promise<void>;
220
+ dispose(): Promise<void>;
221
+ private disposeVmEntry;
222
+ private getSessionEntry;
223
+ private getVmEntry;
224
+ private assertActive;
225
+ }
226
+ export declare function createAgentOsSidecarClient(options: AgentOsSidecarClientOptions): AgentOsSidecarClient;
227
+ export type MountConfigJsonValue = string | number | boolean | null | MountConfigJsonObject | MountConfigJsonValue[];
228
+ export interface MountConfigJsonObject {
229
+ [key: string]: MountConfigJsonValue;
230
+ }
231
+ export interface SidecarMountPluginDescriptor {
232
+ id: string;
233
+ config: MountConfigJsonObject;
234
+ }
235
+ export interface SidecarMountDescriptor {
236
+ guestPath: string;
237
+ readOnly: boolean;
238
+ plugin: SidecarMountPluginDescriptor;
239
+ }
240
+ export declare function serializeMountConfigForSidecar(mount: PlainMountConfig | NativeMountConfig): SidecarMountDescriptor;
241
+ export type SidecarRootFilesystemDescriptor = VmConfigRootFilesystemConfig;
242
+ export type SidecarRootFilesystemLowerDescriptor = VmConfigRootFilesystemLowerDescriptor;
243
+ export type SidecarRootFilesystemEntry = VmConfigRootFilesystemEntry;
244
+ export declare function serializeRootFilesystemForSidecar(config?: RootFilesystemConfig, bootstrapLower?: RootSnapshotExport | null): SidecarRootFilesystemDescriptor;