summaryrefslogtreecommitdiffhomepage
path: root/.rules/changelog/2026-03/29/01.md
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-03-29 17:51:22 +0900
committerAdam Malczewski <[email protected]>2026-03-29 17:51:22 +0900
commit73c25761f6b879d78ebd8ecddac35881848831db (patch)
tree10c3e7e585e44dbd38aeef07295c39d93c9d1fec /.rules/changelog/2026-03/29/01.md
parente8d107e454b3804e089a33ce5fe7c931040d4647 (diff)
downloadai-pulse-obsidian-plugin-73c25761f6b879d78ebd8ecddac35881848831db.tar.gz
ai-pulse-obsidian-plugin-73c25761f6b879d78ebd8ecddac35881848831db.zip
enable image attachments to the chatHEADmain
Diffstat (limited to '.rules/changelog/2026-03/29/01.md')
-rw-r--r--.rules/changelog/2026-03/29/01.md21
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.