@bitbonsai/mcpvault 0.10.0 → 0.11.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createServer.d.ts","sourceRoot":"","sources":["../../src/createServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAMnE,OAAO,EAAE,kBAAkB,EAAoB,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI7C,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"createServer.d.ts","sourceRoot":"","sources":["../../src/createServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAMnE,OAAO,EAAE,kBAAkB,EAAoB,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI7C,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,MAAM,CA8YzF"}
|
package/dist/src/createServer.js
CHANGED
|
@@ -197,6 +197,16 @@ export function createServer(vaultPath, options = {}) {
|
|
|
197
197
|
prettyPrint: { type: "boolean", description: "Format JSON response with indentation (default: false)", default: false }
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: "list_all_tags",
|
|
203
|
+
description: "List all tags across the vault with occurrence counts. Returns both frontmatter tags and inline #hashtags, deduplicated and sorted by frequency. Useful for discovering existing tags before creating or organizing notes.",
|
|
204
|
+
inputSchema: {
|
|
205
|
+
type: "object",
|
|
206
|
+
properties: {
|
|
207
|
+
prettyPrint: { type: "boolean", description: "Format JSON response with indentation (default: false)", default: false }
|
|
208
|
+
}
|
|
209
|
+
}
|
|
200
210
|
}
|
|
201
211
|
]
|
|
202
212
|
};
|
|
@@ -349,6 +359,13 @@ export function createServer(vaultPath, options = {}) {
|
|
|
349
359
|
content: [{ type: "text", text: JSON.stringify({ notes: stats.totalNotes, folders: stats.totalFolders, size: stats.totalSize, recent: stats.recentlyModified }, null, indent) }]
|
|
350
360
|
};
|
|
351
361
|
}
|
|
362
|
+
case "list_all_tags": {
|
|
363
|
+
const tags = await fileSystem.listAllTags();
|
|
364
|
+
const indent = trimmedArgs.prettyPrint ? 2 : undefined;
|
|
365
|
+
return {
|
|
366
|
+
content: [{ type: "text", text: JSON.stringify(tags, null, indent) }]
|
|
367
|
+
};
|
|
368
|
+
}
|
|
352
369
|
default:
|
|
353
370
|
throw new Error(`Unknown tool: ${toolName}`);
|
|
354
371
|
}
|
package/dist/src/filesystem.d.ts
CHANGED
|
@@ -22,5 +22,9 @@ export declare class FileSystemService {
|
|
|
22
22
|
manageTags(params: TagManagementParams): Promise<TagManagementResult>;
|
|
23
23
|
getVaultPath(): string;
|
|
24
24
|
getVaultStats(recentCount?: number): Promise<VaultStats>;
|
|
25
|
+
listAllTags(): Promise<Array<{
|
|
26
|
+
tag: string;
|
|
27
|
+
count: number;
|
|
28
|
+
}>>;
|
|
25
29
|
}
|
|
26
30
|
//# sourceMappingURL=filesystem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
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G,OAAO,CAAC,IAAI,CAAC;IA6EjD,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IA2F5D,aAAa,CAAC,IAAI,GAAE,MAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA8D3D,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAetC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAe3C,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC;IAmE3D,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAoFrD,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IA6HrD,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAgDpE,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BjE,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IA2ClD,UAAU,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IA0F3E,YAAY,IAAI,MAAM;IAIhB,aAAa,CAAC,WAAW,GAAE,MAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAyD3D,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAkDpE"}
|
package/dist/src/filesystem.js
CHANGED
|
@@ -828,4 +828,49 @@ export class FileSystemService {
|
|
|
828
828
|
recentlyModified: recentFiles
|
|
829
829
|
};
|
|
830
830
|
}
|
|
831
|
+
async listAllTags() {
|
|
832
|
+
const tagCounts = new Map();
|
|
833
|
+
const inlineTagRegex = /(?:^|\s)#([a-zA-Z][a-zA-Z0-9_/\-]*)/g;
|
|
834
|
+
const scanDirectory = async (dirPath, relativePath = '') => {
|
|
835
|
+
const entries = await readdir(dirPath, { withFileTypes: true });
|
|
836
|
+
for (const entry of entries) {
|
|
837
|
+
const entryRelativePath = relativePath ? `${relativePath}/${entry.name}` : entry.name;
|
|
838
|
+
const fullEntryPath = join(dirPath, entry.name);
|
|
839
|
+
if (entry.isDirectory()) {
|
|
840
|
+
if (!this.pathFilter.isAllowedForListing(entryRelativePath))
|
|
841
|
+
continue;
|
|
842
|
+
await scanDirectory(fullEntryPath, entryRelativePath);
|
|
843
|
+
}
|
|
844
|
+
else if (entry.isFile() && this.pathFilter.isAllowed(entryRelativePath)) {
|
|
845
|
+
try {
|
|
846
|
+
const content = await readFile(fullEntryPath, 'utf-8');
|
|
847
|
+
const parsed = this.frontmatterHandler.parse(content);
|
|
848
|
+
// Frontmatter tags
|
|
849
|
+
const fmTags = parsed.frontmatter?.tags;
|
|
850
|
+
if (Array.isArray(fmTags)) {
|
|
851
|
+
for (const tag of fmTags) {
|
|
852
|
+
if (typeof tag === 'string' && tag.trim()) {
|
|
853
|
+
const normalized = tag.trim().toLowerCase();
|
|
854
|
+
tagCounts.set(normalized, (tagCounts.get(normalized) || 0) + 1);
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
// Inline #tags from body content
|
|
859
|
+
let match;
|
|
860
|
+
while ((match = inlineTagRegex.exec(parsed.content)) !== null) {
|
|
861
|
+
const normalized = match[1].toLowerCase();
|
|
862
|
+
tagCounts.set(normalized, (tagCounts.get(normalized) || 0) + 1);
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
catch {
|
|
866
|
+
// Skip files that can't be read
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
};
|
|
871
|
+
await scanDirectory(this.vaultPath);
|
|
872
|
+
return Array.from(tagCounts.entries())
|
|
873
|
+
.map(([tag, count]) => ({ tag, count }))
|
|
874
|
+
.sort((a, b) => b.count - a.count || a.tag.localeCompare(b.tag));
|
|
875
|
+
}
|
|
831
876
|
}
|
package/package.json
CHANGED