/** * @fileoverview obsidian_open_in_ui — open a file in the Obsidian app UI. * Defaults to `failIfMissing: true` because Obsidian silently creates files on * open otherwise; opt out for an "open or create" flow. * * The existence probe runs on both paths. It is what lets `createdIfMissing` * report what actually happened, and it is the point where an open that would * create a file is gated as a write — so opening a note that already exists * keeps working under `OBSIDIAN_READ_ONLY`, while the create-capable branch is * refused there and outside `OBSIDIAN_WRITE_PATHS`. * @module mcp-server/tools/definitions/obsidian-open-in-ui.tool */ import { z } from '@cyanheads/mcp-ts-core'; import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors'; export declare const obsidianOpenInUi: import("@cyanheads/mcp-ts-core").ToolDefinition; newLeaf: z.ZodDefault; }, z.core.$strip>, z.ZodObject<{ path: z.ZodString; opened: z.ZodBoolean; createdIfMissing: z.ZodBoolean; }, z.core.$strip>, readonly [{ readonly reason: "path_forbidden"; readonly thrownBy: "service"; readonly code: JsonRpcErrorCode.Forbidden; readonly when: "The path is outside OBSIDIAN_READ_PATHS or inside OBSIDIAN_DENY_PATHS, or — when the file does not exist and `failIfMissing: false` would have Obsidian create it — outside OBSIDIAN_WRITE_PATHS or blocked by OBSIDIAN_READ_ONLY=true."; readonly recovery: "Open a path inside the configured scope; `op` on the error data names whether read or write access was the one denied. The error data echoes the active scope; a `denied_path` denial carries none, since the operator withholds that path."; }, { readonly reason: "note_missing"; readonly code: JsonRpcErrorCode.NotFound; readonly when: "`failIfMissing: true` (default) and the path does not exist in the vault. Pass `failIfMissing: false` to allow Obsidian to create the file on open."; readonly recovery: "Verify the path with obsidian_list_notes or obsidian_search_notes first — a typo would otherwise materialize as an empty file. If creation is intended, retry with failIfMissing: false."; }, { readonly reason: "ambiguous_path"; readonly thrownBy: "service"; readonly code: JsonRpcErrorCode.Conflict; readonly when: "The parent directory contains multiple files whose names differ only in case (case-sensitive filesystems only)."; readonly recovery: "Retry with one of the exact paths listed in `matches` on the error data."; }, { readonly reason: "path_is_directory"; readonly thrownBy: "service"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "The supplied path names a folder rather than a file."; readonly recovery: "Call obsidian_list_notes with this path to list the folder, then open one of the files it returns."; }, { readonly reason: "path_traversal"; readonly thrownBy: "service"; readonly code: JsonRpcErrorCode.ValidationError; readonly when: "The path contains a `.` or `..` segment, which is rejected to prevent vault escape."; readonly recovery: "Supply a vault-relative path with no `.` or `..` segments, e.g. \"Projects/Note.md\". Use obsidian_list_notes to browse the vault."; }], { readonly requestedPath: z.ZodOptional; readonly notice: z.ZodOptional; }>; //# sourceMappingURL=obsidian-open-in-ui.tool.d.ts.map