@roo-code/types
Version:
TypeScript type definitions for Roo Code.
1,543 lines (1,530 loc) • 253 kB
JavaScript
// src/cloud.ts
import { z as z16 } from "zod";
// src/events.ts
import { z as z3 } from "zod";
// src/message.ts
import { z } from "zod";
var clineAsks = [
"followup",
"command",
"command_output",
"completion_result",
"tool",
"api_req_failed",
"resume_task",
"resume_completed_task",
"mistake_limit_reached",
"browser_action_launch",
"use_mcp_server",
"auto_approval_max_req_reached"
];
var clineAskSchema = z.enum(clineAsks);
var idleAsks = [
"completion_result",
"api_req_failed",
"resume_completed_task",
"mistake_limit_reached",
"auto_approval_max_req_reached"
];
function isIdleAsk(ask) {
return idleAsks.includes(ask);
}
var resumableAsks = ["resume_task"];
function isResumableAsk(ask) {
return resumableAsks.includes(ask);
}
var interactiveAsks = [
"followup",
"command",
"tool",
"browser_action_launch",
"use_mcp_server"
];
function isInteractiveAsk(ask) {
return interactiveAsks.includes(ask);
}
var nonBlockingAsks = ["command_output"];
function isNonBlockingAsk(ask) {
return nonBlockingAsks.includes(ask);
}
var clineSays = [
"error",
"api_req_started",
"api_req_finished",
"api_req_retried",
"api_req_retry_delayed",
"api_req_rate_limit_wait",
"api_req_deleted",
"text",
"image",
"reasoning",
"completion_result",
"user_feedback",
"user_feedback_diff",
"command_output",
"shell_integration_warning",
"browser_action",
"browser_action_result",
"browser_session_status",
"mcp_server_request_started",
"mcp_server_response",
"subtask_result",
"checkpoint_saved",
"rooignore_error",
"diff_error",
"condense_context",
"condense_context_error",
"sliding_window_truncation",
"codebase_search_result",
"user_edit_todos"
];
var clineSaySchema = z.enum(clineSays);
var toolProgressStatusSchema = z.object({
icon: z.string().optional(),
text: z.string().optional()
});
var contextCondenseSchema = z.object({
cost: z.number(),
prevContextTokens: z.number(),
newContextTokens: z.number(),
summary: z.string(),
condenseId: z.string().optional()
});
var contextTruncationSchema = z.object({
truncationId: z.string(),
messagesRemoved: z.number(),
prevContextTokens: z.number(),
newContextTokens: z.number()
});
var clineMessageSchema = z.object({
ts: z.number(),
type: z.union([z.literal("ask"), z.literal("say")]),
ask: clineAskSchema.optional(),
say: clineSaySchema.optional(),
text: z.string().optional(),
images: z.array(z.string()).optional(),
partial: z.boolean().optional(),
reasoning: z.string().optional(),
conversationHistoryIndex: z.number().optional(),
checkpoint: z.record(z.string(), z.unknown()).optional(),
progressStatus: toolProgressStatusSchema.optional(),
/**
* Data for successful context condensation.
* Present when `say: "condense_context"` and `partial: false`.
*/
contextCondense: contextCondenseSchema.optional(),
/**
* Data for sliding window truncation.
* Present when `say: "sliding_window_truncation"`.
*/
contextTruncation: contextTruncationSchema.optional(),
isProtected: z.boolean().optional(),
apiProtocol: z.union([z.literal("openai"), z.literal("anthropic")]).optional(),
isAnswered: z.boolean().optional()
});
var tokenUsageSchema = z.object({
totalTokensIn: z.number(),
totalTokensOut: z.number(),
totalCacheWrites: z.number().optional(),
totalCacheReads: z.number().optional(),
totalCost: z.number(),
contextTokens: z.number()
});
var queuedMessageSchema = z.object({
timestamp: z.number(),
id: z.string(),
text: z.string(),
images: z.array(z.string()).optional()
});
// src/tool.ts
import { z as z2 } from "zod";
var toolGroups = ["read", "edit", "browser", "command", "mcp", "modes"];
var toolGroupsSchema = z2.enum(toolGroups);
var toolNames = [
"execute_command",
"read_file",
"write_to_file",
"apply_diff",
"search_and_replace",
"search_replace",
"edit_file",
"apply_patch",
"search_files",
"list_files",
"browser_action",
"use_mcp_tool",
"access_mcp_resource",
"ask_followup_question",
"attempt_completion",
"switch_mode",
"new_task",
"fetch_instructions",
"codebase_search",
"update_todo_list",
"run_slash_command",
"generate_image",
"custom_tool"
];
var toolNamesSchema = z2.enum(toolNames);
var toolUsageSchema = z2.record(
toolNamesSchema,
z2.object({
attempts: z2.number(),
failures: z2.number()
})
);
var TOOL_PROTOCOL = {
XML: "xml",
NATIVE: "native"
};
var NATIVE_TOOL_DEFAULTS = {
supportsNativeTools: true,
defaultToolProtocol: TOOL_PROTOCOL.NATIVE
};
function isNativeProtocol(protocol) {
return protocol === TOOL_PROTOCOL.NATIVE;
}
function getEffectiveProtocol(toolProtocol) {
return toolProtocol || TOOL_PROTOCOL.XML;
}
// src/events.ts
var RooCodeEventName = /* @__PURE__ */ ((RooCodeEventName2) => {
RooCodeEventName2["TaskCreated"] = "taskCreated";
RooCodeEventName2["TaskStarted"] = "taskStarted";
RooCodeEventName2["TaskCompleted"] = "taskCompleted";
RooCodeEventName2["TaskAborted"] = "taskAborted";
RooCodeEventName2["TaskFocused"] = "taskFocused";
RooCodeEventName2["TaskUnfocused"] = "taskUnfocused";
RooCodeEventName2["TaskActive"] = "taskActive";
RooCodeEventName2["TaskInteractive"] = "taskInteractive";
RooCodeEventName2["TaskResumable"] = "taskResumable";
RooCodeEventName2["TaskIdle"] = "taskIdle";
RooCodeEventName2["TaskPaused"] = "taskPaused";
RooCodeEventName2["TaskUnpaused"] = "taskUnpaused";
RooCodeEventName2["TaskSpawned"] = "taskSpawned";
RooCodeEventName2["TaskDelegated"] = "taskDelegated";
RooCodeEventName2["TaskDelegationCompleted"] = "taskDelegationCompleted";
RooCodeEventName2["TaskDelegationResumed"] = "taskDelegationResumed";
RooCodeEventName2["Message"] = "message";
RooCodeEventName2["TaskModeSwitched"] = "taskModeSwitched";
RooCodeEventName2["TaskAskResponded"] = "taskAskResponded";
RooCodeEventName2["TaskUserMessage"] = "taskUserMessage";
RooCodeEventName2["TaskTokenUsageUpdated"] = "taskTokenUsageUpdated";
RooCodeEventName2["TaskToolFailed"] = "taskToolFailed";
RooCodeEventName2["ModeChanged"] = "modeChanged";
RooCodeEventName2["ProviderProfileChanged"] = "providerProfileChanged";
RooCodeEventName2["EvalPass"] = "evalPass";
RooCodeEventName2["EvalFail"] = "evalFail";
return RooCodeEventName2;
})(RooCodeEventName || {});
var rooCodeEventsSchema = z3.object({
["taskCreated" /* TaskCreated */]: z3.tuple([z3.string()]),
["taskStarted" /* TaskStarted */]: z3.tuple([z3.string()]),
["taskCompleted" /* TaskCompleted */]: z3.tuple([
z3.string(),
tokenUsageSchema,
toolUsageSchema,
z3.object({
isSubtask: z3.boolean()
})
]),
["taskAborted" /* TaskAborted */]: z3.tuple([z3.string()]),
["taskFocused" /* TaskFocused */]: z3.tuple([z3.string()]),
["taskUnfocused" /* TaskUnfocused */]: z3.tuple([z3.string()]),
["taskActive" /* TaskActive */]: z3.tuple([z3.string()]),
["taskInteractive" /* TaskInteractive */]: z3.tuple([z3.string()]),
["taskResumable" /* TaskResumable */]: z3.tuple([z3.string()]),
["taskIdle" /* TaskIdle */]: z3.tuple([z3.string()]),
["taskPaused" /* TaskPaused */]: z3.tuple([z3.string()]),
["taskUnpaused" /* TaskUnpaused */]: z3.tuple([z3.string()]),
["taskSpawned" /* TaskSpawned */]: z3.tuple([z3.string(), z3.string()]),
["taskDelegated" /* TaskDelegated */]: z3.tuple([
z3.string(),
// parentTaskId
z3.string()
// childTaskId
]),
["taskDelegationCompleted" /* TaskDelegationCompleted */]: z3.tuple([
z3.string(),
// parentTaskId
z3.string(),
// childTaskId
z3.string()
// completionResultSummary
]),
["taskDelegationResumed" /* TaskDelegationResumed */]: z3.tuple([
z3.string(),
// parentTaskId
z3.string()
// childTaskId
]),
["message" /* Message */]: z3.tuple([
z3.object({
taskId: z3.string(),
action: z3.union([z3.literal("created"), z3.literal("updated")]),
message: clineMessageSchema
})
]),
["taskModeSwitched" /* TaskModeSwitched */]: z3.tuple([z3.string(), z3.string()]),
["taskAskResponded" /* TaskAskResponded */]: z3.tuple([z3.string()]),
["taskUserMessage" /* TaskUserMessage */]: z3.tuple([z3.string()]),
["taskToolFailed" /* TaskToolFailed */]: z3.tuple([z3.string(), toolNamesSchema, z3.string()]),
["taskTokenUsageUpdated" /* TaskTokenUsageUpdated */]: z3.tuple([z3.string(), tokenUsageSchema, toolUsageSchema]),
["modeChanged" /* ModeChanged */]: z3.tuple([z3.string()]),
["providerProfileChanged" /* ProviderProfileChanged */]: z3.tuple([z3.object({ name: z3.string(), provider: z3.string() })])
});
var taskEventSchema = z3.discriminatedUnion("eventName", [
// Task Provider Lifecycle
z3.object({
eventName: z3.literal("taskCreated" /* TaskCreated */),
payload: rooCodeEventsSchema.shape["taskCreated" /* TaskCreated */],
taskId: z3.number().optional()
}),
// Task Lifecycle
z3.object({
eventName: z3.literal("taskStarted" /* TaskStarted */),
payload: rooCodeEventsSchema.shape["taskStarted" /* TaskStarted */],
taskId: z3.number().optional()
}),
z3.object({
eventName: z3.literal("taskCompleted" /* TaskCompleted */),
payload: rooCodeEventsSchema.shape["taskCompleted" /* TaskCompleted */],
taskId: z3.number().optional()
}),
z3.object({
eventName: z3.literal("taskAborted" /* TaskAborted */),
payload: rooCodeEventsSchema.shape["taskAborted" /* TaskAborted */],
taskId: z3.number().optional()
}),
z3.object({
eventName: z3.literal("taskFocused" /* TaskFocused */),
payload: rooCodeEventsSchema.shape["taskFocused" /* TaskFocused */],
taskId: z3.number().optional()
}),
z3.object({
eventName: z3.literal("taskUnfocused" /* TaskUnfocused */),
payload: rooCodeEventsSchema.shape["taskUnfocused" /* TaskUnfocused */],
taskId: z3.number().optional()
}),
z3.object({
eventName: z3.literal("taskActive" /* TaskActive */),
payload: rooCodeEventsSchema.shape["taskActive" /* TaskActive */],
taskId: z3.number().optional()
}),
z3.object({
eventName: z3.literal("taskInteractive" /* TaskInteractive */),
payload: rooCodeEventsSchema.shape["taskInteractive" /* TaskInteractive */],
taskId: z3.number().optional()
}),
z3.object({
eventName: z3.literal("taskResumable" /* TaskResumable */),
payload: rooCodeEventsSchema.shape["taskResumable" /* TaskResumable */],
taskId: z3.number().optional()
}),
z3.object({
eventName: z3.literal("taskIdle" /* TaskIdle */),
payload: rooCodeEventsSchema.shape["taskIdle" /* TaskIdle */],
taskId: z3.number().optional()
}),
// Subtask Lifecycle
z3.object({
eventName: z3.literal("taskPaused" /* TaskPaused */),
payload: rooCodeEventsSchema.shape["taskPaused" /* TaskPaused */],
taskId: z3.number().optional()
}),
z3.object({
eventName: z3.literal("taskUnpaused" /* TaskUnpaused */),
payload: rooCodeEventsSchema.shape["taskUnpaused" /* TaskUnpaused */],
taskId: z3.number().optional()
}),
z3.object({
eventName: z3.literal("taskSpawned" /* TaskSpawned */),
payload: rooCodeEventsSchema.shape["taskSpawned" /* TaskSpawned */],
taskId: z3.number().optional()
}),
z3.object({
eventName: z3.literal("taskDelegated" /* TaskDelegated */),
payload: rooCodeEventsSchema.shape["taskDelegated" /* TaskDelegated */],
taskId: z3.number().optional()
}),
z3.object({
eventName: z3.literal("taskDelegationCompleted" /* TaskDelegationCompleted */),
payload: rooCodeEventsSchema.shape["taskDelegationCompleted" /* TaskDelegationCompleted */],
taskId: z3.number().optional()
}),
z3.object({
eventName: z3.literal("taskDelegationResumed" /* TaskDelegationResumed */),
payload: rooCodeEventsSchema.shape["taskDelegationResumed" /* TaskDelegationResumed */],
taskId: z3.number().optional()
}),
// Task Execution
z3.object({
eventName: z3.literal("message" /* Message */),
payload: rooCodeEventsSchema.shape["message" /* Message */],
taskId: z3.number().optional()
}),
z3.object({
eventName: z3.literal("taskModeSwitched" /* TaskModeSwitched */),
payload: rooCodeEventsSchema.shape["taskModeSwitched" /* TaskModeSwitched */],
taskId: z3.number().optional()
}),
z3.object({
eventName: z3.literal("taskAskResponded" /* TaskAskResponded */),
payload: rooCodeEventsSchema.shape["taskAskResponded" /* TaskAskResponded */],
taskId: z3.number().optional()
}),
// Task Analytics
z3.object({
eventName: z3.literal("taskToolFailed" /* TaskToolFailed */),
payload: rooCodeEventsSchema.shape["taskToolFailed" /* TaskToolFailed */],
taskId: z3.number().optional()
}),
z3.object({
eventName: z3.literal("taskTokenUsageUpdated" /* TaskTokenUsageUpdated */),
payload: rooCodeEventsSchema.shape["taskTokenUsageUpdated" /* TaskTokenUsageUpdated */],
taskId: z3.number().optional()
}),
// Evals
z3.object({
eventName: z3.literal("evalPass" /* EvalPass */),
payload: z3.undefined(),
taskId: z3.number()
}),
z3.object({
eventName: z3.literal("evalFail" /* EvalFail */),
payload: z3.undefined(),
taskId: z3.number()
})
]);
// src/task.ts
import { z as z4 } from "zod";
var TaskStatus = /* @__PURE__ */ ((TaskStatus2) => {
TaskStatus2["Running"] = "running";
TaskStatus2["Interactive"] = "interactive";
TaskStatus2["Resumable"] = "resumable";
TaskStatus2["Idle"] = "idle";
TaskStatus2["None"] = "none";
return TaskStatus2;
})(TaskStatus || {});
var taskMetadataSchema = z4.object({
task: z4.string().optional(),
images: z4.array(z4.string()).optional()
});
// src/global-settings.ts
import { z as z14 } from "zod";
// src/provider-settings.ts
import { z as z8 } from "zod";
// src/model.ts
import { z as z5 } from "zod";
var reasoningEfforts = ["low", "medium", "high"];
var reasoningEffortsSchema = z5.enum(reasoningEfforts);
var reasoningEffortWithMinimalSchema = z5.union([reasoningEffortsSchema, z5.literal("minimal")]);
var reasoningEffortsExtended = ["none", "minimal", "low", "medium", "high", "xhigh"];
var reasoningEffortExtendedSchema = z5.enum(reasoningEffortsExtended);
var reasoningEffortSettingValues = ["disable", "none", "minimal", "low", "medium", "high", "xhigh"];
var reasoningEffortSettingSchema = z5.enum(reasoningEffortSettingValues);
var verbosityLevels = ["low", "medium", "high"];
var verbosityLevelsSchema = z5.enum(verbosityLevels);
var serviceTiers = ["default", "flex", "priority"];
var serviceTierSchema = z5.enum(serviceTiers);
var modelParameters = ["max_tokens", "temperature", "reasoning", "include_reasoning"];
var modelParametersSchema = z5.enum(modelParameters);
var isModelParameter = (value) => modelParameters.includes(value);
var modelInfoSchema = z5.object({
maxTokens: z5.number().nullish(),
maxThinkingTokens: z5.number().nullish(),
contextWindow: z5.number(),
supportsImages: z5.boolean().optional(),
supportsPromptCache: z5.boolean(),
// Optional default prompt cache retention policy for providers that support it.
// When set to "24h", extended prompt caching will be requested; when omitted
// or set to "in_memory", the default in‑memory cache is used.
promptCacheRetention: z5.enum(["in_memory", "24h"]).optional(),
// Capability flag to indicate whether the model supports an output verbosity parameter
supportsVerbosity: z5.boolean().optional(),
supportsReasoningBudget: z5.boolean().optional(),
// Capability flag to indicate whether the model supports simple on/off binary reasoning
supportsReasoningBinary: z5.boolean().optional(),
// Capability flag to indicate whether the model supports temperature parameter
supportsTemperature: z5.boolean().optional(),
defaultTemperature: z5.number().optional(),
requiredReasoningBudget: z5.boolean().optional(),
supportsReasoningEffort: z5.union([z5.boolean(), z5.array(z5.enum(["disable", "none", "minimal", "low", "medium", "high", "xhigh"]))]).optional(),
requiredReasoningEffort: z5.boolean().optional(),
preserveReasoning: z5.boolean().optional(),
supportedParameters: z5.array(modelParametersSchema).optional(),
inputPrice: z5.number().optional(),
outputPrice: z5.number().optional(),
cacheWritesPrice: z5.number().optional(),
cacheReadsPrice: z5.number().optional(),
description: z5.string().optional(),
// Default effort value for models that support reasoning effort
reasoningEffort: reasoningEffortExtendedSchema.optional(),
minTokensPerCachePoint: z5.number().optional(),
maxCachePoints: z5.number().optional(),
cachableFields: z5.array(z5.string()).optional(),
// Flag to indicate if the model is deprecated and should not be used
deprecated: z5.boolean().optional(),
// Flag to indicate if the model should hide vendor/company identity in responses
isStealthModel: z5.boolean().optional(),
// Flag to indicate if the model is free (no cost)
isFree: z5.boolean().optional(),
// Flag to indicate if the model supports native tool calling (OpenAI-style function calling)
supportsNativeTools: z5.boolean().optional(),
// Default tool protocol preferred by this model (if not specified, falls back to capability/provider defaults)
defaultToolProtocol: z5.enum(["xml", "native"]).optional(),
// Exclude specific native tools from being available (only applies to native protocol)
// These tools will be removed from the set of tools available to the model
excludedTools: z5.array(z5.string()).optional(),
// Include specific native tools (only applies to native protocol)
// These tools will be added if they belong to an allowed group in the current mode
// Cannot force-add tools from groups the mode doesn't allow
includedTools: z5.array(z5.string()).optional(),
/**
* Service tiers with pricing information.
* Each tier can have a name (for OpenAI service tiers) and pricing overrides.
* The top-level input/output/cache* fields represent the default/standard tier.
*/
tiers: z5.array(
z5.object({
name: serviceTierSchema.optional(),
// Service tier name (flex, priority, etc.)
contextWindow: z5.number(),
inputPrice: z5.number().optional(),
outputPrice: z5.number().optional(),
cacheWritesPrice: z5.number().optional(),
cacheReadsPrice: z5.number().optional()
})
).optional()
});
// src/codebase-index.ts
import { z as z6 } from "zod";
var CODEBASE_INDEX_DEFAULTS = {
MIN_SEARCH_RESULTS: 10,
MAX_SEARCH_RESULTS: 200,
DEFAULT_SEARCH_RESULTS: 50,
SEARCH_RESULTS_STEP: 10,
MIN_SEARCH_SCORE: 0,
MAX_SEARCH_SCORE: 1,
DEFAULT_SEARCH_MIN_SCORE: 0.4,
SEARCH_SCORE_STEP: 0.05
};
var codebaseIndexConfigSchema = z6.object({
codebaseIndexEnabled: z6.boolean().optional(),
codebaseIndexQdrantUrl: z6.string().optional(),
codebaseIndexEmbedderProvider: z6.enum([
"openai",
"ollama",
"openai-compatible",
"gemini",
"mistral",
"vercel-ai-gateway",
"bedrock",
"openrouter"
]).optional(),
codebaseIndexEmbedderBaseUrl: z6.string().optional(),
codebaseIndexEmbedderModelId: z6.string().optional(),
codebaseIndexEmbedderModelDimension: z6.number().optional(),
codebaseIndexSearchMinScore: z6.number().min(0).max(1).optional(),
codebaseIndexSearchMaxResults: z6.number().min(CODEBASE_INDEX_DEFAULTS.MIN_SEARCH_RESULTS).max(CODEBASE_INDEX_DEFAULTS.MAX_SEARCH_RESULTS).optional(),
// OpenAI Compatible specific fields
codebaseIndexOpenAiCompatibleBaseUrl: z6.string().optional(),
codebaseIndexOpenAiCompatibleModelDimension: z6.number().optional(),
// Bedrock specific fields
codebaseIndexBedrockRegion: z6.string().optional(),
codebaseIndexBedrockProfile: z6.string().optional(),
// OpenRouter specific fields
codebaseIndexOpenRouterSpecificProvider: z6.string().optional()
});
var codebaseIndexModelsSchema = z6.object({
openai: z6.record(z6.string(), z6.object({ dimension: z6.number() })).optional(),
ollama: z6.record(z6.string(), z6.object({ dimension: z6.number() })).optional(),
"openai-compatible": z6.record(z6.string(), z6.object({ dimension: z6.number() })).optional(),
gemini: z6.record(z6.string(), z6.object({ dimension: z6.number() })).optional(),
mistral: z6.record(z6.string(), z6.object({ dimension: z6.number() })).optional(),
"vercel-ai-gateway": z6.record(z6.string(), z6.object({ dimension: z6.number() })).optional(),
openrouter: z6.record(z6.string(), z6.object({ dimension: z6.number() })).optional(),
bedrock: z6.record(z6.string(), z6.object({ dimension: z6.number() })).optional()
});
var codebaseIndexProviderSchema = z6.object({
codeIndexOpenAiKey: z6.string().optional(),
codeIndexQdrantApiKey: z6.string().optional(),
codebaseIndexOpenAiCompatibleBaseUrl: z6.string().optional(),
codebaseIndexOpenAiCompatibleApiKey: z6.string().optional(),
codebaseIndexOpenAiCompatibleModelDimension: z6.number().optional(),
codebaseIndexGeminiApiKey: z6.string().optional(),
codebaseIndexMistralApiKey: z6.string().optional(),
codebaseIndexVercelAiGatewayApiKey: z6.string().optional(),
codebaseIndexOpenRouterApiKey: z6.string().optional()
});
// src/providers/anthropic.ts
var anthropicDefaultModelId = "claude-sonnet-4-5";
var anthropicModels = {
"claude-sonnet-4-5": {
maxTokens: 64e3,
// Overridden to 8k if `enableReasoningEffort` is false.
contextWindow: 2e5,
// Default 200K, extendable to 1M with beta flag 'context-1m-2025-08-07'
supportsImages: true,
supportsPromptCache: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 3,
// $3 per million input tokens (≤200K context)
outputPrice: 15,
// $15 per million output tokens (≤200K context)
cacheWritesPrice: 3.75,
// $3.75 per million tokens
cacheReadsPrice: 0.3,
// $0.30 per million tokens
supportsReasoningBudget: true,
// Tiered pricing for extended context (requires beta flag 'context-1m-2025-08-07')
tiers: [
{
contextWindow: 1e6,
// 1M tokens with beta flag
inputPrice: 6,
// $6 per million input tokens (>200K context)
outputPrice: 22.5,
// $22.50 per million output tokens (>200K context)
cacheWritesPrice: 7.5,
// $7.50 per million tokens (>200K context)
cacheReadsPrice: 0.6
// $0.60 per million tokens (>200K context)
}
]
},
"claude-sonnet-4-20250514": {
maxTokens: 64e3,
// Overridden to 8k if `enableReasoningEffort` is false.
contextWindow: 2e5,
// Default 200K, extendable to 1M with beta flag 'context-1m-2025-08-07'
supportsImages: true,
supportsPromptCache: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 3,
// $3 per million input tokens (≤200K context)
outputPrice: 15,
// $15 per million output tokens (≤200K context)
cacheWritesPrice: 3.75,
// $3.75 per million tokens
cacheReadsPrice: 0.3,
// $0.30 per million tokens
supportsReasoningBudget: true,
// Tiered pricing for extended context (requires beta flag 'context-1m-2025-08-07')
tiers: [
{
contextWindow: 1e6,
// 1M tokens with beta flag
inputPrice: 6,
// $6 per million input tokens (>200K context)
outputPrice: 22.5,
// $22.50 per million output tokens (>200K context)
cacheWritesPrice: 7.5,
// $7.50 per million tokens (>200K context)
cacheReadsPrice: 0.6
// $0.60 per million tokens (>200K context)
}
]
},
"claude-opus-4-5-20251101": {
maxTokens: 32e3,
// Overridden to 8k if `enableReasoningEffort` is false.
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 5,
// $5 per million input tokens
outputPrice: 25,
// $25 per million output tokens
cacheWritesPrice: 6.25,
// $6.25 per million tokens
cacheReadsPrice: 0.5,
// $0.50 per million tokens
supportsReasoningBudget: true
},
"claude-opus-4-1-20250805": {
maxTokens: 32e3,
// Overridden to 8k if `enableReasoningEffort` is false.
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 15,
// $15 per million input tokens
outputPrice: 75,
// $75 per million output tokens
cacheWritesPrice: 18.75,
// $18.75 per million tokens
cacheReadsPrice: 1.5,
// $1.50 per million tokens
supportsReasoningBudget: true
},
"claude-opus-4-20250514": {
maxTokens: 32e3,
// Overridden to 8k if `enableReasoningEffort` is false.
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 15,
// $15 per million input tokens
outputPrice: 75,
// $75 per million output tokens
cacheWritesPrice: 18.75,
// $18.75 per million tokens
cacheReadsPrice: 1.5,
// $1.50 per million tokens
supportsReasoningBudget: true
},
"claude-3-7-sonnet-20250219:thinking": {
maxTokens: 128e3,
// Unlocked by passing `beta` flag to the model. Otherwise, it's 64k.
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 3,
// $3 per million input tokens
outputPrice: 15,
// $15 per million output tokens
cacheWritesPrice: 3.75,
// $3.75 per million tokens
cacheReadsPrice: 0.3,
// $0.30 per million tokens
supportsReasoningBudget: true,
requiredReasoningBudget: true
},
"claude-3-7-sonnet-20250219": {
maxTokens: 8192,
// Since we already have a `:thinking` virtual model we aren't setting `supportsReasoningBudget: true` here.
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 3,
// $3 per million input tokens
outputPrice: 15,
// $15 per million output tokens
cacheWritesPrice: 3.75,
// $3.75 per million tokens
cacheReadsPrice: 0.3
// $0.30 per million tokens
},
"claude-3-5-sonnet-20241022": {
maxTokens: 8192,
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 3,
// $3 per million input tokens
outputPrice: 15,
// $15 per million output tokens
cacheWritesPrice: 3.75,
// $3.75 per million tokens
cacheReadsPrice: 0.3
// $0.30 per million tokens
},
"claude-3-5-haiku-20241022": {
maxTokens: 8192,
contextWindow: 2e5,
supportsImages: false,
supportsPromptCache: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 1,
outputPrice: 5,
cacheWritesPrice: 1.25,
cacheReadsPrice: 0.1
},
"claude-3-opus-20240229": {
maxTokens: 4096,
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 15,
outputPrice: 75,
cacheWritesPrice: 18.75,
cacheReadsPrice: 1.5
},
"claude-3-haiku-20240307": {
maxTokens: 4096,
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 0.25,
outputPrice: 1.25,
cacheWritesPrice: 0.3,
cacheReadsPrice: 0.03
},
"claude-haiku-4-5-20251001": {
maxTokens: 64e3,
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 1,
outputPrice: 5,
cacheWritesPrice: 1.25,
cacheReadsPrice: 0.1,
supportsReasoningBudget: true,
description: "Claude Haiku 4.5 delivers near-frontier intelligence at lightning speeds with extended thinking, vision, and multilingual support."
}
};
var ANTHROPIC_DEFAULT_MAX_TOKENS = 8192;
// src/providers/baseten.ts
var basetenModels = {
"moonshotai/Kimi-K2-Thinking": {
maxTokens: 16384,
contextWindow: 262e3,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.6,
outputPrice: 2.5,
cacheWritesPrice: 0,
cacheReadsPrice: 0,
description: "Kimi K2 Thinking - A model with enhanced reasoning capabilities from Kimi K2"
},
"zai-org/GLM-4.6": {
maxTokens: 16384,
contextWindow: 2e5,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.6,
outputPrice: 2.2,
cacheWritesPrice: 0,
cacheReadsPrice: 0,
description: "Frontier open model with advanced agentic, reasoning and coding capabilities"
},
"deepseek-ai/DeepSeek-R1": {
maxTokens: 16384,
contextWindow: 163840,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 2.55,
outputPrice: 5.95,
cacheWritesPrice: 0,
cacheReadsPrice: 0,
description: "DeepSeek's first-generation reasoning model"
},
"deepseek-ai/DeepSeek-R1-0528": {
maxTokens: 16384,
contextWindow: 163840,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 2.55,
outputPrice: 5.95,
cacheWritesPrice: 0,
cacheReadsPrice: 0,
description: "The latest revision of DeepSeek's first-generation reasoning model"
},
"deepseek-ai/DeepSeek-V3-0324": {
maxTokens: 16384,
contextWindow: 163840,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.77,
outputPrice: 0.77,
cacheWritesPrice: 0,
cacheReadsPrice: 0,
description: "Fast general-purpose LLM with enhanced reasoning capabilities"
},
"deepseek-ai/DeepSeek-V3.1": {
maxTokens: 16384,
contextWindow: 163840,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.5,
outputPrice: 1.5,
cacheWritesPrice: 0,
cacheReadsPrice: 0,
description: "Extremely capable general-purpose LLM with hybrid reasoning capabilities and advanced tool calling"
},
"deepseek-ai/DeepSeek-V3.2": {
maxTokens: 16384,
contextWindow: 163840,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.3,
outputPrice: 0.45,
cacheWritesPrice: 0,
cacheReadsPrice: 0,
description: "DeepSeek's hybrid reasoning model with efficient long context scaling with GPT-5 level performance"
},
"openai/gpt-oss-120b": {
maxTokens: 16384,
contextWindow: 128072,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.1,
outputPrice: 0.5,
cacheWritesPrice: 0,
cacheReadsPrice: 0,
description: "Extremely capable general-purpose LLM with strong, controllable reasoning capabilities"
},
"Qwen/Qwen3-235B-A22B-Instruct-2507": {
maxTokens: 16384,
contextWindow: 262144,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.22,
outputPrice: 0.8,
cacheWritesPrice: 0,
cacheReadsPrice: 0,
description: "Mixture-of-experts LLM with math and reasoning capabilities"
},
"Qwen/Qwen3-Coder-480B-A35B-Instruct": {
maxTokens: 16384,
contextWindow: 262144,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.38,
outputPrice: 1.53,
cacheWritesPrice: 0,
cacheReadsPrice: 0,
description: "Mixture-of-experts LLM with advanced coding and reasoning capabilities"
},
"moonshotai/Kimi-K2-Instruct-0905": {
maxTokens: 16384,
contextWindow: 262e3,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.6,
outputPrice: 2.5,
cacheWritesPrice: 0,
cacheReadsPrice: 0,
description: "State of the art language model for agentic and coding tasks. September Update."
}
};
var basetenDefaultModelId = "zai-org/GLM-4.6";
// src/providers/bedrock.ts
var bedrockDefaultModelId = "anthropic.claude-sonnet-4-5-20250929-v1:0";
var bedrockDefaultPromptRouterModelId = "anthropic.claude-3-sonnet-20240229-v1:0";
var bedrockModels = {
"anthropic.claude-sonnet-4-5-20250929-v1:0": {
maxTokens: 8192,
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: true,
supportsReasoningBudget: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 3,
outputPrice: 15,
cacheWritesPrice: 3.75,
cacheReadsPrice: 0.3,
minTokensPerCachePoint: 1024,
maxCachePoints: 4,
cachableFields: ["system", "messages", "tools"]
},
"amazon.nova-pro-v1:0": {
maxTokens: 5e3,
contextWindow: 3e5,
supportsImages: true,
supportsPromptCache: true,
supportsNativeTools: true,
inputPrice: 0.8,
outputPrice: 3.2,
cacheWritesPrice: 0.8,
// per million tokens
cacheReadsPrice: 0.2,
// per million tokens
minTokensPerCachePoint: 1,
maxCachePoints: 1,
cachableFields: ["system"]
},
"amazon.nova-pro-latency-optimized-v1:0": {
maxTokens: 5e3,
contextWindow: 3e5,
supportsImages: true,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 1,
outputPrice: 4,
cacheWritesPrice: 1,
// per million tokens
cacheReadsPrice: 0.25,
// per million tokens
description: "Amazon Nova Pro with latency optimized inference"
},
"amazon.nova-lite-v1:0": {
maxTokens: 5e3,
contextWindow: 3e5,
supportsImages: true,
supportsPromptCache: true,
supportsNativeTools: true,
inputPrice: 0.06,
outputPrice: 0.24,
cacheWritesPrice: 0.06,
// per million tokens
cacheReadsPrice: 0.015,
// per million tokens
minTokensPerCachePoint: 1,
maxCachePoints: 1,
cachableFields: ["system"]
},
"amazon.nova-2-lite-v1:0": {
maxTokens: 65535,
contextWindow: 1e6,
supportsImages: true,
supportsPromptCache: true,
supportsNativeTools: true,
inputPrice: 0.33,
outputPrice: 2.75,
cacheWritesPrice: 0,
cacheReadsPrice: 0.0825,
// 75% less than input price
minTokensPerCachePoint: 1,
maxCachePoints: 1,
cachableFields: ["system"],
description: "Amazon Nova 2 Lite - Comparable to Claude Haiku 4.5"
},
"amazon.nova-micro-v1:0": {
maxTokens: 5e3,
contextWindow: 128e3,
supportsImages: false,
supportsPromptCache: true,
supportsNativeTools: true,
inputPrice: 0.035,
outputPrice: 0.14,
cacheWritesPrice: 0.035,
// per million tokens
cacheReadsPrice: 875e-5,
// per million tokens
minTokensPerCachePoint: 1,
maxCachePoints: 1,
cachableFields: ["system"]
},
"anthropic.claude-sonnet-4-20250514-v1:0": {
maxTokens: 8192,
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: true,
supportsReasoningBudget: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 3,
outputPrice: 15,
cacheWritesPrice: 3.75,
cacheReadsPrice: 0.3,
minTokensPerCachePoint: 1024,
maxCachePoints: 4,
cachableFields: ["system", "messages", "tools"]
},
"anthropic.claude-opus-4-1-20250805-v1:0": {
maxTokens: 8192,
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: true,
supportsReasoningBudget: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 15,
outputPrice: 75,
cacheWritesPrice: 18.75,
cacheReadsPrice: 1.5,
minTokensPerCachePoint: 1024,
maxCachePoints: 4,
cachableFields: ["system", "messages", "tools"]
},
"anthropic.claude-opus-4-5-20251101-v1:0": {
maxTokens: 8192,
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: true,
supportsReasoningBudget: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 5,
outputPrice: 25,
cacheWritesPrice: 6.25,
cacheReadsPrice: 0.5,
minTokensPerCachePoint: 1024,
maxCachePoints: 4,
cachableFields: ["system", "messages", "tools"]
},
"anthropic.claude-opus-4-20250514-v1:0": {
maxTokens: 8192,
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: true,
supportsReasoningBudget: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 15,
outputPrice: 75,
cacheWritesPrice: 18.75,
cacheReadsPrice: 1.5,
minTokensPerCachePoint: 1024,
maxCachePoints: 4,
cachableFields: ["system", "messages", "tools"]
},
"anthropic.claude-3-7-sonnet-20250219-v1:0": {
maxTokens: 8192,
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: true,
supportsReasoningBudget: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 3,
outputPrice: 15,
cacheWritesPrice: 3.75,
cacheReadsPrice: 0.3,
minTokensPerCachePoint: 1024,
maxCachePoints: 4,
cachableFields: ["system", "messages", "tools"]
},
"anthropic.claude-3-5-sonnet-20241022-v2:0": {
maxTokens: 8192,
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 3,
outputPrice: 15,
cacheWritesPrice: 3.75,
cacheReadsPrice: 0.3,
minTokensPerCachePoint: 1024,
maxCachePoints: 4,
cachableFields: ["system", "messages", "tools"]
},
"anthropic.claude-3-5-haiku-20241022-v1:0": {
maxTokens: 8192,
contextWindow: 2e5,
supportsImages: false,
supportsPromptCache: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 0.8,
outputPrice: 4,
cacheWritesPrice: 1,
cacheReadsPrice: 0.08,
minTokensPerCachePoint: 2048,
maxCachePoints: 4,
cachableFields: ["system", "messages", "tools"]
},
"anthropic.claude-haiku-4-5-20251001-v1:0": {
maxTokens: 8192,
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: true,
supportsReasoningBudget: true,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 1,
outputPrice: 5,
cacheWritesPrice: 1.25,
// 5m cache writes
cacheReadsPrice: 0.1,
// cache hits / refreshes
minTokensPerCachePoint: 2048,
maxCachePoints: 4,
cachableFields: ["system", "messages", "tools"]
},
"anthropic.claude-3-5-sonnet-20240620-v1:0": {
maxTokens: 8192,
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: false,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 3,
outputPrice: 15
},
"anthropic.claude-3-opus-20240229-v1:0": {
maxTokens: 4096,
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: false,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 15,
outputPrice: 75
},
"anthropic.claude-3-sonnet-20240229-v1:0": {
maxTokens: 4096,
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: false,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 3,
outputPrice: 15
},
"anthropic.claude-3-haiku-20240307-v1:0": {
maxTokens: 4096,
contextWindow: 2e5,
supportsImages: true,
supportsPromptCache: false,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 0.25,
outputPrice: 1.25
},
"anthropic.claude-2-1-v1:0": {
maxTokens: 4096,
contextWindow: 1e5,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 8,
outputPrice: 24,
description: "Claude 2.1"
},
"anthropic.claude-2-0-v1:0": {
maxTokens: 4096,
contextWindow: 1e5,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 8,
outputPrice: 24,
description: "Claude 2.0"
},
"anthropic.claude-instant-v1:0": {
maxTokens: 4096,
contextWindow: 1e5,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 0.8,
outputPrice: 2.4,
description: "Claude Instant"
},
"deepseek.r1-v1:0": {
maxTokens: 32768,
contextWindow: 128e3,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 1.35,
outputPrice: 5.4
},
"openai.gpt-oss-20b-1:0": {
maxTokens: 8192,
contextWindow: 128e3,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.5,
outputPrice: 1.5,
description: "GPT-OSS 20B - Optimized for low latency and local/specialized use cases"
},
"openai.gpt-oss-120b-1:0": {
maxTokens: 8192,
contextWindow: 128e3,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 2,
outputPrice: 6,
description: "GPT-OSS 120B - Production-ready, general-purpose, high-reasoning model"
},
"meta.llama3-3-70b-instruct-v1:0": {
maxTokens: 8192,
contextWindow: 128e3,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.72,
outputPrice: 0.72,
description: "Llama 3.3 Instruct (70B)"
},
"meta.llama3-2-90b-instruct-v1:0": {
maxTokens: 8192,
contextWindow: 128e3,
supportsImages: true,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.72,
outputPrice: 0.72,
description: "Llama 3.2 Instruct (90B)"
},
"meta.llama3-2-11b-instruct-v1:0": {
maxTokens: 8192,
contextWindow: 128e3,
supportsImages: true,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.16,
outputPrice: 0.16,
description: "Llama 3.2 Instruct (11B)"
},
"meta.llama3-2-3b-instruct-v1:0": {
maxTokens: 8192,
contextWindow: 128e3,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.15,
outputPrice: 0.15,
description: "Llama 3.2 Instruct (3B)"
},
"meta.llama3-2-1b-instruct-v1:0": {
maxTokens: 8192,
contextWindow: 128e3,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.1,
outputPrice: 0.1,
description: "Llama 3.2 Instruct (1B)"
},
"meta.llama3-1-405b-instruct-v1:0": {
maxTokens: 8192,
contextWindow: 128e3,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 2.4,
outputPrice: 2.4,
description: "Llama 3.1 Instruct (405B)"
},
"meta.llama3-1-70b-instruct-v1:0": {
maxTokens: 8192,
contextWindow: 128e3,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.72,
outputPrice: 0.72,
description: "Llama 3.1 Instruct (70B)"
},
"meta.llama3-1-70b-instruct-latency-optimized-v1:0": {
maxTokens: 8192,
contextWindow: 128e3,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.9,
outputPrice: 0.9,
description: "Llama 3.1 Instruct (70B) (w/ latency optimized inference)"
},
"meta.llama3-1-8b-instruct-v1:0": {
maxTokens: 8192,
contextWindow: 8e3,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.22,
outputPrice: 0.22,
description: "Llama 3.1 Instruct (8B)"
},
"meta.llama3-70b-instruct-v1:0": {
maxTokens: 2048,
contextWindow: 8e3,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 2.65,
outputPrice: 3.5
},
"meta.llama3-8b-instruct-v1:0": {
maxTokens: 2048,
contextWindow: 4e3,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.3,
outputPrice: 0.6
},
"amazon.titan-text-lite-v1:0": {
maxTokens: 4096,
contextWindow: 8e3,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.15,
outputPrice: 0.2,
description: "Amazon Titan Text Lite"
},
"amazon.titan-text-express-v1:0": {
maxTokens: 4096,
contextWindow: 8e3,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
inputPrice: 0.2,
outputPrice: 0.6,
description: "Amazon Titan Text Express"
},
"moonshot.kimi-k2-thinking": {
maxTokens: 32e3,
contextWindow: 262144,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
defaultToolProtocol: "native",
preserveReasoning: true,
inputPrice: 0.6,
outputPrice: 2.5,
description: "Kimi K2 Thinking (1T parameter MoE model with 32B active parameters)"
},
"minimax.minimax-m2": {
maxTokens: 16384,
contextWindow: 196608,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
defaultToolProtocol: "native",
preserveReasoning: true,
inputPrice: 0.3,
outputPrice: 1.2,
description: "MiniMax M2 (230B parameter MoE model with 10B active parameters)"
},
"qwen.qwen3-next-80b-a3b": {
maxTokens: 8192,
contextWindow: 262144,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 0.15,
outputPrice: 1.2,
description: "Qwen3 Next 80B (MoE model with 3B active parameters)"
},
"qwen.qwen3-coder-480b-a35b-v1:0": {
maxTokens: 8192,
contextWindow: 262144,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 0.45,
outputPrice: 1.8,
description: "Qwen3 Coder 480B (MoE model with 35B active parameters)"
}
};
var BEDROCK_DEFAULT_TEMPERATURE = 0.3;
var BEDROCK_MAX_TOKENS = 4096;
var BEDROCK_DEFAULT_CONTEXT = 128e3;
var AWS_INFERENCE_PROFILE_MAPPING = [
// Australia regions (Sydney and Melbourne) → au. inference profile (most specific - 14 chars)
["ap-southeast-2", "au."],
["ap-southeast-4", "au."],
// Japan regions (Tokyo and Osaka) → jp. inference profile (13 chars)
["ap-northeast-", "jp."],
// US Government Cloud → ug. inference profile (7 chars)
["us-gov-", "ug."],
// Americas regions → us. inference profile (3 chars)
["us-", "us."],
// Europe regions → eu. inference profile (3 chars)
["eu-", "eu."],
// Asia Pacific regions → apac. inference profile (3 chars)
["ap-", "apac."],
// Canada regions → ca. inference profile (3 chars)
["ca-", "ca."],
// South America regions → sa. inference profile (3 chars)
["sa-", "sa."]
];
var BEDROCK_REGIONS = [
{ value: "us-east-1", label: "us-east-1" },
{ value: "us-east-2", label: "us-east-2" },
{ value: "us-west-1", label: "us-west-1" },
{ value: "us-west-2", label: "us-west-2" },
{ value: "ap-northeast-1", label: "ap-northeast-1" },
{ value: "ap-northeast-2", label: "ap-northeast-2" },
{ value: "ap-northeast-3", label: "ap-northeast-3" },
{ value: "ap-south-1", label: "ap-south-1" },
{ value: "ap-south-2", label: "ap-south-2" },
{ value: "ap-southeast-1", label: "ap-southeast-1" },
{ value: "ap-southeast-2", label: "ap-southeast-2" },
{ value: "ap-east-1", label: "ap-east-1" },
{ value: "eu-central-1", label: "eu-central-1" },
{ value: "eu-central-2", label: "eu-central-2" },
{ value: "eu-west-1", label: "eu-west-1" },
{ value: "eu-west-2", label: "eu-west-2" },
{ value: "eu-west-3", label: "eu-west-3" },
{ value: "eu-north-1", label: "eu-north-1" },
{ value: "eu-south-1", label: "eu-south-1" },
{ value: "eu-south-2", label: "eu-south-2" },
{ value: "ca-central-1", label: "ca-central-1" },
{ value: "sa-east-1", label: "sa-east-1" },
{ value: "us-gov-east-1", label: "us-gov-east-1" },
{ value: "us-gov-west-1", label: "us-gov-west-1" }
].sort((a, b) => a.value.localeCompare(b.value));
var BEDROCK_1M_CONTEXT_MODEL_IDS = [
"anthropic.claude-sonnet-4-20250514-v1:0",
"anthropic.claude-sonnet-4-5-20250929-v1:0"
];
var BEDROCK_GLOBAL_INFERENCE_MODEL_IDS = [
"anthropic.claude-sonnet-4-20250514-v1:0",
"anthropic.claude-sonnet-4-5-20250929-v1:0",
"anthropic.claude-haiku-4-5-20251001-v1:0",
"anthropic.claude-opus-4-5-20251101-v1:0"
];
var BEDROCK_SERVICE_TIER_MODEL_IDS = [
// Amazon Nova models
"amazon.nova-lite-v1:0",
"amazon.nova-2-lite-v1:0",
"amazon.nova-pro-v1:0",
"amazon.nova-pro-latency-optimized-v1:0",
// DeepSeek models
"deepseek.r1-v1:0",
// Qwen models
"qwen.qwen3-next-80b-a3b",
"qwen.qwen3-coder-480b-a35b-v1:0",
// OpenAI GPT-OSS models
"openai.gpt-oss-20b-1:0",
"openai.gpt-oss-120b-1:0"
];
var BEDROCK_SERVICE_TIER_PRICING = {
STANDARD: 1,
// Base price
FLEX: 0.5,
// 50% discount from standard
PRIORITY: 1.75
// 75% premium over standard
};
// src/providers/cerebras.ts
var cerebrasDefaultModelId = "gpt-oss-120b";
var cerebrasModels = {
"zai-glm-4.6": {
maxTokens: 16384,
// Conservative default to avoid premature rate limiting (Cerebras reserves quota upfront)
contextWindow: 131072,
supportsImages: false,
supportsPromptCache: false,
supportsNativeTools: true,
defaultToolProtocol: "native",
inputPrice: 0,
outputPrice: 0,
description: "Highly intelligent general purpose model with up to 1,000 tokens/s"
},
"qwen-3-235b-a22b-instruct-2507": {
maxTokens: 16384,
// Conservative default to avoid premature rate limiting
contextWindow: 64e3,
supportsImages: false,
supportsPromptCache: false,
supportsNat