@velvetmonkey/flywheel-crank 0.11.1 → 0.11.2

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 +27 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2093,9 +2093,17 @@ function registerMutationTools(server2, vaultPath2) {
2093
2093
  const { content: fileContent, frontmatter } = await readVaultFile(vaultPath2, notePath);
2094
2094
  const sectionBoundary = findSection(fileContent, section);
2095
2095
  if (!sectionBoundary) {
2096
+ const headings = extractHeadings(fileContent);
2097
+ let message;
2098
+ if (headings.length === 0) {
2099
+ message = `Section '${section}' not found. This file has no headings. Use vault_append_to_note for files without section structure.`;
2100
+ } else {
2101
+ const availableSections = headings.map((h) => h.text).join(", ");
2102
+ message = `Section '${section}' not found. Available sections: ${availableSections}`;
2103
+ }
2096
2104
  const result2 = {
2097
2105
  success: false,
2098
- message: `Section not found: ${section}`,
2106
+ message,
2099
2107
  path: notePath,
2100
2108
  tokensEstimate: 0
2101
2109
  };
@@ -2208,9 +2216,17 @@ function registerMutationTools(server2, vaultPath2) {
2208
2216
  const { content: fileContent, frontmatter } = await readVaultFile(vaultPath2, notePath);
2209
2217
  const sectionBoundary = findSection(fileContent, section);
2210
2218
  if (!sectionBoundary) {
2219
+ const headings = extractHeadings(fileContent);
2220
+ let message;
2221
+ if (headings.length === 0) {
2222
+ message = `Section '${section}' not found. This file has no headings. Use vault_append_to_note for files without section structure.`;
2223
+ } else {
2224
+ const availableSections = headings.map((h) => h.text).join(", ");
2225
+ message = `Section '${section}' not found. Available sections: ${availableSections}`;
2226
+ }
2211
2227
  const result2 = {
2212
2228
  success: false,
2213
- message: `Section not found: ${section}`,
2229
+ message,
2214
2230
  path: notePath,
2215
2231
  tokensEstimate: 0
2216
2232
  };
@@ -2304,9 +2320,17 @@ function registerMutationTools(server2, vaultPath2) {
2304
2320
  const { content: fileContent, frontmatter } = await readVaultFile(vaultPath2, notePath);
2305
2321
  const sectionBoundary = findSection(fileContent, section);
2306
2322
  if (!sectionBoundary) {
2323
+ const headings = extractHeadings(fileContent);
2324
+ let message;
2325
+ if (headings.length === 0) {
2326
+ message = `Section '${section}' not found. This file has no headings. Use vault_append_to_note for files without section structure.`;
2327
+ } else {
2328
+ const availableSections = headings.map((h) => h.text).join(", ");
2329
+ message = `Section '${section}' not found. Available sections: ${availableSections}`;
2330
+ }
2307
2331
  const result2 = {
2308
2332
  success: false,
2309
- message: `Section not found: ${section}`,
2333
+ message,
2310
2334
  path: notePath,
2311
2335
  tokensEstimate: 0
2312
2336
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velvetmonkey/flywheel-crank",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "description": "Deterministic vault mutations for Obsidian via MCP",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",