Commit Graph

4537 Commits

Author SHA1 Message Date
Max Korp 8218bc3726 feat: add intelligence platform support 2026-03-13 11:34:16 -07:00
Markus Ecker 53a8cea13b Fix Bedrock Converse API compatibility in CopilotKitMiddleware (#3444)
## Summary

- Adds `_fix_messages_for_bedrock()` static method to
`CopilotKitMiddleware` that sanitizes messages before model invocation
- Strips unanswered `tool_calls` (no matching `ToolMessage`) — Bedrock
rejects `toolUse` blocks without a corresponding `toolResult`
- Syncs `msg.content` tool_use blocks with `msg.tool_calls` to remove
stale content blocks left behind in checkpoints
- Fixes string-typed `args`/`input` in tool_calls and tool_use content
blocks (Bedrock requires dict)

## Context

When using CopilotKit with Amazon Bedrock's Converse API, `after_agent`
restores frontend tool_calls to the checkpoint. This creates three
problems that cause Bedrock to reject the request:

1. AIMessages contain `toolUse` blocks without matching `toolResult`
messages
2. Content blocks and `tool_calls` can get out of sync after
`after_model` strips calls but leaves content blocks
3. Tool call arguments can be serialized as strings instead of dicts

This fix runs automatically in `awrap_model_call` before every model
invocation.

## Test plan

- [ ] Verify existing CopilotKit tests still pass
- [ ] Test with Bedrock Converse API (Claude models) with frontend tool
injection
- [ ] Test multi-turn conversations where frontend tool_calls are
restored from checkpoints
2026-03-13 17:29:08 +01:00
Alem Tuzlak 7c33c41874 ci: remove unused uv install from node-only workflows (#3448)
## Summary
- Removes the \`astral-sh/setup-uv@v6\` step from 8 CI workflows that
install uv but never use it
- Keeps uv in \`e2e_dojo.yml\` which actually needs it (dojo scripts use
\`uv sync\`/\`uv run\` for Python agents)

### Workflows cleaned up
| Workflow | What it does |
|---|---|
| \`test_unit-v1.yml\` | Unit tests (pnpm/node only) |
| \`test_unit-v2.yml\` | Unit tests (pnpm/node only) |
| \`static_quality.yml\` | Prettier, ESLint, publint (3 jobs, all node)
|
| \`static_commitlint.yml\` | Commitlint (node only) |
| \`static_danger.yml\` | Danger (node only) |
| \`e2e_examples.yml\` | Example e2e tests (node only) |
| \`publish_release.yml\` | Changeset publish (node only) |
| \`publish_custom-pre.yml\` | Snapshot publish (node only) |

### Workflow kept unchanged
- \`e2e_dojo.yml\` — \`prep-dojo-everything.js\` and
\`run-dojo-everything.js\` use \`uv sync\`/\`uv run\` for Python agent
suites

## Test plan
- [x] Verified \`e2e_dojo.yml\` is the only workflow where \`uv\` is
actually invoked
- [x] Verified no \`postinstall\` scripts in core packages call \`uv\`
- [x] Confirmed \`setup-uv\` only remains in \`e2e_dojo.yml\`
- [ ] CI should pass on this PR — all affected workflows are node-only
2026-03-13 16:04:57 +01:00
Alem Tuzlak 9dd893f627 Merge branch 'main' into chore/remove-unused-uv-from-ci 2026-03-13 15:07:31 +01:00
Ben Taylor 3b0cb58402 chore: add husky to gitignore (#3447)
Add husky to gitignore.
2026-03-13 09:03:57 -05:00
Alem Tuzlak 08e356df74 ci: remove unused uv install step from node-only workflows
These 8 workflows install uv but never invoke it. Only e2e_dojo.yml
actually needs uv (the dojo scripts use uv sync/run for Python agents).
Removing the unnecessary step saves CI time and reduces confusion.
2026-03-13 15:03:39 +01:00
Alem Tuzlak 633c81e085 Merge branch 'main' into chore/enforce-lefthook-in-claude-agents 2026-03-13 14:42:13 +01:00
Alem Tuzlak c854384e5e chore: ignore .husky directory and remove deprecated leftovers
The repo migrated to lefthook but leftover .husky/_/ files from the
old husky install can confuse agents into thinking husky is the hook
runner. Adding .husky/ to .gitignore prevents these from reappearing.
2026-03-13 14:32:49 +01:00
Ben Taylor f8acf7a649 chore: enforce lefthook in Claude Code agent sessions (#3446)
## Summary
- Adds a Claude Code `PreToolUse` hook that blocks `git commit` calls
containing `--no-verify`, `-n`, `LEFTHOOK=0`, or `--no-gpg-sign` —
preventing agents from silently skipping lefthook pre-commit hooks
- Adds commit grouping convention to the git guidelines docs (commits
should be separated by area of concern)

## Test plan
- [x] Verified hook blocks `git commit --no-verify` (blocked live in
session)
- [x] Verified hook blocks `LEFTHOOK=0 git commit` (blocked live in
session)
- [x] Verified hook allows normal `git commit` (passed through)
- [x] Verified hook ignores blocked keywords inside commit messages
(e.g. mentioning "--no-verify" in message text)
2026-03-13 08:32:13 -05:00
Alem Tuzlak 09572f7a37 docs: add commit grouping convention to git guidelines
Commits should be grouped by area of concern when committing batches
of changes, with related file moves included in the same commit.
2026-03-13 14:22:52 +01:00
Alem Tuzlak 33109250e7 chore: add Claude Code hook to enforce lefthook pre-commit
Agents and subagents sometimes skip pre-commit hooks by passing
bypass flags to git commit. This adds a PreToolUse hook that blocks
those attempts, ensuring lefthook always runs.
2026-03-13 14:22:13 +01:00
Ran Shem Tov 4506570206 chore: use latest python langgraph ag-ui 2026-03-13 13:49:15 +01:00
Markus Ecker d6d2e2c96a Fix Bedrock Converse API compatibility in CopilotKitMiddleware
Add _fix_messages_for_bedrock() to handle three issues caused by
after_agent restoring frontend tool_calls to the checkpoint:

1. Strip unanswered tool_calls without matching ToolMessages (Bedrock
   rejects toolUse without a corresponding toolResult)
2. Sync msg.content tool_use blocks with msg.tool_calls
3. Fix tool_use/tool_call blocks with string input/args (must be dict)
2026-03-13 12:02:05 +01:00
Ran Shemtov 9b2c840466 docs: add documentation about a2ui and mcpApps options in copilotkit (#3411) 2026-03-13 10:00:20 +01:00
Tyler Slaton 55b5739ad5 fix(docs): remove CLI scaffolding from built-in-agent and agent-spec quickstarts
Neither built-in-agent nor agent-spec are valid CLI framework options.
Remove "Start from scratch" CLI paths, keep manual setup only.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 20:53:40 -04:00
Tyler Slaton 3051bd1ff1 fix(docs): correct quickstart errors and API examples across integrations
- Agent-spec: remove invalid CLI `-f agent-spec` option, link to manual setup
- A2A: fix env var (GEMINI_API_KEY) and port (10002) to match starter template
- AWS Strands: fix useRenderTool to use Zod schema and correct render props
- LangGraph: add auth guide cross-reference in configurable docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 20:53:40 -04:00
Tyler Slaton bb96398854 fix(cli): remove prepare script on install
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-03-12 20:44:56 -04:00
Tyler Slaton af77b019f1 feat(langgraph-python): better prompt, tasks -> todos
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-03-12 20:44:56 -04:00
Tyler Slaton c672be411d fix(langgraph-python): sync lockfiles
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-03-12 20:21:06 -04:00
Tyler Slaton ccd4cc4437 feat: improve UI, better a2ui example, faster model
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-03-12 20:09:51 -04:00
github-actions[bot] ea746d4629 chore(post-release): update version to 1.54.0 v1.54.0 2026-03-12 22:32:04 +00:00
Tyler Slaton a62a97a195 chore: release 1.54.0
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-03-12 18:27:53 -04: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 1d72b9ce1b chore: strip starters from consolidation, update metadata to 47 repos 2026-03-12 13:06:04 -07: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
Jordan Ritter eab4855e67 fix: address review findings in consolidated examples
- gemini/stack_agent.py: initialize tool_calls/tool_msg before try
  block, guard usage with null check to prevent NameError on failure
- gemini/posts_generator_agent.py: use async generate_content to avoid
  blocking event loop, guard grounding_metadata access, replace bare
  except with explicit bounds check, remove dead router_function and
  redundant static edges
- gemini/app/api/chat/route.ts: remove dead OpenAI route from Gemini
  example (mislabeled as Gemini-powered, no frontend references it)
- gemini/package.json: remove unused @ai-sdk/openai, ai, zod deps
- langgraph-python/agent.py: remove debug print(state), move docstring
  to first position so chat_node.__doc__ works
- textarea tutorial: fix StackBlitz URLs pointing to use-tasks.tsx
  instead of use-emails.tsx
2026-03-12 13:06:04 -07:00
Jordan Ritter 34268b756a fix: remove SVG from LFS tracking
SVG files are text-based XML averaging ~218 bytes each. LFS tracking
adds per-file HTTP fetch overhead with no storage benefit, suppresses
git diff output, and breaks tutorial clone instructions that use
GIT_LFS_SKIP_SMUDGE=1 (users get LFS pointers instead of icons).
2026-03-12 13:06:03 -07:00
Jordan Ritter f36dcc708f fix: resolve pre-existing bugs in CLI package
- base-command: wrap checkCLIVersion() fetch in try-catch so CLI
  doesn't crash when offline (version check is non-critical)
- init: forward argv to Create instead of dropping all flags, remove
  misleading flag definitions (init is just a deprecated redirect)
- detect-endpoint-type: fix Promise.all destructuring (5 promises but
  only 4 variables caused isCopilot to receive the LangGraph FastAPI
  result), add missing isMCP branch, use isLangGraphFastAPI result
- auth.service: validate OAuth state parameter before tracking analytics
  with user data, add reject()+server.close() on state mismatch so the
  Promise settles instead of hanging the CLI forever
- create.test: fix quote-style assertion to match prettier output
2026-03-12 13:06:03 -07:00
Jordan Ritter ad81aaa524 fix: address review findings in migrated CLI package
- Remove copy-paste triplication in scaffoldAgent (LangSmith block
  duplicated twice, causing duplicate .env entries and redundant writes)
- Update AgentTemplates URLs to point to monorepo paths instead of
  archived standalone repos
- Fix flags.projectName → args.projectName in banner logic (projectName
  is an Args field, not Flags)
- Remove stale trpc-cli path mapping and project reference from
  tsconfig.json (package doesn't exist in this monorepo)
2026-03-12 13:06:03 -07:00
Jordan Ritter bee70690bb feat: move CLI package from CopilotCloud into monorepo
Migrate the copilotkit CLI (npx copilotkit create/init/dev) from
CopilotCloud into packages/v1/cli. TEMPLATE_REPOS updated to use
monorepo subdirectory sparse checkout for all CopilotKit-owned
templates, with tarball fallback for external repos (ag2).
2026-03-12 13:06:03 -07:00
Jordan Ritter 22f5d61396 chore: configure Renovate for consolidated examples
Add package rules to group examples/** dependency updates into weekly
Monday PRs. CopilotKit package bumps are tracked separately. Legacy
examples/v1/ and v2/ directories are excluded from both rules.
2026-03-12 13:06:03 -07:00
Jordan Ritter 79bdaddf0c docs: update tutorials and READMEs for consolidated demo paths
Rewrite all standalone repo URLs to monorepo paths across 18 doc files
and the root README. Tutorial clone instructions now use
GIT_LFS_SKIP_SMUDGE=1 and point to examples/ subdirectories. Fix
pre-existing copy-paste bug in textarea tutorial and stale branch refs.
2026-03-12 13:06:03 -07:00
Jordan Ritter 4b73c33d2f chore: add migration and archive scripts for demo repo consolidation
migrate-demos.sh: automates shallow clone + cleanup + copy for all 73
repos, with --group and --dry-run support.

archive-demo-repos.sh: updates each standalone repo's README with a
deprecation notice pointing to the monorepo location, then archives it.
Exits non-zero on any failures.
2026-03-12 13:06:02 -07:00
Jordan Ritter ec3a5ff114 feat: consolidate 47 demo repos into examples/ 2026-03-12 13:06:02 -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
Alem Tuzlak 3780c6ae74 chore: deprecate all @copilotkitnext/* packages
Mark all publishable @copilotkitnext/* packages as deprecated in
package.json, pointing users to the @copilotkit/* equivalents.
V2 features will be available under the /v2 subpath.

Affected packages: shared, core, agent, angular, react, runtime,
sqlite-runner, web-inspector.
2026-03-12 15:05:29 -04:00
github-actions[bot] b443706792 chore(post-release): update version to 1.54.0-next.8 2026-03-12 16:52:13 +00:00
Ran Shemtov 989dc26f56 fix: inject useCopilotReadable context into connectAgent (#3422) 2026-03-12 17:44:52 +01:00
Ran Shemtov f1571ef73e chore: add changeset 2026-03-12 16:43:01 +01:00
Ran Shem Tov ad85914b8c fix: inject useCopilotReadable context into connectAgent 2026-03-12 16:16:20 +01:00
github-actions[bot] ecd76256ed chore(post-release): update version to 1.54.0-next.7 2026-03-12 14:26:14 +00:00
Ran Shemtov d92adea27c fix(react): yield to React scheduler before follow-up agent run to pr… (#3421) 2026-03-12 15:22:30 +01:00
Ran Shem Tov 09d31e1230 docs: recommend runtime mcpApps by default and note A2UI auto-render 2026-03-12 13:52:56 +01:00
Ran Shem Tov aa2f2c1af9 fix(react): use flushSync 2026-03-12 13:38:02 +01:00
Ran Shemtov eb1e0bf2f9 chore: add changeset 2026-03-12 10:56:07 +01:00
Ran Shem Tov cad191176a fix(react): yield to React scheduler before follow-up agent run to prevent stale useAgentContext 2026-03-12 10:54:39 +01:00
Jordan Ritter 1a3ae544cb chore: add LFS tracking for jpeg, webm, and svg assets
Extend .gitattributes to track *.jpeg, *.webm, and *.svg via Git LFS,
complementing existing patterns (gif, jpg, png, pdf, mp4).
2026-03-11 21:48:44 -07:00
github-actions[bot] ed34d9daef chore(post-release): update version to 1.54.0-next.6 2026-03-11 16:22:53 +00:00
Maxim 768109afce feat(core): add copilotkit.runTool() for programmatic tool execution (#3286)
Adds a new `runTool()` method to `CopilotKitCore` that allows
programmatic execution of registered frontend tools without requiring an
LLM turn. This enables UI-driven tool invocations (e.g., button clicks
triggering tool handlers) while maintaining proper message history and
subscriber notifications.

Key changes:
- Extract `executeToolHandler` helper from duplicated logic in
`executeSpecificTool` to share with `runTool`
- Add `runTool()` on `RunHandler` with tool/agent lookup, message
creation, handler execution, and optional follow-up support
- Add `TOOL_NOT_FOUND` and `AGENT_NOT_FOUND` error codes
- Add `CopilotKitCoreRunToolParams` and `CopilotKitCoreRunToolResult`
types
- Add delegation method on `CopilotKitCore`
- Add 16 comprehensive tests covering all runTool behaviors
2026-03-11 20:19:29 +04:00
Maxim a042d74a77 Merge branch 'main' into claude/condescending-turing 2026-03-11 20:09:15 +04:00