Commit Graph

80 Commits

Author SHA1 Message Date
Markus Ecker e3c00af220 feat(examples): A2UI + OpenGenUI demos, updated aimock fixtures, dojo e2e fixes 2026-04-08 12:50:56 -07:00
Alem Tuzlak 136bfc1182 Merge branch 'main' into feat/multimodal-builtin-agent 2026-04-07 09:51:46 +02:00
Martha Schumann 07b9ec13ec chore(a2ui): add /a2ui-demo page and DemoButtonAgent for manual fix validation
Adds a minimal demo at /a2ui-demo that uses the demo-button agent to
reproduce and validate the A2UI thread-clone bug fix. The agent renders
an A2UI surface with a Confirm button on first run; clicking it fires a
second run that emits a text confirmation message.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 09:45:23 -07:00
Alem Tuzlak 5f464e6a0d fix(example): map AG-UI text parts to TanStack AI format (text → content) 2026-04-06 15:34:17 +02:00
Alem Tuzlak 39344c00f7 fix(example): preserve multimodal content arrays in TanStack AI agent 2026-04-06 15:30:08 +02:00
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
Alem Tuzlak 085ac18057 feat(example): dual agent setup — BuiltInAgent + TanStack AI with agent toggle 2026-04-06 14:54:47 +02:00
Alem Tuzlak 64ffb9bee9 feat(example): update react-router example to test multimodal attachments 2026-04-06 14:54:47 +02:00
Alem Tuzlak 68f9b8ad45 feat(examples): add runtime adapter examples for Express, Hono, Node, Deno, Elysia, and CF Workers
Example projects demonstrating the new fetch-based runtime adapters
across six server frameworks/runtimes.
2026-04-03 18:41:29 +02:00
Alem Tuzlak 4ca5b9b621 style: fix package.json sort order after rebase 2026-04-02 16:39:56 +02:00
Alem Tuzlak 932b371bc7 fix: reformat conflict-resolved files
https://claude.ai/code/session_01GMkSf29p78HuMR1mbXn8He
2026-04-02 16:39:40 +02:00
Alem Tuzlak 79ce60c580 chore: migrate from eslint+prettier to oxlint+oxfmt
Replace eslint and prettier with oxlint and oxfmt for faster linting
and formatting across the monorepo. Remove all eslint and prettier
configs, dependencies, and related packages. Add .oxlintrc.json and
.oxfmtrc.json for the new tooling. Update CI workflows and lefthook
hooks accordingly. Reformat codebase with oxfmt.

https://claude.ai/code/session_01GMkSf29p78HuMR1mbXn8He
2026-04-02 16:39:05 +02:00
Claude 0d9e3b88f6 chore(post-release): update version to 1.55.0-next.8
The previous publish workflow released 1.55.0-next.8 to npm but the
post-release commit failed to push to main (blocked by branch
protection). This applies the version bumps and pre.json updates that
the workflow would have committed, unblocking future releases.

