From 338444cc79e00bae1c0dbeeff1b8f24ad28f81a2 Mon Sep 17 00:00:00 2001 From: David Mokos Date: Wed, 23 Sep 2026 14:16:50 +0200 Subject: [PATCH] adds Factory Droid detection --- README.md | 1 + package-lock.json | 4 ++-- package.json | 2 +- src/agents.ts | 5 +++++ src/types.ts | 1 + test/detector.test.mjs | 14 ++++++++++++++ 6 files changed, 24 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c4fb0dc..d8a0c0a 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ Officially supported coding agents: | [Codex](https://developers.openai.com/codex/) | `codex` | ✅ | | [Cursor](https://cursor.com/) | `cursor` | ✅ | | [Devin](https://devin.ai/) | `devin` | 🚫 | +| [Factory Droid](https://docs.factory.ai/droid-cli/overview) | `droid` | 🚫 | | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `gemini` | 🚫 | | [GitHub Copilot CLI](https://github.com/github/copilot-cli) | `copilot` | ✅ | | [Grok](https://x.ai/build) | `grok` | ✅ | diff --git a/package-lock.json b/package-lock.json index 6cd04f1..8fc3c28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "agent-cli-detector", - "version": "0.1.7", + "version": "0.1.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "agent-cli-detector", - "version": "0.1.7", + "version": "0.1.8", "license": "MIT", "bin": { "agent-cli-detector": "dist/cli.js" diff --git a/package.json b/package.json index d90825b..71afd69 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "agent-cli-detector", - "version": "0.1.7", + "version": "0.1.8", "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 0f2ff37..2919a44 100644 --- a/src/agents.ts +++ b/src/agents.ts @@ -46,6 +46,11 @@ export const defaultAgents = [ name: "Devin", process: [{ pattern: /devin/i }] }, + { + id: "droid", + name: "Factory Droid", + env: [{ name: "FACTORY_ENV", value: "production" }] + }, { id: "gemini", name: "Gemini CLI", diff --git a/src/types.ts b/src/types.ts index a9c29fd..996f5d0 100644 --- a/src/types.ts +++ b/src/types.ts @@ -6,6 +6,7 @@ export type AgentId = | "copilot" | "cursor" | "devin" + | "droid" | "gemini" | "grok" | "kiro" diff --git a/test/detector.test.mjs b/test/detector.test.mjs index 7c0f447..112f39f 100644 --- a/test/detector.test.mjs +++ b/test/detector.test.mjs @@ -80,6 +80,20 @@ test("detects grok and normalizes its session id", () => { }); }); +test("detects Factory Droid from FACTORY_ENV", () => { + const result = detectAgent({ + env: { + FACTORY_ENV: "production" + } + }); + + assert.equal(result.detected, true); + assert.deepEqual(result.agent, { + id: "droid", + name: "Factory Droid" + }); +}); + test("detects rork from RORK_API_URL", () => { const result = detectAgent({ env: {