Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` | 🚫 |
Expand Down
9 changes: 9 additions & 0 deletions src/agents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type AgentId =
| "droid"
| "gemini"
| "grok"
| "grok-bot"
| "kiro"
| "kilocode"
| "claude-code"
Expand Down
47 changes: 47 additions & 0 deletions test/detector.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Loading