copilotkit 0.0.44 → 0.0.45

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 (42) 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 +17 -1
  4. package/dist/commands/dev.js.map +1 -1
  5. package/dist/commands/init.d.ts +6 -2
  6. package/dist/commands/init.js +375 -299
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/login.js +17 -1
  9. package/dist/commands/login.js.map +1 -1
  10. package/dist/commands/logout.js +17 -1
  11. package/dist/commands/logout.js.map +1 -1
  12. package/dist/lib/init/index.d.ts +2 -2
  13. package/dist/lib/init/index.js +232 -198
  14. package/dist/lib/init/index.js.map +1 -1
  15. package/dist/lib/init/questions.d.ts +3 -1
  16. package/dist/lib/init/questions.js +211 -183
  17. package/dist/lib/init/questions.js.map +1 -1
  18. package/dist/lib/init/scaffold/env.js +13 -3
  19. package/dist/lib/init/scaffold/env.js.map +1 -1
  20. package/dist/lib/init/scaffold/index.js +33 -24
  21. package/dist/lib/init/scaffold/index.js.map +1 -1
  22. package/dist/lib/init/scaffold/shadcn.js +20 -21
  23. package/dist/lib/init/scaffold/shadcn.js.map +1 -1
  24. package/dist/lib/init/types/index.d.ts +1 -1
  25. package/dist/lib/init/types/index.js +16 -9
  26. package/dist/lib/init/types/index.js.map +1 -1
  27. package/dist/lib/init/types/questions.d.ts +11 -9
  28. package/dist/lib/init/types/questions.js +14 -7
  29. package/dist/lib/init/types/questions.js.map +1 -1
  30. package/dist/lib/init/types/templates.js +2 -2
  31. package/dist/lib/init/types/templates.js.map +1 -1
  32. package/dist/services/analytics.service.d.ts +4 -0
  33. package/dist/services/analytics.service.js +16 -0
  34. package/dist/services/analytics.service.js.map +1 -1
  35. package/dist/services/auth.service.js +16 -0
  36. package/dist/services/auth.service.js.map +1 -1
  37. package/dist/services/events.d.ts +23 -15
  38. package/dist/utils/version.d.ts +1 -1
  39. package/dist/utils/version.js +1 -1
  40. package/dist/utils/version.js.map +1 -1
  41. package/oclif.manifest.json +12 -12
  42. package/package.json +1 -1
