Commit Graph

112 Commits

Author SHA1 Message Date
Max Korp 683a0c3f29 Merge remote-tracking branch 'origin/main' into feat/intelligence-thread-plumbing 2026-03-12 12:57:08 -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
github-actions[bot] ecd76256ed chore(post-release): update version to 1.54.0-next.7 2026-03-12 14:26:14 +00:00
Ran Shem Tov aa2f2c1af9 fix(react): use flushSync 2026-03-12 13:38:02 +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
Mike Ryan 237f10f8f4 refactor(core,react): Clean up rxjs code around Phoenix channels 2026-03-11 12:39:39 -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
github-actions[bot] e9cb7dfe26 chore(post-release): update version to 1.54.0-next.5 2026-03-11 15:20:13 +00:00
Ran Shemtov 4c0f92ac58 Merge branch 'main' into feat/a2ui-cpk-theme 2026-03-11 16:16:36 +01:00
Benjamin Taylor 499f5a1783 fix(runtime): Revert a fix that is outside the scope of this branch 2026-03-11 10:11:02 -05:00
Ran Shem Tov 5433fc33da fix: refine default theme 2026-03-11 15:54:59 +01:00
Benjamin Taylor 8d6bffdd7f Merge remote-tracking branch 'origin/main' into feat/intelligence-thread-plumbing 2026-03-11 09:40:31 -05:00
github-actions[bot] 190eb07f09 chore(post-release): update version to 1.54.0-next.4 2026-03-11 12:50:08 +00:00
Maxim c233c260d1 fix(react): update standard-schema test mock for hook-based render tool calls
Same fix as zod-regression — the mock was missing addHookRenderToolCall
and removeHookRenderToolCall methods.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 15:52:06 +04:00
Maxim e5cbcb670a fix(react): update zod-regression test mock for hook-based render tool calls
The mock was missing addHookRenderToolCall/removeHookRenderToolCall methods
introduced by the separate hook vs prop render tool call storage refactor.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 15:39:27 +04:00
Maxim a57dc40fca fix(react): remove as casts and clean up unused imports
Address review feedback: remove `as ReactToolCallRenderer` cast in
useFrontendTool by guarding with `tool.parameters` check (matching
CopilotKitProvider's pattern). Remove unused ReactToolCallRenderer
imports from use-frontend-tool.tsx and use-render-tool.tsx.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 15:28:26 +04:00
Maxim fd44b5ba5f test(react): add StrictMode render tool call preservation tests
Add tests verifying:
- useFrontendTool render registrations survive StrictMode remount
- Hook and prop render entries coexist through StrictMode remount
- Hook render entries survive provider prop changes
- Update useRenderTool test mock to match new addHookRenderToolCall API

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 15:28:26 +04:00
Maxim 829589a625 fix(react): separate hook vs prop render tool call storage to fix StrictMode race
CopilotKitProvider's didMountRef guard breaks under React Strict Mode:
refs persist across the simulated unmount/remount cycle, causing the
provider's setRenderToolCalls effect to overwrite registrations from
useFrontendTool and useRenderTool hooks.

Split render tool call storage in CopilotKitCoreReact into two layers:
- _renderToolCalls: prop-based entries (set by provider)
- _hookRenderToolCalls: hook-based entries (set by useFrontendTool/useRenderTool)

The renderToolCalls getter merges both with a cached result for
useSyncExternalStore referential stability. Provider and hooks can
never overwrite each other, eliminating the race by design.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 15:28:26 +04:00
github-actions[bot] 60de47cda2 chore(post-release): update version to 1.54.0-next.3 2026-03-11 11:14:53 +00:00
Tyler Slaton 26541a9268 chore(lint): run formatter on changes
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-03-10 15:49:34 -07:00
Alem Tuzlak ea98c8649c test: add Zod regression tests for Standard Schema migration
Adds 77 regression tests across shared, core, react, and agent packages
proving that existing Zod usage produces identical results after the
Standard Schema V1 migration. Covers JSON Schema output identity,
additionalProperties stripping, schema pass-through to AI SDK, React
hook compatibility, and complex Zod patterns (unions, discriminated
unions, nested objects, arrays, constraints, defaults, etc.).
2026-03-10 15:36:27 -07:00
Alem Tuzlak 55f64f08d5 chore: fix eslint issue 2026-03-10 15:36:27 -07:00
Alem Tuzlak f64a815cea feat: migrate public API from Zod to Standard Schema V1
Replace Zod-specific types (z.ZodType, z.infer) with Standard Schema V1
interfaces across the V2 public API surface. This allows users to use any
Standard Schema V1 compatible library (Zod 3.24+, Valibot v1+, ArkType v2+)
for tool parameters, with zero breaking changes for existing Zod users.

- Add schemaToJsonSchema() utility in shared with Standard JSON Schema V1
  support and Zod fallback
- Update FrontendTool, ToolDefinition, useRenderTool, useComponent, and
  Angular tool types to accept StandardSchemaV1
- Move zod from dependencies to devDependencies in core and angular
- Add runtime tests (40) and type-level tests (38) across all packages
  verifying Zod, Valibot, and ArkType compatibility
2026-03-10 15:36:26 -07:00
Tyler Slaton ddf8346911 chore: run pnpm format
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-03-10 17:48:08 -04:00
Benjamin Taylor efd37ccc2b fix(react, runtime): Fix tests and typos not caught by types 2026-03-10 16:47:31 -05:00
Benjamin Taylor 750875f5d3 feat(runtime, react): Refactors, bug fixes, doc strings 2026-03-10 16:34:46 -05:00
Benjamin Taylor 2bb0f220f2 feat(react, runtime): Refactor to not have SDK in intelligence names 2026-03-10 16:34:45 -05:00
Mike Ryan 303754916e feat(core,react,runtime): Support live updates for CRUD on threads 2026-03-10 16:34:44 -05:00
Mike Ryan 9e27d0e559 feat(runtime,core): Automatic opt-in to Intelligence when an SDK is provided 2026-03-10 16:34:43 -05:00
Benjamin Taylor 5d3c11fbaf feat(runtime, react): Add attempt limit to threads websocket cxn. Includes broken tests 2026-03-10 16:29:43 -05:00
Benjamin Taylor 38c6de9efc feat(runtime, react): Remove agentId bits from threads API calls, since it isn't needed 2026-03-10 16:29:42 -05:00
Benjamin Taylor 30af67feb2 feat(runtime, react): Wire in live updates for threads in useThreads 2026-03-10 16:29:41 -05:00
Benjamin Taylor 56e65fe8e9 feat(runtime, react): Add lots of tests 2026-03-10 16:29:41 -05:00
Benjamin Taylor 5e3327f9e7 feat(runtime, react): Add thread CRUD handlers in react and runtime 2026-03-10 16:29:39 -05:00
Benjamin Taylor aa544f6e25 feat(runtime, react): Set up real time updates (but not yet reducing) in useThreads 2026-03-10 16:29:39 -05:00
Benjamin Taylor 107dbaad53 feat(runtime, react): Add initial useThreads hook 2026-03-10 16:29:38 -05:00
github-actions[bot] d2cf028903 chore(post-release): update version to 1.53.1-next.2 2026-03-07 08:47:03 +00:00
Ran Shemtov 0c90355847 Merge branch 'main' into feat/a2ui-eager-default-renderer 2026-03-07 09:34:25 +01:00
Jordan Ritter 729a053842 test(react): add tests for useKatexStyles hook
Covers the dynamic CSS import behavior, graceful error handling,
and a regression guard ensuring the static katex CSS import doesn't
creep back into CopilotChatAssistantMessage.
2026-03-06 11:35:17 -08:00
Jordan Ritter e2b2dd9993 fix(react): replace static KaTeX CSS import with dynamic runtime injection (#3314)
## Summary

Fixes #2851

### Problem

Next.js rejects global CSS imports from within `node_modules`, causing
build failures:

```
Global CSS cannot be imported from within node_modules.
Location: node_modules/@copilotkitnext/react/dist/index.mjs

Import trace:
  katex/dist/katex.min.css
  @copilotkitnext/react/dist/index.mjs
  @copilotkit/react-core/dist/v2/index.mjs
```

This affects all Next.js consumers of CopilotKit (versions 1.50.0+).

### Root Cause

The static `import 'katex/dist/katex.min.css'` in
`CopilotChatAssistantMessage.tsx` (line 22) is preserved in the dist
bundle by tsdown's unbundle mode. Next.js webpack statically analyzes
imports and rejects global CSS from `node_modules`.

### Fix

Replace the static CSS import with a `useKatexStyles()` hook that
dynamically loads the stylesheet at runtime via `useEffect`:

- Created `useKatexStyles.ts` — a singleton hook that uses `import()` to
lazy-load KaTeX CSS
- Dynamic imports bypass Next.js static analysis (the css-npm check only
applies to static imports)
- Uses a module-level flag to ensure the CSS is only injected once

### Testing

- 2 consecutive clean test passes: **748/748 tests** (38 test files)
- Type-check shows only pre-existing errors from
`@copilotkitnext/web-inspector` (unrelated)
2026-03-06 15:22:40 -04:00
github-actions[bot] 6c4aab7d6f chore(post-release): update version to 1.53.1-next.1 2026-03-06 18:32:39 +00:00
Ran Shem Tov 4a294d2be3 chore: add tests 2026-03-06 19:24:00 +01:00
Ran Shem Tov a53bc556b2 feat: only add a2ui renderer when a2ui is enabled in runtime 2026-03-06 19:24:00 +01:00
Ran Shem Tov 4966e5cf1f feat: eagerly create default A2UI renderer when middleware is enabled 2026-03-06 19:24:00 +01:00
github-actions[bot] 1fd878c582 chore(post-release): update version to 1.53.1-next.0 2026-03-06 17:10:16 +00:00
Ran Shem Tov 8667fc7606 feat: move a2ui message renderer to v2s react package 2026-03-06 16:33:36 +01: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