copilotkit 0.0.15 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/commands/base-command.js +1 -1
  2. package/dist/commands/base-command.js.map +1 -1
  3. package/dist/commands/dev.js +1 -1
  4. package/dist/commands/dev.js.map +1 -1
  5. package/dist/commands/init.d.ts +1 -0
  6. package/dist/commands/init.js +227 -146
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/login.js +1 -1
  9. package/dist/commands/login.js.map +1 -1
  10. package/dist/commands/logout.js +1 -1
  11. package/dist/commands/logout.js.map +1 -1
  12. package/dist/lib/init/index.d.ts +3 -2
  13. package/dist/lib/init/index.js +178 -99
  14. package/dist/lib/init/index.js.map +1 -1
  15. package/dist/lib/init/questions.js +92 -47
  16. package/dist/lib/init/questions.js.map +1 -1
  17. package/dist/lib/init/scaffold/agent.d.ts +19 -0
  18. package/dist/lib/init/scaffold/agent.js +161 -0
  19. package/dist/lib/init/scaffold/agent.js.map +1 -0
  20. package/dist/lib/init/scaffold/env.js +4 -2
  21. package/dist/lib/init/scaffold/env.js.map +1 -1
  22. package/dist/lib/init/scaffold/github.d.ts +1 -4
  23. package/dist/lib/init/scaffold/github.js +1 -46
  24. package/dist/lib/init/scaffold/github.js.map +1 -1
  25. package/dist/lib/init/scaffold/index.d.ts +2 -1
  26. package/dist/lib/init/scaffold/index.js +96 -54
  27. package/dist/lib/init/scaffold/index.js.map +1 -1
  28. package/dist/lib/init/scaffold/shadcn.js +15 -6
  29. package/dist/lib/init/scaffold/shadcn.js.map +1 -1
  30. package/dist/lib/init/types/index.d.ts +1 -1
  31. package/dist/lib/init/types/index.js +12 -2
  32. package/dist/lib/init/types/index.js.map +1 -1
  33. package/dist/lib/init/types/questions.d.ts +7 -2
  34. package/dist/lib/init/types/questions.js +4 -1
  35. package/dist/lib/init/types/questions.js.map +1 -1
  36. package/dist/lib/init/types/templates.d.ts +11 -2
  37. package/dist/lib/init/types/templates.js +8 -1
  38. package/dist/lib/init/types/templates.js.map +1 -1
  39. package/dist/utils/version.d.ts +1 -1
  40. package/dist/utils/version.js +1 -1
  41. package/dist/utils/version.js.map +1 -1
  42. package/oclif.manifest.json +12 -1
  43. package/package.json +1 -1
@@ -1,7 +1,8 @@
1
1
  export { scaffoldShadCN } from './shadcn.js';
2
2
  export { scaffoldEnv } from './env.js';
3
- export { cloneGitHubSubdirectory, isValidGitHubUrl, scaffoldAgent } from './github.js';
3
+ export { cloneGitHubSubdirectory, isValidGitHubUrl } from './github.js';
4
4
  export { scaffoldPackages } from './packages.js';
5
+ export { AgentTemplates, scaffoldAgent } from './agent.js';
5
6
  import '../types/questions.js';
6
7
  import '@oclif/core/interfaces';
7
8
  import 'ora';
@@ -7,6 +7,7 @@ var AGENT_FRAMEWORKS = ["CrewAI", "LangGraph", "None"];
7
7
  var CREW_TYPES = ["Crews", "Flows"];
8
8
  var CHAT_COMPONENTS = ["CopilotChat", "CopilotSidebar", "Headless", "CopilotPopup"];
9
9
  var LANGGRAPH_AGENTS = ["Python Starter", "TypeScript Starter", "None"];
