feat(image): --file metadata payload for annotated image cards (T-316)

`clide image show --file meta.json` reads a {path,label,description,caption}
payload so an image can carry a title and a longer description, not just a
one-line caption. ImageMessage + the image card render the richer metadata;
the bare `image show <path> [--caption]` form is unchanged. Honest userError
on a malformed/missing payload. Text annotation only (option a) — visual
marker overlays stay a follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-29 12:58:30 +02:00
co-authored by Claude Opus 4.8
parent 5f8fa6af10
commit f0fb5a5134
10 changed files with 207 additions and 17 deletions
+13 -1
View File
@@ -178,7 +178,15 @@ final class AssistantToolUse extends ConversationItem {
/// driver has already resolved (workspace-relative paths are resolved before
/// injection); [caption] is an optional one-line label.
final class ImageMessage extends ConversationItem {
const ImageMessage({required super.uuid, required super.timestamp, required super.isSidechain, required this.path, this.caption});
const ImageMessage({
required super.uuid,
required super.timestamp,
required super.isSidechain,
required this.path,
this.caption,
this.label,
this.description,
});
/// Absolute path to the image file on disk.
final String path;
@@ -186,6 +194,10 @@ final class ImageMessage extends ConversationItem {
/// Optional caption shown under the image.
final String? caption;
/// Optional richer annotations from a `--file` metadata payload (T-316): a
/// title/label above the image and a longer description beneath it.
final String? label, description;
@override
String toString() => 'ImageMessage($path${caption != null ? ', "$caption"' : ''})';
}