@alumbwe/anvil 1.0.18 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundled.js +61 -3
- package/dist/bundled.js.map +7 -6
- package/package.json +1 -1
package/dist/bundled.js
CHANGED
|
@@ -34298,6 +34298,9 @@ function remapModelForDirectDeepSeek(model) {
|
|
|
34298
34298
|
}
|
|
34299
34299
|
if (model === "fireworks/deepseek-v4-flash")
|
|
34300
34300
|
return "deepseek-v4-flash";
|
|
34301
|
+
if (model.startsWith("google/")) {
|
|
34302
|
+
return DEFAULT_DIRECT_DEEPSEEK_MODEL;
|
|
34303
|
+
}
|
|
34301
34304
|
return DEFAULT_DIRECT_DEEPSEEK_MODEL;
|
|
34302
34305
|
}
|
|
34303
34306
|
var DEEPSEEK_BASE_URL = "https://api.deepseek.com", DEFAULT_DIRECT_DEEPSEEK_MODEL = "deepseek-v4-pro", getDirectDeepSeekApiKey = () => "sk-da16dbd07f4641ecb7e003af63a0241f", isDirectDeepSeekMode = () => Boolean(getDirectDeepSeekApiKey());
|
|
@@ -55560,7 +55563,7 @@ function resolveAvailableFreebuffModel(id, now2 = new Date) {
|
|
|
55560
55563
|
const resolved = resolveFreebuffModel(id);
|
|
55561
55564
|
return isFreebuffModelAvailable(resolved, now2) ? resolved : FALLBACK_FREEBUFF_MODEL_ID;
|
|
55562
55565
|
}
|
|
55563
|
-
var FREEBUFF_GEMINI_PRO_MODEL_ID = "google/gemini-3.
|
|
55566
|
+
var FREEBUFF_GEMINI_PRO_MODEL_ID = "google/gemini-3.7-flash", FREEBUFF_MIMO_V25_MODEL_ID, FREEBUFF_GLM_V52_MODEL_ID = "z-ai/glm-5.2", FREEBUFF_GPT_5_6_LUNA_MODEL_ID = "openai/gpt-5.6-luna", FREEBUFF_GPT_5_6_LUNA_REASONING_EFFORT = "high", FREEBUFF_KIMI_K3_ECO_MODEL_ID = "crof/kimi-k3-eco", FREEBUFF_DEEPSEEK_V4_PRO_MAX_MODEL_ID = "deepseek/deepseek-v4-pro-max", FREEBUFF_DEEPSEEK_V4_FLASH_MAX_MODEL_ID = "deepseek/deepseek-v4-flash-max", FREEBUFF_GPT_5_6_LUNA_MAX_MODEL_ID = "openai/gpt-5.6-luna-max", FREEBUFF_FABLE_5_MODEL_ID = "anthropic/claude-fable-5", FREEBUFF_MUSE_SPARK_12_CONTRIBUTOR_MODEL_ID = "meta/muse-spark-1.2-contributor", FREEBUFF_MUSE_SPARK_REASONING_EFFORT = "xhigh", EFFORTS_THROUGH_XHIGH, EFFORTS_THROUGH_MAX, DEEPSEEK_V4_REASONING_EFFORTS, MUSE_SPARK_FALLBACK_NOTICE = "Falls back to DeepSeek V4 Pro if the queue is too long.", FREEBUFF_ENABLE_MIMO_MODELS_IN_UI = true, FREEBUFF_ENABLE_STREAK_IN_UI = true, FREEBUFF_PREMIUM_SESSION_LIMIT = 6, FREEBUFF_LIMITED_SESSION_LIMIT = 6, FREEBUFF_PREMIUM_SESSION_RESET_TIMEZONE = "America/Los_Angeles", FREEBUFF_GLM_V52_REFERRAL_ENABLED = true, FREEBUFF_GLM_V52_SESSION_LENGTH_MS, FREEBUFF_STREAK_REWARD_INTERVAL_DAYS = 7, FREEBUFF_STREAK_GLM_BONUS_MAX_MULTIPLIER = 4, FREEBUFF_STREAK_REWARDS_ENABLED = true, FREEBUFF_STREAK_GLM_BONUS_ENABLED = true, FREEBUFF_STREAK_BONUS_SESSION_UNITS = 1, FREEBUFF_EASTERN_TIMEZONE = "America/New_York", FREEBUFF_PACIFIC_TIMEZONE = "America/Los_Angeles", FREEBUFF_GEMINI_THINKER_PARENT_MODELS, FREEBUFF_MODEL_CONTEXT_WINDOWS, FLASH_SUPERSEDES_NOTICE = "DeepSeek V4 Flash 07/31 performs better for most tasks.", PRO_SUPERSEDES_NOTICE = "DeepSeek V4 Pro 08/13 is smarter and faster.", DEEPSEEK_V4_PRO_MODEL, MIMO_V25_MODEL, DEEPSEEK_V4_FLASH_MODEL, MINIMAX_M3_MODEL, GPT_5_6_LUNA_MODEL, GLM_V52_MODEL, KIMI_K3_ECO_MODEL, FABLE_5_MODEL, MUSE_SPARK_12_CONTRIBUTOR_MODEL, SUPPORTED_FREEBUFF_MODELS, FREEBUFF_MODELS, FREEBUFF_PREMIUM_MODEL_IDS, FREEBUFF_LIMITED_OFFER_MODEL_IDS, FREEBUFF_WEB_MODELS, FREEBUFF_WEB_GOD_ONLY_MODELS, FREEBUFF_WEB_ALL_MODELS, FREEBUFF_WEB_PREMIUM_MODEL_IDS, FREEBUFF_WEB_STANDARD_MODEL_IDS, FREEBUFF_GLM_V52_MODEL_IDS, FREEBUFF_DESKTOP_PREMIUM_BUCKET_MODEL_IDS, FREEBUFF_INSTANCE_HEADER = "x-freebuff-instance-id", FREEBUFF_MODEL_HEADER = "x-freebuff-model", FREEBUFF_ACTING_USER_HEADER = "x-freebuff-acting-user-id", FREEBUFF_COMPACT_SESSION_HEADER = "x-freebuff-compact-session", FREEBUFF_SESSION_GRACE_MS, FREEBUFF_MULTIMODAL_MODEL_IDS, FREEBUFF_WEB_MULTIMODAL_MODEL_IDS, FREEBUFF_TRACED_MODEL_IDS, DEFAULT_FREEBUFF_MODEL_ID, FALLBACK_FREEBUFF_MODEL_ID, LIMITED_FREEBUFF_MODEL_ID, LIMITED_FREEBUFF_MODEL_IDS, LIMITED_FREEBUFF_MODELS, FREEBUFF_WEB_GEO_EXEMPT_MODEL_IDS, FREEBUFF_WEB_LIMITED_MODEL_IDS;
|
|
55564
55567
|
var init_freebuff_models = __esm(() => {
|
|
55565
55568
|
init_model_config();
|
|
55566
55569
|
init_freebuff_data_use();
|
|
@@ -55591,7 +55594,15 @@ var init_freebuff_models = __esm(() => {
|
|
|
55591
55594
|
[FREEBUFF_DEEPSEEK_V4_FLASH_MODEL_ID]: 1048576,
|
|
55592
55595
|
[FREEBUFF_DEEPSEEK_V4_PRO_MODEL_ID]: 1048576,
|
|
55593
55596
|
[FREEBUFF_GPT_5_6_LUNA_MODEL_ID]: 1e6,
|
|
55594
|
-
[FREEBUFF_MUSE_SPARK_12_CONTRIBUTOR_MODEL_ID]: 1e6
|
|
55597
|
+
[FREEBUFF_MUSE_SPARK_12_CONTRIBUTOR_MODEL_ID]: 1e6,
|
|
55598
|
+
[FREEBUFF_GEMINI_PRO_MODEL_ID]: 1e6,
|
|
55599
|
+
["google/gemini-3.6-flash"]: 1e6,
|
|
55600
|
+
["google/gemini-3.5-flash"]: 1e6,
|
|
55601
|
+
["google/gemini-3.5-flash-lite"]: 1e6,
|
|
55602
|
+
["google/gemini-3.1-pro-preview"]: 1e6,
|
|
55603
|
+
["google/gemini-3.1-flash-lite"]: 1e6,
|
|
55604
|
+
["google/gemini-2.5-pro"]: 1e6,
|
|
55605
|
+
["google/gemini-2.5-flash"]: 1e6
|
|
55595
55606
|
};
|
|
55596
55607
|
DEEPSEEK_V4_PRO_MODEL = {
|
|
55597
55608
|
id: FREEBUFF_DEEPSEEK_V4_PRO_MODEL_ID,
|
|
@@ -56161,6 +56172,29 @@ var init_stop_sequence = __esm(() => {
|
|
|
56161
56172
|
init_string();
|
|
56162
56173
|
});
|
|
56163
56174
|
|
|
56175
|
+
// ../common/src/constants/gemini-direct.ts
|
|
56176
|
+
function isGeminiModelId(model) {
|
|
56177
|
+
return model.startsWith("google/gemini");
|
|
56178
|
+
}
|
|
56179
|
+
function remapModelForDirectGemini(model) {
|
|
56180
|
+
return GEMINI_MODEL_MAP[model] ?? DEFAULT_DIRECT_GEMINI_MODEL;
|
|
56181
|
+
}
|
|
56182
|
+
var GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/v1beta/openai", GEMINI_MODEL_MAP, DEFAULT_DIRECT_GEMINI_MODEL = "gemini-3.7-flash", getDirectGeminiApiKey = () => process.env.GEMINI_API_KEY;
|
|
56183
|
+
var init_gemini_direct = __esm(() => {
|
|
56184
|
+
GEMINI_MODEL_MAP = {
|
|
56185
|
+
"google/gemini-3.7-flash": "gemini-3.7-flash",
|
|
56186
|
+
"google/gemini-3.6-flash": "gemini-3.6-flash",
|
|
56187
|
+
"google/gemini-3.5-flash": "gemini-3.5-flash",
|
|
56188
|
+
"google/gemini-3.5-flash-lite": "gemini-3.5-flash-lite",
|
|
56189
|
+
"google/gemini-3.1-pro-preview": "gemini-3.1-pro-preview",
|
|
56190
|
+
"google/gemini-3.1-flash-lite": "gemini-3.1-flash-lite",
|
|
56191
|
+
"google/gemini-3-flash-preview": "gemini-3-flash-preview",
|
|
56192
|
+
"google/gemini-2.5-pro": "gemini-2.5-pro",
|
|
56193
|
+
"google/gemini-2.5-flash": "gemini-2.5-flash",
|
|
56194
|
+
"google/gemini-2.5-flash-lite": "gemini-2.5-flash-lite"
|
|
56195
|
+
};
|
|
56196
|
+
});
|
|
56197
|
+
|
|
56164
56198
|
// ../node_modules/@ai-sdk/provider/dist/index.mjs
|
|
56165
56199
|
function getErrorMessage3(error) {
|
|
56166
56200
|
if (error == null) {
|
|
@@ -58002,6 +58036,13 @@ function getModelForRequest({
|
|
|
58002
58036
|
model,
|
|
58003
58037
|
userId
|
|
58004
58038
|
}) {
|
|
58039
|
+
const directGeminiApiKey = getDirectGeminiApiKey();
|
|
58040
|
+
if (directGeminiApiKey && isGeminiModelId(model)) {
|
|
58041
|
+
return getGeminiDirectModel({
|
|
58042
|
+
apiKey: directGeminiApiKey,
|
|
58043
|
+
model
|
|
58044
|
+
});
|
|
58045
|
+
}
|
|
58005
58046
|
const directDeepSeekApiKey = getDirectDeepSeekApiKey();
|
|
58006
58047
|
if (directDeepSeekApiKey) {
|
|
58007
58048
|
return getDeepSeekDirectModel({
|
|
@@ -58060,6 +58101,22 @@ function getModelForRequest({
|
|
|
58060
58101
|
supportsStructuredOutputs: true
|
|
58061
58102
|
});
|
|
58062
58103
|
}
|
|
58104
|
+
function getGeminiDirectModel({
|
|
58105
|
+
apiKey,
|
|
58106
|
+
model
|
|
58107
|
+
}) {
|
|
58108
|
+
return new OpenAICompatibleChatLanguageModel(remapModelForDirectGemini(model), {
|
|
58109
|
+
provider: "gemini",
|
|
58110
|
+
url: ({ path: endpoint }) => new URL(path11.join("/", endpoint), GEMINI_BASE_URL).toString(),
|
|
58111
|
+
headers: () => ({
|
|
58112
|
+
Authorization: `Bearer ${apiKey}`,
|
|
58113
|
+
"user-agent": `ai-sdk/openai-compatible/${VERSION5}/gemini-direct`
|
|
58114
|
+
}),
|
|
58115
|
+
supportsStructuredOutputs: true,
|
|
58116
|
+
fetch: fetchWithRetryableNetworkErrors,
|
|
58117
|
+
includeUsage: undefined
|
|
58118
|
+
});
|
|
58119
|
+
}
|
|
58063
58120
|
function getDeepSeekDirectModel({
|
|
58064
58121
|
apiKey,
|
|
58065
58122
|
model
|
|
@@ -58078,6 +58135,7 @@ function getDeepSeekDirectModel({
|
|
|
58078
58135
|
}
|
|
58079
58136
|
var freeModeCapacityDeferralListener = null;
|
|
58080
58137
|
var init_model_provider = __esm(() => {
|
|
58138
|
+
init_gemini_direct();
|
|
58081
58139
|
init_freebuff_models();
|
|
58082
58140
|
init_error();
|
|
58083
58141
|
init_openai_compatible();
|
|
@@ -123446,5 +123504,5 @@ if (isTerminalCommandBrokerInvocation(process.argv)) {
|
|
|
123446
123504
|
await Promise.resolve().then(() => (init_src2(), exports_src));
|
|
123447
123505
|
}
|
|
123448
123506
|
|
|
123449
|
-
//# debugId=
|
|
123507
|
+
//# debugId=35BED6F8FA006F5B64756E2164756E21
|
|
123450
123508
|
//# sourceMappingURL=bundled.js.map
|