@vercel/detect-agent
Advanced tools
+11
-1
@@ -35,2 +35,4 @@ "use strict"; | ||
| const CODEX = "codex"; | ||
| const AUGMENT_CLI = "augment-cli"; | ||
| const OPENCODE = "opencode"; | ||
| const KNOWN_AGENTS = { | ||
@@ -43,3 +45,5 @@ CURSOR, | ||
| GEMINI, | ||
| CODEX | ||
| CODEX, | ||
| AUGMENT_CLI, | ||
| OPENCODE | ||
| }; | ||
@@ -68,2 +72,8 @@ async function determineAgent() { | ||
| } | ||
| if (process.env.AUGMENT_AGENT) { | ||
| return { isAgent: true, agent: { name: AUGMENT_CLI } }; | ||
| } | ||
| if (process.env.OPENCODE_CLIENT) { | ||
| return { isAgent: true, agent: { name: OPENCODE } }; | ||
| } | ||
| if (process.env.CLAUDECODE || process.env.CLAUDE_CODE) { | ||
@@ -70,0 +80,0 @@ return { isAgent: true, agent: { name: CLAUDE } }; |
+6
-0
| # @vercel/detect-agent | ||
| ## 1.1.0 | ||
| ### Minor Changes | ||
| - Detect Augment and OpenCode agents ([#14635](https://github.com/vercel/vercel/pull/14635)) | ||
| ## 1.0.0 | ||
@@ -4,0 +10,0 @@ |
+5
-1
@@ -8,3 +8,5 @@ declare const CURSOR: "cursor"; | ||
| declare const CODEX: "codex"; | ||
| export type KnownAgentNames = typeof CURSOR | typeof CURSOR_CLI | typeof CLAUDE | typeof DEVIN | typeof REPLIT | typeof GEMINI | typeof CODEX; | ||
| declare const AUGMENT_CLI: "augment-cli"; | ||
| declare const OPENCODE: "opencode"; | ||
| export type KnownAgentNames = typeof CURSOR | typeof CURSOR_CLI | typeof CLAUDE | typeof DEVIN | typeof REPLIT | typeof GEMINI | typeof CODEX | typeof AUGMENT_CLI | typeof OPENCODE; | ||
| export interface KnownAgentDetails { | ||
@@ -28,4 +30,6 @@ name: KnownAgentNames; | ||
| readonly CODEX: "codex"; | ||
| readonly AUGMENT_CLI: "augment-cli"; | ||
| readonly OPENCODE: "opencode"; | ||
| }; | ||
| export declare function determineAgent(): Promise<AgentResult>; | ||
| export {}; |
+11
-1
@@ -35,2 +35,4 @@ "use strict"; | ||
| const CODEX = "codex"; | ||
| const AUGMENT_CLI = "augment-cli"; | ||
| const OPENCODE = "opencode"; | ||
| const KNOWN_AGENTS = { | ||
@@ -43,3 +45,5 @@ CURSOR, | ||
| GEMINI, | ||
| CODEX | ||
| CODEX, | ||
| AUGMENT_CLI, | ||
| OPENCODE | ||
| }; | ||
@@ -68,2 +72,8 @@ async function determineAgent() { | ||
| } | ||
| if (process.env.AUGMENT_AGENT) { | ||
| return { isAgent: true, agent: { name: AUGMENT_CLI } }; | ||
| } | ||
| if (process.env.OPENCODE_CLIENT) { | ||
| return { isAgent: true, agent: { name: OPENCODE } }; | ||
| } | ||
| if (process.env.CLAUDECODE || process.env.CLAUDE_CODE) { | ||
@@ -70,0 +80,0 @@ return { isAgent: true, agent: { name: CLAUDE } }; |
+1
-1
| { | ||
| "name": "@vercel/detect-agent", | ||
| "version": "1.0.0", | ||
| "version": "1.1.0", | ||
| "description": "Detect if code is running in an AI agent or automated development environment", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances
22891
4.05%219
12.31%26
18.18%