(fullAgentId: string)
| 223 | * - 'codebuff/file-picker@0.0.2' |
| 224 | */ |
| 225 | export 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 | } |
no test coverage detected