@@ -9,17 +9,36 @@ const args = process.argv.slice(2);
99const showHelp = args . includes ( '--help' ) || args . includes ( '-h' ) ;
1010const dryRun = args . includes ( '--dry-run' ) ;
1111
12+ // selection controls
13+ function parseList ( flag ) {
14+ const idx = args . indexOf ( flag ) ;
15+ if ( idx !== - 1 && args [ idx + 1 ] ) {
16+ return args [ idx + 1 ]
17+ . split ( ',' )
18+ . map ( ( s ) => s . trim ( ) )
19+ . filter ( Boolean ) ;
20+ }
21+ return null ;
22+ }
23+
24+ const onlyList = parseList ( '--only' ) || parseList ( '--include' ) ;
25+ const excludeList = parseList ( '--exclude' ) || [ ] ;
26+
1227if ( showHelp ) {
1328 console . log ( `
1429Usage: node prep-dojo-everything.js [options]
1530
1631Options:
1732 --dry-run Show what would be installed without actually running
33+ --only list Comma-separated services to include (defaults to all)
34+ --exclude list Comma-separated services to exclude
1835 --help, -h Show this help message
1936
2037Examples:
2138 node prep-dojo-everything.js
2239 node prep-dojo-everything.js --dry-run
40+ node prep-dojo-everything.js --only dojo,agno
41+ node prep-dojo-everything.js --exclude crew-ai,mastra
2342` ) ;
2443 process . exit ( 0 ) ;
2544}
@@ -29,78 +48,62 @@ const integrationsRoot = path.join(gitRoot, 'typescript-sdk', 'integrations');
2948
3049
3150
32- // Server Starter
33- const serverStarter = {
34- command : 'poetry install' ,
35- name : 'Server Starter' ,
36- cwd : path . join ( integrationsRoot , 'server-starter/server/python' ) ,
37- }
38-
39- // Server Starter All Features
40- const serverStarterAllFeatures = {
41- command : 'poetry install' ,
42- name : 'Server AF' ,
43- cwd : path . join ( integrationsRoot , 'server-starter-all-features/server/python' ) ,
44- }
45-
46- // Agno
47- const agno = {
48- command : 'uv sync' ,
49- name : 'Agno' ,
50- cwd : path . join ( integrationsRoot , 'agno/examples' ) ,
51- }
52-
53- // CrewAI
54- const crewai = {
55- command : 'poetry install' ,
56- name : 'CrewAI' ,
57- cwd : path . join ( integrationsRoot , 'crewai/python' ) ,
58- }
59-
60- // Langgraph (FastAPI)
61- const langgraphFastapi = {
62- command : 'poetry install' ,
63- name : 'LG FastAPI' ,
64- cwd : path . join ( integrationsRoot , 'langgraph/examples/python' ) ,
65- env : {
66- POETRY_VIRTUALENVS_IN_PROJECT : "false"
67- }
68- }
69-
70- // Langgraph (Platorm {typescript})
71- const langgraphPlatformTypescript = {
72- command : 'pnpm install' ,
73- name : 'LG Platform TS' ,
74- cwd : path . join ( integrationsRoot , 'langgraph/examples/typescript/' ) ,
75- }
76-
77- // Llama Index
78- const llamaIndex = {
79- command : 'uv sync' ,
80- name : 'Llama Index' ,
81- cwd : path . join ( integrationsRoot , 'llamaindex/server-py' ) ,
82- }
83-
84- // Mastra
85- const mastra = {
86- command : 'npm install' ,
87- name : 'Mastra' ,
88- cwd : path . join ( integrationsRoot , 'mastra/example' ) ,
89- }
90-
91- // Pydantic AI
92- const pydanticAi = {
93- command : 'uv sync' ,
94- name : 'Pydantic AI' ,
95- cwd : path . join ( integrationsRoot , 'pydantic-ai/examples' ) ,
96- }
97-
98- // THE ACTUAL DOJO
99- const dojo = {
100- command : 'pnpm install --no-frozen-lockfile && pnpm build --filter=demo-viewer...' ,
101- name : 'Dojo' ,
102- cwd : path . join ( gitRoot , 'typescript-sdk' ) ,
103- }
51+ // Define all prep targets keyed by a stable id
52+ const ALL_TARGETS = {
53+ 'server-starter' : {
54+ command : 'poetry install' ,
55+ name : 'Server Starter' ,
56+ cwd : path . join ( integrationsRoot , 'server-starter/server/python' ) ,
57+ } ,
58+ 'server-starter-all' : {
59+ command : 'poetry install' ,
60+ name : 'Server AF' ,
61+ cwd : path . join ( integrationsRoot , 'server-starter-all-features/server/python' ) ,
62+ } ,
63+ 'agno' : {
64+ command : 'uv sync' ,
65+ name : 'Agno' ,
66+ cwd : path . join ( integrationsRoot , 'agno/examples' ) ,
67+ } ,
68+ 'crew-ai' : {
69+ command : 'poetry install' ,
70+ name : 'CrewAI' ,
71+ cwd : path . join ( integrationsRoot , 'crewai/python' ) ,
72+ } ,
73+ 'langgraph-fastapi' : {
74+ command : 'poetry install' ,
75+ name : 'LG FastAPI' ,
76+ cwd : path . join ( integrationsRoot , 'langgraph/examples/python' ) ,
77+ env : {
78+ POETRY_VIRTUALENVS_IN_PROJECT : "false" ,
79+ } ,
80+ } ,
81+ 'langgraph-platform-typescript' : {
82+ command : 'pnpm install' ,
83+ name : 'LG Platform TS' ,
84+ cwd : path . join ( integrationsRoot , 'langgraph/examples/typescript/' ) ,
85+ } ,
86+ 'llama-index' : {
87+ command : 'uv sync' ,
88+ name : 'Llama Index' ,
89+ cwd : path . join ( integrationsRoot , 'llamaindex/server-py' ) ,
90+ } ,
91+ 'mastra' : {
92+ command : 'npm install' ,
93+ name : 'Mastra' ,
94+ cwd : path . join ( integrationsRoot , 'mastra/example' ) ,
95+ } ,
96+ 'pydantic-ai' : {
97+ command : 'uv sync' ,
98+ name : 'Pydantic AI' ,
99+ cwd : path . join ( integrationsRoot , 'pydantic-ai/examples' ) ,
100+ } ,
101+ 'dojo' : {
102+ command : 'pnpm install --no-frozen-lockfile && pnpm build --filter=demo-viewer...' ,
103+ name : 'Dojo' ,
104+ cwd : path . join ( gitRoot , 'typescript-sdk' ) ,
105+ } ,
106+ } ;
104107
105108function printDryRunServices ( procs ) {
106109 console . log ( 'Dry run - would install dependencies for the following services:' ) ;
@@ -113,18 +116,25 @@ function printDryRunServices(procs) {
113116}
114117
115118async function main ( ) {
116- const procs = [
117- serverStarter ,
118- serverStarterAllFeatures ,
119- agno ,
120- crewai ,
121- langgraphFastapi ,
122- langgraphPlatformTypescript ,
123- llamaIndex ,
124- mastra ,
125- pydanticAi ,
126- dojo
127- ] ;
119+ // determine selection
120+ let selectedKeys = Object . keys ( ALL_TARGETS ) ;
121+ if ( onlyList && onlyList . length ) {
122+ selectedKeys = onlyList ;
123+ }
124+ if ( excludeList && excludeList . length ) {
125+ selectedKeys = selectedKeys . filter ( ( k ) => ! excludeList . includes ( k ) ) ;
126+ }
127+
128+ // Build procs list, warning on unknown keys
129+ const procs = [ ] ;
130+ for ( const key of selectedKeys ) {
131+ const target = ALL_TARGETS [ key ] ;
132+ if ( ! target ) {
133+ console . warn ( `Skipping unknown service: ${ key } ` ) ;
134+ continue ;
135+ }
136+ procs . push ( target ) ;
137+ }
128138
129139 if ( dryRun ) {
130140 printDryRunServices ( procs ) ;
0 commit comments