fix(opencode): preserve CommonJS runtime scope and user script ownership

This commit is contained in:
haelyra
2026-10-10 18:53:22 -04:00
parent 6d813fe308
commit 74aace4071
8 changed files with 363 additions and 3 deletions
+2 -1
View File
@@ -111,8 +111,9 @@ function createModularInstallRoot(options = {}) {
fs.writeFileSync(
path.join(root, "package.json"),
JSON.stringify({ name: "ecc-universal", version: "0.0.0-test" })
JSON.stringify({ name: "ecc-universal", version: "0.0.0-test", type: "module" })
)
fs.writeFileSync(path.join(root, "scripts", "package.json"), JSON.stringify({ type: "commonjs" }))
// The plugin's tools import @opencode-ai/plugin, which resolves through
// node_modules — a real installation has it, an isolated temp dir would not.