copilotkit 0.0.42 → 0.0.43-alpha.1
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/dist/commands/base-command.js +1 -1
- package/dist/commands/base-command.js.map +1 -1
- package/dist/commands/dev.js +17 -1
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/init.d.ts +6 -2
- package/dist/commands/init.js +378 -299
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/login.js +17 -1
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.js +17 -1
- package/dist/commands/logout.js.map +1 -1
- package/dist/lib/init/index.d.ts +2 -2
- package/dist/lib/init/index.js +234 -198
- package/dist/lib/init/index.js.map +1 -1
- package/dist/lib/init/questions.d.ts +3 -1
- package/dist/lib/init/questions.js +211 -183
- package/dist/lib/init/questions.js.map +1 -1
- package/dist/lib/init/scaffold/env.js +13 -3
- package/dist/lib/init/scaffold/env.js.map +1 -1
- package/dist/lib/init/scaffold/index.js +35 -24
- package/dist/lib/init/scaffold/index.js.map +1 -1
- package/dist/lib/init/scaffold/shadcn.js +22 -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 +16 -9
- package/dist/lib/init/types/index.js.map +1 -1
- package/dist/lib/init/types/questions.d.ts +11 -9
- package/dist/lib/init/types/questions.js +14 -7
- package/dist/lib/init/types/questions.js.map +1 -1
- package/dist/lib/init/types/templates.js +2 -2
- package/dist/lib/init/types/templates.js.map +1 -1
- package/dist/services/analytics.service.d.ts +4 -0
- package/dist/services/analytics.service.js +16 -0
- package/dist/services/analytics.service.js.map +1 -1
- package/dist/services/auth.service.js +16 -0
- package/dist/services/auth.service.js.map +1 -1
- package/dist/services/events.d.ts +23 -15
- 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 +12 -12
- package/package.json +1 -1
package/dist/lib/init/index.js
CHANGED
|
@@ -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
|
|
135
|
-
LangGraphPlatformRuntime: `${BASE_URL}/langgraph-platform-
|
|
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
|
-
|
|
316
|
-
|
|
317
|
-
{
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
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
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
|
|
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
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
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
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
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
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
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
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
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
|
-
|
|
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,16 +531,12 @@ async function scaffoldShadCN(flags, userAnswers) {
|
|
|
504
531
|
const components = [];
|
|
505
532
|
switch (userAnswers.mode) {
|
|
506
533
|
case "LangGraph":
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
components.push(templateMapping.LangGraphPlatformRuntime);
|
|
514
|
-
} else {
|
|
515
|
-
components.push(templateMapping.RemoteEndpoint);
|
|
516
|
-
}
|
|
534
|
+
components.push(templateMapping.LangGraphGeneric);
|
|
535
|
+
if (userAnswers.deploymentChoice === "Self-hosted" || userAnswers.useCopilotCloud === "No") {
|
|
536
|
+
if (userAnswers.langGraphPlatform === "Yes") {
|
|
537
|
+
components.push(templateMapping.LangGraphPlatformRuntime);
|
|
538
|
+
} else {
|
|
539
|
+
components.push(templateMapping.RemoteEndpoint);
|
|
517
540
|
}
|
|
518
541
|
}
|
|
519
542
|
break;
|
|
@@ -528,13 +551,13 @@ async function scaffoldShadCN(flags, userAnswers) {
|
|
|
528
551
|
break;
|
|
529
552
|
case "MCP":
|
|
530
553
|
components.push(templateMapping.McpStarter);
|
|
531
|
-
if (userAnswers.useCopilotCloud
|
|
554
|
+
if (userAnswers.deploymentChoice === "Self-hosted" || userAnswers.useCopilotCloud === "No") {
|
|
532
555
|
components.push(templateMapping.McpRuntime);
|
|
533
556
|
}
|
|
534
557
|
break;
|
|
535
558
|
case "Standard":
|
|
536
559
|
components.push(templateMapping.StandardStarter);
|
|
537
|
-
if (userAnswers.useCopilotCloud
|
|
560
|
+
if (userAnswers.deploymentChoice === "Self-hosted" || userAnswers.useCopilotCloud === "No") {
|
|
538
561
|
components.push(templateMapping.StandardRuntime);
|
|
539
562
|
}
|
|
540
563
|
break;
|
|
@@ -584,6 +607,12 @@ async function getLangGraphAgents(url, langSmithApiKey) {
|
|
|
584
607
|
|
|
585
608
|
// src/lib/init/scaffold/env.ts
|
|
586
609
|
import inquirer from "inquirer";
|
|
610
|
+
function needsCloudDeployment(userAnswers) {
|
|
611
|
+
return userAnswers.deploymentChoice === "Copilot Cloud" || // Branch B choice
|
|
612
|
+
userAnswers.useCopilotCloud === "Yes" || // Branch C choice
|
|
613
|
+
userAnswers.mode === "CrewAI" || // CrewAI always needs cloud
|
|
614
|
+
!userAnswers.deploymentChoice && !userAnswers.useCopilotCloud;
|
|
615
|
+
}
|
|
587
616
|
async function scaffoldEnv(flags, userAnswers) {
|
|
588
617
|
try {
|
|
589
618
|
const envFile = path2.join(process.cwd(), ".env");
|
|
@@ -592,6 +621,7 @@ async function scaffoldEnv(flags, userAnswers) {
|
|
|
592
621
|
} else {
|
|
593
622
|
}
|
|
594
623
|
let newEnvValues = "";
|
|
624
|
+
const isCloudDeployment = needsCloudDeployment(userAnswers);
|
|
595
625
|
if (userAnswers.copilotCloudPublicApiKey) {
|
|
596
626
|
newEnvValues += `NEXT_PUBLIC_COPILOT_API_KEY=${userAnswers.copilotCloudPublicApiKey}
|
|
597
627
|
`;
|
|
@@ -613,7 +643,7 @@ async function scaffoldEnv(flags, userAnswers) {
|
|
|
613
643
|
`;
|
|
614
644
|
newEnvValues += `LANGGRAPH_DEPLOYMENT_URL=http://localhost:8123
|
|
615
645
|
`;
|
|
616
|
-
} else if (userAnswers.langGraphPlatform === "Yes" &&
|
|
646
|
+
} else if (userAnswers.langGraphPlatform === "Yes" && !isCloudDeployment) {
|
|
617
647
|
newEnvValues += `LANGGRAPH_DEPLOYMENT_URL=${userAnswers.langGraphPlatformUrl}
|
|
618
648
|
`;
|
|
619
649
|
} else if (userAnswers.langGraphRemoteEndpointURL) {
|
|
@@ -623,12 +653,15 @@ async function scaffoldEnv(flags, userAnswers) {
|
|
|
623
653
|
if (flags.runtimeUrl) {
|
|
624
654
|
newEnvValues += `NEXT_PUBLIC_COPILOTKIT_RUNTIME_URL=${flags.runtimeUrl}
|
|
625
655
|
`;
|
|
626
|
-
} else if (
|
|
656
|
+
} else if (!isCloudDeployment && userAnswers.crewType !== "Crews" && userAnswers.crewType !== "Flows") {
|
|
627
657
|
newEnvValues += `NEXT_PUBLIC_COPILOTKIT_RUNTIME_URL=/api/copilotkit
|
|
628
658
|
`;
|
|
629
659
|
}
|
|
630
660
|
if (userAnswers.langGraphPlatformUrl && (userAnswers.langSmithApiKey || isLocalhost(userAnswers.langGraphPlatformUrl))) {
|
|
631
|
-
const langGraphAgents = await getLangGraphAgents(
|
|
661
|
+
const langGraphAgents = await getLangGraphAgents(
|
|
662
|
+
userAnswers.langGraphPlatformUrl,
|
|
663
|
+
userAnswers.langSmithApiKey || ""
|
|
664
|
+
);
|
|
632
665
|
let langGraphAgent = "";
|
|
633
666
|
if (langGraphAgents.length > 1) {
|
|
634
667
|
const { langGraphAgentChoice } = await inquirer.prompt([
|
|
@@ -937,6 +970,8 @@ export {
|
|
|
937
970
|
ConfigSchema,
|
|
938
971
|
CrewFlowTemplateSchema,
|
|
939
972
|
CrewTypeSchema,
|
|
973
|
+
DEPLOYMENT_CHOICES,
|
|
974
|
+
DeploymentChoiceSchema,
|
|
940
975
|
IDE_DOCS_CONFIGS,
|
|
941
976
|
LANGGRAPH_AGENTS,
|
|
942
977
|
LLMApiKeySchema,
|
|
@@ -951,6 +986,7 @@ export {
|
|
|
951
986
|
addCrewInputs,
|
|
952
987
|
cloneGitHubSubdirectory,
|
|
953
988
|
detectInstalledIDEs,
|
|
989
|
+
getQuestionsForBranch,
|
|
954
990
|
handleIDEDocsSetup,
|
|
955
991
|
isLocalhost,
|
|
956
992
|
isValidGitHubUrl,
|