refactor: narrow web image input v1

This commit is contained in:
Tianyi Cui
2026-07-29 23:18:57 +08:00
parent 8348a409aa
commit 3a4c436d83
69 changed files with 280 additions and 613 deletions
@@ -68,16 +68,10 @@ async function harness(image?: StoredImageAttachment): Promise<Context> {
class E2eAttachmentStore extends AttachmentStore {
readonly imageLimits: ImageAttachmentLimits = {
maxImageBytes: fixture.data.byteLength,
maxImagesPerMessage: 1,
maxMessageImageBytes: fixture.data.byteLength,
maxImagePixels: fixture.ref.width * fixture.ref.height,
mediaTypes: [fixture.ref.mediaType],
}
validateImage(_input: SaveImageAttachment): void {
throw new Error('e2e attachment fixture is read-only')
}
saveImage(_input: SaveImageAttachment): Promise<ImageAttachmentRef> {
return Promise.reject(new Error('e2e attachment fixture is read-only'))
}
@@ -228,7 +222,7 @@ for (const profile of providerCases) {
type: 'text',
text: 'What type of machine-readable symbol is shown in the attached image? Reply with exactly: QR code',
},
{ type: 'image', attachment: ref, alt: 'machine-readable symbol' },
{ type: 'image', attachment: ref },
],
source: { kind: 'plugin', plugin: 'test' },
})],