obsidian-mcp-server 3.7.0 → 3.7.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.
- package/AGENTS.md +31 -11
- package/CLAUDE.md +31 -11
- package/Dockerfile +10 -3
- package/README.md +30 -91
- package/changelog/3.7.x/3.7.1.md +40 -0
- package/changelog/3.7.x/3.7.2.md +34 -0
- package/dist/config/server-config.js +1 -1
- package/dist/config/server-config.js.map +1 -1
- package/dist/index.js +13 -32
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.ts +20 -0
- package/dist/instructions.d.ts.map +1 -0
- package/dist/instructions.js +40 -0
- package/dist/instructions.js.map +1 -0
- package/dist/mcp-server/tools/definitions/_shared/markdown.d.ts +14 -0
- package/dist/mcp-server/tools/definitions/_shared/markdown.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/_shared/markdown.js +17 -0
- package/dist/mcp-server/tools/definitions/_shared/markdown.js.map +1 -0
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.d.ts +39 -0
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.js +63 -2
- package/dist/mcp-server/tools/definitions/_shared/suggest-paths.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +127 -116
- package/dist/mcp-server/tools/definitions/index.d.ts.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 +15 -6
- 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.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.js +5 -4
- package/dist/mcp-server/tools/definitions/obsidian-delete-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-execute-command.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-execute-command.tool.js +2 -1
- package/dist/mcp-server/tools/definitions/obsidian-execute-command.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.js +51 -40
- package/dist/mcp-server/tools/definitions/obsidian-get-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.js +7 -4
- package/dist/mcp-server/tools/definitions/obsidian-list-commands.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.js +7 -6
- package/dist/mcp-server/tools/definitions/obsidian-list-notes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.js +3 -2
- package/dist/mcp-server/tools/definitions/obsidian-list-tags.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.js +13 -9
- package/dist/mcp-server/tools/definitions/obsidian-manage-frontmatter.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.js +9 -5
- package/dist/mcp-server/tools/definitions/obsidian-manage-tags.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-open-in-ui.tool.js +2 -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.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.js +5 -4
- package/dist/mcp-server/tools/definitions/obsidian-patch-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-replace-in-note.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-replace-in-note.tool.js +12 -4
- package/dist/mcp-server/tools/definitions/obsidian-replace-in-note.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/obsidian-search-notes.tool.d.ts +26 -2
- 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 +61 -34
- 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 +5 -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 +24 -6
- package/dist/mcp-server/tools/definitions/obsidian-write-note.tool.js.map +1 -1
- package/dist/services/obsidian/frontmatter-ops.d.ts +15 -1
- package/dist/services/obsidian/frontmatter-ops.d.ts.map +1 -1
- package/dist/services/obsidian/frontmatter-ops.js +55 -10
- package/dist/services/obsidian/frontmatter-ops.js.map +1 -1
- package/dist/services/obsidian/jsonlogic-evaluator.d.ts +83 -0
- package/dist/services/obsidian/jsonlogic-evaluator.d.ts.map +1 -0
- package/dist/services/obsidian/jsonlogic-evaluator.js +192 -0
- package/dist/services/obsidian/jsonlogic-evaluator.js.map +1 -0
- package/dist/services/obsidian/jsonlogic-worker.d.ts +53 -0
- package/dist/services/obsidian/jsonlogic-worker.d.ts.map +1 -0
- package/dist/services/obsidian/jsonlogic-worker.js +237 -0
- package/dist/services/obsidian/jsonlogic-worker.js.map +1 -0
- package/dist/services/obsidian/obsidian-service.d.ts +56 -8
- package/dist/services/obsidian/obsidian-service.d.ts.map +1 -1
- package/dist/services/obsidian/obsidian-service.js +254 -48
- package/dist/services/obsidian/obsidian-service.js.map +1 -1
- package/dist/services/obsidian/path-policy.d.ts +33 -5
- package/dist/services/obsidian/path-policy.d.ts.map +1 -1
- package/dist/services/obsidian/path-policy.js +99 -17
- package/dist/services/obsidian/path-policy.js.map +1 -1
- package/dist/services/obsidian/types.d.ts +12 -3
- package/dist/services/obsidian/types.d.ts.map +1 -1
- package/manifest.json +2 -2
- package/package.json +20 -15
- package/server.json +5 -5
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Vault text in content[] (paths, tags, headings, frontmatter keys and values, command names, search terms) reads back as written under a CommonMark parse. Adopts mcp-ts-core ^0.13.18, which escapes error text and renders enrichment trailer strings as code spans."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 3.7.2 — 2026-10-25
|
|
8
|
+
|
|
9
|
+
## Changed
|
|
10
|
+
|
|
11
|
+
- **`obsidian_get_note` `format: "full"` renders a non-string frontmatter value as compact JSON in a code span** (before: pretty-printed multi-line JSON inside the list item).
|
|
12
|
+
- **`obsidian_get_note` `format: "section"` on a `frontmatter` target renders a string value escaped and a non-string value as a fenced `json` block** (before: raw). Heading and block section values and note bodies still render as raw Markdown.
|
|
13
|
+
- **`obsidian_search_notes` empty-result notices show the query and path prefix as code spans** (before: in double quotes, raw). The `obsidian_list_notes` tree fence and the search result fences are sized by the framework's code-block builder.
|
|
14
|
+
- **Framework `@cyanheads/mcp-ts-core` ^0.13.15 → ^0.13.18:**
|
|
15
|
+
- Tool error `content[]` escapes the message, recovery hint, and reason; `structuredContent` is unchanged (0.13.16, cyanheads/mcp-ts-core#760).
|
|
16
|
+
- Enrichment trailer strings such as `requestedPath` and the search `echo` render as code spans, or a fenced block when they hold a line break (0.13.18, cyanheads/mcp-ts-core#785); every line of a multi-line notice stays inside the trailer blockquote (0.13.17, cyanheads/mcp-ts-core#765).
|
|
17
|
+
- A call whose handler returns after the request was cancelled settles as `RequestCancelled` (`-32011`) (0.13.16, cyanheads/mcp-ts-core#753).
|
|
18
|
+
- HTTP shutdown answers `503` with `Retry-After: 1` while draining and aborts in-flight requests instead of waiting out the drain (0.13.16, cyanheads/mcp-ts-core#749, cyanheads/mcp-ts-core#757).
|
|
19
|
+
- Out-of-range framework environment values (a non-integer count, an out-of-range timer) fail startup, and the error names the variable (0.13.16, cyanheads/mcp-ts-core#747, cyanheads/mcp-ts-core#746).
|
|
20
|
+
- CORS exposes `WWW-Authenticate` and `Retry-After` (0.13.16, cyanheads/mcp-ts-core#687); log redaction catches secret names run into another word (0.13.16, cyanheads/mcp-ts-core#702).
|
|
21
|
+
- The `.mcpb` bundle drops the framework's build-only files (its `changelog/`, `templates/`, `scripts/`, `CLAUDE.md`, and similar) (0.13.18, cyanheads/mcp-ts-core#791).
|
|
22
|
+
- MCP SDK `@modelcontextprotocol/server` ^2.3.1 → ^2.4.0 (0.13.17).
|
|
23
|
+
- **Packaging and repo:** root Agent Plugins 1.0.0 `plugin.json` and `mcp.json`; `.mcpbignore` anchors `/changelog/`, `/plugin.json`, `/mcp.json`; `package.json` `files` and the Dockerfile carry a root `skills/` directory per the framework template (this server publishes no skills, so nothing new ships); the Docker image sets `MCP_SESSION_MODE="stateful"` explicitly (already the default from `createApp`, so behavior is unchanged); README Getting started is condensed to a `claude mcp add` line and one `npx` config; issue forms use the template's Environment table; `bunfig.toml` `minimumReleaseAge` 3 days → 1 day; framework skills and scripts synced (new `add-skill`).
|
|
24
|
+
|
|
25
|
+
## Fixed
|
|
26
|
+
|
|
27
|
+
- **Every tool's `content[]` renders text it did not author through `escapeMarkdownInline` or a code span sized past the value's longest backtick run.** Paths, tags, headings, block IDs, frontmatter keys and values, link targets, command IDs and names, regexes, search terms, and cursors read back under a CommonMark parse as the value `structuredContent` carries; before, `_`, `*`, `[`, `]`, `|`, and backticks in vault names could render as emphasis, links, or a broken code span. `structuredContent`, `tools/list`, and error contracts are unchanged.
|
|
28
|
+
|
|
29
|
+
## Dependencies
|
|
30
|
+
|
|
31
|
+
- `@cyanheads/mcp-ts-core` ^0.13.15 → ^0.13.18
|
|
32
|
+
- `@biomejs/biome` ^2.6.2 → ^2.6.3 (dev)
|
|
33
|
+
- `ignore` ^7.0.13 → ^7.0.14 (dev)
|
|
34
|
+
- `tsc-alias` ^1.9.8 → ^1.9.9 (dev)
|
|
@@ -112,7 +112,7 @@ const ServerConfigSchema = z.object({
|
|
|
112
112
|
.default(false)
|
|
113
113
|
.describe('Opt-in flag for the command-palette pair (`obsidian_list_commands` + `obsidian_execute_command`). Off by default — Obsidian commands are opaque and can be destructive.'),
|
|
114
114
|
readPaths: envPathList.describe('Optional vault-relative folder allowlist for read operations. Comma-separated; prefix-based with implicit recursion; case-insensitive; trailing slashes normalized. Unset = full vault.'),
|
|
115
|
-
writePaths: envPathList.describe('Optional vault-relative folder allowlist for write operations. Same syntax as OBSIDIAN_READ_PATHS. Write paths are implicitly readable. Unset = full vault.'),
|
|
115
|
+
writePaths: envPathList.describe('Optional vault-relative folder allowlist for write operations. Same syntax as OBSIDIAN_READ_PATHS. Write paths are implicitly readable. Unset = full vault, or the read scope when reads are restricted.'),
|
|
116
116
|
readOnly: envBoolean
|
|
117
117
|
.default(false)
|
|
118
118
|
.describe('Global kill switch. When true, denies every write regardless of OBSIDIAN_WRITE_PATHS, and suppresses the OBSIDIAN_ENABLE_COMMANDS pair (commands can mutate). Defaults to false.'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAA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C,MAAM,CAAC;SACf,QAAQ,CAAC,sCAAsC,CAAC;IACnD,cAAc,EAAE,UAAU;SACvB,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CACP,yKAAyK,CAC1K;IACH,SAAS,EAAE,WAAW,CAAC,QAAQ,CAC7B,yLAAyL,CAC1L;IACD,UAAU,EAAE,WAAW,CAAC,QAAQ,CAC9B,0MAA0M,CAC3M;IACD,QAAQ,EAAE,UAAU;SACjB,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CACP,kLAAkL,CACnL;IACH,iBAAiB,EAAE,UAAU;SAC1B,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CACP,kWAAkW,CACnW;IACH,aAAa,EAAE,CAAC;SACb,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,QAAQ,CACP,yTAAyT,CAC1T;CACJ,CAAC,CAAC;AAIH,IAAI,OAAiC,CAAC;AAEtC,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,cAAc,CAAC,kBAAkB,EAAE;QAC7C,MAAM,EAAE,kBAAkB;QAC1B,OAAO,EAAE,mBAAmB;QAC5B,SAAS,EAAE,qBAAqB;QAChC,gBAAgB,EAAE,6BAA6B;QAC/C,cAAc,EAAE,0BAA0B;QAC1C,SAAS,EAAE,qBAAqB;QAChC,UAAU,EAAE,sBAAsB;QAClC,QAAQ,EAAE,oBAAoB;QAC9B,iBAAiB,EAAE,6BAA6B;QAChD,aAAa,EAAE,yBAAyB;KACzC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,iBAAiB;IAC/B,OAAO,GAAG,SAAS,CAAC;AACtB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import { createApp, disabledTool } from '@cyanheads/mcp-ts-core';
|
|
11
11
|
import { requestContextService } from '@cyanheads/mcp-ts-core/utils';
|
|
12
12
|
import { getServerConfig } from './config/server-config.js';
|
|
13
|
+
import { buildInstructions } from './instructions.js';
|
|
13
14
|
import { allPromptDefinitions } from './mcp-server/prompts/definitions/index.js';
|
|
14
15
|
import { allResourceDefinitions } from './mcp-server/resources/definitions/index.js';
|
|
15
16
|
import { buildDeleteNoteTool, buildSearchNotesTool, commandToolDefinitions, readToolDefinitions, writeToolDefinitions, } from './mcp-server/tools/definitions/index.js';
|
|
@@ -27,32 +28,6 @@ initObsidianService(config);
|
|
|
27
28
|
const obsidian = getObsidianService();
|
|
28
29
|
const omnisearchReachable = await obsidian.probeOmnisearch();
|
|
29
30
|
const searchNotesTool = buildSearchNotesTool({ omnisearchReachable });
|
|
30
|
-
/**
|
|
31
|
-
* Build the server-level `instructions` string sent on every `initialize`.
|
|
32
|
-
* Provides baseline orientation about the server and then layers in
|
|
33
|
-
* deployment-specific lines (read-only mode, scoped paths, command-palette
|
|
34
|
-
* toggle, Omnisearch availability) when those flags are active.
|
|
35
|
-
*/
|
|
36
|
-
function buildInstructions() {
|
|
37
|
-
const sections = [
|
|
38
|
-
'Use the `obsidian_*` tools to access the Obsidian vault via the Local REST API plugin: search, read, write, and patch notes, including targeted edits to headings, blocks, and YAML frontmatter. Notes are addressed by vault-relative path including the file extension (e.g. `Folder/Note.md`); tags support hierarchical `parent/child` notation, and counts roll up to parents.',
|
|
39
|
-
];
|
|
40
|
-
if (config.readOnly) {
|
|
41
|
-
sections.push('Read-only mode is active (OBSIDIAN_READ_ONLY=true): every write tool rejects every path with `path_forbidden` / `read_only_mode`. `obsidian_open_in_ui` still opens notes that exist, but rejects an open against a missing path — Obsidian would create the file.');
|
|
42
|
-
}
|
|
43
|
-
else if (!policy.isUnrestricted) {
|
|
44
|
-
const { readPaths, writePaths } = policy.describe();
|
|
45
|
-
const render = (scope) => typeof scope === 'string' ? scope : scope.map((p) => `'${p}'`).join(', ');
|
|
46
|
-
sections.push(`Vault path policy is enforced. Readable: ${render(readPaths)}. Writable: ${render(writePaths)}. Paths outside scope reject with \`path_forbidden\` — error data carries the active scope so you can self-correct.`);
|
|
47
|
-
}
|
|
48
|
-
if (config.enableCommands && !config.readOnly) {
|
|
49
|
-
sections.push('Command-palette tools (`obsidian_list_commands`, `obsidian_execute_command`) are enabled and can fire any Obsidian command. Commands are opaque and may be destructive — prefer dedicated tools when one fits.');
|
|
50
|
-
}
|
|
51
|
-
if (omnisearchReachable) {
|
|
52
|
-
sections.push('`obsidian_search_notes` includes an `omnisearch` mode: BM25-ranked, typo-tolerant, with PDF/OCR coverage (via the Text Extractor plugin). Results cap at 50 upstream — narrow the query (quoted phrases, `-exclusion`, `path:` / `ext:` filters) to surface more.');
|
|
53
|
-
}
|
|
54
|
-
return sections.join('\n\n');
|
|
55
|
-
}
|
|
56
31
|
const writeToolSet = [
|
|
57
32
|
...writeToolDefinitions,
|
|
58
33
|
buildDeleteNoteTool({ elicitation: config.deleteElicitation }),
|
|
@@ -86,7 +61,12 @@ const { services } = await createApp({
|
|
|
86
61
|
tools,
|
|
87
62
|
resources: allResourceDefinitions,
|
|
88
63
|
prompts: allPromptDefinitions,
|
|
89
|
-
instructions: buildInstructions(
|
|
64
|
+
instructions: buildInstructions({
|
|
65
|
+
enableCommands: config.enableCommands,
|
|
66
|
+
omnisearchReachable,
|
|
67
|
+
policy,
|
|
68
|
+
readOnly: config.readOnly,
|
|
69
|
+
}),
|
|
90
70
|
/**
|
|
91
71
|
* With `OBSIDIAN_DELETE_ELICITATION=true` (and writes allowed),
|
|
92
72
|
* `obsidian_delete_note` confirms through `ctx.requestInput`, which a
|
|
@@ -106,12 +86,13 @@ const { services } = await createApp({
|
|
|
106
86
|
/**
|
|
107
87
|
* Startup banner — emitted after createApp() returns so the framework's
|
|
108
88
|
* `logger.initialize()` has run; calls inside `setup()` happen pre-init and
|
|
109
|
-
* are dropped. Operators check this against their config to verify the
|
|
110
|
-
* path
|
|
89
|
+
* are dropped. Operators check this against their config to verify the
|
|
90
|
+
* configured path lists and whether `obsidian_delete_note` asks before deleting
|
|
111
91
|
* (`deleteElicitation`, false under read-only like `enableCommands`, since
|
|
112
|
-
* the tool is disabled there). The
|
|
113
|
-
*
|
|
114
|
-
* the
|
|
92
|
+
* the tool is disabled there). The server `instructions` and the active scope
|
|
93
|
+
* on `path_forbidden` errors state the effective scope instead (write paths
|
|
94
|
+
* are readable; a write needs read access), so the LLM (or operator) can
|
|
95
|
+
* self-correct without scrolling the log.
|
|
115
96
|
*/
|
|
116
97
|
const bannerCtx = requestContextService.createRequestContext({
|
|
117
98
|
operation: 'startup',
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAClG,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAEhE,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;AACjC,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;AAEtC;;;;;GAKG;AACH,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAC5B,MAAM,QAAQ,GAAG,kBAAkB,EAAE,CAAC;AACtC,MAAM,mBAAmB,GAAG,MAAM,QAAQ,CAAC,eAAe,EAAE,CAAC;AAE7D,MAAM,e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AAE;QAC9C,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE;IAC3B,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE;CACjC,CAAC,CAAC;AAEH;;;;;;;;;;GAUG;AACH,MAAM,SAAS,GAAG,qBAAqB,CAAC,oBAAoB,CAAC;IAC3D,SAAS,EAAE,SAAS;IACpB,iBAAiB,EAAE;QACjB,GAAG,MAAM,CAAC,QAAQ,EAAE;QACpB,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,CAAC,MAAM,CAAC,QAAQ;QACzD,iBAAiB,EAAE,gBAAgB;QACnC,aAAa,EAAE,QAAQ,CAAC,aAAa;QACrC,mBAAmB;KACpB;CACF,CAAC,CAAC;AACH,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AAC/C,QAAQ,CAAC,MAAM,CAAC,IAAI,CAClB,mBAAmB;IACjB,CAAC,CAAC,2BAA2B,QAAQ,CAAC,aAAa,8DAA8D;IACjH,CAAC,CAAC,+BAA+B,QAAQ,CAAC,aAAa,qJAAqJ,EAC9M,SAAS,CACV,CAAC;AACF,IAAI,MAAM,CAAC,yBAAyB,EAAE,CAAC;IACrC,QAAQ,CAAC,MAAM,CAAC,OAAO,CACrB,uHAAuH,EACvH,SAAS,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview The server-level `instructions` string sent on every
|
|
3
|
+
* `initialize`: baseline orientation, then deployment-specific lines for
|
|
4
|
+
* read-only mode, the effective path scope, the command-palette toggle, and
|
|
5
|
+
* Omnisearch availability.
|
|
6
|
+
* @module instructions
|
|
7
|
+
*/
|
|
8
|
+
import type { PathPolicy } from './services/obsidian/path-policy.js';
|
|
9
|
+
/**
|
|
10
|
+
* Build the instructions. The scope lines state what `path_forbidden`
|
|
11
|
+
* enforces (`PathPolicy.effectiveScope`), not the configured lists the
|
|
12
|
+
* startup banner reports.
|
|
13
|
+
*/
|
|
14
|
+
export declare function buildInstructions(opts: {
|
|
15
|
+
enableCommands: boolean;
|
|
16
|
+
omnisearchReachable: boolean;
|
|
17
|
+
policy: PathPolicy;
|
|
18
|
+
readOnly: boolean;
|
|
19
|
+
}): string;
|
|
20
|
+
//# sourceMappingURL=instructions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAarE;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,cAAc,EAAE,OAAO,CAAC;IACxB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB,GAAG,MAAM,CA6BT"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview The server-level `instructions` string sent on every
|
|
3
|
+
* `initialize`: baseline orientation, then deployment-specific lines for
|
|
4
|
+
* read-only mode, the effective path scope, the command-palette toggle, and
|
|
5
|
+
* Omnisearch availability.
|
|
6
|
+
* @module instructions
|
|
7
|
+
*/
|
|
8
|
+
const BASELINE = 'Use the `obsidian_*` tools to access the Obsidian vault via the Local REST API plugin: search, read, write, and patch notes, including targeted edits to headings, blocks, and YAML frontmatter. Notes are addressed by vault-relative path including the file extension (e.g. `Folder/Note.md`); tags support hierarchical `parent/child` notation, and counts roll up to parents.';
|
|
9
|
+
const SCOPE_RECOVERY = 'Paths outside scope reject with `path_forbidden` — error data carries the active scope so you can self-correct.';
|
|
10
|
+
/** Prefixes as the instructions quote them; `undefined` is an unrestricted op. */
|
|
11
|
+
function renderScope(scope) {
|
|
12
|
+
return scope === undefined ? 'full vault' : scope.map((p) => `'${p}'`).join(', ');
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Build the instructions. The scope lines state what `path_forbidden`
|
|
16
|
+
* enforces (`PathPolicy.effectiveScope`), not the configured lists the
|
|
17
|
+
* startup banner reports.
|
|
18
|
+
*/
|
|
19
|
+
export function buildInstructions(opts) {
|
|
20
|
+
const { enableCommands, omnisearchReachable, policy, readOnly } = opts;
|
|
21
|
+
const { readable, writable } = policy.effectiveScope();
|
|
22
|
+
const sections = [BASELINE];
|
|
23
|
+
if (readOnly) {
|
|
24
|
+
sections.push('Read-only mode is active (OBSIDIAN_READ_ONLY=true): write tools are unavailable. `obsidian_open_in_ui` still opens notes that exist, but rejects an open against a missing path — Obsidian would create the file.');
|
|
25
|
+
if (readable !== undefined) {
|
|
26
|
+
sections.push(`Vault path policy is enforced. Readable: ${renderScope(readable)}. ${SCOPE_RECOVERY}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else if (!policy.isUnrestricted) {
|
|
30
|
+
sections.push(`Vault path policy is enforced. Readable: ${renderScope(readable)}. Writable: ${renderScope(writable)}. ${SCOPE_RECOVERY}`);
|
|
31
|
+
}
|
|
32
|
+
if (enableCommands && !readOnly) {
|
|
33
|
+
sections.push('Command-palette tools (`obsidian_list_commands`, `obsidian_execute_command`) are enabled and can fire any Obsidian command. Commands are opaque and may be destructive — prefer dedicated tools when one fits.');
|
|
34
|
+
}
|
|
35
|
+
if (omnisearchReachable) {
|
|
36
|
+
sections.push('`obsidian_search_notes` includes an `omnisearch` mode: BM25-ranked, typo-tolerant, with PDF/OCR coverage (via the Text Extractor plugin). Results cap at 50 upstream — narrow the query (quoted phrases, `-exclusion`, `path:` / `ext:` filters) to surface more.');
|
|
37
|
+
}
|
|
38
|
+
return sections.join('\n\n');
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=instructions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mapp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,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Code-span encoding for the values `format()` and enrichment
|
|
3
|
+
* notices show as code — paths, tags, keys, command IDs, regexes, search terms.
|
|
4
|
+
* Free text outside a span goes through the framework's `escapeMarkdownInline`.
|
|
5
|
+
* @module mcp-server/tools/definitions/_shared/markdown
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* `value` as an inline code span whose delimiter outgrows its longest backtick
|
|
9
|
+
* run, so a value the tool did not author reads back byte-identical under a
|
|
10
|
+
* CommonMark parse and cannot close the span early. A line break inside reads
|
|
11
|
+
* back as a space.
|
|
12
|
+
*/
|
|
13
|
+
export declare function inlineCode(value: string): string;
|
|
14
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../../../src/mcp-server/tools/definitions/_shared/markdown.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Code-span encoding for the values `format()` and enrichment
|
|
3
|
+
* notices show as code — paths, tags, keys, command IDs, regexes, search terms.
|
|
4
|
+
* Free text outside a span goes through the framework's `escapeMarkdownInline`.
|
|
5
|
+
* @module mcp-server/tools/definitions/_shared/markdown
|
|
6
|
+
*/
|
|
7
|
+
import { markdown } from '@cyanheads/mcp-ts-core/utils';
|
|
8
|
+
/**
|
|
9
|
+
* `value` as an inline code span whose delimiter outgrows its longest backtick
|
|
10
|
+
* run, so a value the tool did not author reads back byte-identical under a
|
|
11
|
+
* CommonMark parse and cannot close the span early. A line break inside reads
|
|
12
|
+
* back as a space.
|
|
13
|
+
*/
|
|
14
|
+
export function inlineCode(value) {
|
|
15
|
+
return markdown().inlineCode(value).build();
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../../../../src/mcp-server/tools/definitions/_shared/markdown.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,QAAQ,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC;AAC9C,CAAC"}
|
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
* NotFound enriched with the candidates in the message and
|
|
17
17
|
* `error.data.suggestions[]`.
|
|
18
18
|
*
|
|
19
|
+
* 3. **Case-variant naming on writes.** A whole-file write never substitutes
|
|
20
|
+
* a path, but on a case-insensitive filesystem a write to a case variant of
|
|
21
|
+
* an existing note is refused (`case_variant_exists`); the same listing
|
|
22
|
+
* names the note it collided with as `existingPath`.
|
|
23
|
+
*
|
|
19
24
|
* `obsidian_get_note` and `obsidian_open_in_ui` wrap their service calls with
|
|
20
25
|
* `withCaseFallback`; writes and deletes match the exact path.
|
|
21
26
|
* @module mcp-server/tools/definitions/_shared/suggest-paths
|
|
@@ -70,4 +75,38 @@ export declare function discloseCaseSubstitution(ctx: Context, fallback: CaseFal
|
|
|
70
75
|
* candidates but never deletes one in place of the requested path).
|
|
71
76
|
*/
|
|
72
77
|
export declare function findSimilarPaths(ctx: Context, svc: ObsidianService, path: string): Promise<string[]>;
|
|
78
|
+
/** What the parent folder listing shows about the spelling of a path. */
|
|
79
|
+
export interface CaseVariants {
|
|
80
|
+
/** The path itself is listed under exactly that name. */
|
|
81
|
+
exact: boolean;
|
|
82
|
+
/** Listed files whose names equal the path's ignoring case, but not exactly (full vault paths). */
|
|
83
|
+
variants: string[];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Read the parent folder listing for files that differ from `path` only in
|
|
87
|
+
* letter case. A listing that fails, or that the read scope withholds, reads
|
|
88
|
+
* as empty, so no path outside the read scope is ever named; the caller's
|
|
89
|
+
* cancellation propagates as itself.
|
|
90
|
+
*/
|
|
91
|
+
export declare function findCaseVariants(ctx: Context, svc: ObsidianService, path: string): Promise<CaseVariants>;
|
|
92
|
+
/**
|
|
93
|
+
* Message and error data for a `case_variant_exists` refusal. `existingPath`
|
|
94
|
+
* is set only when exactly one variant is listed — never picked from several,
|
|
95
|
+
* and never inferred when none is: a file Obsidian does not index (a dot-file)
|
|
96
|
+
* refuses a write the same way and never appears in a listing.
|
|
97
|
+
*/
|
|
98
|
+
export declare function caseVariantError(path: string, variants: readonly string[]): {
|
|
99
|
+
message: string;
|
|
100
|
+
data: {
|
|
101
|
+
path: string;
|
|
102
|
+
existingPath?: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Run a whole-file write to `path`, and when the service refuses it as
|
|
107
|
+
* `case_variant_exists`, rethrow it naming the existing note from the parent
|
|
108
|
+
* listing. The listing is read only on that failure, so a write that succeeds
|
|
109
|
+
* costs no extra request.
|
|
110
|
+
*/
|
|
111
|
+
export declare function withCaseVariantNamed<T>(ctx: Context, svc: ObsidianService, path: string, write: () => Promise<T>): Promise<T>;
|
|
73
112
|
//# sourceMappingURL=suggest-paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggest-paths.d.ts","sourceRoot":"","sources":["../../../../../src/mcp-server/tools/definitions/_shared/suggest-paths.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"suggest-paths.d.ts","sourceRoot":"","sources":["../../../../../src/mcp-server/tools/definitions/_shared/suggest-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;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BAAgB,CACpC,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,eAAe,EACpB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,YAAY,CAAC,CAOvB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,SAAS,MAAM,EAAE,GAC1B;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAYpE;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,CAAC,EAC1C,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,eAAe,EACpB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACtB,OAAO,CAAC,CAAC,CAAC,CASZ"}
|
|
@@ -16,11 +16,17 @@
|
|
|
16
16
|
* NotFound enriched with the candidates in the message and
|
|
17
17
|
* `error.data.suggestions[]`.
|
|
18
18
|
*
|
|
19
|
+
* 3. **Case-variant naming on writes.** A whole-file write never substitutes
|
|
20
|
+
* a path, but on a case-insensitive filesystem a write to a case variant of
|
|
21
|
+
* an existing note is refused (`case_variant_exists`); the same listing
|
|
22
|
+
* names the note it collided with as `existingPath`.
|
|
23
|
+
*
|
|
19
24
|
* `obsidian_get_note` and `obsidian_open_in_ui` wrap their service calls with
|
|
20
25
|
* `withCaseFallback`; writes and deletes match the exact path.
|
|
21
26
|
* @module mcp-server/tools/definitions/_shared/suggest-paths
|
|
22
27
|
*/
|
|
23
28
|
import { conflict, JsonRpcErrorCode, McpError, notFound } from '@cyanheads/mcp-ts-core/errors';
|
|
29
|
+
import { inlineCode } from './markdown.js';
|
|
24
30
|
const MAX_SUGGESTIONS = 5;
|
|
25
31
|
/**
|
|
26
32
|
* Wrap a service call with case-insensitive path fallback and "did you mean"
|
|
@@ -85,7 +91,8 @@ export function discloseCaseSubstitution(ctx, fallback, action) {
|
|
|
85
91
|
if (fallback.requestedPath === undefined)
|
|
86
92
|
return;
|
|
87
93
|
const { requestedPath, resolvedPath } = fallback;
|
|
88
|
-
const
|
|
94
|
+
const resolved = inlineCode(resolvedPath);
|
|
95
|
+
const notice = `${inlineCode(requestedPath)} has no exact match; ${action} ${resolved}, the one file in that folder whose name matches it ignoring case. Write and delete tools match paths exactly — pass them ${resolved}.`;
|
|
89
96
|
ctx.enrich({ requestedPath });
|
|
90
97
|
ctx.enrich.notice(notice);
|
|
91
98
|
return notice;
|
|
@@ -102,6 +109,57 @@ export async function findSimilarPaths(ctx, svc, path) {
|
|
|
102
109
|
const probe = await probeParentDir(ctx, svc, path);
|
|
103
110
|
return [...probe.caseMatches, ...probe.extInsensitive].slice(0, MAX_SUGGESTIONS);
|
|
104
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Read the parent folder listing for files that differ from `path` only in
|
|
114
|
+
* letter case. A listing that fails, or that the read scope withholds, reads
|
|
115
|
+
* as empty, so no path outside the read scope is ever named; the caller's
|
|
116
|
+
* cancellation propagates as itself.
|
|
117
|
+
*/
|
|
118
|
+
export async function findCaseVariants(ctx, svc, path) {
|
|
119
|
+
const { caseMatches } = await probeParentDir(ctx, svc, path);
|
|
120
|
+
const normalized = path.replace(/^\/+|\/+$/g, '');
|
|
121
|
+
return {
|
|
122
|
+
exact: caseMatches.includes(normalized),
|
|
123
|
+
variants: caseMatches.filter((match) => match !== normalized),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Message and error data for a `case_variant_exists` refusal. `existingPath`
|
|
128
|
+
* is set only when exactly one variant is listed — never picked from several,
|
|
129
|
+
* and never inferred when none is: a file Obsidian does not index (a dot-file)
|
|
130
|
+
* refuses a write the same way and never appears in a listing.
|
|
131
|
+
*/
|
|
132
|
+
export function caseVariantError(path, variants) {
|
|
133
|
+
const existingPath = variants.length === 1 ? variants[0] : undefined;
|
|
134
|
+
if (existingPath === undefined) {
|
|
135
|
+
return {
|
|
136
|
+
message: `'${path}' collides with a file already on disk: one whose name differs only in letter case, or one Obsidian does not index.`,
|
|
137
|
+
data: { path },
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
message: `Note '${existingPath}' already exists, and this vault's filesystem treats '${path}' as the same file.`,
|
|
142
|
+
data: { path, existingPath },
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Run a whole-file write to `path`, and when the service refuses it as
|
|
147
|
+
* `case_variant_exists`, rethrow it naming the existing note from the parent
|
|
148
|
+
* listing. The listing is read only on that failure, so a write that succeeds
|
|
149
|
+
* costs no extra request.
|
|
150
|
+
*/
|
|
151
|
+
export async function withCaseVariantNamed(ctx, svc, path, write) {
|
|
152
|
+
try {
|
|
153
|
+
return await write();
|
|
154
|
+
}
|
|
155
|
+
catch (err) {
|
|
156
|
+
if (!(err instanceof McpError) || err.data?.reason !== 'case_variant_exists')
|
|
157
|
+
throw err;
|
|
158
|
+
const { variants } = await findCaseVariants(ctx, svc, path);
|
|
159
|
+
const { message, data } = caseVariantError(path, variants);
|
|
160
|
+
throw conflict(message, { ...data, reason: 'case_variant_exists' }, { cause: err });
|
|
161
|
+
}
|
|
162
|
+
}
|
|
105
163
|
async function probeParentDir(ctx, svc, path) {
|
|
106
164
|
const empty = { caseMatches: [], extInsensitive: [] };
|
|
107
165
|
const normalized = path.replace(/^\/+|\/+$/g, '');
|
|
@@ -117,7 +175,10 @@ async function probeParentDir(ctx, svc, path) {
|
|
|
117
175
|
const listing = await svc.listFiles(ctx, dir);
|
|
118
176
|
entries = listing.files;
|
|
119
177
|
}
|
|
120
|
-
catch {
|
|
178
|
+
catch (err) {
|
|
179
|
+
// The caller's cancellation is not a listing that came back empty.
|
|
180
|
+
if (ctx.signal?.aborted)
|
|
181
|
+
throw err;
|
|
121
182
|
return empty;
|
|
122
183
|
}
|
|
123
184
|
const baseLower = base.toLowerCase();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggest-paths.js","sourceRoot":"","sources":["../../../../../src/mcp-server/tools/definitions/_shared/suggest-paths.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"suggest-paths.js","sourceRoot":"","sources":["../../../../../src/mcp-server/tools/definitions/_shared/suggest-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAG/F,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,eAAe,GAAG,CAAC,CAAC;AAc1B;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,GAAY,EACZ,GAAoB,EACpB,MAAkB,EAClB,EAAsC;IAEtC,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;IAC/D,CAAC;IACD,IAAI,CAAC;QACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IACjE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,CAAC,GAAG,YAAY,QAAQ,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,gBAAgB,CAAC,QAAQ,EAAE,CAAC;YACzE,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;QAC1D,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC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