mirror of
https://github.com/expo/agent-cli-detector.git
synced 2026-11-13 20:11:27 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2f8b90f53 | ||
|
|
e308d262b1 |
No files matched your search
@@ -41,9 +41,11 @@ 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` | ✅ |
|
||||
| [Grok Bot](https://x.ai/bot) | `grok-bot` | ✅ |
|
||||
| [Kilo Code](https://kilocode.ai/) | `kilocode` | ✅ |
|
||||
| [Kiro](https://kiro.dev/) | `kiro` | ✅ |
|
||||
| [Muse Code][muse-code] | `muse` | 🚫 |
|
||||
|
||||
Generated
+2
-2
@@ -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"
|
||||
|
||||
+1
-1
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
@@ -46,6 +55,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",
|
||||
|
||||
@@ -6,8 +6,10 @@ export type AgentId =
|
||||
| "copilot"
|
||||
| "cursor"
|
||||
| "devin"
|
||||
| "droid"
|
||||
| "gemini"
|
||||
| "grok"
|
||||
| "grok-bot"
|
||||
| "kiro"
|
||||
| "kilocode"
|
||||
| "claude-code"
|
||||
|
||||
@@ -80,6 +80,67 @@ 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: {
|
||||
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: {
|
||||
|
||||
Reference in new issue
Block a user