@vercel/detect-agent
Advanced tools
+13
-1
@@ -39,2 +39,4 @@ "use strict"; | ||
| const OPENCODE = "opencode"; | ||
| const GITHUB_COPILOT = "github-copilot"; | ||
| const GITHUB_COPILOT_CLI = "github-copilot-cli"; | ||
| const KNOWN_AGENTS = { | ||
@@ -51,3 +53,4 @@ CURSOR, | ||
| AUGMENT_CLI, | ||
| OPENCODE | ||
| OPENCODE, | ||
| GITHUB_COPILOT | ||
| }; | ||
@@ -58,2 +61,8 @@ async function determineAgent() { | ||
| if (name) { | ||
| if (name === GITHUB_COPILOT || name === GITHUB_COPILOT_CLI) { | ||
| return { | ||
| isAgent: true, | ||
| agent: { name: GITHUB_COPILOT } | ||
| }; | ||
| } | ||
| return { | ||
@@ -95,2 +104,5 @@ isAgent: true, | ||
| } | ||
| if (process.env.COPILOT_MODEL || process.env.COPILOT_ALLOW_ALL || process.env.COPILOT_GITHUB_TOKEN) { | ||
| return { isAgent: true, agent: { name: GITHUB_COPILOT } }; | ||
| } | ||
| try { | ||
@@ -97,0 +109,0 @@ await (0, import_promises.access)(DEVIN_LOCAL_PATH, import_node_fs.constants.F_OK); |
+6
-0
| # @vercel/detect-agent | ||
| ## 1.2.1 | ||
| ### Patch Changes | ||
| - Add GitHub Copilot detection support by recognizing `AI_AGENT=github-copilot|github-copilot-cli` and fallback Copilot CLI environment variables (`COPILOT_MODEL`, `COPILOT_ALLOW_ALL`, and `COPILOT_GITHUB_TOKEN`). ([#15449](https://github.com/vercel/vercel/pull/15449)) | ||
| ## 1.2.0 | ||
@@ -4,0 +10,0 @@ |
+3
-1
@@ -12,3 +12,4 @@ declare const CURSOR: "cursor"; | ||
| declare const OPENCODE: "opencode"; | ||
| export type KnownAgentNames = typeof CURSOR | typeof CURSOR_CLI | typeof CLAUDE | typeof COWORK | typeof DEVIN | typeof REPLIT | typeof GEMINI | typeof CODEX | typeof ANTIGRAVITY | typeof AUGMENT_CLI | typeof OPENCODE; | ||
| declare const GITHUB_COPILOT: "github-copilot"; | ||
| export type KnownAgentNames = typeof CURSOR | typeof CURSOR_CLI | typeof CLAUDE | typeof COWORK | typeof DEVIN | typeof REPLIT | typeof GEMINI | typeof CODEX | typeof ANTIGRAVITY | typeof AUGMENT_CLI | typeof OPENCODE | typeof GITHUB_COPILOT; | ||
| export interface KnownAgentDetails { | ||
@@ -36,4 +37,5 @@ name: KnownAgentNames; | ||
| readonly OPENCODE: "opencode"; | ||
| readonly GITHUB_COPILOT: "github-copilot"; | ||
| }; | ||
| export declare function determineAgent(): Promise<AgentResult>; | ||
| export {}; |
+13
-1
@@ -39,2 +39,4 @@ "use strict"; | ||
| const OPENCODE = "opencode"; | ||
| const GITHUB_COPILOT = "github-copilot"; | ||
| const GITHUB_COPILOT_CLI = "github-copilot-cli"; | ||
| const KNOWN_AGENTS = { | ||
@@ -51,3 +53,4 @@ CURSOR, | ||
| AUGMENT_CLI, | ||
| OPENCODE | ||
| OPENCODE, | ||
| GITHUB_COPILOT | ||
| }; | ||
@@ -58,2 +61,8 @@ async function determineAgent() { | ||
| if (name) { | ||
| if (name === GITHUB_COPILOT || name === GITHUB_COPILOT_CLI) { | ||
| return { | ||
| isAgent: true, | ||
| agent: { name: GITHUB_COPILOT } | ||
| }; | ||
| } | ||
| return { | ||
@@ -95,2 +104,5 @@ isAgent: true, | ||
| } | ||
| if (process.env.COPILOT_MODEL || process.env.COPILOT_ALLOW_ALL || process.env.COPILOT_GITHUB_TOKEN) { | ||
| return { isAgent: true, agent: { name: GITHUB_COPILOT } }; | ||
| } | ||
| try { | ||
@@ -97,0 +109,0 @@ await (0, import_promises.access)(DEVIN_LOCAL_PATH, import_node_fs.constants.F_OK); |
+1
-1
| { | ||
| "name": "@vercel/detect-agent", | ||
| "version": "1.2.0", | ||
| "version": "1.2.1", | ||
| "description": "Detect if code is running in an AI agent or automated development environment", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
+1
-0
@@ -35,2 +35,3 @@ # @vercel/detect-agent | ||
| - **Antigravity** (Google DeepMind) | ||
| - **GitHub Copilot** (via `AI_AGENT=github-copilot|github-copilot-cli`, `COPILOT_MODEL`, `COPILOT_ALLOW_ALL`, or `COPILOT_GITHUB_TOKEN`) | ||
| - **Replit** (online IDE) | ||
@@ -37,0 +38,0 @@ |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances
25784
5.98%269
10.7%126
0.8%40
17.65%