obsidian-mcp-server 3.1.11 → 3.2.1

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 (60) hide show
  1. package/CLAUDE.md +2 -2
  2. package/README.md +20 -18
  3. package/changelog/3.2.x/3.2.0.md +49 -0
  4. package/changelog/3.2.x/3.2.1.md +31 -0
  5. package/dist/config/server-config.d.ts +1 -0
  6. package/dist/config/server-config.d.ts.map +1 -1
  7. package/dist/config/server-config.js +6 -0
  8. package/dist/config/server-config.js.map +1 -1
  9. package/dist/index.d.ts +4 -2
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +26 -9
  12. package/dist/index.js.map +1 -1
  13. package/dist/mcp-server/tools/definitions/_shared/regex-safety.d.ts +18 -0
  14. package/dist/mcp-server/tools/definitions/_shared/regex-safety.d.ts.map +1 -0
  15. package/dist/mcp-server/tools/definitions/_shared/regex-safety.js +34 -0
  16. package/dist/mcp-server/tools/definitions/_shared/regex-safety.js.map +1 -0
  17. package/dist/mcp-server/tools/definitions/_shared/schemas.js +1 -1
  18. package/dist/mcp-server/tools/definitions/_shared/schemas.js.map +1 -1
  19. package/dist/mcp-server/tools/definitions/index.d.ts +46 -845
  20. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  21. package/dist/mcp-server/tools/definitions/index.js +10 -6
  22. package/dist/mcp-server/tools/definitions/index.js.map +1 -1
  23. package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.d.ts +5 -0
  24. package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.d.ts.map +1 -1
  25. package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.js +6 -0
  26. package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.js.map +1 -1
  27. package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.d.ts +5 -0
  28. package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.d.ts.map +1 -1
  29. package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.js +36 -2
  30. package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.js.map +1 -1
  31. package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.d.ts +21 -2
  32. package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.d.ts.map +1 -1
  33. package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.js +59 -6
  34. package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.js.map +1 -1
  35. package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.d.ts.map +1 -1
  36. package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.js +2 -22
  37. package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.js.map +1 -1
  38. package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.d.ts.map +1 -1
  39. package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.js +3 -3
  40. package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.js.map +1 -1
  41. package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.d.ts +1 -1
  42. package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.d.ts.map +1 -1
  43. package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.js +5 -2
  44. package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.js.map +1 -1
  45. package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.d.ts +5 -0
  46. package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.d.ts.map +1 -1
  47. package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.js +6 -0
  48. package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.js.map +1 -1
  49. package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.d.ts +172 -20
  50. package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.d.ts.map +1 -1
  51. package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.js +249 -136
  52. package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.js.map +1 -1
  53. package/dist/services/obsidian/obsidian-service.d.ts +22 -2
  54. package/dist/services/obsidian/obsidian-service.d.ts.map +1 -1
  55. package/dist/services/obsidian/obsidian-service.js +155 -13
  56. package/dist/services/obsidian/obsidian-service.js.map +1 -1
  57. package/dist/services/obsidian/types.d.ts +25 -2
  58. package/dist/services/obsidian/types.d.ts.map +1 -1
  59. package/package.json +3 -3
  60. package/server.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"obsidian-patch-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-patch-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AASjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyH5B,CAAC"}
1
+ {"version":3,"file":"obsidian-patch-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-patch-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AASjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgI5B,CAAC"}
@@ -72,6 +72,12 @@ export const obsidianPatchNote = tool('obsidian_patch_note', {
72
72
  when: 'The named heading/block/frontmatter field does not exist in the note. Use `obsidian_get_note` with `format: "document-map"` to discover available targets.',
73
73
  recovery: 'Call obsidian_get_note with format document-map to discover the available targets.',
74
74
  },
75
+ {
76
+ reason: 'content_preexists',
77
+ code: JsonRpcErrorCode.ValidationError,
78
+ when: 'The supplied content already appears at the target — the patch was rejected to keep retries idempotent (the default).',
79
+ recovery: 'Pass `patchOptions.applyIfContentPreexists: true` to force-apply over preexisting content, or change the content to something not already present.',
80
+ },
75
81
  ],
