@rivet-dev/agentos-core 0.2.5-rc.3 → 0.2.5-rc.4
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/README.md +4 -4
- package/dist/agent-os.d.ts +25 -28
- package/dist/agent-os.js +129 -403
- package/dist/agentos-package.d.ts +3 -3
- package/dist/agentos-package.js +7 -1
- package/dist/cron/types.d.ts +1 -1
- package/dist/default-software.d.ts +6 -46
- package/dist/default-software.js +7 -90
- package/dist/generated/AcpLimitsConfig.d.ts +4 -0
- package/dist/generated/AcpLimitsConfig.js +2 -0
- package/dist/generated/CreateVmConfig.d.ts +26 -0
- package/dist/generated/CreateVmConfig.js +1 -0
- package/dist/generated/FsPermissionRule.d.ts +6 -0
- package/dist/generated/FsPermissionRule.js +1 -0
- package/dist/generated/FsPermissionRuleSet.d.ts +6 -0
- package/dist/generated/FsPermissionRuleSet.js +1 -0
- package/dist/generated/FsPermissionScope.d.ts +3 -0
- package/dist/generated/FsPermissionScope.js +1 -0
- package/dist/generated/HttpLimitsConfig.d.ts +3 -0
- package/dist/generated/HttpLimitsConfig.js +2 -0
- package/dist/generated/JsModuleResolution.d.ts +1 -0
- package/dist/generated/JsModuleResolution.js +2 -0
- package/dist/generated/JsRuntimeConfig.d.ts +31 -0
- package/dist/generated/JsRuntimeConfig.js +1 -0
- package/dist/generated/JsRuntimeLimitsConfig.d.ts +11 -0
- package/dist/generated/JsRuntimeLimitsConfig.js +2 -0
- package/dist/generated/JsRuntimePlatform.d.ts +1 -0
- package/dist/generated/JsRuntimePlatform.js +2 -0
- package/dist/generated/MountPluginDescriptor.d.ts +4 -0
- package/dist/generated/MountPluginDescriptor.js +2 -0
- package/dist/generated/NativeRootFilesystemConfig.d.ts +5 -0
- package/dist/generated/NativeRootFilesystemConfig.js +1 -0
- package/dist/generated/PatternPermissionRule.d.ts +6 -0
- package/dist/generated/PatternPermissionRule.js +1 -0
- package/dist/generated/PatternPermissionRuleSet.d.ts +6 -0
- package/dist/generated/PatternPermissionRuleSet.js +1 -0
- package/dist/generated/PatternPermissionScope.d.ts +3 -0
- package/dist/generated/PatternPermissionScope.js +1 -0
- package/dist/generated/PermissionMode.d.ts +1 -0
- package/dist/generated/PermissionMode.js +2 -0
- package/dist/generated/PermissionsPolicy.d.ts +10 -0
- package/dist/generated/PermissionsPolicy.js +1 -0
- package/dist/generated/PluginLimitsConfig.d.ts +4 -0
- package/dist/generated/PluginLimitsConfig.js +2 -0
- package/dist/generated/PythonLimitsConfig.d.ts +6 -0
- package/dist/generated/PythonLimitsConfig.js +2 -0
- package/dist/generated/ResourceLimitsConfig.d.ts +24 -0
- package/dist/generated/ResourceLimitsConfig.js +2 -0
- package/dist/generated/RootFilesystemConfig.d.ts +9 -0
- package/dist/generated/RootFilesystemConfig.js +1 -0
- package/dist/generated/RootFilesystemEntry.d.ts +13 -0
- package/dist/generated/RootFilesystemEntry.js +1 -0
- package/dist/generated/RootFilesystemEntryEncoding.d.ts +1 -0
- package/dist/generated/RootFilesystemEntryEncoding.js +2 -0
- package/dist/generated/RootFilesystemEntryKind.d.ts +1 -0
- package/dist/generated/RootFilesystemEntryKind.js +2 -0
- package/dist/generated/RootFilesystemLowerDescriptor.d.ts +7 -0
- package/dist/generated/RootFilesystemLowerDescriptor.js +1 -0
- package/dist/generated/RootFilesystemMode.d.ts +1 -0
- package/dist/generated/RootFilesystemMode.js +2 -0
- package/dist/generated/ToolLimitsConfig.d.ts +10 -0
- package/dist/generated/ToolLimitsConfig.js +2 -0
- package/dist/generated/VmDnsConfig.d.ts +6 -0
- package/dist/generated/VmDnsConfig.js +2 -0
- package/dist/generated/VmLimitsConfig.d.ts +18 -0
- package/dist/generated/VmLimitsConfig.js +1 -0
- package/dist/generated/VmListenPolicyConfig.d.ts +5 -0
- package/dist/generated/VmListenPolicyConfig.js +2 -0
- package/dist/generated/WasmLimitsConfig.d.ts +7 -0
- package/dist/generated/WasmLimitsConfig.js +2 -0
- package/dist/host-dir-mount.d.ts +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/options-schema.d.ts +14 -1
- package/dist/options-schema.js +27 -21
- package/dist/packages.d.ts +2 -2
- package/dist/packages.js +20 -6
- package/dist/runtime-compat.d.ts +17 -4
- package/dist/runtime-compat.js +51 -88
- package/dist/runtime.d.ts +27 -0
- package/dist/sandbox.d.ts +112 -0
- package/dist/sandbox.js +264 -0
- package/dist/sidecar/agentos-protocol.d.ts +27 -1
- package/dist/sidecar/agentos-protocol.js +77 -20
- package/dist/sidecar/native-process-client.d.ts +5 -4
- package/dist/sidecar/native-process-client.js +4 -4
- package/dist/sidecar/permissions.d.ts +1 -1
- package/dist/sidecar/rpc-client.d.ts +21 -2
- package/dist/sidecar/rpc-client.js +113 -41
- package/dist/types.d.ts +7 -1
- package/package.json +34 -35
- package/dist/agents.d.ts +0 -79
- package/dist/agents.js +0 -48
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RootFilesystemConfig as VmConfigRootFilesystemConfig, RootFilesystemEntry as VmConfigRootFilesystemEntry, RootFilesystemLowerDescriptor as VmConfigRootFilesystemLowerDescriptor } from "@
|
|
1
|
+
import type { RootFilesystemConfig as VmConfigRootFilesystemConfig, RootFilesystemEntry as VmConfigRootFilesystemEntry, RootFilesystemLowerDescriptor as VmConfigRootFilesystemLowerDescriptor } from "@rivet-dev/agentos-runtime-core/vm-config";
|
|
2
2
|
import type { NativeMountConfig, PlainMountConfig, RootFilesystemConfig } from "../agent-os.js";
|
|
3
3
|
import type { RootSnapshotExport } from "../layers.js";
|
|
4
4
|
import type { ConnectTerminalOptions, KernelExecOptions, KernelExecResult, KernelSpawnOptions, ManagedProcess, OpenShellOptions, ProcessInfo, ShellHandle, VirtualFileSystem, VirtualStat } from "../runtime-compat.js";
|
|
@@ -115,9 +115,25 @@ export declare class NativeSidecarKernelProxy {
|
|
|
115
115
|
exists(path: string): Promise<boolean>;
|
|
116
116
|
stat(path: string): Promise<VirtualStat>;
|
|
117
117
|
readdir(path: string): Promise<string[]>;
|
|
118
|
+
readdirRecursive(path: string, options?: {
|
|
119
|
+
maxDepth?: number;
|
|
120
|
+
}): Promise<Array<{
|
|
121
|
+
name: string;
|
|
122
|
+
path: string;
|
|
123
|
+
isDirectory: boolean;
|
|
124
|
+
isSymbolicLink: boolean;
|
|
125
|
+
size: number;
|
|
126
|
+
}>>;
|
|
118
127
|
removeFile(path: string): Promise<void>;
|
|
119
128
|
removeDir(path: string): Promise<void>;
|
|
129
|
+
removePath(path: string, options?: {
|
|
130
|
+
recursive?: boolean;
|
|
131
|
+
}): Promise<void>;
|
|
132
|
+
copyPath(fromPath: string, toPath: string, options?: {
|
|
133
|
+
recursive?: boolean;
|
|
134
|
+
}): Promise<void>;
|
|
120
135
|
rename(oldPath: string, newPath: string): Promise<void>;
|
|
136
|
+
movePath(oldPath: string, newPath: string): Promise<void>;
|
|
121
137
|
mountFs(path: string, driver: VirtualFileSystem, options?: {
|
|
122
138
|
readOnly?: boolean;
|
|
123
139
|
sidecarMount?: SidecarMountDescriptor;
|
|
@@ -153,6 +169,9 @@ export declare class NativeSidecarKernelProxy {
|
|
|
153
169
|
private handleBackgroundProcessError;
|
|
154
170
|
private recordCompletedProcessError;
|
|
155
171
|
private emitBackgroundProcessError;
|
|
172
|
+
private readdirRecursiveLocal;
|
|
173
|
+
private removePathLocal;
|
|
174
|
+
private copyPathLocal;
|
|
156
175
|
private createFilesystemView;
|
|
157
176
|
private buildProcessSnapshot;
|
|
158
177
|
private dispatchRead;
|
|
@@ -164,7 +183,7 @@ export declare class NativeSidecarKernelProxy {
|
|
|
164
183
|
private assertLocalWritable;
|
|
165
184
|
private updateTrackedProcessSnapshot;
|
|
166
185
|
}
|
|
167
|
-
export type { AuthenticatedSession, CreatedVm, GuestFilesystemStat, RootFilesystemEntry, SidecarEventSelector, SidecarPermissionsPolicy, SidecarRegisteredHostCallbackDefinition, SidecarRequestFrame, SidecarResponsePayload, SidecarSessionState, SidecarSignalHandlerRegistration, SidecarSocketStateEntry, SidecarSpawnOptions, } from "./native-process-client.js";
|
|
186
|
+
export type { AuthenticatedSession, CreatedVm, GuestFilesystemStat, RootFilesystemEntry, SidecarConfigureVmResult, SidecarEventSelector, SidecarLinkPackageResult, SidecarPermissionsPolicy, SidecarProjectedAgent, SidecarRegisteredHostCallbackDefinition, SidecarRequestFrame, SidecarResponsePayload, SidecarSessionState, SidecarSignalHandlerRegistration, SidecarSocketStateEntry, SidecarSpawnOptions, } from "./native-process-client.js";
|
|
168
187
|
export { NATIVE_SIDECAR_FRAME_TIMEOUT_MS, NativeSidecarProcessClient, SidecarEventBufferOverflow, SidecarProcess, SidecarProcessError, SidecarProcessExited, } from "./native-process-client.js";
|
|
169
188
|
export type AgentOsSidecarPlacement = {
|
|
170
189
|
kind: "shared";
|
|
@@ -337,9 +337,6 @@ export class NativeSidecarKernelProxy {
|
|
|
337
337
|
const stderrChunks = [];
|
|
338
338
|
const effectiveCwd = options?.cwd ?? this.defaultExecCwd ?? this.cwd;
|
|
339
339
|
const parsedCommand = parseSimpleExecCommand(command);
|
|
340
|
-
const resolveExecPath = (targetPath) => targetPath.startsWith("/")
|
|
341
|
-
? posixPath.normalize(targetPath)
|
|
342
|
-
: posixPath.normalize(posixPath.join(effectiveCwd, targetPath));
|
|
343
340
|
const runAndCapture = async (proc, stdinOverride, readExitCode) => {
|
|
344
341
|
if (stdinOverride !== undefined) {
|
|
345
342
|
proc.writeStdin(stdinOverride);
|
|
@@ -375,43 +372,6 @@ export class NativeSidecarKernelProxy {
|
|
|
375
372
|
stderr: Buffer.concat(stderrChunks.map((chunk) => Buffer.from(chunk))).toString("utf8"),
|
|
376
373
|
};
|
|
377
374
|
};
|
|
378
|
-
if (parsedCommand &&
|
|
379
|
-
(parsedCommand[0] === "sh" || parsedCommand[0] === "/bin/sh") &&
|
|
380
|
-
parsedCommand[1] === "-c" &&
|
|
381
|
-
parsedCommand.length === 3) {
|
|
382
|
-
const shellScript = parsedCommand[2].trim();
|
|
383
|
-
const exitMatch = shellScript.match(/^exit(?:\s+(-?\d+))?$/);
|
|
384
|
-
if (exitMatch) {
|
|
385
|
-
return {
|
|
386
|
-
exitCode: Number.parseInt(exitMatch[1] ?? "0", 10),
|
|
387
|
-
stdout: "",
|
|
388
|
-
stderr: "",
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
|
-
return this.exec(parsedCommand[2], options);
|
|
392
|
-
}
|
|
393
|
-
if (parsedCommand &&
|
|
394
|
-
parsedCommand[0] === "chmod" &&
|
|
395
|
-
parsedCommand.length >= 3 &&
|
|
396
|
-
/^[0-7]{3,4}$/.test(parsedCommand[1] ?? "")) {
|
|
397
|
-
const mode = Number.parseInt(parsedCommand[1], 8);
|
|
398
|
-
for (const target of parsedCommand.slice(2)) {
|
|
399
|
-
await this.client.chmod(this.session, this.vm, resolveExecPath(target), mode);
|
|
400
|
-
}
|
|
401
|
-
return { exitCode: 0, stdout: "", stderr: "" };
|
|
402
|
-
}
|
|
403
|
-
if (parsedCommand &&
|
|
404
|
-
parsedCommand[0] === "stat" &&
|
|
405
|
-
parsedCommand.length === 4 &&
|
|
406
|
-
parsedCommand[1] === "-c" &&
|
|
407
|
-
parsedCommand[2] === "%a") {
|
|
408
|
-
const stat = await this.stat(resolveExecPath(parsedCommand[3]));
|
|
409
|
-
return {
|
|
410
|
-
exitCode: 0,
|
|
411
|
-
stdout: `${(stat.mode & 0o777).toString(8)}\n`,
|
|
412
|
-
stderr: "",
|
|
413
|
-
};
|
|
414
|
-
}
|
|
415
375
|
const parsedCommandDriver = parsedCommand
|
|
416
376
|
? this.commands.get(parsedCommand[0])
|
|
417
377
|
: undefined;
|
|
@@ -529,7 +489,7 @@ export class NativeSidecarKernelProxy {
|
|
|
529
489
|
cwd: options?.cwd ?? this.cwd,
|
|
530
490
|
env: {
|
|
531
491
|
...(options?.env ?? {}),
|
|
532
|
-
...(options?.streamStdin ? {
|
|
492
|
+
...(options?.streamStdin ? { AGENTOS_KEEP_STDIN_OPEN: "1" } : {}),
|
|
533
493
|
},
|
|
534
494
|
startTime: Date.now(),
|
|
535
495
|
exitTime: null,
|
|
@@ -1093,12 +1053,41 @@ export class NativeSidecarKernelProxy {
|
|
|
1093
1053
|
const entries = await this.client.readdir(this.session, this.vm, path);
|
|
1094
1054
|
return [...new Set([...entries, ...this.mountedChildNames(path)])].sort((a, b) => a.localeCompare(b));
|
|
1095
1055
|
}
|
|
1056
|
+
async readdirRecursive(path, options) {
|
|
1057
|
+
const local = this.resolveLocalMount(path);
|
|
1058
|
+
if (local) {
|
|
1059
|
+
return this.readdirRecursiveLocal(local.mount.fs, local.relativePath, options?.maxDepth);
|
|
1060
|
+
}
|
|
1061
|
+
return this.client.readdirRecursive(this.session, this.vm, path, options);
|
|
1062
|
+
}
|
|
1096
1063
|
async removeFile(path) {
|
|
1097
1064
|
return this.dispatchWrite(path, (mount, relativePath) => mount.fs.removeFile(relativePath), () => this.client.removeFile(this.session, this.vm, path));
|
|
1098
1065
|
}
|
|
1099
1066
|
async removeDir(path) {
|
|
1100
1067
|
return this.dispatchWrite(path, (mount, relativePath) => mount.fs.removeDir(relativePath), () => this.client.removeDir(this.session, this.vm, path));
|
|
1101
1068
|
}
|
|
1069
|
+
async removePath(path, options) {
|
|
1070
|
+
return this.dispatchWrite(path, (mount, relativePath) => this.removePathLocal(mount.fs, relativePath, options?.recursive ?? false), () => this.client.removePath(this.session, this.vm, path, {
|
|
1071
|
+
recursive: options?.recursive ?? false,
|
|
1072
|
+
}));
|
|
1073
|
+
}
|
|
1074
|
+
async copyPath(fromPath, toPath, options) {
|
|
1075
|
+
const from = this.resolveLocalMount(fromPath);
|
|
1076
|
+
const to = this.resolveLocalMount(toPath);
|
|
1077
|
+
if (!!from !== !!to) {
|
|
1078
|
+
throw errnoError("EXDEV", "cross-device link not permitted");
|
|
1079
|
+
}
|
|
1080
|
+
if (from && to) {
|
|
1081
|
+
if (from.mount.path !== to.mount.path) {
|
|
1082
|
+
throw errnoError("EXDEV", "cross-device link not permitted");
|
|
1083
|
+
}
|
|
1084
|
+
this.assertLocalWritable(to.mount);
|
|
1085
|
+
return this.copyPathLocal(from.mount.fs, from.relativePath, to.relativePath, options?.recursive ?? false);
|
|
1086
|
+
}
|
|
1087
|
+
return this.client.copyPath(this.session, this.vm, fromPath, toPath, {
|
|
1088
|
+
recursive: options?.recursive ?? false,
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1102
1091
|
async rename(oldPath, newPath) {
|
|
1103
1092
|
const from = this.resolveLocalMount(oldPath);
|
|
1104
1093
|
const to = this.resolveLocalMount(newPath);
|
|
@@ -1114,6 +1103,21 @@ export class NativeSidecarKernelProxy {
|
|
|
1114
1103
|
}
|
|
1115
1104
|
return this.client.rename(this.session, this.vm, oldPath, newPath);
|
|
1116
1105
|
}
|
|
1106
|
+
async movePath(oldPath, newPath) {
|
|
1107
|
+
const from = this.resolveLocalMount(oldPath);
|
|
1108
|
+
const to = this.resolveLocalMount(newPath);
|
|
1109
|
+
if (!!from !== !!to) {
|
|
1110
|
+
throw errnoError("EXDEV", "cross-device link not permitted");
|
|
1111
|
+
}
|
|
1112
|
+
if (from && to) {
|
|
1113
|
+
if (from.mount.path !== to.mount.path) {
|
|
1114
|
+
throw errnoError("EXDEV", "cross-device link not permitted");
|
|
1115
|
+
}
|
|
1116
|
+
this.assertLocalWritable(from.mount);
|
|
1117
|
+
return from.mount.fs.rename(from.relativePath, to.relativePath);
|
|
1118
|
+
}
|
|
1119
|
+
return this.client.movePath(this.session, this.vm, oldPath, newPath);
|
|
1120
|
+
}
|
|
1117
1121
|
mountFs(path, driver, options) {
|
|
1118
1122
|
this.localMounts.unshift({
|
|
1119
1123
|
path: posixPath.normalize(path),
|
|
@@ -1546,6 +1550,74 @@ export class NativeSidecarKernelProxy {
|
|
|
1546
1550
|
handler(stderr);
|
|
1547
1551
|
}
|
|
1548
1552
|
}
|
|
1553
|
+
async readdirRecursiveLocal(fs, path, maxDepth) {
|
|
1554
|
+
const results = [];
|
|
1555
|
+
const queue = [{ path, depth: 0 }];
|
|
1556
|
+
while (queue.length > 0) {
|
|
1557
|
+
const current = queue.shift();
|
|
1558
|
+
if (!current)
|
|
1559
|
+
break;
|
|
1560
|
+
for (const name of await fs.readDir(current.path)) {
|
|
1561
|
+
if (name === "." || name === "..")
|
|
1562
|
+
continue;
|
|
1563
|
+
const child = posixPath.join(current.path, name);
|
|
1564
|
+
const stat = await fs.lstat(child);
|
|
1565
|
+
results.push({
|
|
1566
|
+
name,
|
|
1567
|
+
path: child,
|
|
1568
|
+
isDirectory: stat.isDirectory,
|
|
1569
|
+
isSymbolicLink: stat.isSymbolicLink,
|
|
1570
|
+
size: stat.size,
|
|
1571
|
+
});
|
|
1572
|
+
if (stat.isDirectory &&
|
|
1573
|
+
!stat.isSymbolicLink &&
|
|
1574
|
+
(maxDepth === undefined || current.depth < maxDepth)) {
|
|
1575
|
+
queue.push({ path: child, depth: current.depth + 1 });
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
return results;
|
|
1580
|
+
}
|
|
1581
|
+
async removePathLocal(fs, path, recursive) {
|
|
1582
|
+
const stat = await fs.lstat(path);
|
|
1583
|
+
if (stat.isDirectory && !stat.isSymbolicLink) {
|
|
1584
|
+
if (recursive) {
|
|
1585
|
+
for (const name of await fs.readDir(path)) {
|
|
1586
|
+
if (name === "." || name === "..")
|
|
1587
|
+
continue;
|
|
1588
|
+
await this.removePathLocal(fs, posixPath.join(path, name), true);
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
return fs.removeDir(path);
|
|
1592
|
+
}
|
|
1593
|
+
return fs.removeFile(path);
|
|
1594
|
+
}
|
|
1595
|
+
async copyPathLocal(fs, fromPath, toPath, recursive) {
|
|
1596
|
+
const stat = await fs.lstat(fromPath);
|
|
1597
|
+
if (stat.isSymbolicLink) {
|
|
1598
|
+
return fs.symlink(await fs.readlink(fromPath), toPath);
|
|
1599
|
+
}
|
|
1600
|
+
if (stat.isDirectory) {
|
|
1601
|
+
if (!recursive) {
|
|
1602
|
+
throw errnoError("EISDIR", "illegal operation on a directory");
|
|
1603
|
+
}
|
|
1604
|
+
await fs.mkdir(posixPath.dirname(toPath), { recursive: true });
|
|
1605
|
+
if (!(await fs.exists(toPath))) {
|
|
1606
|
+
await fs.createDir(toPath);
|
|
1607
|
+
}
|
|
1608
|
+
await fs.chmod(toPath, stat.mode);
|
|
1609
|
+
await fs.chown(toPath, stat.uid, stat.gid);
|
|
1610
|
+
for (const name of await fs.readDir(fromPath)) {
|
|
1611
|
+
if (name === "." || name === "..")
|
|
1612
|
+
continue;
|
|
1613
|
+
await this.copyPathLocal(fs, posixPath.join(fromPath, name), posixPath.join(toPath, name), true);
|
|
1614
|
+
}
|
|
1615
|
+
return;
|
|
1616
|
+
}
|
|
1617
|
+
await fs.writeFile(toPath, await fs.readFile(fromPath));
|
|
1618
|
+
await fs.chmod(toPath, stat.mode);
|
|
1619
|
+
await fs.chown(toPath, stat.uid, stat.gid);
|
|
1620
|
+
}
|
|
1549
1621
|
createFilesystemView(includeLocalMounts) {
|
|
1550
1622
|
return {
|
|
1551
1623
|
readFile: (path) => this.dispatchRead(path, (mount, relativePath) => mount.fs.readFile(relativePath), includeLocalMounts),
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export type { AgentCapabilities, AgentInfo, AgentOsCreateSidecarOptions, AgentOsLimits, AgentOsOptions, AgentOsSharedSidecarOptions, AgentOsSidecarConfig, AgentOsSidecarDescription, AgentExitEvent, AgentExitHandler, AgentRestartOutcome, AgentStderrEvent, AgentStderrHandler, AgentRegistryEntry, BatchReadResult, BatchWriteEntry, BatchWriteResult, CreateSessionOptions, DirEntry, LimitWarning, LimitWarningHandler, McpServerConfig, McpServerConfigLocal, McpServerConfigRemote, MountConfig, MountConfigJsonObject, MountConfigJsonPrimitive, MountConfigJsonValue, NativeMountConfig, NativeMountPluginDescriptor, OverlayMountConfig, PermissionReply, PermissionRequest, PermissionRequestHandler, PlainMountConfig, ProcessTreeNode, PromptResult, ReaddirRecursiveOptions, ResumeSessionOptions, ResumeSessionResult, RootFilesystemConfig, RootLowerInput, SessionConfigOption, SessionEventHandler, SessionInfo, SessionInitData, SessionMode, SessionModeState, SpawnedProcessInfo, } from "./agent-os.js";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* An agent type id — the `name` of an `/opt/agentos` agent package manifest
|
|
4
|
+
* (e.g. `"pi"`, `"claude"`). Agents are resolved by the SIDECAR from the projected
|
|
5
|
+
* package manifest (`/opt/agentos/<name>/current/agentos-package.json`); the client
|
|
6
|
+
* passes only the name, so any manifest `name` is a valid agent type.
|
|
7
|
+
*/
|
|
8
|
+
export type AgentType = string;
|
|
3
9
|
export type { CronAction, CronEvent, CronEventHandler, CronJob, CronJobInfo, CronJobOptions, ScheduleDriver, ScheduleEntry, ScheduleHandle, } from "./cron/index.js";
|
|
4
10
|
export type { HostDirBackendOptions, HostDirMountPluginConfig, NodeModulesMountConfig, } from "./host-dir-mount.js";
|
|
5
11
|
export type { HostTool, ToolExample, ToolKit } from "./host-tools.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivet-dev/agentos-core",
|
|
3
|
-
"version": "0.2.5-rc.
|
|
3
|
+
"version": "0.2.5-rc.4",
|
|
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.
|
|
57
|
-
"@agentos-software/codex-cli": "
|
|
58
|
-
"@agentos-software/common": "
|
|
59
|
-
"@agentos-software/manifest": "0.
|
|
60
|
-
"@agentos-software/opencode": "0.
|
|
61
|
-
"@agentos-software/pi": "0.
|
|
62
|
-
"@agentos-software/pi-cli": "0.
|
|
56
|
+
"@agentos-software/claude-code": "0.2.5-rc.4",
|
|
57
|
+
"@agentos-software/codex-cli": "workspace:*",
|
|
58
|
+
"@agentos-software/common": "workspace:*",
|
|
59
|
+
"@agentos-software/manifest": "0.2.5-rc.4",
|
|
60
|
+
"@agentos-software/opencode": "0.2.5-rc.4",
|
|
61
|
+
"@agentos-software/pi": "0.2.5-rc.4",
|
|
62
|
+
"@agentos-software/pi-cli": "0.2.5-rc.4",
|
|
63
63
|
"@aws-sdk/client-s3": "^3.1019.0",
|
|
64
|
-
"@rivet-dev/agentos-sidecar": "0.2.5-rc.
|
|
64
|
+
"@rivet-dev/agentos-sidecar": "0.2.5-rc.4",
|
|
65
65
|
"@rivetkit/bare-ts": "^0.6.2",
|
|
66
|
-
"@
|
|
66
|
+
"@rivet-dev/agentos-runtime-core": "0.2.5-rc.4",
|
|
67
67
|
"@xterm/headless": "^6.0.0",
|
|
68
68
|
"better-sqlite3": "^12.8.0",
|
|
69
69
|
"croner": "^10.0.1",
|
|
@@ -75,30 +75,30 @@
|
|
|
75
75
|
"zod-to-json-schema": "^3.25.2"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@agentos-software/claude-code": "0.
|
|
79
|
-
"@agentos-software/codex": "0.
|
|
80
|
-
"@agentos-software/coreutils": "
|
|
81
|
-
"@agentos-software/curl": "
|
|
82
|
-
"@agentos-software/diffutils": "
|
|
83
|
-
"@agentos-software/duckdb": "
|
|
84
|
-
"@agentos-software/fd": "
|
|
85
|
-
"@agentos-software/file": "
|
|
86
|
-
"@agentos-software/findutils": "
|
|
87
|
-
"@agentos-software/gawk": "
|
|
88
|
-
"@agentos-software/git": "
|
|
89
|
-
"@agentos-software/grep": "
|
|
90
|
-
"@agentos-software/gzip": "
|
|
91
|
-
"@agentos-software/http-get": "
|
|
92
|
-
"@agentos-software/jq": "
|
|
93
|
-
"@agentos-software/opencode": "0.
|
|
94
|
-
"@agentos-software/pi": "0.
|
|
95
|
-
"@agentos-software/pi-cli": "0.
|
|
96
|
-
"@agentos-software/ripgrep": "
|
|
97
|
-
"@agentos-software/sed": "
|
|
98
|
-
"@agentos-software/tar": "
|
|
99
|
-
"@agentos-software/tree": "
|
|
100
|
-
"@agentos-software/vim": "
|
|
101
|
-
"@agentos-software/yq": "
|
|
78
|
+
"@agentos-software/claude-code": "0.2.5-rc.4",
|
|
79
|
+
"@agentos-software/codex": "0.2.5-rc.4",
|
|
80
|
+
"@agentos-software/coreutils": "workspace:*",
|
|
81
|
+
"@agentos-software/curl": "workspace:*",
|
|
82
|
+
"@agentos-software/diffutils": "workspace:*",
|
|
83
|
+
"@agentos-software/duckdb": "workspace:*",
|
|
84
|
+
"@agentos-software/fd": "workspace:*",
|
|
85
|
+
"@agentos-software/file": "workspace:*",
|
|
86
|
+
"@agentos-software/findutils": "workspace:*",
|
|
87
|
+
"@agentos-software/gawk": "workspace:*",
|
|
88
|
+
"@agentos-software/git": "workspace:*",
|
|
89
|
+
"@agentos-software/grep": "workspace:*",
|
|
90
|
+
"@agentos-software/gzip": "workspace:*",
|
|
91
|
+
"@agentos-software/http-get": "workspace:*",
|
|
92
|
+
"@agentos-software/jq": "workspace:*",
|
|
93
|
+
"@agentos-software/opencode": "0.2.5-rc.4",
|
|
94
|
+
"@agentos-software/pi": "0.2.5-rc.4",
|
|
95
|
+
"@agentos-software/pi-cli": "0.2.5-rc.4",
|
|
96
|
+
"@agentos-software/ripgrep": "workspace:*",
|
|
97
|
+
"@agentos-software/sed": "workspace:*",
|
|
98
|
+
"@agentos-software/tar": "workspace:*",
|
|
99
|
+
"@agentos-software/tree": "workspace:*",
|
|
100
|
+
"@agentos-software/vim": "workspace:*",
|
|
101
|
+
"@agentos-software/yq": "workspace:*",
|
|
102
102
|
"@anthropic-ai/claude-agent-sdk": "^0.2.87",
|
|
103
103
|
"@anthropic-ai/claude-code": "^2.1.86",
|
|
104
104
|
"@bare-ts/tools": "0.15.0",
|
|
@@ -107,7 +107,6 @@
|
|
|
107
107
|
"@browserbasehq/sdk": "2.10.0",
|
|
108
108
|
"@copilotkit/llmock": "^1.6.0",
|
|
109
109
|
"@mariozechner/pi-coding-agent": "^0.60.0",
|
|
110
|
-
"@rivet-dev/agentos-sandbox": "link:../agentos-sandbox",
|
|
111
110
|
"@types/node": "^22.10.2",
|
|
112
111
|
"pi-acp": "^0.0.23",
|
|
113
112
|
"sandbox-agent": "^0.4.2",
|
package/dist/agents.d.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
export interface AgentConfig {
|
|
2
|
-
/**
|
|
3
|
-
* npm package name for the ACP adapter (spawned inside the VM). Optional: an
|
|
4
|
-
* `/opt/agentos` agent package sets `adapterEntrypoint` instead.
|
|
5
|
-
*/
|
|
6
|
-
acpAdapter?: string;
|
|
7
|
-
/** npm package name for the underlying agent (optional for `/opt/agentos` packages). */
|
|
8
|
-
agentPackage?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Pre-resolved guest command path/name for the ACP adapter (e.g.
|
|
11
|
-
* `/opt/agentos/bin/<acpEntrypoint>`). When set, it is used directly as the
|
|
12
|
-
* adapter entrypoint and the npm-package resolution (`acpAdapter` →
|
|
13
|
-
* `/root/node_modules/...`) is bypassed. Set by `/opt/agentos` agent packages.
|
|
14
|
-
*/
|
|
15
|
-
adapterEntrypoint?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Absolute host path to the software package directory that registered this
|
|
18
|
-
* agent config. Package-provided agent adapters should resolve their nested
|
|
19
|
-
* dependencies relative to this directory before falling back to the host dir
|
|
20
|
-
* behind the caller-supplied `/root/node_modules` mount.
|
|
21
|
-
*/
|
|
22
|
-
declaringPackageDir?: string;
|
|
23
|
-
/** Additional CLI args prepended when launching the ACP adapter. */
|
|
24
|
-
launchArgs?: string[];
|
|
25
|
-
/**
|
|
26
|
-
* Default env vars to pass when spawning the adapter. These are merged
|
|
27
|
-
* UNDER user env (lowest priority).
|
|
28
|
-
* Typically set by package descriptors for computed paths (e.g. PI_ACP_PI_COMMAND).
|
|
29
|
-
*/
|
|
30
|
-
defaultEnv?: Record<string, string>;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* @deprecated npm-era legacy. Agents are `/opt/agentos` packages resolved from
|
|
34
|
-
* `@agentos-software/*` dependency manifests (see `default-software.ts`); this
|
|
35
|
-
* table is no longer consulted by agent resolution and exists only for the
|
|
36
|
-
* exported `AgentType` union and legacy registry-listing metadata.
|
|
37
|
-
*/
|
|
38
|
-
export declare const AGENT_CONFIGS: {
|
|
39
|
-
pi: {
|
|
40
|
-
acpAdapter: string;
|
|
41
|
-
agentPackage: string;
|
|
42
|
-
};
|
|
43
|
-
"pi-cli": {
|
|
44
|
-
acpAdapter: string;
|
|
45
|
-
agentPackage: string;
|
|
46
|
-
};
|
|
47
|
-
opencode: {
|
|
48
|
-
acpAdapter: string;
|
|
49
|
-
agentPackage: string;
|
|
50
|
-
defaultEnv: {
|
|
51
|
-
OPENCODE_DISABLE_CONFIG_DEP_INSTALL: string;
|
|
52
|
-
OPENCODE_DISABLE_EMBEDDED_WEB_UI: string;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
claude: {
|
|
56
|
-
acpAdapter: string;
|
|
57
|
-
agentPackage: string;
|
|
58
|
-
defaultEnv: {
|
|
59
|
-
CLAUDE_AGENT_SDK_CLIENT_APP: string;
|
|
60
|
-
CLAUDE_CODE_SIMPLE: string;
|
|
61
|
-
CLAUDE_CODE_FORCE_AGENT_OS_RIPGREP: string;
|
|
62
|
-
CLAUDE_CODE_DEFER_GROWTHBOOK_INIT: string;
|
|
63
|
-
CLAUDE_CODE_DISABLE_CWD_PERSIST: string;
|
|
64
|
-
CLAUDE_CODE_DISABLE_DEV_NULL_REDIRECT: string;
|
|
65
|
-
CLAUDE_CODE_NODE_SHELL_WRAPPER: string;
|
|
66
|
-
CLAUDE_CODE_DISABLE_STREAM_JSON_HOOK_EVENTS: string;
|
|
67
|
-
CLAUDE_CODE_SHELL: string;
|
|
68
|
-
CLAUDE_CODE_SKIP_INITIAL_MESSAGES: string;
|
|
69
|
-
CLAUDE_CODE_SKIP_SANDBOX_INIT: string;
|
|
70
|
-
CLAUDE_CODE_SIMPLE_SHELL_EXEC: string;
|
|
71
|
-
CLAUDE_CODE_SWAP_STDIO: string;
|
|
72
|
-
CLAUDE_CODE_USE_PIPE_OUTPUT: string;
|
|
73
|
-
DISABLE_TELEMETRY: string;
|
|
74
|
-
SHELL: string;
|
|
75
|
-
USE_BUILTIN_RIPGREP: string;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
export type AgentType = keyof typeof AGENT_CONFIGS;
|
package/dist/agents.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// Agent configurations for ACP-compatible coding agents
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated npm-era legacy. Agents are `/opt/agentos` packages resolved from
|
|
4
|
-
* `@agentos-software/*` dependency manifests (see `default-software.ts`); this
|
|
5
|
-
* table is no longer consulted by agent resolution and exists only for the
|
|
6
|
-
* exported `AgentType` union and legacy registry-listing metadata.
|
|
7
|
-
*/
|
|
8
|
-
export const AGENT_CONFIGS = {
|
|
9
|
-
pi: {
|
|
10
|
-
acpAdapter: "@agentos-software/pi",
|
|
11
|
-
agentPackage: "@mariozechner/pi-coding-agent",
|
|
12
|
-
},
|
|
13
|
-
"pi-cli": {
|
|
14
|
-
acpAdapter: "pi-acp",
|
|
15
|
-
agentPackage: "@mariozechner/pi-coding-agent",
|
|
16
|
-
},
|
|
17
|
-
opencode: {
|
|
18
|
-
acpAdapter: "@agentos-software/opencode",
|
|
19
|
-
agentPackage: "@agentos-software/opencode",
|
|
20
|
-
defaultEnv: {
|
|
21
|
-
OPENCODE_DISABLE_CONFIG_DEP_INSTALL: "1",
|
|
22
|
-
OPENCODE_DISABLE_EMBEDDED_WEB_UI: "1",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
claude: {
|
|
26
|
-
acpAdapter: "@agentos-software/claude-code",
|
|
27
|
-
agentPackage: "@anthropic-ai/claude-agent-sdk",
|
|
28
|
-
defaultEnv: {
|
|
29
|
-
CLAUDE_AGENT_SDK_CLIENT_APP: "@rivet-dev/agentos",
|
|
30
|
-
CLAUDE_CODE_SIMPLE: "1",
|
|
31
|
-
CLAUDE_CODE_FORCE_AGENT_OS_RIPGREP: "1",
|
|
32
|
-
CLAUDE_CODE_DEFER_GROWTHBOOK_INIT: "1",
|
|
33
|
-
CLAUDE_CODE_DISABLE_CWD_PERSIST: "1",
|
|
34
|
-
CLAUDE_CODE_DISABLE_DEV_NULL_REDIRECT: "1",
|
|
35
|
-
CLAUDE_CODE_NODE_SHELL_WRAPPER: "1",
|
|
36
|
-
CLAUDE_CODE_DISABLE_STREAM_JSON_HOOK_EVENTS: "1",
|
|
37
|
-
CLAUDE_CODE_SHELL: "/bin/sh",
|
|
38
|
-
CLAUDE_CODE_SKIP_INITIAL_MESSAGES: "1",
|
|
39
|
-
CLAUDE_CODE_SKIP_SANDBOX_INIT: "1",
|
|
40
|
-
CLAUDE_CODE_SIMPLE_SHELL_EXEC: "1",
|
|
41
|
-
CLAUDE_CODE_SWAP_STDIO: "0",
|
|
42
|
-
CLAUDE_CODE_USE_PIPE_OUTPUT: "1",
|
|
43
|
-
DISABLE_TELEMETRY: "1",
|
|
44
|
-
SHELL: "/bin/sh",
|
|
45
|
-
USE_BUILTIN_RIPGREP: "0",
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
};
|