Skip to content

Commit 036d541

Browse files
mmeranst91brandonmcconnellMikeRyanDev
authored
refactor!: restructure repo for v1.x and add v2.x (CopilotKit#2794)
- Move original CopilotKit/CopilotKit directory to src/v1.x - Introduce new v2 interfaces in src/v2.x - Align CI paths and preview environments to new layout Signed-off-by: Tyler Slaton <tyler@copilotkit.ai> Co-authored-by: Ran Shemtov <ran@copilotkit.ai> Co-authored-by: Brandon McConnell <brandon@dreamthinkbuild.com> Co-authored-by: Mike Ryan <mike.ryan52@gmail.com>
1 parent c7d215c commit 036d541

1,109 files changed

Lines changed: 106119 additions & 146 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cursor/rules/agent-development.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Python agents are typically in folders named `agent-py/` or `agent/` and use the
2323
- **[langgraph-tutorial-quickstart/agent-py/](mdc:examples/langgraph-tutorial-quickstart/agent-py/)** - LangGraph integration
2424

2525
### JavaScript Agents
26-
JavaScript agents are in folders named `agent-js/` and use the [sdk-js/](mdc:CopilotKit/packages/sdk-js/) package.
26+
JavaScript agents are in folders named `agent-js/` and use the [sdk-js/](mdc:src/v1.x/packages/sdk-js/) package.
2727

2828
#### JavaScript Agent Examples
2929
- **[coagents-starter/agent-js/](mdc:examples/coagents-starter/agent-js/)** - Basic JavaScript agent setup

.cursor/rules/copilotkit-architecture.mdc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ alwaysApply: false
66
# CopilotKit Architecture Overview
77

88
## Core Library Structure
9-
The main CopilotKit library is located in [CopilotKit/](mdc:CopilotKit/) with the following key packages:
9+
The main CopilotKit library is located in [CopilotKit/](mdc:src/v1.x/) with the following key packages:
1010

1111
### React Packages
12-
- **[react-core/](mdc:CopilotKit/packages/react-core/)** - Core React components and hooks for CopilotKit
13-
- **[react-textarea/](mdc:CopilotKit/packages/react-textarea/)** - Textarea component with AI integration
14-
- **[react-ui/](mdc:CopilotKit/packages/react-ui/)** - UI components for copilot interfaces
12+
- **[react-core/](mdc:src/v1.x/packages/react-core/)** - Core React components and hooks for CopilotKit
13+
- **[react-textarea/](mdc:src/v1.x/packages/react-textarea/)** - Textarea component with AI integration
14+
- **[react-ui/](mdc:src/v1.x/packages/react-ui/)** - UI components for copilot interfaces
1515

1616
### Runtime & SDK
17-
- **[runtime/](mdc:CopilotKit/packages/runtime/)** - Core runtime for executing copilot actions
18-
- **[runtime-client-gql/](mdc:CopilotKit/packages/runtime-client-gql/)** - GraphQL client for runtime communication
19-
- **[sdk-js/](mdc:CopilotKit/packages/sdk-js/)** - JavaScript SDK for backend integration
20-
- **[shared/](mdc:CopilotKit/packages/shared/)** - Shared utilities and types
17+
- **[runtime/](mdc:src/v1.x/packages/runtime/)** - Core runtime for executing copilot actions
18+
- **[runtime-client-gql/](mdc:src/v1.x/packages/runtime-client-gql/)** - GraphQL client for runtime communication
19+
- **[sdk-js/](mdc:src/v1.x/packages/sdk-js/)** - JavaScript SDK for backend integration
20+
- **[shared/](mdc:src/v1.x/packages/shared/)** - Shared utilities and types
2121

2222
### Python SDK
2323
- **[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
3939

4040
## Development Workflow
4141
- Examples use the local packages via workspace references
42-
- [package.json](mdc:CopilotKit/package.json) contains workspace configuration
43-
- Scripts in [scripts/](mdc:CopilotKit/scripts/) for development, testing, and releases
42+
- [package.json](mdc:src/v1.x/package.json) contains workspace configuration
43+
- Scripts in [scripts/](mdc:src/v1.x/scripts/) for development, testing, and releases
4444

4545

.cursor/rules/development-workflow.mdc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ alwaysApply: false
77

88
## Workspace Setup
99
CopilotKit uses a monorepo structure with:
10-
- **[CopilotKit/package.json](mdc:CopilotKit/package.json)** - Main workspace configuration
11-
- **[CopilotKit/packages/](mdc:CopilotKit/packages)** - Core library packages
10+
- **[src/v1.x/package.json](mdc:src/v1.x/package.json)** - Main workspace configuration
11+
- **[src/v1.x/packages/](mdc:src/v1.x/packages)** - Core library packages
1212
- **[examples/](mdc:examples)** - Example applications
1313

1414
## Development Scripts
15-
Located in [CopilotKit/scripts/](mdc:CopilotKit/scripts):
15+
Located in [src/v1.x/scripts/](mdc:src/v1.x/scripts):
1616

1717
### Development Scripts
18-
- **[develop/](mdc:CopilotKit/scripts/develop)** - Development environment setup
19-
- **[qa/](mdc:CopilotKit/scripts/qa)** - Quality assurance and testing scripts
20-
- **[release/](mdc:CopilotKit/scripts/release)** - Release automation scripts
18+
- **[develop/](mdc:src/v1.x/scripts/develop)** - Development environment setup
19+
- **[qa/](mdc:src/v1.x/scripts/qa)** - Quality assurance and testing scripts
20+
- **[release/](mdc:src/v1.x/scripts/release)** - Release automation scripts
2121

2222
### Documentation Scripts
23-
- **[docs/](mdc:CopilotKit/scripts/docs)** - Documentation generation and management
23+
- **[docs/](mdc:src/v1.x/scripts/docs)** - Documentation generation and management
2424

2525
## Package Management
2626
- Uses pnpm workspaces for package management
@@ -39,11 +39,11 @@ Located in [CopilotKit/scripts/](mdc:CopilotKit/scripts):
3939
- **[snippets/](mdc:docs/snippets)** - Code snippets for documentation
4040

4141
## Configuration Files
42-
- **[CopilotKit.code-workspace](mdc:CopilotKit/CopilotKit.code-workspace)** - VS Code workspace settings
43-
- **[utilities/](mdc:CopilotKit/utilities)** - Shared utilities:
44-
- [eslint-config-custom/](mdc:CopilotKit/utilities/eslint-config-custom) - ESLint configuration
45-
- [tailwind-config/](mdc:CopilotKit/utilities/tailwind-config) - Tailwind CSS configuration
46-
- [tsconfig/](mdc:CopilotKit/utilities/tsconfig) - TypeScript configurations
42+
- **[CopilotKit.code-workspace](mdc:src/v1.x/CopilotKit.code-workspace)** - VS Code workspace settings
43+
- **[utilities/](mdc:src/v1.x/utilities)** - Shared utilities:
44+
- [eslint-config-custom/](mdc:src/v1.x/utilities/eslint-config-custom) - ESLint configuration
45+
- [tailwind-config/](mdc:src/v1.x/utilities/tailwind-config) - Tailwind CSS configuration
46+
- [tsconfig/](mdc:src/v1.x/utilities/tsconfig) - TypeScript configurations
4747

4848
## Infrastructure
4949
- **[infra/](mdc:infra)** - AWS CDK infrastructure code

.cursor/rules/frontend-development.mdc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ alwaysApply: false
88
## Core React Packages
99

1010
### React Components
11-
- **[react-core/](mdc:CopilotKit/packages/react-core/)** - Core React components and hooks
11+
- **[react-core/](mdc:src/v1.x/packages/react-core/)** - Core React components and hooks
1212
- `CopilotProvider` - Main provider component
1313
- `useCopilotChat` - Chat functionality hook
1414
- `useCopilotAction` - Action definition hook
1515
- `useCopilotReadable` - State reading hook
1616

1717
### UI Components
18-
- **[react-ui/](mdc:CopilotKit/packages/react-ui/)** - Pre-built UI components
18+
- **[react-ui/](mdc:src/v1.x/packages/react-ui/)** - Pre-built UI components
1919
- `CopilotChat` - Chat interface component
2020
- `CopilotPopup` - Popup chat component
2121
- `CopilotSidebar` - Sidebar chat component
2222

2323
### Specialized Components
24-
- **[react-textarea/](mdc:CopilotKit/packages/react-textarea/)** - AI-enhanced textarea
24+
- **[react-textarea/](mdc:src/v1.x/packages/react-textarea/)** - AI-enhanced textarea
2525
- `CopilotTextarea` - Smart textarea with AI suggestions
2626
- Auto-completion and suggestions
2727

@@ -115,8 +115,8 @@ function MyComponent() {
115115
## Integration with Agents
116116

117117
### Runtime Configuration
118-
- **[runtime/](mdc:CopilotKit/packages/runtime/)** - Core runtime for agent communication
119-
- **[runtime-client-gql/](mdc:CopilotKit/packages/runtime-client-gql/)** - GraphQL client
118+
- **[runtime/](mdc:src/v1.x/packages/runtime/)** - Core runtime for agent communication
119+
- **[runtime-client-gql/](mdc:src/v1.x/packages/runtime-client-gql/)** - GraphQL client
120120

121121
### Agent Communication
122122
- Frontend components communicate with agents via the runtime
@@ -145,7 +145,7 @@ function MyComponent() {
145145

146146
### Styling and Theming
147147
- Uses Tailwind CSS for styling
148-
- Shared configuration in [utilities/tailwind-config/](mdc:CopilotKit/utilities/tailwind-config/)
148+
- Shared configuration in [utilities/tailwind-config/](mdc:src/v1.x/utilities/tailwind-config/)
149149
- Custom components in [components.json](mdc:docs/components.json)
150150
- UI components follow modern design patterns
151151

.cursor/rules/quick-reference.mdc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ alwaysApply: false
99

1010
### Build a Simple Copilot
1111
- Start with [copilot-chat-with-your-data/](mdc:examples/copilot-chat-with-your-data)
12-
- Use [react-core/](mdc:CopilotKit/packages/react-core) for basic integration
13-
- Add [react-ui/](mdc:CopilotKit/packages/react-ui) for pre-built components
12+
- Use [react-core/](mdc:src/v1.x/packages/react-core) for basic integration
13+
- Add [react-ui/](mdc:src/v1.x/packages/react-ui) for pre-built components
1414

1515
### Create Multi-Agent Systems
1616
- Check [coagents-starter/](mdc:examples/coagents-starter) for basic setup
@@ -27,18 +27,18 @@ alwaysApply: false
2727
- See [coagents-starter/agent-py/](mdc:examples/coagents-starter/agent-py) for example
2828

2929
### Develop JavaScript Agents
30-
- Use [sdk-js/](mdc:CopilotKit/packages/sdk-js) package
30+
- Use [sdk-js/](mdc:src/v1.x/packages/sdk-js) package
3131
- Check [coagents-starter/agent-js/](mdc:examples/coagents-starter/agent-js) for example
3232

3333
### Customize UI Components
3434
- Browse [registry/](mdc:registry) for reusable components
3535
- Check [docs/components/react/](mdc:docs/components/react) for documentation
36-
- Use [react-ui/](mdc:CopilotKit/packages/react-ui) for pre-built components
36+
- Use [react-ui/](mdc:src/v1.x/packages/react-ui) for pre-built components
3737

3838
### Set Up Development Environment
39-
- Review [CopilotKit/package.json](mdc:CopilotKit/package.json) for workspace setup
40-
- Use scripts in [CopilotKit/scripts/](mdc:CopilotKit/scripts)
41-
- Check [utilities/](mdc:CopilotKit/utilities) for shared configurations
39+
- Review [src/v1.x/package.json](mdc:src/v1.x/package.json) for workspace setup
40+
- Use scripts in [src/v1.x/scripts/](mdc:src/v1.x/scripts)
41+
- Check [utilities/](mdc:src/v1.x/utilities) for shared configurations
4242

4343
### Run Tests
4444
- Use [examples/e2e/](mdc:examples/e2e) for end-to-end testing
@@ -50,9 +50,9 @@ alwaysApply: false
5050
- See [docs/content/docs/](mdc:docs/content/docs) for markdown files
5151

5252
## Key Files to Know
53-
- **[CopilotKit/package.json](mdc:CopilotKit/package.json)** - Main workspace configuration
53+
- **[src/v1.x/package.json](mdc:src/v1.x/package.json)** - Main workspace configuration
5454
- **[sdk-python/pyproject.toml](mdc:sdk-python/pyproject.toml)** - Python SDK configuration
55-
- **[CopilotKit.code-workspace](mdc:CopilotKit/CopilotKit.code-workspace)** - VS Code workspace settings
55+
- **[CopilotKit.code-workspace](mdc:src/v1.x/CopilotKit.code-workspace)** - VS Code workspace settings
5656
- **[examples/shared/](mdc:examples/shared)** - Shared utilities and templates
5757

5858
## Common Patterns
@@ -63,7 +63,7 @@ alwaysApply: false
6363

6464
## Getting Started Checklist
6565
1. Clone the repository
66-
2. Navigate to [CopilotKit/](mdc:CopilotKit) directory
66+
2. Navigate to [src/v1.x/](mdc:src/v1.x) directory
6767
3. Run `npm install` to set up workspace
6868
4. Choose an example from [examples/](mdc:examples)
6969
5. Follow the example's README.md

.cursor/rules/suggestions-development.mdc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ Users can configure suggestions via `useCopilotChatSuggestions` hook which regis
3131
## Core files
3232

3333
- **@react-ui**
34-
- [Suggestions.tsx](mdc:CopilotKit/packages/react-ui/src/components/chat/Suggestions.tsx) - How suggestions are rendered
35-
- [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)
36-
- [Chat.tsx](mdc:CopilotKit/packages/react-ui/src/components/chat/Chat.tsx) - Includes relevant logic for our prebuilt components loading suggestions
37-
- [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
38-
- [suggestions.css](mdc:CopilotKit/packages/react-ui/src/css/suggestions.css) - Styling for suggestions
34+
- [Suggestions.tsx](mdc:src/v1.x/packages/react-ui/src/components/chat/Suggestions.tsx) - How suggestions are rendered
35+
- [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)
36+
- [Chat.tsx](mdc:src/v1.x/packages/react-ui/src/components/chat/Chat.tsx) - Includes relevant logic for our prebuilt components loading suggestions
37+
- [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
38+
- [suggestions.css](mdc:src/v1.x/packages/react-ui/src/css/suggestions.css) - Styling for suggestions
3939
- **@react-core**
40-
- [copilot-context.tsx](mdc:CopilotKit/packages/react-core/src/context/copilot-context.tsx) - Where the actual suggestions are stored, the "provider" or "context"
41-
- [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"
42-
- [suggestions.ts](mdc:CopilotKit/packages/react-core/src/utils/suggestions.ts) - Core suggestion generation logic with streaming validation and error handling
43-
- [suggestions-constants.ts](mdc:CopilotKit/packages/react-core/src/utils/suggestions-constants.ts) - Retry configuration constants
40+
- [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"
41+
- [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"
42+
- [suggestions.ts](mdc:src/v1.x/packages/react-core/src/utils/suggestions.ts) - Core suggestion generation logic with streaming validation and error handling
43+
- [suggestions-constants.ts](mdc:src/v1.x/packages/react-core/src/utils/suggestions-constants.ts) - Retry configuration constants
4444

4545
## How Suggestions Work
4646

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ on:
99
- 'examples/**'
1010
- '.github/workflows/demos_preview.yml'
1111
- '.github/workflows/release.yml'
12-
- 'CopilotKit/packages/**/package.json'
13-
- 'CopilotKit/packages/**/CHANGELOG.md'
14-
- 'CopilotKit/.changeset/**'
12+
- 'src/v1.x/packages/**/package.json'
13+
- 'src/v1.x/packages/**/CHANGELOG.md'
14+
- 'src/v1.x/.changeset/**'
1515
pull_request:
1616
branches: [main]
1717
paths-ignore:
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
defaults:
2626
run:
27-
working-directory: 'CopilotKit'
27+
working-directory: 'src/v1.x'
2828
strategy:
2929
matrix:
3030
node-version: [20.x, 18.x]

.github/workflows/custom-prerelease.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
defaults:
1313
run:
14-
working-directory: "CopilotKit"
14+
working-directory: "src/v1.x"
1515
timeout-minutes: 10
1616
steps:
1717
- name: Checkout Repo

.github/workflows/danger.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
paths:
66
- "sdk-python/copilotkit/langgraph_agent.py"
7-
- "CopilotKit/packages/sdk-js/src/langgraph.ts"
7+
- "src/v1.x/packages/sdk-js/src/langgraph.ts"
88

99
jobs:
1010
danger:

.github/workflows/dojo-e2e.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@ jobs:
143143
uses: astral-sh/setup-uv@v6
144144

145145
- name: Install cpk dependencies
146-
working-directory: CopilotKit/CopilotKit
146+
working-directory: CopilotKit/src/v1.x
147147
run: pnpm install --frozen-lockfile
148148

149149
- name: Build cpk
150-
working-directory: CopilotKit/CopilotKit
150+
working-directory: CopilotKit/src/v1.x
151151
env:
152152
NODE_OPTIONS: --max-old-space-size=8192
153153
TURBO_CONCURRENCY: 2
@@ -163,7 +163,7 @@ jobs:
163163

164164
- name: Link cpk into ag-ui
165165
working-directory: CopilotKit
166-
run: node ../ag-ui/apps/dojo/scripts/link-cpk.js .
166+
run: node ../ag-ui/apps/dojo/scripts/link-cpk.js src/v1.x/packages
167167

168168
- name: Prepare dojo for e2e
169169
working-directory: ag-ui/apps/dojo

0 commit comments

Comments
 (0)