Inline execute / evaluate code cannot import a package installed in the VM's working directory.
Repro
const vm = await AgentOs.create({ permissions: { network: "allow" } });
await vm.javascript.npm.install(["zod"]); // installs to /workspace/node_modules
await vm.javascript.evaluate(`import("zod").then(() => "ok")`);
Actual
Cannot resolve module 'zod' (imported from '/[agentos-evaluation.js]'). The inline importer path is /[agentos-evaluation.js], /[agentos-inline.js], or /<entry>.js, so resolution starts at /. TypeScript static imports (rewritten to require) do resolve, so the two paths disagree.
Expected
Match node -e: inline code resolves bare specifiers from the working directory.
Workaround
Pass filePath: "/workspace/main.mjs", or run a file with executeFile.
Inline
execute/evaluatecode cannot import a package installed in the VM's working directory.Repro
Actual
Cannot resolve module 'zod' (imported from '/[agentos-evaluation.js]'). The inline importer path is/[agentos-evaluation.js],/[agentos-inline.js], or/<entry>.js, so resolution starts at/. TypeScript static imports (rewritten torequire) do resolve, so the two paths disagree.Expected
Match
node -e: inline code resolves bare specifiers from the working directory.Workaround
Pass
filePath: "/workspace/main.mjs", or run a file withexecuteFile.