logancyang_obsidian-copilot/designdocs/todo
Logan Yang d849ade60a
Add Obsidian CLI daily/random read tools and reasoning summaries (#2181)
* Add Obsidian CLI daily/random read tools with fallback + reasoning summaries

* chore: move CLI design doc to designdocs/ and remove old TODO doc

- Move docs/OBSIDIAN_CLI_INTEGRATION_DESIGN.md to designdocs/OBSIDIAN_CLI_INTEGRATION.md
- Remove designdocs/todo/OBSIDIAN_CLI_INTEGRATION.md (replaced by PR's design doc)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: gate CLI tools behind Platform.isDesktopApp so they are invisible on mobile

- Move CLI tool registration from static BUILTIN_TOOLS array to registerCliTools()
- Only call registerCliTools() when Platform.isDesktopApp is true
- On mobile: tools are not registered, not shown in settings/UI/reasoning
- Update design doc with platform policy and CLI approach rationale

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: update CLI design doc with finalized category-based tool roadmap

- Replace generic v0/v1/v2 tiers with category-based tool grouping
- Define tools: obsidianDailyNote, obsidianProperties, obsidianTasks,
  obsidianFiles, obsidianLinks, obsidianTemplates, obsidianBases,
  obsidianBookmarks, obsidianTags
- Document excluded commands (destructive, plugin/theme, sync, dev tools)
- Add design rationale for category-based approach
- Update rollout plan to match new tool structure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: remove search commands from v1 roadmap

search and search:context are redundant with Copilot's existing
keyword + semantic search. Update obsidianFiles to only include
read, append, prepend, random:read. Add search to excluded list.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: restrict file writes to daily notes, add write operations policy

- Remove append/prepend from obsidianFiles (now read-only: read, random:read)
- Daily note append/prepend: direct execution, no Composer diff needed
- Property set/remove and task toggle: require light confirmation
- Arbitrary file writes excluded — use existing Composer tool instead
- Add Write Operations Policy section to design doc

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: remove redundant CLI tools from roadmap, add tool disambiguation

Remove `read` from obsidianFiles (redundant with readNote) and drop
obsidianTags category (redundant with getTagList). Add Tool
Disambiguation section documenting overlap analysis and prompt
instruction guidelines for CLI tools.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: defer confirmation-required CLI mutations from v1 to v2

Move property:set, property:remove, and task toggle/status to v2 tier.
v1 now contains only read-only tools + direct-execution daily note
writes. This ensures v1 ships without needing confirmation UX.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: add Appendix A with v1 CLI command reference

Document all 12 v1 CLI commands with parameters, output format, and
real examples. Covers obsidianDailyNote, obsidianProperties,
obsidianTasks, obsidianRandomRead, and obsidianLinks tools. Includes
error response reference.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: implement v1 CLI tools (properties, tasks, links, daily note category)

Add 4 new category-based CLI tools for the Obsidian CLI integration:
- obsidianDailyNote: read, append, prepend, path (replaces v0 obsidianDailyRead)
- obsidianProperties: list vault properties, read per-note properties
- obsidianTasks: list and filter tasks across vault
- obsidianLinks: backlinks, outgoing links, orphans, unresolved links

All tools are desktop-only (gated by Platform.isDesktopApp), invisible on
mobile, and labeled as "Obsidian CLI: ... (Experimental)" in settings.

Includes shared error handling module (cliErrors.ts), reasoning summaries,
tool display names, disambiguation prompt instructions, and 21 new tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: prioritize env CLI binaries and align desktop runtime check

- resolveBinaryCandidates: move env var overrides (OBSIDIAN_CLI_BINARY/
  OBSIDIAN_CLI_PATH) before the default "obsidian" binary so configured
  overrides are tried first, preventing an incompatible PATH binary from
  blocking a valid configured override.
- builtinTools: replace Platform.isDesktopApp with isDesktopRuntime()
  (now exported) so CLI tools are registered on both modern isDesktopApp
  and legacy isDesktop runtimes, matching the check used in the executor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: single CLI master toggle, remove v0 overlap, extract buildCliParams

- Group all CLI tools under one "Obsidian CLI (Experimental)" section
  with a single master toggle in settings UI
- Remove v0 obsidianDailyRead registration (superseded by v1 obsidianDailyNote)
- Extract buildCliParams helper to reduce repetitive param building
- Use "cli" category for all CLI tool registrations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: align CLI section title with other tool items

Remove horizontal padding from CLI container box so SettingItem
title aligns flush with Vault Search, Web Search, etc. above it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: preserve raw stdout for daily:read to avoid stripping Markdown whitespace

Only trim stdout for non-read commands (append, prepend, path) where
whitespace is not semantically meaningful. Read commands return note content
where leading/trailing whitespace may be intentional.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: add daily create command and obsidianTemplates tool to v1 CLI

- Add 'daily' command to obsidianDailyNote: creates today's daily note
  from configured template if it doesn't exist
- Add obsidianTemplates category tool with 'templates' (list) and
  'template:read' (read content) commands
- Register obsidianTemplates in builtinTools.ts with cli category
- Update AgentReasoningState and toolExecution with new tool/command cases
- Update obsidianDailyNote prompt instructions to mention 'daily' command
- Move obsidianTemplates from v2 to v1 in design doc; add daily command docs
- Add tests for daily command and full obsidianTemplates tool coverage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: remove daily command, keep only obsidianTemplates addition

The 'daily' CLI command is a UI action (opens the note in Obsidian) and
returns no content, making it unsuitable as an agent tool. Remove it.

Instead, the agent workflow for template-based daily note creation is:
  obsidianTemplates template:read → daily:read (check existence) →
  daily:prepend (write template content if needed)

Update obsidianDailyNote prompt instructions to describe this pattern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs: update CLI tool prompt instructions for template-based daily note workflow

- obsidianDailyNote: add step-by-step guide for creating daily notes from
  templates (templates list → template:read → daily:prepend); note that
  daily:append/prepend auto-create the note if it doesn't exist
- obsidianTemplates: clarify usage of 'templates' and 'template:read',
  cross-reference the daily note creation workflow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: preserve raw stdout for read commands in ObsidianCliDailyTools

Same fix as d2c81b5 for ObsidianCliTools: daily:read and random:read
commands return full markdown note content, so trimming stdout can silently
alter formatting-sensitive notes. Both tools now return raw stdout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 17:40:07 -08:00
..
ACP_DESIGN.md chore: rename docs to designdocs and nest todo folder (#2252) 2026-03-03 16:26:03 -08:00
AGENT_PLANNING_REFLECTION_V0.md chore: rename docs to designdocs and nest todo folder (#2252) 2026-03-03 16:26:03 -08:00
AGENT_REASONING_BLOCK.md chore: rename docs to designdocs and nest todo folder (#2252) 2026-03-03 16:26:03 -08:00
TECHDEBT.md chore: rename docs to designdocs and nest todo folder (#2252) 2026-03-03 16:26:03 -08:00
TODO-composer-tool-redesign.md chore: rename docs to designdocs and nest todo folder (#2252) 2026-03-03 16:26:03 -08:00
TOKEN_BUDGET_ENFORCEMENT.md chore: rename docs to designdocs and nest todo folder (#2252) 2026-03-03 16:26:03 -08:00
UI_RENDERING_PERFORMANCE.md chore: rename docs to designdocs and nest todo folder (#2252) 2026-03-03 16:26:03 -08:00