https://claude.ai/code/session_01N8sLK9h9p6FdRjyHqzKzVV
2026-04-02 02:23:27 +00:00
Alem Tuzlak cce5177af9 feat(examples): add React Router v7 example with TanStack AI agent (#3561)
## Summary

- Adds a new example app at `examples/v2/react-router` demonstrating
CopilotKit with React Router v7 (SSR/framework mode) and TanStack AI as
the default agent
- `TanStackAIAgent` wraps TanStack AI's `chat()` via a factory callback
pattern, giving users full type safety over adapter/model configuration
- CopilotKit runtime is mounted as a Hono route on the same server that
serves React Router SSR

## Key files

| File | Purpose |
|------|---------|
| `app/agent.ts` | `TanStackAIAgent` — thin `AbstractAgent` wrapping a
`chat()` factory, with AG-UI event normalization |
| `app/server.ts` | Hono server config mounting CopilotKit endpoint +
React Router SSR |
| `app/routes/_index.tsx` | Full-page `CopilotChat` UI |

## Notes

Discovered that TanStack AI's AG-UI events have subtle differences from
`@ag-ui/core` spec (extra fields, own type definitions instead of
importing from `@ag-ui/core`, own `runId`/no `threadId`). The
`TanStackAIAgent` normalizes these by consuming only text/tool deltas
from the stream and re-emitting clean `@ag-ui/client`-compatible events.
Will follow up with TanStack AI team on aligning their event types with
`@ag-ui/core`.

## Test plan

- [x] `pnpm build` passes
- [x] Dev server starts and serves the app
- [x] CopilotChat renders and streams responses from TanStack AI via
CopilotKit runtime
- [x] TypeScript type checks pass with zero errors

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-04-01 11:58:13 +02:00
Martha Schumann 0f01f3ea2d fix(state-manager): address code review feedback
- Replace boolean param with SubscribeConfig object on subscribeToAgent
- Invert handleNewMessage guard to early-return on missing input
- Remove module-scope isAnthropic variable in demo route (SSR safety)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 07:51:35 -07:00
Alem Tuzlak 8b4b32a44d style(examples): fix formatting in react-router example 2026-03-31 13:47:49 +02:00
Alem Tuzlak 7eaade9201 feat(examples): add React Router v7 example with TanStack AI agent
Add a new example app at examples/v2/react-router demonstrating CopilotKit
with React Router v7 (SSR/framework mode) and TanStack AI as the default agent.

- React Router v7 SSR with Hono server via react-router-hono-server
- CopilotKit runtime mounted as a Hono route on the same server
- TanStackAIAgent: thin AbstractAgent wrapper that accepts a chat() factory
  callback, giving users full type safety over TanStack AI's adapter/model config
- Proper AG-UI event normalization bridging TanStack AI's event format to
  what CopilotKit's @ag-ui/client pipeline expects
- Full-page CopilotChat UI with Tailwind CSS v4
2026-03-31 13:45:01 +02:00
Martha Schumann 83f58ee3de Merge branch 'main' into fix/cpk-7155-thread-shared-state
Incorporates the V1/V2 flat package consolidation (96885b595). All our
thread-isolation changes auto-merged to the new package paths. Three
content conflicts resolved (import paths updated from @/ aliases to
relative paths and @copilotkitnext/* to @copilotkit/*):
- packages/react-core/src/v2/hooks/use-agent.tsx
- packages/react-core/src/v2/hooks/use-render-custom-messages.tsx
- packages/react-core/src/v2/components/chat/CopilotChatMessageView.tsx

File location conflict resolved: use-agent-thread-isolation.test.tsx
moved from packages/v2/react/... to packages/react-core/src/v2/...
2026-03-30 12:33:16 -07:00
Martha Schumann 6c209bb24a fix(suggestions): pass thread clone agent to reloadSuggestions
With per-thread agent clones, the registry agent has empty messages.
reloadSuggestions was checking messageCount on the registry agent, so
dynamic suggestions (which require messageCount > 0) never fired after
the first message. Fix by passing the thread clone (with actual messages)
through reloadSuggestions → generateSuggestions.

Also updates the demo to use claude-3-7-sonnet (extended thinking support)
when ANTHROPIC_API_KEY is set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 09:57:23 -07:00
github-actions[bot] a1edf59eae chore(post-release): update version to 1.55.0-next.7 2026-03-29 00:19:22 +00:00
Claude 1ceb963a84 Revert "fix: resolve changeset version errors from stale @copilotkitnext package refs"
This reverts commit 1f6ae0d629.
2026-03-28 17:04:55 -07:00
Claude 369266f1be fix: resolve changeset version errors from stale @copilotkitnext package refs
After the V1/V2 consolidation merge, several changesets still referenced
old @copilotkitnext/* package names that no longer exist. Fixed package
references and ran changeset version to apply pending version bumps.

https://claude.ai/code/session_01A5aahBWFTmLPR3xZSeh4SD
2026-03-28 17:04:55 -07:00
Tyler Slaton 96885b5959 refactor: consolidate V1/V2 packages into flat @copilotkit/* structure
Flatten all packages from packages/v1/* and packages/v2/* into packages/* —
every package now lives directly under the @copilotkit/ scope with no v1/v2
subdirectories.

- Move all v1 packages (react-core, react-ui, runtime, shared, etc.) from
  packages/v1/* to packages/*
- Absorb v2 react code into packages/react-core/src/v2/ (exported via /v2 subpath)
- Absorb v2 agent code into packages/runtime/src/agent/ (exported via /v2 subpath)
- Move v2 packages (core, angular, demo-agents, etc.) to packages/*
- Replace all @copilotkitnext/* imports with @copilotkit/* equivalents
- Keep @copilotkitnext/angular as the sole exception (angular remains on next)
- Update CI workflows, renovate config, release scripts for flat structure
- No public API surface changes — all exports fields are preserved

Co-authored-by: Alem Tuzlak <t.zlak@hotmail.com>
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-03-28 16:45:10 -07:00
github-actions[bot] 80da7704c4 chore(post-release): update version to 1.54.1-next.6 2026-03-25 22:04:40 +00:00
github-actions[bot] 0683758931 chore(post-release): update version to 1.54.1-next.5 2026-03-25 16:45:07 +00:00
github-actions[bot] ed99910e51 chore(post-release): update version to 1.54.1-next.4 2026-03-24 23:04:43 +00:00
github-actions[bot] e384ad05fa chore(post-release): update version to 1.54.1-next.3 2026-03-24 22:19:10 +00:00
github-actions[bot] a93d7f0ab8 chore(post-release): update version to 1.54.1-next.2 2026-03-19 15:25:58 +00:00
github-actions[bot] 8238f0e912 chore(post-release): update version to 1.54.1-next.1 2026-03-18 22:17:23 +00:00
github-actions[bot] 7865731108 chore(post-release): update version to 1.54.1-next.0 2026-03-18 19:40:35 +00:00
github-actions[bot] ea746d4629 chore(post-release): update version to 1.54.0 2026-03-12 22:32:04 +00:00
Jordan Ritter 13da6bde76 feat: consolidate 73 standalone demo repos into monorepo (#3418)
## Summary

Migrates 47 standalone demo repositories from the CopilotKit GitHub org
into the monorepo under `examples/`, organized by category
(integrations, showcases, canvas). History is intentionally dropped —
shallow clone + file copy only.

Also migrates the `copilotkit` CLI package from CopilotCloud into
`packages/v1/cli` (previously stacked as PR #3419, now merged into this
branch).

### Demo consolidation

- **47 demos** imported across 4 groups (A=22, B=21, C=2, D=2)
- **26 repos excluded** — all 13 experiments (old/irrelevant
prototypes), 6 showcases (autotale, agui, campaign-manager, chat-sso,
crewai-enterprise, crm), and 7 starters (textarea, todos-app,
coagents-langgraph, coagents-crewai-flows, llamaindex-hitl,
enterprise-runner, react-vite-agent) dropped to reduce consolidation
footprint
- **Git LFS** tracks binary assets (png, jpg, jpeg, gif, mp4, webm, pdf)
— svg removed from LFS (text-based, breaks `GIT_LFS_SKIP_SMUDGE=1` clone
instructions)
- **Image deduplication** via `examples/images/` with symlinks from
individual examples
- **Tutorial branches** imported as `start/` and `final/` subdirectories
- **Cross-link rewriting** — all standalone repo URLs in READMEs and
docs updated to monorepo paths
- **Doc updates** — 18 tutorial/doc files updated with new clone
instructions and paths
- **Renovate config** — `examples/**` dependencies grouped into weekly
Monday PRs, v1/v2 legacy dirs excluded
- **`examples/README.md`** — full index of all 47 demos by category
- **Archive script** — `scripts/archive-demo-repos.sh` ready to
deprecate+archive original repos post-merge
- **Prettier** — all example files formatted to match monorepo standards
- **Example bug fixes** — Gemini agents (unguarded variables, sync
blocking, dead OpenAI route), langgraph-python (debug print, docstring
placement), StackBlitz URLs

### CLI migration (from CopilotCloud)

- `TEMPLATE_REPOS` updated to use monorepo subdirectory sparse checkout
for all CopilotKit-owned templates
- Tarball download fallback preserved for external repos
(ag2ai/ag2-copilotkit-starter)
- Package metadata (bugs, homepage, repository) updated to point to
monorepo
- Removed stale tsconfig paths/references to non-existent
`@repo/trpc-cli`
- **Pre-existing bug fixes:**
  - `base-command.ts`: unguarded `fetch()` crashed CLI when offline
  - `init.ts`: dropped all user flags when delegating to `create`
- `detect-endpoint-type.utils.ts`: Promise.all destructuring mismatch (5
promises, 4 variables)
- `auth.service.ts`: OAuth state validated after analytics, Promise
never settled on mismatch

### Category breakdown

| Category | Count | Path |
|----------|-------|------|
| Integrations | 17 | `examples/integrations/` |
| Canvas | 7 | `examples/canvas/` |
| Showcases | 23 | `examples/showcases/` |

### What happens after merge
- Run `scripts/archive-demo-repos.sh` to deprecate+archive the 47
consolidated repos
- 26 excluded repos (experiments + 6 showcases + 7 starters) left as-is
on GitHub
- Community announcement (Slack draft prepared)
- Post-merge verification (README rendering, LFS quotas, CLI test)

## Test plan

- [ ] `examples/README.md` renders correctly on GitHub with all links
working
- [ ] LFS-tracked images render in GitHub READMEs
- [ ] Spot-check 3-5 examples can `npm install && npm run dev`
successfully
- [ ] Symlinks in `examples/images/` resolve correctly
- [ ] No `.git/`, `.github/`, `node_modules/`, or `.env` files in any
example
- [ ] Doc tutorial paths point to existing `start/`/`final/` directories
- [ ] No remaining standalone repo URLs in docs
- [ ] `nx run copilotkit:test` passes (46/46)
- [ ] `copilotkit create` scaffolds from monorepo subdirectory
- [ ] CLI works offline (version check doesn't crash)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-03-12 16:29:54 -04:00
Jordan Ritter fd34bbfbf6 style: format all example files with prettier
Run prettier on ~1,865 files across examples/ to match the monorepo's
formatting standards. These files were imported as-is from standalone
repos that used different prettier configs.
2026-03-12 13:06:04 -07:00
github-actions[bot] 98890426e5 chore(post-release): update version to 1.54.0-next.9 2026-03-12 19:08:50 +00:00
github-actions[bot] b443706792 chore(post-release): update version to 1.54.0-next.8 2026-03-12 16:52:13 +00:00
github-actions[bot] ecd76256ed chore(post-release): update version to 1.54.0-next.7 2026-03-12 14:26:14 +00:00
github-actions[bot] ed34d9daef chore(post-release): update version to 1.54.0-next.6 2026-03-11 16:22:53 +00:00
github-actions[bot] e9cb7dfe26 chore(post-release): update version to 1.54.0-next.5 2026-03-11 15:20:13 +00:00
github-actions[bot] 190eb07f09 chore(post-release): update version to 1.54.0-next.4 2026-03-11 12:50:08 +00:00
github-actions[bot] 60de47cda2 chore(post-release): update version to 1.54.0-next.3 2026-03-11 11:14:53 +00:00
github-actions[bot] d2cf028903 chore(post-release): update version to 1.53.1-next.2 2026-03-07 08:47:03 +00:00
github-actions[bot] 6c4aab7d6f chore(post-release): update version to 1.53.1-next.1 2026-03-06 18:32:39 +00:00
github-actions[bot] 1fd878c582 chore(post-release): update version to 1.53.1-next.0 2026-03-06 17:10:16 +00:00
github-actions[bot] 57eb016a10 chore(post-release): update version to 1.53.0 2026-03-05 23:57:25 +00:00
github-actions[bot] 671fd0ae47 chore(post-release): update version to 1.53.0-next.6 2026-03-05 23:41:37 +00:00
github-actions[bot] 3ba2352ef8 chore(post-release): update version to 1.53.0-next.5 2026-03-05 23:06:01 +00:00
github-actions[bot] 9f12589107 chore(post-release): update version to 1.52.2-next.4 2026-03-05 21:28:52 +00:00
github-actions[bot] 2173e89096 chore(post-release): update version to 1.52.2-next.3 2026-03-05 17:42:38 +00:00
github-actions[bot] 3ff24c8b05 chore(post-release): update version to 1.52.2-next.2 2026-03-05 10:31:34 +00:00
Tyler Slaton f6e0004fbd fix(examples): disable caching
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-03-04 16:05:32 -05:00