@@ -14,6 +14,7 @@ var CHAT_COMPONENTS = ["CopilotChat", "CopilotSidebar", "Headless", "CopilotPopu
14
14
  var LANGGRAPH_AGENTS = ["Python Starter", "TypeScript Starter"];
15
15
  var CREW_FLOW_TEMPLATES = ["Starter"];
16
16
  var YES_NO = ["Yes", "No"];
17
+ var DEPLOYMENT_CHOICES = ["Copilot Cloud", "Self-hosted"];
17
18
  var sanitizers = {
18
19
  // Remove trailing slash from URLs
19
20
  url: (value) => {
@@ -42,6 +43,7 @@ var ChatComponentSchema = z.enum(CHAT_COMPONENTS);
42
43
  var LangGraphAgentSchema = z.enum(LANGGRAPH_AGENTS);
43
44
  var CrewFlowTemplateSchema = z.enum(CREW_FLOW_TEMPLATES);
44
45
  var YesNoSchema = z.enum(YES_NO);
46
+ var DeploymentChoiceSchema = z.enum(DEPLOYMENT_CHOICES);
45
47
  var UrlSchema = z.preprocess(
46
48
  (val) => sanitizers.url(String(val)),
47
49
  z.string().url("Please enter a valid URL").min(1, "URL is required")
@@ -54,8 +56,6 @@ var ApiKeySchema = z.preprocess(
54
56
  var LLMApiKeySchema = z.preprocess((val) => sanitizers.apiKey(String(val)), z.string().optional());
55
57
  var NameSchema = z.preprocess((val) => sanitizers.trim(String(val)), z.string().min(1, "Name is required"));
56
58
  var ConfigSchema = z.object({
57
- // NEW: Early signup field
58
- signupForCopilotCloud: YesNoSchema.optional(),
59
59
  // Core fields
60
60
  copilotKitVersion: z.string().optional(),
61
61
  mode: ModeSchema,
@@ -63,6 +63,7 @@ var ConfigSchema = z.object({
63
63
  // Yes/No fields
64
64
  alreadyDeployed: YesNoSchema.optional(),
65
65
  fastApiEnabled: YesNoSchema.optional(),
66
+ // DEPRECATED: useCopilotCloud - consolidated with signupForCopilotCloud
66
67
  useCopilotCloud: YesNoSchema.optional(),
67
68
  // LangGraph specific fields
68
69
  langGraphAgent: LangGraphAgentSchema.optional(),
@@ -80,7 +81,10 @@ var ConfigSchema = z.object({
80
81
  llmToken: LLMApiKeySchema.optional(),
81
82
  // IDE Documentation setup fields
82
83
  setupIDEDocs: YesNoSchema.optional(),
83
- selectedIDE: z.union([z.enum(["cursor", "windsurf"]), z.literal("skip")]).optional()
84
+ selectedIDE: z.union([z.enum(["cursor", "windsurf"]), z.literal("skip")]).optional(),
85
+ // NEW: A/B/C test fields
86
+ deploymentChoice: DeploymentChoiceSchema.optional()
87
+ // For branch B only (Cloud vs Self-hosted)
84
88
  }).refine(
85
89
  (data) => {
86
90
  if (data.mode === "CrewAI") {
@@ -106,10 +110,6 @@ var ConfigSchema = z.object({
106
110
  );
107
111
  var ConfigFlags = {
108
112
  booth: Flags.boolean({ description: "Use CopilotKit in booth mode", default: false, char: "b" }),
109
- "signup-for-copilot-cloud": Flags.string({
110
- description: "Sign up for Copilot Cloud for error tracking and debugging insights",
111
- options: YES_NO
112
- }),
113
113
  mode: Flags.string({ description: "How you will be interacting with AI", options: MODES, char: "m" }),
114
114
  "copilotkit-version": Flags.string({ description: "CopilotKit version to use (e.g. 1.7.0)" }),
115
115
  "use-copilot-cloud": Flags.string({ description: "Use Copilot Cloud for production-ready hosting", options: YES_NO }),
@@ -124,6 +124,11 @@ var ConfigFlags = {
124
124
  "selected-ide": Flags.string({
125
125
  description: "IDE to configure with documentation rules",
126
126
  options: ["cursor", "windsurf", "skip"]
127
+ }),
128
+ // NEW: A/B/C test flags
129
+ "deployment-choice": Flags.string({
130
+ description: "Choose between Copilot Cloud or Self-hosted deployment",
131
+ options: DEPLOYMENT_CHOICES
127
132
  })
128
133
  };
129
134
 
@@ -131,8 +136,8 @@ var ConfigFlags = {
131
136
  var BASE_URL = "https://registry.copilotkit.ai/r";
132
137
  var templateMapping = {
133
138
  // Runtimes
134
- RemoteEndpoint: `${BASE_URL}/remote-endpoint-starter.json`,
135
- LangGraphPlatformRuntime: `${BASE_URL}/langgraph-platform-starter.json`,
139
+ RemoteEndpoint: `${BASE_URL}/remote-endpoint.json`,
140
+ LangGraphPlatformRuntime: `${BASE_URL}/langgraph-platform-runtime.json`,
136
141
  // CrewAI
137
142
  CrewEnterprise: [`${BASE_URL}/coagents-crew-starter.json`],
138
143
  CrewFlowsEnterprise: [`${BASE_URL}/coagents-starter-crewai-flows.json`],
@@ -312,190 +317,212 @@ var validateUrl = (input) => {
312
317
  var validateRequired = (input) => {
313
318
  return sanitizers.trim(input) ? true : "This field is required";
314
319
  };
315
- var questions = [
316
- // NEW: Early signup question - first question for maximum visibility
317
- {
318
- type: "yes/no",
319
- name: "signupForCopilotCloud",
320
- message: "\u{1FA81} Sign up for Copilot Cloud to enable error tracking and get production-ready hosting? (Recommended)",
321
- validate: (input) => {
322
- try {
323
- YesNoSchema.parse(input);
324
- return true;
325
- } catch (error) {
326
- return "Please select Yes or No";
320
+ function getQuestionsForBranch(branch) {
321
+ const baseQuestions = getBaseQuestions();
322
+ switch (branch) {
323
+ case "A":
324
+ return [...baseQuestions];
325
+ case "B":
326
+ return [...baseQuestions, ...getDeploymentChoiceQuestions()];
327
+ case "C":
328
+ default:
329
+ return [...baseQuestions, ...getCloudDeploymentQuestions()];
330
+ }
331
+ }
332
+ function getBaseQuestions() {
333
+ return [
334
+ {
335
+ type: "select",
336
+ name: "mode",
337
+ message: "\u{1F916} How will you be interacting with AI?",
338
+ choices: Array.from(MODES),
339
+ validate: (input) => {
340
+ try {
341
+ ModeSchema.parse(input);
342
+ return true;
343
+ } catch (error) {
344
+ return "Please select a valid mode";
345
+ }
327
346
  }
328
- }
329
- },
330
- // Core setup questions - always shown after signup
331
- {
332
- type: "select",
333
- name: "mode",
334
- message: "\u{1F916} How will you be interacting with AI?",
335
- choices: Array.from(MODES),
336
- validate: (input) => {
337
- try {
338
- ModeSchema.parse(input);
339
- return true;
340
- } catch (error) {
341
- return "Please select a valid mode";
347
+ },
348
+ // CrewAI specific questions
349
+ {
350
+ type: "select",
351
+ name: "crewType",
352
+ message: "\u{1F465} What kind of CrewAI implementation would you like to use?",
353
+ choices: Array.from(CREW_TYPES),
354
+ when: (answers) => answers.mode === "CrewAI",
355
+ validate: (input) => {
356
+ try {
357
+ CrewTypeSchema.parse(input);
358
+ return true;
359
+ } catch (error) {
360
+ return "Please select a valid crew type";
361
+ }
342
362
  }
343
- }
344
- },
345
- // CrewAI specific questions - shown when CrewAI selected
346
- {
347
- type: "select",
348
- name: "crewType",
349
- message: "\u{1F465} What kind of CrewAI implementation would you like to use?",
350
- choices: Array.from(CREW_TYPES),
351
- when: (answers) => answers.mode === "CrewAI",
352
- validate: (input) => {
353
- try {
354
- CrewTypeSchema.parse(input);
355
- return true;
356
- } catch (error) {
357
- return "Please select a valid crew type";
363
+ },
364
+ {
365
+ type: "input",
366
+ name: "crewName",
367
+ message: "\u{1F465} What would you like to name your crew? (can be anything)",
368
+ when: (answers) => answers.mode === "CrewAI",
369
+ default: "MyCopilotCrew",
370
+ validate: validateRequired,
371
+ sanitize: sanitizers.trim
372
+ },
373
+ {
374
+ type: "input",
375
+ name: "crewUrl",
376
+ message: "\u{1F517} Enter your Crew's Enterprise URL (more info at https://app.crewai.com):",
377
+ when: (answers) => answers.mode === "CrewAI",
378
+ validate: validateUrl,
379
+ sanitize: sanitizers.url
380
+ },
381
+ {
382
+ type: "input",
383
+ name: "crewBearerToken",
384
+ message: "\u{1F511} Enter your Crew's bearer token:",
385
+ when: (answers) => answers.mode === "CrewAI",
386
+ sensitive: true,
387
+ validate: validateRequired,
388
+ sanitize: sanitizers.trim
389
+ },
390
+ // LangGraph specific questions
391
+ {
392
+ type: "yes/no",
393
+ name: "alreadyDeployed",
394
+ message: "\u{1F99C}\u{1F517} Do you have an existing LangGraph agent?",
395
+ when: (answers) => answers.mode === "LangGraph",
396
+ validate: (input) => {
397
+ try {
398
+ YesNoSchema.parse(input);
399
+ return true;
400
+ } catch (error) {
401
+ return "Please select Yes or No";
402
+ }
358
403
  }
359
- }
360
- },
361
- // CrewAI specific questions - shown when CrewAI Crews or Flows selected
362
- {
363
- type: "input",
364
- name: "crewName",
365
- message: "\u{1F465} What would you like to name your crew? (can be anything)",
366
- when: (answers) => answers.mode === "CrewAI",
367
- default: "MyCopilotCrew",
368
- validate: validateRequired,
369
- sanitize: sanitizers.trim
370
- },
371
- {
372
- type: "input",
373
- name: "crewUrl",
374
- message: "\u{1F517} Enter your Crew's Enterprise URL (more info at https://app.crewai.com):",
375
- when: (answers) => answers.mode === "CrewAI",
376
- validate: validateUrl,
377
- sanitize: sanitizers.url
378
- },
379
- {
380
- type: "input",
381
- name: "crewBearerToken",
382
- message: "\u{1F511} Enter your Crew's bearer token:",
383
- when: (answers) => answers.mode === "CrewAI",
384
- sensitive: true,
385
- validate: validateRequired,
386
- sanitize: sanitizers.trim
387
- },
388
- // LangGraph specific questions - shown when LangGraph selected
389
- {
390
- type: "yes/no",
391
- name: "alreadyDeployed",
392
- message: "\u{1F99C}\u{1F517} Do you have an existing LangGraph agent?",
393
- when: (answers) => answers.mode === "LangGraph",
394
- validate: (input) => {
395
- try {
396
- YesNoSchema.parse(input);
397
- return true;
398
- } catch (error) {
399
- return "Please select Yes or No";
404
+ },
405
+ {
406
+ type: "yes/no",
407
+ name: "langGraphPlatform",
408
+ message: "\u{1F99C}\u{1F517} Do you already have a LangGraph Agent URL? (remote or localhost)",
409
+ when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "Yes",
410
+ validate: (input) => {
411
+ try {
412
+ YesNoSchema.parse(input);
413
+ return true;
414
+ } catch (error) {
415
+ return "Please select Yes or No";
416
+ }
400
417
  }
401
- }
402
- },
403
- {
404
- type: "yes/no",
405
- name: "langGraphPlatform",
406
- message: "\u{1F99C}\u{1F517} Do you already have a LangGraph Agent URL? (remote or localhost)",
407
- when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "Yes",
408
- validate: (input) => {
409
- try {
410
- YesNoSchema.parse(input);
411
- return true;
412
- } catch (error) {
413
- return "Please select Yes or No";
418
+ },
419
+ {
420
+ type: "input",
421
+ name: "langGraphPlatformUrl",
422
+ message: "\u{1F99C}\u{1F517} Enter your LangGraph Agent URL (remote or localhost)",
423
+ when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "Yes" && answers.langGraphPlatform === "Yes",
424
+ validate: validateUrl,
425
+ sanitize: sanitizers.url
426
+ },
427
+ {
428
+ type: "select",
429
+ name: "langGraphAgent",
430
+ message: "\u{1F4E6} Choose a LangGraph starter template:",
431
+ choices: Array.from(LANGGRAPH_AGENTS),
432
+ when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "No"
433
+ },
434
+ {
435
+ type: "input",
436
+ name: "langSmithApiKey",
437
+ message: "\u{1F99C}\u{1F517} Enter your LangSmith API key (required by LangGraph Platform) :",
438
+ when: (answers) => answers.mode === "LangGraph" && answers.langGraphPlatform === "Yes" && !(answers.langGraphPlatformUrl && isLocalhost(answers.langGraphPlatformUrl)),
439
+ sensitive: true,
440
+ validate: validateRequired,
441
+ sanitize: sanitizers.apiKey
442
+ },
443
+ // LLM Token for self-hosted setups
444
+ {
445
+ type: "input",
446
+ name: "llmToken",
447
+ message: "\u{1F511} Enter your OpenAI API key (optional - leave empty to configure your LLM later):",
448
+ when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "No" || answers.mode === "Standard" && answers.deploymentChoice === "Self-hosted" || answers.mode === "MCP" && answers.deploymentChoice === "Self-hosted" || answers.mode === "Standard" && answers.useCopilotCloud !== "Yes" || answers.mode === "MCP" && answers.useCopilotCloud !== "Yes",
449
+ sensitive: true,
450
+ sanitize: sanitizers.apiKey
451
+ },
452
+ // IDE Documentation Setup Questions
453
+ {
454
+ type: "yes/no",
455
+ name: "setupIDEDocs",
456
+ message: "\u{1F4DA} Would you like to add CopilotKit documentation to your IDE? (Provides AI assistant with CopilotKit context)",
457
+ when: async () => {
458
+ const installedIDEs = await detectInstalledIDEs();
459
+ return installedIDEs.length > 0;
460
+ },
461
+ validate: (input) => {
462
+ try {
463
+ YesNoSchema.parse(input);
464
+ return true;
465
+ } catch (error) {
466
+ return "Please select Yes or No";
467
+ }
414
468
  }
469
+ },
470
+ {
471
+ type: "select",
472
+ name: "selectedIDE",
473
+ message: "\u{1F4BB} Which IDE would you like to configure with CopilotKit documentation?",
474
+ choices: async () => {
475
+ const installedIDEs = await detectInstalledIDEs();
476
+ const choices = installedIDEs.map((ide) => ({
477
+ name: IDE_DOCS_CONFIGS[ide].displayName,
478
+ value: ide
479
+ }));
480
+ choices.push({ name: "Skip", value: "skip" });
481
+ return choices;
482
+ },
483
+ when: (answers) => answers.setupIDEDocs === "Yes"
415
484
  }
416
- },
417
- {
418
- type: "input",
419
- name: "langGraphPlatformUrl",
420
- message: "\u{1F99C}\u{1F517} Enter your LangGraph Agent URL (remote or localhost)",
421
- when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "Yes" && answers.langGraphPlatform === "Yes",
422
- validate: validateUrl,
423
- sanitize: sanitizers.url
424
- },
425
- {
426
- type: "select",
427
- name: "langGraphAgent",
428
- message: "\u{1F4E6} Choose a LangGraph starter template:",
429
- choices: Array.from(LANGGRAPH_AGENTS),
430
- when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "No"
431
- },
432
- {
433
- type: "input",
434
- name: "langSmithApiKey",
435
- message: "\u{1F99C}\u{1F517} Enter your LangSmith API key (required by LangGraph Platform) :",
436
- when: (answers) => answers.mode === "LangGraph" && answers.langGraphPlatform === "Yes" && !(answers.langGraphPlatformUrl && isLocalhost(answers.langGraphPlatformUrl)),
437
- sensitive: true,
438
- validate: validateRequired,
439
- sanitize: sanitizers.apiKey
440
- },
441
- // Deployment options
442
- {
443
- type: "yes/no",
444
- name: "useCopilotCloud",
445
- message: "\u{1FA81} Deploy with Copilot Cloud? (recommended for production)",
446
- when: (answers) => answers.mode === "Standard" || answers.mode === "MCP" || answers.mode !== "CrewAI" && // Crews only cloud, flows are self-hosted
447
- answers.alreadyDeployed === "Yes" && answers.langGraphPlatform !== "No" && !linkToDocs.includes(answers.mode || "") && !isLocalhost(answers.langGraphPlatformUrl || ""),
448
- validate: (input) => {
449
- try {
450
- YesNoSchema.parse(input);
451
- return true;
452
- } catch (error) {
453
- return "Please select Yes or No";
485
+ ];
486
+ }
487
+ function getDeploymentChoiceQuestions() {
488
+ return [
489
+ {
490
+ type: "select",
491
+ name: "deploymentChoice",
492
+ message: "\u{1F680} Use Copilot Cloud, or self-hosted?",
493
+ choices: Array.from(DEPLOYMENT_CHOICES),
494
+ validate: (input) => {
495
+ try {
496
+ DeploymentChoiceSchema.parse(input);
497
+ return true;
498
+ } catch (error) {
499
+ return "Please select a valid deployment option";
500
+ }
454
501
  }
455
502
  }
456
- },
457
- {
458
- type: "input",
459
- name: "llmToken",
460
- message: "\u{1F511} Enter your OpenAI API key (optional - leave empty to configure your LLM later):",
461
- when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "No" || answers.mode === "Standard" && answers.useCopilotCloud !== "Yes" || answers.mode === "MCP" && answers.useCopilotCloud !== "Yes",
462
- sensitive: true,
463
- sanitize: sanitizers.apiKey
464
- },
465
- // IDE Documentation Setup Questions
466
- {
467
- type: "yes/no",
468
- name: "setupIDEDocs",
469
- message: "\u{1F4DA} Would you like to add CopilotKit documentation to your IDE? (Provides AI assistant with CopilotKit context)",
470
- when: async () => {
471
- const installedIDEs = await detectInstalledIDEs();
472
- return installedIDEs.length > 0;
473
- },
474
- validate: (input) => {
475
- try {
476
- YesNoSchema.parse(input);
477
- return true;
478
- } catch (error) {
479
- return "Please select Yes or No";
503
+ ];
504
+ }
505
+ function getCloudDeploymentQuestions() {
506
+ return [
507
+ {
508
+ type: "yes/no",
509
+ name: "useCopilotCloud",
510
+ message: "\u{1FA81} Deploy with Copilot Cloud? (recommended for production)",
511
+ when: (answers) => answers.mode === "Standard" || answers.mode === "MCP" || answers.mode === "LangGraph" && answers.alreadyDeployed === "No" || // Include new LangGraph agents
512
+ answers.mode !== "CrewAI" && // Crews only cloud, flows are self-hosted
513
+ answers.alreadyDeployed === "Yes" && answers.langGraphPlatform !== "No" && !linkToDocs.includes(answers.mode || "") && !isLocalhost(answers.langGraphPlatformUrl || ""),
514
+ validate: (input) => {
515
+ try {
516
+ YesNoSchema.parse(input);
517
+ return true;
518
+ } catch (error) {
519
+ return "Please select Yes or No";
520
+ }
480
521
  }
481
522
  }
482
- },
483
- {
484
- type: "select",
485
- name: "selectedIDE",
486
- message: "\u{1F4BB} Which IDE would you like to configure with CopilotKit documentation?",
487
- choices: async () => {
488
- const installedIDEs = await detectInstalledIDEs();
489
- const choices = installedIDEs.map((ide) => ({
490
- name: IDE_DOCS_CONFIGS[ide].displayName,
491
- value: ide
492
- }));
493
- choices.push({ name: "Skip", value: "skip" });
494
- return choices;
495
- },
496
- when: (answers) => answers.setupIDEDocs === "Yes"
497
- }
498
- ];
523
+ ];
524
+ }
525
+ var questions = getQuestionsForBranch("C");
499
526
 
500
527
  // src/lib/init/scaffold/shadcn.ts
501
528
  import spawn from "cross-spawn";
@@ -504,17 +531,11 @@ async function scaffoldShadCN(flags, userAnswers) {
504
531
  const components = [];
505
532
  switch (userAnswers.mode) {
506
533
  case "LangGraph":
507
- if (userAnswers.langGraphAgent || flags.booth) {
508
- components.push(...templateMapping.LangGraphStarter);
534
+ components.push(templateMapping.LangGraphGeneric);
535
+ if (userAnswers.langGraphPlatform === "Yes") {
536
+ components.push(templateMapping.LangGraphPlatformRuntime);
509
537
  } else {
510
- components.push(templateMapping.LangGraphGeneric);
511
- if (userAnswers.useCopilotCloud !== "Yes") {
512
- if (userAnswers.langGraphPlatform === "Yes") {
513
- components.push(templateMapping.LangGraphPlatformRuntime);
514
- } else {
515
- components.push(templateMapping.RemoteEndpoint);
516
- }
517
- }
538
+ components.push(templateMapping.RemoteEndpoint);
518
539
  }
519
540
  break;
520
541
  case "CrewAI":
@@ -528,13 +549,13 @@ async function scaffoldShadCN(flags, userAnswers) {
528
549
  break;
529
550
  case "MCP":
530
551
  components.push(templateMapping.McpStarter);
531
- if (userAnswers.useCopilotCloud !== "Yes") {
552
+ if (userAnswers.deploymentChoice === "Self-hosted" || userAnswers.useCopilotCloud === "No") {
532
553
  components.push(templateMapping.McpRuntime);
533
554
  }
534
555
  break;
535
556
  case "Standard":
536
557
  components.push(templateMapping.StandardStarter);
537
- if (userAnswers.useCopilotCloud !== "Yes") {
558
+ if (userAnswers.deploymentChoice === "Self-hosted" || userAnswers.useCopilotCloud === "No") {
538
559
  components.push(templateMapping.StandardRuntime);
539
560
  }
540
561
  break;
@@ -584,6 +605,12 @@ async function getLangGraphAgents(url, langSmithApiKey) {
584
605
 
585
606
  // src/lib/init/scaffold/env.ts
586
607
  import inquirer from "inquirer";
608
+ function needsCloudDeployment(userAnswers) {
609
+ return userAnswers.deploymentChoice === "Copilot Cloud" || // Branch B choice
610
+ userAnswers.useCopilotCloud === "Yes" || // Branch C choice
611
+ userAnswers.mode === "CrewAI" || // CrewAI always needs cloud
612
+ !userAnswers.deploymentChoice && !userAnswers.useCopilotCloud;
613
+ }
587
614
  async function scaffoldEnv(flags, userAnswers) {
588
615
  try {
589
616
  const envFile = path2.join(process.cwd(), ".env");
@@ -592,6 +619,7 @@ async function scaffoldEnv(flags, userAnswers) {
592
619
  } else {
593
620
  }
594
621
  let newEnvValues = "";
622
+ const isCloudDeployment = needsCloudDeployment(userAnswers);
595
623
  if (userAnswers.copilotCloudPublicApiKey) {
596
624
  newEnvValues += `NEXT_PUBLIC_COPILOT_API_KEY=${userAnswers.copilotCloudPublicApiKey}
597
625
  `;
@@ -613,7 +641,7 @@ async function scaffoldEnv(flags, userAnswers) {
613
641
  `;
614
642
  newEnvValues += `LANGGRAPH_DEPLOYMENT_URL=http://localhost:8123
615
643
  `;
616
- } else if (userAnswers.langGraphPlatform === "Yes" && userAnswers.useCopilotCloud !== "Yes") {
644
+ } else if (userAnswers.langGraphPlatform === "Yes" && !isCloudDeployment) {
617
645
  newEnvValues += `LANGGRAPH_DEPLOYMENT_URL=${userAnswers.langGraphPlatformUrl}
618
646
  `;
619
647
  } else if (userAnswers.langGraphRemoteEndpointURL) {
@@ -623,12 +651,15 @@ async function scaffoldEnv(flags, userAnswers) {
623
651
  if (flags.runtimeUrl) {
624
652
  newEnvValues += `NEXT_PUBLIC_COPILOTKIT_RUNTIME_URL=${flags.runtimeUrl}
625
653
  `;
626
- } else if (userAnswers.useCopilotCloud !== "Yes" && userAnswers.crewType !== "Crews" && userAnswers.crewType !== "Flows") {
654
+ } else if (!isCloudDeployment && userAnswers.crewType !== "Crews" && userAnswers.crewType !== "Flows") {
627
655
  newEnvValues += `NEXT_PUBLIC_COPILOTKIT_RUNTIME_URL=/api/copilotkit
628
656
  `;
629
657
  }
630
658
  if (userAnswers.langGraphPlatformUrl && (userAnswers.langSmithApiKey || isLocalhost(userAnswers.langGraphPlatformUrl))) {
631
- const langGraphAgents = await getLangGraphAgents(userAnswers.langGraphPlatformUrl, userAnswers.langSmithApiKey || "");
659
+ const langGraphAgents = await getLangGraphAgents(
660
+ userAnswers.langGraphPlatformUrl,
661
+ userAnswers.langSmithApiKey || ""
662
+ );
632
663
  let langGraphAgent = "";
633
664
  if (langGraphAgents.length > 1) {
634
665
  const { langGraphAgentChoice } = await inquirer.prompt([
@@ -937,6 +968,8 @@ export {
937
968
  ConfigSchema,
938
969
  CrewFlowTemplateSchema,
939
970
  CrewTypeSchema,
971
+ DEPLOYMENT_CHOICES,
972
+ DeploymentChoiceSchema,
940
973
  IDE_DOCS_CONFIGS,
941
974
  LANGGRAPH_AGENTS,
942
975
  LLMApiKeySchema,
@@ -951,6 +984,7 @@ export {
951
984
  addCrewInputs,
952
985
  cloneGitHubSubdirectory,
953
986
  detectInstalledIDEs,
987
+ getQuestionsForBranch,
954
988
  handleIDEDocsSetup,
955
989
  isLocalhost,
956
990
  isValidGitHubUrl,