From cd1cc511fc6b5e989ceeef6164b16f9c1c13c53d Mon Sep 17 00:00:00 2001 From: David Mokos Date: Mon, 17 Aug 2026 18:00:17 +0200 Subject: [PATCH] adds Muse Code environment detection --- README.md | 3 +++ package-lock.json | 4 ++-- package.json | 2 +- src/agents.ts | 5 +++++ src/types.ts | 1 + test/detector.test.mjs | 17 +++++++++++++++++ 6 files changed, 29 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 20ac70f..daa86c1 100644 --- a/README.md +++ b/README.md @@ -45,11 +45,14 @@ Officially supported coding agents: | [GitHub Copilot CLI](https://github.com/github/copilot-cli) | `copilot` | ✅ | | [Kilo Code](https://kilocode.ai/) | `kilocode` | ✅ | | [Kiro](https://kiro.dev/) | `kiro` | ✅ | +| [Muse Code][muse-code] | `muse` | 🚫 | | [OpenCode](https://opencode.ai/) | `opencode` | 🚫 | | [Pi](https://github.com/badlogic/pi-mono) | `pi` | 🚫 | | [Replit](https://replit.com/) | `replit` | ✅ | | [Rork](https://rork.com/) | `rork` | 🚫 | +[muse-code]: https://developer.meta.com/ai/products/muse-code/ + Detection is data-driven: the exact environment variables and process patterns for each agent live in [`src/agents.ts`](src/agents.ts). diff --git a/package-lock.json b/package-lock.json index fdde869..61fbd59 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "agent-cli-detector", - "version": "0.1.5", + "version": "0.1.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "agent-cli-detector", - "version": "0.1.5", + "version": "0.1.6", "license": "MIT", "bin": { "agent-cli-detector": "dist/cli.js" diff --git a/package.json b/package.json index 9bc5f9f..5c50610 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "agent-cli-detector", - "version": "0.1.5", + "version": "0.1.6", "description": "Detect whether a JavaScript CLI is running inside a coding agent.", "type": "module", "sideEffects": false, diff --git a/src/agents.ts b/src/agents.ts index 0b17a3e..e0e228d 100644 --- a/src/agents.ts +++ b/src/agents.ts @@ -94,6 +94,11 @@ export const defaultAgents = [ process: [{ pattern: /kiro/i }], sessionEnv: ["KIRO_SESSION_ID"] }, + { + id: "muse", + name: "Muse Code", + env: [{ name: "MUSE_RELEASE_INFO" }] + }, { id: "cline", name: "Cline", diff --git a/src/types.ts b/src/types.ts index 82a8582..c69db9a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -10,6 +10,7 @@ export type AgentId = | "kiro" | "kilocode" | "claude-code" + | "muse" | "opencode" | "pi" | "replit" diff --git a/test/detector.test.mjs b/test/detector.test.mjs index 450f09b..a09036d 100644 --- a/test/detector.test.mjs +++ b/test/detector.test.mjs @@ -78,6 +78,23 @@ test("detects rork from RORK_API_URL", () => { }); }); +test("detects Muse Code from MUSE_RELEASE_INFO", () => { + const result = detectAgent({ + env: { + MUSE_RELEASE_INFO: JSON.stringify({ + channel: "muse-stable", + version: "0.1.0-R708.1" + }) + } + }); + + assert.equal(result.detected, true); + assert.deepEqual(result.agent, { + id: "muse", + name: "Muse Code" + }); +}); + test("detects bolt from any known environment variable", () => { for (const envName of ["BOLT_ENV", "BOLT_ORIGIN", "BOLT_SERVER_URL"]) { const result = detectAgent({