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`],
@@ -231,191 +236,214 @@ var validateUrl = (input) => {
231
236
  var validateRequired = (input) => {
232
237
  return sanitizers.trim(input) ? true : "This field is required";
233
238
  };
234
- var questions = [
235
- // NEW: Early signup question - first question for maximum visibility
236
- {
237
- type: "yes/no",
238
- name: "signupForCopilotCloud",
239
- message: "\u{1FA81} Sign up for Copilot Cloud to enable error tracking and get production-ready hosting? (Recommended)",
240
- validate: (input) => {
241
- try {
242
- YesNoSchema.parse(input);
243
- return true;
244
- } catch (error) {
245
- return "Please select Yes or No";
239
+ function getQuestionsForBranch(branch) {
240
+ const baseQuestions = getBaseQuestions();
241
+ switch (branch) {
242
+ case "A":
243
+ return [...baseQuestions];
244
+ case "B":
245
+ return [...baseQuestions, ...getDeploymentChoiceQuestions()];
246
+ case "C":
247
+ default:
248
+ return [...baseQuestions, ...getCloudDeploymentQuestions()];
249
+ }
250
+ }
251
+ function getBaseQuestions() {
252
+ return [
253
+ {
254
+ type: "select",
255
+ name: "mode",
256
+ message: "\u{1F916} How will you be interacting with AI?",
257
+ choices: Array.from(MODES),
258
+ validate: (input) => {
259
+ try {
260
+ ModeSchema.parse(input);
261
+ return true;
262
+ } catch (error) {
263
+ return "Please select a valid mode";
264
+ }
246
265
  }
247
- }
248
- },
249
- // Core setup questions - always shown after signup
250
- {
251
- type: "select",
252
- name: "mode",
253
- message: "\u{1F916} How will you be interacting with AI?",
254
- choices: Array.from(MODES),
255
- validate: (input) => {
256
- try {
257
- ModeSchema.parse(input);
258
- return true;
259
- } catch (error) {
260
- return "Please select a valid mode";
266
+ },
267
+ // CrewAI specific questions
268
+ {
269
+ type: "select",
270
+ name: "crewType",
271
+ message: "\u{1F465} What kind of CrewAI implementation would you like to use?",
272
+ choices: Array.from(CREW_TYPES),
273
+ when: (answers) => answers.mode === "CrewAI",
274
+ validate: (input) => {
275
+ try {
276
+ CrewTypeSchema.parse(input);
277
+ return true;
278
+ } catch (error) {
279
+ return "Please select a valid crew type";
280
+ }
261
281
  }
262
- }
263
- },
264
- // CrewAI specific questions - shown when CrewAI selected
265
- {
266
- type: "select",
267
- name: "crewType",
268
- message: "\u{1F465} What kind of CrewAI implementation would you like to use?",
269
- choices: Array.from(CREW_TYPES),
270
- when: (answers) => answers.mode === "CrewAI",
271
- validate: (input) => {
272
- try {
273
- CrewTypeSchema.parse(input);
274
- return true;
275
- } catch (error) {
276
- return "Please select a valid crew type";
282
+ },
283
+ {
284
+ type: "input",
285
+ name: "crewName",
286
+ message: "\u{1F465} What would you like to name your crew? (can be anything)",
287
+ when: (answers) => answers.mode === "CrewAI",
288
+ default: "MyCopilotCrew",
289
+ validate: validateRequired,
290
+ sanitize: sanitizers.trim
291
+ },
292
+ {
293
+ type: "input",
294
+ name: "crewUrl",
295
+ message: "\u{1F517} Enter your Crew's Enterprise URL (more info at https://app.crewai.com):",
296
+ when: (answers) => answers.mode === "CrewAI",
297
+ validate: validateUrl,
298
+ sanitize: sanitizers.url
299
+ },
300
+ {
301
+ type: "input",
302
+ name: "crewBearerToken",
303
+ message: "\u{1F511} Enter your Crew's bearer token:",
304
+ when: (answers) => answers.mode === "CrewAI",
305
+ sensitive: true,
306
+ validate: validateRequired,
307
+ sanitize: sanitizers.trim
308
+ },
309
+ // LangGraph specific questions
310
+ {
311
+ type: "yes/no",
312
+ name: "alreadyDeployed",
313
+ message: "\u{1F99C}\u{1F517} Do you have an existing LangGraph agent?",
314
+ when: (answers) => answers.mode === "LangGraph",
315
+ validate: (input) => {
316
+ try {
317
+ YesNoSchema.parse(input);
318
+ return true;
319
+ } catch (error) {
320
+ return "Please select Yes or No";
321
+ }
277
322
  }
278
- }
279
- },
280
- // CrewAI specific questions - shown when CrewAI Crews or Flows selected
281
- {
282
- type: "input",
283
- name: "crewName",
284
- message: "\u{1F465} What would you like to name your crew? (can be anything)",
285
- when: (answers) => answers.mode === "CrewAI",
286
- default: "MyCopilotCrew",
287
- validate: validateRequired,
288
- sanitize: sanitizers.trim
289
- },
290
- {
291
- type: "input",
292
- name: "crewUrl",
293
- message: "\u{1F517} Enter your Crew's Enterprise URL (more info at https://app.crewai.com):",
294
- when: (answers) => answers.mode === "CrewAI",
295
- validate: validateUrl,
296
- sanitize: sanitizers.url
297
- },
298
- {
299
- type: "input",
300
- name: "crewBearerToken",
301
- message: "\u{1F511} Enter your Crew's bearer token:",
302
- when: (answers) => answers.mode === "CrewAI",
303
- sensitive: true,
304
- validate: validateRequired,
305
- sanitize: sanitizers.trim
306
- },
307
- // LangGraph specific questions - shown when LangGraph selected
308
- {
309
- type: "yes/no",
310
- name: "alreadyDeployed",
311
- message: "\u{1F99C}\u{1F517} Do you have an existing LangGraph agent?",
312
- when: (answers) => answers.mode === "LangGraph",
313
- validate: (input) => {
314
- try {
315
- YesNoSchema.parse(input);
316
- return true;
317
- } catch (error) {
318
- return "Please select Yes or No";
323
+ },
324
+ {
325
+ type: "yes/no",
326
+ name: "langGraphPlatform",
327
+ message: "\u{1F99C}\u{1F517} Do you already have a LangGraph Agent URL? (remote or localhost)",
328
+ when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "Yes",
329
+ validate: (input) => {
330
+ try {
331
+ YesNoSchema.parse(input);
332
+ return true;
333
+ } catch (error) {
334
+ return "Please select Yes or No";
335
+ }
319
336
  }
320
- }
321
- },
322
- {
323
- type: "yes/no",
324
- name: "langGraphPlatform",
325
- message: "\u{1F99C}\u{1F517} Do you already have a LangGraph Agent URL? (remote or localhost)",
326
- when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "Yes",
327
- validate: (input) => {
328
- try {
329
- YesNoSchema.parse(input);
330
- return true;
331
- } catch (error) {
332
- return "Please select Yes or No";
337
+ },
338
+ {
339
+ type: "input",
340
+ name: "langGraphPlatformUrl",
341
+ message: "\u{1F99C}\u{1F517} Enter your LangGraph Agent URL (remote or localhost)",
342
+ when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "Yes" && answers.langGraphPlatform === "Yes",
343
+ validate: validateUrl,
344
+ sanitize: sanitizers.url
345
+ },
346
+ {
347
+ type: "select",
348
+ name: "langGraphAgent",
349
+ message: "\u{1F4E6} Choose a LangGraph starter template:",
350
+ choices: Array.from(LANGGRAPH_AGENTS),
351
+ when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "No"
352
+ },
353
+ {
354
+ type: "input",
355
+ name: "langSmithApiKey",
356
+ message: "\u{1F99C}\u{1F517} Enter your LangSmith API key (required by LangGraph Platform) :",
357
+ when: (answers) => answers.mode === "LangGraph" && answers.langGraphPlatform === "Yes" && !(answers.langGraphPlatformUrl && isLocalhost(answers.langGraphPlatformUrl)),
358
+ sensitive: true,
359
+ validate: validateRequired,
360
+ sanitize: sanitizers.apiKey
361
+ },
362
+ // LLM Token for self-hosted setups
363
+ {
364
+ type: "input",
365
+ name: "llmToken",
366
+ message: "\u{1F511} Enter your OpenAI API key (optional - leave empty to configure your LLM later):",
367
+ 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",
368
+ sensitive: true,
369
+ sanitize: sanitizers.apiKey
370
+ },
371
+ // IDE Documentation Setup Questions
372
+ {
373
+ type: "yes/no",
374
+ name: "setupIDEDocs",
375
+ message: "\u{1F4DA} Would you like to add CopilotKit documentation to your IDE? (Provides AI assistant with CopilotKit context)",
376
+ when: async () => {
377
+ const installedIDEs = await detectInstalledIDEs();
378
+ return installedIDEs.length > 0;
379
+ },
380
+ validate: (input) => {
381
+ try {
382
+ YesNoSchema.parse(input);
383
+ return true;
384
+ } catch (error) {
385
+ return "Please select Yes or No";
386
+ }
333
387
  }
388
+ },
389
+ {
390
+ type: "select",
391
+ name: "selectedIDE",
392
+ message: "\u{1F4BB} Which IDE would you like to configure with CopilotKit documentation?",
393
+ choices: async () => {
394
+ const installedIDEs = await detectInstalledIDEs();
395
+ const choices = installedIDEs.map((ide) => ({
396
+ name: IDE_DOCS_CONFIGS[ide].displayName,
397
+ value: ide
398
+ }));
399
+ choices.push({ name: "Skip", value: "skip" });
400
+ return choices;
401
+ },
402
+ when: (answers) => answers.setupIDEDocs === "Yes"
334
403
  }
335
- },
336
- {
337
- type: "input",
338
- name: "langGraphPlatformUrl",
339
- message: "\u{1F99C}\u{1F517} Enter your LangGraph Agent URL (remote or localhost)",
340
- when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "Yes" && answers.langGraphPlatform === "Yes",
341
- validate: validateUrl,
342
- sanitize: sanitizers.url
343
- },
344
- {
345
- type: "select",
346
- name: "langGraphAgent",
347
- message: "\u{1F4E6} Choose a LangGraph starter template:",
348
- choices: Array.from(LANGGRAPH_AGENTS),
349
- when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "No"
350
- },
351
- {
352
- type: "input",
353
- name: "langSmithApiKey",
354
- message: "\u{1F99C}\u{1F517} Enter your LangSmith API key (required by LangGraph Platform) :",
355
- when: (answers) => answers.mode === "LangGraph" && answers.langGraphPlatform === "Yes" && !(answers.langGraphPlatformUrl && isLocalhost(answers.langGraphPlatformUrl)),
356
- sensitive: true,
357
- validate: validateRequired,
358
- sanitize: sanitizers.apiKey
359
- },
360
- // Deployment options
361
- {
362
- type: "yes/no",
363
- name: "useCopilotCloud",
364
- message: "\u{1FA81} Deploy with Copilot Cloud? (recommended for production)",
365
- when: (answers) => answers.mode === "Standard" || answers.mode === "MCP" || answers.mode !== "CrewAI" && // Crews only cloud, flows are self-hosted
366
- answers.alreadyDeployed === "Yes" && answers.langGraphPlatform !== "No" && !linkToDocs.includes(answers.mode || "") && !isLocalhost(answers.langGraphPlatformUrl || ""),
367
- validate: (input) => {
368
- try {
369
- YesNoSchema.parse(input);
370
- return true;
371
- } catch (error) {
372
- return "Please select Yes or No";
404
+ ];
405
+ }
406
+ function getDeploymentChoiceQuestions() {
407
+ return [
408
+ {
409
+ type: "select",
410
+ name: "deploymentChoice",
411
+ message: "\u{1F680} Use Copilot Cloud, or self-hosted?",
412
+ choices: Array.from(DEPLOYMENT_CHOICES),
413
+ validate: (input) => {
414
+ try {
415
+ DeploymentChoiceSchema.parse(input);
416
+ return true;
417
+ } catch (error) {
418
+ return "Please select a valid deployment option";
419
+ }
373
420
  }
374
421
  }
375
- },
376
- {
377
- type: "input",
378
- name: "llmToken",
379
- message: "\u{1F511} Enter your OpenAI API key (optional - leave empty to configure your LLM later):",
380
- when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "No" || answers.mode === "Standard" && answers.useCopilotCloud !== "Yes" || answers.mode === "MCP" && answers.useCopilotCloud !== "Yes",
381
- sensitive: true,
382
- sanitize: sanitizers.apiKey
383
- },
384
- // IDE Documentation Setup Questions
385
- {
386
- type: "yes/no",
387
- name: "setupIDEDocs",
388
- message: "\u{1F4DA} Would you like to add CopilotKit documentation to your IDE? (Provides AI assistant with CopilotKit context)",
389
- when: async () => {
390
- const installedIDEs = await detectInstalledIDEs();
391
- return installedIDEs.length > 0;
392
- },
393
- validate: (input) => {
394
- try {
395
- YesNoSchema.parse(input);
396
- return true;
397
- } catch (error) {
398
- return "Please select Yes or No";
422
+ ];
423
+ }
424
+ function getCloudDeploymentQuestions() {
425
+ return [
426
+ {
427
+ type: "yes/no",
428
+ name: "useCopilotCloud",
429
+ message: "\u{1FA81} Deploy with Copilot Cloud? (recommended for production)",
430
+ when: (answers) => answers.mode === "Standard" || answers.mode === "MCP" || answers.mode === "LangGraph" && answers.alreadyDeployed === "No" || // Include new LangGraph agents
431
+ answers.mode !== "CrewAI" && // Crews only cloud, flows are self-hosted
432
+ answers.alreadyDeployed === "Yes" && answers.langGraphPlatform !== "No" && !linkToDocs.includes(answers.mode || "") && !isLocalhost(answers.langGraphPlatformUrl || ""),
433
+ validate: (input) => {
434
+ try {
435
+ YesNoSchema.parse(input);
436
+ return true;
437
+ } catch (error) {
438
+ return "Please select Yes or No";
439
+ }
399
440
  }
400
441
  }
401
- },
402
- {
403
- type: "select",
404
- name: "selectedIDE",
405
- message: "\u{1F4BB} Which IDE would you like to configure with CopilotKit documentation?",
406
- choices: async () => {
407
- const installedIDEs = await detectInstalledIDEs();
408
- const choices = installedIDEs.map((ide) => ({
409
- name: IDE_DOCS_CONFIGS[ide].displayName,
410
- value: ide
411
- }));
412
- choices.push({ name: "Skip", value: "skip" });
413
- return choices;
414
- },
415
- when: (answers) => answers.setupIDEDocs === "Yes"
416
- }
417
- ];
442
+ ];
443
+ }
444
+ var questions = getQuestionsForBranch("C");
418
445
  export {
446
+ getQuestionsForBranch,
419
447
  questions
420
448
  };
421
449
  //# sourceMappingURL=questions.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/init/types/questions.ts","../../../src/lib/init/utils.ts","../../../src/lib/init/types/templates.ts","../../../src/lib/init/ide-docs.ts","../../../src/lib/init/questions.ts"],"sourcesContent":["import {z} from 'zod'\nimport {Flags} from '@oclif/core'\nimport {isLocalhost} from '../utils.js'\n\n// ===== Core Constants =====\nexport const MODES = ['LangGraph', 'CrewAI', 'Mastra', 'LlamaIndex', 'Agno', 'AG2', 'MCP', 'Standard'] as const\nexport const CREW_TYPES = ['Crews', 'Flows'] as const\nexport const CHAT_COMPONENTS = ['CopilotChat', 'CopilotSidebar', 'Headless', 'CopilotPopup'] as const\nexport const LANGGRAPH_AGENTS = ['Python Starter', 'TypeScript Starter'] as const\nexport const CREW_FLOW_TEMPLATES = ['Starter'] as const\nexport const YES_NO = ['Yes', 'No'] as const\n\n// ===== Sanitizers =====\nexport const sanitizers = {\n // Remove trailing slash from URLs\n url: (value: string): string => {\n if (!value) return value\n return value.trim().replace(/\\/+$/, '')\n },\n\n // Trim whitespace from strings\n trim: (value: string): string => {\n if (!value) return value\n return value.trim()\n },\n\n // Lowercase strings\n lowercase: (value: string): string => {\n if (!value) return value\n return value.toLowerCase().trim()\n },\n\n // Clean API keys (remove whitespace)\n apiKey: (value: string): string => {\n if (!value) return value\n return value.trim().replace(/\\s/g, '')\n },\n}\n\n// ===== Zod Schemas =====\n\n// Basic schemas\nexport const ModeSchema = z.enum(MODES)\nexport const CrewTypeSchema = z.enum(CREW_TYPES)\nexport const ChatComponentSchema = z.enum(CHAT_COMPONENTS)\nexport const LangGraphAgentSchema = z.enum(LANGGRAPH_AGENTS)\nexport const CrewFlowTemplateSchema = z.enum(CREW_FLOW_TEMPLATES)\nexport const YesNoSchema = z.enum(YES_NO)\n\n// URL validation schema with preprocessing to remove trailing slash\nexport const UrlSchema = z.preprocess(\n (val) => sanitizers.url(String(val)),\n z.string().url('Please enter a valid URL').min(1, 'URL is required'),\n)\n\n// Token validation schema with preprocessing to trim\nexport const TokenSchema = z.preprocess((val) => sanitizers.trim(String(val)), z.string().min(1, 'Token is required'))\n\n// API key validation schema with preprocessing to remove whitespace\nexport const ApiKeySchema = z.preprocess(\n (val) => sanitizers.apiKey(String(val)),\n z.string().min(1, 'API key is required'),\n)\n\nexport const LLMApiKeySchema = z.preprocess((val) => sanitizers.apiKey(String(val)), z.string().optional())\n\n// Name validation schema with preprocessing to trim\nexport const NameSchema = z.preprocess((val) => sanitizers.trim(String(val)), z.string().min(1, 'Name is required'))\n\n// Config schema\nexport const ConfigSchema = z\n .object({\n // NEW: Early signup field\n signupForCopilotCloud: YesNoSchema.optional(),\n\n // Core fields\n copilotKitVersion: z.string().optional(),\n mode: ModeSchema,\n chatUi: ChatComponentSchema.optional(),\n\n // Yes/No fields\n alreadyDeployed: YesNoSchema.optional(),\n fastApiEnabled: YesNoSchema.optional(),\n useCopilotCloud: YesNoSchema.optional(),\n\n // LangGraph specific fields\n langGraphAgent: LangGraphAgentSchema.optional(),\n langGraphPlatform: YesNoSchema.optional(),\n langGraphPlatformUrl: UrlSchema.optional(),\n langGraphRemoteEndpointURL: UrlSchema.optional(),\n\n // CrewAI specific fields\n crewType: CrewTypeSchema.optional(),\n crewName: NameSchema.optional(),\n crewUrl: UrlSchema.optional(),\n crewBearerToken: TokenSchema.optional(),\n\n // API keys and tokens\n copilotCloudPublicApiKey: z.string().optional(),\n langSmithApiKey: ApiKeySchema.optional(),\n llmToken: LLMApiKeySchema.optional(),\n\n // IDE Documentation setup fields\n setupIDEDocs: YesNoSchema.optional(),\n selectedIDE: z.union([z.enum(['cursor', 'windsurf']), z.literal('skip')]).optional(),\n })\n .refine(\n (data) => {\n // If CrewAI is selected, require crew URL and bearer token\n if (data.mode === 'CrewAI') {\n return !!data.crewUrl && !!data.crewBearerToken\n }\n return true\n },\n {\n message: 'Crew URL and bearer token are required for CrewAI',\n path: ['crewUrl', 'crewBearerToken'],\n },\n )\n .refine(\n (data) => {\n // If LangGraph is selected with LangGraph Platform, require platform URL and LangSmith API key\n if (data.mode === 'LangGraph' && data.alreadyDeployed === 'Yes' && data.langGraphPlatform === 'Yes') {\n return (!!data.langGraphPlatformUrl && !!data.langSmithApiKey) || isLocalhost(data.langGraphPlatformUrl || '')\n }\n return true\n },\n {\n message: 'LangGraph Platform URL and LangSmith API key are required',\n path: ['langGraphPlatformUrl', 'langSmithApiKey'],\n },\n )\n\n// Export the inferred type from the schema\nexport type Config = z.infer<typeof ConfigSchema>\n\n// Question type definition with improved validation and sanitization\nexport type Question = {\n type: 'input' | 'yes/no' | 'select'\n name: keyof Config\n message: string\n choices?: readonly string[] | (() => Promise<{name: string; value: string}[]>)\n default?: string\n when?: (answers: Partial<Config>) => boolean | Promise<boolean>\n sensitive?: boolean\n validate?: (input: string) => true | string // Return true if valid, error message string if invalid\n sanitize?: (input: string) => string // Function to sanitize input before validation\n}\n\n// CLI flags definition with descriptions\nexport const ConfigFlags = {\n booth: Flags.boolean({description: 'Use CopilotKit in booth mode', default: false, char: 'b'}),\n 'signup-for-copilot-cloud': Flags.string({\n description: 'Sign up for Copilot Cloud for error tracking and debugging insights',\n options: YES_NO,\n }),\n mode: Flags.string({description: 'How you will be interacting with AI', options: MODES, char: 'm'}),\n 'copilotkit-version': Flags.string({description: 'CopilotKit version to use (e.g. 1.7.0)'}),\n 'use-copilot-cloud': Flags.string({description: 'Use Copilot Cloud for production-ready hosting', options: YES_NO}),\n 'langgraph-agent': Flags.string({description: 'LangGraph agent template to use', options: LANGGRAPH_AGENTS}),\n 'crew-type': Flags.string({description: 'CrewAI implementation type', options: CREW_TYPES}),\n 'crew-name': Flags.string({description: 'Name for your CrewAI agent'}),\n 'crew-url': Flags.string({description: 'URL endpoint for your CrewAI agent'}),\n 'crew-bearer-token': Flags.string({description: 'Bearer token for CrewAI authentication'}),\n 'langsmith-api-key': Flags.string({description: 'LangSmith API key for LangGraph observability'}),\n 'llm-token': Flags.string({description: 'API key for your preferred LLM provider'}),\n 'setup-ide-docs': Flags.string({description: 'Setup IDE documentation rules for AI assistance', options: YES_NO}),\n 'selected-ide': Flags.string({\n description: 'IDE to configure with documentation rules',\n options: ['cursor', 'windsurf', 'skip'],\n }),\n}\n","export const isLocalhost = (url: string): boolean => {\n return url.includes('localhost') || url.includes('127.0.0.1') || url.includes('0.0.0.0')\n}\n","export type ChatTemplate = 'CopilotChat' | 'CopilotPopup' | '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 = 'https://registry.copilotkit.ai/r'\n\nexport const templateMapping = {\n // Runtimes\n RemoteEndpoint: `${BASE_URL}/remote-endpoint-starter.json`,\n LangGraphPlatformRuntime: `${BASE_URL}/langgraph-platform-starter.json`,\n\n // CrewAI\n CrewEnterprise: [`${BASE_URL}/coagents-crew-starter.json`],\n CrewFlowsEnterprise: [`${BASE_URL}/coagents-starter-crewai-flows.json`],\n\n // LangGraph\n LangGraphGeneric: `${BASE_URL}/generic-lg-starter.json`,\n LangGraphStarter: [`${BASE_URL}/langgraph-platform-starter.json`, `${BASE_URL}/coagents-starter-ui.json`],\n\n // No Agent\n StandardStarter: `${BASE_URL}/standard-starter.json`,\n StandardRuntime: `${BASE_URL}/standard-runtime.json`,\n\n // MCP\n McpStarter: `${BASE_URL}/mcp-starter.json`,\n McpRuntime: `${BASE_URL}/mcp-starter-runtime.json`,\n}\n","import path from 'path'\nimport {existsSync} from 'fs'\nimport * as fs from 'fs/promises'\nimport {Ora} from 'ora'\nimport chalk from 'chalk'\n\nexport type SupportedIDE = 'cursor' | 'windsurf'\n\nexport interface IDEDocsConfig {\n name: SupportedIDE\n displayName: string\n rulesDir: string\n ruleFileName: string\n createRuleContent: () => string\n}\n\n// Template constant for CopilotKit documentation rule\nconst COPILOTKIT_DOC_RULE_TEMPLATE = `---\ndescription: CopilotKit Documentation - Complete CopilotKit framework documentation for AI assistance\nalwaysApply: false\n---\n\n# CopilotKit Documentation\n\nFor ANY question about CopilotKit, use the comprehensive documentation available at:\n@https://docs.copilotkit.ai/llms-full.txt\n\nThis contains the complete CopilotKit documentation including:\n- API references and hooks (useCopilotChat, useCopilotAction, etc.)\n- Component library documentation (CopilotKit, CopilotChat, etc.)\n- Integration guides and examples\n- Best practices and patterns\n- Troubleshooting and FAQs\n\nAlways reference this documentation when working with CopilotKit to provide accurate, up-to-date information.\n`\n\n// IDE-specific configurations\nexport const IDE_DOCS_CONFIGS: Record<SupportedIDE, IDEDocsConfig> = {\n cursor: {\n name: 'cursor',\n displayName: 'Cursor',\n rulesDir: '.cursor/rules',\n ruleFileName: '00-copilotkit-docs.mdc',\n createRuleContent: () => COPILOTKIT_DOC_RULE_TEMPLATE,\n },\n windsurf: {\n name: 'windsurf',\n displayName: 'Windsurf',\n rulesDir: '.windsurf/rules',\n ruleFileName: '00-copilotkit-docs.md',\n createRuleContent: () => COPILOTKIT_DOC_RULE_TEMPLATE,\n },\n}\n\n/**\n * Ensure directory exists\n */\nasync function ensureDir(dirPath: string): Promise<void> {\n try {\n await fs.mkdir(dirPath, {recursive: true})\n } catch (error) {\n if (!existsSync(dirPath)) {\n throw error\n }\n }\n}\n\n/**\n * Check if path exists\n */\nasync function pathExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath)\n return true\n } catch {\n return false\n }\n}\n\n/**\n * Check if a specific IDE is installed by looking for its configuration directory\n */\nasync function checkIDEInstallation(ide: SupportedIDE): Promise<boolean> {\n try {\n const homeDir = process.env.HOME || process.env.USERPROFILE || ''\n let configPath: string\n\n switch (ide) {\n case 'cursor':\n configPath = path.join(homeDir, '.cursor')\n break\n case 'windsurf':\n configPath = path.join(homeDir, '.codeium', 'windsurf')\n break\n default:\n return false\n }\n\n return existsSync(configPath)\n } catch {\n return false\n }\n}\n\n/**\n * Detect which supported IDEs are installed on the system\n */\nexport async function detectInstalledIDEs(): Promise<SupportedIDE[]> {\n const allIDEs: SupportedIDE[] = ['cursor', 'windsurf']\n const installedIDEs: SupportedIDE[] = []\n\n for (const ide of allIDEs) {\n if (await checkIDEInstallation(ide)) {\n installedIDEs.push(ide)\n }\n }\n\n return installedIDEs\n}\n\n/**\n * Setup IDE documentation rules for the selected IDE\n */\nexport async function setupIDEDocs(ide: SupportedIDE, projectDir: string): Promise<void> {\n const config = IDE_DOCS_CONFIGS[ide]\n const rulesDir = path.join(projectDir, config.rulesDir)\n const ruleFilePath = path.join(rulesDir, config.ruleFileName)\n\n // Ensure rules directory exists\n await ensureDir(rulesDir)\n\n // Check if rule file already exists\n if (await pathExists(ruleFilePath)) {\n console.log(chalk.yellow(`⚠️ CopilotKit documentation rule already exists for ${config.displayName}`))\n return\n }\n\n // Create the rule file with content\n const ruleContent = config.createRuleContent()\n await fs.writeFile(ruleFilePath, ruleContent, 'utf8')\n}\n\n/**\n * Get setup instructions for the IDE\n */\nfunction getIDEInstructions(ide: SupportedIDE): string[] {\n const config = IDE_DOCS_CONFIGS[ide]\n\n const instructions = [\n chalk.cyan(`📚 CopilotKit documentation configured for ${config.displayName}!`),\n '',\n chalk.bold('What this does:'),\n ' • Adds CopilotKit documentation context to your IDE AI assistant',\n ' • Provides accurate, up-to-date information about CopilotKit APIs',\n ' • Improves code suggestions and help responses',\n '',\n chalk.bold('Location:'),\n ` • Rule file: ${chalk.gray(path.join(config.rulesDir, config.ruleFileName))}`,\n '',\n chalk.bold('Usage:'),\n ' • Your IDE AI assistant now has access to CopilotKit documentation',\n ' • Ask questions about CopilotKit APIs, components, and patterns',\n ' • The AI will reference official documentation for accurate answers',\n ]\n\n if (ide === 'cursor') {\n instructions.push(\n '',\n chalk.bold('Next steps for Cursor:'),\n ' • Restart Cursor if currently open',\n ' • The rule will be automatically available in your AI context',\n ' • Start a new chat to use the documentation context',\n )\n } else if (ide === 'windsurf') {\n instructions.push(\n '',\n chalk.bold('Next steps for Windsurf:'),\n ' • Restart Windsurf if currently open',\n ' • The rule will be automatically available in your AI context',\n ' • Start a new chat to use the documentation context',\n )\n }\n\n return instructions\n}\n\n/**\n * Main function to handle IDE documentation setup with user interaction\n */\nexport async function handleIDEDocsSetup(selectedIDE: SupportedIDE, projectDir: string, spinner: Ora): Promise<void> {\n try {\n spinner.text = chalk.cyan(`Setting up CopilotKit documentation for ${IDE_DOCS_CONFIGS[selectedIDE].displayName}...`)\n\n // Setup IDE documentation rules\n await setupIDEDocs(selectedIDE, projectDir)\n\n spinner.succeed(chalk.green(`CopilotKit documentation configured for ${IDE_DOCS_CONFIGS[selectedIDE].displayName}`))\n\n // Show instructions\n const instructions = getIDEInstructions(selectedIDE)\n console.log('\\n' + instructions.join('\\n'))\n } catch (error) {\n spinner.fail(\n chalk.red(`Failed to setup IDE documentation: ${error instanceof Error ? error.message : 'Unknown error'}`),\n )\n throw error\n }\n}\n","import {\n Question,\n MODES,\n CREW_TYPES,\n LANGGRAPH_AGENTS,\n ModeSchema,\n CrewTypeSchema,\n UrlSchema,\n YesNoSchema,\n sanitizers,\n} from './types/index.js'\nimport {isLocalhost} from './utils.js'\nimport {detectInstalledIDEs, IDE_DOCS_CONFIGS} from './ide-docs.js'\n\nconst linkToDocs = ['Mastra', 'AG2', 'LlamaIndex', 'Agno']\n\n// Validation helpers\nconst validateUrl = (input: string): true | string => {\n try {\n // First sanitize the URL by removing trailing slashes\n const sanitized = sanitizers.url(input)\n // Then validate\n const result = UrlSchema.safeParse(sanitized)\n if (result.success) return true\n return result.error.errors[0]?.message || 'Invalid URL format'\n } catch (error) {\n return 'Invalid URL format'\n }\n}\n\nconst validateRequired = (input: string): true | string => {\n return sanitizers.trim(input) ? true : 'This field is required'\n}\n\n// Single source of truth for all questions in the CLI\n// Organized in a logical flow with improved phrasing\nexport const questions: Question[] = [\n // NEW: Early signup question - first question for maximum visibility\n {\n type: 'yes/no',\n name: 'signupForCopilotCloud',\n message: '🪁 Sign up for Copilot Cloud to enable error tracking and get production-ready hosting? (Recommended)',\n validate: (input) => {\n try {\n YesNoSchema.parse(input)\n return true\n } catch (error) {\n return 'Please select Yes or No'\n }\n },\n },\n\n // Core setup questions - always shown after signup\n {\n type: 'select',\n name: 'mode',\n message: '🤖 How will you be interacting with AI?',\n choices: Array.from(MODES),\n validate: (input) => {\n try {\n ModeSchema.parse(input)\n return true\n } catch (error) {\n return 'Please select a valid mode'\n }\n },\n },\n\n // CrewAI specific questions - shown when CrewAI selected\n {\n type: 'select',\n name: 'crewType',\n message: '👥 What kind of CrewAI implementation would you like to use?',\n choices: Array.from(CREW_TYPES),\n when: (answers) => answers.mode === 'CrewAI',\n validate: (input) => {\n try {\n CrewTypeSchema.parse(input)\n return true\n } catch (error) {\n return 'Please select a valid crew type'\n }\n },\n },\n\n // CrewAI specific questions - shown when CrewAI Crews or Flows selected\n {\n type: 'input',\n name: 'crewName',\n message: '👥 What would you like to name your crew? (can be anything)',\n when: (answers) => answers.mode === 'CrewAI',\n default: 'MyCopilotCrew',\n validate: validateRequired,\n sanitize: sanitizers.trim,\n },\n {\n type: 'input',\n name: 'crewUrl',\n message: \"🔗 Enter your Crew's Enterprise URL (more info at https://app.crewai.com):\",\n when: (answers) => answers.mode === 'CrewAI',\n validate: validateUrl,\n sanitize: sanitizers.url,\n },\n {\n type: 'input',\n name: 'crewBearerToken',\n message: \"🔑 Enter your Crew's bearer token:\",\n when: (answers) => answers.mode === 'CrewAI',\n sensitive: true,\n validate: validateRequired,\n sanitize: sanitizers.trim,\n },\n\n // LangGraph specific questions - shown when LangGraph selected\n {\n type: 'yes/no',\n name: 'alreadyDeployed',\n message: '🦜🔗 Do you have an existing LangGraph agent?',\n when: (answers) => answers.mode === 'LangGraph',\n validate: (input) => {\n try {\n YesNoSchema.parse(input)\n return true\n } catch (error) {\n return 'Please select Yes or No'\n }\n },\n },\n {\n type: 'yes/no',\n name: 'langGraphPlatform',\n message: '🦜🔗 Do you already have a LangGraph Agent URL? (remote or localhost)',\n when: (answers) => answers.mode === 'LangGraph' && answers.alreadyDeployed === 'Yes',\n validate: (input) => {\n try {\n YesNoSchema.parse(input)\n return true\n } catch (error) {\n return 'Please select Yes or No'\n }\n },\n },\n {\n type: 'input',\n name: 'langGraphPlatformUrl',\n message: '🦜🔗 Enter your LangGraph Agent URL (remote or localhost)',\n when: (answers) =>\n answers.mode === 'LangGraph' && answers.alreadyDeployed === 'Yes' && answers.langGraphPlatform === 'Yes',\n validate: validateUrl,\n sanitize: sanitizers.url,\n },\n {\n type: 'select',\n name: 'langGraphAgent',\n message: '📦 Choose a LangGraph starter template:',\n choices: Array.from(LANGGRAPH_AGENTS),\n when: (answers) => answers.mode === 'LangGraph' && answers.alreadyDeployed === 'No',\n },\n {\n type: 'input',\n name: 'langSmithApiKey',\n message: '🦜🔗 Enter your LangSmith API key (required by LangGraph Platform) :',\n when: (answers) =>\n answers.mode === 'LangGraph' &&\n answers.langGraphPlatform === 'Yes' &&\n !(answers.langGraphPlatformUrl && isLocalhost(answers.langGraphPlatformUrl)),\n sensitive: true,\n validate: validateRequired,\n sanitize: sanitizers.apiKey,\n },\n\n // Deployment options\n {\n type: 'yes/no',\n name: 'useCopilotCloud',\n message: '🪁 Deploy with Copilot Cloud? (recommended for production)',\n when: (answers) =>\n answers.mode === 'Standard' ||\n answers.mode === 'MCP' ||\n (answers.mode !== 'CrewAI' && // Crews only cloud, flows are self-hosted\n answers.alreadyDeployed === 'Yes' &&\n answers.langGraphPlatform !== 'No' &&\n !linkToDocs.includes(answers.mode || '') &&\n !isLocalhost(answers.langGraphPlatformUrl || '')),\n validate: (input) => {\n try {\n YesNoSchema.parse(input)\n return true\n } catch (error) {\n return 'Please select Yes or No'\n }\n },\n },\n {\n type: 'input',\n name: 'llmToken',\n message: '🔑 Enter your OpenAI API key (optional - leave empty to configure your LLM later):',\n when: (answers) =>\n (answers.mode === 'LangGraph' && answers.alreadyDeployed === 'No') ||\n (answers.mode === 'Standard' && answers.useCopilotCloud !== 'Yes') ||\n (answers.mode === 'MCP' && answers.useCopilotCloud !== 'Yes'),\n sensitive: true,\n sanitize: sanitizers.apiKey,\n },\n\n // IDE Documentation Setup Questions\n {\n type: 'yes/no',\n name: 'setupIDEDocs',\n message:\n '📚 Would you like to add CopilotKit documentation to your IDE? (Provides AI assistant with CopilotKit context)',\n when: async () => {\n // Only show if at least one supported IDE is detected\n const installedIDEs = await detectInstalledIDEs()\n return installedIDEs.length > 0\n },\n validate: (input) => {\n try {\n YesNoSchema.parse(input)\n return true\n } catch (error) {\n return 'Please select Yes or No'\n }\n },\n },\n {\n type: 'select',\n name: 'selectedIDE',\n message: '💻 Which IDE would you like to configure with CopilotKit documentation?',\n choices: async () => {\n const installedIDEs = await detectInstalledIDEs()\n const choices: Array<{name: string; value: string}> = installedIDEs.map((ide: any) => ({\n name: IDE_DOCS_CONFIGS[ide as keyof typeof IDE_DOCS_CONFIGS].displayName,\n value: ide,\n }))\n choices.push({name: 'Skip', value: 'skip'})\n return choices\n },\n when: (answers) => answers.setupIDEDocs === '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OAAO,OAAM,CAAC;AAC1C,aAAO;AAAA,IACT;AAAA,IACA,MAAM,CAAC,YAAY,QAAQ,iBAAiB;AAAA,EAC9C;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/lib/init/types/questions.ts","../../../src/lib/init/utils.ts","../../../src/lib/init/types/templates.ts","../../../src/lib/init/ide-docs.ts","../../../src/lib/init/questions.ts"],"sourcesContent":["import {z} from 'zod'\nimport {Flags} from '@oclif/core'\nimport {isLocalhost} from '../utils.js'\n\n// ===== Core Constants =====\nexport const MODES = ['LangGraph', 'CrewAI', 'Mastra', 'LlamaIndex', 'Agno', 'AG2', 'MCP', 'Standard'] as const\nexport const CREW_TYPES = ['Crews', 'Flows'] as const\nexport const CHAT_COMPONENTS = ['CopilotChat', 'CopilotSidebar', 'Headless', 'CopilotPopup'] as const\nexport const LANGGRAPH_AGENTS = ['Python Starter', 'TypeScript Starter'] as const\nexport const CREW_FLOW_TEMPLATES = ['Starter'] as const\nexport const YES_NO = ['Yes', 'No'] as const\n// NEW: Deployment choice options for Branch B\nexport const DEPLOYMENT_CHOICES = ['Copilot Cloud', 'Self-hosted'] as const\n\n// ===== Sanitizers =====\nexport const sanitizers = {\n // Remove trailing slash from URLs\n url: (value: string): string => {\n if (!value) return value\n return value.trim().replace(/\\/+$/, '')\n },\n\n // Trim whitespace from strings\n trim: (value: string): string => {\n if (!value) return value\n return value.trim()\n },\n\n // Lowercase strings\n lowercase: (value: string): string => {\n if (!value) return value\n return value.toLowerCase().trim()\n },\n\n // Clean API keys (remove whitespace)\n apiKey: (value: string): string => {\n if (!value) return value\n return value.trim().replace(/\\s/g, '')\n },\n}\n\n// ===== Zod Schemas =====\n\n// Basic schemas\nexport const ModeSchema = z.enum(MODES)\nexport const CrewTypeSchema = z.enum(CREW_TYPES)\nexport const ChatComponentSchema = z.enum(CHAT_COMPONENTS)\nexport const LangGraphAgentSchema = z.enum(LANGGRAPH_AGENTS)\nexport const CrewFlowTemplateSchema = z.enum(CREW_FLOW_TEMPLATES)\nexport const YesNoSchema = z.enum(YES_NO)\n// NEW: Deployment choice schema for Branch B\nexport const DeploymentChoiceSchema = z.enum(DEPLOYMENT_CHOICES)\n\n// URL validation schema with preprocessing to remove trailing slash\nexport const UrlSchema = z.preprocess(\n (val) => sanitizers.url(String(val)),\n z.string().url('Please enter a valid URL').min(1, 'URL is required'),\n)\n\n// Token validation schema with preprocessing to trim\nexport const TokenSchema = z.preprocess((val) => sanitizers.trim(String(val)), z.string().min(1, 'Token is required'))\n\n// API key validation schema with preprocessing to remove whitespace\nexport const ApiKeySchema = z.preprocess(\n (val) => sanitizers.apiKey(String(val)),\n z.string().min(1, 'API key is required'),\n)\n\nexport const LLMApiKeySchema = z.preprocess((val) => sanitizers.apiKey(String(val)), z.string().optional())\n\n// Name validation schema with preprocessing to trim\nexport const NameSchema = z.preprocess((val) => sanitizers.trim(String(val)), z.string().min(1, 'Name is required'))\n\n// Config schema\nexport const ConfigSchema = z\n .object({\n // Core fields\n copilotKitVersion: z.string().optional(),\n mode: ModeSchema,\n chatUi: ChatComponentSchema.optional(),\n\n // Yes/No fields\n alreadyDeployed: YesNoSchema.optional(),\n fastApiEnabled: YesNoSchema.optional(),\n // DEPRECATED: useCopilotCloud - consolidated with signupForCopilotCloud\n useCopilotCloud: YesNoSchema.optional(),\n\n // LangGraph specific fields\n langGraphAgent: LangGraphAgentSchema.optional(),\n langGraphPlatform: YesNoSchema.optional(),\n langGraphPlatformUrl: UrlSchema.optional(),\n langGraphRemoteEndpointURL: UrlSchema.optional(),\n\n // CrewAI specific fields\n crewType: CrewTypeSchema.optional(),\n crewName: NameSchema.optional(),\n crewUrl: UrlSchema.optional(),\n crewBearerToken: TokenSchema.optional(),\n\n // API keys and tokens\n copilotCloudPublicApiKey: z.string().optional(),\n langSmithApiKey: ApiKeySchema.optional(),\n llmToken: LLMApiKeySchema.optional(),\n\n // IDE Documentation setup fields\n setupIDEDocs: YesNoSchema.optional(),\n selectedIDE: z.union([z.enum(['cursor', 'windsurf']), z.literal('skip')]).optional(),\n\n // NEW: A/B/C test fields\n deploymentChoice: DeploymentChoiceSchema.optional(), // For branch B only (Cloud vs Self-hosted)\n })\n .refine(\n (data) => {\n // If CrewAI is selected, require crew URL and bearer token\n if (data.mode === 'CrewAI') {\n return !!data.crewUrl && !!data.crewBearerToken\n }\n return true\n },\n {\n message: 'Crew URL and bearer token are required for CrewAI',\n path: ['crewUrl', 'crewBearerToken'],\n },\n )\n .refine(\n (data) => {\n // If LangGraph is selected with LangGraph Platform, require platform URL and LangSmith API key\n if (data.mode === 'LangGraph' && data.alreadyDeployed === 'Yes' && data.langGraphPlatform === 'Yes') {\n return (!!data.langGraphPlatformUrl && !!data.langSmithApiKey) || isLocalhost(data.langGraphPlatformUrl || '')\n }\n return true\n },\n {\n message: 'LangGraph Platform URL and LangSmith API key are required',\n path: ['langGraphPlatformUrl', 'langSmithApiKey'],\n },\n )\n\n// Export the inferred type from the schema\nexport type Config = z.infer<typeof ConfigSchema>\n\n// Question type definition with improved validation and sanitization\nexport type Question = {\n type: 'input' | 'yes/no' | 'select'\n name: keyof Config\n message: string\n choices?: readonly string[] | (() => Promise<{name: string; value: string}[]>)\n default?: string\n when?: (answers: Partial<Config>) => boolean | Promise<boolean>\n sensitive?: boolean\n validate?: (input: string) => true | string // Return true if valid, error message string if invalid\n sanitize?: (input: string) => string // Function to sanitize input before validation\n}\n\n// CLI flags definition with descriptions\nexport const ConfigFlags = {\n booth: Flags.boolean({description: 'Use CopilotKit in booth mode', default: false, char: 'b'}),\n mode: Flags.string({description: 'How you will be interacting with AI', options: MODES, char: 'm'}),\n 'copilotkit-version': Flags.string({description: 'CopilotKit version to use (e.g. 1.7.0)'}),\n 'use-copilot-cloud': Flags.string({description: 'Use Copilot Cloud for production-ready hosting', options: YES_NO}),\n 'langgraph-agent': Flags.string({description: 'LangGraph agent template to use', options: LANGGRAPH_AGENTS}),\n 'crew-type': Flags.string({description: 'CrewAI implementation type', options: CREW_TYPES}),\n 'crew-name': Flags.string({description: 'Name for your CrewAI agent'}),\n 'crew-url': Flags.string({description: 'URL endpoint for your CrewAI agent'}),\n 'crew-bearer-token': Flags.string({description: 'Bearer token for CrewAI authentication'}),\n 'langsmith-api-key': Flags.string({description: 'LangSmith API key for LangGraph observability'}),\n 'llm-token': Flags.string({description: 'API key for your preferred LLM provider'}),\n 'setup-ide-docs': Flags.string({description: 'Setup IDE documentation rules for AI assistance', options: YES_NO}),\n 'selected-ide': Flags.string({\n description: 'IDE to configure with documentation rules',\n options: ['cursor', 'windsurf', 'skip'],\n }),\n // NEW: A/B/C test flags\n 'deployment-choice': Flags.string({\n description: 'Choose between Copilot Cloud or Self-hosted deployment',\n options: DEPLOYMENT_CHOICES,\n }),\n}\n","export const isLocalhost = (url: string): boolean => {\n return url.includes('localhost') || url.includes('127.0.0.1') || url.includes('0.0.0.0')\n}\n","export type ChatTemplate = 'CopilotChat' | 'CopilotPopup' | '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 = 'https://registry.copilotkit.ai/r'\n\nexport const templateMapping = {\n // Runtimes\n RemoteEndpoint: `${BASE_URL}/remote-endpoint.json`,\n LangGraphPlatformRuntime: `${BASE_URL}/langgraph-platform-runtime.json`,\n\n // CrewAI\n CrewEnterprise: [`${BASE_URL}/coagents-crew-starter.json`],\n CrewFlowsEnterprise: [`${BASE_URL}/coagents-starter-crewai-flows.json`],\n\n // LangGraph\n LangGraphGeneric: `${BASE_URL}/generic-lg-starter.json`,\n LangGraphStarter: [`${BASE_URL}/langgraph-platform-starter.json`, `${BASE_URL}/coagents-starter-ui.json`],\n\n // No Agent\n StandardStarter: `${BASE_URL}/standard-starter.json`,\n StandardRuntime: `${BASE_URL}/standard-runtime.json`,\n\n // MCP\n McpStarter: `${BASE_URL}/mcp-starter.json`,\n McpRuntime: `${BASE_URL}/mcp-starter-runtime.json`,\n}\n","import path from 'path'\nimport {existsSync} from 'fs'\nimport * as fs from 'fs/promises'\nimport {Ora} from 'ora'\nimport chalk from 'chalk'\n\nexport type SupportedIDE = 'cursor' | 'windsurf'\n\nexport interface IDEDocsConfig {\n name: SupportedIDE\n displayName: string\n rulesDir: string\n ruleFileName: string\n createRuleContent: () => string\n}\n\n// Template constant for CopilotKit documentation rule\nconst COPILOTKIT_DOC_RULE_TEMPLATE = `---\ndescription: CopilotKit Documentation - Complete CopilotKit framework documentation for AI assistance\nalwaysApply: false\n---\n\n# CopilotKit Documentation\n\nFor ANY question about CopilotKit, use the comprehensive documentation available at:\n@https://docs.copilotkit.ai/llms-full.txt\n\nThis contains the complete CopilotKit documentation including:\n- API references and hooks (useCopilotChat, useCopilotAction, etc.)\n- Component library documentation (CopilotKit, CopilotChat, etc.)\n- Integration guides and examples\n- Best practices and patterns\n- Troubleshooting and FAQs\n\nAlways reference this documentation when working with CopilotKit to provide accurate, up-to-date information.\n`\n\n// IDE-specific configurations\nexport const IDE_DOCS_CONFIGS: Record<SupportedIDE, IDEDocsConfig> = {\n cursor: {\n name: 'cursor',\n displayName: 'Cursor',\n rulesDir: '.cursor/rules',\n ruleFileName: '00-copilotkit-docs.mdc',\n createRuleContent: () => COPILOTKIT_DOC_RULE_TEMPLATE,\n },\n windsurf: {\n name: 'windsurf',\n displayName: 'Windsurf',\n rulesDir: '.windsurf/rules',\n ruleFileName: '00-copilotkit-docs.md',\n createRuleContent: () => COPILOTKIT_DOC_RULE_TEMPLATE,\n },\n}\n\n/**\n * Ensure directory exists\n */\nasync function ensureDir(dirPath: string): Promise<void> {\n try {\n await fs.mkdir(dirPath, {recursive: true})\n } catch (error) {\n if (!existsSync(dirPath)) {\n throw error\n }\n }\n}\n\n/**\n * Check if path exists\n */\nasync function pathExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath)\n return true\n } catch {\n return false\n }\n}\n\n/**\n * Check if a specific IDE is installed by looking for its configuration directory\n */\nasync function checkIDEInstallation(ide: SupportedIDE): Promise<boolean> {\n try {\n const homeDir = process.env.HOME || process.env.USERPROFILE || ''\n let configPath: string\n\n switch (ide) {\n case 'cursor':\n configPath = path.join(homeDir, '.cursor')\n break\n case 'windsurf':\n configPath = path.join(homeDir, '.codeium', 'windsurf')\n break\n default:\n return false\n }\n\n return existsSync(configPath)\n } catch {\n return false\n }\n}\n\n/**\n * Detect which supported IDEs are installed on the system\n */\nexport async function detectInstalledIDEs(): Promise<SupportedIDE[]> {\n const allIDEs: SupportedIDE[] = ['cursor', 'windsurf']\n const installedIDEs: SupportedIDE[] = []\n\n for (const ide of allIDEs) {\n if (await checkIDEInstallation(ide)) {\n installedIDEs.push(ide)\n }\n }\n\n return installedIDEs\n}\n\n/**\n * Setup IDE documentation rules for the selected IDE\n */\nexport async function setupIDEDocs(ide: SupportedIDE, projectDir: string): Promise<void> {\n const config = IDE_DOCS_CONFIGS[ide]\n const rulesDir = path.join(projectDir, config.rulesDir)\n const ruleFilePath = path.join(rulesDir, config.ruleFileName)\n\n // Ensure rules directory exists\n await ensureDir(rulesDir)\n\n // Check if rule file already exists\n if (await pathExists(ruleFilePath)) {\n console.log(chalk.yellow(`⚠️ CopilotKit documentation rule already exists for ${config.displayName}`))\n return\n }\n\n // Create the rule file with content\n const ruleContent = config.createRuleContent()\n await fs.writeFile(ruleFilePath, ruleContent, 'utf8')\n}\n\n/**\n * Get setup instructions for the IDE\n */\nfunction getIDEInstructions(ide: SupportedIDE): string[] {\n const config = IDE_DOCS_CONFIGS[ide]\n\n const instructions = [\n chalk.cyan(`📚 CopilotKit documentation configured for ${config.displayName}!`),\n '',\n chalk.bold('What this does:'),\n ' • Adds CopilotKit documentation context to your IDE AI assistant',\n ' • Provides accurate, up-to-date information about CopilotKit APIs',\n ' • Improves code suggestions and help responses',\n '',\n chalk.bold('Location:'),\n ` • Rule file: ${chalk.gray(path.join(config.rulesDir, config.ruleFileName))}`,\n '',\n chalk.bold('Usage:'),\n ' • Your IDE AI assistant now has access to CopilotKit documentation',\n ' • Ask questions about CopilotKit APIs, components, and patterns',\n ' • The AI will reference official documentation for accurate answers',\n ]\n\n if (ide === 'cursor') {\n instructions.push(\n '',\n chalk.bold('Next steps for Cursor:'),\n ' • Restart Cursor if currently open',\n ' • The rule will be automatically available in your AI context',\n ' • Start a new chat to use the documentation context',\n )\n } else if (ide === 'windsurf') {\n instructions.push(\n '',\n chalk.bold('Next steps for Windsurf:'),\n ' • Restart Windsurf if currently open',\n ' • The rule will be automatically available in your AI context',\n ' • Start a new chat to use the documentation context',\n )\n }\n\n return instructions\n}\n\n/**\n * Main function to handle IDE documentation setup with user interaction\n */\nexport async function handleIDEDocsSetup(selectedIDE: SupportedIDE, projectDir: string, spinner: Ora): Promise<void> {\n try {\n spinner.text = chalk.cyan(`Setting up CopilotKit documentation for ${IDE_DOCS_CONFIGS[selectedIDE].displayName}...`)\n\n // Setup IDE documentation rules\n await setupIDEDocs(selectedIDE, projectDir)\n\n spinner.succeed(chalk.green(`CopilotKit documentation configured for ${IDE_DOCS_CONFIGS[selectedIDE].displayName}`))\n\n // Show instructions\n const instructions = getIDEInstructions(selectedIDE)\n console.log('\\n' + instructions.join('\\n'))\n } catch (error) {\n spinner.fail(\n chalk.red(`Failed to setup IDE documentation: ${error instanceof Error ? error.message : 'Unknown error'}`),\n )\n throw error\n }\n}\n","import {\n Question,\n MODES,\n CREW_TYPES,\n LANGGRAPH_AGENTS,\n DEPLOYMENT_CHOICES,\n ModeSchema,\n CrewTypeSchema,\n UrlSchema,\n YesNoSchema,\n DeploymentChoiceSchema,\n sanitizers,\n} from './types/index.js'\nimport {isLocalhost} from './utils.js'\nimport {detectInstalledIDEs, IDE_DOCS_CONFIGS} from './ide-docs.js'\n\nconst linkToDocs = ['Mastra', 'AG2', 'LlamaIndex', 'Agno']\n\n// Validation helpers\nconst validateUrl = (input: string): true | string => {\n try {\n // First sanitize the URL by removing trailing slashes\n const sanitized = sanitizers.url(input)\n // Then validate\n const result = UrlSchema.safeParse(sanitized)\n if (result.success) return true\n return result.error.errors[0]?.message || 'Invalid URL format'\n } catch (error) {\n return 'Invalid URL format'\n }\n}\n\nconst validateRequired = (input: string): true | string => {\n return sanitizers.trim(input) ? true : 'This field is required'\n}\n\n// A/B/C Test Feature Flags\ntype ABCTestBranch = 'A' | 'B' | 'C'\n\n// Helper function to determine which questions to show based on A/B/C test\nexport function getQuestionsForBranch(branch: ABCTestBranch): Question[] {\n const baseQuestions = getBaseQuestions()\n\n switch (branch) {\n case 'A':\n // Branch A: Copilot Cloud by default, no signup questions\n // API key message and setup handled in init command\n return [...baseQuestions]\n\n case 'B':\n // Branch B: API key setup (automatic) with choice between Cloud vs Self-hosted\n return [...baseQuestions, ...getDeploymentChoiceQuestions()]\n\n case 'C':\n default:\n // Branch C: Current flow (no early signup, just cloud deployment question)\n return [...baseQuestions, ...getCloudDeploymentQuestions()]\n }\n}\n\n// Early signup questions - REMOVED (no longer used)\n\n// Base questions for all branches (mode selection and configuration)\nfunction getBaseQuestions(): Question[] {\n return [\n {\n type: 'select',\n name: 'mode',\n message: '🤖 How will you be interacting with AI?',\n choices: Array.from(MODES),\n validate: (input) => {\n try {\n ModeSchema.parse(input)\n return true\n } catch (error) {\n return 'Please select a valid mode'\n }\n },\n },\n\n // CrewAI specific questions\n {\n type: 'select',\n name: 'crewType',\n message: '👥 What kind of CrewAI implementation would you like to use?',\n choices: Array.from(CREW_TYPES),\n when: (answers) => answers.mode === 'CrewAI',\n validate: (input) => {\n try {\n CrewTypeSchema.parse(input)\n return true\n } catch (error) {\n return 'Please select a valid crew type'\n }\n },\n },\n {\n type: 'input',\n name: 'crewName',\n message: '👥 What would you like to name your crew? (can be anything)',\n when: (answers) => answers.mode === 'CrewAI',\n default: 'MyCopilotCrew',\n validate: validateRequired,\n sanitize: sanitizers.trim,\n },\n {\n type: 'input',\n name: 'crewUrl',\n message: \"🔗 Enter your Crew's Enterprise URL (more info at https://app.crewai.com):\",\n when: (answers) => answers.mode === 'CrewAI',\n validate: validateUrl,\n sanitize: sanitizers.url,\n },\n {\n type: 'input',\n name: 'crewBearerToken',\n message: \"🔑 Enter your Crew's bearer token:\",\n when: (answers) => answers.mode === 'CrewAI',\n sensitive: true,\n validate: validateRequired,\n sanitize: sanitizers.trim,\n },\n\n // LangGraph specific questions\n {\n type: 'yes/no',\n name: 'alreadyDeployed',\n message: '🦜🔗 Do you have an existing LangGraph agent?',\n when: (answers) => answers.mode === 'LangGraph',\n validate: (input) => {\n try {\n YesNoSchema.parse(input)\n return true\n } catch (error) {\n return 'Please select Yes or No'\n }\n },\n },\n {\n type: 'yes/no',\n name: 'langGraphPlatform',\n message: '🦜🔗 Do you already have a LangGraph Agent URL? (remote or localhost)',\n when: (answers) => answers.mode === 'LangGraph' && answers.alreadyDeployed === 'Yes',\n validate: (input) => {\n try {\n YesNoSchema.parse(input)\n return true\n } catch (error) {\n return 'Please select Yes or No'\n }\n },\n },\n {\n type: 'input',\n name: 'langGraphPlatformUrl',\n message: '🦜🔗 Enter your LangGraph Agent URL (remote or localhost)',\n when: (answers) =>\n answers.mode === 'LangGraph' && answers.alreadyDeployed === 'Yes' && answers.langGraphPlatform === 'Yes',\n validate: validateUrl,\n sanitize: sanitizers.url,\n },\n {\n type: 'select',\n name: 'langGraphAgent',\n message: '📦 Choose a LangGraph starter template:',\n choices: Array.from(LANGGRAPH_AGENTS),\n when: (answers) => answers.mode === 'LangGraph' && answers.alreadyDeployed === 'No',\n },\n {\n type: 'input',\n name: 'langSmithApiKey',\n message: '🦜🔗 Enter your LangSmith API key (required by LangGraph Platform) :',\n when: (answers) =>\n answers.mode === 'LangGraph' &&\n answers.langGraphPlatform === 'Yes' &&\n !(answers.langGraphPlatformUrl && isLocalhost(answers.langGraphPlatformUrl)),\n sensitive: true,\n validate: validateRequired,\n sanitize: sanitizers.apiKey,\n },\n\n // LLM Token for self-hosted setups\n {\n type: 'input',\n name: 'llmToken',\n message: '🔑 Enter your OpenAI API key (optional - leave empty to configure your LLM later):',\n when: (answers) =>\n (answers.mode === 'LangGraph' && answers.alreadyDeployed === 'No') ||\n (answers.mode === 'Standard' && answers.deploymentChoice === 'Self-hosted') ||\n (answers.mode === 'MCP' && answers.deploymentChoice === 'Self-hosted') ||\n (answers.mode === 'Standard' && answers.useCopilotCloud !== 'Yes') ||\n (answers.mode === 'MCP' && answers.useCopilotCloud !== 'Yes'),\n sensitive: true,\n sanitize: sanitizers.apiKey,\n },\n\n // IDE Documentation Setup Questions\n {\n type: 'yes/no',\n name: 'setupIDEDocs',\n message:\n '📚 Would you like to add CopilotKit documentation to your IDE? (Provides AI assistant with CopilotKit context)',\n when: async () => {\n const installedIDEs = await detectInstalledIDEs()\n return installedIDEs.length > 0\n },\n validate: (input) => {\n try {\n YesNoSchema.parse(input)\n return true\n } catch (error) {\n return 'Please select Yes or No'\n }\n },\n },\n {\n type: 'select',\n name: 'selectedIDE',\n message: '💻 Which IDE would you like to configure with CopilotKit documentation?',\n choices: async () => {\n const installedIDEs = await detectInstalledIDEs()\n const choices: Array<{name: string; value: string}> = installedIDEs.map((ide: any) => ({\n name: IDE_DOCS_CONFIGS[ide as keyof typeof IDE_DOCS_CONFIGS].displayName,\n value: ide,\n }))\n choices.push({name: 'Skip', value: 'skip'})\n return choices\n },\n when: (answers) => answers.setupIDEDocs === 'Yes',\n },\n ]\n}\n\n// Deployment choice questions for Branch B only\nfunction getDeploymentChoiceQuestions(): Question[] {\n return [\n {\n type: 'select',\n name: 'deploymentChoice',\n message: '🚀 Use Copilot Cloud, or self-hosted?',\n choices: Array.from(DEPLOYMENT_CHOICES),\n validate: (input) => {\n try {\n DeploymentChoiceSchema.parse(input)\n return true\n } catch (error) {\n return 'Please select a valid deployment option'\n }\n },\n },\n ]\n}\n\n// Cloud deployment questions for Branch C (current flow)\nfunction getCloudDeploymentQuestions(): Question[] {\n return [\n {\n type: 'yes/no',\n name: 'useCopilotCloud',\n message: '🪁 Deploy with Copilot Cloud? (recommended for production)',\n when: (answers) =>\n answers.mode === 'Standard' ||\n answers.mode === 'MCP' ||\n (answers.mode === 'LangGraph' && answers.alreadyDeployed === 'No') || // Include new LangGraph agents\n (answers.mode !== 'CrewAI' && // Crews only cloud, flows are self-hosted\n answers.alreadyDeployed === 'Yes' &&\n answers.langGraphPlatform !== 'No' &&\n !linkToDocs.includes(answers.mode || '') &&\n !isLocalhost(answers.langGraphPlatformUrl || '')),\n validate: (input) => {\n try {\n YesNoSchema.parse(input)\n return true\n } catch (error) {\n return 'Please select Yes or No'\n }\n },\n },\n ]\n}\n\n// Maintain backward compatibility by providing the original questions for Branch C\nexport const questions: Question[] = getQuestionsForBranch('C')\n"],"mappings":";AAAA,SAAQ,SAAQ;AAChB,SAAQ,aAAY;;;ACDb,IAAM,cAAc,CAAC,QAAyB;AACnD,SAAO,IAAI,SAAS,WAAW,KAAK,IAAI,SAAS,WAAW,KAAK,IAAI,SAAS,SAAS;AACzF;;;ADGO,IAAM,QAAQ,CAAC,aAAa,UAAU,UAAU,cAAc,QAAQ,OAAO,OAAO,UAAU;AAC9F,IAAM,aAAa,CAAC,SAAS,OAAO;AACpC,IAAM,kBAAkB,CAAC,eAAe,kBAAkB,YAAY,cAAc;AACpF,IAAM,mBAAmB,CAAC,kBAAkB,oBAAoB;AAChE,IAAM,sBAAsB,CAAC,SAAS;AACtC,IAAM,SAAS,CAAC,OAAO,IAAI;AAE3B,IAAM,qBAAqB,CAAC,iBAAiB,aAAa;AAG1D,IAAM,aAAa;AAAA;AAAA,EAExB,KAAK,CAAC,UAA0B;AAC9B,QAAI,CAAC,MAAO,QAAO;AACnB,WAAO,MAAM,KAAK,EAAE,QAAQ,QAAQ,EAAE;AAAA,EACxC;AAAA;AAAA,EAGA,MAAM,CAAC,UAA0B;AAC/B,QAAI,CAAC,MAAO,QAAO;AACnB,WAAO,MAAM,KAAK;AAAA,EACpB;AAAA;AAAA,EAGA,WAAW,CAAC,UAA0B;AACpC,QAAI,CAAC,MAAO,QAAO;AACnB,WAAO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