diff --git a/README.md b/README.md index d8a0c0a..627afc6 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ Officially supported coding agents: | [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` | ✅ | +| [Grok Bot](https://x.ai/bot) | `grok-bot` | ✅ | | [Kilo Code](https://kilocode.ai/) | `kilocode` | ✅ | | [Kiro](https://kiro.dev/) | `kiro` | ✅ | | [Muse Code][muse-code] | `muse` | 🚫 | diff --git a/src/agents.ts b/src/agents.ts index 2919a44..145b253 100644 --- a/src/agents.ts +++ b/src/agents.ts @@ -12,6 +12,15 @@ export const defaultAgents = [ process: [{ pattern: /^codex$/i }], sessionEnv: ["CODEX_THREAD_ID"] }, + { + id: "grok-bot", + name: "Grok Bot", + env: [ + { name: "SAND_BOX_BOOT_ID" }, + { name: "SAND_BOX_STORE_ID" } + ], + sessionEnv: ["CURSOR_CONVERSATION_ID"] + }, { id: "cursor", name: "Cursor", diff --git a/src/types.ts b/src/types.ts index 996f5d0..ba1c29d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -9,6 +9,7 @@ export type AgentId = | "droid" | "gemini" | "grok" + | "grok-bot" | "kiro" | "kilocode" | "claude-code" diff --git a/test/detector.test.mjs b/test/detector.test.mjs index 112f39f..a98ad9d 100644 --- a/test/detector.test.mjs +++ b/test/detector.test.mjs @@ -80,6 +80,53 @@ test("detects grok and normalizes its session id", () => { }); }); +test("detects Grok Bot from SAND_BOX_BOOT_ID and normalizes the conversation id", () => { + const result = detectAgent({ + env: { + CURSOR_AGENT: "1", + CURSOR_CONVERSATION_ID: "conversation-123", + SAND_BOX_BOOT_ID: "boot-456" + } + }); + + assert.equal(result.detected, true); + assert.deepEqual(result.agent, { + id: "grok-bot", + name: "Grok Bot", + sessionId: "conversation-123" + }); +}); + +test("detects cursor from CURSOR_AGENT without Grok Bot signals", () => { + const result = detectAgent({ + env: { + CURSOR_AGENT: "1", + CURSOR_CONVERSATION_ID: "conversation-123" + } + }); + + assert.equal(result.detected, true); + assert.deepEqual(result.agent, { + id: "cursor", + name: "Cursor", + sessionId: "conversation-123" + }); +}); + +test("detects Grok Bot from SAND_BOX_STORE_ID alone", () => { + const result = detectAgent({ + env: { + SAND_BOX_STORE_ID: "store-789" + } + }); + + assert.equal(result.detected, true); + assert.deepEqual(result.agent, { + id: "grok-bot", + name: "Grok Bot" + }); +}); + test("detects Factory Droid from FACTORY_ENV", () => { const result = detectAgent({ env: {