@massa-ai/mcp-client 1.31.0 → 1.33.0
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/config-cli.js +79 -28
- package/dist/index.js +77 -26
- package/package.json +3 -3
package/dist/config-cli.js
CHANGED
|
@@ -410,9 +410,9 @@ var init_massa_ai_config = __esm(() => {
|
|
|
410
410
|
},
|
|
411
411
|
embedding: {
|
|
412
412
|
provider: "ollama",
|
|
413
|
-
model: "
|
|
413
|
+
model: "qwen3-embedding:4b",
|
|
414
414
|
baseURL: "http://localhost:11434",
|
|
415
|
-
dimensions:
|
|
415
|
+
dimensions: 2560
|
|
416
416
|
},
|
|
417
417
|
compression: {
|
|
418
418
|
defaultStrategy: "code_structure",
|
|
@@ -50949,6 +50949,18 @@ function _extractJsonObject(text2) {
|
|
|
50949
50949
|
function timeoutSignal(timeoutMs) {
|
|
50950
50950
|
return AbortSignal.timeout(timeoutMs);
|
|
50951
50951
|
}
|
|
50952
|
+
function _isAbortOrTimeoutError(err) {
|
|
50953
|
+
let cur = err;
|
|
50954
|
+
for (let hops = 0;cur && hops < 5; hops++, cur = cur.cause) {
|
|
50955
|
+
const name24 = typeof cur.name === "string" ? cur.name : "";
|
|
50956
|
+
if (name24 === "TimeoutError" || name24 === "AbortError")
|
|
50957
|
+
return true;
|
|
50958
|
+
const message = typeof cur.message === "string" ? cur.message : "";
|
|
50959
|
+
if (/timed out|operation was aborted/i.test(message))
|
|
50960
|
+
return true;
|
|
50961
|
+
}
|
|
50962
|
+
return false;
|
|
50963
|
+
}
|
|
50952
50964
|
async function llmComplete(prompt, opts = {}) {
|
|
50953
50965
|
if (!isLlmEnabled()) {
|
|
50954
50966
|
return { ok: false, error: "llm disabled" };
|
|
@@ -51046,7 +51058,7 @@ async function llmObject(prompt, schema, opts = {}) {
|
|
|
51046
51058
|
});
|
|
51047
51059
|
return { ok: false, error: "schema validation failed (fallback path)" };
|
|
51048
51060
|
} catch (e) {
|
|
51049
|
-
if (llm.disableThink) {
|
|
51061
|
+
if (llm.disableThink && !_isAbortOrTimeoutError(e)) {
|
|
51050
51062
|
const reasoning = _reasoningToText(result).length > 0 ? _reasoningToText(result) : _reasoningToText(e);
|
|
51051
51063
|
if (reasoning.length > 0) {
|
|
51052
51064
|
const parsed = _extractJsonObject(reasoning);
|
|
@@ -93638,7 +93650,7 @@ function createProvider(config3, providerId) {
|
|
|
93638
93650
|
}
|
|
93639
93651
|
return new AISDKEmbeddingProvider(config3, providerId);
|
|
93640
93652
|
}
|
|
93641
|
-
var AISDKEmbeddingProvider;
|
|
93653
|
+
var OLLAMA_EMBED_NUM_CTX, AISDKEmbeddingProvider;
|
|
93642
93654
|
var init_provider = __esm(() => {
|
|
93643
93655
|
init_dist6();
|
|
93644
93656
|
init_dist7();
|
|
@@ -93649,7 +93661,9 @@ var init_provider = __esm(() => {
|
|
|
93649
93661
|
init_metrics2();
|
|
93650
93662
|
init_rate_limiter2();
|
|
93651
93663
|
init_dist();
|
|
93664
|
+
init_config();
|
|
93652
93665
|
init_local_transformers();
|
|
93666
|
+
OLLAMA_EMBED_NUM_CTX = parsePositiveIntEnv(process.env.OLLAMA_EMBEDDING_NUM_CTX, 8192);
|
|
93653
93667
|
AISDKEmbeddingProvider = class AISDKEmbeddingProvider {
|
|
93654
93668
|
config;
|
|
93655
93669
|
providerId;
|
|
@@ -93797,7 +93811,8 @@ var init_provider = __esm(() => {
|
|
|
93797
93811
|
const inputText = this.sanitizeText(this.truncateText(text2));
|
|
93798
93812
|
const response = await this.ollamaFetch("/api/embed", {
|
|
93799
93813
|
model: this.model,
|
|
93800
|
-
input: inputText
|
|
93814
|
+
input: inputText,
|
|
93815
|
+
options: { num_ctx: OLLAMA_EMBED_NUM_CTX }
|
|
93801
93816
|
});
|
|
93802
93817
|
if (!response.ok) {
|
|
93803
93818
|
throw new Error(`Ollama API error: ${response.status} ${response.statusText}`);
|
|
@@ -93887,7 +93902,8 @@ var init_provider = __esm(() => {
|
|
|
93887
93902
|
return await withTimeout(() => withRetry(async () => {
|
|
93888
93903
|
const response = await this.ollamaFetch("/api/embed", {
|
|
93889
93904
|
model: this.model,
|
|
93890
|
-
input: texts.map((t) => this.sanitizeText(this.truncateText(t)))
|
|
93905
|
+
input: texts.map((t) => this.sanitizeText(this.truncateText(t))),
|
|
93906
|
+
options: { num_ctx: OLLAMA_EMBED_NUM_CTX }
|
|
93891
93907
|
});
|
|
93892
93908
|
if (!response.ok) {
|
|
93893
93909
|
throw new Error(`Ollama batch API error: ${response.status} ${response.statusText}`);
|
|
@@ -106446,18 +106462,36 @@ function hasApiKey(providerName) {
|
|
|
106446
106462
|
}
|
|
106447
106463
|
return !!config3.apiKey;
|
|
106448
106464
|
}
|
|
106449
|
-
var embeddingProviders;
|
|
106465
|
+
var fileEmbedding, selectedProvider, fileFor = (provider) => fileEmbedding?.provider === provider ? fileEmbedding : undefined, SELECTABLE_PROVIDERS, embeddingProviders;
|
|
106450
106466
|
var init_config2 = __esm(() => {
|
|
106451
106467
|
init_config();
|
|
106468
|
+
init_dist();
|
|
106469
|
+
fileEmbedding = loadConfigSafe().embedding;
|
|
106470
|
+
selectedProvider = process.env.EMBEDDING_PROVIDER || fileEmbedding?.provider || "ollama";
|
|
106471
|
+
SELECTABLE_PROVIDERS = new Set([
|
|
106472
|
+
"ollama",
|
|
106473
|
+
"mistral",
|
|
106474
|
+
"google",
|
|
106475
|
+
"openai",
|
|
106476
|
+
"vercel",
|
|
106477
|
+
"litellm",
|
|
106478
|
+
"custom",
|
|
106479
|
+
"transformers",
|
|
106480
|
+
"local"
|
|
106481
|
+
]);
|
|
106482
|
+
if (!SELECTABLE_PROVIDERS.has(selectedProvider)) {
|
|
106483
|
+
logger.warn(`[EmbeddingConfig] selected provider "${selectedProvider}" has no runtime entry \u2014 falling back to priority order`, { source: process.env.EMBEDDING_PROVIDER ? "EMBEDDING_PROVIDER env" : "config.json embedding.provider" });
|
|
106484
|
+
}
|
|
106452
106485
|
embeddingProviders = {
|
|
106453
106486
|
google: (() => {
|
|
106454
|
-
const
|
|
106487
|
+
const file2 = fileFor("google");
|
|
106488
|
+
const model = process.env.GOOGLE_EMBEDDING_MODEL || file2?.model || "gemini-embedding-001";
|
|
106455
106489
|
return {
|
|
106456
106490
|
provider: "google",
|
|
106457
106491
|
model,
|
|
106458
|
-
apiKey: process.env.GOOGLE_GENERATIVE_AI_API_KEY || process.env.GOOGLE_API_KEY,
|
|
106459
|
-
dimensions: 3072,
|
|
106460
|
-
priority:
|
|
106492
|
+
apiKey: process.env.GOOGLE_GENERATIVE_AI_API_KEY || process.env.GOOGLE_API_KEY || file2?.apiKey,
|
|
106493
|
+
dimensions: file2?.dimensions ?? 3072,
|
|
106494
|
+
priority: selectedProvider === "google" ? 1 : 10,
|
|
106461
106495
|
timeout: 60000,
|
|
106462
106496
|
maxRetries: 3,
|
|
106463
106497
|
maxChars: getMaxChars("GOOGLE", model),
|
|
@@ -106472,7 +106506,7 @@ var init_config2 = __esm(() => {
|
|
|
106472
106506
|
apiKey: process.env.AI_GATEWAY_API_KEY || process.env.VERCEL_AI_GATEWAY_API_KEY,
|
|
106473
106507
|
baseURL: process.env.VERCEL_AI_GATEWAY_URL,
|
|
106474
106508
|
dimensions: Number(process.env.VERCEL_EMBEDDING_DIMENSIONS || "4096"),
|
|
106475
|
-
priority:
|
|
106509
|
+
priority: selectedProvider === "vercel" ? 1 : 20,
|
|
106476
106510
|
timeout: 60000,
|
|
106477
106511
|
maxRetries: 3,
|
|
106478
106512
|
maxChars: getMaxChars("VERCEL", model),
|
|
@@ -106480,13 +106514,14 @@ var init_config2 = __esm(() => {
|
|
|
106480
106514
|
};
|
|
106481
106515
|
})(),
|
|
106482
106516
|
ollama: (() => {
|
|
106483
|
-
const
|
|
106517
|
+
const file2 = fileFor("ollama");
|
|
106518
|
+
const model = process.env.OLLAMA_EMBEDDING_MODEL || file2?.model || "qwen3-embedding:4b";
|
|
106484
106519
|
return {
|
|
106485
106520
|
provider: "ollama",
|
|
106486
106521
|
model,
|
|
106487
|
-
baseURL: process.env.OLLAMA_BASE_URL || "http://localhost:11434",
|
|
106488
|
-
dimensions: Number(process.env.OLLAMA_EMBEDDING_DIMENSIONS
|
|
106489
|
-
priority:
|
|
106522
|
+
baseURL: process.env.OLLAMA_BASE_URL || file2?.baseURL || "http://localhost:11434",
|
|
106523
|
+
dimensions: process.env.OLLAMA_EMBEDDING_DIMENSIONS ? Number(process.env.OLLAMA_EMBEDDING_DIMENSIONS) : file2?.dimensions ?? 2560,
|
|
106524
|
+
priority: selectedProvider === "ollama" ? 1 : 50,
|
|
106490
106525
|
timeout: 300000,
|
|
106491
106526
|
maxRetries: 2,
|
|
106492
106527
|
maxChars: getMaxChars("OLLAMA", model),
|
|
@@ -106494,13 +106529,14 @@ var init_config2 = __esm(() => {
|
|
|
106494
106529
|
};
|
|
106495
106530
|
})(),
|
|
106496
106531
|
mistralText: (() => {
|
|
106497
|
-
const
|
|
106532
|
+
const file2 = fileFor("mistral");
|
|
106533
|
+
const model = process.env.MISTRAL_TEXT_EMBEDDING_MODEL || file2?.model || "mistral-embed";
|
|
106498
106534
|
return {
|
|
106499
106535
|
provider: "mistral",
|
|
106500
106536
|
model,
|
|
106501
|
-
apiKey: process.env.MISTRAL_API_KEY,
|
|
106502
|
-
dimensions: 1024,
|
|
106503
|
-
priority:
|
|
106537
|
+
apiKey: process.env.MISTRAL_API_KEY || file2?.apiKey,
|
|
106538
|
+
dimensions: file2?.dimensions ?? 1024,
|
|
106539
|
+
priority: selectedProvider === "mistral" ? 1 : 2,
|
|
106504
106540
|
timeout: 60000,
|
|
106505
106541
|
maxRetries: 3,
|
|
106506
106542
|
maxChars: getMaxChars("MISTRAL", model),
|
|
@@ -106512,9 +106548,9 @@ var init_config2 = __esm(() => {
|
|
|
106512
106548
|
return {
|
|
106513
106549
|
provider: "mistral",
|
|
106514
106550
|
model,
|
|
106515
|
-
apiKey: process.env.MISTRAL_API_KEY,
|
|
106551
|
+
apiKey: process.env.MISTRAL_API_KEY || fileFor("mistral")?.apiKey,
|
|
106516
106552
|
dimensions: 1536,
|
|
106517
|
-
priority:
|
|
106553
|
+
priority: selectedProvider === "mistral" ? 1 : 3,
|
|
106518
106554
|
timeout: 60000,
|
|
106519
106555
|
maxRetries: 3,
|
|
106520
106556
|
maxChars: getMaxChars("MISTRAL", model),
|
|
@@ -106529,7 +106565,7 @@ var init_config2 = __esm(() => {
|
|
|
106529
106565
|
apiKey: process.env.LITELLM_API_KEY,
|
|
106530
106566
|
baseURL: process.env.LITELLM_BASE_URL,
|
|
106531
106567
|
dimensions: Number(process.env.LITELLM_EMBEDDING_DIMENSIONS || "1024"),
|
|
106532
|
-
priority:
|
|
106568
|
+
priority: selectedProvider === "litellm" ? 1 : 15,
|
|
106533
106569
|
timeout: Number(process.env.LITELLM_EMBEDDING_TIMEOUT || "60000"),
|
|
106534
106570
|
maxRetries: 3,
|
|
106535
106571
|
maxChars: getMaxChars("LITELLM", model),
|
|
@@ -106544,7 +106580,7 @@ var init_config2 = __esm(() => {
|
|
|
106544
106580
|
apiKey: process.env.CUSTOM_API_KEY,
|
|
106545
106581
|
baseURL: process.env.CUSTOM_EMBEDDING_BASE_URL,
|
|
106546
106582
|
dimensions: Number(process.env.CUSTOM_EMBEDDING_DIMENSIONS || "1536"),
|
|
106547
|
-
priority:
|
|
106583
|
+
priority: selectedProvider === "custom" ? 1 : 100,
|
|
106548
106584
|
timeout: Number(process.env.CUSTOM_EMBEDDING_TIMEOUT || "60000"),
|
|
106549
106585
|
maxRetries: 3,
|
|
106550
106586
|
maxChars: getMaxChars("CUSTOM", model),
|
|
@@ -106557,7 +106593,7 @@ var init_config2 = __esm(() => {
|
|
|
106557
106593
|
provider: "transformers",
|
|
106558
106594
|
model,
|
|
106559
106595
|
dimensions: Number(process.env.TRANSFORMERS_EMBEDDING_DIMENSIONS || "384"),
|
|
106560
|
-
priority:
|
|
106596
|
+
priority: selectedProvider === "transformers" ? 1 : 100,
|
|
106561
106597
|
timeout: 300000,
|
|
106562
106598
|
maxRetries: 1,
|
|
106563
106599
|
maxChars: getMaxChars("TRANSFORMERS", model),
|
|
@@ -106570,12 +106606,27 @@ var init_config2 = __esm(() => {
|
|
|
106570
106606
|
provider: "transformers",
|
|
106571
106607
|
model,
|
|
106572
106608
|
dimensions: Number(process.env.TRANSFORMERS_EMBEDDING_DIMENSIONS || "384"),
|
|
106573
|
-
priority:
|
|
106609
|
+
priority: selectedProvider === "local" ? 1 : 100,
|
|
106574
106610
|
timeout: 300000,
|
|
106575
106611
|
maxRetries: 1,
|
|
106576
106612
|
maxChars: getMaxChars("TRANSFORMERS", model),
|
|
106577
106613
|
rateLimits: getRateLimits("TRANSFORMERS")
|
|
106578
106614
|
};
|
|
106615
|
+
})(),
|
|
106616
|
+
openai: (() => {
|
|
106617
|
+
const file2 = fileFor("openai");
|
|
106618
|
+
const model = process.env.OPENAI_EMBEDDING_MODEL || file2?.model || "text-embedding-3-small";
|
|
106619
|
+
return {
|
|
106620
|
+
provider: "openai",
|
|
106621
|
+
model,
|
|
106622
|
+
apiKey: process.env.OPENAI_API_KEY || file2?.apiKey,
|
|
106623
|
+
dimensions: file2?.dimensions ?? 1536,
|
|
106624
|
+
priority: selectedProvider === "openai" ? 1 : 10,
|
|
106625
|
+
timeout: 60000,
|
|
106626
|
+
maxRetries: 3,
|
|
106627
|
+
maxChars: getMaxChars("OPENAI", model),
|
|
106628
|
+
rateLimits: getRateLimits("OPENAI")
|
|
106629
|
+
};
|
|
106579
106630
|
})()
|
|
106580
106631
|
};
|
|
106581
106632
|
});
|
|
@@ -151980,7 +152031,7 @@ Commands:
|
|
|
151980
152031
|
Examples:
|
|
151981
152032
|
massa-ai-config init
|
|
151982
152033
|
massa-ai-config init --mistral your-api-key
|
|
151983
|
-
massa-ai-config use ollama --model qwen3-embedding:
|
|
152034
|
+
massa-ai-config use ollama --model qwen3-embedding:4b
|
|
151984
152035
|
massa-ai-config use mistral --api-key your-key
|
|
151985
152036
|
massa-ai-config set embedding.dimensions 1024
|
|
151986
152037
|
massa-ai-config recover my-project --path /home/user/renamed-dir
|
|
@@ -152109,7 +152160,7 @@ Using defaults:`);
|
|
|
152109
152160
|
if (provider === "ollama") {
|
|
152110
152161
|
config3.embedding = {
|
|
152111
152162
|
provider: "ollama",
|
|
152112
|
-
model: options.model || "qwen3-embedding:
|
|
152163
|
+
model: options.model || "qwen3-embedding:4b",
|
|
152113
152164
|
baseURL: options["base-url"] || "http://localhost:11434",
|
|
152114
152165
|
dimensions: 768
|
|
152115
152166
|
};
|
package/dist/index.js
CHANGED
|
@@ -25407,9 +25407,9 @@ var init_massa_ai_config = __esm(() => {
|
|
|
25407
25407
|
},
|
|
25408
25408
|
embedding: {
|
|
25409
25409
|
provider: "ollama",
|
|
25410
|
-
model: "
|
|
25410
|
+
model: "qwen3-embedding:4b",
|
|
25411
25411
|
baseURL: "http://localhost:11434",
|
|
25412
|
-
dimensions:
|
|
25412
|
+
dimensions: 2560
|
|
25413
25413
|
},
|
|
25414
25414
|
compression: {
|
|
25415
25415
|
defaultStrategy: "code_structure",
|
|
@@ -57508,6 +57508,18 @@ function _extractJsonObject(text2) {
|
|
|
57508
57508
|
function timeoutSignal(timeoutMs) {
|
|
57509
57509
|
return AbortSignal.timeout(timeoutMs);
|
|
57510
57510
|
}
|
|
57511
|
+
function _isAbortOrTimeoutError(err) {
|
|
57512
|
+
let cur = err;
|
|
57513
|
+
for (let hops = 0;cur && hops < 5; hops++, cur = cur.cause) {
|
|
57514
|
+
const name24 = typeof cur.name === "string" ? cur.name : "";
|
|
57515
|
+
if (name24 === "TimeoutError" || name24 === "AbortError")
|
|
57516
|
+
return true;
|
|
57517
|
+
const message = typeof cur.message === "string" ? cur.message : "";
|
|
57518
|
+
if (/timed out|operation was aborted/i.test(message))
|
|
57519
|
+
return true;
|
|
57520
|
+
}
|
|
57521
|
+
return false;
|
|
57522
|
+
}
|
|
57511
57523
|
async function llmComplete(prompt, opts = {}) {
|
|
57512
57524
|
if (!isLlmEnabled()) {
|
|
57513
57525
|
return { ok: false, error: "llm disabled" };
|
|
@@ -57605,7 +57617,7 @@ async function llmObject(prompt, schema, opts = {}) {
|
|
|
57605
57617
|
});
|
|
57606
57618
|
return { ok: false, error: "schema validation failed (fallback path)" };
|
|
57607
57619
|
} catch (e) {
|
|
57608
|
-
if (llm.disableThink) {
|
|
57620
|
+
if (llm.disableThink && !_isAbortOrTimeoutError(e)) {
|
|
57609
57621
|
const reasoning = _reasoningToText(result).length > 0 ? _reasoningToText(result) : _reasoningToText(e);
|
|
57610
57622
|
if (reasoning.length > 0) {
|
|
57611
57623
|
const parsed = _extractJsonObject(reasoning);
|
|
@@ -100197,7 +100209,7 @@ function createProvider(config3, providerId) {
|
|
|
100197
100209
|
}
|
|
100198
100210
|
return new AISDKEmbeddingProvider(config3, providerId);
|
|
100199
100211
|
}
|
|
100200
|
-
var AISDKEmbeddingProvider;
|
|
100212
|
+
var OLLAMA_EMBED_NUM_CTX, AISDKEmbeddingProvider;
|
|
100201
100213
|
var init_provider = __esm(() => {
|
|
100202
100214
|
init_dist6();
|
|
100203
100215
|
init_dist7();
|
|
@@ -100208,7 +100220,9 @@ var init_provider = __esm(() => {
|
|
|
100208
100220
|
init_metrics2();
|
|
100209
100221
|
init_rate_limiter2();
|
|
100210
100222
|
init_dist();
|
|
100223
|
+
init_config();
|
|
100211
100224
|
init_local_transformers();
|
|
100225
|
+
OLLAMA_EMBED_NUM_CTX = parsePositiveIntEnv(process.env.OLLAMA_EMBEDDING_NUM_CTX, 8192);
|
|
100212
100226
|
AISDKEmbeddingProvider = class AISDKEmbeddingProvider {
|
|
100213
100227
|
config;
|
|
100214
100228
|
providerId;
|
|
@@ -100356,7 +100370,8 @@ var init_provider = __esm(() => {
|
|
|
100356
100370
|
const inputText = this.sanitizeText(this.truncateText(text2));
|
|
100357
100371
|
const response = await this.ollamaFetch("/api/embed", {
|
|
100358
100372
|
model: this.model,
|
|
100359
|
-
input: inputText
|
|
100373
|
+
input: inputText,
|
|
100374
|
+
options: { num_ctx: OLLAMA_EMBED_NUM_CTX }
|
|
100360
100375
|
});
|
|
100361
100376
|
if (!response.ok) {
|
|
100362
100377
|
throw new Error(`Ollama API error: ${response.status} ${response.statusText}`);
|
|
@@ -100446,7 +100461,8 @@ var init_provider = __esm(() => {
|
|
|
100446
100461
|
return await withTimeout(() => withRetry(async () => {
|
|
100447
100462
|
const response = await this.ollamaFetch("/api/embed", {
|
|
100448
100463
|
model: this.model,
|
|
100449
|
-
input: texts.map((t) => this.sanitizeText(this.truncateText(t)))
|
|
100464
|
+
input: texts.map((t) => this.sanitizeText(this.truncateText(t))),
|
|
100465
|
+
options: { num_ctx: OLLAMA_EMBED_NUM_CTX }
|
|
100450
100466
|
});
|
|
100451
100467
|
if (!response.ok) {
|
|
100452
100468
|
throw new Error(`Ollama batch API error: ${response.status} ${response.statusText}`);
|
|
@@ -113005,18 +113021,36 @@ function hasApiKey(providerName) {
|
|
|
113005
113021
|
}
|
|
113006
113022
|
return !!config3.apiKey;
|
|
113007
113023
|
}
|
|
113008
|
-
var embeddingProviders;
|
|
113024
|
+
var fileEmbedding, selectedProvider, fileFor = (provider) => fileEmbedding?.provider === provider ? fileEmbedding : undefined, SELECTABLE_PROVIDERS, embeddingProviders;
|
|
113009
113025
|
var init_config2 = __esm(() => {
|
|
113010
113026
|
init_config();
|
|
113027
|
+
init_dist();
|
|
113028
|
+
fileEmbedding = loadConfigSafe().embedding;
|
|
113029
|
+
selectedProvider = process.env.EMBEDDING_PROVIDER || fileEmbedding?.provider || "ollama";
|
|
113030
|
+
SELECTABLE_PROVIDERS = new Set([
|
|
113031
|
+
"ollama",
|
|
113032
|
+
"mistral",
|
|
113033
|
+
"google",
|
|
113034
|
+
"openai",
|
|
113035
|
+
"vercel",
|
|
113036
|
+
"litellm",
|
|
113037
|
+
"custom",
|
|
113038
|
+
"transformers",
|
|
113039
|
+
"local"
|
|
113040
|
+
]);
|
|
113041
|
+
if (!SELECTABLE_PROVIDERS.has(selectedProvider)) {
|
|
113042
|
+
logger.warn(`[EmbeddingConfig] selected provider "${selectedProvider}" has no runtime entry \u2014 falling back to priority order`, { source: process.env.EMBEDDING_PROVIDER ? "EMBEDDING_PROVIDER env" : "config.json embedding.provider" });
|
|
113043
|
+
}
|
|
113011
113044
|
embeddingProviders = {
|
|
113012
113045
|
google: (() => {
|
|
113013
|
-
const
|
|
113046
|
+
const file2 = fileFor("google");
|
|
113047
|
+
const model = process.env.GOOGLE_EMBEDDING_MODEL || file2?.model || "gemini-embedding-001";
|
|
113014
113048
|
return {
|
|
113015
113049
|
provider: "google",
|
|
113016
113050
|
model,
|
|
113017
|
-
apiKey: process.env.GOOGLE_GENERATIVE_AI_API_KEY || process.env.GOOGLE_API_KEY,
|
|
113018
|
-
dimensions: 3072,
|
|
113019
|
-
priority:
|
|
113051
|
+
apiKey: process.env.GOOGLE_GENERATIVE_AI_API_KEY || process.env.GOOGLE_API_KEY || file2?.apiKey,
|
|
113052
|
+
dimensions: file2?.dimensions ?? 3072,
|
|
113053
|
+
priority: selectedProvider === "google" ? 1 : 10,
|
|
113020
113054
|
timeout: 60000,
|
|
113021
113055
|
maxRetries: 3,
|
|
113022
113056
|
maxChars: getMaxChars("GOOGLE", model),
|
|
@@ -113031,7 +113065,7 @@ var init_config2 = __esm(() => {
|
|
|
113031
113065
|
apiKey: process.env.AI_GATEWAY_API_KEY || process.env.VERCEL_AI_GATEWAY_API_KEY,
|
|
113032
113066
|
baseURL: process.env.VERCEL_AI_GATEWAY_URL,
|
|
113033
113067
|
dimensions: Number(process.env.VERCEL_EMBEDDING_DIMENSIONS || "4096"),
|
|
113034
|
-
priority:
|
|
113068
|
+
priority: selectedProvider === "vercel" ? 1 : 20,
|
|
113035
113069
|
timeout: 60000,
|
|
113036
113070
|
maxRetries: 3,
|
|
113037
113071
|
maxChars: getMaxChars("VERCEL", model),
|
|
@@ -113039,13 +113073,14 @@ var init_config2 = __esm(() => {
|
|
|
113039
113073
|
};
|
|
113040
113074
|
})(),
|
|
113041
113075
|
ollama: (() => {
|
|
113042
|
-
const
|
|
113076
|
+
const file2 = fileFor("ollama");
|
|
113077
|
+
const model = process.env.OLLAMA_EMBEDDING_MODEL || file2?.model || "qwen3-embedding:4b";
|
|
113043
113078
|
return {
|
|
113044
113079
|
provider: "ollama",
|
|
113045
113080
|
model,
|
|
113046
|
-
baseURL: process.env.OLLAMA_BASE_URL || "http://localhost:11434",
|
|
113047
|
-
dimensions: Number(process.env.OLLAMA_EMBEDDING_DIMENSIONS
|
|
113048
|
-
priority:
|
|
113081
|
+
baseURL: process.env.OLLAMA_BASE_URL || file2?.baseURL || "http://localhost:11434",
|
|
113082
|
+
dimensions: process.env.OLLAMA_EMBEDDING_DIMENSIONS ? Number(process.env.OLLAMA_EMBEDDING_DIMENSIONS) : file2?.dimensions ?? 2560,
|
|
113083
|
+
priority: selectedProvider === "ollama" ? 1 : 50,
|
|
113049
113084
|
timeout: 300000,
|
|
113050
113085
|
maxRetries: 2,
|
|
113051
113086
|
maxChars: getMaxChars("OLLAMA", model),
|
|
@@ -113053,13 +113088,14 @@ var init_config2 = __esm(() => {
|
|
|
113053
113088
|
};
|
|
113054
113089
|
})(),
|
|
113055
113090
|
mistralText: (() => {
|
|
113056
|
-
const
|
|
113091
|
+
const file2 = fileFor("mistral");
|
|
113092
|
+
const model = process.env.MISTRAL_TEXT_EMBEDDING_MODEL || file2?.model || "mistral-embed";
|
|
113057
113093
|
return {
|
|
113058
113094
|
provider: "mistral",
|
|
113059
113095
|
model,
|
|
113060
|
-
apiKey: process.env.MISTRAL_API_KEY,
|
|
113061
|
-
dimensions: 1024,
|
|
113062
|
-
priority:
|
|
113096
|
+
apiKey: process.env.MISTRAL_API_KEY || file2?.apiKey,
|
|
113097
|
+
dimensions: file2?.dimensions ?? 1024,
|
|
113098
|
+
priority: selectedProvider === "mistral" ? 1 : 2,
|
|
113063
113099
|
timeout: 60000,
|
|
113064
113100
|
maxRetries: 3,
|
|
113065
113101
|
maxChars: getMaxChars("MISTRAL", model),
|
|
@@ -113071,9 +113107,9 @@ var init_config2 = __esm(() => {
|
|
|
113071
113107
|
return {
|
|
113072
113108
|
provider: "mistral",
|
|
113073
113109
|
model,
|
|
113074
|
-
apiKey: process.env.MISTRAL_API_KEY,
|
|
113110
|
+
apiKey: process.env.MISTRAL_API_KEY || fileFor("mistral")?.apiKey,
|
|
113075
113111
|
dimensions: 1536,
|
|
113076
|
-
priority:
|
|
113112
|
+
priority: selectedProvider === "mistral" ? 1 : 3,
|
|
113077
113113
|
timeout: 60000,
|
|
113078
113114
|
maxRetries: 3,
|
|
113079
113115
|
maxChars: getMaxChars("MISTRAL", model),
|
|
@@ -113088,7 +113124,7 @@ var init_config2 = __esm(() => {
|
|
|
113088
113124
|
apiKey: process.env.LITELLM_API_KEY,
|
|
113089
113125
|
baseURL: process.env.LITELLM_BASE_URL,
|
|
113090
113126
|
dimensions: Number(process.env.LITELLM_EMBEDDING_DIMENSIONS || "1024"),
|
|
113091
|
-
priority:
|
|
113127
|
+
priority: selectedProvider === "litellm" ? 1 : 15,
|
|
113092
113128
|
timeout: Number(process.env.LITELLM_EMBEDDING_TIMEOUT || "60000"),
|
|
113093
113129
|
maxRetries: 3,
|
|
113094
113130
|
maxChars: getMaxChars("LITELLM", model),
|
|
@@ -113103,7 +113139,7 @@ var init_config2 = __esm(() => {
|
|
|
113103
113139
|
apiKey: process.env.CUSTOM_API_KEY,
|
|
113104
113140
|
baseURL: process.env.CUSTOM_EMBEDDING_BASE_URL,
|
|
113105
113141
|
dimensions: Number(process.env.CUSTOM_EMBEDDING_DIMENSIONS || "1536"),
|
|
113106
|
-
priority:
|
|
113142
|
+
priority: selectedProvider === "custom" ? 1 : 100,
|
|
113107
113143
|
timeout: Number(process.env.CUSTOM_EMBEDDING_TIMEOUT || "60000"),
|
|
113108
113144
|
maxRetries: 3,
|
|
113109
113145
|
maxChars: getMaxChars("CUSTOM", model),
|
|
@@ -113116,7 +113152,7 @@ var init_config2 = __esm(() => {
|
|
|
113116
113152
|
provider: "transformers",
|
|
113117
113153
|
model,
|
|
113118
113154
|
dimensions: Number(process.env.TRANSFORMERS_EMBEDDING_DIMENSIONS || "384"),
|
|
113119
|
-
priority:
|
|
113155
|
+
priority: selectedProvider === "transformers" ? 1 : 100,
|
|
113120
113156
|
timeout: 300000,
|
|
113121
113157
|
maxRetries: 1,
|
|
113122
113158
|
maxChars: getMaxChars("TRANSFORMERS", model),
|
|
@@ -113129,12 +113165,27 @@ var init_config2 = __esm(() => {
|
|
|
113129
113165
|
provider: "transformers",
|
|
113130
113166
|
model,
|
|
113131
113167
|
dimensions: Number(process.env.TRANSFORMERS_EMBEDDING_DIMENSIONS || "384"),
|
|
113132
|
-
priority:
|
|
113168
|
+
priority: selectedProvider === "local" ? 1 : 100,
|
|
113133
113169
|
timeout: 300000,
|
|
113134
113170
|
maxRetries: 1,
|
|
113135
113171
|
maxChars: getMaxChars("TRANSFORMERS", model),
|
|
113136
113172
|
rateLimits: getRateLimits("TRANSFORMERS")
|
|
113137
113173
|
};
|
|
113174
|
+
})(),
|
|
113175
|
+
openai: (() => {
|
|
113176
|
+
const file2 = fileFor("openai");
|
|
113177
|
+
const model = process.env.OPENAI_EMBEDDING_MODEL || file2?.model || "text-embedding-3-small";
|
|
113178
|
+
return {
|
|
113179
|
+
provider: "openai",
|
|
113180
|
+
model,
|
|
113181
|
+
apiKey: process.env.OPENAI_API_KEY || file2?.apiKey,
|
|
113182
|
+
dimensions: file2?.dimensions ?? 1536,
|
|
113183
|
+
priority: selectedProvider === "openai" ? 1 : 10,
|
|
113184
|
+
timeout: 60000,
|
|
113185
|
+
maxRetries: 3,
|
|
113186
|
+
maxChars: getMaxChars("OPENAI", model),
|
|
113187
|
+
rateLimits: getRateLimits("OPENAI")
|
|
113188
|
+
};
|
|
113138
113189
|
})()
|
|
113139
113190
|
};
|
|
113140
113191
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@massa-ai/mcp-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.33.0",
|
|
4
4
|
"description": "massa-ai MCP server - Semantic code search, memory, and context compression via Model Context Protocol",
|
|
5
5
|
"author": "luizgmassa",
|
|
6
6
|
"type": "module",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"type-check": "tsc --noEmit"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@massa-ai/core": "^1.
|
|
24
|
-
"@massa-ai/shared": "^1.
|
|
23
|
+
"@massa-ai/core": "^1.33.0",
|
|
24
|
+
"@massa-ai/shared": "^1.33.0",
|
|
25
25
|
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|