Files
copilotkit__copilotkit/examples/v2/react/demo/package.json
Alem Tuzlak 18c7a6001d feat: multimodal attachments — UI polish, deprecations, docs, codemod
Attachment queue & previews:
- Image lightbox with View Transition API morph animation
- Video lightbox with native controls and play button overlay
- Document lightbox (PDF via blob URL, text inline, info card fallback)
- Drop zone overlay with upload icon
- Filename preservation via InputContent metadata
- Proper video thumbnail sizing and play/pause indicator
- Fix attachment queue positioning (max-w-3xl constraint)
- Padding between X button and content for audio/document cards
- Document filenames wrap instead of truncating

Attachments config:
- onUploadFailed callback for validation/upload errors (file-too-large, invalid-type, upload-failed)
- onUpload accepts sync or async returns
- AttachmentUploadResult discriminated union with explicit interfaces
- Metadata field on Attachment and onUpload return type

AG-UI version bump:
- Bump @ag-ui/client, @ag-ui/core, @ag-ui/encoder, @ag-ui/proto to 0.0.51
- Remove process.env Vite workaround (fixed upstream in 0.0.51)

Deprecation lifecycle:
- @deprecated JSDoc on all legacy image upload APIs
- ImageRenderer, ImageRendererProps, ImageUpload type, imageUploadsEnabled prop,
  inputFileAccept prop, ImageRenderer prop, AIMessage.image, ImageData
- Codemod at codemods/migrate-attachments.ts (15 tests)
- Migration guide updated with codemod instructions and new type shapes

Docs:
- New guide: docs/(root)/multimodal-attachments.mdx
- Updated migration guide with onUpload return type, metadata, codemod section
- Cross-links from prebuilt-components and migration guide
- Label change: "Add photos or files" → "Add attachments"

Tests:
- CopilotChat.attachments.test.tsx — 5 tests for onUploadFailed
- migrate-attachments codemod — 15 tests
2026-04-06 14:55:06 +02:00

52 lines
1.2 KiB
JSON

{
"name": "demo",
"version": "0.1.4-next.0",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"test": "vitest",
"test:watch": "vitest --watch",
"test:coverage": "vitest --coverage"
},
"dependencies": {
"@ag-ui/client": "0.0.51",
"@ag-ui/mcp-apps-middleware": "0.0.2",
"@copilotkit/core": "workspace:*",
"@copilotkit/react-core": "workspace:*",
"@copilotkit/runtime": "workspace:*",
"@copilotkit/shared": "workspace:*",
"@copilotkit/voice": "workspace:*",
"@modelcontextprotocol/sdk": "^1.18.2",
"cors": "^2.8.5",
"express": "^4.21.0",
"hono": "^4.11.4",
"next": "15.4.4",
"openai": "^5.9.0",
"react": "19.1.0",
"react-dom": "19.1.0",
"rxjs": "^7.8.1",
"zod": "^3.25.75"
},
"devDependencies": {
"@tailwindcss/postcss": "^4",
"@types/better-sqlite3": "^7.6.13",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.21",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"tailwindcss": "^4",
"typescript": "^5",
"vitest": "^3.2.3"
},
"nx": {
"targets": {
"build": {
"cache": false
}
}
}
}