obsidian-mcp-server 3.4.0 → 3.5.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/AGENTS.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** obsidian-mcp-server
4
- **Version:** 3.4.0
4
+ **Version:** 3.5.0
5
5
  **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.12.3`
6
6
  **Engines:** Bun ≥1.3.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` ^2.0.0
package/CLAUDE.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** obsidian-mcp-server
4
- **Version:** 3.4.0
4
+ **Version:** 3.5.0
5
5
  **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.12.3`
6
6
  **Engines:** Bun ≥1.3.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` ^2.0.0
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![Version](https://img.shields.io/badge/Version-3.4.0-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/obsidian-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/obsidian-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/obsidian-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.0-blueviolet.svg?style=flat-square)](https://bun.sh/)
10
+ [![Version](https://img.shields.io/badge/Version-3.5.0-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/obsidian-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/obsidian-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/obsidian-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.0-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
12
12
  </div>
13
13
 
@@ -35,7 +35,7 @@ Fourteen tools grouped by shape — readers fetch notes and metadata, writers cr
35
35
  | `obsidian_write_note` | Create a note, replace a single section in place, or — with `overwrite: true` — clobber an existing file. Refuses whole-file writes against an existing path by default. |
36
36
  | `obsidian_append_to_note` | Append content to a note. Without `section`, creates the file if missing. With `section`, appends to a specific heading, block, or frontmatter field (file must exist). |
37
37
  | `obsidian_patch_note` | Surgical `append` / `prepend` / `replace` against a heading, block reference, or frontmatter field. |
38
- | `obsidian_replace_in_note` | Body-wide search-replace inside a single note. Literal or regex matching with whole-word, whitespace-flexible, and case-sensitivity options; supports capture-group replacement. |
38
+ | `obsidian_replace_in_note` | Search-replace inside a single note, scoped to the body by default. Literal or regex matching with whole-word, whitespace-flexible, and case-sensitivity options; supports capture-group replacement. |
39
39
  | `obsidian_manage_frontmatter` | Atomic `get` / `set` / `delete` on a single frontmatter key. |
40
40
  | `obsidian_manage_tags` | Add, remove, or list tags. Defaults to the frontmatter `tags:` array; `location: 'inline'` or `'both'` opts into mutating the note body. |
41
41
  | `obsidian_delete_note` | Permanently delete a note. Always asks the user to confirm first — the call is answered with a confirmation request and retried with the answer. |
@@ -106,7 +106,15 @@ Use `obsidian_get_note` with `format: "document-map"` to discover what targets e
106
106
 
107
107
  ### `obsidian_replace_in_note`
108
108
 
109
- Body-wide search-replace for edits that don't fit `obsidian_patch_note`'s structural targets. The note is fetched, replacements are applied sequentially (each sees the previous output), and the result is written back in a single `PUT`.
109
+ Search-replace for edits that don't fit `obsidian_patch_note`'s structural targets. The note is fetched, replacements are applied sequentially (each sees the previous output), and the result is written back in a single `PUT`.
110
+
111
+ `scope` selects what the replacements run over:
112
+
113
+ - `body` (default) — the text after the YAML frontmatter block. The block is re-attached from the original bytes, so it comes back byte-identical.
114
+ - `frontmatter` — only the YAML between the `---` fences. The fences themselves are never matched.
115
+ - `both` — each replacement runs over the frontmatter and then the body; `perReplacement[]` reports `bodyCount` and `frontmatterCount` separately.
116
+
117
+ With the frontmatter in scope, the rewritten YAML is re-parsed before anything is written: if it no longer parses as a mapping of properties, the call fails with `frontmatter_invalid` and the note keeps its original bytes. That check catches YAML that breaks — an unquoted `:` in a scalar, a list marker rewritten into an alias, a stray quote. It cannot catch an edit that stays well-formed while meaning something else, such as a substring collision that renames a key or a replacement that drops a scalar's quotes and changes its type. Prefer `obsidian_manage_frontmatter` for typed edits to a single property.
110
118
 
111
119
  Per-replacement options:
112
120
 
@@ -114,7 +122,7 @@ Per-replacement options:
114
122
  - `caseSensitive` — when `false`, match case-insensitively
115
123
  - `wholeWord` — wrap the pattern in `\b…\b`; works in both literal and regex modes
116
124
  - `flexibleWhitespace` — substitute any run of whitespace in `search` with `\s+`. Literal mode only — has no effect when `useRegex: true` (express it directly).
117
- - `replaceAll` — when `false`, only the first match is replaced
125
+ - `replaceAll` — when `false`, only the first match is replaced. Under `scope: 'both'` that one substitution goes to the frontmatter when it matches there, and to the body otherwise.
118
126
 
119
127
  Literal mode preserves `$1` / `$&` in the replacement verbatim — only `useRegex: true` expands capture-group references.
120
128
 
@@ -130,6 +138,8 @@ Add, remove, or list tags on a note. Operates on one of two representations, def
130
138
 
131
139
  `add` ensures the tag is present in the requested location(s); `remove` strips it; `list` ignores the input `tags` array. Inline `#tag` occurrences inside fenced code blocks are intentionally left alone.
132
140
 
141
+ Inline mode reads and writes the note body only — a `#` inside a YAML scalar is frontmatter, so it is neither listed as an inline tag nor rewritten by a removal. Removing an inline tag takes exactly one adjacent horizontal space with it — the one before the tag, or the one after when no space precedes it; every other byte survives, including nested list indentation, four-space indented code blocks, trailing two-space hard line breaks, and table cell padding.
142
+
133
143
  ---
134
144
 
135
145
  ### `obsidian_delete_note`
@@ -0,0 +1,16 @@
1
+ ---
2
+ summary: "obsidian_manage_tags inline removal and obsidian_replace_in_note no longer corrupt notes — whitespace collapse and frontmatter overwrite are both fixed."
3
+ breaking: true
4
+ security: false
5
+ ---
6
+
7
+ # 3.5.0 — 2026-08-22
8
+
9
+ ## Changed
10
+
11
+ - **`obsidian_replace_in_note` gains a `scope` input (`body` (default) | `frontmatter` | `both`)** — replacements now run over the note body only by default, with the YAML frontmatter block spliced off and re-attached verbatim; a replacement whose only match was in the frontmatter now reports zero matches and writes nothing, silently rather than as an error. Anchored patterns (`^`/`$`) bind to the body or the YAML rather than the whole file, so a pattern spanning the fence boundary is unmatchable under every scope. `perReplacement[]` reports `bodyCount`/`frontmatterCount` alongside `count` ([#112](https://github.com/cyanheads/obsidian-mcp-server/issues/112)).
12
+ - **A `scope` of `"frontmatter"` or `"both"` re-parses the rewritten YAML before writing** — a result that no longer parses as a mapping fails the whole call with the new `frontmatter_invalid` (`ValidationError`) and nothing is written; the `---` fences themselves are never matched under any scope ([#112](https://github.com/cyanheads/obsidian-mcp-server/issues/112)).
13
+
14
+ ## Fixed
15
+
16
+ - **`obsidian_manage_tags` inline tag removal no longer collapses whitespace across the whole note** — the frontmatter block is spliced off and re-attached byte-identical, the unanchored whitespace-collapse regexes are gone, and a removal takes exactly one adjacent space with the tag; nested list indentation, code-block indentation, hard line breaks, and table padding all survive untouched. Removal also now clears every repeated occurrence of the same tag in one call, where a single pass previously missed later occurrences ([#111](https://github.com/cyanheads/obsidian-mcp-server/issues/111)).
@@ -564,6 +564,11 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
564
564
  }>;
565
565
  date: import("zod").ZodOptional<import("zod").ZodString>;
566
566
  }, import("zod/v4/core").$strip>], "type">;
567
+ scope: import("zod").ZodDefault<import("zod").ZodEnum<{
568
+ body: "body";
569
+ both: "both";
570
+ frontmatter: "frontmatter";
571
+ }>>;
567
572
  replacements: import("zod").ZodArray<import("zod").ZodObject<{
568
573
  search: import("zod").ZodString;
569
574
  replace: import("zod").ZodString;
@@ -579,6 +584,8 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
579
584
  perReplacement: import("zod").ZodArray<import("zod").ZodObject<{
580
585
  search: import("zod").ZodString;
581
586
  count: import("zod").ZodNumber;
587
+ bodyCount: import("zod").ZodNumber;
588
+ frontmatterCount: import("zod").ZodNumber;
582
589
  }, import("zod/v4/core").$strip>>;
583
590
  previousSizeInBytes: import("zod").ZodNumber;
584
591
  currentSizeInBytes: import("zod").ZodNumber;
@@ -597,6 +604,11 @@ export declare const writeToolDefinitions: (import("@cyanheads/mcp-ts-core").Too
597
604
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
598
605
  readonly when: "A `useRegex: true` replacement supplied a `search` pattern that is well-formed but exceeds the 1024-character limit or contains nested quantifiers known to cause catastrophic backtracking against the note body.";
599
606
  readonly recovery: "Avoid nested quantifiers like `(a+)+` or `(.*)*`. Use a simpler pattern, or set useRegex to false to match `search` as a literal string.";
607
+ }, {
608
+ readonly reason: "frontmatter_invalid";
609
+ readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ValidationError;
610
+ readonly when: "A `scope` of \"frontmatter\" or \"both\" produced YAML that no longer parses as a mapping of properties. Nothing is written — the note keeps its original bytes. The check reads the rewritten YAML only, so a replacement that renames a key or changes a scalar's type while still parsing is not caught by it.";
611
+ readonly recovery: "Narrow the search so it cannot match inside the YAML, or leave scope at \"body\" and edit the property with obsidian_manage_frontmatter.";
600
612
  }, {
601
613
  readonly reason: "note_missing";
602
614
  readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAgBH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAK/B,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQhC,CAAC;AAEF,mHAAmH;AACnH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAiD,CAAC"}
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * @fileoverview obsidian_replace_in_note — string/regex search-replace inside a
3
3
  * single note. Composed read → mutate → write at the service layer; replacements
4
- * are applied sequentially over the evolving body.
4
+ * are applied sequentially over the evolving text of whichever parts of the note
5
+ * `scope` selects, with the frontmatter block out of scope by default.
5
6
  * @module mcp-server/tools/definitions/obsidian-replace-in-note.tool
6
7
  */
7
8
  import { z } from '@cyanheads/mcp-ts-core';
@@ -23,6 +24,11 @@ export declare const obsidianReplaceInNote: import("@cyanheads/mcp-ts-core").Too
23
24
  }>;
24
25
  date: z.ZodOptional<z.ZodString>;
25
26
  }, z.core.$strip>], "type">;
27
+ scope: z.ZodDefault<z.ZodEnum<{
28
+ body: "body";
29
+ both: "both";
30
+ frontmatter: "frontmatter";
31
+ }>>;
26
32
  replacements: z.ZodArray<z.ZodObject<{
27
33
  search: z.ZodString;
28
34
  replace: z.ZodString;
@@ -38,6 +44,8 @@ export declare const obsidianReplaceInNote: import("@cyanheads/mcp-ts-core").Too
38
44
  perReplacement: z.ZodArray<z.ZodObject<{
39
45
  search: z.ZodString;
40
46
  count: z.ZodNumber;
47
+ bodyCount: z.ZodNumber;
48
+ frontmatterCount: z.ZodNumber;
41
49
  }, z.core.$strip>>;
42
50
  previousSizeInBytes: z.ZodNumber;
43
51
  currentSizeInBytes: z.ZodNumber;
@@ -56,6 +64,11 @@ export declare const obsidianReplaceInNote: import("@cyanheads/mcp-ts-core").Too
56
64
  readonly code: JsonRpcErrorCode.ValidationError;
57
65
  readonly when: "A `useRegex: true` replacement supplied a `search` pattern that is well-formed but exceeds the 1024-character limit or contains nested quantifiers known to cause catastrophic backtracking against the note body.";
58
66
  readonly recovery: "Avoid nested quantifiers like `(a+)+` or `(.*)*`. Use a simpler pattern, or set useRegex to false to match `search` as a literal string.";
67
+ }, {
68
+ readonly reason: "frontmatter_invalid";
69
+ readonly code: JsonRpcErrorCode.ValidationError;
70
+ readonly when: "A `scope` of \"frontmatter\" or \"both\" produced YAML that no longer parses as a mapping of properties. Nothing is written — the note keeps its original bytes. The check reads the rewritten YAML only, so a replacement that renames a key or changes a scalar's type while still parsing is not caught by it.";
71
+ readonly recovery: "Narrow the search so it cannot match inside the YAML, or leave scope at \"body\" and edit the property with obsidian_manage_frontmatter.";
59
72
  }, {
60
73
  readonly reason: "note_missing";
61
74
  readonly code: JsonRpcErrorCode.NotFound;
@@ -1 +1 @@
1
- {"version":3,"file":"obsidian-replace-in-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-replace-in-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAuCjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+LhC,CAAC"}
1
+ {"version":3,"file":"obsidian-replace-in-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-replace-in-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAgDjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiRhC,CAAC"}
@@ -1,11 +1,13 @@
1
1
  /**
2
2
  * @fileoverview obsidian_replace_in_note — string/regex search-replace inside a
3
3
  * single note. Composed read → mutate → write at the service layer; replacements
4
- * are applied sequentially over the evolving body.
4
+ * are applied sequentially over the evolving text of whichever parts of the note
5
+ * `scope` selects, with the frontmatter block out of scope by default.
5
6
  * @module mcp-server/tools/definitions/obsidian-replace-in-note.tool
6
7
  */
7
8
  import { tool, z } from '@cyanheads/mcp-ts-core';
8
9
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
+ import { frontmatterParseError, splice } from '../../../services/obsidian/frontmatter-ops.js';
9
11
  import { getObsidianService } from '../../../services/obsidian/obsidian-service.js';
10
12
  import { nameRegexSafetyIssue } from './_shared/regex-safety.js';
11
13
  import { TargetSchema } from './_shared/schemas.js';
@@ -36,10 +38,14 @@ const ReplacementSchema = z
36
38
  })
37
39
  .describe('A single search/replace operation.');
38
40
  export const obsidianReplaceInNote = tool('obsidian_replace_in_note', {
39
- description: "Search and replace inside a single note, literally or by regex. Replacements run in array order, each over the previous one's output. Use for edits that don't fit `obsidian_patch_note`'s structural targets — e.g., body-wide find-and-replace.",
41
+ description: "Search and replace inside a single note, literally or by regex. Replacements run in array order, each over the previous one's output, and cover the note body only unless `scope` says otherwise — the YAML frontmatter block is left byte-identical by default, because a prose edit that lands in a scalar can silently invalidate the whole block. Use for edits that don't fit `obsidian_patch_note`'s structural targets — e.g., body-wide find-and-replace. Prefer `obsidian_manage_frontmatter` for typed edits to a single property.",
40
42
  annotations: { destructiveHint: true },
41
43
  input: z.object({
42
44
  target: TargetSchema.describe('Where the note lives.'),
45
+ scope: z
46
+ .enum(['body', 'frontmatter', 'both'])
47
+ .default('body')
48
+ .describe("Which part of the note the replacements run over. `body` leaves the YAML frontmatter block byte-identical. `frontmatter` and `both` also rewrite the YAML between the `---` fences — never the fences themselves — and re-parse it afterwards, failing the whole call and writing nothing if the result no longer parses. That check catches YAML that breaks, not YAML that still parses while meaning something else: a replacement that renames a key or strips a scalar's quotes passes it."),
43
49
  replacements: z
44
50
  .array(ReplacementSchema)
45
51
  .min(1)
@@ -54,7 +60,13 @@ export const obsidianReplaceInNote = tool('obsidian_replace_in_note', {
54
60
  .array(z
55
61
  .object({
56
62
  search: z.string().describe('The search term/pattern that ran.'),
57
- count: z.number().describe('Number of matches replaced for this entry.'),
63
+ count: z
64
+ .number()
65
+ .describe('Number of matches replaced for this entry, across every scope it ran in.'),
66
+ bodyCount: z.number().describe('Matches replaced in the note body.'),
67
+ frontmatterCount: z
68
+ .number()
69
+ .describe('Matches replaced inside the YAML frontmatter block. Always 0 under the default `body` scope.'),
58
70
  })
59
71
  .describe('Counts for one replacement entry.'))
60
72
  .describe('Per-entry counts in the order replacements were applied.'),
@@ -85,6 +97,12 @@ export const obsidianReplaceInNote = tool('obsidian_replace_in_note', {
85
97
  when: 'A `useRegex: true` replacement supplied a `search` pattern that is well-formed but exceeds the 1024-character limit or contains nested quantifiers known to cause catastrophic backtracking against the note body.',
86
98
  recovery: 'Avoid nested quantifiers like `(a+)+` or `(.*)*`. Use a simpler pattern, or set useRegex to false to match `search` as a literal string.',
87
99
  },
100
+ {
101
+ reason: 'frontmatter_invalid',
102
+ code: JsonRpcErrorCode.ValidationError,
103
+ when: 'A `scope` of "frontmatter" or "both" produced YAML that no longer parses as a mapping of properties. Nothing is written — the note keeps its original bytes. The check reads the rewritten YAML only, so a replacement that renames a key or changes a scalar\'s type while still parsing is not caught by it.',
104
+ recovery: 'Narrow the search so it cannot match inside the YAML, or leave scope at "body" and edit the property with obsidian_manage_frontmatter.',
105
+ },
88
106
  {
89
107
  reason: 'note_missing',
90
108
  code: JsonRpcErrorCode.NotFound,
@@ -128,11 +146,23 @@ export const obsidianReplaceInNote = tool('obsidian_replace_in_note', {
128
146
  const note = await svc.getNoteJson(ctx, target);
129
147
  // Delivered bytes — not note.stat.size (see ObsidianService.tryGetSize).
130
148
  const previousSizeInBytes = Buffer.byteLength(note.content, 'utf8');
131
- let body = note.content;
149
+ /**
150
+ * `note.content` is the whole file. Split it so each replacement runs only
151
+ * over the parts `scope` selects, and so the untouched half is re-attached
152
+ * from the original bytes rather than re-emitted.
153
+ */
154
+ const fm = splice(note.content);
155
+ const editFrontmatter = fm.hasFrontmatter && input.scope !== 'body';
156
+ const editBody = input.scope !== 'frontmatter';
157
+ let yamlText = fm.yamlText;
158
+ let body = fm.body;
132
159
  const perReplacement = [];
133
160
  let totalReplacements = 0;
134
- for (const r of input.replacements) {
135
- let count = 0;
161
+ /**
162
+ * Compile once per replacement — the pattern guards fire before any text is
163
+ * touched — and return a function that can run over each in-scope stretch.
164
+ */
165
+ const compile = (r) => {
136
166
  if (r.useRegex) {
137
167
  const pattern = r.wholeWord ? `\\b(?:${r.search})\\b` : r.search;
138
168
  const safetyIssue = nameRegexSafetyIssue(pattern, REPLACE_REGEX_MAX_LENGTH);
@@ -151,11 +181,15 @@ export const obsidianReplaceInNote = tool('obsidian_replace_in_note', {
151
181
  }
152
182
  // Count separately, then apply with the string overload so $1/$2/$&
153
183
  // capture-group references in `r.replace` are honored.
154
- const matches = body.match(re);
155
- count = matches ? (re.global ? matches.length : 1) : 0;
156
- body = body.replace(re, r.replace);
184
+ return (text) => {
185
+ const matches = text.match(re);
186
+ return {
187
+ text: text.replace(re, r.replace),
188
+ count: matches ? (re.global ? matches.length : 1) : 0,
189
+ };
190
+ };
157
191
  }
158
- else if (r.wholeWord || r.flexibleWhitespace) {
192
+ if (r.wholeWord || r.flexibleWhitespace) {
159
193
  // Literal-with-transformations: build a regex from the escaped needle.
160
194
  // Use the callback overload so `$1`/`$&` in `r.replace` stay literal.
161
195
  let escaped = r.search.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&');
@@ -164,27 +198,55 @@ export const obsidianReplaceInNote = tool('obsidian_replace_in_note', {
164
198
  if (r.wholeWord)
165
199
  escaped = `\\b${escaped}\\b`;
166
200
  const re = new RegExp(escaped, `${r.replaceAll ? 'g' : ''}${r.caseSensitive ? '' : 'i'}`);
167
- body = body.replace(re, () => {
168
- count++;
169
- return r.replace;
170
- });
201
+ return (text) => {
202
+ let count = 0;
203
+ const next = text.replace(re, () => {
204
+ count++;
205
+ return r.replace;
206
+ });
207
+ return { text: next, count };
208
+ };
171
209
  }
172
- else if (r.caseSensitive) {
173
- body = replaceLiteral(body, r.search, r.replace, r.replaceAll, () => {
210
+ const replaceEach = r.caseSensitive ? replaceLiteral : replaceLiteralCaseInsensitive;
211
+ return (text) => {
212
+ let count = 0;
213
+ const next = replaceEach(text, r.search, r.replace, r.replaceAll, () => {
174
214
  count++;
175
215
  });
216
+ return { text: next, count };
217
+ };
218
+ };
219
+ for (const r of input.replacements) {
220
+ const apply = compile(r);
221
+ let frontmatterCount = 0;
222
+ let bodyCount = 0;
223
+ if (editFrontmatter) {
224
+ const applied = apply(yamlText);
225
+ yamlText = applied.text;
226
+ frontmatterCount = applied.count;
176
227
  }
177
- else {
178
- body = replaceLiteralCaseInsensitive(body, r.search, r.replace, r.replaceAll, () => {
179
- count++;
180
- });
228
+ // `replaceAll: false` means one substitution for the note, and the
229
+ // frontmatter comes first a hit there is that one.
230
+ if (editBody && (r.replaceAll || frontmatterCount === 0)) {
231
+ const applied = apply(body);
232
+ body = applied.text;
233
+ bodyCount = applied.count;
181
234
  }
182
- perReplacement.push({ search: r.search, count });
235
+ const count = frontmatterCount + bodyCount;
236
+ perReplacement.push({ search: r.search, count, bodyCount, frontmatterCount });
183
237
  totalReplacements += count;
184
238
  }
239
+ // Validate before the write: a broken block reaching disk costs the note its
240
+ // properties, and Obsidian reports nothing.
241
+ if (editFrontmatter && yamlText !== fm.yamlText) {
242
+ const problem = frontmatterParseError(yamlText);
243
+ if (problem) {
244
+ throw ctx.fail('frontmatter_invalid', `Replacements left the frontmatter of ${note.path} unparseable: ${problem}`, { path: note.path, ...ctx.recoveryFor('frontmatter_invalid') });
245
+ }
246
+ }
185
247
  let currentSizeInBytes = previousSizeInBytes;
186
248
  if (totalReplacements > 0) {
187
- await svc.writeNote(ctx, target, body, 'markdown');
249
+ await svc.writeNote(ctx, target, fm.open + yamlText + fm.close + body, 'markdown');
188
250
  currentSizeInBytes = await svc.getSize(ctx, { type: 'path', path: note.path });
189
251
  }
190
252
  return {
@@ -204,7 +266,7 @@ export const obsidianReplaceInNote = tool('obsidian_replace_in_note', {
204
266
  '**Per replacement**',
205
267
  ];
206
268
  for (const r of result.perReplacement) {
207
- lines.push(`- \`${r.search}\` → ${r.count} match${r.count === 1 ? '' : 'es'}`);
269
+ lines.push(`- \`${r.search}\` → ${r.count} match${r.count === 1 ? '' : 'es'} (body ${r.bodyCount}, frontmatter ${r.frontmatterCount})`);
208
270
  }
209
271
  return [{ type: 'text', text: lines.join('\n') }];
210
272
  },
@@ -1 +1 @@
1
- {"version":3,"file":"obsidian-replace-in-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-replace-in-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MA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G,EAAE;QAC/B,OAAO,EAAE,CAAC;QACV,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"obsidian-replace-in-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-replace-in-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAEtC,MAAM,iBAAiB,GAAG,CAAC;KACxB,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,sCAAsC,CAAC;IAC1E,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC;IAC/E,QAAQ,EAAE,CAAC;SACR,OAAO,EAAE;SACT,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CACP,oIAAoI,CACrI;IACH,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IAC1F,SAAS,EAAE,CAAC;SACT,OAAO,EAAE;SACT,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CACP,wHAAwH,CACzH;IACH,kBAAkB,EAAE,CAAC;SAClB,OAAO,EAAE;SACT,OAAO,CAAC,KAAK,CAAC;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Y,EACZ,OAAmB;IAEnB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IAC9D,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjD,OAAO,QAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE;QAC/B,OAAO,EAAE,CAAC;QACV,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -4,6 +4,43 @@
4
4
  * tools when the upstream Local REST API has no single-call equivalent.
5
5
  * @module services/obsidian/frontmatter-ops
6
6
  */
7
+ /** The two halves of a note: its raw frontmatter prefix and everything after it. */
8
+ export interface Splice {
9
+ /** Everything after the closing fence. The whole file when `hasFrontmatter` is false. */
10
+ body: string;
11
+ /** Closing fence with the newlines around it. Empty when `hasFrontmatter` is false. */
12
+ close: string;
13
+ hasFrontmatter: boolean;
14
+ /** Opening fence and its newline. Empty when `hasFrontmatter` is false. */
15
+ open: string;
16
+ /** The frontmatter prefix verbatim — `open + yamlText + close`, and `''` when there is none. */
17
+ raw: string;
18
+ /** YAML text between the `---` fences. Empty when `hasFrontmatter` is false. */
19
+ yamlText: string;
20
+ }
21
+ /**
22
+ * Split a note into its raw frontmatter prefix and its body. `raw + body`
23
+ * reconstructs the input byte for byte, which is what makes this the primitive
24
+ * for body-scoped mutations: rebuild with the original `raw` and the frontmatter
25
+ * block is untouched by construction. Rebuilding through `serializeFrontmatter`
26
+ * would instead re-emit the YAML and can reformat scalars nobody asked to change.
27
+ *
28
+ * A file whose fence is never closed, whose `---` sits below the first line, or
29
+ * whose opening `---` carries trailing whitespace has no frontmatter — the whole
30
+ * thing is body, which is also how Obsidian reads each of those shapes.
31
+ */
32
+ export declare function splice(content: string): Splice;
33
+ /**
34
+ * Describe why `yamlText` is not usable as a frontmatter block, or `undefined`
35
+ * when it is. Catches YAML that no longer parses and YAML that parses to
36
+ * something other than a mapping — the two states in which Obsidian reads no
37
+ * properties at all.
38
+ *
39
+ * It cannot catch an edit that stays well-formed while meaning something else:
40
+ * a renamed key, a scalar that re-parses as a different type. Those are valid
41
+ * YAML and pass this check.
42
+ */
43
+ export declare function frontmatterParseError(yamlText: string): string | undefined;
7
44
  /**
8
45
  * Returns the full file content with `key` removed from the frontmatter.
9
46
  * If the file has no frontmatter or the key isn't present, returns content
@@ -26,7 +63,11 @@ export type TagLocation = 'frontmatter' | 'inline' | 'both';
26
63
  * are code, not tags.
27
64
  */
28
65
  export declare function reconcileTags(content: string, tags: string[], operation: TagOperation, location: TagLocation): TagReconcileResult;
29
- /** Read-only helpers for `obsidian_manage_tags list`. */
66
+ /**
67
+ * Read-only helpers for `obsidian_manage_tags list`. Inline tags are read from
68
+ * the body only, matching where a removal can actually reach — a `#` inside a
69
+ * YAML scalar is frontmatter, not a tag.
70
+ */
30
71
  export declare function listTagsFromContent(content: string, frontmatter: Record<string, unknown>): {
31
72
  frontmatter: string[];
32
73
  inline: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"frontmatter-ops.d.ts","sourceRoot":"","sources":["../../../src/services/obsidian/frontmatter-ops.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA8CH;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAOzE;AAED,MAAM,WAAW,kBAAkB;IACjC,sEAAsE;IACtE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,QAAQ,CAAC;AAC5C,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,SAAS,EAAE,YAAY,EACvB,QAAQ,EAAE,WAAW,GACpB,kBAAkB,CAqBpB;AA2JD,yDAAyD;AACzD,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC;IACD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAkBA"}
1
+ {"version":3,"file":"frontmatter-ops.d.ts","sourceRoot":"","sources":["../../../src/services/obsidian/frontmatter-ops.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,oFAAoF;AACpF,MAAM,WAAW,MAAM;IACrB,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,uFAAuF;IACvF,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,OAAO,CAAC;IACxB,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,gGAAgG;IAChG,GAAG,EAAE,MAAM,CAAC;IACZ,gFAAgF;IAChF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAa9C;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQ1E;AAyBD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAOzE;AAED,MAAM,WAAW,kBAAkB;IACjC,sEAAsE;IACtE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,QAAQ,CAAC;AAC5C,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,SAAS,EAAE,YAAY,EACvB,QAAQ,EAAE,WAAW,GACpB,kBAAkB,CAqBpB;AA2MD;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC;IACD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAkBA"}
@@ -5,17 +5,52 @@
5
5
  * @module services/obsidian/frontmatter-ops
6
6
  */
7
7
  import { isMap, parseDocument } from 'yaml';
8
- const FM_RE = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;
9
- function splice(content) {
8
+ const FM_RE = /^(---\r?\n)([\s\S]*?)(\r?\n---\r?\n?)/;
9
+ /**
10
+ * Split a note into its raw frontmatter prefix and its body. `raw + body`
11
+ * reconstructs the input byte for byte, which is what makes this the primitive
12
+ * for body-scoped mutations: rebuild with the original `raw` and the frontmatter
13
+ * block is untouched by construction. Rebuilding through `serializeFrontmatter`
14
+ * would instead re-emit the YAML and can reformat scalars nobody asked to change.
15
+ *
16
+ * A file whose fence is never closed, whose `---` sits below the first line, or
17
+ * whose opening `---` carries trailing whitespace has no frontmatter — the whole
18
+ * thing is body, which is also how Obsidian reads each of those shapes.
19
+ */
20
+ export function splice(content) {
10
21
  const m = FM_RE.exec(content);
11
- if (!m)
12
- return { hasFrontmatter: false, yamlText: '', body: content };
22
+ if (!m) {
23
+ return { hasFrontmatter: false, raw: '', open: '', yamlText: '', close: '', body: content };
24
+ }
13
25
  return {
14
26
  hasFrontmatter: true,
15
- yamlText: m[1] ?? '',
27
+ raw: m[0],
28
+ open: m[1] ?? '',
29
+ yamlText: m[2] ?? '',
30
+ close: m[3] ?? '',
16
31
  body: content.slice(m[0].length),
17
32
  };
18
33
  }
34
+ /**
35
+ * Describe why `yamlText` is not usable as a frontmatter block, or `undefined`
36
+ * when it is. Catches YAML that no longer parses and YAML that parses to
37
+ * something other than a mapping — the two states in which Obsidian reads no
38
+ * properties at all.
39
+ *
40
+ * It cannot catch an edit that stays well-formed while meaning something else:
41
+ * a renamed key, a scalar that re-parses as a different type. Those are valid
42
+ * YAML and pass this check.
43
+ */
44
+ export function frontmatterParseError(yamlText) {
45
+ const doc = parseDocument(yamlText);
46
+ const first = doc.errors[0];
47
+ if (first)
48
+ return first.message;
49
+ if (doc.contents !== null && !isMap(doc.contents)) {
50
+ return 'Frontmatter must be a YAML mapping of properties.';
51
+ }
52
+ return;
53
+ }
19
54
  /**
20
55
  * Re-emit the parsed frontmatter document between `---` fences, preserving the
21
56
  * comments, quoting, and scalar formatting of every untouched node — the reason
@@ -133,8 +168,14 @@ function normalizeTagList(value) {
133
168
  }
134
169
  const FENCED_CODE_BLOCK = /(```[\s\S]*?```|~~~[\s\S]*?~~~)/g;
135
170
  const INLINE_CODE = /(`[^`\n]+`)/g;
171
+ /**
172
+ * Inline `#tag` syntax lives in the body. The frontmatter block is spliced off
173
+ * first and re-attached verbatim, so a `#` inside a YAML scalar is neither read
174
+ * as a tag nor rewritten by a removal.
175
+ */
136
176
  function mutateInlineTags(content, tags, operation, applied, skipped) {
137
- const segments = splitProtectedSegments(content);
177
+ const { raw, body } = splice(content);
178
+ const segments = splitProtectedSegments(body);
138
179
  let updatedNonCode = false;
139
180
  if (operation === 'add') {
140
181
  for (const tag of tags) {
@@ -152,16 +193,23 @@ function mutateInlineTags(content, tags, operation, applied, skipped) {
152
193
  .map((t) => `#${t}`)
153
194
  .join(' ');
154
195
  if (additions.length > 0) {
196
+ /**
197
+ * The separator turns on everything that precedes the insertion point in
198
+ * the finished note — `raw` and every segment — not on any one of them.
199
+ * A note that is nothing but frontmatter has an empty body while `raw`
200
+ * already ends in a newline, and a note whose body ends at a closing code
201
+ * fence ends in a protected segment the tag must not be glued to.
202
+ */
203
+ const preceding = raw + segments.map((s) => s.text).join('');
204
+ const sep = preceding.endsWith('\n') ? '' : '\n';
155
205
  const trailing = segments.length > 0 ? (segments[segments.length - 1] ?? null) : null;
156
206
  if (trailing && !trailing.protected) {
157
- const sep = trailing.text.endsWith('\n') ? '' : '\n';
158
207
  trailing.text = `${trailing.text}${sep}${additions}\n`;
159
- updatedNonCode = true;
160
208
  }
161
209
  else {
162
- segments.push({ protected: false, text: `\n${additions}\n` });
163
- updatedNonCode = true;
210
+ segments.push({ protected: false, text: `${sep}${additions}\n` });
164
211
  }
212
+ updatedNonCode = true;
165
213
  }
166
214
  }
167
215
  else {
@@ -171,23 +219,47 @@ function mutateInlineTags(content, tags, operation, applied, skipped) {
171
219
  for (const s of segments) {
172
220
  if (s.protected)
173
221
  continue;
174
- if (re.test(s.text)) {
175
- s.text = s.text.replace(re, (_full, leading) => leading);
176
- // collapse double spaces left behind
177
- s.text = s.text.replace(/[ \t]{2,}/g, ' ').replace(/ \n/g, '\n');
222
+ /**
223
+ * One pass is not enough: the regex consumes the space after the tag,
224
+ * and that space is the left boundary the next occurrence needs, so a
225
+ * single pass stops at the first of two same tags separated by one
226
+ * space. Repeat until the segment stops changing — every pass drops at
227
+ * least the tag itself, so this terminates.
228
+ */
229
+ for (let next = s.text.replace(re, removeAt); next !== s.text; next = s.text.replace(re, removeAt)) {
230
+ s.text = next;
178
231
  found = true;
179
- updatedNonCode = true;
180
232
  }
181
233
  }
182
- if (found)
234
+ if (found) {
183
235
  applied.add(tag);
184
- else
236
+ updatedNonCode = true;
237
+ }
238
+ else {
185
239
  skipped.add(tag);
240
+ }
186
241
  }
187
242
  }
188
243
  if (!updatedNonCode)
189
244
  return content;
190
- return segments.map((s) => s.text).join('');
245
+ return raw + segments.map((s) => s.text).join('');
246
+ }
247
+ /**
248
+ * Close the gap a removed tag leaves without touching anything else. Exactly one
249
+ * adjacent horizontal space goes with the tag — the one before it when there is
250
+ * one, otherwise the one after — so neighbouring words neither jam together nor
251
+ * end up separated by a widened gap. Everything outside that span survives byte
252
+ * for byte: list and code-block indentation, a trailing two-space hard line
253
+ * break, table cell padding.
254
+ */
255
+ function removeAt(full, leading, trailing, offset, whole) {
256
+ if (!/^[ \t]$/.test(leading))
257
+ return leading;
258
+ // A space is all that marks the start of an immediately following tag —
259
+ // taking it would silently stop that tag being one.
260
+ if (trailing === '' && whole[offset + full.length] === '#')
261
+ return leading;
262
+ return trailing;
191
263
  }
192
264
  function splitProtectedSegments(content) {
193
265
  const segments = [];
@@ -209,16 +281,21 @@ function splitProtectedSegments(content) {
209
281
  }
210
282
  return segments;
211
283
  }
284
+ /** Captures the character before the tag and the single horizontal space after it, if any. */
212
285
  function makeInlineTagRegex(tag) {
213
286
  const escaped = tag.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&');
214
- return new RegExp(`(^|[^\\w/])#${escaped}(?![\\w/-])`, 'g');
287
+ return new RegExp(`(^|[^\\w/])#${escaped}(?![\\w/-])([ \\t]?)`, 'g');
215
288
  }
216
- /** Read-only helpers for `obsidian_manage_tags list`. */
289
+ /**
290
+ * Read-only helpers for `obsidian_manage_tags list`. Inline tags are read from
291
+ * the body only, matching where a removal can actually reach — a `#` inside a
292
+ * YAML scalar is frontmatter, not a tag.
293
+ */
217
294
  export function listTagsFromContent(content, frontmatter) {
218
295
  const fmTags = normalizeTagList(frontmatter.tags);
219
296
  const inline = [];
220
297
  const seen = new Set();
221
- for (const seg of splitProtectedSegments(content)) {
298
+ for (const seg of splitProtectedSegments(splice(content).body)) {
222
299
  if (seg.protected)
223
300
  continue;
224
301
  const re = /(^|[^\w/])#([a-zA-Z][\w/-]*)/g;
@@ -1 +1 @@
1
- {"version":3,"file":"frontmatter-ops.js","sourceRoot":"","sources":["../../../src/services/obsidian/frontmatter-ops.ts"],"names":[],"mappings":"AAAA;;;;;GAKG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 +1,7 @@
1
1
  {
2
2
  "manifest_version": "0.3",
3
3
  "name": "obsidian-mcp-server",
4
- "version": "3.4.0",
4
+ "version": "3.5.0",
5
5
  "description": "Read, write, search, and surgically edit Obsidian vault notes, tags, and frontmatter via MCP. STDIO or Streamable HTTP.",
6
6
  "author": {
7
7
  "name": "cyanheads",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-mcp-server",
3
- "version": "3.4.0",
3
+ "version": "3.5.0",
4
4
  "mcpName": "io.github.cyanheads/obsidian-mcp-server",
5
5
  "description": "Read, write, search, and surgically edit Obsidian vault notes, tags, and frontmatter via MCP. STDIO or Streamable HTTP.",
6
6
  "type": "module",
package/server.json CHANGED
@@ -6,14 +6,14 @@
6
6
  "url": "https://github.com/cyanheads/obsidian-mcp-server",
7
7
  "source": "github"
8
8
  },
9
- "version": "3.4.0",
9
+ "version": "3.5.0",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "registryBaseUrl": "https://registry.npmjs.org",
14
14
  "identifier": "obsidian-mcp-server",
15
15
  "runtimeHint": "node",
16
- "version": "3.4.0",
16
+ "version": "3.5.0",
17
17
  "packageArguments": [
18
18
  {
19
19
  "type": "positional",
@@ -101,7 +101,7 @@
101
101
  "registryBaseUrl": "https://registry.npmjs.org",
102
102
  "identifier": "obsidian-mcp-server",
103
103
  "runtimeHint": "node",
104
- "version": "3.4.0",
104
+ "version": "3.5.0",
105
105
  "packageArguments": [
106
106
  {
107
107
  "type": "positional",