Download src/tools/AgentTool/builtInAgents.ts from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 2.99 kB
-
https://huggingface.co/chenbhao/codev/resolve/afbc7edaae4e6bb0102ba024b49ce8be89d2264c/src/tools/AgentTool/builtInAgents.ts
- Command line
-
hf download hf://chenbhao/codev@afbc7edaae4e6bb0102ba024b49ce8be89d2264c/src/tools/AgentTool/builtInAgents.ts
-
curl -L -o builtInAgents.ts https://huggingface.co/chenbhao/codev/resolve/afbc7edaae4e6bb0102ba024b49ce8be89d2264c/src/tools/AgentTool/builtInAgents.ts
2.99 kB
| import { feature } from 'bun:bundle' | |
| import { getIsNonInteractiveSession } from '../../bootstrap/state.js' | |
| import { getFeatureValue_CACHED_MAY_BE_STALE } from '../../services/analytics/growthbook.js' | |
| import { isEnvTruthy } from '../../utils/envUtils.js' | |
| import { VERSPER_CLAW_GUIDE_AGENT } from './built-in/versperClawGuideAgent.js' | |
| import { EXPLORE_AGENT } from './built-in/exploreAgent.js' | |
| import { GENERAL_PURPOSE_AGENT } from './built-in/generalPurposeAgent.js' | |
| import { PLAN_AGENT } from './built-in/planAgent.js' | |
| import { STATUSLINE_SETUP_AGENT } from './built-in/statuslineSetup.js' | |
| import { VERIFICATION_AGENT } from './built-in/verificationAgent.js' | |
| import type { AgentDefinition } from './loadAgentsDir.js' | |
| export function areExplorePlanAgentsEnabled(): boolean { | |
| if (process.env.USER_TYPE !== 'ant') { | |
| return true | |
| } | |
| if (feature('BUILTIN_EXPLORE_PLAN_AGENTS')) { | |
| // 3P default: true — Bedrock/Vertex keep agents enabled (matches pre-experiment | |
| // external behavior). A/B test treatment sets false to measure impact of removal. | |
| return getFeatureValue_CACHED_MAY_BE_STALE('tengu_amber_stoat', true) | |
| } | |
| return false | |
| } | |
| function isVerificationAgentEnabled(): boolean { | |
| if (process.env.USER_TYPE !== 'ant') { | |
| return true | |
| } | |
| if (feature('VERIFICATION_AGENT')) { | |
| return getFeatureValue_CACHED_MAY_BE_STALE('tengu_hive_evidence', false) | |
| } | |
| return false | |
| } | |
| export function getBuiltInAgents(): AgentDefinition[] { | |
| // Allow disabling all built-in agents via env var (useful for SDK users who want a blank slate) | |
| // Only applies in noninteractive mode (SDK/API usage) | |
| if ( | |
| isEnvTruthy(process.env.CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS) && | |
| getIsNonInteractiveSession() | |
| ) { | |
| return [] | |
| } | |
| // Use lazy require inside the function body to avoid circular dependency | |
| // issues at module init time. The coordinatorMode module depends on tools | |
| // which depend on AgentTool which imports this file. | |
| if (feature('COORDINATOR_MODE')) { | |
| if (isEnvTruthy(process.env.CLAUDE_CODE_COORDINATOR_MODE)) { | |
| /* eslint-disable @typescript-eslint/no-require-imports */ | |
| const { getCoordinatorAgents } = | |
| require('../../coordinator/workerAgent.js') as typeof import('../../coordinator/workerAgent.js') | |
| /* eslint-enable @typescript-eslint/no-require-imports */ | |
| return getCoordinatorAgents() | |
| } | |
| } | |
| const agents: AgentDefinition[] = [ | |
| GENERAL_PURPOSE_AGENT, | |
| STATUSLINE_SETUP_AGENT, | |
| ] | |
| if (areExplorePlanAgentsEnabled()) { | |
| agents.push(EXPLORE_AGENT, PLAN_AGENT) | |
| } | |
| // Include Code Guide agent for non-SDK entrypoints | |
| const isNonSdkEntrypoint = | |
| process.env.CLAUDE_CODE_ENTRYPOINT !== 'sdk-ts' && | |
| process.env.CLAUDE_CODE_ENTRYPOINT !== 'sdk-py' && | |
| process.env.CLAUDE_CODE_ENTRYPOINT !== 'sdk-cli' | |
| if (isNonSdkEntrypoint) { | |
| agents.push(VERSPER_CLAW_GUIDE_AGENT) | |
| } | |
| if (isVerificationAgentEnabled()) { | |
| agents.push(VERIFICATION_AGENT) | |
| } | |
| return agents | |
| } | |