copilotkit 0.0.30 → 0.0.32
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.
- package/README.md +1 -1
- package/dist/commands/base-command.js +1 -1
- package/dist/commands/base-command.js.map +1 -1
- package/dist/commands/dev.js +1 -1
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/init.d.ts +11 -13
- package/dist/commands/init.js +84 -73
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/login.js +1 -1
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.js +1 -1
- package/dist/commands/logout.js.map +1 -1
- package/dist/lib/init/index.d.ts +1 -1
- package/dist/lib/init/index.js +51 -65
- package/dist/lib/init/index.js.map +1 -1
- package/dist/lib/init/questions.js +37 -57
- package/dist/lib/init/questions.js.map +1 -1
- package/dist/lib/init/scaffold/agent.js +4 -4
- package/dist/lib/init/scaffold/agent.js.map +1 -1
- package/dist/lib/init/scaffold/index.js +32 -25
- package/dist/lib/init/scaffold/index.js.map +1 -1
- package/dist/lib/init/scaffold/shadcn.js +28 -21
- package/dist/lib/init/scaffold/shadcn.js.map +1 -1
- package/dist/lib/init/types/index.d.ts +1 -1
- package/dist/lib/init/types/index.js +22 -21
- package/dist/lib/init/types/index.js.map +1 -1
- package/dist/lib/init/types/questions.d.ts +21 -23
- package/dist/lib/init/types/questions.js +18 -20
- package/dist/lib/init/types/questions.js.map +1 -1
- package/dist/lib/init/types/templates.d.ts +2 -0
- package/dist/lib/init/types/templates.js +4 -1
- package/dist/lib/init/types/templates.js.map +1 -1
- package/dist/utils/detect-endpoint-type.utils.d.ts +1 -1
- package/dist/utils/version.d.ts +1 -1
- package/dist/utils/version.js +1 -1
- package/dist/utils/version.js.map +1 -1
- package/oclif.manifest.json +28 -50
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -222,7 +222,7 @@ import { Command } from "@oclif/core";
|
|
|
222
222
|
import Sentry, { consoleIntegration } from "@sentry/node";
|
|
223
223
|
|
|
224
224
|
// src/utils/version.ts
|
|
225
|
-
var LIB_VERSION = "0.0.
|
|
225
|
+
var LIB_VERSION = "0.0.32";
|
|
226
226
|
|
|
227
227
|
// src/commands/base-command.ts
|
|
228
228
|
import chalk2 from "chalk";
|
|
@@ -275,7 +275,7 @@ var BaseCommand = class extends Command {
|
|
|
275
275
|
// src/lib/init/types/questions.ts
|
|
276
276
|
import { z } from "zod";
|
|
277
277
|
import { Flags } from "@oclif/core";
|
|
278
|
-
var
|
|
278
|
+
var MODES = ["CrewAI", "LangGraph", "MCP", "Standard"];
|
|
279
279
|
var CREW_TYPES = ["Crews", "Flows"];
|
|
280
280
|
var CHAT_COMPONENTS = ["CopilotChat", "CopilotSidebar", "Headless", "CopilotPopup"];
|
|
281
281
|
var LANGGRAPH_AGENTS = ["Python Starter", "TypeScript Starter"];
|
|
@@ -303,7 +303,7 @@ var sanitizers = {
|
|
|
303
303
|
return value.trim().replace(/\s/g, "");
|
|
304
304
|
}
|
|
305
305
|
};
|
|
306
|
-
var
|
|
306
|
+
var ModeSchema = z.enum(MODES);
|
|
307
307
|
var CrewTypeSchema = z.enum(CREW_TYPES);
|
|
308
308
|
var ChatComponentSchema = z.enum(CHAT_COMPONENTS);
|
|
309
309
|
var LangGraphAgentSchema = z.enum(LANGGRAPH_AGENTS);
|
|
@@ -328,7 +328,7 @@ var NameSchema = z.preprocess(
|
|
|
328
328
|
var ConfigSchema = z.object({
|
|
329
329
|
// Core fields
|
|
330
330
|
copilotKitVersion: z.string().optional(),
|
|
331
|
-
|
|
331
|
+
mode: ModeSchema,
|
|
332
332
|
chatUi: ChatComponentSchema.optional(),
|
|
333
333
|
// Yes/No fields
|
|
334
334
|
alreadyDeployed: YesNoSchema.optional(),
|
|
@@ -351,7 +351,7 @@ var ConfigSchema = z.object({
|
|
|
351
351
|
llmToken: ApiKeySchema.optional()
|
|
352
352
|
}).refine(
|
|
353
353
|
(data) => {
|
|
354
|
-
if (data.
|
|
354
|
+
if (data.mode === "CrewAI" && data.crewType === "Crews") {
|
|
355
355
|
return !!data.crewUrl && !!data.crewBearerToken;
|
|
356
356
|
}
|
|
357
357
|
return true;
|
|
@@ -362,7 +362,7 @@ var ConfigSchema = z.object({
|
|
|
362
362
|
}
|
|
363
363
|
).refine(
|
|
364
364
|
(data) => {
|
|
365
|
-
if (data.
|
|
365
|
+
if (data.mode === "LangGraph" && data.alreadyDeployed === "Yes" && data.langGraphPlatform === "Yes") {
|
|
366
366
|
return !!data.langGraphPlatformUrl && !!data.langSmithApiKey;
|
|
367
367
|
}
|
|
368
368
|
return true;
|
|
@@ -373,19 +373,17 @@ var ConfigSchema = z.object({
|
|
|
373
373
|
}
|
|
374
374
|
);
|
|
375
375
|
var ConfigFlags = {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
llmToken: Flags.string({ description: "API key for your preferred LLM provider" }),
|
|
388
|
-
crewFlowAgent: Flags.string({ description: "CrewAI Flow template to use", options: CREW_FLOW_TEMPLATES })
|
|
376
|
+
mode: Flags.string({ description: "How you will be interacting with AI", options: MODES, char: "m" }),
|
|
377
|
+
"copilotkit-version": Flags.string({ description: "CopilotKit version to use (e.g. 1.7.0)" }),
|
|
378
|
+
"use-copilot-cloud": Flags.string({ description: "Use Copilot Cloud for production-ready hosting", options: YES_NO }),
|
|
379
|
+
"langgraph-agent": Flags.string({ description: "LangGraph agent template to use", options: LANGGRAPH_AGENTS }),
|
|
380
|
+
"crew-type": Flags.string({ description: "CrewAI implementation type", options: CREW_TYPES }),
|
|
381
|
+
"crew-name": Flags.string({ description: "Name for your CrewAI agent" }),
|
|
382
|
+
"crew-url": Flags.string({ description: "URL endpoint for your CrewAI agent" }),
|
|
383
|
+
"crew-bearer-token": Flags.string({ description: "Bearer token for CrewAI authentication" }),
|
|
384
|
+
"langsmith-api-key": Flags.string({ description: "LangSmith API key for LangGraph observability" }),
|
|
385
|
+
"llm-token": Flags.string({ description: "API key for your preferred LLM provider" }),
|
|
386
|
+
"crew-flow-agent": Flags.string({ description: "CrewAI Flow template to use", options: CREW_FLOW_TEMPLATES })
|
|
389
387
|
};
|
|
390
388
|
|
|
391
389
|
// src/lib/init/types/templates.ts
|
|
@@ -411,7 +409,10 @@ var templateMapping = {
|
|
|
411
409
|
],
|
|
412
410
|
// No Agent
|
|
413
411
|
"StandardStarter": `${BASE_URL}/standard-starter.json`,
|
|
414
|
-
"StandardRuntime": `${BASE_URL}/standard-runtime.json
|
|
412
|
+
"StandardRuntime": `${BASE_URL}/standard-runtime.json`,
|
|
413
|
+
// MCP
|
|
414
|
+
"McpStarter": `${BASE_URL}/mcp-starter.json`,
|
|
415
|
+
"McpRuntime": `${BASE_URL}/mcp-starter-runtime.json`
|
|
415
416
|
};
|
|
416
417
|
|
|
417
418
|
// src/lib/init/questions.ts
|
|
@@ -432,15 +433,15 @@ var questions = [
|
|
|
432
433
|
// Core setup questions - always shown first
|
|
433
434
|
{
|
|
434
435
|
type: "select",
|
|
435
|
-
name: "
|
|
436
|
-
message: "\u{1F916}
|
|
437
|
-
choices: Array.from(
|
|
436
|
+
name: "mode",
|
|
437
|
+
message: "\u{1F916} How will you be interacting with AI?",
|
|
438
|
+
choices: Array.from(MODES),
|
|
438
439
|
validate: (input) => {
|
|
439
440
|
try {
|
|
440
|
-
|
|
441
|
+
ModeSchema.parse(input);
|
|
441
442
|
return true;
|
|
442
443
|
} catch (error) {
|
|
443
|
-
return "Please select a valid
|
|
444
|
+
return "Please select a valid mode";
|
|
444
445
|
}
|
|
445
446
|
}
|
|
446
447
|
},
|
|
@@ -450,7 +451,7 @@ var questions = [
|
|
|
450
451
|
name: "crewType",
|
|
451
452
|
message: "\u{1F465} What kind of CrewAI implementation would you like to use?",
|
|
452
453
|
choices: Array.from(CREW_TYPES),
|
|
453
|
-
when: (answers) => answers.
|
|
454
|
+
when: (answers) => answers.mode === "CrewAI",
|
|
454
455
|
validate: (input) => {
|
|
455
456
|
try {
|
|
456
457
|
CrewTypeSchema.parse(input);
|
|
@@ -465,7 +466,7 @@ var questions = [
|
|
|
465
466
|
type: "input",
|
|
466
467
|
name: "crewName",
|
|
467
468
|
message: "\u{1F465} What would you like to name your crew? (can be anything)",
|
|
468
|
-
when: (answers) => answers.
|
|
469
|
+
when: (answers) => answers.mode === "CrewAI" && answers.crewType === "Crews",
|
|
469
470
|
default: "MyCopilotCrew",
|
|
470
471
|
validate: validateRequired,
|
|
471
472
|
sanitize: sanitizers.trim
|
|
@@ -474,7 +475,7 @@ var questions = [
|
|
|
474
475
|
type: "input",
|
|
475
476
|
name: "crewUrl",
|
|
476
477
|
message: "\u{1F517} Enter your Crew's Enterprise URL (more info at https://app.crewai.com):",
|
|
477
|
-
when: (answers) => answers.
|
|
478
|
+
when: (answers) => answers.mode === "CrewAI" && answers.crewType === "Crews",
|
|
478
479
|
validate: validateUrl,
|
|
479
480
|
sanitize: sanitizers.url
|
|
480
481
|
},
|
|
@@ -482,7 +483,7 @@ var questions = [
|
|
|
482
483
|
type: "input",
|
|
483
484
|
name: "crewBearerToken",
|
|
484
485
|
message: "\u{1F511} Enter your Crew's bearer token:",
|
|
485
|
-
when: (answers) => answers.
|
|
486
|
+
when: (answers) => answers.mode === "CrewAI" && answers.crewType === "Crews",
|
|
486
487
|
sensitive: true,
|
|
487
488
|
validate: validateRequired,
|
|
488
489
|
sanitize: sanitizers.trim
|
|
@@ -493,14 +494,14 @@ var questions = [
|
|
|
493
494
|
name: "crewFlowAgent",
|
|
494
495
|
message: "\u{1F4E6} Choose a CrewAI Flow Template",
|
|
495
496
|
choices: Array.from(CREW_FLOW_TEMPLATES),
|
|
496
|
-
when: (answers) => answers.
|
|
497
|
+
when: (answers) => answers.mode === "CrewAI" && answers.crewType === "Flows"
|
|
497
498
|
},
|
|
498
499
|
// LangGraph specific questions - shown when LangGraph selected
|
|
499
500
|
{
|
|
500
501
|
type: "yes/no",
|
|
501
502
|
name: "alreadyDeployed",
|
|
502
503
|
message: "\u{1F99C}\u{1F517} Do you have an existing LangGraph agent?",
|
|
503
|
-
when: (answers) => answers.
|
|
504
|
+
when: (answers) => answers.mode === "LangGraph",
|
|
504
505
|
validate: (input) => {
|
|
505
506
|
try {
|
|
506
507
|
YesNoSchema.parse(input);
|
|
@@ -514,7 +515,7 @@ var questions = [
|
|
|
514
515
|
type: "yes/no",
|
|
515
516
|
name: "langGraphPlatform",
|
|
516
517
|
message: "\u{1F99C}\u{1F517} Do you already have a LangGraph Agent URL? (remote or localhost)",
|
|
517
|
-
when: (answers) => answers.
|
|
518
|
+
when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "Yes",
|
|
518
519
|
validate: (input) => {
|
|
519
520
|
try {
|
|
520
521
|
YesNoSchema.parse(input);
|
|
@@ -528,33 +529,22 @@ var questions = [
|
|
|
528
529
|
type: "input",
|
|
529
530
|
name: "langGraphPlatformUrl",
|
|
530
531
|
message: "\u{1F99C}\u{1F517} Enter your LangGraph Agent URL (remote or localhost)",
|
|
531
|
-
when: (answers) => answers.
|
|
532
|
+
when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "Yes" && answers.langGraphPlatform === "Yes",
|
|
532
533
|
validate: validateUrl,
|
|
533
534
|
sanitize: sanitizers.url
|
|
534
535
|
},
|
|
535
|
-
// {
|
|
536
|
-
// type: 'input',
|
|
537
|
-
// name: 'langGraphRemoteEndpointURL',
|
|
538
|
-
// message: '🔌 Enter your LangGraph endpoint URL:',
|
|
539
|
-
// when: (answers) =>
|
|
540
|
-
// answers.agentFramework === 'LangGraph' &&
|
|
541
|
-
// answers.alreadyDeployed === 'Yes' &&
|
|
542
|
-
// answers.langGraphPlatform === 'No',
|
|
543
|
-
// validate: validateUrl,
|
|
544
|
-
// sanitize: sanitizers.url
|
|
545
|
-
// },
|
|
546
536
|
{
|
|
547
537
|
type: "select",
|
|
548
538
|
name: "langGraphAgent",
|
|
549
539
|
message: "\u{1F4E6} Choose a LangGraph starter template:",
|
|
550
540
|
choices: Array.from(LANGGRAPH_AGENTS),
|
|
551
|
-
when: (answers) => answers.
|
|
541
|
+
when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "No"
|
|
552
542
|
},
|
|
553
543
|
{
|
|
554
544
|
type: "input",
|
|
555
545
|
name: "langSmithApiKey",
|
|
556
546
|
message: "\u{1F99C}\u{1F517} Enter your LangSmith API key (required by LangGraph Platform) :",
|
|
557
|
-
when: (answers) => answers.
|
|
547
|
+
when: (answers) => answers.mode === "LangGraph" && answers.langGraphPlatform === "Yes",
|
|
558
548
|
sensitive: true,
|
|
559
549
|
validate: validateRequired,
|
|
560
550
|
sanitize: sanitizers.apiKey
|
|
@@ -564,7 +554,7 @@ var questions = [
|
|
|
564
554
|
type: "yes/no",
|
|
565
555
|
name: "useCopilotCloud",
|
|
566
556
|
message: "\u{1FA81} Deploy with Copilot Cloud? (recommended for production)",
|
|
567
|
-
when: (answers) => answers.
|
|
557
|
+
when: (answers) => answers.mode === "Standard" || answers.mode === "MCP" || answers.mode !== "CrewAI" && // Crews only cloud, flows are self-hosted
|
|
568
558
|
answers.alreadyDeployed === "Yes" && answers.langGraphPlatform !== "No",
|
|
569
559
|
validate: (input) => {
|
|
570
560
|
try {
|
|
@@ -575,21 +565,11 @@ var questions = [
|
|
|
575
565
|
}
|
|
576
566
|
}
|
|
577
567
|
},
|
|
578
|
-
// {
|
|
579
|
-
// type: 'yes/no',
|
|
580
|
-
// name: 'fastApiEnabled',
|
|
581
|
-
// message: '⚡ Set up a FastAPI server for local development?',
|
|
582
|
-
// when: (answers) =>
|
|
583
|
-
// answers.agentFramework === 'LangGraph' &&
|
|
584
|
-
// answers.alreadyDeployed === 'No' &&
|
|
585
|
-
// answers.langGraphAgent === 'Python Starter' &&
|
|
586
|
-
// answers.useCopilotCloud !== 'Yes',
|
|
587
|
-
// },
|
|
588
568
|
{
|
|
589
569
|
type: "input",
|
|
590
570
|
name: "llmToken",
|
|
591
571
|
message: "\u{1F511} Enter your OpenAI API key (required for LLM interfacing):",
|
|
592
|
-
when: (answers) => answers.
|
|
572
|
+
when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "No" || answers.mode === "CrewAI" && answers.crewType === "Flows" || answers.mode === "Standard" && answers.useCopilotCloud !== "Yes" || answers.mode === "MCP" && answers.useCopilotCloud !== "Yes",
|
|
593
573
|
sensitive: true,
|
|
594
574
|
validate: validateRequired,
|
|
595
575
|
sanitize: sanitizers.apiKey
|
|
@@ -601,7 +581,7 @@ import spawn from "cross-spawn";
|
|
|
601
581
|
async function scaffoldShadCN(userAnswers) {
|
|
602
582
|
try {
|
|
603
583
|
const components = [];
|
|
604
|
-
switch (userAnswers.
|
|
584
|
+
switch (userAnswers.mode) {
|
|
605
585
|
case "LangGraph":
|
|
606
586
|
if (userAnswers.langGraphAgent) {
|
|
607
587
|
components.push(...templateMapping.LangGraphStarter);
|
|
@@ -625,7 +605,13 @@ async function scaffoldShadCN(userAnswers) {
|
|
|
625
605
|
components.push(templateMapping.RemoteEndpoint);
|
|
626
606
|
}
|
|
627
607
|
break;
|
|
628
|
-
case "
|
|
608
|
+
case "MCP":
|
|
609
|
+
components.push(templateMapping.McpStarter);
|
|
610
|
+
if (userAnswers.useCopilotCloud !== "Yes") {
|
|
611
|
+
components.push(templateMapping.McpRuntime);
|
|
612
|
+
}
|
|
613
|
+
break;
|
|
614
|
+
case "Standard":
|
|
629
615
|
components.push(templateMapping.StandardStarter);
|
|
630
616
|
if (userAnswers.useCopilotCloud !== "Yes") {
|
|
631
617
|
components.push(templateMapping.StandardRuntime);
|
|
@@ -852,7 +838,7 @@ import chalk5 from "chalk";
|
|
|
852
838
|
import path3 from "path";
|
|
853
839
|
import fs3 from "fs";
|
|
854
840
|
async function scaffoldAgent(userAnswers) {
|
|
855
|
-
if (userAnswers.
|
|
841
|
+
if (userAnswers.mode === "CrewAI" && userAnswers.crewType === "Crews" || userAnswers.mode === "LangGraph" && !userAnswers.langGraphAgent || userAnswers.mode === "Standard" || userAnswers.mode === "MCP") {
|
|
856
842
|
return;
|
|
857
843
|
}
|
|
858
844
|
const spinner = ora3({
|
|
@@ -860,7 +846,7 @@ async function scaffoldAgent(userAnswers) {
|
|
|
860
846
|
color: "cyan"
|
|
861
847
|
}).start();
|
|
862
848
|
let template = "";
|
|
863
|
-
switch (userAnswers.
|
|
849
|
+
switch (userAnswers.mode) {
|
|
864
850
|
case "LangGraph":
|
|
865
851
|
if (userAnswers.langGraphAgent === "Python Starter") {
|
|
866
852
|
template = AgentTemplates.LangGraph.Starter.Python;
|
|
@@ -891,7 +877,7 @@ async function scaffoldAgent(userAnswers) {
|
|
|
891
877
|
envContent += `OPENAI_API_KEY=${userAnswers.llmToken}
|
|
892
878
|
`;
|
|
893
879
|
}
|
|
894
|
-
if (userAnswers.
|
|
880
|
+
if (userAnswers.mode === "LangGraph" && userAnswers.langSmithApiKey) {
|
|
895
881
|
envContent += `LANGSMITH_API_KEY=${userAnswers.langSmithApiKey}
|
|
896
882
|
`;
|
|
897
883
|
}
|
|
@@ -904,7 +890,7 @@ async function scaffoldAgent(userAnswers) {
|
|
|
904
890
|
spinner.fail(chalk5.red("Failed to clone agent template"));
|
|
905
891
|
throw error;
|
|
906
892
|
}
|
|
907
|
-
spinner.succeed(`${userAnswers.
|
|
893
|
+
spinner.succeed(`${userAnswers.mode} agent cloned successfully`);
|
|
908
894
|
}
|
|
909
895
|
var AgentTemplates = {
|
|
910
896
|
LangGraph: {
|
|
@@ -989,8 +975,8 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
989
975
|
this.log(chalk6.magenta("\n\u{1FA81} Welcome to CopilotKit"));
|
|
990
976
|
this.log(chalk6.gray("Let's power up your Next.js project with AI capabilities\n"));
|
|
991
977
|
this.validateProjectCompatibility(flags);
|
|
992
|
-
const userAnswers = await this.getUserAnswers();
|
|
993
|
-
const needsCloudSetup = userAnswers.useCopilotCloud === "Yes" || userAnswers.
|
|
978
|
+
const userAnswers = await this.getUserAnswers(flags);
|
|
979
|
+
const needsCloudSetup = userAnswers.useCopilotCloud === "Yes" || userAnswers.mode === "CrewAI" && userAnswers.crewType === "Crews";
|
|
994
980
|
if (needsCloudSetup) await this.setupCloud(flags, userAnswers);
|
|
995
981
|
await scaffoldEnv(flags, userAnswers);
|
|
996
982
|
await scaffoldShadCN(userAnswers);
|
|
@@ -1002,12 +988,36 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1002
988
|
this.gracefulError(error.message);
|
|
1003
989
|
}
|
|
1004
990
|
}
|
|
1005
|
-
async getUserAnswers() {
|
|
991
|
+
async getUserAnswers(flags) {
|
|
992
|
+
const initialAnswers = {};
|
|
993
|
+
Object.keys(flags).forEach((flagName) => {
|
|
994
|
+
if (flagName in ConfigFlags && flags[flagName] !== void 0) {
|
|
995
|
+
const camelCaseFlagName = flagName.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
996
|
+
if (YES_NO.includes(flags[flagName])) {
|
|
997
|
+
initialAnswers[camelCaseFlagName] = flags[flagName];
|
|
998
|
+
} else if (flags[flagName]) {
|
|
999
|
+
initialAnswers[camelCaseFlagName] = flags[flagName];
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
});
|
|
1003
|
+
if (Object.keys(initialAnswers).length > 0) {
|
|
1004
|
+
this.log("\nUsing the following values from provided flags:");
|
|
1005
|
+
Object.entries(initialAnswers).forEach(([key, value]) => {
|
|
1006
|
+
this.log(` ${chalk6.green(key)}: ${value}`);
|
|
1007
|
+
});
|
|
1008
|
+
this.log("");
|
|
1009
|
+
}
|
|
1006
1010
|
const inquirerQuestions = questions.map((q) => {
|
|
1011
|
+
if (initialAnswers[q.name] !== void 0) {
|
|
1012
|
+
return null;
|
|
1013
|
+
}
|
|
1007
1014
|
const baseQuestion = {
|
|
1008
1015
|
name: q.name,
|
|
1009
1016
|
message: q.message,
|
|
1010
|
-
when:
|
|
1017
|
+
when: (answers2) => {
|
|
1018
|
+
const combinedAnswers = { ...initialAnswers, ...answers2 };
|
|
1019
|
+
return q.when ? q.when(combinedAnswers) : true;
|
|
1020
|
+
},
|
|
1011
1021
|
default: q.default,
|
|
1012
1022
|
validate: q.validate
|
|
1013
1023
|
};
|
|
@@ -1034,8 +1044,9 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1034
1044
|
filter: q.sanitize ? (input) => q.sanitize(input) : void 0
|
|
1035
1045
|
};
|
|
1036
1046
|
}
|
|
1037
|
-
});
|
|
1038
|
-
const
|
|
1047
|
+
}).filter((q) => q !== null);
|
|
1048
|
+
const promptAnswers = await inquirer3.prompt(inquirerQuestions);
|
|
1049
|
+
const answers = { ...initialAnswers, ...promptAnswers };
|
|
1039
1050
|
if (answers.langGraphPlatform === "No") {
|
|
1040
1051
|
this.log("\nCurrently the CLI only supports scaffolding LangGraph Platform agents. Use our quickstart guide to get started:\n");
|
|
1041
1052
|
this.log(chalk6.blue("https://docs.copilotkit.ai/coagents/quickstart/langgraph"));
|
|
@@ -1129,7 +1140,7 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1129
1140
|
process.exit(1);
|
|
1130
1141
|
}
|
|
1131
1142
|
}
|
|
1132
|
-
if (userAnswers.
|
|
1143
|
+
if (userAnswers.mode === "LangGraph" && userAnswers.useCopilotCloud === "Yes" && userAnswers.alreadyDeployed === "Yes") {
|
|
1133
1144
|
const langGraphSpinner = ora5({
|
|
1134
1145
|
text: chalk6("\u{1F99C}\u{1F517} Adding LangGraph to Copilot Cloud..."),
|
|
1135
1146
|
color: "cyan"
|
|
@@ -1207,7 +1218,7 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1207
1218
|
let agentDevInstructions = "";
|
|
1208
1219
|
let agentType = "";
|
|
1209
1220
|
let agentSetupMessage = "";
|
|
1210
|
-
if (userAnswers.
|
|
1221
|
+
if (userAnswers.mode === "CrewAI") {
|
|
1211
1222
|
agentType = "CrewAI";
|
|
1212
1223
|
if (userAnswers.crewType === "Crews") {
|
|
1213
1224
|
agentSetupMessage = `Using your Crew from ${chalk6.cyan(userAnswers.crewUrl || "the provided URL")}.`;
|
|
@@ -1215,7 +1226,7 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1215
1226
|
agentSetupMessage = `We've scaffolded a ${chalk6.cyan(userAnswers.crewFlowAgent || "CrewAI")} agent in the ${chalk6.cyan("./agent")} directory.`;
|
|
1216
1227
|
}
|
|
1217
1228
|
}
|
|
1218
|
-
switch (userAnswers.
|
|
1229
|
+
switch (userAnswers.mode) {
|
|
1219
1230
|
case "LangGraph":
|
|
1220
1231
|
switch (userAnswers.langGraphAgent) {
|
|
1221
1232
|
case "Python Starter":
|