@rivet-dev/agentos-core 0.2.7 → 0.2.8-rc.1
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/dist/agent-os.d.ts +8 -2
- package/dist/agent-os.js +21 -6
- package/dist/runtime-compat.d.ts +5 -2
- package/dist/runtime-compat.js +4 -4
- package/dist/runtime.d.ts +5 -2
- package/dist/sidecar/native-process-client.d.ts +1 -1
- package/dist/sidecar/native-process-client.js +1 -1
- package/dist/sidecar/rpc-client.d.ts +25 -3
- package/dist/sidecar/rpc-client.js +53 -12
- package/package.json +14 -14
package/dist/agent-os.d.ts
CHANGED
|
@@ -499,10 +499,16 @@ export declare class AgentOs {
|
|
|
499
499
|
stat(path: string): Promise<VirtualStat>;
|
|
500
500
|
exists(path: string): Promise<boolean>;
|
|
501
501
|
snapshotRootFilesystem(): Promise<RootSnapshotExport>;
|
|
502
|
+
/**
|
|
503
|
+
* Mount a filesystem into the running VM. Resolves once the mount has been
|
|
504
|
+
* delivered to the native sidecar, so guest code can use it immediately
|
|
505
|
+
* after the returned promise settles; a delivery failure rejects instead of
|
|
506
|
+
* leaving the mount silently host-only.
|
|
507
|
+
*/
|
|
502
508
|
mountFs(path: string, driver: VirtualFileSystem, options?: {
|
|
503
509
|
readOnly?: boolean;
|
|
504
|
-
}): void
|
|
505
|
-
unmountFs(path: string): void
|
|
510
|
+
}): Promise<void>;
|
|
511
|
+
unmountFs(path: string): Promise<void>;
|
|
506
512
|
move(from: string, to: string): Promise<void>;
|
|
507
513
|
delete(path: string, options?: {
|
|
508
514
|
recursive?: boolean;
|
package/dist/agent-os.js
CHANGED
|
@@ -43,7 +43,7 @@ import { resolveDefaultSoftware } from "./default-software.js";
|
|
|
43
43
|
import { allowAll } from "./runtime-compat.js";
|
|
44
44
|
import { AcpRuntimeKind, decodeAcpCallback, decodeAcpEvent, decodeAcpResponse, encodeAcpCallbackResponse, encodeAcpRequest, } from "./sidecar/agentos-protocol.js";
|
|
45
45
|
import { serializePermissionsForSidecar } from "./sidecar/permissions.js";
|
|
46
|
-
import { createAgentOsSidecarClient,
|
|
46
|
+
import { createAgentOsSidecarClient, NativeSidecarKernelProxy, SidecarProcess, serializeRootFilesystemForSidecar, } from "./sidecar/rpc-client.js";
|
|
47
47
|
function defaultAgentStderrHandler(event) {
|
|
48
48
|
process.stderr.write(event.chunk);
|
|
49
49
|
}
|
|
@@ -1600,6 +1600,12 @@ export class AgentOs {
|
|
|
1600
1600
|
permissions: sidecarPermissions,
|
|
1601
1601
|
commandPermissions: {},
|
|
1602
1602
|
loopbackExemptPorts: options?.loopbackExemptPorts,
|
|
1603
|
+
// Retained for runtime mount reconfigures: `configure_vm` is
|
|
1604
|
+
// replace-on-write for the whole payload, so post-boot mountFs
|
|
1605
|
+
// must resend the boot packages and tool shims.
|
|
1606
|
+
packages: sidecarPackages,
|
|
1607
|
+
packagesMountAt: OPT_AGENTOS_ROOT,
|
|
1608
|
+
toolShimCommands: toolBootstrapCommands,
|
|
1603
1609
|
commandGuestPaths,
|
|
1604
1610
|
onDispose: cleanup,
|
|
1605
1611
|
// The native process is owned by the AgentOsSidecar handle and
|
|
@@ -1920,13 +1926,19 @@ export class AgentOs {
|
|
|
1920
1926
|
}
|
|
1921
1927
|
return createSnapshotExport(await snapshotVirtualFilesystem(this._rootFilesystem));
|
|
1922
1928
|
}
|
|
1923
|
-
|
|
1929
|
+
/**
|
|
1930
|
+
* Mount a filesystem into the running VM. Resolves once the mount has been
|
|
1931
|
+
* delivered to the native sidecar, so guest code can use it immediately
|
|
1932
|
+
* after the returned promise settles; a delivery failure rejects instead of
|
|
1933
|
+
* leaving the mount silently host-only.
|
|
1934
|
+
*/
|
|
1935
|
+
async mountFs(path, driver, options) {
|
|
1924
1936
|
this._assertSafeAbsolutePath(path);
|
|
1925
|
-
this.#kernel.mountFs(path, driver, { readOnly: options?.readOnly });
|
|
1937
|
+
await this.#kernel.mountFs(path, driver, { readOnly: options?.readOnly });
|
|
1926
1938
|
}
|
|
1927
|
-
unmountFs(path) {
|
|
1939
|
+
async unmountFs(path) {
|
|
1928
1940
|
this._assertSafeAbsolutePath(path);
|
|
1929
|
-
this.#kernel.unmountFs(path);
|
|
1941
|
+
await this.#kernel.unmountFs(path);
|
|
1930
1942
|
}
|
|
1931
1943
|
async move(from, to) {
|
|
1932
1944
|
this._assertWritableAbsolutePath(from);
|
|
@@ -2174,6 +2186,10 @@ export class AgentOs {
|
|
|
2174
2186
|
command.name,
|
|
2175
2187
|
command.guestPath,
|
|
2176
2188
|
])));
|
|
2189
|
+
// Retain the linked package for runtime mount reconfigures:
|
|
2190
|
+
// `configure_vm` is replace-on-write, so a later `mountFs` that
|
|
2191
|
+
// resent only the boot packages would unproject this one.
|
|
2192
|
+
this.#kernel.registerLinkedPackage({ path: ref.path });
|
|
2177
2193
|
}
|
|
2178
2194
|
// The client parses no manifests: an `agent` block in the linked package is
|
|
2179
2195
|
// picked up by the sidecar (it owns the projected `/opt/agentos` and answers
|
|
@@ -3621,7 +3637,6 @@ function ensureSharedSidecarNativeProcess(sidecar) {
|
|
|
3621
3637
|
cwd: REPO_ROOT,
|
|
3622
3638
|
command: ensureNativeSidecarBinary(),
|
|
3623
3639
|
args: [],
|
|
3624
|
-
frameTimeoutMs: NATIVE_SIDECAR_FRAME_TIMEOUT_MS,
|
|
3625
3640
|
});
|
|
3626
3641
|
// Track the child immediately — BEFORE the handshake await — so a
|
|
3627
3642
|
// failed `authenticateAndOpenSession()` can still reap it (otherwise
|
package/dist/runtime-compat.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export interface VirtualDirEntry {
|
|
|
16
16
|
export interface VirtualStat {
|
|
17
17
|
mode: number;
|
|
18
18
|
size: number;
|
|
19
|
+
sizeExact?: bigint;
|
|
19
20
|
blocks: number;
|
|
20
21
|
dev: number;
|
|
21
22
|
rdev: number;
|
|
@@ -26,7 +27,9 @@ export interface VirtualStat {
|
|
|
26
27
|
ctimeMs: number;
|
|
27
28
|
birthtimeMs: number;
|
|
28
29
|
ino: number;
|
|
30
|
+
inoExact?: bigint;
|
|
29
31
|
nlink: number;
|
|
32
|
+
nlinkExact?: bigint;
|
|
30
33
|
uid: number;
|
|
31
34
|
gid: number;
|
|
32
35
|
}
|
|
@@ -281,8 +284,8 @@ export interface Kernel extends KernelInterface {
|
|
|
281
284
|
connectTerminal(options?: ConnectTerminalOptions): Promise<number>;
|
|
282
285
|
mountFs(path: string, fs: VirtualFileSystem, options?: {
|
|
283
286
|
readOnly?: boolean;
|
|
284
|
-
}): void
|
|
285
|
-
unmountFs(path: string): void
|
|
287
|
+
}): void | Promise<void>;
|
|
288
|
+
unmountFs(path: string): void | Promise<void>;
|
|
286
289
|
readFile(path: string): Promise<Uint8Array>;
|
|
287
290
|
writeFile(path: string, content: string | Uint8Array): Promise<void>;
|
|
288
291
|
mkdir(path: string): Promise<void>;
|
package/dist/runtime-compat.js
CHANGED
|
@@ -7,7 +7,7 @@ import { fileURLToPath } from "node:url";
|
|
|
7
7
|
import { resolvePublishedSidecarBinary } from "./sidecar/binary.js";
|
|
8
8
|
import { findCargoBinary, resolveCargoBinary } from "./sidecar/cargo.js";
|
|
9
9
|
import { serializePermissionsForSidecar } from "./sidecar/permissions.js";
|
|
10
|
-
import {
|
|
10
|
+
import { NativeSidecarKernelProxy, SidecarProcess, serializeMountConfigForSidecar, } from "./sidecar/rpc-client.js";
|
|
11
11
|
export const AF_INET = 2;
|
|
12
12
|
export const AF_UNIX = 1;
|
|
13
13
|
export const SOCK_STREAM = 1;
|
|
@@ -1804,9 +1804,10 @@ class NativeKernel {
|
|
|
1804
1804
|
this.pendingLocalMounts.unshift(localMount);
|
|
1805
1805
|
this.pendingLocalMounts.sort((left, right) => right.path.length - left.path.length);
|
|
1806
1806
|
if (!this.proxy) {
|
|
1807
|
+
// Pre-boot mounts apply during kernel initialization.
|
|
1807
1808
|
return;
|
|
1808
1809
|
}
|
|
1809
|
-
this.proxy.mountFs(mountPath, filesystem, {
|
|
1810
|
+
return this.proxy.mountFs(mountPath, filesystem, {
|
|
1810
1811
|
readOnly: localMount.readOnly,
|
|
1811
1812
|
sidecarMount: localMount.sidecarMount,
|
|
1812
1813
|
});
|
|
@@ -1817,7 +1818,7 @@ class NativeKernel {
|
|
|
1817
1818
|
if (pendingIndex >= 0) {
|
|
1818
1819
|
this.pendingLocalMounts.splice(pendingIndex, 1);
|
|
1819
1820
|
}
|
|
1820
|
-
this.proxy?.unmountFs(mountPath);
|
|
1821
|
+
return this.proxy?.unmountFs(mountPath);
|
|
1821
1822
|
}
|
|
1822
1823
|
async readFile(targetPath) {
|
|
1823
1824
|
await this.ensureReady();
|
|
@@ -1917,7 +1918,6 @@ class NativeKernel {
|
|
|
1917
1918
|
cwd: REPO_ROOT,
|
|
1918
1919
|
command: ensureNativeSidecarBinary(),
|
|
1919
1920
|
args: [],
|
|
1920
|
-
frameTimeoutMs: NATIVE_SIDECAR_FRAME_TIMEOUT_MS,
|
|
1921
1921
|
});
|
|
1922
1922
|
const session = await client.authenticateAndOpenSession();
|
|
1923
1923
|
const createVmConfig = {
|
package/dist/runtime.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface VirtualDirEntry {
|
|
|
10
10
|
export interface VirtualStat {
|
|
11
11
|
mode: number;
|
|
12
12
|
size: number;
|
|
13
|
+
sizeExact?: bigint;
|
|
13
14
|
blocks: number;
|
|
14
15
|
dev: number;
|
|
15
16
|
rdev: number;
|
|
@@ -20,7 +21,9 @@ export interface VirtualStat {
|
|
|
20
21
|
ctimeMs: number;
|
|
21
22
|
birthtimeMs: number;
|
|
22
23
|
ino: number;
|
|
24
|
+
inoExact?: bigint;
|
|
23
25
|
nlink: number;
|
|
26
|
+
nlinkExact?: bigint;
|
|
24
27
|
uid: number;
|
|
25
28
|
gid: number;
|
|
26
29
|
}
|
|
@@ -275,8 +278,8 @@ export interface Kernel extends KernelInterface {
|
|
|
275
278
|
connectTerminal(options?: ConnectTerminalOptions): Promise<number>;
|
|
276
279
|
mountFs(path: string, fs: VirtualFileSystem, options?: {
|
|
277
280
|
readOnly?: boolean;
|
|
278
|
-
}): void
|
|
279
|
-
unmountFs(path: string): void
|
|
281
|
+
}): void | Promise<void>;
|
|
282
|
+
unmountFs(path: string): void | Promise<void>;
|
|
280
283
|
readFile(path: string): Promise<Uint8Array>;
|
|
281
284
|
writeFile(path: string, content: string | Uint8Array): Promise<void>;
|
|
282
285
|
mkdir(path: string): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "@rivet-dev/agentos-runtime-core/native-client";
|
|
2
2
|
import { SidecarProcess } from "@rivet-dev/agentos-runtime-core/sidecar-client";
|
|
3
|
-
export {
|
|
3
|
+
export { SidecarEventBufferOverflow, SidecarProcess, SidecarProcessError, SidecarProcessExited, } from "@rivet-dev/agentos-runtime-core/sidecar-client";
|
|
4
4
|
export declare const NativeSidecarProcessClient: typeof SidecarProcess;
|
|
5
5
|
export type { AuthenticatedSession, CreatedVm, ExtEnvelope, GuestFilesystemStat, RootFilesystemEntry, RootFilesystemLowerDescriptor, SidecarEventSelector, SidecarFsPermissionRule, SidecarLinkPackageResult, SidecarMountDescriptor, SidecarMountPluginDescriptor, SidecarPatternPermissionRule, SidecarPermissionMode, SidecarPermissionScope, SidecarPermissionsPolicy, SidecarProcessSnapshotEntry, SidecarProjectedAgent, SidecarProjectedModuleDescriptor, SidecarRegisteredHostCallbackDefinition, SidecarRegisteredHostCallbackExample, SidecarRequestFrame, SidecarRequestHandler, SidecarRequestPayload, SidecarResponseFrame, SidecarResponsePayload, SidecarRulePermissions, SidecarSessionState, SidecarSignalHandlerRegistration, SidecarSignalState, SidecarSocketStateEntry, SidecarSoftwareDescriptor, SidecarSpawnOptions, SidecarSpawnOptions as NativeSidecarSpawnOptions, SidecarZombieTimerCount, } from "@rivet-dev/agentos-runtime-core/sidecar-client";
|
|
6
6
|
export type { SidecarVmConfiguredResponse as SidecarConfigureVmResult, } from "@rivet-dev/agentos-runtime-core/sidecar-client";
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
// SidecarProcess.spawn works in this native runtime.
|
|
5
5
|
import "@rivet-dev/agentos-runtime-core/native-client";
|
|
6
6
|
import { SidecarProcess } from "@rivet-dev/agentos-runtime-core/sidecar-client";
|
|
7
|
-
export {
|
|
7
|
+
export { SidecarEventBufferOverflow, SidecarProcess, SidecarProcessError, SidecarProcessExited, } from "@rivet-dev/agentos-runtime-core/sidecar-client";
|
|
8
8
|
export const NativeSidecarProcessClient = SidecarProcess;
|
|
@@ -35,6 +35,16 @@ interface NativeSidecarKernelProxyOptions {
|
|
|
35
35
|
permissions?: SidecarPermissionsPolicy;
|
|
36
36
|
commandPermissions?: Parameters<SidecarProcess["configureVm"]>[2]["commandPermissions"];
|
|
37
37
|
loopbackExemptPorts?: number[];
|
|
38
|
+
/**
|
|
39
|
+
* The boot `configureVm` payload pieces beyond mounts/permissions. Rust
|
|
40
|
+
* `configure_vm` rebuilds the whole VM configuration from each payload, so
|
|
41
|
+
* every runtime mount reconfigure must resend these or a post-boot
|
|
42
|
+
* `mountFs()` silently drops the `/opt/agentos` package projections and
|
|
43
|
+
* tool shim commands applied at boot.
|
|
44
|
+
*/
|
|
45
|
+
packages?: Parameters<SidecarProcess["configureVm"]>[2]["packages"];
|
|
46
|
+
packagesMountAt?: string;
|
|
47
|
+
toolShimCommands?: string[];
|
|
38
48
|
commandGuestPaths: ReadonlyMap<string, string>;
|
|
39
49
|
onWasmCommandResolved?: (command: string) => void;
|
|
40
50
|
onDispose?: () => Promise<void>;
|
|
@@ -63,6 +73,9 @@ export declare class NativeSidecarKernelProxy {
|
|
|
63
73
|
private readonly permissions;
|
|
64
74
|
private readonly commandPermissions;
|
|
65
75
|
private readonly loopbackExemptPorts;
|
|
76
|
+
private packages;
|
|
77
|
+
private readonly packagesMountAt;
|
|
78
|
+
private readonly toolShimCommands;
|
|
66
79
|
private readonly commandDrivers;
|
|
67
80
|
private readonly onWasmCommandResolved;
|
|
68
81
|
private readonly onDispose;
|
|
@@ -88,6 +101,15 @@ export declare class NativeSidecarKernelProxy {
|
|
|
88
101
|
createRootView(): VirtualFileSystem;
|
|
89
102
|
get zombieTimerCount(): number;
|
|
90
103
|
registerCommandGuestPaths(commandGuestPaths: ReadonlyMap<string, string>): void;
|
|
104
|
+
/**
|
|
105
|
+
* Record a runtime-linked package (`linkSoftware`) so mount reconfigures
|
|
106
|
+
* resend it. Rust `configure_vm` rebuilds the whole VM configuration from
|
|
107
|
+
* each payload, so a linked package omitted here would be silently
|
|
108
|
+
* unprojected from `/opt/agentos` by the next `mountFs`/`unmountFs`.
|
|
109
|
+
*/
|
|
110
|
+
registerLinkedPackage(descriptor: {
|
|
111
|
+
path: string;
|
|
112
|
+
}): void;
|
|
91
113
|
dispose(): Promise<void>;
|
|
92
114
|
/** Test-only snapshot of the per-VM tracking collection sizes. */
|
|
93
115
|
__trackingSizesForTest(): {
|
|
@@ -137,8 +159,8 @@ export declare class NativeSidecarKernelProxy {
|
|
|
137
159
|
mountFs(path: string, driver: VirtualFileSystem, options?: {
|
|
138
160
|
readOnly?: boolean;
|
|
139
161
|
sidecarMount?: SidecarMountDescriptor;
|
|
140
|
-
}): void
|
|
141
|
-
unmountFs(path: string): void
|
|
162
|
+
}): Promise<void>;
|
|
163
|
+
unmountFs(path: string): Promise<void>;
|
|
142
164
|
private desiredSidecarMounts;
|
|
143
165
|
private reconfigureSidecarMounts;
|
|
144
166
|
private waitForMountReconfigure;
|
|
@@ -184,7 +206,7 @@ export declare class NativeSidecarKernelProxy {
|
|
|
184
206
|
private updateTrackedProcessSnapshot;
|
|
185
207
|
}
|
|
186
208
|
export type { AuthenticatedSession, CreatedVm, GuestFilesystemStat, RootFilesystemEntry, SidecarConfigureVmResult, SidecarEventSelector, SidecarLinkPackageResult, SidecarPermissionsPolicy, SidecarProjectedAgent, SidecarRegisteredHostCallbackDefinition, SidecarRequestFrame, SidecarResponsePayload, SidecarSessionState, SidecarSignalHandlerRegistration, SidecarSocketStateEntry, SidecarSpawnOptions, } from "./native-process-client.js";
|
|
187
|
-
export {
|
|
209
|
+
export { NativeSidecarProcessClient, SidecarEventBufferOverflow, SidecarProcess, SidecarProcessError, SidecarProcessExited, } from "./native-process-client.js";
|
|
188
210
|
export type AgentOsSidecarPlacement = {
|
|
189
211
|
kind: "shared";
|
|
190
212
|
pool?: string;
|
|
@@ -214,6 +214,11 @@ export class NativeSidecarKernelProxy {
|
|
|
214
214
|
permissions;
|
|
215
215
|
commandPermissions;
|
|
216
216
|
loopbackExemptPorts;
|
|
217
|
+
// Mutable: runtime `linkSoftware` appends via `registerLinkedPackage` so
|
|
218
|
+
// later mount reconfigures resend linked packages too, not just boot ones.
|
|
219
|
+
packages;
|
|
220
|
+
packagesMountAt;
|
|
221
|
+
toolShimCommands;
|
|
217
222
|
commandDrivers;
|
|
218
223
|
onWasmCommandResolved;
|
|
219
224
|
onDispose;
|
|
@@ -250,6 +255,9 @@ export class NativeSidecarKernelProxy {
|
|
|
250
255
|
this.permissions = options.permissions;
|
|
251
256
|
this.commandPermissions = options.commandPermissions;
|
|
252
257
|
this.loopbackExemptPorts = options.loopbackExemptPorts;
|
|
258
|
+
this.packages = options.packages ? [...options.packages] : [];
|
|
259
|
+
this.packagesMountAt = options.packagesMountAt;
|
|
260
|
+
this.toolShimCommands = options.toolShimCommands;
|
|
253
261
|
this.commandDrivers = buildCommandMap(options.commandGuestPaths);
|
|
254
262
|
this.onWasmCommandResolved = options.onWasmCommandResolved;
|
|
255
263
|
this.onDispose = options.onDispose;
|
|
@@ -273,6 +281,17 @@ export class NativeSidecarKernelProxy {
|
|
|
273
281
|
this.commandDrivers.set(name, "wasmvm");
|
|
274
282
|
}
|
|
275
283
|
}
|
|
284
|
+
/**
|
|
285
|
+
* Record a runtime-linked package (`linkSoftware`) so mount reconfigures
|
|
286
|
+
* resend it. Rust `configure_vm` rebuilds the whole VM configuration from
|
|
287
|
+
* each payload, so a linked package omitted here would be silently
|
|
288
|
+
* unprojected from `/opt/agentos` by the next `mountFs`/`unmountFs`.
|
|
289
|
+
*/
|
|
290
|
+
registerLinkedPackage(descriptor) {
|
|
291
|
+
if (!this.packages.some((pkg) => pkg.path === descriptor.path)) {
|
|
292
|
+
this.packages.push({ path: descriptor.path });
|
|
293
|
+
}
|
|
294
|
+
}
|
|
276
295
|
async dispose() {
|
|
277
296
|
if (this.disposed) {
|
|
278
297
|
return;
|
|
@@ -1058,7 +1077,7 @@ export class NativeSidecarKernelProxy {
|
|
|
1058
1077
|
if (local) {
|
|
1059
1078
|
return this.readdirRecursiveLocal(local.mount.fs, local.relativePath, options?.maxDepth);
|
|
1060
1079
|
}
|
|
1061
|
-
return this.client.readdirRecursive(this.session, this.vm, path, options);
|
|
1080
|
+
return (await this.client.readdirRecursive(this.session, this.vm, path, options)).map((entry) => ({ ...entry, size: Number(entry.size) }));
|
|
1062
1081
|
}
|
|
1063
1082
|
async removeFile(path) {
|
|
1064
1083
|
return this.dispatchWrite(path, (mount, relativePath) => mount.fs.removeFile(relativePath), () => this.client.removeFile(this.session, this.vm, path));
|
|
@@ -1126,15 +1145,24 @@ export class NativeSidecarKernelProxy {
|
|
|
1126
1145
|
sidecarMount: options?.sidecarMount,
|
|
1127
1146
|
});
|
|
1128
1147
|
this.localMounts.sort((left, right) => right.path.length - left.path.length);
|
|
1129
|
-
|
|
1148
|
+
// Resolves once the sidecar has the mount; a swallowed rejection here
|
|
1149
|
+
// used to turn reconfigure failures into silently missing guest mounts.
|
|
1150
|
+
// The local catch only guards callers that drop the promise — awaiting
|
|
1151
|
+
// callers still observe the rejection.
|
|
1152
|
+
const applied = this.reconfigureSidecarMounts();
|
|
1153
|
+
applied.catch(() => { });
|
|
1154
|
+
return applied;
|
|
1130
1155
|
}
|
|
1131
1156
|
unmountFs(path) {
|
|
1132
1157
|
const normalized = posixPath.normalize(path);
|
|
1133
1158
|
const index = this.localMounts.findIndex((mount) => mount.path === normalized);
|
|
1134
|
-
if (index
|
|
1135
|
-
|
|
1136
|
-
void this.reconfigureSidecarMounts().catch(() => { });
|
|
1159
|
+
if (index < 0) {
|
|
1160
|
+
return Promise.resolve();
|
|
1137
1161
|
}
|
|
1162
|
+
this.localMounts.splice(index, 1);
|
|
1163
|
+
const applied = this.reconfigureSidecarMounts();
|
|
1164
|
+
applied.catch(() => { });
|
|
1165
|
+
return applied;
|
|
1138
1166
|
}
|
|
1139
1167
|
desiredSidecarMounts() {
|
|
1140
1168
|
return [
|
|
@@ -1154,11 +1182,18 @@ export class NativeSidecarKernelProxy {
|
|
|
1154
1182
|
if (this.disposed) {
|
|
1155
1183
|
return;
|
|
1156
1184
|
}
|
|
1185
|
+
// Rust `configure_vm` rebuilds the whole VM configuration from this
|
|
1186
|
+
// payload, so resend the boot packages / tool shim commands too —
|
|
1187
|
+
// omitting them here strips the `/opt/agentos` projections and tool
|
|
1188
|
+
// shims from the VM as a side effect of a runtime mount change.
|
|
1157
1189
|
await this.client.configureVm(this.session, this.vm, {
|
|
1158
1190
|
mounts: this.desiredSidecarMounts(),
|
|
1159
1191
|
permissions: this.permissions,
|
|
1160
1192
|
commandPermissions: this.commandPermissions,
|
|
1161
1193
|
loopbackExemptPorts: this.loopbackExemptPorts,
|
|
1194
|
+
packages: this.packages,
|
|
1195
|
+
packagesMountAt: this.packagesMountAt,
|
|
1196
|
+
toolShimCommands: this.toolShimCommands,
|
|
1162
1197
|
});
|
|
1163
1198
|
};
|
|
1164
1199
|
const previous = this.mountReconfigurePromise ?? Promise.resolve();
|
|
@@ -1957,21 +1992,27 @@ function isMissingHostProcessError(error) {
|
|
|
1957
1992
|
function errnoError(code, message) {
|
|
1958
1993
|
return Object.assign(new Error(`${code}: ${message}`), { code });
|
|
1959
1994
|
}
|
|
1995
|
+
// VirtualStat is a numeric, Node-default-shaped view: u64 fields above
|
|
1996
|
+
// Number.MAX_SAFE_INTEGER lose precision here, same as Node's non-bigint
|
|
1997
|
+
// fs.stat on the host.
|
|
1960
1998
|
function toVirtualStat(stat) {
|
|
1961
1999
|
return {
|
|
1962
2000
|
mode: stat.mode,
|
|
1963
|
-
size: stat.size,
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
2001
|
+
size: Number(stat.size),
|
|
2002
|
+
sizeExact: stat.size,
|
|
2003
|
+
blocks: Number(stat.blocks),
|
|
2004
|
+
dev: Number(stat.dev),
|
|
2005
|
+
rdev: Number(stat.rdev),
|
|
1967
2006
|
isDirectory: stat.is_directory,
|
|
1968
2007
|
isSymbolicLink: stat.is_symbolic_link,
|
|
1969
2008
|
atimeMs: stat.atime_ms,
|
|
1970
2009
|
mtimeMs: stat.mtime_ms,
|
|
1971
2010
|
ctimeMs: stat.ctime_ms,
|
|
1972
2011
|
birthtimeMs: stat.birthtime_ms,
|
|
1973
|
-
ino: stat.ino,
|
|
1974
|
-
|
|
2012
|
+
ino: Number(stat.ino),
|
|
2013
|
+
inoExact: stat.ino,
|
|
2014
|
+
nlink: Number(stat.nlink),
|
|
2015
|
+
nlinkExact: stat.nlink,
|
|
1975
2016
|
uid: stat.uid,
|
|
1976
2017
|
gid: stat.gid,
|
|
1977
2018
|
};
|
|
@@ -2004,7 +2045,7 @@ function socketLookupKey(kind, request) {
|
|
|
2004
2045
|
path: request.path ?? null,
|
|
2005
2046
|
});
|
|
2006
2047
|
}
|
|
2007
|
-
export {
|
|
2048
|
+
export { NativeSidecarProcessClient, SidecarEventBufferOverflow, SidecarProcess, SidecarProcessError, SidecarProcessExited, } from "./native-process-client.js";
|
|
2008
2049
|
export class AgentOsSidecarVmHandle {
|
|
2009
2050
|
client;
|
|
2010
2051
|
sessionId;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivet-dev/agentos-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8-rc.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -53,17 +53,17 @@
|
|
|
53
53
|
"test": "vitest run --reporter=verbose"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@agentos-software/claude-code": "0.2.
|
|
56
|
+
"@agentos-software/claude-code": "0.2.8-rc.1",
|
|
57
57
|
"@agentos-software/codex-cli": "0.3.3",
|
|
58
|
-
"@agentos-software/common": "0.2.
|
|
59
|
-
"@agentos-software/manifest": "0.2.
|
|
60
|
-
"@agentos-software/opencode": "0.2.
|
|
61
|
-
"@agentos-software/pi": "0.2.
|
|
62
|
-
"@agentos-software/pi-cli": "0.2.
|
|
58
|
+
"@agentos-software/common": "0.2.8-rc.1",
|
|
59
|
+
"@agentos-software/manifest": "0.2.8-rc.1",
|
|
60
|
+
"@agentos-software/opencode": "0.2.8-rc.1",
|
|
61
|
+
"@agentos-software/pi": "0.2.8-rc.1",
|
|
62
|
+
"@agentos-software/pi-cli": "0.2.8-rc.1",
|
|
63
63
|
"@aws-sdk/client-s3": "^3.1019.0",
|
|
64
|
-
"@rivet-dev/agentos-sidecar": "0.2.
|
|
64
|
+
"@rivet-dev/agentos-sidecar": "0.2.8-rc.1",
|
|
65
65
|
"@rivetkit/bare-ts": "^0.6.2",
|
|
66
|
-
"@rivet-dev/agentos-runtime-core": "0.2.
|
|
66
|
+
"@rivet-dev/agentos-runtime-core": "0.2.8-rc.1",
|
|
67
67
|
"@xterm/headless": "^6.0.0",
|
|
68
68
|
"better-sqlite3": "^12.8.0",
|
|
69
69
|
"croner": "^10.0.1",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"zod-to-json-schema": "^3.25.2"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@agentos-software/claude-code": "0.2.
|
|
79
|
-
"@agentos-software/codex": "0.2.
|
|
78
|
+
"@agentos-software/claude-code": "0.2.8-rc.1",
|
|
79
|
+
"@agentos-software/codex": "0.2.8-rc.1",
|
|
80
80
|
"@agentos-software/coreutils": "0.3.3",
|
|
81
81
|
"@agentos-software/curl": "0.3.3",
|
|
82
82
|
"@agentos-software/diffutils": "0.3.3",
|
|
@@ -90,9 +90,9 @@
|
|
|
90
90
|
"@agentos-software/gzip": "0.3.3",
|
|
91
91
|
"@agentos-software/http-get": "0.3.3",
|
|
92
92
|
"@agentos-software/jq": "0.3.3",
|
|
93
|
-
"@agentos-software/opencode": "0.2.
|
|
94
|
-
"@agentos-software/pi": "0.2.
|
|
95
|
-
"@agentos-software/pi-cli": "0.2.
|
|
93
|
+
"@agentos-software/opencode": "0.2.8-rc.1",
|
|
94
|
+
"@agentos-software/pi": "0.2.8-rc.1",
|
|
95
|
+
"@agentos-software/pi-cli": "0.2.8-rc.1",
|
|
96
96
|
"@agentos-software/ripgrep": "0.3.3",
|
|
97
97
|
"@agentos-software/sed": "0.3.3",
|
|
98
98
|
"@agentos-software/tar": "0.3.3",
|