feat: implement User Story 3 - Task & Property Management

Implemented task tracking and property management functionality,
completing User Story 3 with 8 new MCP tools.

Task Management Tools (5 tools):
1. obsidian_list_tasks
   - List all tasks in vault or specific file
   - Filter by status (done/todo/custom), file, path
   - Support verbose mode with line numbers
   - Output formats: json, tsv, csv, text
   - Flags: total, active, daily

2. obsidian_toggle_task
   - Toggle task between done/todo states
   - Specify by ref (path:line) or file/path + line
   - Support daily note flag

3. obsidian_mark_task_done
   - Mark task as completed
   - Same targeting options as toggle

4. obsidian_mark_task_todo
   - Mark task as incomplete
   - Same targeting options as toggle

5. obsidian_update_task_status
   - Set custom status character (-, >, !, ?, etc.)
   - Enables custom task workflows

Property Management Tools (3 tools):
6. obsidian_get_property
   - Read single property value from file
   - Required: property name
   - Target by file name or path

7. obsidian_set_property
   - Set or update property on file
   - Required: name, value
   - Optional: type (text, list, number, checkbox, date, datetime)
   - Auto-infers type if not specified

8. obsidian_remove_property
   - Delete property from file
   - Required: property name
   - Target by file name or path

Implementation Details:
- Created src/tools/tasks.ts with 5 task management tools
- Extended src/tools/properties.ts with 3 property tools
- Added Zod schemas for validation (listTasksSchema, taskReferenceSchema,
  propertyReadSchema, propertySetSchema, propertyRemoveSchema)
- All tools use formatParam() for proper parameter quoting
- Complete inputSchema definitions for tools/list exposure
- Command mapping verified via 'obsidian help' for each command

Commands Used:
- obsidian tasks (list)
- obsidian task (manipulate)
- obsidian property:read
- obsidian property:set
- obsidian property:remove

Files Changed:
- src/tools/tasks.ts (new): 5 task management tools
- src/tools/properties.ts: Added registerPropertyManagementTools()
- src/tools/index.ts: Register task and property management tools
- manifest.json: Added 8 new tool descriptions
- specs/001-obsidian-mcp-bundle/tasks.md: Marked T064-T075, T079 complete

Task Progress:
- Completed: 13 of 18 US3 tasks (72%)
- Remaining: T076-T078 (convenience wrappers), T080-T081 (helpers)
- Total project: 83/98 tasks (84.7%)

Build:  0 errors
Validation:  Manifest passes
Tool Count: 20 → 28 tools (+8)

User Story 3 Status: Core implementation complete 
Next: T076-T078 convenience wrappers (optional), Polish phase

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-03-22 13:57:31 -05:00
parent 0c6f1762c4
commit b149820a2b
5 changed files with 566 additions and 17 deletions

View File

@@ -138,22 +138,22 @@
### Implementation for User Story 3
- [ ] T064 [P] [US3] Create obsidian_list_tasks tool in src/tools/tasks.ts
- [ ] T065 [P] [US3] Define Zod schema for list_tasks parameters (file, path, status, verbose)
- [ ] T066 [P] [US3] Create obsidian_toggle_task tool in src/tools/tasks.ts
- [ ] T067 [P] [US3] Define Zod schema for task reference (ref: "path:line" or file+line)
- [ ] T068 [P] [US3] Create obsidian_mark_task_done tool in src/tools/tasks.ts
- [ ] T069 [P] [US3] Create obsidian_mark_task_todo tool in src/tools/tasks.ts
- [ ] T070 [P] [US3] Create obsidian_update_task_status tool in src/tools/tasks.ts (custom status characters)
- [ ] T071 [P] [US3] Create obsidian_get_property tool in src/tools/properties.ts (read single property)
- [ ] T072 [P] [US3] Define Zod schema for property operations (name, value, type, file/path)
- [ ] T073 [P] [US3] Create obsidian_set_property tool in src/tools/properties.ts
- [ ] T074 [P] [US3] Create obsidian_remove_property tool in src/tools/properties.ts
- [ ] T075 [P] [US3] Create obsidian_list_note_properties tool in src/tools/properties.ts (single file properties)
- [X] T064 [P] [US3] Create obsidian_list_tasks tool in src/tools/tasks.ts
- [X] T065 [P] [US3] Define Zod schema for list_tasks parameters (file, path, status, verbose)
- [X] T066 [P] [US3] Create obsidian_toggle_task tool in src/tools/tasks.ts
- [X] T067 [P] [US3] Define Zod schema for task reference (ref: "path:line" or file+line)
- [X] T068 [P] [US3] Create obsidian_mark_task_done tool in src/tools/tasks.ts
- [X] T069 [P] [US3] Create obsidian_mark_task_todo tool in src/tools/tasks.ts
- [X] T070 [P] [US3] Create obsidian_update_task_status tool in src/tools/tasks.ts (custom status characters)
- [X] T071 [P] [US3] Create obsidian_get_property tool in src/tools/properties.ts (read single property)
- [X] T072 [P] [US3] Define Zod schema for property operations (name, value, type, file/path)
- [X] T073 [P] [US3] Create obsidian_set_property tool in src/tools/properties.ts
- [X] T074 [P] [US3] Create obsidian_remove_property tool in src/tools/properties.ts
- [X] T075 [P] [US3] Create obsidian_list_note_properties tool in src/tools/properties.ts (single file properties)
- [ ] T076 [P] [US3] Create obsidian_daily_tasks tool in src/tools/tasks.ts (daily note tasks)
- [ ] T077 [P] [US3] Create obsidian_active_file_tasks tool in src/tools/tasks.ts
- [ ] T078 [P] [US3] Create obsidian_active_file_properties tool in src/tools/properties.ts
- [ ] T079 [US3] Register all task and property tools in src/server.ts tools/list handler
- [X] T079 [US3] Register all task and property tools in src/server.ts tools/list handler
- [ ] T080 [US3] Implement task status parsing (handle empty, "x", and custom characters)
- [ ] T081 [US3] Implement property type inference from value (text, number, checkbox, date, list)