@velvetmonkey/flywheel-memory 2.0.147 → 2.0.149
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/index.js +18 -7
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3396,7 +3396,8 @@ async function rebuildIndex(vaultPath2) {
|
|
|
3396
3396
|
console.error(`[Flywheel] Scanning vault for entities...`);
|
|
3397
3397
|
const startTime = Date.now();
|
|
3398
3398
|
entityIndex = await scanVaultEntities(vaultPath2, {
|
|
3399
|
-
excludeFolders: DEFAULT_EXCLUDE_FOLDERS
|
|
3399
|
+
excludeFolders: DEFAULT_EXCLUDE_FOLDERS,
|
|
3400
|
+
customCategories: getConfig()?.custom_categories
|
|
3400
3401
|
});
|
|
3401
3402
|
indexReady = true;
|
|
3402
3403
|
lastLoadedAt = Date.now();
|
|
@@ -3689,6 +3690,12 @@ function isLikelyArticleTitle(name) {
|
|
|
3689
3690
|
}
|
|
3690
3691
|
return false;
|
|
3691
3692
|
}
|
|
3693
|
+
function getTypeBoost(category, customCategories) {
|
|
3694
|
+
if (customCategories?.[category]?.type_boost != null) {
|
|
3695
|
+
return customCategories[category].type_boost;
|
|
3696
|
+
}
|
|
3697
|
+
return TYPE_BOOST[category] || 0;
|
|
3698
|
+
}
|
|
3692
3699
|
function getCrossFolderBoost(entityPath, notePath) {
|
|
3693
3700
|
if (!entityPath || !notePath) return 0;
|
|
3694
3701
|
const entityParts = entityPath.split("/");
|
|
@@ -3869,7 +3876,7 @@ async function suggestRelatedLinks(content, options = {}) {
|
|
|
3869
3876
|
if (contentScore > 0) {
|
|
3870
3877
|
entitiesWithContentMatch.add(entityName);
|
|
3871
3878
|
}
|
|
3872
|
-
const layerTypeBoost = disabled.has("type_boost") ? 0 :
|
|
3879
|
+
const layerTypeBoost = disabled.has("type_boost") ? 0 : getTypeBoost(category, getConfig()?.custom_categories);
|
|
3873
3880
|
score += layerTypeBoost;
|
|
3874
3881
|
const layerContextBoost = disabled.has("context_boost") ? 0 : contextBoosts[category] || 0;
|
|
3875
3882
|
score += layerContextBoost;
|
|
@@ -3961,7 +3968,7 @@ async function suggestRelatedLinks(content, options = {}) {
|
|
|
3961
3968
|
if (hasContentOverlap || strongCooccurrence) {
|
|
3962
3969
|
entitiesWithContentMatch.add(entityName);
|
|
3963
3970
|
}
|
|
3964
|
-
const typeBoost = disabled.has("type_boost") ? 0 :
|
|
3971
|
+
const typeBoost = disabled.has("type_boost") ? 0 : getTypeBoost(category, getConfig()?.custom_categories);
|
|
3965
3972
|
const contextBoost = disabled.has("context_boost") ? 0 : contextBoosts[category] || 0;
|
|
3966
3973
|
const recencyBoostVal = hasContentOverlap && !disabled.has("recency") ? recencyIndex ? getRecencyBoost(entityName, recencyIndex) : 0 : 0;
|
|
3967
3974
|
const rawCrossFolderBoost = disabled.has("cross_folder") ? 0 : notePath && entity.path ? getCrossFolderBoost(entity.path, notePath) : 0;
|
|
@@ -4022,7 +4029,7 @@ async function suggestRelatedLinks(content, options = {}) {
|
|
|
4022
4029
|
if (!disabled.has("length_filter") && match.entityName.length > MAX_ENTITY_LENGTH) continue;
|
|
4023
4030
|
if (!disabled.has("article_filter") && isLikelyArticleTitle(match.entityName)) continue;
|
|
4024
4031
|
const { entity, category } = entityWithType;
|
|
4025
|
-
const layerTypeBoost = disabled.has("type_boost") ? 0 :
|
|
4032
|
+
const layerTypeBoost = disabled.has("type_boost") ? 0 : getTypeBoost(category, getConfig()?.custom_categories);
|
|
4026
4033
|
const layerContextBoost = disabled.has("context_boost") ? 0 : contextBoosts[category] || 0;
|
|
4027
4034
|
const layerHubBoost = disabled.has("hub_boost") ? 0 : getHubBoost(entity);
|
|
4028
4035
|
const layerCrossFolderBoost = disabled.has("cross_folder") ? 0 : notePath && entity.path ? getCrossFolderBoost(entity.path, notePath) : 0;
|
|
@@ -14759,6 +14766,7 @@ function registerSystemTools(server2, getIndex, setIndex, getVaultPath, setConfi
|
|
|
14759
14766
|
const stateDb2 = getStateDb3?.();
|
|
14760
14767
|
if (stateDb2) {
|
|
14761
14768
|
try {
|
|
14769
|
+
const config = loadConfig(stateDb2);
|
|
14762
14770
|
const entityIndex2 = await scanVaultEntities2(vaultPath2, {
|
|
14763
14771
|
excludeFolders: [
|
|
14764
14772
|
"daily-notes",
|
|
@@ -14780,7 +14788,8 @@ function registerSystemTools(server2, getIndex, setIndex, getVaultPath, setConfi
|
|
|
14780
14788
|
"articles",
|
|
14781
14789
|
"bookmarks",
|
|
14782
14790
|
"web-clips"
|
|
14783
|
-
]
|
|
14791
|
+
],
|
|
14792
|
+
customCategories: config.custom_categories
|
|
14784
14793
|
});
|
|
14785
14794
|
stateDb2.replaceAllEntities(entityIndex2);
|
|
14786
14795
|
console.error(`[Flywheel] Updated ${entityIndex2._metadata.total_entities} entities in StateDb`);
|
|
@@ -22565,7 +22574,8 @@ async function executeRun(stateDb2, vaultPath2) {
|
|
|
22565
22574
|
if (entityCount === 0) {
|
|
22566
22575
|
const start = Date.now();
|
|
22567
22576
|
try {
|
|
22568
|
-
const
|
|
22577
|
+
const config = loadConfig(stateDb2);
|
|
22578
|
+
const entityIndex2 = await scanVaultEntities3(vaultPath2, { excludeFolders: EXCLUDE_FOLDERS, customCategories: config.custom_categories });
|
|
22569
22579
|
stateDb2.replaceAllEntities(entityIndex2);
|
|
22570
22580
|
const newCount = entityIndex2._metadata.total_entities;
|
|
22571
22581
|
steps.push({
|
|
@@ -25616,7 +25626,8 @@ async function updateEntitiesInStateDb(vp, sd) {
|
|
|
25616
25626
|
const config = loadConfig(db4);
|
|
25617
25627
|
const excludeFolders = config.exclude_entity_folders?.length ? config.exclude_entity_folders : DEFAULT_ENTITY_EXCLUDE_FOLDERS;
|
|
25618
25628
|
const entityIndex2 = await scanVaultEntities4(vault, {
|
|
25619
|
-
excludeFolders
|
|
25629
|
+
excludeFolders,
|
|
25630
|
+
customCategories: config.custom_categories
|
|
25620
25631
|
});
|
|
25621
25632
|
db4.replaceAllEntities(entityIndex2);
|
|
25622
25633
|
serverLog("index", `Updated ${entityIndex2._metadata.total_entities} entities in StateDb`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@velvetmonkey/flywheel-memory",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.149",
|
|
4
4
|
"description": "MCP server that gives Claude full read/write access to your Obsidian vault. Select from 74 tools for search, backlinks, graph queries, mutations, agent memory, and hybrid semantic search.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@huggingface/transformers": "^3.8.1",
|
|
56
56
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
57
|
-
"@velvetmonkey/vault-core": "^2.0.
|
|
57
|
+
"@velvetmonkey/vault-core": "^2.0.149",
|
|
58
58
|
"better-sqlite3": "^12.0.0",
|
|
59
59
|
"chokidar": "^4.0.0",
|
|
60
60
|
"gray-matter": "^4.0.3",
|