MCPcopy Create free account
hub / github.com/arctic-cli/interface / getCopilotMultiplier

Function getCopilotMultiplier

packages/arctic/src/provider/pricing.ts:423–446  ·  view source on GitHub ↗
(modelId: string, plan: CopilotPlanType)

Source from the content-addressed store, hash-verified

421 }
422
423 export function getCopilotMultiplier(modelId: string, plan: CopilotPlanType): number | null {
424 const candidates = copilotModelCandidates(modelId)
425 let entry: CopilotMultiplier | undefined
426
427 for (const candidate of candidates) {
428 entry = COPILOT_MULTIPLIERS[candidate]
429 if (entry) break
430 }
431
432 if (!entry) {
433 const normalizedCandidates = new Set(candidates.map((candidate) => normalizeModelId(candidate)))
434
435 for (const [key, value] of Object.entries(COPILOT_MULTIPLIERS)) {
436 const normalizedKey = normalizeModelId(key)
437 if (normalizedCandidates.has(normalizedKey)) {
438 entry = value
439 break
440 }
441 }
442 }
443
444 if (!entry) return null
445 return plan === "free" ? entry.free : entry.paid
446 }
447
448 export function isCopilotModelAvailable(modelId: string, plan: CopilotPlanType): boolean {
449 const multiplier = getCopilotMultiplier(modelId, plan)

Callers 1

isCopilotModelAvailableFunction · 0.85

Calls 2

copilotModelCandidatesFunction · 0.85
normalizeModelIdFunction · 0.85

Tested by

no test coverage detected