obsidian-mcp-server 3.8.0 → 3.9.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 +12 -10
- package/CLAUDE.md +12 -10
- package/README.md +12 -8
- package/changelog/3.9.x/3.9.0.md +43 -0
- package/changelog/template.md +10 -3
- package/dist/config/server-config.d.ts.map +1 -1
- package/dist/config/server-config.js +6 -4
- package/dist/config/server-config.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +22 -15
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.ts +4 -3
- package/dist/instructions.d.ts.map +1 -1
- package/dist/instructions.js +6 -9
- package/dist/instructions.js.map +1 -1
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.d.ts +7 -5
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.js +11 -8
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +237 -217
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/index.js +6 -4
- package/dist/mcp-server/tools/definitions/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.d.ts +6 -0
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.js +8 -1
- package/dist/mcp-server/tools/definitions/obsidian-append-to-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.d.ts +6 -0
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.js +8 -1
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.d.ts +143 -27
- package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.js +87 -79
- package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.d.ts +6 -0
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.js +10 -3
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.js.map +1 -1
- package/dist/services/obsidian/obsidian-service.d.ts +53 -15
- package/dist/services/obsidian/obsidian-service.d.ts.map +1 -1
- package/dist/services/obsidian/obsidian-service.js +461 -155
- package/dist/services/obsidian/obsidian-service.js.map +1 -1
- package/dist/services/obsidian/section-extractor.d.ts +62 -6
- package/dist/services/obsidian/section-extractor.d.ts.map +1 -1
- package/dist/services/obsidian/section-extractor.js +303 -62
- package/dist/services/obsidian/section-extractor.js.map +1 -1
- package/manifest.json +3 -3
- package/package.json +8 -8
- package/server.json +7 -7
- package/skills/obsidian-guide/SKILL.md +61 -0
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
* separately so the entry point wraps it with `disabledTool()` when either
|
|
6
6
|
* `OBSIDIAN_ENABLE_COMMANDS=false` or `OBSIDIAN_READ_ONLY=true` — keeping this
|
|
7
7
|
* module free of eager config reads. `obsidian_search_notes` is exposed as a
|
|
8
|
-
* factory (`buildSearchNotesTool`) because its mode enum
|
|
9
|
-
*
|
|
8
|
+
* factory (`buildSearchNotesTool`) because its mode enum follows
|
|
9
|
+
* `omnisearchAvailability`, which the entry point decides at startup: the
|
|
10
|
+
* `omnisearch` mode is withheld under a read scope and otherwise offered only
|
|
11
|
+
* when the startup probe reaches the plugin.
|
|
10
12
|
* `obsidian_delete_note` is exposed as a factory (`buildDeleteNoteTool`)
|
|
11
13
|
* because its description and confirmation round follow
|
|
12
14
|
* `OBSIDIAN_DELETE_ELICITATION`, which the entry point reads.
|
|
@@ -25,12 +27,12 @@ import { obsidianPatchNote } from './obsidian-patch-note.tool.js';
|
|
|
25
27
|
import { obsidianReplaceInNote } from './obsidian-replace-in-note.tool.js';
|
|
26
28
|
import { obsidianWriteNote } from './obsidian-write-note.tool.js';
|
|
27
29
|
export { buildDeleteNoteTool } from './obsidian-delete-note.tool.js';
|
|
28
|
-
export { buildSearchNotesTool } from './obsidian-search-notes.tool.js';
|
|
30
|
+
export { buildSearchNotesTool, omnisearchAvailability, } from './obsidian-search-notes.tool.js';
|
|
29
31
|
/**
|
|
30
32
|
* Tools that don't depend on runtime probes — always registered, even with
|
|
31
33
|
* `OBSIDIAN_READ_ONLY=true`. `obsidian_search_notes` is constructed separately
|
|
32
34
|
* in the entry point via `buildSearchNotesTool` so its mode enum can reflect
|
|
33
|
-
* Omnisearch
|
|
35
|
+
* Omnisearch availability.
|
|
34
36
|
*
|
|
35
37
|
* `obsidian_open_in_ui` stays here rather than in the write bucket so that
|
|
36
38
|
* opening a note that already exists keeps working on a read-only vault, which
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EACL,oBAAoB,EAEpB,sBAAsB,GACvB,MAAM,iCAAiC,CAAC;AAEzC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,eAAe;IACf,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;CACjB,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,iBAAiB;IACjB,oBAAoB;IACpB,iBAAiB;IACjB,qBAAqB;IACrB,yBAAyB;IACzB,kBAAkB;CACnB,CAAC;AAEF,mHAAmH;AACnH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC"}
|
|
@@ -112,6 +112,12 @@ export declare const obsidianAppendToNote: import("@cyanheads/mcp-ts-core").Tool
|
|
|
112
112
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
113
113
|
readonly when: "On Local REST API v5.0 and later, content appended to a heading carries a heading at or above that section’s own level, which would have to sit outside the section.";
|
|
114
114
|
readonly recovery: "Append the heading at the parent section or at the end of the note (no `section`), or write it one level below the target section or deeper.";
|
|
115
|
+
}, {
|
|
116
|
+
readonly reason: "repeated_link_definition";
|
|
117
|
+
readonly thrownBy: "service";
|
|
118
|
+
readonly code: JsonRpcErrorCode.Conflict;
|
|
119
|
+
readonly when: "A link reference definition that repeats a label defined earlier in the note sits above where the target heading’s section ends (for the last section, above its heading); the Local REST API’s markdown parser drops it and misplaces every heading below it, so the append would land outside the section.";
|
|
120
|
+
readonly recovery: "Use obsidian_replace_in_note to place the content directly, or to remove or rename the repeated definition at `line`, then retry the section append.";
|
|
115
121
|
}, {
|
|
116
122
|
readonly reason: "patch_rejected";
|
|
117
123
|
readonly thrownBy: "service";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-append-to-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-append-to-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAMjE,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"obsidian-append-to-note.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-append-to-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAMjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAoO/B,CAAC"}
|
|
@@ -13,7 +13,7 @@ import { getObsidianService } from '../../../services/obsidian/obsidian-service.
|
|
|
13
13
|
import { ContentTypeSchema, SectionSchema, TargetSchema } from './_shared/schemas.js';
|
|
14
14
|
import { withCaseVariantNamed } from './_shared/suggest-paths.js';
|
|
15
15
|
export const obsidianAppendToNote = tool('obsidian_append_to_note', {
|
|
16
|
-
description: 'Append content to a note. **Without `section`: appends to the end of the file, or creates the file if it does not exist (your content becomes the full file).** When an existing file does not end in a line break, one is inserted before your content. On a case-insensitive filesystem, a path that differs from an existing note only in letter case fails with `case_variant_exists` (`existingPath` names the note when the folder listing shows exactly one case match). With `section`: appends to the end of that heading/block/frontmatter (on Local REST API v5.0 and later, content appended to a heading is separated from the section’s existing content by a blank line, except a list item appended to a section that ends in a list and has no sub-headings, which continues that list) — use `obsidian_get_note` with `format: "document-map"` to discover available targets. Name a heading by its full `Parent::Child` path as the document map lists it, or by a bare leaf name matched at any depth. A leaf shared by several headings is rejected with `ambiguous_section`, unless one of them has no parent heading, in which case the write targets that one; a full path that occurs more than once in the note is rejected with `ambiguous_section` too. For block-reference targets, content is concatenated adjacent to the block line without inserting a separator — include a leading newline in `content` if you want one. Set `createTargetIfMissing` to bring the target section into existence rather than failing when it does not exist.',
|
|
16
|
+
description: 'Append content to a note. **Without `section`: appends to the end of the file, or creates the file if it does not exist (your content becomes the full file).** When an existing file does not end in a line break, one is inserted before your content. On a case-insensitive filesystem, a path that differs from an existing note only in letter case fails with `case_variant_exists` (`existingPath` names the note when the folder listing shows exactly one case match). With `section`: appends to the end of that heading/block/frontmatter (on Local REST API v5.0 and later, content appended to a heading is separated from the section’s existing content by a blank line, except a list item appended to a section that ends in a list and has no sub-headings, which continues that list) — use `obsidian_get_note` with `format: "document-map"` to discover available targets. Name a heading by its full `Parent::Child` path as the document map lists it, or by a bare leaf name matched at any depth. A leaf shared by several headings is rejected with `ambiguous_section`, unless one of them has no parent heading, in which case the write targets that one; a full path that occurs more than once in the note is rejected with `ambiguous_section` too. A heading append is rejected with `repeated_link_definition` when a link reference definition that repeats an earlier label sits above where its section ends (for the last section, above its heading), which makes the plugin misplace the headings below it. For block-reference targets, content is concatenated adjacent to the block line without inserting a separator — include a leading newline in `content` if you want one. Set `createTargetIfMissing` to bring the target section into existence rather than failing when it does not exist.',
|
|
17
17
|
annotations: { destructiveHint: true },
|
|
18
18
|
input: z.object({
|
|
19
19
|
target: TargetSchema.describe('Where the note lives.'),
|
|
@@ -123,6 +123,13 @@ export const obsidianAppendToNote = tool('obsidian_append_to_note', {
|
|
|
123
123
|
when: 'On Local REST API v5.0 and later, content appended to a heading carries a heading at or above that section’s own level, which would have to sit outside the section.',
|
|
124
124
|
recovery: 'Append the heading at the parent section or at the end of the note (no `section`), or write it one level below the target section or deeper.',
|
|
125
125
|
},
|
|
126
|
+
{
|
|
127
|
+
reason: 'repeated_link_definition',
|
|
128
|
+
thrownBy: 'service',
|
|
129
|
+
code: JsonRpcErrorCode.Conflict,
|
|
130
|
+
when: 'A link reference definition that repeats a label defined earlier in the note sits above where the target heading’s section ends (for the last section, above its heading); the Local REST API’s markdown parser drops it and misplaces every heading below it, so the append would land outside the section.',
|
|
131
|
+
recovery: 'Use obsidian_replace_in_note to place the content directly, or to remove or rename the repeated definition at `line`, then retry the section append.',
|
|
132
|
+
},
|
|
126
133
|
{
|
|
127
134
|
reason: 'patch_rejected',
|
|
128
135
|
thrownBy: 'service',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-append-to-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-append-to-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,yBAAyB,EAAE;IAClE,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"obsidian-append-to-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-append-to-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,yBAAyB,EAAE;IAClE,WAAW,EACT,gvDAAgvD;IAClvD,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,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0DAA0D,CAAC;QACxF,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACxC,kGAAkG,CACnG;QACD,WAAW,EAAE,iBAAiB;QAC9B,qBAAqB,EAAE,CAAC;aACrB,OAAO,EAAE;aACT,OAAO,CAAC,KAAK,CAAC;aACd,QAAQ,CACP,qI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C,KAAK,CAAC,IAAI,CACR,uBAAuB,MAAM,CAAC,eAAe,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,oBAAoB,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CACjI,CAAC;QACF,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -62,7 +62,7 @@ async function readExactNote(ctx, svc, path) {
|
|
|
62
62
|
const suggestions = await findSimilarPaths(ctx, svc, path);
|
|
63
63
|
if (suggestions.length === 0)
|
|
64
64
|
throw err;
|
|
65
|
-
throw notFound(didYouMean(err.message, suggestions), { ...(err.data ?? {}), suggestions }, { cause: err });
|
|
65
|
+
throw notFound(didYouMean(err.message, suggestions), { ...(err.data ?? {}), suggestions }, { cause: err, literals: suggestions });
|
|
66
66
|
}
|
|
67
67
|
return await svc.getNoteContent(ctx, target);
|
|
68
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-delete-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-delete-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAgB,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAwB,MAAM,yCAAyC,CAAC;AACnG,OAAO,EAAE,YA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AAM,GAAG,CAAC;QACpF,MAAM,WAAW,GAAG,MAAM,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QAC3D,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,MAAM,GAAG,CAAC;QACxC,MAAM,QAAQ,CACZ,UAAU,CAAC,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC,EACpC,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,EACpC,EAAE,KAAK,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"obsidian-delete-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-delete-note.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAgB,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAwB,MAAM,yCAAyC,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE1E,MAAM,SAAS,GAAG,sBAAsB,CAAC;AACzC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAChC,MAAM,IAAI,GAAG,gEAAgE,CAAC;AAE9E,kFAAkF;AAClF,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,0D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,EAAE,CAAC,CAAC;gBACvE,CAAC;YACH,CAAC;YAED,MAAM,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;YACtC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAC,EAAE,CAAC;QAC7E,CAAC;QAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC;YAClB;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,aAAa,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,MAAM,CAAC,mBAAmB,MAAM,MAAM,CAAC,kBAAkB,SAAS;aACpI;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC"}
|
|
@@ -23,7 +23,7 @@ const DEFAULT_TAG_LIMIT = 200;
|
|
|
23
23
|
*/
|
|
24
24
|
const MAX_TAG_LIMIT = 10_000;
|
|
25
25
|
export const obsidianListTags = tool('obsidian_list_tags', {
|
|
26
|
-
description: `List the vault's tags with usage counts, ordered by count descending and capped at \`limit\` (default ${DEFAULT_TAG_LIMIT}) — the response says so when it withheld any. Includes hierarchical parents: \`work/tasks\` contributes to both \`work\` and \`work/tasks\`. Narrow with \`nameRegex\` for a known prefix or \`minCount\` to drop the single-use tail. To find notes by tag, use \`obsidian_search_notes\` in jsonlogic mode
|
|
26
|
+
description: `List the vault's tags with usage counts, ordered by count descending and capped at \`limit\` (default ${DEFAULT_TAG_LIMIT}) — the response says so when it withheld any. Includes hierarchical parents: \`work/tasks\` contributes to both \`work\` and \`work/tasks\`. Narrow with \`nameRegex\` for a known prefix or \`minCount\` to drop the single-use tail. To find notes by tag, use \`obsidian_search_notes\` in jsonlogic mode, where a note's \`tags\` hold only its own tags as written: \`{"in": ["work", {"var": "tags"}]}\` matches \`work\` exactly, and \`{"some": [{"var": "tags"}, {"regexp": ["^work(/|$)", {"var": ""}]}]}\` adds its nested tags.`,
|
|
27
27
|
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
28
28
|
input: z.object({
|
|
29
29
|
nameRegex: z
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-list-tags.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-list-tags.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;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,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,sFAAsF;AACtF,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAC9B;;;;GAIG;AACH,MAAM,aAAa,GAAG,MAAM,CAAC;AAE7B,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,oBAAoB,EAAE;IACzD,WAAW,EAAE,yGAAyG,iBAAiB,
|
|
1
|
+
{"version":3,"file":"obsidian-list-tags.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-list-tags.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;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,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,sFAAsF;AAC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I,CAAC,MAAM,UAAU,MAAM,CAAC,CAAC,CAAC,MAAM,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAChF,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACf,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI;gBAAE,KAAK,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;QACxF,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC;AAEH,mEAAmE;AACnE,SAAS,eAAe,CAAC,OAIxB;IACC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,OAAO,CAAC,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,aAAa,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAChF,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,YAAY,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC/E,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACtE,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -119,7 +119,7 @@ export const obsidianOpenInUi = tool('obsidian_open_in_ui', {
|
|
|
119
119
|
path: input.path,
|
|
120
120
|
...(suggestions.length > 0 ? { suggestions } : {}),
|
|
121
121
|
recovery: { hint: hintParts.join(' ') },
|
|
122
|
-
}, { cause: err });
|
|
122
|
+
}, { cause: err, literals: suggestions });
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
await svc.openInUi(ctx, resolvedPath, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-open-in-ui.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-open-in-ui.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAExF,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,qBAAqB,EAAE;IAC1D,WAAW,EACT,oaAAoa;IACta,WAAW,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE;IAClF,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,0CAA0C,CAAC;QAC5E,aAAa,EAAE,CAAC;aACb,OAAO,EAAE;aACT,OAAO,CAAC,IAAI,CAAC;aACb,QAAQ,CACP,4LAA4L,CAC7L;QACH,OAAO,EAAE,CAAC;aACP,OAAO,EAAE;aACT,OAAO,CAAC,KAAK,CAAC;aACd,QAAQ,CAAC,4DAA4D,CAAC;KAC1E,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+CAA+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AAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBAClF,CAAC;gBACD,wEAAwE;gBACxE,qEAAqE;gBACrE,+BAA+B;gBAC/B,SAAS,CAAC,IAAI,CACZ,mIAAmI,CACpI,CAAC;gBACF,MAAM,GAAG,CAAC,IAAI,CACZ,cAAc,EACd,gBAAgB,KAAK,CAAC,IAAI,0BAA0B,EACpD;oBACE,IAAI,EAAE,KAAK,CAAC,IAAI;oBAChB,GAAG,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBAClD,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;iBACxC,EACD,EAAE,KAAK,EAAE,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"obsidian-open-in-ui.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-open-in-ui.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAExF,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,qBAAqB,EAAE;IAC1D,WAAW,EACT,oaAAoa;IACta,WAAW,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE;IAClF,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,CAAC,CAAC,MAAM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CAAC;IAED,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC;QAClB;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE;gBACJ,YAAY,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI;gBACjD,aAAa,MAAM,CAAC,MAAM,EAAE;gBAC5B,yBAAyB,MAAM,CAAC,gBAAgB,EAAE;aACnD,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF;CACF,CAAC,CAAC"}
|
|
@@ -124,6 +124,12 @@ export declare const obsidianPatchNote: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
124
124
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
125
125
|
readonly when: "On Local REST API v5.0 and later, the content of a heading write carries a heading at or above the target section’s own level, which would have to sit outside the section.";
|
|
126
126
|
readonly recovery: "Append the heading at the parent section or at the end of the note with obsidian_append_to_note, or write it one level below the target section or deeper.";
|
|
127
|
+
}, {
|
|
128
|
+
readonly reason: "repeated_link_definition";
|
|
129
|
+
readonly thrownBy: "service";
|
|
130
|
+
readonly code: JsonRpcErrorCode.Conflict;
|
|
131
|
+
readonly when: "A link reference definition that repeats a label defined earlier in the note sits above where the target heading’s section ends (for the last section, above its heading); the Local REST API’s markdown parser drops it and misplaces every heading below it, so the write would land outside the section.";
|
|
132
|
+
readonly recovery: "Use obsidian_replace_in_note to place the content directly, or to remove or rename the repeated definition at `line`, then retry the section write.";
|
|
127
133
|
}, {
|
|
128
134
|
readonly reason: "patch_rejected";
|
|
129
135
|
readonly thrownBy: "service";
|
|
@@ -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;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAUjE,eAAO,MAAM,iBAAiB
|
|
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;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAUjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgM5B,CAAC"}
|
|
@@ -11,7 +11,7 @@ import { escapeMarkdownInline } from '@cyanheads/mcp-ts-core/utils';
|
|
|
11
11
|
import { getObsidianService } from '../../../services/obsidian/obsidian-service.js';
|
|
12
12
|
import { ContentTypeSchema, PatchOptionsSchema, SectionSchema, TargetSchema, } from './_shared/schemas.js';
|
|
13
13
|
export const obsidianPatchNote = tool('obsidian_patch_note', {
|
|
14
|
-
description: 'Edit a heading, block reference, or frontmatter field in place — append to, prepend to, or replace the target\'s body. On Local REST API v5.0 and later, content appended or prepended to a heading is separated from the section’s existing content by a blank line, except a list item appended to a section that ends in a list and has no sub-headings, or prepended to one that opens with a list, which continues that list. Use `obsidian_get_note` with `format: "document-map"` to discover available targets first. Name a heading by its full `Parent::Child` path as the document map lists it, or by a bare leaf name matched at any depth. A leaf shared by several headings is rejected with `ambiguous_section`, unless one of them has no parent heading, in which case the write targets that one; a full path that occurs more than once in the note is rejected with `ambiguous_section` too.',
|
|
14
|
+
description: 'Edit a heading, block reference, or frontmatter field in place — append to, prepend to, or replace the target\'s body. On Local REST API v5.0 and later, content appended or prepended to a heading is separated from the section’s existing content by a blank line, except a list item appended to a section that ends in a list and has no sub-headings, or prepended to one that opens with a list, which continues that list. Use `obsidian_get_note` with `format: "document-map"` to discover available targets first. Name a heading by its full `Parent::Child` path as the document map lists it, or by a bare leaf name matched at any depth. A leaf shared by several headings is rejected with `ambiguous_section`, unless one of them has no parent heading, in which case the write targets that one; a full path that occurs more than once in the note is rejected with `ambiguous_section` too. A heading write is rejected with `repeated_link_definition` when a link reference definition that repeats an earlier label sits above where its section ends (for the last section, above its heading), which makes the plugin misplace the headings below it.',
|
|
15
15
|
annotations: { destructiveHint: true },
|
|
16
16
|
input: z.object({
|
|
17
17
|
target: TargetSchema.describe('Where the note lives.'),
|
|
@@ -108,6 +108,13 @@ export const obsidianPatchNote = tool('obsidian_patch_note', {
|
|
|
108
108
|
when: 'On Local REST API v5.0 and later, the content of a heading write carries a heading at or above the target section’s own level, which would have to sit outside the section.',
|
|
109
109
|
recovery: 'Append the heading at the parent section or at the end of the note with obsidian_append_to_note, or write it one level below the target section or deeper.',
|
|
110
110
|
},
|
|
111
|
+
{
|
|
112
|
+
reason: 'repeated_link_definition',
|
|
113
|
+
thrownBy: 'service',
|
|
114
|
+
code: JsonRpcErrorCode.Conflict,
|
|
115
|
+
when: 'A link reference definition that repeats a label defined earlier in the note sits above where the target heading’s section ends (for the last section, above its heading); the Local REST API’s markdown parser drops it and misplaces every heading below it, so the write would land outside the section.',
|
|
116
|
+
recovery: 'Use obsidian_replace_in_note to place the content directly, or to remove or rename the repeated definition at `line`, then retry the section write.',
|
|
117
|
+
},
|
|
111
118
|
{
|
|
112
119
|
reason: 'patch_rejected',
|
|
113
120
|
thrownBy: 'service',
|
|
@@ -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;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,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,
|
|
1
|
+
{"version":3,"file":"obsidian-patch-note.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/obsidian-patch-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,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,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,knCAAknC;IACpnC,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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,GAAG,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE;YACrD,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,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI;gBAClD,gBAAgB,MAAM,CAAC,SAAS,EAAE;gBAClC,cAAc,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;gBACpF,WAAW,MAAM,CAAC,mBAAmB,MAAM,MAAM,CAAC,kBAAkB,QAAQ;aAC7E,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1,23 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview obsidian_search_notes — text/jsonlogic/omnisearch search with
|
|
3
|
-
* MCP-spec cursor pagination. The `omnisearch` mode is
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* multi-token query's per-token spans) and additionally clip
|
|
7
|
-
* `maxMatchesPerHit` so a single match-heavy note can't blow the
|
|
8
|
-
* budget — clipped hits carry `truncated: true` and `totalMatches`.
|
|
3
|
+
* MCP-spec cursor pagination. The `omnisearch` mode is offered only with reads
|
|
4
|
+
* unscoped and the Omnisearch plugin's HTTP server answering at startup
|
|
5
|
+
* (`omnisearchAvailability`). Text-mode hits carry match locations (the
|
|
6
|
+
* service merges a multi-token query's per-token spans) and additionally clip
|
|
7
|
+
* per file via `maxMatchesPerHit` so a single match-heavy note can't blow the
|
|
8
|
+
* response budget — clipped hits carry `truncated: true` and `totalMatches`.
|
|
9
9
|
* @module mcp-server/tools/definitions/obsidian-search-notes.tool
|
|
10
10
|
*/
|
|
11
11
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
12
12
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
13
|
+
import { type ObsidianService } from '../../../services/obsidian/obsidian-service.js';
|
|
14
|
+
/**
|
|
15
|
+
* Whether `obsidian_search_notes` offers `omnisearch` mode: `offered` when
|
|
16
|
+
* reads are unscoped and the plugin answered the startup probe,
|
|
17
|
+
* `unreachable` when it did not answer, and `withheld` under
|
|
18
|
+
* OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS, where the plugin is never
|
|
19
|
+
* called. Omnisearch ranks and selects its results over the whole vault, so
|
|
20
|
+
* every one of them depends on notes outside a read scope.
|
|
21
|
+
*/
|
|
22
|
+
export type OmnisearchAvailability = 'offered' | 'unreachable' | 'withheld';
|
|
23
|
+
/**
|
|
24
|
+
* Decide {@link OmnisearchAvailability} once, at startup. Under a read scope
|
|
25
|
+
* it is `withheld` with no request, the probe included; otherwise the probe
|
|
26
|
+
* decides.
|
|
27
|
+
*/
|
|
28
|
+
export declare function omnisearchAvailability(svc: ObsidianService): Promise<OmnisearchAvailability>;
|
|
13
29
|
/**
|
|
14
30
|
* Build the `obsidian_search_notes` tool. The `omnisearch` mode is included
|
|
15
|
-
* in the input/output schemas only when `
|
|
16
|
-
* LLM never sees it as an option on a deployment where it
|
|
17
|
-
* requires a server restart.
|
|
31
|
+
* in the input/output schemas and the description only when `omnisearch` is
|
|
32
|
+
* `offered`, so the LLM never sees it as an option on a deployment where it
|
|
33
|
+
* can't run or is withheld. Re-probe requires a server restart.
|
|
18
34
|
*/
|
|
19
|
-
export declare function buildSearchNotesTool({
|
|
20
|
-
|
|
35
|
+
export declare function buildSearchNotesTool({ omnisearch }: {
|
|
36
|
+
omnisearch: OmnisearchAvailability;
|
|
21
37
|
}): import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
22
38
|
mode: z.ZodEnum<{
|
|
23
39
|
jsonlogic: "jsonlogic";
|
|
@@ -102,7 +118,6 @@ export declare function buildSearchNotesTool({ omnisearchReachable }: {
|
|
|
102
118
|
truncatedReason: z.ZodOptional<z.ZodEnum<{
|
|
103
119
|
cap_reached: "cap_reached";
|
|
104
120
|
filtered_after_cap: "filtered_after_cap";
|
|
105
|
-
read_scope: "read_scope";
|
|
106
121
|
}>>;
|
|
107
122
|
}, z.core.$strip>], "mode">;
|
|
108
123
|
}, z.core.$strip>, readonly [{
|
|
@@ -113,8 +128,8 @@ export declare function buildSearchNotesTool({ omnisearchReachable }: {
|
|
|
113
128
|
}, {
|
|
114
129
|
readonly reason: 'query_required';
|
|
115
130
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
116
|
-
readonly when: '`query` is missing
|
|
117
|
-
readonly recovery:
|
|
131
|
+
readonly when: '`query` is missing in a mode that requires it: every mode but `jsonlogic`.';
|
|
132
|
+
readonly recovery: "Pass `query` as space-separated tokens, all of which a note must contain." | "Pass `query` — space-separated tokens, all required, for text mode, or BM25 query syntax (quoted phrases, `-exclusion`, `path:` / `ext:` filters) for omnisearch.";
|
|
118
133
|
}, {
|
|
119
134
|
readonly reason: 'context_length_too_large';
|
|
120
135
|
readonly thrownBy: 'service';
|
|
@@ -160,20 +175,71 @@ export declare function buildSearchNotesTool({ omnisearchReachable }: {
|
|
|
160
175
|
readonly reason: 'omnisearch_unreachable';
|
|
161
176
|
readonly thrownBy: 'service';
|
|
162
177
|
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
163
|
-
readonly when: 'Omnisearch was reachable at startup but is
|
|
178
|
+
readonly when: 'Omnisearch was reachable at startup but did not answer: it is unreachable (Obsidian quit, plugin disabled, or mobile session), answered with a non-2xx status, or took longer than OBSIDIAN_REQUEST_TIMEOUT_MS. One attempt, never retried.';
|
|
164
179
|
readonly retryable: true;
|
|
165
|
-
readonly recovery: '
|
|
166
|
-
}]
|
|
180
|
+
readonly recovery: 'Confirm Obsidian is running with the Omnisearch plugin enabled and retry, or narrow the query if it was slow. If Omnisearch stays down, restart Obsidian, then restart this MCP server so it re-probes the plugin URL.';
|
|
181
|
+
}] | readonly [{
|
|
182
|
+
readonly reason: 'path_prefix_invalid_mode';
|
|
183
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
184
|
+
readonly when: '`pathPrefix` was provided in a non-text mode (only `text` supports prefix filtering).';
|
|
185
|
+
readonly recovery: 'Drop pathPrefix or switch mode to text for prefix filtering.';
|
|
186
|
+
}, {
|
|
187
|
+
readonly reason: 'query_required';
|
|
188
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
189
|
+
readonly when: '`query` is missing in a mode that requires it: every mode but `jsonlogic`.';
|
|
190
|
+
readonly recovery: "Pass `query` as space-separated tokens, all of which a note must contain." | "Pass `query` — space-separated tokens, all required, for text mode, or BM25 query syntax (quoted phrases, `-exclusion`, `path:` / `ext:` filters) for omnisearch.";
|
|
191
|
+
}, {
|
|
192
|
+
readonly reason: 'context_length_too_large';
|
|
193
|
+
readonly thrownBy: 'service';
|
|
194
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
195
|
+
readonly when: "The matches would make a response longer than one can be, so the whole text search failed: the Local REST API runs out of string capacity serializing them, or, under OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS, the readable notes' matches alone would pass the same ceiling. Each match costs its context window plus about 150 characters of offsets and framing.";
|
|
196
|
+
readonly recovery: 'Narrow the query so fewer notes match, and drop very common tokens: every occurrence of each token in a matching note is a match costing about 150 characters beside its window, so a token like `the` can fail even at `contextLength` 0. Lowering `contextLength` helps only while the windows, about twice `contextLength` each, dominate that cost.';
|
|
197
|
+
}, {
|
|
198
|
+
readonly reason: 'logic_required';
|
|
199
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
200
|
+
readonly when: '`logic` is missing for `jsonlogic` mode.';
|
|
201
|
+
readonly recovery: 'Pass a JSONLogic tree as `logic`. `glob` and `regexp` take `[PATTERN, VALUE]` — pattern first, e.g. `{"glob": ["Projects/*.md", {"var": "path"}]}`.';
|
|
202
|
+
}, {
|
|
203
|
+
readonly reason: 'logic_invalid';
|
|
204
|
+
readonly thrownBy: 'service';
|
|
205
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
206
|
+
readonly when: 'The JSONLogic tree failed to evaluate against a note — an unrecognized operator, or an operand that could not be evaluated (an uncompilable `regexp` pattern). A mis-arity operator is not rejected: it evaluates to false and the search returns zero hits.';
|
|
207
|
+
readonly recovery: 'Check the operator names and arity. `glob` and `regexp` take `[PATTERN, VALUE]` — pattern first, e.g. `{"regexp": ["^Inbox/", {"var": "path"}]}`; the reverse order compiles the note field as the pattern.';
|
|
208
|
+
}, {
|
|
209
|
+
readonly reason: 'logic_too_costly';
|
|
210
|
+
readonly thrownBy: 'service';
|
|
211
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
212
|
+
readonly when: "With OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS set, the server evaluates the JSONLogic tree itself, and the tree passed a bound: nesting deeper than 1,000 levels, more than a work budget, more than 10 s of evaluation, or more than 45 s for the whole search, reading the readable notes included. One work budget is per note — the size of values built by `merge`, `cat`, `map`, and array literals while evaluating that note, up to the note's own size plus 10,000,000 units — and one is per search: 10,000,000 units across every note for returned results, where a result whose JSON is at most 1,024 characters is free and a larger one pays for what it holds beyond its own note.";
|
|
213
|
+
readonly recovery: "Simplify the tree: nest fewer levels, avoid building arrays or strings many times a note's size with `merge`, `cat`, `map`, or `reduce`, return values drawn from the note rather than large built values or constants, and prefer a simpler `regexp` pattern.";
|
|
214
|
+
}, {
|
|
215
|
+
readonly reason: 'text_search_too_costly';
|
|
216
|
+
readonly thrownBy: 'service';
|
|
217
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
218
|
+
readonly when: 'With OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS set, the server runs text mode itself, reading every readable note whose path or body holds each token, and reading and matching them took more than 45 s.';
|
|
219
|
+
readonly recovery: 'Add rarer tokens, which every candidate note must contain, so fewer readable notes are read, or ask the operator to narrow OBSIDIAN_READ_PATHS or extend OBSIDIAN_DENY_PATHS.';
|
|
220
|
+
}, {
|
|
221
|
+
readonly reason: 'link_fields_unavailable';
|
|
222
|
+
readonly thrownBy: 'service';
|
|
223
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
224
|
+
readonly when: 'With OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS set, the JSONLogic tree names `links`, `backlinks`, or `unresolvedLinks` by a fixed `var`, `missing`, or `missing_some` key. Scoped searches leave these fields out, since Obsidian resolves each link across the whole vault, notes outside the scope included; a computed key reads them as null.';
|
|
225
|
+
readonly recovery: 'Find backlinks by body text: `{"regexp": ["\\\\[\\\\[Target Note(\\\\\\\\?\\\\||#|\\\\]\\\\])", {"var": "content"}]}` matches every readable note that wikilinks or embeds `Target Note`. For a note\'s outgoing links, call `obsidian_get_note` with `includeLinks: true`.';
|
|
226
|
+
}, {
|
|
227
|
+
readonly reason: 'note_too_deep';
|
|
228
|
+
readonly thrownBy: 'service';
|
|
229
|
+
readonly code: JsonRpcErrorCode.SerializationError;
|
|
230
|
+
readonly when: 'With OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS set, a readable note holds data, usually a frontmatter value, nested deeper than the server can hand to its evaluator (about 3,500 levels under Node, more under Bun).';
|
|
231
|
+
readonly recovery: 'Flatten the deeply nested value, usually a frontmatter field, in the note the message names, or ask the operator to leave that note out of OBSIDIAN_READ_PATHS or add it to OBSIDIAN_DENY_PATHS; no scoped jsonlogic search runs while it is readable.';
|
|
232
|
+
}, ...never[]], {
|
|
167
233
|
readonly effectiveQuery: z.ZodOptional<z.ZodString>;
|
|
168
234
|
readonly notice: z.ZodOptional<z.ZodString>;
|
|
169
235
|
}>;
|
|
170
236
|
/**
|
|
171
237
|
* Static specimen for the MCP definition linter (which duck-types tool
|
|
172
238
|
* exports out of each `.tool.ts` file) and for existing tests that import
|
|
173
|
-
* the tool directly.
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
239
|
+
* the tool directly. Built without the `omnisearch` mode — the safe baseline
|
|
240
|
+
* that doesn't assume the optional plugin is installed. The entry point
|
|
241
|
+
* (`src/index.ts`) builds the live tool via `buildSearchNotesTool` with the
|
|
242
|
+
* startup `omnisearchAvailability`; this export is not the registered tool.
|
|
177
243
|
* The omnisearch-enabled variant is exercised by tests rather than the
|
|
178
244
|
* linter (two exports under the same tool name would collide on
|
|
179
245
|
* `name-unique`).
|
|
@@ -262,7 +328,6 @@ export declare const obsidianSearchNotes: import("@cyanheads/mcp-ts-core").ToolD
|
|
|
262
328
|
truncatedReason: z.ZodOptional<z.ZodEnum<{
|
|
263
329
|
cap_reached: "cap_reached";
|
|
264
330
|
filtered_after_cap: "filtered_after_cap";
|
|
265
|
-
read_scope: "read_scope";
|
|
266
331
|
}>>;
|
|
267
332
|
}, z.core.$strip>], "mode">;
|
|
268
333
|
}, z.core.$strip>, readonly [{
|
|
@@ -273,8 +338,8 @@ export declare const obsidianSearchNotes: import("@cyanheads/mcp-ts-core").ToolD
|
|
|
273
338
|
}, {
|
|
274
339
|
readonly reason: 'query_required';
|
|
275
340
|
readonly code: JsonRpcErrorCode.ValidationError;
|
|
276
|
-
readonly when: '`query` is missing
|
|
277
|
-
readonly recovery:
|
|
341
|
+
readonly when: '`query` is missing in a mode that requires it: every mode but `jsonlogic`.';
|
|
342
|
+
readonly recovery: "Pass `query` as space-separated tokens, all of which a note must contain." | "Pass `query` — space-separated tokens, all required, for text mode, or BM25 query syntax (quoted phrases, `-exclusion`, `path:` / `ext:` filters) for omnisearch.";
|
|
278
343
|
}, {
|
|
279
344
|
readonly reason: 'context_length_too_large';
|
|
280
345
|
readonly thrownBy: 'service';
|
|
@@ -320,10 +385,61 @@ export declare const obsidianSearchNotes: import("@cyanheads/mcp-ts-core").ToolD
|
|
|
320
385
|
readonly reason: 'omnisearch_unreachable';
|
|
321
386
|
readonly thrownBy: 'service';
|
|
322
387
|
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
323
|
-
readonly when: 'Omnisearch was reachable at startup but is
|
|
388
|
+
readonly when: 'Omnisearch was reachable at startup but did not answer: it is unreachable (Obsidian quit, plugin disabled, or mobile session), answered with a non-2xx status, or took longer than OBSIDIAN_REQUEST_TIMEOUT_MS. One attempt, never retried.';
|
|
324
389
|
readonly retryable: true;
|
|
325
|
-
readonly recovery: '
|
|
326
|
-
}]
|
|
390
|
+
readonly recovery: 'Confirm Obsidian is running with the Omnisearch plugin enabled and retry, or narrow the query if it was slow. If Omnisearch stays down, restart Obsidian, then restart this MCP server so it re-probes the plugin URL.';
|
|
391
|
+
}] | readonly [{
|
|
392
|
+
readonly reason: 'path_prefix_invalid_mode';
|
|
393
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
394
|
+
readonly when: '`pathPrefix` was provided in a non-text mode (only `text` supports prefix filtering).';
|
|
395
|
+
readonly recovery: 'Drop pathPrefix or switch mode to text for prefix filtering.';
|
|
396
|
+
}, {
|
|
397
|
+
readonly reason: 'query_required';
|
|
398
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
399
|
+
readonly when: '`query` is missing in a mode that requires it: every mode but `jsonlogic`.';
|
|
400
|
+
readonly recovery: "Pass `query` as space-separated tokens, all of which a note must contain." | "Pass `query` — space-separated tokens, all required, for text mode, or BM25 query syntax (quoted phrases, `-exclusion`, `path:` / `ext:` filters) for omnisearch.";
|
|
401
|
+
}, {
|
|
402
|
+
readonly reason: 'context_length_too_large';
|
|
403
|
+
readonly thrownBy: 'service';
|
|
404
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
405
|
+
readonly when: "The matches would make a response longer than one can be, so the whole text search failed: the Local REST API runs out of string capacity serializing them, or, under OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS, the readable notes' matches alone would pass the same ceiling. Each match costs its context window plus about 150 characters of offsets and framing.";
|
|
406
|
+
readonly recovery: 'Narrow the query so fewer notes match, and drop very common tokens: every occurrence of each token in a matching note is a match costing about 150 characters beside its window, so a token like `the` can fail even at `contextLength` 0. Lowering `contextLength` helps only while the windows, about twice `contextLength` each, dominate that cost.';
|
|
407
|
+
}, {
|
|
408
|
+
readonly reason: 'logic_required';
|
|
409
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
410
|
+
readonly when: '`logic` is missing for `jsonlogic` mode.';
|
|
411
|
+
readonly recovery: 'Pass a JSONLogic tree as `logic`. `glob` and `regexp` take `[PATTERN, VALUE]` — pattern first, e.g. `{"glob": ["Projects/*.md", {"var": "path"}]}`.';
|
|
412
|
+
}, {
|
|
413
|
+
readonly reason: 'logic_invalid';
|
|
414
|
+
readonly thrownBy: 'service';
|
|
415
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
416
|
+
readonly when: 'The JSONLogic tree failed to evaluate against a note — an unrecognized operator, or an operand that could not be evaluated (an uncompilable `regexp` pattern). A mis-arity operator is not rejected: it evaluates to false and the search returns zero hits.';
|
|
417
|
+
readonly recovery: 'Check the operator names and arity. `glob` and `regexp` take `[PATTERN, VALUE]` — pattern first, e.g. `{"regexp": ["^Inbox/", {"var": "path"}]}`; the reverse order compiles the note field as the pattern.';
|
|
418
|
+
}, {
|
|
419
|
+
readonly reason: 'logic_too_costly';
|
|
420
|
+
readonly thrownBy: 'service';
|
|
421
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
422
|
+
readonly when: "With OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS set, the server evaluates the JSONLogic tree itself, and the tree passed a bound: nesting deeper than 1,000 levels, more than a work budget, more than 10 s of evaluation, or more than 45 s for the whole search, reading the readable notes included. One work budget is per note — the size of values built by `merge`, `cat`, `map`, and array literals while evaluating that note, up to the note's own size plus 10,000,000 units — and one is per search: 10,000,000 units across every note for returned results, where a result whose JSON is at most 1,024 characters is free and a larger one pays for what it holds beyond its own note.";
|
|
423
|
+
readonly recovery: "Simplify the tree: nest fewer levels, avoid building arrays or strings many times a note's size with `merge`, `cat`, `map`, or `reduce`, return values drawn from the note rather than large built values or constants, and prefer a simpler `regexp` pattern.";
|
|
424
|
+
}, {
|
|
425
|
+
readonly reason: 'text_search_too_costly';
|
|
426
|
+
readonly thrownBy: 'service';
|
|
427
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
428
|
+
readonly when: 'With OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS set, the server runs text mode itself, reading every readable note whose path or body holds each token, and reading and matching them took more than 45 s.';
|
|
429
|
+
readonly recovery: 'Add rarer tokens, which every candidate note must contain, so fewer readable notes are read, or ask the operator to narrow OBSIDIAN_READ_PATHS or extend OBSIDIAN_DENY_PATHS.';
|
|
430
|
+
}, {
|
|
431
|
+
readonly reason: 'link_fields_unavailable';
|
|
432
|
+
readonly thrownBy: 'service';
|
|
433
|
+
readonly code: JsonRpcErrorCode.ValidationError;
|
|
434
|
+
readonly when: 'With OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS set, the JSONLogic tree names `links`, `backlinks`, or `unresolvedLinks` by a fixed `var`, `missing`, or `missing_some` key. Scoped searches leave these fields out, since Obsidian resolves each link across the whole vault, notes outside the scope included; a computed key reads them as null.';
|
|
435
|
+
readonly recovery: 'Find backlinks by body text: `{"regexp": ["\\\\[\\\\[Target Note(\\\\\\\\?\\\\||#|\\\\]\\\\])", {"var": "content"}]}` matches every readable note that wikilinks or embeds `Target Note`. For a note\'s outgoing links, call `obsidian_get_note` with `includeLinks: true`.';
|
|
436
|
+
}, {
|
|
437
|
+
readonly reason: 'note_too_deep';
|
|
438
|
+
readonly thrownBy: 'service';
|
|
439
|
+
readonly code: JsonRpcErrorCode.SerializationError;
|
|
440
|
+
readonly when: 'With OBSIDIAN_READ_PATHS or OBSIDIAN_DENY_PATHS set, a readable note holds data, usually a frontmatter value, nested deeper than the server can hand to its evaluator (about 3,500 levels under Node, more under Bun).';
|
|
441
|
+
readonly recovery: 'Flatten the deeply nested value, usually a frontmatter field, in the note the message names, or ask the operator to leave that note out of OBSIDIAN_READ_PATHS or add it to OBSIDIAN_DENY_PATHS; no scoped jsonlogic search runs while it is readable.';
|
|
442
|
+
}, ...never[]], {
|
|
327
443
|
readonly effectiveQuery: z.ZodOptional<z.ZodString>;
|
|
328
444
|
readonly notice: z.ZodOptional<z.ZodString>;
|
|
329
445
|
}>;
|
|
@@ -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;;;;;;;;;GASG;AAEH,OAAO,EAAsB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,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;;;;;;;;;GASG;AAEH,OAAO,EAAsB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AASjE,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAiBnG;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;AAE5E;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,eAAe,GACnB,OAAO,CAAC,sBAAsB,CAAC,CAGjC;AAqGD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,EAAE,sBAAsB,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA4J7E,0BAA0B;;mBAE5B,uFAAuF;uBACnF,8DAA8D;;qBAGhE,gBAAgB;;mBAEl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