@massa-ai/mcp-client 1.47.0 → 1.49.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 +125 -45
- package/dist/index.js +125 -45
- package/package.json +3 -3
package/dist/config-cli.js
CHANGED
|
@@ -401,7 +401,7 @@ var init_xdg = () => {};
|
|
|
401
401
|
|
|
402
402
|
// ../../packages/shared/dist/config/massa-ai-config.js
|
|
403
403
|
import path2 from "path";
|
|
404
|
-
var SCHEDULER_JOB_KINDS, defaultMassaAiConfig;
|
|
404
|
+
var SCHEDULER_JOB_KINDS, MAX_MATCH_WORK = 1e5, MAX_IGNORE_PATTERNS = 1024, DEFAULT_CAPTURE_POLICY, DEFAULT_SCHEDULER_CONFIG, defaultMassaAiConfig;
|
|
405
405
|
var init_massa_ai_config = __esm(() => {
|
|
406
406
|
init_xdg();
|
|
407
407
|
SCHEDULER_JOB_KINDS = [
|
|
@@ -411,6 +411,54 @@ var init_massa_ai_config = __esm(() => {
|
|
|
411
411
|
"observation-bridge",
|
|
412
412
|
"checkpoint-purge"
|
|
413
413
|
];
|
|
414
|
+
DEFAULT_CAPTURE_POLICY = {
|
|
415
|
+
rules: [
|
|
416
|
+
{ pattern: "**/node_modules/**", disposition: "Drop" },
|
|
417
|
+
{ pattern: "**/.git/**", disposition: "Drop" },
|
|
418
|
+
{ pattern: "**/dist/**", disposition: "Drop" },
|
|
419
|
+
{ pattern: "**/build/**", disposition: "Drop" },
|
|
420
|
+
{ pattern: "**/coverage/**", disposition: "Drop" },
|
|
421
|
+
{ pattern: ".env", disposition: "Drop" },
|
|
422
|
+
{ pattern: ".env.*", disposition: "Drop" },
|
|
423
|
+
{ pattern: "**/generated/**", disposition: "Drop" },
|
|
424
|
+
{ pattern: "**/*.generated.*", disposition: "Drop" },
|
|
425
|
+
{ pattern: "**/*.d.ts", disposition: "Drop" },
|
|
426
|
+
{ pattern: "**/__tests__/**", disposition: "Drop" },
|
|
427
|
+
{ pattern: "**/tests/**", disposition: "Drop" },
|
|
428
|
+
{ pattern: "**/*.test.ts", disposition: "Drop" },
|
|
429
|
+
{ pattern: "**/*.test.tsx", disposition: "Drop" },
|
|
430
|
+
{ pattern: "**/*.test.js", disposition: "Drop" },
|
|
431
|
+
{ pattern: "**/*.test.jsx", disposition: "Drop" },
|
|
432
|
+
{ pattern: "**/*.spec.ts", disposition: "Drop" },
|
|
433
|
+
{ pattern: "**/*.spec.tsx", disposition: "Drop" },
|
|
434
|
+
{ pattern: "**/*.spec.js", disposition: "Drop" },
|
|
435
|
+
{ pattern: "**/*.spec.jsx", disposition: "Drop" },
|
|
436
|
+
{ pattern: "**/benchmarks/**", disposition: "Drop" },
|
|
437
|
+
{ pattern: "**/fixtures/**", disposition: "Drop" },
|
|
438
|
+
{ pattern: "**/*.wasm*", disposition: "Drop" },
|
|
439
|
+
{ pattern: "**/*.min.*", disposition: "Drop" },
|
|
440
|
+
{ pattern: "**/*.map", disposition: "Drop" },
|
|
441
|
+
{ pattern: "**/lock.yaml", disposition: "Drop" },
|
|
442
|
+
{ pattern: "**/pnpm-lock.yaml", disposition: "Drop" },
|
|
443
|
+
{ pattern: "**/package-lock.json", disposition: "Drop" },
|
|
444
|
+
{ pattern: "**/bun.lockb", disposition: "Drop" },
|
|
445
|
+
{ pattern: "**/yarn.lock", disposition: "Drop" }
|
|
446
|
+
],
|
|
447
|
+
maxMatchWork: MAX_MATCH_WORK,
|
|
448
|
+
maxIgnorePatterns: MAX_IGNORE_PATTERNS
|
|
449
|
+
};
|
|
450
|
+
DEFAULT_SCHEDULER_CONFIG = {
|
|
451
|
+
enabled: false,
|
|
452
|
+
tickMs: 60000,
|
|
453
|
+
maxConcurrent: 2,
|
|
454
|
+
jobs: {
|
|
455
|
+
"memory-consolidation": { enabled: false, intervalMs: 30 * 60 * 1000 },
|
|
456
|
+
"decay-sweep": { enabled: false, intervalMs: 60 * 60 * 1000 },
|
|
457
|
+
"auto-improve": { enabled: false, intervalMs: 30 * 60 * 1000 },
|
|
458
|
+
"observation-bridge": { enabled: false, intervalMs: 30 * 60 * 1000 },
|
|
459
|
+
"checkpoint-purge": { enabled: false, intervalMs: 60 * 60 * 1000 }
|
|
460
|
+
}
|
|
461
|
+
};
|
|
414
462
|
defaultMassaAiConfig = {
|
|
415
463
|
database: {
|
|
416
464
|
url: ""
|
|
@@ -429,7 +477,7 @@ var init_massa_ai_config = __esm(() => {
|
|
|
429
477
|
impact: {
|
|
430
478
|
bfsCteEnabled: false
|
|
431
479
|
},
|
|
432
|
-
capturePolicy:
|
|
480
|
+
capturePolicy: DEFAULT_CAPTURE_POLICY,
|
|
433
481
|
cache: {
|
|
434
482
|
enabled: true,
|
|
435
483
|
l1MaxSizeMB: 100,
|
|
@@ -552,7 +600,8 @@ var init_massa_ai_config = __esm(() => {
|
|
|
552
600
|
},
|
|
553
601
|
security: {
|
|
554
602
|
corsOrigins: []
|
|
555
|
-
}
|
|
603
|
+
},
|
|
604
|
+
scheduler: DEFAULT_SCHEDULER_CONFIG
|
|
556
605
|
};
|
|
557
606
|
});
|
|
558
607
|
|
|
@@ -562,6 +611,8 @@ __export(exports_config_loader, {
|
|
|
562
611
|
writeFileAtomically: () => writeFileAtomically,
|
|
563
612
|
saveConfig: () => saveConfig,
|
|
564
613
|
migrateDataDirOnce: () => migrateDataDirOnce,
|
|
614
|
+
mergeSchedulerSection: () => mergeSchedulerSection,
|
|
615
|
+
loadRawUserConfig: () => loadRawUserConfig,
|
|
565
616
|
loadConfigSafe: () => loadConfigSafe,
|
|
566
617
|
loadConfig: () => loadConfig,
|
|
567
618
|
initConfig: () => initConfig,
|
|
@@ -584,6 +635,22 @@ function getConfigPath() {
|
|
|
584
635
|
function configExists() {
|
|
585
636
|
return fs.existsSync(CONFIG_FILE);
|
|
586
637
|
}
|
|
638
|
+
function mergeSchedulerJobs(base, incoming) {
|
|
639
|
+
const defaults = defaultMassaAiConfig.scheduler?.jobs ?? {};
|
|
640
|
+
const merged = {};
|
|
641
|
+
for (const kind of Object.keys(defaults)) {
|
|
642
|
+
merged[kind] = { ...defaults[kind], ...base?.[kind], ...incoming?.[kind] };
|
|
643
|
+
}
|
|
644
|
+
return merged;
|
|
645
|
+
}
|
|
646
|
+
function mergeSchedulerSection(base, incoming) {
|
|
647
|
+
return {
|
|
648
|
+
...defaultMassaAiConfig.scheduler,
|
|
649
|
+
...base,
|
|
650
|
+
...incoming,
|
|
651
|
+
jobs: mergeSchedulerJobs(base?.jobs, incoming?.jobs)
|
|
652
|
+
};
|
|
653
|
+
}
|
|
587
654
|
function loadConfig() {
|
|
588
655
|
if (!fs.existsSync(CONFIG_FILE)) {
|
|
589
656
|
return defaultMassaAiConfig;
|
|
@@ -604,13 +671,27 @@ function loadConfig() {
|
|
|
604
671
|
memory: { ...defaultMassaAiConfig.memory, ...userConfig.memory },
|
|
605
672
|
hooks: { ...defaultMassaAiConfig.hooks, ...userConfig.hooks },
|
|
606
673
|
handoffs: { ...defaultMassaAiConfig.handoffs, ...userConfig.handoffs },
|
|
607
|
-
security: { ...defaultMassaAiConfig.security, ...userConfig.security }
|
|
674
|
+
security: { ...defaultMassaAiConfig.security, ...userConfig.security },
|
|
675
|
+
scheduler: mergeSchedulerSection(undefined, userConfig.scheduler),
|
|
676
|
+
capturePolicy: userConfig.capturePolicy ?? defaultMassaAiConfig.capturePolicy
|
|
608
677
|
};
|
|
609
678
|
} catch (error) {
|
|
610
679
|
console.error(`Error loading config from ${CONFIG_FILE}:`, error);
|
|
611
680
|
return defaultMassaAiConfig;
|
|
612
681
|
}
|
|
613
682
|
}
|
|
683
|
+
function loadRawUserConfig() {
|
|
684
|
+
try {
|
|
685
|
+
if (!fs.existsSync(CONFIG_FILE))
|
|
686
|
+
return {};
|
|
687
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, "utf-8"));
|
|
688
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
689
|
+
return {};
|
|
690
|
+
return parsed;
|
|
691
|
+
} catch {
|
|
692
|
+
return {};
|
|
693
|
+
}
|
|
694
|
+
}
|
|
614
695
|
function loadConfigSafe() {
|
|
615
696
|
try {
|
|
616
697
|
return loadConfig();
|
|
@@ -784,6 +865,31 @@ function parsePositiveIntEnv(raw2, defaultValue, opts) {
|
|
|
784
865
|
return Number.isInteger(n) && n >= floor ? n : defaultValue;
|
|
785
866
|
}
|
|
786
867
|
|
|
868
|
+
// ../../packages/shared/dist/config/embedding-dimensions.js
|
|
869
|
+
function knownEmbeddingDimensions(model) {
|
|
870
|
+
if (!model)
|
|
871
|
+
return;
|
|
872
|
+
return KNOWN_EMBEDDING_DIMENSIONS[model.trim()];
|
|
873
|
+
}
|
|
874
|
+
function resolveEmbeddingDimensions(model, configured, envValue) {
|
|
875
|
+
if (envValue !== undefined)
|
|
876
|
+
return { dimensions: envValue };
|
|
877
|
+
const known = knownEmbeddingDimensions(model);
|
|
878
|
+
if (known !== undefined) {
|
|
879
|
+
return configured !== undefined && configured !== known ? { dimensions: known, correctedFrom: configured } : { dimensions: known };
|
|
880
|
+
}
|
|
881
|
+
return { dimensions: configured ?? DEFAULT_EMBEDDING_DIMENSIONS };
|
|
882
|
+
}
|
|
883
|
+
var KNOWN_EMBEDDING_DIMENSIONS, DEFAULT_EMBEDDING_DIMENSIONS = 2560;
|
|
884
|
+
var init_embedding_dimensions = __esm(() => {
|
|
885
|
+
KNOWN_EMBEDDING_DIMENSIONS = {
|
|
886
|
+
"qwen3-embedding:8b": 4096,
|
|
887
|
+
"qwen3-embedding:4b": 2560,
|
|
888
|
+
"qwen3-embedding:0.6b": 1024,
|
|
889
|
+
"bge-m3": 1024
|
|
890
|
+
};
|
|
891
|
+
});
|
|
892
|
+
|
|
787
893
|
// ../../packages/shared/dist/config/index.js
|
|
788
894
|
import path4 from "path";
|
|
789
895
|
function envNum(key, fallback) {
|
|
@@ -1031,16 +1137,18 @@ class Config {
|
|
|
1031
1137
|
this.config[key] = value;
|
|
1032
1138
|
}
|
|
1033
1139
|
}
|
|
1034
|
-
var DEFAULT_LLM_MODEL = "qwen2.5:7b-instruct", DEFAULT_LLM_CODE_MODEL = "qwen2.5-coder:7b", SCHEDULER_JOB_ENV,
|
|
1140
|
+
var DEFAULT_LLM_MODEL = "qwen2.5:7b-instruct", DEFAULT_LLM_CODE_MODEL = "qwen2.5-coder:7b", SCHEDULER_JOB_ENV, DEFAULT_ALLOWED_EXTENSIONS, fileConfig, fileCacheL1Bytes, fileCacheL2Bytes, resolvedDataDir, defaultConfig, config;
|
|
1035
1141
|
var init_config = __esm(() => {
|
|
1036
1142
|
init_env();
|
|
1037
1143
|
init_config_loader();
|
|
1038
1144
|
init_massa_ai_config();
|
|
1039
1145
|
init_massa_ai_config();
|
|
1146
|
+
init_massa_ai_config();
|
|
1040
1147
|
init_config_loader();
|
|
1041
1148
|
init_config_writer();
|
|
1042
1149
|
init_xdg();
|
|
1043
1150
|
init_api_key();
|
|
1151
|
+
init_embedding_dimensions();
|
|
1044
1152
|
SCHEDULER_JOB_ENV = {
|
|
1045
1153
|
"memory-consolidation": {
|
|
1046
1154
|
enabledVar: "MASSA_AI_SCHEDULER_CONSOLIDATION_ENABLED",
|
|
@@ -8663,7 +8771,7 @@ function validatePolicy(policy, opts = {}) {
|
|
|
8663
8771
|
if (!Array.isArray(p.rules))
|
|
8664
8772
|
throw new TypeError("policy.rules must be an array");
|
|
8665
8773
|
const dropCount = p.rules.filter((r) => r?.disposition === "Drop").length;
|
|
8666
|
-
const maxIgnore = typeof p.maxIgnorePatterns === "number" ? p.maxIgnorePatterns :
|
|
8774
|
+
const maxIgnore = typeof p.maxIgnorePatterns === "number" ? p.maxIgnorePatterns : MAX_IGNORE_PATTERNS;
|
|
8667
8775
|
if (dropCount > maxIgnore) {
|
|
8668
8776
|
throw new TypeError(`policy: ${dropCount} Drop rules exceed maxIgnorePatterns=${maxIgnore}`);
|
|
8669
8777
|
}
|
|
@@ -8681,7 +8789,7 @@ function matchesGlob2(path14, pattern) {
|
|
|
8681
8789
|
}
|
|
8682
8790
|
return re.test(path14);
|
|
8683
8791
|
}
|
|
8684
|
-
var
|
|
8792
|
+
var DEFAULT_POLICY, applyPolicy = (filePath, policy) => {
|
|
8685
8793
|
const normalized = filePath.trim();
|
|
8686
8794
|
for (const rule of policy.rules) {
|
|
8687
8795
|
if (matchesGlob2(normalized, rule.pattern))
|
|
@@ -8690,42 +8798,8 @@ var MAX_MATCH_WORK = 1e5, MAX_IGNORE_PATTERNS2 = 1024, DEFAULT_POLICY, applyPoli
|
|
|
8690
8798
|
return "Keep";
|
|
8691
8799
|
}, regexCache;
|
|
8692
8800
|
var init_capture_policy = __esm(() => {
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
{ pattern: "**/node_modules/**", disposition: "Drop" },
|
|
8696
|
-
{ pattern: "**/.git/**", disposition: "Drop" },
|
|
8697
|
-
{ pattern: "**/dist/**", disposition: "Drop" },
|
|
8698
|
-
{ pattern: "**/build/**", disposition: "Drop" },
|
|
8699
|
-
{ pattern: "**/coverage/**", disposition: "Drop" },
|
|
8700
|
-
{ pattern: ".env", disposition: "Drop" },
|
|
8701
|
-
{ pattern: ".env.*", disposition: "Drop" },
|
|
8702
|
-
{ pattern: "**/generated/**", disposition: "Drop" },
|
|
8703
|
-
{ pattern: "**/*.generated.*", disposition: "Drop" },
|
|
8704
|
-
{ pattern: "**/*.d.ts", disposition: "Drop" },
|
|
8705
|
-
{ pattern: "**/__tests__/**", disposition: "Drop" },
|
|
8706
|
-
{ pattern: "**/tests/**", disposition: "Drop" },
|
|
8707
|
-
{ pattern: "**/*.test.ts", disposition: "Drop" },
|
|
8708
|
-
{ pattern: "**/*.test.tsx", disposition: "Drop" },
|
|
8709
|
-
{ pattern: "**/*.test.js", disposition: "Drop" },
|
|
8710
|
-
{ pattern: "**/*.test.jsx", disposition: "Drop" },
|
|
8711
|
-
{ pattern: "**/*.spec.ts", disposition: "Drop" },
|
|
8712
|
-
{ pattern: "**/*.spec.tsx", disposition: "Drop" },
|
|
8713
|
-
{ pattern: "**/*.spec.js", disposition: "Drop" },
|
|
8714
|
-
{ pattern: "**/*.spec.jsx", disposition: "Drop" },
|
|
8715
|
-
{ pattern: "**/benchmarks/**", disposition: "Drop" },
|
|
8716
|
-
{ pattern: "**/fixtures/**", disposition: "Drop" },
|
|
8717
|
-
{ pattern: "**/*.wasm*", disposition: "Drop" },
|
|
8718
|
-
{ pattern: "**/*.min.*", disposition: "Drop" },
|
|
8719
|
-
{ pattern: "**/*.map", disposition: "Drop" },
|
|
8720
|
-
{ pattern: "**/lock.yaml", disposition: "Drop" },
|
|
8721
|
-
{ pattern: "**/pnpm-lock.yaml", disposition: "Drop" },
|
|
8722
|
-
{ pattern: "**/package-lock.json", disposition: "Drop" },
|
|
8723
|
-
{ pattern: "**/bun.lockb", disposition: "Drop" },
|
|
8724
|
-
{ pattern: "**/yarn.lock", disposition: "Drop" }
|
|
8725
|
-
],
|
|
8726
|
-
maxMatchWork: MAX_MATCH_WORK,
|
|
8727
|
-
maxIgnorePatterns: MAX_IGNORE_PATTERNS2
|
|
8728
|
-
};
|
|
8801
|
+
init_dist();
|
|
8802
|
+
DEFAULT_POLICY = DEFAULT_CAPTURE_POLICY;
|
|
8729
8803
|
regexCache = new Map;
|
|
8730
8804
|
});
|
|
8731
8805
|
|
|
@@ -107171,11 +107245,17 @@ var init_config2 = __esm(() => {
|
|
|
107171
107245
|
ollama: (() => {
|
|
107172
107246
|
const file2 = fileFor("ollama");
|
|
107173
107247
|
const model = process.env.OLLAMA_EMBEDDING_MODEL || file2?.model || "qwen3-embedding:4b";
|
|
107248
|
+
const rawEnvDimensions = Number(process.env.OLLAMA_EMBEDDING_DIMENSIONS);
|
|
107249
|
+
const envDimensions = Number.isInteger(rawEnvDimensions) && rawEnvDimensions > 0 ? rawEnvDimensions : undefined;
|
|
107250
|
+
const resolvedDimensions = resolveEmbeddingDimensions(model, file2?.dimensions, envDimensions);
|
|
107251
|
+
if (resolvedDimensions.correctedFrom !== undefined) {
|
|
107252
|
+
logger.warn(`[ollama] config.json records embedding.dimensions ${resolvedDimensions.correctedFrom} for model ` + `"${model}", which emits ${resolvedDimensions.dimensions}. Using ${resolvedDimensions.dimensions}. ` + "Update embedding.dimensions in config.json (or set OLLAMA_EMBEDDING_DIMENSIONS) to silence this.");
|
|
107253
|
+
}
|
|
107174
107254
|
return {
|
|
107175
107255
|
provider: "ollama",
|
|
107176
107256
|
model,
|
|
107177
107257
|
baseURL: process.env.OLLAMA_BASE_URL || file2?.baseURL || "http://localhost:11434",
|
|
107178
|
-
dimensions:
|
|
107258
|
+
dimensions: resolvedDimensions.dimensions,
|
|
107179
107259
|
priority: selectedProvider === "ollama" ? 1 : 50,
|
|
107180
107260
|
timeout: 300000,
|
|
107181
107261
|
maxRetries: 2,
|
|
@@ -128407,7 +128487,7 @@ function envNum2(key, fileValue, fallback) {
|
|
|
128407
128487
|
}
|
|
128408
128488
|
function readFileSchedulerJobs() {
|
|
128409
128489
|
try {
|
|
128410
|
-
const raw2 =
|
|
128490
|
+
const raw2 = loadRawUserConfig().scheduler?.jobs;
|
|
128411
128491
|
return raw2;
|
|
128412
128492
|
} catch {
|
|
128413
128493
|
return;
|
package/dist/index.js
CHANGED
|
@@ -25398,7 +25398,7 @@ var init_xdg = () => {};
|
|
|
25398
25398
|
|
|
25399
25399
|
// ../../packages/shared/dist/config/massa-ai-config.js
|
|
25400
25400
|
import path2 from "path";
|
|
25401
|
-
var SCHEDULER_JOB_KINDS, defaultMassaAiConfig;
|
|
25401
|
+
var SCHEDULER_JOB_KINDS, MAX_MATCH_WORK = 1e5, MAX_IGNORE_PATTERNS = 1024, DEFAULT_CAPTURE_POLICY, DEFAULT_SCHEDULER_CONFIG, defaultMassaAiConfig;
|
|
25402
25402
|
var init_massa_ai_config = __esm(() => {
|
|
25403
25403
|
init_xdg();
|
|
25404
25404
|
SCHEDULER_JOB_KINDS = [
|
|
@@ -25408,6 +25408,54 @@ var init_massa_ai_config = __esm(() => {
|
|
|
25408
25408
|
"observation-bridge",
|
|
25409
25409
|
"checkpoint-purge"
|
|
25410
25410
|
];
|
|
25411
|
+
DEFAULT_CAPTURE_POLICY = {
|
|
25412
|
+
rules: [
|
|
25413
|
+
{ pattern: "**/node_modules/**", disposition: "Drop" },
|
|
25414
|
+
{ pattern: "**/.git/**", disposition: "Drop" },
|
|
25415
|
+
{ pattern: "**/dist/**", disposition: "Drop" },
|
|
25416
|
+
{ pattern: "**/build/**", disposition: "Drop" },
|
|
25417
|
+
{ pattern: "**/coverage/**", disposition: "Drop" },
|
|
25418
|
+
{ pattern: ".env", disposition: "Drop" },
|
|
25419
|
+
{ pattern: ".env.*", disposition: "Drop" },
|
|
25420
|
+
{ pattern: "**/generated/**", disposition: "Drop" },
|
|
25421
|
+
{ pattern: "**/*.generated.*", disposition: "Drop" },
|
|
25422
|
+
{ pattern: "**/*.d.ts", disposition: "Drop" },
|
|
25423
|
+
{ pattern: "**/__tests__/**", disposition: "Drop" },
|
|
25424
|
+
{ pattern: "**/tests/**", disposition: "Drop" },
|
|
25425
|
+
{ pattern: "**/*.test.ts", disposition: "Drop" },
|
|
25426
|
+
{ pattern: "**/*.test.tsx", disposition: "Drop" },
|
|
25427
|
+
{ pattern: "**/*.test.js", disposition: "Drop" },
|
|
25428
|
+
{ pattern: "**/*.test.jsx", disposition: "Drop" },
|
|
25429
|
+
{ pattern: "**/*.spec.ts", disposition: "Drop" },
|
|
25430
|
+
{ pattern: "**/*.spec.tsx", disposition: "Drop" },
|
|
25431
|
+
{ pattern: "**/*.spec.js", disposition: "Drop" },
|
|
25432
|
+
{ pattern: "**/*.spec.jsx", disposition: "Drop" },
|
|
25433
|
+
{ pattern: "**/benchmarks/**", disposition: "Drop" },
|
|
25434
|
+
{ pattern: "**/fixtures/**", disposition: "Drop" },
|
|
25435
|
+
{ pattern: "**/*.wasm*", disposition: "Drop" },
|
|
25436
|
+
{ pattern: "**/*.min.*", disposition: "Drop" },
|
|
25437
|
+
{ pattern: "**/*.map", disposition: "Drop" },
|
|
25438
|
+
{ pattern: "**/lock.yaml", disposition: "Drop" },
|
|
25439
|
+
{ pattern: "**/pnpm-lock.yaml", disposition: "Drop" },
|
|
25440
|
+
{ pattern: "**/package-lock.json", disposition: "Drop" },
|
|
25441
|
+
{ pattern: "**/bun.lockb", disposition: "Drop" },
|
|
25442
|
+
{ pattern: "**/yarn.lock", disposition: "Drop" }
|
|
25443
|
+
],
|
|
25444
|
+
maxMatchWork: MAX_MATCH_WORK,
|
|
25445
|
+
maxIgnorePatterns: MAX_IGNORE_PATTERNS
|
|
25446
|
+
};
|
|
25447
|
+
DEFAULT_SCHEDULER_CONFIG = {
|
|
25448
|
+
enabled: false,
|
|
25449
|
+
tickMs: 60000,
|
|
25450
|
+
maxConcurrent: 2,
|
|
25451
|
+
jobs: {
|
|
25452
|
+
"memory-consolidation": { enabled: false, intervalMs: 30 * 60 * 1000 },
|
|
25453
|
+
"decay-sweep": { enabled: false, intervalMs: 60 * 60 * 1000 },
|
|
25454
|
+
"auto-improve": { enabled: false, intervalMs: 30 * 60 * 1000 },
|
|
25455
|
+
"observation-bridge": { enabled: false, intervalMs: 30 * 60 * 1000 },
|
|
25456
|
+
"checkpoint-purge": { enabled: false, intervalMs: 60 * 60 * 1000 }
|
|
25457
|
+
}
|
|
25458
|
+
};
|
|
25411
25459
|
defaultMassaAiConfig = {
|
|
25412
25460
|
database: {
|
|
25413
25461
|
url: ""
|
|
@@ -25426,7 +25474,7 @@ var init_massa_ai_config = __esm(() => {
|
|
|
25426
25474
|
impact: {
|
|
25427
25475
|
bfsCteEnabled: false
|
|
25428
25476
|
},
|
|
25429
|
-
capturePolicy:
|
|
25477
|
+
capturePolicy: DEFAULT_CAPTURE_POLICY,
|
|
25430
25478
|
cache: {
|
|
25431
25479
|
enabled: true,
|
|
25432
25480
|
l1MaxSizeMB: 100,
|
|
@@ -25549,7 +25597,8 @@ var init_massa_ai_config = __esm(() => {
|
|
|
25549
25597
|
},
|
|
25550
25598
|
security: {
|
|
25551
25599
|
corsOrigins: []
|
|
25552
|
-
}
|
|
25600
|
+
},
|
|
25601
|
+
scheduler: DEFAULT_SCHEDULER_CONFIG
|
|
25553
25602
|
};
|
|
25554
25603
|
});
|
|
25555
25604
|
|
|
@@ -25559,6 +25608,8 @@ __export(exports_config_loader, {
|
|
|
25559
25608
|
writeFileAtomically: () => writeFileAtomically,
|
|
25560
25609
|
saveConfig: () => saveConfig,
|
|
25561
25610
|
migrateDataDirOnce: () => migrateDataDirOnce,
|
|
25611
|
+
mergeSchedulerSection: () => mergeSchedulerSection,
|
|
25612
|
+
loadRawUserConfig: () => loadRawUserConfig,
|
|
25562
25613
|
loadConfigSafe: () => loadConfigSafe,
|
|
25563
25614
|
loadConfig: () => loadConfig,
|
|
25564
25615
|
initConfig: () => initConfig,
|
|
@@ -25581,6 +25632,22 @@ function getConfigPath() {
|
|
|
25581
25632
|
function configExists() {
|
|
25582
25633
|
return fs.existsSync(CONFIG_FILE);
|
|
25583
25634
|
}
|
|
25635
|
+
function mergeSchedulerJobs(base, incoming) {
|
|
25636
|
+
const defaults = defaultMassaAiConfig.scheduler?.jobs ?? {};
|
|
25637
|
+
const merged = {};
|
|
25638
|
+
for (const kind of Object.keys(defaults)) {
|
|
25639
|
+
merged[kind] = { ...defaults[kind], ...base?.[kind], ...incoming?.[kind] };
|
|
25640
|
+
}
|
|
25641
|
+
return merged;
|
|
25642
|
+
}
|
|
25643
|
+
function mergeSchedulerSection(base, incoming) {
|
|
25644
|
+
return {
|
|
25645
|
+
...defaultMassaAiConfig.scheduler,
|
|
25646
|
+
...base,
|
|
25647
|
+
...incoming,
|
|
25648
|
+
jobs: mergeSchedulerJobs(base?.jobs, incoming?.jobs)
|
|
25649
|
+
};
|
|
25650
|
+
}
|
|
25584
25651
|
function loadConfig() {
|
|
25585
25652
|
if (!fs.existsSync(CONFIG_FILE)) {
|
|
25586
25653
|
return defaultMassaAiConfig;
|
|
@@ -25601,13 +25668,27 @@ function loadConfig() {
|
|
|
25601
25668
|
memory: { ...defaultMassaAiConfig.memory, ...userConfig.memory },
|
|
25602
25669
|
hooks: { ...defaultMassaAiConfig.hooks, ...userConfig.hooks },
|
|
25603
25670
|
handoffs: { ...defaultMassaAiConfig.handoffs, ...userConfig.handoffs },
|
|
25604
|
-
security: { ...defaultMassaAiConfig.security, ...userConfig.security }
|
|
25671
|
+
security: { ...defaultMassaAiConfig.security, ...userConfig.security },
|
|
25672
|
+
scheduler: mergeSchedulerSection(undefined, userConfig.scheduler),
|
|
25673
|
+
capturePolicy: userConfig.capturePolicy ?? defaultMassaAiConfig.capturePolicy
|
|
25605
25674
|
};
|
|
25606
25675
|
} catch (error51) {
|
|
25607
25676
|
console.error(`Error loading config from ${CONFIG_FILE}:`, error51);
|
|
25608
25677
|
return defaultMassaAiConfig;
|
|
25609
25678
|
}
|
|
25610
25679
|
}
|
|
25680
|
+
function loadRawUserConfig() {
|
|
25681
|
+
try {
|
|
25682
|
+
if (!fs.existsSync(CONFIG_FILE))
|
|
25683
|
+
return {};
|
|
25684
|
+
const parsed = JSON.parse(fs.readFileSync(CONFIG_FILE, "utf-8"));
|
|
25685
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
25686
|
+
return {};
|
|
25687
|
+
return parsed;
|
|
25688
|
+
} catch {
|
|
25689
|
+
return {};
|
|
25690
|
+
}
|
|
25691
|
+
}
|
|
25611
25692
|
function loadConfigSafe() {
|
|
25612
25693
|
try {
|
|
25613
25694
|
return loadConfig();
|
|
@@ -25781,6 +25862,31 @@ function parsePositiveIntEnv(raw2, defaultValue, opts) {
|
|
|
25781
25862
|
return Number.isInteger(n) && n >= floor ? n : defaultValue;
|
|
25782
25863
|
}
|
|
25783
25864
|
|
|
25865
|
+
// ../../packages/shared/dist/config/embedding-dimensions.js
|
|
25866
|
+
function knownEmbeddingDimensions(model) {
|
|
25867
|
+
if (!model)
|
|
25868
|
+
return;
|
|
25869
|
+
return KNOWN_EMBEDDING_DIMENSIONS[model.trim()];
|
|
25870
|
+
}
|
|
25871
|
+
function resolveEmbeddingDimensions(model, configured, envValue) {
|
|
25872
|
+
if (envValue !== undefined)
|
|
25873
|
+
return { dimensions: envValue };
|
|
25874
|
+
const known = knownEmbeddingDimensions(model);
|
|
25875
|
+
if (known !== undefined) {
|
|
25876
|
+
return configured !== undefined && configured !== known ? { dimensions: known, correctedFrom: configured } : { dimensions: known };
|
|
25877
|
+
}
|
|
25878
|
+
return { dimensions: configured ?? DEFAULT_EMBEDDING_DIMENSIONS };
|
|
25879
|
+
}
|
|
25880
|
+
var KNOWN_EMBEDDING_DIMENSIONS, DEFAULT_EMBEDDING_DIMENSIONS = 2560;
|
|
25881
|
+
var init_embedding_dimensions = __esm(() => {
|
|
25882
|
+
KNOWN_EMBEDDING_DIMENSIONS = {
|
|
25883
|
+
"qwen3-embedding:8b": 4096,
|
|
25884
|
+
"qwen3-embedding:4b": 2560,
|
|
25885
|
+
"qwen3-embedding:0.6b": 1024,
|
|
25886
|
+
"bge-m3": 1024
|
|
25887
|
+
};
|
|
25888
|
+
});
|
|
25889
|
+
|
|
25784
25890
|
// ../../packages/shared/dist/config/index.js
|
|
25785
25891
|
import path4 from "path";
|
|
25786
25892
|
function envNum(key, fallback) {
|
|
@@ -26028,16 +26134,18 @@ class Config {
|
|
|
26028
26134
|
this.config[key] = value;
|
|
26029
26135
|
}
|
|
26030
26136
|
}
|
|
26031
|
-
var DEFAULT_LLM_MODEL = "qwen2.5:7b-instruct", DEFAULT_LLM_CODE_MODEL = "qwen2.5-coder:7b", SCHEDULER_JOB_ENV,
|
|
26137
|
+
var DEFAULT_LLM_MODEL = "qwen2.5:7b-instruct", DEFAULT_LLM_CODE_MODEL = "qwen2.5-coder:7b", SCHEDULER_JOB_ENV, DEFAULT_ALLOWED_EXTENSIONS, fileConfig, fileCacheL1Bytes, fileCacheL2Bytes, resolvedDataDir, defaultConfig, config2;
|
|
26032
26138
|
var init_config = __esm(() => {
|
|
26033
26139
|
init_env();
|
|
26034
26140
|
init_config_loader();
|
|
26035
26141
|
init_massa_ai_config();
|
|
26036
26142
|
init_massa_ai_config();
|
|
26143
|
+
init_massa_ai_config();
|
|
26037
26144
|
init_config_loader();
|
|
26038
26145
|
init_config_writer();
|
|
26039
26146
|
init_xdg();
|
|
26040
26147
|
init_api_key();
|
|
26148
|
+
init_embedding_dimensions();
|
|
26041
26149
|
SCHEDULER_JOB_ENV = {
|
|
26042
26150
|
"memory-consolidation": {
|
|
26043
26151
|
enabledVar: "MASSA_AI_SCHEDULER_CONSOLIDATION_ENABLED",
|
|
@@ -33660,7 +33768,7 @@ function validatePolicy(policy, opts = {}) {
|
|
|
33660
33768
|
if (!Array.isArray(p.rules))
|
|
33661
33769
|
throw new TypeError("policy.rules must be an array");
|
|
33662
33770
|
const dropCount = p.rules.filter((r) => r?.disposition === "Drop").length;
|
|
33663
|
-
const maxIgnore = typeof p.maxIgnorePatterns === "number" ? p.maxIgnorePatterns :
|
|
33771
|
+
const maxIgnore = typeof p.maxIgnorePatterns === "number" ? p.maxIgnorePatterns : MAX_IGNORE_PATTERNS;
|
|
33664
33772
|
if (dropCount > maxIgnore) {
|
|
33665
33773
|
throw new TypeError(`policy: ${dropCount} Drop rules exceed maxIgnorePatterns=${maxIgnore}`);
|
|
33666
33774
|
}
|
|
@@ -33678,7 +33786,7 @@ function matchesGlob2(path14, pattern) {
|
|
|
33678
33786
|
}
|
|
33679
33787
|
return re.test(path14);
|
|
33680
33788
|
}
|
|
33681
|
-
var
|
|
33789
|
+
var DEFAULT_POLICY, applyPolicy = (filePath, policy) => {
|
|
33682
33790
|
const normalized = filePath.trim();
|
|
33683
33791
|
for (const rule of policy.rules) {
|
|
33684
33792
|
if (matchesGlob2(normalized, rule.pattern))
|
|
@@ -33687,42 +33795,8 @@ var MAX_MATCH_WORK = 1e5, MAX_IGNORE_PATTERNS2 = 1024, DEFAULT_POLICY, applyPoli
|
|
|
33687
33795
|
return "Keep";
|
|
33688
33796
|
}, regexCache;
|
|
33689
33797
|
var init_capture_policy = __esm(() => {
|
|
33690
|
-
|
|
33691
|
-
|
|
33692
|
-
{ pattern: "**/node_modules/**", disposition: "Drop" },
|
|
33693
|
-
{ pattern: "**/.git/**", disposition: "Drop" },
|
|
33694
|
-
{ pattern: "**/dist/**", disposition: "Drop" },
|
|
33695
|
-
{ pattern: "**/build/**", disposition: "Drop" },
|
|
33696
|
-
{ pattern: "**/coverage/**", disposition: "Drop" },
|
|
33697
|
-
{ pattern: ".env", disposition: "Drop" },
|
|
33698
|
-
{ pattern: ".env.*", disposition: "Drop" },
|
|
33699
|
-
{ pattern: "**/generated/**", disposition: "Drop" },
|
|
33700
|
-
{ pattern: "**/*.generated.*", disposition: "Drop" },
|
|
33701
|
-
{ pattern: "**/*.d.ts", disposition: "Drop" },
|
|
33702
|
-
{ pattern: "**/__tests__/**", disposition: "Drop" },
|
|
33703
|
-
{ pattern: "**/tests/**", disposition: "Drop" },
|
|
33704
|
-
{ pattern: "**/*.test.ts", disposition: "Drop" },
|
|
33705
|
-
{ pattern: "**/*.test.tsx", disposition: "Drop" },
|
|
33706
|
-
{ pattern: "**/*.test.js", disposition: "Drop" },
|
|
33707
|
-
{ pattern: "**/*.test.jsx", disposition: "Drop" },
|
|
33708
|
-
{ pattern: "**/*.spec.ts", disposition: "Drop" },
|
|
33709
|
-
{ pattern: "**/*.spec.tsx", disposition: "Drop" },
|
|
33710
|
-
{ pattern: "**/*.spec.js", disposition: "Drop" },
|
|
33711
|
-
{ pattern: "**/*.spec.jsx", disposition: "Drop" },
|
|
33712
|
-
{ pattern: "**/benchmarks/**", disposition: "Drop" },
|
|
33713
|
-
{ pattern: "**/fixtures/**", disposition: "Drop" },
|
|
33714
|
-
{ pattern: "**/*.wasm*", disposition: "Drop" },
|
|
33715
|
-
{ pattern: "**/*.min.*", disposition: "Drop" },
|
|
33716
|
-
{ pattern: "**/*.map", disposition: "Drop" },
|
|
33717
|
-
{ pattern: "**/lock.yaml", disposition: "Drop" },
|
|
33718
|
-
{ pattern: "**/pnpm-lock.yaml", disposition: "Drop" },
|
|
33719
|
-
{ pattern: "**/package-lock.json", disposition: "Drop" },
|
|
33720
|
-
{ pattern: "**/bun.lockb", disposition: "Drop" },
|
|
33721
|
-
{ pattern: "**/yarn.lock", disposition: "Drop" }
|
|
33722
|
-
],
|
|
33723
|
-
maxMatchWork: MAX_MATCH_WORK,
|
|
33724
|
-
maxIgnorePatterns: MAX_IGNORE_PATTERNS2
|
|
33725
|
-
};
|
|
33798
|
+
init_dist();
|
|
33799
|
+
DEFAULT_POLICY = DEFAULT_CAPTURE_POLICY;
|
|
33726
33800
|
regexCache = new Map;
|
|
33727
33801
|
});
|
|
33728
33802
|
|
|
@@ -113730,11 +113804,17 @@ var init_config2 = __esm(() => {
|
|
|
113730
113804
|
ollama: (() => {
|
|
113731
113805
|
const file2 = fileFor("ollama");
|
|
113732
113806
|
const model = process.env.OLLAMA_EMBEDDING_MODEL || file2?.model || "qwen3-embedding:4b";
|
|
113807
|
+
const rawEnvDimensions = Number(process.env.OLLAMA_EMBEDDING_DIMENSIONS);
|
|
113808
|
+
const envDimensions = Number.isInteger(rawEnvDimensions) && rawEnvDimensions > 0 ? rawEnvDimensions : undefined;
|
|
113809
|
+
const resolvedDimensions = resolveEmbeddingDimensions(model, file2?.dimensions, envDimensions);
|
|
113810
|
+
if (resolvedDimensions.correctedFrom !== undefined) {
|
|
113811
|
+
logger.warn(`[ollama] config.json records embedding.dimensions ${resolvedDimensions.correctedFrom} for model ` + `"${model}", which emits ${resolvedDimensions.dimensions}. Using ${resolvedDimensions.dimensions}. ` + "Update embedding.dimensions in config.json (or set OLLAMA_EMBEDDING_DIMENSIONS) to silence this.");
|
|
113812
|
+
}
|
|
113733
113813
|
return {
|
|
113734
113814
|
provider: "ollama",
|
|
113735
113815
|
model,
|
|
113736
113816
|
baseURL: process.env.OLLAMA_BASE_URL || file2?.baseURL || "http://localhost:11434",
|
|
113737
|
-
dimensions:
|
|
113817
|
+
dimensions: resolvedDimensions.dimensions,
|
|
113738
113818
|
priority: selectedProvider === "ollama" ? 1 : 50,
|
|
113739
113819
|
timeout: 300000,
|
|
113740
113820
|
maxRetries: 2,
|
|
@@ -144674,7 +144754,7 @@ function envNum2(key, fileValue, fallback) {
|
|
|
144674
144754
|
}
|
|
144675
144755
|
function readFileSchedulerJobs() {
|
|
144676
144756
|
try {
|
|
144677
|
-
const raw2 =
|
|
144757
|
+
const raw2 = loadRawUserConfig().scheduler?.jobs;
|
|
144678
144758
|
return raw2;
|
|
144679
144759
|
} catch {
|
|
144680
144760
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@massa-ai/mcp-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.49.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.49.0",
|
|
24
|
+
"@massa-ai/shared": "^1.49.0",
|
|
25
25
|
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|