Render Mermaid diagrams and worktree images in agent Markdown

This commit is contained in:
Ian Gulliver
2026-10-15 07:27:17 -07:00
parent 1f44bc6d91
commit 4ca6f88861
26 changed files with 5613 additions and 227 deletions
+25 -1
View File
@@ -327,6 +327,30 @@ paths:
"404": { $ref: "#/components/responses/Error" }
"409": { $ref: "#/components/responses/Error" }
/api/tasks/{taskId}/image:
parameters:
- { name: taskId, in: path, required: true, schema: { type: string } }
get:
operationId: getTaskImage
description: >
An image file from the task's worktree, for Markdown images and image attachments. path is absolute or relative
to the worktree; after resolving symlinks it must be inside the worktree. PNG, JPEG, GIF, WebP and SVG, chosen by extension.
parameters:
- { name: path, in: query, required: true, schema: { type: string } }
responses:
"200":
description: The file's bytes.
content:
image/png: { schema: { type: string, format: binary } }
image/jpeg: { schema: { type: string, format: binary } }
image/gif: { schema: { type: string, format: binary } }
image/webp: { schema: { type: string, format: binary } }
image/svg+xml: { schema: { type: string, format: binary } }
"400": { $ref: "#/components/responses/Error" }
"403": { $ref: "#/components/responses/Error" }
"404": { $ref: "#/components/responses/Error" }
"409": { $ref: "#/components/responses/Error" }
/api/tasks/{taskId}/diff:
parameters:
- { name: taskId, in: path, required: true, schema: { type: string } }
@@ -832,7 +856,7 @@ components:
required: [kind]
properties:
kind: { type: string, enum: [file, diff, image, diagram, task, snapshot, url] }
path: { type: string, description: "file: repo-relative path." }
path: { type: string, description: "file: repo-relative path. image: an image file in the task's worktree, absolute or relative to it." }
start_line: { type: integer }
end_line: { type: integer }
ref: { type: string, description: "diff: git revision range." }