76
82
  async handler(input, ctx) {
77
83
  const svc = getObsidianService();
@@ -1 +1 @@
1
- {"version":3,"file":"obsidian-patch-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-patch-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,EACL,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,YAAY,GACb,MAAM,sBAAsB,CAAC;AAE9B,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,qBAAqB,EAAE;IAC3D,WAAW,EACT,gQAAgQ;IAClQ,WAAW,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;IACtC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACtD,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,gDAAgD,CAAC;QACjF,SAAS,EAAE,CAAC;aACT,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;aACtC,QAAQ,CACP,+QAA+Q,CAChR;QACH,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,QAAQ,CAAC,kEAAkE,CAAC;QAC/E,WAAW,EAAE,iBAAiB;QAC9B,YAAY,EAAE,kBAAkB,CAAC,QAAQ,CACvC,uFAAuF,CACxF;KACF,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,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ClB;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE;gBACJ,aAAa,MAAM,CAAC,IAAI,IAAI;gBAC5B,gBAAgB,MAAM,CAAC,SAAS,EAAE;gBAClC,cAAc,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE;gBAC9D,WAAW,MAAM,CAAC,mBAAmB,MAAM,MAAM,CAAC,kBAAkB,QAAQ;aAC7E,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"obsidian-patch-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-patch-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,EACL,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,YAAY,GACb,MAAM,sBAAsB,CAAC;AAE9B,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,qBAAqB,EAAE;IAC3D,WAAW,EACT,gQAAgQ;IAClQ,WAAW,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;IACtC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACtD,OAAO,EAAE,aAAa,CAAC,QAAQ,CAAC,gDAAgD,CAAC;QACjF,SAAS,EAAE,CAAC;aACT,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;aACtC,QAAQ,CACP,+QAA+Q,CAChR;QACH,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,QAAQ,CAAC,kEAAkE,CAAC;QAC/E,WAAW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,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QAE9D,OAAO;YACL,IAAI;YACJ,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,mBAAmB;YACnB,kBAAkB;SACnB,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC;QAClB;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE;gBACJ,aAAa,MAAM,CAAC,IAAI,IAAI;gBAC5B,gBAAgB,MAAM,CAAC,SAAS,EAAE;gBAClC,cAAc,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE;gBAC9D,WAAW,MAAM,CAAC,mBAAmB,MAAM,MAAM,CAAC,kBAAkB,QAAQ;aAC7E,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF;CACF,CAAC,CAAC"}
@@ -1,30 +1,39 @@
1
1
  /**
2
- * @fileoverview obsidian_search_notes — text/dataview/jsonlogic search.
3
- * Caps results at 100 hits and surfaces an `excluded` indicator when more
4
- * were returned upstream. Text-mode hits are additionally capped per file
5
- * via `maxMatchesPerHit` so a single match-heavy note can't blow the
6
- * response budget — clipped hits carry `truncated: true` and `totalMatches`.
2
+ * @fileoverview obsidian_search_notes — text/jsonlogic/omnisearch search with
3
+ * MCP-spec cursor pagination. The `omnisearch` mode is added conditionally by
4
+ * the entry point only when the Omnisearch plugin's HTTP server is reachable
5
+ * at startup. Text-mode hits additionally clip per file via `maxMatchesPerHit`
6
+ * so a single match-heavy note can't blow the response budget — clipped hits
7
+ * carry `truncated: true` and `totalMatches`.
7
8
  * @module mcp-server/tools/definitions/obsidian-search-notes.tool
8
9
  */
9
10
  import { z } from '@cyanheads/mcp-ts-core';
10
11
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
11
- export declare const obsidianSearchNotes: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
12
+ /**
13
+ * Build the `obsidian_search_notes` tool. The `omnisearch` mode is included
14
+ * in the input/output schemas only when `omnisearchReachable` is true so the
15
+ * LLM never sees it as an option on a deployment where it can't run. Re-probe
16
+ * requires a server restart.
17
+ */
18
+ export declare function buildSearchNotesTool({ omnisearchReachable }: {
19
+ omnisearchReachable: boolean;
20
+ }): import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
12
21
  mode: z.ZodEnum<{
13
22
  text: "text";
14
- dataview: "dataview";
15
23
  jsonlogic: "jsonlogic";
24
+ omnisearch: "omnisearch";
16
25
  }>;
17
26
  query: z.ZodOptional<z.ZodString>;
18
27
  logic: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
19
28
  contextLength: z.ZodDefault<z.ZodNumber>;
20
29
  pathPrefix: z.ZodOptional<z.ZodString>;
21
30
  maxMatchesPerHit: z.ZodDefault<z.ZodNumber>;
31
+ cursor: z.ZodOptional<z.ZodString>;
22
32
  }, z.core.$strip>, z.ZodObject<{
23
33
  result: z.ZodDiscriminatedUnion<[z.ZodObject<{
24
34
  mode: z.ZodLiteral<"text">;
25
35
  hits: z.ZodArray<z.ZodObject<{
26
36
  filename: z.ZodString;
27
- score: z.ZodOptional<z.ZodNumber>;
28
37
  matches: z.ZodArray<z.ZodObject<{
29
38
  context: z.ZodString;
30
39
  match: z.ZodObject<{
@@ -35,30 +44,167 @@ export declare const obsidianSearchNotes: import("@cyanheads/mcp-ts-core").ToolD
35
44
  totalMatches: z.ZodOptional<z.ZodNumber>;
36
45
  truncated: z.ZodOptional<z.ZodBoolean>;
37
46
  }, z.core.$strip>>;
38
- excluded: z.ZodOptional<z.ZodObject<{
39
- count: z.ZodNumber;
40
- hint: z.ZodString;
47
+ totalCount: z.ZodNumber;
48
+ nextCursor: z.ZodOptional<z.ZodString>;
49
+ }, z.core.$strip>, z.ZodObject<{
50
+ mode: z.ZodLiteral<"jsonlogic">;
51
+ hits: z.ZodArray<z.ZodObject<{
52
+ filename: z.ZodString;
53
+ result: z.ZodUnknown;
54
+ }, z.core.$strip>>;
55
+ totalCount: z.ZodNumber;
56
+ nextCursor: z.ZodOptional<z.ZodString>;
57
+ }, z.core.$strip>, z.ZodObject<{
58
+ mode: z.ZodLiteral<"omnisearch">;
59
+ hits: z.ZodArray<z.ZodObject<{
60
+ filename: z.ZodString;
61
+ basename: z.ZodString;
62
+ score: z.ZodNumber;
63
+ foundWords: z.ZodArray<z.ZodString>;
64
+ matches: z.ZodArray<z.ZodObject<{
65
+ match: z.ZodString;
66
+ offset: z.ZodNumber;
67
+ }, z.core.$strip>>;
68
+ excerpt: z.ZodString;
69
+ }, z.core.$strip>>;
70
+ totalCount: z.ZodNumber;
71
+ nextCursor: z.ZodOptional<z.ZodString>;
72
+ truncated: z.ZodBoolean;
73
+ }, z.core.$strip>] | [z.ZodObject<{
74
+ mode: z.ZodLiteral<"text">;
75
+ hits: z.ZodArray<z.ZodObject<{
76
+ filename: z.ZodString;
77
+ matches: z.ZodArray<z.ZodObject<{
78
+ context: z.ZodString;
79
+ match: z.ZodObject<{
80
+ start: z.ZodNumber;
81
+ end: z.ZodNumber;
82
+ }, z.core.$strip>;
83
+ }, z.core.$strip>>;
84
+ totalMatches: z.ZodOptional<z.ZodNumber>;
85
+ truncated: z.ZodOptional<z.ZodBoolean>;
41
86
  }, z.core.$strip>>;
87
+ totalCount: z.ZodNumber;
88
+ nextCursor: z.ZodOptional<z.ZodString>;
42
89
  }, z.core.$strip>, z.ZodObject<{
43
- mode: z.ZodLiteral<"dataview">;
90
+ mode: z.ZodLiteral<"jsonlogic">;
44
91
  hits: z.ZodArray<z.ZodObject<{
45
92
  filename: z.ZodString;
46
93
  result: z.ZodUnknown;
47
94
  }, z.core.$strip>>;
48
- excluded: z.ZodOptional<z.ZodObject<{
49
- count: z.ZodNumber;
50
- hint: z.ZodString;
95
+ totalCount: z.ZodNumber;
96
+ nextCursor: z.ZodOptional<z.ZodString>;
97
+ }, z.core.$strip>], "mode">;
98
+ }, z.core.$strip>, readonly [{
99
+ readonly reason: "path_prefix_invalid_mode";
100
+ readonly code: JsonRpcErrorCode.ValidationError;
101
+ readonly when: "`pathPrefix` was provided in a non-text mode (only `text` supports prefix filtering).";
102
+ readonly recovery: "Drop pathPrefix or switch mode to text for prefix filtering.";
103
+ }, {
104
+ readonly reason: "query_required";
105
+ readonly code: JsonRpcErrorCode.ValidationError;
106
+ readonly when: "`query` is missing for `text` or `omnisearch` mode (required for both).";
107
+ readonly recovery: "Pass `query` — substring for text mode, or BM25 query syntax (quoted phrases, `-exclusion`, `path:` / `ext:` filters) for omnisearch.";
108
+ }, {
109
+ readonly reason: "logic_required";
110
+ readonly code: JsonRpcErrorCode.ValidationError;
111
+ readonly when: "`logic` is missing for `jsonlogic` mode.";
112
+ readonly recovery: "Pass a JSONLogic tree as `logic`, e.g. `{\"glob\": [{\"var\": \"path\"}, \"Projects/*.md\"]}`.";
113
+ }, {
114
+ readonly reason: "omnisearch_unreachable";
115
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
116
+ readonly when: "Omnisearch was reachable at startup but is now unreachable (Obsidian quit, plugin disabled, or mobile session).";
117
+ readonly retryable: true;
118
+ readonly recovery: "Restart Obsidian with the Omnisearch plugin enabled, then restart this MCP server so it re-probes the plugin URL.";
119
+ }]>;
120
+ /**
121
+ * Static specimen for the MCP definition linter (which duck-types tool
122
+ * exports out of each `.tool.ts` file) and for existing tests that import
123
+ * the tool directly. Defaults to `omnisearchReachable: false` — the safe
124
+ * baseline that doesn't assume the optional plugin is installed. The entry
125
+ * point (`src/index.ts`) builds the live tool via `buildSearchNotesTool`
126
+ * with the actual probe result; this export is not the registered tool.
127
+ * The omnisearch-enabled variant is exercised by tests rather than the
128
+ * linter (two exports under the same tool name would collide on
129
+ * `name-unique`).
130
+ */
131
+ export declare const obsidianSearchNotes: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
132
+ mode: z.ZodEnum<{
133
+ text: "text";
134
+ jsonlogic: "jsonlogic";
135
+ omnisearch: "omnisearch";
136
+ }>;
137
+ query: z.ZodOptional<z.ZodString>;
138
+ logic: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
139
+ contextLength: z.ZodDefault<z.ZodNumber>;
140
+ pathPrefix: z.ZodOptional<z.ZodString>;
141
+ maxMatchesPerHit: z.ZodDefault<z.ZodNumber>;
142
+ cursor: z.ZodOptional<z.ZodString>;
143
+ }, z.core.$strip>, z.ZodObject<{
144
+ result: z.ZodDiscriminatedUnion<[z.ZodObject<{
145
+ mode: z.ZodLiteral<"text">;
146
+ hits: z.ZodArray<z.ZodObject<{
147
+ filename: z.ZodString;
148
+ matches: z.ZodArray<z.ZodObject<{
149
+ context: z.ZodString;
150
+ match: z.ZodObject<{
151
+ start: z.ZodNumber;
152
+ end: z.ZodNumber;
153
+ }, z.core.$strip>;
154
+ }, z.core.$strip>>;
155
+ totalMatches: z.ZodOptional<z.ZodNumber>;
156
+ truncated: z.ZodOptional<z.ZodBoolean>;
51
157
  }, z.core.$strip>>;
158
+ totalCount: z.ZodNumber;
159
+ nextCursor: z.ZodOptional<z.ZodString>;
52
160
  }, z.core.$strip>, z.ZodObject<{
53
161
  mode: z.ZodLiteral<"jsonlogic">;
54
162
  hits: z.ZodArray<z.ZodObject<{
55
163
  filename: z.ZodString;
56
164
  result: z.ZodUnknown;
57
165
  }, z.core.$strip>>;
58
- excluded: z.ZodOptional<z.ZodObject<{
59
- count: z.ZodNumber;
60
- hint: z.ZodString;
166
+ totalCount: z.ZodNumber;
167
+ nextCursor: z.ZodOptional<z.ZodString>;
168
+ }, z.core.$strip>, z.ZodObject<{
169
+ mode: z.ZodLiteral<"omnisearch">;
170
+ hits: z.ZodArray<z.ZodObject<{
171
+ filename: z.ZodString;
172
+ basename: z.ZodString;
173
+ score: z.ZodNumber;
174
+ foundWords: z.ZodArray<z.ZodString>;
175
+ matches: z.ZodArray<z.ZodObject<{
176
+ match: z.ZodString;
177
+ offset: z.ZodNumber;
178
+ }, z.core.$strip>>;
179
+ excerpt: z.ZodString;
61
180
  }, z.core.$strip>>;
181
+ totalCount: z.ZodNumber;
182
+ nextCursor: z.ZodOptional<z.ZodString>;
183
+ truncated: z.ZodBoolean;
184
+ }, z.core.$strip>] | [z.ZodObject<{
185
+ mode: z.ZodLiteral<"text">;
186
+ hits: z.ZodArray<z.ZodObject<{
187
+ filename: z.ZodString;
188
+ matches: z.ZodArray<z.ZodObject<{
189
+ context: z.ZodString;
190
+ match: z.ZodObject<{
191
+ start: z.ZodNumber;
192
+ end: z.ZodNumber;
193
+ }, z.core.$strip>;
194
+ }, z.core.$strip>>;
195
+ totalMatches: z.ZodOptional<z.ZodNumber>;
196
+ truncated: z.ZodOptional<z.ZodBoolean>;
197
+ }, z.core.$strip>>;
198
+ totalCount: z.ZodNumber;
199
+ nextCursor: z.ZodOptional<z.ZodString>;
200
+ }, z.core.$strip>, z.ZodObject<{
201
+ mode: z.ZodLiteral<"jsonlogic">;
202
+ hits: z.ZodArray<z.ZodObject<{
203
+ filename: z.ZodString;
204
+ result: z.ZodUnknown;
205
+ }, z.core.$strip>>;
206
+ totalCount: z.ZodNumber;
207
+ nextCursor: z.ZodOptional<z.ZodString>;
62
208
  }, z.core.$strip>], "mode">;
63
209
  }, z.core.$strip>, readonly [{
64
210
  readonly reason: "path_prefix_invalid_mode";
@@ -68,12 +214,18 @@ export declare const obsidianSearchNotes: import("@cyanheads/mcp-ts-core").ToolD
68
214
  }, {
69
215
  readonly reason: "query_required";
70
216
  readonly code: JsonRpcErrorCode.ValidationError;
71
- readonly when: "`query` is missing for `text` or `dataview` mode (required for both).";
72
- readonly recovery: "Pass `query` — search terms for text mode (e.g. \"TODO\"), or DQL like \"TABLE WHERE file.mtime > date(today)\" for dataview mode.";
217
+ readonly when: "`query` is missing for `text` or `omnisearch` mode (required for both).";
218
+ readonly recovery: "Pass `query` — substring for text mode, or BM25 query syntax (quoted phrases, `-exclusion`, `path:` / `ext:` filters) for omnisearch.";
73
219
  }, {
74
220
  readonly reason: "logic_required";
75
221
  readonly code: JsonRpcErrorCode.ValidationError;
76
222
  readonly when: "`logic` is missing for `jsonlogic` mode.";
77
223
  readonly recovery: "Pass a JSONLogic tree as `logic`, e.g. `{\"glob\": [{\"var\": \"path\"}, \"Projects/*.md\"]}`.";
224
+ }, {
225
+ readonly reason: "omnisearch_unreachable";
226
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
227
+ readonly when: "Omnisearch was reachable at startup but is now unreachable (Obsidian quit, plugin disabled, or mobile session).";
228
+ readonly retryable: true;
229
+ readonly recovery: "Restart Obsidian with the Omnisearch plugin enabled, then restart this MCP server so it re-probes the plugin URL.";
78
230
  }]>;
79
231
  //# sourceMappingURL=obsidian-search-notes.tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"obsidian-search-notes.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-search-notes.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAwDjE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2L9B,CAAC"}
1
+ {"version":3,"file":"obsidian-search-notes.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-search-notes.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAsB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAsFjE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,mBAAmB,EAAE,EAAE;IAAE,mBAAmB,EAAE,OAAO,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqR7F;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAuD,CAAC"}