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
|
@@ -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,24 +100,20 @@ 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
|
export {
|
|
118
|
-
AGENT_FRAMEWORKS,
|
|
119
|
-
AgentFrameworkSchema,
|
|
120
117
|
ApiKeySchema,
|
|
121
118
|
CHAT_COMPONENTS,
|
|
122
119
|
CREW_FLOW_TEMPLATES,
|
|
@@ -128,6 +125,8 @@ export {
|
|
|
128
125
|
CrewTypeSchema,
|
|
129
126
|
LANGGRAPH_AGENTS,
|
|
130
127
|
LangGraphAgentSchema,
|
|
128
|
+
MODES,
|
|
129
|
+
ModeSchema,
|
|
131
130
|
NameSchema,
|
|
132
131
|
TokenSchema,
|
|
133
132
|
UrlSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/init/types/questions.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/init/types/questions.ts","../../../../src/lib/init/utils.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}"],"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,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,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D,SAAS,OAAM,CAAC;AAAA,EAClH,mBAAmB,MAAM,OAAO,EAAC,aAAa,mCAAmC,SAAS,iBAAgB,CAAC;AAAA,EAC3G,aAAa,MAAM,OAAO,EAAC,aAAa,8BAA8B,SAAS,WAAU,CAAC;AAAA,EAC1F,aAAa,MAAM,OAAO,EAAC,aAAa,6BAA4B,CAAC;AAAA,EACrE,YAAY,MAAM,OAAO,EAAC,aAAa,qCAAoC,CAAC;AAAA,EAC5E,qBAAqB,MAAM,OAAO,EAAC,aAAa,yCAAwC,CAAC;AAAA,EACzF,qBAAqB,MAAM,OAAO,EAAC,aAAa,gDAA+C,CAAC;AAAA,EAChG,aAAa,MAAM,OAAO,EAAC,aAAa,0CAAyC,CAAC;AAAA,EAClF,mBAAmB,MAAM,OAAO,EAAC,aAAa,+BAA+B,SAAS,oBAAmB,CAAC;AAC5G;","names":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
type ChatTemplate =
|
|
2
|
-
type StarterTemplate =
|
|
1
|
+
type ChatTemplate = 'CopilotChat' | 'CopilotPopup' | 'CopilotSidebar';
|
|
2
|
+
type StarterTemplate = 'LangGraphPlatform' | 'RemoteEndpoint' | 'Standard' | 'CrewEnterprise' | 'CrewFlowsStarter';
|
|
3
3
|
type Template = ChatTemplate | StarterTemplate;
|
|
4
4
|
declare const templateMapping: {
|
|
5
5
|
RemoteEndpoint: string;
|
|
@@ -2,29 +2,24 @@
|
|
|
2
2
|
var BASE_URL = "https://registry.copilotkit.ai/r";
|
|
3
3
|
var templateMapping = {
|
|
4
4
|
// Runtimes
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
RemoteEndpoint: `${BASE_URL}/remote-endpoint-starter.json`,
|
|
6
|
+
LangGraphPlatformRuntime: `${BASE_URL}/langgraph-platform-starter.json`,
|
|
7
7
|
// CrewAI
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
],
|
|
11
|
-
"CrewFlowsStarter": [
|
|
8
|
+
CrewEnterprise: [`${BASE_URL}/coagents-crew-starter.json`],
|
|
9
|
+
CrewFlowsStarter: [
|
|
12
10
|
`${BASE_URL}/coagents-starter-ui.json`,
|
|
13
11
|
`${BASE_URL}/agent-layout.json`,
|
|
14
12
|
`${BASE_URL}/remote-endpoint.json`
|
|
15
13
|
],
|
|
16
14
|
// LangGraph
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
`${BASE_URL}/langgraph-platform-starter.json`,
|
|
20
|
-
`${BASE_URL}/coagents-starter-ui.json`
|
|
21
|
-
],
|
|
15
|
+
LangGraphGeneric: `${BASE_URL}/generic-lg-starter.json`,
|
|
16
|
+
LangGraphStarter: [`${BASE_URL}/langgraph-platform-starter.json`, `${BASE_URL}/coagents-starter-ui.json`],
|
|
22
17
|
// No Agent
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
StandardStarter: `${BASE_URL}/standard-starter.json`,
|
|
19
|
+
StandardRuntime: `${BASE_URL}/standard-runtime.json`,
|
|
25
20
|
// MCP
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
McpStarter: `${BASE_URL}/mcp-starter.json`,
|
|
22
|
+
McpRuntime: `${BASE_URL}/mcp-starter-runtime.json`
|
|
28
23
|
};
|
|
29
24
|
export {
|
|
30
25
|
templateMapping
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/init/types/templates.ts"],"sourcesContent":["export type ChatTemplate =
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/init/types/templates.ts"],"sourcesContent":["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":";AAWA,IAAM,WAAW;AAEV,IAAM,kBAAkB;AAAA;AAAA,EAE7B,gBAAgB,GAAG,QAAQ;AAAA,EAC3B,0BAA0B,GAAG,QAAQ;AAAA;AAAA,EAGrC,gBAAgB,CAAC,GAAG,QAAQ,6BAA6B;AAAA,EACzD,kBAAkB;AAAA,IAChB,GAAG,QAAQ;AAAA,IACX,GAAG,QAAQ;AAAA,IACX,GAAG,QAAQ;AAAA,EACb;AAAA;AAAA,EAGA,kBAAkB,GAAG,QAAQ;AAAA,EAC7B,kBAAkB,CAAC,GAAG,QAAQ,oCAAoC,GAAG,QAAQ,2BAA2B;AAAA;AAAA,EAGxG,iBAAiB,GAAG,QAAQ;AAAA,EAC5B,iBAAiB,GAAG,QAAQ;AAAA;AAAA,EAG5B,YAAY,GAAG,QAAQ;AAAA,EACvB,YAAY,GAAG,QAAQ;AACzB;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/init/utils.ts"],"sourcesContent":["export const isLocalhost = (url: string): boolean => {\n return url.includes('localhost') || url.includes('127.0.0.1') || url.includes('0.0.0.0');\n}"],"mappings":";AAAO,IAAM,cAAc,CAAC,QAAyB;AACnD,SAAO,IAAI,SAAS,WAAW,KAAK,IAAI,SAAS,WAAW,KAAK,IAAI,SAAS,SAAS;AACzF;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/services/analytics.service.ts"],"sourcesContent":["import {Analytics} from '@segment/analytics-node'\nimport {AnalyticsEvents} from './events.js'\nimport Conf from 'conf'\n\nexport class AnalyticsService {\n private segment: Analytics | undefined\n private globalProperties: Record<string, any> = {}\n private userId: string | undefined
|
|
1
|
+
{"version":3,"sources":["../../src/services/analytics.service.ts"],"sourcesContent":["import {Analytics} from '@segment/analytics-node'\nimport {AnalyticsEvents} from './events.js'\nimport Conf from 'conf'\n\nexport class AnalyticsService {\n private segment: Analytics | undefined\n private globalProperties: Record<string, any> = {}\n private userId: string | undefined\n private email: string | undefined\n private organizationId: string | undefined\n private config = new Conf({projectName: 'CopilotKitCLI'})\n\n constructor(\n private readonly authData?: {\n userId: string\n email: string\n organizationId: string\n },\n ) {\n if (process.env.SEGMENT_DISABLED === 'true') {\n return\n }\n\n const segmentWriteKey = process.env.SEGMENT_WRITE_KEY || '9Pv6QyExYef2P4hPz4gks6QAvNMi2AOf'\n\n this.globalProperties = {\n service: 'cli',\n }\n\n if (this.authData?.userId) {\n this.userId = this.authData.userId\n }\n\n if (this.authData?.email) {\n this.email = this.authData.email\n this.globalProperties.email = this.authData.email\n }\n\n if (this.authData?.organizationId) {\n this.organizationId = this.authData.organizationId\n }\n\n this.segment = new Analytics({\n writeKey: segmentWriteKey,\n disable: process.env.SEGMENT_DISABLE === 'true',\n })\n\n const config = new Conf({projectName: 'CopilotKitCLI'})\n if (!config.get('anonymousId')) {\n config.set('anonymousId', crypto.randomUUID())\n }\n }\n\n private getAnonymousId(): string {\n const anonymousId = this.config.get('anonymousId')\n if (!anonymousId) {\n const anonymousId = crypto.randomUUID()\n this.config.set('anonymousId', anonymousId)\n return anonymousId\n }\n\n return anonymousId as string\n }\n\n public track<K extends keyof AnalyticsEvents>(\n event: Omit<Parameters<Analytics['track']>[0], 'userId'> & {\n event: K\n properties: AnalyticsEvents[K]\n },\n ): Promise<void> {\n if (!this.segment) {\n return Promise.resolve()\n }\n\n const payload = {\n userId: this.userId ? this.userId : undefined,\n email: this.email ? this.email : undefined,\n anonymousId: this.getAnonymousId(),\n event: event.event,\n properties: {\n ...this.globalProperties,\n ...event.properties,\n $groups: this.organizationId\n ? {\n segment_group: this.organizationId,\n }\n : undefined,\n eventProperties: {\n ...event.properties,\n ...this.globalProperties,\n },\n },\n }\n\n return new Promise((resolve, reject) => {\n this.segment!.track(payload, (err) => {\n if (err) {\n // Resolve anyway\n resolve()\n }\n\n resolve()\n })\n })\n }\n}\n"],"mappings":";AAAA,SAAQ,iBAAgB;AAExB,OAAO,UAAU;AAEV,IAAM,mBAAN,MAAuB;AAAA,EAQ5B,YACmB,UAKjB;AALiB;AAMjB,QAAI,QAAQ,IAAI,qBAAqB,QAAQ;AAC3C;AAAA,IACF;AAEA,UAAM,kBAAkB,QAAQ,IAAI,qBAAqB;AAEzD,SAAK,mBAAmB;AAAA,MACtB,SAAS;AAAA,IACX;AAEA,QAAI,KAAK,UAAU,QAAQ;AACzB,WAAK,SAAS,KAAK,SAAS;AAAA,IAC9B;AAEA,QAAI,KAAK,UAAU,OAAO;AACxB,WAAK,QAAQ,KAAK,SAAS;AAC3B,WAAK,iBAAiB,QAAQ,KAAK,SAAS;AAAA,IAC9C;AAEA,QAAI,KAAK,UAAU,gBAAgB;AACjC,WAAK,iBAAiB,KAAK,SAAS;AAAA,IACtC;AAEA,SAAK,UAAU,IAAI,UAAU;AAAA,MAC3B,UAAU;AAAA,MACV,SAAS,QAAQ,IAAI,oBAAoB;AAAA,IAC3C,CAAC;AAED,UAAM,SAAS,IAAI,KAAK,EAAC,aAAa,gBAAe,CAAC;AACtD,QAAI,CAAC,OAAO,IAAI,aAAa,GAAG;AAC9B,aAAO,IAAI,eAAe,OAAO,WAAW,CAAC;AAAA,IAC/C;AAAA,EACF;AAAA,EA9CQ;AAAA,EACA,mBAAwC,CAAC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS,IAAI,KAAK,EAAC,aAAa,gBAAe,CAAC;AAAA,EA2ChD,iBAAyB;AAC/B,UAAM,cAAc,KAAK,OAAO,IAAI,aAAa;AACjD,QAAI,CAAC,aAAa;AAChB,YAAMA,eAAc,OAAO,WAAW;AACtC,WAAK,OAAO,IAAI,eAAeA,YAAW;AAC1C,aAAOA;AAAA,IACT;AAEA,WAAO;AAAA,EACT;AAAA,EAEO,MACL,OAIe;AACf,QAAI,CAAC,KAAK,SAAS;AACjB,aAAO,QAAQ,QAAQ;AAAA,IACzB;AAEA,UAAM,UAAU;AAAA,MACd,QAAQ,KAAK,SAAS,KAAK,SAAS;AAAA,MACpC,OAAO,KAAK,QAAQ,KAAK,QAAQ;AAAA,MACjC,aAAa,KAAK,eAAe;AAAA,MACjC,OAAO,MAAM;AAAA,MACb,YAAY;AAAA,QACV,GAAG,KAAK;AAAA,QACR,GAAG,MAAM;AAAA,QACT,SAAS,KAAK,iBACV;AAAA,UACE,eAAe,KAAK;AAAA,QACtB,IACA;AAAA,QACJ,iBAAiB;AAAA,UACf,GAAG,MAAM;AAAA,UACT,GAAG,KAAK;AAAA,QACV;AAAA,MACF;AAAA,IACF;AAEA,WAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,WAAK,QAAS,MAAM,SAAS,CAAC,QAAQ;AACpC,YAAI,KAAK;AAEP,kBAAQ;AAAA,QACV;AAEA,gBAAQ;AAAA,MACV,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;","names":["anonymousId"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/services/auth.service.ts","../../src/utils/trpc.ts","../../src/services/analytics.service.ts"],"sourcesContent":["// @ts-ignore\nimport Conf from 'conf'\nimport cors from 'cors'\nimport express from 'express'\nimport crypto from 'node:crypto'\nimport open from 'open'\nimport getPort from 'get-port'\nimport ora from 'ora'\nimport chalk from 'chalk'\nimport inquirer from 'inquirer'\nimport {Command} from '@oclif/core'\nimport {createTRPCClient} from '../utils/trpc.js'\nimport {AnalyticsService} from '../services/analytics.service.js'\nimport { BaseCommand } from '../commands/base-command.js'\n\ninterface LoginResponse {\n cliToken: string\n user: {\n email: string\n id: string\n }\n organization: {\n id: string\n }\n}\n\nexport class AuthService {\n private readonly config = new Conf({projectName: 'CopilotKitCLI'})\n private readonly COPILOT_CLOUD_BASE_URL = process.env.COPILOT_CLOUD_BASE_URL || 'https://cloud.copilotkit.ai'\n\n getToken(): string | undefined {\n return this.config.get('cliToken') as string | undefined\n }\n\n getCLIToken(): string | undefined {\n const cliToken = this.config.get('cliToken') as string | undefined\n return cliToken\n }\n\n async logout(cmd: BaseCommand): Promise<void> {\n this.config.delete('cliToken')\n }\n\n async requireLogin(cmd: Command): Promise<LoginResponse> {\n let cliToken = this.getCLIToken()\n // Check authentication\n if (!cliToken) {\n try {\n const {shouldLogin} = await inquirer.prompt([\n {\n name: 'shouldLogin',\n type: 'confirm',\n message: '🪁 You are not yet authenticated. Authenticate with Copilot Cloud? (press Enter to confirm)',\n default: true,\n },\n ])\n if (shouldLogin) {\n const loginResult = await this.login({exitAfterLogin: false})\n cliToken = loginResult.cliToken\n return loginResult\n } else {\n cmd.error('Authentication required to proceed.')\n }\n } catch (error) {\n if (error instanceof Error && error.name === 'ExitPromptError') {\n cmd.error(chalk.yellow('\\nAuthentication cancelled'))\n }\n\n throw error\n }\n }\n\n let me\n\n const trpcClient = createTRPCClient(cliToken)\n try {\n me = await trpcClient.me.query()\n } catch (error) {\n cmd.log(chalk.red('Could not authenticate with Copilot Cloud. Please try again.'))\n process.exit(1)\n }\n\n if (!me.organization || !me.user) {\n cmd.error('Authentication required to proceed.')\n }\n\n return {cliToken, user: me.user, organization: me.organization}\n }\n\n async login({exitAfterLogin}: {exitAfterLogin?: boolean} = {exitAfterLogin: true}): Promise<LoginResponse> {\n const spinner = ora(\"🪁 Opening browser for authentication...\").start()\n let analytics: AnalyticsService\n analytics = new AnalyticsService()\n\n const app = express()\n app.use(cors())\n app.use(express.urlencoded({extended: true}))\n app.use(express.json())\n\n const port = await getPort()\n const state = crypto.randomBytes(16).toString('hex')\n\n return new Promise(async (resolve) => {\n const server = app.listen(port, () => {})\n\n await analytics.track({\n event: 'cli.login.initiated',\n properties: {},\n })\n\n spinner.text = '🪁 Waiting for browser authentication to complete...'\n\n app.post('/callback', async (req, res) => {\n const {cliToken, user, organization} = req.body\n\n analytics = new AnalyticsService({userId: user.id, organizationId: organization.id, email: user.email})\n await analytics.track({\n event: 'cli.login.success',\n properties: {\n organizationId: organization.id,\n userId: user.id,\n email: user.email,\n },\n })\n\n if (state !== req.query.state) {\n res.status(401).json({message: 'Invalid state'})\n spinner.fail('Invalid state')\n return\n }\n\n this.config.set('cliToken', cliToken)\n res.status(200).json({message: 'Callback called'})\n spinner.succeed(`🪁 Successfully logged in as ${chalk.hex('#7553fc')(user.email)}`)\n if (exitAfterLogin) {\n process.exit(0)\n } else {\n server.close();\n resolve({cliToken, user, organization});\n }\n })\n\n open(`${this.COPILOT_CLOUD_BASE_URL}/cli-auth?callbackUrl=http://localhost:${port}/callback&state=${state}`)\n })\n }\n}\n","import {createTRPCClient as trpcClient, httpBatchLink} from '@trpc/client'\nimport superjson from 'superjson'\n\nexport const COPILOT_CLOUD_BASE_URL = process.env.COPILOT_CLOUD_BASE_URL || 'https://cloud.copilotkit.ai'\n\nexport function createTRPCClient(cliToken: string): any {\n return trpcClient({\n links: [\n httpBatchLink({\n url: `${COPILOT_CLOUD_BASE_URL}/api/trpc-cli`,\n transformer: superjson,\n headers: () => {\n return {\n 'x-trpc-source': 'cli',\n 'x-cli-token': cliToken,\n }\n },\n }),\n ],\n })\n}\n","import {Analytics} from '@segment/analytics-node'\nimport {AnalyticsEvents} from './events.js'\nimport Conf from 'conf'\n\nexport class AnalyticsService {\n private segment: Analytics | undefined\n private globalProperties: Record<string, any> = {}\n private userId: string | undefined;\n private email: string | undefined;\n private organizationId: string | undefined;\n private config = new Conf({projectName: 'CopilotKitCLI'})\n\n constructor(private readonly authData?: {\n userId: string,\n email: string,\n organizationId: string,\n }) {\n if (process.env.SEGMENT_DISABLED === 'true') {\n return;\n }\n\n const segmentWriteKey = process.env.SEGMENT_WRITE_KEY || \"9Pv6QyExYef2P4hPz4gks6QAvNMi2AOf\"\n\n this.globalProperties = {\n service: 'cli',\n }\n\n\n if (this.authData?.userId) {\n this.userId = this.authData.userId\n }\n\n if (this.authData?.email) {\n this.email = this.authData.email\n this.globalProperties.email = this.authData.email\n }\n\n if (this.authData?.organizationId) {\n this.organizationId = this.authData.organizationId\n }\n\n this.segment = new Analytics({\n writeKey: segmentWriteKey,\n disable: process.env.SEGMENT_DISABLE === 'true',\n })\n\n const config = new Conf({projectName: 'CopilotKitCLI'})\n if (!config.get('anonymousId')) {\n config.set('anonymousId', crypto.randomUUID())\n }\n }\n\n private getAnonymousId(): string {\n const anonymousId = this.config.get('anonymousId')\n if (!anonymousId) {\n const anonymousId = crypto.randomUUID()\n this.config.set('anonymousId', anonymousId)\n return anonymousId\n }\n\n return anonymousId as string;\n }\n\n public track<K extends keyof AnalyticsEvents>(\n event: Omit<Parameters<Analytics['track']>[0], 'userId'> & {\n event: K\n properties: AnalyticsEvents[K]\n },\n ): Promise<void> {\n if (!this.segment) {\n return Promise.resolve();\n }\n\n const payload = {\n userId: this.userId ? this.userId : undefined,\n email: this.email ? this.email : undefined,\n anonymousId: this.getAnonymousId(),\n event: event.event,\n properties: {\n ...this.globalProperties,\n ...event.properties,\n $groups: this.organizationId ? {\n segment_group: this.organizationId,\n } : undefined,\n eventProperties: {\n ...event.properties,\n ...this.globalProperties,\n },\n },\n }\n\n return new Promise((resolve, reject) => {\n this.segment!.track(payload, (err) => {\n if (err) {\n // Resolve anyway\n resolve();\n }\n\n resolve();\n })\n });\n }\n}\n"],"mappings":";AACA,OAAOA,WAAU;AACjB,OAAO,UAAU;AACjB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;AAAA,QAChB,OAAO;AACL,iBAAO,MAAM;AACb,kBAAQ,EAAC,UAAU,MAAM,aAAY,CAAC;AAAA,QACxC;AAAA,MACF,CAAC;AAED,WAAK,GAAG,KAAK,sBAAsB,0CAA0C,IAAI,mBAAmB,KAAK,EAAE;AAAA,IAC7G,CAAC;AAAA,EACH;AACF;","names":["Conf","crypto","anonymousId","Conf","trpcClient","crypto"]}
|
|
1
|
+
{"version":3,"sources":["../../src/services/auth.service.ts","../../src/utils/trpc.ts","../../src/services/analytics.service.ts"],"sourcesContent":["// @ts-ignore\nimport Conf from 'conf'\nimport cors from 'cors'\nimport express from 'express'\nimport crypto from 'node:crypto'\nimport open from 'open'\nimport getPort from 'get-port'\nimport ora from 'ora'\nimport chalk from 'chalk'\nimport inquirer from 'inquirer'\nimport {Command} from '@oclif/core'\nimport {createTRPCClient} from '../utils/trpc.js'\nimport {AnalyticsService} from '../services/analytics.service.js'\nimport {BaseCommand} from '../commands/base-command.js'\n\ninterface LoginResponse {\n cliToken: string\n user: {\n email: string\n id: string\n }\n organization: {\n id: string\n }\n}\n\nexport class AuthService {\n private readonly config = new Conf({projectName: 'CopilotKitCLI'})\n private readonly COPILOT_CLOUD_BASE_URL = process.env.COPILOT_CLOUD_BASE_URL || 'https://cloud.copilotkit.ai'\n\n getToken(): string | undefined {\n return this.config.get('cliToken') as string | undefined\n }\n\n getCLIToken(): string | undefined {\n const cliToken = this.config.get('cliToken') as string | undefined\n return cliToken\n }\n\n async logout(cmd: BaseCommand): Promise<void> {\n this.config.delete('cliToken')\n }\n\n async requireLogin(cmd: Command): Promise<LoginResponse> {\n let cliToken = this.getCLIToken()\n // Check authentication\n if (!cliToken) {\n try {\n const {shouldLogin} = await inquirer.prompt([\n {\n name: 'shouldLogin',\n type: 'confirm',\n message: '🪁 You are not yet authenticated. Authenticate with Copilot Cloud? (press Enter to confirm)',\n default: true,\n },\n ])\n if (shouldLogin) {\n const loginResult = await this.login({exitAfterLogin: false})\n cliToken = loginResult.cliToken\n return loginResult\n } else {\n cmd.error('Authentication required to proceed.')\n }\n } catch (error) {\n if (error instanceof Error && error.name === 'ExitPromptError') {\n cmd.error(chalk.yellow('\\nAuthentication cancelled'))\n }\n\n throw error\n }\n }\n\n let me\n\n const trpcClient = createTRPCClient(cliToken)\n try {\n me = await trpcClient.me.query()\n } catch (error) {\n cmd.log(chalk.red('Could not authenticate with Copilot Cloud. Please try again.'))\n process.exit(1)\n }\n\n if (!me.organization || !me.user) {\n cmd.error('Authentication required to proceed.')\n }\n\n return {cliToken, user: me.user, organization: me.organization}\n }\n\n async login({exitAfterLogin}: {exitAfterLogin?: boolean} = {exitAfterLogin: true}): Promise<LoginResponse> {\n const spinner = ora('🪁 Opening browser for authentication...').start()\n let analytics: AnalyticsService\n analytics = new AnalyticsService()\n\n const app = express()\n app.use(cors())\n app.use(express.urlencoded({extended: true}))\n app.use(express.json())\n\n const port = await getPort()\n const state = crypto.randomBytes(16).toString('hex')\n\n return new Promise(async (resolve) => {\n const server = app.listen(port, () => {})\n\n await analytics.track({\n event: 'cli.login.initiated',\n properties: {},\n })\n\n spinner.text = '🪁 Waiting for browser authentication to complete...'\n\n app.post('/callback', async (req, res) => {\n const {cliToken, user, organization} = req.body\n\n analytics = new AnalyticsService({userId: user.id, organizationId: organization.id, email: user.email})\n await analytics.track({\n event: 'cli.login.success',\n properties: {\n organizationId: organization.id,\n userId: user.id,\n email: user.email,\n },\n })\n\n if (state !== req.query.state) {\n res.status(401).json({message: 'Invalid state'})\n spinner.fail('Invalid state')\n return\n }\n\n this.config.set('cliToken', cliToken)\n res.status(200).json({message: 'Callback called'})\n spinner.succeed(`🪁 Successfully logged in as ${chalk.hex('#7553fc')(user.email)}`)\n if (exitAfterLogin) {\n process.exit(0)\n } else {\n server.close()\n resolve({cliToken, user, organization})\n }\n })\n\n open(`${this.COPILOT_CLOUD_BASE_URL}/cli-auth?callbackUrl=http://localhost:${port}/callback&state=${state}`)\n })\n }\n}\n","import {createTRPCClient as trpcClient, httpBatchLink} from '@trpc/client'\nimport superjson from 'superjson'\n\nexport const COPILOT_CLOUD_BASE_URL = process.env.COPILOT_CLOUD_BASE_URL || 'https://cloud.copilotkit.ai'\n\nexport function createTRPCClient(cliToken: string): any {\n return trpcClient({\n links: [\n httpBatchLink({\n url: `${COPILOT_CLOUD_BASE_URL}/api/trpc-cli`,\n transformer: superjson,\n headers: () => {\n return {\n 'x-trpc-source': 'cli',\n 'x-cli-token': cliToken,\n }\n },\n }),\n ],\n })\n}\n","import {Analytics} from '@segment/analytics-node'\nimport {AnalyticsEvents} from './events.js'\nimport Conf from 'conf'\n\nexport class AnalyticsService {\n private segment: Analytics | undefined\n private globalProperties: Record<string, any> = {}\n private userId: string | undefined\n private email: string | undefined\n private organizationId: string | undefined\n private config = new Conf({projectName: 'CopilotKitCLI'})\n\n constructor(\n private readonly authData?: {\n userId: string\n email: string\n organizationId: string\n },\n ) {\n if (process.env.SEGMENT_DISABLED === 'true') {\n return\n }\n\n const segmentWriteKey = process.env.SEGMENT_WRITE_KEY || '9Pv6QyExYef2P4hPz4gks6QAvNMi2AOf'\n\n this.globalProperties = {\n service: 'cli',\n }\n\n if (this.authData?.userId) {\n this.userId = this.authData.userId\n }\n\n if (this.authData?.email) {\n this.email = this.authData.email\n this.globalProperties.email = this.authData.email\n }\n\n if (this.authData?.organizationId) {\n this.organizationId = this.authData.organizationId\n }\n\n this.segment = new Analytics({\n writeKey: segmentWriteKey,\n disable: process.env.SEGMENT_DISABLE === 'true',\n })\n\n const config = new Conf({projectName: 'CopilotKitCLI'})\n if (!config.get('anonymousId')) {\n config.set('anonymousId', crypto.randomUUID())\n }\n }\n\n private getAnonymousId(): string {\n const anonymousId = this.config.get('anonymousId')\n if (!anonymousId) {\n const anonymousId = crypto.randomUUID()\n this.config.set('anonymousId', anonymousId)\n return anonymousId\n }\n\n return anonymousId as string\n }\n\n public track<K extends keyof AnalyticsEvents>(\n event: Omit<Parameters<Analytics['track']>[0], 'userId'> & {\n event: K\n properties: AnalyticsEvents[K]\n },\n ): Promise<void> {\n if (!this.segment) {\n return Promise.resolve()\n }\n\n const payload = {\n userId: this.userId ? this.userId : undefined,\n email: this.email ? this.email : undefined,\n anonymousId: this.getAnonymousId(),\n event: event.event,\n properties: {\n ...this.globalProperties,\n ...event.properties,\n $groups: this.organizationId\n ? {\n segment_group: this.organizationId,\n }\n : undefined,\n eventProperties: {\n ...event.properties,\n ...this.globalProperties,\n },\n },\n }\n\n return new Promise((resolve, reject) => {\n this.segment!.track(payload, (err) => {\n if (err) {\n // Resolve anyway\n resolve()\n }\n\n resolve()\n })\n })\n }\n}\n"],"mappings":";AACA,OAAOA,WAAU;AACjB,OAAO,UAAU;AACjB,OAAO,aAAa;AACpB,OAAOC,aAAY;AACnB,OAAO,UAAU;AACjB,OAAO,aAAa;AACpB,OAAO,SAAS;AAChB,OAAO,WAAW;AAClB,OAAO,cAAc;;;ACTrB,SAAQ,oBAAoB,YAAY,qBAAoB;AAC5D,OAAO,eAAe;AAEf,IAAM,yBAAyB,QAAQ,IAAI,0BAA0B;AAErE,SAAS,iBAAiB,UAAuB;AACtD,SAAO,WAAW;AAAA,IAChB,OAAO;AAAA,MACL,cAAc;AAAA,QACZ,KAAK,GAAG,sBAAsB;AAAA,QAC9B,aAAa;AAAA,QACb,SAAS,MAAM;AACb,iBAAO;AAAA,YACL,iBAAiB;AAAA,YACjB,eAAe;AAAA,UACjB;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACH;;;ACpBA,SAAQ,iBAAgB;AAExB,OAAO,UAAU;AAEV,IAAM,mBAAN,MAAuB;AAAA,EAQ5B,YACmB,UAKjB;AALiB;AAMjB,QAAI,QAAQ,IAAI,qBAAqB,QAAQ;AAC3C;AAAA,IACF;AAEA,UAAM,kBAAkB,QAAQ,IAAI,qBAAqB;AAEzD,SAAK,mBAAmB;AAAA,MACtB,SAAS;AAAA,IACX;AAEA,QAAI,KAAK,UAAU,QAAQ;AACzB,WAAK,S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AK;AAAA,YACb,OAAO,KAAK;AAAA,UACd;AAAA,QACF,CAAC;AAED,YAAI,UAAU,IAAI,MAAM,OAAO;AAC7B,cAAI,OAAO,GAAG,EAAE,KAAK,EAAC,SAAS,gBAAe,CAAC;AAC/C,kBAAQ,KAAK,eAAe;AAC5B;AAAA,QACF;AAEA,aAAK,OAAO,IAAI,YAAY,QAAQ;AACpC,YAAI,OAAO,GAAG,EAAE,KAAK,EAAC,SAAS,kBAAiB,CAAC;AACjD,gBAAQ,QAAQ,uCAAgC,MAAM,IAAI,SAAS,EAAE,KAAK,KAAK,CAAC,EAAE;AAClF,YAAI,gBAAgB;AAClB,kBAAQ,KAAK,CAAC;AAAA,QAChB,OAAO;AACL,iBAAO,MAAM;AACb,kBAAQ,EAAC,UAAU,MAAM,aAAY,CAAC;AAAA,QACxC;AAAA,MACF,CAAC;AAED,WAAK,GAAG,KAAK,sBAAsB,0CAA0C,IAAI,mBAAmB,KAAK,EAAE;AAAA,IAC7G,CAAC;AAAA,EACH;AACF;","names":["Conf","crypto","anonymousId","Conf","trpcClient","crypto"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/services/tunnel.service.ts"],"sourcesContent":["import type {Tunnel} from 'localtunnel'\n\nimport axios from 'axios'\nimport localtunnel from 'localtunnel'\n\nexport interface TunnelOptions {\n port: number\n subdomain?: string\n}\n\nexport class TunnelService {\n private readonly META_DATA_URL = 'https://metadata-cdn.copilotkit.ai/cloud.config.json'\n\n async create(options: TunnelOptions): Promise<Tunnel> {\n
|
|
1
|
+
{"version":3,"sources":["../../src/services/tunnel.service.ts"],"sourcesContent":["import type {Tunnel} from 'localtunnel'\n\nimport axios from 'axios'\nimport localtunnel from 'localtunnel'\n\nexport interface TunnelOptions {\n port: number\n subdomain?: string\n}\n\nexport class TunnelService {\n private readonly META_DATA_URL = 'https://metadata-cdn.copilotkit.ai/cloud.config.json'\n\n async create(options: TunnelOptions): Promise<Tunnel> {\n const metadata = await this.getMetaData()\n\n return localtunnel({\n ...options,\n host: metadata.tunnelHost,\n })\n }\n\n async getMetaData() {\n const response = await axios.get<{\n tunnelHost: string\n }>(this.META_DATA_URL)\n return response.data\n }\n}\n"],"mappings":";AAEA,OAAO,WAAW;AAClB,OAAO,iBAAiB;AAOjB,IAAM,gBAAN,MAAoB;AAAA,EACR,gBAAgB;AAAA,EAEjC,MAAM,OAAO,SAAyC;AACpD,UAAM,WAAW,MAAM,KAAK,YAAY;AAExC,WAAO,YAAY;AAAA,MACjB,GAAG;AAAA,MACH,MAAM,SAAS;AAAA,IACjB,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,cAAc;AAClB,UAAM,WAAW,MAAM,MAAM,IAE1B,KAAK,aAAa;AACrB,WAAO,SAAS;AAAA,EAClB;AACF;","names":[]}
|
|
@@ -5,7 +5,7 @@ declare enum RemoteEndpointType {
|
|
|
5
5
|
MCP = "MCP",
|
|
6
6
|
Invalid = "Invalid"
|
|
7
7
|
}
|
|
8
|
-
declare const getHumanReadableEndpointType: (type: RemoteEndpointType) => "
|
|
8
|
+
declare const getHumanReadableEndpointType: (type: RemoteEndpointType) => "LangGraph Platform" | "CopilotKit" | "CrewAI" | "MCP" | "Invalid";
|
|
9
9
|
declare function detectRemoteEndpointType(url: string): Promise<{
|
|
10
10
|
url: string;
|
|
11
11
|
type: RemoteEndpointType;
|
package/dist/utils/version.d.ts
CHANGED
package/dist/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/version.ts"],"sourcesContent":["// This is auto generated!\nexport const LIB_VERSION = \"0.0.
|
|
1
|
+
{"version":3,"sources":["../../src/utils/version.ts"],"sourcesContent":["// This is auto generated!\nexport const LIB_VERSION = \"0.0.33\";\n"],"mappings":";AACO,IAAM,cAAc;","names":[]}
|
package/oclif.manifest.json
CHANGED
|
@@ -65,47 +65,37 @@
|
|
|
65
65
|
"<%= config.bin %> init"
|
|
66
66
|
],
|
|
67
67
|
"flags": {
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"type": "
|
|
74
|
-
},
|
|
75
|
-
"copilotKitVersion": {
|
|
76
|
-
"description": "CopilotKit version to use (e.g. 1.7.0)",
|
|
77
|
-
"name": "copilotKitVersion",
|
|
78
|
-
"hasDynamicHelp": false,
|
|
79
|
-
"multiple": false,
|
|
80
|
-
"type": "option"
|
|
68
|
+
"booth": {
|
|
69
|
+
"char": "b",
|
|
70
|
+
"description": "Use CopilotKit in booth mode",
|
|
71
|
+
"name": "booth",
|
|
72
|
+
"allowNo": false,
|
|
73
|
+
"type": "boolean"
|
|
81
74
|
},
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
75
|
+
"mode": {
|
|
76
|
+
"char": "m",
|
|
77
|
+
"description": "How you will be interacting with AI",
|
|
78
|
+
"name": "mode",
|
|
85
79
|
"hasDynamicHelp": false,
|
|
86
80
|
"multiple": false,
|
|
87
81
|
"options": [
|
|
88
82
|
"CrewAI",
|
|
89
83
|
"LangGraph",
|
|
90
84
|
"MCP",
|
|
91
|
-
"
|
|
85
|
+
"Standard"
|
|
92
86
|
],
|
|
93
87
|
"type": "option"
|
|
94
88
|
},
|
|
95
|
-
"
|
|
96
|
-
"description": "
|
|
97
|
-
"name": "
|
|
89
|
+
"copilotkit-version": {
|
|
90
|
+
"description": "CopilotKit version to use (e.g. 1.7.0)",
|
|
91
|
+
"name": "copilotkit-version",
|
|
98
92
|
"hasDynamicHelp": false,
|
|
99
93
|
"multiple": false,
|
|
100
|
-
"options": [
|
|
101
|
-
"Yes",
|
|
102
|
-
"No"
|
|
103
|
-
],
|
|
104
94
|
"type": "option"
|
|
105
95
|
},
|
|
106
|
-
"
|
|
96
|
+
"use-copilot-cloud": {
|
|
107
97
|
"description": "Use Copilot Cloud for production-ready hosting",
|
|
108
|
-
"name": "
|
|
98
|
+
"name": "use-copilot-cloud",
|
|
109
99
|
"hasDynamicHelp": false,
|
|
110
100
|
"multiple": false,
|
|
111
101
|
"options": [
|
|
@@ -114,22 +104,9 @@
|
|
|
114
104
|
],
|
|
115
105
|
"type": "option"
|
|
116
106
|
},
|
|
117
|
-
"
|
|
118
|
-
"description": "Chat UI component to add to your app",
|
|
119
|
-
"name": "chatUi",
|
|
120
|
-
"hasDynamicHelp": false,
|
|
121
|
-
"multiple": false,
|
|
122
|
-
"options": [
|
|
123
|
-
"CopilotChat",
|
|
124
|
-
"CopilotSidebar",
|
|
125
|
-
"Headless",
|
|
126
|
-
"CopilotPopup"
|
|
127
|
-
],
|
|
128
|
-
"type": "option"
|
|
129
|
-
},
|
|
130
|
-
"langGraphAgent": {
|
|
107
|
+
"langgraph-agent": {
|
|
131
108
|
"description": "LangGraph agent template to use",
|
|
132
|
-
"name": "
|
|
109
|
+
"name": "langgraph-agent",
|
|
133
110
|
"hasDynamicHelp": false,
|
|
134
111
|
"multiple": false,
|
|
135
112
|
"options": [
|
|
@@ -138,9 +115,9 @@
|
|
|
138
115
|
],
|
|
139
116
|
"type": "option"
|
|
140
117
|
},
|
|
141
|
-
"
|
|
118
|
+
"crew-type": {
|
|
142
119
|
"description": "CrewAI implementation type",
|
|
143
|
-
"name": "
|
|
120
|
+
"name": "crew-type",
|
|
144
121
|
"hasDynamicHelp": false,
|
|
145
122
|
"multiple": false,
|
|
146
123
|
"options": [
|
|
@@ -149,44 +126,44 @@
|
|
|
149
126
|
],
|
|
150
127
|
"type": "option"
|
|
151
128
|
},
|
|
152
|
-
"
|
|
129
|
+
"crew-name": {
|
|
153
130
|
"description": "Name for your CrewAI agent",
|
|
154
|
-
"name": "
|
|
131
|
+
"name": "crew-name",
|
|
155
132
|
"hasDynamicHelp": false,
|
|
156
133
|
"multiple": false,
|
|
157
134
|
"type": "option"
|
|
158
135
|
},
|
|
159
|
-
"
|
|
136
|
+
"crew-url": {
|
|
160
137
|
"description": "URL endpoint for your CrewAI agent",
|
|
161
|
-
"name": "
|
|
138
|
+
"name": "crew-url",
|
|
162
139
|
"hasDynamicHelp": false,
|
|
163
140
|
"multiple": false,
|
|
164
141
|
"type": "option"
|
|
165
142
|
},
|
|
166
|
-
"
|
|
143
|
+
"crew-bearer-token": {
|
|
167
144
|
"description": "Bearer token for CrewAI authentication",
|
|
168
|
-
"name": "
|
|
145
|
+
"name": "crew-bearer-token",
|
|
169
146
|
"hasDynamicHelp": false,
|
|
170
147
|
"multiple": false,
|
|
171
148
|
"type": "option"
|
|
172
149
|
},
|
|
173
|
-
"
|
|
150
|
+
"langsmith-api-key": {
|
|
174
151
|
"description": "LangSmith API key for LangGraph observability",
|
|
175
|
-
"name": "
|
|
152
|
+
"name": "langsmith-api-key",
|
|
176
153
|
"hasDynamicHelp": false,
|
|
177
154
|
"multiple": false,
|
|
178
155
|
"type": "option"
|
|
179
156
|
},
|
|
180
|
-
"
|
|
157
|
+
"llm-token": {
|
|
181
158
|
"description": "API key for your preferred LLM provider",
|
|
182
|
-
"name": "
|
|
159
|
+
"name": "llm-token",
|
|
183
160
|
"hasDynamicHelp": false,
|
|
184
161
|
"multiple": false,
|
|
185
162
|
"type": "option"
|
|
186
163
|
},
|
|
187
|
-
"
|
|
164
|
+
"crew-flow-agent": {
|
|
188
165
|
"description": "CrewAI Flow template to use",
|
|
189
|
-
"name": "
|
|
166
|
+
"name": "crew-flow-agent",
|
|
190
167
|
"hasDynamicHelp": false,
|
|
191
168
|
"multiple": false,
|
|
192
169
|
"options": [
|
|
@@ -276,5 +253,5 @@
|
|
|
276
253
|
]
|
|
277
254
|
}
|
|
278
255
|
},
|
|
279
|
-
"version": "0.0.
|
|
256
|
+
"version": "0.0.33"
|
|
280
257
|
}
|