A settled top-level `read_image` call printed its raw attachment object as
literal text in the tool card — `{"type":"image","attachment":{…}}` —
instead of the image, because no presentation metadata told a client card
how to present the reference and the tool-card layer had no image concept.
Host: `read_image` declares an `output.presentationMeta` persisting
`{ path }` only. The attachment reference deliberately lives in the
settled result content — the single record a `tools/post-execute`
replacement rewrites — not in `meta`; the id is opaque and
provider-owned, checked for existence only.
Client: `imageCardModel` derives the card from the call head, the meta
path, the result's own image block, and a shape-matched envelope. ToolRow
gains an `image` card slot; the `read_image` toolview declares the
Tool-owned `tool.call.images` slot as its child and dispatches the
gallery through it. ui-chat down-threads the session-authorized loader
(`ChatNodeOwnerProps.loadImage`), so the tool layer supplies only derived
references plus the loader and never imports an attachment
implementation; ui-attachment fills the slot with its message gallery
renderer. The card keeps the envelope text below the gallery for the
no-attachment-plugin deployment. An image-bearing tool registers a keyed
toolview; the generic fallback keeps its flattened text. `read_image`
joins the read variant with its own locale title key; both rows share
`read-family-row.tsx`.
Verification: `read-image.spec.ts` (metadata projection, envelope by
shape, reference narrowing, real-execution round trip, rejection
branches incl. non-digest ids), `image-card.client.spec.tsx` (derivation,
row render site dispatching the slot, keyed registration with the
child-slot declaration, empty-slot fallbacks, media-type enum), keyless
snapshots (`read-image-gif` added; read-image/-dimension/-reencode
updated to the `{path}` meta), five injected-defect negative controls,
and a demo GIF recorded from this PR's head through the official
image-capable model.
77 lines
2.2 KiB
JSON
77 lines
2.2 KiB
JSON
{
|
|
"name": "@deepseek-ai/dsh-client-ui-attachment",
|
|
"description": "Dynamic attachment presentation plugin for conversation input, message-image, and trajectory image slots",
|
|
"version": "0.1.2-alpha.1",
|
|
"publishConfig": {
|
|
"access": "public"
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
"directory": "packages/client/ui-attachment"
|
|
},
|
|
"type": "module",
|
|
"main": "lib/index.js",
|
|
"types": "lib/types/index.d.ts",
|
|
"exports": {
|
|
".": {
|
|
"types": "./lib/types/index.d.ts",
|
|
"default": "./lib/index.js"
|
|
},
|
|
"./invariant": {
|
|
"types": "./lib/types/invariant.d.ts",
|
|
"default": "./lib/invariant.js"
|
|
},
|
|
"./client": {
|
|
"types": "./lib/types/client/index.d.ts",
|
|
"default": "./lib/client.js"
|
|
},
|
|
"./src/*": "./src/*",
|
|
"./package.json": "./package.json"
|
|
},
|
|
"dsh": {
|
|
"client": {
|
|
"inject": [
|
|
"@deepseek-ai/dsh-client-ui-chat",
|
|
"@deepseek-ai/dsh-client-ui-conversation",
|
|
"@deepseek-ai/dsh-client-ui-renderer",
|
|
"@deepseek-ai/dsh-client-ui-trajectory",
|
|
"@deepseek-ai/dsh-client-ui-tool"
|
|
],
|
|
"platform": "web"
|
|
}
|
|
},
|
|
"scripts": {
|
|
"bundle": "tsdown",
|
|
"watch": "tsdown --watch"
|
|
},
|
|
"license": "MIT",
|
|
"dependencies": {
|
|
"clsx": "^2.0.0"
|
|
},
|
|
"devDependencies": {
|
|
"@deepseek-ai/cordis": "workspace:^",
|
|
"@deepseek-ai/dsh-invariants": "workspace:^",
|
|
"@types/react": "~18.3.1",
|
|
"@types/react-dom": "~18.3.0",
|
|
"@deepseek-ai/dsh-client-ui-chat": "workspace:^",
|
|
"@deepseek-ai/dsh-client-ui-conversation": "workspace:^",
|
|
"@deepseek-ai/dsh-client-ui-trajectory": "workspace:^",
|
|
"@deepseek-ai/dsh-client-ui-renderer": "workspace:^",
|
|
"@deepseek-ai/dsh-client-ui-primitives": "workspace:^",
|
|
"@deepseek-ai/dsh-client-ui-slots": "workspace:^",
|
|
"react": "^18.2.0",
|
|
"react-dom": "^18.2.0",
|
|
"@deepseek-ai/dsh-attachment": "workspace:^",
|
|
"@deepseek-ai/dsh-client-ui-tool": "workspace:^"
|
|
},
|
|
"files": [
|
|
"lib/index.js",
|
|
"lib/invariant.js",
|
|
"lib/client.js",
|
|
"lib/types/**/*.d.ts"
|
|
],
|
|
"peerDependencies": {
|
|
"@deepseek-ai/cordis": "workspace:^"
|
|
}
|
|
}
|