10
+ var CREW_FLOW_TEMPLATES = ["Starter", "None"];
10
11
  var ConfigFlags = {
11
12
  copilotKitVersion: Flags.string({ description: "CopilotKit version to use (e.g. 1.7.0)" }),
12
13
  agentFramework: Flags.string({ description: "Agent framework to power your copilot", options: AGENT_FRAMEWORKS }),
@@ -19,7 +20,8 @@ var ConfigFlags = {
19
20
  crewUrl: Flags.string({ description: "URL endpoint for your CrewAI agent" }),
20
21
  crewBearerToken: Flags.string({ description: "Bearer token for CrewAI authentication" }),
21
22
  langSmithApiKey: Flags.string({ description: "LangSmith API key for LangGraph observability" }),
22
- llmToken: Flags.string({ description: "API key for your preferred LLM provider" })
23
+ llmToken: Flags.string({ description: "API key for your preferred LLM provider" }),
24
+ crewFlowAgent: Flags.string({ description: "CrewAI Flow template to use", options: CREW_FLOW_TEMPLATES })
23
25
  };
24
26
 
25
27
  // src/lib/init/types/templates.ts
@@ -27,7 +29,14 @@ var BASE_URL = "http://registry.copilotkit.ai/r";
27
29
  var templateMapping = {
28
30
  "LangGraphPlatform": `${BASE_URL}/langgraph-platform-starter.json`,
29
31
  "RemoteEndpoint": `${BASE_URL}/remote-endpoint-starter.json`,
30
- "CrewEnterprise": `${BASE_URL}/agent-layout.json`,
32
+ "CrewEnterprise": [
33
+ `${BASE_URL}/coagents-crew-starter.json`
34
+ ],
35
+ "CrewFlowsStarter": [
36
+ `${BASE_URL}/coagents-starter-ui.json`,
37
+ `${BASE_URL}/agent-layout.json`,
38
+ `${BASE_URL}/remote-endpoint.json`
39
+ ],
31
40
  "Standard": `${BASE_URL}/standard-starter.json`,
32
41
  "CopilotChat": `${BASE_URL}/chat.json`,
33
42
  "CopilotPopup": `${BASE_URL}/popup.json`,
@@ -37,9 +46,7 @@ var templateMapping = {
37
46
  // src/lib/init/scaffold/shadcn.ts
38
47
  async function scaffoldShadCN(userAnswers) {
39
48
  try {
40
- const components = [
41
- templateMapping[userAnswers.chatUi]
42
- ];
49
+ const components = [];
43
50
  if (userAnswers.agentFramework !== "None") {
44
51
  switch (userAnswers.agentFramework) {
45
52
  case "LangGraph":
@@ -47,7 +54,9 @@ async function scaffoldShadCN(userAnswers) {
47
54
  break;
48
55
  case "CrewAI":
49
56
  if (userAnswers.crewType === "Crews") {
50
- components.push(templateMapping.CrewEnterprise);
57
+ components.push(...templateMapping.CrewEnterprise);
58
+ } else if (userAnswers.crewFlowAgent) {
59
+ components.push(...templateMapping.CrewFlowsStarter);
51
60
  } else {
52
61
  components.push(templateMapping.RemoteEndpoint);
53
62
  }
@@ -101,7 +110,7 @@ async function scaffoldEnv(flags, userAnswers) {
101
110
  varsAdded = true;
102
111
  }
103
112
  if (userAnswers.langSmithApiKey) {
104
- newEnvValues += `LANG_SMITH_API_KEY=${userAnswers.langSmithApiKey}
113
+ newEnvValues += `LANGSMITH_API_KEY=${userAnswers.langSmithApiKey}
105
114
  `;
106
115
  spinner.text = chalk.cyan("Adding LangSmith API key...");
107
116
  varsAdded = true;
@@ -109,7 +118,9 @@ async function scaffoldEnv(flags, userAnswers) {
109
118
  if (userAnswers.llmToken) {
110
119
  newEnvValues += `LLM_TOKEN=${userAnswers.llmToken}
111
120
  `;
112
- spinner.text = chalk.cyan("Adding LLM token...");
121
+ newEnvValues += `OPENAI_API_KEY=${userAnswers.llmToken}
122
+ `;
123
+ spinner.text = chalk.cyan("Adding OpenAI API key...");
113
124
  varsAdded = true;
114
125
  }
115
126
  if (userAnswers.crewName) {
@@ -145,50 +156,6 @@ import * as fs2 from "fs";
145
156
  import * as path2 from "path";
146
157
  import * as os from "os";
147
158
  import chalk2 from "chalk";
148
- import ora2 from "ora";
149
- async function scaffoldAgent(userAnswers) {
150
- if (userAnswers.agentFramework === "None" || userAnswers.agentFramework === "CrewAI" && userAnswers.crewType === "Crews" || userAnswers.agentFramework === "LangGraph" && (!userAnswers.langGraphAgent || userAnswers.langGraphAgent === "None")) {
151
- return;
152
- }
153
- const spinner = ora2({
154
- text: chalk2.cyan("Setting up AI agent..."),
155
- color: "cyan"
156
- }).start();
157
- try {
158
- if (userAnswers.agentFramework === "LangGraph") {
159
- switch (userAnswers.langGraphAgent) {
160
- case "Python Starter":
161
- spinner.text = chalk2.cyan("Setting up Python LangGraph agent...");
162
- await new Promise((resolve) => setTimeout(resolve, 50));
163
- await cloneGitHubSubdirectory(
164
- "https://github.com/CopilotKit/CopilotKit/tree/main/examples/coagents-starter/agent-py",
165
- path2.join(process.cwd(), "agent"),
166
- spinner
167
- );
168
- break;
169
- case "TypeScript Starter":
170
- spinner.text = chalk2.cyan("Setting up TypeScript LangGraph agent...");
171
- await new Promise((resolve) => setTimeout(resolve, 50));
172
- await cloneGitHubSubdirectory(
173
- "https://github.com/CopilotKit/CopilotKit/tree/main/examples/coagents-starter/agent-js",
174
- path2.join(process.cwd(), "agent"),
175
- spinner
176
- );
177
- break;
178
- default:
179
- break;
180
- }
181
- } else if (userAnswers.agentFramework === "CrewAI" && userAnswers.crewType === "Flows") {
182
- spinner.text = chalk2.cyan("Setting up CrewAI Flows agent...");
183
- await new Promise((resolve) => setTimeout(resolve, 50));
184
- spinner.info(chalk2.yellow("CrewAI Flows support is coming soon..."));
185
- }
186
- spinner.succeed(chalk2.green("AI agent setup complete"));
187
- } catch (error) {
188
- spinner.fail(chalk2.red("Failed to set up AI agent"));
189
- throw error;
190
- }
191
- }
192
159
  async function cloneGitHubSubdirectory(githubUrl, destinationPath, spinner) {
193
160
  try {
194
161
  const { owner, repo, branch, subdirectoryPath } = parseGitHubUrl(githubUrl);
@@ -276,9 +243,9 @@ function isValidGitHubUrl(url) {
276
243
  import spawn2 from "cross-spawn";
277
244
  import chalk3 from "chalk";
278
245
  import fs3 from "fs";
279
- import ora3 from "ora";
246
+ import ora2 from "ora";
280
247
  async function scaffoldPackages(userAnswers) {
281
- const spinner = ora3({
248
+ const spinner = ora2({
282
249
  text: chalk3.cyan("Preparing to install packages..."),
283
250
  color: "cyan"
284
251
  }).start();
@@ -328,7 +295,82 @@ function detectInstallCommand(packageManager) {
328
295
  return "install";
329
296
  }
330
297
  }
298
+
299
+ // src/lib/init/scaffold/agent.ts
300
+ import ora3 from "ora";
301
+ import chalk4 from "chalk";
302
+ import path3 from "path";
303
+ import fs4 from "fs";
304
+ async function scaffoldAgent(userAnswers) {
305
+ if (userAnswers.agentFramework === "None" || userAnswers.agentFramework === "CrewAI" && userAnswers.crewType === "Crews" || userAnswers.agentFramework === "LangGraph" && (!userAnswers.langGraphAgent || userAnswers.langGraphAgent === "None")) {
306
+ return;
307
+ }
308
+ const spinner = ora3({
309
+ text: chalk4.cyan("Setting up AI agent..."),
310
+ color: "cyan"
311
+ }).start();
312
+ let template = "";
313
+ switch (userAnswers.agentFramework) {
314
+ case "LangGraph":
315
+ if (userAnswers.langGraphAgent === "Python Starter") {
316
+ template = AgentTemplates.LangGraph.Starter.Python;
317
+ } else {
318
+ template = AgentTemplates.LangGraph.Starter.TypeScript;
319
+ }
320
+ break;
321
+ case "CrewAI":
322
+ if (userAnswers.crewFlowAgent === "Starter") {
323
+ template = AgentTemplates.CrewAI.Flows.Starter;
324
+ }
325
+ break;
326
+ }
327
+ if (!template) {
328
+ spinner.fail(chalk4.red("Failed to determine agent template"));
329
+ throw new Error("Failed to determine agent template");
330
+ }
331
+ const agentDir = path3.join(process.cwd(), "agent");
332
+ try {
333
+ await cloneGitHubSubdirectory(
334
+ template,
335
+ agentDir,
336
+ spinner
337
+ );
338
+ spinner.text = chalk4.cyan("Creating agent environment variables...");
339
+ let envContent = "";
340
+ if (userAnswers.llmToken) {
341
+ envContent += `OPENAI_API_KEY=${userAnswers.llmToken}
342
+ `;
343
+ }
344
+ if (userAnswers.agentFramework === "LangGraph" && userAnswers.langSmithApiKey) {
345
+ envContent += `LANGSMITH_API_KEY=${userAnswers.langSmithApiKey}
346
+ `;
347
+ }
348
+ if (envContent) {
349
+ const agentEnvFile = path3.join(agentDir, ".env");
350
+ fs4.writeFileSync(agentEnvFile, envContent, "utf8");
351
+ spinner.text = chalk4.cyan("Added API keys to agent .env file");
352
+ }
353
+ } catch (error) {
354
+ spinner.fail(chalk4.red("Failed to clone agent template"));
355
+ throw error;
356
+ }
357
+ spinner.succeed(chalk4.green(`${userAnswers.agentFramework} agent cloned successfully`));
358
+ }
359
+ var AgentTemplates = {
360
+ LangGraph: {
361
+ Starter: {
362
+ Python: "https://github.com/CopilotKit/CopilotKit/tree/main/examples/coagents-starter/agent-py",
363
+ TypeScript: "https://github.com/CopilotKit/CopilotKit/tree/main/examples/coagents-starter/agent-js"
364
+ }
365
+ },
366
+ CrewAI: {
367
+ Flows: {
368
+ Starter: "https://github.com/CopilotKit/CopilotKit/tree/main/examples/coagents-starter-crewai-flows/agent-py"
369
+ }
370
+ }
371
+ };
331
372
  export {
373
+ AgentTemplates,
332
374
  cloneGitHubSubdirectory,
333
375
  isValidGitHubUrl,
334
376
  scaffoldAgent,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/init/scaffold/shadcn.ts","../../../../src/lib/init/types/questions.ts","../../../../src/lib/init/types/templates.ts","../../../../src/lib/init/scaffold/env.ts","../../../../src/lib/init/scaffold/github.ts","../../../../src/lib/init/scaffold/packages.ts"],"sourcesContent":["import spawn from \"cross-spawn\"\nimport { \n templateMapping, \n ChatTemplate, \n Config \n} from \"../types/index.js\"\n\nexport async function scaffoldShadCN(userAnswers: Config) {\n try {\n // Determine which components to install based on user choices\n const components = [\n templateMapping[userAnswers.chatUi as ChatTemplate]\n ]\n \n // Add additional components based on agent framework\n if (userAnswers.agentFramework !== 'None') {\n switch (userAnswers.agentFramework) {\n case 'LangGraph':\n components.push(templateMapping.LangGraphPlatform)\n break\n case 'CrewAI':\n if (userAnswers.crewType === 'Crews') {\n components.push(templateMapping.CrewEnterprise)\n } else {\n components.push(templateMapping.RemoteEndpoint)\n }\n break\n default:\n components.push(templateMapping.RemoteEndpoint)\n break\n }\n }\n \n // Small pause before running shadcn\n await new Promise(resolve => setTimeout(resolve, 100));\n \n try {\n // Run shadcn with inherited stdio for all streams to allow for user input\n const result = spawn.sync('npx', ['shadcn@latest', 'add', ...components], { \n stdio: 'inherit' // This ensures stdin/stdout/stderr are all passed through\n });\n \n if (result.status !== 0) {\n throw new Error(`The shadcn installation process exited with code ${result.status}`);\n }\n } catch (error) {\n throw error;\n }\n } catch (error) {\n throw error;\n }\n}","import { Flags } from \"@oclif/core\"\n\nexport type Question = {\n type: 'input' | 'yes/no' | 'select'\n name: Fields\n message: string\n choices?: string[]\n default?: string\n when?: (answers: Record<string, any>) => boolean\n}\n\n// Agent framework options\nexport const AGENT_FRAMEWORKS = ['CrewAI', 'LangGraph', 'None'] as const;\nexport type AgentFramework = typeof AGENT_FRAMEWORKS[number];\n\n// CrewAI types\nexport const CREW_TYPES = ['Crews', 'Flows'] as const;\nexport type CrewType = typeof CREW_TYPES[number];\n\n// UI component options\nexport const CHAT_COMPONENTS = ['CopilotChat','CopilotSidebar', 'Headless', 'CopilotPopup'] as const;\nexport type ChatComponent = typeof CHAT_COMPONENTS[number];\n\n// LangGraph agent types\nexport const LANGGRAPH_AGENTS = ['Python Starter', 'TypeScript Starter', 'None'] as const;\nexport type LangGraphAgent = typeof LANGGRAPH_AGENTS[number];\n\n// Yes/No type for consistent options\nexport type YesNo = 'Yes' | 'No';\n\n// All possible field names for questions\nexport type Fields = \n \"copilotKitVersion\" | \n \"agentFramework\" | \n \"alreadyDeployed\" |\n \"fastApiEnabled\" | \n \"useCopilotCloud\" | \n \"chatUi\" | \n \"langGraphAgent\" | \n \"langGraphPlatform\" |\n \"langGraphPlatformUrl\" | \n \"crewType\" | \n \"crewName\" | \n \"langGraphRemoteEndpointURL\" |\n \"crewUrl\" | \n \"crewBearerToken\" | \n \"langSmithApiKey\" | \n \"llmToken\";\n\n// Complete configuration shape that holds all possible answers\nexport interface Config {\n copilotKitVersion: string;\n agentFramework: AgentFramework;\n alreadyDeployed?: YesNo;\n fastApiEnabled?: YesNo;\n useCopilotCloud?: YesNo;\n chatUi: ChatComponent;\n\n // LangGraph\n langGraphAgent?: LangGraphAgent;\n langGraphPlatform?: YesNo;\n langGraphPlatformUrl?: string;\n langGraphRemoteEndpointURL?: string;\n\n // CrewAI\n crewType?: CrewType;\n crewName?: string;\n crewUrl?: string;\n crewBearerToken?: string;\n\n // API keys and tokens\n copilotCloudPublicApiKey?: string;\n langSmithApiKey?: string;\n llmToken?: string;\n}\n\n// CLI flags definition - single source of truth for flag descriptions\nexport const ConfigFlags = {\n copilotKitVersion: Flags.string({description: 'CopilotKit version to use (e.g. 1.7.0)'}),\n agentFramework: Flags.string({description: 'Agent framework to power your copilot', options: AGENT_FRAMEWORKS}),\n fastApiEnabled: Flags.string({description: 'Use FastAPI to serve your agent locally', options: ['Yes', 'No']}),\n useCopilotCloud: Flags.string({description: 'Use Copilot Cloud for production-ready hosting', options: ['Yes', 'No']}),\n chatUi: Flags.string({description: 'Chat UI component to add to your app', options: CHAT_COMPONENTS}),\n langGraphAgent: Flags.string({description: 'LangGraph agent template to use', options: LANGGRAPH_AGENTS}),\n crewType: Flags.string({description: 'CrewAI implementation type', options: CREW_TYPES}),\n crewName: Flags.string({description: 'Name for your CrewAI agent'}),\n crewUrl: Flags.string({description: 'URL endpoint for your CrewAI agent'}),\n crewBearerToken: Flags.string({description: 'Bearer token for CrewAI authentication'}),\n langSmithApiKey: Flags.string({description: 'LangSmith API key for LangGraph observability'}),\n llmToken: Flags.string({description: 'API key for your preferred LLM provider'}),\n}","export type ChatTemplate = \n \"CopilotChat\" |\n \"CopilotPopup\" |\n \"CopilotSidebar\"\n\nexport type StarterTemplate = \n \"LangGraphPlatform\" |\n \"RemoteEndpoint\" |\n \"Standard\" |\n \"CrewEnterprise\"\n\nexport type Template = ChatTemplate | StarterTemplate\n\nconst BASE_URL = \"http://registry.copilotkit.ai/r\"\n\nexport const templateMapping: Record<Template, string> = {\n \"LangGraphPlatform\": `${BASE_URL}/langgraph-platform-starter.json`,\n \"RemoteEndpoint\": `${BASE_URL}/remote-endpoint-starter.json`,\n \"CrewEnterprise\": `${BASE_URL}/agent-layout.json`,\n\n \"Standard\": `${BASE_URL}/standard-starter.json`,\n \"CopilotChat\": `${BASE_URL}/chat.json`,\n \"CopilotPopup\": `${BASE_URL}/popup.json`,\n \"CopilotSidebar\": `${BASE_URL}/sidebar.json`,\n}","import path from \"path\"\nimport fs from \"fs\"\nimport { Config } from \"../types/index.js\"\nimport chalk from \"chalk\"\nimport ora from \"ora\"\n\nexport async function scaffoldEnv(flags: any, userAnswers: Config) {\n const spinner = ora({\n text: chalk.cyan('Configuring environment variables...'),\n color: 'cyan'\n }).start();\n\n try {\n // Define the env file path\n const envFile = path.join(process.cwd(), '.env')\n \n // Create the env file if it doesn't exist\n if (!fs.existsSync(envFile)) {\n fs.writeFileSync(envFile, '', 'utf8')\n spinner.text = chalk.cyan('Created .env file...');\n } else {\n spinner.text = chalk.cyan('Updating existing .env file...');\n }\n \n // Build environment variables based on user selections\n let newEnvValues = ''\n let varsAdded = false;\n \n // Copilot Cloud API key\n if (userAnswers.copilotCloudPublicApiKey) {\n newEnvValues += `NEXT_PUBLIC_COPILOT_API_KEY=${userAnswers.copilotCloudPublicApiKey}\\n`\n spinner.text = chalk.cyan('Adding Copilot Cloud API key...');\n varsAdded = true;\n }\n \n // LangSmith API key (for LangGraph)\n if (userAnswers.langSmithApiKey) {\n newEnvValues += `LANG_SMITH_API_KEY=${userAnswers.langSmithApiKey}\\n`\n spinner.text = chalk.cyan('Adding LangSmith API key...');\n varsAdded = true;\n }\n \n // LLM API key\n if (userAnswers.llmToken) {\n newEnvValues += `LLM_TOKEN=${userAnswers.llmToken}\\n`\n spinner.text = chalk.cyan('Adding LLM token...');\n varsAdded = true;\n }\n \n // CrewAI name\n if (userAnswers.crewName) {\n newEnvValues += `NEXT_PUBLIC_COPILOTKIT_AGENT_NAME=${userAnswers.crewName}\\n`\n spinner.text = chalk.cyan('Adding Crew agent name...');\n varsAdded = true;\n }\n \n // Runtime URL if provided via flags\n if (flags.runtimeUrl) {\n newEnvValues += `NEXT_PUBLIC_COPILOTKIT_RUNTIME_URL=${flags.runtimeUrl}\\n`\n spinner.text = chalk.cyan('Adding runtime URL...');\n varsAdded = true;\n }\n \n if (!varsAdded) {\n spinner.text = chalk.cyan('No environment variables needed...');\n }\n \n // Append the variables to the .env file\n if (newEnvValues) {\n fs.appendFileSync(envFile, newEnvValues)\n spinner.succeed(chalk('Environment variables configured successfully'));\n } else {\n spinner.info(chalk.yellow('No environment variables were added'));\n }\n } catch (error) {\n spinner.fail(chalk.red('Failed to update environment variables'));\n throw error;\n }\n}\n","import { execSync } from 'child_process';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as os from 'os';\nimport { Config } from '../types/index.js';\nimport chalk from \"chalk\"\nimport ora, {Ora} from \"ora\";\n\nexport async function scaffoldAgent(userAnswers: Config) {\n // Skip if no agent framework or using CrewAI Crews (which are handled by cloud)\n if (userAnswers.agentFramework === 'None' || \n (userAnswers.agentFramework === 'CrewAI' && userAnswers.crewType === 'Crews') ||\n (userAnswers.agentFramework === 'LangGraph' && (!userAnswers.langGraphAgent || userAnswers.langGraphAgent === 'None'))) {\n return;\n }\n \n const spinner = ora({\n text: chalk.cyan('Setting up AI agent...'),\n color: 'cyan'\n }).start();\n \n try {\n if (userAnswers.agentFramework === 'LangGraph') {\n switch (userAnswers.langGraphAgent) {\n case 'Python Starter':\n spinner.text = chalk.cyan('Setting up Python LangGraph agent...');\n await new Promise(resolve => setTimeout(resolve, 50));\n \n await cloneGitHubSubdirectory(\n 'https://github.com/CopilotKit/CopilotKit/tree/main/examples/coagents-starter/agent-py', \n path.join(process.cwd(), 'agent'),\n spinner\n );\n break;\n \n case 'TypeScript Starter':\n spinner.text = chalk.cyan('Setting up TypeScript LangGraph agent...');\n await new Promise(resolve => setTimeout(resolve, 50));\n \n await cloneGitHubSubdirectory(\n 'https://github.com/CopilotKit/CopilotKit/tree/main/examples/coagents-starter/agent-js', \n path.join(process.cwd(), 'agent'),\n spinner\n );\n break;\n \n default:\n break;\n }\n } else if (userAnswers.agentFramework === 'CrewAI' && userAnswers.crewType === 'Flows') {\n spinner.text = chalk.cyan('Setting up CrewAI Flows agent...');\n await new Promise(resolve => setTimeout(resolve, 50));\n \n // CrewAI local flows scaffolding would go here when implemented\n spinner.info(chalk.yellow('CrewAI Flows support is coming soon...'));\n }\n \n spinner.succeed(chalk.green('AI agent setup complete'));\n } catch (error) {\n spinner.fail(chalk.red('Failed to set up AI agent'));\n throw error;\n }\n}\n\n/**\n * Clones a specific subdirectory from a GitHub repository\n * \n * @param githubUrl - The GitHub URL to the repository or subdirectory\n * @param destinationPath - The local path where the content should be copied\n * @param spinner - The spinner to update with progress information\n * @returns A boolean indicating success or failure\n */\nexport async function cloneGitHubSubdirectory(\n githubUrl: string,\n destinationPath: string,\n spinner: Ora\n): Promise<boolean> {\n try {\n // Parse the GitHub URL to extract repo info\n const { owner, repo, branch, subdirectoryPath } = parseGitHubUrl(githubUrl);\n \n spinner.text = chalk.cyan(`Cloning from ${owner}/${repo}...`);\n \n // Method 1: Use sparse checkout (more efficient than full clone)\n return await sparseCheckout(owner, repo, branch, subdirectoryPath, destinationPath, spinner);\n } catch (error) {\n spinner.text = chalk.red(`Failed to clone from GitHub: ${error}`);\n return false;\n }\n}\n\n/**\n * Uses Git sparse-checkout to efficiently download only the needed subdirectory\n */\nasync function sparseCheckout(\n owner: string,\n repo: string,\n branch: string,\n subdirectoryPath: string,\n destinationPath: string,\n spinner: Ora\n): Promise<boolean> {\n const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'copilotkit-sparse-'));\n \n try {\n spinner.text = chalk.cyan('Creating temporary workspace...');\n \n // Initialize git repo\n execSync('git init', { cwd: tempDir, stdio: 'pipe' });\n \n spinner.text = chalk.cyan('Connecting to repository...');\n \n // Add remote\n execSync(`git remote add origin https://github.com/${owner}/${repo}.git`, { cwd: tempDir, stdio: 'pipe' });\n \n // Enable sparse checkout\n execSync('git config core.sparseCheckout true', { cwd: tempDir, stdio: 'pipe' });\n \n // Specify which subdirectory to checkout\n fs.writeFileSync(path.join(tempDir, '.git/info/sparse-checkout'), subdirectoryPath);\n \n spinner.text = chalk.cyan('Downloading agent files...');\n \n // Pull only the specified branch\n execSync(`git pull origin ${branch} --depth=1`, { cwd: tempDir, stdio: 'pipe' });\n \n // Copy the subdirectory to the destination\n const sourcePath = path.join(tempDir, subdirectoryPath);\n if (!fs.existsSync(sourcePath)) {\n throw new Error(`Subdirectory '${subdirectoryPath}' not found in the repository.`);\n }\n \n // Ensure destination directory exists\n fs.mkdirSync(destinationPath, { recursive: true });\n \n spinner.text = chalk.cyan('Installing agent files...');\n \n // Copy the subdirectory to the destination\n await copyDirectoryAsync(sourcePath, destinationPath);\n \n return true;\n } finally {\n // Clean up the temporary directory\n try {\n fs.rmSync(tempDir, { recursive: true, force: true });\n } catch (error) {\n console.warn(`Failed to clean up temporary directory: ${error}`);\n }\n }\n}\n\n/**\n * Recursively copies a directory with async pauses\n */\nasync function copyDirectoryAsync(source: string, destination: string): Promise<void> {\n // Create destination directory if it doesn't exist\n if (!fs.existsSync(destination)) {\n fs.mkdirSync(destination, { recursive: true });\n }\n \n // Read all files/directories from source\n const entries = fs.readdirSync(source, { withFileTypes: true });\n \n for (const entry of entries) {\n const srcPath = path.join(source, entry.name);\n const destPath = path.join(destination, entry.name);\n \n if (entry.isDirectory()) {\n // Recursively copy subdirectories\n await copyDirectoryAsync(srcPath, destPath);\n } else {\n // Copy files\n fs.copyFileSync(srcPath, destPath);\n }\n \n // For large directories, add small pauses\n if (entries.length > 10) {\n await new Promise(resolve => setTimeout(resolve, 1));\n }\n }\n}\n\n/**\n * Parses a GitHub URL to extract owner, repo, branch and subdirectory path\n */\nfunction parseGitHubUrl(githubUrl: string): { \n owner: string; \n repo: string; \n branch: string;\n subdirectoryPath: string;\n} {\n const url = new URL(githubUrl);\n \n if (url.hostname !== 'github.com') {\n throw new Error('Only GitHub URLs are supported');\n }\n \n const pathParts = url.pathname.split('/').filter(Boolean);\n \n if (pathParts.length < 2) {\n throw new Error('Invalid GitHub URL format');\n }\n \n const owner = pathParts[0];\n const repo = pathParts[1];\n let branch = 'main'; // Default branch\n let subdirectoryPath = '';\n \n if (pathParts.length > 3 && (pathParts[2] === 'tree' || pathParts[2] === 'blob')) {\n branch = pathParts[3];\n subdirectoryPath = pathParts.slice(4).join('/');\n }\n \n return { owner, repo, branch, subdirectoryPath };\n}\n\n/**\n * Validates if a string is a valid GitHub URL\n */\nexport function isValidGitHubUrl(url: string): boolean {\n try {\n const parsedUrl = new URL(url);\n return parsedUrl.hostname === 'github.com' && \n parsedUrl.pathname.split('/').filter(Boolean).length >= 2;\n } catch {\n return false;\n }\n}\n","/*\n Currently unusued but will be used in the future once we have more time to think\n about what to use outside of shadcn/ui.\n*/\n\nimport spawn from \"cross-spawn\";\nimport { Config } from \"../types/index.js\";\nimport chalk from \"chalk\";\nimport fs from \"fs\";\nimport ora from \"ora\";\n\ntype PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun';\n\nexport async function scaffoldPackages(userAnswers: Config) {\n const spinner = ora({\n text: chalk.cyan('Preparing to install packages...'),\n color: 'cyan'\n }).start();\n\n try {\n const packages = [\n `@copilotkit/react-ui@${userAnswers.copilotKitVersion}`,\n `@copilotkit/react-core@${userAnswers.copilotKitVersion}`,\n `@copilotkit/runtime@${userAnswers.copilotKitVersion}`,\n ];\n\n // Small pause before starting\n await new Promise(resolve => setTimeout(resolve, 50));\n\n const packageManager = detectPackageManager();\n const installCommand = detectInstallCommand(packageManager);\n \n spinner.text = chalk.cyan(`Using ${packageManager} to install packages...`);\n \n // Pause the spinner for the package installation\n spinner.stop();\n \n console.log(chalk.cyan('\\n⚙️ Installing packages...\\n'));\n \n const result = spawn.sync(packageManager, [installCommand, ...packages], { \n stdio: 'inherit' // This ensures stdin/stdout/stderr are all passed through\n });\n \n if (result.status !== 0) {\n throw new Error(`Package installation process exited with code ${result.status}`);\n }\n \n // Resume the spinner for success message\n spinner.start();\n spinner.succeed(chalk.green('CopilotKit packages installed successfully'));\n } catch (error) {\n // Use spinner for consistent error reporting\n if (!spinner.isSpinning) {\n spinner.start();\n }\n spinner.fail(chalk.red('Failed to install CopilotKit packages'));\n throw error;\n }\n}\n\nfunction detectPackageManager(): PackageManager {\n // Check for lock files in the current directory\n const files = fs.readdirSync(process.cwd());\n \n if (files.includes('bun.lockb')) return 'bun';\n if (files.includes('pnpm-lock.yaml')) return 'pnpm';\n if (files.includes('yarn.lock')) return 'yarn';\n if (files.includes('package-lock.json')) return 'npm';\n\n // Default to npm if no lock file found\n return 'npm';\n}\n\nfunction detectInstallCommand(packageManager: PackageManager): string {\n switch (packageManager) {\n case 'yarn':\n case 'pnpm':\n return 'add';\n default:\n return 'install';\n }\n}"],"mappings":";AAAA,OAAO,WAAW;;;ACAlB,SAAS,aAAa;AAYf,IAAM,mBAAmB,CAAC,UAAU,aAAa,MAAM;AAIvD,IAAM,aAAa,CAAC,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SAAS,uBAAuC;AAE9C,QAAM,QAAQC,IAAG,YAAY,QAAQ,IAAI,CAAC;AAE1C,MAAI,MAAM,SAAS,WAAW,EAAG,QAAO;AACxC,MAAI,MAAM,SAAS,gBAAgB,EAAG,QAAO;AAC7C,MAAI,MAAM,SAAS,WAAW,EAAG,QAAO;AACxC,MAAI,MAAM,SAAS,mBAAmB,EAAG,QAAO;AAGhD,SAAO;AACT;AAEA,SAAS,qBAAqB,gBAAwC;AACpE,UAAQ,gBAAgB;AAAA,IACtB,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;","names":["fs","path","chalk","ora","spawn","chalk","fs","ora"]}
1
+ {"version":3,"sources":["../../../../src/lib/init/scaffold/shadcn.ts","../../../../src/lib/init/types/questions.ts","../../../../src/lib/init/types/templates.ts","../../../../src/lib/init/scaffold/env.ts","../../../../src/lib/init/scaffold/github.ts","../../../../src/lib/init/scaffold/packages.ts","../../../../src/lib/init/scaffold/agent.ts"],"sourcesContent":["import spawn from \"cross-spawn\"\nimport { \n templateMapping, \n Config \n} from \"../types/index.js\"\n\nexport async function scaffoldShadCN(userAnswers: Config) {\n try {\n // Determine which components to install based on user choices\n const components: string[] = []\n \n // Add additional components based on agent framework\n if (userAnswers.agentFramework !== 'None') {\n switch (userAnswers.agentFramework) {\n case 'LangGraph':\n components.push(templateMapping.LangGraphPlatform)\n break\n case 'CrewAI':\n if (userAnswers.crewType === 'Crews') {\n components.push(...templateMapping.CrewEnterprise)\n } else if (userAnswers.crewFlowAgent) {\n components.push(...templateMapping.CrewFlowsStarter)\n } else {\n components.push(templateMapping.RemoteEndpoint)\n }\n break\n default:\n components.push(templateMapping.RemoteEndpoint)\n break\n }\n }\n \n // Small pause before running shadcn\n await new Promise(resolve => setTimeout(resolve, 100));\n \n try {\n // Run shadcn with inherited stdio for all streams to allow for user input\n const result = spawn.sync('npx', ['shadcn@latest', 'add', ...components], { \n stdio: 'inherit' // This ensures stdin/stdout/stderr are all passed through\n });\n \n if (result.status !== 0) {\n throw new Error(`The shadcn installation process exited with code ${result.status}`);\n }\n } catch (error) {\n throw error;\n }\n } catch (error) {\n throw error;\n }\n}","import { Flags } from \"@oclif/core\"\n\nexport type Question = {\n type: 'input' | 'yes/no' | 'select'\n name: Fields\n message: string\n choices?: string[]\n default?: string\n when?: (answers: Record<string, any>) => boolean\n sensitive?: boolean\n}\n\n// Agent framework options\nexport const AGENT_FRAMEWORKS = ['CrewAI', 'LangGraph', 'None'] as const;\nexport type AgentFramework = typeof AGENT_FRAMEWORKS[number];\n\n// CrewAI types\nexport const CREW_TYPES = ['Crews', 'Flows'] as const;\nexport type CrewType = typeof CREW_TYPES[number];\n\n// UI component options\nexport const CHAT_COMPONENTS = ['CopilotChat','CopilotSidebar', 'Headless', 'CopilotPopup'] as const;\nexport type ChatComponent = typeof CHAT_COMPONENTS[number];\n\n// LangGraph agent types\nexport const LANGGRAPH_AGENTS = ['Python Starter', 'TypeScript Starter', 'None'] as const;\nexport type LangGraphAgent = typeof LANGGRAPH_AGENTS[number];\n\n// CrewAI Flow templates\nexport const CREW_FLOW_TEMPLATES = ['Starter', 'None'] as const;\nexport type CrewFlowTemplate = typeof CREW_FLOW_TEMPLATES[number];\n\n// Yes/No type for consistent options\nexport type YesNo = 'Yes' | 'No';\n\n// All possible field names for questions\nexport type Fields = \n \"copilotKitVersion\" | \n \"agentFramework\" | \n \"alreadyDeployed\" |\n \"fastApiEnabled\" | \n \"useCopilotCloud\" | \n \"chatUi\" | \n \"langGraphAgent\" | \n \"langGraphPlatform\" |\n \"langGraphPlatformUrl\" | \n \"crewType\" | \n \"crewName\" | \n \"langGraphRemoteEndpointURL\" |\n \"crewUrl\" | \n \"crewBearerToken\" | \n \"langSmithApiKey\" | \n \"llmToken\" |\n \"crewFlowAgent\";\n\n// Complete configuration shape that holds all possible answers\nexport interface Config {\n copilotKitVersion: string;\n agentFramework: AgentFramework;\n alreadyDeployed?: YesNo;\n fastApiEnabled?: YesNo;\n useCopilotCloud?: YesNo;\n chatUi: ChatComponent;\n\n // LangGraph\n langGraphAgent?: LangGraphAgent;\n langGraphPlatform?: YesNo;\n langGraphPlatformUrl?: string;\n langGraphRemoteEndpointURL?: string;\n\n // CrewAI\n crewType?: CrewType;\n crewName?: string;\n crewUrl?: string;\n crewBearerToken?: string;\n crewFlowAgent?: string;\n\n // API keys and tokens\n copilotCloudPublicApiKey?: string;\n langSmithApiKey?: string;\n llmToken?: string;\n}\n\n// CLI flags definition - single source of truth for flag descriptions\nexport const ConfigFlags = {\n copilotKitVersion: Flags.string({description: 'CopilotKit version to use (e.g. 1.7.0)'}),\n agentFramework: Flags.string({description: 'Agent framework to power your copilot', options: AGENT_FRAMEWORKS}),\n fastApiEnabled: Flags.string({description: 'Use FastAPI to serve your agent locally', options: ['Yes', 'No']}),\n useCopilotCloud: Flags.string({description: 'Use Copilot Cloud for production-ready hosting', options: ['Yes', 'No']}),\n chatUi: Flags.string({description: 'Chat UI component to add to your app', options: CHAT_COMPONENTS}),\n langGraphAgent: Flags.string({description: 'LangGraph agent template to use', options: LANGGRAPH_AGENTS}),\n crewType: Flags.string({description: 'CrewAI implementation type', options: CREW_TYPES}),\n crewName: Flags.string({description: 'Name for your CrewAI agent'}),\n crewUrl: Flags.string({description: 'URL endpoint for your CrewAI agent'}),\n crewBearerToken: Flags.string({description: 'Bearer token for CrewAI authentication'}),\n langSmithApiKey: Flags.string({description: 'LangSmith API key for LangGraph observability'}),\n llmToken: Flags.string({description: 'API key for your preferred LLM provider'}),\n crewFlowAgent: Flags.string({description: 'CrewAI Flow template to use', options: CREW_FLOW_TEMPLATES}),\n}","export type ChatTemplate = \n \"CopilotChat\" |\n \"CopilotPopup\" |\n \"CopilotSidebar\"\n\nexport type StarterTemplate = \n \"LangGraphPlatform\" |\n \"RemoteEndpoint\" |\n \"Standard\" |\n \"CrewEnterprise\" |\n \"CrewFlowsStarter\"\n\nexport type Template = ChatTemplate | StarterTemplate\n\nconst BASE_URL = \"http://registry.copilotkit.ai/r\"\n\nexport const templateMapping = {\n \"LangGraphPlatform\": `${BASE_URL}/langgraph-platform-starter.json`,\n \"RemoteEndpoint\": `${BASE_URL}/remote-endpoint-starter.json`,\n \"CrewEnterprise\": [\n `${BASE_URL}/coagents-crew-starter.json`,\n ],\n\n \"CrewFlowsStarter\": [\n `${BASE_URL}/coagents-starter-ui.json`,\n `${BASE_URL}/agent-layout.json`,\n `${BASE_URL}/remote-endpoint.json`\n ],\n\n \"Standard\": `${BASE_URL}/standard-starter.json`,\n \"CopilotChat\": `${BASE_URL}/chat.json`,\n \"CopilotPopup\": `${BASE_URL}/popup.json`,\n \"CopilotSidebar\": `${BASE_URL}/sidebar.json`,\n}","import path from \"path\"\nimport fs from \"fs\"\nimport { Config } from \"../types/index.js\"\nimport chalk from \"chalk\"\nimport ora from \"ora\"\n\nexport async function scaffoldEnv(flags: any, userAnswers: Config) {\n const spinner = ora({\n text: chalk.cyan('Configuring environment variables...'),\n color: 'cyan'\n }).start();\n\n try {\n // Define the env file path\n const envFile = path.join(process.cwd(), '.env')\n \n // Create the env file if it doesn't exist\n if (!fs.existsSync(envFile)) {\n fs.writeFileSync(envFile, '', 'utf8')\n spinner.text = chalk.cyan('Created .env file...');\n } else {\n spinner.text = chalk.cyan('Updating existing .env file...');\n }\n \n // Build environment variables based on user selections\n let newEnvValues = ''\n let varsAdded = false;\n \n // Copilot Cloud API key\n if (userAnswers.copilotCloudPublicApiKey) {\n newEnvValues += `NEXT_PUBLIC_COPILOT_API_KEY=${userAnswers.copilotCloudPublicApiKey}\\n`\n spinner.text = chalk.cyan('Adding Copilot Cloud API key...');\n varsAdded = true;\n }\n \n // LangSmith API key (for LangGraph)\n if (userAnswers.langSmithApiKey) {\n // Add both formats for compatibility\n newEnvValues += `LANGSMITH_API_KEY=${userAnswers.langSmithApiKey}\\n`\n spinner.text = chalk.cyan('Adding LangSmith API key...');\n varsAdded = true;\n }\n \n // LLM API key - set as both LLM_TOKEN and OPENAI_API_KEY for compatibility\n if (userAnswers.llmToken) {\n newEnvValues += `LLM_TOKEN=${userAnswers.llmToken}\\n`\n newEnvValues += `OPENAI_API_KEY=${userAnswers.llmToken}\\n`\n spinner.text = chalk.cyan('Adding OpenAI API key...');\n varsAdded = true;\n }\n \n // CrewAI name\n if (userAnswers.crewName) {\n newEnvValues += `NEXT_PUBLIC_COPILOTKIT_AGENT_NAME=${userAnswers.crewName}\\n`\n spinner.text = chalk.cyan('Adding Crew agent name...');\n varsAdded = true;\n }\n \n // Runtime URL if provided via flags\n if (flags.runtimeUrl) {\n newEnvValues += `NEXT_PUBLIC_COPILOTKIT_RUNTIME_URL=${flags.runtimeUrl}\\n`\n spinner.text = chalk.cyan('Adding runtime URL...');\n varsAdded = true;\n }\n \n if (!varsAdded) {\n spinner.text = chalk.cyan('No environment variables needed...');\n }\n \n // Append the variables to the .env file\n if (newEnvValues) {\n fs.appendFileSync(envFile, newEnvValues)\n spinner.succeed(chalk('Environment variables configured successfully'));\n } else {\n spinner.info(chalk.yellow('No environment variables were added'));\n }\n } catch (error) {\n spinner.fail(chalk.red('Failed to update environment variables'));\n throw error;\n }\n}\n","import { execSync } from 'child_process';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as os from 'os';\nimport { Config } from '../types/index.js';\nimport chalk from \"chalk\"\nimport ora, {Ora} from \"ora\";\n\n/**\n * Clones a specific subdirectory from a GitHub repository\n * \n * @param githubUrl - The GitHub URL to the repository or subdirectory\n * @param destinationPath - The local path where the content should be copied\n * @param spinner - The spinner to update with progress information\n * @returns A boolean indicating success or failure\n */\nexport async function cloneGitHubSubdirectory(\n githubUrl: string,\n destinationPath: string,\n spinner: Ora\n): Promise<boolean> {\n try {\n // Parse the GitHub URL to extract repo info\n const { owner, repo, branch, subdirectoryPath } = parseGitHubUrl(githubUrl);\n \n spinner.text = chalk.cyan(`Cloning from ${owner}/${repo}...`);\n \n // Method 1: Use sparse checkout (more efficient than full clone)\n return await sparseCheckout(owner, repo, branch, subdirectoryPath, destinationPath, spinner);\n } catch (error) {\n spinner.text = chalk.red(`Failed to clone from GitHub: ${error}`);\n return false;\n }\n}\n\n/**\n * Uses Git sparse-checkout to efficiently download only the needed subdirectory\n */\nasync function sparseCheckout(\n owner: string,\n repo: string,\n branch: string,\n subdirectoryPath: string,\n destinationPath: string,\n spinner: Ora\n): Promise<boolean> {\n const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'copilotkit-sparse-'));\n \n try {\n spinner.text = chalk.cyan('Creating temporary workspace...');\n \n // Initialize git repo\n execSync('git init', { cwd: tempDir, stdio: 'pipe' });\n \n spinner.text = chalk.cyan('Connecting to repository...');\n \n // Add remote\n execSync(`git remote add origin https://github.com/${owner}/${repo}.git`, { cwd: tempDir, stdio: 'pipe' });\n \n // Enable sparse checkout\n execSync('git config core.sparseCheckout true', { cwd: tempDir, stdio: 'pipe' });\n \n // Specify which subdirectory to checkout\n fs.writeFileSync(path.join(tempDir, '.git/info/sparse-checkout'), subdirectoryPath);\n \n spinner.text = chalk.cyan('Downloading agent files...');\n \n // Pull only the specified branch\n execSync(`git pull origin ${branch} --depth=1`, { cwd: tempDir, stdio: 'pipe' });\n \n // Copy the subdirectory to the destination\n const sourcePath = path.join(tempDir, subdirectoryPath);\n if (!fs.existsSync(sourcePath)) {\n throw new Error(`Subdirectory '${subdirectoryPath}' not found in the repository.`);\n }\n \n // Ensure destination directory exists\n fs.mkdirSync(destinationPath, { recursive: true });\n \n spinner.text = chalk.cyan('Installing agent files...');\n \n // Copy the subdirectory to the destination\n await copyDirectoryAsync(sourcePath, destinationPath);\n \n return true;\n } finally {\n // Clean up the temporary directory\n try {\n fs.rmSync(tempDir, { recursive: true, force: true });\n } catch (error) {\n console.warn(`Failed to clean up temporary directory: ${error}`);\n }\n }\n}\n\n/**\n * Recursively copies a directory with async pauses\n */\nasync function copyDirectoryAsync(source: string, destination: string): Promise<void> {\n // Create destination directory if it doesn't exist\n if (!fs.existsSync(destination)) {\n fs.mkdirSync(destination, { recursive: true });\n }\n \n // Read all files/directories from source\n const entries = fs.readdirSync(source, { withFileTypes: true });\n \n for (const entry of entries) {\n const srcPath = path.join(source, entry.name);\n const destPath = path.join(destination, entry.name);\n \n if (entry.isDirectory()) {\n // Recursively copy subdirectories\n await copyDirectoryAsync(srcPath, destPath);\n } else {\n // Copy files\n fs.copyFileSync(srcPath, destPath);\n }\n \n // For large directories, add small pauses\n if (entries.length > 10) {\n await new Promise(resolve => setTimeout(resolve, 1));\n }\n }\n}\n\n/**\n * Parses a GitHub URL to extract owner, repo, branch and subdirectory path\n */\nfunction parseGitHubUrl(githubUrl: string): { \n owner: string; \n repo: string; \n branch: string;\n subdirectoryPath: string;\n} {\n const url = new URL(githubUrl);\n \n if (url.hostname !== 'github.com') {\n throw new Error('Only GitHub URLs are supported');\n }\n \n const pathParts = url.pathname.split('/').filter(Boolean);\n \n if (pathParts.length < 2) {\n throw new Error('Invalid GitHub URL format');\n }\n \n const owner = pathParts[0];\n const repo = pathParts[1];\n let branch = 'main'; // Default branch\n let subdirectoryPath = '';\n \n if (pathParts.length > 3 && (pathParts[2] === 'tree' || pathParts[2] === 'blob')) {\n branch = pathParts[3];\n subdirectoryPath = pathParts.slice(4).join('/');\n }\n \n return { owner, repo, branch, subdirectoryPath };\n}\n\n/**\n * Validates if a string is a valid GitHub URL\n */\nexport function isValidGitHubUrl(url: string): boolean {\n try {\n const parsedUrl = new URL(url);\n return parsedUrl.hostname === 'github.com' && \n parsedUrl.pathname.split('/').filter(Boolean).length >= 2;\n } catch {\n return false;\n }\n}\n","/*\n Currently unusued but will be used in the future once we have more time to think\n about what to use outside of shadcn/ui.\n*/\n\nimport spawn from \"cross-spawn\";\nimport { Config } from \"../types/index.js\";\nimport chalk from \"chalk\";\nimport fs from \"fs\";\nimport ora from \"ora\";\n\ntype PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun';\n\nexport async function scaffoldPackages(userAnswers: Config) {\n const spinner = ora({\n text: chalk.cyan('Preparing to install packages...'),\n color: 'cyan'\n }).start();\n\n try {\n const packages = [\n `@copilotkit/react-ui@${userAnswers.copilotKitVersion}`,\n `@copilotkit/react-core@${userAnswers.copilotKitVersion}`,\n `@copilotkit/runtime@${userAnswers.copilotKitVersion}`,\n ];\n\n // Small pause before starting\n await new Promise(resolve => setTimeout(resolve, 50));\n\n const packageManager = detectPackageManager();\n const installCommand = detectInstallCommand(packageManager);\n \n spinner.text = chalk.cyan(`Using ${packageManager} to install packages...`);\n \n // Pause the spinner for the package installation\n spinner.stop();\n \n console.log(chalk.cyan('\\n⚙️ Installing packages...\\n'));\n \n const result = spawn.sync(packageManager, [installCommand, ...packages], { \n stdio: 'inherit' // This ensures stdin/stdout/stderr are all passed through\n });\n \n if (result.status !== 0) {\n throw new Error(`Package installation process exited with code ${result.status}`);\n }\n \n // Resume the spinner for success message\n spinner.start();\n spinner.succeed(chalk.green('CopilotKit packages installed successfully'));\n } catch (error) {\n // Use spinner for consistent error reporting\n if (!spinner.isSpinning) {\n spinner.start();\n }\n spinner.fail(chalk.red('Failed to install CopilotKit packages'));\n throw error;\n }\n}\n\nfunction detectPackageManager(): PackageManager {\n // Check for lock files in the current directory\n const files = fs.readdirSync(process.cwd());\n \n if (files.includes('bun.lockb')) return 'bun';\n if (files.includes('pnpm-lock.yaml')) return 'pnpm';\n if (files.includes('yarn.lock')) return 'yarn';\n if (files.includes('package-lock.json')) return 'npm';\n\n // Default to npm if no lock file found\n return 'npm';\n}\n\nfunction detectInstallCommand(packageManager: PackageManager): string {\n switch (packageManager) {\n case 'yarn':\n case 'pnpm':\n return 'add';\n default:\n return 'install';\n }\n}","import ora from \"ora\"\nimport chalk from \"chalk\"\nimport { cloneGitHubSubdirectory } from \"./github.js\"\nimport { Config } from \"../types/index.js\"\nimport path from \"path\"\nimport fs from \"fs\"\n\nexport async function scaffoldAgent(userAnswers: Config) {\n // Skip if no agent framework or using CrewAI Crews (which are handled by cloud)\n if (userAnswers.agentFramework === 'None' || \n (userAnswers.agentFramework === 'CrewAI' && userAnswers.crewType === 'Crews') ||\n (userAnswers.agentFramework === 'LangGraph' && (!userAnswers.langGraphAgent || userAnswers.langGraphAgent === 'None'))) {\n return;\n }\n \n const spinner = ora({\n text: chalk.cyan('Setting up AI agent...'),\n color: 'cyan'\n }).start();\n\n let template = \"\";\n switch (userAnswers.agentFramework) {\n case 'LangGraph':\n if (userAnswers.langGraphAgent === 'Python Starter') {\n template = AgentTemplates.LangGraph.Starter.Python;\n } else {\n template = AgentTemplates.LangGraph.Starter.TypeScript;\n }\n break;\n case 'CrewAI':\n if (userAnswers.crewFlowAgent === 'Starter') {\n template = AgentTemplates.CrewAI.Flows.Starter;\n }\n break;\n }\n\n if (!template) {\n spinner.fail(chalk.red('Failed to determine agent template'));\n throw new Error('Failed to determine agent template');\n }\n\n const agentDir = path.join(process.cwd(), 'agent');\n\n try {\n await cloneGitHubSubdirectory(\n template, \n agentDir,\n spinner\n );\n\n // Create .env file in the agent directory\n spinner.text = chalk.cyan('Creating agent environment variables...');\n \n let envContent = '';\n \n // Add OpenAI API key if provided\n if (userAnswers.llmToken) {\n envContent += `OPENAI_API_KEY=${userAnswers.llmToken}\\n`;\n }\n \n // Add LangSmith API key for LangGraph\n if (userAnswers.agentFramework === 'LangGraph' && userAnswers.langSmithApiKey) {\n envContent += `LANGSMITH_API_KEY=${userAnswers.langSmithApiKey}\\n`;\n }\n \n if (envContent) {\n const agentEnvFile = path.join(agentDir, '.env');\n fs.writeFileSync(agentEnvFile, envContent, 'utf8');\n spinner.text = chalk.cyan('Added API keys to agent .env file');\n }\n\n } catch (error) {\n spinner.fail(chalk.red('Failed to clone agent template'));\n throw error;\n }\n\n spinner.succeed(chalk.green(`${userAnswers.agentFramework} agent cloned successfully`));\n}\n\nexport const AgentTemplates = {\n LangGraph: {\n Starter: {\n Python: 'https://github.com/CopilotKit/CopilotKit/tree/main/examples/coagents-starter/agent-py',\n TypeScript: 'https://github.com/CopilotKit/CopilotKit/tree/main/examples/coagents-starter/agent-js',\n }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iBAAiB;AAAA,EAC5B,WAAW;AAAA,IACT,SAAS;AAAA,MACP,QAAQ;AAAA,MACR,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EACA,QAAQ;AAAA,IACN,OAAO;AAAA,MACL,SAAS;AAAA,IACX;AAAA,EACF;AACF;","names":["fs","path","chalk","spawn","chalk","fs","ora","ora","chalk","path","fs","ora","chalk"]}
@@ -7,6 +7,7 @@ var AGENT_FRAMEWORKS = ["CrewAI", "LangGraph", "None"];
7
7
  var CREW_TYPES = ["Crews", "Flows"];
8
8
  var CHAT_COMPONENTS = ["CopilotChat", "CopilotSidebar", "Headless", "CopilotPopup"];
9
9
  var LANGGRAPH_AGENTS = ["Python Starter", "TypeScript Starter", "None"];
10
+ var CREW_FLOW_TEMPLATES = ["Starter", "None"];
10
11
  var ConfigFlags = {
11
12
  copilotKitVersion: Flags.string({ description: "CopilotKit version to use (e.g. 1.7.0)" }),
12
13
  agentFramework: Flags.string({ description: "Agent framework to power your copilot", options: AGENT_FRAMEWORKS }),
@@ -19,7 +20,8 @@ var ConfigFlags = {
19
20
  crewUrl: Flags.string({ description: "URL endpoint for your CrewAI agent" }),
20
21
  crewBearerToken: Flags.string({ description: "Bearer token for CrewAI authentication" }),
21
22
  langSmithApiKey: Flags.string({ description: "LangSmith API key for LangGraph observability" }),
22
- llmToken: Flags.string({ description: "API key for your preferred LLM provider" })
23
+ llmToken: Flags.string({ description: "API key for your preferred LLM provider" }),
24
+ crewFlowAgent: Flags.string({ description: "CrewAI Flow template to use", options: CREW_FLOW_TEMPLATES })
23
25
  };
24
26
 
25
27
  // src/lib/init/types/templates.ts
@@ -27,7 +29,14 @@ var BASE_URL = "http://registry.copilotkit.ai/r";
27
29
  var templateMapping = {
28
30
  "LangGraphPlatform": `${BASE_URL}/langgraph-platform-starter.json`,
29
31
  "RemoteEndpoint": `${BASE_URL}/remote-endpoint-starter.json`,
30
- "CrewEnterprise": `${BASE_URL}/agent-layout.json`,
32
+ "CrewEnterprise": [
33
+ `${BASE_URL}/coagents-crew-starter.json`
34
+ ],
35
+ "CrewFlowsStarter": [
36
+ `${BASE_URL}/coagents-starter-ui.json`,
37
+ `${BASE_URL}/agent-layout.json`,
38
+ `${BASE_URL}/remote-endpoint.json`
39
+ ],
31
40
  "Standard": `${BASE_URL}/standard-starter.json`,
32
41
  "CopilotChat": `${BASE_URL}/chat.json`,
33
42
  "CopilotPopup": `${BASE_URL}/popup.json`,
@@ -37,9 +46,7 @@ var templateMapping = {
37
46
  // src/lib/init/scaffold/shadcn.ts
38
47
  async function scaffoldShadCN(userAnswers) {
39
48
  try {
40
- const components = [
41
- templateMapping[userAnswers.chatUi]
42
- ];
49
+ const components = [];
43
50
  if (userAnswers.agentFramework !== "None") {
44
51
  switch (userAnswers.agentFramework) {
45
52
  case "LangGraph":
@@ -47,7 +54,9 @@ async function scaffoldShadCN(userAnswers) {
47
54
  break;
48
55
  case "CrewAI":
49
56
  if (userAnswers.crewType === "Crews") {
50
- components.push(templateMapping.CrewEnterprise);
57
+ components.push(...templateMapping.CrewEnterprise);
58
+ } else if (userAnswers.crewFlowAgent) {
59
+ components.push(...templateMapping.CrewFlowsStarter);
51
60
  } else {
52
61
  components.push(templateMapping.RemoteEndpoint);
53
62
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/init/scaffold/shadcn.ts","../../../../src/lib/init/types/questions.ts","../../../../src/lib/init/types/templates.ts"],"sourcesContent":["import spawn from \"cross-spawn\"\nimport { \n templateMapping, \n ChatTemplate, \n Config \n} from \"../types/index.js\"\n\nexport async function scaffoldShadCN(userAnswers: Config) {\n try {\n // Determine which components to install based on user choices\n const components = [\n templateMapping[userAnswers.chatUi as ChatTemplate]\n ]\n \n // Add additional components based on agent framework\n if (userAnswers.agentFramework !== 'None') {\n switch (userAnswers.agentFramework) {\n case 'LangGraph':\n components.push(templateMapping.LangGraphPlatform)\n break\n case 'CrewAI':\n if (userAnswers.crewType === 'Crews') {\n components.push(templateMapping.CrewEnterprise)\n } else {\n components.push(templateMapping.RemoteEndpoint)\n }\n break\n default:\n components.push(templateMapping.RemoteEndpoint)\n break\n }\n }\n \n // Small pause before running shadcn\n await new Promise(resolve => setTimeout(resolve, 100));\n \n try {\n // Run shadcn with inherited stdio for all streams to allow for user input\n const result = spawn.sync('npx', ['shadcn@latest', 'add', ...components], { \n stdio: 'inherit' // This ensures stdin/stdout/stderr are all passed through\n });\n \n if (result.status !== 0) {\n throw new Error(`The shadcn installation process exited with code ${result.status}`);\n }\n } catch (error) {\n throw error;\n }\n } catch (error) {\n throw error;\n }\n}","import { Flags } from \"@oclif/core\"\n\nexport type Question = {\n type: 'input' | 'yes/no' | 'select'\n name: Fields\n message: string\n choices?: string[]\n default?: string\n when?: (answers: Record<string, any>) => boolean\n}\n\n// Agent framework options\nexport const AGENT_FRAMEWORKS = ['CrewAI', 'LangGraph', 'None'] as const;\nexport type AgentFramework = typeof AGENT_FRAMEWORKS[number];\n\n// CrewAI types\nexport const CREW_TYPES = ['Crews', 'Flows'] as const;\nexport type CrewType = typeof CREW_TYPES[number];\n\n// UI component options\nexport const CHAT_COMPONENTS = ['CopilotChat','CopilotSidebar', 'Headless', 'CopilotPopup'] as const;\nexport type ChatComponent = typeof CHAT_COMPONENTS[number];\n\n// LangGraph agent types\nexport const LANGGRAPH_AGENTS = ['Python Starter', 'TypeScript Starter', 'None'] as const;\nexport type LangGraphAgent = typeof LANGGRAPH_AGENTS[number];\n\n// Yes/No type for consistent options\nexport type YesNo = 'Yes' | 'No';\n\n// All possible field names for questions\nexport type Fields = \n \"copilotKitVersion\" | \n \"agentFramework\" | \n \"alreadyDeployed\" |\n \"fastApiEnabled\" | \n \"useCopilotCloud\" | \n \"chatUi\" | \n \"langGraphAgent\" | \n \"langGraphPlatform\" |\n \"langGraphPlatformUrl\" | \n \"crewType\" | \n \"crewName\" | \n \"langGraphRemoteEndpointURL\" |\n \"crewUrl\" | \n \"crewBearerToken\" | \n \"langSmithApiKey\" | \n \"llmToken\";\n\n// Complete configuration shape that holds all possible answers\nexport interface Config {\n copilotKitVersion: string;\n agentFramework: AgentFramework;\n alreadyDeployed?: YesNo;\n fastApiEnabled?: YesNo;\n useCopilotCloud?: YesNo;\n chatUi: ChatComponent;\n\n // LangGraph\n langGraphAgent?: LangGraphAgent;\n langGraphPlatform?: YesNo;\n langGraphPlatformUrl?: string;\n langGraphRemoteEndpointURL?: string;\n\n // CrewAI\n crewType?: CrewType;\n crewName?: string;\n crewUrl?: string;\n crewBearerToken?: string;\n\n // API keys and tokens\n copilotCloudPublicApiKey?: string;\n langSmithApiKey?: string;\n llmToken?: string;\n}\n\n// CLI flags definition - single source of truth for flag descriptions\nexport const ConfigFlags = {\n copilotKitVersion: Flags.string({description: 'CopilotKit version to use (e.g. 1.7.0)'}),\n agentFramework: Flags.string({description: 'Agent framework to power your copilot', options: AGENT_FRAMEWORKS}),\n fastApiEnabled: Flags.string({description: 'Use FastAPI to serve your agent locally', options: ['Yes', 'No']}),\n useCopilotCloud: Flags.string({description: 'Use Copilot Cloud for production-ready hosting', options: ['Yes', 'No']}),\n chatUi: Flags.string({description: 'Chat UI component to add to your app', options: CHAT_COMPONENTS}),\n langGraphAgent: Flags.string({description: 'LangGraph agent template to use', options: LANGGRAPH_AGENTS}),\n crewType: Flags.string({description: 'CrewAI implementation type', options: CREW_TYPES}),\n crewName: Flags.string({description: 'Name for your CrewAI agent'}),\n crewUrl: Flags.string({description: 'URL endpoint for your CrewAI agent'}),\n crewBearerToken: Flags.string({description: 'Bearer token for CrewAI authentication'}),\n langSmithApiKey: Flags.string({description: 'LangSmith API key for LangGraph observability'}),\n llmToken: Flags.string({description: 'API key for your preferred LLM provider'}),\n}","export type ChatTemplate = \n \"CopilotChat\" |\n \"CopilotPopup\" |\n \"CopilotSidebar\"\n\nexport type StarterTemplate = \n \"LangGraphPlatform\" |\n \"RemoteEndpoint\" |\n \"Standard\" |\n \"CrewEnterprise\"\n\nexport type Template = ChatTemplate | StarterTemplate\n\nconst BASE_URL = \"http://registry.copilotkit.ai/r\"\n\nexport const templateMapping: Record<Template, string> = {\n \"LangGraphPlatform\": `${BASE_URL}/langgraph-platform-starter.json`,\n \"RemoteEndpoint\": `${BASE_URL}/remote-endpoint-starter.json`,\n \"CrewEnterprise\": `${BASE_URL}/agent-layout.json`,\n\n \"Standard\": `${BASE_URL}/standard-starter.json`,\n \"CopilotChat\": `${BASE_URL}/chat.json`,\n \"CopilotPopup\": `${BASE_URL}/popup.json`,\n \"CopilotSidebar\": `${BASE_URL}/sidebar.json`,\n}"],"mappings":";AAAA,OAAO,WAAW;;;ACAlB,SAAS,aAAa;AAYf,IAAM,mBAAmB,CAAC,UAAU,aAAa,MAAM;AAIvD,IAAM,aAAa,CAAC,SAAS,OAAO;AAIpC,IAAM,kBAAkB,CAAC,eAAc,kBAAkB,YAAY,cAAc;AAInF,IAAM,mBAAmB,CAAC,kBAAkB,sBAAsB,MAAM;AAqDxE,IAAM,cAAc;AAAA,EACzB,mBAAmB,MAAM,OAAO,EAAC,aAAa,yCAAwC,CAAC;AAAA,EACvF,gBAAgB,MAAM,OAAO,EAAC,aAAa,yCAAyC,SAAS,iBAAgB,CAAC;AAAA,EAC9G,gBAAgB,MAAM,OAAO,EAAC,aAAa,2CAA2C,SAAS,CAAC,OAAO,IAAI,EAAC,CAAC;AAAA,EAC7G,iBAAiB,MAAM,OAAO,EAAC,aAAa,kDAAkD,SAAS,CAAC,OAAO,IAAI,EAAC,CAAC;AAAA,EACrH,QAAQ,MAAM,OAAO,EAAC,aAAa,wCAAwC,SAAS,gBAAe,CAAC;AAAA,EACpG,gBAAgB,MAAM,OAAO,EAAC,aAAa,mCAAmC,SAAS,iBAAgB,CAAC;AAAA,EACxG,UAAU,MAAM,OAAO,EAAC,aAAa,8BAA8B,SAAS,WAAU,CAAC;AAAA,EACvF,UAAU,MAAM,OAAO,EAAC,aAAa,6BAA4B,CAAC;AAAA,EAClE,SAAS,MAAM,OAAO,EAAC,aAAa,qCAAoC,CAAC;AAAA,EACzE,i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S,OAAO;AACd,UAAM;AAAA,EACR;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/lib/init/scaffold/shadcn.ts","../../../../src/lib/init/types/questions.ts","../../../../src/lib/init/types/templates.ts"],"sourcesContent":["import spawn from \"cross-spawn\"\nimport { \n templateMapping, \n Config \n} from \"../types/index.js\"\n\nexport async function scaffoldShadCN(userAnswers: Config) {\n try {\n // Determine which components to install based on user choices\n const components: string[] = []\n \n // Add additional components based on agent framework\n if (userAnswers.agentFramework !== 'None') {\n switch (userAnswers.agentFramework) {\n case 'LangGraph':\n components.push(templateMapping.LangGraphPlatform)\n break\n case 'CrewAI':\n if (userAnswers.crewType === 'Crews') {\n components.push(...templateMapping.CrewEnterprise)\n } else if (userAnswers.crewFlowAgent) {\n components.push(...templateMapping.CrewFlowsStarter)\n } else {\n components.push(templateMapping.RemoteEndpoint)\n }\n break\n default:\n components.push(templateMapping.RemoteEndpoint)\n break\n }\n }\n \n // Small pause before running shadcn\n await new Promise(resolve => setTimeout(resolve, 100));\n \n try {\n // Run shadcn with inherited stdio for all streams to allow for user input\n const result = spawn.sync('npx', ['shadcn@latest', 'add', ...components], { \n stdio: 'inherit' // This ensures stdin/stdout/stderr are all passed through\n });\n \n if (result.status !== 0) {\n throw new Error(`The shadcn installation process exited with code ${result.status}`);\n }\n } catch (error) {\n throw error;\n }\n } catch (error) {\n throw error;\n }\n}","import { Flags } from \"@oclif/core\"\n\nexport type Question = {\n type: 'input' | 'yes/no' | 'select'\n name: Fields\n message: string\n choices?: string[]\n default?: string\n when?: (answers: Record<string, any>) => boolean\n sensitive?: boolean\n}\n\n// Agent framework options\nexport const AGENT_FRAMEWORKS = ['CrewAI', 'LangGraph', 'None'] as const;\nexport type AgentFramework = typeof AGENT_FRAMEWORKS[number];\n\n// CrewAI types\nexport const CREW_TYPES = ['Crews', 'Flows'] as const;\nexport type CrewType = typeof CREW_TYPES[number];\n\n// UI component options\nexport const CHAT_COMPONENTS = ['CopilotChat','CopilotSidebar', 'Headless', 'CopilotPopup'] as const;\nexport type ChatComponent = typeof CHAT_COMPONENTS[number];\n\n// LangGraph agent types\nexport const LANGGRAPH_AGENTS = ['Python Starter', 'TypeScript Starter', 'None'] as const;\nexport type LangGraphAgent = typeof LANGGRAPH_AGENTS[number];\n\n// CrewAI Flow templates\nexport const CREW_FLOW_TEMPLATES = ['Starter', 'None'] as const;\nexport type CrewFlowTemplate = typeof CREW_FLOW_TEMPLATES[number];\n\n// Yes/No type for consistent options\nexport type YesNo = 'Yes' | 'No';\n\n// All possible field names for questions\nexport type Fields = \n \"copilotKitVersion\" | \n \"agentFramework\" | \n \"alreadyDeployed\" |\n \"fastApiEnabled\" | \n \"useCopilotCloud\" | \n \"chatUi\" | \n \"langGraphAgent\" | \n \"langGraphPlatform\" |\n \"langGraphPlatformUrl\" | \n \"crewType\" | \n \"crewName\" | \n \"langGraphRemoteEndpointURL\" |\n \"crewUrl\" | \n \"crewBearerToken\" | \n \"langSmithApiKey\" | \n \"llmToken\" |\n \"crewFlowAgent\";\n\n// Complete configuration shape that holds all possible answers\nexport interface Config {\n copilotKitVersion: string;\n agentFramework: AgentFramework;\n alreadyDeployed?: YesNo;\n fastApiEnabled?: YesNo;\n useCopilotCloud?: YesNo;\n chatUi: ChatComponent;\n\n // LangGraph\n langGraphAgent?: LangGraphAgent;\n langGraphPlatform?: YesNo;\n langGraphPlatformUrl?: string;\n langGraphRemoteEndpointURL?: string;\n\n // CrewAI\n crewType?: CrewType;\n crewName?: string;\n crewUrl?: string;\n crewBearerToken?: string;\n crewFlowAgent?: string;\n\n // API keys and tokens\n copilotCloudPublicApiKey?: string;\n langSmithApiKey?: string;\n llmToken?: string;\n}\n\n// CLI flags definition - single source of truth for flag descriptions\nexport const ConfigFlags = {\n copilotKitVersion: Flags.string({description: 'CopilotKit version to use (e.g. 1.7.0)'}),\n agentFramework: Flags.string({description: 'Agent framework to power your copilot', options: AGENT_FRAMEWORKS}),\n fastApiEnabled: Flags.string({description: 'Use FastAPI to serve your agent locally', options: ['Yes', 'No']}),\n useCopilotCloud: Flags.string({description: 'Use Copilot Cloud for production-ready hosting', options: ['Yes', 'No']}),\n chatUi: Flags.string({description: 'Chat UI component to add to your app', options: CHAT_COMPONENTS}),\n langGraphAgent: Flags.string({description: 'LangGraph agent template to use', options: LANGGRAPH_AGENTS}),\n crewType: Flags.string({description: 'CrewAI implementation type', options: CREW_TYPES}),\n crewName: Flags.string({description: 'Name for your CrewAI agent'}),\n crewUrl: Flags.string({description: 'URL endpoint for your CrewAI agent'}),\n crewBearerToken: Flags.string({description: 'Bearer token for CrewAI authentication'}),\n langSmithApiKey: Flags.string({description: 'LangSmith API key for LangGraph observability'}),\n llmToken: Flags.string({description: 'API key for your preferred LLM provider'}),\n crewFlowAgent: Flags.string({description: 'CrewAI Flow template to use', options: CREW_FLOW_TEMPLATES}),\n}","export type ChatTemplate = \n \"CopilotChat\" |\n \"CopilotPopup\" |\n \"CopilotSidebar\"\n\nexport type StarterTemplate = \n \"LangGraphPlatform\" |\n \"RemoteEndpoint\" |\n \"Standard\" |\n \"CrewEnterprise\" |\n \"CrewFlowsStarter\"\n\nexport type Template = ChatTemplate | StarterTemplate\n\nconst BASE_URL = \"http://registry.copilotkit.ai/r\"\n\nexport const templateMapping = {\n \"LangGraphPlatform\": `${BASE_URL}/langgraph-platform-starter.json`,\n \"RemoteEndpoint\": `${BASE_URL}/remote-endpoint-starter.json`,\n \"CrewEnterprise\": [\n `${BASE_URL}/coagents-crew-starter.json`,\n ],\n\n \"CrewFlowsStarter\": [\n `${BASE_URL}/coagents-starter-ui.json`,\n `${BASE_URL}/agent-layout.json`,\n `${BASE_URL}/remote-endpoint.json`\n ],\n\n \"Standard\": `${BASE_URL}/standard-starter.json`,\n \"CopilotChat\": `${BASE_URL}/chat.json`,\n \"CopilotPopup\": `${BASE_URL}/popup.json`,\n \"CopilotSidebar\": `${BASE_URL}/sidebar.json`,\n}"],"mappings":";AAAA,OAAO,WAAW;;;ACAlB,SAAS,aAAa;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CHAT_COMPONENTS, CREW_TYPES, ChatComponent, Config, ConfigFlags, CrewType, Fields, LANGGRAPH_AGENTS, LangGraphAgent, Question, YesNo } from './questions.js';
1
+ export { AGENT_FRAMEWORKS, AgentFramework, CHAT_COMPONENTS, CREW_FLOW_TEMPLATES, CREW_TYPES, ChatComponent, Config, ConfigFlags, CrewFlowTemplate, CrewType, Fields, LANGGRAPH_AGENTS, LangGraphAgent, Question, YesNo } from './questions.js';
2
2
  export { ChatTemplate, StarterTemplate, Template, templateMapping } from './templates.js';
3
3
  import '@oclif/core/interfaces';
@@ -4,6 +4,7 @@ var AGENT_FRAMEWORKS = ["CrewAI", "LangGraph", "None"];
4
4
  var CREW_TYPES = ["Crews", "Flows"];
5
5
  var CHAT_COMPONENTS = ["CopilotChat", "CopilotSidebar", "Headless", "CopilotPopup"];
6
6
  var LANGGRAPH_AGENTS = ["Python Starter", "TypeScript Starter", "None"];
7
+ var CREW_FLOW_TEMPLATES = ["Starter", "None"];
7
8
  var ConfigFlags = {
8
9
  copilotKitVersion: Flags.string({ description: "CopilotKit version to use (e.g. 1.7.0)" }),
9
10
  agentFramework: Flags.string({ description: "Agent framework to power your copilot", options: AGENT_FRAMEWORKS }),
@@ -16,7 +17,8 @@ var ConfigFlags = {
16
17
  crewUrl: Flags.string({ description: "URL endpoint for your CrewAI agent" }),
17
18
  crewBearerToken: Flags.string({ description: "Bearer token for CrewAI authentication" }),
18
19
  langSmithApiKey: Flags.string({ description: "LangSmith API key for LangGraph observability" }),
19
- llmToken: Flags.string({ description: "API key for your preferred LLM provider" })
20
+ llmToken: Flags.string({ description: "API key for your preferred LLM provider" }),
21
+ crewFlowAgent: Flags.string({ description: "CrewAI Flow template to use", options: CREW_FLOW_TEMPLATES })
20
22
  };
21
23
 
22
24
  // src/lib/init/types/templates.ts
@@ -24,7 +26,14 @@ var BASE_URL = "http://registry.copilotkit.ai/r";
24
26
  var templateMapping = {
25
27
  "LangGraphPlatform": `${BASE_URL}/langgraph-platform-starter.json`,
26
28
  "RemoteEndpoint": `${BASE_URL}/remote-endpoint-starter.json`,
27
- "CrewEnterprise": `${BASE_URL}/agent-layout.json`,
29
+ "CrewEnterprise": [
30
+ `${BASE_URL}/coagents-crew-starter.json`
31
+ ],
32
+ "CrewFlowsStarter": [
33
+ `${BASE_URL}/coagents-starter-ui.json`,
34
+ `${BASE_URL}/agent-layout.json`,
35
+ `${BASE_URL}/remote-endpoint.json`
36
+ ],
28
37
  "Standard": `${BASE_URL}/standard-starter.json`,
29
38
  "CopilotChat": `${BASE_URL}/chat.json`,
30
39
  "CopilotPopup": `${BASE_URL}/popup.json`,
@@ -33,6 +42,7 @@ var templateMapping = {
33
42
  export {
34
43
  AGENT_FRAMEWORKS,
35
44
  CHAT_COMPONENTS,
45
+ CREW_FLOW_TEMPLATES,
36
46
  CREW_TYPES,
37
47
  ConfigFlags,
38
48
  LANGGRAPH_AGENTS,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/lib/init/types/questions.ts","../../../../src/lib/init/types/templates.ts"],"sourcesContent":["import { Flags } from \"@oclif/core\"\n\nexport type Question = {\n type: 'input' | 'yes/no' | 'select'\n name: Fields\n message: string\n choices?: string[]\n default?: string\n when?: (answers: Record<string, any>) => boolean\n}\n\n// Agent framework options\nexport const AGENT_FRAMEWORKS = ['CrewAI', 'LangGraph', 'None'] as const;\nexport type AgentFramework = typeof AGENT_FRAMEWORKS[number];\n\n// CrewAI types\nexport const CREW_TYPES = ['Crews', 'Flows'] as const;\nexport type CrewType = typeof CREW_TYPES[number];\n\n// UI component options\nexport const CHAT_COMPONENTS = ['CopilotChat','CopilotSidebar', 'Headless', 'CopilotPopup'] as const;\nexport type ChatComponent = typeof CHAT_COMPONENTS[number];\n\n// LangGraph agent types\nexport const LANGGRAPH_AGENTS = ['Python Starter', 'TypeScript Starter', 'None'] as const;\nexport type LangGraphAgent = typeof LANGGRAPH_AGENTS[number];\n\n// Yes/No type for consistent options\nexport type YesNo = 'Yes' | 'No';\n\n// All possible field names for questions\nexport type Fields = \n \"copilotKitVersion\" | \n \"agentFramework\" | \n \"alreadyDeployed\" |\n \"fastApiEnabled\" | \n \"useCopilotCloud\" | \n \"chatUi\" | \n \"langGraphAgent\" | \n \"langGraphPlatform\" |\n \"langGraphPlatformUrl\" | \n \"crewType\" | \n \"crewName\" | \n \"langGraphRemoteEndpointURL\" |\n \"crewUrl\" | \n \"crewBearerToken\" | \n \"langSmithApiKey\" | \n \"llmToken\";\n\n// Complete configuration shape that holds all possible answers\nexport interface Config {\n copilotKitVersion: string;\n agentFramework: AgentFramework;\n alreadyDeployed?: YesNo;\n fastApiEnabled?: YesNo;\n useCopilotCloud?: YesNo;\n chatUi: ChatComponent;\n\n // LangGraph\n langGraphAgent?: LangGraphAgent;\n langGraphPlatform?: YesNo;\n langGraphPlatformUrl?: string;\n langGraphRemoteEndpointURL?: string;\n\n // CrewAI\n crewType?: CrewType;\n crewName?: string;\n crewUrl?: string;\n crewBearerToken?: string;\n\n // API keys and tokens\n copilotCloudPublicApiKey?: string;\n langSmithApiKey?: string;\n llmToken?: string;\n}\n\n// CLI flags definition - single source of truth for flag descriptions\nexport const ConfigFlags = {\n copilotKitVersion: Flags.string({description: 'CopilotKit version to use (e.g. 1.7.0)'}),\n agentFramework: Flags.string({description: 'Agent framework to power your copilot', options: AGENT_FRAMEWORKS}),\n fastApiEnabled: Flags.string({description: 'Use FastAPI to serve your agent locally', options: ['Yes', 'No']}),\n useCopilotCloud: Flags.string({description: 'Use Copilot Cloud for production-ready hosting', options: ['Yes', 'No']}),\n chatUi: Flags.string({description: 'Chat UI component to add to your app', options: CHAT_COMPONENTS}),\n langGraphAgent: Flags.string({description: 'LangGraph agent template to use', options: LANGGRAPH_AGENTS}),\n crewType: Flags.string({description: 'CrewAI implementation type', options: CREW_TYPES}),\n crewName: Flags.string({description: 'Name for your CrewAI agent'}),\n crewUrl: Flags.string({description: 'URL endpoint for your CrewAI agent'}),\n crewBearerToken: Flags.string({description: 'Bearer token for CrewAI authentication'}),\n langSmithApiKey: Flags.string({description: 'LangSmith API key for LangGraph observability'}),\n llmToken: Flags.string({description: 'API key for your preferred LLM provider'}),\n}","export type ChatTemplate = \n \"CopilotChat\" |\n \"CopilotPopup\" |\n \"CopilotSidebar\"\n\nexport type StarterTemplate = \n \"LangGraphPlatform\" |\n \"RemoteEndpoint\" |\n \"Standard\" |\n \"CrewEnterprise\"\n\nexport type Template = ChatTemplate | StarterTemplate\n\nconst BASE_URL = \"http://registry.copilotkit.ai/r\"\n\nexport const templateMapping: Record<Template, string> = {\n \"LangGraphPlatform\": `${BASE_URL}/langgraph-platform-starter.json`,\n \"RemoteEndpoint\": `${BASE_URL}/remote-endpoint-starter.json`,\n \"CrewEnterprise\": `${BASE_URL}/agent-layout.json`,\n\n \"Standard\": `${BASE_URL}/standard-starter.json`,\n \"CopilotChat\": `${BASE_URL}/chat.json`,\n \"CopilotPopup\": `${BASE_URL}/popup.json`,\n \"CopilotSidebar\": `${BASE_URL}/sidebar.json`,\n}"],"mappings":";AAAA,SAAS,aAAa;AAYf,IAAM,mBAAmB,CAAC,UAAU,aAAa,MAAM;AAIvD,IAAM,aAAa,CAAC,SAAS,OAAO;AAIpC,IAAM,kBAAkB,CAAC,eAAc,kBAAkB,YAAY,cAAc;AAInF,IAAM,mBAAmB,CAAC,kBAAkB,sBAAsB,MAAM;AAqDxE,IAAM,cAAc;AAAA,EACzB,mBAAmB,MAAM,OAAO,EAAC,aAAa,yCAAwC,CAAC;AAAA,EACvF,gBAAgB,MAAM,OAAO,EAAC,aAAa,yCAAyC,SAAS,iBAAgB,CAAC;AAAA,EAC9G,gBAAgB,MAAM,OAAO,EAAC,aAAa,2CAA2C,SAAS,CAAC,OAAO,IAAI,EAAC,CAAC;AAAA,EAC7G,iBAAiB,MAAM,OAAO,EAAC,aAAa,kDAAkD,SAAS,CAAC,OAAO,IAAI,EAAC,CAAC;AAAA,EACrH,QAAQ,MAAM,OAAO,EAAC,aAAa,wCAAwC,SAAS,gBAAe,CAAC;AAAA,EACpG,gBAAgB,MAAM,OAAO,EAAC,aAAa,mCAAmC,SAAS,iBAAgB,CAAC;AAAA,EACxG,UAAU,MAAM,OAAO,EAAC,aAAa,8BAA8B,SAAS,WAAU,CAAC;AAAA,EACvF,UAAU,MAAM,OAAO,EAAC,aAAa,6BAA4B,CAAC;AAAA,EAClE,SAAS,MAAM,OAAO,EAAC,aAAa,qCAAoC,CAAC;AAAA,EACzE,iBAAiB,MAAM,OAAO,EAAC,aAAa,yCAAwC,CAAC;AAAA,EACrF,iBAAiB,MAAM,OAAO,EAAC,aAAa,gDAA+C,CAAC;AAAA,EAC5F,UAAU,MAAM,OAAO,EAAC,aAAa,0CAAyC,CAAC;AACjF;;;AC7EA,IAAM,WAAW;AAEV,IAAM,kBAA4C;AAAA,EACrD,qBAAqB,GAAG,QAAQ;AAAA,EAChC,kBAAkB,GAAG,QAAQ;AAAA,EAC7B,kBAAkB,GAAG,QAAQ;AAAA,EAE7B,YAAY,GAAG,QAAQ;AAAA,EACvB,eAAe,GAAG,QAAQ;AAAA,EAC1B,gBAAgB,GAAG,QAAQ;AAAA,EAC3B,kBAAkB,GAAG,QAAQ;AACjC;","names":[]}
1
+ {"version":3,"sources":["../../../../src/lib/init/types/questions.ts","../../../../src/lib/init/types/templates.ts"],"sourcesContent":["import { Flags } from \"@oclif/core\"\n\nexport type Question = {\n type: 'input' | 'yes/no' | 'select'\n name: Fields\n message: string\n choices?: string[]\n default?: string\n when?: (answers: Record<string, any>) => boolean\n sensitive?: boolean\n}\n\n// Agent framework options\nexport const AGENT_FRAMEWORKS = ['CrewAI', 'LangGraph', 'None'] as const;\nexport type AgentFramework = typeof AGENT_FRAMEWORKS[number];\n\n// CrewAI types\nexport const CREW_TYPES = ['Crews', 'Flows'] as const;\nexport type CrewType = typeof CREW_TYPES[number];\n\n// UI component options\nexport const CHAT_COMPONENTS = ['CopilotChat','CopilotSidebar', 'Headless', 'CopilotPopup'] as const;\nexport type ChatComponent = typeof CHAT_COMPONENTS[number];\n\n// LangGraph agent types\nexport const LANGGRAPH_AGENTS = ['Python Starter', 'TypeScript Starter', 'None'] as const;\nexport type LangGraphAgent = typeof LANGGRAPH_AGENTS[number];\n\n// CrewAI Flow templates\nexport const CREW_FLOW_TEMPLATES = ['Starter', 'None'] as const;\nexport type CrewFlowTemplate = typeof CREW_FLOW_TEMPLATES[number];\n\n// Yes/No type for consistent options\nexport type YesNo = 'Yes' | 'No';\n\n// All possible field names for questions\nexport type Fields = \n \"copilotKitVersion\" | \n \"agentFramework\" | \n \"alreadyDeployed\" |\n \"fastApiEnabled\" | \n \"useCopilotCloud\" | \n \"chatUi\" | \n \"langGraphAgent\" | \n \"langGraphPlatform\" |\n \"langGraphPlatformUrl\" | \n \"crewType\" | \n \"crewName\" | \n \"langGraphRemoteEndpointURL\" |\n \"crewUrl\" | \n \"crewBearerToken\" | \n \"langSmithApiKey\" | \n \"llmToken\" |\n \"crewFlowAgent\";\n\n// Complete configuration shape that holds all possible answers\nexport interface Config {\n copilotKitVersion: string;\n agentFramework: AgentFramework;\n alreadyDeployed?: YesNo;\n fastApiEnabled?: YesNo;\n useCopilotCloud?: YesNo;\n chatUi: ChatComponent;\n\n // LangGraph\n langGraphAgent?: LangGraphAgent;\n langGraphPlatform?: YesNo;\n langGraphPlatformUrl?: string;\n langGraphRemoteEndpointURL?: string;\n\n // CrewAI\n crewType?: CrewType;\n crewName?: string;\n crewUrl?: string;\n crewBearerToken?: string;\n crewFlowAgent?: string;\n\n // API keys and tokens\n copilotCloudPublicApiKey?: string;\n langSmithApiKey?: string;\n llmToken?: string;\n}\n\n// CLI flags definition - single source of truth for flag descriptions\nexport const ConfigFlags = {\n copilotKitVersion: Flags.string({description: 'CopilotKit version to use (e.g. 1.7.0)'}),\n agentFramework: Flags.string({description: 'Agent framework to power your copilot', options: AGENT_FRAMEWORKS}),\n fastApiEnabled: Flags.string({description: 'Use FastAPI to serve your agent locally', options: ['Yes', 'No']}),\n useCopilotCloud: Flags.string({description: 'Use Copilot Cloud for production-ready hosting', options: ['Yes', 'No']}),\n chatUi: Flags.string({description: 'Chat UI component to add to your app', options: CHAT_COMPONENTS}),\n langGraphAgent: Flags.string({description: 'LangGraph agent template to use', options: LANGGRAPH_AGENTS}),\n crewType: Flags.string({description: 'CrewAI implementation type', options: CREW_TYPES}),\n crewName: Flags.string({description: 'Name for your CrewAI agent'}),\n crewUrl: Flags.string({description: 'URL endpoint for your CrewAI agent'}),\n crewBearerToken: Flags.string({description: 'Bearer token for CrewAI authentication'}),\n langSmithApiKey: Flags.string({description: 'LangSmith API key for LangGraph observability'}),\n llmToken: Flags.string({description: 'API key for your preferred LLM provider'}),\n crewFlowAgent: Flags.string({description: 'CrewAI Flow template to use', options: CREW_FLOW_TEMPLATES}),\n}","export type ChatTemplate = \n \"CopilotChat\" |\n \"CopilotPopup\" |\n \"CopilotSidebar\"\n\nexport type StarterTemplate = \n \"LangGraphPlatform\" |\n \"RemoteEndpoint\" |\n \"Standard\" |\n \"CrewEnterprise\" |\n \"CrewFlowsStarter\"\n\nexport type Template = ChatTemplate | StarterTemplate\n\nconst BASE_URL = \"http://registry.copilotkit.ai/r\"\n\nexport const templateMapping = {\n \"LangGraphPlatform\": `${BASE_URL}/langgraph-platform-starter.json`,\n \"RemoteEndpoint\": `${BASE_URL}/remote-endpoint-starter.json`,\n \"CrewEnterprise\": [\n `${BASE_URL}/coagents-crew-starter.json`,\n ],\n\n \"CrewFlowsStarter\": [\n `${BASE_URL}/coagents-starter-ui.json`,\n `${BASE_URL}/agent-layout.json`,\n `${BASE_URL}/remote-endpoint.json`\n ],\n\n \"Standard\": `${BASE_URL}/standard-starter.json`,\n \"CopilotChat\": `${BASE_URL}/chat.json`,\n \"CopilotPopup\": `${BASE_URL}/popup.json`,\n \"CopilotSidebar\": `${BASE_URL}/sidebar.json`,\n}"],"mappings":";AAAA,SAAS,aAAa;AAaf,IAAM,mBAAmB,CAAC,UAAU,aAAa,MAAM;AAIvD,IAAM,aAAa,CAAC,SA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;AAAA,EAEA,oBAAoB;AAAA,IAChB,GAAG,QAAQ;AAAA,IACX,GAAG,QAAQ;AAAA,IACX,GAAG,QAAQ;AAAA,EACf;AAAA,EAEA,YAAY,GAAG,QAAQ;AAAA,EACvB,eAAe,GAAG,QAAQ;AAAA,EAC1B,gBAAgB,GAAG,QAAQ;AAAA,EAC3B,kBAAkB,GAAG,QAAQ;AACjC;","names":[]}
@@ -7,6 +7,7 @@ type Question = {
7
7
  choices?: string[];
8
8
  default?: string;
9
9
  when?: (answers: Record<string, any>) => boolean;
10
+ sensitive?: boolean;
10
11
  };
11
12
  declare const AGENT_FRAMEWORKS: readonly ["CrewAI", "LangGraph", "None"];
12
13
  type AgentFramework = typeof AGENT_FRAMEWORKS[number];
@@ -16,8 +17,10 @@ declare const CHAT_COMPONENTS: readonly ["CopilotChat", "CopilotSidebar", "Headl
16
17
  type ChatComponent = typeof CHAT_COMPONENTS[number];
17
18
  declare const LANGGRAPH_AGENTS: readonly ["Python Starter", "TypeScript Starter", "None"];
18
19
  type LangGraphAgent = typeof LANGGRAPH_AGENTS[number];
20
+ declare const CREW_FLOW_TEMPLATES: readonly ["Starter", "None"];
21
+ type CrewFlowTemplate = typeof CREW_FLOW_TEMPLATES[number];
19
22
  type YesNo = 'Yes' | 'No';
20
- type Fields = "copilotKitVersion" | "agentFramework" | "alreadyDeployed" | "fastApiEnabled" | "useCopilotCloud" | "chatUi" | "langGraphAgent" | "langGraphPlatform" | "langGraphPlatformUrl" | "crewType" | "crewName" | "langGraphRemoteEndpointURL" | "crewUrl" | "crewBearerToken" | "langSmithApiKey" | "llmToken";
23
+ type Fields = "copilotKitVersion" | "agentFramework" | "alreadyDeployed" | "fastApiEnabled" | "useCopilotCloud" | "chatUi" | "langGraphAgent" | "langGraphPlatform" | "langGraphPlatformUrl" | "crewType" | "crewName" | "langGraphRemoteEndpointURL" | "crewUrl" | "crewBearerToken" | "langSmithApiKey" | "llmToken" | "crewFlowAgent";
21
24
  interface Config {
22
25
  copilotKitVersion: string;
23
26
  agentFramework: AgentFramework;
@@ -33,6 +36,7 @@ interface Config {
33
36
  crewName?: string;
34
37
  crewUrl?: string;
35
38
  crewBearerToken?: string;
39
+ crewFlowAgent?: string;
36
40
  copilotCloudPublicApiKey?: string;
37
41
  langSmithApiKey?: string;
38
42
  llmToken?: string;
@@ -50,6 +54,7 @@ declare const ConfigFlags: {
50
54
  crewBearerToken: _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
51
55
  langSmithApiKey: _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
52
56
  llmToken: _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
57
+ crewFlowAgent: _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
53
58
  };
54
59
 
55
- export { AGENT_FRAMEWORKS, type AgentFramework, CHAT_COMPONENTS, CREW_TYPES, type ChatComponent, type Config, ConfigFlags, type CrewType, type Fields, LANGGRAPH_AGENTS, type LangGraphAgent, type Question, type YesNo };
60
+ export { AGENT_FRAMEWORKS, type AgentFramework, CHAT_COMPONENTS, CREW_FLOW_TEMPLATES, CREW_TYPES, type ChatComponent, type Config, ConfigFlags, type CrewFlowTemplate, type CrewType, type Fields, LANGGRAPH_AGENTS, type LangGraphAgent, type Question, type YesNo };
@@ -4,6 +4,7 @@ var AGENT_FRAMEWORKS = ["CrewAI", "LangGraph", "None"];
4
4
  var CREW_TYPES = ["Crews", "Flows"];
5
5
  var CHAT_COMPONENTS = ["CopilotChat", "CopilotSidebar", "Headless", "CopilotPopup"];
6
6
  var LANGGRAPH_AGENTS = ["Python Starter", "TypeScript Starter", "None"];
7
+ var CREW_FLOW_TEMPLATES = ["Starter", "None"];
7
8
  var ConfigFlags = {
8
9
  copilotKitVersion: Flags.string({ description: "CopilotKit version to use (e.g. 1.7.0)" }),
9
10
  agentFramework: Flags.string({ description: "Agent framework to power your copilot", options: AGENT_FRAMEWORKS }),
@@ -16,11 +17,13 @@ var ConfigFlags = {
16
17
  crewUrl: Flags.string({ description: "URL endpoint for your CrewAI agent" }),
17
18
  crewBearerToken: Flags.string({ description: "Bearer token for CrewAI authentication" }),
18
19
  langSmithApiKey: Flags.string({ description: "LangSmith API key for LangGraph observability" }),
19
- llmToken: Flags.string({ description: "API key for your preferred LLM provider" })
20
+ llmToken: Flags.string({ description: "API key for your preferred LLM provider" }),
21
+ crewFlowAgent: Flags.string({ description: "CrewAI Flow template to use", options: CREW_FLOW_TEMPLATES })
20
22
  };
21
23
  export {
22
24
  AGENT_FRAMEWORKS,
23
25
  CHAT_COMPONENTS,
26
+ CREW_FLOW_TEMPLATES,
24
27
  CREW_TYPES,
25
28
  ConfigFlags,
26
29
  LANGGRAPH_AGENTS