diff --git a/packages/client/ui-tool/src/client/contract/slots.ts b/packages/client/ui-tool/src/client/contract/slots.ts index d99a64a626..7e6aaa675c 100644 --- a/packages/client/ui-tool/src/client/contract/slots.ts +++ b/packages/client/ui-tool/src/client/contract/slots.ts @@ -32,7 +32,10 @@ declare module '@deepseek-ai/dsh-client-ui-slots' { * loader it received in its owner, and the attachment plugin fills the * gallery. Composing no attachment presentation plugin renders nothing, * which is why the image card keeps its own envelope text beside the - * gallery. + * gallery. A child slot is declared by exactly one entry: registering a + * second toolview that declares the same child throws at load, so a + * future image-bearing tool must reuse this entry or own a distinct + * slot. */ 'tool.call.images': { kind: 'single'; scope: 'session'; owner: ToolImagesOwnerProps } } diff --git a/packages/client/ui-tool/src/client/tool/models/image-card-model.ts b/packages/client/ui-tool/src/client/tool/models/image-card-model.ts index 49d27316e2..ea829e4b5c 100644 --- a/packages/client/ui-tool/src/client/tool/models/image-card-model.ts +++ b/packages/client/ui-tool/src/client/tool/models/image-card-model.ts @@ -29,7 +29,9 @@ export interface ImageCardModel { } /** - * The persisted `presentationMeta` this card reads: the authored path only. + * The persisted `presentationMeta` this card reads: the resolved display path only + * (the value `read_image` persisted from its target's display path, not the + * author-typed `file_path` argument). * * Root calls persist it; a nested call (a read_image dispatched from inside * run_code) settles without `meta`, so the card falls back to the call's own diff --git a/packages/client/ui-tool/tests/image-card.client.spec.tsx b/packages/client/ui-tool/tests/image-card.client.spec.tsx index f74a489f00..53578e25d9 100644 --- a/packages/client/ui-tool/tests/image-card.client.spec.tsx +++ b/packages/client/ui-tool/tests/image-card.client.spec.tsx @@ -46,7 +46,6 @@ const sampleImage = { name: 'card.png', } -/** The persisted presentationMeta payload. */ /** The persisted presentationMeta payload: the path only. */ const imageMeta = (over?: Record) => ({ path: 'shots/card.png', ...over }) diff --git a/packages/fs/tool-fs/tests/read-image.spec.ts b/packages/fs/tool-fs/tests/read-image.spec.ts index 42a1542a4c..d5b4dc5b46 100644 --- a/packages/fs/tool-fs/tests/read-image.spec.ts +++ b/packages/fs/tool-fs/tests/read-image.spec.ts @@ -243,8 +243,8 @@ describe('read_image happy path', () => { expect(result.content).toHaveLength(2) const image = result.content[1] as { type: string; attachment: ImageAttachmentRef } expect(image.type).toBe('image') - // GIFs do not pass through unchanged: normalization re-encodes this - // transparent 1x1 GIF as WebP while keeping the source file name. + // Normalization re-encodes this transparent 1x1 GIF as WebP: the bytes do + // not pass through unchanged, only the source file name survives. expect(image.attachment.mediaType).toBe('image/webp') expect(image.attachment.width).toBe(1) expect(image.attachment.height).toBe(1)