Files
copilotkit__copilotkit/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

91 lines
3.1 KiB
JSON

{
"name": "CopilotKit",
"private": true,
"scripts": {
"build": "nx run-many -t build --projects=packages/** --exclude=@copilotkit/demo-agents",
"build:examples": "nx run-many -t build --projects=examples/**",
"build:storybook": "nx run-many -t build --projects=examples/v2/*/storybook",
"check-types": "nx run-many -t check-types",
"clean": "git clean -fdX --exclude=\"!.env\"",
"lint": "oxlint .",
"format": "oxfmt --write .",
"check-format": "oxfmt --check .",
"test": "nx run-many -t test",
"test:watch": "pnpm run test && nx watch --all -- pnpm run test",
"test:coverage": "nx run-many -t test:coverage",
"dev": "pnpm run build && nx watch --projects=packages/** -- pnpm run build",
"dev:examples": "pnpm run build:examples && nx watch --projects=examples/** -- pnpm run build:examples",
"storybook:angular": "pnpm -C examples/v2/angular/storybook dev",
"storybook:react": "pnpm -C examples/v2/react/storybook dev",
"storybook": "pnpm storybook:react",
"docs": "pnpm -C examples/v2/docs dev",
"demo:angular": "nx run-many -t dev --projects=examples/v2/angular/demo,examples/v2/angular/demo-server",
"demo:react": "pnpm -C examples/v2/react/demo dev",
"changeset": "changeset",
"prepare": "lefthook install",
"graph": "nx graph",
"publint": "nx run-many -t publint --projects=packages/**",
"attw": "nx run-many -t attw --projects=packages/**",
"check:packages": "nx run-many -t publint,attw --projects=packages/**"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.2",
"@changesets/cli": "^2.29.8",
"@commitlint/cli": "^20.3.0",
"@commitlint/config-conventional": "^20.3.0",
"@storybook/addon-docs": "^10.1.10",
"@storybook/addon-webpack5-compiler-swc": "^4.0.2",
"@storybook/react-webpack5": "^10.1.10",
"@types/jscodeshift": "^17.3.0",
"@types/node": "^18.11.17",
"@vitest/coverage-v8": "^3.2.4",
"danger": "^12.3.3",
"glob": "^10.3.12",
"install": "^0.13.0",
"jscodeshift": "^17.3.0",
"lefthook": "^2.1.1",
"npm": "^10.7.0",
"nx": "^22.5.0",
"oxfmt": "^0.36.0",
"oxlint": "^1.51.0",
"publint": "^0.3.17",
"storybook": "^10.1.10",
"ts-node": "^10.9.2",
"tsdown": "^0.20.3",
"typescript": "^5.2.3"
},
"engines": {
"node": ">=18"
},
"packageManager": "pnpm@10.13.1",
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": [
"react",
"react-dom"
],
"allowedVersions": {
"react": "*",
"react-dom": "*"
}
},
"overrides": {
"streamdown>react": "^19.0.0",
"@types/react": "^19.1.0",
"@types/react-dom": "^19.0.2",
"react": "19.1.0",
"react-dom": "19.1.0",
"next@<=15.4.10": "15.4.10",
"send@<=0.19.0": "0.19.0",
"path-to-regexp@<=0.1.12": "0.1.12",
"serve-static@<=1.16.0": "1.16.0",
"prismjs@<=1.30.0": "1.30.0",
"pino@<=10.1.1": "10.1.1",
"@copilotkit/license-verifier": "0.0.1-a1"
},
"patchedDependencies": {
"@changesets/assemble-release-plan@6.0.9": "patches/@changesets__assemble-release-plan@6.0.9.patch"
}
}
}