Skip to content

Commit 89f12c4

Browse files
committed
Add scripts for prepping dojo for e2e
1 parent 6157b97 commit 89f12c4

File tree

5 files changed

+398
-428
lines changed

5 files changed

+398
-428
lines changed

typescript-sdk/apps/dojo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
"@types/node": "^20",
8484
"@types/react": "^19",
8585
"@types/react-dom": "^19",
86+
"concurrently": "^9.2.0",
8687
"eslint": "^9",
8788
"eslint-config-next": "15.2.1",
8889
"tailwindcss": "^4",
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env node
2+
const fs = require('fs');
3+
const { execSync } = require('child_process');
4+
const path = require('path');
5+
6+
const gitRoot = execSync('git rev-parse --show-toplevel', { encoding: 'utf-8' }).trim();
7+
const dojoDir = path.join(gitRoot, 'typescript-sdk/apps/dojo');
8+
9+
function linkCopilotKit() {
10+
const pkgPath = path.join(dojoDir, 'package.json');
11+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
12+
const packages = Object.keys(pkg.dependencies).filter(pkg => pkg.startsWith('@copilotkit/'));
13+
14+
success = true;
15+
packages.forEach(pkg => {
16+
console.log(`Linking ${pkg}`);
17+
try {
18+
execSync(`pnpm link ${pkg}`, {cwd: dojoDir});
19+
console.log(`Linked ${pkg}`);
20+
} catch (e) {
21+
console.error(`Error linking ${pkg}: ${e}`);
22+
success = false;
23+
}
24+
25+
});
26+
27+
if (!success) {
28+
process.exit(1);
29+
}
30+
31+
}
32+
33+
linkCopilotKit();
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#!/usr/bin/env node
2+
3+
const { execSync } = require('child_process');
4+
const path = require('path');
5+
const concurrently = require('concurrently');
6+
7+
const gitRoot = execSync('git rev-parse --show-toplevel', { encoding: 'utf-8' }).trim();
8+
const integrationsRoot = path.join(gitRoot, 'typescript-sdk', 'integrations');
9+
10+
11+
12+
// Server Starter
13+
const serverStarter = {
14+
command: 'poetry install',
15+
name: 'Server Starter',
16+
cwd: path.join(integrationsRoot, 'server-starter/server/python'),
17+
}
18+
19+
// Server Starter All Features
20+
const serverStarterAllFeatures = {
21+
command: 'poetry install',
22+
name: 'Server AF',
23+
cwd: path.join(integrationsRoot, 'server-starter-all-features/server/python'),
24+
}
25+
26+
// Agno
27+
const agno = {
28+
command: 'uv venv --allow-existing && uv pip install -r requirements.txt',
29+
name: 'Agno',
30+
cwd: path.join(integrationsRoot, 'agno/examples'),
31+
}
32+
33+
// CrewAI
34+
const crewai = {
35+
command: 'poetry install',
36+
name: 'CrewAI',
37+
cwd: path.join(integrationsRoot, 'crewai/python'),
38+
}
39+
40+
// Langgraph (FastAPI)
41+
const langgraphFastapi = {
42+
command: 'poetry install',
43+
name: 'LG FastAPI',
44+
cwd: path.join(integrationsRoot, 'langgraph/python/ag_ui_langgraph/examples'),
45+
}
46+
47+
// Llama Index
48+
const llamaIndex = {
49+
command: 'uv sync',
50+
name: 'Llama Index',
51+
cwd: path.join(integrationsRoot, 'llamaindex/server-py'),
52+
}
53+
54+
// Mastra
55+
const mastra = {
56+
command: 'npm install',
57+
name: 'Mastra',
58+
cwd: path.join(integrationsRoot, 'mastra/example'),
59+
}
60+
61+
// Pydantic AI
62+
const pydanticAi = {
63+
command: 'uv sync',
64+
name: 'Pydantic AI',
65+
cwd: path.join(integrationsRoot, 'pydantic-ai/examples'),
66+
}
67+
68+
// THE ACTUAL DOJO
69+
const dojo = {
70+
command: 'pnpm install && pnpm build:clean',
71+
name: 'Dojo',
72+
cwd: path.join(gitRoot, 'typescript-sdk'),
73+
}
74+
75+
async function main() {
76+
const {result} = concurrently([
77+
serverStarter,
78+
serverStarterAllFeatures,
79+
agno,
80+
crewai,
81+
langgraphFastapi,
82+
llamaIndex,
83+
mastra,
84+
pydanticAi,
85+
dojo
86+
]);
87+
88+
result.then(() => process.exit(0)).catch((err) => {
89+
console.error(err);
90+
process.exit(1);
91+
});
92+
}
93+
94+
main();
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#!/usr/bin/env node
2+
3+
const { execSync } = require('child_process');
4+
const path = require('path');
5+
const concurrently = require('concurrently');
6+
7+
const gitRoot = execSync('git rev-parse --show-toplevel', { encoding: 'utf-8' }).trim();
8+
const integrationsRoot = path.join(gitRoot, 'typescript-sdk', 'integrations');
9+
10+
11+
12+
// Server Starter
13+
const serverStarter = {
14+
command: 'poetry run dev',
15+
name: 'Server Starter',
16+
cwd: path.join(integrationsRoot, 'server-starter/server/python'),
17+
}
18+
19+
// Server Starter All Features
20+
const serverStarterAllFeatures = {
21+
command: 'poetry run dev',
22+
name: 'Server AF',
23+
cwd: path.join(integrationsRoot, 'server-starter-all-features/server/python'),
24+
}
25+
26+
// Agno
27+
const agno = {
28+
command: 'uv run agent.py',
29+
name: 'Agno',
30+
cwd: path.join(integrationsRoot, 'agno/examples'),
31+
}
32+
33+
// CrewAI
34+
const crewai = {
35+
command: 'poetry run dev',
36+
name: 'CrewAI',
37+
cwd: path.join(integrationsRoot, 'crewai/python'),
38+
}
39+
40+
// Langgraph (FastAPI)
41+
const langgraphFastapi = {
42+
command: 'poetry run dev',
43+
name: 'LG FastAPI',
44+
cwd: path.join(integrationsRoot, 'langgraph/python/ag_ui_langgraph/examples'),
45+
}
46+
47+
// Langgraph (Platform)
48+
const langgraph = {
49+
command: 'pnpx @langchain/langgraph-cli@latest dev --no-browser',
50+
name: 'LG Platform',
51+
cwd: path.join(integrationsRoot, 'langgraph/examples'),
52+
}
53+
54+
// Llama Index
55+
const llamaIndex = {
56+
command: 'uv run dev',
57+
name: 'Llama Index',
58+
cwd: path.join(integrationsRoot, 'llamaindex/server-py'),
59+
}
60+
61+
// Mastra
62+
const mastra = {
63+
command: 'npm run dev',
64+
name: 'Mastra',
65+
cwd: path.join(integrationsRoot, 'mastra/example'),
66+
}
67+
68+
// Pydantic AI
69+
const pydanticAi = {
70+
command: 'uv run dev',
71+
name: 'Pydantic AI',
72+
cwd: path.join(integrationsRoot, 'pydantic-ai/examples'),
73+
}
74+
75+
// THE ACTUAL DOJO
76+
const dojo = {
77+
command: 'pnpm run dev',
78+
name: 'Dojo',
79+
cwd: path.join(gitRoot, 'typescript-sdk/apps/dojo'),
80+
}
81+
82+
async function main() {
83+
const {result} = concurrently([
84+
serverStarter,
85+
serverStarterAllFeatures,
86+
agno,
87+
crewai,
88+
langgraphFastapi,
89+
langgraph,
90+
llamaIndex,
91+
mastra,
92+
pydanticAi,
93+
dojo,
94+
]);
95+
96+
result.then(() => process.exit(0)).catch((err) => {
97+
console.error(err);
98+
process.exit(1);
99+
});
100+
}
101+
102+
main();

0 commit comments

Comments
 (0)