diff --git a/.cursor/rules/agent-development.mdc b/.cursor/rules/agent-development.mdc
index d75071229c..29027cdb89 100644
--- a/.cursor/rules/agent-development.mdc
+++ b/.cursor/rules/agent-development.mdc
@@ -23,7 +23,7 @@ Python agents are typically in folders named `agent-py/` or `agent/` and use the
- **[langgraph-tutorial-quickstart/agent-py/](mdc:examples/langgraph-tutorial-quickstart/agent-py/)** - LangGraph integration
### JavaScript Agents
-JavaScript agents are in folders named `agent-js/` and use the [sdk-js/](mdc:CopilotKit/packages/sdk-js/) package.
+JavaScript agents are in folders named `agent-js/` and use the [sdk-js/](mdc:src/v1.x/packages/sdk-js/) package.
#### JavaScript Agent Examples
- **[coagents-starter/agent-js/](mdc:examples/coagents-starter/agent-js/)** - Basic JavaScript agent setup
diff --git a/.cursor/rules/copilotkit-architecture.mdc b/.cursor/rules/copilotkit-architecture.mdc
index e364d682cd..451cc7414a 100644
--- a/.cursor/rules/copilotkit-architecture.mdc
+++ b/.cursor/rules/copilotkit-architecture.mdc
@@ -6,18 +6,18 @@ alwaysApply: false
# CopilotKit Architecture Overview
## Core Library Structure
-The main CopilotKit library is located in [CopilotKit/](mdc:CopilotKit/) with the following key packages:
+The main CopilotKit library is located in [CopilotKit/](mdc:src/v1.x/) with the following key packages:
### React Packages
-- **[react-core/](mdc:CopilotKit/packages/react-core/)** - Core React components and hooks for CopilotKit
-- **[react-textarea/](mdc:CopilotKit/packages/react-textarea/)** - Textarea component with AI integration
-- **[react-ui/](mdc:CopilotKit/packages/react-ui/)** - UI components for copilot interfaces
+- **[react-core/](mdc:src/v1.x/packages/react-core/)** - Core React components and hooks for CopilotKit
+- **[react-textarea/](mdc:src/v1.x/packages/react-textarea/)** - Textarea component with AI integration
+- **[react-ui/](mdc:src/v1.x/packages/react-ui/)** - UI components for copilot interfaces
### Runtime & SDK
-- **[runtime/](mdc:CopilotKit/packages/runtime/)** - Core runtime for executing copilot actions
-- **[runtime-client-gql/](mdc:CopilotKit/packages/runtime-client-gql/)** - GraphQL client for runtime communication
-- **[sdk-js/](mdc:CopilotKit/packages/sdk-js/)** - JavaScript SDK for backend integration
-- **[shared/](mdc:CopilotKit/packages/shared/)** - Shared utilities and types
+- **[runtime/](mdc:src/v1.x/packages/runtime/)** - Core runtime for executing copilot actions
+- **[runtime-client-gql/](mdc:src/v1.x/packages/runtime-client-gql/)** - GraphQL client for runtime communication
+- **[sdk-js/](mdc:src/v1.x/packages/sdk-js/)** - JavaScript SDK for backend integration
+- **[shared/](mdc:src/v1.x/packages/shared/)** - Shared utilities and types
### Python SDK
- **[sdk-python/](mdc:sdk-python/)** - Python SDK with integrations for:
@@ -39,7 +39,7 @@ All examples are in [examples/](mdc:examples/) and typically follow this pattern
## Development Workflow
- Examples use the local packages via workspace references
-- [package.json](mdc:CopilotKit/package.json) contains workspace configuration
-- Scripts in [scripts/](mdc:CopilotKit/scripts/) for development, testing, and releases
+- [package.json](mdc:src/v1.x/package.json) contains workspace configuration
+- Scripts in [scripts/](mdc:src/v1.x/scripts/) for development, testing, and releases
diff --git a/.cursor/rules/development-workflow.mdc b/.cursor/rules/development-workflow.mdc
index 9c9ca89d89..84e97c361a 100644
--- a/.cursor/rules/development-workflow.mdc
+++ b/.cursor/rules/development-workflow.mdc
@@ -7,20 +7,20 @@ alwaysApply: false
## Workspace Setup
CopilotKit uses a monorepo structure with:
-- **[CopilotKit/package.json](mdc:CopilotKit/package.json)** - Main workspace configuration
-- **[CopilotKit/packages/](mdc:CopilotKit/packages)** - Core library packages
+- **[src/v1.x/package.json](mdc:src/v1.x/package.json)** - Main workspace configuration
+- **[src/v1.x/packages/](mdc:src/v1.x/packages)** - Core library packages
- **[examples/](mdc:examples)** - Example applications
## Development Scripts
-Located in [CopilotKit/scripts/](mdc:CopilotKit/scripts):
+Located in [src/v1.x/scripts/](mdc:src/v1.x/scripts):
### Development Scripts
-- **[develop/](mdc:CopilotKit/scripts/develop)** - Development environment setup
-- **[qa/](mdc:CopilotKit/scripts/qa)** - Quality assurance and testing scripts
-- **[release/](mdc:CopilotKit/scripts/release)** - Release automation scripts
+- **[develop/](mdc:src/v1.x/scripts/develop)** - Development environment setup
+- **[qa/](mdc:src/v1.x/scripts/qa)** - Quality assurance and testing scripts
+- **[release/](mdc:src/v1.x/scripts/release)** - Release automation scripts
### Documentation Scripts
-- **[docs/](mdc:CopilotKit/scripts/docs)** - Documentation generation and management
+- **[docs/](mdc:src/v1.x/scripts/docs)** - Documentation generation and management
## Package Management
- Uses pnpm workspaces for package management
@@ -39,11 +39,11 @@ Located in [CopilotKit/scripts/](mdc:CopilotKit/scripts):
- **[snippets/](mdc:docs/snippets)** - Code snippets for documentation
## Configuration Files
-- **[CopilotKit.code-workspace](mdc:CopilotKit/CopilotKit.code-workspace)** - VS Code workspace settings
-- **[utilities/](mdc:CopilotKit/utilities)** - Shared utilities:
- - [eslint-config-custom/](mdc:CopilotKit/utilities/eslint-config-custom) - ESLint configuration
- - [tailwind-config/](mdc:CopilotKit/utilities/tailwind-config) - Tailwind CSS configuration
- - [tsconfig/](mdc:CopilotKit/utilities/tsconfig) - TypeScript configurations
+- **[CopilotKit.code-workspace](mdc:src/v1.x/CopilotKit.code-workspace)** - VS Code workspace settings
+- **[utilities/](mdc:src/v1.x/utilities)** - Shared utilities:
+ - [eslint-config-custom/](mdc:src/v1.x/utilities/eslint-config-custom) - ESLint configuration
+ - [tailwind-config/](mdc:src/v1.x/utilities/tailwind-config) - Tailwind CSS configuration
+ - [tsconfig/](mdc:src/v1.x/utilities/tsconfig) - TypeScript configurations
## Infrastructure
- **[infra/](mdc:infra)** - AWS CDK infrastructure code
diff --git a/.cursor/rules/frontend-development.mdc b/.cursor/rules/frontend-development.mdc
index 2e0000522a..132a4d745d 100644
--- a/.cursor/rules/frontend-development.mdc
+++ b/.cursor/rules/frontend-development.mdc
@@ -8,20 +8,20 @@ alwaysApply: false
## Core React Packages
### React Components
-- **[react-core/](mdc:CopilotKit/packages/react-core/)** - Core React components and hooks
+- **[react-core/](mdc:src/v1.x/packages/react-core/)** - Core React components and hooks
- `CopilotProvider` - Main provider component
- `useCopilotChat` - Chat functionality hook
- `useCopilotAction` - Action definition hook
- `useCopilotReadable` - State reading hook
### UI Components
-- **[react-ui/](mdc:CopilotKit/packages/react-ui/)** - Pre-built UI components
+- **[react-ui/](mdc:src/v1.x/packages/react-ui/)** - Pre-built UI components
- `CopilotChat` - Chat interface component
- `CopilotPopup` - Popup chat component
- `CopilotSidebar` - Sidebar chat component
### Specialized Components
-- **[react-textarea/](mdc:CopilotKit/packages/react-textarea/)** - AI-enhanced textarea
+- **[react-textarea/](mdc:src/v1.x/packages/react-textarea/)** - AI-enhanced textarea
- `CopilotTextarea` - Smart textarea with AI suggestions
- Auto-completion and suggestions
@@ -115,8 +115,8 @@ function MyComponent() {
## Integration with Agents
### Runtime Configuration
-- **[runtime/](mdc:CopilotKit/packages/runtime/)** - Core runtime for agent communication
-- **[runtime-client-gql/](mdc:CopilotKit/packages/runtime-client-gql/)** - GraphQL client
+- **[runtime/](mdc:src/v1.x/packages/runtime/)** - Core runtime for agent communication
+- **[runtime-client-gql/](mdc:src/v1.x/packages/runtime-client-gql/)** - GraphQL client
### Agent Communication
- Frontend components communicate with agents via the runtime
@@ -145,7 +145,7 @@ function MyComponent() {
### Styling and Theming
- Uses Tailwind CSS for styling
-- Shared configuration in [utilities/tailwind-config/](mdc:CopilotKit/utilities/tailwind-config/)
+- Shared configuration in [utilities/tailwind-config/](mdc:src/v1.x/utilities/tailwind-config/)
- Custom components in [components.json](mdc:docs/components.json)
- UI components follow modern design patterns
diff --git a/.cursor/rules/quick-reference.mdc b/.cursor/rules/quick-reference.mdc
index 9da8093ead..5e6e18f6eb 100644
--- a/.cursor/rules/quick-reference.mdc
+++ b/.cursor/rules/quick-reference.mdc
@@ -9,8 +9,8 @@ alwaysApply: false
### Build a Simple Copilot
- Start with [copilot-chat-with-your-data/](mdc:examples/copilot-chat-with-your-data)
-- Use [react-core/](mdc:CopilotKit/packages/react-core) for basic integration
-- Add [react-ui/](mdc:CopilotKit/packages/react-ui) for pre-built components
+- Use [react-core/](mdc:src/v1.x/packages/react-core) for basic integration
+- Add [react-ui/](mdc:src/v1.x/packages/react-ui) for pre-built components
### Create Multi-Agent Systems
- Check [coagents-starter/](mdc:examples/coagents-starter) for basic setup
@@ -27,18 +27,18 @@ alwaysApply: false
- See [coagents-starter/agent-py/](mdc:examples/coagents-starter/agent-py) for example
### Develop JavaScript Agents
-- Use [sdk-js/](mdc:CopilotKit/packages/sdk-js) package
+- Use [sdk-js/](mdc:src/v1.x/packages/sdk-js) package
- Check [coagents-starter/agent-js/](mdc:examples/coagents-starter/agent-js) for example
### Customize UI Components
- Browse [registry/](mdc:registry) for reusable components
- Check [docs/components/react/](mdc:docs/components/react) for documentation
-- Use [react-ui/](mdc:CopilotKit/packages/react-ui) for pre-built components
+- Use [react-ui/](mdc:src/v1.x/packages/react-ui) for pre-built components
### Set Up Development Environment
-- Review [CopilotKit/package.json](mdc:CopilotKit/package.json) for workspace setup
-- Use scripts in [CopilotKit/scripts/](mdc:CopilotKit/scripts)
-- Check [utilities/](mdc:CopilotKit/utilities) for shared configurations
+- Review [src/v1.x/package.json](mdc:src/v1.x/package.json) for workspace setup
+- Use scripts in [src/v1.x/scripts/](mdc:src/v1.x/scripts)
+- Check [utilities/](mdc:src/v1.x/utilities) for shared configurations
### Run Tests
- Use [examples/e2e/](mdc:examples/e2e) for end-to-end testing
@@ -50,9 +50,9 @@ alwaysApply: false
- See [docs/content/docs/](mdc:docs/content/docs) for markdown files
## Key Files to Know
-- **[CopilotKit/package.json](mdc:CopilotKit/package.json)** - Main workspace configuration
+- **[src/v1.x/package.json](mdc:src/v1.x/package.json)** - Main workspace configuration
- **[sdk-python/pyproject.toml](mdc:sdk-python/pyproject.toml)** - Python SDK configuration
-- **[CopilotKit.code-workspace](mdc:CopilotKit/CopilotKit.code-workspace)** - VS Code workspace settings
+- **[CopilotKit.code-workspace](mdc:src/v1.x/CopilotKit.code-workspace)** - VS Code workspace settings
- **[examples/shared/](mdc:examples/shared)** - Shared utilities and templates
## Common Patterns
@@ -63,7 +63,7 @@ alwaysApply: false
## Getting Started Checklist
1. Clone the repository
-2. Navigate to [CopilotKit/](mdc:CopilotKit) directory
+2. Navigate to [src/v1.x/](mdc:src/v1.x) directory
3. Run `npm install` to set up workspace
4. Choose an example from [examples/](mdc:examples)
5. Follow the example's README.md
diff --git a/.cursor/rules/suggestions-development.mdc b/.cursor/rules/suggestions-development.mdc
index 47442956b2..760beb5c87 100644
--- a/.cursor/rules/suggestions-development.mdc
+++ b/.cursor/rules/suggestions-development.mdc
@@ -31,16 +31,16 @@ Users can configure suggestions via `useCopilotChatSuggestions` hook which regis
## Core files
- **@react-ui**
- - [Suggestions.tsx](mdc:CopilotKit/packages/react-ui/src/components/chat/Suggestions.tsx) - How suggestions are rendered
- - [Messages.tsx](mdc:CopilotKit/packages/react-ui/src/components/chat/Messages.tsx) - Includes relevant code for what renders [Suggestions.tsx](mdc:CopilotKit/packages/react-ui/src/components/chat/Suggestions.tsx)
- - [Chat.tsx](mdc:CopilotKit/packages/react-ui/src/components/chat/Chat.tsx) - Includes relevant logic for our prebuilt components loading suggestions
- - [use-copilot-chat-suggestions.tsx](mdc:CopilotKit/packages/react-ui/src/hooks/use-copilot-chat-suggestions.tsx) - How users specify the configuration for their suggestions
- - [suggestions.css](mdc:CopilotKit/packages/react-ui/src/css/suggestions.css) - Styling for suggestions
+ - [Suggestions.tsx](mdc:src/v1.x/packages/react-ui/src/components/chat/Suggestions.tsx) - How suggestions are rendered
+ - [Messages.tsx](mdc:src/v1.x/packages/react-ui/src/components/chat/Messages.tsx) - Includes relevant code for what renders [Suggestions.tsx](mdc:src/v1.x/packages/react-ui/src/components/chat/Suggestions.tsx)
+ - [Chat.tsx](mdc:src/v1.x/packages/react-ui/src/components/chat/Chat.tsx) - Includes relevant logic for our prebuilt components loading suggestions
+ - [use-copilot-chat-suggestions.tsx](mdc:src/v1.x/packages/react-ui/src/hooks/use-copilot-chat-suggestions.tsx) - How users specify the configuration for their suggestions
+ - [suggestions.css](mdc:src/v1.x/packages/react-ui/src/css/suggestions.css) - Styling for suggestions
- **@react-core**
- - [copilot-context.tsx](mdc:CopilotKit/packages/react-core/src/context/copilot-context.tsx) - Where the actual suggestions are stored, the "provider" or "context"
- - [use-copilot-chat.ts](mdc:CopilotKit/packages/react-core/src/hooks/use-copilot-chat.ts) - Hook that controls and contains logic for suggestions, often referred to as "headless UI"
- - [suggestions.ts](mdc:CopilotKit/packages/react-core/src/utils/suggestions.ts) - Core suggestion generation logic with streaming validation and error handling
- - [suggestions-constants.ts](mdc:CopilotKit/packages/react-core/src/utils/suggestions-constants.ts) - Retry configuration constants
+ - [copilot-context.tsx](mdc:src/v1.x/packages/react-core/src/context/copilot-context.tsx) - Where the actual suggestions are stored, the "provider" or "context"
+ - [use-copilot-chat.ts](mdc:src/v1.x/packages/react-core/src/hooks/use-copilot-chat.ts) - Hook that controls and contains logic for suggestions, often referred to as "headless UI"
+ - [suggestions.ts](mdc:src/v1.x/packages/react-core/src/utils/suggestions.ts) - Core suggestion generation logic with streaming validation and error handling
+ - [suggestions-constants.ts](mdc:src/v1.x/packages/react-core/src/utils/suggestions-constants.ts) - Retry configuration constants
## How Suggestions Work
diff --git a/.github/workflows/cleanup-caches-after-pr-close.yml b/.github/workflows/cleanup_pr-caches.yml
similarity index 93%
rename from .github/workflows/cleanup-caches-after-pr-close.yml
rename to .github/workflows/cleanup_pr-caches.yml
index 5b56775094..a3cc178de8 100644
--- a/.github/workflows/cleanup-caches-after-pr-close.yml
+++ b/.github/workflows/cleanup_pr-caches.yml
@@ -1,11 +1,11 @@
-name: Cleanup caches after PR close
+name: cleanup
on:
pull_request:
types:
- closed
jobs:
- cleanup:
+ pr-caches:
runs-on: ubuntu-latest
steps:
- name: Cleanup
diff --git a/.github/workflows/dojo-e2e.yml b/.github/workflows/e2e_dojo.yml
similarity index 95%
rename from .github/workflows/dojo-e2e.yml
rename to .github/workflows/e2e_dojo.yml
index 29680142e1..a34143e395 100644
--- a/.github/workflows/dojo-e2e.yml
+++ b/.github/workflows/e2e_dojo.yml
@@ -1,20 +1,22 @@
-name: e2e
+name: e2e / dojo
on:
push:
branches: [main]
- paths-ignore:
- - "docs/**"
- - "README.md"
+ paths:
+ - "src/v1.x/**"
+ - "src/v2.x/**"
+ - ".github/workflows/e2e_dojo.yml"
pull_request:
branches: [main]
- paths-ignore:
- - "docs/**"
- - "README.md"
+ paths:
+ - "src/v1.x/**"
+ - "src/v2.x/**"
+ - ".github/workflows/e2e_dojo.yml"
jobs:
dojo:
- name: dojo / ${{ matrix.suite }}
+ name: ${{ matrix.suite }}
runs-on: depot-ubuntu-24.04
timeout-minutes: 20
strategy:
@@ -143,11 +145,11 @@ jobs:
uses: astral-sh/setup-uv@v6
- name: Install cpk dependencies
- working-directory: CopilotKit/CopilotKit
+ working-directory: CopilotKit/src/v1.x
run: pnpm install --frozen-lockfile
- name: Build cpk
- working-directory: CopilotKit/CopilotKit
+ working-directory: CopilotKit/src/v1.x
env:
NODE_OPTIONS: --max-old-space-size=8192
TURBO_CONCURRENCY: 2
@@ -163,7 +165,7 @@ jobs:
- name: Link cpk into ag-ui
working-directory: CopilotKit
- run: node ../ag-ui/apps/dojo/scripts/link-cpk.js .
+ run: node ../ag-ui/apps/dojo/scripts/link-cpk.js src/v1.x/packages
- name: Prepare dojo for e2e
working-directory: ag-ui/apps/dojo
diff --git a/.github/workflows/preview-envs-deploy.yml b/.github/workflows/e2e_examples-previews-deploy.yml
similarity index 96%
rename from .github/workflows/preview-envs-deploy.yml
rename to .github/workflows/e2e_examples-previews-deploy.yml
index 800a9797be..091c5cde42 100644
--- a/.github/workflows/preview-envs-deploy.yml
+++ b/.github/workflows/e2e_examples-previews-deploy.yml
@@ -1,4 +1,4 @@
-name: Preview Environments
+name: e2e / examples
on:
pull_request:
@@ -16,7 +16,7 @@ jobs:
build_images:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'automated-version-pr') }}
runs-on: ubuntu-latest
- name: Build Images
+ name: build
strategy:
matrix:
app:
@@ -116,19 +116,19 @@ jobs:
- name: (UI, Local Deps) Install monorepo
if: matrix.app.type == 'ui' || matrix.app.type == 'next-openai'
- working-directory: ./CopilotKit
+ working-directory: ./src/v1.x
run: pnpm install --frozen-lockfile
- name: (UI, Local Deps) Build @copilotkit packages
if: matrix.app.type == 'ui' || matrix.app.type == 'next-openai'
- working-directory: ./CopilotKit
+ working-directory: ./src/v1.x
run: pnpm run freshbuild
- name: (UI, Local Deps) Link @copilotkit packages
if: matrix.app.type == 'ui'
working-directory: ./examples/${{ matrix.app.project }}/${{ matrix.app.type }}
run: |
- for package in $(ls -d ../../../CopilotKit/packages/*); do
+ for package in $(ls -d ../../../src/v1.x/packages/*); do
pnpm link $package
done
@@ -141,7 +141,7 @@ jobs:
- name: (next-openai) Build app
if: matrix.app.type == 'next-openai'
- working-directory: CopilotKit/examples/next-openai
+ working-directory: src/v1.x/examples/next-openai
run: pnpm run example-build
env:
OPENAI_API_KEY: placeholder
@@ -165,7 +165,7 @@ jobs:
run: |
docker buildx build \
-t 058264219587.dkr.ecr.us-east-1.amazonaws.com/coagents:next-openai-${{ github.run_id }} \
- -f ./CopilotKit/examples/next-openai/Dockerfile \
+ -f ./src/v1.x/examples/next-openai/Dockerfile \
--platform=linux/amd64 \
--provenance=false \
--push \
@@ -204,7 +204,6 @@ jobs:
deploy:
runs-on: ubuntu-latest
- name: Deploy Preview Environments
needs: build_images
outputs:
e2e-urls: ${{ steps.export-e2e-urls.outputs.e2e-urls }}
@@ -312,10 +311,10 @@ jobs:
labels: ['preview']
})
- test:
+ playwright:
+ name: "playwright"
if: github.event_name == 'pull_request'
- name: End to End Tests
- uses: ./.github/workflows/e2e.yml
+ uses: ./.github/workflows/e2e_examples-test.yml
needs: deploy
with:
ref: "${{ github.event.pull_request.head.ref }}"
diff --git a/.github/workflows/preview-envs-destroy.yml b/.github/workflows/e2e_examples-previews-destroy.yml
similarity index 95%
rename from .github/workflows/preview-envs-destroy.yml
rename to .github/workflows/e2e_examples-previews-destroy.yml
index 64acf4c2ed..222cad1bf2 100644
--- a/.github/workflows/preview-envs-destroy.yml
+++ b/.github/workflows/e2e_examples-previews-destroy.yml
@@ -1,12 +1,12 @@
-name: Destroy Preview Environments
+name: e2e / examples
on:
pull_request:
- types: [ closed ]
+ types: [closed]
workflow_dispatch:
inputs:
pr_number:
- description: 'Pull Request Number'
+ description: "Pull Request Number"
required: true
concurrency:
@@ -42,7 +42,7 @@ jobs:
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} --profile default
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} --profile default
aws configure set region us-east-1
-
+
- uses: pnpm/action-setup@v4
with:
version: 9
@@ -69,4 +69,4 @@ jobs:
with:
comment-tag: preview-status-update
message: |
- Preview environments destroyed for this pull request.
\ No newline at end of file
+ Preview environments destroyed for this pull request.
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e_examples-test.yml
similarity index 98%
rename from .github/workflows/e2e.yml
rename to .github/workflows/e2e_examples-test.yml
index 8933d79ece..4ccf8000b7 100644
--- a/.github/workflows/e2e.yml
+++ b/.github/workflows/e2e_examples-test.yml
@@ -1,4 +1,4 @@
-name: End to End Tests
+name: e2e / examples
on:
workflow_call:
@@ -17,8 +17,7 @@ on:
required: true
jobs:
- e2e_tests:
- name: E2E Tests
+ test:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
@@ -111,4 +110,4 @@ jobs:
with:
pr-number: ${{ inputs.pr_number }}
comment-tag: test-run-status-update
- file-path: ./examples/e2e/test-results/test-run-comment.md
\ No newline at end of file
+ file-path: ./examples/e2e/test-results/test-run-comment.md
diff --git a/.github/workflows/custom-prerelease.yml b/.github/workflows/publish_custom-pre.yml
similarity index 83%
rename from .github/workflows/custom-prerelease.yml
rename to .github/workflows/publish_custom-pre.yml
index 0dd888a54b..d789519b49 100644
--- a/.github/workflows/custom-prerelease.yml
+++ b/.github/workflows/publish_custom-pre.yml
@@ -1,4 +1,4 @@
-name: Custom Tag Pre-Release
+name: publish
on:
workflow_dispatch:
@@ -6,12 +6,11 @@ on:
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
- release:
- name: Pre-release
+ custom-pre:
runs-on: ubuntu-latest
defaults:
run:
- working-directory: "CopilotKit"
+ working-directory: "src/v1.x"
timeout-minutes: 10
steps:
- name: Checkout Repo
@@ -39,4 +38,4 @@ jobs:
- name: Publish snapshot
run: ./scripts/release/publish-snapshot-release.sh
env:
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
\ No newline at end of file
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
diff --git a/.github/workflows/release.yml b/.github/workflows/publish_release.yml
similarity index 97%
rename from .github/workflows/release.yml
rename to .github/workflows/publish_release.yml
index 51d2aaec59..970bc9213c 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/publish_release.yml
@@ -1,4 +1,4 @@
-name: Release
+name: publish
on:
workflow_dispatch:
@@ -10,11 +10,10 @@ concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
- name: Release
runs-on: ubuntu-latest
defaults:
run:
- working-directory: "CopilotKit"
+ working-directory: "src/v1.x"
timeout-minutes: 10
steps:
- name: Checkout Repo
@@ -117,6 +116,6 @@ jobs:
with:
tag_name: v${{ steps.new-version.outputs.version }}
release_name: v${{ steps.new-version.outputs.version }}
- body_path: ./CopilotKit/changelog.txt
+ body_path: ./src/v1.x/changelog.txt
draft: false
prerelease: false
diff --git a/.github/workflows/danger.yml b/.github/workflows/static_danger.yml
similarity index 91%
rename from .github/workflows/danger.yml
rename to .github/workflows/static_danger.yml
index b724881e47..e289deca7d 100644
--- a/.github/workflows/danger.yml
+++ b/.github/workflows/static_danger.yml
@@ -1,10 +1,10 @@
-name: Danger
+name: static
on:
pull_request:
paths:
- "sdk-python/copilotkit/langgraph_agent.py"
- - "CopilotKit/packages/sdk-js/src/langgraph.ts"
+ - "src/v1.x/packages/sdk-js/src/langgraph.ts"
jobs:
danger:
diff --git a/.github/workflows/quality.yml b/.github/workflows/static_quality.yml
similarity index 60%
rename from .github/workflows/quality.yml
rename to .github/workflows/static_quality.yml
index 7a6baaf80a..e9ca9d17a0 100644
--- a/.github/workflows/quality.yml
+++ b/.github/workflows/static_quality.yml
@@ -1,31 +1,30 @@
-name: Quality
+name: static
on:
push:
branches: [main]
paths-ignore:
- - 'docs/**'
- - 'README.md'
- - 'examples/**'
- - '.github/workflows/demos_preview.yml'
- - '.github/workflows/release.yml'
- - 'CopilotKit/packages/**/package.json'
- - 'CopilotKit/packages/**/CHANGELOG.md'
- - 'CopilotKit/.changeset/**'
+ - "docs/**"
+ - "README.md"
+ - "examples/**"
+ - ".github/workflows/demos_preview.yml"
+ - ".github/workflows/release.yml"
+ - "src/v1.x/packages/**/package.json"
+ - "src/v1.x/packages/**/CHANGELOG.md"
+ - "src/v1.x/.changeset/**"
pull_request:
- branches: [main]
+ branches: [main]
paths-ignore:
- - 'docs/**'
- - 'README.md'
- - 'examples/**'
+ - "docs/**"
+ - "README.md"
+ - "examples/**"
jobs:
prettier:
- name: 'Prettier'
runs-on: ubuntu-latest
defaults:
run:
- working-directory: 'CopilotKit'
+ working-directory: "src/v1.x"
steps:
- name: Checkout
@@ -40,9 +39,9 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 20.x
- cache: 'pnpm'
- cache-dependency-path: '**/pnpm-lock.yaml'
-
+ cache: "pnpm"
+ cache-dependency-path: "**/pnpm-lock.yaml"
+
- name: Install dependencies
run: pnpm install --frozen-lockfile
@@ -50,11 +49,10 @@ jobs:
run: npx turbo run check-prettier
eslint:
- name: 'ESLint'
runs-on: ubuntu-latest
defaults:
run:
- working-directory: CopilotKit
+ working-directory: src/v1.x
steps:
- name: Checkout
uses: actions/checkout@v3
@@ -68,11 +66,11 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 20.x
- cache: 'pnpm'
- cache-dependency-path: '**/pnpm-lock.yaml'
-
+ cache: "pnpm"
+ cache-dependency-path: "**/pnpm-lock.yaml"
+
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run ESLint check
- run: npx turbo run lint
\ No newline at end of file
+ run: npx turbo run lint
diff --git a/.github/workflows/test-deploy-custom-copilotkit-version-to-cloud.yaml b/.github/workflows/test-deploy-custom-copilotkit-version-to-cloud.yaml
deleted file mode 100644
index 6ac173e7e5..0000000000
--- a/.github/workflows/test-deploy-custom-copilotkit-version-to-cloud.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
-name: Test Deploy Custom CopilotKit Version to Cloud
-
-on:
- workflow_dispatch:
- inputs:
- version:
- description: "Version to deploy (e.g. `1.5.12-next.0`)"
- required: true
-
-jobs:
- run:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0
-
- - uses: actions/checkout@v3
- with:
- repository: copilotkit/copilotcloud
- ref: main
- sparse-checkout: '.github/actions'
- sparse-checkout-cone-mode: false
- path: .github/cloud-actions
-
- - name: LS LA
- run: |
- ls -la .github
- ls -la .github/cloud-actions
-
- # - name: Test Composite Action
- # uses: copilotkit/copilotcloud/.github/workflows/test-deploy-custom-copilotkit-version-to-cloud.yml@main
- # with:
- # version: ${{ inputs.version }}
- # secrets:
- # aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
- # aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
diff --git a/.github/workflows/ci.yml b/.github/workflows/test_unit-v1.yml
similarity index 55%
rename from .github/workflows/ci.yml
rename to .github/workflows/test_unit-v1.yml
index 31214830d3..5350d3c930 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/test_unit-v1.yml
@@ -1,44 +1,44 @@
-name: CI
+name: test
on:
push:
branches: [main]
paths-ignore:
- - 'docs/**'
- - 'README.md'
- - 'examples/**'
- - '.github/workflows/demos_preview.yml'
- - '.github/workflows/release.yml'
- - 'CopilotKit/packages/**/package.json'
- - 'CopilotKit/packages/**/CHANGELOG.md'
- - 'CopilotKit/.changeset/**'
+ - "docs/**"
+ - "README.md"
+ - "examples/**"
+ - ".github/workflows/demos_preview.yml"
+ - ".github/workflows/release.yml"
+ - "src/v1.x/packages/**/package.json"
+ - "src/v1.x/packages/**/CHANGELOG.md"
+ - "src/v1.x/.changeset/**"
pull_request:
branches: [main]
paths-ignore:
- - 'docs/**'
- - 'README.md'
- - 'examples/**'
+ - "docs/**"
+ - "README.md"
+ - "examples/**"
jobs:
- test:
- name: 'Test'
+ v1:
+ name: "unit / v1.x"
runs-on: ubuntu-latest
defaults:
run:
- working-directory: 'CopilotKit'
+ working-directory: "src/v1.x"
strategy:
matrix:
- node-version: [20.x, 18.x]
+ node-version: [20.x, 22.x, 24.x]
steps:
- name: Checkout
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: "9.5"
-
+
- name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v2
+ uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
diff --git a/.github/workflows/test_unit-v2.yml b/.github/workflows/test_unit-v2.yml
new file mode 100644
index 0000000000..bb7210f0a9
--- /dev/null
+++ b/.github/workflows/test_unit-v2.yml
@@ -0,0 +1,45 @@
+name: test
+
+on:
+ push:
+ branches: [main]
+ paths:
+ - "src/v2.x/**"
+ - ".github/workflows/test_unit-v2.yml"
+ pull_request:
+ branches: [main]
+ paths:
+ - "src/v2.x/**"
+ - ".github/workflows/test_unit-v2.yml"
+jobs:
+ v2:
+ name: "unit / v2.x"
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ working-directory: "src/v2.x"
+ strategy:
+ matrix:
+ node-version: [20.x, 22.x, 24.x]
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Setup pnpm
+ uses: pnpm/action-setup@v4
+ with:
+ version: "9.5"
+
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v4
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ - name: Install dependencies
+ run: pnpm install --frozen-lockfile
+
+ - name: Build
+ run: pnpm build
+
+ - name: Run tests
+ run: pnpm test
diff --git a/.husky/pre-commit b/.husky/pre-commit
index 88641c6ff9..c234aa1390 100644
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1 +1 @@
-cd CopilotKit && pnpm run precommit
+cd src/v1.x && pnpm run precommit
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 63edd3a60e..31a4fafd7e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -73,7 +73,7 @@ pnpm install
To make sure everything works, let’s build all packages once:
```jsx
-cd CopilotKit
+cd src/v1.x
turbo run build
```
diff --git a/dangerfile.js b/dangerfile.js
index 0588d5c8ba..6262596283 100644
--- a/dangerfile.js
+++ b/dangerfile.js
@@ -1,7 +1,7 @@
import { danger, warn } from "danger";
const file1 = "sdk-python/copilotkit/langgraph_agent.py";
-const file2 = "CopilotKit/packages/sdk-js/src/langgraph.ts";
+const file2 = "src/v1.x/packages/sdk-js/src/langgraph.ts";
// Get the list of modified files in the PR
const changedFiles = danger.git.modified_files;
diff --git a/docs/app/(home)/layout.tsx b/docs/app/(home)/layout.tsx
index c145cc5f35..8bfc548065 100644
--- a/docs/app/(home)/layout.tsx
+++ b/docs/app/(home)/layout.tsx
@@ -13,6 +13,7 @@ import {
ADKIcon,
AgnoIcon,
LlamaIndexIcon,
+ AgentSpecMarkIcon,
PydanticAIIcon,
AwsStrandsIcon,
A2AIcon,
@@ -217,6 +218,15 @@ export default function Layout({ children }: { children: ReactNode }) {
bgGradient: "bg-black text-white",
selectedStyle: "ring-gray-500 ring-2 rounded-sm",
},
+ {
+ title: "Open Agent Spec",
+ description: "Documentation for CoAgents with Open Agent Spec",
+ url: "/agent-spec",
+ icon: ,
+ bgGradient:
+ "bg-gradient-to-b from-slate-700 to-slate-400 text-slate-100",
+ selectedStyle: "ring-slate-500/70 ring-2 rounded-sm",
+ },
],
},
]}
diff --git a/docs/components/content/iframe-switcher.tsx b/docs/components/content/iframe-switcher.tsx
index 704359403b..71faf13af6 100644
--- a/docs/components/content/iframe-switcher.tsx
+++ b/docs/components/content/iframe-switcher.tsx
@@ -1,6 +1,6 @@
-import * as React from "react";
import {
Tabs,
+ Tab,
TabsContent,
TabsList,
TabsTrigger,
@@ -57,3 +57,68 @@ export function IframeSwitcher({
);
}
+
+// Wrapper for multiple IframeSwitcher variants (e.g., different integrations)
+interface IframeSwitcherVariant {
+ label: string;
+ exampleUrl: string;
+ codeUrl: string;
+}
+
+interface IframeSwitcherGroupProps {
+ id?: string;
+ variants: IframeSwitcherVariant[];
+ height?: string;
+ exampleLabel?: string;
+ codeLabel?: string;
+}
+
+export function IframeSwitcherGroup({
+ id,
+ variants,
+ height = "600px",
+ exampleLabel = "Example",
+ codeLabel = "Code",
+}: IframeSwitcherGroupProps) {
+ const items = variants.map((v) => v.label);
+ const firstItem = items[0];
+
+ if (!firstItem || variants.length === 0) {
+ return null;
+ }
+
+ // Single variant - render without outer tabs
+ if (variants.length === 1) {
+ const variant = variants[0];
+ if (!variant) return null;
+
+ return (
+
+ );
+ }
+
+ // Multiple variants - wrap with outer tabs
+ return (
+
+ {variants.map((variant) => (
+
+
+
+ ))}
+
+ );
+}
diff --git a/docs/components/content/index.ts b/docs/components/content/index.ts
index 5401d87c3c..e67981490d 100644
--- a/docs/components/content/index.ts
+++ b/docs/components/content/index.ts
@@ -1 +1 @@
-export { IframeSwitcher } from "./iframe-switcher";
+export { IframeSwitcher, IframeSwitcherGroup } from "./iframe-switcher";
diff --git a/docs/content/docs/(root)/(other)/contributing/code-contributions/index.mdx b/docs/content/docs/(root)/(other)/contributing/code-contributions/index.mdx
index 16ef161e6c..f20ae7e49f 100644
--- a/docs/content/docs/(root)/(other)/contributing/code-contributions/index.mdx
+++ b/docs/content/docs/(root)/(other)/contributing/code-contributions/index.mdx
@@ -22,7 +22,7 @@ This guide will help you get started as smoothly as possible.
Then, clone your fork to your local machine:
```bash
git clone https://github.com//CopilotKit
- cd CopilotKit/CopilotKit
+ cd CopilotKit/src/v1.x
```
diff --git a/docs/content/docs/a2a/generative-ui/meta.json b/docs/content/docs/a2a/generative-ui/meta.json
index 157b52f03b..c72c843607 100644
--- a/docs/content/docs/a2a/generative-ui/meta.json
+++ b/docs/content/docs/a2a/generative-ui/meta.json
@@ -1,5 +1,6 @@
{
"title": "Generative UI",
+ "icon": "lucide/Paintbrush",
"defaultOpen": true,
"pages": ["declarative-a2ui"]
}
diff --git a/docs/content/docs/adk/generative-ui/meta.json b/docs/content/docs/adk/generative-ui/meta.json
index 9360ddea96..b230d5f64d 100644
--- a/docs/content/docs/adk/generative-ui/meta.json
+++ b/docs/content/docs/adk/generative-ui/meta.json
@@ -1,5 +1,6 @@
{
"title": "Generative UI",
+ "icon": "lucide/Paintbrush",
"defaultOpen": true,
"pages": ["backend-tools", "frontend-tools", "agentic"]
}
diff --git a/docs/content/docs/ag2/(other)/contributing/code-contributions/index.mdx b/docs/content/docs/ag2/(other)/contributing/code-contributions/index.mdx
index 16ef161e6c..f20ae7e49f 100644
--- a/docs/content/docs/ag2/(other)/contributing/code-contributions/index.mdx
+++ b/docs/content/docs/ag2/(other)/contributing/code-contributions/index.mdx
@@ -22,7 +22,7 @@ This guide will help you get started as smoothly as possible.
Then, clone your fork to your local machine:
```bash
git clone https://github.com//CopilotKit
- cd CopilotKit/CopilotKit
+ cd CopilotKit/src/v1.x
```
diff --git a/docs/content/docs/agent-spec/agentic-chat-ui.mdx b/docs/content/docs/agent-spec/agentic-chat-ui.mdx
new file mode 100644
index 0000000000..560dddbdaf
--- /dev/null
+++ b/docs/content/docs/agent-spec/agentic-chat-ui.mdx
@@ -0,0 +1,52 @@
+---
+title: Chat with an Agent
+icon: "lucide/SendHorizontal"
+description: Chat with your Agent Spec agent using CopilotKit's UI components.
+---
+
+import ConnectCopilotUI from "@/snippets/copilot-ui.mdx";
+import SelfHostingCopilotRuntimeCreateEndpoint from "@/snippets/self-hosting-copilot-runtime-create-endpoint.mdx";
+import SelfHostingCopilotRuntimeConfigureCopilotKitProvider from "@/snippets/self-hosting-copilot-runtime-configure-copilotkit-provider.mdx";
+import CopilotCloudConfigureCopilotKitProvider from "@/snippets/cloud/cloud-copilotkit-provider.mdx";
+import ComponentExamples from "@/snippets/component-examples.mdx";
+import { UserIcon, PaintbrushIcon, WrenchIcon, RepeatIcon } from "lucide-react";
+import { IframeSwitcherGroup } from "@/components/content"
+
+
+
+## What is this?
+
+Agentic chat UIs let your users interact with your agent. CopilotKit provides prebuilt components (like `CopilotChat` and `CopilotSidebar`) as well as headless hooks — you can start simple and grow to a fully custom app.
+
+If you've gone through the [quickstart](/agent-spec/quickstart), you already have an agentic chat UI set up — nothing else is required to begin chatting.
+
+## When should I use this?
+
+Use the agentic chat UI when you want a turnkey chat experience that:
+- streams assistant text and tool calls/results,
+- supports stateful conversations (thread/run lifecycle),
+- can evolve into generative UI with custom renders.
+
+
+
+## Learn more
+
+- Agent Spec docs home: https://oracle.github.io/agent-spec/development/docs_home.html
+- Reference sheet (formats): https://oracle.github.io/agent-spec/development/misc/reference_sheet.html
diff --git a/docs/content/docs/agent-spec/custom-look-and-feel/bring-your-own-components.mdx b/docs/content/docs/agent-spec/custom-look-and-feel/bring-your-own-components.mdx
new file mode 100644
index 0000000000..98fe17448e
--- /dev/null
+++ b/docs/content/docs/agent-spec/custom-look-and-feel/bring-your-own-components.mdx
@@ -0,0 +1,7 @@
+---
+title: Custom Sub-Components
+icon: "lucide/Puzzle"
+---
+import BringYourOwnComponents from "@/snippets/shared/guides/custom-look-and-feel/bring-your-own-components.mdx";
+
+
\ No newline at end of file
diff --git a/docs/content/docs/agent-spec/custom-look-and-feel/customize-built-in-ui-components.mdx b/docs/content/docs/agent-spec/custom-look-and-feel/customize-built-in-ui-components.mdx
new file mode 100644
index 0000000000..aaeadede05
--- /dev/null
+++ b/docs/content/docs/agent-spec/custom-look-and-feel/customize-built-in-ui-components.mdx
@@ -0,0 +1,7 @@
+---
+title: "Styling Copilot UI"
+icon: "lucide/Brush"
+---
+import CustomizeBuiltInUIComponents from "@/snippets/shared/guides/custom-look-and-feel/customize-built-in-ui-components.mdx";
+
+
\ No newline at end of file
diff --git a/docs/content/docs/agent-spec/custom-look-and-feel/headless-ui.mdx b/docs/content/docs/agent-spec/custom-look-and-feel/headless-ui.mdx
new file mode 100644
index 0000000000..de5fa9adcf
--- /dev/null
+++ b/docs/content/docs/agent-spec/custom-look-and-feel/headless-ui.mdx
@@ -0,0 +1,8 @@
+---
+title: "Fully Headless UI"
+description: "Fully customize your Copilot's UI from the ground up using headless UI"
+icon: "lucide/Settings"
+---
+import HeadlessUI from "@/snippets/shared/guides/custom-look-and-feel/headless-ui.mdx";
+
+
\ No newline at end of file
diff --git a/docs/content/docs/agent-spec/custom-look-and-feel/index.mdx b/docs/content/docs/agent-spec/custom-look-and-feel/index.mdx
new file mode 100644
index 0000000000..7c059b39d0
--- /dev/null
+++ b/docs/content/docs/agent-spec/custom-look-and-feel/index.mdx
@@ -0,0 +1,42 @@
+---
+title: "Customize UI"
+description: "Customize the look, feel, and functionality of CopilotKit's UI components."
+icon: "lucide/Settings"
+---
+import { MessageCircleIcon, BrushIcon, PuzzleIcon, SettingsIcon } from "lucide-react";
+
+CopilotKit offers a variety of ways to create a UI interface for your Copilots and CoAgents. This ranges
+from using our built-in UI components to fully customizing the UI with headless UI.
+
+
+ Prebuilt Copilot UI}
+ description="Get started quickly with CopilotKit's ready-to-use UI components."
+ href="./custom-look-and-feel/built-in-ui-components"
+ />
+ Styling Copilot UI}
+ description="Customize the appearance of CopilotKit's pre-built components with your own styles."
+ href="./custom-look-and-feel/customize-built-in-ui-components"
+ />
+ Custom Components}
+ description="Replace the Copilot UI components with your own while keeping the core functionality."
+ href="./custom-look-and-feel/bring-your-own-components"
+ />
+ Fully Custom UI}
+ description="Build your UI from scratch using CopilotKit's hooks and core functionality."
+ href="./custom-look-and-feel/headless-ui"
+ />
+ Markdown Rendering}
+ description="Modify CopilotKit's use of markdown to display elements within the assistant arrow text, such as source citing and reasoning steps."
+ href="./custom-look-and-feel/markdown-rendering"
+ />
+
\ No newline at end of file
diff --git a/docs/content/docs/agent-spec/custom-look-and-feel/markdown-rendering.mdx b/docs/content/docs/agent-spec/custom-look-and-feel/markdown-rendering.mdx
new file mode 100644
index 0000000000..3f3ef50155
--- /dev/null
+++ b/docs/content/docs/agent-spec/custom-look-and-feel/markdown-rendering.mdx
@@ -0,0 +1,7 @@
+---
+title: Markdown rendering
+icon: "lucide/MessageSquareCode"
+---
+import MarkdownRendering from "@/snippets/shared/guides/custom-look-and-feel/markdown-rendering.mdx";
+
+
\ No newline at end of file
diff --git a/docs/content/docs/agent-spec/custom-look-and-feel/meta.json b/docs/content/docs/agent-spec/custom-look-and-feel/meta.json
new file mode 100644
index 0000000000..39661263b2
--- /dev/null
+++ b/docs/content/docs/agent-spec/custom-look-and-feel/meta.json
@@ -0,0 +1,11 @@
+{
+ "title": "Custom Look and Feel",
+ "icon": "lucide/LayoutDashboard",
+ "pages": [
+ "built-in-ui-components",
+ "customize-built-in-ui-components",
+ "bring-your-own-components",
+ "headless-ui",
+ "markdown-rendering"
+ ]
+}
\ No newline at end of file
diff --git a/docs/content/docs/agent-spec/generative-ui/backend-tools.mdx b/docs/content/docs/agent-spec/generative-ui/backend-tools.mdx
new file mode 100644
index 0000000000..0ed81d120c
--- /dev/null
+++ b/docs/content/docs/agent-spec/generative-ui/backend-tools.mdx
@@ -0,0 +1,173 @@
+---
+title: Backend Tools
+icon: "lucide/Server"
+description: Render your agent's tool calls with custom UI components.
+---
+import { Accordions, Accordion } from "fumadocs-ui/components/accordion";
+import { IframeSwitcherGroup } from "@/components/content"
+import { Tabs, Tab } from "fumadocs-ui/components/tabs"
+import DefaultToolRendering from "@/snippets/shared/guides/default-tool-rendering.mdx"
+import RunAndConnect from "@/snippets/integrations/agent-spec/run-and-connect.mdx"
+
+
+
+
+ This example demonstrates the [implementation](#implementation) section applied in the CopilotKit feature viewer.
+
+
+## What is this?
+
+Tools are a way for the LLM to call predefined, typically, deterministic functions. CopilotKit allows you to render these tools in the UI
+as a custom component, which we call **Generative UI**.
+
+## When should I use this?
+
+Rendering tools in the UI is useful when you want to provide the user with feedback about what your agent is doing, specifically
+when your agent is calling tools. CopilotKit allows you to fully customize how these tools are rendered in the chat.
+
+## Implementation
+
+
+
+### Run and connect your agent
+
+
+
+### Give your agent a tool to call
+
+
+
+ ```python title="agent.py"
+
+ # Create the agent
+ from pyagentspec.agent import Agent
+ from pyagentspec.llms import OpenAiCompatibleConfig
+ from pyagentspec.property import StringProperty
+ from pyagentspec.tools import ServerTool
+ from pyagentspec.serialization import AgentSpecSerializer
+
+ llm = OpenAiCompatibleConfig(
+ name="my_llm",
+ model_id="gpt-4o-mini",
+ url="https://api.openai.com/v1",
+ )
+ weather_tool = ServerTool( # ServerTool are backend tools in Agent Spec
+ name="get_weather",
+ description="Get the weather for a given location.",
+ inputs=[StringProperty(title="location", description="The location to get the weather forecast. Must be a city/town name.")],
+ outputs=[StringProperty(title="weather_result")],
+ )
+ agent = Agent(
+ name="my_agent",
+ llm_config=llm,
+ system_prompt="Based on the weather forecast result and the user input, write a response to the user",
+ tools=[weather_tool],
+ human_in_the_loop=True,
+ )
+ agentspec_json_config = AgentSpecSerializer().to_json(agent)
+
+ async def get_weather(location: str = "Everywhere ever") -> str:
+ """Get the weather for a given location. Ensure location is fully spelled out."""
+ return f"The weather in {location} is sunny."
+
+ # Start the server
+ from fastapi import APIRouter, FastAPI
+ from ag_ui_agentspec.agent import AgentSpecAgent
+ from ag_ui_agentspec.endpoint import add_agentspec_fastapi_endpoint
+
+
+ runtime = "langgraph" # you can also choose "wayflow"
+ router = APIRouter()
+ add_agentspec_fastapi_endpoint(
+ app=router,
+ agentspec_agent=AgentSpecAgent(
+ agentspec_json_config,
+ runtime=runtime,
+ tool_registry={"get_weather": get_weather},
+ ),
+ path=f"/{runtime}/path_to_my_agent",
+ )
+ app = FastAPI(title="Agent-Spec x AG-UI Examples - Backend Tool")
+ app.include_router(router)
+
+ if __name__ == "__main__":
+ import uvicorn
+ uvicorn.run(app, host="0.0.0.0", port=8000)
+
+ ```
+
+
+
+
+
+### Render the tool call in your frontend
+At this point, your agent will be able to call the `get_weather` tool. Now
+we just need to add a `useRenderToolCall` hook to render the tool call in
+the UI.
+
+
+ In order to render a tool call in the UI, the name of the action must match the name of the tool.
+
+
+```tsx title="app/page.tsx"
+import { useRenderToolCall } from "@copilotkit/react-core"; // [!code highlight]
+// ...
+
+const YourMainContent = () => {
+ // ...
+ // [!code highlight:12]
+ useRenderToolCall({
+ name: "get_weather",
+ render: ({status, args}) => {
+ return (
+
+ {status !== "complete" && "Calling weather API..."}
+ {status === "complete" && `Called the weather API for ${args.location}.`}
+
+ );
+ },
+ });
+ // ...
+}
+```
+
+
+
+### Give it a try!
+
+Try asking the agent to get the weather for a location. You should see the custom UI component that we added
+render the tool call and display the arguments that were passed to the tool.
+
+
+
+
+
+## Default Tool Rendering
+
+
+
diff --git a/docs/content/docs/agent-spec/generative-ui/frontend-tools.mdx b/docs/content/docs/agent-spec/generative-ui/frontend-tools.mdx
new file mode 100644
index 0000000000..acfeaf7ab2
--- /dev/null
+++ b/docs/content/docs/agent-spec/generative-ui/frontend-tools.mdx
@@ -0,0 +1,163 @@
+---
+title: Frontend Tools
+icon: "lucide/Wrench"
+description: Create frontend tools and use them within your Agent Spec configured agent.
+---
+import InstallSDKSnippet from "@/snippets/install-sdk.mdx"
+import { IframeSwitcher } from "@/components/content"
+import { Tabs, Tab } from "fumadocs-ui/components/tabs"
+import RunAndConnect from "@/snippets/integrations/agent-spec/run-and-connect.mdx"
+
+
+
+## What is this?
+Frontend tools enable you to define client-side functions that your agents defined with Agent Spec can invoke, with execution happening entirely in the user's browser. When your agent calls a frontend tool,
+the logic runs on the client side, giving you direct access to the frontend environment.
+
+This can be utilized for to let [your agent control the UI](/frontend-actions), [generative UI](/agent-spec/generative-ui/frontend-tools), or for Human-in-the-loop interactions.
+
+In this guide, we cover the use of frontend tools for generative UI.
+
+## When should I use this?
+Use frontend tools when you need your agent to interact with client-side primitives such as:
+- Reading or modifying React component state
+- Accessing browser APIs like localStorage, sessionStorage, or cookies
+- Triggering UI updates or animations
+- Interacting with third-party frontend libraries
+- Performing actions that require the user's immediate browser context
+
+## Implementation
+
+
+
+ ### Run and connect your agent
+
+
+
+
+ ### Create a frontend tool
+
+ First, you'll need to create a frontend tool using the [useFrontendTool](/reference/hooks/useFrontendTool) hook. Here's a simple one to get you started
+ that says hello to the user.
+
+ ```tsx title="page.tsx"
+ import { useFrontendTool } from "@copilotkit/react-core" // [!code highlight]
+
+ export function Page() {
+ // ...
+
+ // [!code highlight:25]
+ useFrontendTool({
+ name: "sayHello",
+ description: "Say hello to the user",
+ parameters: [
+ {
+ name: "name",
+ type: "string",
+ description: "The name of the user to say hello to",
+ required: true,
+ },
+ ],
+ handler({ name }) {
+ // Handler returns the result of the tool call
+ return { currentURLPath: window.location.href, userName: name };
+ },
+ render: ({ args }) => {
+ // Renders UI based on the data of the tool call
+ return (
+
+
Hello, {args.name}!
+
You're currently on {window.location.href}
+
+ );
+ },
+ });
+
+ // ...
+ }
+ ```
+
+ Now you need to indicate to the Agent that they can use this tool similarly how you defined backend tools.
+
+
+
+
+ ### Give the tool to the Agent
+ ```python title="agent.py"
+
+ # Create the agent
+ from pyagentspec.agent import Agent
+ from pyagentspec.llms import OpenAiCompatibleConfig
+ from pyagentspec.property import StringProperty
+ from pyagentspec.tools import ClientTool
+ from pyagentspec.serialization import AgentSpecSerializer
+
+ llm = OpenAiCompatibleConfig(
+ name="my_llm",
+ model_id="gpt-4o-mini",
+ url="https://api.openai.com/v1",
+ )
+ sayhello_tool = ClientTool( # ClientTool is used for frontend tools
+ name="sayHello",
+ description="Say hello to the user.",
+ inputs=[StringProperty(title="name", description="The name of the user to say hello to")],
+ )
+ agent = Agent(
+ name="my_agent",
+ llm_config=llm,
+ system_prompt="An helpful assistant tasked with answering the user requests.",
+ tools=[sayhello_tool],
+ human_in_the_loop=True,
+ )
+ agentspec_json_config = AgentSpecSerializer().to_json(agent)
+
+ # Start the server
+ from fastapi import APIRouter, FastAPI
+ from ag_ui_agentspec.agent import AgentSpecAgent
+ from ag_ui_agentspec.endpoint import add_agentspec_fastapi_endpoint
+
+
+ runtime = "langgraph" # you can also choose "wayflow"
+ router = APIRouter()
+ add_agentspec_fastapi_endpoint(
+ app=router,
+ agentspec_agent=AgentSpecAgent(
+ agentspec_json_config,
+ runtime=runtime,
+ ),
+ path=f"/{runtime}/path_to_my_agent",
+ )
+ app = FastAPI(title="Agent-Spec x AG-UI Examples - Frontend Tool")
+ app.include_router(router)
+
+ if __name__ == "__main__":
+ import uvicorn
+ uvicorn.run(app, host="0.0.0.0", port=8000)
+
+ ```
+
+
+
+
+ ### Give it a try!
+ You've now given your agent the ability to call the frontend tool you've just defined.
+
+
+
+
+
diff --git a/docs/content/docs/agent-spec/generative-ui/index.mdx b/docs/content/docs/agent-spec/generative-ui/index.mdx
new file mode 100644
index 0000000000..f31c549b83
--- /dev/null
+++ b/docs/content/docs/agent-spec/generative-ui/index.mdx
@@ -0,0 +1,42 @@
+---
+title: Generative UI
+icon: "lucide/Paintbrush"
+description: Render your agent's behavior with custom UI components.
+---
+import { ServerIcon, SquareMousePointerIcon, BotIcon } from "lucide-react";
+
+
+
+
+
+## What is Generative UI?
+
+Generative UI lets you render your agent's state, progress, outputs, and tool calls with custom UI components in real-time. It bridges the gap between AI
+agents and user interfaces. As your Agent Spec agent processes information and makes decisions, you can render custom UI components that:
+
+- Show loading states and progress indicators
+- Display structured data in tables, cards, or charts
+- Create interactive elements for user input
+
+## How can I use this?
+
+To get started, you first need to decide what is going to be backing your generative UI. Currently, there are two main variants of Generative UI with CopilotKit for Agent Spec.
+
+
+ }
+ title="Backend Tools"
+ description="Render your agent's tool calls with custom UI components"
+ href="/agent-spec/generative-ui/backend-tools"
+ />
+ }
+ title="Frontend Tools"
+ description="Provide your agent with client-side tools to show custom components and drive the UI."
+ href="/agent-spec/generative-ui/frontend-tools"
+ />
+
diff --git a/docs/content/docs/agent-spec/generative-ui/meta.json b/docs/content/docs/agent-spec/generative-ui/meta.json
new file mode 100644
index 0000000000..1434b4f463
--- /dev/null
+++ b/docs/content/docs/agent-spec/generative-ui/meta.json
@@ -0,0 +1,6 @@
+{
+ "title": "Generative UI",
+ "icon": "lucide/Paintbrush",
+ "defaultOpen": true,
+ "pages": ["backend-tools", "frontend-tools"]
+}
diff --git a/docs/content/docs/agent-spec/human-in-the-loop.mdx b/docs/content/docs/agent-spec/human-in-the-loop.mdx
new file mode 100644
index 0000000000..ca4c837725
--- /dev/null
+++ b/docs/content/docs/agent-spec/human-in-the-loop.mdx
@@ -0,0 +1,117 @@
+---
+title: Human-in-the-Loop
+icon: "lucide/Wrench"
+description: Create frontend tools and use them within your Agent Spec AI agent for human-in-the-loop interactions.
+---
+import InstallSDKSnippet from "@/snippets/install-sdk.mdx"
+import RunAndConnect from "@/snippets/integrations/agent-spec/run-and-connect.mdx"
+import { IframeSwitcherGroup } from "@/components/content"
+
+
+
+## What is this?
+
+Frontend tools enable you to define client-side functions that your Agent Spec agent can invoke, with execution happening entirely in the user's browser. When your agent calls a frontend tool,
+the logic runs on the client side, giving you direct access to the frontend environment.
+
+This can be utilized to let [your agent control the UI](/frontend-actions), [generative UI](/agent-spec/generative-ui/frontend-tools), or for Human-in-the-loop interactions.
+
+In this guide, we cover the use of frontend tools for Human-in-the-loop.
+
+## When should I use this?
+
+Use frontend tools when you need your agent to interact with client-side primitives such as:
+- Reading or modifying React component state
+- Accessing browser APIs like localStorage, sessionStorage, or cookies
+- Triggering UI updates or animations
+- Interacting with third-party frontend libraries
+- Performing actions that require the user's immediate browser context
+
+## Implementation
+
+
+
+ ### Run and connect your agent
+
+
+
+
+ ### Create a frontend human-in-the-loop tool
+
+ Frontend tools can be leveraged in a variety of ways. One of those ways is to have a human-in-the-loop flow where the response
+ of the tool is gated by a user's decision.
+
+ In this example we will simulate an "approval" flow for executing a command. First, use the `useHumanInTheLoop` hook to create a tool that
+ prompts the user for approval.
+
+ ```tsx title="page.tsx"
+ import { useHumanInTheLoop } from "@copilotkit/react-core" // [!code highlight]
+
+ export function Page() {
+ // ...
+
+ useHumanInTheLoop({
+ name: "offerOptions",
+ description: "Give the user a choice between two options and have them select one.",
+ parameters: [
+ {
+ name: "option_1",
+ type: "string",
+ description: "The first option",
+ required: true,
+ },
+ {
+ name: "option_2",
+ type: "string",
+ description: "The second option",
+ required: true,
+ },
+ ],
+ render: ({ args, respond }) => {
+ if (!respond) return <>>;
+ return (
+
+ {/* [!code highlight:2] */}
+
+
+
+ );
+ },
+ });
+
+ // ...
+ }
+ ```
+
+
+ ### Set up your agent
+
+ Human-in-the-loop tools are enabled through the concept of `ClientTool` in Agent Spec. Refer to the [Frontend Tools guide](/agent-spec/generative-ui/frontend-tools) for more details. In short, in your Agent Spec config, you need to provide the tool declarations, but the execution happens client-side (in your frontend).
+
+
+ ### Try it out!
+
+ You've now given your agent the ability to show the user two options and have them select one. The agent will then be aware of the user's choice and can use it in subsequent steps.
+
+ ```
+ Can you show me two good options for a restaurant name?
+ ```
+
+
diff --git a/docs/content/docs/agent-spec/index.mdx b/docs/content/docs/agent-spec/index.mdx
new file mode 100644
index 0000000000..b189cebcb2
--- /dev/null
+++ b/docs/content/docs/agent-spec/index.mdx
@@ -0,0 +1,88 @@
+---
+title: Overview
+icon: "custom/agentspecMark"
+description: Bring your Agent‑Spec agents to your users with CopilotKit via AG‑UI.
+hideHeader: true
+---
+import { customIcons } from "@/lib/icons/custom-icons";
+import { FrameworkOverview } from "@/components/content/landing-pages/framework-overview";
+
+}
+ header="Bring your Open Agent Spec agents to your users"
+ subheader="Give your Open Agent Spec agents real user-interactivity using CopilotKit and AG-UI. Build rich, interactive, agent-powered applications."
+ bannerVideo="https://cdn.copilotkit.ai/docs/copilotkit/videos/coagents/overview.mp4"
+ guideLink="/agent-spec/quickstart"
+ initCommand="npx copilotkit@latest init"
+ featuresLink="https://feature-viewer.copilotkit.ai/agent-spec-wayflow/feature/agentic_chat"
+ supportedFeatures={[
+ {
+ title: "Generative UI",
+ description: "Render your agent's state, progress, outputs, and tool calls with custom UI components in real-time. Bridges the gap between AI agents and user interfaces.",
+ documentationLink: "/agent-spec/generative-ui",
+ demoLink: "https://feature-viewer.copilotkit.ai/agent-spec-wayflow/feature/tool_based_generative_ui",
+ videoUrl: "https://cdn.copilotkit.ai/docs/copilotkit/videos/coagents/haiku.mp4"
+ },
+ {
+ title: "Human in the Loop",
+ description: "Empower users to guide agents at key checkpoints. Combine the best of AI and human judgment for more reliable and controllable agent behavior.",
+ documentationLink: "/agent-spec/human-in-the-loop",
+ demoLink: "https://examples-coagents-ai-travel-app.vercel.app/",
+ videoUrl: "https://cdn.copilotkit.ai/docs/copilotkit/images/coagents/human-in-the-loop-example.mp4"
+ }
+ ]}
+ architectureImage="https://cdn.copilotkit.ai/docs/copilotkit/images/generic-agui-architecture.png"
+ liveDemos={[
+ {
+ type: "saas",
+ title: "SaaS Copilot",
+ description: "A traditional SaaS application enhanced with AI agents. These copilots integrate seamlessly into existing workflows, providing intelligent assistance for specific business processes. Perfect for customer service, sales automation, project management, and domain-specific tasks where users need guided, step-by-step AI assistance.",
+ iframeUrl: "https://examples-coagents-ai-travel-app.vercel.app?copilotOpen=true"
+ },
+ {
+ type: "canvas",
+ title: "Canvas Copilot",
+ description: "An infinite canvas interface where users collaborate with AI agents in a spatial, visual environment. These copilots excel at research, brainstorming, content creation, and complex problem-solving where information needs to be organized, connected, and explored in a non-linear, creative way.",
+ iframeUrl: "https://examples-coagents-research-canvas-ui.vercel.app/"
+ }
+ ]}
+/>
+
+
+# Open Agent Spec + CopilotKit
+
+Bring your Agent Spec agents to an interactive UI using CopilotKit and AG‑UI. Use our Next.js starter to connect a CopilotKit UI to your Agent‑Spec FastAPI endpoint that streams AG‑UI events.
+
+## Quickstart
+
+```bash
+npx copilotkit@latest create -f agent-spec
+```
+
+Then set an endpoint for your backend (defaults to `http://localhost:8000/copilotkit`):
+
+```dotenv title=".env.local"
+COPILOTKIT_REMOTE_ENDPOINT=http://localhost:8000/copilotkit
+```
+
+Run your Agent Spec FastAPI server and start the Next.js app. You can use the example server at `ag-ui/integrations/agent-spec/python/examples/server.py`.
+
+## How it works
+
+- Backend: Your FastAPI endpoint (from the Agent Spec integration) emits AG‑UI SSE events.
+- Frontend: The Next.js template proxies requests to your backend using CopilotKit Runtime.
+- Protocol: AG‑UI spans/events power streaming text, tool calls and results, and run lifecycle.
+
+## Links
+
+- Next.js starter flag: `-f agent-spec`
+- Example FastAPI server: `ag-ui/integrations/agent-spec/python/examples/server.py`
+- Endpoint helper: `ag-ui/integrations/agent-spec/python/ag_ui_agentspec/endpoint.py`
+
+## Learn more
+
+- Agent Spec docs home: https://oracle.github.io/agent-spec/development/docs_home.html
+- Specification overview: https://oracle.github.io/agent-spec/development/agentspec/index.html
+- API reference: https://oracle.github.io/agent-spec/development/api/index.html
+- Reference sheet: https://oracle.github.io/agent-spec/development/misc/reference_sheet.html
diff --git a/docs/content/docs/agent-spec/langgraph.mdx b/docs/content/docs/agent-spec/langgraph.mdx
new file mode 100644
index 0000000000..0d70b0b582
--- /dev/null
+++ b/docs/content/docs/agent-spec/langgraph.mdx
@@ -0,0 +1,91 @@
+---
+title: LangGraph Integration
+description: Connect an Agent Spec (LangGraph) backend to CopilotKit via the AG‑UI endpoint and stream agent runs to the UI.
+icon: "lucide/Workflow"
+---
+
+import RunAndConnect from "@/snippets/integrations/agent-spec/run-and-connect.mdx";
+
+## What is this?
+
+Wire an Agent Spec agent backed by LangGraph to CopilotKit’s UI via the AG‑UI event protocol. You’ll run a FastAPI endpoint that emits AG‑UI events and point your Next.js app at it.
+
+Key pieces:
+- Backend endpoint: `ag-ui/integrations/agent-spec/python/ag_ui_agentspec/endpoint.py`
+- Example server: `ag-ui/integrations/agent-spec/python/examples/server.py`
+- Template UI: `npx copilotkit@latest create -f agent-spec`
+
+## When should I use this?
+
+Use this integration when you already have a LangGraph-based agent described by an Agent Spec and want a turnkey UI that streams assistant text, tool calls/results, and run lifecycle with minimal wiring.
+
+## Prerequisites
+
+- Python 3.9+
+- Node.js 20+
+- An Agent Spec file that targets a LangGraph runtime (JSON/YAML)
+
+## Steps
+
+### 1. Start the Agent Spec FastAPI server
+
+Use the provided example server and select the LangGraph runtime.
+
+```bash title="Start FastAPI (LangGraph)"
+export AGENT_SPEC_PATH=/absolute/path/to/your-agent-spec.json
+export AGENT_SPEC_RUNTIME=langgraph
+python ag-ui/integrations/agent-spec/python/examples/server.py
+```
+
+What it does:
+- Loads your Agent Spec from `AGENT_SPEC_PATH`.
+- Constructs an `AgentSpecAgent(runtime="langgraph")`.
+- Mounts the AG‑UI endpoint at `/copilotkit` using `add_agentspec_fastapi_endpoint(...)`.
+
+Endpoint implementation reference:
+
+```python title="ag-ui/integrations/agent-spec/python/ag_ui_agentspec/endpoint.py"
+def add_agentspec_fastapi_endpoint(app, agentspec_agent, path="/"):
+ @app.post(path)
+ async def agentic_chat_endpoint(input_data: RunAgentInput, request: Request):
+ # Bridges Agent‑Spec telemetry to AG‑UI events via EVENT_QUEUE and streams SSE
+ ...
+```
+
+### 2. Scaffold and connect the UI
+
+
+
+If you already have the starter, set your backend endpoint in `.env.local`:
+
+```dotenv title=".env.local"
+COPILOTKIT_REMOTE_ENDPOINT=http://localhost:8000/copilotkit
+```
+
+Then run the app (for example with `pnpm dev`) and open `http://localhost:3000`.
+
+## How it works
+
+- The Agent Spec adapter converts LangGraph callbacks into Agent‑Spec telemetry.
+- `AgUiSpanProcessor` translates spans/events into AG‑UI events and enqueues them onto a per‑request queue (`EVENT_QUEUE`).
+- The FastAPI endpoint drains that queue and streams SSE to the browser. CopilotKit consumes these to render:
+ - assistant text: `TEXT_MESSAGE_START/CONTENT/END`
+ - tool call lifecycle: `TOOL_CALL_START/ARGS/END`
+ - tool results: `TOOL_CALL_RESULT`
+ - run lifecycle: `RUN_STARTED/RUN_FINISHED`
+
+## Troubleshooting
+
+- Ensure `AGENT_SPEC_RUNTIME=langgraph` is set when starting the server.
+- The endpoint path must match your UI’s `COPILOTKIT_REMOTE_ENDPOINT` (default `/copilotkit`).
+- The endpoint asserts a queue is bound (no print fallback). If you get queue errors, check that requests go through the provided FastAPI route.
+
+## Next steps
+
+- Build richer UIs with agentic chat and generative UI.
+- Pass full chat history between turns. The adapter and processor handle `message_id` and tool‑call lifecycle for you.
+
+## Learn more
+
+- Agent Spec docs home: https://oracle.github.io/agent-spec/development/docs_home.html
+- Specification overview: https://oracle.github.io/agent-spec/development/agentspec/index.html
diff --git a/docs/content/docs/agent-spec/meta.json b/docs/content/docs/agent-spec/meta.json
new file mode 100644
index 0000000000..3e69c981b3
--- /dev/null
+++ b/docs/content/docs/agent-spec/meta.json
@@ -0,0 +1,22 @@
+{
+ "title": "Open Agent Spec",
+ "root": true,
+ "pages": [
+ "---Getting Started---",
+ "index",
+ "quickstart",
+ "vibe-coding-mcp",
+ "---Guides---",
+ "agentic-chat-ui",
+ "langgraph",
+ "wayflow",
+ "custom-look-and-feel",
+ "frontend-actions",
+ "generative-ui",
+ "human-in-the-loop",
+ "---Premium Features---",
+ "...premium",
+ "---Troubleshooting---",
+ "...troubleshooting"
+ ]
+}
diff --git a/docs/content/docs/agent-spec/premium/headless-ui.mdx b/docs/content/docs/agent-spec/premium/headless-ui.mdx
new file mode 100644
index 0000000000..de5fa9adcf
--- /dev/null
+++ b/docs/content/docs/agent-spec/premium/headless-ui.mdx
@@ -0,0 +1,8 @@
+---
+title: "Fully Headless UI"
+description: "Fully customize your Copilot's UI from the ground up using headless UI"
+icon: "lucide/Settings"
+---
+import HeadlessUI from "@/snippets/shared/guides/custom-look-and-feel/headless-ui.mdx";
+
+
\ No newline at end of file
diff --git a/docs/content/docs/agent-spec/premium/inspector.mdx b/docs/content/docs/agent-spec/premium/inspector.mdx
new file mode 100644
index 0000000000..c4cd53630b
--- /dev/null
+++ b/docs/content/docs/agent-spec/premium/inspector.mdx
@@ -0,0 +1,9 @@
+---
+title: Inspector
+icon: "lucide/SearchCheck"
+description: Inspector for debugging actions, readables, agent status, messages, and context.
+---
+
+import Inspector from "@/snippets/shared/premium/inspector.mdx";
+
+
diff --git a/docs/content/docs/agent-spec/premium/meta.json b/docs/content/docs/agent-spec/premium/meta.json
new file mode 100644
index 0000000000..076ce46d60
--- /dev/null
+++ b/docs/content/docs/agent-spec/premium/meta.json
@@ -0,0 +1,4 @@
+{
+ "title": "Premium Features",
+ "pages": ["overview", "headless-ui", "observability", "inspector"]
+}
diff --git a/docs/content/docs/agent-spec/premium/observability.mdx b/docs/content/docs/agent-spec/premium/observability.mdx
new file mode 100644
index 0000000000..6bf9a04026
--- /dev/null
+++ b/docs/content/docs/agent-spec/premium/observability.mdx
@@ -0,0 +1,9 @@
+---
+title: "Observability"
+description: "Monitor your CopilotKit application with comprehensive observability hooks. Understand user interactions, chat events, and system errors."
+icon: "lucide/Activity"
+---
+
+import Observability from "@/snippets/shared/premium/observability.mdx";
+
+
\ No newline at end of file
diff --git a/docs/content/docs/agent-spec/premium/overview.mdx b/docs/content/docs/agent-spec/premium/overview.mdx
new file mode 100644
index 0000000000..825d857944
--- /dev/null
+++ b/docs/content/docs/agent-spec/premium/overview.mdx
@@ -0,0 +1,9 @@
+---
+title: CopilotKit Premium
+icon: "lucide/Star"
+description: Premium features for CopilotKit.
+---
+
+import Overview from "@/snippets/shared/premium/overview.mdx";
+
+
\ No newline at end of file
diff --git a/docs/content/docs/agent-spec/quickstart.mdx b/docs/content/docs/agent-spec/quickstart.mdx
new file mode 100644
index 0000000000..de82557950
--- /dev/null
+++ b/docs/content/docs/agent-spec/quickstart.mdx
@@ -0,0 +1,55 @@
+---
+title: Quickstart
+description: Turn your Agent Spec agent into an agent‑native application in minutes.
+icon: "lucide/Play"
+hideTOC: true
+---
+
+## Prerequisites
+
+- Node.js 20+
+- Python 3.9+
+
+## 1) Scaffold the UI
+
+Start from our starter template:
+
+```bash
+npx copilotkit@latest create -f agent-spec
+```
+
+## 2) Run your Agent‑Spec server
+
+Use the FastAPI example or your own server with the Agent‑Spec endpoint mounted at `/copilotkit`:
+
+```bash title="ag-ui/integrations/agent-spec/python/examples/server.py"
+python server.py
+# Requires AGENT_SPEC_PATH pointing to an Agent‑Spec JSON/YAML file
+```
+
+## 3) Connect the UI to your server
+
+Set the endpoint in your Next.js app:
+
+```dotenv title=".env.local"
+COPILOTKIT_REMOTE_ENDPOINT=http://localhost:8000/copilotkit
+```
+
+## 4) Run Next.js
+
+```bash
+pnpm dev
+# or npm run dev / yarn dev / bun dev
+```
+
+Open http://localhost:3000 and start chatting with your agent.
+
+## Notes
+
+- The template uses CopilotKit Runtime to proxy to your FastAPI endpoint.
+- AG‑UI streaming covers text, tool calls, tool results, and run lifecycle.
+
+## Learn more
+
+- Agent Spec docs home: https://oracle.github.io/agent-spec/development/docs_home.html
+- Specification overview: https://oracle.github.io/agent-spec/development/agentspec/index.html
diff --git a/docs/content/docs/agent-spec/shared-state/index.mdx b/docs/content/docs/agent-spec/shared-state/index.mdx
new file mode 100644
index 0000000000..8a14231666
--- /dev/null
+++ b/docs/content/docs/agent-spec/shared-state/index.mdx
@@ -0,0 +1,12 @@
+---
+title: Shared State
+icon: "lucide/Repeat"
+description: Synchronize app and agent state in Agent Spec integrations.
+---
+
+Agent Spec agentic chat supports streaming text and tool events. For advanced shared state patterns, mirror what you surface as messages or tool calls until a dedicated state channel is available.
+
+## Learn more
+
+- Agent Spec docs home: https://oracle.github.io/agent-spec/development/docs_home.html
+- Reference sheet (formats): https://oracle.github.io/agent-spec/development/misc/reference_sheet.html
diff --git a/docs/content/docs/agent-spec/troubleshooting/common-issues.mdx b/docs/content/docs/agent-spec/troubleshooting/common-issues.mdx
new file mode 100644
index 0000000000..8074c11fc9
--- /dev/null
+++ b/docs/content/docs/agent-spec/troubleshooting/common-issues.mdx
@@ -0,0 +1,9 @@
+---
+title: Common Copilot Issues
+description: Common issues you may encounter when using Copilots.
+icon: "lucide/LifeBuoy"
+---
+
+import CommonIssues from "@/snippets/shared/troubleshooting/common-issues.mdx";
+
+
\ No newline at end of file
diff --git a/docs/content/docs/agent-spec/troubleshooting/error-debugging.mdx b/docs/content/docs/agent-spec/troubleshooting/error-debugging.mdx
new file mode 100644
index 0000000000..7e9c4ee7de
--- /dev/null
+++ b/docs/content/docs/agent-spec/troubleshooting/error-debugging.mdx
@@ -0,0 +1,9 @@
+---
+title: "Error Debugging & Observability"
+description: "Learn how to debug errors in CopilotKit with dev console and set up error observability for monitoring services."
+icon: "lucide/TriangleAlert"
+---
+
+import ErrorDebugging from "@/snippets/shared/troubleshooting/error-debugging.mdx";
+
+
\ No newline at end of file
diff --git a/docs/content/docs/agent-spec/troubleshooting/meta.json b/docs/content/docs/agent-spec/troubleshooting/meta.json
new file mode 100644
index 0000000000..15015c7b3a
--- /dev/null
+++ b/docs/content/docs/agent-spec/troubleshooting/meta.json
@@ -0,0 +1,8 @@
+{
+ "pages": [
+ "error-debugging",
+ "common-issues",
+ "migrate-to-1.10.X",
+ "migrate-to-1.8.2"
+ ]
+}
diff --git a/docs/content/docs/agent-spec/troubleshooting/migrate-to-1.10.X.mdx b/docs/content/docs/agent-spec/troubleshooting/migrate-to-1.10.X.mdx
new file mode 100644
index 0000000000..ea6825b308
--- /dev/null
+++ b/docs/content/docs/agent-spec/troubleshooting/migrate-to-1.10.X.mdx
@@ -0,0 +1,8 @@
+---
+title: Migrate to 1.10.X
+description: Migration guide for CopilotKit 1.10.X
+icon: "lucide/RefreshCw"
+---
+import MigrateTo1100 from "@/snippets/shared/troubleshooting/migrate-to-1.10.X.mdx";
+
+
\ No newline at end of file
diff --git a/docs/content/docs/agent-spec/troubleshooting/migrate-to-1.8.2.mdx b/docs/content/docs/agent-spec/troubleshooting/migrate-to-1.8.2.mdx
new file mode 100644
index 0000000000..7979baf226
--- /dev/null
+++ b/docs/content/docs/agent-spec/troubleshooting/migrate-to-1.8.2.mdx
@@ -0,0 +1,8 @@
+---
+title: Migrate to 1.8.2
+description: Migration guide for CopilotKit 1.8.2
+icon: "lucide/RefreshCw"
+---
+import MigrateTo182 from "@/snippets/shared/troubleshooting/migrate-to-1.8.2.mdx";
+
+
\ No newline at end of file
diff --git a/docs/content/docs/agent-spec/vibe-coding-mcp.mdx b/docs/content/docs/agent-spec/vibe-coding-mcp.mdx
new file mode 100644
index 0000000000..0578bb49a2
--- /dev/null
+++ b/docs/content/docs/agent-spec/vibe-coding-mcp.mdx
@@ -0,0 +1,8 @@
+---
+title: "Vibe Coding MCP"
+icon: "lucide/Code"
+description: "Use our MCP server to connect your Pydantic AI agents to CopilotKit."
+---
+import MCPSetup from "@/snippets/shared/guides/mcp-server-setup.mdx";
+
+
\ No newline at end of file
diff --git a/docs/content/docs/agent-spec/wayflow.mdx b/docs/content/docs/agent-spec/wayflow.mdx
new file mode 100644
index 0000000000..ee3a4fbd4e
--- /dev/null
+++ b/docs/content/docs/agent-spec/wayflow.mdx
@@ -0,0 +1,91 @@
+---
+title: WayFlow Integration
+description: Connect an Agent Spec (WayFlow) backend to CopilotKit via the AG‑UI endpoint and stream agent runs to the UI.
+icon: "lucide/Gauge"
+---
+
+import RunAndConnect from "@/snippets/integrations/agent-spec/run-and-connect.mdx";
+
+## What is this?
+
+Wire an Agent Spec agent backed by WayFlow to CopilotKit’s UI via the AG‑UI event protocol. You’ll run a FastAPI endpoint that emits AG‑UI events and point your Next.js app at it.
+
+Key pieces:
+- Backend endpoint: `ag-ui/integrations/agent-spec/python/ag_ui_agentspec/endpoint.py`
+- Example server: `ag-ui/integrations/agent-spec/python/examples/server.py`
+- Template UI: `npx copilotkit@latest create -f agent-spec`
+
+## When should I use this?
+
+Use this integration when you already have a WayFlow-based agent described by an Agent Spec and want a turnkey UI that streams assistant text, tool calls/results, and run lifecycle with minimal wiring.
+
+## Prerequisites
+
+- Python 3.9+
+- Node.js 20+
+- An Agent Spec file that targets a WayFlow runtime (JSON/YAML)
+
+## Steps
+
+### 1. Start the Agent Spec FastAPI server
+
+Use the provided example server and select the WayFlow runtime.
+
+```bash title="Start FastAPI (WayFlow)"
+export AGENT_SPEC_PATH=/absolute/path/to/your-agent-spec.json
+export AGENT_SPEC_RUNTIME=wayflow
+python ag-ui/integrations/agent-spec/python/examples/server.py
+```
+
+What it does:
+- Loads your Agent Spec from `AGENT_SPEC_PATH`.
+- Constructs an `AgentSpecAgent(runtime="wayflow")`.
+- Mounts the AG‑UI endpoint at `/copilotkit` using `add_agentspec_fastapi_endpoint(...)`.
+
+Endpoint implementation reference:
+
+```python title="ag-ui/integrations/agent-spec/python/ag_ui_agentspec/endpoint.py"
+def add_agentspec_fastapi_endpoint(app, agentspec_agent, path="/"):
+ @app.post(path)
+ async def agentic_chat_endpoint(input_data: RunAgentInput, request: Request):
+ # Bridges Agent‑Spec telemetry to AG‑UI events via EVENT_QUEUE and streams SSE
+ ...
+```
+
+### 2. Scaffold and connect the UI
+
+
+
+If you already have the starter, set your backend endpoint in `.env.local`:
+
+```dotenv title=".env.local"
+COPILOTKIT_REMOTE_ENDPOINT=http://localhost:8000/copilotkit
+```
+
+Then run the app (for example with `pnpm dev`) and open `http://localhost:3000`.
+
+## How it works
+
+- The Agent Spec adapter and processors translate WayFlow runs into AG‑UI events.
+- `AgUiSpanProcessor` enqueues events onto a per‑request queue (`EVENT_QUEUE`).
+- The FastAPI endpoint drains that queue and streams SSE to the browser. CopilotKit consumes these to render:
+ - assistant text: `TEXT_MESSAGE_START/CONTENT/END`
+ - tool call lifecycle: `TOOL_CALL_START/ARGS/END`
+ - tool results: `TOOL_CALL_RESULT`
+ - run lifecycle: `RUN_STARTED/RUN_FINISHED`
+
+## Troubleshooting
+
+- Ensure `AGENT_SPEC_RUNTIME=wayflow` is set when starting the server.
+- The endpoint path must match your UI’s `COPILOTKIT_REMOTE_ENDPOINT` (default `/copilotkit`).
+- The endpoint asserts a queue is bound. If you get queue errors, check that requests go through the provided FastAPI route.
+
+## Next steps
+
+- Build richer UIs with agentic chat and generative UI.
+- For advanced usage, see the WayFlow docs and Agent Spec telemetry notes in the repo.
+
+## Learn more
+
+- Agent Spec docs home: https://oracle.github.io/agent-spec/development/docs_home.html
+- Specification overview: https://oracle.github.io/agent-spec/development/agentspec/index.html
diff --git a/docs/content/docs/agno/(other)/contributing/code-contributions/index.mdx b/docs/content/docs/agno/(other)/contributing/code-contributions/index.mdx
index 16ef161e6c..f20ae7e49f 100644
--- a/docs/content/docs/agno/(other)/contributing/code-contributions/index.mdx
+++ b/docs/content/docs/agno/(other)/contributing/code-contributions/index.mdx
@@ -22,7 +22,7 @@ This guide will help you get started as smoothly as possible.
Then, clone your fork to your local machine:
```bash
git clone https://github.com//CopilotKit
- cd CopilotKit/CopilotKit
+ cd CopilotKit/src/v1.x
```
diff --git a/docs/content/docs/agno/generative-ui/meta.json b/docs/content/docs/agno/generative-ui/meta.json
index c7ec6a51f1..1434b4f463 100644
--- a/docs/content/docs/agno/generative-ui/meta.json
+++ b/docs/content/docs/agno/generative-ui/meta.json
@@ -1,5 +1,6 @@
{
"title": "Generative UI",
+ "icon": "lucide/Paintbrush",
"defaultOpen": true,
"pages": ["backend-tools", "frontend-tools"]
}
diff --git a/docs/content/docs/aws-strands/(other)/contributing/code-contributions/index.mdx b/docs/content/docs/aws-strands/(other)/contributing/code-contributions/index.mdx
index 16ef161e6c..f20ae7e49f 100644
--- a/docs/content/docs/aws-strands/(other)/contributing/code-contributions/index.mdx
+++ b/docs/content/docs/aws-strands/(other)/contributing/code-contributions/index.mdx
@@ -22,7 +22,7 @@ This guide will help you get started as smoothly as possible.
Then, clone your fork to your local machine:
```bash
git clone https://github.com//CopilotKit
- cd CopilotKit/CopilotKit
+ cd CopilotKit/src/v1.x
```
diff --git a/docs/content/docs/aws-strands/generative-ui/meta.json b/docs/content/docs/aws-strands/generative-ui/meta.json
index 33fb211de6..bb92117e49 100644
--- a/docs/content/docs/aws-strands/generative-ui/meta.json
+++ b/docs/content/docs/aws-strands/generative-ui/meta.json
@@ -1,6 +1,6 @@
{
"title": "Generative UI",
- "defaultOpen": true,
"icon": "lucide/Paintbrush",
+ "defaultOpen": true,
"pages": ["backend-tools", "frontend-tools", "agentic"]
}
diff --git a/docs/content/docs/crewai-crews/(other)/contributing/code-contributions/index.mdx b/docs/content/docs/crewai-crews/(other)/contributing/code-contributions/index.mdx
index 16ef161e6c..f20ae7e49f 100644
--- a/docs/content/docs/crewai-crews/(other)/contributing/code-contributions/index.mdx
+++ b/docs/content/docs/crewai-crews/(other)/contributing/code-contributions/index.mdx
@@ -22,7 +22,7 @@ This guide will help you get started as smoothly as possible.
Then, clone your fork to your local machine:
```bash
git clone https://github.com//CopilotKit
- cd CopilotKit/CopilotKit
+ cd CopilotKit/src/v1.x
```
diff --git a/docs/content/docs/crewai-flows/(other)/contributing/code-contributions/index.mdx b/docs/content/docs/crewai-flows/(other)/contributing/code-contributions/index.mdx
index 16ef161e6c..f20ae7e49f 100644
--- a/docs/content/docs/crewai-flows/(other)/contributing/code-contributions/index.mdx
+++ b/docs/content/docs/crewai-flows/(other)/contributing/code-contributions/index.mdx
@@ -22,7 +22,7 @@ This guide will help you get started as smoothly as possible.
Then, clone your fork to your local machine:
```bash
git clone https://github.com//CopilotKit
- cd CopilotKit/CopilotKit
+ cd CopilotKit/src/v1.x
```
diff --git a/docs/content/docs/direct-to-llm/guides/custom-ai-assistant-behavior.mdx b/docs/content/docs/direct-to-llm/guides/custom-ai-assistant-behavior.mdx
index 879d0462da..9e8b51fca3 100644
--- a/docs/content/docs/direct-to-llm/guides/custom-ai-assistant-behavior.mdx
+++ b/docs/content/docs/direct-to-llm/guides/custom-ai-assistant-behavior.mdx
@@ -99,7 +99,7 @@ It can be customized for **Copilot UI** as well as **programmatically**:
### Overwriting the default system message
-For cases requiring complete control over the system message, you can use the `makeSystemMessage` function. We highly recommend reading CopilotKit's default system message before deciding to overwrite it, which can be found [here](https://github.com/CopilotKit/CopilotKit/blob/e48a34a66bb4dfd210e93dc41eee7d0f22d1a0c4/CopilotKit/packages/react-core/src/hooks/use-copilot-chat.ts#L240-L258).
+For cases requiring complete control over the system message, you can use the `makeSystemMessage` function. We highly recommend reading CopilotKit's default system message before deciding to overwrite it, which can be found [here](https://github.com/CopilotKit/CopilotKit/blob/e48a34a66bb4dfd210e93dc41eee7d0f22d1a0c4/src/v1.x/packages/react-core/src/hooks/use-copilot-chat.ts#L240-L258).
This approach is **not recommended** as it may interfere with more advanced optimizations made by CopilotKit. **Only use this approach if the other options are not enough.**
diff --git a/docs/content/docs/langgraph/(other)/contributing/code-contributions/index.mdx b/docs/content/docs/langgraph/(other)/contributing/code-contributions/index.mdx
index 16ef161e6c..f20ae7e49f 100644
--- a/docs/content/docs/langgraph/(other)/contributing/code-contributions/index.mdx
+++ b/docs/content/docs/langgraph/(other)/contributing/code-contributions/index.mdx
@@ -22,7 +22,7 @@ This guide will help you get started as smoothly as possible.
Then, clone your fork to your local machine:
```bash
git clone https://github.com//CopilotKit
- cd CopilotKit/CopilotKit
+ cd CopilotKit/src/v1.x
```
diff --git a/docs/content/docs/langgraph/generative-ui/meta.json b/docs/content/docs/langgraph/generative-ui/meta.json
index 8f18138594..54cc3c53e0 100644
--- a/docs/content/docs/langgraph/generative-ui/meta.json
+++ b/docs/content/docs/langgraph/generative-ui/meta.json
@@ -1,4 +1,5 @@
{
"title": "Generative UI",
+ "icon": "lucide/Paintbrush",
"pages": ["backend-tools", "frontend-tools", "agentic"]
}
diff --git a/docs/content/docs/llamaindex/generative-ui/meta.json b/docs/content/docs/llamaindex/generative-ui/meta.json
index f4d74dd7dd..bb92117e49 100644
--- a/docs/content/docs/llamaindex/generative-ui/meta.json
+++ b/docs/content/docs/llamaindex/generative-ui/meta.json
@@ -1,5 +1,6 @@
{
"title": "Generative UI",
+ "icon": "lucide/Paintbrush",
"defaultOpen": true,
"pages": ["backend-tools", "frontend-tools", "agentic"]
}
diff --git a/docs/content/docs/mastra/(other)/contributing/code-contributions/index.mdx b/docs/content/docs/mastra/(other)/contributing/code-contributions/index.mdx
index 16ef161e6c..f20ae7e49f 100644
--- a/docs/content/docs/mastra/(other)/contributing/code-contributions/index.mdx
+++ b/docs/content/docs/mastra/(other)/contributing/code-contributions/index.mdx
@@ -22,7 +22,7 @@ This guide will help you get started as smoothly as possible.
Then, clone your fork to your local machine:
```bash
git clone https://github.com//CopilotKit
- cd CopilotKit/CopilotKit
+ cd CopilotKit/src/v1.x
```
diff --git a/docs/content/docs/mastra/generative-ui/meta.json b/docs/content/docs/mastra/generative-ui/meta.json
index d47fc3c528..1434b4f463 100644
--- a/docs/content/docs/mastra/generative-ui/meta.json
+++ b/docs/content/docs/mastra/generative-ui/meta.json
@@ -1,6 +1,6 @@
{
"title": "Generative UI",
- "icon": "lucide/LayoutDashboard",
+ "icon": "lucide/Paintbrush",
"defaultOpen": true,
"pages": ["backend-tools", "frontend-tools"]
}
diff --git a/docs/content/docs/meta.json b/docs/content/docs/meta.json
index acf5fc2f67..ef29f3db33 100644
--- a/docs/content/docs/meta.json
+++ b/docs/content/docs/meta.json
@@ -10,6 +10,7 @@
"microsoft-agent-framework",
"aws-strands",
"direct-to-llm",
+ "agent-spec",
"langgraph",
"ag2",
"agno",
diff --git a/docs/content/docs/microsoft-agent-framework/(other)/contributing/code-contributions/index.mdx b/docs/content/docs/microsoft-agent-framework/(other)/contributing/code-contributions/index.mdx
index 1134fc0b63..3ea706fcb8 100644
--- a/docs/content/docs/microsoft-agent-framework/(other)/contributing/code-contributions/index.mdx
+++ b/docs/content/docs/microsoft-agent-framework/(other)/contributing/code-contributions/index.mdx
@@ -22,7 +22,7 @@ This guide will help you get started as smoothly as possible.
Then, clone your fork to your local machine:
```bash
git clone https://github.com//CopilotKit
- cd CopilotKit/CopilotKit
+ cd CopilotKit/src/v1.x
```
diff --git a/docs/content/docs/microsoft-agent-framework/generative-ui/meta.json b/docs/content/docs/microsoft-agent-framework/generative-ui/meta.json
index 8f18138594..54cc3c53e0 100644
--- a/docs/content/docs/microsoft-agent-framework/generative-ui/meta.json
+++ b/docs/content/docs/microsoft-agent-framework/generative-ui/meta.json
@@ -1,4 +1,5 @@
{
"title": "Generative UI",
+ "icon": "lucide/Paintbrush",
"pages": ["backend-tools", "frontend-tools", "agentic"]
}
diff --git a/docs/content/docs/pydantic-ai/generative-ui/meta.json b/docs/content/docs/pydantic-ai/generative-ui/meta.json
index f4d74dd7dd..bb92117e49 100644
--- a/docs/content/docs/pydantic-ai/generative-ui/meta.json
+++ b/docs/content/docs/pydantic-ai/generative-ui/meta.json
@@ -1,5 +1,6 @@
{
"title": "Generative UI",
+ "icon": "lucide/Paintbrush",
"defaultOpen": true,
"pages": ["backend-tools", "frontend-tools", "agentic"]
}
diff --git a/docs/content/docs/reference/classes/CopilotRuntime.mdx b/docs/content/docs/reference/classes/CopilotRuntime.mdx
index e34e470115..4a0eb1b2c3 100644
--- a/docs/content/docs/reference/classes/CopilotRuntime.mdx
+++ b/docs/content/docs/reference/classes/CopilotRuntime.mdx
@@ -7,7 +7,7 @@ description: "Copilot Runtime is the back-end component of CopilotKit, enabling
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/runtime/src/lib/runtime/copilot-runtime.ts
+ * src/v1.x/packages/runtime/src/lib/runtime/copilot-runtime.ts
*/
}
diff --git a/docs/content/docs/reference/classes/CopilotTask.mdx b/docs/content/docs/reference/classes/CopilotTask.mdx
index c5ef31e06e..fdedd24939 100644
--- a/docs/content/docs/reference/classes/CopilotTask.mdx
+++ b/docs/content/docs/reference/classes/CopilotTask.mdx
@@ -7,7 +7,7 @@ description: "CopilotTask is used to execute one-off tasks, for example on butto
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/react-core/src/lib/copilot-task.ts
+ * src/v1.x/packages/react-core/src/lib/copilot-task.ts
*/
}
This class is used to execute one-off tasks, for example on button press. It can use the context available via [useCopilotReadable](/reference/hooks/useCopilotReadable) and the actions provided by [useCopilotAction](/reference/hooks/useCopilotAction), or you can provide your own context and actions.
@@ -54,7 +54,7 @@ export function MyComponent() {
}
```
-Have a look at the [Presentation Example App](https://github.com/CopilotKit/CopilotKit/blob/main/CopilotKit/examples/next-openai/src/app/presentation/page.tsx) for a more complete example.
+Have a look at the [Presentation Example App](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/examples/next-openai/src/app/presentation/page.tsx) for a more complete example.
## Constructor Parameters
diff --git a/docs/content/docs/reference/classes/llm-adapters/AnthropicAdapter.mdx b/docs/content/docs/reference/classes/llm-adapters/AnthropicAdapter.mdx
index 62a56395d9..cd7be24ced 100644
--- a/docs/content/docs/reference/classes/llm-adapters/AnthropicAdapter.mdx
+++ b/docs/content/docs/reference/classes/llm-adapters/AnthropicAdapter.mdx
@@ -7,7 +7,7 @@ description: "Copilot Runtime adapter for Anthropic."
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/runtime/src/service-adapters/anthropic/anthropic-adapter.ts
+ * src/v1.x/packages/runtime/src/service-adapters/anthropic/anthropic-adapter.ts
*/
}
Copilot Runtime adapter for Anthropic.
diff --git a/docs/content/docs/reference/classes/llm-adapters/GoogleGenerativeAIAdapter.mdx b/docs/content/docs/reference/classes/llm-adapters/GoogleGenerativeAIAdapter.mdx
index e33cd3afde..e4acd75212 100644
--- a/docs/content/docs/reference/classes/llm-adapters/GoogleGenerativeAIAdapter.mdx
+++ b/docs/content/docs/reference/classes/llm-adapters/GoogleGenerativeAIAdapter.mdx
@@ -7,7 +7,7 @@ description: "Copilot Runtime adapter for Google Generative AI (e.g. Gemini)."
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/runtime/src/service-adapters/google/google-genai-adapter.ts
+ * src/v1.x/packages/runtime/src/service-adapters/google/google-genai-adapter.ts
*/
}
Copilot Runtime adapter for Google Generative AI (e.g. Gemini).
diff --git a/docs/content/docs/reference/classes/llm-adapters/GroqAdapter.mdx b/docs/content/docs/reference/classes/llm-adapters/GroqAdapter.mdx
index 22c7e63fe7..6f303df5ce 100644
--- a/docs/content/docs/reference/classes/llm-adapters/GroqAdapter.mdx
+++ b/docs/content/docs/reference/classes/llm-adapters/GroqAdapter.mdx
@@ -7,7 +7,7 @@ description: "Copilot Runtime adapter for Groq."
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/runtime/src/service-adapters/groq/groq-adapter.ts
+ * src/v1.x/packages/runtime/src/service-adapters/groq/groq-adapter.ts
*/
}
Copilot Runtime adapter for Groq.
diff --git a/docs/content/docs/reference/classes/llm-adapters/LangChainAdapter.mdx b/docs/content/docs/reference/classes/llm-adapters/LangChainAdapter.mdx
index 90dd29a190..49538f5cd7 100644
--- a/docs/content/docs/reference/classes/llm-adapters/LangChainAdapter.mdx
+++ b/docs/content/docs/reference/classes/llm-adapters/LangChainAdapter.mdx
@@ -7,7 +7,7 @@ description: "Copilot Runtime adapter for LangChain."
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/runtime/src/service-adapters/langchain/langchain-adapter.ts
+ * src/v1.x/packages/runtime/src/service-adapters/langchain/langchain-adapter.ts
*/
}
Copilot Runtime adapter for LangChain.
diff --git a/docs/content/docs/reference/classes/llm-adapters/OpenAIAdapter.mdx b/docs/content/docs/reference/classes/llm-adapters/OpenAIAdapter.mdx
index d446dee28e..aec381962f 100644
--- a/docs/content/docs/reference/classes/llm-adapters/OpenAIAdapter.mdx
+++ b/docs/content/docs/reference/classes/llm-adapters/OpenAIAdapter.mdx
@@ -7,7 +7,7 @@ description: "Copilot Runtime adapter for OpenAI."
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/runtime/src/service-adapters/openai/openai-adapter.ts
+ * src/v1.x/packages/runtime/src/service-adapters/openai/openai-adapter.ts
*/
}
Copilot Runtime adapter for OpenAI.
diff --git a/docs/content/docs/reference/classes/llm-adapters/OpenAIAssistantAdapter.mdx b/docs/content/docs/reference/classes/llm-adapters/OpenAIAssistantAdapter.mdx
index 34931bae42..371003302a 100644
--- a/docs/content/docs/reference/classes/llm-adapters/OpenAIAssistantAdapter.mdx
+++ b/docs/content/docs/reference/classes/llm-adapters/OpenAIAssistantAdapter.mdx
@@ -7,7 +7,7 @@ description: "Copilot Runtime adapter for OpenAI Assistant API."
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/runtime/src/service-adapters/openai/openai-assistant-adapter.ts
+ * src/v1.x/packages/runtime/src/service-adapters/openai/openai-assistant-adapter.ts
*/
}
Copilot Runtime adapter for the OpenAI Assistant API.
diff --git a/docs/content/docs/reference/components/CopilotKit.mdx b/docs/content/docs/reference/components/CopilotKit.mdx
index 3f61af6e4f..54e15de876 100644
--- a/docs/content/docs/reference/components/CopilotKit.mdx
+++ b/docs/content/docs/reference/components/CopilotKit.mdx
@@ -7,7 +7,7 @@ description: "The CopilotKit provider component, wrapping your application."
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/react-core/src/components/copilot-provider/copilotkit.tsx
+ * src/v1.x/packages/react-core/src/components/copilot-provider/copilotkit.tsx
*/
}
This component will typically wrap your entire application (or a sub-tree of your application where you want to have a copilot). It provides the copilot context to all other components and hooks.
diff --git a/docs/content/docs/reference/components/CopilotTextarea.mdx b/docs/content/docs/reference/components/CopilotTextarea.mdx
index 26db53883f..2944bc76f8 100644
--- a/docs/content/docs/reference/components/CopilotTextarea.mdx
+++ b/docs/content/docs/reference/components/CopilotTextarea.mdx
@@ -7,7 +7,7 @@ description: "An AI-powered textarea component for your application, which serve
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/react-textarea/src/components/copilot-textarea/copilot-textarea.tsx
+ * src/v1.x/packages/react-textarea/src/components/copilot-textarea/copilot-textarea.tsx
*/
}
@@ -133,7 +133,7 @@ The shortcut to use to open the editor popover window. Default is `"Cmd-k"`.
Configuration settings for the autosuggestions feature.
- For full reference, [check the interface on GitHub](https://github.com/CopilotKit/CopilotKit/blob/main/CopilotKit/packages/react-textarea/src/types/base/base-copilot-textarea-props.tsx#L8).
+ For full reference, [check the interface on GitHub](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/packages/react-textarea/src/types/base/base-copilot-textarea-props.tsx#L8).
The purpose of the text area in plain text.
@@ -147,10 +147,10 @@ Configuration settings for the autosuggestions feature.
NOTE: You must provide specify at least one of `suggestionsApiConfig` or `insertionApiConfig`.
- For full reference, please [click here](https://github.com/CopilotKit/CopilotKit/blob/main/CopilotKit/packages/react-textarea/src/types/autosuggestions-config/suggestions-api-config.tsx#L4).
+ For full reference, please [click here](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/packages/react-textarea/src/types/autosuggestions-config/suggestions-api-config.tsx#L4).
- For full reference, please [click here](https://github.com/CopilotKit/CopilotKit/blob/main/CopilotKit/packages/react-textarea/src/types/autosuggestions-config/insertions-api-config.tsx#L4).
+ For full reference, please [click here](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/packages/react-textarea/src/types/autosuggestions-config/insertions-api-config.tsx#L4).
diff --git a/docs/content/docs/reference/components/chat/CopilotChat.mdx b/docs/content/docs/reference/components/chat/CopilotChat.mdx
index cb1d517a55..e63140f957 100644
--- a/docs/content/docs/reference/components/chat/CopilotChat.mdx
+++ b/docs/content/docs/reference/components/chat/CopilotChat.mdx
@@ -7,7 +7,7 @@ description: "The CopilotChat component, providing a chat interface for interact
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/react-ui/src/components/chat/Chat.tsx
+ * src/v1.x/packages/react-ui/src/components/chat/Chat.tsx
*/
}
diff --git a/docs/content/docs/reference/components/chat/CopilotPopup.mdx b/docs/content/docs/reference/components/chat/CopilotPopup.mdx
index eb93d7999b..a15500d960 100644
--- a/docs/content/docs/reference/components/chat/CopilotPopup.mdx
+++ b/docs/content/docs/reference/components/chat/CopilotPopup.mdx
@@ -7,7 +7,7 @@ description: "The CopilotPopup component, providing a popup interface for intera
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/react-ui/src/components/chat/Popup.tsx
+ * src/v1.x/packages/react-ui/src/components/chat/Popup.tsx
*/
}
diff --git a/docs/content/docs/reference/components/chat/CopilotSidebar.mdx b/docs/content/docs/reference/components/chat/CopilotSidebar.mdx
index f7938cb9fe..20074a4cfe 100644
--- a/docs/content/docs/reference/components/chat/CopilotSidebar.mdx
+++ b/docs/content/docs/reference/components/chat/CopilotSidebar.mdx
@@ -7,7 +7,7 @@ description: "The CopilotSidebar component, providing a sidebar interface for in
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/react-ui/src/components/chat/Sidebar.tsx
+ * src/v1.x/packages/react-ui/src/components/chat/Sidebar.tsx
*/
}
diff --git a/docs/content/docs/reference/hooks/useCoAgent.mdx b/docs/content/docs/reference/hooks/useCoAgent.mdx
index ef43685b06..b8c487f822 100644
--- a/docs/content/docs/reference/hooks/useCoAgent.mdx
+++ b/docs/content/docs/reference/hooks/useCoAgent.mdx
@@ -7,7 +7,7 @@ description: "The useCoAgent hook allows you to share state bidirectionally betw
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/react-core/src/hooks/use-coagent.ts
+ * src/v1.x/packages/react-core/src/hooks/use-coagent.ts
*/
}
diff --git a/docs/content/docs/reference/hooks/useCoAgentStateRender.mdx b/docs/content/docs/reference/hooks/useCoAgentStateRender.mdx
index 1cc8be43d9..270d5a8deb 100644
--- a/docs/content/docs/reference/hooks/useCoAgentStateRender.mdx
+++ b/docs/content/docs/reference/hooks/useCoAgentStateRender.mdx
@@ -7,7 +7,7 @@ description: "The useCoAgentStateRender hook allows you to render the state of t
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/react-core/src/hooks/use-coagent-state-render.ts
+ * src/v1.x/packages/react-core/src/hooks/use-coagent-state-render.ts
*/
}
The useCoAgentStateRender hook allows you to render UI or text based components on a Agentic Copilot's state in the chat.
diff --git a/docs/content/docs/reference/hooks/useCopilotAdditionalInstructions.mdx b/docs/content/docs/reference/hooks/useCopilotAdditionalInstructions.mdx
index 899eb9be62..db3d332d2a 100644
--- a/docs/content/docs/reference/hooks/useCopilotAdditionalInstructions.mdx
+++ b/docs/content/docs/reference/hooks/useCopilotAdditionalInstructions.mdx
@@ -7,7 +7,7 @@ description: "The useCopilotAdditionalInstructions hook allows you to provide ad
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/react-core/src/hooks/use-copilot-additional-instructions.ts
+ * src/v1.x/packages/react-core/src/hooks/use-copilot-additional-instructions.ts
*/
}
`useCopilotAdditionalInstructions` is a React hook that provides additional instructions
diff --git a/docs/content/docs/reference/hooks/useCopilotChat.mdx b/docs/content/docs/reference/hooks/useCopilotChat.mdx
index 2bb25aac0b..44730f8ee1 100644
--- a/docs/content/docs/reference/hooks/useCopilotChat.mdx
+++ b/docs/content/docs/reference/hooks/useCopilotChat.mdx
@@ -6,7 +6,7 @@ title: "useCopilotChat"
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/react-core/src/hooks/use-copilot-chat.ts
+ * src/v1.x/packages/react-core/src/hooks/use-copilot-chat.ts
*/
}
`useCopilotChat` is a lightweight React hook for headless chat interactions.
diff --git a/docs/content/docs/reference/hooks/useCopilotChatHeadless_c.mdx b/docs/content/docs/reference/hooks/useCopilotChatHeadless_c.mdx
index cc0958917a..704d22502b 100644
--- a/docs/content/docs/reference/hooks/useCopilotChatHeadless_c.mdx
+++ b/docs/content/docs/reference/hooks/useCopilotChatHeadless_c.mdx
@@ -6,7 +6,7 @@ title: "useCopilotChatHeadless_c"
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/react-core/src/hooks/use-copilot-chat-headless_c.ts
+ * src/v1.x/packages/react-core/src/hooks/use-copilot-chat-headless_c.ts
*/
}
`useCopilotChatHeadless_c` is for building fully custom UI (headless UI) implementations.
diff --git a/docs/content/docs/reference/hooks/useCopilotChatSuggestions.mdx b/docs/content/docs/reference/hooks/useCopilotChatSuggestions.mdx
index b1403550f4..6164f9171d 100644
--- a/docs/content/docs/reference/hooks/useCopilotChatSuggestions.mdx
+++ b/docs/content/docs/reference/hooks/useCopilotChatSuggestions.mdx
@@ -7,7 +7,7 @@ description: "The useCopilotChatSuggestions hook generates suggestions in the ch
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/react-ui/src/hooks/use-copilot-chat-suggestions.tsx
+ * src/v1.x/packages/react-ui/src/hooks/use-copilot-chat-suggestions.tsx
*/
}
diff --git a/docs/content/docs/reference/hooks/useCopilotReadable.mdx b/docs/content/docs/reference/hooks/useCopilotReadable.mdx
index 97a79d2f6b..69ae137a8e 100644
--- a/docs/content/docs/reference/hooks/useCopilotReadable.mdx
+++ b/docs/content/docs/reference/hooks/useCopilotReadable.mdx
@@ -7,7 +7,7 @@ description: "The useCopilotReadable hook allows you to provide knowledge to you
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/react-core/src/hooks/use-copilot-readable.ts
+ * src/v1.x/packages/react-core/src/hooks/use-copilot-readable.ts
*/
}
`useCopilotReadable` is a React hook that provides app-state and other information
diff --git a/docs/content/docs/reference/sdk/js/LangGraph.mdx b/docs/content/docs/reference/sdk/js/LangGraph.mdx
index aa3f0f6e9c..d46c7e866b 100644
--- a/docs/content/docs/reference/sdk/js/LangGraph.mdx
+++ b/docs/content/docs/reference/sdk/js/LangGraph.mdx
@@ -7,7 +7,7 @@ description: "The CopilotKit LangGraph SDK for JavaScript allows you to build an
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/packages/sdk-js/src/langgraph.ts
+ * src/v1.x/packages/sdk-js/src/langgraph.ts
*/
}
## copilotkitCustomizeConfig
diff --git a/docs/content/docs/reference/sdk/python/CrewAI.mdx b/docs/content/docs/reference/sdk/python/CrewAI.mdx
index d2bb46fede..374e9061cc 100644
--- a/docs/content/docs/reference/sdk/python/CrewAI.mdx
+++ b/docs/content/docs/reference/sdk/python/CrewAI.mdx
@@ -7,7 +7,7 @@ description: "The CopilotKit CrewAI SDK for Python allows you to build and run C
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/../sdk-python/copilotkit/crewai/crewai_sdk.py
+ * src/v1.x/../../sdk-python/copilotkit/crewai/crewai_sdk.py
*/
}
## copilotkit_predict_state
diff --git a/docs/content/docs/reference/sdk/python/CrewAIAgent.mdx b/docs/content/docs/reference/sdk/python/CrewAIAgent.mdx
index 5f37c5ed20..9ff7b37eaa 100644
--- a/docs/content/docs/reference/sdk/python/CrewAIAgent.mdx
+++ b/docs/content/docs/reference/sdk/python/CrewAIAgent.mdx
@@ -7,7 +7,7 @@ description: "CrewAIAgent lets you define your agent for use with CopilotKit."
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/../sdk-python/copilotkit/crewai/crewai_agent.py
+ * src/v1.x/../../sdk-python/copilotkit/crewai/crewai_agent.py
*/
}
## CrewAIAgent
diff --git a/docs/content/docs/reference/sdk/python/LangGraph.mdx b/docs/content/docs/reference/sdk/python/LangGraph.mdx
index ed624e3559..075a015b6f 100644
--- a/docs/content/docs/reference/sdk/python/LangGraph.mdx
+++ b/docs/content/docs/reference/sdk/python/LangGraph.mdx
@@ -7,7 +7,7 @@ description: "The CopilotKit LangGraph SDK for Python allows you to build and ru
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/../sdk-python/copilotkit/langgraph.py
+ * src/v1.x/../../sdk-python/copilotkit/langgraph.py
*/
}
## copilotkit_customize_config
diff --git a/docs/content/docs/reference/sdk/python/LangGraphAgent.mdx b/docs/content/docs/reference/sdk/python/LangGraphAgent.mdx
index 673950acfc..357d5d24c6 100644
--- a/docs/content/docs/reference/sdk/python/LangGraphAgent.mdx
+++ b/docs/content/docs/reference/sdk/python/LangGraphAgent.mdx
@@ -7,7 +7,7 @@ description: "LangGraphAgent lets you define your agent for use with CopilotKit.
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/../sdk-python/copilotkit/langgraph_agent.py
+ * src/v1.x/../../sdk-python/copilotkit/langgraph_agent.py
*/
}
## LangGraphAgent
diff --git a/docs/content/docs/reference/sdk/python/RemoteEndpoints.mdx b/docs/content/docs/reference/sdk/python/RemoteEndpoints.mdx
index 8328ecbc63..ab04e13513 100644
--- a/docs/content/docs/reference/sdk/python/RemoteEndpoints.mdx
+++ b/docs/content/docs/reference/sdk/python/RemoteEndpoints.mdx
@@ -7,7 +7,7 @@ description: "CopilotKit Remote Endpoints allow you to connect actions and agent
/*
* ATTENTION! DO NOT MODIFY THIS FILE!
* This page is auto-generated. If you want to make any changes to this page, changes must be made at:
- * CopilotKit/../sdk-python/copilotkit/sdk.py
+ * src/v1.x/../../sdk-python/copilotkit/sdk.py
*/
}
## CopilotKitRemoteEndpoint
diff --git a/docs/lib/icons/custom-icons.tsx b/docs/lib/icons/custom-icons.tsx
index b4b8ac1286..2d8b477268 100644
--- a/docs/lib/icons/custom-icons.tsx
+++ b/docs/lib/icons/custom-icons.tsx
@@ -347,6 +347,38 @@ export const A2AIcon = (props: IconBaseProps) => (
);
+
+export const AgentSpecMarkIcon = (props: IconBaseProps) => (
+
+);
+
+
export const customIcons = {
a2a: A2AIcon,
adk: ADKIcon,
@@ -368,6 +400,7 @@ export const customIcons = {
agnoBlack: AgnoIconBlack,
llamaindex: LlamaIndexIcon,
pydantic: PydanticAIIcon,
+ agentspecMark: AgentSpecMarkIcon,
llm: RocketIcon,
"direct-to-llm": RocketIcon,
};
diff --git a/docs/snippets/integrations/agent-spec/run-and-connect.mdx b/docs/snippets/integrations/agent-spec/run-and-connect.mdx
new file mode 100644
index 0000000000..2eaf6e5166
--- /dev/null
+++ b/docs/snippets/integrations/agent-spec/run-and-connect.mdx
@@ -0,0 +1,18 @@
+import { Accordions, Accordion } from "fumadocs-ui/components/accordion";
+
+You'll need to run your agent and connect it to CopilotKit before proceeding.
+
+If you don't already have CopilotKit and your agent connected, choose one of the following options:
+
+
+
+ You can follow the instructions in the [quickstart](/agent-spec/quickstart) guide.
+
+
+ Run the following command to create a brand new project with a pre-configured agent:
+
+ ```bash
+ npx copilotkit@latest create -f agent-spec
+ ```
+
+
\ No newline at end of file
diff --git a/docs/snippets/shared/contributing/code-contributions/development.mdx b/docs/snippets/shared/contributing/code-contributions/development.mdx
index 84cfe55991..97beba357f 100644
--- a/docs/snippets/shared/contributing/code-contributions/development.mdx
+++ b/docs/snippets/shared/contributing/code-contributions/development.mdx
@@ -18,7 +18,7 @@ This guide will help you get started as smoothly as possible.
Then, clone your fork to your local machine:
```bash
git clone https://github.com//CopilotKit
- cd CopilotKit/CopilotKit
+ cd CopilotKit/src/v1.x
```
diff --git a/docs/snippets/shared/guides/custom-look-and-feel/customize-built-in-ui-components.mdx b/docs/snippets/shared/guides/custom-look-and-feel/customize-built-in-ui-components.mdx
index 59c22d5ae5..0d82f79757 100644
--- a/docs/snippets/shared/guides/custom-look-and-feel/customize-built-in-ui-components.mdx
+++ b/docs/snippets/shared/guides/custom-look-and-feel/customize-built-in-ui-components.mdx
@@ -70,7 +70,7 @@ In addition to customizing the colors, the CopilotKit CSS is structured to easil
### Reference
-For a full list of styles and classes used in CopilotKit, click [here](https://github.com/CopilotKit/CopilotKit/blob/main/CopilotKit/packages/react-ui/src/css/).
+For a full list of styles and classes used in CopilotKit, click [here](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/packages/react-ui/src/css/).
| CSS Class | Description |
diff --git a/registry/app/globals.css b/registry/app/globals.css
deleted file mode 100644
index 404bb606b6..0000000000
--- a/registry/app/globals.css
+++ /dev/null
@@ -1,136 +0,0 @@
-@tailwind base;
-@tailwind components;
-@tailwind utilities;
-
-@layer base {
- :root {
- --background: 0 0% 100%;
- --foreground: 240 10% 3.9%;
- --card: 0 0% 100%;
- --card-foreground: 240 10% 3.9%;
- --popover: 0 0% 100%;
- --popover-foreground: 240 10% 3.9%;
- --primary: 240 5.9% 10%;
- --primary-foreground: 0 0% 98%;
- --secondary: 240 4.8% 95.9%;
- --secondary-foreground: 240 5.9% 10%;
- --muted: 240 4.8% 95.9%;
- --muted-foreground: 240 3.8% 46.1%;
- --accent: 240 4.8% 95.9%;
- --accent-foreground: 240 5.9% 10%;
- --destructive: 0 84.2% 60.2%;
- --destructive-foreground: 0 0% 98%;
- --border: 240 5.9% 90%;
- --input: 240 5.9% 90%;
- --ring: 240 10% 3.9%;
- --chart-1: 12 76% 61%;
- --chart-2: 173 58% 39%;
- --chart-3: 197 37% 24%;
- --chart-4: 43 74% 66%;
- --chart-5: 27 87% 67%;
- --radius: 0.5rem;
- --sidebar-background: 0 0% 98%;
- --sidebar-foreground: 240 5.3% 26.1%;
- --sidebar-primary: 240 5.9% 10%;
- --sidebar-primary-foreground: 0 0% 98%;
- --sidebar-accent: 240 4.8% 95.9%;
- --sidebar-accent-foreground: 240 5.9% 10%;
- --sidebar-border: 220 13% 91%;
- --sidebar-ring: 217.2 91.2% 59.8%;
- }
- .dark {
- --background: 240 10% 3.9%;
- --foreground: 0 0% 98%;
- --card: 240 10% 3.9%;
- --card-foreground: 0 0% 98%;
- --popover: 240 10% 3.9%;
- --popover-foreground: 0 0% 98%;
- --primary: 0 0% 98%;
- --primary-foreground: 240 5.9% 10%;
- --secondary: 240 3.7% 15.9%;
- --secondary-foreground: 0 0% 98%;
- --muted: 240 3.7% 15.9%;
- --muted-foreground: 240 5% 64.9%;
- --accent: 240 3.7% 15.9%;
- --accent-foreground: 0 0% 98%;
- --destructive: 0 62.8% 30.6%;
- --destructive-foreground: 0 0% 98%;
- --border: 240 3.7% 15.9%;
- --input: 240 3.7% 15.9%;
- --ring: 240 4.9% 83.9%;
- --chart-1: 220 70% 50%;
- --chart-2: 160 60% 45%;
- --chart-3: 30 80% 55%;
- --chart-4: 280 65% 60%;
- --chart-5: 340 75% 55%;
- --sidebar-background: 240 5.9% 10%;
- --sidebar-foreground: 240 4.8% 95.9%;
- --sidebar-primary: 224.3 76.3% 48%;
- --sidebar-primary-foreground: 0 0% 100%;
- --sidebar-accent: 240 3.7% 15.9%;
- --sidebar-accent-foreground: 240 4.8% 95.9%;
- --sidebar-border: 240 3.7% 15.9%;
- --sidebar-ring: 217.2 91.2% 59.8%;
- }
-}
-
-@layer base {
- * {
- @apply border-border;
- }
- body {
- @apply bg-background text-foreground;
- }
-}
-
-[data-rehype-pretty-code-fragment] {
- @apply relative text-white;
-}
-
-[data-rehype-pretty-code-fragment] code {
- @apply grid min-w-full break-words rounded-none border-0 bg-transparent p-0;
- counter-reset: line;
- box-decoration-break: clone;
-}
-
-[data-rehype-pretty-code-fragment] .line {
- @apply px-4 min-h-[1rem] py-0.5 w-full inline-block;
-}
-
-[data-rehype-pretty-code-fragment] [data-line-numbers] .line {
- @apply px-2;
-}
-
-[data-rehype-pretty-code-fragment] [data-line-numbers] > .line::before {
- @apply text-zinc-50/40 text-xs;
- counter-increment: line;
- content: counter(line);
- display: inline-block;
- width: 1.8rem;
- margin-right: 1.4rem;
- text-align: right;
-}
-
-[data-rehype-pretty-code-fragment] .line--highlighted {
- @apply bg-zinc-700/50;
-}
-
-[data-rehype-pretty-code-fragment] .line-highlighted span {
- @apply relative;
-}
-
-[data-rehype-pretty-code-fragment] .word--highlighted {
- @apply rounded-md bg-zinc-700/50 border-zinc-700/70 p-1;
-}
-
-.dark [data-rehype-pretty-code-fragment] .word--highlighted {
- @apply bg-zinc-900;
-}
-
-[data-rehype-pretty-code-title] {
- @apply mt-2 pt-6 px-4 text-sm font-medium text-foreground;
-}
-
-[data-rehype-pretty-code-title] + pre {
- @apply mt-2;
-}
diff --git a/registry/app/page.tsx b/registry/app/page.tsx
deleted file mode 100644
index 0d7cd1fcc6..0000000000
--- a/registry/app/page.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import * as React from "react"
-
-// This page displays items from the custom registry.
-// You are free to implement this with your own design as needed.
-
-export default function Home() {
- return (
-
-
-
Custom Registry
-
- A custom registry for distribution code using shadcn.
-
-
-
- )
-}
diff --git a/registry/components/ui/tooltip.tsx b/registry/components/ui/tooltip.tsx
deleted file mode 100644
index 28e19183f4..0000000000
--- a/registry/components/ui/tooltip.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-"use client"
-
-import * as React from "react"
-import * as TooltipPrimitive from "@radix-ui/react-tooltip"
-
-import { cn } from "@/lib/utils"
-
-const TooltipProvider = TooltipPrimitive.Provider
-
-const Tooltip = TooltipPrimitive.Root
-
-const TooltipTrigger = TooltipPrimitive.Trigger
-
-const TooltipContent = React.forwardRef<
- React.ElementRef,
- React.ComponentPropsWithoutRef
->(({ className, sideOffset = 4, ...props }, ref) => (
-
-
-
-))
-TooltipContent.displayName = TooltipPrimitive.Content.displayName
-
-export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
diff --git a/registry/hooks/use-coagents-crew-starter.tsx b/registry/hooks/use-coagents-crew-starter.tsx
deleted file mode 100644
index a4c57b96f7..0000000000
--- a/registry/hooks/use-coagents-crew-starter.tsx
+++ /dev/null
@@ -1,163 +0,0 @@
-"use client";
-import {
- CrewsAgentState,
- CrewsResponseStatus,
- useCoAgent,
- useCoAgentStateRender,
- useCopilotAction,
- useCopilotAdditionalInstructions,
- useCopilotChat,
-} from "@copilotkit/react-core";
-import { useEffect, useState } from "react";
-import CrewHumanFeedbackRenderer, {
- CrewsFeedback,
-} from "@/registry/crews/crew-human-feedback-renderer";
-import CrewStateRenderer from "@/registry/crews/crew-state-renderer";
-import { MessageRole, TextMessage } from "@copilotkit/runtime-client-gql";
-import { CrewInChatInput } from "@/registry/crews/crew-in-chat-input";
-
-/**
- * Hook: useCoagentsCrewStarter
- *
- * This hook provides a simplified interface for initializing and managing
- * a copilot crew in your application. It handles:
- *
- * 1. Initialization with configured agent name from environment variables
- * 2. Collection of user inputs through a form interface
- * 3. Real-time state visualization during execution
- * 4. Feedback collection when the crew needs user input
- * 5. Result aggregation and presentation
- *
- * @param {Object} params - Parameters for initializing the crew
- * @param {Array} params.inputs - Input field names to collect from the user
- * @returns {Object} - An object containing the crew's output
- *
- * @example
- * ```tsx
- * const { output } = useCoagentsCrewStarter({
- * inputs: ["query", "location"]
- * });
- * ```
- */
-export const useCoagentsCrewStarter = ({
- inputs,
-}: {
- inputs: Array;
-}): {
- output: string;
-} => {
- const [initialMessageSent, setInitialMessageSent] = useState(false);
-
- // Use the agent name from environment variables
- const agentName = process.env.NEXT_PUBLIC_COPILOTKIT_AGENT_NAME || "DefaultAgent";
-
- // Initialize the crew agent with a default state
- const { state, setState, run } = useCoAgent<
- CrewsAgentState & {
- result: string;
- inputs: Record;
- }
- >({
- name: agentName,
- initialState: {
- inputs: {},
- result: "Crew result will appear here...",
- },
- });
-
- const { appendMessage, isLoading } = useCopilotChat();
-
- // Instructions for the copilot to ensure inputs are gathered
- const instructions =
- "INPUTS ARE ABSOLUTELY REQUIRED. Please call getInputs before proceeding with anything else.";
-
- // Send initial greeting when chat is loaded
- useEffect(() => {
- if (initialMessageSent || isLoading) return;
-
- setTimeout(async () => {
- await appendMessage(
- new TextMessage({
- content: "Hi! Please provide your inputs to get started.",
- role: MessageRole.Developer,
- })
- );
- setInitialMessageSent(true);
- }, 0);
- }, [initialMessageSent, isLoading, appendMessage]);
-
- // Send a message with the inputs once they are provided
- useEffect(() => {
- if (!initialMessageSent && Object.values(state?.inputs || {}).length > 0) {
- appendMessage(
- new TextMessage({
- role: MessageRole.Developer,
- content: "My inputs are: " + JSON.stringify(state?.inputs),
- })
- ).then(() => {
- setInitialMessageSent(true);
- });
- }
- }, [initialMessageSent, state?.inputs, appendMessage]);
-
- // Provide additional instructions to the copilot
- useCopilotAdditionalInstructions({
- instructions,
- available:
- Object.values(state?.inputs || {}).length > 0 ? "enabled" : "disabled",
- });
-
- // Action to get inputs from the user
- useCopilotAction({
- name: "getInputs",
- description:
- "Collect required inputs from the user before starting the crew execution.",
- renderAndWaitForResponse({ status, respond }) {
- if (status === "inProgress" || status === "executing") {
- return (
- {
- setState({
- ...state,
- inputs: inputValues,
- });
- respond?.("Inputs submitted");
- }}
- />
- );
- }
- return
;\n },\n });\n\n // Render the crew's state in real-time\n useCoAgentStateRender({\n name: agentName,\n render: ({ state, status }) => (\n \n ),\n });\n\n // Action to handle feedback requests from the crew\n useCopilotAction({\n name: \"crew_requesting_feedback\",\n description: \"Request feedback from the user on the crew's output\",\n renderAndWaitForResponse(props) {\n const { status, args, respond } = props;\n return (\n \n );\n },\n });\n\n // Return the output result of the crew\n return {\n output: state?.result || \"\",\n };\n};\n",
- "type": "registry:hook",
- "target": "hooks/use-coagents-crew-starter.tsx"
- },
- {
- "path": "registry/crews/crew-in-chat-input.tsx",
- "content": "import React from \"react\";\n\n/**\n * Props for the CrewInChatInput component\n * \n * @property status - The current status of the crew operation\n * @property inputs - Array of input field names to render\n * @property onSubmit - Callback function triggered when form is submitted\n */\ninterface CrewInChatInputProps {\n status: \"inProgress\" | \"executing\" | string;\n inputs: string[];\n onSubmit: (inputs: Record) => Promise;\n}\n\n/**\n * A form component that renders dynamic input fields for crew interactions\n * \n * This component creates a form with input fields based on the provided\n * input names. It's designed to collect information from users in a \n * conversational interface during crew execution.\n * \n * @example\n * ```tsx\n * {\n * console.log(values); // { query: \"...\", location: \"...\" }\n * }}\n * />\n * ```\n */\nexport const CrewInChatInput: React.FC = ({\n status,\n inputs,\n onSubmit,\n}) => {\n // If not in progress or executing, show that inputs were submitted\n console.log(\"status\", status);\n if (status !== \"inProgress\" && status !== \"executing\") {\n return
Inputs submitted
;\n }\n\n return (\n \n );\n};\n",
- "type": "registry:component",
- "target": "components/crew-in-chat-input.tsx"
- },
- {
- "path": "registry/crews/crew-state-renderer.tsx",
- "content": "import {\n CrewsAgentState,\n CrewsResponseStatus,\n CrewsTaskStateItem,\n CrewsToolStateItem,\n} from \"@copilotkit/react-core\";\nimport { useEffect } from \"react\";\nimport { useMemo, useRef, useState } from \"react\";\n\n/**\n * Component that renders the crew's execution state in real-time\n * \n * This component visualizes:\n * - Steps being executed by the crew\n * - Tasks being performed\n * - Thoughts and results during execution\n * \n * Features:\n * - Collapsible UI to save space\n * - Auto-scrolling to newest items\n * - Highlighting of newly added items\n * \n * @param state - The current state of the crew agent\n * @param status - The response status of the crew\n */\nfunction CrewStateRenderer({\n state,\n status,\n}: {\n state: CrewsAgentState;\n status: CrewsResponseStatus;\n}) {\n const [isCollapsed, setIsCollapsed] = useState(true);\n const contentRef = useRef(null);\n const prevItemsLengthRef = useRef(0);\n const [highlightId, setHighlightId] = useState(null);\n\n // Combine and sort steps and tasks by timestamp\n const items = useMemo(() => {\n if (!state) return [];\n return [...(state.steps || []), ...(state.tasks || [])].sort(\n (a, b) =>\n new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime()\n );\n }, [state]);\n\n // Handle highlighting of new items and auto-scrolling\n useEffect(() => {\n if (!state) return;\n if (items.length > prevItemsLengthRef.current) {\n const newestItem = items[items.length - 1];\n setHighlightId(newestItem.id);\n setTimeout(() => setHighlightId(null), 1500);\n\n if (contentRef.current && !isCollapsed) {\n contentRef.current.scrollTop = contentRef.current.scrollHeight;\n }\n }\n prevItemsLengthRef.current = items.length;\n }, [items, isCollapsed, state]);\n\n if (!state) {\n return
Loading crew state...
;\n }\n\n // Hide entirely if collapsed & empty & not in progress\n if (isCollapsed && items.length === 0 && status !== \"inProgress\") return null;\n\n return (\n
\n )}\n {\"description\" in item && item.description && (\n
{item.description}
\n )}\n
\n );\n })\n ) : (\n
No activity yet...
\n )}\n
\n )}\n\n {/* Custom animation for highlighting new items */}\n \n
\n );\n}\n\nexport default CrewStateRenderer;\n",
- "type": "registry:component",
- "target": "components/crew-state-renderer.tsx"
- },
- {
- "path": "registry/crews/crew-human-feedback-renderer.tsx",
- "content": "import { CrewsResponseStatus, CrewsStateItem } from \"@copilotkit/react-core\";\nimport { Markdown } from \"@copilotkit/react-ui\";\nimport { useState } from \"react\";\n\n/**\n * Interface defining the feedback structure requested by the crew agents\n */\nexport interface CrewsFeedback extends CrewsStateItem {\n /**\n * Output of the task execution that requires user feedback\n */\n task_output?: string;\n}\n\n/**\n * Component that renders a UI for agent-requested user feedback\n * \n * This component presents the task output from the crew and provides\n * buttons for the user to approve or reject the proposed solution.\n * \n * @param feedback - The feedback object containing task output\n * @param respond - Callback function to send user response back to the crew\n * @param status - Current status of the feedback request\n */\nfunction CrewHumanFeedbackRenderer({\n feedback,\n respond,\n status,\n}: {\n feedback: CrewsFeedback;\n respond?: (input: string) => void;\n status: CrewsResponseStatus;\n}) {\n const [isExpanded, setIsExpanded] = useState(true);\n const [userResponse, setUserResponse] = useState(null);\n\n // If feedback request is complete, show the user's response\n if (status === \"complete\") {\n return (\n
\n {userResponse || \"Feedback submitted.\"}\n
\n );\n }\n\n // If feedback request is in progress, show the feedback UI\n if (status === \"inProgress\" || status === \"executing\") {\n return (\n
\n
\n
Feedback Required
\n \n
\n\n {isExpanded && (\n
\n \n
\n )}\n \n
\n \n \n
\n
\n );\n }\n\n return null;\n}\n\nexport default CrewHumanFeedbackRenderer;\n",
- "type": "registry:component",
- "target": "components/crew-human-feedback-renderer.tsx"
- },
- {
- "path": "registry/layout/coagents-crew-starter-layout.tsx",
- "content": "\"use client\";\nimport \"@copilotkit/react-ui/styles.css\";\nimport React from \"react\";\nimport { CopilotChat } from \"@copilotkit/react-ui\";\nimport { CopilotKit } from \"@copilotkit/react-core\";\n\n// Read environment variables for copilot configuration\nconst apiKey = process.env.NEXT_PUBLIC_COPILOT_API_KEY || \"\";\nconst agentName = process.env.NEXT_PUBLIC_COPILOTKIT_AGENT_NAME || \"DefaultAgent\";\n\n/**\n * Layout component for the CopilotKit interface\n * \n * This component creates a two-column layout:\n * 1. Left column (60%): Chat interface for user interaction\n * 2. Right column (40%): Results panel to display crew output\n * \n * It configures CopilotKit with environment variables for API key and agent name\n * and provides optimized styling for both light and dark modes.\n */\nexport default function CoagentsCrewStarterLayout({\n children,\n}: {\n children: React.ReactNode;\n}) {\n return (\n \n
\n
\n {/* Chat Column */}\n
\n \n
\n\n {/* Results Column */}\n
\n
\n {children}\n
\n
\n
\n
\n \n );\n}\n",
- "type": "registry:component",
- "target": "app/copilotkit/layout.tsx"
- },
- {
- "path": "registry/quickstarts/coagents-crew-starter.tsx",
- "content": "\"use client\";\nimport React from \"react\";\nimport { useCoagentsCrewStarter } from \"@/hooks/use-coagents-crew-starter\";\n\n/**\n * Format text output from the Crew for better readability\n * \n * This utility function:\n * - Preserves existing formatting if present\n * - Converts markdown bold (**text**) to HTML tags\n * - Adds appropriate spacing for listed items\n * - Handles both pre-formatted and unformatted text\n * \n * @param text - The raw text output from the crew\n * @returns Formatted HTML string ready for display\n */\nfunction formatText(text: string): string {\n if (!text) return \"\";\n\n // Check if text already has formatting (multiple consecutive newlines)\n const hasFormatting = /\\n\\s*\\n/.test(text);\n\n // Process markdown elements\n let formatted = text;\n\n // Convert markdown bold to HTML bold\n formatted = formatted.replace(/\\*\\*([^*]+)\\*\\*/g, \"$1\");\n \n // Convert markdown lists to proper HTML with spacing\n formatted = formatted.replace(/^- (.+)$/gm, \"
$1
\");\n formatted = formatted.replace(/(
.+<\\/li>\\n)+/g, \"
$&
\");\n\n if (hasFormatting) {\n // Just convert newlines to tags for pre-formatted text\n return formatted.replace(/\\n/g, \" \");\n } else {\n // For unformatted text, add proper spacing\n // Add double line breaks before numbered items\n formatted = formatted.replace(/(\\d+\\.)/g, \"
$1\");\n\n // Add single line breaks before properties\n formatted = formatted.replace(/(\\s-\\s)/g, \" $1\");\n\n return formatted;\n }\n}\n\n/**\n * Main component for the Copilot Crew interface\n * \n * This component:\n * 1. Initializes the crew with required input fields\n * 2. Renders the formatted output from the crew\n * 3. Provides a clean, readable interface for users\n */\nexport default function CoagentsCrewStarter() {\n const { output } = useCoagentsCrewStarter({\n /**\n * Define the input fields needed to start your crew.\n * These will be presented as a form in the chat interface.\n */\n inputs: [\"YOUR_INPUTS_HERE\"],\n });\n\n return (\n
\n
\n Crew Results\n
\n \n {!output || output === \"Crew result will appear here...\" ? (\n
\n
\n Waiting for input...\n
\n
\n Results will appear here after providing inputs in the chat\n
\n
\n ) : (\n
\n \n
\n )}\n
\n );\n}\n",
- "type": "registry:page",
- "target": "app/copilotkit/page.tsx"
- }
- ]
-}
\ No newline at end of file
diff --git a/registry/public/r/coagents-starter-crewai-flows.json b/registry/public/r/coagents-starter-crewai-flows.json
deleted file mode 100644
index 85fef1c65d..0000000000
--- a/registry/public/r/coagents-starter-crewai-flows.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "$schema": "https://ui.shadcn.com/schema/registry-item.json",
- "name": "coagents-starter-crewai-flows",
- "type": "registry:page",
- "title": "Coagents Starter CrewAI Flows",
- "description": "Quickstart for CopilotKit and CrewAI Flows on CrewAI Enterprise.",
- "dependencies": [
- "@copilotkit/react-core",
- "@copilotkit/react-ui"
- ],
- "files": [
- {
- "path": "registry/quickstarts/coagents-starter-crewai-flows/page.tsx",
- "content": "\"use client\";\nimport \"@copilotkit/react-ui/styles.css\";\nimport { CopilotKit, useCopilotAction } from \"@copilotkit/react-core\";\nimport { CopilotChat } from \"@copilotkit/react-ui\";\nimport React, { useState } from \"react\";\n\nconst publicApiKey = process.env.NEXT_PUBLIC_COPILOT_API_KEY;\nconst agentName = process.env.NEXT_PUBLIC_COPILOTKIT_AGENT_NAME;\n\nif (!publicApiKey || !agentName) {\n throw new Error(\"Missing environment variables\");\n}\n\n// Main Chat Component: Handles chat interface and background customization\nconst Chat = () => {\n const [background, setBackground] = useState(\n \"linear-gradient(135deg, #667eea 0%, #764ba2 100%)\"\n );\n\n // Action: Allow AI to change background color dynamically\n useCopilotAction({\n name: \"change_background\",\n description:\n \"Change the background color of the chat. Can be anything that the CSS background attribute accepts. Regular colors, linear of radial gradients etc.\",\n parameters: [\n {\n name: \"background\",\n type: \"string\",\n description: \"The background. Prefer gradients.\",\n },\n ],\n handler: ({ background }) => setBackground(background),\n followUp: false,\n });\n\n return (\n
\n
\n
\n \n
\n
\n
\n );\n};\n\n// App Component: Main wrapper that provides CopilotKit context\nconst CrewAIFlow: React.FC = () => (\n \n \n \n);\n\nexport default CrewAIFlow;\n",
- "type": "registry:page",
- "target": "app/copilotkit/page.tsx"
- }
- ]
-}
\ No newline at end of file
diff --git a/registry/public/r/coagents-starter-ui.json b/registry/public/r/coagents-starter-ui.json
deleted file mode 100644
index 5e9f7fd2ad..0000000000
--- a/registry/public/r/coagents-starter-ui.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "$schema": "https://ui.shadcn.com/schema/registry-item.json",
- "name": "coagents-starter-ui",
- "type": "registry:block",
- "title": "Coagents Starter UI",
- "description": "UI for interacting with the a starter coagent.",
- "dependencies": [
- "@copilotkit/react-ui",
- "@copilotkit/react-core"
- ],
- "files": [
- {
- "path": "registry/quickstarts/coagents-starter.tsx",
- "content": "\"use client\";\n\nimport { useCoAgent, useCopilotAction } from \"@copilotkit/react-core\";\nimport { CopilotKitCSSProperties, CopilotSidebar } from \"@copilotkit/react-ui\";\nimport { useState } from \"react\";\n\nexport default function CopilotKitPage() {\n const [themeColor, setThemeColor] = useState(\"#6366f1\");\n\n // 🪁 Frontend Actions: https://docs.copilotkit.ai/guides/frontend-actions\n useCopilotAction({\n name: \"setThemeColor\",\n parameters: [{\n name: \"themeColor\",\n description: \"The theme color to set. Make sure to pick nice colors.\",\n required: true, \n }],\n handler({ themeColor }) {\n setThemeColor(themeColor);\n },\n });\n\n return (\n \n \n \n \n );\n}\n\n// State of the agent, make sure this aligns with your agent's state.\ntype AgentState = {\n proverbs: string[];\n}\n\nfunction YourMainContent({ themeColor }: { themeColor: string }) {\n // 🪁 Shared State: https://docs.copilotkit.ai/coagents/shared-state\n const {state, setState} = useCoAgent({\n name: \"sample_agent\",\n initialState: {\n proverbs: [\n \"CopilotKit may be new, but its the best thing since sliced bread.\",\n ],\n },\n })\n\n // 🪁 Frontend Actions: https://docs.copilotkit.ai/coagents/frontend-actions\n useCopilotAction({\n name: \"addProverb\",\n parameters: [{\n name: \"proverb\",\n description: \"The proverb to add. Make it witty, short and concise.\",\n required: true,\n }],\n handler: ({ proverb }) => {\n setState({\n ...state,\n proverbs: [...state.proverbs, proverb],\n });\n },\n });\n\n //🪁 Generative UI: https://docs.copilotkit.ai/coagents/generative-ui\n useCopilotAction({\n name: \"getWeather\",\n description: \"Get the weather for a given location.\",\n available: \"disabled\",\n parameters: [\n { name: \"location\", type: \"string\", required: true },\n ],\n render: ({ args }) => {\n return \n },\n });\n\n return (\n
\n
\n
Proverbs
\n
This is a demonstrative page, but it could be anything you want! 🪁
\n \n
\n {state.proverbs?.map((proverb, index) => (\n
\n
{proverb}
\n \n
\n ))}\n
\n {state.proverbs?.length === 0 &&
\n No proverbs yet. Ask the assistant to add some!\n
}\n
\n
\n );\n}\n\n// Simple sun icon for the weather card\nfunction SunIcon() {\n return (\n \n );\n}\n\n// Weather card component where the location and themeColor are based on what the agent\n// sets via tool calls.\nfunction WeatherCard({ location, themeColor }: { location?: string, themeColor: string }) {\n return (\n
\n
\n
\n
\n
{location}
\n
Current Weather
\n
\n \n
\n \n
\n
70°
\n
Clear skies
\n
\n \n
\n
\n
\n
Humidity
\n
45%
\n
\n
\n
Wind
\n
5 mph
\n
\n
\n
Feels Like
\n
72°
\n
\n
\n
\n
\n
\n );\n}\n",
- "type": "registry:page",
- "target": "app/copilotkit/page.tsx"
- }
- ]
-}
\ No newline at end of file
diff --git a/registry/public/r/crew-quickstart.json b/registry/public/r/crew-quickstart.json
deleted file mode 100644
index 4183bde6c1..0000000000
--- a/registry/public/r/crew-quickstart.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "$schema": "https://ui.shadcn.com/schema/registry-item.json",
- "name": "crew-quickstart",
- "type": "registry:page",
- "title": "Crew Enterprise Quickstart",
- "description": "A quickstart guide for setting up CopilotKit in an enterprise environment with a crew.",
- "dependencies": [
- "@copilotkit/react-core",
- "@copilotkit/runtime-client-gql"
- ],
- "files": [
- {
- "path": "hooks/crew-quickstart/use-crew-quickstart.tsx",
- "content": "\"use client\";\n\nimport {\n CrewsAgentState,\n CrewsResponseStatus,\n CrewsStateItem,\n CrewsTaskStateItem,\n CrewsToolStateItem,\n useCoAgent,\n useCoAgentStateRender,\n useCopilotAction,\n useCopilotChat,\n useCopilotAdditionalInstructions,\n} from \"@copilotkit/react-core\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { MessageRole, TextMessage } from \"@copilotkit/runtime-client-gql\";\n\ninterface CrewsFeedback extends CrewsStateItem {\n /**\n * Output of the task execution\n */\n task_output?: string;\n}\n\n/**\n * Renders your Crew's steps & tasks in real-time.\n */\nfunction CrewStateRenderer({\n state,\n status,\n}: {\n state: CrewsAgentState;\n status: CrewsResponseStatus;\n}) {\n const [isCollapsed, setIsCollapsed] = useState(true);\n const contentRef = useRef(null);\n const prevItemsLengthRef = useRef(0);\n const [highlightId, setHighlightId] = useState(null);\n\n // Combine steps + tasks\n const items = useMemo(() => {\n if (!state) return [];\n return [...(state.steps || []), ...(state.tasks || [])].sort(\n (a, b) =>\n new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime()\n );\n }, [state]);\n\n // Highlight newly added item & auto-scroll\n useEffect(() => {\n if (!state) return;\n if (items.length > prevItemsLengthRef.current) {\n const newestItem = items[items.length - 1];\n setHighlightId(newestItem.id);\n setTimeout(() => setHighlightId(null), 1500);\n\n if (contentRef.current && !isCollapsed) {\n contentRef.current.scrollTop = contentRef.current.scrollHeight;\n }\n }\n prevItemsLengthRef.current = items.length;\n }, [items, isCollapsed, state]);\n\n if (!state) {\n return
Loading crew state...
;\n }\n\n // Hide entirely if collapsed & empty & not in progress\n if (isCollapsed && items.length === 0 && status !== \"inProgress\") return null;\n\n return (\n
- )}
-
- {/* Custom animation for highlighting new items */}
-
-
- );
-}
-
-export default CrewStateRenderer;
diff --git a/registry/registry/layout/agent-layout.tsx b/registry/registry/layout/agent-layout.tsx
deleted file mode 100644
index 9fa364b25c..0000000000
--- a/registry/registry/layout/agent-layout.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import "@copilotkit/react-ui/styles.css";
-import React, { ReactNode } from "react";
-import { CopilotKit } from "@copilotkit/react-core";
-
-// Where CopilotKit will proxy requests to. If you're using Copilot Cloud, this environment variable will be empty.
-const runtimeUrl = process.env.NEXT_PUBLIC_COPILOTKIT_RUNTIME_URL
-// When using Copilot Cloud, all we need is the publicApiKey.
-const publicApiKey = process.env.NEXT_PUBLIC_COPILOT_API_KEY;
-// The name of the agent that we'll be using.
-const agentName = process.env.NEXT_PUBLIC_COPILOTKIT_AGENT_NAME
-
-export default function Layout({ children }: { children: ReactNode }) {
- return (
-
- {children}
-
- );
-}
diff --git a/registry/registry/layout/coagents-crew-starter-layout.tsx b/registry/registry/layout/coagents-crew-starter-layout.tsx
deleted file mode 100644
index 34abc2d92a..0000000000
--- a/registry/registry/layout/coagents-crew-starter-layout.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-"use client";
-import "@copilotkit/react-ui/styles.css";
-import React from "react";
-import { CopilotChat } from "@copilotkit/react-ui";
-import { CopilotKit } from "@copilotkit/react-core";
-
-// Read environment variables for copilot configuration
-const apiKey = process.env.NEXT_PUBLIC_COPILOT_API_KEY || "";
-const agentName = process.env.NEXT_PUBLIC_COPILOTKIT_AGENT_NAME || "DefaultAgent";
-
-/**
- * Layout component for the CopilotKit interface
- *
- * This component creates a two-column layout:
- * 1. Left column (60%): Chat interface for user interaction
- * 2. Right column (40%): Results panel to display crew output
- *
- * It configures CopilotKit with environment variables for API key and agent name
- * and provides optimized styling for both light and dark modes.
- */
-export default function CoagentsCrewStarterLayout({
- children,
-}: {
- children: React.ReactNode;
-}) {
- return (
-
-
-
- {/* Chat Column */}
-
-
-
-
- {/* Results Column */}
-
-
- {children}
-
-
-
-
-
- );
-}
diff --git a/registry/registry/layout/index.tsx b/registry/registry/layout/index.tsx
deleted file mode 100644
index 69207183bd..0000000000
--- a/registry/registry/layout/index.tsx
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from "./agent-layout";
-export * from "./standard-layout";
diff --git a/registry/registry/layout/standard-layout.tsx b/registry/registry/layout/standard-layout.tsx
deleted file mode 100644
index 5f8c432091..0000000000
--- a/registry/registry/layout/standard-layout.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import "@copilotkit/react-ui/styles.css";
-import React, { ReactNode } from "react";
-import { CopilotKit } from "@copilotkit/react-core";
-
-// Where CopilotKit will proxy requests to. If you're using Copilot Cloud, this environment variable will be empty.
-const runtimeUrl = process.env.NEXT_PUBLIC_COPILOTKIT_RUNTIME_URL
-// When using Copilot Cloud, all we need is the publicApiKey.
-const publicApiKey = process.env.NEXT_PUBLIC_COPILOT_API_KEY;
-
-export default function Layout({ children }: { children: ReactNode }) {
- return (
-
- {children}
-
- );
-}
diff --git a/registry/registry/quickstarts/coagents-crew-starter.tsx b/registry/registry/quickstarts/coagents-crew-starter.tsx
deleted file mode 100644
index e0103289f4..0000000000
--- a/registry/registry/quickstarts/coagents-crew-starter.tsx
+++ /dev/null
@@ -1,90 +0,0 @@
-"use client";
-import React from "react";
-import { useCoagentsCrewStarter } from "@/hooks/use-coagents-crew-starter";
-
-/**
- * Format text output from the Crew for better readability
- *
- * This utility function:
- * - Preserves existing formatting if present
- * - Converts markdown bold (**text**) to HTML tags
- * - Adds appropriate spacing for listed items
- * - Handles both pre-formatted and unformatted text
- *
- * @param text - The raw text output from the crew
- * @returns Formatted HTML string ready for display
- */
-function formatText(text: string): string {
- if (!text) return "";
-
- // Check if text already has formatting (multiple consecutive newlines)
- const hasFormatting = /\n\s*\n/.test(text);
-
- // Process markdown elements
- let formatted = text;
-
- // Convert markdown bold to HTML bold
- formatted = formatted.replace(/\*\*([^*]+)\*\*/g, "$1");
-
- // Convert markdown lists to proper HTML with spacing
- formatted = formatted.replace(/^- (.+)$/gm, "
$1
");
- formatted = formatted.replace(/(
.+<\/li>\n)+/g, "
$&
");
-
- if (hasFormatting) {
- // Just convert newlines to tags for pre-formatted text
- return formatted.replace(/\n/g, " ");
- } else {
- // For unformatted text, add proper spacing
- // Add double line breaks before numbered items
- formatted = formatted.replace(/(\d+\.)/g, "
$1");
-
- // Add single line breaks before properties
- formatted = formatted.replace(/(\s-\s)/g, " $1");
-
- return formatted;
- }
-}
-
-/**
- * Main component for the Copilot Crew interface
- *
- * This component:
- * 1. Initializes the crew with required input fields
- * 2. Renders the formatted output from the crew
- * 3. Provides a clean, readable interface for users
- */
-export default function CoagentsCrewStarter() {
- const { output } = useCoagentsCrewStarter({
- /**
- * Define the input fields needed to start your crew.
- * These will be presented as a form in the chat interface.
- */
- inputs: ["YOUR_INPUTS_HERE"],
- });
-
- return (
-
-
- Crew Results
-
-
- {!output || output === "Crew result will appear here..." ? (
-
-
- Waiting for input...
-
-
- Results will appear here after providing inputs in the chat
-
- Missing required environment variables: NEXT_PUBLIC_COPILOT_API_KEY
- and NEXT_PUBLIC_COPILOTKIT_AGENT_NAME
-
-
-
- );
- }
-
- return (
-
-
-
- );
-};
-
-export default CrewAIFlow;
-
-// Main Chat Component: Handles chat interface and background customization
-const Chat = () => {
- const [background, setBackground] = useState(
- "linear-gradient(135deg, #667eea 0%, #764ba2 100%)"
- );
-
- // Tool: Allow AI to change background color dynamically
- useFrontendTool({
- name: "change_background",
- description:
- "Change the background color of the chat. Can be anything that the CSS background attribute accepts. Regular colors, linear of radial gradients etc.",
- parameters: [
- {
- name: "background",
- type: "string",
- description: "The background. Prefer gradients.",
- },
- ],
- handler: ({ background }) => setBackground(background),
- followUp: false,
- });
-
- return (
-
-
-
-
-
-
-
- );
-};
diff --git a/registry/registry/quickstarts/coagents-starter.tsx b/registry/registry/quickstarts/coagents-starter.tsx
deleted file mode 100644
index 4fa1f341ac..0000000000
--- a/registry/registry/quickstarts/coagents-starter.tsx
+++ /dev/null
@@ -1,171 +0,0 @@
-"use client";
-
-import { useCoAgent, useCopilotAction } from "@copilotkit/react-core";
-import { CopilotKitCSSProperties, CopilotSidebar } from "@copilotkit/react-ui";
-import { useState } from "react";
-
-export default function CopilotKitPage() {
- const [themeColor, setThemeColor] = useState("#6366f1");
-
- // 🪁 Frontend Actions: https://docs.copilotkit.ai/guides/frontend-actions
- useCopilotAction({
- name: "setThemeColor",
- parameters: [{
- name: "themeColor",
- description: "The theme color to set. Make sure to pick nice colors.",
- required: true,
- }],
- handler({ themeColor }) {
- setThemeColor(themeColor);
- },
- });
-
- return (
-
-
-
-
- );
-}
-
-// State of the agent, make sure this aligns with your agent's state.
-type AgentState = {
- proverbs: string[];
-}
-
-function YourMainContent({ themeColor }: { themeColor: string }) {
- // 🪁 Shared State: https://docs.copilotkit.ai/coagents/shared-state
- const {state, setState} = useCoAgent({
- name: "sample_agent",
- initialState: {
- proverbs: [
- "CopilotKit may be new, but its the best thing since sliced bread.",
- ],
- },
- })
-
- // 🪁 Frontend Actions: https://docs.copilotkit.ai/coagents/frontend-actions
- useCopilotAction({
- name: "addProverb",
- parameters: [{
- name: "proverb",
- description: "The proverb to add. Make it witty, short and concise.",
- required: true,
- }],
- handler: ({ proverb }) => {
- setState({
- ...state,
- proverbs: [...state.proverbs, proverb],
- });
- },
- });
-
- //🪁 Generative UI: https://docs.copilotkit.ai/coagents/generative-ui
- useCopilotAction({
- name: "getWeather",
- description: "Get the weather for a given location.",
- available: "disabled",
- parameters: [
- { name: "location", type: "string", required: true },
- ],
- render: ({ args }) => {
- return
- },
- });
-
- return (
-
-
-
Proverbs
-
This is a demonstrative page, but it could be anything you want! 🪁
-
-
- {state.proverbs?.map((proverb, index) => (
-
-
{proverb}
-
-
- ))}
-
- {state.proverbs?.length === 0 &&
- No proverbs yet. Ask the assistant to add some!
-
}
-
-
- );
-}
-
-// Simple sun icon for the weather card
-function SunIcon() {
- return (
-
- );
-}
-
-// Weather card component where the location and themeColor are based on what the agent
-// sets via tool calls.
-function WeatherCard({ location, themeColor }: { location?: string, themeColor: string }) {
- return (
-
- );
-}
diff --git a/registry/registry/quickstarts/mcp-starter/runtime.ts b/registry/registry/quickstarts/mcp-starter/runtime.ts
deleted file mode 100644
index fffcf2942e..0000000000
--- a/registry/registry/quickstarts/mcp-starter/runtime.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import {
- CopilotRuntime,
- OpenAIAdapter,
- copilotRuntimeNextJSAppRouterEndpoint,
-} from "@copilotkit/runtime";
-import { NextRequest } from "next/server";
-import { HttpStreamClient } from "@/registry/quickstarts/mcp-starter/utils/http-stream-client";
-
-const serviceAdapter = new OpenAIAdapter();
-const runtime = new CopilotRuntime({
- createMCPClient: async (config) => {
- const mcpClient = new HttpStreamClient({
- serverUrl: config.endpoint,
- });
-
- await mcpClient.connect();
- return mcpClient;
- },
-});
-
-export const POST = async (req: NextRequest) => {
- const { handleRequest } = copilotRuntimeNextJSAppRouterEndpoint({
- runtime,
- serviceAdapter,
- endpoint: "/api/copilotkit",
- });
-
- return handleRequest(req);
-};
diff --git a/registry/registry/quickstarts/mcp-starter/utils/http-stream-client.ts b/registry/registry/quickstarts/mcp-starter/utils/http-stream-client.ts
deleted file mode 100644
index 8641f6e573..0000000000
--- a/registry/registry/quickstarts/mcp-starter/utils/http-stream-client.ts
+++ /dev/null
@@ -1,212 +0,0 @@
-import { MCPTool, MCPClient as MCPClientInterface } from "@copilotkit/runtime";
-
-/**
- * HTTP Stream Transport client implementation for MCP
- * Based on the MCP specification version 2025-03-26
- *
- * This implementation supports both:
- * - Pure HTTP Stream Transport (JSON responses)
- * - Hybrid SSE/HTTP servers (SSE-formatted responses)
- *
- * Many current MCP servers use a hybrid approach where they accept
- * HTTP POST requests but respond with SSE format. This client handles
- * both response formats automatically.
- */
-export class HttpStreamClient implements MCPClientInterface {
- private baseUrl: string;
- private sessionId: string | null = null;
- private eventSource: EventSource | null = null;
- private headers: Record;
- private toolsCache: Record | null = null;
-
- constructor(options: {
- serverUrl: string;
- headers?: Record;
- }) {
- this.baseUrl = options.serverUrl;
- this.headers = options.headers || {};
- }
-
- async connect(): Promise {
- // Initialize connection
- const initRequest = {
- jsonrpc: "2.0",
- id: "init-" + Date.now(),
- method: "initialize",
- params: {
- protocolVersion: "2025-03-26",
- capabilities: {},
- clientInfo: {
- name: "cpk-http-client",
- version: "1.0.0",
- },
- },
- };
-
- const response = await fetch(this.baseUrl, {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- Accept: "application/json, text/event-stream",
- ...this.headers,
- },
- body: JSON.stringify(initRequest),
- });
-
- // Handle SSE response format
- let responseData;
- const contentType = response.headers.get("content-type");
- if (contentType?.includes("text/event-stream")) {
- // Parse SSE response
- const text = await response.text();
- const lines = text.split("\n");
- const dataLine = lines.find((line) => line.startsWith("data:"));
- if (dataLine) {
- responseData = JSON.parse(dataLine.substring(5).trim());
- }
- } else {
- responseData = await response.json();
- }
-
- // Store session ID
- this.sessionId = response.headers.get("Mcp-Session-Id");
-
- // Open SSE stream for server messages (only if we have a session)
- if (this.sessionId) {
- this.openEventStream();
- }
-
- console.log(`Connected with session: ${this.sessionId}`);
- }
-
- private openEventStream() {
- if (!this.sessionId) return;
-
- const url = new URL(this.baseUrl);
- url.searchParams.append("session", this.sessionId);
-
- this.eventSource = new EventSource(url.toString());
-
- this.eventSource.onmessage = (event) => {
- try {
- const message = JSON.parse(event.data);
- console.log("Received server message:", message);
- } catch (e) {
- console.error("Error parsing SSE message:", e);
- }
- };
-
- this.eventSource.onerror = () => {
- console.error("SSE connection error, reconnecting...");
- setTimeout(() => this.openEventStream(), 1000);
- };
- }
-
- async tools(): Promise> {
- if (this.toolsCache) return this.toolsCache;
-
- const request = {
- jsonrpc: "2.0",
- id: "tools-" + Date.now(),
- method: "tools/list",
- params: {},
- };
-
- const response = await fetch(this.baseUrl, {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- Accept: "application/json, text/event-stream",
- "Mcp-Session-Id": this.sessionId!,
- ...this.headers,
- },
- body: JSON.stringify(request),
- });
-
- // Handle SSE response format
- let result;
- const contentType = response.headers.get("content-type");
- if (contentType?.includes("text/event-stream")) {
- // Parse SSE response
- const text = await response.text();
- const lines = text.split("\n");
- const dataLine = lines.find((line) => line.startsWith("data:"));
- if (dataLine) {
- result = JSON.parse(dataLine.substring(5).trim());
- }
- } else {
- result = await response.json();
- }
- const toolsMap: Record = {};
-
- if (result.result?.tools) {
- for (const tool of result.result.tools) {
- toolsMap[tool.name] = {
- description: tool.description,
- schema: tool.inputSchema,
- execute: async (args: any) => this.callTool(tool.name, args),
- };
- }
- }
-
- this.toolsCache = toolsMap;
- return toolsMap;
- }
-
- private async callTool(name: string, args: any): Promise {
- const request = {
- jsonrpc: "2.0",
- id: `tool-${name}-${Date.now()}`,
- method: "tools/call",
- params: {
- name: name,
- arguments: args,
- },
- };
-
- const response = await fetch(this.baseUrl, {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- Accept: "application/json, text/event-stream",
- "Mcp-Session-Id": this.sessionId!,
- ...this.headers,
- },
- body: JSON.stringify(request),
- });
-
- // Handle SSE response format
- let result;
- const contentType = response.headers.get("content-type");
- if (contentType?.includes("text/event-stream")) {
- // Parse SSE response
- const text = await response.text();
- const lines = text.split("\n");
- const dataLine = lines.find((line) => line.startsWith("data:"));
- if (dataLine) {
- result = JSON.parse(dataLine.substring(5).trim());
- }
- } else {
- result = await response.json();
- }
- return result.result;
- }
-
- async close(): Promise {
- if (this.eventSource) {
- this.eventSource.close();
- this.eventSource = null;
- }
-
- if (this.sessionId) {
- await fetch(this.baseUrl, {
- method: "DELETE",
- headers: {
- "Mcp-Session-Id": this.sessionId,
- ...this.headers,
- },
- });
- this.sessionId = null;
- }
- }
-}
diff --git a/registry/registry/quickstarts/mcp-starter/utils/mcp-client.ts b/registry/registry/quickstarts/mcp-starter/utils/mcp-client.ts
deleted file mode 100644
index 64fa931e62..0000000000
--- a/registry/registry/quickstarts/mcp-starter/utils/mcp-client.ts
+++ /dev/null
@@ -1,457 +0,0 @@
-import { MCPTool, MCPClient as MCPClientInterface } from "@copilotkit/runtime";
-import { Client } from "@modelcontextprotocol/sdk/client/index.js";
-import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
-// TODO: Replace with HttpClientTransport when available in SDK
-// import { HttpClientTransport } from "@modelcontextprotocol/sdk/client/http.js";
-import type { JSONRPCMessage } from "@modelcontextprotocol/sdk/types.js";
-
-export interface McpClientOptions {
- serverUrl: string;
- headers?: Record;
- onMessage?: (message: Record) => void;
- onError?: (error: Error) => void;
- onOpen?: () => void;
- onClose?: () => void;
-}
-
-/**
- * McpClient - A Model Context Protocol client implementation
- *
- * @deprecated SSE transport is deprecated. Use HttpStreamClient instead which supports
- * the new HTTP Stream Transport protocol and is compatible with modern MCP servers.
- *
- * This class uses the deprecated SSE (Server-Sent Events) transport.
- * Many modern MCP servers (like Composio) no longer support pure SSE connections.
- *
- * This class implements the Model Context Protocol (MCP) client, which allows for
- * standardized communication with MCP servers. It's designed to be compatible with
- * CopilotKit's runtime by exposing the required interface.
- *
- * The main methods required by CopilotKit are:
- * - tools(): Returns a map of tool names to MCPTool objects
- * - close(): Closes the connection to the MCP server
- */
-export class MCPClient implements MCPClientInterface {
- private client: Client;
- private transport: SSEClientTransport;
- private serverUrl: URL;
- private onMessage: (message: Record) => void;
- private onError: (error: Error) => void;
- private onOpen: () => void;
- private onClose: () => void;
- private isConnected = false;
- private headers?: Record;
-
- // Cache for tools to avoid repeated fetches
- private toolsCache: Record | null = null;
-
- constructor(options: McpClientOptions) {
- this.serverUrl = new URL(options.serverUrl);
- this.headers = options.headers;
- this.onMessage =
- options.onMessage ||
- ((message) => console.log("Message received:", message));
- this.onError =
- options.onError || ((error) => console.error("Error:", error));
- this.onOpen = options.onOpen || (() => console.log("Connection opened"));
- this.onClose = options.onClose || (() => console.log("Connection closed"));
-
- // Initialize the SSE transport with headers
- // TODO: Migrate to HttpClientTransport when available
- this.transport = new SSEClientTransport(this.serverUrl, this.headers);
-
- // Initialize the client
- this.client = new Client({
- name: "cpk-mcp-client",
- version: "0.0.1",
- });
-
- // Set up event handlers
- this.transport.onmessage = this.handleMessage.bind(this);
- this.transport.onerror = this.handleError.bind(this);
- this.transport.onclose = this.handleClose.bind(this);
- }
-
- private handleMessage(message: JSONRPCMessage): void {
- try {
- this.onMessage(message as Record);
- } catch (error) {
- this.onError(
- error instanceof Error
- ? error
- : new Error(`Failed to handle message: ${error}`)
- );
- }
- }
-
- private handleError(error: Error): void {
- this.onError(error);
- if (this.isConnected) {
- this.isConnected = false;
- // Could implement reconnection logic here
- }
- }
-
- private handleClose(): void {
- this.isConnected = false;
- this.onClose();
- }
-
- /**
- * Connects to the MCP server using SSE (will migrate to HTTP Stream when available)
- */
- public async connect(): Promise {
- try {
- console.log("Connecting to MCP server:", this.serverUrl.href);
-
- // Connect the client (which connects the transport)
- await this.client.connect(this.transport);
-
- this.isConnected = true;
- console.log("Connected to MCP server");
- this.onOpen();
- } catch (error) {
- console.error("Failed to connect to MCP server:", error);
- this.onError(error instanceof Error ? error : new Error(String(error)));
- throw error;
- }
- }
-
- /**
- * Returns a map of tool names to MCPTool objects
- * This method matches the expected CopilotKit interface
- */
- public async tools(): Promise> {
- try {
- // Return from cache if available
- if (this.toolsCache) {
- return this.toolsCache;
- }
-
- // Fetch raw tools data
- const rawToolsResult = await this.client.listTools();
-
- // Transform to the expected format
- const toolsMap: Record = {};
-
- if (rawToolsResult) {
- // If the result has a 'tools' property with an array of tools
- if (
- typeof rawToolsResult === "object" &&
- "tools" in rawToolsResult &&
- Array.isArray(rawToolsResult.tools)
- ) {
- rawToolsResult.tools.forEach((tool: any) => {
- if (tool && typeof tool === "object" && "name" in tool) {
- // Extract required parameters if available
- let requiredParams: string[] = [];
-
- if (
- tool.inputSchema &&
- typeof tool.inputSchema === "object" &&
- "required" in tool.inputSchema &&
- Array.isArray(tool.inputSchema.required)
- ) {
- requiredParams = tool.inputSchema.required;
- }
-
- // Enhanced description with parameter requirements if available
- let enhancedDescription = tool.description || "";
-
- // Add parameter information to the description
- if (requiredParams.length > 0) {
- enhancedDescription += `\nRequired parameters: ${requiredParams.join(
- ", "
- )}`;
- }
-
- // Add example structure if we can derive it from schema
- const exampleInput = this.deriveExampleInput(
- tool.inputSchema,
- tool.name
- );
- if (exampleInput) {
- enhancedDescription += `\nExample usage: ${exampleInput}`;
- }
-
- toolsMap[tool.name] = {
- description: enhancedDescription,
- schema: tool.inputSchema || {},
- execute: async (args: Record) => {
- return this.callTool(tool.name, args);
- },
- };
- }
- });
- }
- // If the result is an array directly
- else if (Array.isArray(rawToolsResult)) {
- rawToolsResult.forEach((tool: any) => {
- if (tool && typeof tool === "object" && "name" in tool) {
- // Extract required parameters if available
- let requiredParams: string[] = [];
-
- if (
- tool.inputSchema &&
- typeof tool.inputSchema === "object" &&
- "required" in tool.inputSchema &&
- Array.isArray(tool.inputSchema.required)
- ) {
- requiredParams = tool.inputSchema.required;
- }
-
- // Enhanced description with parameter requirements if available
- let enhancedDescription = tool.description || "";
-
- // Add parameter information to the description
- if (requiredParams.length > 0) {
- enhancedDescription += `\nRequired parameters: ${requiredParams.join(
- ", "
- )}`;
- }
-
- // Add example structure if we can derive it from schema
- const exampleInput = this.deriveExampleInput(
- tool.inputSchema,
- tool.name
- );
- if (exampleInput) {
- enhancedDescription += `\nExample usage: ${exampleInput}`;
- }
-
- toolsMap[tool.name] = {
- description: enhancedDescription,
- schema: tool.inputSchema || {},
- execute: async (args: Record) => {
- return this.callTool(tool.name, args);
- },
- };
- }
- });
- }
- }
-
- // Cache the result
- this.toolsCache = toolsMap;
-
- return toolsMap;
- } catch (error) {
- console.error("Error fetching tools:", error);
- // Return empty map on error rather than throwing
- return {};
- }
- }
-
- /**
- * Close the connection to the MCP server
- * This method matches the expected CopilotKit interface
- */
- public async close(): Promise {
- return this.disconnect();
- }
-
- /**
- * Disconnects from the MCP server
- * (Legacy method, prefer using close() for compatibility with CopilotKit)
- */
- public async disconnect(): Promise {
- try {
- // Clear the tools cache
- this.toolsCache = null;
-
- // Close the transport connection
- await this.transport.close();
- this.isConnected = false;
- console.log("Disconnected from MCP server");
- } catch (error) {
- console.error("Error disconnecting from MCP server:", error);
- this.onError(error instanceof Error ? error : new Error(String(error)));
- }
- }
-
- /**
- * Call a tool with the given name and arguments
- * @param name Tool name
- * @param args Tool arguments
- * @returns Tool execution result
- */
- public async callTool(
- name: string,
- args: Record
- ): Promise {
- try {
- console.log(
- `Calling tool: ${name} with args:`,
- JSON.stringify(args, null, 2)
- );
-
- // Generic handler for double-nested params structure
- const fixedArgs = this.normalizeToolArgs(args);
-
- // Process string-encoded JSON objects
- const processedArgs = this.processStringifiedJsonArgs(fixedArgs);
-
- // Log the processed arguments
- console.log(
- `Processed args for ${name}:`,
- JSON.stringify(processedArgs, null, 2)
- );
-
- // Call the tool with processed arguments
- return this.client.callTool({
- name: name,
- arguments: processedArgs,
- });
- } catch (error) {
- console.error(`Error calling tool ${name}:`, error);
- throw error;
- }
- }
-
- /**
- * Normalize tool arguments - detects and fixes common patterns in LLM tool calls
- * like double-nested params objects
- */
- private normalizeToolArgs(
- args: Record
- ): Record {
- // Handle double-nested params: { params: { params: { actual data } } }
- if (
- "params" in args &&
- args.params !== null &&
- typeof args.params === "object"
- ) {
- const paramsObj = args.params as Record;
- if ("params" in paramsObj) {
- console.log("Detected double-nested params, fixing structure");
- return paramsObj;
- }
- }
-
- return args;
- }
-
- /**
- * Process arguments to handle cases where JSON strings might be passed instead of objects
- */
- private processStringifiedJsonArgs(
- args: Record
- ): Record {
- const result: Record = {};
-
- // Process each argument to handle potential JSON strings
- for (const [key, value] of Object.entries(args)) {
- if (typeof value === "string") {
- // Try to parse potential JSON strings
- try {
- const parsedValue = JSON.parse(value);
- result[key] = parsedValue;
- } catch (e) {
- // Not valid JSON, keep as string
- result[key] = value;
- }
- } else if (Array.isArray(value)) {
- // Preserve arrays properly
- result[key] = value.map((item) =>
- typeof item === "object" && item !== null
- ? this.processStringifiedJsonArgs(item as Record)
- : item
- );
- } else if (value !== null && typeof value === "object") {
- // Recursively process nested objects
- result[key] = this.processStringifiedJsonArgs(
- value as Record
- );
- } else {
- // Keep other types as-is
- result[key] = value;
- }
- }
-
- return result;
- }
-
- /**
- * Derives an example input structure from a tool's inputSchema
- * This helps the LLM understand how to format requests properly
- */
- private deriveExampleInput(
- inputSchema: any,
- toolName: string
- ): string | null {
- if (!inputSchema) return null;
-
- try {
- // Handle special cases for better guidance
- if (toolName.toLowerCase().includes("asana_create")) {
- return '{ "params": { "data": { "name": "Task name", "notes": "Task description" } } }';
- }
-
- if (inputSchema.type === "object" && inputSchema.properties) {
- // Build a minimal example object
- const example: Record = {};
- const props = inputSchema.properties;
-
- // Add required properties first
- if (Array.isArray(inputSchema.required)) {
- inputSchema.required.forEach((key: string) => {
- if (key in props) {
- if (props[key].type === "object" && props[key].properties) {
- example[key] = this.createExampleObject(props[key]);
- } else if (props[key].type === "string") {
- example[key] = `"Example ${key}"`;
- } else if (props[key].type === "number") {
- example[key] = 123;
- } else if (props[key].type === "boolean") {
- example[key] = true;
- } else {
- example[key] = null;
- }
- }
- });
- }
-
- return JSON.stringify(example, null, 2);
- }
-
- return null;
- } catch (error) {
- console.error("Error creating example input:", error);
- return null;
- }
- }
-
- /**
- * Creates an example object from an object schema
- */
- private createExampleObject(schema: any): Record {
- const result: Record = {};
-
- if (schema.type !== "object" || !schema.properties) {
- return result;
- }
-
- const props = schema.properties;
-
- // Add required properties
- if (Array.isArray(schema.required)) {
- schema.required.forEach((key: string) => {
- if (key in props) {
- if (props[key].type === "object" && props[key].properties) {
- result[key] = this.createExampleObject(props[key]);
- } else if (props[key].type === "string") {
- result[key] = `Example ${key}`;
- } else if (props[key].type === "number") {
- result[key] = 123;
- } else if (props[key].type === "boolean") {
- result[key] = true;
- } else {
- result[key] = null;
- }
- }
- });
- }
-
- return result;
- }
-}
diff --git a/registry/registry/quickstarts/no-agent-framework.tsx b/registry/registry/quickstarts/no-agent-framework.tsx
deleted file mode 100644
index 165009a74b..0000000000
--- a/registry/registry/quickstarts/no-agent-framework.tsx
+++ /dev/null
@@ -1,122 +0,0 @@
-"use client";
-
-import { useFrontendTool, useCopilotReadable } from "@copilotkit/react-core";
-import { CopilotKitCSSProperties, CopilotSidebar, useCopilotChatSuggestions } from "@copilotkit/react-ui";
-import { useState } from "react";
-
-export default function CopilotKitPage() {
- const [themeColor, setThemeColor] = useState("#6366f1");
-
- // 🪁 Frontend Tools: https://docs.copilotkit.ai/guides/frontend-tools
- useFrontendTool({
- name: "setThemeColor",
- description: "Set the theme color of the interface",
- parameters: [{
- name: "themeColor",
- description: "The theme color to set. Make sure to pick nice colors.",
- required: true,
- }],
- handler({ themeColor }) {
- setThemeColor(themeColor);
- },
- });
-
- return (
-
-
-
-
- );
-}
-
-function YourMainContent({ themeColor }: { themeColor: string }) {
- const [proverbs, setProverbs] = useState(['Success is the sum of small efforts, repeated day in and day out.']);
-
- // 🪁 Copilot Suggestions: https://docs.copilotkit.ai/guides/copilot-suggestions
- useCopilotChatSuggestions({
- maxSuggestions: 3,
- minSuggestions: 3,
- instructions: "Give the user 3 options: 'Change theme color' (choose a random hexadecimal color), 'Write a proverb about {topic}' (choose a random topic) or 'Generate a gradient card between {color1} and {color2}' (choose random hexadecimal colors)",
- })
-
- // 🪁 Frontend Readables: https://docs.copilotkit.ai/guides/connect-your-data/frontend
- useCopilotReadable({
- description: "The current list of proverbs",
- value: proverbs,
- })
-
- // 🪁 Frontend Tools: https://docs.copilotkit.ai/guides/frontend-tools
- useFrontendTool({
- name: "addProverb",
- description: "Add a proverb to the list",
- parameters: [{
- name: "proverb",
- description: "The proverb to add. Make it witty, short and concise.",
- required: true,
- }],
- handler: ({ proverb }) => {
- setProverbs([...proverbs, proverb]);
- },
- });
-
- //🪁 Generative UI: https://docs.copilotkit.ai/guides/generative-ui
- useFrontendTool({
- name: "generateGradientCard",
- description: "Generate a card with a card with a background gradient between two colors.",
- parameters: [
- { name: "color1", type: "string", required: true },
- { name: "color2", type: "string", required: true },
- ],
- render: ({ args }) => {
- return (
-
-
{args.color1}
-
{args.color2}
-
- );
- },
- });
-
- return (
-
-
-
Proverbs
-
This is a demonstrative page, but it could be anything you want! 🪁
-
-
- {proverbs.map((proverb, index) => (
-
-
{proverb}
-
-
- ))}
-
- {proverbs.length === 0 &&
- No proverbs yet. Ask the assistant to add some!
-
}
-
-
- );
-}
diff --git a/registry/registry/runtime/langgraph-platform.ts b/registry/registry/runtime/langgraph-platform.ts
deleted file mode 100644
index 887e500033..0000000000
--- a/registry/registry/runtime/langgraph-platform.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import { NextRequest } from "next/server";
-import {
- CopilotRuntime,
- copilotRuntimeNextJSAppRouterEndpoint,
- ExperimentalEmptyAdapter,
- langGraphPlatformEndpoint,
-} from "@copilotkit/runtime";
-
-const serviceAdapter = new ExperimentalEmptyAdapter();
-
-const runtime = new CopilotRuntime({
- remoteEndpoints: [
- langGraphPlatformEndpoint({
- deploymentUrl: process.env.LANGGRAPH_DEPLOYMENT_URL || "",
- langsmithApiKey: process.env.LANGSMITH_API_KEY || "", // only used in LangGraph Platform deployments
- agents: [{
- name: process.env.NEXT_PUBLIC_COPILOTKIT_AGENT_NAME || "",
- description: process.env.NEXT_PUBLIC_COPILOTKIT_AGENT_DESCRIPTION || 'A helpful LLM agent.'
- }]
- }),
- ],
-});
-
-export const POST = async (req: NextRequest) => {
- const { handleRequest } = copilotRuntimeNextJSAppRouterEndpoint({
- runtime,
- serviceAdapter,
- endpoint: "/api/copilotkit",
- });
-
- return handleRequest(req);
-};
diff --git a/registry/registry/runtime/remote-endpoint.ts b/registry/registry/runtime/remote-endpoint.ts
deleted file mode 100644
index 70ea293407..0000000000
--- a/registry/registry/runtime/remote-endpoint.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { NextRequest } from "next/server";
-import {
- CopilotRuntime,
- copilotRuntimeNextJSAppRouterEndpoint,
- ExperimentalEmptyAdapter,
-} from "@copilotkit/runtime";
-
-const serviceAdapter = new ExperimentalEmptyAdapter();
-
-const runtime = new CopilotRuntime({
- remoteEndpoints: [
- { url: process.env.COPILOTKIT_REMOTE_ENDPOINT || "http://localhost:8000/copilotkit" },
- ],
-});
-
-export const POST = async (req: NextRequest) => {
- const { handleRequest } = copilotRuntimeNextJSAppRouterEndpoint({
- runtime,
- serviceAdapter,
- endpoint: "/api/copilotkit",
- });
-
- return handleRequest(req);
-};
diff --git a/registry/registry/runtime/standard.ts b/registry/registry/runtime/standard.ts
deleted file mode 100644
index 3c52d5352b..0000000000
--- a/registry/registry/runtime/standard.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import {
- CopilotRuntime,
- OpenAIAdapter,
- copilotRuntimeNextJSAppRouterEndpoint,
-} from "@copilotkit/runtime";
-import { NextRequest } from "next/server";
-import OpenAI from "openai";
-
-const openai = new OpenAI();
-const serviceAdapter = new OpenAIAdapter({ openai });
-
-const runtime = new CopilotRuntime();
-
-export const POST = async (req: NextRequest) => {
-const { handleRequest } = copilotRuntimeNextJSAppRouterEndpoint({
- runtime,
- serviceAdapter,
- endpoint: req.nextUrl.pathname,
-});
-
-return handleRequest(req);
-};
diff --git a/registry/tailwind.config.ts b/registry/tailwind.config.ts
deleted file mode 100644
index 92a2cd54e3..0000000000
--- a/registry/tailwind.config.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import type { Config } from "tailwindcss"
-import tailwindAnimate from "tailwindcss-animate"
-
-export default {
- darkMode: ["class"],
- content: [
- "./pages/**/*.{js,ts,jsx,tsx,mdx}",
- "./components/**/*.{js,ts,jsx,tsx,mdx}",
- "./app/**/*.{js,ts,jsx,tsx,mdx}",
- "./registry/**/*.{js,ts,jsx,tsx,mdx}",
- ],
- theme: {
- extend: {
- colors: {
- background: 'hsl(var(--background))',
- foreground: 'hsl(var(--foreground))',
- card: {
- DEFAULT: 'hsl(var(--card))',
- foreground: 'hsl(var(--card-foreground))'
- },
- popover: {
- DEFAULT: 'hsl(var(--popover))',
- foreground: 'hsl(var(--popover-foreground))'
- },
- primary: {
- DEFAULT: 'hsl(var(--primary))',
- foreground: 'hsl(var(--primary-foreground))'
- },
- secondary: {
- DEFAULT: 'hsl(var(--secondary))',
- foreground: 'hsl(var(--secondary-foreground))'
- },
- muted: {
- DEFAULT: 'hsl(var(--muted))',
- foreground: 'hsl(var(--muted-foreground))'
- },
- accent: {
- DEFAULT: 'hsl(var(--accent))',
- foreground: 'hsl(var(--accent-foreground))'
- },
- destructive: {
- DEFAULT: 'hsl(var(--destructive))',
- foreground: 'hsl(var(--destructive-foreground))'
- },
- border: 'hsl(var(--border))',
- input: 'hsl(var(--input))',
- ring: 'hsl(var(--ring))',
- chart: {
- '1': 'hsl(var(--chart-1))',
- '2': 'hsl(var(--chart-2))',
- '3': 'hsl(var(--chart-3))',
- '4': 'hsl(var(--chart-4))',
- '5': 'hsl(var(--chart-5))',
- }
- },
- borderRadius: {
- lg: 'var(--radius)',
- md: 'calc(var(--radius) - 2px)',
- sm: 'calc(var(--radius) - 4px)'
- }
- }
- },
- plugins: [tailwindAnimate, require("tailwindcss-animate")],
-} satisfies Config
diff --git a/renovate.json b/renovate.json
index 556351710c..b45bdaa8cd 100644
--- a/renovate.json
+++ b/renovate.json
@@ -46,7 +46,7 @@
"description": "[@copilotkit/*] Dependencies",
"enabled": true,
"matchFileNames": [
- "CopilotKit/packages/**"
+ "src/v1.x/packages/**"
],
"matchPackageNames": [
"*"
diff --git a/CopilotKit/.changeset/README.md b/src/v1.x/.changeset/README.md
similarity index 100%
rename from CopilotKit/.changeset/README.md
rename to src/v1.x/.changeset/README.md
diff --git a/CopilotKit/.changeset/config.json b/src/v1.x/.changeset/config.json
similarity index 100%
rename from CopilotKit/.changeset/config.json
rename to src/v1.x/.changeset/config.json
diff --git a/CopilotKit/.changeset/pre.json b/src/v1.x/.changeset/pre.json
similarity index 100%
rename from CopilotKit/.changeset/pre.json
rename to src/v1.x/.changeset/pre.json
diff --git a/CopilotKit/.eslintrc.js b/src/v1.x/.eslintrc.js
similarity index 100%
rename from CopilotKit/.eslintrc.js
rename to src/v1.x/.eslintrc.js
diff --git a/CopilotKit/.gitignore b/src/v1.x/.gitignore
similarity index 100%
rename from CopilotKit/.gitignore
rename to src/v1.x/.gitignore
diff --git a/CopilotKit/.npmrc b/src/v1.x/.npmrc
similarity index 100%
rename from CopilotKit/.npmrc
rename to src/v1.x/.npmrc
diff --git a/CopilotKit/.prettierignore b/src/v1.x/.prettierignore
similarity index 100%
rename from CopilotKit/.prettierignore
rename to src/v1.x/.prettierignore
diff --git a/CopilotKit/.prettierrc b/src/v1.x/.prettierrc
similarity index 100%
rename from CopilotKit/.prettierrc
rename to src/v1.x/.prettierrc
diff --git a/CopilotKit/.vscode/cspell.json b/src/v1.x/.vscode/cspell.json
similarity index 100%
rename from CopilotKit/.vscode/cspell.json
rename to src/v1.x/.vscode/cspell.json
diff --git a/CopilotKit/.vscode/launch.json b/src/v1.x/.vscode/launch.json
similarity index 96%
rename from CopilotKit/.vscode/launch.json
rename to src/v1.x/.vscode/launch.json
index f78de12cce..f541a57f08 100644
--- a/CopilotKit/.vscode/launch.json
+++ b/src/v1.x/.vscode/launch.json
@@ -15,7 +15,7 @@
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"resolveSourceMapLocations": [
- "${workspaceFolder}/CopilotKit/**",
+ "${workspaceFolder}/src/v1.x/**",
"!**/node_modules/**"
],
"sourceMaps": true
diff --git a/CopilotKit/.vscode/settings.json b/src/v1.x/.vscode/settings.json
similarity index 100%
rename from CopilotKit/.vscode/settings.json
rename to src/v1.x/.vscode/settings.json
diff --git a/CopilotKit/CopilotKit.code-workspace b/src/v1.x/CopilotKit.code-workspace
similarity index 100%
rename from CopilotKit/CopilotKit.code-workspace
rename to src/v1.x/CopilotKit.code-workspace
diff --git a/CopilotKit/changelog.txt b/src/v1.x/changelog.txt
similarity index 100%
rename from CopilotKit/changelog.txt
rename to src/v1.x/changelog.txt
diff --git a/CopilotKit/demo-suggestions-improvement.md b/src/v1.x/demo-suggestions-improvement.md
similarity index 100%
rename from CopilotKit/demo-suggestions-improvement.md
rename to src/v1.x/demo-suggestions-improvement.md
diff --git a/CopilotKit/examples/next-openai/.env.local.example b/src/v1.x/examples/next-openai/.env.local.example
similarity index 100%
rename from CopilotKit/examples/next-openai/.env.local.example
rename to src/v1.x/examples/next-openai/.env.local.example
diff --git a/CopilotKit/examples/next-openai/.eslintrc.js b/src/v1.x/examples/next-openai/.eslintrc.js
similarity index 100%
rename from CopilotKit/examples/next-openai/.eslintrc.js
rename to src/v1.x/examples/next-openai/.eslintrc.js
diff --git a/CopilotKit/examples/next-openai/.gitignore b/src/v1.x/examples/next-openai/.gitignore
similarity index 100%
rename from CopilotKit/examples/next-openai/.gitignore
rename to src/v1.x/examples/next-openai/.gitignore
diff --git a/CopilotKit/examples/next-openai/CHANGELOG.md b/src/v1.x/examples/next-openai/CHANGELOG.md
similarity index 100%
rename from CopilotKit/examples/next-openai/CHANGELOG.md
rename to src/v1.x/examples/next-openai/CHANGELOG.md
diff --git a/CopilotKit/examples/next-openai/Dockerfile b/src/v1.x/examples/next-openai/Dockerfile
similarity index 81%
rename from CopilotKit/examples/next-openai/Dockerfile
rename to src/v1.x/examples/next-openai/Dockerfile
index 630efd37da..0b50c4be42 100644
--- a/CopilotKit/examples/next-openai/Dockerfile
+++ b/src/v1.x/examples/next-openai/Dockerfile
@@ -9,11 +9,11 @@ RUN pnpm i -g turbo
# Production Stage
FROM base AS production
-ARG APP_DIR="CopilotKit/examples/next-openai"
+ARG APP_DIR="src/v1.x/examples/next-openai"
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.8.4 /lambda-adapter /opt/extensions/lambda-adapter
-WORKDIR /app/CopilotKit
-COPY CopilotKit/package.json CopilotKit/pnpm-lock.yaml CopilotKit/pnpm-workspace.yaml ./
+WORKDIR /app/src/v1.x
+COPY src/v1.x/package.json src/v1.x/pnpm-lock.yaml src/v1.x/pnpm-workspace.yaml ./
COPY --parents ${APP_DIR}/**/package.json ./
# Copy the built artifacts from the builder stage
diff --git a/CopilotKit/examples/next-openai/README.md b/src/v1.x/examples/next-openai/README.md
similarity index 100%
rename from CopilotKit/examples/next-openai/README.md
rename to src/v1.x/examples/next-openai/README.md
diff --git a/CopilotKit/examples/next-openai/next-env.d.ts b/src/v1.x/examples/next-openai/next-env.d.ts
similarity index 100%
rename from CopilotKit/examples/next-openai/next-env.d.ts
rename to src/v1.x/examples/next-openai/next-env.d.ts
diff --git a/CopilotKit/examples/next-openai/next.config.js b/src/v1.x/examples/next-openai/next.config.js
similarity index 100%
rename from CopilotKit/examples/next-openai/next.config.js
rename to src/v1.x/examples/next-openai/next.config.js
diff --git a/CopilotKit/examples/next-openai/package.json b/src/v1.x/examples/next-openai/package.json
similarity index 100%
rename from CopilotKit/examples/next-openai/package.json
rename to src/v1.x/examples/next-openai/package.json
diff --git a/CopilotKit/examples/next-openai/postcss.config.js b/src/v1.x/examples/next-openai/postcss.config.js
similarity index 100%
rename from CopilotKit/examples/next-openai/postcss.config.js
rename to src/v1.x/examples/next-openai/postcss.config.js
diff --git a/CopilotKit/examples/next-openai/public/images/GoogleDocs.svg b/src/v1.x/examples/next-openai/public/images/GoogleDocs.svg
similarity index 100%
rename from CopilotKit/examples/next-openai/public/images/GoogleDocs.svg
rename to src/v1.x/examples/next-openai/public/images/GoogleDocs.svg
diff --git a/CopilotKit/examples/next-openai/src/app/api/copilotkit/[[...slug]]/route.ts b/src/v1.x/examples/next-openai/src/app/api/copilotkit/[[...slug]]/route.ts
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/api/copilotkit/[[...slug]]/route.ts
rename to src/v1.x/examples/next-openai/src/app/api/copilotkit/[[...slug]]/route.ts
diff --git a/CopilotKit/examples/next-openai/src/app/api/copilotkit/presentation/route.ts b/src/v1.x/examples/next-openai/src/app/api/copilotkit/presentation/route.ts
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/api/copilotkit/presentation/route.ts
rename to src/v1.x/examples/next-openai/src/app/api/copilotkit/presentation/route.ts
diff --git a/CopilotKit/examples/next-openai/src/app/api/copilotkit/travel/route.ts b/src/v1.x/examples/next-openai/src/app/api/copilotkit/travel/route.ts
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/api/copilotkit/travel/route.ts
rename to src/v1.x/examples/next-openai/src/app/api/copilotkit/travel/route.ts
diff --git a/CopilotKit/examples/next-openai/src/app/api/copilotkit/travel/tavily.ts b/src/v1.x/examples/next-openai/src/app/api/copilotkit/travel/tavily.ts
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/api/copilotkit/travel/tavily.ts
rename to src/v1.x/examples/next-openai/src/app/api/copilotkit/travel/tavily.ts
diff --git a/CopilotKit/examples/next-openai/src/app/api/transcribe/route.ts b/src/v1.x/examples/next-openai/src/app/api/transcribe/route.ts
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/api/transcribe/route.ts
rename to src/v1.x/examples/next-openai/src/app/api/transcribe/route.ts
diff --git a/CopilotKit/examples/next-openai/src/app/api/tts/route.ts b/src/v1.x/examples/next-openai/src/app/api/tts/route.ts
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/api/tts/route.ts
rename to src/v1.x/examples/next-openai/src/app/api/tts/route.ts
diff --git a/CopilotKit/examples/next-openai/src/app/components/ActionButton.tsx b/src/v1.x/examples/next-openai/src/app/components/ActionButton.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/components/ActionButton.tsx
rename to src/v1.x/examples/next-openai/src/app/components/ActionButton.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/components/Presentation.tsx b/src/v1.x/examples/next-openai/src/app/components/Presentation.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/components/Presentation.tsx
rename to src/v1.x/examples/next-openai/src/app/components/Presentation.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/components/ServiceAdapterSelector.tsx b/src/v1.x/examples/next-openai/src/app/components/ServiceAdapterSelector.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/components/ServiceAdapterSelector.tsx
rename to src/v1.x/examples/next-openai/src/app/components/ServiceAdapterSelector.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/components/Slide.tsx b/src/v1.x/examples/next-openai/src/app/components/Slide.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/components/Slide.tsx
rename to src/v1.x/examples/next-openai/src/app/components/Slide.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/components/destination-row.tsx b/src/v1.x/examples/next-openai/src/app/components/destination-row.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/components/destination-row.tsx
rename to src/v1.x/examples/next-openai/src/app/components/destination-row.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/components/destination-table.tsx b/src/v1.x/examples/next-openai/src/app/components/destination-table.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/components/destination-table.tsx
rename to src/v1.x/examples/next-openai/src/app/components/destination-table.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/components/vacation-list.tsx b/src/v1.x/examples/next-openai/src/app/components/vacation-list.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/components/vacation-list.tsx
rename to src/v1.x/examples/next-openai/src/app/components/vacation-list.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/components/vacation-notes.tsx b/src/v1.x/examples/next-openai/src/app/components/vacation-notes.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/components/vacation-notes.tsx
rename to src/v1.x/examples/next-openai/src/app/components/vacation-notes.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/headless/page.tsx b/src/v1.x/examples/next-openai/src/app/headless/page.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/headless/page.tsx
rename to src/v1.x/examples/next-openai/src/app/headless/page.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/layout.tsx b/src/v1.x/examples/next-openai/src/app/layout.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/layout.tsx
rename to src/v1.x/examples/next-openai/src/app/layout.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/multi/page.tsx b/src/v1.x/examples/next-openai/src/app/multi/page.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/multi/page.tsx
rename to src/v1.x/examples/next-openai/src/app/multi/page.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/multi/styles.css b/src/v1.x/examples/next-openai/src/app/multi/styles.css
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/multi/styles.css
rename to src/v1.x/examples/next-openai/src/app/multi/styles.css
diff --git a/CopilotKit/examples/next-openai/src/app/page.tsx b/src/v1.x/examples/next-openai/src/app/page.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/page.tsx
rename to src/v1.x/examples/next-openai/src/app/page.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/actions/useAppendSlide.tsx b/src/v1.x/examples/next-openai/src/app/presentation/actions/useAppendSlide.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/actions/useAppendSlide.tsx
rename to src/v1.x/examples/next-openai/src/app/presentation/actions/useAppendSlide.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/actions/useUpdateSlide.tsx b/src/v1.x/examples/next-openai/src/app/presentation/actions/useUpdateSlide.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/actions/useUpdateSlide.tsx
rename to src/v1.x/examples/next-openai/src/app/presentation/actions/useUpdateSlide.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/components/buttons/ActionButton.tsx b/src/v1.x/examples/next-openai/src/app/presentation/components/buttons/ActionButton.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/components/buttons/ActionButton.tsx
rename to src/v1.x/examples/next-openai/src/app/presentation/components/buttons/ActionButton.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/components/buttons/AddSlideButton.tsx b/src/v1.x/examples/next-openai/src/app/presentation/components/buttons/AddSlideButton.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/components/buttons/AddSlideButton.tsx
rename to src/v1.x/examples/next-openai/src/app/presentation/components/buttons/AddSlideButton.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/components/buttons/DeleteSlideButton.tsx b/src/v1.x/examples/next-openai/src/app/presentation/components/buttons/DeleteSlideButton.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/components/buttons/DeleteSlideButton.tsx
rename to src/v1.x/examples/next-openai/src/app/presentation/components/buttons/DeleteSlideButton.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/components/buttons/GenerateSlideButton.tsx b/src/v1.x/examples/next-openai/src/app/presentation/components/buttons/GenerateSlideButton.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/components/buttons/GenerateSlideButton.tsx
rename to src/v1.x/examples/next-openai/src/app/presentation/components/buttons/GenerateSlideButton.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/components/buttons/NavButton.tsx b/src/v1.x/examples/next-openai/src/app/presentation/components/buttons/NavButton.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/components/buttons/NavButton.tsx
rename to src/v1.x/examples/next-openai/src/app/presentation/components/buttons/NavButton.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/components/buttons/PerformResearchSwitch.tsx b/src/v1.x/examples/next-openai/src/app/presentation/components/buttons/PerformResearchSwitch.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/components/buttons/PerformResearchSwitch.tsx
rename to src/v1.x/examples/next-openai/src/app/presentation/components/buttons/PerformResearchSwitch.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/components/buttons/SpeakCurrentSlideButton.tsx b/src/v1.x/examples/next-openai/src/app/presentation/components/buttons/SpeakCurrentSlideButton.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/components/buttons/SpeakCurrentSlideButton.tsx
rename to src/v1.x/examples/next-openai/src/app/presentation/components/buttons/SpeakCurrentSlideButton.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/components/main/Header.tsx b/src/v1.x/examples/next-openai/src/app/presentation/components/main/Header.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/components/main/Header.tsx
rename to src/v1.x/examples/next-openai/src/app/presentation/components/main/Header.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/components/main/Presentation.tsx b/src/v1.x/examples/next-openai/src/app/presentation/components/main/Presentation.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/components/main/Presentation.tsx
rename to src/v1.x/examples/next-openai/src/app/presentation/components/main/Presentation.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/components/main/Slide.tsx b/src/v1.x/examples/next-openai/src/app/presentation/components/main/Slide.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/components/main/Slide.tsx
rename to src/v1.x/examples/next-openai/src/app/presentation/components/main/Slide.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/components/misc/SlideNumberIndicator.tsx b/src/v1.x/examples/next-openai/src/app/presentation/components/misc/SlideNumberIndicator.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/components/misc/SlideNumberIndicator.tsx
rename to src/v1.x/examples/next-openai/src/app/presentation/components/misc/SlideNumberIndicator.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/components/misc/SlidePreview.tsx b/src/v1.x/examples/next-openai/src/app/presentation/components/misc/SlidePreview.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/components/misc/SlidePreview.tsx
rename to src/v1.x/examples/next-openai/src/app/presentation/components/misc/SlidePreview.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/page.tsx b/src/v1.x/examples/next-openai/src/app/presentation/page.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/page.tsx
rename to src/v1.x/examples/next-openai/src/app/presentation/page.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/styles.css b/src/v1.x/examples/next-openai/src/app/presentation/styles.css
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/styles.css
rename to src/v1.x/examples/next-openai/src/app/presentation/styles.css
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/types.ts b/src/v1.x/examples/next-openai/src/app/presentation/types.ts
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/types.ts
rename to src/v1.x/examples/next-openai/src/app/presentation/types.ts
diff --git a/CopilotKit/examples/next-openai/src/app/presentation/utils/globalAudio.tsx b/src/v1.x/examples/next-openai/src/app/presentation/utils/globalAudio.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/presentation/utils/globalAudio.tsx
rename to src/v1.x/examples/next-openai/src/app/presentation/utils/globalAudio.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/textarea/page.tsx b/src/v1.x/examples/next-openai/src/app/textarea/page.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/textarea/page.tsx
rename to src/v1.x/examples/next-openai/src/app/textarea/page.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/travel/page.tsx b/src/v1.x/examples/next-openai/src/app/travel/page.tsx
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/travel/page.tsx
rename to src/v1.x/examples/next-openai/src/app/travel/page.tsx
diff --git a/CopilotKit/examples/next-openai/src/app/travel/styles.css b/src/v1.x/examples/next-openai/src/app/travel/styles.css
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/travel/styles.css
rename to src/v1.x/examples/next-openai/src/app/travel/styles.css
diff --git a/CopilotKit/examples/next-openai/src/app/utils.ts b/src/v1.x/examples/next-openai/src/app/utils.ts
similarity index 100%
rename from CopilotKit/examples/next-openai/src/app/utils.ts
rename to src/v1.x/examples/next-openai/src/app/utils.ts
diff --git a/CopilotKit/examples/next-openai/src/lib/dynamic-service-adapter.ts b/src/v1.x/examples/next-openai/src/lib/dynamic-service-adapter.ts
similarity index 100%
rename from CopilotKit/examples/next-openai/src/lib/dynamic-service-adapter.ts
rename to src/v1.x/examples/next-openai/src/lib/dynamic-service-adapter.ts
diff --git a/CopilotKit/examples/next-openai/src/styles/globals.css b/src/v1.x/examples/next-openai/src/styles/globals.css
similarity index 100%
rename from CopilotKit/examples/next-openai/src/styles/globals.css
rename to src/v1.x/examples/next-openai/src/styles/globals.css
diff --git a/CopilotKit/examples/next-openai/tailwind.config.js b/src/v1.x/examples/next-openai/tailwind.config.js
similarity index 100%
rename from CopilotKit/examples/next-openai/tailwind.config.js
rename to src/v1.x/examples/next-openai/tailwind.config.js
diff --git a/CopilotKit/examples/next-openai/tsconfig.json b/src/v1.x/examples/next-openai/tsconfig.json
similarity index 100%
rename from CopilotKit/examples/next-openai/tsconfig.json
rename to src/v1.x/examples/next-openai/tsconfig.json
diff --git a/CopilotKit/examples/next-pages-router/.eslintrc.js b/src/v1.x/examples/next-pages-router/.eslintrc.js
similarity index 100%
rename from CopilotKit/examples/next-pages-router/.eslintrc.js
rename to src/v1.x/examples/next-pages-router/.eslintrc.js
diff --git a/CopilotKit/examples/next-pages-router/.gitignore b/src/v1.x/examples/next-pages-router/.gitignore
similarity index 100%
rename from CopilotKit/examples/next-pages-router/.gitignore
rename to src/v1.x/examples/next-pages-router/.gitignore
diff --git a/CopilotKit/examples/next-pages-router/CHANGELOG.md b/src/v1.x/examples/next-pages-router/CHANGELOG.md
similarity index 100%
rename from CopilotKit/examples/next-pages-router/CHANGELOG.md
rename to src/v1.x/examples/next-pages-router/CHANGELOG.md
diff --git a/CopilotKit/examples/next-pages-router/README.md b/src/v1.x/examples/next-pages-router/README.md
similarity index 100%
rename from CopilotKit/examples/next-pages-router/README.md
rename to src/v1.x/examples/next-pages-router/README.md
diff --git a/CopilotKit/examples/next-pages-router/next.config.mjs b/src/v1.x/examples/next-pages-router/next.config.mjs
similarity index 100%
rename from CopilotKit/examples/next-pages-router/next.config.mjs
rename to src/v1.x/examples/next-pages-router/next.config.mjs
diff --git a/CopilotKit/examples/next-pages-router/package.json b/src/v1.x/examples/next-pages-router/package.json
similarity index 100%
rename from CopilotKit/examples/next-pages-router/package.json
rename to src/v1.x/examples/next-pages-router/package.json
diff --git a/CopilotKit/examples/next-pages-router/pages/_app.tsx b/src/v1.x/examples/next-pages-router/pages/_app.tsx
similarity index 100%
rename from CopilotKit/examples/next-pages-router/pages/_app.tsx
rename to src/v1.x/examples/next-pages-router/pages/_app.tsx
diff --git a/CopilotKit/examples/next-pages-router/pages/_document.tsx b/src/v1.x/examples/next-pages-router/pages/_document.tsx
similarity index 100%
rename from CopilotKit/examples/next-pages-router/pages/_document.tsx
rename to src/v1.x/examples/next-pages-router/pages/_document.tsx
diff --git a/CopilotKit/examples/next-pages-router/pages/api/copilotkit.ts b/src/v1.x/examples/next-pages-router/pages/api/copilotkit.ts
similarity index 100%
rename from CopilotKit/examples/next-pages-router/pages/api/copilotkit.ts
rename to src/v1.x/examples/next-pages-router/pages/api/copilotkit.ts
diff --git a/CopilotKit/examples/next-pages-router/pages/api/hello.ts b/src/v1.x/examples/next-pages-router/pages/api/hello.ts
similarity index 100%
rename from CopilotKit/examples/next-pages-router/pages/api/hello.ts
rename to src/v1.x/examples/next-pages-router/pages/api/hello.ts
diff --git a/CopilotKit/examples/next-pages-router/pages/index.tsx b/src/v1.x/examples/next-pages-router/pages/index.tsx
similarity index 100%
rename from CopilotKit/examples/next-pages-router/pages/index.tsx
rename to src/v1.x/examples/next-pages-router/pages/index.tsx
diff --git a/CopilotKit/examples/next-pages-router/postcss.config.mjs b/src/v1.x/examples/next-pages-router/postcss.config.mjs
similarity index 100%
rename from CopilotKit/examples/next-pages-router/postcss.config.mjs
rename to src/v1.x/examples/next-pages-router/postcss.config.mjs
diff --git a/CopilotKit/examples/next-pages-router/public/favicon.ico b/src/v1.x/examples/next-pages-router/public/favicon.ico
similarity index 100%
rename from CopilotKit/examples/next-pages-router/public/favicon.ico
rename to src/v1.x/examples/next-pages-router/public/favicon.ico
diff --git a/CopilotKit/examples/next-pages-router/public/next.svg b/src/v1.x/examples/next-pages-router/public/next.svg
similarity index 100%
rename from CopilotKit/examples/next-pages-router/public/next.svg
rename to src/v1.x/examples/next-pages-router/public/next.svg
diff --git a/CopilotKit/examples/next-pages-router/public/vercel.svg b/src/v1.x/examples/next-pages-router/public/vercel.svg
similarity index 100%
rename from CopilotKit/examples/next-pages-router/public/vercel.svg
rename to src/v1.x/examples/next-pages-router/public/vercel.svg
diff --git a/CopilotKit/examples/next-pages-router/styles/globals.css b/src/v1.x/examples/next-pages-router/styles/globals.css
similarity index 100%
rename from CopilotKit/examples/next-pages-router/styles/globals.css
rename to src/v1.x/examples/next-pages-router/styles/globals.css
diff --git a/CopilotKit/examples/next-pages-router/tailwind.config.ts b/src/v1.x/examples/next-pages-router/tailwind.config.ts
similarity index 100%
rename from CopilotKit/examples/next-pages-router/tailwind.config.ts
rename to src/v1.x/examples/next-pages-router/tailwind.config.ts
diff --git a/CopilotKit/examples/next-pages-router/tsconfig.json b/src/v1.x/examples/next-pages-router/tsconfig.json
similarity index 100%
rename from CopilotKit/examples/next-pages-router/tsconfig.json
rename to src/v1.x/examples/next-pages-router/tsconfig.json
diff --git a/CopilotKit/examples/node-express/.eslintrc.js b/src/v1.x/examples/node-express/.eslintrc.js
similarity index 100%
rename from CopilotKit/examples/node-express/.eslintrc.js
rename to src/v1.x/examples/node-express/.eslintrc.js
diff --git a/CopilotKit/examples/node-express/CHANGELOG.md b/src/v1.x/examples/node-express/CHANGELOG.md
similarity index 100%
rename from CopilotKit/examples/node-express/CHANGELOG.md
rename to src/v1.x/examples/node-express/CHANGELOG.md
diff --git a/CopilotKit/examples/node-express/package.json b/src/v1.x/examples/node-express/package.json
similarity index 100%
rename from CopilotKit/examples/node-express/package.json
rename to src/v1.x/examples/node-express/package.json
diff --git a/CopilotKit/examples/node-express/src/index.ts b/src/v1.x/examples/node-express/src/index.ts
similarity index 100%
rename from CopilotKit/examples/node-express/src/index.ts
rename to src/v1.x/examples/node-express/src/index.ts
diff --git a/CopilotKit/examples/node-express/tsconfig.json b/src/v1.x/examples/node-express/tsconfig.json
similarity index 100%
rename from CopilotKit/examples/node-express/tsconfig.json
rename to src/v1.x/examples/node-express/tsconfig.json
diff --git a/CopilotKit/examples/node-http/.eslintrc.js b/src/v1.x/examples/node-http/.eslintrc.js
similarity index 100%
rename from CopilotKit/examples/node-http/.eslintrc.js
rename to src/v1.x/examples/node-http/.eslintrc.js
diff --git a/CopilotKit/examples/node-http/CHANGELOG.md b/src/v1.x/examples/node-http/CHANGELOG.md
similarity index 100%
rename from CopilotKit/examples/node-http/CHANGELOG.md
rename to src/v1.x/examples/node-http/CHANGELOG.md
diff --git a/CopilotKit/examples/node-http/package.json b/src/v1.x/examples/node-http/package.json
similarity index 100%
rename from CopilotKit/examples/node-http/package.json
rename to src/v1.x/examples/node-http/package.json
diff --git a/CopilotKit/examples/node-http/src/index.ts b/src/v1.x/examples/node-http/src/index.ts
similarity index 100%
rename from CopilotKit/examples/node-http/src/index.ts
rename to src/v1.x/examples/node-http/src/index.ts
diff --git a/CopilotKit/examples/node-http/tsconfig.json b/src/v1.x/examples/node-http/tsconfig.json
similarity index 100%
rename from CopilotKit/examples/node-http/tsconfig.json
rename to src/v1.x/examples/node-http/tsconfig.json
diff --git a/CopilotKit/package.json b/src/v1.x/package.json
similarity index 100%
rename from CopilotKit/package.json
rename to src/v1.x/package.json
diff --git a/CopilotKit/packages/a2ui-renderer/CHANGELOG.md b/src/v1.x/packages/a2ui-renderer/CHANGELOG.md
similarity index 100%
rename from CopilotKit/packages/a2ui-renderer/CHANGELOG.md
rename to src/v1.x/packages/a2ui-renderer/CHANGELOG.md
diff --git a/CopilotKit/packages/a2ui-renderer/eslint.config.js b/src/v1.x/packages/a2ui-renderer/eslint.config.js
similarity index 100%
rename from CopilotKit/packages/a2ui-renderer/eslint.config.js
rename to src/v1.x/packages/a2ui-renderer/eslint.config.js
diff --git a/CopilotKit/packages/a2ui-renderer/package.json b/src/v1.x/packages/a2ui-renderer/package.json
similarity index 100%
rename from CopilotKit/packages/a2ui-renderer/package.json
rename to src/v1.x/packages/a2ui-renderer/package.json
diff --git a/CopilotKit/packages/a2ui-renderer/src/A2UIMessageRenderer.tsx b/src/v1.x/packages/a2ui-renderer/src/A2UIMessageRenderer.tsx
similarity index 100%
rename from CopilotKit/packages/a2ui-renderer/src/A2UIMessageRenderer.tsx
rename to src/v1.x/packages/a2ui-renderer/src/A2UIMessageRenderer.tsx
diff --git a/CopilotKit/packages/a2ui-renderer/src/A2UIViewer.tsx b/src/v1.x/packages/a2ui-renderer/src/A2UIViewer.tsx
similarity index 100%
rename from CopilotKit/packages/a2ui-renderer/src/A2UIViewer.tsx
rename to src/v1.x/packages/a2ui-renderer/src/A2UIViewer.tsx
diff --git a/CopilotKit/packages/a2ui-renderer/src/index.ts b/src/v1.x/packages/a2ui-renderer/src/index.ts
similarity index 100%
rename from CopilotKit/packages/a2ui-renderer/src/index.ts
rename to src/v1.x/packages/a2ui-renderer/src/index.ts
diff --git a/CopilotKit/packages/a2ui-renderer/src/styles/components.ts b/src/v1.x/packages/a2ui-renderer/src/styles/components.ts
similarity index 100%
rename from CopilotKit/packages/a2ui-renderer/src/styles/components.ts
rename to src/v1.x/packages/a2ui-renderer/src/styles/components.ts
diff --git a/CopilotKit/packages/a2ui-renderer/src/styles/global.ts b/src/v1.x/packages/a2ui-renderer/src/styles/global.ts
similarity index 100%
rename from CopilotKit/packages/a2ui-renderer/src/styles/global.ts
rename to src/v1.x/packages/a2ui-renderer/src/styles/global.ts
diff --git a/CopilotKit/packages/a2ui-renderer/src/theme/viewer-theme.ts b/src/v1.x/packages/a2ui-renderer/src/theme/viewer-theme.ts
similarity index 100%
rename from CopilotKit/packages/a2ui-renderer/src/theme/viewer-theme.ts
rename to src/v1.x/packages/a2ui-renderer/src/theme/viewer-theme.ts
diff --git a/CopilotKit/packages/a2ui-renderer/src/themed-surface.ts b/src/v1.x/packages/a2ui-renderer/src/themed-surface.ts
similarity index 100%
rename from CopilotKit/packages/a2ui-renderer/src/themed-surface.ts
rename to src/v1.x/packages/a2ui-renderer/src/themed-surface.ts
diff --git a/CopilotKit/packages/a2ui-renderer/tsconfig.json b/src/v1.x/packages/a2ui-renderer/tsconfig.json
similarity index 100%
rename from CopilotKit/packages/a2ui-renderer/tsconfig.json
rename to src/v1.x/packages/a2ui-renderer/tsconfig.json
diff --git a/CopilotKit/packages/react-core/CHANGELOG.md b/src/v1.x/packages/react-core/CHANGELOG.md
similarity index 100%
rename from CopilotKit/packages/react-core/CHANGELOG.md
rename to src/v1.x/packages/react-core/CHANGELOG.md
diff --git a/CopilotKit/packages/react-core/README.md b/src/v1.x/packages/react-core/README.md
similarity index 100%
rename from CopilotKit/packages/react-core/README.md
rename to src/v1.x/packages/react-core/README.md
diff --git a/CopilotKit/packages/react-core/jest.config.js b/src/v1.x/packages/react-core/jest.config.js
similarity index 100%
rename from CopilotKit/packages/react-core/jest.config.js
rename to src/v1.x/packages/react-core/jest.config.js
diff --git a/CopilotKit/packages/react-core/package.json b/src/v1.x/packages/react-core/package.json
similarity index 100%
rename from CopilotKit/packages/react-core/package.json
rename to src/v1.x/packages/react-core/package.json
diff --git a/CopilotKit/packages/react-core/src/components/CopilotListeners.tsx b/src/v1.x/packages/react-core/src/components/CopilotListeners.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/components/CopilotListeners.tsx
rename to src/v1.x/packages/react-core/src/components/CopilotListeners.tsx
diff --git a/CopilotKit/packages/react-core/src/components/copilot-provider/__tests__/copilotkit-error.test.tsx b/src/v1.x/packages/react-core/src/components/copilot-provider/__tests__/copilotkit-error.test.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/components/copilot-provider/__tests__/copilotkit-error.test.tsx
rename to src/v1.x/packages/react-core/src/components/copilot-provider/__tests__/copilotkit-error.test.tsx
diff --git a/CopilotKit/packages/react-core/src/components/copilot-provider/copilot-messages.tsx b/src/v1.x/packages/react-core/src/components/copilot-provider/copilot-messages.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/components/copilot-provider/copilot-messages.tsx
rename to src/v1.x/packages/react-core/src/components/copilot-provider/copilot-messages.tsx
diff --git a/CopilotKit/packages/react-core/src/components/copilot-provider/copilotkit-props.tsx b/src/v1.x/packages/react-core/src/components/copilot-provider/copilotkit-props.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/components/copilot-provider/copilotkit-props.tsx
rename to src/v1.x/packages/react-core/src/components/copilot-provider/copilotkit-props.tsx
diff --git a/CopilotKit/packages/react-core/src/components/copilot-provider/copilotkit.tsx b/src/v1.x/packages/react-core/src/components/copilot-provider/copilotkit.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/components/copilot-provider/copilotkit.tsx
rename to src/v1.x/packages/react-core/src/components/copilot-provider/copilotkit.tsx
diff --git a/CopilotKit/packages/react-core/src/components/copilot-provider/index.ts b/src/v1.x/packages/react-core/src/components/copilot-provider/index.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/components/copilot-provider/index.ts
rename to src/v1.x/packages/react-core/src/components/copilot-provider/index.ts
diff --git a/CopilotKit/packages/react-core/src/components/dev-console/console-trigger.tsx b/src/v1.x/packages/react-core/src/components/dev-console/console-trigger.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/components/dev-console/console-trigger.tsx
rename to src/v1.x/packages/react-core/src/components/dev-console/console-trigger.tsx
diff --git a/CopilotKit/packages/react-core/src/components/dev-console/developer-console-modal.tsx b/src/v1.x/packages/react-core/src/components/dev-console/developer-console-modal.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/components/dev-console/developer-console-modal.tsx
rename to src/v1.x/packages/react-core/src/components/dev-console/developer-console-modal.tsx
diff --git a/CopilotKit/packages/react-core/src/components/dev-console/icons.tsx b/src/v1.x/packages/react-core/src/components/dev-console/icons.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/components/dev-console/icons.tsx
rename to src/v1.x/packages/react-core/src/components/dev-console/icons.tsx
diff --git a/CopilotKit/packages/react-core/src/components/error-boundary/error-boundary.tsx b/src/v1.x/packages/react-core/src/components/error-boundary/error-boundary.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/components/error-boundary/error-boundary.tsx
rename to src/v1.x/packages/react-core/src/components/error-boundary/error-boundary.tsx
diff --git a/CopilotKit/packages/react-core/src/components/error-boundary/error-utils.tsx b/src/v1.x/packages/react-core/src/components/error-boundary/error-utils.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/components/error-boundary/error-utils.tsx
rename to src/v1.x/packages/react-core/src/components/error-boundary/error-utils.tsx
diff --git a/CopilotKit/packages/react-core/src/components/index.ts b/src/v1.x/packages/react-core/src/components/index.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/components/index.ts
rename to src/v1.x/packages/react-core/src/components/index.ts
diff --git a/CopilotKit/packages/react-core/src/components/toast/exclamation-mark-icon.tsx b/src/v1.x/packages/react-core/src/components/toast/exclamation-mark-icon.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/components/toast/exclamation-mark-icon.tsx
rename to src/v1.x/packages/react-core/src/components/toast/exclamation-mark-icon.tsx
diff --git a/CopilotKit/packages/react-core/src/components/toast/toast-provider.tsx b/src/v1.x/packages/react-core/src/components/toast/toast-provider.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/components/toast/toast-provider.tsx
rename to src/v1.x/packages/react-core/src/components/toast/toast-provider.tsx
diff --git a/CopilotKit/packages/react-core/src/components/usage-banner.tsx b/src/v1.x/packages/react-core/src/components/usage-banner.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/components/usage-banner.tsx
rename to src/v1.x/packages/react-core/src/components/usage-banner.tsx
diff --git a/CopilotKit/packages/react-core/src/context/coagent-state-renders-context.tsx b/src/v1.x/packages/react-core/src/context/coagent-state-renders-context.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/context/coagent-state-renders-context.tsx
rename to src/v1.x/packages/react-core/src/context/coagent-state-renders-context.tsx
diff --git a/CopilotKit/packages/react-core/src/context/copilot-context.tsx b/src/v1.x/packages/react-core/src/context/copilot-context.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/context/copilot-context.tsx
rename to src/v1.x/packages/react-core/src/context/copilot-context.tsx
diff --git a/CopilotKit/packages/react-core/src/context/copilot-messages-context.tsx b/src/v1.x/packages/react-core/src/context/copilot-messages-context.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/context/copilot-messages-context.tsx
rename to src/v1.x/packages/react-core/src/context/copilot-messages-context.tsx
diff --git a/CopilotKit/packages/react-core/src/context/index.ts b/src/v1.x/packages/react-core/src/context/index.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/context/index.ts
rename to src/v1.x/packages/react-core/src/context/index.ts
diff --git a/CopilotKit/packages/react-core/src/context/threads-context.tsx b/src/v1.x/packages/react-core/src/context/threads-context.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/context/threads-context.tsx
rename to src/v1.x/packages/react-core/src/context/threads-context.tsx
diff --git a/CopilotKit/packages/react-core/src/hooks/__tests__/use-coagent-config.test.ts b/src/v1.x/packages/react-core/src/hooks/__tests__/use-coagent-config.test.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/__tests__/use-coagent-config.test.ts
rename to src/v1.x/packages/react-core/src/hooks/__tests__/use-coagent-config.test.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/index.ts b/src/v1.x/packages/react-core/src/hooks/index.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/index.ts
rename to src/v1.x/packages/react-core/src/hooks/index.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-agent-nodename.ts b/src/v1.x/packages/react-core/src/hooks/use-agent-nodename.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-agent-nodename.ts
rename to src/v1.x/packages/react-core/src/hooks/use-agent-nodename.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-coagent-state-render-bridge.tsx b/src/v1.x/packages/react-core/src/hooks/use-coagent-state-render-bridge.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-coagent-state-render-bridge.tsx
rename to src/v1.x/packages/react-core/src/hooks/use-coagent-state-render-bridge.tsx
diff --git a/CopilotKit/packages/react-core/src/hooks/use-coagent-state-render.ts b/src/v1.x/packages/react-core/src/hooks/use-coagent-state-render.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-coagent-state-render.ts
rename to src/v1.x/packages/react-core/src/hooks/use-coagent-state-render.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-coagent.ts b/src/v1.x/packages/react-core/src/hooks/use-coagent.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-coagent.ts
rename to src/v1.x/packages/react-core/src/hooks/use-coagent.ts
diff --git a/src/v1.x/packages/react-core/src/hooks/use-configure-chat-suggestions.tsx b/src/v1.x/packages/react-core/src/hooks/use-configure-chat-suggestions.tsx
new file mode 100644
index 0000000000..78e4163ba2
--- /dev/null
+++ b/src/v1.x/packages/react-core/src/hooks/use-configure-chat-suggestions.tsx
@@ -0,0 +1,86 @@
+import {
+ useConfigureSuggestions,
+ useCopilotChatConfiguration,
+ useCopilotKit,
+ useSuggestions,
+} from "@copilotkitnext/react";
+import { StaticSuggestionsConfig, Suggestion } from "@copilotkitnext/core";
+import { useCopilotContext } from "../context";
+import { useEffect, useMemo } from "react";
+
+type StaticSuggestionInput = Omit & Partial>;
+
+type StaticSuggestionsConfigInput = Omit & {
+ suggestions: StaticSuggestionInput[];
+};
+
+type DynamicSuggestionsConfigInput = {
+ /**
+ * A prompt or instructions for the GPT to generate suggestions.
+ */
+ instructions: string;
+ /**
+ * The minimum number of suggestions to generate. Defaults to `1`.
+ * @default 1
+ */
+ minSuggestions?: number;
+ /**
+ * The maximum number of suggestions to generate. Defaults to `3`.
+ * @default 1
+ */
+ maxSuggestions?: number;
+
+ /**
+ * Whether the suggestions are available. Defaults to `enabled`.
+ * @default enabled
+ */
+ available?: "enabled" | "disabled" | "always" | "before-first-message" | "after-first-message";
+
+ /**
+ * An optional class name to apply to the suggestions.
+ */
+ className?: string;
+};
+
+export type UseCopilotChatSuggestionsConfiguration =
+ | DynamicSuggestionsConfigInput
+ | StaticSuggestionsConfigInput;
+
+export function useConfigureChatSuggestions(
+ config: UseCopilotChatSuggestionsConfiguration,
+ dependencies: any[] = [],
+): ReturnType {
+ const existingConfig = useCopilotChatConfiguration();
+ const resolvedAgentId = existingConfig?.agentId ?? "default";
+ const { copilotkit } = useCopilotKit();
+
+ const available = config.available === "enabled" ? "always" : config.available;
+
+ const finalSuggestionConfig = {
+ ...config,
+ available,
+ consumerAgentId: resolvedAgentId, // Use chatConfig.agentId here
+ };
+ useConfigureSuggestions(finalSuggestionConfig, dependencies);
+
+ const result = useSuggestions({ agentId: resolvedAgentId });
+
+ useEffect(() => {
+ if (finalSuggestionConfig.available === "disabled") return;
+ const subscription = copilotkit.subscribe({
+ onAgentsChanged: () => {
+ // When agents change, check if our target agent now exists and reload
+ const agent = copilotkit.getAgent(resolvedAgentId);
+ if (agent && !agent.isRunning && !result.suggestions.length) {
+ copilotkit.reloadSuggestions(resolvedAgentId);
+ }
+ },
+ });
+
+ return () => {
+ subscription.unsubscribe();
+ };
+ }, [resolvedAgentId]);
+
+ return result;
+}
diff --git a/CopilotKit/packages/react-core/src/hooks/use-copilot-action.ts b/src/v1.x/packages/react-core/src/hooks/use-copilot-action.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-copilot-action.ts
rename to src/v1.x/packages/react-core/src/hooks/use-copilot-action.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-copilot-additional-instructions.ts b/src/v1.x/packages/react-core/src/hooks/use-copilot-additional-instructions.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-copilot-additional-instructions.ts
rename to src/v1.x/packages/react-core/src/hooks/use-copilot-additional-instructions.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-copilot-authenticated-action.ts b/src/v1.x/packages/react-core/src/hooks/use-copilot-authenticated-action.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-copilot-authenticated-action.ts
rename to src/v1.x/packages/react-core/src/hooks/use-copilot-authenticated-action.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-copilot-chat-headless_c.ts b/src/v1.x/packages/react-core/src/hooks/use-copilot-chat-headless_c.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-copilot-chat-headless_c.ts
rename to src/v1.x/packages/react-core/src/hooks/use-copilot-chat-headless_c.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-copilot-chat-suggestions.tsx b/src/v1.x/packages/react-core/src/hooks/use-copilot-chat-suggestions.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-copilot-chat-suggestions.tsx
rename to src/v1.x/packages/react-core/src/hooks/use-copilot-chat-suggestions.tsx
diff --git a/CopilotKit/packages/react-core/src/hooks/use-copilot-chat.ts b/src/v1.x/packages/react-core/src/hooks/use-copilot-chat.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-copilot-chat.ts
rename to src/v1.x/packages/react-core/src/hooks/use-copilot-chat.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-copilot-chat_internal.ts b/src/v1.x/packages/react-core/src/hooks/use-copilot-chat_internal.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-copilot-chat_internal.ts
rename to src/v1.x/packages/react-core/src/hooks/use-copilot-chat_internal.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-copilot-readable.ts b/src/v1.x/packages/react-core/src/hooks/use-copilot-readable.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-copilot-readable.ts
rename to src/v1.x/packages/react-core/src/hooks/use-copilot-readable.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-copilot-runtime-client.ts b/src/v1.x/packages/react-core/src/hooks/use-copilot-runtime-client.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-copilot-runtime-client.ts
rename to src/v1.x/packages/react-core/src/hooks/use-copilot-runtime-client.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-default-tool.ts b/src/v1.x/packages/react-core/src/hooks/use-default-tool.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-default-tool.ts
rename to src/v1.x/packages/react-core/src/hooks/use-default-tool.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-flat-category-store.ts b/src/v1.x/packages/react-core/src/hooks/use-flat-category-store.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-flat-category-store.ts
rename to src/v1.x/packages/react-core/src/hooks/use-flat-category-store.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-frontend-tool.ts b/src/v1.x/packages/react-core/src/hooks/use-frontend-tool.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-frontend-tool.ts
rename to src/v1.x/packages/react-core/src/hooks/use-frontend-tool.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-human-in-the-loop.ts b/src/v1.x/packages/react-core/src/hooks/use-human-in-the-loop.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-human-in-the-loop.ts
rename to src/v1.x/packages/react-core/src/hooks/use-human-in-the-loop.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-langgraph-interrupt-render.ts b/src/v1.x/packages/react-core/src/hooks/use-langgraph-interrupt-render.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-langgraph-interrupt-render.ts
rename to src/v1.x/packages/react-core/src/hooks/use-langgraph-interrupt-render.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-langgraph-interrupt.ts b/src/v1.x/packages/react-core/src/hooks/use-langgraph-interrupt.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-langgraph-interrupt.ts
rename to src/v1.x/packages/react-core/src/hooks/use-langgraph-interrupt.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-lazy-tool-renderer.tsx b/src/v1.x/packages/react-core/src/hooks/use-lazy-tool-renderer.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-lazy-tool-renderer.tsx
rename to src/v1.x/packages/react-core/src/hooks/use-lazy-tool-renderer.tsx
diff --git a/CopilotKit/packages/react-core/src/hooks/use-make-copilot-document-readable.ts b/src/v1.x/packages/react-core/src/hooks/use-make-copilot-document-readable.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-make-copilot-document-readable.ts
rename to src/v1.x/packages/react-core/src/hooks/use-make-copilot-document-readable.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-render-tool-call.ts b/src/v1.x/packages/react-core/src/hooks/use-render-tool-call.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-render-tool-call.ts
rename to src/v1.x/packages/react-core/src/hooks/use-render-tool-call.ts
diff --git a/CopilotKit/packages/react-core/src/hooks/use-tree.ts b/src/v1.x/packages/react-core/src/hooks/use-tree.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/hooks/use-tree.ts
rename to src/v1.x/packages/react-core/src/hooks/use-tree.ts
diff --git a/CopilotKit/packages/react-core/src/index.tsx b/src/v1.x/packages/react-core/src/index.tsx
similarity index 100%
rename from CopilotKit/packages/react-core/src/index.tsx
rename to src/v1.x/packages/react-core/src/index.tsx
diff --git a/CopilotKit/packages/react-core/src/lib/copilot-task.ts b/src/v1.x/packages/react-core/src/lib/copilot-task.ts
similarity index 97%
rename from CopilotKit/packages/react-core/src/lib/copilot-task.ts
rename to src/v1.x/packages/react-core/src/lib/copilot-task.ts
index 6081f29a6c..f4839bdbba 100644
--- a/CopilotKit/packages/react-core/src/lib/copilot-task.ts
+++ b/src/v1.x/packages/react-core/src/lib/copilot-task.ts
@@ -43,7 +43,7 @@
* }
* ```
*
- * Have a look at the [Presentation Example App](https://github.com/CopilotKit/CopilotKit/blob/main/CopilotKit/examples/next-openai/src/app/presentation/page.tsx) for a more complete example.
+ * Have a look at the [Presentation Example App](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/examples/next-openai/src/app/presentation/page.tsx) for a more complete example.
*/
import {
diff --git a/CopilotKit/packages/react-core/src/lib/index.ts b/src/v1.x/packages/react-core/src/lib/index.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/lib/index.ts
rename to src/v1.x/packages/react-core/src/lib/index.ts
diff --git a/CopilotKit/packages/react-core/src/lib/status-checker.ts b/src/v1.x/packages/react-core/src/lib/status-checker.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/lib/status-checker.ts
rename to src/v1.x/packages/react-core/src/lib/status-checker.ts
diff --git a/CopilotKit/packages/react-core/src/setupTests.ts b/src/v1.x/packages/react-core/src/setupTests.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/setupTests.ts
rename to src/v1.x/packages/react-core/src/setupTests.ts
diff --git a/CopilotKit/packages/react-core/src/types/chat-suggestion-configuration.ts b/src/v1.x/packages/react-core/src/types/chat-suggestion-configuration.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/types/chat-suggestion-configuration.ts
rename to src/v1.x/packages/react-core/src/types/chat-suggestion-configuration.ts
diff --git a/CopilotKit/packages/react-core/src/types/coagent-action.ts b/src/v1.x/packages/react-core/src/types/coagent-action.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/types/coagent-action.ts
rename to src/v1.x/packages/react-core/src/types/coagent-action.ts
diff --git a/CopilotKit/packages/react-core/src/types/coagent-state.ts b/src/v1.x/packages/react-core/src/types/coagent-state.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/types/coagent-state.ts
rename to src/v1.x/packages/react-core/src/types/coagent-state.ts
diff --git a/CopilotKit/packages/react-core/src/types/crew.ts b/src/v1.x/packages/react-core/src/types/crew.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/types/crew.ts
rename to src/v1.x/packages/react-core/src/types/crew.ts
diff --git a/CopilotKit/packages/react-core/src/types/document-pointer.ts b/src/v1.x/packages/react-core/src/types/document-pointer.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/types/document-pointer.ts
rename to src/v1.x/packages/react-core/src/types/document-pointer.ts
diff --git a/CopilotKit/packages/react-core/src/types/frontend-action.ts b/src/v1.x/packages/react-core/src/types/frontend-action.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/types/frontend-action.ts
rename to src/v1.x/packages/react-core/src/types/frontend-action.ts
diff --git a/CopilotKit/packages/react-core/src/types/index.ts b/src/v1.x/packages/react-core/src/types/index.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/types/index.ts
rename to src/v1.x/packages/react-core/src/types/index.ts
diff --git a/CopilotKit/packages/react-core/src/types/interrupt-action.ts b/src/v1.x/packages/react-core/src/types/interrupt-action.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/types/interrupt-action.ts
rename to src/v1.x/packages/react-core/src/types/interrupt-action.ts
diff --git a/CopilotKit/packages/react-core/src/types/system-message.ts b/src/v1.x/packages/react-core/src/types/system-message.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/types/system-message.ts
rename to src/v1.x/packages/react-core/src/types/system-message.ts
diff --git a/CopilotKit/packages/react-core/src/utils/dev-console.ts b/src/v1.x/packages/react-core/src/utils/dev-console.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/utils/dev-console.ts
rename to src/v1.x/packages/react-core/src/utils/dev-console.ts
diff --git a/CopilotKit/packages/react-core/src/utils/index.ts b/src/v1.x/packages/react-core/src/utils/index.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/utils/index.ts
rename to src/v1.x/packages/react-core/src/utils/index.ts
diff --git a/CopilotKit/packages/react-core/src/utils/suggestions-constants.ts b/src/v1.x/packages/react-core/src/utils/suggestions-constants.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/utils/suggestions-constants.ts
rename to src/v1.x/packages/react-core/src/utils/suggestions-constants.ts
diff --git a/CopilotKit/packages/react-core/src/utils/utils.test.ts b/src/v1.x/packages/react-core/src/utils/utils.test.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/utils/utils.test.ts
rename to src/v1.x/packages/react-core/src/utils/utils.test.ts
diff --git a/CopilotKit/packages/react-core/src/utils/utils.ts b/src/v1.x/packages/react-core/src/utils/utils.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/utils/utils.ts
rename to src/v1.x/packages/react-core/src/utils/utils.ts
diff --git a/CopilotKit/packages/react-core/src/v2/index.css b/src/v1.x/packages/react-core/src/v2/index.css
similarity index 100%
rename from CopilotKit/packages/react-core/src/v2/index.css
rename to src/v1.x/packages/react-core/src/v2/index.css
diff --git a/CopilotKit/packages/react-core/src/v2/index.ts b/src/v1.x/packages/react-core/src/v2/index.ts
similarity index 100%
rename from CopilotKit/packages/react-core/src/v2/index.ts
rename to src/v1.x/packages/react-core/src/v2/index.ts
diff --git a/CopilotKit/packages/react-core/tsconfig.json b/src/v1.x/packages/react-core/tsconfig.json
similarity index 100%
rename from CopilotKit/packages/react-core/tsconfig.json
rename to src/v1.x/packages/react-core/tsconfig.json
diff --git a/CopilotKit/packages/react-core/tsup.config.ts b/src/v1.x/packages/react-core/tsup.config.ts
similarity index 81%
rename from CopilotKit/packages/react-core/tsup.config.ts
rename to src/v1.x/packages/react-core/tsup.config.ts
index 208ea3de3e..e759bd3458 100644
--- a/CopilotKit/packages/react-core/tsup.config.ts
+++ b/src/v1.x/packages/react-core/tsup.config.ts
@@ -10,7 +10,7 @@ export default defineConfig((options: Options) => ({
format: ["esm", "cjs"],
dts: true,
minify: false,
- external: ["react"],
+ external: ["react", "@copilotkitnext/core", "@copilotkitnext/react"],
sourcemap: true,
...options,
}));
diff --git a/CopilotKit/packages/react-core/typedoc.json b/src/v1.x/packages/react-core/typedoc.json
similarity index 100%
rename from CopilotKit/packages/react-core/typedoc.json
rename to src/v1.x/packages/react-core/typedoc.json
diff --git a/CopilotKit/packages/react-textarea/CHANGELOG.md b/src/v1.x/packages/react-textarea/CHANGELOG.md
similarity index 100%
rename from CopilotKit/packages/react-textarea/CHANGELOG.md
rename to src/v1.x/packages/react-textarea/CHANGELOG.md
diff --git a/CopilotKit/packages/react-textarea/README.md b/src/v1.x/packages/react-textarea/README.md
similarity index 100%
rename from CopilotKit/packages/react-textarea/README.md
rename to src/v1.x/packages/react-textarea/README.md
diff --git a/CopilotKit/packages/react-textarea/jest.config.js b/src/v1.x/packages/react-textarea/jest.config.js
similarity index 100%
rename from CopilotKit/packages/react-textarea/jest.config.js
rename to src/v1.x/packages/react-textarea/jest.config.js
diff --git a/CopilotKit/packages/react-textarea/package.json b/src/v1.x/packages/react-textarea/package.json
similarity index 100%
rename from CopilotKit/packages/react-textarea/package.json
rename to src/v1.x/packages/react-textarea/package.json
diff --git a/CopilotKit/packages/react-textarea/postcss.config.js b/src/v1.x/packages/react-textarea/postcss.config.js
similarity index 100%
rename from CopilotKit/packages/react-textarea/postcss.config.js
rename to src/v1.x/packages/react-textarea/postcss.config.js
diff --git a/CopilotKit/packages/react-textarea/src/components/base-copilot-textarea/base-copilot-textarea.css b/src/v1.x/packages/react-textarea/src/components/base-copilot-textarea/base-copilot-textarea.css
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/base-copilot-textarea/base-copilot-textarea.css
rename to src/v1.x/packages/react-textarea/src/components/base-copilot-textarea/base-copilot-textarea.css
diff --git a/CopilotKit/packages/react-textarea/src/components/base-copilot-textarea/base-copilot-textarea.tsx b/src/v1.x/packages/react-textarea/src/components/base-copilot-textarea/base-copilot-textarea.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/base-copilot-textarea/base-copilot-textarea.tsx
rename to src/v1.x/packages/react-textarea/src/components/base-copilot-textarea/base-copilot-textarea.tsx
diff --git a/CopilotKit/packages/react-textarea/src/components/base-copilot-textarea/render-element.tsx b/src/v1.x/packages/react-textarea/src/components/base-copilot-textarea/render-element.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/base-copilot-textarea/render-element.tsx
rename to src/v1.x/packages/react-textarea/src/components/base-copilot-textarea/render-element.tsx
diff --git a/CopilotKit/packages/react-textarea/src/components/base-copilot-textarea/render-placeholder.tsx b/src/v1.x/packages/react-textarea/src/components/base-copilot-textarea/render-placeholder.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/base-copilot-textarea/render-placeholder.tsx
rename to src/v1.x/packages/react-textarea/src/components/base-copilot-textarea/render-placeholder.tsx
diff --git a/CopilotKit/packages/react-textarea/src/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.tsx b/src/v1.x/packages/react-textarea/src/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.tsx
rename to src/v1.x/packages/react-textarea/src/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.tsx
diff --git a/CopilotKit/packages/react-textarea/src/components/base-copilot-textarea/use-add-branding-css.tsx b/src/v1.x/packages/react-textarea/src/components/base-copilot-textarea/use-add-branding-css.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/base-copilot-textarea/use-add-branding-css.tsx
rename to src/v1.x/packages/react-textarea/src/components/base-copilot-textarea/use-add-branding-css.tsx
diff --git a/CopilotKit/packages/react-textarea/src/components/copilot-textarea/copilot-textarea.tsx b/src/v1.x/packages/react-textarea/src/components/copilot-textarea/copilot-textarea.tsx
similarity index 95%
rename from CopilotKit/packages/react-textarea/src/components/copilot-textarea/copilot-textarea.tsx
rename to src/v1.x/packages/react-textarea/src/components/copilot-textarea/copilot-textarea.tsx
index 49801f19c4..442083efe6 100644
--- a/CopilotKit/packages/react-textarea/src/components/copilot-textarea/copilot-textarea.tsx
+++ b/src/v1.x/packages/react-textarea/src/components/copilot-textarea/copilot-textarea.tsx
@@ -105,7 +105,7 @@ export interface CopilotTextareaProps
extends Omit {
/**
* Configuration settings for the autosuggestions feature.
- * For full reference, [check the interface on GitHub](https://github.com/CopilotKit/CopilotKit/blob/main/CopilotKit/packages/react-textarea/src/types/base/base-copilot-textarea-props.tsx#L8).
+ * For full reference, [check the interface on GitHub](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/packages/react-textarea/src/types/base/base-copilot-textarea-props.tsx#L8).
*
*
* The purpose of the text area in plain text.
@@ -119,10 +119,10 @@ export interface CopilotTextareaProps
* NOTE: You must provide specify at least one of `suggestionsApiConfig` or `insertionApiConfig`.
*
*
- * For full reference, please [click here](https://github.com/CopilotKit/CopilotKit/blob/main/CopilotKit/packages/react-textarea/src/types/autosuggestions-config/suggestions-api-config.tsx#L4).
+ * For full reference, please [click here](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/packages/react-textarea/src/types/autosuggestions-config/suggestions-api-config.tsx#L4).
*
*
- * For full reference, please [click here](https://github.com/CopilotKit/CopilotKit/blob/main/CopilotKit/packages/react-textarea/src/types/autosuggestions-config/insertions-api-config.tsx#L4).
+ * For full reference, please [click here](https://github.com/CopilotKit/CopilotKit/blob/main/src/v1.x/packages/react-textarea/src/types/autosuggestions-config/insertions-api-config.tsx#L4).
*
*
*
diff --git a/CopilotKit/packages/react-textarea/src/components/hovering-toolbar/hovering-editor-provider.tsx b/src/v1.x/packages/react-textarea/src/components/hovering-toolbar/hovering-editor-provider.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/hovering-toolbar/hovering-editor-provider.tsx
rename to src/v1.x/packages/react-textarea/src/components/hovering-toolbar/hovering-editor-provider.tsx
diff --git a/CopilotKit/packages/react-textarea/src/components/hovering-toolbar/hovering-toolbar-components.tsx b/src/v1.x/packages/react-textarea/src/components/hovering-toolbar/hovering-toolbar-components.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/hovering-toolbar/hovering-toolbar-components.tsx
rename to src/v1.x/packages/react-textarea/src/components/hovering-toolbar/hovering-toolbar-components.tsx
diff --git a/CopilotKit/packages/react-textarea/src/components/hovering-toolbar/hovering-toolbar.tsx b/src/v1.x/packages/react-textarea/src/components/hovering-toolbar/hovering-toolbar.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/hovering-toolbar/hovering-toolbar.tsx
rename to src/v1.x/packages/react-textarea/src/components/hovering-toolbar/hovering-toolbar.tsx
diff --git a/CopilotKit/packages/react-textarea/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx b/src/v1.x/packages/react-textarea/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx
rename to src/v1.x/packages/react-textarea/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx
diff --git a/CopilotKit/packages/react-textarea/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.tsx b/src/v1.x/packages/react-textarea/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.tsx
rename to src/v1.x/packages/react-textarea/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.tsx
diff --git a/CopilotKit/packages/react-textarea/src/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.tsx b/src/v1.x/packages/react-textarea/src/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.tsx
rename to src/v1.x/packages/react-textarea/src/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.tsx
diff --git a/CopilotKit/packages/react-textarea/src/components/hovering-toolbar/text-insertion-prompt-box/index.ts b/src/v1.x/packages/react-textarea/src/components/hovering-toolbar/text-insertion-prompt-box/index.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/hovering-toolbar/text-insertion-prompt-box/index.ts
rename to src/v1.x/packages/react-textarea/src/components/hovering-toolbar/text-insertion-prompt-box/index.ts
diff --git a/CopilotKit/packages/react-textarea/src/components/index.ts b/src/v1.x/packages/react-textarea/src/components/index.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/index.ts
rename to src/v1.x/packages/react-textarea/src/components/index.ts
diff --git a/CopilotKit/packages/react-textarea/src/components/manual-ui/chip-with-icon.tsx b/src/v1.x/packages/react-textarea/src/components/manual-ui/chip-with-icon.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/manual-ui/chip-with-icon.tsx
rename to src/v1.x/packages/react-textarea/src/components/manual-ui/chip-with-icon.tsx
diff --git a/CopilotKit/packages/react-textarea/src/components/source-search-box/source-search-box.tsx b/src/v1.x/packages/react-textarea/src/components/source-search-box/source-search-box.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/source-search-box/source-search-box.tsx
rename to src/v1.x/packages/react-textarea/src/components/source-search-box/source-search-box.tsx
diff --git a/CopilotKit/packages/react-textarea/src/components/ui/button.tsx b/src/v1.x/packages/react-textarea/src/components/ui/button.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/ui/button.tsx
rename to src/v1.x/packages/react-textarea/src/components/ui/button.tsx
diff --git a/CopilotKit/packages/react-textarea/src/components/ui/command.tsx b/src/v1.x/packages/react-textarea/src/components/ui/command.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/ui/command.tsx
rename to src/v1.x/packages/react-textarea/src/components/ui/command.tsx
diff --git a/CopilotKit/packages/react-textarea/src/components/ui/dialog.tsx b/src/v1.x/packages/react-textarea/src/components/ui/dialog.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/ui/dialog.tsx
rename to src/v1.x/packages/react-textarea/src/components/ui/dialog.tsx
diff --git a/CopilotKit/packages/react-textarea/src/components/ui/label.tsx b/src/v1.x/packages/react-textarea/src/components/ui/label.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/components/ui/label.tsx
rename to src/v1.x/packages/react-textarea/src/components/ui/label.tsx
diff --git a/CopilotKit/packages/react-textarea/src/context/index.ts b/src/v1.x/packages/react-textarea/src/context/index.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/context/index.ts
rename to src/v1.x/packages/react-textarea/src/context/index.ts
diff --git a/CopilotKit/packages/react-textarea/src/hooks/base-copilot-textarea-implementation/use-autosuggestions.ts b/src/v1.x/packages/react-textarea/src/hooks/base-copilot-textarea-implementation/use-autosuggestions.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/hooks/base-copilot-textarea-implementation/use-autosuggestions.ts
rename to src/v1.x/packages/react-textarea/src/hooks/base-copilot-textarea-implementation/use-autosuggestions.ts
diff --git a/CopilotKit/packages/react-textarea/src/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.tsx b/src/v1.x/packages/react-textarea/src/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.tsx
rename to src/v1.x/packages/react-textarea/src/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.tsx
diff --git a/CopilotKit/packages/react-textarea/src/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.ts b/src/v1.x/packages/react-textarea/src/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.ts
rename to src/v1.x/packages/react-textarea/src/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.ts
diff --git a/CopilotKit/packages/react-textarea/src/hooks/index.ts b/src/v1.x/packages/react-textarea/src/hooks/index.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/hooks/index.ts
rename to src/v1.x/packages/react-textarea/src/hooks/index.ts
diff --git a/CopilotKit/packages/react-textarea/src/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.tsx b/src/v1.x/packages/react-textarea/src/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.tsx
rename to src/v1.x/packages/react-textarea/src/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.tsx
diff --git a/CopilotKit/packages/react-textarea/src/hooks/make-autosuggestions-function/use-make-standard-insertion-function.tsx b/src/v1.x/packages/react-textarea/src/hooks/make-autosuggestions-function/use-make-standard-insertion-function.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/hooks/make-autosuggestions-function/use-make-standard-insertion-function.tsx
rename to src/v1.x/packages/react-textarea/src/hooks/make-autosuggestions-function/use-make-standard-insertion-function.tsx
diff --git a/CopilotKit/packages/react-textarea/src/hooks/misc/use-autosize-textarea.tsx b/src/v1.x/packages/react-textarea/src/hooks/misc/use-autosize-textarea.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/hooks/misc/use-autosize-textarea.tsx
rename to src/v1.x/packages/react-textarea/src/hooks/misc/use-autosize-textarea.tsx
diff --git a/CopilotKit/packages/react-textarea/src/index.tsx b/src/v1.x/packages/react-textarea/src/index.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/index.tsx
rename to src/v1.x/packages/react-textarea/src/index.tsx
diff --git a/CopilotKit/packages/react-textarea/src/lib/debouncer.ts b/src/v1.x/packages/react-textarea/src/lib/debouncer.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/lib/debouncer.ts
rename to src/v1.x/packages/react-textarea/src/lib/debouncer.ts
diff --git a/CopilotKit/packages/react-textarea/src/lib/editor-to-text.ts b/src/v1.x/packages/react-textarea/src/lib/editor-to-text.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/lib/editor-to-text.ts
rename to src/v1.x/packages/react-textarea/src/lib/editor-to-text.ts
diff --git a/CopilotKit/packages/react-textarea/src/lib/get-text-around-cursor.ts b/src/v1.x/packages/react-textarea/src/lib/get-text-around-cursor.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/lib/get-text-around-cursor.ts
rename to src/v1.x/packages/react-textarea/src/lib/get-text-around-cursor.ts
diff --git a/CopilotKit/packages/react-textarea/src/lib/retry.tsx b/src/v1.x/packages/react-textarea/src/lib/retry.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/lib/retry.tsx
rename to src/v1.x/packages/react-textarea/src/lib/retry.tsx
diff --git a/CopilotKit/packages/react-textarea/src/lib/slatejs-edits/add-autocompletions.ts b/src/v1.x/packages/react-textarea/src/lib/slatejs-edits/add-autocompletions.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/lib/slatejs-edits/add-autocompletions.ts
rename to src/v1.x/packages/react-textarea/src/lib/slatejs-edits/add-autocompletions.ts
diff --git a/CopilotKit/packages/react-textarea/src/lib/slatejs-edits/clear-autocompletions.ts b/src/v1.x/packages/react-textarea/src/lib/slatejs-edits/clear-autocompletions.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/lib/slatejs-edits/clear-autocompletions.ts
rename to src/v1.x/packages/react-textarea/src/lib/slatejs-edits/clear-autocompletions.ts
diff --git a/CopilotKit/packages/react-textarea/src/lib/slatejs-edits/replace-text.ts b/src/v1.x/packages/react-textarea/src/lib/slatejs-edits/replace-text.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/lib/slatejs-edits/replace-text.ts
rename to src/v1.x/packages/react-textarea/src/lib/slatejs-edits/replace-text.ts
diff --git a/CopilotKit/packages/react-textarea/src/lib/slatejs-edits/with-partial-history.ts b/src/v1.x/packages/react-textarea/src/lib/slatejs-edits/with-partial-history.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/lib/slatejs-edits/with-partial-history.ts
rename to src/v1.x/packages/react-textarea/src/lib/slatejs-edits/with-partial-history.ts
diff --git a/CopilotKit/packages/react-textarea/src/lib/stream-promise-flatten.ts b/src/v1.x/packages/react-textarea/src/lib/stream-promise-flatten.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/lib/stream-promise-flatten.ts
rename to src/v1.x/packages/react-textarea/src/lib/stream-promise-flatten.ts
diff --git a/CopilotKit/packages/react-textarea/src/lib/utils.test.ts b/src/v1.x/packages/react-textarea/src/lib/utils.test.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/lib/utils.test.ts
rename to src/v1.x/packages/react-textarea/src/lib/utils.test.ts
diff --git a/CopilotKit/packages/react-textarea/src/lib/utils.ts b/src/v1.x/packages/react-textarea/src/lib/utils.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/lib/utils.ts
rename to src/v1.x/packages/react-textarea/src/lib/utils.ts
diff --git a/CopilotKit/packages/react-textarea/src/styles.css b/src/v1.x/packages/react-textarea/src/styles.css
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/styles.css
rename to src/v1.x/packages/react-textarea/src/styles.css
diff --git a/CopilotKit/packages/react-textarea/src/types/autosuggestions-config/autosuggestions-config-user-specified.tsx b/src/v1.x/packages/react-textarea/src/types/autosuggestions-config/autosuggestions-config-user-specified.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/types/autosuggestions-config/autosuggestions-config-user-specified.tsx
rename to src/v1.x/packages/react-textarea/src/types/autosuggestions-config/autosuggestions-config-user-specified.tsx
diff --git a/CopilotKit/packages/react-textarea/src/types/autosuggestions-config/autosuggestions-config.tsx b/src/v1.x/packages/react-textarea/src/types/autosuggestions-config/autosuggestions-config.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/types/autosuggestions-config/autosuggestions-config.tsx
rename to src/v1.x/packages/react-textarea/src/types/autosuggestions-config/autosuggestions-config.tsx
diff --git a/CopilotKit/packages/react-textarea/src/types/autosuggestions-config/editing-api-config.tsx b/src/v1.x/packages/react-textarea/src/types/autosuggestions-config/editing-api-config.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/types/autosuggestions-config/editing-api-config.tsx
rename to src/v1.x/packages/react-textarea/src/types/autosuggestions-config/editing-api-config.tsx
diff --git a/CopilotKit/packages/react-textarea/src/types/autosuggestions-config/index.ts b/src/v1.x/packages/react-textarea/src/types/autosuggestions-config/index.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/types/autosuggestions-config/index.ts
rename to src/v1.x/packages/react-textarea/src/types/autosuggestions-config/index.ts
diff --git a/CopilotKit/packages/react-textarea/src/types/autosuggestions-config/insertions-api-config.tsx b/src/v1.x/packages/react-textarea/src/types/autosuggestions-config/insertions-api-config.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/types/autosuggestions-config/insertions-api-config.tsx
rename to src/v1.x/packages/react-textarea/src/types/autosuggestions-config/insertions-api-config.tsx
diff --git a/CopilotKit/packages/react-textarea/src/types/autosuggestions-config/subtypes/make-system-prompt.ts b/src/v1.x/packages/react-textarea/src/types/autosuggestions-config/subtypes/make-system-prompt.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/types/autosuggestions-config/subtypes/make-system-prompt.ts
rename to src/v1.x/packages/react-textarea/src/types/autosuggestions-config/subtypes/make-system-prompt.ts
diff --git a/CopilotKit/packages/react-textarea/src/types/autosuggestions-config/suggestions-api-config.tsx b/src/v1.x/packages/react-textarea/src/types/autosuggestions-config/suggestions-api-config.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/types/autosuggestions-config/suggestions-api-config.tsx
rename to src/v1.x/packages/react-textarea/src/types/autosuggestions-config/suggestions-api-config.tsx
diff --git a/CopilotKit/packages/react-textarea/src/types/base/autosuggestion-state.ts b/src/v1.x/packages/react-textarea/src/types/base/autosuggestion-state.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/types/base/autosuggestion-state.ts
rename to src/v1.x/packages/react-textarea/src/types/base/autosuggestion-state.ts
diff --git a/CopilotKit/packages/react-textarea/src/types/base/autosuggestions-bare-function.ts b/src/v1.x/packages/react-textarea/src/types/base/autosuggestions-bare-function.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/types/base/autosuggestions-bare-function.ts
rename to src/v1.x/packages/react-textarea/src/types/base/autosuggestions-bare-function.ts
diff --git a/CopilotKit/packages/react-textarea/src/types/base/base-autosuggestions-config.tsx b/src/v1.x/packages/react-textarea/src/types/base/base-autosuggestions-config.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/types/base/base-autosuggestions-config.tsx
rename to src/v1.x/packages/react-textarea/src/types/base/base-autosuggestions-config.tsx
diff --git a/CopilotKit/packages/react-textarea/src/types/base/base-copilot-textarea-props.tsx b/src/v1.x/packages/react-textarea/src/types/base/base-copilot-textarea-props.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/types/base/base-copilot-textarea-props.tsx
rename to src/v1.x/packages/react-textarea/src/types/base/base-copilot-textarea-props.tsx
diff --git a/CopilotKit/packages/react-textarea/src/types/base/custom-editor.tsx b/src/v1.x/packages/react-textarea/src/types/base/custom-editor.tsx
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/types/base/custom-editor.tsx
rename to src/v1.x/packages/react-textarea/src/types/base/custom-editor.tsx
diff --git a/CopilotKit/packages/react-textarea/src/types/base/editor-autocomplete-state.ts b/src/v1.x/packages/react-textarea/src/types/base/editor-autocomplete-state.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/types/base/editor-autocomplete-state.ts
rename to src/v1.x/packages/react-textarea/src/types/base/editor-autocomplete-state.ts
diff --git a/CopilotKit/packages/react-textarea/src/types/base/index.ts b/src/v1.x/packages/react-textarea/src/types/base/index.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/types/base/index.ts
rename to src/v1.x/packages/react-textarea/src/types/base/index.ts
diff --git a/CopilotKit/packages/react-textarea/src/types/html-copilot-textarea-element.ts b/src/v1.x/packages/react-textarea/src/types/html-copilot-textarea-element.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/types/html-copilot-textarea-element.ts
rename to src/v1.x/packages/react-textarea/src/types/html-copilot-textarea-element.ts
diff --git a/CopilotKit/packages/react-textarea/src/types/index.ts b/src/v1.x/packages/react-textarea/src/types/index.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/src/types/index.ts
rename to src/v1.x/packages/react-textarea/src/types/index.ts
diff --git a/CopilotKit/packages/react-textarea/tailwind.config.js b/src/v1.x/packages/react-textarea/tailwind.config.js
similarity index 100%
rename from CopilotKit/packages/react-textarea/tailwind.config.js
rename to src/v1.x/packages/react-textarea/tailwind.config.js
diff --git a/CopilotKit/packages/react-textarea/tsconfig.json b/src/v1.x/packages/react-textarea/tsconfig.json
similarity index 100%
rename from CopilotKit/packages/react-textarea/tsconfig.json
rename to src/v1.x/packages/react-textarea/tsconfig.json
diff --git a/CopilotKit/packages/react-textarea/tsup.config.ts b/src/v1.x/packages/react-textarea/tsup.config.ts
similarity index 100%
rename from CopilotKit/packages/react-textarea/tsup.config.ts
rename to src/v1.x/packages/react-textarea/tsup.config.ts
diff --git a/CopilotKit/packages/react-textarea/typedoc.json b/src/v1.x/packages/react-textarea/typedoc.json
similarity index 100%
rename from CopilotKit/packages/react-textarea/typedoc.json
rename to src/v1.x/packages/react-textarea/typedoc.json
diff --git a/CopilotKit/packages/react-ui/CHANGELOG.md b/src/v1.x/packages/react-ui/CHANGELOG.md
similarity index 100%
rename from CopilotKit/packages/react-ui/CHANGELOG.md
rename to src/v1.x/packages/react-ui/CHANGELOG.md
diff --git a/CopilotKit/packages/react-ui/README.md b/src/v1.x/packages/react-ui/README.md
similarity index 100%
rename from CopilotKit/packages/react-ui/README.md
rename to src/v1.x/packages/react-ui/README.md
diff --git a/CopilotKit/packages/react-ui/jest.config.js b/src/v1.x/packages/react-ui/jest.config.js
similarity index 100%
rename from CopilotKit/packages/react-ui/jest.config.js
rename to src/v1.x/packages/react-ui/jest.config.js
diff --git a/CopilotKit/packages/react-ui/package.json b/src/v1.x/packages/react-ui/package.json
similarity index 100%
rename from CopilotKit/packages/react-ui/package.json
rename to src/v1.x/packages/react-ui/package.json
diff --git a/CopilotKit/packages/react-ui/postcss.config.js b/src/v1.x/packages/react-ui/postcss.config.js
similarity index 100%
rename from CopilotKit/packages/react-ui/postcss.config.js
rename to src/v1.x/packages/react-ui/postcss.config.js
diff --git a/CopilotKit/packages/react-ui/src/components/chat/Button.tsx b/src/v1.x/packages/react-ui/src/components/chat/Button.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/Button.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/Button.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/Chat.tsx b/src/v1.x/packages/react-ui/src/components/chat/Chat.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/Chat.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/Chat.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/ChatContext.tsx b/src/v1.x/packages/react-ui/src/components/chat/ChatContext.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/ChatContext.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/ChatContext.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/CodeBlock.tsx b/src/v1.x/packages/react-ui/src/components/chat/CodeBlock.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/CodeBlock.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/CodeBlock.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/Header.tsx b/src/v1.x/packages/react-ui/src/components/chat/Header.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/Header.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/Header.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/Icons.tsx b/src/v1.x/packages/react-ui/src/components/chat/Icons.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/Icons.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/Icons.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/ImageUploadQueue.tsx b/src/v1.x/packages/react-ui/src/components/chat/ImageUploadQueue.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/ImageUploadQueue.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/ImageUploadQueue.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/Input.tsx b/src/v1.x/packages/react-ui/src/components/chat/Input.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/Input.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/Input.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/Markdown.tsx b/src/v1.x/packages/react-ui/src/components/chat/Markdown.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/Markdown.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/Markdown.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/Messages.tsx b/src/v1.x/packages/react-ui/src/components/chat/Messages.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/Messages.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/Messages.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/Modal.tsx b/src/v1.x/packages/react-ui/src/components/chat/Modal.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/Modal.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/Modal.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/Popup.tsx b/src/v1.x/packages/react-ui/src/components/chat/Popup.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/Popup.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/Popup.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/PoweredByTag.tsx b/src/v1.x/packages/react-ui/src/components/chat/PoweredByTag.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/PoweredByTag.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/PoweredByTag.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/Sidebar.tsx b/src/v1.x/packages/react-ui/src/components/chat/Sidebar.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/Sidebar.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/Sidebar.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/Suggestion.tsx b/src/v1.x/packages/react-ui/src/components/chat/Suggestion.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/Suggestion.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/Suggestion.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/Suggestions.tsx b/src/v1.x/packages/react-ui/src/components/chat/Suggestions.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/Suggestions.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/Suggestions.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/Textarea.tsx b/src/v1.x/packages/react-ui/src/components/chat/Textarea.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/Textarea.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/Textarea.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/Window.tsx b/src/v1.x/packages/react-ui/src/components/chat/Window.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/Window.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/Window.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/index.tsx b/src/v1.x/packages/react-ui/src/components/chat/index.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/index.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/index.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/messages/AssistantMessage.tsx b/src/v1.x/packages/react-ui/src/components/chat/messages/AssistantMessage.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/messages/AssistantMessage.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/messages/AssistantMessage.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/messages/ErrorMessage.tsx b/src/v1.x/packages/react-ui/src/components/chat/messages/ErrorMessage.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/messages/ErrorMessage.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/messages/ErrorMessage.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/messages/ImageRenderer.tsx b/src/v1.x/packages/react-ui/src/components/chat/messages/ImageRenderer.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/messages/ImageRenderer.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/messages/ImageRenderer.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/messages/LegacyRenderMessage.tsx b/src/v1.x/packages/react-ui/src/components/chat/messages/LegacyRenderMessage.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/messages/LegacyRenderMessage.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/messages/LegacyRenderMessage.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/messages/RenderMessage.tsx b/src/v1.x/packages/react-ui/src/components/chat/messages/RenderMessage.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/messages/RenderMessage.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/messages/RenderMessage.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/messages/UserMessage.tsx b/src/v1.x/packages/react-ui/src/components/chat/messages/UserMessage.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/messages/UserMessage.tsx
rename to src/v1.x/packages/react-ui/src/components/chat/messages/UserMessage.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/chat/props.ts b/src/v1.x/packages/react-ui/src/components/chat/props.ts
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/chat/props.ts
rename to src/v1.x/packages/react-ui/src/components/chat/props.ts
diff --git a/CopilotKit/packages/react-ui/src/components/dev-console/console.tsx b/src/v1.x/packages/react-ui/src/components/dev-console/console.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/dev-console/console.tsx
rename to src/v1.x/packages/react-ui/src/components/dev-console/console.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/dev-console/icons.tsx b/src/v1.x/packages/react-ui/src/components/dev-console/icons.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/dev-console/icons.tsx
rename to src/v1.x/packages/react-ui/src/components/dev-console/icons.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/dev-console/index.tsx b/src/v1.x/packages/react-ui/src/components/dev-console/index.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/dev-console/index.tsx
rename to src/v1.x/packages/react-ui/src/components/dev-console/index.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/dev-console/types.ts b/src/v1.x/packages/react-ui/src/components/dev-console/types.ts
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/dev-console/types.ts
rename to src/v1.x/packages/react-ui/src/components/dev-console/types.ts
diff --git a/CopilotKit/packages/react-ui/src/components/dev-console/utils.ts b/src/v1.x/packages/react-ui/src/components/dev-console/utils.ts
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/dev-console/utils.ts
rename to src/v1.x/packages/react-ui/src/components/dev-console/utils.ts
diff --git a/CopilotKit/packages/react-ui/src/components/help-modal/icons.tsx b/src/v1.x/packages/react-ui/src/components/help-modal/icons.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/help-modal/icons.tsx
rename to src/v1.x/packages/react-ui/src/components/help-modal/icons.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/help-modal/index.tsx b/src/v1.x/packages/react-ui/src/components/help-modal/index.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/help-modal/index.tsx
rename to src/v1.x/packages/react-ui/src/components/help-modal/index.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/help-modal/modal.tsx b/src/v1.x/packages/react-ui/src/components/help-modal/modal.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/help-modal/modal.tsx
rename to src/v1.x/packages/react-ui/src/components/help-modal/modal.tsx
diff --git a/CopilotKit/packages/react-ui/src/components/index.ts b/src/v1.x/packages/react-ui/src/components/index.ts
similarity index 100%
rename from CopilotKit/packages/react-ui/src/components/index.ts
rename to src/v1.x/packages/react-ui/src/components/index.ts
diff --git a/CopilotKit/packages/react-ui/src/context/index.ts b/src/v1.x/packages/react-ui/src/context/index.ts
similarity index 100%
rename from CopilotKit/packages/react-ui/src/context/index.ts
rename to src/v1.x/packages/react-ui/src/context/index.ts
diff --git a/CopilotKit/packages/react-ui/src/css/animations.css b/src/v1.x/packages/react-ui/src/css/animations.css
similarity index 100%
rename from CopilotKit/packages/react-ui/src/css/animations.css
rename to src/v1.x/packages/react-ui/src/css/animations.css
diff --git a/CopilotKit/packages/react-ui/src/css/button.css b/src/v1.x/packages/react-ui/src/css/button.css
similarity index 100%
rename from CopilotKit/packages/react-ui/src/css/button.css
rename to src/v1.x/packages/react-ui/src/css/button.css
diff --git a/CopilotKit/packages/react-ui/src/css/colors.css b/src/v1.x/packages/react-ui/src/css/colors.css
similarity index 100%
rename from CopilotKit/packages/react-ui/src/css/colors.css
rename to src/v1.x/packages/react-ui/src/css/colors.css
diff --git a/CopilotKit/packages/react-ui/src/css/console.css b/src/v1.x/packages/react-ui/src/css/console.css
similarity index 100%
rename from CopilotKit/packages/react-ui/src/css/console.css
rename to src/v1.x/packages/react-ui/src/css/console.css
diff --git a/CopilotKit/packages/react-ui/src/css/crew.css b/src/v1.x/packages/react-ui/src/css/crew.css
similarity index 100%
rename from CopilotKit/packages/react-ui/src/css/crew.css
rename to src/v1.x/packages/react-ui/src/css/crew.css
diff --git a/CopilotKit/packages/react-ui/src/css/header.css b/src/v1.x/packages/react-ui/src/css/header.css
similarity index 100%
rename from CopilotKit/packages/react-ui/src/css/header.css
rename to src/v1.x/packages/react-ui/src/css/header.css
diff --git a/CopilotKit/packages/react-ui/src/css/input.css b/src/v1.x/packages/react-ui/src/css/input.css
similarity index 100%
rename from CopilotKit/packages/react-ui/src/css/input.css
rename to src/v1.x/packages/react-ui/src/css/input.css
diff --git a/CopilotKit/packages/react-ui/src/css/markdown.css b/src/v1.x/packages/react-ui/src/css/markdown.css
similarity index 100%
rename from CopilotKit/packages/react-ui/src/css/markdown.css
rename to src/v1.x/packages/react-ui/src/css/markdown.css
diff --git a/CopilotKit/packages/react-ui/src/css/messages.css b/src/v1.x/packages/react-ui/src/css/messages.css
similarity index 100%
rename from CopilotKit/packages/react-ui/src/css/messages.css
rename to src/v1.x/packages/react-ui/src/css/messages.css
diff --git a/CopilotKit/packages/react-ui/src/css/panel.css b/src/v1.x/packages/react-ui/src/css/panel.css
similarity index 100%
rename from CopilotKit/packages/react-ui/src/css/panel.css
rename to src/v1.x/packages/react-ui/src/css/panel.css
diff --git a/CopilotKit/packages/react-ui/src/css/popup.css b/src/v1.x/packages/react-ui/src/css/popup.css
similarity index 100%
rename from CopilotKit/packages/react-ui/src/css/popup.css
rename to src/v1.x/packages/react-ui/src/css/popup.css
diff --git a/CopilotKit/packages/react-ui/src/css/sidebar.css b/src/v1.x/packages/react-ui/src/css/sidebar.css
similarity index 100%
rename from CopilotKit/packages/react-ui/src/css/sidebar.css
rename to src/v1.x/packages/react-ui/src/css/sidebar.css
diff --git a/CopilotKit/packages/react-ui/src/css/suggestions.css b/src/v1.x/packages/react-ui/src/css/suggestions.css
similarity index 100%
rename from CopilotKit/packages/react-ui/src/css/suggestions.css
rename to src/v1.x/packages/react-ui/src/css/suggestions.css
diff --git a/CopilotKit/packages/react-ui/src/css/window.css b/src/v1.x/packages/react-ui/src/css/window.css
similarity index 100%
rename from CopilotKit/packages/react-ui/src/css/window.css
rename to src/v1.x/packages/react-ui/src/css/window.css
diff --git a/CopilotKit/packages/react-ui/src/hooks/index.ts b/src/v1.x/packages/react-ui/src/hooks/index.ts
similarity index 100%
rename from CopilotKit/packages/react-ui/src/hooks/index.ts
rename to src/v1.x/packages/react-ui/src/hooks/index.ts
diff --git a/CopilotKit/packages/react-ui/src/hooks/use-copilot-chat-suggestions.tsx b/src/v1.x/packages/react-ui/src/hooks/use-copilot-chat-suggestions.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/hooks/use-copilot-chat-suggestions.tsx
rename to src/v1.x/packages/react-ui/src/hooks/use-copilot-chat-suggestions.tsx
diff --git a/CopilotKit/packages/react-ui/src/hooks/use-copy-to-clipboard.tsx b/src/v1.x/packages/react-ui/src/hooks/use-copy-to-clipboard.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/hooks/use-copy-to-clipboard.tsx
rename to src/v1.x/packages/react-ui/src/hooks/use-copy-to-clipboard.tsx
diff --git a/CopilotKit/packages/react-ui/src/hooks/use-dark-mode.ts b/src/v1.x/packages/react-ui/src/hooks/use-dark-mode.ts
similarity index 100%
rename from CopilotKit/packages/react-ui/src/hooks/use-dark-mode.ts
rename to src/v1.x/packages/react-ui/src/hooks/use-dark-mode.ts
diff --git a/CopilotKit/packages/react-ui/src/hooks/use-push-to-talk.tsx b/src/v1.x/packages/react-ui/src/hooks/use-push-to-talk.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/hooks/use-push-to-talk.tsx
rename to src/v1.x/packages/react-ui/src/hooks/use-push-to-talk.tsx
diff --git a/CopilotKit/packages/react-ui/src/index.tsx b/src/v1.x/packages/react-ui/src/index.tsx
similarity index 100%
rename from CopilotKit/packages/react-ui/src/index.tsx
rename to src/v1.x/packages/react-ui/src/index.tsx
diff --git a/CopilotKit/packages/react-ui/src/lib/utils.test.ts b/src/v1.x/packages/react-ui/src/lib/utils.test.ts
similarity index 100%
rename from CopilotKit/packages/react-ui/src/lib/utils.test.ts
rename to src/v1.x/packages/react-ui/src/lib/utils.test.ts
diff --git a/CopilotKit/packages/react-ui/src/lib/utils.ts b/src/v1.x/packages/react-ui/src/lib/utils.ts
similarity index 100%
rename from CopilotKit/packages/react-ui/src/lib/utils.ts
rename to src/v1.x/packages/react-ui/src/lib/utils.ts
diff --git a/CopilotKit/packages/react-ui/src/styles.css b/src/v1.x/packages/react-ui/src/styles.css
similarity index 100%
rename from CopilotKit/packages/react-ui/src/styles.css
rename to src/v1.x/packages/react-ui/src/styles.css
diff --git a/CopilotKit/packages/react-ui/src/types/css.ts b/src/v1.x/packages/react-ui/src/types/css.ts
similarity index 100%
rename from CopilotKit/packages/react-ui/src/types/css.ts
rename to src/v1.x/packages/react-ui/src/types/css.ts
diff --git a/CopilotKit/packages/react-ui/src/types/index.ts b/src/v1.x/packages/react-ui/src/types/index.ts
similarity index 100%
rename from CopilotKit/packages/react-ui/src/types/index.ts
rename to src/v1.x/packages/react-ui/src/types/index.ts
diff --git a/CopilotKit/packages/react-ui/src/types/suggestions.ts b/src/v1.x/packages/react-ui/src/types/suggestions.ts
similarity index 100%
rename from CopilotKit/packages/react-ui/src/types/suggestions.ts
rename to src/v1.x/packages/react-ui/src/types/suggestions.ts
diff --git a/CopilotKit/packages/react-ui/src/v2/index.ts b/src/v1.x/packages/react-ui/src/v2/index.ts
similarity index 100%
rename from CopilotKit/packages/react-ui/src/v2/index.ts
rename to src/v1.x/packages/react-ui/src/v2/index.ts
diff --git a/CopilotKit/packages/react-ui/src/v2/styles.css b/src/v1.x/packages/react-ui/src/v2/styles.css
similarity index 100%
rename from CopilotKit/packages/react-ui/src/v2/styles.css
rename to src/v1.x/packages/react-ui/src/v2/styles.css
diff --git a/CopilotKit/packages/react-ui/tailwind.config.js b/src/v1.x/packages/react-ui/tailwind.config.js
similarity index 100%
rename from CopilotKit/packages/react-ui/tailwind.config.js
rename to src/v1.x/packages/react-ui/tailwind.config.js
diff --git a/CopilotKit/packages/react-ui/tsconfig.json b/src/v1.x/packages/react-ui/tsconfig.json
similarity index 100%
rename from CopilotKit/packages/react-ui/tsconfig.json
rename to src/v1.x/packages/react-ui/tsconfig.json
diff --git a/CopilotKit/packages/react-ui/tsup.config.ts b/src/v1.x/packages/react-ui/tsup.config.ts
similarity index 79%
rename from CopilotKit/packages/react-ui/tsup.config.ts
rename to src/v1.x/packages/react-ui/tsup.config.ts
index 3124c6528f..0be5c3f6cc 100644
--- a/CopilotKit/packages/react-ui/tsup.config.ts
+++ b/src/v1.x/packages/react-ui/tsup.config.ts
@@ -5,7 +5,7 @@ export default defineConfig((options: Options) => ({
format: ["esm", "cjs"],
dts: true,
minify: false,
- external: ["react"],
+ external: ["react", "@copilotkitnext/core", "@copilotkitnext/react"],
sourcemap: true,
...options,
}));
diff --git a/CopilotKit/packages/react-ui/typedoc.json b/src/v1.x/packages/react-ui/typedoc.json
similarity index 100%
rename from CopilotKit/packages/react-ui/typedoc.json
rename to src/v1.x/packages/react-ui/typedoc.json
diff --git a/CopilotKit/packages/runtime-client-gql/CHANGELOG.md b/src/v1.x/packages/runtime-client-gql/CHANGELOG.md
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/CHANGELOG.md
rename to src/v1.x/packages/runtime-client-gql/CHANGELOG.md
diff --git a/CopilotKit/packages/runtime-client-gql/README.md b/src/v1.x/packages/runtime-client-gql/README.md
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/README.md
rename to src/v1.x/packages/runtime-client-gql/README.md
diff --git a/CopilotKit/packages/runtime-client-gql/codegen.ts b/src/v1.x/packages/runtime-client-gql/codegen.ts
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/codegen.ts
rename to src/v1.x/packages/runtime-client-gql/codegen.ts
diff --git a/CopilotKit/packages/runtime-client-gql/jest.config.js b/src/v1.x/packages/runtime-client-gql/jest.config.js
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/jest.config.js
rename to src/v1.x/packages/runtime-client-gql/jest.config.js
diff --git a/CopilotKit/packages/runtime-client-gql/package.json b/src/v1.x/packages/runtime-client-gql/package.json
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/package.json
rename to src/v1.x/packages/runtime-client-gql/package.json
diff --git a/CopilotKit/packages/runtime-client-gql/src/client/CopilotRuntimeClient.ts b/src/v1.x/packages/runtime-client-gql/src/client/CopilotRuntimeClient.ts
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/src/client/CopilotRuntimeClient.ts
rename to src/v1.x/packages/runtime-client-gql/src/client/CopilotRuntimeClient.ts
diff --git a/CopilotKit/packages/runtime-client-gql/src/client/conversion.ts b/src/v1.x/packages/runtime-client-gql/src/client/conversion.ts
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/src/client/conversion.ts
rename to src/v1.x/packages/runtime-client-gql/src/client/conversion.ts
diff --git a/CopilotKit/packages/runtime-client-gql/src/client/index.ts b/src/v1.x/packages/runtime-client-gql/src/client/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/src/client/index.ts
rename to src/v1.x/packages/runtime-client-gql/src/client/index.ts
diff --git a/CopilotKit/packages/runtime-client-gql/src/client/types.ts b/src/v1.x/packages/runtime-client-gql/src/client/types.ts
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/src/client/types.ts
rename to src/v1.x/packages/runtime-client-gql/src/client/types.ts
diff --git a/CopilotKit/packages/runtime-client-gql/src/graphql/definitions/mutations.ts b/src/v1.x/packages/runtime-client-gql/src/graphql/definitions/mutations.ts
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/src/graphql/definitions/mutations.ts
rename to src/v1.x/packages/runtime-client-gql/src/graphql/definitions/mutations.ts
diff --git a/CopilotKit/packages/runtime-client-gql/src/graphql/definitions/queries.ts b/src/v1.x/packages/runtime-client-gql/src/graphql/definitions/queries.ts
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/src/graphql/definitions/queries.ts
rename to src/v1.x/packages/runtime-client-gql/src/graphql/definitions/queries.ts
diff --git a/CopilotKit/packages/runtime-client-gql/src/index.ts b/src/v1.x/packages/runtime-client-gql/src/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/src/index.ts
rename to src/v1.x/packages/runtime-client-gql/src/index.ts
diff --git a/CopilotKit/packages/runtime-client-gql/src/message-conversion/agui-to-gql.test.ts b/src/v1.x/packages/runtime-client-gql/src/message-conversion/agui-to-gql.test.ts
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/src/message-conversion/agui-to-gql.test.ts
rename to src/v1.x/packages/runtime-client-gql/src/message-conversion/agui-to-gql.test.ts
diff --git a/CopilotKit/packages/runtime-client-gql/src/message-conversion/agui-to-gql.ts b/src/v1.x/packages/runtime-client-gql/src/message-conversion/agui-to-gql.ts
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/src/message-conversion/agui-to-gql.ts
rename to src/v1.x/packages/runtime-client-gql/src/message-conversion/agui-to-gql.ts
diff --git a/CopilotKit/packages/runtime-client-gql/src/message-conversion/gql-to-agui.test.ts b/src/v1.x/packages/runtime-client-gql/src/message-conversion/gql-to-agui.test.ts
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/src/message-conversion/gql-to-agui.test.ts
rename to src/v1.x/packages/runtime-client-gql/src/message-conversion/gql-to-agui.test.ts
diff --git a/CopilotKit/packages/runtime-client-gql/src/message-conversion/gql-to-agui.ts b/src/v1.x/packages/runtime-client-gql/src/message-conversion/gql-to-agui.ts
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/src/message-conversion/gql-to-agui.ts
rename to src/v1.x/packages/runtime-client-gql/src/message-conversion/gql-to-agui.ts
diff --git a/CopilotKit/packages/runtime-client-gql/src/message-conversion/index.ts b/src/v1.x/packages/runtime-client-gql/src/message-conversion/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/src/message-conversion/index.ts
rename to src/v1.x/packages/runtime-client-gql/src/message-conversion/index.ts
diff --git a/CopilotKit/packages/runtime-client-gql/src/message-conversion/roundtrip-conversion.test.ts b/src/v1.x/packages/runtime-client-gql/src/message-conversion/roundtrip-conversion.test.ts
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/src/message-conversion/roundtrip-conversion.test.ts
rename to src/v1.x/packages/runtime-client-gql/src/message-conversion/roundtrip-conversion.test.ts
diff --git a/CopilotKit/packages/runtime-client-gql/tsconfig.json b/src/v1.x/packages/runtime-client-gql/tsconfig.json
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/tsconfig.json
rename to src/v1.x/packages/runtime-client-gql/tsconfig.json
diff --git a/CopilotKit/packages/runtime-client-gql/tsup.config.ts b/src/v1.x/packages/runtime-client-gql/tsup.config.ts
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/tsup.config.ts
rename to src/v1.x/packages/runtime-client-gql/tsup.config.ts
diff --git a/CopilotKit/packages/runtime-client-gql/typedoc.json b/src/v1.x/packages/runtime-client-gql/typedoc.json
similarity index 100%
rename from CopilotKit/packages/runtime-client-gql/typedoc.json
rename to src/v1.x/packages/runtime-client-gql/typedoc.json
diff --git a/CopilotKit/packages/runtime/.eslintrc.js b/src/v1.x/packages/runtime/.eslintrc.js
similarity index 100%
rename from CopilotKit/packages/runtime/.eslintrc.js
rename to src/v1.x/packages/runtime/.eslintrc.js
diff --git a/CopilotKit/packages/runtime/CHANGELOG.md b/src/v1.x/packages/runtime/CHANGELOG.md
similarity index 100%
rename from CopilotKit/packages/runtime/CHANGELOG.md
rename to src/v1.x/packages/runtime/CHANGELOG.md
diff --git a/CopilotKit/packages/runtime/README.md b/src/v1.x/packages/runtime/README.md
similarity index 100%
rename from CopilotKit/packages/runtime/README.md
rename to src/v1.x/packages/runtime/README.md
diff --git a/CopilotKit/packages/runtime/jest.config.js b/src/v1.x/packages/runtime/jest.config.js
similarity index 100%
rename from CopilotKit/packages/runtime/jest.config.js
rename to src/v1.x/packages/runtime/jest.config.js
diff --git a/CopilotKit/packages/runtime/package.json b/src/v1.x/packages/runtime/package.json
similarity index 100%
rename from CopilotKit/packages/runtime/package.json
rename to src/v1.x/packages/runtime/package.json
diff --git a/CopilotKit/packages/runtime/pnpm-lock.yaml b/src/v1.x/packages/runtime/pnpm-lock.yaml
similarity index 100%
rename from CopilotKit/packages/runtime/pnpm-lock.yaml
rename to src/v1.x/packages/runtime/pnpm-lock.yaml
diff --git a/CopilotKit/packages/runtime/scripts/generate-gql-schema.ts b/src/v1.x/packages/runtime/scripts/generate-gql-schema.ts
similarity index 100%
rename from CopilotKit/packages/runtime/scripts/generate-gql-schema.ts
rename to src/v1.x/packages/runtime/scripts/generate-gql-schema.ts
diff --git a/CopilotKit/packages/runtime/src/agents/langgraph/event-source.ts b/src/v1.x/packages/runtime/src/agents/langgraph/event-source.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/agents/langgraph/event-source.ts
rename to src/v1.x/packages/runtime/src/agents/langgraph/event-source.ts
diff --git a/CopilotKit/packages/runtime/src/agents/langgraph/events.ts b/src/v1.x/packages/runtime/src/agents/langgraph/events.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/agents/langgraph/events.ts
rename to src/v1.x/packages/runtime/src/agents/langgraph/events.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/inputs/action.input.ts b/src/v1.x/packages/runtime/src/graphql/inputs/action.input.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/inputs/action.input.ts
rename to src/v1.x/packages/runtime/src/graphql/inputs/action.input.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/inputs/agent-session.input.ts b/src/v1.x/packages/runtime/src/graphql/inputs/agent-session.input.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/inputs/agent-session.input.ts
rename to src/v1.x/packages/runtime/src/graphql/inputs/agent-session.input.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/inputs/agent-state.input.ts b/src/v1.x/packages/runtime/src/graphql/inputs/agent-state.input.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/inputs/agent-state.input.ts
rename to src/v1.x/packages/runtime/src/graphql/inputs/agent-state.input.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/inputs/cloud-guardrails.input.ts b/src/v1.x/packages/runtime/src/graphql/inputs/cloud-guardrails.input.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/inputs/cloud-guardrails.input.ts
rename to src/v1.x/packages/runtime/src/graphql/inputs/cloud-guardrails.input.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/inputs/cloud.input.ts b/src/v1.x/packages/runtime/src/graphql/inputs/cloud.input.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/inputs/cloud.input.ts
rename to src/v1.x/packages/runtime/src/graphql/inputs/cloud.input.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/inputs/context-property.input.ts b/src/v1.x/packages/runtime/src/graphql/inputs/context-property.input.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/inputs/context-property.input.ts
rename to src/v1.x/packages/runtime/src/graphql/inputs/context-property.input.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/inputs/copilot-context.input.ts b/src/v1.x/packages/runtime/src/graphql/inputs/copilot-context.input.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/inputs/copilot-context.input.ts
rename to src/v1.x/packages/runtime/src/graphql/inputs/copilot-context.input.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/inputs/custom-property.input.ts b/src/v1.x/packages/runtime/src/graphql/inputs/custom-property.input.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/inputs/custom-property.input.ts
rename to src/v1.x/packages/runtime/src/graphql/inputs/custom-property.input.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/inputs/extensions.input.ts b/src/v1.x/packages/runtime/src/graphql/inputs/extensions.input.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/inputs/extensions.input.ts
rename to src/v1.x/packages/runtime/src/graphql/inputs/extensions.input.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/inputs/forwarded-parameters.input.ts b/src/v1.x/packages/runtime/src/graphql/inputs/forwarded-parameters.input.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/inputs/forwarded-parameters.input.ts
rename to src/v1.x/packages/runtime/src/graphql/inputs/forwarded-parameters.input.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/inputs/frontend.input.ts b/src/v1.x/packages/runtime/src/graphql/inputs/frontend.input.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/inputs/frontend.input.ts
rename to src/v1.x/packages/runtime/src/graphql/inputs/frontend.input.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/inputs/generate-copilot-response.input.ts b/src/v1.x/packages/runtime/src/graphql/inputs/generate-copilot-response.input.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/inputs/generate-copilot-response.input.ts
rename to src/v1.x/packages/runtime/src/graphql/inputs/generate-copilot-response.input.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/inputs/load-agent-state.input.ts b/src/v1.x/packages/runtime/src/graphql/inputs/load-agent-state.input.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/inputs/load-agent-state.input.ts
rename to src/v1.x/packages/runtime/src/graphql/inputs/load-agent-state.input.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/inputs/message.input.ts b/src/v1.x/packages/runtime/src/graphql/inputs/message.input.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/inputs/message.input.ts
rename to src/v1.x/packages/runtime/src/graphql/inputs/message.input.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/inputs/meta-event.input.ts b/src/v1.x/packages/runtime/src/graphql/inputs/meta-event.input.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/inputs/meta-event.input.ts
rename to src/v1.x/packages/runtime/src/graphql/inputs/meta-event.input.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/message-conversion/agui-to-gql.test.ts b/src/v1.x/packages/runtime/src/graphql/message-conversion/agui-to-gql.test.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/message-conversion/agui-to-gql.test.ts
rename to src/v1.x/packages/runtime/src/graphql/message-conversion/agui-to-gql.test.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/message-conversion/agui-to-gql.ts b/src/v1.x/packages/runtime/src/graphql/message-conversion/agui-to-gql.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/message-conversion/agui-to-gql.ts
rename to src/v1.x/packages/runtime/src/graphql/message-conversion/agui-to-gql.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/message-conversion/gql-to-agui.test.ts b/src/v1.x/packages/runtime/src/graphql/message-conversion/gql-to-agui.test.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/message-conversion/gql-to-agui.test.ts
rename to src/v1.x/packages/runtime/src/graphql/message-conversion/gql-to-agui.test.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/message-conversion/gql-to-agui.ts b/src/v1.x/packages/runtime/src/graphql/message-conversion/gql-to-agui.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/message-conversion/gql-to-agui.ts
rename to src/v1.x/packages/runtime/src/graphql/message-conversion/gql-to-agui.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/message-conversion/index.ts b/src/v1.x/packages/runtime/src/graphql/message-conversion/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/message-conversion/index.ts
rename to src/v1.x/packages/runtime/src/graphql/message-conversion/index.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/message-conversion/roundtrip-conversion.test.ts b/src/v1.x/packages/runtime/src/graphql/message-conversion/roundtrip-conversion.test.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/message-conversion/roundtrip-conversion.test.ts
rename to src/v1.x/packages/runtime/src/graphql/message-conversion/roundtrip-conversion.test.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/resolvers/copilot.resolver.ts b/src/v1.x/packages/runtime/src/graphql/resolvers/copilot.resolver.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/resolvers/copilot.resolver.ts
rename to src/v1.x/packages/runtime/src/graphql/resolvers/copilot.resolver.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/resolvers/state.resolver.ts b/src/v1.x/packages/runtime/src/graphql/resolvers/state.resolver.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/resolvers/state.resolver.ts
rename to src/v1.x/packages/runtime/src/graphql/resolvers/state.resolver.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/types/agents-response.type.ts b/src/v1.x/packages/runtime/src/graphql/types/agents-response.type.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/types/agents-response.type.ts
rename to src/v1.x/packages/runtime/src/graphql/types/agents-response.type.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/types/base/index.ts b/src/v1.x/packages/runtime/src/graphql/types/base/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/types/base/index.ts
rename to src/v1.x/packages/runtime/src/graphql/types/base/index.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/types/converted/index.ts b/src/v1.x/packages/runtime/src/graphql/types/converted/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/types/converted/index.ts
rename to src/v1.x/packages/runtime/src/graphql/types/converted/index.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/types/copilot-response.type.ts b/src/v1.x/packages/runtime/src/graphql/types/copilot-response.type.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/types/copilot-response.type.ts
rename to src/v1.x/packages/runtime/src/graphql/types/copilot-response.type.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/types/enums.ts b/src/v1.x/packages/runtime/src/graphql/types/enums.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/types/enums.ts
rename to src/v1.x/packages/runtime/src/graphql/types/enums.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/types/extensions-response.type.ts b/src/v1.x/packages/runtime/src/graphql/types/extensions-response.type.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/types/extensions-response.type.ts
rename to src/v1.x/packages/runtime/src/graphql/types/extensions-response.type.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/types/guardrails-result.type.ts b/src/v1.x/packages/runtime/src/graphql/types/guardrails-result.type.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/types/guardrails-result.type.ts
rename to src/v1.x/packages/runtime/src/graphql/types/guardrails-result.type.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/types/load-agent-state-response.type.ts b/src/v1.x/packages/runtime/src/graphql/types/load-agent-state-response.type.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/types/load-agent-state-response.type.ts
rename to src/v1.x/packages/runtime/src/graphql/types/load-agent-state-response.type.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/types/message-status.type.ts b/src/v1.x/packages/runtime/src/graphql/types/message-status.type.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/types/message-status.type.ts
rename to src/v1.x/packages/runtime/src/graphql/types/message-status.type.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/types/meta-events.type.ts b/src/v1.x/packages/runtime/src/graphql/types/meta-events.type.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/types/meta-events.type.ts
rename to src/v1.x/packages/runtime/src/graphql/types/meta-events.type.ts
diff --git a/CopilotKit/packages/runtime/src/graphql/types/response-status.type.ts b/src/v1.x/packages/runtime/src/graphql/types/response-status.type.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/graphql/types/response-status.type.ts
rename to src/v1.x/packages/runtime/src/graphql/types/response-status.type.ts
diff --git a/CopilotKit/packages/runtime/src/index.ts b/src/v1.x/packages/runtime/src/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/index.ts
rename to src/v1.x/packages/runtime/src/index.ts
diff --git a/CopilotKit/packages/runtime/src/langgraph.ts b/src/v1.x/packages/runtime/src/langgraph.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/langgraph.ts
rename to src/v1.x/packages/runtime/src/langgraph.ts
diff --git a/CopilotKit/packages/runtime/src/lib/cloud/index.ts b/src/v1.x/packages/runtime/src/lib/cloud/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/cloud/index.ts
rename to src/v1.x/packages/runtime/src/lib/cloud/index.ts
diff --git a/CopilotKit/packages/runtime/src/lib/error-messages.ts b/src/v1.x/packages/runtime/src/lib/error-messages.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/error-messages.ts
rename to src/v1.x/packages/runtime/src/lib/error-messages.ts
diff --git a/CopilotKit/packages/runtime/src/lib/index.ts b/src/v1.x/packages/runtime/src/lib/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/index.ts
rename to src/v1.x/packages/runtime/src/lib/index.ts
diff --git a/CopilotKit/packages/runtime/src/lib/integrations/index.ts b/src/v1.x/packages/runtime/src/lib/integrations/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/integrations/index.ts
rename to src/v1.x/packages/runtime/src/lib/integrations/index.ts
diff --git a/CopilotKit/packages/runtime/src/lib/integrations/nest/index.ts b/src/v1.x/packages/runtime/src/lib/integrations/nest/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/integrations/nest/index.ts
rename to src/v1.x/packages/runtime/src/lib/integrations/nest/index.ts
diff --git a/CopilotKit/packages/runtime/src/lib/integrations/nextjs/app-router.ts b/src/v1.x/packages/runtime/src/lib/integrations/nextjs/app-router.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/integrations/nextjs/app-router.ts
rename to src/v1.x/packages/runtime/src/lib/integrations/nextjs/app-router.ts
diff --git a/CopilotKit/packages/runtime/src/lib/integrations/nextjs/pages-router.ts b/src/v1.x/packages/runtime/src/lib/integrations/nextjs/pages-router.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/integrations/nextjs/pages-router.ts
rename to src/v1.x/packages/runtime/src/lib/integrations/nextjs/pages-router.ts
diff --git a/CopilotKit/packages/runtime/src/lib/integrations/node-express/index.ts b/src/v1.x/packages/runtime/src/lib/integrations/node-express/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/integrations/node-express/index.ts
rename to src/v1.x/packages/runtime/src/lib/integrations/node-express/index.ts
diff --git a/CopilotKit/packages/runtime/src/lib/integrations/node-http/index.ts b/src/v1.x/packages/runtime/src/lib/integrations/node-http/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/integrations/node-http/index.ts
rename to src/v1.x/packages/runtime/src/lib/integrations/node-http/index.ts
diff --git a/CopilotKit/packages/runtime/src/lib/integrations/shared.ts b/src/v1.x/packages/runtime/src/lib/integrations/shared.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/integrations/shared.ts
rename to src/v1.x/packages/runtime/src/lib/integrations/shared.ts
diff --git a/CopilotKit/packages/runtime/src/lib/logger.ts b/src/v1.x/packages/runtime/src/lib/logger.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/logger.ts
rename to src/v1.x/packages/runtime/src/lib/logger.ts
diff --git a/CopilotKit/packages/runtime/src/lib/observability.ts b/src/v1.x/packages/runtime/src/lib/observability.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/observability.ts
rename to src/v1.x/packages/runtime/src/lib/observability.ts
diff --git a/CopilotKit/packages/runtime/src/lib/runtime/__tests__/copilot-runtime-error.test.ts b/src/v1.x/packages/runtime/src/lib/runtime/__tests__/copilot-runtime-error.test.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/runtime/__tests__/copilot-runtime-error.test.ts
rename to src/v1.x/packages/runtime/src/lib/runtime/__tests__/copilot-runtime-error.test.ts
diff --git a/CopilotKit/packages/runtime/src/lib/runtime/__tests__/mcp-tools-utils.test.ts b/src/v1.x/packages/runtime/src/lib/runtime/__tests__/mcp-tools-utils.test.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/runtime/__tests__/mcp-tools-utils.test.ts
rename to src/v1.x/packages/runtime/src/lib/runtime/__tests__/mcp-tools-utils.test.ts
diff --git a/CopilotKit/packages/runtime/src/lib/runtime/agent-integrations/langgraph/agent.ts b/src/v1.x/packages/runtime/src/lib/runtime/agent-integrations/langgraph/agent.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/runtime/agent-integrations/langgraph/agent.ts
rename to src/v1.x/packages/runtime/src/lib/runtime/agent-integrations/langgraph/agent.ts
diff --git a/CopilotKit/packages/runtime/src/lib/runtime/agent-integrations/langgraph/consts.ts b/src/v1.x/packages/runtime/src/lib/runtime/agent-integrations/langgraph/consts.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/runtime/agent-integrations/langgraph/consts.ts
rename to src/v1.x/packages/runtime/src/lib/runtime/agent-integrations/langgraph/consts.ts
diff --git a/CopilotKit/packages/runtime/src/lib/runtime/agent-integrations/langgraph/index.ts b/src/v1.x/packages/runtime/src/lib/runtime/agent-integrations/langgraph/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/runtime/agent-integrations/langgraph/index.ts
rename to src/v1.x/packages/runtime/src/lib/runtime/agent-integrations/langgraph/index.ts
diff --git a/CopilotKit/packages/runtime/src/lib/runtime/copilot-runtime.ts b/src/v1.x/packages/runtime/src/lib/runtime/copilot-runtime.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/runtime/copilot-runtime.ts
rename to src/v1.x/packages/runtime/src/lib/runtime/copilot-runtime.ts
diff --git a/CopilotKit/packages/runtime/src/lib/runtime/mcp-tools-utils.ts b/src/v1.x/packages/runtime/src/lib/runtime/mcp-tools-utils.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/runtime/mcp-tools-utils.ts
rename to src/v1.x/packages/runtime/src/lib/runtime/mcp-tools-utils.ts
diff --git a/CopilotKit/packages/runtime/src/lib/runtime/retry-utils.ts b/src/v1.x/packages/runtime/src/lib/runtime/retry-utils.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/runtime/retry-utils.ts
rename to src/v1.x/packages/runtime/src/lib/runtime/retry-utils.ts
diff --git a/CopilotKit/packages/runtime/src/lib/runtime/telemetry-agent-runner.ts b/src/v1.x/packages/runtime/src/lib/runtime/telemetry-agent-runner.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/runtime/telemetry-agent-runner.ts
rename to src/v1.x/packages/runtime/src/lib/runtime/telemetry-agent-runner.ts
diff --git a/CopilotKit/packages/runtime/src/lib/runtime/types.ts b/src/v1.x/packages/runtime/src/lib/runtime/types.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/runtime/types.ts
rename to src/v1.x/packages/runtime/src/lib/runtime/types.ts
diff --git a/CopilotKit/packages/runtime/src/lib/runtime/utils.ts b/src/v1.x/packages/runtime/src/lib/runtime/utils.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/runtime/utils.ts
rename to src/v1.x/packages/runtime/src/lib/runtime/utils.ts
diff --git a/CopilotKit/packages/runtime/src/lib/streaming.ts b/src/v1.x/packages/runtime/src/lib/streaming.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/streaming.ts
rename to src/v1.x/packages/runtime/src/lib/streaming.ts
diff --git a/CopilotKit/packages/runtime/src/lib/telemetry-client.ts b/src/v1.x/packages/runtime/src/lib/telemetry-client.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/lib/telemetry-client.ts
rename to src/v1.x/packages/runtime/src/lib/telemetry-client.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/anthropic/anthropic-adapter.ts b/src/v1.x/packages/runtime/src/service-adapters/anthropic/anthropic-adapter.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/anthropic/anthropic-adapter.ts
rename to src/v1.x/packages/runtime/src/service-adapters/anthropic/anthropic-adapter.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/anthropic/utils.ts b/src/v1.x/packages/runtime/src/service-adapters/anthropic/utils.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/anthropic/utils.ts
rename to src/v1.x/packages/runtime/src/service-adapters/anthropic/utils.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/bedrock/bedrock-adapter.ts b/src/v1.x/packages/runtime/src/service-adapters/bedrock/bedrock-adapter.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/bedrock/bedrock-adapter.ts
rename to src/v1.x/packages/runtime/src/service-adapters/bedrock/bedrock-adapter.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/conversion.ts b/src/v1.x/packages/runtime/src/service-adapters/conversion.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/conversion.ts
rename to src/v1.x/packages/runtime/src/service-adapters/conversion.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/empty/empty-adapter.ts b/src/v1.x/packages/runtime/src/service-adapters/empty/empty-adapter.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/empty/empty-adapter.ts
rename to src/v1.x/packages/runtime/src/service-adapters/empty/empty-adapter.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/events.ts b/src/v1.x/packages/runtime/src/service-adapters/events.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/events.ts
rename to src/v1.x/packages/runtime/src/service-adapters/events.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/experimental/ollama/ollama-adapter.ts b/src/v1.x/packages/runtime/src/service-adapters/experimental/ollama/ollama-adapter.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/experimental/ollama/ollama-adapter.ts
rename to src/v1.x/packages/runtime/src/service-adapters/experimental/ollama/ollama-adapter.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/google/google-genai-adapter.test.ts b/src/v1.x/packages/runtime/src/service-adapters/google/google-genai-adapter.test.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/google/google-genai-adapter.test.ts
rename to src/v1.x/packages/runtime/src/service-adapters/google/google-genai-adapter.test.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/google/google-genai-adapter.ts b/src/v1.x/packages/runtime/src/service-adapters/google/google-genai-adapter.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/google/google-genai-adapter.ts
rename to src/v1.x/packages/runtime/src/service-adapters/google/google-genai-adapter.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/groq/groq-adapter.ts b/src/v1.x/packages/runtime/src/service-adapters/groq/groq-adapter.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/groq/groq-adapter.ts
rename to src/v1.x/packages/runtime/src/service-adapters/groq/groq-adapter.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/index.ts b/src/v1.x/packages/runtime/src/service-adapters/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/index.ts
rename to src/v1.x/packages/runtime/src/service-adapters/index.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/langchain/langchain-adapter.ts b/src/v1.x/packages/runtime/src/service-adapters/langchain/langchain-adapter.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/langchain/langchain-adapter.ts
rename to src/v1.x/packages/runtime/src/service-adapters/langchain/langchain-adapter.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/langchain/langserve.ts b/src/v1.x/packages/runtime/src/service-adapters/langchain/langserve.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/langchain/langserve.ts
rename to src/v1.x/packages/runtime/src/service-adapters/langchain/langserve.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/langchain/types.ts b/src/v1.x/packages/runtime/src/service-adapters/langchain/types.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/langchain/types.ts
rename to src/v1.x/packages/runtime/src/service-adapters/langchain/types.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/langchain/utils.ts b/src/v1.x/packages/runtime/src/service-adapters/langchain/utils.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/langchain/utils.ts
rename to src/v1.x/packages/runtime/src/service-adapters/langchain/utils.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/openai/openai-adapter.ts b/src/v1.x/packages/runtime/src/service-adapters/openai/openai-adapter.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/openai/openai-adapter.ts
rename to src/v1.x/packages/runtime/src/service-adapters/openai/openai-adapter.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/openai/openai-assistant-adapter.ts b/src/v1.x/packages/runtime/src/service-adapters/openai/openai-assistant-adapter.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/openai/openai-assistant-adapter.ts
rename to src/v1.x/packages/runtime/src/service-adapters/openai/openai-assistant-adapter.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/openai/utils.ts b/src/v1.x/packages/runtime/src/service-adapters/openai/utils.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/openai/utils.ts
rename to src/v1.x/packages/runtime/src/service-adapters/openai/utils.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/service-adapter.ts b/src/v1.x/packages/runtime/src/service-adapters/service-adapter.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/service-adapter.ts
rename to src/v1.x/packages/runtime/src/service-adapters/service-adapter.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/shared/error-utils.ts b/src/v1.x/packages/runtime/src/service-adapters/shared/error-utils.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/shared/error-utils.ts
rename to src/v1.x/packages/runtime/src/service-adapters/shared/error-utils.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/shared/index.ts b/src/v1.x/packages/runtime/src/service-adapters/shared/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/shared/index.ts
rename to src/v1.x/packages/runtime/src/service-adapters/shared/index.ts
diff --git a/CopilotKit/packages/runtime/src/service-adapters/unify/unify-adapter.ts b/src/v1.x/packages/runtime/src/service-adapters/unify/unify-adapter.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/service-adapters/unify/unify-adapter.ts
rename to src/v1.x/packages/runtime/src/service-adapters/unify/unify-adapter.ts
diff --git a/CopilotKit/packages/runtime/src/utils/failed-response-status-reasons.ts b/src/v1.x/packages/runtime/src/utils/failed-response-status-reasons.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/utils/failed-response-status-reasons.ts
rename to src/v1.x/packages/runtime/src/utils/failed-response-status-reasons.ts
diff --git a/CopilotKit/packages/runtime/src/utils/index.ts b/src/v1.x/packages/runtime/src/utils/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/utils/index.ts
rename to src/v1.x/packages/runtime/src/utils/index.ts
diff --git a/CopilotKit/packages/runtime/src/v2/index.ts b/src/v1.x/packages/runtime/src/v2/index.ts
similarity index 100%
rename from CopilotKit/packages/runtime/src/v2/index.ts
rename to src/v1.x/packages/runtime/src/v2/index.ts
diff --git a/CopilotKit/packages/runtime/tests/global.d.ts b/src/v1.x/packages/runtime/tests/global.d.ts
similarity index 100%
rename from CopilotKit/packages/runtime/tests/global.d.ts
rename to src/v1.x/packages/runtime/tests/global.d.ts
diff --git a/CopilotKit/packages/runtime/tests/service-adapters/anthropic/allowlist-approach.test.ts b/src/v1.x/packages/runtime/tests/service-adapters/anthropic/allowlist-approach.test.ts
similarity index 100%
rename from CopilotKit/packages/runtime/tests/service-adapters/anthropic/allowlist-approach.test.ts
rename to src/v1.x/packages/runtime/tests/service-adapters/anthropic/allowlist-approach.test.ts
diff --git a/CopilotKit/packages/runtime/tests/service-adapters/anthropic/anthropic-adapter.test.ts b/src/v1.x/packages/runtime/tests/service-adapters/anthropic/anthropic-adapter.test.ts
similarity index 100%
rename from CopilotKit/packages/runtime/tests/service-adapters/anthropic/anthropic-adapter.test.ts
rename to src/v1.x/packages/runtime/tests/service-adapters/anthropic/anthropic-adapter.test.ts
diff --git a/CopilotKit/packages/runtime/tests/service-adapters/openai/allowlist-approach.test.ts b/src/v1.x/packages/runtime/tests/service-adapters/openai/allowlist-approach.test.ts
similarity index 100%
rename from CopilotKit/packages/runtime/tests/service-adapters/openai/allowlist-approach.test.ts
rename to src/v1.x/packages/runtime/tests/service-adapters/openai/allowlist-approach.test.ts
diff --git a/CopilotKit/packages/runtime/tests/service-adapters/openai/openai-adapter.test.ts b/src/v1.x/packages/runtime/tests/service-adapters/openai/openai-adapter.test.ts
similarity index 100%
rename from CopilotKit/packages/runtime/tests/service-adapters/openai/openai-adapter.test.ts
rename to src/v1.x/packages/runtime/tests/service-adapters/openai/openai-adapter.test.ts
diff --git a/CopilotKit/packages/runtime/tests/setup.jest.ts b/src/v1.x/packages/runtime/tests/setup.jest.ts
similarity index 100%
rename from CopilotKit/packages/runtime/tests/setup.jest.ts
rename to src/v1.x/packages/runtime/tests/setup.jest.ts
diff --git a/CopilotKit/packages/runtime/tests/tsconfig.json b/src/v1.x/packages/runtime/tests/tsconfig.json
similarity index 100%
rename from CopilotKit/packages/runtime/tests/tsconfig.json
rename to src/v1.x/packages/runtime/tests/tsconfig.json
diff --git a/CopilotKit/packages/runtime/tsconfig.json b/src/v1.x/packages/runtime/tsconfig.json
similarity index 100%
rename from CopilotKit/packages/runtime/tsconfig.json
rename to src/v1.x/packages/runtime/tsconfig.json
diff --git a/CopilotKit/packages/runtime/tsup.config.ts b/src/v1.x/packages/runtime/tsup.config.ts
similarity index 100%
rename from CopilotKit/packages/runtime/tsup.config.ts
rename to src/v1.x/packages/runtime/tsup.config.ts
diff --git a/CopilotKit/packages/runtime/typedoc.json b/src/v1.x/packages/runtime/typedoc.json
similarity index 100%
rename from CopilotKit/packages/runtime/typedoc.json
rename to src/v1.x/packages/runtime/typedoc.json
diff --git a/CopilotKit/packages/sdk-js/CHANGELOG.md b/src/v1.x/packages/sdk-js/CHANGELOG.md
similarity index 100%
rename from CopilotKit/packages/sdk-js/CHANGELOG.md
rename to src/v1.x/packages/sdk-js/CHANGELOG.md
diff --git a/CopilotKit/packages/sdk-js/README.md b/src/v1.x/packages/sdk-js/README.md
similarity index 100%
rename from CopilotKit/packages/sdk-js/README.md
rename to src/v1.x/packages/sdk-js/README.md
diff --git a/CopilotKit/packages/sdk-js/jest.config.js b/src/v1.x/packages/sdk-js/jest.config.js
similarity index 100%
rename from CopilotKit/packages/sdk-js/jest.config.js
rename to src/v1.x/packages/sdk-js/jest.config.js
diff --git a/CopilotKit/packages/sdk-js/package.json b/src/v1.x/packages/sdk-js/package.json
similarity index 100%
rename from CopilotKit/packages/sdk-js/package.json
rename to src/v1.x/packages/sdk-js/package.json
diff --git a/CopilotKit/packages/sdk-js/src/__tests__/error-handling.test.ts b/src/v1.x/packages/sdk-js/src/__tests__/error-handling.test.ts
similarity index 100%
rename from CopilotKit/packages/sdk-js/src/__tests__/error-handling.test.ts
rename to src/v1.x/packages/sdk-js/src/__tests__/error-handling.test.ts
diff --git a/CopilotKit/packages/sdk-js/src/index.ts b/src/v1.x/packages/sdk-js/src/index.ts
similarity index 100%
rename from CopilotKit/packages/sdk-js/src/index.ts
rename to src/v1.x/packages/sdk-js/src/index.ts
diff --git a/CopilotKit/packages/sdk-js/src/langchain.ts b/src/v1.x/packages/sdk-js/src/langchain.ts
similarity index 100%
rename from CopilotKit/packages/sdk-js/src/langchain.ts
rename to src/v1.x/packages/sdk-js/src/langchain.ts
diff --git a/CopilotKit/packages/sdk-js/src/langgraph.ts b/src/v1.x/packages/sdk-js/src/langgraph.ts
similarity index 100%
rename from CopilotKit/packages/sdk-js/src/langgraph.ts
rename to src/v1.x/packages/sdk-js/src/langgraph.ts
diff --git a/CopilotKit/packages/sdk-js/tsconfig.json b/src/v1.x/packages/sdk-js/tsconfig.json
similarity index 100%
rename from CopilotKit/packages/sdk-js/tsconfig.json
rename to src/v1.x/packages/sdk-js/tsconfig.json
diff --git a/CopilotKit/packages/sdk-js/tsup.config.ts b/src/v1.x/packages/sdk-js/tsup.config.ts
similarity index 100%
rename from CopilotKit/packages/sdk-js/tsup.config.ts
rename to src/v1.x/packages/sdk-js/tsup.config.ts
diff --git a/CopilotKit/packages/sdk-js/typedoc.json b/src/v1.x/packages/sdk-js/typedoc.json
similarity index 100%
rename from CopilotKit/packages/sdk-js/typedoc.json
rename to src/v1.x/packages/sdk-js/typedoc.json
diff --git a/CopilotKit/packages/shared/CHANGELOG.md b/src/v1.x/packages/shared/CHANGELOG.md
similarity index 100%
rename from CopilotKit/packages/shared/CHANGELOG.md
rename to src/v1.x/packages/shared/CHANGELOG.md
diff --git a/CopilotKit/packages/shared/README.md b/src/v1.x/packages/shared/README.md
similarity index 100%
rename from CopilotKit/packages/shared/README.md
rename to src/v1.x/packages/shared/README.md
diff --git a/CopilotKit/packages/shared/jest.config.js b/src/v1.x/packages/shared/jest.config.js
similarity index 100%
rename from CopilotKit/packages/shared/jest.config.js
rename to src/v1.x/packages/shared/jest.config.js
diff --git a/CopilotKit/packages/shared/package.json b/src/v1.x/packages/shared/package.json
similarity index 100%
rename from CopilotKit/packages/shared/package.json
rename to src/v1.x/packages/shared/package.json
diff --git a/CopilotKit/packages/shared/src/constants/index.ts b/src/v1.x/packages/shared/src/constants/index.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/constants/index.ts
rename to src/v1.x/packages/shared/src/constants/index.ts
diff --git a/CopilotKit/packages/shared/src/index.ts b/src/v1.x/packages/shared/src/index.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/index.ts
rename to src/v1.x/packages/shared/src/index.ts
diff --git a/CopilotKit/packages/shared/src/telemetry/events.ts b/src/v1.x/packages/shared/src/telemetry/events.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/telemetry/events.ts
rename to src/v1.x/packages/shared/src/telemetry/events.ts
diff --git a/CopilotKit/packages/shared/src/telemetry/index.ts b/src/v1.x/packages/shared/src/telemetry/index.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/telemetry/index.ts
rename to src/v1.x/packages/shared/src/telemetry/index.ts
diff --git a/CopilotKit/packages/shared/src/telemetry/scarf-client.ts b/src/v1.x/packages/shared/src/telemetry/scarf-client.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/telemetry/scarf-client.ts
rename to src/v1.x/packages/shared/src/telemetry/scarf-client.ts
diff --git a/CopilotKit/packages/shared/src/telemetry/security-check.ts b/src/v1.x/packages/shared/src/telemetry/security-check.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/telemetry/security-check.ts
rename to src/v1.x/packages/shared/src/telemetry/security-check.ts
diff --git a/CopilotKit/packages/shared/src/telemetry/telemetry-client.ts b/src/v1.x/packages/shared/src/telemetry/telemetry-client.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/telemetry/telemetry-client.ts
rename to src/v1.x/packages/shared/src/telemetry/telemetry-client.ts
diff --git a/CopilotKit/packages/shared/src/telemetry/utils.ts b/src/v1.x/packages/shared/src/telemetry/utils.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/telemetry/utils.ts
rename to src/v1.x/packages/shared/src/telemetry/utils.ts
diff --git a/CopilotKit/packages/shared/src/types/action.ts b/src/v1.x/packages/shared/src/types/action.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/types/action.ts
rename to src/v1.x/packages/shared/src/types/action.ts
diff --git a/CopilotKit/packages/shared/src/types/copilot-cloud-config.ts b/src/v1.x/packages/shared/src/types/copilot-cloud-config.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/types/copilot-cloud-config.ts
rename to src/v1.x/packages/shared/src/types/copilot-cloud-config.ts
diff --git a/CopilotKit/packages/shared/src/types/error.ts b/src/v1.x/packages/shared/src/types/error.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/types/error.ts
rename to src/v1.x/packages/shared/src/types/error.ts
diff --git a/CopilotKit/packages/shared/src/types/index.ts b/src/v1.x/packages/shared/src/types/index.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/types/index.ts
rename to src/v1.x/packages/shared/src/types/index.ts
diff --git a/CopilotKit/packages/shared/src/types/message.ts b/src/v1.x/packages/shared/src/types/message.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/types/message.ts
rename to src/v1.x/packages/shared/src/types/message.ts
diff --git a/CopilotKit/packages/shared/src/types/openai-assistant.ts b/src/v1.x/packages/shared/src/types/openai-assistant.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/types/openai-assistant.ts
rename to src/v1.x/packages/shared/src/types/openai-assistant.ts
diff --git a/CopilotKit/packages/shared/src/types/utility.ts b/src/v1.x/packages/shared/src/types/utility.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/types/utility.ts
rename to src/v1.x/packages/shared/src/types/utility.ts
diff --git a/CopilotKit/packages/shared/src/utils/conditions.ts b/src/v1.x/packages/shared/src/utils/conditions.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/utils/conditions.ts
rename to src/v1.x/packages/shared/src/utils/conditions.ts
diff --git a/CopilotKit/packages/shared/src/utils/console-styling.ts b/src/v1.x/packages/shared/src/utils/console-styling.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/utils/console-styling.ts
rename to src/v1.x/packages/shared/src/utils/console-styling.ts
diff --git a/CopilotKit/packages/shared/src/utils/errors.ts b/src/v1.x/packages/shared/src/utils/errors.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/utils/errors.ts
rename to src/v1.x/packages/shared/src/utils/errors.ts
diff --git a/CopilotKit/packages/shared/src/utils/index.ts b/src/v1.x/packages/shared/src/utils/index.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/utils/index.ts
rename to src/v1.x/packages/shared/src/utils/index.ts
diff --git a/CopilotKit/packages/shared/src/utils/json-schema.test.ts b/src/v1.x/packages/shared/src/utils/json-schema.test.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/utils/json-schema.test.ts
rename to src/v1.x/packages/shared/src/utils/json-schema.test.ts
diff --git a/CopilotKit/packages/shared/src/utils/json-schema.ts b/src/v1.x/packages/shared/src/utils/json-schema.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/utils/json-schema.ts
rename to src/v1.x/packages/shared/src/utils/json-schema.ts
diff --git a/CopilotKit/packages/shared/src/utils/random-id.ts b/src/v1.x/packages/shared/src/utils/random-id.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/utils/random-id.ts
rename to src/v1.x/packages/shared/src/utils/random-id.ts
diff --git a/CopilotKit/packages/shared/src/utils/requests.ts b/src/v1.x/packages/shared/src/utils/requests.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/utils/requests.ts
rename to src/v1.x/packages/shared/src/utils/requests.ts
diff --git a/CopilotKit/packages/shared/src/utils/types.ts b/src/v1.x/packages/shared/src/utils/types.ts
similarity index 100%
rename from CopilotKit/packages/shared/src/utils/types.ts
rename to src/v1.x/packages/shared/src/utils/types.ts
diff --git a/CopilotKit/packages/shared/tsconfig.json b/src/v1.x/packages/shared/tsconfig.json
similarity index 100%
rename from CopilotKit/packages/shared/tsconfig.json
rename to src/v1.x/packages/shared/tsconfig.json
diff --git a/CopilotKit/packages/shared/tsup.config.ts b/src/v1.x/packages/shared/tsup.config.ts
similarity index 100%
rename from CopilotKit/packages/shared/tsup.config.ts
rename to src/v1.x/packages/shared/tsup.config.ts
diff --git a/CopilotKit/packages/shared/typedoc.json b/src/v1.x/packages/shared/typedoc.json
similarity index 100%
rename from CopilotKit/packages/shared/typedoc.json
rename to src/v1.x/packages/shared/typedoc.json
diff --git a/CopilotKit/pnpm-lock.yaml b/src/v1.x/pnpm-lock.yaml
similarity index 99%
rename from CopilotKit/pnpm-lock.yaml
rename to src/v1.x/pnpm-lock.yaml
index 5b85ef3149..e3a092fe42 100644
--- a/CopilotKit/pnpm-lock.yaml
+++ b/src/v1.x/pnpm-lock.yaml
@@ -341,8 +341,8 @@ importers:
specifier: ^0.8.1
version: 0.8.1(signal-polyfill@0.2.2)
'@copilotkit/react-core':
- specifier: ^1.50.1-next.3
- version: 1.50.1-next.3(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(encoding@0.1.13)(graphql@16.12.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(zod@3.25.76)
+ specifier: ^1.50.1
+ version: 1.50.1(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(encoding@0.1.13)(graphql@16.12.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(zod@3.25.76)
'@lit-labs/signals':
specifier: ^0.1.3
version: 0.1.3
@@ -1861,20 +1861,20 @@ packages:
'@chevrotain/utils@11.0.3':
resolution: {integrity: sha512-YslZMgtJUyuMbZ+aKvfF3x1f5liK4mWNxghFRv7jqRR9C3R3fAOGTTKvxXDa2Y1s9zSbcpuO0cAxDYsc9SrXoQ==}
- '@copilotkit/react-core@1.50.1-next.3':
- resolution: {integrity: sha512-+dMDRvZ7eHu7zbD8N3XKIYxviaU6HJND0a252kNDWJKCOT1U50m/gDd/eu0yJzh+kgOIFYU+KvG5taXf4/rqGA==}
+ '@copilotkit/react-core@1.50.1':
+ resolution: {integrity: sha512-L7WdesE1PAP+Ks5kY0NXT+/sZfmx/Vj5t7l4eMQzzLDSvwgLDqvrQCZLJq/PtSLKidrX+z8zDyLJad7YR3L6dQ==}
peerDependencies:
react: ^18 || ^19 || ^19.0.0-rc
react-dom: ^18 || ^19 || ^19.0.0-rc
zod: '>=3.0.0'
- '@copilotkit/runtime-client-gql@1.50.1-next.3':
- resolution: {integrity: sha512-xzlPqxYC1AloUtqQV/07/15H6AVke0RSuk/SF55VxZBvjwzEFdwDWAOk8jf7bYL28lOZZ3Cn2UrkU0fzB3ToPA==}
+ '@copilotkit/runtime-client-gql@1.50.1':
+ resolution: {integrity: sha512-J8TXi2wq4xqoZAPECht4AbD8kxrjn38LEulgCAXXCUm6wsT8Uyt8WVnFT6bODIYee5K4MsXTrITTeH/Y7jviMw==}
peerDependencies:
react: ^18 || ^19 || ^19.0.0-rc
- '@copilotkit/shared@1.50.1-next.3':
- resolution: {integrity: sha512-YV+uaL5kbVeGuJ65I/FX1PAZekikAl3SUg6LPnPSoQsnytut0TL/AD6vX74JFF3iNvktNi81jdph5XCVbW27CQ==}
+ '@copilotkit/shared@1.50.1':
+ resolution: {integrity: sha512-Nk4saaXxVRq3VCTXfmE5hi46hmNkHZGCtb8H38LjZEFDR6lv0b2cnOWEhfkGzSjUwfY+XcZmwrGef7mMl/XI/w==}
'@copilotkitnext/agent@0.0.33':
resolution: {integrity: sha512-Q9J/GnG6HtLT2RP9aCHl8u3Nzv7/AKrbo+3cO4jv25VwFtlIGiSBEDS+g1Pru+vev0hSo/moEsswZTBkoN3WwA==}
@@ -14028,11 +14028,11 @@ snapshots:
'@chevrotain/utils@11.0.3': {}
- '@copilotkit/react-core@1.50.1-next.3(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(encoding@0.1.13)(graphql@16.12.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(zod@3.25.76)':
+ '@copilotkit/react-core@1.50.1(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(encoding@0.1.13)(graphql@16.12.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(zod@3.25.76)':
dependencies:
'@ag-ui/client': 0.0.42
- '@copilotkit/runtime-client-gql': 1.50.1-next.3(encoding@0.1.13)(graphql@16.12.0)(react@18.3.1)
- '@copilotkit/shared': 1.50.1-next.3(encoding@0.1.13)
+ '@copilotkit/runtime-client-gql': 1.50.1(encoding@0.1.13)(graphql@16.12.0)(react@18.3.1)
+ '@copilotkit/shared': 1.50.1(encoding@0.1.13)
'@copilotkitnext/core': 0.0.33
'@copilotkitnext/react': 0.0.33(@types/react-dom@19.2.2(@types/react@19.2.2))(@types/react@19.2.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@scarf/scarf': 1.3.0
@@ -14048,9 +14048,9 @@ snapshots:
- graphql
- supports-color
- '@copilotkit/runtime-client-gql@1.50.1-next.3(encoding@0.1.13)(graphql@16.12.0)(react@18.3.1)':
+ '@copilotkit/runtime-client-gql@1.50.1(encoding@0.1.13)(graphql@16.12.0)(react@18.3.1)':
dependencies:
- '@copilotkit/shared': 1.50.1-next.3(encoding@0.1.13)
+ '@copilotkit/shared': 1.50.1(encoding@0.1.13)
'@urql/core': 5.0.4(graphql@16.12.0)
react: 18.3.1
untruncate-json: 0.0.1
@@ -14059,7 +14059,7 @@ snapshots:
- encoding
- graphql
- '@copilotkit/shared@1.50.1-next.3(encoding@0.1.13)':
+ '@copilotkit/shared@1.50.1(encoding@0.1.13)':
dependencies:
'@ag-ui/core': 0.0.42
'@segment/analytics-node': 2.1.2(encoding@0.1.13)
diff --git a/CopilotKit/pnpm-workspace.yaml b/src/v1.x/pnpm-workspace.yaml
similarity index 100%
rename from CopilotKit/pnpm-workspace.yaml
rename to src/v1.x/pnpm-workspace.yaml
diff --git a/CopilotKit/scripts/develop/example.sh b/src/v1.x/scripts/develop/example.sh
similarity index 100%
rename from CopilotKit/scripts/develop/example.sh
rename to src/v1.x/scripts/develop/example.sh
diff --git a/CopilotKit/scripts/docs/gen.ts b/src/v1.x/scripts/docs/gen.ts
similarity index 100%
rename from CopilotKit/scripts/docs/gen.ts
rename to src/v1.x/scripts/docs/gen.ts
diff --git a/CopilotKit/scripts/docs/lib/comments.ts b/src/v1.x/scripts/docs/lib/comments.ts
similarity index 100%
rename from CopilotKit/scripts/docs/lib/comments.ts
rename to src/v1.x/scripts/docs/lib/comments.ts
diff --git a/CopilotKit/scripts/docs/lib/files.ts b/src/v1.x/scripts/docs/lib/files.ts
similarity index 96%
rename from CopilotKit/scripts/docs/lib/files.ts
rename to src/v1.x/scripts/docs/lib/files.ts
index e687bc5b66..9a8ffa3dd8 100644
--- a/CopilotKit/scripts/docs/lib/files.ts
+++ b/src/v1.x/scripts/docs/lib/files.ts
@@ -137,7 +137,7 @@ export const REFERENCE_DOCS: ReferenceDocConfiguration[] = [
/* SDKs */
{
- sourcePath: "../sdk-python/copilotkit/langgraph.py",
+ sourcePath: "../../sdk-python/copilotkit/langgraph.py",
destinationPath: "docs/content/docs/reference/sdk/python/LangGraph.mdx",
title: "LangGraph SDK",
description:
@@ -151,7 +151,7 @@ export const REFERENCE_DOCS: ReferenceDocConfiguration[] = [
],
},
{
- sourcePath: "../sdk-python/copilotkit/crewai/crewai_sdk.py",
+ sourcePath: "../../sdk-python/copilotkit/crewai/crewai_sdk.py",
destinationPath: "docs/content/docs/reference/sdk/python/CrewAI.mdx",
title: "CrewAI SDK",
description:
@@ -167,21 +167,21 @@ export const REFERENCE_DOCS: ReferenceDocConfiguration[] = [
/* Agents */
{
- sourcePath: "../sdk-python/copilotkit/langgraph_agent.py",
+ sourcePath: "../../sdk-python/copilotkit/langgraph_agent.py",
destinationPath: "docs/content/docs/reference/sdk/python/LangGraphAgent.mdx",
title: "LangGraphAgent",
description: "LangGraphAgent lets you define your agent for use with CopilotKit.",
pythonSymbols: ["LangGraphAgent", "CopilotKitConfig"],
},
{
- sourcePath: "../sdk-python/copilotkit/crewai/crewai_agent.py",
+ sourcePath: "../../sdk-python/copilotkit/crewai/crewai_agent.py",
destinationPath: "docs/content/docs/reference/sdk/python/CrewAIAgent.mdx",
title: "CrewAIAgent",
description: "CrewAIAgent lets you define your agent for use with CopilotKit.",
pythonSymbols: ["CrewAIAgent", "CopilotKitConfig"],
},
{
- sourcePath: "../sdk-python/copilotkit/sdk.py",
+ sourcePath: "../../sdk-python/copilotkit/sdk.py",
destinationPath: "docs/content/docs/reference/sdk/python/RemoteEndpoints.mdx",
title: "Remote Endpoints",
description:
diff --git a/CopilotKit/scripts/docs/lib/python.ts b/src/v1.x/scripts/docs/lib/python.ts
similarity index 100%
rename from CopilotKit/scripts/docs/lib/python.ts
rename to src/v1.x/scripts/docs/lib/python.ts
diff --git a/CopilotKit/scripts/docs/lib/reference-doc.ts b/src/v1.x/scripts/docs/lib/reference-doc.ts
similarity index 98%
rename from CopilotKit/scripts/docs/lib/reference-doc.ts
rename to src/v1.x/scripts/docs/lib/reference-doc.ts
index ecbfaf8a9c..2cb0e54180 100644
--- a/CopilotKit/scripts/docs/lib/reference-doc.ts
+++ b/src/v1.x/scripts/docs/lib/reference-doc.ts
@@ -30,7 +30,7 @@ export class ReferenceDoc {
generatedDocumentation = await this.generatedDocsTypeScript();
}
if (generatedDocumentation) {
- const dest = "../" + this.referenceDoc.destinationPath;
+ const dest = "../../" + this.referenceDoc.destinationPath;
fs.writeFileSync(dest, generatedDocumentation);
console.log(`Successfully autogenerated ${dest} from ${this.referenceDoc.sourcePath}`);
}
@@ -48,7 +48,7 @@ export class ReferenceDoc {
result += ` /*\n`;
result += ` * ATTENTION! DO NOT MODIFY THIS FILE!\n`;
result += ` * This page is auto-generated. If you want to make any changes to this page, changes must be made at:\n`;
- result += ` * CopilotKit/${sourcePath}\n`;
+ result += ` * src/v1.x/${sourcePath}\n`;
result += ` */\n`;
result += `}\n`;
return result;
diff --git a/CopilotKit/scripts/docs/lib/source.ts b/src/v1.x/scripts/docs/lib/source.ts
similarity index 100%
rename from CopilotKit/scripts/docs/lib/source.ts
rename to src/v1.x/scripts/docs/lib/source.ts
diff --git a/CopilotKit/scripts/qa/actions.sh b/src/v1.x/scripts/qa/actions.sh
similarity index 100%
rename from CopilotKit/scripts/qa/actions.sh
rename to src/v1.x/scripts/qa/actions.sh
diff --git a/CopilotKit/scripts/qa/css.sh b/src/v1.x/scripts/qa/css.sh
similarity index 100%
rename from CopilotKit/scripts/qa/css.sh
rename to src/v1.x/scripts/qa/css.sh
diff --git a/CopilotKit/scripts/qa/firebase.sh b/src/v1.x/scripts/qa/firebase.sh
similarity index 100%
rename from CopilotKit/scripts/qa/firebase.sh
rename to src/v1.x/scripts/qa/firebase.sh
diff --git a/CopilotKit/scripts/qa/langchain.sh b/src/v1.x/scripts/qa/langchain.sh
similarity index 100%
rename from CopilotKit/scripts/qa/langchain.sh
rename to src/v1.x/scripts/qa/langchain.sh
diff --git a/CopilotKit/scripts/qa/langserve.sh b/src/v1.x/scripts/qa/langserve.sh
similarity index 100%
rename from CopilotKit/scripts/qa/langserve.sh
rename to src/v1.x/scripts/qa/langserve.sh
diff --git a/CopilotKit/scripts/qa/lib/actions/bad/array.ts b/src/v1.x/scripts/qa/lib/actions/bad/array.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/actions/bad/array.ts
rename to src/v1.x/scripts/qa/lib/actions/bad/array.ts
diff --git a/CopilotKit/scripts/qa/lib/actions/bad/enum.ts b/src/v1.x/scripts/qa/lib/actions/bad/enum.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/actions/bad/enum.ts
rename to src/v1.x/scripts/qa/lib/actions/bad/enum.ts
diff --git a/CopilotKit/scripts/qa/lib/actions/bad/noargs.ts b/src/v1.x/scripts/qa/lib/actions/bad/noargs.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/actions/bad/noargs.ts
rename to src/v1.x/scripts/qa/lib/actions/bad/noargs.ts
diff --git a/CopilotKit/scripts/qa/lib/actions/bad/object.ts b/src/v1.x/scripts/qa/lib/actions/bad/object.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/actions/bad/object.ts
rename to src/v1.x/scripts/qa/lib/actions/bad/object.ts
diff --git a/CopilotKit/scripts/qa/lib/actions/bad/optional.ts b/src/v1.x/scripts/qa/lib/actions/bad/optional.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/actions/bad/optional.ts
rename to src/v1.x/scripts/qa/lib/actions/bad/optional.ts
diff --git a/CopilotKit/scripts/qa/lib/actions/good/array.ts b/src/v1.x/scripts/qa/lib/actions/good/array.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/actions/good/array.ts
rename to src/v1.x/scripts/qa/lib/actions/good/array.ts
diff --git a/CopilotKit/scripts/qa/lib/actions/good/enum.ts b/src/v1.x/scripts/qa/lib/actions/good/enum.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/actions/good/enum.ts
rename to src/v1.x/scripts/qa/lib/actions/good/enum.ts
diff --git a/CopilotKit/scripts/qa/lib/actions/good/noargs.ts b/src/v1.x/scripts/qa/lib/actions/good/noargs.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/actions/good/noargs.ts
rename to src/v1.x/scripts/qa/lib/actions/good/noargs.ts
diff --git a/CopilotKit/scripts/qa/lib/actions/good/object.ts b/src/v1.x/scripts/qa/lib/actions/good/object.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/actions/good/object.ts
rename to src/v1.x/scripts/qa/lib/actions/good/object.ts
diff --git a/CopilotKit/scripts/qa/lib/actions/good/optional.ts b/src/v1.x/scripts/qa/lib/actions/good/optional.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/actions/good/optional.ts
rename to src/v1.x/scripts/qa/lib/actions/good/optional.ts
diff --git a/CopilotKit/scripts/qa/lib/bash/packages.sh b/src/v1.x/scripts/qa/lib/bash/packages.sh
similarity index 100%
rename from CopilotKit/scripts/qa/lib/bash/packages.sh
rename to src/v1.x/scripts/qa/lib/bash/packages.sh
diff --git a/CopilotKit/scripts/qa/lib/bash/prelude.sh b/src/v1.x/scripts/qa/lib/bash/prelude.sh
similarity index 100%
rename from CopilotKit/scripts/qa/lib/bash/prelude.sh
rename to src/v1.x/scripts/qa/lib/bash/prelude.sh
diff --git a/CopilotKit/scripts/qa/lib/bash/qa.sh b/src/v1.x/scripts/qa/lib/bash/qa.sh
similarity index 100%
rename from CopilotKit/scripts/qa/lib/bash/qa.sh
rename to src/v1.x/scripts/qa/lib/bash/qa.sh
diff --git a/CopilotKit/scripts/qa/lib/css/page.tsx b/src/v1.x/scripts/qa/lib/css/page.tsx
similarity index 100%
rename from CopilotKit/scripts/qa/lib/css/page.tsx
rename to src/v1.x/scripts/qa/lib/css/page.tsx
diff --git a/CopilotKit/scripts/qa/lib/css/route.ts b/src/v1.x/scripts/qa/lib/css/route.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/css/route.ts
rename to src/v1.x/scripts/qa/lib/css/route.ts
diff --git a/CopilotKit/scripts/qa/lib/firebase/.firebaserc b/src/v1.x/scripts/qa/lib/firebase/.firebaserc
similarity index 100%
rename from CopilotKit/scripts/qa/lib/firebase/.firebaserc
rename to src/v1.x/scripts/qa/lib/firebase/.firebaserc
diff --git a/CopilotKit/scripts/qa/lib/firebase/firebase.json b/src/v1.x/scripts/qa/lib/firebase/firebase.json
similarity index 100%
rename from CopilotKit/scripts/qa/lib/firebase/firebase.json
rename to src/v1.x/scripts/qa/lib/firebase/firebase.json
diff --git a/CopilotKit/scripts/qa/lib/firebase/index.ts b/src/v1.x/scripts/qa/lib/firebase/index.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/firebase/index.ts
rename to src/v1.x/scripts/qa/lib/firebase/index.ts
diff --git a/CopilotKit/scripts/qa/lib/firebase/package.json b/src/v1.x/scripts/qa/lib/firebase/package.json
similarity index 100%
rename from CopilotKit/scripts/qa/lib/firebase/package.json
rename to src/v1.x/scripts/qa/lib/firebase/package.json
diff --git a/CopilotKit/scripts/qa/lib/firebase/page.tsx b/src/v1.x/scripts/qa/lib/firebase/page.tsx
similarity index 100%
rename from CopilotKit/scripts/qa/lib/firebase/page.tsx
rename to src/v1.x/scripts/qa/lib/firebase/page.tsx
diff --git a/CopilotKit/scripts/qa/lib/firebase/tsconfig.json b/src/v1.x/scripts/qa/lib/firebase/tsconfig.json
similarity index 100%
rename from CopilotKit/scripts/qa/lib/firebase/tsconfig.json
rename to src/v1.x/scripts/qa/lib/firebase/tsconfig.json
diff --git a/CopilotKit/scripts/qa/lib/langchain/page.tsx b/src/v1.x/scripts/qa/lib/langchain/page.tsx
similarity index 100%
rename from CopilotKit/scripts/qa/lib/langchain/page.tsx
rename to src/v1.x/scripts/qa/lib/langchain/page.tsx
diff --git a/CopilotKit/scripts/qa/lib/langchain/route.ts b/src/v1.x/scripts/qa/lib/langchain/route.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/langchain/route.ts
rename to src/v1.x/scripts/qa/lib/langchain/route.ts
diff --git a/CopilotKit/scripts/qa/lib/langserve/app/server.py b/src/v1.x/scripts/qa/lib/langserve/app/server.py
similarity index 100%
rename from CopilotKit/scripts/qa/lib/langserve/app/server.py
rename to src/v1.x/scripts/qa/lib/langserve/app/server.py
diff --git a/CopilotKit/scripts/qa/lib/langserve/next/page.tsx b/src/v1.x/scripts/qa/lib/langserve/next/page.tsx
similarity index 100%
rename from CopilotKit/scripts/qa/lib/langserve/next/page.tsx
rename to src/v1.x/scripts/qa/lib/langserve/next/page.tsx
diff --git a/CopilotKit/scripts/qa/lib/langserve/next/route.ts b/src/v1.x/scripts/qa/lib/langserve/next/route.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/langserve/next/route.ts
rename to src/v1.x/scripts/qa/lib/langserve/next/route.ts
diff --git a/CopilotKit/scripts/qa/lib/langserve/requirements.txt b/src/v1.x/scripts/qa/lib/langserve/requirements.txt
similarity index 100%
rename from CopilotKit/scripts/qa/lib/langserve/requirements.txt
rename to src/v1.x/scripts/qa/lib/langserve/requirements.txt
diff --git a/CopilotKit/scripts/qa/lib/next-pages/copilotkit.ts b/src/v1.x/scripts/qa/lib/next-pages/copilotkit.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/next-pages/copilotkit.ts
rename to src/v1.x/scripts/qa/lib/next-pages/copilotkit.ts
diff --git a/CopilotKit/scripts/qa/lib/next-pages/index.tsx b/src/v1.x/scripts/qa/lib/next-pages/index.tsx
similarity index 100%
rename from CopilotKit/scripts/qa/lib/next-pages/index.tsx
rename to src/v1.x/scripts/qa/lib/next-pages/index.tsx
diff --git a/CopilotKit/scripts/qa/lib/next/page.tsx b/src/v1.x/scripts/qa/lib/next/page.tsx
similarity index 100%
rename from CopilotKit/scripts/qa/lib/next/page.tsx
rename to src/v1.x/scripts/qa/lib/next/page.tsx
diff --git a/CopilotKit/scripts/qa/lib/next/route.ts b/src/v1.x/scripts/qa/lib/next/route.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/next/route.ts
rename to src/v1.x/scripts/qa/lib/next/route.ts
diff --git a/CopilotKit/scripts/qa/lib/node/express.ts b/src/v1.x/scripts/qa/lib/node/express.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/node/express.ts
rename to src/v1.x/scripts/qa/lib/node/express.ts
diff --git a/CopilotKit/scripts/qa/lib/node/page.tsx b/src/v1.x/scripts/qa/lib/node/page.tsx
similarity index 100%
rename from CopilotKit/scripts/qa/lib/node/page.tsx
rename to src/v1.x/scripts/qa/lib/node/page.tsx
diff --git a/CopilotKit/scripts/qa/lib/node/server.ts b/src/v1.x/scripts/qa/lib/node/server.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/node/server.ts
rename to src/v1.x/scripts/qa/lib/node/server.ts
diff --git a/CopilotKit/scripts/qa/lib/remix/_index.tsx b/src/v1.x/scripts/qa/lib/remix/_index.tsx
similarity index 100%
rename from CopilotKit/scripts/qa/lib/remix/_index.tsx
rename to src/v1.x/scripts/qa/lib/remix/_index.tsx
diff --git a/CopilotKit/scripts/qa/lib/remix/copilotkit.tsx b/src/v1.x/scripts/qa/lib/remix/copilotkit.tsx
similarity index 100%
rename from CopilotKit/scripts/qa/lib/remix/copilotkit.tsx
rename to src/v1.x/scripts/qa/lib/remix/copilotkit.tsx
diff --git a/CopilotKit/scripts/qa/lib/upgrade-express/new/page.tsx b/src/v1.x/scripts/qa/lib/upgrade-express/new/page.tsx
similarity index 100%
rename from CopilotKit/scripts/qa/lib/upgrade-express/new/page.tsx
rename to src/v1.x/scripts/qa/lib/upgrade-express/new/page.tsx
diff --git a/CopilotKit/scripts/qa/lib/upgrade-express/new/server.ts b/src/v1.x/scripts/qa/lib/upgrade-express/new/server.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/upgrade-express/new/server.ts
rename to src/v1.x/scripts/qa/lib/upgrade-express/new/server.ts
diff --git a/CopilotKit/scripts/qa/lib/upgrade-express/old/page.tsx b/src/v1.x/scripts/qa/lib/upgrade-express/old/page.tsx
similarity index 100%
rename from CopilotKit/scripts/qa/lib/upgrade-express/old/page.tsx
rename to src/v1.x/scripts/qa/lib/upgrade-express/old/page.tsx
diff --git a/CopilotKit/scripts/qa/lib/upgrade-express/old/server.ts b/src/v1.x/scripts/qa/lib/upgrade-express/old/server.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/upgrade-express/old/server.ts
rename to src/v1.x/scripts/qa/lib/upgrade-express/old/server.ts
diff --git a/CopilotKit/scripts/qa/lib/upgrade-next-app/new/page.tsx b/src/v1.x/scripts/qa/lib/upgrade-next-app/new/page.tsx
similarity index 100%
rename from CopilotKit/scripts/qa/lib/upgrade-next-app/new/page.tsx
rename to src/v1.x/scripts/qa/lib/upgrade-next-app/new/page.tsx
diff --git a/CopilotKit/scripts/qa/lib/upgrade-next-app/new/route.ts b/src/v1.x/scripts/qa/lib/upgrade-next-app/new/route.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/upgrade-next-app/new/route.ts
rename to src/v1.x/scripts/qa/lib/upgrade-next-app/new/route.ts
diff --git a/CopilotKit/scripts/qa/lib/upgrade-next-app/old/page.tsx b/src/v1.x/scripts/qa/lib/upgrade-next-app/old/page.tsx
similarity index 100%
rename from CopilotKit/scripts/qa/lib/upgrade-next-app/old/page.tsx
rename to src/v1.x/scripts/qa/lib/upgrade-next-app/old/page.tsx
diff --git a/CopilotKit/scripts/qa/lib/upgrade-next-app/old/route.ts b/src/v1.x/scripts/qa/lib/upgrade-next-app/old/route.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/upgrade-next-app/old/route.ts
rename to src/v1.x/scripts/qa/lib/upgrade-next-app/old/route.ts
diff --git a/CopilotKit/scripts/qa/lib/upgrade-next-pages/new/page.tsx b/src/v1.x/scripts/qa/lib/upgrade-next-pages/new/page.tsx
similarity index 100%
rename from CopilotKit/scripts/qa/lib/upgrade-next-pages/new/page.tsx
rename to src/v1.x/scripts/qa/lib/upgrade-next-pages/new/page.tsx
diff --git a/CopilotKit/scripts/qa/lib/upgrade-next-pages/new/route.ts b/src/v1.x/scripts/qa/lib/upgrade-next-pages/new/route.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/upgrade-next-pages/new/route.ts
rename to src/v1.x/scripts/qa/lib/upgrade-next-pages/new/route.ts
diff --git a/CopilotKit/scripts/qa/lib/upgrade-next-pages/old/page.tsx b/src/v1.x/scripts/qa/lib/upgrade-next-pages/old/page.tsx
similarity index 100%
rename from CopilotKit/scripts/qa/lib/upgrade-next-pages/old/page.tsx
rename to src/v1.x/scripts/qa/lib/upgrade-next-pages/old/page.tsx
diff --git a/CopilotKit/scripts/qa/lib/upgrade-next-pages/old/route.ts b/src/v1.x/scripts/qa/lib/upgrade-next-pages/old/route.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/upgrade-next-pages/old/route.ts
rename to src/v1.x/scripts/qa/lib/upgrade-next-pages/old/route.ts
diff --git a/CopilotKit/scripts/qa/lib/upgrade-node/new/page.tsx b/src/v1.x/scripts/qa/lib/upgrade-node/new/page.tsx
similarity index 100%
rename from CopilotKit/scripts/qa/lib/upgrade-node/new/page.tsx
rename to src/v1.x/scripts/qa/lib/upgrade-node/new/page.tsx
diff --git a/CopilotKit/scripts/qa/lib/upgrade-node/new/server.ts b/src/v1.x/scripts/qa/lib/upgrade-node/new/server.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/upgrade-node/new/server.ts
rename to src/v1.x/scripts/qa/lib/upgrade-node/new/server.ts
diff --git a/CopilotKit/scripts/qa/lib/upgrade-node/old/page.tsx b/src/v1.x/scripts/qa/lib/upgrade-node/old/page.tsx
similarity index 100%
rename from CopilotKit/scripts/qa/lib/upgrade-node/old/page.tsx
rename to src/v1.x/scripts/qa/lib/upgrade-node/old/page.tsx
diff --git a/CopilotKit/scripts/qa/lib/upgrade-node/old/server.ts b/src/v1.x/scripts/qa/lib/upgrade-node/old/server.ts
similarity index 100%
rename from CopilotKit/scripts/qa/lib/upgrade-node/old/server.ts
rename to src/v1.x/scripts/qa/lib/upgrade-node/old/server.ts
diff --git a/CopilotKit/scripts/qa/next-pages.sh b/src/v1.x/scripts/qa/next-pages.sh
similarity index 100%
rename from CopilotKit/scripts/qa/next-pages.sh
rename to src/v1.x/scripts/qa/next-pages.sh
diff --git a/CopilotKit/scripts/qa/next.sh b/src/v1.x/scripts/qa/next.sh
similarity index 100%
rename from CopilotKit/scripts/qa/next.sh
rename to src/v1.x/scripts/qa/next.sh
diff --git a/CopilotKit/scripts/qa/node.sh b/src/v1.x/scripts/qa/node.sh
similarity index 100%
rename from CopilotKit/scripts/qa/node.sh
rename to src/v1.x/scripts/qa/node.sh
diff --git a/CopilotKit/scripts/qa/remix.sh b/src/v1.x/scripts/qa/remix.sh
similarity index 100%
rename from CopilotKit/scripts/qa/remix.sh
rename to src/v1.x/scripts/qa/remix.sh
diff --git a/CopilotKit/scripts/qa/upgrade-express.sh b/src/v1.x/scripts/qa/upgrade-express.sh
similarity index 100%
rename from CopilotKit/scripts/qa/upgrade-express.sh
rename to src/v1.x/scripts/qa/upgrade-express.sh
diff --git a/CopilotKit/scripts/qa/upgrade-next-app.sh b/src/v1.x/scripts/qa/upgrade-next-app.sh
similarity index 100%
rename from CopilotKit/scripts/qa/upgrade-next-app.sh
rename to src/v1.x/scripts/qa/upgrade-next-app.sh
diff --git a/CopilotKit/scripts/qa/upgrade-next-pages.sh b/src/v1.x/scripts/qa/upgrade-next-pages.sh
similarity index 100%
rename from CopilotKit/scripts/qa/upgrade-next-pages.sh
rename to src/v1.x/scripts/qa/upgrade-next-pages.sh
diff --git a/CopilotKit/scripts/qa/upgrade-node.sh b/src/v1.x/scripts/qa/upgrade-node.sh
similarity index 100%
rename from CopilotKit/scripts/qa/upgrade-node.sh
rename to src/v1.x/scripts/qa/upgrade-node.sh
diff --git a/CopilotKit/scripts/release/generate-changelog.js b/src/v1.x/scripts/release/generate-changelog.js
similarity index 100%
rename from CopilotKit/scripts/release/generate-changelog.js
rename to src/v1.x/scripts/release/generate-changelog.js
diff --git a/CopilotKit/scripts/release/prepare-custom-prerelease.sh b/src/v1.x/scripts/release/prepare-custom-prerelease.sh
similarity index 100%
rename from CopilotKit/scripts/release/prepare-custom-prerelease.sh
rename to src/v1.x/scripts/release/prepare-custom-prerelease.sh
diff --git a/CopilotKit/scripts/release/prerelease.sh b/src/v1.x/scripts/release/prerelease.sh
similarity index 100%
rename from CopilotKit/scripts/release/prerelease.sh
rename to src/v1.x/scripts/release/prerelease.sh
diff --git a/CopilotKit/scripts/release/publish-snapshot-release.sh b/src/v1.x/scripts/release/publish-snapshot-release.sh
similarity index 100%
rename from CopilotKit/scripts/release/publish-snapshot-release.sh
rename to src/v1.x/scripts/release/publish-snapshot-release.sh
diff --git a/CopilotKit/scripts/release/release.sh b/src/v1.x/scripts/release/release.sh
similarity index 100%
rename from CopilotKit/scripts/release/release.sh
rename to src/v1.x/scripts/release/release.sh
diff --git a/CopilotKit/turbo.json b/src/v1.x/turbo.json
similarity index 100%
rename from CopilotKit/turbo.json
rename to src/v1.x/turbo.json
diff --git a/CopilotKit/typedoc.base.json b/src/v1.x/typedoc.base.json
similarity index 100%
rename from CopilotKit/typedoc.base.json
rename to src/v1.x/typedoc.base.json
diff --git a/CopilotKit/typedoc.json b/src/v1.x/typedoc.json
similarity index 100%
rename from CopilotKit/typedoc.json
rename to src/v1.x/typedoc.json
diff --git a/CopilotKit/utilities/eslint-config-custom/CHANGELOG.md b/src/v1.x/utilities/eslint-config-custom/CHANGELOG.md
similarity index 100%
rename from CopilotKit/utilities/eslint-config-custom/CHANGELOG.md
rename to src/v1.x/utilities/eslint-config-custom/CHANGELOG.md
diff --git a/CopilotKit/utilities/eslint-config-custom/index.js b/src/v1.x/utilities/eslint-config-custom/index.js
similarity index 100%
rename from CopilotKit/utilities/eslint-config-custom/index.js
rename to src/v1.x/utilities/eslint-config-custom/index.js
diff --git a/CopilotKit/utilities/eslint-config-custom/package.json b/src/v1.x/utilities/eslint-config-custom/package.json
similarity index 100%
rename from CopilotKit/utilities/eslint-config-custom/package.json
rename to src/v1.x/utilities/eslint-config-custom/package.json
diff --git a/CopilotKit/utilities/eslint-config-custom/typedoc.json b/src/v1.x/utilities/eslint-config-custom/typedoc.json
similarity index 100%
rename from CopilotKit/utilities/eslint-config-custom/typedoc.json
rename to src/v1.x/utilities/eslint-config-custom/typedoc.json
diff --git a/CopilotKit/utilities/tailwind-config/CHANGELOG.md b/src/v1.x/utilities/tailwind-config/CHANGELOG.md
similarity index 100%
rename from CopilotKit/utilities/tailwind-config/CHANGELOG.md
rename to src/v1.x/utilities/tailwind-config/CHANGELOG.md
diff --git a/CopilotKit/utilities/tailwind-config/package.json b/src/v1.x/utilities/tailwind-config/package.json
similarity index 100%
rename from CopilotKit/utilities/tailwind-config/package.json
rename to src/v1.x/utilities/tailwind-config/package.json
diff --git a/CopilotKit/utilities/tailwind-config/tailwind.config.js b/src/v1.x/utilities/tailwind-config/tailwind.config.js
similarity index 100%
rename from CopilotKit/utilities/tailwind-config/tailwind.config.js
rename to src/v1.x/utilities/tailwind-config/tailwind.config.js
diff --git a/CopilotKit/utilities/tailwind-config/typedoc.json b/src/v1.x/utilities/tailwind-config/typedoc.json
similarity index 100%
rename from CopilotKit/utilities/tailwind-config/typedoc.json
rename to src/v1.x/utilities/tailwind-config/typedoc.json
diff --git a/CopilotKit/utilities/tsconfig/CHANGELOG.md b/src/v1.x/utilities/tsconfig/CHANGELOG.md
similarity index 100%
rename from CopilotKit/utilities/tsconfig/CHANGELOG.md
rename to src/v1.x/utilities/tsconfig/CHANGELOG.md
diff --git a/CopilotKit/utilities/tsconfig/base.json b/src/v1.x/utilities/tsconfig/base.json
similarity index 100%
rename from CopilotKit/utilities/tsconfig/base.json
rename to src/v1.x/utilities/tsconfig/base.json
diff --git a/CopilotKit/utilities/tsconfig/nextjs.json b/src/v1.x/utilities/tsconfig/nextjs.json
similarity index 100%
rename from CopilotKit/utilities/tsconfig/nextjs.json
rename to src/v1.x/utilities/tsconfig/nextjs.json
diff --git a/CopilotKit/utilities/tsconfig/package.json b/src/v1.x/utilities/tsconfig/package.json
similarity index 100%
rename from CopilotKit/utilities/tsconfig/package.json
rename to src/v1.x/utilities/tsconfig/package.json
diff --git a/CopilotKit/utilities/tsconfig/react-library.json b/src/v1.x/utilities/tsconfig/react-library.json
similarity index 100%
rename from CopilotKit/utilities/tsconfig/react-library.json
rename to src/v1.x/utilities/tsconfig/react-library.json
diff --git a/CopilotKit/utilities/tsconfig/typedoc.json b/src/v1.x/utilities/tsconfig/typedoc.json
similarity index 100%
rename from CopilotKit/utilities/tsconfig/typedoc.json
rename to src/v1.x/utilities/tsconfig/typedoc.json
diff --git a/src/v2.x/.cursor/rules/00-base.always.mdc b/src/v2.x/.cursor/rules/00-base.always.mdc
new file mode 100644
index 0000000000..82e93de9ee
--- /dev/null
+++ b/src/v2.x/.cursor/rules/00-base.always.mdc
@@ -0,0 +1,18 @@
+---
+description: High-level map of the monorepo. Always applied.
+globs: "*"
+alwaysApply: true
+---
+
+# 📦 Repository layout
+
+- `packages/*` – workspace packages
+ - `eslint-config` – shared ESLint configs
+ - `typescript-config` – tsconfig presets
+ - `runtime` – server-side runtime utilities and handlers
+ - `shared` – common utilities
+
+# General
+
+- Do **NOT** edit `dist/` or `node_modules/` directories; they are build artefacts.
+- When adding dependencies, use `pnpm add -w `.
diff --git a/src/v2.x/.cursor/rules/10-repo-conventions.always.mdc b/src/v2.x/.cursor/rules/10-repo-conventions.always.mdc
new file mode 100644
index 0000000000..1a79a00fea
--- /dev/null
+++ b/src/v2.x/.cursor/rules/10-repo-conventions.always.mdc
@@ -0,0 +1,10 @@
+---
+description: Repository conventions and scripts. Always applied.
+globs: "*"
+alwaysApply: true
+---
+
+- Use `pnpm` for all package management. Never run `npm`.
+- Keep scripts standardized: `build`, `dev`, `lint`, `check-types`, `test`, and `test:watch`.
+- All packages publish within the workspace using `pnpm` workspaces.
+- Do not commit build outputs in `dist/` or `.next/`.
diff --git a/src/v2.x/.cursor/rules/20-typescript.auto.mdc b/src/v2.x/.cursor/rules/20-typescript.auto.mdc
new file mode 100644
index 0000000000..22f63473f4
--- /dev/null
+++ b/src/v2.x/.cursor/rules/20-typescript.auto.mdc
@@ -0,0 +1,10 @@
+---
+description: TypeScript style guide.
+globs: "**/*.{ts,tsx}"
+---
+
+- The repository uses `@copilotkitnext/typescript-config` presets with `strict` and `noUncheckedIndexedAccess` enabled.
+- Prefer `type` aliases over `interface` for data structures.
+- Avoid `any`; use explicit generics or `unknown` where necessary.
+- Files should be named in `kebab-case.ts` or `kebab-case.tsx` with a single export per file.
+- Keep runtime-only scripts (e.g., ts-node) in dev scripts, not in production code.
diff --git a/src/v2.x/.cursor/rules/30-pnpm.auto.mdc b/src/v2.x/.cursor/rules/30-pnpm.auto.mdc
new file mode 100644
index 0000000000..c51207854f
--- /dev/null
+++ b/src/v2.x/.cursor/rules/30-pnpm.auto.mdc
@@ -0,0 +1,11 @@
+---
+description: pnpm workspace guidelines.
+globs:
+ - "**/package.json"
+ - "**/pnpm-lock.yaml"
+---
+
+- Use `pnpm -F ` to run scripts in a specific package.
+- Add dependencies with `pnpm add -w ` or `pnpm add -F `.
+- Do not use `npm` commands or edit `node_modules` manually.
+- Keep the lockfile committed.
diff --git a/src/v2.x/.cursor/rules/40-turborepo.auto.mdc b/src/v2.x/.cursor/rules/40-turborepo.auto.mdc
new file mode 100644
index 0000000000..ec7d48ac88
--- /dev/null
+++ b/src/v2.x/.cursor/rules/40-turborepo.auto.mdc
@@ -0,0 +1,9 @@
+---
+description: Turborepo pipeline guidance.
+globs: "**/turbo*.{json,js}"
+---
+
+- Tasks are defined in `turbo.json` with common names: `build`, `lint`, `dev`, `check-types`, `test`.
+- Each task should specify `dependsOn` and `outputs` where caching matters.
+- Avoid creating new pipelines at the repo root without discussion.
+- Use `turbo run ` for workspace-wide scripts.
diff --git a/src/v2.x/.cursor/rules/50-vitest.auto.mdc b/src/v2.x/.cursor/rules/50-vitest.auto.mdc
new file mode 100644
index 0000000000..a9ba3a5fe3
--- /dev/null
+++ b/src/v2.x/.cursor/rules/50-vitest.auto.mdc
@@ -0,0 +1,12 @@
+---
+description: Vitest testing conventions.
+globs:
+ - "**/vitest.config.{js,mjs,ts}"
+ - "**/*.{spec,test}.{ts,tsx}"
+ - "**/__tests__/**"
+---
+
+- Use Vitest for all testing; see `packages/react/vitest.config.mjs` and `packages/runtime/vitest.config.mjs` for examples.
+- Place tests under `__tests__/` with `.test.ts` suffix.
+- Use the Arrange-Act-Assert pattern in tests.
+- Import `vi` from 'vitest' for mocking functions (use `vi.fn()`, `vi.spyOn()`, etc.).
diff --git a/src/v2.x/.github/workflows/claude.yml b/src/v2.x/.github/workflows/claude.yml
new file mode 100644
index 0000000000..64a3e5b14b
--- /dev/null
+++ b/src/v2.x/.github/workflows/claude.yml
@@ -0,0 +1,64 @@
+name: Claude Code
+
+on:
+ issue_comment:
+ types: [created]
+ pull_request_review_comment:
+ types: [created]
+ issues:
+ types: [opened, assigned]
+ pull_request_review:
+ types: [submitted]
+
+jobs:
+ claude:
+ if: |
+ (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
+ (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
+ (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
+ (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ pull-requests: read
+ issues: read
+ id-token: write
+ actions: read # Required for Claude to read CI results on PRs
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 1
+
+ - name: Run Claude Code
+ id: claude
+ uses: anthropics/claude-code-action@beta
+ with:
+ claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
+
+ # This is an optional setting that allows Claude to read CI results on PRs
+ additional_permissions: |
+ actions: read
+
+ # Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
+ # model: "claude-opus-4-20250514"
+
+ # Optional: Customize the trigger phrase (default: @claude)
+ # trigger_phrase: "/claude"
+
+ # Optional: Trigger when specific user is assigned to an issue
+ # assignee_trigger: "claude-bot"
+
+ # Optional: Allow Claude to run specific commands
+ # allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
+
+ # Optional: Add custom instructions for Claude to customize its behavior for your project
+ # custom_instructions: |
+ # Follow our coding standards
+ # Ensure all new code has tests
+ # Use TypeScript for new files
+
+ # Optional: Custom environment variables for Claude
+ # claude_env: |
+ # NODE_ENV: test
+
diff --git a/src/v2.x/.github/workflows/test.yml b/src/v2.x/.github/workflows/test.yml
new file mode 100644
index 0000000000..6498ced393
--- /dev/null
+++ b/src/v2.x/.github/workflows/test.yml
@@ -0,0 +1,33 @@
+name: test
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+ workflow_dispatch:
+
+jobs:
+ unit:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: pnpm/action-setup@v3
+ with:
+ version: 9
+
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: 'pnpm'
+ cache-dependency-path: pnpm-lock.yaml
+
+ - name: Install dependencies
+ run: pnpm install --frozen-lockfile
+
+ - name: Run tests
+ run: pnpm test
diff --git a/src/v2.x/.gitignore b/src/v2.x/.gitignore
new file mode 100644
index 0000000000..d12cb15794
--- /dev/null
+++ b/src/v2.x/.gitignore
@@ -0,0 +1,50 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# Dependencies
+node_modules
+.pnp
+.pnp.js
+
+# Local env files
+.env
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+
+# Testing
+coverage
+
+# Turbo
+.turbo
+
+# Vercel
+.vercel
+
+# Build Outputs
+.next/
+out/
+build
+dist
+
+# Generated Tailwind assets
+packages/web-inspector/src/styles/generated.css
+
+
+# Debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# Misc
+.DS_Store
+*.pem
+
+*storybook.log
+storybook-static
+
+# Angular
+.angular/
+.playwright-mcp/
+
+.pnpm-store
diff --git a/src/v2.x/.prettierrc b/src/v2.x/.prettierrc
new file mode 100644
index 0000000000..87d7d41b8a
--- /dev/null
+++ b/src/v2.x/.prettierrc
@@ -0,0 +1,13 @@
+{
+ "printWidth": 120,
+ "proseWrap": "always",
+ "overrides": [
+ {
+ "files": "*.mdx",
+ "options": {
+ "proseWrap": "always",
+ "printWidth": 120
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/v2.x/CLAUDE.md b/src/v2.x/CLAUDE.md
new file mode 100644
index 0000000000..b323d5aaed
--- /dev/null
+++ b/src/v2.x/CLAUDE.md
@@ -0,0 +1,210 @@
+# CLAUDE.md
+
+This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
+
+## Important Rules
+
+- NEVER commit or push to the repository unless explicitly asked to
+- NEVER credit yourself in commit messages (no "Generated with Claude Code" or similar)
+
+## Common Commands
+
+### Development
+
+```bash
+# Install dependencies
+pnpm install
+
+# Build all packages
+pnpm build
+
+# Build specific package
+pnpm turbo run build --filter=@copilotkitnext/react
+
+# Clean all dist outputs
+pnpm clean
+```
+
+**Development Workflow - Run Order (Important):**
+
+1. **Always start package compilers first:**
+
+ ```bash
+ pnpm dev # Watches and compiles libraries only
+ ```
+ - Includes: @copilotkitnext/core, @copilotkitnext/shared, @copilotkitnext/runtime, @copilotkitnext/react, @copilotkitnext/angular
+ - Produces dist and styles.css with hot reload for dependent apps
+ - Wait for this to be ready before starting apps
+
+2. **Then run demos/storybooks/docs in separate terminals as needed:**
+
+ ```bash
+ # Angular demo + backend server
+ pnpm demo:angular
+ # Frontend: apps/angular/demo (ng serve on port 4200)
+ # Backend: apps/angular/demo-server (Hono API on port 3001)
+
+ # Angular Storybook
+ pnpm storybook:angular
+ # Port 6007 with --no-open flag
+
+ # React demo (Next.js)
+ pnpm demo:react
+ # Port 3000
+
+ # React Storybook
+ pnpm storybook:react
+ # Port 6006 with --no-open flag
+
+ # Documentation site
+ pnpm docs
+ # Mintlify on port 4000
+ ```
+
+**Important Notes:**
+
+- Demos and storybooks depend on `pnpm dev` for compiled outputs
+- No upstream builds for apps - they rely on the watch mode from `pnpm dev`
+- All apps have hot reload enabled
+
+### Testing & Quality
+
+```bash
+# Run all tests
+pnpm test
+
+# Run tests in watch mode
+pnpm test:watch
+
+# Run tests with coverage
+pnpm test:coverage
+
+# Type checking
+pnpm check-types
+
+# Linting
+pnpm lint
+
+# Code formatting
+pnpm format
+```
+
+### Storybook
+
+```bash
+# Start Storybook development server
+pnpm storybook
+
+# Build Storybook for production
+pnpm build-storybook
+```
+
+#### Storybook Story Guidelines
+
+When creating or modifying Storybook stories, especially for Angular components:
+
+1. **Always manually provide source code** - Do not rely on automatic source extraction. Use the `parameters.docs.source` configuration:
+
+ ```typescript
+ parameters: {
+ docs: {
+ source: {
+ type: 'code',
+ code: `// Your complete example code here`,
+ language: 'typescript', // or 'html'
+ },
+ },
+ },
+ ```
+
+2. **Show complete, working examples** - The code in the source panel should be a complete, copy-pasteable example that shows all necessary imports, component definitions, and event handlers.
+
+## Architecture Overview
+
+CopilotKit vnext_experimental is a TypeScript-first monorepo built with React components and AI agents. The codebase follows a modular workspace architecture managed by Turbo and pnpm.
+
+### Package Structure
+
+- **`packages/core`** - Core utilities, types, and foundational logic
+- **`packages/react`** - React components, hooks, and providers for building copilot interfaces
+- **`packages/runtime`** - Server-side runtime utilities, handlers, and API endpoints
+- **`packages/shared`** - Common utilities shared across packages
+- **`packages/eslint-config`** - Shared ESLint configuration
+- **`packages/typescript-config`** - TypeScript configuration presets
+
+### Application Structure
+
+- **`apps/demo`** - Next.js demo application showcasing CopilotKit features
+- **`apps/docs`** - Documentation site built with Mintlify
+- **`apps/storybook`** - Component documentation and interactive examples
+
+## Development Guidelines
+
+### Web Development and UI Testing
+
+- **Always verify UI changes with Playwright MCP when available** - When working on web UI components, especially when matching behavior between frameworks (React/Angular), use Playwright to verify that changes work correctly
+- **Don't stop until functionality is confirmed** - Continue working on UI issues until they are fully resolved and verified with Playwright or other testing tools
+- **Test interactively** - Use Playwright to interact with components (clicking buttons, scrolling, etc.) to ensure they behave as expected
+
+### Package Management
+
+- Always use `pnpm` for package management (never use `npm`)
+- Add workspace dependencies with `pnpm add -w `
+- Keep scripts standardized across packages: `build`, `dev`, `lint`, `check-types`, `test`, `test:watch`
+
+### Code Organization
+
+- React components are in `packages/react/src/components/`
+- Server-side logic belongs in `packages/runtime/src/`
+- Shared utilities go in `packages/shared/src/`
+- Tests are located in `src/__tests__/` directories within each package
+- Build outputs (`dist/`, `.next/`) are never committed
+
+### Key Technologies
+
+- **TypeScript 5.8.2** for type safety
+- **React 18+** for UI components
+- **Tailwind CSS** for styling (with custom build process)
+- **Vitest** for testing with jsdom environment
+- **Turbo** for monorepo task orchestration
+- **@ag-ui** for core AI agent functionality
+
+### Testing
+
+- Tests use Vitest with jsdom environment
+- React components tested with @testing-library/react
+- Runtime code uses Node environment for testing
+- Coverage reports available via `test:coverage`
+
+#### Angular Testing Patterns
+
+**Important findings from testing Angular directives and components:**
+
+1. **Dependency Injection Context Issues**
+ - Angular's `inject()` function must be called in an injection context
+ - Cannot directly instantiate directives/components that use `inject()` in tests
+ - Use `TestBed.createComponent()` for testing components with DI dependencies
+ - Prefer field initializers over `ngOnInit` for `inject()` calls when possible
+
+2. **Memory Issues with Test Components**
+ - Declaring too many Angular components at module level can cause "JavaScript heap out of memory" errors
+ - Keep test components minimal and focused
+ - Consider declaring simple test components inside test functions (like `CopilotKitAgentContextDirective` tests)
+ - If experiencing memory issues, reduce the number of test components or split tests across files
+
+3. **TestBed Configuration**
+ - Cannot call `TestBed.configureTestingModule()` multiple times in the same test
+ - Components declared with `@Component` decorator can import their own dependencies (directives, etc.)
+ - Use `providers: [provideCopilotKit({})]` in TestBed or component decorator for CopilotKit services
+
+4. **Directive Testing Patterns**
+ - For directives using field injection (`inject()`), test through host components
+ - For directives with constructor injection, can test more directly
+ - Follow existing patterns in `copilotkit-agent-context.directive.spec.ts` for reference
+
+### Build Process
+
+- React package builds both TypeScript and CSS (Tailwind)
+- Runtime package compiles TypeScript from `src/` to `dist/`
+- Turbo handles dependency ordering and caching
+- Development mode supports watch mode across all packages
diff --git a/src/v2.x/LICENSE b/src/v2.x/LICENSE
new file mode 100644
index 0000000000..f854fc1c48
--- /dev/null
+++ b/src/v2.x/LICENSE
@@ -0,0 +1,11 @@
+Note: This license does not apply to the whole project. Individual packages may contain their own licenses.
+
+MIT License
+
+Copyright 2025 Tawkit Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/src/v2.x/PLAN.md b/src/v2.x/PLAN.md
new file mode 100644
index 0000000000..3d6166b1f9
--- /dev/null
+++ b/src/v2.x/PLAN.md
@@ -0,0 +1,90 @@
+Title: Make useAgent always return a runtime agent (or throw after sync)
+
+Goal
+- Change `packages/react/src/hooks/use-agent.tsx` so it never returns `undefined`.
+- While the runtime is not yet synced, return a provisional `ProxiedCopilotRuntimeAgent` instance.
+- After the runtime has synced (Connected or Error), if the agent id does not exist, throw a descriptive error.
+- Do not change core (`@copilotkitnext/core`) behavior so existing core tests continue to pass.
+
+Non-Goals
+- Do not change `CopilotKitCore.getAgent` semantics (it may still return `undefined` while syncing).
+- Do not change Angular APIs.
+
+Design Overview
+- Implement the new behavior entirely in the React hook. Keep the core’s registry logic intact to avoid breaking current unit tests that depend on `getAgent(...)` returning `undefined` before runtime sync.
+- The hook’s return type becomes `{ agent: AbstractAgent }` (non-optional). In runtime-enabled scenarios, the actual instance is a `ProxiedCopilotRuntimeAgent` while syncing, and then the real agent object once the runtime is connected.
+- Only throw when “synced but missing”: runtime status is `Connected` or `Error`, and `copilotkit.getAgent(agentId)` is still `undefined`.
+
+Implementation Plan
+1) Update hook signature and behavior
+ - File: `packages/react/src/hooks/use-agent.tsx`
+ - Change the return type to always include an `agent: AbstractAgent` (no `undefined`).
+ - Import `ProxiedCopilotRuntimeAgent` from `@copilotkitnext/core`.
+ - Compute `agent` as follows:
+ - Call `copilotkit.getAgent(agentId)`.
+ - If it returns an agent, use it.
+ - Else if `copilotkit.runtimeUrl` is defined and `runtimeConnectionStatus` is `Disconnected` or `Connecting`, construct a provisional `ProxiedCopilotRuntimeAgent`:
+ - Use `runtimeUrl` and `runtimeTransport` (respect `single` or `rest`).
+ - Set `agentId` and apply `copilotkit.headers`.
+ - Memoize identity via `useMemo` on `(agentId, runtimeUrl, runtimeTransport, headers)`.
+ - Subscribe to it with the same update handlers the hook already registers.
+ - Return it.
+ - Else (no runtimeUrl or runtime has already synced), throw an Error that includes: `agentId`, `runtimeUrl` (if any), and a hint to verify `/info` on the runtime.
+ - Ensure the effect cleanup unsubscribes from the provisional agent subscription when the real agent becomes available.
+
+2) Maintain SSR safety
+ - `AgentRegistry.updateRuntimeConnection` early-returns when `window` is undefined; we will still return a provisional agent in SSR if `runtimeUrl` is provided, but it will not perform any network I/O until `run`/`connect` is called. This keeps SSR safe and predictable.
+
+3) Type and dependency updates
+ - Update the hook type export if necessary: `packages/react/src/hooks/index.ts` remains the same export surface; only the return type changes.
+ - No change to other hooks that call `copilotkit.getAgent` directly (they may continue to receive `undefined` and should keep their current guards).
+
+4) Documentation
+ - File: `docs/REACT_API.md`
+ - Update the `useAgent` section to reflect the new behavior:
+ - It never returns `undefined`.
+ - While syncing to a runtime, it returns a provisional `ProxiedCopilotRuntimeAgent` that is safe to use.
+ - If the runtime has synced and the agent does not exist, it throws.
+ - Also remove outdated mention of `isRunning` from the `useAgent` return shape (current code does not return it).
+
+5) Tests (ensure all existing tests still pass and add new coverage)
+ - Keep core tests untouched (they rely on current `getAgent` semantics):
+ - `packages/core/src/__tests__/core-headers.test.ts`
+ - `packages/core/src/__tests__/core-agent-id-validation.test.ts`
+ - `packages/core/src/__tests__/proxied-runtime-transport.test.ts`
+ - These expect `core.getAgent("remote")` to be `undefined` before runtime info is fetched and defined afterwards. We are not changing core behavior.
+ - Add new React hook tests to cover the new behavior:
+ - New file: `packages/react/src/hooks/__tests__/use-agent.behavior.test.tsx`
+ - Cases:
+ 1. With `runtimeUrl` set and `window` undefined (SSR-like), `useAgent` returns a `ProxiedCopilotRuntimeAgent` while status is effectively pre-sync. Should not throw.
+ 2. With `runtimeUrl` set and `window` defined; mock `fetch` to return `{ agents: {}, version: "x" }`. After runtime connects (status `Connected`), `useAgent` with a non-existent `agentId` throws.
+ 3. With `runtimeUrl` set and remote agent present in `/info`, after connection `useAgent` returns the real remote agent instance (instanceof `ProxiedCopilotRuntimeAgent`).
+ 4. With no `runtimeUrl` and a local agent provided via `agents__unsafe_dev_only`, `useAgent` returns that local agent.
+ 5. With no `runtimeUrl` and missing local agent, `useAgent` throws.
+ - Where helpful, assert that the hook continues to re-render on message/state/run changes (existing subscription behavior).
+ - Double-check React tests that rely on optional chaining like `agent?.isRunning` continue to compile (optional chaining on a definite value is allowed; these tests should not break). No changes needed.
+
+6) DX: Error messaging
+ - Include agent id and runtime url in thrown error text, and a short hint: “Verify agent registration in runtime `/info` and/or provider `agents__unsafe_dev_only`.”
+
+7) Migration notes (not code-enforced, but document intent)
+ - Code that previously handled `agent` possibly being `undefined` should either:
+ - Rely on the provisional agent during runtime sync, or
+ - Surround the hook usage with an error boundary if targeting agent ids that might not exist after sync.
+
+Risk Assessment and Mitigations
+- Potential double-connect when runtime transitions from pre-sync provisional → connected real agent.
+ - Mitigation: The `CopilotChat` effect sets `threadId` and calls `connectAgent` for the current `agent`; when the agent object changes, the effect re-runs. Both `connect` and `run` paths already guard/ignore unsupported connect and log errors. This is acceptable and consistent with current patterns.
+- Header/transport changes before sync.
+ - Mitigation: Provisional agent identity is memoized on `(agentId, runtimeUrl, runtimeTransport, headers)`. Changing these will recreate the provisional agent appropriately.
+- SSR safety.
+ - Mitigation: Provisional agent construction performs no network I/O; network calls only occur on `connect`/`run`.
+
+Acceptance Criteria
+- `useAgent` never returns `undefined`.
+- During runtime syncing, `useAgent` returns a usable `ProxiedCopilotRuntimeAgent`.
+- Once runtime is synced (Connected or Error), unknown agent ids cause the hook to throw with a clear message.
+- All existing unit tests pass unchanged.
+- New hook tests cover the behaviors above.
+- Docs reflect the updated `useAgent` semantics and return type.
+
diff --git a/src/v2.x/README.md b/src/v2.x/README.md
new file mode 100644
index 0000000000..8e53dcaa2d
--- /dev/null
+++ b/src/v2.x/README.md
@@ -0,0 +1,62 @@
+# CopilotKit vnext_experimental
+
+A modern TypeScript-first copilot framework built with React components and AI agents.
+
+## Development
+
+### Prerequisites
+
+- Node.js 18+
+- pnpm 9+
+
+### Setup
+
+```bash
+pnpm install
+```
+
+### Available Commands
+
+#### Build
+
+```bash
+# Build all packages
+pnpm turbo run build
+
+# Build specific package
+pnpm turbo run build --filter=@copilotkitnext/react
+```
+
+#### Development
+
+```bash
+# Run tests
+pnpm turbo run test
+
+# Run tests in watch mode
+pnpm turbo run test:watch
+
+# Type checking
+pnpm turbo run check-types
+
+# Linting
+pnpm turbo run lint
+```
+
+#### Storybook
+
+```bash
+# Start Storybook development server
+pnpm turbo run storybook:dev --filter=storybook
+
+# Build Storybook for production
+pnpm turbo run storybook:build --filter=storybook
+```
+
+### Package Structure
+
+- `packages/core` - Core utilities and types
+- `packages/react` - React components and hooks
+- `packages/runtime` - Server-side runtime handlers
+- `packages/shared` - Common utilities
+- `apps/storybook` - Component documentation and examples
diff --git a/src/v2.x/apps/angular/demo-server/README.md b/src/v2.x/apps/angular/demo-server/README.md
new file mode 100644
index 0000000000..b7ee759264
--- /dev/null
+++ b/src/v2.x/apps/angular/demo-server/README.md
@@ -0,0 +1,50 @@
+# Angular Demo Server
+
+Minimal Hono server for the Angular CopilotKit demo, matching the React demo behavior.
+
+## Setup
+
+1. Add your OpenAI API key to `.env`:
+
+ ```
+ OPENAI_API_KEY=sk-...
+ ```
+
+2. Install dependencies (from repository root):
+
+ ```bash
+ pnpm install
+ ```
+
+3. Start the server:
+ ```bash
+ pnpm --filter @copilotkitnext/angular-demo-server dev
+ ```
+
+The server will be available at http://localhost:3001/api/copilotkit
+
+## Testing
+
+To verify the server is running:
+
+```bash
+curl http://localhost:3001/api/copilotkit/info
+```
+
+You should see JSON with agents and version information.
+
+## Using with Angular Storybook
+
+1. Start the demo server (Terminal A):
+
+ ```bash
+ pnpm --filter @copilotkitnext/angular-demo-server dev
+ ```
+
+2. Start Angular Storybook (Terminal B):
+
+ ```bash
+ pnpm --filter storybook-angular dev
+ ```
+
+3. Open http://localhost:6007 and navigate to "Live/CopilotChat"
diff --git a/src/v2.x/apps/angular/demo-server/package.json b/src/v2.x/apps/angular/demo-server/package.json
new file mode 100644
index 0000000000..fe254511bd
--- /dev/null
+++ b/src/v2.x/apps/angular/demo-server/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "@copilotkitnext/angular-demo-server",
+ "private": true,
+ "type": "module",
+ "version": "0.0.0",
+ "scripts": {
+ "dev": "nodemon --verbose --cwd ../../../ --watch packages/core/dist/** --watch packages/shared/dist/** --watch packages/runtime/dist/** --watch packages/demo-agents/dist/** --watch apps/angular/demo-server/src/** --ext mjs,js,json,ts --delay 800ms --signal SIGTERM --exec \"tsx --env-file=apps/angular/demo-server/.env apps/angular/demo-server/src/index.ts\"",
+ "start": "node --env-file=.env --loader tsx src/index.ts"
+ },
+ "dependencies": {
+ "@ag-ui/client": "0.0.42",
+ "@ag-ui/langgraph": "^0.0.11",
+ "@copilotkitnext/demo-agents": "workspace:^",
+ "@copilotkitnext/runtime": "workspace:^",
+ "@hono/node-server": "^1.13.6",
+ "hono": "^4.6.11",
+ "openai": "^4.56.1",
+ "rxjs": "^7.8.1"
+ },
+ "devDependencies": {
+ "nodemon": "^3.1.7",
+ "tsx": "^4.19.2",
+ "typescript": "^5.6.3"
+ }
+}
diff --git a/src/v2.x/apps/angular/demo-server/src/index.ts b/src/v2.x/apps/angular/demo-server/src/index.ts
new file mode 100644
index 0000000000..629783198f
--- /dev/null
+++ b/src/v2.x/apps/angular/demo-server/src/index.ts
@@ -0,0 +1,44 @@
+import { serve } from "@hono/node-server";
+import { Hono } from "hono";
+import { cors } from "hono/cors";
+import { CopilotRuntime, createCopilotEndpoint, InMemoryAgentRunner } from "@copilotkitnext/runtime";
+import { OpenAIAgent, SlowToolCallStreamingAgent } from "@copilotkitnext/demo-agents";
+
+const runtime = new CopilotRuntime({
+ agents: {
+ // @ts-ignore
+ default: new SlowToolCallStreamingAgent(),
+ // @ts-ignore
+ openai: new OpenAIAgent(),
+ },
+ runner: new InMemoryAgentRunner(),
+});
+
+// Create a main app with CORS enabled
+const app = new Hono();
+
+// Enable CORS for local dev (Angular demo at http://localhost:4200)
+app.use(
+ "*",
+ cors({
+ origin: "http://localhost:4200",
+ allowMethods: ["GET", "POST", "OPTIONS", "PUT", "DELETE"],
+ allowHeaders: ["Content-Type", "Authorization", "X-Requested-With"],
+ exposeHeaders: ["Content-Type"],
+ credentials: true,
+ maxAge: 86400,
+ }),
+);
+
+// Create the CopilotKit endpoint
+const copilotApp = createCopilotEndpoint({
+ runtime,
+ basePath: "/api/copilotkit",
+});
+
+// Mount the CopilotKit app
+app.route("/", copilotApp);
+
+const port = Number(process.env.PORT || 3001);
+serve({ fetch: app.fetch, port });
+console.log(`CopilotKit runtime listening at http://localhost:${port}/api/copilotkit`);
diff --git a/src/v2.x/apps/angular/demo-server/tsconfig.json b/src/v2.x/apps/angular/demo-server/tsconfig.json
new file mode 100644
index 0000000000..3381230d32
--- /dev/null
+++ b/src/v2.x/apps/angular/demo-server/tsconfig.json
@@ -0,0 +1,14 @@
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "NodeNext",
+ "moduleResolution": "NodeNext",
+ "strict": true,
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "forceConsistentCasingInFileNames": true,
+ "resolveJsonModule": true,
+ "outDir": "dist"
+ },
+ "include": ["src"]
+}
\ No newline at end of file
diff --git a/src/v2.x/apps/angular/demo/angular.json b/src/v2.x/apps/angular/demo/angular.json
new file mode 100644
index 0000000000..0e6a6e9c52
--- /dev/null
+++ b/src/v2.x/apps/angular/demo/angular.json
@@ -0,0 +1,34 @@
+{
+ "$schema": "https://json.schemastore.org/angular-cli",
+ "version": 1,
+ "projects": {
+ "angular-demo": {
+ "projectType": "application",
+ "root": ".",
+ "sourceRoot": "src",
+ "architect": {
+ "build": {
+ "builder": "@angular-devkit/build-angular:application",
+ "options": {
+ "outputPath": "dist/angular-demo",
+ "index": "src/index.html",
+ "browser": "src/main.ts",
+ "tsConfig": "tsconfig.app.json",
+ "assets": ["src/favicon.ico", "src/assets"],
+ "styles": ["node_modules/@copilotkitnext/angular/dist/styles.css"],
+ "optimization": false
+ }
+ },
+ "serve": {
+ "builder": "@angular-devkit/build-angular:dev-server",
+ "options": {
+ "buildTarget": "angular-demo:build"
+ }
+ }
+ }
+ }
+ },
+ "cli": {
+ "analytics": "980356bd-241e-4f9c-91f9-6c7714a97a43"
+ }
+}
diff --git a/src/v2.x/apps/angular/demo/package.json b/src/v2.x/apps/angular/demo/package.json
new file mode 100644
index 0000000000..8cc4906c53
--- /dev/null
+++ b/src/v2.x/apps/angular/demo/package.json
@@ -0,0 +1,49 @@
+{
+ "name": "@copilotkitnext/angular-demo",
+ "private": true,
+ "version": "0.0.0",
+ "type": "module",
+ "scripts": {
+ "start": "ng serve",
+ "build": "ng build",
+ "dev": "nodemon --verbose --cwd ../../../ --watch packages/angular/dist/** --watch packages/core/dist/** --watch packages/shared/dist/** --watch packages/runtime/dist/** --watch packages/angular/dist/fesm2022/copilotkit-angular.mjs --ext mjs,js,json,css --delay 800ms --signal SIGTERM --exec \"pnpm -s -C apps/angular/demo run serve:clean\"",
+ "serve:clean": "rimraf .angular/cache || true && ng serve",
+ "clean": "rimraf dist .angular"
+ },
+ "dependencies": {
+ "@angular/animations": "^18.2.0",
+ "@angular/cdk": "^18.2.0",
+ "@angular/common": "^18.2.0",
+ "@angular/compiler": "^18.2.0",
+ "@angular/core": "^18.2.0",
+ "@angular/forms": "^18.2.0",
+ "@angular/platform-browser": "^18.2.0",
+ "@angular/platform-browser-dynamic": "^18.2.0",
+ "@ag-ui/client": "0.0.42",
+ "@ag-ui/core": "0.0.42",
+ "@ag-ui/encoder": "0.0.42",
+ "@ag-ui/proto": "0.0.42",
+ "@copilotkitnext/angular": "workspace:*",
+ "@copilotkitnext/web-inspector": "workspace:*",
+ "compare-versions": "^6.1.1",
+ "fast-json-patch": "^3.1.1",
+ "lit": "^3.3.1",
+ "lucide": "^0.525.0",
+ "partial-json": "^0.1.7",
+ "untruncate-json": "^0.0.1",
+ "uuid": "^11.1.0",
+ "rxjs": "^7.8.1",
+ "tslib": "^2.8.1",
+ "zod-to-json-schema": "^3.24.6",
+ "zod": "^3.25.75",
+ "zone.js": "^0.14.0"
+ },
+ "devDependencies": {
+ "@angular-devkit/build-angular": "^18.2.0",
+ "@angular/cli": "^18.2.0",
+ "@angular/compiler-cli": "^18.2.0",
+ "nodemon": "^3.1.7",
+ "rimraf": "^6.0.1",
+ "typescript": "~5.4.5"
+ }
+}
diff --git a/src/v2.x/apps/angular/demo/src/app/app.component.ts b/src/v2.x/apps/angular/demo/src/app/app.component.ts
new file mode 100644
index 0000000000..f0eea9e0ac
--- /dev/null
+++ b/src/v2.x/apps/angular/demo/src/app/app.component.ts
@@ -0,0 +1,47 @@
+import { Component } from "@angular/core";
+import { CommonModule } from "@angular/common";
+import { HeadlessChatComponent } from "./routes/headless/headless-chat.component";
+import { CustomInputChatComponent } from "./routes/custom-input/custom-input-chat.component";
+import { DefaultChatComponent } from "./routes/default/default-chat.component";
+import { CoPilotPortComponent } from "./routes/ukg-port/co-pilot-port.component";
+
+@Component({
+ selector: "app-root",
+ standalone: true,
+ imports: [
+ CommonModule,
+ HeadlessChatComponent,
+ CustomInputChatComponent,
+ DefaultChatComponent,
+ CoPilotPortComponent,
+ ],
+ template: `
+
+ `,
+ }),
+ parameters: {
+ docs: {
+ description: {
+ story: `
+Customize multiple aspects of the component simultaneously using different slots.
+
+**Available slots:**
+- \`#sendButton\` - Replace the send button
+- \`#additionalToolbarItems\` - Add extra toolbar buttons
+- More slots coming soon!
+
+Each slot operates independently, allowing for granular customization.
+ `,
+ },
+ },
+ },
+};
diff --git a/src/v2.x/apps/angular/storybook/stories/CopilotChatMessageView.stories.ts b/src/v2.x/apps/angular/storybook/stories/CopilotChatMessageView.stories.ts
new file mode 100644
index 0000000000..c79e43813e
--- /dev/null
+++ b/src/v2.x/apps/angular/storybook/stories/CopilotChatMessageView.stories.ts
@@ -0,0 +1,996 @@
+import type { Meta, StoryObj } from "@storybook/angular";
+import { moduleMetadata } from "@storybook/angular";
+import { CommonModule } from "@angular/common";
+import { Component, Injectable, input, signal } from "@angular/core";
+import {
+ CopilotChatMessageView,
+ CopilotChatMessageViewCursor,
+ CopilotKit,
+ provideCopilotKit,
+ provideCopilotChatLabels,
+ Message,
+ RenderToolCallConfig,
+ ToolRenderer,
+ AngularToolCall,
+} from "@copilotkitnext/angular";
+import { ToolCallStatus } from "@copilotkitnext/core";
+import { z } from "zod"; // Schema validation
+
+const meta: Meta = {
+ title: "UI/CopilotChatMessageView",
+ component: CopilotChatMessageView,
+ parameters: {
+ docs: {
+ description: {
+ component:
+ "A simple conversation between user and AI using CopilotChatMessageView component.",
+ },
+ },
+ },
+ decorators: [
+ moduleMetadata({
+ imports: [
+ CommonModule,
+ CopilotChatMessageView,
+ CopilotChatMessageViewCursor,
+ ],
+ providers: [
+ provideCopilotChatLabels({
+ assistantMessageToolbarCopyMessageLabel: "Copy",
+ assistantMessageToolbarCopyCodeLabel: "Copy",
+ assistantMessageToolbarCopyCodeCopiedLabel: "Copied",
+ assistantMessageToolbarThumbsUpLabel: "Good response",
+ assistantMessageToolbarThumbsDownLabel: "Bad response",
+ assistantMessageToolbarReadAloudLabel: "Read aloud",
+ assistantMessageToolbarRegenerateLabel: "Regenerate",
+ userMessageToolbarCopyMessageLabel: "Copy",
+ userMessageToolbarEditMessageLabel: "Edit",
+ }),
+ ],
+ }),
+ ],
+};
+
+export default meta;
+type Story = StoryObj;
+
+// Default story with full conversation - matches React exactly
+export const Default: Story = {
+ parameters: {
+ layout: "fullscreen",
+ docs: {
+ source: {
+ type: "code",
+ code: `import { Component } from '@angular/core';
+import { CopilotChatMessageView, Message } from '@copilotkitnext/angular';
+
+@Component({
+ selector: 'app-chat',
+ standalone: true,
+ imports: [CopilotChatMessageView],
+ template: \`
+
+
+ \`
+})
+export class ChatComponent {
+ messages: Message[] = [
+ {
+ id: 'user-1',
+ content: 'Hello! Can you help me understand how React hooks work?',
+ role: 'user',
+ },
+ {
+ id: 'assistant-1',
+ content: \`React hooks are functions that let you use state and other React features in functional components. Here are the most common ones:
+
+- **useState** - Manages local state
+- **useEffect** - Handles side effects
+- **useContext** - Accesses context values
+- **useCallback** - Memoizes functions
+- **useMemo** - Memoizes values
+
+Would you like me to explain any of these in detail?\`,
+ role: 'assistant',
+ },
+ {
+ id: 'user-2',
+ content: 'Yes, could you explain useState with a simple example?',
+ role: 'user',
+ },
+ {
+ id: 'assistant-2',
+ content: \`Absolutely! Here's a simple useState example:
+
+\\\`\\\`\\\`jsx
+import React, { useState } from 'react';
+
+function Counter() {
+ const [count, setCount] = useState(0);
+
+ return (
+
+
You clicked {count} times
+
+
+ );
+}
+\\\`\\\`\\\`
+
+In this example:
+- \\\`useState(0)\\\` initializes the state with value 0
+- It returns an array: \\\`[currentValue, setterFunction]\\\`
+- \\\`count\\\` is the current state value
+- \\\`setCount\\\` is the function to update the state\`,
+ role: 'assistant',
+ },
+ ];
+
+ // Note: In Angular, thumbs up/down actions are handled through the chat configuration service
+ // or by providing a custom assistant message component
+}`,
+ language: "typescript",
+ },
+ },
+ },
+ render: () => {
+ const messages: Message[] = [
+ {
+ id: "user-1",
+ content: "Hello! Can you help me understand how React hooks work?",
+ role: "user" as const,
+ },
+ {
+ id: "assistant-1",
+ content: `React hooks are functions that let you use state and other React features in functional components. Here are the most common ones:
+
+- **useState** - Manages local state
+- **useEffect** - Handles side effects
+- **useContext** - Accesses context values
+- **useCallback** - Memoizes functions
+- **useMemo** - Memoizes values
+
+Would you like me to explain any of these in detail?`,
+ role: "assistant" as const,
+ },
+ {
+ id: "user-2",
+ content: "Yes, could you explain useState with a simple example?",
+ role: "user" as const,
+ },
+ {
+ id: "assistant-2",
+ content: `Absolutely! Here's a simple useState example:
+
+\`\`\`jsx
+import React, { useState } from 'react';
+
+function Counter() {
+ const [count, setCount] = useState(0);
+
+ return (
+
+
You clicked {count} times
+
+
+ );
+}
+\`\`\`
+
+In this example:
+- \`useState(0)\` initializes the state with value 0
+- It returns an array: \`[currentValue, setterFunction]\`
+- \`count\` is the current state value
+- \`setCount\` is the function to update the state`,
+ role: "assistant" as const,
+ },
+ ];
+
+ return {
+ props: {
+ messages,
+ },
+ template: `
+
+
+
+
+ `,
+ };
+ },
+};
+
+// ShowCursor story - matches React exactly
+export const ShowCursor: Story = {
+ parameters: {
+ layout: "fullscreen",
+ docs: {
+ source: {
+ type: "code",
+ code: `import { Component } from '@angular/core';
+import { CopilotChatMessageView, Message } from '@copilotkitnext/angular';
+
+@Component({
+ selector: 'app-chat',
+ standalone: true,
+ imports: [CopilotChatMessageView],
+ template: \`
+
+
+ \`
+})
+export class ChatComponent {
+ messages: Message[] = [
+ {
+ id: 'user-1',
+ content: 'Can you explain how AI models work?',
+ role: 'user',
+ },
+ ];
+
+ // Note: In Angular, thumbs up/down actions are handled through the chat configuration service
+ // or by providing a custom assistant message component
+}`,
+ language: "typescript",
+ },
+ },
+ },
+ render: () => {
+ const messages: Message[] = [
+ {
+ id: "user-1",
+ content: "Can you explain how AI models work?",
+ role: "user" as const,
+ },
+ ];
+
+ return {
+ props: {
+ messages,
+ showCursor: true,
+ },
+ template: `
+
+ `,
+ };
+ },
+};
diff --git a/src/v2.x/apps/angular/storybook/stories/CopilotChatUserMessage.stories.ts b/src/v2.x/apps/angular/storybook/stories/CopilotChatUserMessage.stories.ts
new file mode 100644
index 0000000000..8d90487846
--- /dev/null
+++ b/src/v2.x/apps/angular/storybook/stories/CopilotChatUserMessage.stories.ts
@@ -0,0 +1,576 @@
+import type { Meta, StoryObj } from "@storybook/angular";
+import { moduleMetadata } from "@storybook/angular";
+import { CommonModule } from "@angular/common";
+import { CopilotChatUserMessage, provideCopilotChatLabels } from "@copilotkitnext/angular";
+import { UserMessage } from "@ag-ui/client";
+
+// Simple default message
+const simpleMessage: UserMessage = {
+ id: "simple-user-message",
+ content: "Hello! Can you help me build an Angular component?",
+ role: "user",
+};
+
+// Longer user message
+const longMessage: UserMessage = {
+ id: "long-user-message",
+ content: `I need help with creating a complex Angular component that handles user authentication. Here are my requirements:
+
+1. The component should have login and signup forms
+2. It needs to integrate with Firebase Auth
+3. Should handle form validation
+4. Must be responsive and work on mobile
+5. Include forgot password functionality
+6. Support social login (Google, GitHub)
+
+Can you help me implement this step by step? I'm particularly struggling with the form validation and state management parts.`,
+ role: "user",
+};
+
+// Code-related user message
+const codeMessage: UserMessage = {
+ id: "code-user-message",
+ content: `I'm getting this error in my Angular app:
+
+TypeError: Cannot read property 'map' of undefined
+
+The error happens in this component:
+
+@Component({
+ selector: 'app-user-list',
+ template: \`
+
+ \`
+})
+export class ChatActionsComponent {
+ messages: Message[] = [
+ {
+ id: 'user-1',
+ content: 'Hello! Can you help me with TypeScript?',
+ role: 'user'
+ },
+ {
+ id: 'assistant-1',
+ content: 'Of course! TypeScript is a superset of JavaScript that adds static typing. What would you like to know?',
+ role: 'assistant'
+ }
+ ];
+
+ customDisclaimerComponent = CustomDisclaimerComponent;
+
+ onThumbsUp(event: any) {
+ console.log('Thumbs up!', event);
+ alert('You liked this message!');
+ }
+
+ onThumbsDown(event: any) {
+ console.log('Thumbs down!', event);
+ alert('You disliked this message!');
+ }
+}`,
+ language: "typescript",
+ },
+ },
+ },
+ render: () => {
+ // Custom disclaimer component
+ @Component({
+ selector: "custom-disclaimer",
+ standalone: true,
+ template: `
+
+ 🎨 This chat interface is fully customizable!
+
+ `,
+ })
+ class CustomDisclaimerComponent {
+ // Accept slot-provided inputs to avoid NG0303
+ @Input() text?: string;
+ @Input() inputClass?: string;
+ }
+
+ const messages: Message[] = [
+ {
+ id: "user-1",
+ content: "Hello! Can you help me with TypeScript?",
+ role: "user" as const,
+ },
+ {
+ id: "assistant-1",
+ content:
+ "Of course! TypeScript is a superset of JavaScript that adds static typing. What would you like to know?",
+ role: "assistant" as const,
+ },
+ ];
+
+ const onThumbsUp = (event: any) => {
+ console.log("Thumbs up!", event);
+ alert("You liked this message!");
+ };
+
+ const onThumbsDown = (event: any) => {
+ console.log("Thumbs down!", event);
+ alert("You disliked this message!");
+ };
+
+ return {
+ template: `
+
+
+
+
+ `,
+ props: {
+ messages,
+ customDisclaimerComponent: CustomDisclaimerComponent,
+ onThumbsUp,
+ onThumbsDown,
+ },
+ };
+ },
+};
diff --git a/src/v2.x/apps/angular/storybook/stories/CopilotChatView-CSS.stories.ts b/src/v2.x/apps/angular/storybook/stories/CopilotChatView-CSS.stories.ts
new file mode 100644
index 0000000000..2cf41dc49d
--- /dev/null
+++ b/src/v2.x/apps/angular/storybook/stories/CopilotChatView-CSS.stories.ts
@@ -0,0 +1,180 @@
+import type { Meta, StoryObj } from "@storybook/angular";
+import { moduleMetadata } from "@storybook/angular";
+import { CommonModule } from "@angular/common";
+import { Component, Input } from "@angular/core";
+import {
+ CopilotChatView,
+ CopilotChatMessageView,
+ CopilotChatInput,
+ provideCopilotChatLabels,
+ provideCopilotKit,
+} from "@copilotkitnext/angular";
+import { Message } from "@ag-ui/client";
+
+const meta: Meta = {
+ title: "UI/CopilotChatView/Customized with CSS",
+ component: CopilotChatView,
+ decorators: [
+ moduleMetadata({
+ imports: [
+ CommonModule,
+ CopilotChatView,
+ CopilotChatMessageView,
+ CopilotChatInput,
+ ],
+ providers: [
+ provideCopilotKit({}),
+ provideCopilotChatLabels({
+ chatInputPlaceholder: "Type a message...",
+ chatDisclaimerText:
+ "AI can make mistakes. Please verify important information.",
+ }),
+ ],
+ }),
+ ],
+ parameters: {
+ layout: "fullscreen",
+ },
+};
+
+export default meta;
+type Story = StoryObj;
+
+// Story with custom disclaimer text
+export const CustomDisclaimerText: Story = {
+ render: () => {
+ const messages: Message[] = [
+ {
+ id: "user-1",
+ content: "Hello!",
+ role: "user" as const,
+ },
+ {
+ id: "assistant-1",
+ content: "Hi there! How can I help you today?",
+ role: "assistant" as const,
+ },
+ ];
+
+ return {
+ template: `
+
+
+
+
+ `,
+ props: {
+ messages,
+ },
+ };
+ },
+};
+
+export const AnimatedDisclaimer: Story = {
+ render: () => {
+ const messages: Message[] = [
+ {
+ id: "user-1",
+ content: "Hello! Can you help me with styling?",
+ role: "user" as const,
+ },
+ {
+ id: "assistant-1",
+ content: `Absolutely! I can help you with CSS styling, design patterns, and UI/UX best practices. What specific styling challenge are you working on?`,
+ role: "assistant" as const,
+ },
+ ];
+
+ return {
+ template: `
+
+ \`
+})
+export class CustomDisclaimerExampleComponent {
+ messages: Message[] = [
+ {
+ id: 'user-1',
+ content: 'Hello! Can you help me with TypeScript?',
+ role: 'user'
+ },
+ {
+ id: 'assistant-1',
+ content: 'Of course! TypeScript is a superset of JavaScript that adds static typing. What would you like to know?',
+ role: 'assistant'
+ }
+ ];
+
+ customDisclaimerComponent = CustomDisclaimerComponent;
+}`,
+ language: "typescript",
+ },
+ },
+ },
+ render: () => {
+ const messages: Message[] = [
+ {
+ id: "user-1",
+ content: "Hello! Can you help me with TypeScript?",
+ role: "user" as const,
+ },
+ {
+ id: "assistant-1",
+ content:
+ "Of course! TypeScript is a superset of JavaScript that adds static typing. What would you like to know?",
+ role: "assistant" as const,
+ },
+ ];
+
+ return {
+ template: `
+
+ \`
+})
+export class ChatScrollComponent {
+ messages: Message[] = [];
+
+ constructor() {
+ // Generate many messages to show scroll behavior
+ for (let i = 0; i < 20; i++) {
+ if (i % 2 === 0) {
+ this.messages.push({
+ id: \`user-\${i}\`,
+ content: \`User message \${i}: This is a test message to demonstrate scrolling behavior.\`,
+ role: 'user'
+ });
+ } else {
+ this.messages.push({
+ id: \`assistant-\${i}\`,
+ content: \`Assistant response \${i}: This is a longer response to demonstrate how the chat interface handles various message lengths and scrolling behavior when there are many messages in the conversation.\`,
+ role: 'assistant'
+ });
+ }
+ }
+ }
+}`,
+ language: "typescript",
+ },
+ },
+ },
+ render: () => {
+ // Generate many messages to show scroll behavior
+ const messages: Message[] = [];
+ for (let i = 0; i < 20; i++) {
+ if (i % 2 === 0) {
+ messages.push({
+ id: `user-${i}`,
+ content: `User message ${i}: This is a test message to demonstrate scrolling behavior.`,
+ role: "user" as const,
+ });
+ } else {
+ messages.push({
+ id: `assistant-${i}`,
+ content: `Assistant response ${i}: This is a longer response to demonstrate how the chat interface handles various message lengths and scrolling behavior when there are many messages in the conversation.`,
+ role: "assistant" as const,
+ });
+ }
+ }
+
+ return {
+ template: `
+
+
+
+
+ `,
+ props: {
+ messages,
+ },
+ };
+ },
+};
+
+// Story with empty state
+export const EmptyState: Story = {
+ parameters: {
+ docs: {
+ source: {
+ type: "code",
+ code: `import { Component } from '@angular/core';
+import {
+ CopilotChatView,
+ provideCopilotKit,
+ provideCopilotChatLabels
+} from '@copilotkitnext/angular';
+
+@Component({
+ selector: 'app-chat-empty',
+ standalone: true,
+ imports: [CopilotChatView],
+ providers: [
+ provideCopilotKit({}),
+ provideCopilotChatLabels({
+ chatInputPlaceholder: 'Type a message...',
+ chatDisclaimerText: 'AI can make mistakes. Please verify important information.'
+ })
+ ],
+ template: \`
+
+ `,
+ props: {},
+ };
+ },
+};
diff --git a/src/v2.x/apps/angular/storybook/stories/Welcome.mdx b/src/v2.x/apps/angular/storybook/stories/Welcome.mdx
new file mode 100644
index 0000000000..d585a35e93
--- /dev/null
+++ b/src/v2.x/apps/angular/storybook/stories/Welcome.mdx
@@ -0,0 +1,120 @@
+import { Meta } from "@storybook/blocks";
+
+
+
+# CopilotKit Angular Components
+
+Welcome to the **CopilotKit Angular Storybook**! This is the dedicated documentation and showcase for all Angular components in the CopilotKit ecosystem.
+
+## What is CopilotKit?
+
+CopilotKit is a comprehensive toolkit for building AI-powered copilot experiences in your applications. This Angular package provides native Angular components that integrate seamlessly with your Angular applications.
+
+## Available Components
+
+### Chat Components
+
+- **CopilotChatInput** - A feature-rich chat input component with voice recording, tools menu, and file attachments
+- **CopilotChatTextarea** - An auto-resizing textarea component for chat interfaces
+- **CopilotChatView** - Complete chat interface with message history
+- **CopilotChatUserMessage** - User message display component
+- **CopilotAssistantMessage** - Assistant message display component
+
+### Context Management
+
+- **CopilotAgentContextProvider** - Provides agent context to child components
+- **CopilotChatConfigurationProvider** - Configures chat components globally
+
+## Getting Started
+
+### Installation
+
+```bash
+npm install @copilotkitnext/angular
+# or
+pnpm add @copilotkitnext/angular
+```
+
+### Basic Usage
+
+```typescript
+import { Component } from "@angular/core";
+import { CopilotChatInput } from "@copilotkitnext/angular";
+import { provideCopilotChatConfiguration } from "@copilotkitnext/angular";
+
+@Component({
+ selector: "app-chat",
+ standalone: true,
+ imports: [CopilotChatInput],
+ providers: [
+ provideCopilotChatConfiguration({
+ labels: {
+ chatInputPlaceholder: "Type a message...",
+ },
+ }),
+ ],
+ template: `
+
+ `,
+})
+export class ChatComponent {
+ onSubmitMessage(message: string): void {
+ console.log("Message:", message);
+ }
+}
+```
+
+## Features
+
+### Angular 19+ Support
+
+Built with the latest Angular features including:
+
+- Standalone components
+- Signals for reactive state management
+- OnPush change detection
+- TypeScript strict mode
+
+### Full TypeScript Support
+
+All components are fully typed with comprehensive TypeScript definitions.
+
+### Customizable
+
+- Custom CSS classes for styling
+- Configurable labels and placeholders
+- Event emitters for all interactions
+- Flexible slot system for content projection
+
+## Development
+
+This Storybook runs alongside the [React Storybook](http://localhost:6006) on port 6007.
+
+### Available Scripts
+
+```bash
+# Run Angular Storybook in development mode
+pnpm --filter storybook-angular dev
+
+# Build Angular Storybook for production
+pnpm --filter storybook-angular build
+```
+
+## Links
+
+- [CopilotKit Documentation](https://docs.copilotkit.ai)
+- [GitHub Repository](https://github.com/CopilotKit/CopilotKit)
+- [React Components Storybook](http://localhost:6006)
+
+## Support
+
+For issues, feature requests, or questions:
+
+- [GitHub Issues](https://github.com/CopilotKit/CopilotKit/issues)
+- [Discord Community](https://discord.gg/copilotkit)
+
+---
+
+_Built with Angular 19 and Storybook 8_
diff --git a/src/v2.x/apps/angular/storybook/tsconfig.json b/src/v2.x/apps/angular/storybook/tsconfig.json
new file mode 100644
index 0000000000..71f2d36e51
--- /dev/null
+++ b/src/v2.x/apps/angular/storybook/tsconfig.json
@@ -0,0 +1,27 @@
+{
+ "extends": "@copilotkitnext/typescript-config/base.json",
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "ESNext",
+ "lib": ["ES2022", "dom"],
+ "moduleResolution": "bundler",
+ "strict": true,
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "forceConsistentCasingInFileNames": true,
+ "allowSyntheticDefaultImports": true,
+ "experimentalDecorators": true,
+ "emitDecoratorMetadata": true,
+ "resolveJsonModule": true,
+ "useDefineForClassFields": false,
+ "paths": {
+ "@copilotkitnext/angular": ["../../../packages/angular/src/index.ts"],
+ "@copilotkitnext/angular/*": ["../../../packages/angular/src/*"],
+ "@copilotkitnext/core": ["../../../packages/core/src/index.ts"],
+ "@copilotkitnext/shared": ["../../../packages/shared/src/index.ts"]
+ },
+ "types": ["node"]
+ },
+ "include": ["**/*.ts", "**/*.tsx", ".storybook/**/*"],
+ "exclude": ["node_modules", "dist"]
+}
diff --git a/src/v2.x/apps/docs/docs.json b/src/v2.x/apps/docs/docs.json
new file mode 100644
index 0000000000..369f70261c
--- /dev/null
+++ b/src/v2.x/apps/docs/docs.json
@@ -0,0 +1,83 @@
+{
+ "$schema": "https://mintlify.com/schema.json",
+ "name": "CopilotKit vnext_experimental",
+ "theme": "mint",
+ "logo": {
+ "dark": "/logo/dark.svg",
+ "light": "/logo/light.svg"
+ },
+ "favicon": "/favicon.ico",
+ "colors": {
+ "primary": "#0D9373",
+ "light": "#07C983",
+ "dark": "#0D9373"
+ },
+ "topbarLinks": [
+ {
+ "name": "Support",
+ "url": "mailto:hi@copilotkitnext.ai"
+ }
+ ],
+ "topbarCtaButton": {
+ "name": "Dashboard",
+ "url": "https://dashboard.copilotkit.ai"
+ },
+ "navigation": {
+ "anchors": [
+ {
+ "name": "Community",
+ "icon": "slack",
+ "url": "https://discord.gg/6dffbvGU3D"
+ },
+ {
+ "name": "Blog",
+ "icon": "newspaper",
+ "url": "https://copilotkit.ai/blog"
+ }
+ ],
+ "groups": [
+ {
+ "group": "Get Started",
+ "pages": ["introduction"]
+ },
+ {
+ "group": "API Reference",
+ "pages": [
+ {
+ "group": "Core",
+ "pages": ["reference/copilotkit-core", "reference/proxied-copilot-runtime-agent", "reference/frontend-tool"]
+ },
+ {
+ "group": "React",
+ "pages": [
+ {
+ "group": "Providers",
+ "pages": ["reference/copilotkit-provider", "reference/copilot-chat-configuration-provider"]
+ },
+ {
+ "group": "Components",
+ "pages": ["reference/copilot-chat"]
+ },
+ {
+ "group": "Hooks",
+ "pages": [
+ "reference/use-copilotkit",
+ "reference/use-agent",
+ "reference/use-agent-context",
+ "reference/use-frontend-tool",
+ "reference/use-human-in-the-loop",
+ "reference/use-render-tool-call"
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ "footerSocials": {
+ "x": "https://x.com/copilotkit",
+ "github": "https://github.com/copilotkit/copilotkit",
+ "linkedin": "https://www.linkedin.com/company/copilotkit"
+ }
+}
diff --git a/src/v2.x/apps/docs/introduction.mdx b/src/v2.x/apps/docs/introduction.mdx
new file mode 100644
index 0000000000..dcdf0f6ce8
--- /dev/null
+++ b/src/v2.x/apps/docs/introduction.mdx
@@ -0,0 +1,68 @@
+---
+title: CopilotKit VNext Documentation
+description: "CopilotKit VNext Documentation"
+---
+
+## API Reference
+
+### Core
+
+
+ Core CopilotKit class
+
+
+
+ Host agents and expose runtime endpoints
+
+
+
+ Proxied runtime agent for CopilotKit
+
+
+
+ Frontend tool utilities
+
+
+### React
+
+#### Providers
+
+
+ Main provider for CopilotKit React integration
+
+
+
+ Configuration provider for CopilotChat
+
+
+#### Components
+
+
+ Chat component for CopilotKit
+
+
+#### Hooks
+
+
+ Main hook for CopilotKit functionality
+
+
+
+ Hook for agent interactions
+
+
+
+ Hook for agent context management
+
+
+
+ Hook for frontend tools
+
+
+
+ Hook for human-in-the-loop functionality
+
+
+
+ Hook for rendering tool calls
+
diff --git a/src/v2.x/apps/docs/package.json b/src/v2.x/apps/docs/package.json
new file mode 100644
index 0000000000..6c4afcdf7e
--- /dev/null
+++ b/src/v2.x/apps/docs/package.json
@@ -0,0 +1,16 @@
+{
+ "name": "@copilotkitnext/docs",
+ "version": "0.1.0",
+ "private": true,
+ "scripts": {
+ "dev": "mintlify dev --port 4000",
+ "lint": "mintlify broken-links",
+ "check-types": "echo 'No TypeScript compilation needed for Mintlify docs'"
+ },
+ "devDependencies": {
+ "mintlify": "^4.2.127"
+ },
+ "dependencies": {
+ "sharp": "^0.34.2"
+ }
+}
diff --git a/src/v2.x/apps/docs/reference/copilot-chat-configuration-provider.mdx b/src/v2.x/apps/docs/reference/copilot-chat-configuration-provider.mdx
new file mode 100644
index 0000000000..8348daeea0
--- /dev/null
+++ b/src/v2.x/apps/docs/reference/copilot-chat-configuration-provider.mdx
@@ -0,0 +1,179 @@
+---
+title: CopilotChatConfigurationProvider
+description: "CopilotChatConfigurationProvider API Reference"
+---
+
+`CopilotChatConfigurationProvider` is a React context provider that manages configuration for chat UI components,
+including labels, agent ID, and thread ID. It enables customization of all text labels in the chat interface and
+provides context for chat components to access configuration values.
+
+## What is CopilotChatConfigurationProvider?
+
+The CopilotChatConfigurationProvider:
+
+- Manages UI labels for all chat components (placeholders, button labels, etc.), allowing for localization or
+ customization of the chat interface.
+- Lets you to access the current `agentId` and `threadId`
+- Supports nested configuration with proper inheritance
+
+## Basic Usage
+
+Wrap your chat components with the provider to customize configuration:
+
+```tsx
+import { CopilotChatConfigurationProvider } from "@copilotkitnext/react";
+
+function App() {
+ return (
+
+ {/* Your chat components */}
+
+ );
+}
+```
+
+## Props
+
+### threadId
+
+`string` **(required)**
+
+A unique identifier for the conversation thread. This is used to maintain conversation history and context.
+
+```tsx
+{children}
+```
+
+### agentId
+
+`string` **(optional)**
+
+The ID of the agent to use for this chat context. If not provided, defaults to `"default"`.
+
+```tsx
+
+ {children}
+
+```
+
+### labels
+
+`Partial` **(optional)**
+
+Custom labels for chat UI elements. Any labels not provided will use the default values.
+
+```tsx
+
+ {children}
+
+```
+
+### children
+
+`ReactNode` **(required)**
+
+The React components that will have access to the chat configuration context.
+
+## Using with CopilotChat
+
+The `CopilotChat` component automatically creates its own `CopilotChatConfigurationProvider` internally. When using
+`CopilotChat`, you can pass configuration directly as props:
+
+```tsx
+
+```
+
+### Priority System
+
+When `CopilotChat` is used within an existing `CopilotChatConfigurationProvider`, values are merged with the following
+priority (highest to lowest):
+
+1. Props passed directly to `CopilotChat`
+2. Values from the outer `CopilotChatConfigurationProvider`
+3. Default values
+
+Example:
+
+```tsx
+
+
+
+```
+
+## Accessing Configuration
+
+Use the `useCopilotChatConfiguration` hook to access configuration values in your components:
+
+```tsx
+import { useCopilotChatConfiguration } from "@copilotkitnext/react";
+
+function MyComponent() {
+ const config = useCopilotChatConfiguration();
+
+ if (!config) {
+ // No provider found
+ return null;
+ }
+
+ return (
+
+
Agent: {config.agentId}
+
Thread: {config.threadId}
+
Labels: {JSON.stringify(config.labels)}
+
+ );
+}
+```
+
+Note: The hook returns `null` if no provider is found in the component tree.
+
+## Localization Example
+
+The provider is ideal for implementing localization:
+
+```tsx
+import { useTranslation } from "react-i18next";
+
+function LocalizedChat() {
+ const { t } = useTranslation();
+
+ return (
+
+
+
+ );
+}
+```
diff --git a/src/v2.x/apps/docs/reference/copilot-chat.mdx b/src/v2.x/apps/docs/reference/copilot-chat.mdx
new file mode 100644
index 0000000000..656c626765
--- /dev/null
+++ b/src/v2.x/apps/docs/reference/copilot-chat.mdx
@@ -0,0 +1,116 @@
+---
+title: CopilotChat
+description: "CopilotChat Component API Reference"
+---
+
+`CopilotChat` is a React component that provides a complete chat interface for interacting with AI agents. It handles
+message display, user input, tool execution rendering, and agent communication automatically.
+
+## What is CopilotChat?
+
+The CopilotChat component:
+
+- Provides a complete chat UI out of the box
+- Manages conversation threads and message history
+- Automatically connects to agents and handles message routing
+- Renders tool executions with visual feedback
+- Supports customization through props and slots
+- Handles auto-scrolling and responsive layouts
+
+## Basic Usage
+
+```tsx
+import { CopilotChat, CopilotKitProvider } from "@copilotkitnext/react";
+
+function App() {
+ return (
+
+
+
+ );
+}
+```
+
+## Props
+
+### agentId
+
+`string` **(optional)**
+
+The ID of the agent to connect to. Defaults to `"default"`.
+
+```tsx
+
+```
+
+### threadId
+
+`string` **(optional)**
+
+The conversation thread ID. If not provided, a new thread ID is automatically generated.
+
+```tsx
+
+```
+
+### labels
+
+`Partial` **(optional)**
+
+Customize the text labels used throughout the chat interface.
+
+```tsx
+
+```
+
+### autoScroll
+
+`boolean` **(optional, default: true)**
+
+Automatically scroll to the bottom when new messages appear.
+
+```tsx
+
+```
+
+### className
+
+`string` **(optional)**
+
+CSS class name for the root container.
+
+```tsx
+
+```
+
+### Component Slots
+
+CopilotChat supports slot customization for various parts of the UI:
+
+```tsx
+
+```
+
+## Auto-scrolling Behavior
+
+CopilotChat automatically scrolls to the bottom when:
+
+- New messages are added
+- The user is already near the bottom
+- `autoScroll` prop is true (default)
+
+The scroll-to-bottom button appears when the user scrolls up and new content is available.
diff --git a/src/v2.x/apps/docs/reference/copilot-runtime.mdx b/src/v2.x/apps/docs/reference/copilot-runtime.mdx
new file mode 100644
index 0000000000..220cf5f40e
--- /dev/null
+++ b/src/v2.x/apps/docs/reference/copilot-runtime.mdx
@@ -0,0 +1,277 @@
+---
+title: CopilotRuntime
+description: "Server-side runtime for hosting CopilotKit agents"
+---
+
+The `CopilotRuntime` package gives you everything you need to host CopilotKit agents on your own infrastructure. It owns the agent registry, wires an `AgentRunner`, exposes HTTP endpoints (Express or Hono), and optionally coordinates middleware and transcription services.
+
+## Basic Setup
+
+```ts
+import { CopilotRuntime, InMemoryAgentRunner } from "@copilotkitnext/runtime";
+import { BasicAgent } from "@copilotkitnext/agent";
+
+const runtime = new CopilotRuntime({
+ agents: {
+ default: new BasicAgent({
+ model: "openai/gpt-4o",
+ prompt: "You are a helpful assistant.",
+ }),
+ },
+ runner: new InMemoryAgentRunner(),
+});
+```
+
+Once you create a runtime instance you can mount one of the provided HTTP endpoints (Express or Hono) described below.
+
+## `CopilotRuntime` Constructor
+
+```ts
+new CopilotRuntime(options: CopilotRuntimeOptions)
+```
+
+### `CopilotRuntimeOptions`
+
+| Option | Type | Description |
+| --- | --- | --- |
+| `agents` | `Promise> \| Record` | Required. A map from agent identifier to an `AbstractAgent`. You can return the map synchronously or asynchronously. |
+| `runner` | `AgentRunner` | Optional. Defaults to `new InMemoryAgentRunner()`. Controls how agent runs are scheduled and streamed. |
+| `transcriptionService` | `TranscriptionService` | Optional. Enables `/transcribe` and reports `audioFileTranscriptionEnabled: true` from `/info`. |
+| `beforeRequestMiddleware` | `BeforeRequestMiddleware` | Optional. Runs before every request. Can mutate the incoming `Request` or return `void`. |
+| `afterRequestMiddleware` | `AfterRequestMiddleware` | Optional. Runs after every handler resolves. Use this for logging, metrics, etc. |
+
+### Passing Agents
+
+- Provide a plain object mapping agent ids to instances. The helper `BasicAgent` covers common OpenAI/Anthropic/Gemini setups, but you can supply any `AbstractAgent`.
+- Because `agents` may be an async function, you can lazily load credentials or fetch configuration before returning the record.
+- Each request clones the selected agent instance so per-request state (messages, headers, tool registration) does not leak between threads.
+- `Authorization` and `x-*` headers on the incoming request are forwarded to the cloned agent automatically. Override or strip them inside `beforeRequestMiddleware` if needed.
+
+```ts
+const runtime = new CopilotRuntime({
+ agents: async () => ({
+ default: buildDefaultAgent(),
+ support: buildSupportAgent(),
+ }),
+});
+```
+
+### Choosing an `AgentRunner`
+
+`InMemoryAgentRunner` is the default and streams events directly from your Node.js process. Swap it with a custom `AgentRunner` if you need to enqueue work or forward to another service:
+
+```ts
+class QueueBackedRunner implements AgentRunner { /* ... */ }
+
+const runtime = new CopilotRuntime({
+ agents,
+ runner: new QueueBackedRunner(),
+});
+```
+
+### Middleware Hooks
+
+```ts
+const runtime = new CopilotRuntime({
+ agents,
+ beforeRequestMiddleware: async ({ request, path }) => {
+ const auth = request.headers.get("authorization");
+ if (!auth) {
+ throw new Response("Unauthorized", { status: 401 });
+ }
+ },
+ afterRequestMiddleware: async ({ response, path }) => {
+ console.info("Handled", path, response.status);
+ },
+});
+```
+
+Throwing a `Response` from `beforeRequestMiddleware` short-circuits the request. `afterRequestMiddleware` runs in the background and should swallow its own errors.
+
+## HTTP Endpoints
+
+Import the helper that matches your server framework and the transport style you want to expose.
+
+### Hono (REST-style)
+
+```ts
+import { createCopilotEndpoint } from "@copilotkitnext/runtime";
+
+const copilot = createCopilotEndpoint({ runtime, basePath: "/api/copilotkit" });
+
+const app = new Hono();
+app.route("/", copilot);
+```
+
+This mounts five routes under the base path:
+
+| Method | Path | Purpose |
+| --- | --- | --- |
+| `POST` | `/agent/:agentId/run` | Streams agent events (SSE). |
+| `POST` | `/agent/:agentId/connect` | Creates a live WebSocket/stream connection. |
+| `POST` | `/agent/:agentId/stop/:threadId` | Cancels an in-flight thread. |
+| `GET` | `/info` | Returns runtime metadata and agent list. |
+| `POST` | `/transcribe` | Proxies audio transcription (requires `transcriptionService`). |
+
+### Hono (Single-route)
+
+```ts
+import { createCopilotEndpointSingleRoute } from "@copilotkitnext/runtime";
+
+const copilot = createCopilotEndpointSingleRoute({ runtime, basePath: "/api/copilotkit" });
+
+const app = new Hono();
+app.route("/", copilot);
+```
+
+All interactions happen through a single `POST /api/copilotkit` endpoint. The client sends a JSON envelope:
+
+```json
+{
+ "method": "agent/run",
+ "params": { "agentId": "default" },
+ "body": { "messages": [...], "threadId": "thread-123" }
+}
+```
+
+Allowed `method` values are:
+
+- `agent/run`
+- `agent/connect`
+- `agent/stop`
+- `info`
+- `transcribe`
+
+Pair this server endpoint with the React provider flag ``.
+
+### Next.js (App Router) with Hono
+
+When you're inside a Next.js `app/` route, export the Hono handlers directly:
+
+```ts
+// app/api/copilotkit/[[...slug]]/route.ts
+import { CopilotRuntime, createCopilotEndpoint } from "@copilotkitnext/runtime";
+import { handle } from "hono/vercel";
+
+const runtime = new CopilotRuntime({ agents, runner });
+const app = createCopilotEndpoint({ runtime, basePath: "/api/copilotkit" });
+
+export const GET = handle(app);
+export const POST = handle(app);
+```
+
+Swap `createCopilotEndpoint` for `createCopilotEndpointSingleRoute` if you configure the client with `useSingleEndpoint`.
+
+### Express (REST-style)
+
+```ts
+import express from "express";
+import { createCopilotEndpointExpress } from "@copilotkitnext/runtime/express";
+
+const app = express();
+app.use(
+ "/api/copilotkit",
+ createCopilotEndpointExpress({ runtime, basePath: "/" }),
+);
+```
+
+The router mirrors the Hono REST routes and automatically enables permissive CORS (allowing all origins, headers, and methods). Adjust headers upstream if you need tighter controls.
+
+### Express (Single-route)
+
+```ts
+import express from "express";
+import { createCopilotEndpointSingleRouteExpress } from "@copilotkitnext/runtime/express";
+
+const app = express();
+app.use(
+ "/api/copilotkit",
+ createCopilotEndpointSingleRouteExpress({ runtime, basePath: "/" }),
+);
+```
+
+Single-route Express works identically to the Hono version: send the JSON envelope described earlier, and set `useSingleEndpoint` on the client.
+
+### NestJS (Express backend)
+
+NestJS uses Express by default. Mount the Express router in `main.ts`:
+
+```ts
+// main.ts
+import { NestFactory } from '@nestjs/core';
+import { AppModule } from './app.module';
+import { NestExpressApplication } from '@nestjs/platform-express';
+import { CopilotRuntime } from '@copilotkitnext/runtime';
+import { createCopilotEndpointExpress } from '@copilotkitnext/runtime/express';
+import { BasicAgent } from '@copilotkitnext/agent';
+
+async function bootstrap() {
+ const app = await NestFactory.create(AppModule);
+
+ const runtime = new CopilotRuntime({
+ agents: {
+ default: new BasicAgent({ model: 'openai/gpt-4o', prompt: 'You are helpful.' }),
+ },
+ });
+
+ // Mount under /api/copilotkit (REST-style routes)
+ app.use(
+ '/api/copilotkit',
+ createCopilotEndpointExpress({ runtime, basePath: '/' }),
+ );
+
+ await app.listen(3000);
+}
+bootstrap();
+```
+
+Available routes (no global prefix):
+
+- `POST /api/copilotkit/agent/:agentId/run`
+- `POST /api/copilotkit/agent/:agentId/connect`
+- `POST /api/copilotkit/agent/:agentId/stop/:threadId`
+- `GET /api/copilotkit/info`
+- `POST /api/copilotkit/transcribe`
+
+If you prefer the single-route transport, mount the single-route helper instead and set `useSingleEndpoint` on the client:
+
+```ts
+import { createCopilotEndpointSingleRouteExpress } from '@copilotkitnext/runtime/express';
+
+app.use(
+ '/api/copilotkit',
+ createCopilotEndpointSingleRouteExpress({ runtime, basePath: '/' }),
+);
+```
+
+Notes:
+
+- If you call `app.setGlobalPrefix('api')`, the effective paths become `/api/copilotkit/...` (or `/api/copilotkit` for single-route).
+- Endpoints stream Server‑Sent Events; ensure your proxy honors `text/event-stream` and keep‑alive.
+- The router enables permissive CORS; tighten via Nest’s `enableCors` if needed.
+
+## Runtime Metadata
+
+Calling `GET /info` (or the `info` single-route method) returns:
+
+```json
+{
+ "version": "0.0.20",
+ "agents": {
+ "default": {
+ "name": "default",
+ "className": "BasicAgent",
+ "description": "You are a helpful assistant."
+ }
+ },
+ "audioFileTranscriptionEnabled": false
+}
+```
+
+Use this to verify deployments and surface diagnostics in your UI.
+
+## Next Steps
+
+- Configure the React client with `runtimeUrl` (and `useSingleEndpoint` if you chose the single endpoint helper).
+- Register frontend tools with `CopilotKitProvider` so agents can trigger UI actions.
+- Extend the runtime runner or middleware hooks to integrate logging, rate limiting, or background queues.
diff --git a/src/v2.x/apps/docs/reference/copilotkit-core.mdx b/src/v2.x/apps/docs/reference/copilotkit-core.mdx
new file mode 100644
index 0000000000..3e3643a594
--- /dev/null
+++ b/src/v2.x/apps/docs/reference/copilotkit-core.mdx
@@ -0,0 +1,549 @@
+---
+title: CopilotKitCore
+description: "CopilotKitCore API Reference"
+---
+
+`CopilotKitCore` is the client-side cross-framework orchestration layer that coordinates communication between your
+application's UI, agents abd the remote Copilot runtime.
+
+## Architecture Overview
+
+```mermaid
+graph TB
+ subgraph Framework["Framework Layer"]
+ React["**CopilotKit React** Components & Hooks"]
+ Angular["**CopilotKit Angular** Directives & Services"]
+ Vue["**CopilotKit ...** Future frameworks"]
+ end
+
+ subgraph CoreLayer["Core Layer"]
+ Core["**CopilotKitCore** Cross-framework Orchestration State Management & Agent Coordination"]
+ end
+
+ subgraph RuntimeLayer["Runtime Layer"]
+ Runtime["**CopilotRuntime** AI Agent Execution Backend Services"]
+ end
+
+ React --> Core
+ Angular --> Core
+ Vue -.-> Core
+ Core <--> Runtime
+```
+
+## What does CopilotKitCore do?
+
+CopilotKitCore solves several complex challenges in building AI-powered applications:
+
+1. **Agent Orchestration**: Handles the entire lifecycle of running AI agents, from starting the agent and executing
+ tools, to providing tool results, handling follow-ups and handling streaming updates to the UI.
+2. **Runtime Connection**: Manages connecting to and synchronizing with the remote `CopilotRuntime`.
+3. **State Synchronization**: Maintains consistent state across your application, ensuring all components have access to
+ the latest agents, tools, and context
+4. **Framework Independence**: Works with any frontend framework, providing a consistent API whether you're using React,
+ Angular, Vue, or vanilla JavaScript
+
+At its heart, CopilotKitCore maintains the authoritative state for these critical elements:
+
+- **Agents**: Both local and remote AI agents that power your application's intelligence
+- **Context**: Additional information that agents can use to make more informed decisions
+- **Frontend Tools**: Functions that agents can call to interact with your UI
+- **Properties and Headers**: Application-specific data forwarded to agents as additional properties or HTTP headers
+- **Runtime Metadata**: Connection status, versioning, and configuration details
+
+## Creating a CopilotKitCore Instance
+
+
+ In most applications, you don’t need to create a `CopilotKitCore` instance yourself—CopilotKit initializes and manages
+ it behind the scenes.
+
+
+Instantiate `CopilotKitCore` to initialize the client that manages runtime connections, agents, and tools.
+
+```typescript
+new CopilotKitCore(config?: CopilotKitCoreConfig)
+````
+
+#### Parameters
+
+```typescript
+interface CopilotKitCoreConfig {
+ runtimeUrl?: string; // The endpoint where your CopilotRuntime server is hosted
+ headers?: Record; // Custom HTTP headers to include with every request
+ properties?: Record; // Application-specific data forwarded to agents as context
+ agents__unsafe_dev_only?: Record; // Local agents for development only - production requires CopilotRuntime
+ tools?: FrontendTool[]; // Frontend functions that agents can invoke
+}
+```
+
+Configuration details:
+
+- `runtimeUrl`: When provided, CopilotKitCore will automatically connect and discover available remote agents.
+- `headers`: Headers to include with every request.
+- `properties`: Properties forwarded to agents as `forwardedProps`.
+- `tools`: Frontend tools that agents can invoke.
+- `agents__unsafe_dev_only`: **Development only** - This property is intended solely for rapid prototyping during
+ development. Production deployments require the security, reliability, and performance guarantees that only the
+ CopilotRuntime can provide. The key becomes the agent's identifier.
+
+## Core Properties
+
+Once initialized, CopilotKitCore exposes several properties that provide insight into its current state:
+
+### Runtime Configuration
+
+- `runtimeUrl`: `string | undefined` The current runtime endpoint. Changing this property triggers a connection attempt
+ to the new runtime. Setting it to `undefined` gracefully disconnects from the current runtime.
+
+- `runtimeVersion`: `string | undefined` The version of the connected runtime, helpful for compatibility checks and
+ debugging.
+
+- `runtimeConnectionStatus`: `CopilotKitCoreRuntimeConnectionStatus` Tracks the current connection state, allowing you
+ to respond to connection changes in your UI.
+
+### State Management
+
+- `headers`: `Readonly>` The current request headers sent with every request.
+
+- `properties`: `Readonly>` The application properties being forwarded to agents.
+
+- `agents`: `Readonly>` A combined view of all available agents, merging local development
+ agents with those discovered from the runtime.
+
+- `tools`: `Readonly[]>` The list of registered frontend tools available to agents.
+
+- `context`: `Readonly>` Contextual information that agents can use to make more informed
+ decisions.
+
+## Understanding Runtime Connections
+
+When you provide a `runtimeUrl`, CopilotKitCore initiates a connection to your CopilotRuntime server. Here's what
+happens behind the scenes:
+
+1. CopilotKitCore sends a GET request to `{runtimeUrl}/info`
+2. The runtime responds with available agents and metadata
+3. For each remote agent, `CopilotKitCore` creates a `ProxiedCopilotRuntimeAgent` instance
+4. These remote agents are merged with your local agents
+5. Subscribers are notified of the connection status and agent availability
+
+### Runtime Connection States
+
+The connection to your runtime can be in one of four states:
+
+- `Disconnected`: No runtime URL is configured, or the connection was intentionally closed
+- `Connecting`: Actively attempting to establish a connection with the runtime
+- `Connected`: Successfully connected and remote agents are available
+- `Error`: The connection attempt failed, but CopilotKitCore will continue with local agents only
+
+## Event Subscription System
+
+CopilotKitCore implements a robust event system that allows you to react to state changes and agent activities:
+
+### subscribe()
+
+Registers a subscriber to receive events. Returns a subscription object with an `unsubscribe()` method, keeping
+unsubscription localized to the subscription object.
+
+```typescript
+subscribe(subscriber: CopilotKitCoreSubscriber): { unsubscribe(): void }
+```
+
+## Subscribing to Events
+
+The event subscription system allows you to build reactive UIs that respond to CopilotKitCore's state changes. Each
+event provides both the CopilotKitCore instance and relevant data:
+
+### onRuntimeConnectionStatusChanged()
+
+Notified whenever the connection to the runtime changes state. Use this to show connection indicators in your UI.
+
+```typescript
+onRuntimeConnectionStatusChanged?: (event: {
+ copilotkit: CopilotKitCore;
+ status: CopilotKitCoreRuntimeConnectionStatus;
+}) => void | Promise
+```
+
+### onToolExecutionStart()
+
+Fired when an agent begins executing a tool. Useful for showing loading states or activity indicators.
+
+```typescript
+onToolExecutionStart?: (event: {
+ copilotkit: CopilotKitCore;
+ toolCallId: string;
+ agentId: string;
+ toolName: string;
+ args: unknown;
+}) => void | Promise
+```
+
+### onToolExecutionEnd()
+
+Fired when tool execution completes, whether successfully or with an error. Use this to update your UI based on the
+results.
+
+```typescript
+onToolExecutionEnd?: (event: {
+ copilotkit: CopilotKitCore;
+ toolCallId: string;
+ agentId: string;
+ toolName: string;
+ result: string;
+ error?: string;
+}) => void | Promise
+```
+
+### onAgentsChanged()
+
+Notified when agents are added, removed, or updated. This includes both local changes and runtime discovery.
+
+```typescript
+onAgentsChanged?: (event: {
+ copilotkit: CopilotKitCore;
+ agents: Readonly>;
+}) => void | Promise
+```
+
+### onContextChanged()
+
+Fired when context items are added or removed. Use this to keep UI elements in sync with available context.
+
+```typescript
+onContextChanged?: (event: {
+ copilotkit: CopilotKitCore;
+ context: Readonly>;
+}) => void | Promise
+```
+
+### onPropertiesChanged()
+
+Notified when application properties are updated. Useful for debugging or showing current configuration.
+
+```typescript
+onPropertiesChanged?: (event: {
+ copilotkit: CopilotKitCore;
+ properties: Readonly>;
+}) => void | Promise
+```
+
+### onHeadersChanged()
+
+Fired when HTTP headers are modified. Important for tracking authentication state changes.
+
+```typescript
+onHeadersChanged?: (event: {
+ copilotkit: CopilotKitCore;
+ headers: Readonly>;
+}) => void | Promise
+```
+
+### onError()
+
+The central error handler for all CopilotKitCore operations. Every error includes a code and contextual information to
+help with debugging.
+
+```typescript
+onError?: (event: {
+ copilotkit: CopilotKitCore;
+ error: Error;
+ code: CopilotKitCoreErrorCode;
+ context: Record;
+}) => void | Promise
+```
+
+## Error Handling
+
+CopilotKitCore provides detailed error information through typed error codes, making it easier to handle different
+failure scenarios appropriately:
+
+### Understanding Error Codes
+
+Each error is categorized with a specific code that indicates what went wrong:
+
+- `RUNTIME_INFO_FETCH_FAILED`: The attempt to fetch runtime information failed. This might indicate network issues or an
+ incorrect runtime URL.
+
+- `AGENT_CONNECT_FAILED`: Failed to establish a connection with an agent. Check that the agent is properly configured.
+
+- `AGENT_RUN_FAILED`: The agent execution failed. This could be due to invalid messages or agent-side errors.
+
+- `AGENT_RUN_FAILED_EVENT`: The agent reported a failure through its event stream.
+
+- `AGENT_RUN_ERROR_EVENT`: The agent emitted an error event during execution.
+
+- `TOOL_ARGUMENT_PARSE_FAILED`: The arguments provided to a tool couldn't be parsed. This usually indicates a mismatch
+ between expected and actual parameters.
+
+- `TOOL_HANDLER_FAILED`: A tool's handler function threw an error during execution.
+
+## Running Agents
+
+CopilotKitCore provides two primary methods for executing agents: `runAgent` for immediate execution with message
+handling, and `connectAgent` for establishing live connections to existing agent sessions.
+
+### runAgent()
+
+Executes an agent and intelligently handles the complete request-response cycle, including automatic tool execution and
+follow-up runs.
+
+The execution flow:
+
+1. Sends initial messages (if provided) to the agent
+2. Agent processes the request and may request tool calls
+3. CopilotKitCore automatically executes any requested frontend tools
+4. Tool results are added back to the message history
+5. If tools were executed and have `followUp` enabled (default), the agent is automatically re-run with the tool results
+6. This cycle continues until the agent completes without requesting more tools
+
+Key behaviors:
+
+- **Automatic Tool Execution**: When an agent requests a tool call, CopilotKitCore finds the matching tool, executes it,
+ and adds the result to the conversation
+- **Smart Follow-ups**: After executing tools, it automatically re-runs the agent so it can process the tool results and
+ continue its work
+- **Error Recovery**: Tool execution errors are captured and returned to the agent, allowing it to handle failures
+ gracefully
+- **Wildcard Tools**: Supports a special "\*" tool that can handle any undefined tool request
+
+```typescript
+runAgent(params: CopilotKitCoreRunAgentParams): Promise
+```
+
+#### Parameters
+
+```typescript
+interface CopilotKitCoreRunAgentParams {
+ agent: AbstractAgent; // The agent to execute
+}
+```
+
+### connectAgent()
+
+Establishes a live connection with an agent, restoring any existing conversation history and subscribing to real-time
+events. This method is particularly useful when:
+
+- Reconnecting to an agent that's already running (displays new events as they occur)
+- Restoring conversation history after a page refresh
+- Setting up an agent that will receive updates from background processes
+
+The connection process:
+
+1. Provides the agent with current properties and available tools
+2. Sets up error event subscribers for proper error handling
+3. Restores any existing message history
+4. Returns immediately without triggering a new agent run
+
+```typescript
+connectAgent(params: CopilotKitCoreConnectAgentParams): Promise
+```
+
+#### Parameters
+
+```typescript
+interface CopilotKitCoreConnectAgentParams {
+ agent: AbstractAgent; // The agent to connect
+ agentId?: string; // Override the agent's default identifier
+}
+```
+
+### getAgent()
+
+Retrieves an agent by its identifier. Returns `undefined` if the agent doesn't exist or if the runtime is still
+connecting.
+
+```typescript
+getAgent(id: string): AbstractAgent | undefined
+```
+
+## Managing Context
+
+Context provides agents with additional information about the current state of your application:
+
+### addContext()
+
+Adds contextual information that agents can reference. Returns a unique identifier for later removal.
+
+```typescript
+addContext(context: Context): string
+```
+
+#### Parameters
+
+```typescript
+interface Context {
+ description: string; // A human-readable description of what this context represents
+ value: any; // The actual context data
+}
+```
+
+### removeContext()
+
+Removes previously added context using its identifier.
+
+```typescript
+removeContext(id: string): void
+```
+
+## Managing Tools
+
+Tools are functions that agents can call to interact with your application:
+
+### addTool()
+
+Registers a new frontend tool. If a tool with the same name and agent scope already exists, the registration is skipped
+to prevent duplicates.
+
+```typescript
+addTool(tool: FrontendTool): void
+```
+
+### removeTool()
+
+Removes a tool from the registry. You can remove tools globally or for specific agents:
+
+- When `agentId` is provided, removes the tool only for that agent
+- When `agentId` is omitted, removes only global tools with the matching name
+
+```typescript
+removeTool(id: string, agentId?: string): void
+```
+
+### getTool()
+
+Retrieves a tool by name, with intelligent fallback behavior:
+
+- If an agent-specific tool isn't found, it falls back to global tools
+
+```typescript
+getTool(params: CopilotKitCoreGetToolParams): FrontendTool | undefined
+```
+
+#### Parameters
+
+```typescript
+interface CopilotKitCoreGetToolParams {
+ toolName: string; // The tool's name
+ agentId?: string; // Look for agent-specific tools first
+}
+```
+
+### setTools()
+
+Replaces all tools at once. Useful for completely reconfiguring available tools.
+
+```typescript
+setTools(tools: FrontendTool[]): void
+```
+
+## Tool Execution Lifecycle
+
+Understanding how CopilotKitCore handles tool execution is crucial for building responsive AI applications. Here's the
+complete lifecycle:
+
+### 1. Tool Request
+
+When an agent needs to interact with your application, it returns a tool call request with:
+
+- Tool name
+- Structured arguments (JSON)
+- Unique call ID for tracking
+
+### 2. Tool Resolution
+
+CopilotKitCore uses a two-tier resolution strategy:
+
+- First checks for agent-specific tools (scoped to that particular agent)
+- Falls back to global tools available to all agents
+- Special wildcard tool (`*`) can handle any unmatched tool requests
+
+### 3. Execution & Error Handling
+
+The tool handler is invoked with parsed arguments:
+
+- Successful results are stringified and added to the conversation
+- Errors are caught and returned to the agent for graceful handling
+- Subscribers are notified of start and completion events
+
+### 4. Automatic Follow-up
+
+By default, after tool execution completes:
+
+- The tool result is inserted into the message history
+- The agent is automatically re-run to process the results
+- This continues until no more tools are requested
+- You can disable follow-up by setting `followUp: false` on specific tools
+
+## Working with Configuration
+
+These methods allow you to dynamically update CopilotKitCore's configuration after initialization:
+
+### setRuntimeUrl()
+
+Changes the runtime endpoint and manages the connection lifecycle. This is useful when switching between different
+environments or disconnecting from the runtime entirely.
+
+```typescript
+setRuntimeUrl(runtimeUrl: string | undefined): void
+```
+
+### setHeaders()
+
+Replaces all HTTP headers. Subscribers are notified so they can react to authentication changes or other header updates.
+
+```typescript
+setHeaders(headers: Record): void
+```
+
+### setProperties()
+
+Updates the properties forwarded to agents. Use this when your application state changes in ways that might affect agent
+behavior.
+
+```typescript
+setProperties(properties: Record): void
+```
+
+## Managing Local Agents
+
+
+ In production applications, agents must be managed through the CopilotRuntime, which provides proper isolation,
+ monitoring, and scalability. The local agent methods below are marked `__unsafe_dev_only` as they're intended solely
+ for rapid prototyping during development. Production deployments require the security and performance guarantees that
+ only the CopilotRuntime can provide.
+
+
+Agents are the AI-powered components that process requests and generate responses. CopilotKitCore provides several
+methods to manage them locally during development:
+
+### setAgents\_\_unsafe_dev_only()
+
+Replaces all local development agents while preserving remote agents from the runtime.
+
+```typescript
+setAgents__unsafe_dev_only(agents: Record): void
+```
+
+### addAgent\_\_unsafe_dev_only()
+
+Adds a single agent for development testing.
+
+```typescript
+addAgent__unsafe_dev_only(params: CopilotKitCoreAddAgentParams): void
+```
+
+#### Parameters
+
+```typescript
+interface CopilotKitCoreAddAgentParams {
+ id: string; // A unique identifier for the agent
+ agent: AbstractAgent; // The agent instance to add
+}
+```
+
+### removeAgent\_\_unsafe_dev_only()
+
+Removes a local development agent by its identifier. Remote agents from the runtime cannot be removed this way.
+
+```typescript
+removeAgent__unsafe_dev_only(id: string): void
+```
diff --git a/src/v2.x/apps/docs/reference/copilotkit-provider.mdx b/src/v2.x/apps/docs/reference/copilotkit-provider.mdx
new file mode 100644
index 0000000000..61d2ce2637
--- /dev/null
+++ b/src/v2.x/apps/docs/reference/copilotkit-provider.mdx
@@ -0,0 +1,261 @@
+---
+title: CopilotKitProvider
+description: "CopilotKitProvider API Reference"
+---
+
+`CopilotKitProvider` is the React context provider that initializes and manages `CopilotKitCore` for your React
+application. It provides all child components with access to agents, tools, and copilot functionality through React's
+context API.
+
+## What is CopilotKitProvider?
+
+The CopilotKitProvider is the root component that:
+
+- Creates and manages a `CopilotKitCore` instance
+- Provides React-specific features like hooks and render components
+- Manages tool rendering and human-in-the-loop interactions
+- Handles state synchronization between your React app and AI agents
+
+## Basic Usage
+
+Typically you would wrap your application with `CopilotKitProvider` at the root level:
+
+```tsx
+import { CopilotKitProvider } from "@copilotkitnext/react";
+
+function App() {
+ return (
+
+ {/* Your app components */}
+
+ );
+}
+```
+
+## Props
+
+### runtimeUrl
+
+`string` **(optional)**
+
+The URL of your CopilotRuntime server. The provider will automatically connect to the runtime and discover available
+agents.
+
+```tsx
+{children}
+```
+
+### headers
+
+`Record` **(optional)**
+
+Custom HTTP headers to include with every request to the runtime. Useful for authentication and custom metadata.
+
+```tsx
+
+ {children}
+
+```
+
+### properties
+
+`Record` **(optional)**
+
+Application-specific data that gets forwarded to agents as additional context. Agents receive these as `forwardedProps`.
+
+```tsx
+
+ {children}
+
+```
+
+### agents\_\_unsafe_dev_only
+
+`Record` **(optional, development only)**
+
+
+ This property is intended solely for rapid prototyping during development. Production deployments require the
+ security, reliability, and performance guarantees that only the CopilotRuntime can provide.
+
+
+Local agents for development testing. The key becomes the agent's identifier.
+
+```tsx
+import { HttpAgent } from "@ag-ui/client";
+
+const devAgent = new HttpAgent({
+ url: "http://localhost:8000",
+});
+
+
+ {children}
+;
+```
+
+### useSingleEndpoint
+
+`boolean` **(optional, default: `false`)**
+
+When set to `true`, the provider connects to runtimes that expose the **single-route** transport (a single POST endpoint that multiplexes all runtime actions). Leave this `false` for the default REST-style transport.
+
+Pair this flag with the matching server endpoint helper:
+
+```tsx
+
+ {children}
+
+```
+
+On the server, mount one of the single-route runtimes (`createCopilotEndpointSingleRoute` for Hono or `createCopilotEndpointSingleRouteExpress` for Express).
+
+### renderToolCalls
+
+`ReactToolCallRenderer[]` **(optional)**
+
+A static list of components to render when specific tools are called. Enables visual feedback for tool execution.
+
+```tsx
+const renderToolCalls = [
+ {
+ name: "searchProducts",
+ args: z.object({
+ query: z.string(),
+ }),
+ render: ({ args }) =>
Searching for: {args.query}
,
+ },
+];
+
+{children};
+```
+
+
+ The `renderToolCalls` array must be stable across renders. Define it outside your component or use `useMemo`. For
+ dynamic tool rendering, use the `useRenderToolCall` hook instead.
+
+
+### frontendTools
+
+`ReactFrontendTool[]` **(optional)**
+
+A static list of frontend tools that agents can invoke. These are React-specific wrappers around the base `FrontendTool`
+type with additional rendering capabilities.
+
+```tsx
+const tools = [
+ {
+ name: "showNotification",
+ description: "Display a notification to the user",
+ parameters: z.object({
+ message: z.string(),
+ type: z.enum(["info", "success", "warning", "error"]),
+ }),
+ handler: async ({ message, type }) => {
+ toast[type](message);
+ return "Notification displayed";
+ },
+ },
+];
+
+{children};
+```
+
+
+ The `frontendTools` array must be stable across renders. For dynamically adding/removing tools, use the
+ `useFrontendTool` hook.
+
+
+### humanInTheLoop
+
+`ReactHumanInTheLoop[]` **(optional)**
+
+Tools that require human interaction or approval before execution. These tools pause agent execution until the user
+responds.
+
+```tsx
+const humanInTheLoop = [
+ {
+ name: "confirmAction",
+ description: "Request user confirmation for an action",
+ parameters: z.object({
+ action: z.string(),
+ details: z.string(),
+ }),
+ render: ({ args, resolve }) => (
+ resolve({ confirmed: true })}
+ onCancel={() => resolve({ confirmed: false })}
+ />
+ ),
+ },
+];
+
+{children};
+```
+
+### children
+
+`ReactNode` **(required)**
+
+The React components that will have access to the CopilotKit context.
+
+## Context Value
+
+The provider makes a `CopilotKitContextValue` available to child components through React context:
+
+```typescript
+interface CopilotKitContextValue {
+ copilotkit: CopilotKitCore;
+ renderToolCalls: ReactToolCallRenderer[];
+ currentRenderToolCalls: ReactToolCallRenderer[];
+ setCurrentRenderToolCalls: React.Dispatch[]>>;
+}
+```
+
+Access this context using the `useCopilotKit` hook:
+
+```tsx
+import { useCopilotKit } from "@copilotkitnext/react";
+
+function MyComponent() {
+ const { copilotkit } = useCopilotKit();
+
+ // Access CopilotKitCore instance
+ const agent = copilotkit.getAgent("assistant");
+}
+```
+
+## Considerations
+
+### Server-Side Rendering (SSR)
+
+The provider is compatible with SSR but won't fetch runtime information during server-side rendering. The runtime
+connection is established only on the client side to prevent blocking SSR.
+
+### Dynamic Updates
+
+You can dynamically update the following props:
+
+- `runtimeUrl`: Changing this will disconnect from the current runtime and connect to the new one
+- `headers`: Updates are applied to all future requests
+- `properties`: Changes are immediately available to agents
diff --git a/src/v2.x/apps/docs/reference/frontend-tool.mdx b/src/v2.x/apps/docs/reference/frontend-tool.mdx
new file mode 100644
index 0000000000..4dd32964bd
--- /dev/null
+++ b/src/v2.x/apps/docs/reference/frontend-tool.mdx
@@ -0,0 +1,150 @@
+---
+title: FrontendTool
+description: "FrontendTool API Reference"
+---
+
+`FrontendTool` is a cross-platform type that defines tools (functions) that AI agents can invoke in your frontend
+application. These tools enable agents to interact the user, retrieve data, perform actions, and integrate with your
+application's functionality.
+
+## What is a FrontendTool?
+
+A FrontendTool represents a capability you expose to AI agents, allowing them to:
+
+- Interact with the user
+- Fetch or manipulate application data
+- Trigger application workflows
+
+Frontend tools are framework-agnostic and work consistently across all frameworks through `CopilotKitCore`.
+
+## Type Definition
+
+```typescript
+type FrontendTool = Record> = {
+ name: string;
+ description?: string;
+ parameters?: z.ZodType;
+ handler?: (args: T, toolCall: ToolCall) => Promise;
+ followUp?: boolean;
+ agentId?: string;
+};
+```
+
+## Properties
+
+### name
+
+`string` **(required)**
+
+A unique identifier for the tool. This is the name agents will use to request this tool's execution. Avoid spaces and
+special characters.
+
+```typescript
+{
+ name: "searchProducts";
+}
+```
+
+A special wildcard tool is available with the name `*`. This tool will handle any unmatched tool requests.
+
+### description
+
+`string` **(optional)**
+
+A human-readable description that helps agents understand when and how to use this tool. This description is sent to the
+LLM to guide its decision-making.
+
+```typescript
+{
+ name: "searchProducts",
+ description: "Search for products in the catalog by name, category, or price range"
+}
+```
+
+### parameters
+
+`z.ZodType` **(optional)**
+
+A Zod schema that defines and validates the tool's input parameters. This ensures type safety and provides automatic
+validation of agent-provided arguments.
+
+```typescript
+import { z } from "zod";
+
+{
+ name: "updateUserProfile",
+ parameters: z.object({
+ firstName: z.string().optional(),
+ lastName: z.string().optional(),
+ email: z.string().email().optional(),
+ preferences: z.object({
+ theme: z.enum(["light", "dark"]).optional(),
+ notifications: z.boolean().optional()
+ }).optional()
+ })
+}
+```
+
+### handler
+
+`(args: T, toolCall: ToolCall) => Promise` **(optional)**
+
+The async function that executes when the agent invokes this tool. It receives the validated arguments and a ToolCall
+object containing metadata about the invocation.
+
+```typescript
+{
+ name: "addToCart",
+ parameters: z.object({
+ productId: z.string(),
+ quantity: z.number().min(1)
+ }),
+ handler: async ({productId, quantity}) => {
+ // Add product to cart
+ const result = await cartService.addItem(productId, quantity);
+
+ // Return a string or serializable object
+ return {
+ success: true,
+ cartTotal: result.total,
+ itemCount: result.itemCount
+ };
+ }
+}
+```
+
+### followUp
+
+`boolean` **(optional, default: true)**
+
+Controls whether the agent should be automatically re-run after this tool completes. When `true`, the tool's result is
+added to the conversation and the agent continues processing. Disable follow-up for final actions that complete a
+workflow.
+
+```typescript
+{
+ name: "saveDocument",
+ handler: async (args) => {
+ await documentService.save(args);
+ return "Document saved successfully";
+ },
+ followUp: false // Don't re-run agent after saving
+}
+```
+
+### agentId
+
+`string` **(optional)**
+
+Restricts this tool to a specific agent. When set, only the specified agent can invoke this tool.
+
+```typescript
+{
+ name: "adminAction",
+ agentId: "admin-assistant",
+ handler: async (args) => {
+ // Only the admin-assistant agent can call this
+ return await performAdminAction(args);
+ }
+}
+```
diff --git a/src/v2.x/apps/docs/reference/proxied-copilot-runtime-agent.mdx b/src/v2.x/apps/docs/reference/proxied-copilot-runtime-agent.mdx
new file mode 100644
index 0000000000..475f22f1af
--- /dev/null
+++ b/src/v2.x/apps/docs/reference/proxied-copilot-runtime-agent.mdx
@@ -0,0 +1,80 @@
+---
+title: ProxiedCopilotRuntimeAgent
+description: "ProxiedCopilotRuntimeAgent API Reference"
+---
+
+`ProxiedCopilotRuntimeAgent` is a specialized HTTP agent that acts as a proxy between your client application and remote
+agents hosted on the `CopilotRuntime` server. It extends the base `HttpAgent` class to provide seamless communication
+with runtime-hosted agents.
+
+## Architecture Overview
+
+```mermaid
+graph LR
+ subgraph Client["Client Application"]
+ Core[CopilotKitCore]
+ PRA1[ProxiedCopilotRuntimeAgent customer-support]
+ PRA2[ProxiedCopilotRuntimeAgent code-assistant]
+ PRA3[ProxiedCopilotRuntimeAgent data-analyst]
+
+ Core --> PRA1
+ Core --> PRA2
+ Core --> PRA3
+ end
+
+ subgraph Server["CopilotRuntime Server"]
+ Runtime[Runtime API]
+ Agent1[Agent: customer-support]
+ Agent2[Agent: code-assistant]
+ Agent3[Agent: data-analyst]
+
+ Runtime --> Agent1
+ Runtime --> Agent2
+ Runtime --> Agent3
+ end
+
+ PRA1 -.-> Runtime
+ PRA2 -.-> Runtime
+ PRA3 -.-> Runtime
+```
+
+## What is ProxiedCopilotRuntimeAgent?
+
+When `CopilotKitCore` connects to a `CopilotRuntime` server, it discovers available remote agents. For each remote
+agent, it creates a `ProxiedCopilotRuntimeAgent` instance that handles all communication with that specific agent
+through the runtime's API endpoints.
+
+Key characteristics:
+
+- **Remote Agent Communication**: Handles communication with the remote agent through the runtime's API endpoints
+- **Header and Property Forwarding**: Inherits and forwards authentication headers and properties from `CopilotKitCore`
+- **Connection and History Management**: Handles loading history and reconnecting to existing live agent sessions
+
+## How does it work?
+
+`CopilotKitCore` automatically creates `ProxiedCopilotRuntimeAgent` instances during runtime discovery:
+
+1. `CopilotKitCore` fetches `/info` from the runtime
+2. The runtime responds with available agents
+3. For each agent, `CopilotKitCore` creates a `ProxiedCopilotRuntimeAgent`
+4. These agents are merged with any local agents
+5. The agents become available through `copilotKit.getAgent()`
+
+## Creating a ProxiedCopilotRuntimeAgent
+
+
+ In typical usage, you don't create `ProxiedCopilotRuntimeAgent` instances directly. `CopilotKitCore` automatically
+ creates them when discovering agents from the runtime.
+
+
+```typescript
+import { ProxiedCopilotRuntimeAgent } from "@copilotkitnext/core";
+
+const agent = new ProxiedCopilotRuntimeAgent({
+ runtimeUrl: "https://your-runtime.example.com",
+ agentId: "my-agent",
+ headers: {
+ Authorization: "Bearer your-token",
+ },
+});
+```
diff --git a/src/v2.x/apps/docs/reference/use-agent-context.mdx b/src/v2.x/apps/docs/reference/use-agent-context.mdx
new file mode 100644
index 0000000000..e98a308733
--- /dev/null
+++ b/src/v2.x/apps/docs/reference/use-agent-context.mdx
@@ -0,0 +1,384 @@
+---
+title: useAgentContext
+description: "useAgentContext Hook API Reference"
+---
+
+`useAgentContext` is a React hook that provides contextual information to AI agents during their execution. It allows
+you to dynamically add relevant data that agents can use to make more informed decisions and provide better responses.
+
+## What is useAgentContext?
+
+The useAgentContext hook:
+
+- Provides contextual information to agents
+- Automatically manages context lifecycle (add on mount, remove on unmount)
+- Updates context when values change
+- Helps agents understand application state and user data
+
+## Basic Usage
+
+```tsx
+import { useAgentContext } from "@copilotkitnext/react";
+
+function UserPreferences() {
+ const userSettings = {
+ theme: "dark",
+ language: "en",
+ timezone: "UTC-5",
+ };
+
+ useAgentContext({
+ description: "User preferences and settings",
+ value: userSettings,
+ });
+
+ return
User preferences loaded
;
+}
+```
+
+## Parameters
+
+The hook accepts a single `Context` object with the following properties:
+
+### description
+
+`string` **(required)**
+
+A clear description of what this context represents. This helps agents understand how to use the provided information.
+
+```tsx
+useAgentContext({
+ description: "Current shopping cart contents",
+ value: cartItems,
+});
+```
+
+### value
+
+`any` **(required)**
+
+The actual data to provide as context. Can be any serializable value including objects, arrays, strings, or numbers.
+
+```tsx
+useAgentContext({
+ description: "Current form validation state",
+ value: {
+ hasErrors: false,
+ touchedFields: ["email", "name"],
+ dirtyFields: ["email"],
+ isSubmitting: false,
+ },
+});
+```
+
+## Examples
+
+### User Preferences Context
+
+```tsx
+import { useAgentContext } from "@copilotkitnext/react";
+import { useUserPreferences } from "./hooks/useUserPreferences";
+
+function UserPreferencesContext() {
+ const { preferences, isLoading } = useUserPreferences();
+
+ useAgentContext({
+ description: "User display preferences and settings",
+ value: {
+ theme: preferences?.theme || "light",
+ language: preferences?.language || "en",
+ timezone: preferences?.timezone || "UTC",
+ displayDensity: preferences?.displayDensity || "comfortable",
+ isLoading,
+ },
+ });
+
+ return null; // Context-only component
+}
+```
+
+### Form State Context
+
+```tsx
+import { useAgentContext } from "@copilotkitnext/react";
+import { useState } from "react";
+
+function ContactForm() {
+ const [formData, setFormData] = useState({
+ name: "",
+ email: "",
+ subject: "",
+ message: "",
+ });
+
+ // Provide form state to agent for assistance
+ useAgentContext({
+ description: "Contact form current state",
+ value: {
+ formData,
+ hasUnsavedChanges: Object.values(formData).some((v) => v !== ""),
+ isValid: formData.email.includes("@") && formData.name.length > 0,
+ },
+ });
+
+ return (
+
+ );
+}
+```
+
+### Application State Context
+
+```tsx
+import { useAgentContext } from "@copilotkitnext/react";
+import { useLocation } from "react-router-dom";
+
+function AppStateContext() {
+ const location = useLocation();
+ const currentTime = new Date().toISOString();
+
+ useAgentContext({
+ description: "Current application state and navigation",
+ value: {
+ currentPath: location.pathname,
+ queryParams: Object.fromEntries(new URLSearchParams(location.search)),
+ timestamp: currentTime,
+ },
+ });
+
+ return null;
+}
+```
+
+### Dynamic Data Context
+
+```tsx
+import { useAgentContext } from "@copilotkitnext/react";
+import { useEffect, useState } from "react";
+
+function DynamicDataContext() {
+ const [data, setData] = useState(null);
+
+ useEffect(() => {
+ const fetchData = async () => {
+ const response = await fetch("/api/context-data");
+ setData(await response.json());
+ };
+ fetchData();
+ }, []);
+
+ // Context updates automatically when data changes
+ useAgentContext({
+ description: "Dynamic application data",
+ value: data || { loading: true },
+ });
+
+ return null;
+}
+```
+
+### Multiple Contexts
+
+```tsx
+import { useAgentContext } from "@copilotkitnext/react";
+
+function MultipleContexts() {
+ const userContext = { id: "123", name: "John" };
+ const appContext = { version: "1.0.0", features: ["chat", "search"] };
+
+ // Use multiple hooks for different contexts
+ useAgentContext({
+ description: "User information",
+ value: userContext,
+ });
+
+ useAgentContext({
+ description: "Application configuration",
+ value: appContext,
+ });
+
+ return
+ );
+}
+```
diff --git a/src/v2.x/apps/docs/reference/use-agent.mdx b/src/v2.x/apps/docs/reference/use-agent.mdx
new file mode 100644
index 0000000000..4b1f62245b
--- /dev/null
+++ b/src/v2.x/apps/docs/reference/use-agent.mdx
@@ -0,0 +1,486 @@
+---
+title: useAgent
+description: "useAgent Hook API Reference"
+---
+
+`useAgent` is a React hook that provides access to [AG-UI](https://ag-ui.com) agents and subscribes to their state
+changes. It enables components to interact with agents, access their messages, and respond to updates in real-time.
+The hook always returns an agent instance. While the runtime is syncing, it returns a provisional runtime agent; once
+the runtime has synced, if the agent id does not exist the hook throws an error.
+
+## What is useAgent?
+
+The useAgent hook:
+
+- Retrieves an agent by ID from the CopilotKit context
+- Subscribes to agent state changes (messages, state, run status)
+- Automatically triggers component re-renders when the agent updates
+- Handles cleanup of subscriptions when the component unmounts
+
+## Basic Usage
+
+```tsx
+import { useAgent } from "@copilotkitnext/react";
+
+function ChatComponent() {
+ const { agent } = useAgent({ agentId: "assistant" });
+
+ return (
+
+
Agent: {agent.id}
+
Messages: {agent.messages.length}
+
Running: {agent.isRunning ? "Yes" : "No"}
+
+ );
+}
+```
+
+## Parameters
+
+### agentId
+
+`string` **(optional)**
+
+The ID of the agent to retrieve. If not provided, defaults to `"default"`.
+
+```tsx
+const { agent } = useAgent({ agentId: "customer-support" });
+```
+
+### updates
+
+`UseAgentUpdate[]` **(optional)**
+
+An array of update types to subscribe to. This allows you to optimize re-renders by only subscribing to specific
+changes.
+
+```tsx
+import { useAgent, UseAgentUpdate } from "@copilotkitnext/react";
+
+const { agent } = useAgent({
+ agentId: "assistant",
+ updates: [UseAgentUpdate.OnMessagesChanged],
+});
+```
+
+Available update types:
+
+- `UseAgentUpdate.OnMessagesChanged` - Updates when messages are added or modified
+- `UseAgentUpdate.OnStateChanged` - Updates when agent state changes
+- `UseAgentUpdate.OnRunStatusChanged` - Updates when agent starts or stops running
+
+If `updates` is not provided, the hook subscribes to all update types by default.
+
+## Return Value
+
+The hook returns an object with a single property:
+
+### agent
+
+`AbstractAgent`
+
+The agent instance. During runtime synchronization, the hook returns a provisional runtime agent so you can bind UI
+immediately. After the runtime has synced (Connected or Error), if the agent id does not exist the hook throws an
+error.
+
+## Accessing Agent Messages
+
+The agent's message history is available through the `messages` property. You can read messages and add new ones to
+create interactive conversations.
+
+### Reading Messages
+
+```tsx
+function SimpleChat() {
+ const { agent } = useAgent();
+
+ return (
+
+ {agent.messages.map((message) => (
+
+ {message.role}: {message.content}
+
+ ))}
+
+ );
+}
+```
+
+### Sending Messages
+
+To send a message, add it to the agent and then run the agent:
+
+```tsx
+import { useAgent } from "@copilotkitnext/react";
+import { useCopilotKit } from "@copilotkitnext/react";
+
+function MessageSender() {
+ const { agent } = useAgent({ agentId: "assistant" });
+ const { copilotkit } = useCopilotKit();
+
+ const sendMessage = async (content: string) => {
+
+ // Add message to agent
+ agent.addMessage({
+ id: crypto.randomUUID(),
+ role: "user",
+ content,
+ });
+
+ // Run the agent to get a response
+ await copilotkit.runAgent({
+ agent,
+ agentId: "assistant",
+ });
+ };
+
+ return (
+
+
+
+ );
+}
+```
+
+## Accessing and Updating Shared State
+
+Shared state enables real-time collaboration between users and agents. Both can read and modify the state, creating a
+synchronized workspace for interactive features.
+
+### Understanding Shared State
+
+The agent's state is a shared data structure that:
+
+- Can be read by both your application and the agent
+- Can be modified by both parties
+- Automatically triggers re-renders when changed
+- Persists throughout the conversation
+
+State updates cause re-renders when:
+
+- You call `agent.setState()` from your application
+- The agent modifies the state during execution
+- Any state change occurs, regardless of source
+
+### Reading State
+
+```tsx
+function StateDisplay() {
+ const { agent } = useAgent({
+ updates: [UseAgentUpdate.OnStateChanged], // Subscribe to state changes
+ });
+
+ return (
+
+
Current State
+
{JSON.stringify(agent.state, null, 2)}
+
+ );
+}
+```
+
+### Updating State
+
+```tsx
+function StateController() {
+ const { agent } = useAgent({
+ updates: [UseAgentUpdate.OnStateChanged],
+ });
+
+ const updateState = (key: string, value: any) => {
+ // Update the shared state
+ agent.setState({
+ ...agent.state,
+ [key]: value,
+ });
+
+ // This will trigger re-renders for all components
+ // subscribed to OnStateChanged
+ };
+
+ return (
+
+
+
+ );
+}
+```
+
+### Collaborative Features
+
+Shared state enables collaborative features where users and agents work together:
+
+```tsx
+function CollaborativeTodo() {
+ const { agent } = useAgent({
+ updates: [UseAgentUpdate.OnStateChanged],
+ });
+ const { copilotkit } = useCopilotKit();
+
+ const todos = agent.state.todos || [];
+
+ const addTodo = (text: string) => {
+ agent.setState({
+ ...agent.state,
+ todos: [...todos, { id: crypto.randomUUID(), text, done: false }],
+ });
+ };
+
+ const toggleTodo = (id: string) => {
+ agent.setState({
+ ...agent.state,
+ todos: todos.map((todo) => (todo.id === id ? { ...todo, done: !todo.done } : todo)),
+ });
+ };
+
+ const askAgentToOrganize = async () => {
+ // Add a message asking the agent to organize todos
+ agent.addMessage({
+ id: crypto.randomUUID(),
+ role: "user",
+ content: "Please organize my todos by priority",
+ });
+
+ // The agent can read and modify the todos in agent.state
+ await copilotkit.runAgent({ agent });
+
+ // After the agent runs, the state will be updated
+ // and the component will re-render automatically
+ };
+
+ return (
+
+ );
+}
+```
+
+## Performance Considerations
+
+### Selective Updates
+
+By default, `useAgent` subscribes to all update types, which can cause frequent re-renders. Use the `updates` parameter
+to subscribe only to the changes you need:
+
+```tsx
+// ❌ Subscribes to all updates (may cause unnecessary re-renders)
+const { agent } = useAgent({ agentId: "assistant" });
+
+// ✅ Only subscribes to message changes
+const { agent } = useAgent({
+ agentId: "assistant",
+ updates: [UseAgentUpdate.OnMessagesChanged],
+});
+
+// ✅ Only subscribes to run status changes
+const { agent } = useAgent({
+ agentId: "assistant",
+ updates: [UseAgentUpdate.OnRunStatusChanged],
+});
+```
+
+### Component Splitting
+
+Split components by update type to optimize rendering:
+
+```tsx
+// Message display component - only updates on message changes
+function Messages() {
+ const { agent } = useAgent({
+ updates: [UseAgentUpdate.OnMessagesChanged],
+ });
+
+ // Render messages...
+}
+
+// Status indicator - only updates on run status changes
+function StatusIndicator() {
+ const { agent } = useAgent({
+ updates: [UseAgentUpdate.OnRunStatusChanged],
+ });
+
+ // Render status...
+}
+
+// Parent component doesn't need to subscribe
+function ChatView() {
+ return (
+ <>
+
+
+ >
+ );
+}
+```
+
+## Error Handling
+
+After the runtime has synced (Connected or Error), `useAgent` throws if the requested agent id does not exist. During
+runtime syncing, a provisional agent is returned. To avoid runtime errors:
+
+- Ensure the agent id you request is registered (via `agents__unsafe_dev_only` or exposed by your runtime).
+- Optionally wrap the component that calls `useAgent` in an error boundary to render a fallback UI if the agent is
+ missing due to misconfiguration in development.
+
+Example configuration with a local agent for development:
+
+```tsx
+
+
+
+```
diff --git a/src/v2.x/apps/docs/reference/use-copilotkit.mdx b/src/v2.x/apps/docs/reference/use-copilotkit.mdx
new file mode 100644
index 0000000000..876c865568
--- /dev/null
+++ b/src/v2.x/apps/docs/reference/use-copilotkit.mdx
@@ -0,0 +1,144 @@
+---
+title: useCopilotKit
+description: "useCopilotKit Hook API Reference"
+---
+
+`useCopilotKit` is a React hook that provides access to the CopilotKit context, including the core instance, tool
+rendering capabilities, and runtime connection status. It's the primary way to interact with CopilotKit's core
+functionality from React components.
+
+## What is useCopilotKit?
+
+The useCopilotKit hook:
+
+- Provides access to the `CopilotKitCore` instance for agent and tool management
+- Exposes render tool calls for visual tool execution feedback
+- Subscribes to runtime connection status changes
+- Enables programmatic control over agents, tools, and context
+
+## Basic Usage
+
+```tsx
+import { useCopilotKit } from "@copilotkitnext/react";
+
+function MyComponent() {
+ const { copilotkit } = useCopilotKit();
+
+ // Access runtime status
+ console.log("Runtime status:", copilotkit.runtimeConnectionStatus);
+
+ // Get an agent
+ const agent = copilotkit.getAgent("assistant");
+
+ return
+
+ {showTool && } {/* Tool only available when mounted */}
+
+ );
+}
+```
+
+### Cleanup on Unmount
+
+Tools are automatically removed when components unmount, but their renderers persist to maintain chat history:
+
+```tsx
+function TemporaryTool() {
+ useFrontendTool({
+ name: "tempAction",
+ handler: async () => "Temporary action",
+ render: ({ status }) =>
Temp tool: {status}
,
+ });
+
+ // When this component unmounts:
+ // - The tool handler is removed (agent can't call it anymore)
+ // - The renderer persists (previous executions still visible in chat)
+
+ return null;
+}
+```
+
+### Tool Override Warning
+
+If a tool with the same name already exists, it will be overridden with a console warning:
+
+```tsx
+// First registration
+useFrontendTool({
+ name: "search",
+ handler: async () => "Search v1",
+});
+
+// Second registration (overrides first)
+useFrontendTool({
+ name: "search", // Same name - will override with warning
+ handler: async () => "Search v2",
+});
+```
diff --git a/src/v2.x/apps/docs/reference/use-human-in-the-loop.mdx b/src/v2.x/apps/docs/reference/use-human-in-the-loop.mdx
new file mode 100644
index 0000000000..a64f2379a2
--- /dev/null
+++ b/src/v2.x/apps/docs/reference/use-human-in-the-loop.mdx
@@ -0,0 +1,223 @@
+---
+title: useHumanInTheLoop
+description: "useHumanInTheLoop Hook API Reference"
+---
+
+`useHumanInTheLoop` is a React hook that creates interactive tools requiring human approval or input before the agent
+can proceed. It enables you to build approval workflows, confirmation dialogs, and interactive decision points where
+human oversight is needed.
+
+## What is useHumanInTheLoop?
+
+The useHumanInTheLoop hook:
+
+- Creates tools that pause execution until human input is received
+- Manages status transitions (InProgress → Executing → Complete)
+- Provides a `respond` callback for user interactions
+- Automatically handles promise resolution for agent continuation
+- Renders interactive UI components in the chat interface
+
+## Basic Usage
+
+```tsx
+import { useHumanInTheLoop } from "@copilotkitnext/react";
+import { ToolCallStatus } from "@copilotkitnext/core";
+import { z } from "zod";
+
+function ApprovalComponent() {
+ useHumanInTheLoop({
+ name: "requireApproval",
+ description: "Requires human approval before proceeding",
+ parameters: z.object({
+ action: z.string(),
+ reason: z.string(),
+ }),
+ render: ({ status, args, respond }) => {
+ if (status === ToolCallStatus.Executing && respond) {
+ return (
+
+
Approve action: {args.action}
+
Reason: {args.reason}
+
+
+
+ );
+ }
+ return
Status: {status}
;
+ },
+ });
+
+ return
Approval system active
;
+}
+```
+
+## Parameters
+
+The hook accepts:
+
+- A required `ReactHumanInTheLoop` object describing the tool
+- An optional `options` object for controlling dependency behavior
+
+### name
+
+`string` **(required)**
+
+A unique identifier for the human-in-the-loop tool.
+
+```tsx
+useHumanInTheLoop({
+ name: "confirmDeletion",
+ // ...
+});
+```
+
+### description
+
+`string` **(optional)**
+
+Describes the tool's purpose to help agents understand when human approval is needed.
+
+```tsx
+useHumanInTheLoop({
+ name: "sensitiveAction",
+ description: "Requires human confirmation for sensitive operations",
+ // ...
+});
+```
+
+### parameters
+
+`z.ZodType` **(optional)**
+
+A Zod schema defining the parameters the agent will provide when requesting human input.
+
+```tsx
+import { z } from "zod";
+
+useHumanInTheLoop({
+ name: "reviewChanges",
+ parameters: z.object({
+ changes: z.array(z.string()),
+ impact: z.enum(["low", "medium", "high"]),
+ estimatedTime: z.number(),
+ }),
+ // ...
+});
+```
+
+### render
+
+`React.ComponentType` **(required)**
+
+A React component that renders the interactive UI. It receives different props based on the current status:
+
+#### Status: InProgress
+
+Initial state when the tool is called but not yet executing:
+
+```tsx
+{
+ name: string;
+ description: string;
+ args: Partial; // Partial arguments as they're being streamed
+ status: ToolCallStatus.InProgress;
+ result: undefined;
+ respond: undefined;
+}
+```
+
+#### Status: Executing
+
+Active state where user interaction is required:
+
+```tsx
+{
+ name: string;
+ description: string;
+ args: T; // Complete arguments
+ status: ToolCallStatus.Executing;
+ result: undefined;
+ respond: (result: unknown) => Promise; // Callback to provide response
+}
+```
+
+#### Status: Complete
+
+Final state after user has responded:
+
+```tsx
+{
+ name: string;
+ description: string;
+ args: T; // Complete arguments
+ status: ToolCallStatus.Complete;
+ result: string; // The response provided via respond()
+ respond: undefined;
+}
+```
+
+### followUp
+
+`boolean` **(optional, default: true)**
+
+Controls whether the agent continues after receiving the human response. Provided for completeness, but typically you
+would want the agent to continue (default behavior).
+
+```tsx
+useHumanInTheLoop({
+ name: "finalConfirmation",
+ followUp: false, // Don't continue after confirmation
+ // ...
+});
+```
+
+### agentId
+
+`string` **(optional)**
+
+Restricts this tool to a specific agent.
+
+```tsx
+useHumanInTheLoop({
+ name: "adminApproval",
+ agentId: "admin-assistant",
+ // ...
+});
+```
+
+## Options
+
+### deps (second argument)
+
+`ReadonlyArray` **(optional)**
+
+Additional dependencies that should trigger re-registration of the human-in-the-loop tool. By default, the hook only
+depends on stable keys like the tool name and CopilotKit instance to avoid re-register loops from object identity
+changes. Pass a dependency array as the second argument when the tool configuration is derived from changing props or
+state:
+
+```tsx
+function VersionedApproval({ version }: { version: number }) {
+ useHumanInTheLoop(
+ {
+ name: "versionedApproval",
+ description: `Approve deployment v${version}`,
+ // ...
+ },
+ [version],
+ );
+
+ return null;
+}
+```
+
+## Differences from useFrontendTool
+
+While `useFrontendTool` executes immediately and returns results, `useHumanInTheLoop`:
+
+- Pauses execution until human input is received
+- Provides a `respond` callback during the Executing state
+- Manages status transitions automatically
+- Is designed specifically for approval workflows and interactive decisions
+
+Choose `useHumanInTheLoop` when you need human oversight, and `useFrontendTool` for automated tool execution.
diff --git a/src/v2.x/apps/docs/reference/use-render-tool-call.mdx b/src/v2.x/apps/docs/reference/use-render-tool-call.mdx
new file mode 100644
index 0000000000..995930b59e
--- /dev/null
+++ b/src/v2.x/apps/docs/reference/use-render-tool-call.mdx
@@ -0,0 +1,262 @@
+---
+title: useRenderToolCall
+description: "useRenderToolCall Hook API Reference"
+---
+
+
+ You would use this hook if you use the headless functionality of CopilotKit, rendering your own chat UI instead of the
+ default `CopilotChat`. If you are using `CopilotChat`, you don't need to use this hook.
+
+
+`useRenderToolCall` is a React hook that provides a function to render visual representations of tool calls in the chat
+interface. It manages the rendering of tool execution states (InProgress, Executing, Complete) based on configured
+render functions.
+
+## What is useRenderToolCall?
+
+The useRenderToolCall hook:
+
+- Returns a render function for tool calls
+- Automatically determines the appropriate status (InProgress, Executing, or Complete)
+- Manages tool execution state transitions
+- Supports agent-specific and wildcard renderers
+- Integrates with CopilotKit's tool rendering system
+
+## Basic Usage
+
+```tsx
+import { useRenderToolCall } from "@copilotkitnext/react";
+import { ToolCall } from "@ag-ui/core";
+
+function ToolCallDisplay({ toolCall, toolMessage }) {
+ const renderToolCall = useRenderToolCall();
+
+ return
{renderToolCall({ toolCall, toolMessage })}
;
+}
+```
+
+## Return Value
+
+The hook returns a function with the following signature:
+
+```tsx
+(props: UseRenderToolCallProps) => React.ReactElement | null;
+```
+
+### UseRenderToolCallProps
+
+```tsx
+interface UseRenderToolCallProps {
+ toolCall: ToolCall; // The tool call to render
+ toolMessage?: ToolMessage; // Optional result message
+}
+```
+
+## How It Works
+
+### Status Determination
+
+The render function automatically determines the tool's status:
+
+1. **Complete**: When a `toolMessage` is provided
+2. **Executing**: When the tool is currently running (tracked internally)
+3. **InProgress**: Default state when neither complete nor executing
+
+### Renderer Selection
+
+The function selects renderers based on priority:
+
+1. **Exact match** with matching agentId
+2. **Exact match** without agentId (global)
+3. **Exact match** (any agentId)
+4. **Wildcard** renderer (`*`)
+5. **No render** (returns null)
+
+## Examples
+
+### Basic Tool Call Rendering
+
+```tsx
+import { useRenderToolCall } from "@copilotkitnext/react";
+import { AssistantMessage } from "@ag-ui/core";
+
+function ChatMessage({ message }: { message: AssistantMessage }) {
+ const renderToolCall = useRenderToolCall();
+
+ if (!message.toolCalls) {
+ return