MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / isFreeAgent

Function isFreeAgent

common/src/constants/free-agents.ts:225–239  ·  view source on GitHub ↗
(fullAgentId: string)

Source from the content-addressed store, hash-verified

223 * - 'codebuff/file-picker@0.0.2'
224 */
225export function isFreeAgent(fullAgentId: string): boolean {
226 const { publisherId, agentId } = parseAgentId(fullAgentId)
227
228 // Must have a valid agent ID
229 if (!agentId) return false
230
231 // Must be in the free tier agents list
232 if (!FREE_TIER_AGENTS.has(agentId)) return false
233
234 // Must be either internal (no publisher) or from codebuff
235 // This prevents publisher spoofing attacks
236 if (publisherId && publisherId !== 'codebuff') return false
237
238 return true
239}

Callers 1

consumeCreditsForMessageFunction · 0.90

Calls 1

parseAgentIdFunction · 0.90

Tested by

no test coverage detected