Skip to content

The fastest browser for AI agents to run browser automation, built for sharing your logged-in browser state with your AI agents, like Codex or Claude Code, without disturbing you. Zero cost, zero config.

fix(plugins): keep npm package names scoped to the ego plugin

0x0c62f3d3b1e15
diff --git a/plugins/ego/package.json b/plugins/ego/package.json
index c50c230..60426b4 100644
--- a/plugins/ego/package.json
+++ b/plugins/ego/package.json
@@ -32,6 +32,11 @@
"patch": "./cordis.patch.yml"
}
},
+ "npmPackages": {
+ "opencode": "@ego-lite/opencode-plugin",
+ "deepseek-harness": "@ego-lite/dsh-plugin",
+ "pi": "@ego-lite/pi-plugin"
+ },
"keywords": [
"agent-plugin",
"browser",
diff --git a/plugins/ego/tests/plugin-packaging.test.mjs b/plugins/ego/tests/plugin-packaging.test.mjs
index 5826f3a..08e4475 100644
--- a/plugins/ego/tests/plugin-packaging.test.mjs
+++ b/plugins/ego/tests/plugin-packaging.test.mjs
@@ -67,7 +67,7 @@ function writeJson(path, value) {
write(path, `${JSON.stringify(value, null, 2)}\n`);
}
-function addPlugin(root, name, version, skillName) {
+function addPlugin(root, name, version, skillName, npmPackages) {
const pluginRoot = join(root, "plugins", name);
const manifest = {
name,
@@ -102,6 +102,7 @@ function addPlugin(root, name, version, skillName) {
"./dsh": "./dsh/src/index.js",
},
dsh: { bundle: { patch: "./cordis.patch.yml" } },
+ npmPackages,
keywords: ["agent-plugin"],
});
write(join(pluginRoot, "index.js"), "export default async () => ({});\n");
@@ -139,7 +140,7 @@ function createFixture() {
join(repositoryRoot, "plugins", "scripts", "package-plugins.mjs"),
join(root, "plugins", "scripts", "package-plugins.mjs"),
);
- addPlugin(root, "ego", "1.3.1", "ego-browser");
+ addPlugin(root, "ego", "1.3.1", "ego-browser", npmNames);
addPlugin(root, "sample", "2.4.0", "sample-skill");
return root;
}
@@ -255,7 +256,12 @@ function assertArtifacts(root, output, name, version, skillName) {
const pkg = JSON.parse(
readFileSync(join(plugin, "package.json"), "utf8"),
);
- assert.equal(pkg.name, npmNames[id]);
+ assert.equal(
+ pkg.name,
+ name === "ego" ? npmNames[id] : `${sourcePackage.name}-${id}`,
+ "only ego names its npm packages; other plugins derive theirs",
+ );
+ assert.equal(pkg.npmPackages, undefined);
assert.equal(pkg.version, version);
assert.equal(
pkg.scripts,
diff --git a/plugins/scripts/package-plugins.mjs b/plugins/scripts/package-plugins.mjs
index 706a7a8..d70420c 100755
--- a/plugins/scripts/package-plugins.mjs
+++ b/plugins/scripts/package-plugins.mjs
@@ -58,7 +58,6 @@ const TARGETS = [
title: "OpenCode",
files: ["index.js"],
npm: true,
- packageName: "@ego-lite/opencode-plugin",
keywords: ["opencode"],
exports: { ".": "./index.js", "./server": "./index.js" },
},
@@ -67,7 +66,6 @@ const TARGETS = [
title: "DeepSeek Harness",
files: ["cordis.patch.yml", "dsh/src/index.js"],
npm: true,
- packageName: "@ego-lite/dsh-plugin",
keywords: ["deepseek-harness"],
exports: {
"./dsh": "./dsh/src/index.js",
@@ -82,7 +80,6 @@ const TARGETS = [
title: "Pi",
files: [],
npm: true,
- packageName: "@ego-lite/pi-plugin",
keywords: ["pi-package"],
// The gallery image comes from the release tag, so a published version
// keeps its preview when the default branch moves the file.
@@ -388,13 +385,17 @@ async function packagePlugin(repositoryRoot, name, outputRoot) {
if (target.npm) {
const pkg = {
...sourcePackage,
- name: target.packageName,
+ // A plugin may name its npm packages; otherwise derive them.
+ name:
+ sourcePackage.npmPackages?.[target.id] ??
+ `${sourcePackage.name}-${target.id}`,
files: ["LICENSE", "README.md", "skills", ...target.files],
keywords: [...target.keywords, ...sourcePackage.keywords],
exports: target.exports,
...target.package?.(manifest.version),
};
delete pkg.scripts;
+ delete pkg.npmPackages;
if (target.id === "deepseek-harness") {
const patchPath = join(payloadRoot, "cordis.patch.yml");
const patch = await readFile(patchPath, "utf8");