Files
copilotkit__copilotkit/.cursor/rules/copilotkit-architecture.mdc
Tyler Slaton 96885b5959 refactor: consolidate V1/V2 packages into flat @copilotkit/* structure
Flatten all packages from packages/v1/* and packages/v2/* into packages/* —
every package now lives directly under the @copilotkit/ scope with no v1/v2
subdirectories.

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

Co-authored-by: Alem Tuzlak <t.zlak@hotmail.com>
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
2026-03-28 16:45:10 -07:00

46 lines
1.8 KiB
Plaintext

---
description:
globs:
alwaysApply: false
---
# CopilotKit Architecture Overview
## Core Library Structure
The main CopilotKit library is located in [CopilotKit/](mdc:./) with the following key packages:
### React Packages
- **[react-core/](mdc:packages/react-core/)** - Core React components and hooks for CopilotKit
- **[react-textarea/](mdc:packages/react-textarea/)** - Textarea component with AI integration
- **[react-ui/](mdc:packages/react-ui/)** - UI components for copilot interfaces
### Runtime & SDK
- **[runtime/](mdc:packages/runtime/)** - Core runtime for executing copilot actions
- **[runtime-client-gql/](mdc:packages/runtime-client-gql/)** - GraphQL client for runtime communication
- **[sdk-js/](mdc:packages/sdk-js/)** - JavaScript SDK for backend integration
- **[shared/](mdc:packages/shared/)** - Shared utilities and types
### Python SDK
- **[sdk-python/](mdc:sdk-python/)** - Python SDK with integrations for:
- CrewAI agents in [crewai/](mdc:sdk-python/copilotkit/crewai/)
- LangGraph integrations
- OpenAI integrations in [openai/](mdc:sdk-python/copilotkit/openai/)
## Key Concepts
- **Copilots**: AI assistants that can read and write application state
- **Actions**: Functions that copilots can call to interact with your application
- **Agents**: Backend AI agents that process complex tasks
- **Coagents**: Multi-agent systems for complex workflows
## Examples Structure
All examples are in [examples/](mdc:examples/) and typically follow this pattern:
- `agent/` or `agent-py/` - Backend agent implementation
- `ui/` - Frontend Next.js application
- `README.md` - Setup and usage instructions
## Development Workflow
- Examples use the local packages via workspace references
- [package.json](mdc:package.json) contains workspace configuration
- Scripts in [scripts/](mdc:scripts/) for development, testing, and releases