neuro-vault-mcp 10.0.2 → 10.1.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/cli.js +16 -3
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -14530,7 +14530,7 @@ function normalizeScanPrefix(raw) {
|
|
|
14530
14530
|
}
|
|
14531
14531
|
|
|
14532
14532
|
// src/lib/obsidian/frontmatter.ts
|
|
14533
|
-
import { parse as parseYaml } from "yaml";
|
|
14533
|
+
import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
|
|
14534
14534
|
|
|
14535
14535
|
// src/lib/obsidian/in-place-edit.ts
|
|
14536
14536
|
var FRONTMATTER_OPEN = /^---[ \t]*\r?\n/;
|
|
@@ -14611,6 +14611,11 @@ function splitFrontmatter(raw) {
|
|
|
14611
14611
|
}
|
|
14612
14612
|
return { frontmatter: parsed, content };
|
|
14613
14613
|
}
|
|
14614
|
+
function serializeFrontmatter(fm) {
|
|
14615
|
+
return `---
|
|
14616
|
+
${stringifyYaml(fm)}---
|
|
14617
|
+
`;
|
|
14618
|
+
}
|
|
14614
14619
|
|
|
14615
14620
|
// src/lib/obsidian/wikilink.ts
|
|
14616
14621
|
var WIKILINK_RE = /\[\[(.+?)\]\]/g;
|
|
@@ -16517,12 +16522,13 @@ function buildCreateNoteTool(deps) {
|
|
|
16517
16522
|
name: external_exports.string().optional(),
|
|
16518
16523
|
path: external_exports.string().optional(),
|
|
16519
16524
|
content: external_exports.string().optional(),
|
|
16525
|
+
frontmatter: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
16520
16526
|
overwrite: external_exports.boolean().optional()
|
|
16521
16527
|
});
|
|
16522
16528
|
return {
|
|
16523
16529
|
name: "create_note",
|
|
16524
16530
|
title: "Create Note",
|
|
16525
|
-
description: "Create a new note. Provide `name` or `path` (exactly one). Optionally provide `content` (raw markdown for the note body and frontmatter). Paths without an extension are treated as `.md` notes.\n\nBefore composing `content`, sample 1\u20132 similar notes from the vault to mimic existing conventions instead of inventing your own. A reliable pattern: `search_notes` for the topic (or `query_notes` with a tag/folder filter that fits) to find candidates, then `read_notes` on the closest match to inspect its frontmatter shape, tag values, heading layout, and folder placement. Match those conventions \u2014 the user almost always prefers a new note that looks like its neighbours. Be especially careful with the `type` frontmatter field: vaults tend to use a small closed set (e.g. project / task / idea / reflection / daily / review / inbox / resource); pick from what other notes use rather than coining a new value.\n\nTemplates are not handled by this tool \u2014 render any template yourself (Obsidian Core Templates, Templater, or anything else) and pass the result as `content`." + describeMultiVault(
|
|
16531
|
+
description: "Create a new note. Provide `name` or `path` (exactly one). Optionally provide `content` (raw markdown for the note body) and/or `frontmatter` (an object of frontmatter properties, serialized to a YAML block and prepended to the note \u2014 prefer this over hand-writing a `---` block inside `content`; it quotes `[[wikilinks]]`, formats dates, and renders tag lists correctly). If `content` also begins with its own `---` block, the two are merged key-by-key and the `frontmatter` parameter wins on any key collision (the body is kept). Paths without an extension are treated as `.md` notes.\n\nBefore composing `content`, sample 1\u20132 similar notes from the vault to mimic existing conventions instead of inventing your own. A reliable pattern: `search_notes` for the topic (or `query_notes` with a tag/folder filter that fits) to find candidates, then `read_notes` on the closest match to inspect its frontmatter shape, tag values, heading layout, and folder placement. Match those conventions \u2014 the user almost always prefers a new note that looks like its neighbours. Be especially careful with the `type` frontmatter field: vaults tend to use a small closed set (e.g. project / task / idea / reflection / daily / review / inbox / resource); pick from what other notes use rather than coining a new value.\n\nTemplates are not handled by this tool \u2014 render any template yourself (Obsidian Core Templates, Templater, or anything else) and pass the result as `content`." + describeMultiVault(
|
|
16526
16532
|
registry2,
|
|
16527
16533
|
'Pass `vault: "<name>"` to target a specific vault when multiple are registered.'
|
|
16528
16534
|
) + " If a note with this path/name might already exist and the user has not explicitly asked to replace it, ask the user before passing `overwrite: true` \u2014 overwrite is destructive. Default behavior fails when the note exists.",
|
|
@@ -16548,7 +16554,14 @@ function buildCreateNoteTool(deps) {
|
|
|
16548
16554
|
}
|
|
16549
16555
|
}
|
|
16550
16556
|
if (input.overwrite !== void 0) passthrough.overwrite = input.overwrite;
|
|
16551
|
-
|
|
16557
|
+
const hasFrontmatter = input.frontmatter !== void 0 && Object.keys(input.frontmatter).length > 0;
|
|
16558
|
+
if (hasFrontmatter) {
|
|
16559
|
+
const { frontmatter: contentFm, content: body } = splitFrontmatter(input.content ?? "");
|
|
16560
|
+
const merged = { ...contentFm ?? {}, ...input.frontmatter };
|
|
16561
|
+
passthrough.content = serializeFrontmatter(merged) + body;
|
|
16562
|
+
} else if (input.content !== void 0) {
|
|
16563
|
+
passthrough.content = input.content;
|
|
16564
|
+
}
|
|
16552
16565
|
const result = await entry.provider.createNote(passthrough);
|
|
16553
16566
|
return { vault: entry.name, ...result };
|
|
16554
16567
|
}
|