diff options
Diffstat (limited to '.rules/changelog/2026-03/29/01.md')
| -rw-r--r-- | .rules/changelog/2026-03/29/01.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/.rules/changelog/2026-03/29/01.md b/.rules/changelog/2026-03/29/01.md new file mode 100644 index 0000000..7a0c13f --- /dev/null +++ b/.rules/changelog/2026-03/29/01.md @@ -0,0 +1,21 @@ +# Changelog — 2026-03-29 — 01 + +## Image Attachment Backend (Part 1) + +### New Files + +- **`src/image-attachments.ts`** — Module-level storage for pending image attachments (`ImageAttachment` interface, `setCurrentAttachments`, `getCurrentAttachments`, `clearCurrentAttachments`, `hasCurrentAttachments`). +- **`src/context/tools/save-image.json`** — Tool context JSON for the `save_image` tool (id, label, description, friendlyName, requiresApproval, Ollama function definition with `file_path` parameter). + +### Modified Files + +- **`src/tools.ts`** + - Added imports for `save-image.json` and `image-attachments` module. + - Added `mimeToExtension()` helper mapping MIME types to file extensions. + - Added `executeSaveImage()` — saves attached images to vault, handles single/multi naming, creates parent folders, clears attachments after save. + - Added `save_image` entry to `TOOL_REGISTRY` with `approvalMessage`, `summarize`, `summarizeResult`, and `execute` callbacks. + +- **`src/ollama-client.ts`** + - Added import for `hasCurrentAttachments` from `image-attachments`. + - Added `"save_image"` case to `preValidateTool` switch. + - Added `preValidateSaveImage()` — validates `file_path` is provided and attachments exist before prompting user approval. |
