copilotkit 0.0.43-alpha.0 → 0.0.43
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/create.d.ts +1 -0
- package/dist/commands/create.js +41 -19
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dev.js +1 -17
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/init.d.ts +2 -6
- package/dist/commands/init.js +299 -377
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/login.js +1 -17
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.js +1 -17
- package/dist/commands/logout.js.map +1 -1
- package/dist/lib/init/index.d.ts +2 -2
- package/dist/lib/init/index.js +198 -234
- package/dist/lib/init/index.js.map +1 -1
- package/dist/lib/init/questions.d.ts +1 -3
- package/dist/lib/init/questions.js +183 -211
- package/dist/lib/init/questions.js.map +1 -1
- package/dist/lib/init/scaffold/env.js +3 -13
- package/dist/lib/init/scaffold/env.js.map +1 -1
- package/dist/lib/init/scaffold/index.js +24 -35
- package/dist/lib/init/scaffold/index.js.map +1 -1
- package/dist/lib/init/scaffold/shadcn.js +21 -22
- 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 +9 -16
- package/dist/lib/init/types/index.js.map +1 -1
- package/dist/lib/init/types/questions.d.ts +9 -11
- package/dist/lib/init/types/questions.js +7 -14
- 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 +0 -4
- package/dist/services/analytics.service.js +0 -16
- package/dist/services/analytics.service.js.map +1 -1
- package/dist/services/auth.service.js +0 -16
- package/dist/services/auth.service.js.map +1 -1
- package/dist/services/events.d.ts +15 -23
- 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 +26 -15
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -138,22 +138,6 @@ var AnalyticsService = class {
|
|
|
138
138
|
return false;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
/**
|
|
142
|
-
* Get feature flag payload
|
|
143
|
-
*/
|
|
144
|
-
async getFeatureFlagPayload(flagKey) {
|
|
145
|
-
if (!this.posthog) {
|
|
146
|
-
return null;
|
|
147
|
-
}
|
|
148
|
-
try {
|
|
149
|
-
const distinctId = this.userId || this.getAnonymousId();
|
|
150
|
-
const payload = await this.posthog.getFeatureFlagPayload(flagKey, distinctId);
|
|
151
|
-
return payload;
|
|
152
|
-
} catch (error) {
|
|
153
|
-
console.warn(`Failed to get feature flag payload ${flagKey}:`, error);
|
|
154
|
-
return null;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
141
|
/**
|
|
158
142
|
* Shutdown analytics services
|
|
159
143
|
*/
|
|
@@ -278,7 +262,7 @@ import { Command } from "@oclif/core";
|
|
|
278
262
|
import Sentry, { consoleIntegration } from "@sentry/node";
|
|
279
263
|
|
|
280
264
|
// src/utils/version.ts
|
|
281
|
-
var LIB_VERSION = "0.0.43
|
|
265
|
+
var LIB_VERSION = "0.0.43";
|
|
282
266
|
|
|
283
267
|
// src/commands/base-command.ts
|
|
284
268
|
import chalk2 from "chalk";
|
|
@@ -342,7 +326,6 @@ var CHAT_COMPONENTS = ["CopilotChat", "CopilotSidebar", "Headless", "CopilotPopu
|
|
|
342
326
|
var LANGGRAPH_AGENTS = ["Python Starter", "TypeScript Starter"];
|
|
343
327
|
var CREW_FLOW_TEMPLATES = ["Starter"];
|
|
344
328
|
var YES_NO = ["Yes", "No"];
|
|
345
|
-
var DEPLOYMENT_CHOICES = ["Copilot Cloud", "Self-hosted"];
|
|
346
329
|
var sanitizers = {
|
|
347
330
|
// Remove trailing slash from URLs
|
|
348
331
|
url: (value) => {
|
|
@@ -371,7 +354,6 @@ var ChatComponentSchema = z.enum(CHAT_COMPONENTS);
|
|
|
371
354
|
var LangGraphAgentSchema = z.enum(LANGGRAPH_AGENTS);
|
|
372
355
|
var CrewFlowTemplateSchema = z.enum(CREW_FLOW_TEMPLATES);
|
|
373
356
|
var YesNoSchema = z.enum(YES_NO);
|
|
374
|
-
var DeploymentChoiceSchema = z.enum(DEPLOYMENT_CHOICES);
|
|
375
357
|
var UrlSchema = z.preprocess(
|
|
376
358
|
(val) => sanitizers.url(String(val)),
|
|
377
359
|
z.string().url("Please enter a valid URL").min(1, "URL is required")
|
|
@@ -384,6 +366,8 @@ var ApiKeySchema = z.preprocess(
|
|
|
384
366
|
var LLMApiKeySchema = z.preprocess((val) => sanitizers.apiKey(String(val)), z.string().optional());
|
|
385
367
|
var NameSchema = z.preprocess((val) => sanitizers.trim(String(val)), z.string().min(1, "Name is required"));
|
|
386
368
|
var ConfigSchema = z.object({
|
|
369
|
+
// NEW: Early signup field
|
|
370
|
+
signupForCopilotCloud: YesNoSchema.optional(),
|
|
387
371
|
// Core fields
|
|
388
372
|
copilotKitVersion: z.string().optional(),
|
|
389
373
|
mode: ModeSchema,
|
|
@@ -391,7 +375,6 @@ var ConfigSchema = z.object({
|
|
|
391
375
|
// Yes/No fields
|
|
392
376
|
alreadyDeployed: YesNoSchema.optional(),
|
|
393
377
|
fastApiEnabled: YesNoSchema.optional(),
|
|
394
|
-
// DEPRECATED: useCopilotCloud - consolidated with signupForCopilotCloud
|
|
395
378
|
useCopilotCloud: YesNoSchema.optional(),
|
|
396
379
|
// LangGraph specific fields
|
|
397
380
|
langGraphAgent: LangGraphAgentSchema.optional(),
|
|
@@ -409,10 +392,7 @@ var ConfigSchema = z.object({
|
|
|
409
392
|
llmToken: LLMApiKeySchema.optional(),
|
|
410
393
|
// IDE Documentation setup fields
|
|
411
394
|
setupIDEDocs: YesNoSchema.optional(),
|
|
412
|
-
selectedIDE: z.union([z.enum(["cursor", "windsurf"]), z.literal("skip")]).optional()
|
|
413
|
-
// NEW: A/B/C test fields
|
|
414
|
-
deploymentChoice: DeploymentChoiceSchema.optional()
|
|
415
|
-
// For branch B only (Cloud vs Self-hosted)
|
|
395
|
+
selectedIDE: z.union([z.enum(["cursor", "windsurf"]), z.literal("skip")]).optional()
|
|
416
396
|
}).refine(
|
|
417
397
|
(data) => {
|
|
418
398
|
if (data.mode === "CrewAI") {
|
|
@@ -438,6 +418,10 @@ var ConfigSchema = z.object({
|
|
|
438
418
|
);
|
|
439
419
|
var ConfigFlags = {
|
|
440
420
|
booth: Flags.boolean({ description: "Use CopilotKit in booth mode", default: false, char: "b" }),
|
|
421
|
+
"signup-for-copilot-cloud": Flags.string({
|
|
422
|
+
description: "Sign up for Copilot Cloud for error tracking and debugging insights",
|
|
423
|
+
options: YES_NO
|
|
424
|
+
}),
|
|
441
425
|
mode: Flags.string({ description: "How you will be interacting with AI", options: MODES, char: "m" }),
|
|
442
426
|
"copilotkit-version": Flags.string({ description: "CopilotKit version to use (e.g. 1.7.0)" }),
|
|
443
427
|
"use-copilot-cloud": Flags.string({ description: "Use Copilot Cloud for production-ready hosting", options: YES_NO }),
|
|
@@ -452,11 +436,6 @@ var ConfigFlags = {
|
|
|
452
436
|
"selected-ide": Flags.string({
|
|
453
437
|
description: "IDE to configure with documentation rules",
|
|
454
438
|
options: ["cursor", "windsurf", "skip"]
|
|
455
|
-
}),
|
|
456
|
-
// NEW: A/B/C test flags
|
|
457
|
-
"deployment-choice": Flags.string({
|
|
458
|
-
description: "Choose between Copilot Cloud or Self-hosted deployment",
|
|
459
|
-
options: DEPLOYMENT_CHOICES
|
|
460
439
|
})
|
|
461
440
|
};
|
|
462
441
|
|
|
@@ -464,8 +443,8 @@ var ConfigFlags = {
|
|
|
464
443
|
var BASE_URL = "https://registry.copilotkit.ai/r";
|
|
465
444
|
var templateMapping = {
|
|
466
445
|
// Runtimes
|
|
467
|
-
RemoteEndpoint: `${BASE_URL}/remote-endpoint.json`,
|
|
468
|
-
LangGraphPlatformRuntime: `${BASE_URL}/langgraph-platform-
|
|
446
|
+
RemoteEndpoint: `${BASE_URL}/remote-endpoint-starter.json`,
|
|
447
|
+
LangGraphPlatformRuntime: `${BASE_URL}/langgraph-platform-starter.json`,
|
|
469
448
|
// CrewAI
|
|
470
449
|
CrewEnterprise: [`${BASE_URL}/coagents-crew-starter.json`],
|
|
471
450
|
CrewFlowsEnterprise: [`${BASE_URL}/coagents-starter-crewai-flows.json`],
|
|
@@ -645,212 +624,190 @@ var validateUrl = (input) => {
|
|
|
645
624
|
var validateRequired = (input) => {
|
|
646
625
|
return sanitizers.trim(input) ? true : "This field is required";
|
|
647
626
|
};
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
function getBaseQuestions() {
|
|
661
|
-
return [
|
|
662
|
-
{
|
|
663
|
-
type: "select",
|
|
664
|
-
name: "mode",
|
|
665
|
-
message: "\u{1F916} How will you be interacting with AI?",
|
|
666
|
-
choices: Array.from(MODES),
|
|
667
|
-
validate: (input) => {
|
|
668
|
-
try {
|
|
669
|
-
ModeSchema.parse(input);
|
|
670
|
-
return true;
|
|
671
|
-
} catch (error) {
|
|
672
|
-
return "Please select a valid mode";
|
|
673
|
-
}
|
|
627
|
+
var questions = [
|
|
628
|
+
// NEW: Early signup question - first question for maximum visibility
|
|
629
|
+
{
|
|
630
|
+
type: "yes/no",
|
|
631
|
+
name: "signupForCopilotCloud",
|
|
632
|
+
message: "\u{1FA81} Sign up for Copilot Cloud to enable error tracking and get production-ready hosting? (Recommended)",
|
|
633
|
+
validate: (input) => {
|
|
634
|
+
try {
|
|
635
|
+
YesNoSchema.parse(input);
|
|
636
|
+
return true;
|
|
637
|
+
} catch (error) {
|
|
638
|
+
return "Please select Yes or No";
|
|
674
639
|
}
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
}
|
|
640
|
+
}
|
|
641
|
+
},
|
|
642
|
+
// Core setup questions - always shown after signup
|
|
643
|
+
{
|
|
644
|
+
type: "select",
|
|
645
|
+
name: "mode",
|
|
646
|
+
message: "\u{1F916} How will you be interacting with AI?",
|
|
647
|
+
choices: Array.from(MODES),
|
|
648
|
+
validate: (input) => {
|
|
649
|
+
try {
|
|
650
|
+
ModeSchema.parse(input);
|
|
651
|
+
return true;
|
|
652
|
+
} catch (error) {
|
|
653
|
+
return "Please select a valid mode";
|
|
690
654
|
}
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
validate: validateUrl,
|
|
707
|
-
sanitize: sanitizers.url
|
|
708
|
-
},
|
|
709
|
-
{
|
|
710
|
-
type: "input",
|
|
711
|
-
name: "crewBearerToken",
|
|
712
|
-
message: "\u{1F511} Enter your Crew's bearer token:",
|
|
713
|
-
when: (answers) => answers.mode === "CrewAI",
|
|
714
|
-
sensitive: true,
|
|
715
|
-
validate: validateRequired,
|
|
716
|
-
sanitize: sanitizers.trim
|
|
717
|
-
},
|
|
718
|
-
// LangGraph specific questions
|
|
719
|
-
{
|
|
720
|
-
type: "yes/no",
|
|
721
|
-
name: "alreadyDeployed",
|
|
722
|
-
message: "\u{1F99C}\u{1F517} Do you have an existing LangGraph agent?",
|
|
723
|
-
when: (answers) => answers.mode === "LangGraph",
|
|
724
|
-
validate: (input) => {
|
|
725
|
-
try {
|
|
726
|
-
YesNoSchema.parse(input);
|
|
727
|
-
return true;
|
|
728
|
-
} catch (error) {
|
|
729
|
-
return "Please select Yes or No";
|
|
730
|
-
}
|
|
655
|
+
}
|
|
656
|
+
},
|
|
657
|
+
// CrewAI specific questions - shown when CrewAI selected
|
|
658
|
+
{
|
|
659
|
+
type: "select",
|
|
660
|
+
name: "crewType",
|
|
661
|
+
message: "\u{1F465} What kind of CrewAI implementation would you like to use?",
|
|
662
|
+
choices: Array.from(CREW_TYPES),
|
|
663
|
+
when: (answers) => answers.mode === "CrewAI",
|
|
664
|
+
validate: (input) => {
|
|
665
|
+
try {
|
|
666
|
+
CrewTypeSchema.parse(input);
|
|
667
|
+
return true;
|
|
668
|
+
} catch (error) {
|
|
669
|
+
return "Please select a valid crew type";
|
|
731
670
|
}
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
671
|
+
}
|
|
672
|
+
},
|
|
673
|
+
// CrewAI specific questions - shown when CrewAI Crews or Flows selected
|
|
674
|
+
{
|
|
675
|
+
type: "input",
|
|
676
|
+
name: "crewName",
|
|
677
|
+
message: "\u{1F465} What would you like to name your crew? (can be anything)",
|
|
678
|
+
when: (answers) => answers.mode === "CrewAI",
|
|
679
|
+
default: "MyCopilotCrew",
|
|
680
|
+
validate: validateRequired,
|
|
681
|
+
sanitize: sanitizers.trim
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
type: "input",
|
|
685
|
+
name: "crewUrl",
|
|
686
|
+
message: "\u{1F517} Enter your Crew's Enterprise URL (more info at https://app.crewai.com):",
|
|
687
|
+
when: (answers) => answers.mode === "CrewAI",
|
|
688
|
+
validate: validateUrl,
|
|
689
|
+
sanitize: sanitizers.url
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
type: "input",
|
|
693
|
+
name: "crewBearerToken",
|
|
694
|
+
message: "\u{1F511} Enter your Crew's bearer token:",
|
|
695
|
+
when: (answers) => answers.mode === "CrewAI",
|
|
696
|
+
sensitive: true,
|
|
697
|
+
validate: validateRequired,
|
|
698
|
+
sanitize: sanitizers.trim
|
|
699
|
+
},
|
|
700
|
+
// LangGraph specific questions - shown when LangGraph selected
|
|
701
|
+
{
|
|
702
|
+
type: "yes/no",
|
|
703
|
+
name: "alreadyDeployed",
|
|
704
|
+
message: "\u{1F99C}\u{1F517} Do you have an existing LangGraph agent?",
|
|
705
|
+
when: (answers) => answers.mode === "LangGraph",
|
|
706
|
+
validate: (input) => {
|
|
707
|
+
try {
|
|
708
|
+
YesNoSchema.parse(input);
|
|
709
|
+
return true;
|
|
710
|
+
} catch (error) {
|
|
711
|
+
return "Please select Yes or No";
|
|
745
712
|
}
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
choices: Array.from(LANGGRAPH_AGENTS),
|
|
760
|
-
when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "No"
|
|
761
|
-
},
|
|
762
|
-
{
|
|
763
|
-
type: "input",
|
|
764
|
-
name: "langSmithApiKey",
|
|
765
|
-
message: "\u{1F99C}\u{1F517} Enter your LangSmith API key (required by LangGraph Platform) :",
|
|
766
|
-
when: (answers) => answers.mode === "LangGraph" && answers.langGraphPlatform === "Yes" && !(answers.langGraphPlatformUrl && isLocalhost(answers.langGraphPlatformUrl)),
|
|
767
|
-
sensitive: true,
|
|
768
|
-
validate: validateRequired,
|
|
769
|
-
sanitize: sanitizers.apiKey
|
|
770
|
-
},
|
|
771
|
-
// LLM Token for self-hosted setups
|
|
772
|
-
{
|
|
773
|
-
type: "input",
|
|
774
|
-
name: "llmToken",
|
|
775
|
-
message: "\u{1F511} Enter your OpenAI API key (optional - leave empty to configure your LLM later):",
|
|
776
|
-
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",
|
|
777
|
-
sensitive: true,
|
|
778
|
-
sanitize: sanitizers.apiKey
|
|
779
|
-
},
|
|
780
|
-
// IDE Documentation Setup Questions
|
|
781
|
-
{
|
|
782
|
-
type: "yes/no",
|
|
783
|
-
name: "setupIDEDocs",
|
|
784
|
-
message: "\u{1F4DA} Would you like to add CopilotKit documentation to your IDE? (Provides AI assistant with CopilotKit context)",
|
|
785
|
-
when: async () => {
|
|
786
|
-
const installedIDEs = await detectInstalledIDEs();
|
|
787
|
-
return installedIDEs.length > 0;
|
|
788
|
-
},
|
|
789
|
-
validate: (input) => {
|
|
790
|
-
try {
|
|
791
|
-
YesNoSchema.parse(input);
|
|
792
|
-
return true;
|
|
793
|
-
} catch (error) {
|
|
794
|
-
return "Please select Yes or No";
|
|
795
|
-
}
|
|
713
|
+
}
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
type: "yes/no",
|
|
717
|
+
name: "langGraphPlatform",
|
|
718
|
+
message: "\u{1F99C}\u{1F517} Do you already have a LangGraph Agent URL? (remote or localhost)",
|
|
719
|
+
when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "Yes",
|
|
720
|
+
validate: (input) => {
|
|
721
|
+
try {
|
|
722
|
+
YesNoSchema.parse(input);
|
|
723
|
+
return true;
|
|
724
|
+
} catch (error) {
|
|
725
|
+
return "Please select Yes or No";
|
|
796
726
|
}
|
|
797
|
-
},
|
|
798
|
-
{
|
|
799
|
-
type: "select",
|
|
800
|
-
name: "selectedIDE",
|
|
801
|
-
message: "\u{1F4BB} Which IDE would you like to configure with CopilotKit documentation?",
|
|
802
|
-
choices: async () => {
|
|
803
|
-
const installedIDEs = await detectInstalledIDEs();
|
|
804
|
-
const choices = installedIDEs.map((ide) => ({
|
|
805
|
-
name: IDE_DOCS_CONFIGS[ide].displayName,
|
|
806
|
-
value: ide
|
|
807
|
-
}));
|
|
808
|
-
choices.push({ name: "Skip", value: "skip" });
|
|
809
|
-
return choices;
|
|
810
|
-
},
|
|
811
|
-
when: (answers) => answers.setupIDEDocs === "Yes"
|
|
812
727
|
}
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
{
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
type: "input",
|
|
731
|
+
name: "langGraphPlatformUrl",
|
|
732
|
+
message: "\u{1F99C}\u{1F517} Enter your LangGraph Agent URL (remote or localhost)",
|
|
733
|
+
when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "Yes" && answers.langGraphPlatform === "Yes",
|
|
734
|
+
validate: validateUrl,
|
|
735
|
+
sanitize: sanitizers.url
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
type: "select",
|
|
739
|
+
name: "langGraphAgent",
|
|
740
|
+
message: "\u{1F4E6} Choose a LangGraph starter template:",
|
|
741
|
+
choices: Array.from(LANGGRAPH_AGENTS),
|
|
742
|
+
when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "No"
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
type: "input",
|
|
746
|
+
name: "langSmithApiKey",
|
|
747
|
+
message: "\u{1F99C}\u{1F517} Enter your LangSmith API key (required by LangGraph Platform) :",
|
|
748
|
+
when: (answers) => answers.mode === "LangGraph" && answers.langGraphPlatform === "Yes" && !(answers.langGraphPlatformUrl && isLocalhost(answers.langGraphPlatformUrl)),
|
|
749
|
+
sensitive: true,
|
|
750
|
+
validate: validateRequired,
|
|
751
|
+
sanitize: sanitizers.apiKey
|
|
752
|
+
},
|
|
753
|
+
// Deployment options
|
|
754
|
+
{
|
|
755
|
+
type: "yes/no",
|
|
756
|
+
name: "useCopilotCloud",
|
|
757
|
+
message: "\u{1FA81} Deploy with Copilot Cloud? (recommended for production)",
|
|
758
|
+
when: (answers) => answers.mode === "Standard" || answers.mode === "MCP" || answers.mode !== "CrewAI" && // Crews only cloud, flows are self-hosted
|
|
759
|
+
answers.alreadyDeployed === "Yes" && answers.langGraphPlatform !== "No" && !linkToDocs.includes(answers.mode || "") && !isLocalhost(answers.langGraphPlatformUrl || ""),
|
|
760
|
+
validate: (input) => {
|
|
761
|
+
try {
|
|
762
|
+
YesNoSchema.parse(input);
|
|
763
|
+
return true;
|
|
764
|
+
} catch (error) {
|
|
765
|
+
return "Please select Yes or No";
|
|
829
766
|
}
|
|
830
767
|
}
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
{
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
type: "input",
|
|
771
|
+
name: "llmToken",
|
|
772
|
+
message: "\u{1F511} Enter your OpenAI API key (optional - leave empty to configure your LLM later):",
|
|
773
|
+
when: (answers) => answers.mode === "LangGraph" && answers.alreadyDeployed === "No" || answers.mode === "Standard" && answers.useCopilotCloud !== "Yes" || answers.mode === "MCP" && answers.useCopilotCloud !== "Yes",
|
|
774
|
+
sensitive: true,
|
|
775
|
+
sanitize: sanitizers.apiKey
|
|
776
|
+
},
|
|
777
|
+
// IDE Documentation Setup Questions
|
|
778
|
+
{
|
|
779
|
+
type: "yes/no",
|
|
780
|
+
name: "setupIDEDocs",
|
|
781
|
+
message: "\u{1F4DA} Would you like to add CopilotKit documentation to your IDE? (Provides AI assistant with CopilotKit context)",
|
|
782
|
+
when: async () => {
|
|
783
|
+
const installedIDEs = await detectInstalledIDEs();
|
|
784
|
+
return installedIDEs.length > 0;
|
|
785
|
+
},
|
|
786
|
+
validate: (input) => {
|
|
787
|
+
try {
|
|
788
|
+
YesNoSchema.parse(input);
|
|
789
|
+
return true;
|
|
790
|
+
} catch (error) {
|
|
791
|
+
return "Please select Yes or No";
|
|
849
792
|
}
|
|
850
793
|
}
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
type: "select",
|
|
797
|
+
name: "selectedIDE",
|
|
798
|
+
message: "\u{1F4BB} Which IDE would you like to configure with CopilotKit documentation?",
|
|
799
|
+
choices: async () => {
|
|
800
|
+
const installedIDEs = await detectInstalledIDEs();
|
|
801
|
+
const choices = installedIDEs.map((ide) => ({
|
|
802
|
+
name: IDE_DOCS_CONFIGS[ide].displayName,
|
|
803
|
+
value: ide
|
|
804
|
+
}));
|
|
805
|
+
choices.push({ name: "Skip", value: "skip" });
|
|
806
|
+
return choices;
|
|
807
|
+
},
|
|
808
|
+
when: (answers) => answers.setupIDEDocs === "Yes"
|
|
809
|
+
}
|
|
810
|
+
];
|
|
854
811
|
|
|
855
812
|
// src/lib/init/scaffold/shadcn.ts
|
|
856
813
|
import spawn from "cross-spawn";
|
|
@@ -859,12 +816,16 @@ async function scaffoldShadCN(flags, userAnswers) {
|
|
|
859
816
|
const components = [];
|
|
860
817
|
switch (userAnswers.mode) {
|
|
861
818
|
case "LangGraph":
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
819
|
+
if (userAnswers.langGraphAgent || flags.booth) {
|
|
820
|
+
components.push(...templateMapping.LangGraphStarter);
|
|
821
|
+
} else {
|
|
822
|
+
components.push(templateMapping.LangGraphGeneric);
|
|
823
|
+
if (userAnswers.useCopilotCloud !== "Yes") {
|
|
824
|
+
if (userAnswers.langGraphPlatform === "Yes") {
|
|
825
|
+
components.push(templateMapping.LangGraphPlatformRuntime);
|
|
826
|
+
} else {
|
|
827
|
+
components.push(templateMapping.RemoteEndpoint);
|
|
828
|
+
}
|
|
868
829
|
}
|
|
869
830
|
}
|
|
870
831
|
break;
|
|
@@ -879,13 +840,13 @@ async function scaffoldShadCN(flags, userAnswers) {
|
|
|
879
840
|
break;
|
|
880
841
|
case "MCP":
|
|
881
842
|
components.push(templateMapping.McpStarter);
|
|
882
|
-
if (userAnswers.
|
|
843
|
+
if (userAnswers.useCopilotCloud !== "Yes") {
|
|
883
844
|
components.push(templateMapping.McpRuntime);
|
|
884
845
|
}
|
|
885
846
|
break;
|
|
886
847
|
case "Standard":
|
|
887
848
|
components.push(templateMapping.StandardStarter);
|
|
888
|
-
if (userAnswers.
|
|
849
|
+
if (userAnswers.useCopilotCloud !== "Yes") {
|
|
889
850
|
components.push(templateMapping.StandardRuntime);
|
|
890
851
|
}
|
|
891
852
|
break;
|
|
@@ -935,12 +896,6 @@ async function getLangGraphAgents(url, langSmithApiKey) {
|
|
|
935
896
|
|
|
936
897
|
// src/lib/init/scaffold/env.ts
|
|
937
898
|
import inquirer2 from "inquirer";
|
|
938
|
-
function needsCloudDeployment(userAnswers) {
|
|
939
|
-
return userAnswers.deploymentChoice === "Copilot Cloud" || // Branch B choice
|
|
940
|
-
userAnswers.useCopilotCloud === "Yes" || // Branch C choice
|
|
941
|
-
userAnswers.mode === "CrewAI" || // CrewAI always needs cloud
|
|
942
|
-
!userAnswers.deploymentChoice && !userAnswers.useCopilotCloud;
|
|
943
|
-
}
|
|
944
899
|
async function scaffoldEnv(flags, userAnswers) {
|
|
945
900
|
try {
|
|
946
901
|
const envFile = path2.join(process.cwd(), ".env");
|
|
@@ -949,7 +904,6 @@ async function scaffoldEnv(flags, userAnswers) {
|
|
|
949
904
|
} else {
|
|
950
905
|
}
|
|
951
906
|
let newEnvValues = "";
|
|
952
|
-
const isCloudDeployment = needsCloudDeployment(userAnswers);
|
|
953
907
|
if (userAnswers.copilotCloudPublicApiKey) {
|
|
954
908
|
newEnvValues += `NEXT_PUBLIC_COPILOT_API_KEY=${userAnswers.copilotCloudPublicApiKey}
|
|
955
909
|
`;
|
|
@@ -971,7 +925,7 @@ async function scaffoldEnv(flags, userAnswers) {
|
|
|
971
925
|
`;
|
|
972
926
|
newEnvValues += `LANGGRAPH_DEPLOYMENT_URL=http://localhost:8123
|
|
973
927
|
`;
|
|
974
|
-
} else if (userAnswers.langGraphPlatform === "Yes" &&
|
|
928
|
+
} else if (userAnswers.langGraphPlatform === "Yes" && userAnswers.useCopilotCloud !== "Yes") {
|
|
975
929
|
newEnvValues += `LANGGRAPH_DEPLOYMENT_URL=${userAnswers.langGraphPlatformUrl}
|
|
976
930
|
`;
|
|
977
931
|
} else if (userAnswers.langGraphRemoteEndpointURL) {
|
|
@@ -981,15 +935,12 @@ async function scaffoldEnv(flags, userAnswers) {
|
|
|
981
935
|
if (flags.runtimeUrl) {
|
|
982
936
|
newEnvValues += `NEXT_PUBLIC_COPILOTKIT_RUNTIME_URL=${flags.runtimeUrl}
|
|
983
937
|
`;
|
|
984
|
-
} else if (
|
|
938
|
+
} else if (userAnswers.useCopilotCloud !== "Yes" && userAnswers.crewType !== "Crews" && userAnswers.crewType !== "Flows") {
|
|
985
939
|
newEnvValues += `NEXT_PUBLIC_COPILOTKIT_RUNTIME_URL=/api/copilotkit
|
|
986
940
|
`;
|
|
987
941
|
}
|
|
988
942
|
if (userAnswers.langGraphPlatformUrl && (userAnswers.langSmithApiKey || isLocalhost(userAnswers.langGraphPlatformUrl))) {
|
|
989
|
-
const langGraphAgents = await getLangGraphAgents(
|
|
990
|
-
userAnswers.langGraphPlatformUrl,
|
|
991
|
-
userAnswers.langSmithApiKey || ""
|
|
992
|
-
);
|
|
943
|
+
const langGraphAgents = await getLangGraphAgents(userAnswers.langGraphPlatformUrl, userAnswers.langSmithApiKey || "");
|
|
993
944
|
let langGraphAgent = "";
|
|
994
945
|
if (langGraphAgents.length > 1) {
|
|
995
946
|
const { langGraphAgentChoice } = await inquirer2.prompt([
|
|
@@ -1275,8 +1226,7 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1275
1226
|
}
|
|
1276
1227
|
this.queueAnalytics("cli.init.mode_selected", {
|
|
1277
1228
|
mode: userAnswers.mode,
|
|
1278
|
-
|
|
1279
|
-
deployment_choice: userAnswers.deploymentChoice
|
|
1229
|
+
early_signup_completed: !!cloudSetupInfo
|
|
1280
1230
|
});
|
|
1281
1231
|
if (userAnswers.mode === "Mastra") {
|
|
1282
1232
|
this.log(chalk7.magenta(`
|
|
@@ -1295,17 +1245,15 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1295
1245
|
\u{1F517} Please go to https://docs.copilotkit.ai/llamaindex/quickstart to get started.`));
|
|
1296
1246
|
process.exit(0);
|
|
1297
1247
|
}
|
|
1298
|
-
const
|
|
1299
|
-
userAnswers.useCopilotCloud
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
});
|
|
1308
|
-
if (needsCloudDeployment2) {
|
|
1248
|
+
const needsCloudDeployment = userAnswers.useCopilotCloud === "Yes" || userAnswers.mode === "CrewAI";
|
|
1249
|
+
if (userAnswers.useCopilotCloud) {
|
|
1250
|
+
this.queueAnalytics("cli.init.cloud_deployment_selected", {
|
|
1251
|
+
choice: userAnswers.useCopilotCloud,
|
|
1252
|
+
mode: userAnswers.mode,
|
|
1253
|
+
early_signup_completed: !!cloudSetupInfo
|
|
1254
|
+
});
|
|
1255
|
+
}
|
|
1256
|
+
if (needsCloudDeployment) {
|
|
1309
1257
|
if (cloudSetupInfo) {
|
|
1310
1258
|
await this.completeCloudDeploymentSetup(flags, userAnswers, cloudSetupInfo);
|
|
1311
1259
|
} else {
|
|
@@ -1334,9 +1282,8 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1334
1282
|
}
|
|
1335
1283
|
this.queueAnalytics("cli.init.completed", {
|
|
1336
1284
|
mode: userAnswers.mode,
|
|
1337
|
-
|
|
1338
|
-
cloud_deployment:
|
|
1339
|
-
deployment_choice: userAnswers.deploymentChoice,
|
|
1285
|
+
early_signup_completed: !!cloudSetupInfo,
|
|
1286
|
+
cloud_deployment: needsCloudDeployment,
|
|
1340
1287
|
agent_scaffolded: agentScaffolded,
|
|
1341
1288
|
api_key_in_env: !!userAnswers.copilotCloudPublicApiKey,
|
|
1342
1289
|
duration_ms: Date.now() - this.startTime
|
|
@@ -1351,7 +1298,7 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1351
1298
|
this.log(` - Talk to your agent.`);
|
|
1352
1299
|
this.log(chalk7.magenta("\nThanks for giving CopilotKit a try! \u{1FA81}\n"));
|
|
1353
1300
|
} else {
|
|
1354
|
-
this.finalSummary(userAnswers
|
|
1301
|
+
this.finalSummary(userAnswers);
|
|
1355
1302
|
}
|
|
1356
1303
|
} catch (error) {
|
|
1357
1304
|
this.queueAnalytics("cli.init.failed", {
|
|
@@ -1363,24 +1310,6 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1363
1310
|
this.gracefulError(error.message);
|
|
1364
1311
|
}
|
|
1365
1312
|
}
|
|
1366
|
-
/**
|
|
1367
|
-
* Get A/B/C test branch from feature flags
|
|
1368
|
-
*/
|
|
1369
|
-
async getABCTestBranch() {
|
|
1370
|
-
const defaultBranch = "C";
|
|
1371
|
-
if (!this.analytics) {
|
|
1372
|
-
return defaultBranch;
|
|
1373
|
-
}
|
|
1374
|
-
try {
|
|
1375
|
-
const payload = await this.analytics.getFeatureFlagPayload("enterprise-by-default");
|
|
1376
|
-
if (payload && typeof payload === "object" && payload.branch) {
|
|
1377
|
-
return payload.branch;
|
|
1378
|
-
}
|
|
1379
|
-
return defaultBranch;
|
|
1380
|
-
} catch (error) {
|
|
1381
|
-
return defaultBranch;
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
1313
|
/**
|
|
1385
1314
|
* Queue an analytics event to be sent later (non-blocking)
|
|
1386
1315
|
*/
|
|
@@ -1437,14 +1366,72 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1437
1366
|
}
|
|
1438
1367
|
}
|
|
1439
1368
|
});
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1369
|
+
let signupAnswer = initialAnswers.signupForCopilotCloud;
|
|
1370
|
+
let isCloudByDefault = false;
|
|
1371
|
+
try {
|
|
1372
|
+
isCloudByDefault = await this.analytics.isFeatureEnabled("cloud-by-default");
|
|
1373
|
+
} catch {
|
|
1374
|
+
}
|
|
1375
|
+
if (!signupAnswer) {
|
|
1376
|
+
if (isCloudByDefault) {
|
|
1377
|
+
this.queueAnalytics("cli.init.early_signup_prompt_shown", {});
|
|
1378
|
+
const signupResult = await inquirer3.prompt([
|
|
1379
|
+
{
|
|
1380
|
+
type: "list",
|
|
1381
|
+
name: "signupForCopilotCloud",
|
|
1382
|
+
message: "\u{1FA81} Sign up for Copilot Cloud to enable error tracking and get production-ready hosting? (Recommended)",
|
|
1383
|
+
choices: ["Yes", "No"]
|
|
1384
|
+
}
|
|
1385
|
+
]);
|
|
1386
|
+
signupAnswer = signupResult.signupForCopilotCloud;
|
|
1387
|
+
} else {
|
|
1388
|
+
signupAnswer = "No";
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
if (isCloudByDefault || initialAnswers.signupForCopilotCloud) {
|
|
1392
|
+
this.queueAnalytics("cli.init.early_signup_selected", {
|
|
1393
|
+
choice: signupAnswer,
|
|
1394
|
+
cloud_by_default_enabled: isCloudByDefault
|
|
1395
|
+
});
|
|
1396
|
+
}
|
|
1445
1397
|
let cloudSetupInfo = null;
|
|
1446
1398
|
let earlyApiKey;
|
|
1447
|
-
|
|
1399
|
+
if (signupAnswer === "Yes") {
|
|
1400
|
+
try {
|
|
1401
|
+
const tempConfig = { ...initialAnswers, signupForCopilotCloud: signupAnswer };
|
|
1402
|
+
const earlySignupResult = await this.handleEarlyCloudSignup(flags, tempConfig);
|
|
1403
|
+
cloudSetupInfo = earlySignupResult;
|
|
1404
|
+
earlyApiKey = earlySignupResult.apiKey;
|
|
1405
|
+
if (this.analytics && cloudSetupInfo.cliToken) {
|
|
1406
|
+
const trpcClient2 = createTRPCClient(cloudSetupInfo.cliToken);
|
|
1407
|
+
const me = await trpcClient2.me.query();
|
|
1408
|
+
if (me.user && me.organization) {
|
|
1409
|
+
this.analytics = new AnalyticsService({
|
|
1410
|
+
userId: me.user.id,
|
|
1411
|
+
organizationId: me.organization.id,
|
|
1412
|
+
email: me.user.email
|
|
1413
|
+
});
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
this.queueAnalytics("cli.init.early_signup_completed", {
|
|
1417
|
+
userId: cloudSetupInfo.organization?.id || "unknown",
|
|
1418
|
+
organizationId: cloudSetupInfo.organization?.id || "unknown",
|
|
1419
|
+
email: "unknown",
|
|
1420
|
+
// Will be updated when we get user info
|
|
1421
|
+
projectId: cloudSetupInfo.selectedProjectId || "unknown",
|
|
1422
|
+
api_key_retrieved: !!earlyApiKey
|
|
1423
|
+
});
|
|
1424
|
+
} catch (error) {
|
|
1425
|
+
this.queueAnalytics("cli.init.early_signup_failed", {
|
|
1426
|
+
error: error.message,
|
|
1427
|
+
step: "auth"
|
|
1428
|
+
// Could be more specific based on where it failed
|
|
1429
|
+
});
|
|
1430
|
+
throw error;
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
const remainingQuestions = questions.slice(1);
|
|
1434
|
+
const inquirerQuestions = remainingQuestions.map((q) => {
|
|
1448
1435
|
if (initialAnswers[q.name] !== void 0) {
|
|
1449
1436
|
return null;
|
|
1450
1437
|
}
|
|
@@ -1452,7 +1439,7 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1452
1439
|
name: q.name,
|
|
1453
1440
|
message: q.message,
|
|
1454
1441
|
when: (answers2) => {
|
|
1455
|
-
const combinedAnswers = { ...initialAnswers, ...answers2 };
|
|
1442
|
+
const combinedAnswers = { ...initialAnswers, signupForCopilotCloud: signupAnswer, ...answers2 };
|
|
1456
1443
|
return q.when ? q.when(combinedAnswers) : true;
|
|
1457
1444
|
},
|
|
1458
1445
|
default: q.default,
|
|
@@ -1477,6 +1464,7 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1477
1464
|
...baseQuestion,
|
|
1478
1465
|
type: q.sensitive ? "password" : "input",
|
|
1479
1466
|
mask: q.sensitive ? "*" : void 0,
|
|
1467
|
+
// Add sanitization filter for input fields
|
|
1480
1468
|
filter: q.sanitize ? (input) => q.sanitize(input) : void 0
|
|
1481
1469
|
};
|
|
1482
1470
|
}
|
|
@@ -1484,73 +1472,11 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1484
1472
|
const promptAnswers = await inquirer3.prompt(inquirerQuestions);
|
|
1485
1473
|
const answers = {
|
|
1486
1474
|
...initialAnswers,
|
|
1475
|
+
signupForCopilotCloud: signupAnswer,
|
|
1487
1476
|
...promptAnswers,
|
|
1488
1477
|
...earlyApiKey && { copilotCloudPublicApiKey: earlyApiKey }
|
|
1478
|
+
// Add API key if we got one from early signup
|
|
1489
1479
|
};
|
|
1490
|
-
if (abcBranch === "B" && !cloudSetupInfo) {
|
|
1491
|
-
this.log(chalk7.cyan("\n\u{1F511} Now you will get an API key"));
|
|
1492
|
-
this.log(chalk7.gray("Setting up your cloud account and retrieving your API key...\n"));
|
|
1493
|
-
try {
|
|
1494
|
-
const tempConfig = { ...answers, signupForCopilotCloud: "Yes" };
|
|
1495
|
-
const cloudSignupResult = await this.setupApiKey(flags, tempConfig);
|
|
1496
|
-
cloudSetupInfo = cloudSignupResult;
|
|
1497
|
-
answers.copilotCloudPublicApiKey = cloudSignupResult.apiKey;
|
|
1498
|
-
if (this.analytics && cloudSetupInfo.cliToken) {
|
|
1499
|
-
const trpcClient2 = createTRPCClient(cloudSetupInfo.cliToken);
|
|
1500
|
-
const me = await trpcClient2.me.query();
|
|
1501
|
-
if (me.user && me.organization) {
|
|
1502
|
-
this.analytics = new AnalyticsService({
|
|
1503
|
-
userId: me.user.id,
|
|
1504
|
-
organizationId: me.organization.id,
|
|
1505
|
-
email: me.user.email
|
|
1506
|
-
});
|
|
1507
|
-
}
|
|
1508
|
-
}
|
|
1509
|
-
this.queueAnalytics("cli.init.branch_b_api_key_setup_completed", {
|
|
1510
|
-
branch: abcBranch,
|
|
1511
|
-
projectId: cloudSetupInfo.selectedProjectId || "unknown",
|
|
1512
|
-
api_key_retrieved: !!cloudSetupInfo.apiKey
|
|
1513
|
-
});
|
|
1514
|
-
} catch (error) {
|
|
1515
|
-
this.queueAnalytics("cli.init.branch_b_api_key_setup_failed", {
|
|
1516
|
-
error: error.message,
|
|
1517
|
-
branch: abcBranch
|
|
1518
|
-
});
|
|
1519
|
-
throw error;
|
|
1520
|
-
}
|
|
1521
|
-
}
|
|
1522
|
-
if (abcBranch === "A" && !cloudSetupInfo) {
|
|
1523
|
-
this.log(chalk7.cyan("\n\u{1F511} Now get your API key"));
|
|
1524
|
-
this.log(chalk7.gray("Setting up your cloud account and retrieving your API key...\n"));
|
|
1525
|
-
try {
|
|
1526
|
-
const tempConfig = { ...answers, signupForCopilotCloud: "Yes" };
|
|
1527
|
-
const cloudSignupResult = await this.setupApiKey(flags, tempConfig);
|
|
1528
|
-
cloudSetupInfo = cloudSignupResult;
|
|
1529
|
-
answers.copilotCloudPublicApiKey = cloudSignupResult.apiKey;
|
|
1530
|
-
if (this.analytics && cloudSetupInfo.cliToken) {
|
|
1531
|
-
const trpcClient2 = createTRPCClient(cloudSetupInfo.cliToken);
|
|
1532
|
-
const me = await trpcClient2.me.query();
|
|
1533
|
-
if (me.user && me.organization) {
|
|
1534
|
-
this.analytics = new AnalyticsService({
|
|
1535
|
-
userId: me.user.id,
|
|
1536
|
-
organizationId: me.organization.id,
|
|
1537
|
-
email: me.user.email
|
|
1538
|
-
});
|
|
1539
|
-
}
|
|
1540
|
-
}
|
|
1541
|
-
this.queueAnalytics("cli.init.branch_a_cloud_setup_completed", {
|
|
1542
|
-
branch: abcBranch,
|
|
1543
|
-
projectId: cloudSetupInfo.selectedProjectId || "unknown",
|
|
1544
|
-
api_key_retrieved: !!cloudSetupInfo.apiKey
|
|
1545
|
-
});
|
|
1546
|
-
} catch (error) {
|
|
1547
|
-
this.queueAnalytics("cli.init.branch_a_cloud_setup_failed", {
|
|
1548
|
-
error: error.message,
|
|
1549
|
-
branch: abcBranch
|
|
1550
|
-
});
|
|
1551
|
-
throw error;
|
|
1552
|
-
}
|
|
1553
|
-
}
|
|
1554
1480
|
if (answers.langGraphPlatform === "No") {
|
|
1555
1481
|
this.log(
|
|
1556
1482
|
"\nCurrently the CLI only supports scaffolding LangGraph Platform agents. Use our quickstart guide to get started:\n"
|
|
@@ -1692,8 +1618,8 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1692
1618
|
}
|
|
1693
1619
|
}
|
|
1694
1620
|
}
|
|
1695
|
-
async
|
|
1696
|
-
this.log(chalk7.cyan("\n\u{
|
|
1621
|
+
async handleEarlyCloudSignup(flags, userAnswers) {
|
|
1622
|
+
this.log(chalk7.cyan("\n\u{1F680} Great choice! Let's get you set up with Copilot Cloud...\n"));
|
|
1697
1623
|
const { cliToken, organization } = await this.authService.requireLogin(this, "cloud-features");
|
|
1698
1624
|
this.trpcClient = createTRPCClient(cliToken);
|
|
1699
1625
|
const availableProjects = await this.trpcClient.listOrgProjects.query({ orgId: organization.id });
|
|
@@ -1725,7 +1651,7 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1725
1651
|
let apiKey;
|
|
1726
1652
|
if (selectedProjectId) {
|
|
1727
1653
|
const spinner = ora5({
|
|
1728
|
-
text: "
|
|
1654
|
+
text: "Setting up error tracking and debugging insights...",
|
|
1729
1655
|
color: "cyan"
|
|
1730
1656
|
}).start();
|
|
1731
1657
|
try {
|
|
@@ -1733,13 +1659,13 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1733
1659
|
projectId: selectedProjectId
|
|
1734
1660
|
});
|
|
1735
1661
|
apiKey = copilotCloudPublicApiKey?.key;
|
|
1736
|
-
spinner.succeed("\u2705
|
|
1662
|
+
spinner.succeed("\u2705 Error tracking and debugging insights enabled");
|
|
1737
1663
|
} catch (error) {
|
|
1738
|
-
spinner.fail("Failed to
|
|
1664
|
+
spinner.fail("Failed to set up error tracking, but continuing with setup");
|
|
1739
1665
|
console.error(error);
|
|
1740
1666
|
}
|
|
1741
1667
|
}
|
|
1742
|
-
this.log(chalk7.green("\u2705
|
|
1668
|
+
this.log(chalk7.green("\u2705 Copilot Cloud setup complete! Error tracking enabled for better debugging.\n"));
|
|
1743
1669
|
return { cliToken, organization, selectedProjectId, apiKey };
|
|
1744
1670
|
}
|
|
1745
1671
|
async completeCloudDeploymentSetup(flags, userAnswers, cloudSetupInfo) {
|
|
@@ -1846,7 +1772,7 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1846
1772
|
process.exit(1);
|
|
1847
1773
|
}
|
|
1848
1774
|
}
|
|
1849
|
-
finalSummary(userAnswers
|
|
1775
|
+
finalSummary(userAnswers) {
|
|
1850
1776
|
let agentDevInstructions = "";
|
|
1851
1777
|
let agentSetupMessage = "";
|
|
1852
1778
|
if (userAnswers.mode === "CrewAI") {
|
|
@@ -1862,7 +1788,7 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1862
1788
|
switch (userAnswers.langGraphAgent) {
|
|
1863
1789
|
case "Python Starter":
|
|
1864
1790
|
agentSetupMessage = `We've scaffolded a ${chalk7.cyan(userAnswers.langGraphAgent || "LangGraph")} agent in the ${chalk7.cyan("./agent")} directory.`;
|
|
1865
|
-
agentDevInstructions = "poetry lock && poetry install &&
|
|
1791
|
+
agentDevInstructions = "poetry lock && poetry install && npx @langchain/langgraph-cli dev --port 8123";
|
|
1866
1792
|
break;
|
|
1867
1793
|
case "TypeScript Starter":
|
|
1868
1794
|
agentSetupMessage = `We've scaffolded a ${chalk7.cyan(userAnswers.langGraphAgent || "LangGraph")} agent in the ${chalk7.cyan("./agent")} directory.`;
|
|
@@ -1889,28 +1815,24 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1889
1815
|
this.log(chalk7.bold(`\u{1F4CB} Recap`));
|
|
1890
1816
|
this.log(` - CopilotKit has been added to your Next.js app.`);
|
|
1891
1817
|
if (agentSetupMessage) this.log(` - ${agentSetupMessage}`);
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1818
|
+
if (userAnswers.signupForCopilotCloud === "Yes") {
|
|
1819
|
+
if (userAnswers.useCopilotCloud === "Yes" || userAnswers.crewType === "Crews") {
|
|
1820
|
+
this.log(` - \u{1F680} Configured for Copilot Cloud deployment with error tracking.`);
|
|
1821
|
+
} else {
|
|
1822
|
+
this.log(` - \u{1F41B} Error tracking enabled for better debugging and insights.`);
|
|
1823
|
+
}
|
|
1824
|
+
} else if (userAnswers.useCopilotCloud === "Yes" || userAnswers.crewType === "Crews") {
|
|
1898
1825
|
this.log(` - \u{1F680} Configured for Copilot Cloud deployment.`);
|
|
1899
|
-
} else if (isSelfHosted) {
|
|
1900
|
-
this.log(` - \u{1F3E0} Configured for self-hosted deployment.`);
|
|
1901
1826
|
}
|
|
1902
1827
|
this.log(chalk7.bold("\n\u{1F680} Next steps:"));
|
|
1903
1828
|
this.log(` - Start your Next.js app: ${chalk7.gray("$")} ${chalk7.cyan("npm run dev")}`);
|
|
1904
|
-
if (agentDevInstructions)
|
|
1829
|
+
if (agentDevInstructions)
|
|
1905
1830
|
this.log(` - Start your agent: ${chalk7.gray("$")} ${chalk7.cyan(`cd agent && ${agentDevInstructions}`)}`);
|
|
1906
|
-
if (isCloudDeployment) {
|
|
1907
|
-
this.log(
|
|
1908
|
-
` - Create local tunnel for your agent: ${chalk7.gray("$")} ${chalk7.cyan(`npx copilotkit@latest dev --port <value>${projectId ? ` --project ${projectId}` : " [--project <value>]"}`)}`
|
|
1909
|
-
);
|
|
1910
|
-
}
|
|
1911
|
-
}
|
|
1912
1831
|
this.log(` - Navigate to ${chalk7.blue("http://localhost:3000/copilotkit")}`);
|
|
1913
1832
|
this.log(` - Talk to your agent.`);
|
|
1833
|
+
if (userAnswers.copilotCloudPublicApiKey) {
|
|
1834
|
+
this.log(` - \u{1F41B} Errors and performance data will be visible in your Copilot Cloud dashboard.`);
|
|
1835
|
+
}
|
|
1914
1836
|
if (userAnswers.setupIDEDocs === "Yes" && userAnswers.selectedIDE !== "skip") {
|
|
1915
1837
|
this.log(` - Your IDE now has CopilotKit documentation context for better AI assistance.`);
|
|
1916
1838
|
}
|