copilotkit 0.0.31 → 0.0.33
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 +8 -7
- package/dist/commands/base-command.js +2 -4
- package/dist/commands/base-command.js.map +1 -1
- package/dist/commands/dev.js +2 -4
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/init.d.ts +13 -14
- package/dist/commands/init.js +155 -135
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/login.js +2 -4
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.js +2 -4
- package/dist/commands/logout.js.map +1 -1
- package/dist/lib/init/index.d.ts +1 -1
- package/dist/lib/init/index.js +92 -112
- package/dist/lib/init/index.js.map +1 -1
- package/dist/lib/init/questions.js +56 -83
- package/dist/lib/init/questions.js.map +1 -1
- package/dist/lib/init/scaffold/agent.js +19 -9
- 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 +72 -71
- 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 +42 -48
- 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 +40 -46
- package/dist/lib/init/types/index.js.map +1 -1
- package/dist/lib/init/types/questions.d.ts +22 -24
- package/dist/lib/init/types/questions.js +30 -31
- 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.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 +33 -56
- package/package.json +1 -1
|
@@ -4,7 +4,14 @@ import spawn from "cross-spawn";
|
|
|
4
4
|
// src/lib/init/types/questions.ts
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { Flags } from "@oclif/core";
|
|
7
|
-
|
|
7
|
+
|
|
8
|
+
// src/lib/init/utils.ts
|
|
9
|
+
var isLocalhost = (url) => {
|
|
10
|
+
return url.includes("localhost") || url.includes("127.0.0.1") || url.includes("0.0.0.0");
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// src/lib/init/types/questions.ts
|
|
14
|
+
var MODES = ["CrewAI", "LangGraph", "MCP", "Standard"];
|
|
8
15
|
var CREW_TYPES = ["Crews", "Flows"];
|
|
9
16
|
var CHAT_COMPONENTS = ["CopilotChat", "CopilotSidebar", "Headless", "CopilotPopup"];
|
|
10
17
|
var LANGGRAPH_AGENTS = ["Python Starter", "TypeScript Starter"];
|
|
@@ -32,7 +39,7 @@ var sanitizers = {
|
|
|
32
39
|
return value.trim().replace(/\s/g, "");
|
|
33
40
|
}
|
|
34
41
|
};
|
|
35
|
-
var
|
|
42
|
+
var ModeSchema = z.enum(MODES);
|
|
36
43
|
var CrewTypeSchema = z.enum(CREW_TYPES);
|
|
37
44
|
var ChatComponentSchema = z.enum(CHAT_COMPONENTS);
|
|
38
45
|
var LangGraphAgentSchema = z.enum(LANGGRAPH_AGENTS);
|
|
@@ -42,28 +49,22 @@ var UrlSchema = z.preprocess(
|
|
|
42
49
|
(val) => sanitizers.url(String(val)),
|
|
43
50
|
z.string().url("Please enter a valid URL").min(1, "URL is required")
|
|
44
51
|
);
|
|
45
|
-
var TokenSchema = z.preprocess(
|
|
46
|
-
(val) => sanitizers.trim(String(val)),
|
|
47
|
-
z.string().min(1, "Token is required")
|
|
48
|
-
);
|
|
52
|
+
var TokenSchema = z.preprocess((val) => sanitizers.trim(String(val)), z.string().min(1, "Token is required"));
|
|
49
53
|
var ApiKeySchema = z.preprocess(
|
|
50
54
|
(val) => sanitizers.apiKey(String(val)),
|
|
51
55
|
z.string().min(1, "API key is required")
|
|
52
56
|
);
|
|
53
|
-
var NameSchema = z.preprocess(
|
|
54
|
-
(val) => sanitizers.trim(String(val)),
|
|
55
|
-
z.string().min(1, "Name is required")
|
|
56
|
-
);
|
|
57
|
+
var NameSchema = z.preprocess((val) => sanitizers.trim(String(val)), z.string().min(1, "Name is required"));
|
|
57
58
|
var ConfigSchema = z.object({
|
|
58
59
|
// Core fields
|
|
59
60
|
copilotKitVersion: z.string().optional(),
|
|
60
|
-
|
|
61
|
+
mode: ModeSchema,
|
|
61
62
|
chatUi: ChatComponentSchema.optional(),
|
|
62
63
|
// Yes/No fields
|
|
63
64
|
alreadyDeployed: YesNoSchema.optional(),
|
|
64
65
|
fastApiEnabled: YesNoSchema.optional(),
|
|
65
66
|
useCopilotCloud: YesNoSchema.optional(),
|
|
66
|
-
// LangGraph specific fields
|
|
67
|
+
// LangGraph specific fields
|
|
67
68
|
langGraphAgent: LangGraphAgentSchema.optional(),
|
|
68
69
|
langGraphPlatform: YesNoSchema.optional(),
|
|
69
70
|
langGraphPlatformUrl: UrlSchema.optional(),
|
|
@@ -80,7 +81,7 @@ var ConfigSchema = z.object({
|
|
|
80
81
|
llmToken: ApiKeySchema.optional()
|
|
81
82
|
}).refine(
|
|
82
83
|
(data) => {
|
|
83
|
-
if (data.
|
|
84
|
+
if (data.mode === "CrewAI" && data.crewType === "Crews") {
|
|
84
85
|
return !!data.crewUrl && !!data.crewBearerToken;
|
|
85
86
|
}
|
|
86
87
|
return true;
|
|
@@ -91,8 +92,8 @@ var ConfigSchema = z.object({
|
|
|
91
92
|
}
|
|
92
93
|
).refine(
|
|
93
94
|
(data) => {
|
|
94
|
-
if (data.
|
|
95
|
-
return !!data.langGraphPlatformUrl && !!data.langSmithApiKey;
|
|
95
|
+
if (data.mode === "LangGraph" && data.alreadyDeployed === "Yes" && data.langGraphPlatform === "Yes") {
|
|
96
|
+
return !!data.langGraphPlatformUrl && !!data.langSmithApiKey || isLocalhost(data.langGraphPlatformUrl || "");
|
|
96
97
|
}
|
|
97
98
|
return true;
|
|
98
99
|
},
|
|
@@ -102,58 +103,51 @@ var ConfigSchema = z.object({
|
|
|
102
103
|
}
|
|
103
104
|
);
|
|
104
105
|
var ConfigFlags = {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
llmToken: Flags.string({ description: "API key for your preferred LLM provider" }),
|
|
118
|
-
crewFlowAgent: Flags.string({ description: "CrewAI Flow template to use", options: CREW_FLOW_TEMPLATES })
|
|
106
|
+
booth: Flags.boolean({ description: "Use CopilotKit in booth mode", default: false, char: "b" }),
|
|
107
|
+
mode: Flags.string({ description: "How you will be interacting with AI", options: MODES, char: "m" }),
|
|
108
|
+
"copilotkit-version": Flags.string({ description: "CopilotKit version to use (e.g. 1.7.0)" }),
|
|
109
|
+
"use-copilot-cloud": Flags.string({ description: "Use Copilot Cloud for production-ready hosting", options: YES_NO }),
|
|
110
|
+
"langgraph-agent": Flags.string({ description: "LangGraph agent template to use", options: LANGGRAPH_AGENTS }),
|
|
111
|
+
"crew-type": Flags.string({ description: "CrewAI implementation type", options: CREW_TYPES }),
|
|
112
|
+
"crew-name": Flags.string({ description: "Name for your CrewAI agent" }),
|
|
113
|
+
"crew-url": Flags.string({ description: "URL endpoint for your CrewAI agent" }),
|
|
114
|
+
"crew-bearer-token": Flags.string({ description: "Bearer token for CrewAI authentication" }),
|
|
115
|
+
"langsmith-api-key": Flags.string({ description: "LangSmith API key for LangGraph observability" }),
|
|
116
|
+
"llm-token": Flags.string({ description: "API key for your preferred LLM provider" }),
|
|
117
|
+
"crew-flow-agent": Flags.string({ description: "CrewAI Flow template to use", options: CREW_FLOW_TEMPLATES })
|
|
119
118
|
};
|
|
120
119
|
|
|
121
120
|
// src/lib/init/types/templates.ts
|
|
122
121
|
var BASE_URL = "https://registry.copilotkit.ai/r";
|
|
123
122
|
var templateMapping = {
|
|
124
123
|
// Runtimes
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
RemoteEndpoint: `${BASE_URL}/remote-endpoint-starter.json`,
|
|
125
|
+
LangGraphPlatformRuntime: `${BASE_URL}/langgraph-platform-starter.json`,
|
|
127
126
|
// CrewAI
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
],
|
|
131
|
-
"CrewFlowsStarter": [
|
|
127
|
+
CrewEnterprise: [`${BASE_URL}/coagents-crew-starter.json`],
|
|
128
|
+
CrewFlowsStarter: [
|
|
132
129
|
`${BASE_URL}/coagents-starter-ui.json`,
|
|
133
130
|
`${BASE_URL}/agent-layout.json`,
|
|
134
131
|
`${BASE_URL}/remote-endpoint.json`
|
|
135
132
|
],
|
|
136
133
|
// LangGraph
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
`${BASE_URL}/langgraph-platform-starter.json`,
|
|
140
|
-
`${BASE_URL}/coagents-starter-ui.json`
|
|
141
|
-
],
|
|
134
|
+
LangGraphGeneric: `${BASE_URL}/generic-lg-starter.json`,
|
|
135
|
+
LangGraphStarter: [`${BASE_URL}/langgraph-platform-starter.json`, `${BASE_URL}/coagents-starter-ui.json`],
|
|
142
136
|
// No Agent
|
|
143
|
-
|
|
144
|
-
|
|
137
|
+
StandardStarter: `${BASE_URL}/standard-starter.json`,
|
|
138
|
+
StandardRuntime: `${BASE_URL}/standard-runtime.json`,
|
|
145
139
|
// MCP
|
|
146
|
-
|
|
147
|
-
|
|
140
|
+
McpStarter: `${BASE_URL}/mcp-starter.json`,
|
|
141
|
+
McpRuntime: `${BASE_URL}/mcp-starter-runtime.json`
|
|
148
142
|
};
|
|
149
143
|
|
|
150
144
|
// src/lib/init/scaffold/shadcn.ts
|
|
151
|
-
async function scaffoldShadCN(userAnswers) {
|
|
145
|
+
async function scaffoldShadCN(flags, userAnswers) {
|
|
152
146
|
try {
|
|
153
147
|
const components = [];
|
|
154
|
-
switch (userAnswers.
|
|
148
|
+
switch (userAnswers.mode) {
|
|
155
149
|
case "LangGraph":
|
|
156
|
-
if (userAnswers.langGraphAgent) {
|
|
150
|
+
if (userAnswers.langGraphAgent || flags.booth) {
|
|
157
151
|
components.push(...templateMapping.LangGraphStarter);
|
|
158
152
|
} else {
|
|
159
153
|
components.push(templateMapping.LangGraphGeneric);
|
|
@@ -181,7 +175,7 @@ async function scaffoldShadCN(userAnswers) {
|
|
|
181
175
|
components.push(templateMapping.McpRuntime);
|
|
182
176
|
}
|
|
183
177
|
break;
|
|
184
|
-
case "
|
|
178
|
+
case "Standard":
|
|
185
179
|
components.push(templateMapping.StandardStarter);
|
|
186
180
|
if (userAnswers.useCopilotCloud !== "Yes") {
|
|
187
181
|
components.push(templateMapping.StandardRuntime);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/init/scaffold/shadcn.ts","../../../../src/lib/init/types/questions.ts","../../../../src/lib/init/types/templates.ts"],"sourcesContent":["import spawn from \"cross-spawn\"\nimport { \n templateMapping, \n Config \n} from \"../types/index.js\"\n\nexport async function scaffoldShadCN(userAnswers: Config) {\n try {\n // Determine which components to install based on user choices\n const components: string[] = []\n \n // Add additional components based on agent framework\n switch (userAnswers.agentFramework) {\n case 'LangGraph':\n if (userAnswers.langGraphAgent) {\n components.push(...templateMapping.LangGraphStarter)\n } else {\n components.push(templateMapping.LangGraphGeneric)\n if (userAnswers.useCopilotCloud !== 'Yes') {\n if (userAnswers.langGraphPlatform === 'Yes') {\n components.push(templateMapping.LangGraphPlatformRuntime)\n } else {\n components.push(templateMapping.RemoteEndpoint)\n }\n }\n }\n break\n case 'CrewAI':\n if (userAnswers.crewType === 'Crews') {\n components.push(...templateMapping.CrewEnterprise)\n } else if (userAnswers.crewFlowAgent) {\n components.push(...templateMapping.CrewFlowsStarter)\n } else {\n components.push(templateMapping.RemoteEndpoint)\n }\n break\n case 'MCP':\n components.push(templateMapping.McpStarter)\n if (userAnswers.useCopilotCloud !== 'Yes') {\n components.push(templateMapping.McpRuntime)\n }\n break\n case 'None':\n components.push(templateMapping.StandardStarter)\n if (userAnswers.useCopilotCloud !== 'Yes') {\n components.push(templateMapping.StandardRuntime)\n }\n break\n default:\n components.push(templateMapping.RemoteEndpoint)\n break\n }\n \n // Small pause before running shadcn\n await new Promise(resolve => setTimeout(resolve, 100));\n \n try {\n // Run shadcn with inherited stdio for all streams to allow for user input\n const result = spawn.sync('npx', ['shadcn@latest', 'add', ...components], { \n stdio: 'inherit' // This ensures stdin/stdout/stderr are all passed through\n });\n \n if (result.status !== 0) {\n throw new Error(`The shadcn installation process exited with code ${result.status}`);\n }\n } catch (error) {\n throw error;\n }\n } catch (error) {\n throw error;\n }\n}","import { z } from 'zod';\nimport { Flags } from \"@oclif/core\"\n\n// ===== Core Constants =====\nexport const AGENT_FRAMEWORKS = ['CrewAI', 'LangGraph', \"MCP\", 'None'] as const;\nexport const CREW_TYPES = ['Crews', 'Flows'] as const;\nexport const CHAT_COMPONENTS = ['CopilotChat','CopilotSidebar', 'Headless', 'CopilotPopup'] as const;\nexport const LANGGRAPH_AGENTS = ['Python Starter', 'TypeScript Starter'] as const;\nexport const CREW_FLOW_TEMPLATES = ['Starter'] as const;\nexport const YES_NO = ['Yes', 'No'] as const;\n\n// ===== Sanitizers =====\nexport const sanitizers = {\n // Remove trailing slash from URLs\n url: (value: string): string => {\n if (!value) return value;\n return value.trim().replace(/\\/+$/, '');\n },\n \n // Trim whitespace from strings\n trim: (value: string): string => {\n if (!value) return value;\n return value.trim();\n },\n \n // Lowercase strings\n lowercase: (value: string): string => {\n if (!value) return value;\n return value.toLowerCase().trim();\n },\n \n // Clean API keys (remove whitespace)\n apiKey: (value: string): string => {\n if (!value) return value;\n return value.trim().replace(/\\s/g, '');\n }\n};\n\n// ===== Zod Schemas =====\n\n// Basic schemas\nexport const AgentFrameworkSchema = z.enum(AGENT_FRAMEWORKS);\nexport const CrewTypeSchema = z.enum(CREW_TYPES);\nexport const ChatComponentSchema = z.enum(CHAT_COMPONENTS);\nexport const LangGraphAgentSchema = z.enum(LANGGRAPH_AGENTS);\nexport const CrewFlowTemplateSchema = z.enum(CREW_FLOW_TEMPLATES);\nexport const YesNoSchema = z.enum(YES_NO);\n\n// URL validation schema with preprocessing to remove trailing slash\nexport const UrlSchema = z.preprocess(\n val => sanitizers.url(String(val)),\n z.string().url('Please enter a valid URL').min(1, 'URL is required')\n);\n\n// Token validation schema with preprocessing to trim\nexport const TokenSchema = z.preprocess(\n val => sanitizers.trim(String(val)),\n z.string().min(1, 'Token is required')\n);\n\n// API key validation schema with preprocessing to remove whitespace\nexport const ApiKeySchema = z.preprocess(\n val => sanitizers.apiKey(String(val)),\n z.string().min(1, 'API key is required')\n);\n\n// Name validation schema with preprocessing to trim\nexport const NameSchema = z.preprocess(\n val => sanitizers.trim(String(val)),\n z.string().min(1, 'Name is required')\n);\n\n// Config schema\nexport const ConfigSchema = z.object({\n // Core fields\n copilotKitVersion: z.string().optional(),\n agentFramework: AgentFrameworkSchema,\n chatUi: ChatComponentSchema.optional(),\n \n // Yes/No fields\n alreadyDeployed: YesNoSchema.optional(),\n fastApiEnabled: YesNoSchema.optional(),\n useCopilotCloud: YesNoSchema.optional(),\n \n // LangGraph specific fields \n langGraphAgent: LangGraphAgentSchema.optional(),\n langGraphPlatform: YesNoSchema.optional(),\n langGraphPlatformUrl: UrlSchema.optional(),\n langGraphRemoteEndpointURL: UrlSchema.optional(),\n \n // CrewAI specific fields\n crewType: CrewTypeSchema.optional(),\n crewName: NameSchema.optional(),\n crewUrl: UrlSchema.optional(),\n crewBearerToken: TokenSchema.optional(),\n crewFlowAgent: CrewFlowTemplateSchema.optional(),\n \n // API keys and tokens\n copilotCloudPublicApiKey: z.string().optional(),\n langSmithApiKey: ApiKeySchema.optional(),\n llmToken: ApiKeySchema.optional(),\n})\n.refine(\n (data) => {\n // If CrewAI is selected with Crews type, require crew URL and bearer token\n if (data.agentFramework === 'CrewAI' && data.crewType === 'Crews') {\n return !!data.crewUrl && !!data.crewBearerToken;\n }\n return true;\n },\n {\n message: \"Crew URL and bearer token are required for CrewAI Crews\",\n path: [\"crewUrl\", \"crewBearerToken\"],\n }\n)\n.refine(\n (data) => {\n // If LangGraph is selected with LangGraph Platform, require platform URL and LangSmith API key\n if (\n data.agentFramework === 'LangGraph' && \n data.alreadyDeployed === 'Yes' && \n data.langGraphPlatform === 'Yes'\n ) {\n return !!data.langGraphPlatformUrl && !!data.langSmithApiKey;\n }\n return true;\n },\n {\n message: \"LangGraph Platform URL and LangSmith API key are required\",\n path: [\"langGraphPlatformUrl\", \"langSmithApiKey\"],\n }\n);\n\n// Export the inferred type from the schema\nexport type Config = z.infer<typeof ConfigSchema>;\n\n// Question type definition with improved validation and sanitization\nexport type Question = {\n type: 'input' | 'yes/no' | 'select';\n name: keyof Config;\n message: string;\n choices?: readonly string[];\n default?: string;\n when?: (answers: Partial<Config>) => boolean;\n sensitive?: boolean;\n validate?: (input: string) => true | string; // Return true if valid, error message string if invalid\n sanitize?: (input: string) => string; // Function to sanitize input before validation\n};\n\n// CLI flags definition with descriptions\nexport const ConfigFlags = {\n mcp: Flags.string({description: 'Scaffold a CopilotKit project with MCP'}),\n copilotKitVersion: Flags.string({description: 'CopilotKit version to use (e.g. 1.7.0)'}),\n agentFramework: Flags.string({description: 'Agent framework to power your copilot', options: AGENT_FRAMEWORKS}),\n fastApiEnabled: Flags.string({description: 'Use FastAPI to serve your agent locally', options: YES_NO}),\n useCopilotCloud: Flags.string({description: 'Use Copilot Cloud for production-ready hosting', options: YES_NO}),\n chatUi: Flags.string({description: 'Chat UI component to add to your app', options: CHAT_COMPONENTS}),\n langGraphAgent: Flags.string({description: 'LangGraph agent template to use', options: LANGGRAPH_AGENTS}),\n crewType: Flags.string({description: 'CrewAI implementation type', options: CREW_TYPES}),\n crewName: Flags.string({description: 'Name for your CrewAI agent'}),\n crewUrl: Flags.string({description: 'URL endpoint for your CrewAI agent'}),\n crewBearerToken: Flags.string({description: 'Bearer token for CrewAI authentication'}),\n langSmithApiKey: Flags.string({description: 'LangSmith API key for LangGraph observability'}),\n llmToken: Flags.string({description: 'API key for your preferred LLM provider'}),\n crewFlowAgent: Flags.string({description: 'CrewAI Flow template to use', options: CREW_FLOW_TEMPLATES}),\n}","export type ChatTemplate = \n \"CopilotChat\" |\n \"CopilotPopup\" |\n \"CopilotSidebar\"\n\nexport type StarterTemplate = \n \"LangGraphPlatform\" |\n \"RemoteEndpoint\" |\n \"Standard\" |\n \"CrewEnterprise\" |\n \"CrewFlowsStarter\"\n\nexport type Template = ChatTemplate | StarterTemplate\n\nconst BASE_URL = \"https://registry.copilotkit.ai/r\"\n\nexport const templateMapping = {\n // Runtimes\n \"RemoteEndpoint\": `${BASE_URL}/remote-endpoint-starter.json`,\n \"LangGraphPlatformRuntime\": `${BASE_URL}/langgraph-platform-starter.json`,\n \n // CrewAI\n \"CrewEnterprise\": [\n `${BASE_URL}/coagents-crew-starter.json`,\n ], \n \"CrewFlowsStarter\": [\n `${BASE_URL}/coagents-starter-ui.json`,\n `${BASE_URL}/agent-layout.json`,\n `${BASE_URL}/remote-endpoint.json`\n ],\n \n // LangGraph\n \"LangGraphGeneric\": `${BASE_URL}/generic-lg-starter.json`,\n \"LangGraphStarter\": [\n `${BASE_URL}/langgraph-platform-starter.json`,\n `${BASE_URL}/coagents-starter-ui.json`,\n ],\n\n // No Agent\n \"StandardStarter\": `${BASE_URL}/standard-starter.json`,\n \"StandardRuntime\": `${BASE_URL}/standard-runtime.json`,\n\n // MCP\n \"McpStarter\": `${BASE_URL}/mcp-starter.json`,\n \"McpRuntime\": `${BASE_URL}/mcp-starter-runtime.json`\n}"],"mappings":";AAAA,OAAO,WAAW;;;ACAlB,SAAS,SAAS;AAClB,SAAS,aAAa;AAGf,IAAM,mBAAmB,CAAC,UAAU,aAAa,OAAO,MAAM;AAC9D,IAAM,aAAa,CAAC,SAAS,OAAO;AACpC,IAAM,kBAAkB,CAAC,eAAc,kBAAkB,YAAY,cAAc;AACnF,IAAM,mBAAmB,CAAC,kBAAkB,oBAAoB;AAChE,IAAM,sBAAsB,CAAC,SAAS;AACtC,IAAM,SAAS,CAAC,OAAO,IAAI;AAG3B,IAAM,aAAa;AAAA;AAAA,EAExB,KAAK,CAAC,UAA0B;AAC9B,QAAI,CAAC,MAAO,QAAO;AACnB,WAAO,MAAM,KAAK,EAAE,QAAQ,QAAQ,EAAE;AAAA,EACxC;AAAA;AAAA,EAGA,MAAM,CAAC,UAA0B;AAC/B,QAAI,CAAC,MAAO,QAAO;AACnB,WAAO,MAAM,KAAK;AAAA,EACpB;AAAA;AAAA,EAGA,WAAW,CAAC,UAA0B;AACpC,QAAI,CAAC,MAAO,QAAO;AACnB,WAAO,MAAM,YAAY,EAAE,KAAK;AAAA,EAClC;AAAA;AAAA,EAGA,QAAQ,CAAC,UAA0B;AACjC,QAAI,CAAC,MAAO,QAAO;AACnB,WAAO,MAAM,KAAK,EAAE,QAAQ,OAAO,EAAE;AAAA,EACvC;AACF;AAKO,IAAM,uBAAuB,EAAE,KAAK,gBAAgB;AACpD,IAAM,iBAAiB,EAAE,KAAK,UAAU;AACxC,IAAM,sBAAsB,EAAE,KAAK,eAAe;AAClD,IAAM,uBAAuB,EAAE,KAAK,gBAAgB;AACpD,IAAM,yBAAyB,EAAE,KAAK,mBAAmB;AACzD,IAAM,cAAc,EAAE,KAAK,MAAM;AAGjC,IAAM,YAAY,EAAE;AAAA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BAAgB,cAAc;AAAA,QACnD,WAAW,YAAY,eAAe;AACpC,qBAAW,KAAK,GAAG,gBAAgB,gBAAgB;AAAA,QACrD,OAAO;AACL,qBAAW,KAAK,gBAAgB,cAAc;AAAA,QAChD;AACA;AAAA,MACF,KAAK;AACH,mBAAW,KAAK,gBAAgB,UAAU;AAC1C,YAAI,YAAY,oBAAoB,OAAO;AACzC,qBAAW,KAAK,gBAAgB,UAAU;AAAA,QAC5C;AACA;AAAA,MACF,KAAK;AACH,mBAAW,KAAK,gBAAgB,eAAe;AAC/C,YAAI,YAAY,oBAAoB,OAAO;AACzC,qBAAW,KAAK,gBAAgB,eAAe;AAAA,QACjD;AACA;AAAA,MACF;AACE,mBAAW,KAAK,gBAAgB,cAAc;AAC9C;AAAA,IACJ;AAGA,UAAM,IAAI,QAAQ,aAAW,WAAW,SAAS,GAAG,CAAC;AAErD,QAAI;AAEF,YAAM,SAAS,MAAM,KAAK,OAAO,CAAC,iBAAiB,OAAO,GAAG,UAAU,GAAG;AAAA,QACxE,OAAO;AAAA;AAAA,MACT,CAAC;AAED,UAAI,OAAO,WAAW,GAAG;AACvB,cAAM,IAAI,MAAM,oDAAoD,OAAO,MAAM,EAAE;AAAA,MACrF;AAAA,IACF,SAAS,OAAO;AACd,YAAM;AAAA,IACR;AAAA,EACF,SAAS,OAAO;AACd,UAAM;AAAA,EACR;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/init/scaffold/shadcn.ts","../../../../src/lib/init/types/questions.ts","../../../../src/lib/init/utils.ts","../../../../src/lib/init/types/templates.ts"],"sourcesContent":["import spawn from 'cross-spawn'\nimport {templateMapping, Config} from '../types/index.js'\n\nexport async function scaffoldShadCN(flags: any, userAnswers: Config) {\n try {\n // Determine which components to install based on user choices\n const components: string[] = []\n \n // Add additional components based on agent framework\n switch (userAnswers.mode) {\n case 'LangGraph':\n if (userAnswers.langGraphAgent || flags.booth) {\n components.push(...templateMapping.LangGraphStarter)\n } else {\n components.push(templateMapping.LangGraphGeneric)\n if (userAnswers.useCopilotCloud !== 'Yes') {\n if (userAnswers.langGraphPlatform === 'Yes') {\n components.push(templateMapping.LangGraphPlatformRuntime)\n } else {\n components.push(templateMapping.RemoteEndpoint)\n }\n }\n }\n break\n case 'CrewAI':\n if (userAnswers.crewType === 'Crews') {\n components.push(...templateMapping.CrewEnterprise)\n } else if (userAnswers.crewFlowAgent) {\n components.push(...templateMapping.CrewFlowsStarter)\n } else {\n components.push(templateMapping.RemoteEndpoint)\n }\n break\n case 'MCP':\n components.push(templateMapping.McpStarter)\n if (userAnswers.useCopilotCloud !== 'Yes') {\n components.push(templateMapping.McpRuntime)\n }\n break\n case 'Standard':\n components.push(templateMapping.StandardStarter)\n if (userAnswers.useCopilotCloud !== 'Yes') {\n components.push(templateMapping.StandardRuntime)\n }\n break\n default:\n components.push(templateMapping.RemoteEndpoint)\n break\n }\n\n // Small pause before running shadcn\n await new Promise((resolve) => setTimeout(resolve, 100))\n\n try {\n // Run shadcn with inherited stdio for all streams to allow for user input\n const result = spawn.sync('npx', ['shadcn@latest', 'add', ...components], {\n stdio: 'inherit', // This ensures stdin/stdout/stderr are all passed through\n })\n\n if (result.status !== 0) {\n throw new Error(`The shadcn installation process exited with code ${result.status}`)\n }\n } catch (error) {\n throw error\n }\n } catch (error) {\n throw error\n }\n}\n","import {z} from 'zod'\nimport { Flags } from \"@oclif/core\"\nimport { isLocalhost } from \"../utils.js\"\n\n// ===== Core Constants =====\nexport const MODES = ['CrewAI', 'LangGraph', 'MCP', 'Standard'] as const\nexport const CREW_TYPES = ['Crews', 'Flows'] as const\nexport const CHAT_COMPONENTS = ['CopilotChat', 'CopilotSidebar', 'Headless', 'CopilotPopup'] as const\nexport const LANGGRAPH_AGENTS = ['Python Starter', 'TypeScript Starter'] as const\nexport const CREW_FLOW_TEMPLATES = ['Starter'] as const\nexport const YES_NO = ['Yes', 'No'] as const\n\n// ===== Sanitizers =====\nexport const sanitizers = {\n // Remove trailing slash from URLs\n url: (value: string): string => {\n if (!value) return value\n return value.trim().replace(/\\/+$/, '')\n },\n\n // Trim whitespace from strings\n trim: (value: string): string => {\n if (!value) return value\n return value.trim()\n },\n\n // Lowercase strings\n lowercase: (value: string): string => {\n if (!value) return value\n return value.toLowerCase().trim()\n },\n\n // Clean API keys (remove whitespace)\n apiKey: (value: string): string => {\n if (!value) return value\n return value.trim().replace(/\\s/g, '')\n },\n}\n\n// ===== Zod Schemas =====\n\n// Basic schemas\nexport const ModeSchema = z.enum(MODES)\nexport const CrewTypeSchema = z.enum(CREW_TYPES)\nexport const ChatComponentSchema = z.enum(CHAT_COMPONENTS)\nexport const LangGraphAgentSchema = z.enum(LANGGRAPH_AGENTS)\nexport const CrewFlowTemplateSchema = z.enum(CREW_FLOW_TEMPLATES)\nexport const YesNoSchema = z.enum(YES_NO)\n\n// URL validation schema with preprocessing to remove trailing slash\nexport const UrlSchema = z.preprocess(\n (val) => sanitizers.url(String(val)),\n z.string().url('Please enter a valid URL').min(1, 'URL is required'),\n)\n\n// Token validation schema with preprocessing to trim\nexport const TokenSchema = z.preprocess((val) => sanitizers.trim(String(val)), z.string().min(1, 'Token is required'))\n\n// API key validation schema with preprocessing to remove whitespace\nexport const ApiKeySchema = z.preprocess(\n (val) => sanitizers.apiKey(String(val)),\n z.string().min(1, 'API key is required'),\n)\n\n// Name validation schema with preprocessing to trim\nexport const NameSchema = z.preprocess((val) => sanitizers.trim(String(val)), z.string().min(1, 'Name is required'))\n\n// Config schema\nexport const ConfigSchema = z\n .object({\n // Core fields\n copilotKitVersion: z.string().optional(),\n mode: ModeSchema,\n chatUi: ChatComponentSchema.optional(),\n\n // Yes/No fields\n alreadyDeployed: YesNoSchema.optional(),\n fastApiEnabled: YesNoSchema.optional(),\n useCopilotCloud: YesNoSchema.optional(),\n\n // LangGraph specific fields\n langGraphAgent: LangGraphAgentSchema.optional(),\n langGraphPlatform: YesNoSchema.optional(),\n langGraphPlatformUrl: UrlSchema.optional(),\n langGraphRemoteEndpointURL: UrlSchema.optional(),\n\n // CrewAI specific fields\n crewType: CrewTypeSchema.optional(),\n crewName: NameSchema.optional(),\n crewUrl: UrlSchema.optional(),\n crewBearerToken: TokenSchema.optional(),\n crewFlowAgent: CrewFlowTemplateSchema.optional(),\n\n // API keys and tokens\n copilotCloudPublicApiKey: z.string().optional(),\n langSmithApiKey: ApiKeySchema.optional(),\n llmToken: ApiKeySchema.optional(),\n })\n .refine(\n (data) => {\n // If CrewAI is selected with Crews type, require crew URL and bearer token\n if (data.mode === 'CrewAI' && data.crewType === 'Crews') {\n return !!data.crewUrl && !!data.crewBearerToken\n }\n return true\n },\n {\n message: 'Crew URL and bearer token are required for CrewAI Crews',\n path: ['crewUrl', 'crewBearerToken'],\n },\n )\n .refine(\n (data) => {\n // If LangGraph is selected with LangGraph Platform, require platform URL and LangSmith API key\n if (data.mode === 'LangGraph' && data.alreadyDeployed === 'Yes' && data.langGraphPlatform === 'Yes') {\n return (!!data.langGraphPlatformUrl && !!data.langSmithApiKey) || isLocalhost(data.langGraphPlatformUrl || '');\n }\n return true\n },\n {\n message: 'LangGraph Platform URL and LangSmith API key are required',\n path: ['langGraphPlatformUrl', 'langSmithApiKey'],\n },\n )\n\n// Export the inferred type from the schema\nexport type Config = z.infer<typeof ConfigSchema>\n\n// Question type definition with improved validation and sanitization\nexport type Question = {\n type: 'input' | 'yes/no' | 'select'\n name: keyof Config\n message: string\n choices?: readonly string[]\n default?: string\n when?: (answers: Partial<Config>) => boolean\n sensitive?: boolean\n validate?: (input: string) => true | string // Return true if valid, error message string if invalid\n sanitize?: (input: string) => string // Function to sanitize input before validation\n}\n\n// CLI flags definition with descriptions\nexport const ConfigFlags = {\n booth: Flags.boolean({description: 'Use CopilotKit in booth mode', default: false, char: 'b'}),\n mode: Flags.string({description: 'How you will be interacting with AI', options: MODES, char: 'm'}),\n 'copilotkit-version': Flags.string({description: 'CopilotKit version to use (e.g. 1.7.0)'}),\n 'use-copilot-cloud': Flags.string({description: 'Use Copilot Cloud for production-ready hosting', options: YES_NO}),\n 'langgraph-agent': Flags.string({description: 'LangGraph agent template to use', options: LANGGRAPH_AGENTS}),\n 'crew-type': Flags.string({description: 'CrewAI implementation type', options: CREW_TYPES}),\n 'crew-name': Flags.string({description: 'Name for your CrewAI agent'}),\n 'crew-url': Flags.string({description: 'URL endpoint for your CrewAI agent'}),\n 'crew-bearer-token': Flags.string({description: 'Bearer token for CrewAI authentication'}),\n 'langsmith-api-key': Flags.string({description: 'LangSmith API key for LangGraph observability'}),\n 'llm-token': Flags.string({description: 'API key for your preferred LLM provider'}),\n 'crew-flow-agent': Flags.string({description: 'CrewAI Flow template to use', options: CREW_FLOW_TEMPLATES}),\n}\n","export const isLocalhost = (url: string): boolean => {\n return url.includes('localhost') || url.includes('127.0.0.1') || url.includes('0.0.0.0');\n}","export type ChatTemplate = 'CopilotChat' | 'CopilotPopup' | 'CopilotSidebar'\n\nexport type StarterTemplate =\n | 'LangGraphPlatform'\n | 'RemoteEndpoint'\n | 'Standard'\n | 'CrewEnterprise'\n | 'CrewFlowsStarter'\n\nexport type Template = ChatTemplate | StarterTemplate\n\nconst BASE_URL = 'https://registry.copilotkit.ai/r'\n\nexport const templateMapping = {\n // Runtimes\n RemoteEndpoint: `${BASE_URL}/remote-endpoint-starter.json`,\n LangGraphPlatformRuntime: `${BASE_URL}/langgraph-platform-starter.json`,\n\n // CrewAI\n CrewEnterprise: [`${BASE_URL}/coagents-crew-starter.json`],\n CrewFlowsStarter: [\n `${BASE_URL}/coagents-starter-ui.json`,\n `${BASE_URL}/agent-layout.json`,\n `${BASE_URL}/remote-endpoint.json`,\n ],\n\n // LangGraph\n LangGraphGeneric: `${BASE_URL}/generic-lg-starter.json`,\n LangGraphStarter: [`${BASE_URL}/langgraph-platform-starter.json`, `${BASE_URL}/coagents-starter-ui.json`],\n\n // No Agent\n StandardStarter: `${BASE_URL}/standard-starter.json`,\n StandardRuntime: `${BASE_URL}/standard-runtime.json`,\n\n // MCP\n McpStarter: `${BASE_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Y,eAAe;AACpC,qBAAW,KAAK,GAAG,gBAAgB,gBAAgB;AAAA,QACrD,OAAO;AACL,qBAAW,KAAK,gBAAgB,cAAc;AAAA,QAChD;AACA;AAAA,MACF,KAAK;AACH,mBAAW,KAAK,gBAAgB,UAAU;AAC1C,YAAI,YAAY,oBAAoB,OAAO;AACzC,qBAAW,KAAK,gBAAgB,UAAU;AAAA,QAC5C;AACA;AAAA,MACF,KAAK;AACH,mBAAW,KAAK,gBAAgB,eAAe;AAC/C,YAAI,YAAY,oBAAoB,OAAO;AACzC,qBAAW,KAAK,gBAAgB,eAAe;AAAA,QACjD;AACA;AAAA,MACF;AACE,mBAAW,KAAK,gBAAgB,cAAc;AAC9C;AAAA,IACJ;AAGA,UAAM,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,GAAG,CAAC;AAEvD,QAAI;AAEF,YAAM,SAAS,MAAM,KAAK,OAAO,CAAC,iBAAiB,OAAO,GAAG,UAAU,GAAG;AAAA,QACxE,OAAO;AAAA;AAAA,MACT,CAAC;AAED,UAAI,OAAO,WAAW,GAAG;AACvB,cAAM,IAAI,MAAM,oDAAoD,OAAO,MAAM,EAAE;AAAA,MACrF;AAAA,IACF,SAAS,OAAO;AACd,YAAM;AAAA,IACR;AAAA,EACF,SAAS,OAAO;AACd,UAAM;AAAA,EACR;AACF;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ApiKeySchema, CHAT_COMPONENTS, CREW_FLOW_TEMPLATES, CREW_TYPES, ChatComponentSchema, Config, ConfigFlags, ConfigSchema, CrewFlowTemplateSchema, CrewTypeSchema, LANGGRAPH_AGENTS, LangGraphAgentSchema, MODES, ModeSchema, NameSchema, Question, TokenSchema, UrlSchema, YES_NO, YesNoSchema, sanitizers } from './questions.js';
|
|
2
2
|
export { ChatTemplate, StarterTemplate, Template, templateMapping } from './templates.js';
|
|
3
3
|
import '@oclif/core/interfaces';
|
|
4
4
|
import 'zod';
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
// src/lib/init/types/questions.ts
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { Flags } from "@oclif/core";
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
// src/lib/init/utils.ts
|
|
6
|
+
var isLocalhost = (url) => {
|
|
7
|
+
return url.includes("localhost") || url.includes("127.0.0.1") || url.includes("0.0.0.0");
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// src/lib/init/types/questions.ts
|
|
11
|
+
var MODES = ["CrewAI", "LangGraph", "MCP", "Standard"];
|
|
5
12
|
var CREW_TYPES = ["Crews", "Flows"];
|
|
6
13
|
var CHAT_COMPONENTS = ["CopilotChat", "CopilotSidebar", "Headless", "CopilotPopup"];
|
|
7
14
|
var LANGGRAPH_AGENTS = ["Python Starter", "TypeScript Starter"];
|
|
@@ -29,7 +36,7 @@ var sanitizers = {
|
|
|
29
36
|
return value.trim().replace(/\s/g, "");
|
|
30
37
|
}
|
|
31
38
|
};
|
|
32
|
-
var
|
|
39
|
+
var ModeSchema = z.enum(MODES);
|
|
33
40
|
var CrewTypeSchema = z.enum(CREW_TYPES);
|
|
34
41
|
var ChatComponentSchema = z.enum(CHAT_COMPONENTS);
|
|
35
42
|
var LangGraphAgentSchema = z.enum(LANGGRAPH_AGENTS);
|
|
@@ -39,28 +46,22 @@ var UrlSchema = z.preprocess(
|
|
|
39
46
|
(val) => sanitizers.url(String(val)),
|
|
40
47
|
z.string().url("Please enter a valid URL").min(1, "URL is required")
|
|
41
48
|
);
|
|
42
|
-
var TokenSchema = z.preprocess(
|
|
43
|
-
(val) => sanitizers.trim(String(val)),
|
|
44
|
-
z.string().min(1, "Token is required")
|
|
45
|
-
);
|
|
49
|
+
var TokenSchema = z.preprocess((val) => sanitizers.trim(String(val)), z.string().min(1, "Token is required"));
|
|
46
50
|
var ApiKeySchema = z.preprocess(
|
|
47
51
|
(val) => sanitizers.apiKey(String(val)),
|
|
48
52
|
z.string().min(1, "API key is required")
|
|
49
53
|
);
|
|
50
|
-
var NameSchema = z.preprocess(
|
|
51
|
-
(val) => sanitizers.trim(String(val)),
|
|
52
|
-
z.string().min(1, "Name is required")
|
|
53
|
-
);
|
|
54
|
+
var NameSchema = z.preprocess((val) => sanitizers.trim(String(val)), z.string().min(1, "Name is required"));
|
|
54
55
|
var ConfigSchema = z.object({
|
|
55
56
|
// Core fields
|
|
56
57
|
copilotKitVersion: z.string().optional(),
|
|
57
|
-
|
|
58
|
+
mode: ModeSchema,
|
|
58
59
|
chatUi: ChatComponentSchema.optional(),
|
|
59
60
|
// Yes/No fields
|
|
60
61
|
alreadyDeployed: YesNoSchema.optional(),
|
|
61
62
|
fastApiEnabled: YesNoSchema.optional(),
|
|
62
63
|
useCopilotCloud: YesNoSchema.optional(),
|
|
63
|
-
// LangGraph specific fields
|
|
64
|
+
// LangGraph specific fields
|
|
64
65
|
langGraphAgent: LangGraphAgentSchema.optional(),
|
|
65
66
|
langGraphPlatform: YesNoSchema.optional(),
|
|
66
67
|
langGraphPlatformUrl: UrlSchema.optional(),
|
|
@@ -77,7 +78,7 @@ var ConfigSchema = z.object({
|
|
|
77
78
|
llmToken: ApiKeySchema.optional()
|
|
78
79
|
}).refine(
|
|
79
80
|
(data) => {
|
|
80
|
-
if (data.
|
|
81
|
+
if (data.mode === "CrewAI" && data.crewType === "Crews") {
|
|
81
82
|
return !!data.crewUrl && !!data.crewBearerToken;
|
|
82
83
|
}
|
|
83
84
|
return true;
|
|
@@ -88,8 +89,8 @@ var ConfigSchema = z.object({
|
|
|
88
89
|
}
|
|
89
90
|
).refine(
|
|
90
91
|
(data) => {
|
|
91
|
-
if (data.
|
|
92
|
-
return !!data.langGraphPlatformUrl && !!data.langSmithApiKey;
|
|
92
|
+
if (data.mode === "LangGraph" && data.alreadyDeployed === "Yes" && data.langGraphPlatform === "Yes") {
|
|
93
|
+
return !!data.langGraphPlatformUrl && !!data.langSmithApiKey || isLocalhost(data.langGraphPlatformUrl || "");
|
|
93
94
|
}
|
|
94
95
|
return true;
|
|
95
96
|
},
|
|
@@ -99,53 +100,44 @@ var ConfigSchema = z.object({
|
|
|
99
100
|
}
|
|
100
101
|
);
|
|
101
102
|
var ConfigFlags = {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
llmToken: Flags.string({ description: "API key for your preferred LLM provider" }),
|
|
115
|
-
crewFlowAgent: Flags.string({ description: "CrewAI Flow template to use", options: CREW_FLOW_TEMPLATES })
|
|
103
|
+
booth: Flags.boolean({ description: "Use CopilotKit in booth mode", default: false, char: "b" }),
|
|
104
|
+
mode: Flags.string({ description: "How you will be interacting with AI", options: MODES, char: "m" }),
|
|
105
|
+
"copilotkit-version": Flags.string({ description: "CopilotKit version to use (e.g. 1.7.0)" }),
|
|
106
|
+
"use-copilot-cloud": Flags.string({ description: "Use Copilot Cloud for production-ready hosting", options: YES_NO }),
|
|
107
|
+
"langgraph-agent": Flags.string({ description: "LangGraph agent template to use", options: LANGGRAPH_AGENTS }),
|
|
108
|
+
"crew-type": Flags.string({ description: "CrewAI implementation type", options: CREW_TYPES }),
|
|
109
|
+
"crew-name": Flags.string({ description: "Name for your CrewAI agent" }),
|
|
110
|
+
"crew-url": Flags.string({ description: "URL endpoint for your CrewAI agent" }),
|
|
111
|
+
"crew-bearer-token": Flags.string({ description: "Bearer token for CrewAI authentication" }),
|
|
112
|
+
"langsmith-api-key": Flags.string({ description: "LangSmith API key for LangGraph observability" }),
|
|
113
|
+
"llm-token": Flags.string({ description: "API key for your preferred LLM provider" }),
|
|
114
|
+
"crew-flow-agent": Flags.string({ description: "CrewAI Flow template to use", options: CREW_FLOW_TEMPLATES })
|
|
116
115
|
};
|
|
117
116
|
|
|
118
117
|
// src/lib/init/types/templates.ts
|
|
119
118
|
var BASE_URL = "https://registry.copilotkit.ai/r";
|
|
120
119
|
var templateMapping = {
|
|
121
120
|
// Runtimes
|
|
122
|
-
|
|
123
|
-
|
|
121
|
+
RemoteEndpoint: `${BASE_URL}/remote-endpoint-starter.json`,
|
|
122
|
+
LangGraphPlatformRuntime: `${BASE_URL}/langgraph-platform-starter.json`,
|
|
124
123
|
// CrewAI
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
],
|
|
128
|
-
"CrewFlowsStarter": [
|
|
124
|
+
CrewEnterprise: [`${BASE_URL}/coagents-crew-starter.json`],
|
|
125
|
+
CrewFlowsStarter: [
|
|
129
126
|
`${BASE_URL}/coagents-starter-ui.json`,
|
|
130
127
|
`${BASE_URL}/agent-layout.json`,
|
|
131
128
|
`${BASE_URL}/remote-endpoint.json`
|
|
132
129
|
],
|
|
133
130
|
// LangGraph
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
`${BASE_URL}/langgraph-platform-starter.json`,
|
|
137
|
-
`${BASE_URL}/coagents-starter-ui.json`
|
|
138
|
-
],
|
|
131
|
+
LangGraphGeneric: `${BASE_URL}/generic-lg-starter.json`,
|
|
132
|
+
LangGraphStarter: [`${BASE_URL}/langgraph-platform-starter.json`, `${BASE_URL}/coagents-starter-ui.json`],
|
|
139
133
|
// No Agent
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
StandardStarter: `${BASE_URL}/standard-starter.json`,
|
|
135
|
+
StandardRuntime: `${BASE_URL}/standard-runtime.json`,
|
|
142
136
|
// MCP
|
|
143
|
-
|
|
144
|
-
|
|
137
|
+
McpStarter: `${BASE_URL}/mcp-starter.json`,
|
|
138
|
+
McpRuntime: `${BASE_URL}/mcp-starter-runtime.json`
|
|
145
139
|
};
|
|
146
140
|
export {
|
|
147
|
-
AGENT_FRAMEWORKS,
|
|
148
|
-
AgentFrameworkSchema,
|
|
149
141
|
ApiKeySchema,
|
|
150
142
|
CHAT_COMPONENTS,
|
|
151
143
|
CREW_FLOW_TEMPLATES,
|
|
@@ -157,6 +149,8 @@ export {
|
|
|
157
149
|
CrewTypeSchema,
|
|
158
150
|
LANGGRAPH_AGENTS,
|
|
159
151
|
LangGraphAgentSchema,
|
|
152
|
+
MODES,
|
|
153
|
+
ModeSchema,
|
|
160
154
|
NameSchema,
|
|
161
155
|
TokenSchema,
|
|
162
156
|
UrlSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/init/types/questions.ts","../../../../src/lib/init/types/templates.ts"],"sourcesContent":["import { z } from 'zod';\nimport { Flags } from \"@oclif/core\"\n\n// ===== Core Constants =====\nexport const AGENT_FRAMEWORKS = ['CrewAI', 'LangGraph', \"MCP\", 'None'] as const;\nexport const CREW_TYPES = ['Crews', 'Flows'] as const;\nexport const CHAT_COMPONENTS = ['CopilotChat','CopilotSidebar', 'Headless', 'CopilotPopup'] as const;\nexport const LANGGRAPH_AGENTS = ['Python Starter', 'TypeScript Starter'] as const;\nexport const CREW_FLOW_TEMPLATES = ['Starter'] as const;\nexport const YES_NO = ['Yes', 'No'] as const;\n\n// ===== Sanitizers =====\nexport const sanitizers = {\n // Remove trailing slash from URLs\n url: (value: string): string => {\n if (!value) return value;\n return value.trim().replace(/\\/+$/, '');\n },\n \n // Trim whitespace from strings\n trim: (value: string): string => {\n if (!value) return value;\n return value.trim();\n },\n \n // Lowercase strings\n lowercase: (value: string): string => {\n if (!value) return value;\n return value.toLowerCase().trim();\n },\n \n // Clean API keys (remove whitespace)\n apiKey: (value: string): string => {\n if (!value) return value;\n return value.trim().replace(/\\s/g, '');\n }\n};\n\n// ===== Zod Schemas =====\n\n// Basic schemas\nexport const AgentFrameworkSchema = z.enum(AGENT_FRAMEWORKS);\nexport const CrewTypeSchema = z.enum(CREW_TYPES);\nexport const ChatComponentSchema = z.enum(CHAT_COMPONENTS);\nexport const LangGraphAgentSchema = z.enum(LANGGRAPH_AGENTS);\nexport const CrewFlowTemplateSchema = z.enum(CREW_FLOW_TEMPLATES);\nexport const YesNoSchema = z.enum(YES_NO);\n\n// URL validation schema with preprocessing to remove trailing slash\nexport const UrlSchema = z.preprocess(\n val => sanitizers.url(String(val)),\n z.string().url('Please enter a valid URL').min(1, 'URL is required')\n);\n\n// Token validation schema with preprocessing to trim\nexport const TokenSchema = z.preprocess(\n val => sanitizers.trim(String(val)),\n z.string().min(1, 'Token is required')\n);\n\n// API key validation schema with preprocessing to remove whitespace\nexport const ApiKeySchema = z.preprocess(\n val => sanitizers.apiKey(String(val)),\n z.string().min(1, 'API key is required')\n);\n\n// Name validation schema with preprocessing to trim\nexport const NameSchema = z.preprocess(\n val => sanitizers.trim(String(val)),\n z.string().min(1, 'Name is required')\n);\n\n// Config schema\nexport const ConfigSchema = z.object({\n // Core fields\n copilotKitVersion: z.string().optional(),\n agentFramework: AgentFrameworkSchema,\n chatUi: ChatComponentSchema.optional(),\n \n // Yes/No fields\n alreadyDeployed: YesNoSchema.optional(),\n fastApiEnabled: YesNoSchema.optional(),\n useCopilotCloud: YesNoSchema.optional(),\n \n // LangGraph specific fields \n langGraphAgent: LangGraphAgentSchema.optional(),\n langGraphPlatform: YesNoSchema.optional(),\n langGraphPlatformUrl: UrlSchema.optional(),\n langGraphRemoteEndpointURL: UrlSchema.optional(),\n \n // CrewAI specific fields\n crewType: CrewTypeSchema.optional(),\n crewName: NameSchema.optional(),\n crewUrl: UrlSchema.optional(),\n crewBearerToken: TokenSchema.optional(),\n crewFlowAgent: CrewFlowTemplateSchema.optional(),\n \n // API keys and tokens\n copilotCloudPublicApiKey: z.string().optional(),\n langSmithApiKey: ApiKeySchema.optional(),\n llmToken: ApiKeySchema.optional(),\n})\n.refine(\n (data) => {\n // If CrewAI is selected with Crews type, require crew URL and bearer token\n if (data.agentFramework === 'CrewAI' && data.crewType === 'Crews') {\n return !!data.crewUrl && !!data.crewBearerToken;\n }\n return true;\n },\n {\n message: \"Crew URL and bearer token are required for CrewAI Crews\",\n path: [\"crewUrl\", \"crewBearerToken\"],\n }\n)\n.refine(\n (data) => {\n // If LangGraph is selected with LangGraph Platform, require platform URL and LangSmith API key\n if (\n data.agentFramework === 'LangGraph' && \n data.alreadyDeployed === 'Yes' && \n data.langGraphPlatform === 'Yes'\n ) {\n return !!data.langGraphPlatformUrl && !!data.langSmithApiKey;\n }\n return true;\n },\n {\n message: \"LangGraph Platform URL and LangSmith API key are required\",\n path: [\"langGraphPlatformUrl\", \"langSmithApiKey\"],\n }\n);\n\n// Export the inferred type from the schema\nexport type Config = z.infer<typeof ConfigSchema>;\n\n// Question type definition with improved validation and sanitization\nexport type Question = {\n type: 'input' | 'yes/no' | 'select';\n name: keyof Config;\n message: string;\n choices?: readonly string[];\n default?: string;\n when?: (answers: Partial<Config>) => boolean;\n sensitive?: boolean;\n validate?: (input: string) => true | string; // Return true if valid, error message string if invalid\n sanitize?: (input: string) => string; // Function to sanitize input before validation\n};\n\n// CLI flags definition with descriptions\nexport const ConfigFlags = {\n mcp: Flags.string({description: 'Scaffold a CopilotKit project with MCP'}),\n copilotKitVersion: Flags.string({description: 'CopilotKit version to use (e.g. 1.7.0)'}),\n agentFramework: Flags.string({description: 'Agent framework to power your copilot', options: AGENT_FRAMEWORKS}),\n fastApiEnabled: Flags.string({description: 'Use FastAPI to serve your agent locally', options: YES_NO}),\n useCopilotCloud: Flags.string({description: 'Use Copilot Cloud for production-ready hosting', options: YES_NO}),\n chatUi: Flags.string({description: 'Chat UI component to add to your app', options: CHAT_COMPONENTS}),\n langGraphAgent: Flags.string({description: 'LangGraph agent template to use', options: LANGGRAPH_AGENTS}),\n crewType: Flags.string({description: 'CrewAI implementation type', options: CREW_TYPES}),\n crewName: Flags.string({description: 'Name for your CrewAI agent'}),\n crewUrl: Flags.string({description: 'URL endpoint for your CrewAI agent'}),\n crewBearerToken: Flags.string({description: 'Bearer token for CrewAI authentication'}),\n langSmithApiKey: Flags.string({description: 'LangSmith API key for LangGraph observability'}),\n llmToken: Flags.string({description: 'API key for your preferred LLM provider'}),\n crewFlowAgent: Flags.string({description: 'CrewAI Flow template to use', options: CREW_FLOW_TEMPLATES}),\n}","export type ChatTemplate = \n \"CopilotChat\" |\n \"CopilotPopup\" |\n \"CopilotSidebar\"\n\nexport type StarterTemplate = \n \"LangGraphPlatform\" |\n \"RemoteEndpoint\" |\n \"Standard\" |\n \"CrewEnterprise\" |\n \"CrewFlowsStarter\"\n\nexport type Template = ChatTemplate | StarterTemplate\n\nconst BASE_URL = \"https://registry.copilotkit.ai/r\"\n\nexport const templateMapping = {\n // Runtimes\n \"RemoteEndpoint\": `${BASE_URL}/remote-endpoint-starter.json`,\n \"LangGraphPlatformRuntime\": `${BASE_URL}/langgraph-platform-starter.json`,\n \n // CrewAI\n \"CrewEnterprise\": [\n `${BASE_URL}/coagents-crew-starter.json`,\n ], \n \"CrewFlowsStarter\": [\n `${BASE_URL}/coagents-starter-ui.json`,\n `${BASE_URL}/agent-layout.json`,\n `${BASE_URL}/remote-endpoint.json`\n ],\n \n // LangGraph\n \"LangGraphGeneric\": `${BASE_URL}/generic-lg-starter.json`,\n \"LangGraphStarter\": [\n `${BASE_URL}/langgraph-platform-starter.json`,\n `${BASE_URL}/coagents-starter-ui.json`,\n ],\n\n // No Agent\n \"StandardStarter\": `${BASE_URL}/standard-starter.json`,\n \"StandardRuntime\": `${BASE_URL}/standard-runtime.json`,\n\n // MCP\n \"McpStarter\": `${BASE_URL}/mcp-starter.json`,\n \"McpRuntime\": `${BASE_URL}/mcp-starter-runtime.json`\n}"],"mappings":";AAAA,SAAS,SAAS;AAClB,SAAS,aAAa;AAGf,IAAM,mBAAmB,CAAC,UAAU,aAAa,OAAO,MAAM;AAC9D,IAAM,aAAa,CAAC,SAAS,OAAO;AACpC,IAAM,kBAAkB,CAAC,eAAc,kBAAkB,YAAY,cAAc;AACnF,IAAM,mBAAmB,CAAC,kBAAkB,oBAAoB;AAChE,IAAM,sBAAsB,CAAC,SAAS;AACtC,IAAM,SAAS,CAAC,OAAO,IAAI;AAG3B,IAAM,aAAa;AAAA;AAAA,EAExB,KAAK,CAAC,UAA0B;AAC9B,QAAI,C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AAG,QAAQ;AAAA,IACX,GAAG,QAAQ;AAAA,EACf;AAAA;AAAA,EAGA,mBAAmB,GAAG,QAAQ;AAAA,EAC9B,mBAAmB,GAAG,QAAQ;AAAA;AAAA,EAG9B,cAAc,GAAG,QAAQ;AAAA,EACzB,cAAc,GAAG,QAAQ;AAC7B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/init/types/questions.ts","../../../../src/lib/init/utils.ts","../../../../src/lib/init/types/templates.ts"],"sourcesContent":["import {z} from 'zod'\nimport { Flags } from \"@oclif/core\"\nimport { isLocalhost } from \"../utils.js\"\n\n// ===== Core Constants =====\nexport const MODES = ['CrewAI', 'LangGraph', 'MCP', 'Standard'] as const\nexport const CREW_TYPES = ['Crews', 'Flows'] as const\nexport const CHAT_COMPONENTS = ['CopilotChat', 'CopilotSidebar', 'Headless', 'CopilotPopup'] as const\nexport const LANGGRAPH_AGENTS = ['Python Starter', 'TypeScript Starter'] as const\nexport const CREW_FLOW_TEMPLATES = ['Starter'] as const\nexport const YES_NO = ['Yes', 'No'] as const\n\n// ===== Sanitizers =====\nexport const sanitizers = {\n // Remove trailing slash from URLs\n url: (value: string): string => {\n if (!value) return value\n return value.trim().replace(/\\/+$/, '')\n },\n\n // Trim whitespace from strings\n trim: (value: string): string => {\n if (!value) return value\n return value.trim()\n },\n\n // Lowercase strings\n lowercase: (value: string): string => {\n if (!value) return value\n return value.toLowerCase().trim()\n },\n\n // Clean API keys (remove whitespace)\n apiKey: (value: string): string => {\n if (!value) return value\n return value.trim().replace(/\\s/g, '')\n },\n}\n\n// ===== Zod Schemas =====\n\n// Basic schemas\nexport const ModeSchema = z.enum(MODES)\nexport const CrewTypeSchema = z.enum(CREW_TYPES)\nexport const ChatComponentSchema = z.enum(CHAT_COMPONENTS)\nexport const LangGraphAgentSchema = z.enum(LANGGRAPH_AGENTS)\nexport const CrewFlowTemplateSchema = z.enum(CREW_FLOW_TEMPLATES)\nexport const YesNoSchema = z.enum(YES_NO)\n\n// URL validation schema with preprocessing to remove trailing slash\nexport const UrlSchema = z.preprocess(\n (val) => sanitizers.url(String(val)),\n z.string().url('Please enter a valid URL').min(1, 'URL is required'),\n)\n\n// Token validation schema with preprocessing to trim\nexport const TokenSchema = z.preprocess((val) => sanitizers.trim(String(val)), z.string().min(1, 'Token is required'))\n\n// API key validation schema with preprocessing to remove whitespace\nexport const ApiKeySchema = z.preprocess(\n (val) => sanitizers.apiKey(String(val)),\n z.string().min(1, 'API key is required'),\n)\n\n// Name validation schema with preprocessing to trim\nexport const NameSchema = z.preprocess((val) => sanitizers.trim(String(val)), z.string().min(1, 'Name is required'))\n\n// Config schema\nexport const ConfigSchema = z\n .object({\n // Core fields\n copilotKitVersion: z.string().optional(),\n mode: ModeSchema,\n chatUi: ChatComponentSchema.optional(),\n\n // Yes/No fields\n alreadyDeployed: YesNoSchema.optional(),\n fastApiEnabled: YesNoSchema.optional(),\n useCopilotCloud: YesNoSchema.optional(),\n\n // LangGraph specific fields\n langGraphAgent: LangGraphAgentSchema.optional(),\n langGraphPlatform: YesNoSchema.optional(),\n langGraphPlatformUrl: UrlSchema.optional(),\n langGraphRemoteEndpointURL: UrlSchema.optional(),\n\n // CrewAI specific fields\n crewType: CrewTypeSchema.optional(),\n crewName: NameSchema.optional(),\n crewUrl: UrlSchema.optional(),\n crewBearerToken: TokenSchema.optional(),\n crewFlowAgent: CrewFlowTemplateSchema.optional(),\n\n // API keys and tokens\n copilotCloudPublicApiKey: z.string().optional(),\n langSmithApiKey: ApiKeySchema.optional(),\n llmToken: ApiKeySchema.optional(),\n })\n .refine(\n (data) => {\n // If CrewAI is selected with Crews type, require crew URL and bearer token\n if (data.mode === 'CrewAI' && data.crewType === 'Crews') {\n return !!data.crewUrl && !!data.crewBearerToken\n }\n return true\n },\n {\n message: 'Crew URL and bearer token are required for CrewAI Crews',\n path: ['crewUrl', 'crewBearerToken'],\n },\n )\n .refine(\n (data) => {\n // If LangGraph is selected with LangGraph Platform, require platform URL and LangSmith API key\n if (data.mode === 'LangGraph' && data.alreadyDeployed === 'Yes' && data.langGraphPlatform === 'Yes') {\n return (!!data.langGraphPlatformUrl && !!data.langSmithApiKey) || isLocalhost(data.langGraphPlatformUrl || '');\n }\n return true\n },\n {\n message: 'LangGraph Platform URL and LangSmith API key are required',\n path: ['langGraphPlatformUrl', 'langSmithApiKey'],\n },\n )\n\n// Export the inferred type from the schema\nexport type Config = z.infer<typeof ConfigSchema>\n\n// Question type definition with improved validation and sanitization\nexport type Question = {\n type: 'input' | 'yes/no' | 'select'\n name: keyof Config\n message: string\n choices?: readonly string[]\n default?: string\n when?: (answers: Partial<Config>) => boolean\n sensitive?: boolean\n validate?: (input: string) => true | string // Return true if valid, error message string if invalid\n sanitize?: (input: string) => string // Function to sanitize input before validation\n}\n\n// CLI flags definition with descriptions\nexport const ConfigFlags = {\n booth: Flags.boolean({description: 'Use CopilotKit in booth mode', default: false, char: 'b'}),\n mode: Flags.string({description: 'How you will be interacting with AI', options: MODES, char: 'm'}),\n 'copilotkit-version': Flags.string({description: 'CopilotKit version to use (e.g. 1.7.0)'}),\n 'use-copilot-cloud': Flags.string({description: 'Use Copilot Cloud for production-ready hosting', options: YES_NO}),\n 'langgraph-agent': Flags.string({description: 'LangGraph agent template to use', options: LANGGRAPH_AGENTS}),\n 'crew-type': Flags.string({description: 'CrewAI implementation type', options: CREW_TYPES}),\n 'crew-name': Flags.string({description: 'Name for your CrewAI agent'}),\n 'crew-url': Flags.string({description: 'URL endpoint for your CrewAI agent'}),\n 'crew-bearer-token': Flags.string({description: 'Bearer token for CrewAI authentication'}),\n 'langsmith-api-key': Flags.string({description: 'LangSmith API key for LangGraph observability'}),\n 'llm-token': Flags.string({description: 'API key for your preferred LLM provider'}),\n 'crew-flow-agent': Flags.string({description: 'CrewAI Flow template to use', options: CREW_FLOW_TEMPLATES}),\n}\n","export const isLocalhost = (url: string): boolean => {\n return url.includes('localhost') || url.includes('127.0.0.1') || url.includes('0.0.0.0');\n}","export type ChatTemplate = 'CopilotChat' | 'CopilotPopup' | 'CopilotSidebar'\n\nexport type StarterTemplate =\n | 'LangGraphPlatform'\n | 'RemoteEndpoint'\n | 'Standard'\n | 'CrewEnterprise'\n | 'CrewFlowsStarter'\n\nexport type Template = ChatTemplate | StarterTemplate\n\nconst BASE_URL = 'https://registry.copilotkit.ai/r'\n\nexport const templateMapping = {\n // Runtimes\n RemoteEndpoint: `${BASE_URL}/remote-endpoint-starter.json`,\n LangGraphPlatformRuntime: `${BASE_URL}/langgraph-platform-starter.json`,\n\n // CrewAI\n CrewEnterprise: [`${BASE_URL}/coagents-crew-starter.json`],\n CrewFlowsStarter: [\n `${BASE_URL}/coagents-starter-ui.json`,\n `${BASE_URL}/agent-layout.json`,\n `${BASE_URL}/remote-endpoint.json`,\n ],\n\n // LangGraph\n LangGraphGeneric: `${BASE_URL}/generic-lg-starter.json`,\n LangGraphStarter: [`${BASE_URL}/langgraph-platform-starter.json`, `${BASE_URL}/coagents-starter-ui.json`],\n\n // No Agent\n StandardStarter: `${BASE_URL}/standard-starter.json`,\n StandardRuntime: `${BASE_URL}/standard-runtime.json`,\n\n // MCP\n McpStarter: `${BASE_URL}/mcp-starter.json`,\n McpRuntime: `${BASE_URL}/mcp-starter-runtime.json`,\n}\n"],"mappings":";AAAA,SAAQ,SAAQ;AAChB,SAAS,aAAa;;;ACDf,IAAM,cAAc,CAAC,QAAyB;AACnD,SAAO,IAAI,SAAS,WAAW,KAAK,IAAI,SAAS,WAAW,KAAK,IAAI,SAAS,SAAS;AACzF;;;ADGO,IAAM,QAAQ,CAAC,UAAU,aAAa,OAAO,UAAU;AACvD,IAAM,aAAa,CAAC,SAAS,OAAO;AACpC,IAAM,kBAAkB,CAAC,eAAe,kBAAkB,YAAY,cAAc;AACpF,IAAM,mBAAmB,CAAC,kBAAkB,oBAAoB;AAChE,IAAM,sBAAsB,CAAC,SAAS;AACtC,IAAM,SAAS,CAAC,OAAO,IAAI;AAG3B,IAAM,aAAa;AAAA;AAAA,EAExB,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EAGxG,iBAAiB,GAAG,QAAQ;AAAA,EAC5B,iBAAiB,GAAG,QAAQ;AAAA;AAAA,EAG5B,YAAY,GAAG,QAAQ;AAAA,EACvB,YAAY,GAAG,QAAQ;AACzB;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _oclif_core_interfaces from '@oclif/core/interfaces';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
declare const
|
|
4
|
+
declare const MODES: readonly ["CrewAI", "LangGraph", "MCP", "Standard"];
|
|
5
5
|
declare const CREW_TYPES: readonly ["Crews", "Flows"];
|
|
6
6
|
declare const CHAT_COMPONENTS: readonly ["CopilotChat", "CopilotSidebar", "Headless", "CopilotPopup"];
|
|
7
7
|
declare const LANGGRAPH_AGENTS: readonly ["Python Starter", "TypeScript Starter"];
|
|
@@ -13,7 +13,7 @@ declare const sanitizers: {
|
|
|
13
13
|
lowercase: (value: string) => string;
|
|
14
14
|
apiKey: (value: string) => string;
|
|
15
15
|
};
|
|
16
|
-
declare const
|
|
16
|
+
declare const ModeSchema: z.ZodEnum<["CrewAI", "LangGraph", "MCP", "Standard"]>;
|
|
17
17
|
declare const CrewTypeSchema: z.ZodEnum<["Crews", "Flows"]>;
|
|
18
18
|
declare const ChatComponentSchema: z.ZodEnum<["CopilotChat", "CopilotSidebar", "Headless", "CopilotPopup"]>;
|
|
19
19
|
declare const LangGraphAgentSchema: z.ZodEnum<["Python Starter", "TypeScript Starter"]>;
|
|
@@ -25,7 +25,7 @@ declare const ApiKeySchema: z.ZodEffects<z.ZodString, string, unknown>;
|
|
|
25
25
|
declare const NameSchema: z.ZodEffects<z.ZodString, string, unknown>;
|
|
26
26
|
declare const ConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
27
27
|
copilotKitVersion: z.ZodOptional<z.ZodString>;
|
|
28
|
-
|
|
28
|
+
mode: z.ZodEnum<["CrewAI", "LangGraph", "MCP", "Standard"]>;
|
|
29
29
|
chatUi: z.ZodOptional<z.ZodEnum<["CopilotChat", "CopilotSidebar", "Headless", "CopilotPopup"]>>;
|
|
30
30
|
alreadyDeployed: z.ZodOptional<z.ZodEnum<["Yes", "No"]>>;
|
|
31
31
|
fastApiEnabled: z.ZodOptional<z.ZodEnum<["Yes", "No"]>>;
|
|
@@ -43,7 +43,7 @@ declare const ConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
|
43
43
|
langSmithApiKey: z.ZodOptional<z.ZodEffects<z.ZodString, string, unknown>>;
|
|
44
44
|
llmToken: z.ZodOptional<z.ZodEffects<z.ZodString, string, unknown>>;
|
|
45
45
|
}, "strip", z.ZodTypeAny, {
|
|
46
|
-
|
|
46
|
+
mode: "CrewAI" | "MCP" | "LangGraph" | "Standard";
|
|
47
47
|
copilotKitVersion?: string | undefined;
|
|
48
48
|
chatUi?: "CopilotChat" | "CopilotSidebar" | "Headless" | "CopilotPopup" | undefined;
|
|
49
49
|
alreadyDeployed?: "Yes" | "No" | undefined;
|
|
@@ -62,7 +62,7 @@ declare const ConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
|
62
62
|
langSmithApiKey?: string | undefined;
|
|
63
63
|
llmToken?: string | undefined;
|
|
64
64
|
}, {
|
|
65
|
-
|
|
65
|
+
mode: "CrewAI" | "MCP" | "LangGraph" | "Standard";
|
|
66
66
|
copilotKitVersion?: string | undefined;
|
|
67
67
|
chatUi?: "CopilotChat" | "CopilotSidebar" | "Headless" | "CopilotPopup" | undefined;
|
|
68
68
|
alreadyDeployed?: "Yes" | "No" | undefined;
|
|
@@ -81,7 +81,7 @@ declare const ConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
|
81
81
|
langSmithApiKey?: unknown;
|
|
82
82
|
llmToken?: unknown;
|
|
83
83
|
}>, {
|
|
84
|
-
|
|
84
|
+
mode: "CrewAI" | "MCP" | "LangGraph" | "Standard";
|
|
85
85
|
copilotKitVersion?: string | undefined;
|
|
86
86
|
chatUi?: "CopilotChat" | "CopilotSidebar" | "Headless" | "CopilotPopup" | undefined;
|
|
87
87
|
alreadyDeployed?: "Yes" | "No" | undefined;
|
|
@@ -100,7 +100,7 @@ declare const ConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
|
100
100
|
langSmithApiKey?: string | undefined;
|
|
101
101
|
llmToken?: string | undefined;
|
|
102
102
|
}, {
|
|
103
|
-
|
|
103
|
+
mode: "CrewAI" | "MCP" | "LangGraph" | "Standard";
|
|
104
104
|
copilotKitVersion?: string | undefined;
|
|
105
105
|
chatUi?: "CopilotChat" | "CopilotSidebar" | "Headless" | "CopilotPopup" | undefined;
|
|
106
106
|
alreadyDeployed?: "Yes" | "No" | undefined;
|
|
@@ -119,7 +119,7 @@ declare const ConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
|
119
119
|
langSmithApiKey?: unknown;
|
|
120
120
|
llmToken?: unknown;
|
|
121
121
|
}>, {
|
|
122
|
-
|
|
122
|
+
mode: "CrewAI" | "MCP" | "LangGraph" | "Standard";
|
|
123
123
|
copilotKitVersion?: string | undefined;
|
|
124
124
|
chatUi?: "CopilotChat" | "CopilotSidebar" | "Headless" | "CopilotPopup" | undefined;
|
|
125
125
|
alreadyDeployed?: "Yes" | "No" | undefined;
|
|
@@ -138,7 +138,7 @@ declare const ConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
|
138
138
|
langSmithApiKey?: string | undefined;
|
|
139
139
|
llmToken?: string | undefined;
|
|
140
140
|
}, {
|
|
141
|
-
|
|
141
|
+
mode: "CrewAI" | "MCP" | "LangGraph" | "Standard";
|
|
142
142
|
copilotKitVersion?: string | undefined;
|
|
143
143
|
chatUi?: "CopilotChat" | "CopilotSidebar" | "Headless" | "CopilotPopup" | undefined;
|
|
144
144
|
alreadyDeployed?: "Yes" | "No" | undefined;
|
|
@@ -170,20 +170,18 @@ type Question = {
|
|
|
170
170
|
sanitize?: (input: string) => string;
|
|
171
171
|
};
|
|
172
172
|
declare const ConfigFlags: {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
llmToken: _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
|
|
186
|
-
crewFlowAgent: _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
|
|
173
|
+
booth: _oclif_core_interfaces.BooleanFlag<boolean>;
|
|
174
|
+
mode: _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
|
|
175
|
+
'copilotkit-version': _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
|
|
176
|
+
'use-copilot-cloud': _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
|
|
177
|
+
'langgraph-agent': _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
|
|
178
|
+
'crew-type': _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
|
|
179
|
+
'crew-name': _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
|
|
180
|
+
'crew-url': _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
|
|
181
|
+
'crew-bearer-token': _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
|
|
182
|
+
'langsmith-api-key': _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
|
|
183
|
+
'llm-token': _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
|
|
184
|
+
'crew-flow-agent': _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
|
|
187
185
|
};
|
|
188
186
|
|
|
189
|
-
export {
|
|
187
|
+
export { ApiKeySchema, CHAT_COMPONENTS, CREW_FLOW_TEMPLATES, CREW_TYPES, ChatComponentSchema, type Config, ConfigFlags, ConfigSchema, CrewFlowTemplateSchema, CrewTypeSchema, LANGGRAPH_AGENTS, LangGraphAgentSchema, MODES, ModeSchema, NameSchema, type Question, TokenSchema, UrlSchema, YES_NO, YesNoSchema, sanitizers };
|