copilotkit 0.0.32 → 0.0.34
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 +7 -6
- package/dist/commands/base-command.js +2 -4
- package/dist/commands/base-command.js.map +1 -1
- package/dist/commands/dev.js +3 -5
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/init.d.ts +12 -10
- package/dist/commands/init.js +122 -73
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/login.js +3 -5
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.js +3 -5
- package/dist/commands/logout.js.map +1 -1
- package/dist/lib/init/index.js +54 -51
- package/dist/lib/init/index.js.map +1 -1
- package/dist/lib/init/questions.js +25 -28
- package/dist/lib/init/questions.js.map +1 -1
- package/dist/lib/init/scaffold/agent.js +15 -5
- package/dist/lib/init/scaffold/agent.js.map +1 -1
- package/dist/lib/init/scaffold/crew-inputs.js.map +1 -1
- package/dist/lib/init/scaffold/env.js +11 -14
- package/dist/lib/init/scaffold/env.js.map +1 -1
- package/dist/lib/init/scaffold/github.js.map +1 -1
- package/dist/lib/init/scaffold/index.js +52 -49
- package/dist/lib/init/scaffold/index.js.map +1 -1
- package/dist/lib/init/scaffold/langgraph-assistants.js +11 -14
- package/dist/lib/init/scaffold/langgraph-assistants.js.map +1 -1
- package/dist/lib/init/scaffold/packages.js.map +1 -1
- package/dist/lib/init/scaffold/shadcn.d.ts +1 -1
- package/dist/lib/init/scaffold/shadcn.js +26 -30
- package/dist/lib/init/scaffold/shadcn.js.map +1 -1
- package/dist/lib/init/types/index.js +23 -26
- package/dist/lib/init/types/index.js.map +1 -1
- package/dist/lib/init/types/questions.d.ts +20 -19
- package/dist/lib/init/types/questions.js +13 -11
- package/dist/lib/init/types/questions.js.map +1 -1
- package/dist/lib/init/types/templates.d.ts +2 -2
- package/dist/lib/init/types/templates.js +10 -15
- package/dist/lib/init/types/templates.js.map +1 -1
- package/dist/lib/init/utils.d.ts +3 -0
- package/dist/lib/init/utils.js +8 -0
- package/dist/lib/init/utils.js.map +1 -0
- package/dist/services/analytics.service.js.map +1 -1
- package/dist/services/auth.service.js +1 -1
- package/dist/services/auth.service.js.map +1 -1
- package/dist/services/tunnel.service.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 +11 -2
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -160,7 +160,7 @@ var AuthService = class {
|
|
|
160
160
|
try {
|
|
161
161
|
me = await trpcClient2.me.query();
|
|
162
162
|
} catch (error) {
|
|
163
|
-
cmd.log(chalk.red("Could not authenticate with Copilot Cloud. Please
|
|
163
|
+
cmd.log(chalk.red("Could not authenticate with Copilot Cloud. Please run: npx copilotkit@latest login"));
|
|
164
164
|
process.exit(1);
|
|
165
165
|
}
|
|
166
166
|
if (!me.organization || !me.user) {
|
|
@@ -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.34";
|
|
226
226
|
|
|
227
227
|
// src/commands/base-command.ts
|
|
228
228
|
import chalk2 from "chalk";
|
|
@@ -234,9 +234,7 @@ var BaseCommand = class extends Command {
|
|
|
234
234
|
}
|
|
235
235
|
Sentry.init({
|
|
236
236
|
dsn: process.env.SENTRY_DSN || "https://1eea15d32e2eacb0456a77db5e39aeeb@o4507288195170304.ingest.us.sentry.io/4508581448581120",
|
|
237
|
-
integrations: [
|
|
238
|
-
consoleIntegration()
|
|
239
|
-
],
|
|
237
|
+
integrations: [consoleIntegration()],
|
|
240
238
|
// Tracing
|
|
241
239
|
tracesSampleRate: 1
|
|
242
240
|
// Capture 100% of the transactions
|
|
@@ -275,7 +273,14 @@ var BaseCommand = class extends Command {
|
|
|
275
273
|
// src/lib/init/types/questions.ts
|
|
276
274
|
import { z } from "zod";
|
|
277
275
|
import { Flags } from "@oclif/core";
|
|
278
|
-
|
|
276
|
+
|
|
277
|
+
// src/lib/init/utils.ts
|
|
278
|
+
var isLocalhost = (url) => {
|
|
279
|
+
return url.includes("localhost") || url.includes("127.0.0.1") || url.includes("0.0.0.0");
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
// src/lib/init/types/questions.ts
|
|
283
|
+
var MODES = ["LangGraph", "CrewAI", "Mastra", "AG2", "MCP", "Standard"];
|
|
279
284
|
var CREW_TYPES = ["Crews", "Flows"];
|
|
280
285
|
var CHAT_COMPONENTS = ["CopilotChat", "CopilotSidebar", "Headless", "CopilotPopup"];
|
|
281
286
|
var LANGGRAPH_AGENTS = ["Python Starter", "TypeScript Starter"];
|
|
@@ -313,18 +318,12 @@ var UrlSchema = z.preprocess(
|
|
|
313
318
|
(val) => sanitizers.url(String(val)),
|
|
314
319
|
z.string().url("Please enter a valid URL").min(1, "URL is required")
|
|
315
320
|
);
|
|
316
|
-
var TokenSchema = z.preprocess(
|
|
317
|
-
(val) => sanitizers.trim(String(val)),
|
|
318
|
-
z.string().min(1, "Token is required")
|
|
319
|
-
);
|
|
321
|
+
var TokenSchema = z.preprocess((val) => sanitizers.trim(String(val)), z.string().min(1, "Token is required"));
|
|
320
322
|
var ApiKeySchema = z.preprocess(
|
|
321
323
|
(val) => sanitizers.apiKey(String(val)),
|
|
322
324
|
z.string().min(1, "API key is required")
|
|
323
325
|
);
|
|
324
|
-
var NameSchema = z.preprocess(
|
|
325
|
-
(val) => sanitizers.trim(String(val)),
|
|
326
|
-
z.string().min(1, "Name is required")
|
|
327
|
-
);
|
|
326
|
+
var NameSchema = z.preprocess((val) => sanitizers.trim(String(val)), z.string().min(1, "Name is required"));
|
|
328
327
|
var ConfigSchema = z.object({
|
|
329
328
|
// Core fields
|
|
330
329
|
copilotKitVersion: z.string().optional(),
|
|
@@ -334,7 +333,7 @@ var ConfigSchema = z.object({
|
|
|
334
333
|
alreadyDeployed: YesNoSchema.optional(),
|
|
335
334
|
fastApiEnabled: YesNoSchema.optional(),
|
|
336
335
|
useCopilotCloud: YesNoSchema.optional(),
|
|
337
|
-
// LangGraph specific fields
|
|
336
|
+
// LangGraph specific fields
|
|
338
337
|
langGraphAgent: LangGraphAgentSchema.optional(),
|
|
339
338
|
langGraphPlatform: YesNoSchema.optional(),
|
|
340
339
|
langGraphPlatformUrl: UrlSchema.optional(),
|
|
@@ -363,7 +362,7 @@ var ConfigSchema = z.object({
|
|
|
363
362
|
).refine(
|
|
364
363
|
(data) => {
|
|
365
364
|
if (data.mode === "LangGraph" && data.alreadyDeployed === "Yes" && data.langGraphPlatform === "Yes") {
|
|
366
|
-
return !!data.langGraphPlatformUrl && !!data.langSmithApiKey;
|
|
365
|
+
return !!data.langGraphPlatformUrl && !!data.langSmithApiKey || isLocalhost(data.langGraphPlatformUrl || "");
|
|
367
366
|
}
|
|
368
367
|
return true;
|
|
369
368
|
},
|
|
@@ -373,6 +372,7 @@ var ConfigSchema = z.object({
|
|
|
373
372
|
}
|
|
374
373
|
);
|
|
375
374
|
var ConfigFlags = {
|
|
375
|
+
booth: Flags.boolean({ description: "Use CopilotKit in booth mode", default: false, char: "b" }),
|
|
376
376
|
mode: Flags.string({ description: "How you will be interacting with AI", options: MODES, char: "m" }),
|
|
377
377
|
"copilotkit-version": Flags.string({ description: "CopilotKit version to use (e.g. 1.7.0)" }),
|
|
378
378
|
"use-copilot-cloud": Flags.string({ description: "Use Copilot Cloud for production-ready hosting", options: YES_NO }),
|
|
@@ -390,29 +390,24 @@ var ConfigFlags = {
|
|
|
390
390
|
var BASE_URL = "https://registry.copilotkit.ai/r";
|
|
391
391
|
var templateMapping = {
|
|
392
392
|
// Runtimes
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
RemoteEndpoint: `${BASE_URL}/remote-endpoint-starter.json`,
|
|
394
|
+
LangGraphPlatformRuntime: `${BASE_URL}/langgraph-platform-starter.json`,
|
|
395
395
|
// CrewAI
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
],
|
|
399
|
-
"CrewFlowsStarter": [
|
|
396
|
+
CrewEnterprise: [`${BASE_URL}/coagents-crew-starter.json`],
|
|
397
|
+
CrewFlowsStarter: [
|
|
400
398
|
`${BASE_URL}/coagents-starter-ui.json`,
|
|
401
399
|
`${BASE_URL}/agent-layout.json`,
|
|
402
400
|
`${BASE_URL}/remote-endpoint.json`
|
|
403
401
|
],
|
|
404
402
|
// LangGraph
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
`${BASE_URL}/langgraph-platform-starter.json`,
|
|
408
|
-
`${BASE_URL}/coagents-starter-ui.json`
|
|
409
|
-
],
|
|
403
|
+
LangGraphGeneric: `${BASE_URL}/generic-lg-starter.json`,
|
|
404
|
+
LangGraphStarter: [`${BASE_URL}/langgraph-platform-starter.json`, `${BASE_URL}/coagents-starter-ui.json`],
|
|
410
405
|
// No Agent
|
|
411
|
-
|
|
412
|
-
|
|
406
|
+
StandardStarter: `${BASE_URL}/standard-starter.json`,
|
|
407
|
+
StandardRuntime: `${BASE_URL}/standard-runtime.json`,
|
|
413
408
|
// MCP
|
|
414
|
-
|
|
415
|
-
|
|
409
|
+
McpStarter: `${BASE_URL}/mcp-starter.json`,
|
|
410
|
+
McpRuntime: `${BASE_URL}/mcp-starter-runtime.json`
|
|
416
411
|
};
|
|
417
412
|
|
|
418
413
|
// src/lib/init/questions.ts
|
|
@@ -544,7 +539,7 @@ var questions = [
|
|
|
544
539
|
type: "input",
|
|
545
540
|
name: "langSmithApiKey",
|
|
546
541
|
message: "\u{1F99C}\u{1F517} Enter your LangSmith API key (required by LangGraph Platform) :",
|
|
547
|
-
when: (answers) => answers.mode === "LangGraph" && answers.langGraphPlatform === "Yes",
|
|
542
|
+
when: (answers) => answers.mode === "LangGraph" && answers.langGraphPlatform === "Yes" && !(answers.langGraphPlatformUrl && isLocalhost(answers.langGraphPlatformUrl)),
|
|
548
543
|
sensitive: true,
|
|
549
544
|
validate: validateRequired,
|
|
550
545
|
sanitize: sanitizers.apiKey
|
|
@@ -555,7 +550,7 @@ var questions = [
|
|
|
555
550
|
name: "useCopilotCloud",
|
|
556
551
|
message: "\u{1FA81} Deploy with Copilot Cloud? (recommended for production)",
|
|
557
552
|
when: (answers) => answers.mode === "Standard" || answers.mode === "MCP" || answers.mode !== "CrewAI" && // Crews only cloud, flows are self-hosted
|
|
558
|
-
answers.alreadyDeployed === "Yes" && answers.langGraphPlatform !== "No",
|
|
553
|
+
answers.alreadyDeployed === "Yes" && answers.langGraphPlatform !== "No" && answers.mode !== "Mastra" && answers.mode !== "AG2" && !isLocalhost(answers.langGraphPlatformUrl || ""),
|
|
559
554
|
validate: (input) => {
|
|
560
555
|
try {
|
|
561
556
|
YesNoSchema.parse(input);
|
|
@@ -578,12 +573,12 @@ var questions = [
|
|
|
578
573
|
|
|
579
574
|
// src/lib/init/scaffold/shadcn.ts
|
|
580
575
|
import spawn from "cross-spawn";
|
|
581
|
-
async function scaffoldShadCN(userAnswers) {
|
|
576
|
+
async function scaffoldShadCN(flags, userAnswers) {
|
|
582
577
|
try {
|
|
583
578
|
const components = [];
|
|
584
579
|
switch (userAnswers.mode) {
|
|
585
580
|
case "LangGraph":
|
|
586
|
-
if (userAnswers.langGraphAgent) {
|
|
581
|
+
if (userAnswers.langGraphAgent || flags.booth) {
|
|
587
582
|
components.push(...templateMapping.LangGraphStarter);
|
|
588
583
|
} else {
|
|
589
584
|
components.push(templateMapping.LangGraphGeneric);
|
|
@@ -618,8 +613,7 @@ async function scaffoldShadCN(userAnswers) {
|
|
|
618
613
|
}
|
|
619
614
|
break;
|
|
620
615
|
default:
|
|
621
|
-
|
|
622
|
-
break;
|
|
616
|
+
return;
|
|
623
617
|
}
|
|
624
618
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
625
619
|
try {
|
|
@@ -645,20 +639,17 @@ import fs from "fs";
|
|
|
645
639
|
// src/lib/init/scaffold/langgraph-assistants.ts
|
|
646
640
|
async function getLangGraphAgents(url, langSmithApiKey) {
|
|
647
641
|
try {
|
|
648
|
-
const response = await fetch(
|
|
649
|
-
|
|
650
|
-
{
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
})
|
|
660
|
-
}
|
|
661
|
-
);
|
|
642
|
+
const response = await fetch(`${url.trim().replace(/\/$/, "")}/assistants/search`, {
|
|
643
|
+
method: "POST",
|
|
644
|
+
headers: {
|
|
645
|
+
"Content-Type": "application/json",
|
|
646
|
+
"X-Api-Key": langSmithApiKey
|
|
647
|
+
},
|
|
648
|
+
body: JSON.stringify({
|
|
649
|
+
limit: 10,
|
|
650
|
+
offset: 0
|
|
651
|
+
})
|
|
652
|
+
});
|
|
662
653
|
return await response.json();
|
|
663
654
|
} catch (error) {
|
|
664
655
|
throw new Error(`Failed to get LangGraph agents: ${error}`);
|
|
@@ -866,11 +857,7 @@ async function scaffoldAgent(userAnswers) {
|
|
|
866
857
|
}
|
|
867
858
|
const agentDir = path3.join(process.cwd(), "agent");
|
|
868
859
|
try {
|
|
869
|
-
await cloneGitHubSubdirectory(
|
|
870
|
-
template,
|
|
871
|
-
agentDir,
|
|
872
|
-
spinner
|
|
873
|
-
);
|
|
860
|
+
await cloneGitHubSubdirectory(template, agentDir, spinner);
|
|
874
861
|
spinner.text = chalk5.cyan("Creating agent environment variables...");
|
|
875
862
|
let envContent = "";
|
|
876
863
|
if (userAnswers.llmToken) {
|
|
@@ -886,6 +873,20 @@ async function scaffoldAgent(userAnswers) {
|
|
|
886
873
|
fs3.writeFileSync(agentEnvFile, envContent, "utf8");
|
|
887
874
|
spinner.text = chalk5.cyan("Added API keys to agent .env file");
|
|
888
875
|
}
|
|
876
|
+
if (userAnswers.mode === "LangGraph" && userAnswers.langSmithApiKey) {
|
|
877
|
+
envContent += `LANGSMITH_API_KEY=${userAnswers.langSmithApiKey}
|
|
878
|
+
`;
|
|
879
|
+
}
|
|
880
|
+
if (envContent) {
|
|
881
|
+
const agentEnvFile = path3.join(agentDir, ".env");
|
|
882
|
+
fs3.writeFileSync(agentEnvFile, envContent, "utf8");
|
|
883
|
+
spinner.text = chalk5.cyan("Added API keys to agent .env file");
|
|
884
|
+
}
|
|
885
|
+
if (envContent) {
|
|
886
|
+
const agentEnvFile = path3.join(agentDir, ".env");
|
|
887
|
+
fs3.writeFileSync(agentEnvFile, envContent, "utf8");
|
|
888
|
+
spinner.text = chalk5.cyan("Added API keys to agent .env file");
|
|
889
|
+
}
|
|
889
890
|
} catch (error) {
|
|
890
891
|
spinner.fail(chalk5.red("Failed to clone agent template"));
|
|
891
892
|
throw error;
|
|
@@ -959,9 +960,7 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
959
960
|
}
|
|
960
961
|
trpcClient = null;
|
|
961
962
|
static description = "Set up CopilotKit in your Next.js project";
|
|
962
|
-
static examples = [
|
|
963
|
-
"<%= config.bin %> init"
|
|
964
|
-
];
|
|
963
|
+
static examples = ["<%= config.bin %> init"];
|
|
965
964
|
static flags = {
|
|
966
965
|
...BaseCommand.flags,
|
|
967
966
|
...ConfigFlags,
|
|
@@ -973,21 +972,68 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
973
972
|
const { flags } = await this.parse(_CloudInit);
|
|
974
973
|
try {
|
|
975
974
|
this.log(chalk6.magenta("\n\u{1FA81} Welcome to CopilotKit"));
|
|
976
|
-
|
|
975
|
+
if (flags.booth) {
|
|
976
|
+
this.log(chalk6.gray("Thanks for giving CopilotKit a try! Now, let's try to impress you \u{1F4AA}\n"));
|
|
977
|
+
} else {
|
|
978
|
+
this.log(chalk6.gray("Let's power up your Next.js project with AI capabilities\n"));
|
|
979
|
+
}
|
|
977
980
|
this.validateProjectCompatibility(flags);
|
|
978
|
-
|
|
981
|
+
let userAnswers;
|
|
982
|
+
if (flags.booth) {
|
|
983
|
+
userAnswers = await this.getBoothAnswers();
|
|
984
|
+
} else {
|
|
985
|
+
userAnswers = await this.getUserAnswers(flags);
|
|
986
|
+
}
|
|
987
|
+
if (userAnswers.mode === "Mastra") {
|
|
988
|
+
this.log(chalk6.magenta(`
|
|
989
|
+
\u{1F517} Please go to https://docs.copilotkit.ai/mastra/quickstart/mastra to get started.`));
|
|
990
|
+
process.exit(0);
|
|
991
|
+
} else if (userAnswers.mode === "AG2") {
|
|
992
|
+
this.log(chalk6.magenta(`
|
|
993
|
+
\u{1F517} Please go to https://docs.copilotkit.ai/ag2/quickstart/ag2 to get started.`));
|
|
994
|
+
process.exit(0);
|
|
995
|
+
}
|
|
979
996
|
const needsCloudSetup = userAnswers.useCopilotCloud === "Yes" || userAnswers.mode === "CrewAI" && userAnswers.crewType === "Crews";
|
|
980
997
|
if (needsCloudSetup) await this.setupCloud(flags, userAnswers);
|
|
981
998
|
await scaffoldEnv(flags, userAnswers);
|
|
982
|
-
await scaffoldShadCN(userAnswers);
|
|
983
|
-
await scaffoldAgent(userAnswers);
|
|
999
|
+
await scaffoldShadCN(flags, userAnswers);
|
|
1000
|
+
if (!flags.booth) await scaffoldAgent(userAnswers);
|
|
984
1001
|
if (userAnswers.crewType === "Crews" && userAnswers.crewUrl && userAnswers.crewBearerToken)
|
|
985
1002
|
await addCrewInputs(userAnswers.crewUrl, userAnswers.crewBearerToken);
|
|
986
|
-
|
|
1003
|
+
if (flags.booth) {
|
|
1004
|
+
this.log("\n-----\n");
|
|
1005
|
+
this.log(chalk6.magenta("\u{1F389} Your CopilotKit setup is complete! \u{1F389}\n"));
|
|
1006
|
+
this.log(chalk6.bold("\n\u{1F680} Next steps:"));
|
|
1007
|
+
this.log(` - Start the Next.js app: ${chalk6.gray("$")} ${chalk6.cyan("npm run dev")}`);
|
|
1008
|
+
this.log(` - Navigate to ${chalk6.blue("http://localhost:3000/copilotkit")}`);
|
|
1009
|
+
this.log(` - Talk to your agent.`);
|
|
1010
|
+
this.log(chalk6.magenta("\nThanks for giving CopilotKit a try! \u{1FA81}\n"));
|
|
1011
|
+
} else {
|
|
1012
|
+
this.finalSummary(userAnswers);
|
|
1013
|
+
}
|
|
987
1014
|
} catch (error) {
|
|
988
1015
|
this.gracefulError(error.message);
|
|
989
1016
|
}
|
|
990
1017
|
}
|
|
1018
|
+
async getBoothAnswers() {
|
|
1019
|
+
const url = await inquirer3.prompt({
|
|
1020
|
+
type: "input",
|
|
1021
|
+
message: "\u{1F99C}\u{1F517} What is the LangGraph's agent URL?",
|
|
1022
|
+
name: "agentURL",
|
|
1023
|
+
validate: (value) => {
|
|
1024
|
+
if (!value) return "You need a URL to continue, it should be present on the screen. If you need help, feel free to ask!";
|
|
1025
|
+
if (!value.includes("http") || !value.includes("://")) return "Please provide a valid URL";
|
|
1026
|
+
return true;
|
|
1027
|
+
}
|
|
1028
|
+
});
|
|
1029
|
+
return {
|
|
1030
|
+
mode: "LangGraph",
|
|
1031
|
+
langGraphPlatformUrl: url.agentURL,
|
|
1032
|
+
useCopilotCloud: "No",
|
|
1033
|
+
alreadyDeployed: "Yes",
|
|
1034
|
+
langGraphPlatform: "Yes"
|
|
1035
|
+
};
|
|
1036
|
+
}
|
|
991
1037
|
async getUserAnswers(flags) {
|
|
992
1038
|
const initialAnswers = {};
|
|
993
1039
|
Object.keys(flags).forEach((flagName) => {
|
|
@@ -1048,7 +1094,9 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1048
1094
|
const promptAnswers = await inquirer3.prompt(inquirerQuestions);
|
|
1049
1095
|
const answers = { ...initialAnswers, ...promptAnswers };
|
|
1050
1096
|
if (answers.langGraphPlatform === "No") {
|
|
1051
|
-
this.log(
|
|
1097
|
+
this.log(
|
|
1098
|
+
"\nCurrently the CLI only supports scaffolding LangGraph Platform agents. Use our quickstart guide to get started:\n"
|
|
1099
|
+
);
|
|
1052
1100
|
this.log(chalk6.blue("https://docs.copilotkit.ai/coagents/quickstart/langgraph"));
|
|
1053
1101
|
process.exit(0);
|
|
1054
1102
|
}
|
|
@@ -1060,9 +1108,7 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1060
1108
|
} catch (error) {
|
|
1061
1109
|
const spinner = ora5({ text: "Validation failed...", color: "red" }).start();
|
|
1062
1110
|
if (error.errors) {
|
|
1063
|
-
const formattedErrors = error.errors.map(
|
|
1064
|
-
(err) => `- ${err.path.join(".")}: ${err.message}`
|
|
1065
|
-
).join("\n");
|
|
1111
|
+
const formattedErrors = error.errors.map((err) => `- ${err.path.join(".")}: ${err.message}`).join("\n");
|
|
1066
1112
|
spinner.fail(chalk6.red("Configuration validation failed:"));
|
|
1067
1113
|
console.error(chalk6.red(formattedErrors));
|
|
1068
1114
|
process.exit(1);
|
|
@@ -1098,7 +1144,9 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1098
1144
|
]);
|
|
1099
1145
|
selectedProjectId = projectId;
|
|
1100
1146
|
}
|
|
1101
|
-
const copilotCloudPublicApiKey = await this.trpcClient.getCopilotCloudPublicApiKey.query({
|
|
1147
|
+
const copilotCloudPublicApiKey = await this.trpcClient.getCopilotCloudPublicApiKey.query({
|
|
1148
|
+
projectId: selectedProjectId
|
|
1149
|
+
});
|
|
1102
1150
|
try {
|
|
1103
1151
|
const sanitizedConfig = {
|
|
1104
1152
|
...userAnswers,
|
|
@@ -1201,7 +1249,9 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1201
1249
|
const packageJson = JSON.parse(fs5.readFileSync(packageJsonPath, "utf8"));
|
|
1202
1250
|
if (!packageJson.dependencies?.next && !packageJson.devDependencies?.next) {
|
|
1203
1251
|
spinner.fail(`Not a Next.js project`);
|
|
1204
|
-
throw new Error(
|
|
1252
|
+
throw new Error(
|
|
1253
|
+
`Directory ${projectPath} does not appear to be a Next.js project. Make sure it has next in dependencies.`
|
|
1254
|
+
);
|
|
1205
1255
|
}
|
|
1206
1256
|
spinner.succeed(`\u{1F53C} Valid Next.js project detected at ${projectPath}`);
|
|
1207
1257
|
return true;
|
|
@@ -1216,10 +1266,8 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1216
1266
|
}
|
|
1217
1267
|
finalSummary(userAnswers) {
|
|
1218
1268
|
let agentDevInstructions = "";
|
|
1219
|
-
let agentType = "";
|
|
1220
1269
|
let agentSetupMessage = "";
|
|
1221
1270
|
if (userAnswers.mode === "CrewAI") {
|
|
1222
|
-
agentType = "CrewAI";
|
|
1223
1271
|
if (userAnswers.crewType === "Crews") {
|
|
1224
1272
|
agentSetupMessage = `Using your Crew from ${chalk6.cyan(userAnswers.crewUrl || "the provided URL")}.`;
|
|
1225
1273
|
} else if (userAnswers.crewType === "Flows") {
|
|
@@ -1261,7 +1309,8 @@ var CloudInit = class _CloudInit extends BaseCommand {
|
|
|
1261
1309
|
if (userAnswers.useCopilotCloud || userAnswers.crewType === "Crews") this.log(` - With Copilot Cloud.`);
|
|
1262
1310
|
this.log(chalk6.bold("\n\u{1F680} Next steps:"));
|
|
1263
1311
|
this.log(` - Start your Next.js app: ${chalk6.gray("$")} ${chalk6.cyan("npm run dev")}`);
|
|
1264
|
-
if (agentDevInstructions)
|
|
1312
|
+
if (agentDevInstructions)
|
|
1313
|
+
this.log(` - Start your agent: ${chalk6.gray("$")} ${chalk6.cyan(`cd agent && ${agentDevInstructions}`)}`);
|
|
1265
1314
|
this.log(` - Navigate to ${chalk6.blue("http://localhost:3000/copilotkit")}`);
|
|
1266
1315
|
this.log(` - Talk to your agent.`);
|
|
1267
1316
|
this.log(` - Read the docs: ${chalk6.blue("https://docs.copilotkit.ai")}`);
|