diff options
| author | Adam Malczewski <[email protected]> | 2026-03-24 13:44:52 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-03-24 13:44:52 +0900 |
| commit | 5a44a97111d304945bbfc3da02d29a83191d816c (patch) | |
| tree | a1e31b76db2a0b0e84c5745127a0d05ddc574ec7 /.rules | |
| parent | bb543c3f7840f2a3fa1b7a1fb32245fa87a30f7b (diff) | |
| download | ai-pulse-obsidian-plugin-5a44a97111d304945bbfc3da02d29a83191d816c.tar.gz ai-pulse-obsidian-plugin-5a44a97111d304945bbfc3da02d29a83191d816c.zip | |
Add initial ai tool system, and 2 tools to explore
Diffstat (limited to '.rules')
| -rw-r--r-- | .rules/changelog/2026-03/24/06.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/.rules/changelog/2026-03/24/06.md b/.rules/changelog/2026-03/24/06.md new file mode 100644 index 0000000..ffe233c --- /dev/null +++ b/.rules/changelog/2026-03/24/06.md @@ -0,0 +1,21 @@ +# Changelog — 2026-03-24 (06) + +## Added: AI Tool System with Tool Modal and Vault Tools + +### New Files +- **`src/tools.ts`** — Tool registry with `OllamaToolDefinition` schema, `ToolEntry` interface, and two tool implementations: + - `search_files` — case-insensitive search of vault file paths (capped at 50 results) + - `read_file` — reads full text content of a file by vault path using `cachedRead()` + - Each tool has `friendlyName`, `summarize()`, and `summarizeResult()` for UI display +- **`src/tool-modal.ts`** — `ToolModal` with toggles for each registered tool, persisted via plugin settings + +### Modified Files +- **`src/settings.ts`** — Added `enabledTools: Record<string, boolean>` to settings +- **`src/main.ts`** — Merges tool states on load to handle new tools added to registry +- **`src/ollama-client.ts`** — Extended `ChatMessage` with `tool` role, `tool_calls`, `tool_name`. `sendChatMessage` now supports optional tools with full agent loop (up to 10 iterations). `ToolCallEvent` includes `friendlyName`, `summary`, and `resultSummary` +- **`src/chat-view.ts`** — Added wrench button (highlights when tools active), opens tool modal, passes enabled tools to chat, displays tool calls inline with: + - Friendly name header with wrench icon + - One-line summary of what the tool did + - Result summary line (e.g. "3 results found") + - Collapsible `<details>` for JSON args and result preview +- **`styles.css`** — Styles for tools button (active indicator), tool call blocks (accent border, summary, collapsible details), tool modal description |
