@rivet-dev/agentos 0.0.0-agentos-dylib-plugin.f065be7 → 0.0.0-codex-darwin-ci-publish.61a7af3
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/actor.js +85 -5
- package/dist/plugin-binary.js +7 -1
- package/package.json +7 -4
package/dist/actor.js
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
* configuration, resolves the plugin + sidecar binaries, and hands the opaque
|
|
10
10
|
* config envelope across the bridge — it owns no agent-os runtime logic.
|
|
11
11
|
*/
|
|
12
|
+
import { sep } from "node:path";
|
|
13
|
+
import common from "@agent-os-pkgs/common";
|
|
12
14
|
import { getSidecarPath } from "@rivet-dev/agentos-sidecar";
|
|
13
15
|
import { actor, } from "rivetkit";
|
|
14
16
|
import { agentOsActorConfigSchema, } from "./config.js";
|
|
@@ -35,6 +37,70 @@ export function nodeModulesMount(hostNodeModulesDir, opts) {
|
|
|
35
37
|
readOnly,
|
|
36
38
|
};
|
|
37
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Derive the `node_modules` root that contains an installed package directory.
|
|
42
|
+
* For an agent descriptor whose `packageDir` is `<root>/node_modules/@scope/pkg`,
|
|
43
|
+
* this returns `<root>/node_modules` — the hoist root that also holds the agent's
|
|
44
|
+
* `requires` (the ACP adapter + agent SDK) and their transitive deps under a
|
|
45
|
+
* flat (npm) install. Returns `undefined` when `packageDir` is not inside a
|
|
46
|
+
* `node_modules` tree (e.g. a linked monorepo checkout), where the caller must
|
|
47
|
+
* supply an explicit `nodeModulesMount(...)`.
|
|
48
|
+
*/
|
|
49
|
+
function nodeModulesRootOf(packageDir) {
|
|
50
|
+
const parts = packageDir.split(sep);
|
|
51
|
+
const idx = parts.lastIndexOf("node_modules");
|
|
52
|
+
if (idx === -1)
|
|
53
|
+
return undefined;
|
|
54
|
+
return parts.slice(0, idx + 1).join(sep);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Agents run their ACP adapter + SDK inside the VM from `/root/node_modules`.
|
|
58
|
+
* Rather than make the caller hand-write `nodeModulesMount(...)`, auto-derive a
|
|
59
|
+
* read-only `host_dir` mount of the `node_modules` root that holds the agent
|
|
60
|
+
* packages (`requires`) from each agent descriptor's installed `packageDir`.
|
|
61
|
+
*
|
|
62
|
+
* An explicit `/root/node_modules` mount in `options.mounts` always wins. If
|
|
63
|
+
* agents resolve to more than one distinct `node_modules` root the derivation is
|
|
64
|
+
* ambiguous and the caller must mount explicitly.
|
|
65
|
+
*/
|
|
66
|
+
function withAutoAgentNodeModulesMount(mounts, descriptors) {
|
|
67
|
+
if (mounts?.some((mount) => mount.path === "/root/node_modules")) {
|
|
68
|
+
return mounts;
|
|
69
|
+
}
|
|
70
|
+
const roots = new Set();
|
|
71
|
+
for (const d of descriptors) {
|
|
72
|
+
if (!d.agent || typeof d.packageDir !== "string")
|
|
73
|
+
continue;
|
|
74
|
+
const root = nodeModulesRootOf(d.packageDir);
|
|
75
|
+
if (root)
|
|
76
|
+
roots.add(root);
|
|
77
|
+
}
|
|
78
|
+
if (roots.size === 0)
|
|
79
|
+
return mounts;
|
|
80
|
+
if (roots.size > 1) {
|
|
81
|
+
throw new Error("agentOs() could not auto-mount agent node_modules: agents resolved to " +
|
|
82
|
+
`multiple node_modules roots (${[...roots].join(", ")}). Pass an ` +
|
|
83
|
+
"explicit nodeModulesMount(...) in options.mounts.");
|
|
84
|
+
}
|
|
85
|
+
const [hostNodeModulesDir] = [...roots];
|
|
86
|
+
return [...(mounts ?? []), nodeModulesMount(hostNodeModulesDir)];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Stable identity for a software descriptor, used to de-duplicate the
|
|
90
|
+
* auto-injected default bundle against software the caller passed explicitly.
|
|
91
|
+
* Resolved `commandDir`/`packageDir` paths are the most reliable key; `name`
|
|
92
|
+
* is the fallback for descriptors without a directory.
|
|
93
|
+
*/
|
|
94
|
+
function softwareIdentity(d) {
|
|
95
|
+
if (typeof d.commandDir === "string")
|
|
96
|
+
return `dir:${d.commandDir}`;
|
|
97
|
+
if (typeof d.packageDir === "string")
|
|
98
|
+
return `dir:${d.packageDir}`;
|
|
99
|
+
const name = d.name;
|
|
100
|
+
if (typeof name === "string")
|
|
101
|
+
return `name:${name}`;
|
|
102
|
+
return JSON.stringify(d);
|
|
103
|
+
}
|
|
38
104
|
function flattenSoftware(input, out) {
|
|
39
105
|
if (input == null)
|
|
40
106
|
return;
|
|
@@ -49,6 +115,19 @@ function flattenSoftware(input, out) {
|
|
|
49
115
|
export function buildConfigJson(parsed) {
|
|
50
116
|
const descriptors = [];
|
|
51
117
|
flattenSoftware(parsed.options?.software, descriptors);
|
|
118
|
+
// Auto-include the default software bundle (`@agent-os-pkgs/common`: `sh` +
|
|
119
|
+
// coreutils + the standard CLI tools agents rely on) unless the caller opted
|
|
120
|
+
// out with `defaultSoftware: false`. Anything already listed in `software`
|
|
121
|
+
// (e.g. an explicit `common`) is not duplicated. Prepended so the baseline
|
|
122
|
+
// tools come first, matching the previous explicit `[common, ...]` ordering.
|
|
123
|
+
const defaultSoftwareEnabled = parsed.options?.defaultSoftware !== false;
|
|
124
|
+
if (defaultSoftwareEnabled) {
|
|
125
|
+
const defaults = [];
|
|
126
|
+
flattenSoftware(common, defaults);
|
|
127
|
+
const seen = new Set(descriptors.map(softwareIdentity));
|
|
128
|
+
const toPrepend = defaults.filter((d) => !seen.has(softwareIdentity(d)));
|
|
129
|
+
descriptors.unshift(...toPrepend);
|
|
130
|
+
}
|
|
52
131
|
const software = [];
|
|
53
132
|
for (const d of descriptors) {
|
|
54
133
|
if (typeof d.commandDir === "string") {
|
|
@@ -65,12 +144,13 @@ export function buildConfigJson(parsed) {
|
|
|
65
144
|
});
|
|
66
145
|
}
|
|
67
146
|
}
|
|
68
|
-
// `/root/node_modules` (agent SDK + transitive dep resolution)
|
|
69
|
-
//
|
|
70
|
-
//
|
|
71
|
-
//
|
|
147
|
+
// `/root/node_modules` (agent ACP adapter + SDK + transitive dep resolution)
|
|
148
|
+
// is auto-derived from the agent descriptors so the standard quickstart needs
|
|
149
|
+
// no manual `nodeModulesMount(...)`: see `withAutoAgentNodeModulesMount`. An
|
|
150
|
+
// explicit `/root/node_modules` mount in `options.mounts` always wins. The VM
|
|
151
|
+
// module resolver reads the mounted tree through the kernel VFS.
|
|
72
152
|
const options = (parsed.options ?? {});
|
|
73
|
-
const mounts = serializeNativeMounts(options.mounts);
|
|
153
|
+
const mounts = withAutoAgentNodeModulesMount(serializeNativeMounts(options.mounts), descriptors);
|
|
74
154
|
const sidecar = serializeSidecar(options.sidecar);
|
|
75
155
|
return JSON.stringify({
|
|
76
156
|
software,
|
package/dist/plugin-binary.js
CHANGED
|
@@ -34,6 +34,12 @@ function getPlatformPackageName() {
|
|
|
34
34
|
if (arch === "arm64")
|
|
35
35
|
return "@rivet-dev/agentos-plugin-linux-arm64-gnu";
|
|
36
36
|
break;
|
|
37
|
+
case "darwin":
|
|
38
|
+
if (arch === "arm64")
|
|
39
|
+
return "@rivet-dev/agentos-plugin-darwin-arm64";
|
|
40
|
+
if (arch === "x64")
|
|
41
|
+
return "@rivet-dev/agentos-plugin-darwin-x64";
|
|
42
|
+
break;
|
|
37
43
|
default:
|
|
38
44
|
break;
|
|
39
45
|
}
|
|
@@ -65,7 +71,7 @@ export function getPluginPath() {
|
|
|
65
71
|
const platformPkg = getPlatformPackageName();
|
|
66
72
|
if (!platformPkg) {
|
|
67
73
|
throw new Error(`@rivet-dev/agentos: unsupported platform ${process.platform}/${process.arch}. ` +
|
|
68
|
-
"The Agent OS actor plugin currently supports linux x64 and arm64. " +
|
|
74
|
+
"The Agent OS actor plugin currently supports linux x64/arm64 and macOS x64/arm64. " +
|
|
69
75
|
`Set ${PLUGIN_BIN_ENV} to a local cdylib to override.`);
|
|
70
76
|
}
|
|
71
77
|
const require = createRequire(import.meta.url);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivet-dev/agentos",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-codex-darwin-ci-publish.61a7af3",
|
|
4
4
|
"description": "Agent OS actor for RivetKit — thin TS forwarder that loads the native actor plugin (cdylib) via RivetKit's generic native-plugin ABI.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -28,8 +28,9 @@
|
|
|
28
28
|
"test": "vitest run"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@
|
|
32
|
-
"@rivet-dev/agentos-
|
|
31
|
+
"@agent-os-pkgs/common": "0.0.0-split-runtime-preview.5d46b14",
|
|
32
|
+
"@rivet-dev/agentos-core": "0.0.0-codex-darwin-ci-publish.61a7af3",
|
|
33
|
+
"@rivet-dev/agentos-sidecar": "0.0.0-codex-darwin-ci-publish.61a7af3",
|
|
33
34
|
"zod": "^4.1.11"
|
|
34
35
|
},
|
|
35
36
|
"peerDependencies": {
|
|
@@ -44,6 +45,8 @@
|
|
|
44
45
|
"node": ">=20"
|
|
45
46
|
},
|
|
46
47
|
"optionalDependencies": {
|
|
47
|
-
"@rivet-dev/agentos-plugin-
|
|
48
|
+
"@rivet-dev/agentos-plugin-darwin-arm64": "0.0.0-codex-darwin-ci-publish.61a7af3",
|
|
49
|
+
"@rivet-dev/agentos-plugin-darwin-x64": "0.0.0-codex-darwin-ci-publish.61a7af3",
|
|
50
|
+
"@rivet-dev/agentos-plugin-linux-x64-gnu": "0.0.0-codex-darwin-ci-publish.61a7af3"
|
|
48
51
|
}
|
|
49
52
|
}
|