@velvetmonkey/flywheel-memory 2.0.25 → 2.0.26

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -42
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -168,24 +168,6 @@ function findSection(content, sectionName) {
168
168
  contentStartLine
169
169
  };
170
170
  }
171
- function isInsideCodeBlock(lines, currentIndex) {
172
- let fenceCount = 0;
173
- for (let i = 0; i < currentIndex; i++) {
174
- if (lines[i].trim().startsWith("```")) {
175
- fenceCount++;
176
- }
177
- }
178
- return fenceCount % 2 === 1;
179
- }
180
- function isStructuredLine(line) {
181
- const trimmed = line.trimStart();
182
- return trimmed.startsWith("|") || // Table row
183
- trimmed.startsWith(">") || // Blockquote
184
- trimmed.startsWith("```") || // Code fence
185
- /^-{3,}$/.test(trimmed) || // Horizontal rule (dashes)
186
- /^\*{3,}$/.test(trimmed) || // Horizontal rule (asterisks)
187
- /^_{3,}$/.test(trimmed);
188
- }
189
171
  function isPreformattedList(content) {
190
172
  const trimmed = content.trim();
191
173
  if (!trimmed) return false;
@@ -223,9 +205,6 @@ function formatContent(content, format) {
223
205
  return lines.map((line, i) => {
224
206
  if (i === 0) return `- ${line}`;
225
207
  if (line === "") return "";
226
- if (isInsideCodeBlock(lines, i) || isStructuredLine(line)) {
227
- return line;
228
- }
229
208
  return ` ${line}`;
230
209
  }).join("\n");
231
210
  }
@@ -237,9 +216,6 @@ function formatContent(content, format) {
237
216
  return lines.map((line, i) => {
238
217
  if (i === 0) return `- [ ] ${line}`;
239
218
  if (line === "") return "";
240
- if (isInsideCodeBlock(lines, i) || isStructuredLine(line)) {
241
- return line;
242
- }
243
219
  return ` ${line}`;
244
220
  }).join("\n");
245
221
  }
@@ -251,9 +227,6 @@ function formatContent(content, format) {
251
227
  return lines.map((line, i) => {
252
228
  if (i === 0) return `1. ${line}`;
253
229
  if (line === "") return "";
254
- if (isInsideCodeBlock(lines, i) || isStructuredLine(line)) {
255
- return line;
256
- }
257
230
  return ` ${line}`;
258
231
  }).join("\n");
259
232
  }
@@ -270,9 +243,6 @@ function formatContent(content, format) {
270
243
  return lines.map((line, i) => {
271
244
  if (i === 0) return `${prefix}${line}`;
272
245
  if (line === "") return "";
273
- if (isInsideCodeBlock(lines, i) || isStructuredLine(line)) {
274
- return line;
275
- }
276
246
  return `${indent}${line}`;
277
247
  }).join("\n");
278
248
  }
@@ -348,10 +318,8 @@ function insertInSection(content, section, newContent, position, options) {
348
318
  const indent = detectSectionBaseIndentation(lines, section.contentStartLine, section.endLine);
349
319
  if (indent) {
350
320
  const contentLines = formattedContent.split("\n");
351
- const indentedContent = contentLines.map((line, i) => {
352
- if (line === "" || isInsideCodeBlock(contentLines, i) || isStructuredLine(line)) {
353
- return line;
354
- }
321
+ const indentedContent = contentLines.map((line) => {
322
+ if (line === "") return line;
355
323
  return indent + line;
356
324
  }).join("\n");
357
325
  lines.splice(section.contentStartLine, 0, indentedContent);
@@ -373,10 +341,8 @@ function insertInSection(content, section, newContent, position, options) {
373
341
  if (options?.preserveListNesting) {
374
342
  const indent = detectSectionBaseIndentation(lines, section.contentStartLine, section.endLine);
375
343
  const contentLines = formattedContent.split("\n");
376
- const indentedContent = contentLines.map((line, i) => {
377
- if (line === "" || isInsideCodeBlock(contentLines, i) || isStructuredLine(line)) {
378
- return line;
379
- }
344
+ const indentedContent = contentLines.map((line) => {
345
+ if (line === "") return line;
380
346
  return indent + line;
381
347
  }).join("\n");
382
348
  lines[lastContentLineIdx] = indentedContent;
@@ -398,10 +364,8 @@ function insertInSection(content, section, newContent, position, options) {
398
364
  if (options?.preserveListNesting) {
399
365
  const indent = detectSectionBaseIndentation(lines, section.contentStartLine, section.endLine);
400
366
  const contentLines = formattedContent.split("\n");
401
- const indentedContent = contentLines.map((line, i) => {
402
- if (line === "" || isInsideCodeBlock(contentLines, i) || isStructuredLine(line)) {
403
- return line;
404
- }
367
+ const indentedContent = contentLines.map((line) => {
368
+ if (line === "") return line;
405
369
  return indent + line;
406
370
  }).join("\n");
407
371
  lines.splice(insertLine, 0, indentedContent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velvetmonkey/flywheel-memory",
3
- "version": "2.0.25",
3
+ "version": "2.0.26",
4
4
  "description": "MCP server that gives Claude full read/write access to your Obsidian vault. 42 tools for search, backlinks, graph queries, mutations, and hybrid semantic search.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@modelcontextprotocol/sdk": "^1.25.1",
53
- "@velvetmonkey/vault-core": "^2.0.25",
53
+ "@velvetmonkey/vault-core": "^2.0.26",
54
54
  "better-sqlite3": "^11.0.0",
55
55
  "chokidar": "^4.0.0",
56
56
  "gray-matter": "^4.0.3",