copilotkit 1.54.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +90052 -0
- package/package.json +4 -114
- package/src/commands/docs.d.ts +17 -0
- package/src/commands/docs.d.ts.map +1 -0
- package/src/commands/init.d.ts +103 -0
- package/src/commands/init.d.ts.map +1 -0
- package/src/commands/kite.d.ts +8 -0
- package/src/commands/kite.d.ts.map +1 -0
- package/src/commands/license.d.ts +17 -0
- package/src/commands/license.d.ts.map +1 -0
- package/src/commands/login.d.ts +13 -0
- package/src/commands/login.d.ts.map +1 -0
- package/src/commands/logs.d.ts +32 -0
- package/src/commands/logs.d.ts.map +1 -0
- package/src/commands/version.d.ts +8 -0
- package/src/commands/version.d.ts.map +1 -0
- package/src/config.d.ts +31 -0
- package/src/config.d.ts.map +1 -0
- package/src/index.d.ts +21 -0
- package/src/index.d.ts.map +1 -0
- package/src/services/agentcore-config.d.ts +34 -0
- package/src/services/agentcore-config.d.ts.map +1 -0
- package/src/services/api-client.d.ts +106 -0
- package/src/services/api-client.d.ts.map +1 -0
- package/src/services/auth.service.d.ts +107 -0
- package/src/services/auth.service.d.ts.map +1 -0
- package/src/services/cli-auth-diagnostics.d.ts +71 -0
- package/src/services/cli-auth-diagnostics.d.ts.map +1 -0
- package/src/services/cli-logs.d.ts +45 -0
- package/src/services/cli-logs.d.ts.map +1 -0
- package/src/services/config.service.d.ts +53 -0
- package/src/services/config.service.d.ts.map +1 -0
- package/src/services/feature-flags.d.ts +14 -0
- package/src/services/feature-flags.d.ts.map +1 -0
- package/src/services/kite-game-engine.d.ts +99 -0
- package/src/services/kite-game-engine.d.ts.map +1 -0
- package/src/services/kite-game-score.d.ts +33 -0
- package/src/services/kite-game-score.d.ts.map +1 -0
- package/src/services/project-scaffold.d.ts +49 -0
- package/src/services/project-scaffold.d.ts.map +1 -0
- package/src/services/showcase-config.d.ts +19 -0
- package/src/services/showcase-config.d.ts.map +1 -0
- package/src/types.d.ts +227 -0
- package/src/types.d.ts.map +1 -0
- package/src/ui/banner.d.ts +3 -0
- package/src/ui/banner.d.ts.map +1 -0
- package/src/ui/browser-login.d.ts +71 -0
- package/src/ui/browser-login.d.ts.map +1 -0
- package/src/ui/init-flow.d.ts +35 -0
- package/src/ui/init-flow.d.ts.map +1 -0
- package/src/ui/kite-game.d.ts +26 -0
- package/src/ui/kite-game.d.ts.map +1 -0
- package/src/ui/login-flow.d.ts +22 -0
- package/src/ui/login-flow.d.ts.map +1 -0
- package/src/ui/spinner.d.ts +9 -0
- package/src/ui/spinner.d.ts.map +1 -0
- package/LICENSE +0 -21
- package/README.md +0 -83
- package/bin/dev.cmd +0 -3
- package/bin/dev.js +0 -8
- package/bin/run.cmd +0 -3
- package/bin/run.js +0 -17
- package/dist/commands/base-command.d.ts +0 -12
- package/dist/commands/base-command.js +0 -65
- package/dist/commands/base-command.js.map +0 -1
- package/dist/commands/create.d.ts +0 -24
- package/dist/commands/create.js +0 -507
- package/dist/commands/create.js.map +0 -1
- package/dist/commands/dev.d.ts +0 -25
- package/dist/commands/dev.js +0 -776
- package/dist/commands/dev.js.map +0 -1
- package/dist/commands/init.d.ts +0 -11
- package/dist/commands/init.js +0 -523
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/login.d.ts +0 -13
- package/dist/commands/login.js +0 -374
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/logout.d.ts +0 -13
- package/dist/commands/logout.js +0 -375
- package/dist/commands/logout.js.map +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -6
- package/dist/index.js.map +0 -1
- package/dist/lib/init/ide-docs.d.ts +0 -25
- package/dist/lib/init/ide-docs.js +0 -170
- package/dist/lib/init/ide-docs.js.map +0 -1
- package/dist/lib/init/index.d.ts +0 -14
- package/dist/lib/init/index.js +0 -1104
- package/dist/lib/init/index.js.map +0 -1
- package/dist/lib/init/questions.d.ts +0 -9
- package/dist/lib/init/questions.js +0 -508
- package/dist/lib/init/questions.js.map +0 -1
- package/dist/lib/init/scaffold/agent.d.ts +0 -20
- package/dist/lib/init/scaffold/agent.js +0 -173
- package/dist/lib/init/scaffold/agent.js.map +0 -1
- package/dist/lib/init/scaffold/crew-inputs.d.ts +0 -3
- package/dist/lib/init/scaffold/crew-inputs.js +0 -59
- package/dist/lib/init/scaffold/crew-inputs.js.map +0 -1
- package/dist/lib/init/scaffold/env.d.ts +0 -7
- package/dist/lib/init/scaffold/env.js +0 -124
- package/dist/lib/init/scaffold/env.js.map +0 -1
- package/dist/lib/init/scaffold/github.d.ts +0 -17
- package/dist/lib/init/scaffold/github.js +0 -114
- package/dist/lib/init/scaffold/github.js.map +0 -1
- package/dist/lib/init/scaffold/index.d.ts +0 -10
- package/dist/lib/init/scaffold/index.js +0 -690
- package/dist/lib/init/scaffold/index.js.map +0 -1
- package/dist/lib/init/scaffold/langgraph-assistants.d.ts +0 -18
- package/dist/lib/init/scaffold/langgraph-assistants.js +0 -26
- package/dist/lib/init/scaffold/langgraph-assistants.js.map +0 -1
- package/dist/lib/init/scaffold/packages.d.ts +0 -7
- package/dist/lib/init/scaffold/packages.js +0 -62
- package/dist/lib/init/scaffold/packages.js.map +0 -1
- package/dist/lib/init/scaffold/shadcn.d.ts +0 -7
- package/dist/lib/init/scaffold/shadcn.js +0 -279
- package/dist/lib/init/scaffold/shadcn.js.map +0 -1
- package/dist/lib/init/types/index.d.ts +0 -4
- package/dist/lib/init/types/index.js +0 -238
- package/dist/lib/init/types/index.js.map +0 -1
- package/dist/lib/init/types/questions.d.ts +0 -209
- package/dist/lib/init/types/questions.js +0 -214
- package/dist/lib/init/types/questions.js.map +0 -1
- package/dist/lib/init/types/templates.d.ts +0 -17
- package/dist/lib/init/types/templates.js +0 -26
- package/dist/lib/init/types/templates.js.map +0 -1
- package/dist/lib/init/utils.d.ts +0 -3
- package/dist/lib/init/utils.js +0 -8
- package/dist/lib/init/utils.js.map +0 -1
- package/dist/services/analytics.service.d.ts +0 -38
- package/dist/services/analytics.service.js +0 -134
- package/dist/services/analytics.service.js.map +0 -1
- package/dist/services/auth.service.d.ts +0 -26
- package/dist/services/auth.service.js +0 -299
- package/dist/services/auth.service.js.map +0 -1
- package/dist/services/events.d.ts +0 -119
- package/dist/services/events.js +0 -1
- package/dist/services/events.js.map +0 -1
- package/dist/services/tunnel.service.d.ts +0 -15
- package/dist/services/tunnel.service.js +0 -21
- package/dist/services/tunnel.service.js.map +0 -1
- package/dist/utils/detect-endpoint-type.utils.d.ts +0 -15
- package/dist/utils/detect-endpoint-type.utils.js +0 -157
- package/dist/utils/detect-endpoint-type.utils.js.map +0 -1
- package/dist/utils/trpc.d.ts +0 -4
- package/dist/utils/trpc.js +0 -25
- package/dist/utils/trpc.js.map +0 -1
- package/dist/utils/version.d.ts +0 -3
- package/dist/utils/version.js +0 -6
- package/dist/utils/version.js.map +0 -1
- package/oclif.manifest.json +0 -208
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent framework options — matches CopilotKit CLI supported frameworks.
|
|
3
|
+
*
|
|
4
|
+
* Each value corresponds to a supported agent integration target that
|
|
5
|
+
* CopilotKit Intelligence can scaffold or connect to.
|
|
6
|
+
*/
|
|
7
|
+
export type AgentFramework = 'langgraph-py' | 'langgraph-js' | 'flows' | 'mastra' | 'pydantic-ai' | 'llamaindex' | 'agno' | 'ag2' | 'adk' | 'aws-strands-py' | 'a2a' | 'microsoft-agent-framework-dotnet' | 'microsoft-agent-framework-py' | 'mcp-apps' | 'agentcore-langgraph' | 'agentcore-strands' | 'a2ui' | 'opengenui';
|
|
8
|
+
/**
|
|
9
|
+
* Runtime list of all supported agent frameworks.
|
|
10
|
+
*
|
|
11
|
+
* Used for validation of CLI flags and any other user-provided framework
|
|
12
|
+
* values before they are used as template keys.
|
|
13
|
+
*/
|
|
14
|
+
export declare const AGENT_FRAMEWORKS: readonly ["langgraph-py", "langgraph-js", "flows", "mastra", "pydantic-ai", "llamaindex", "agno", "ag2", "adk", "aws-strands-py", "a2a", "microsoft-agent-framework-dotnet", "microsoft-agent-framework-py", "mcp-apps", "agentcore-langgraph", "agentcore-strands", "a2ui", "opengenui"];
|
|
15
|
+
/**
|
|
16
|
+
* User-facing aliases for `--framework`/`-f` values.
|
|
17
|
+
*
|
|
18
|
+
* Alias keys resolve to canonical {@link AgentFramework} values before
|
|
19
|
+
* validation. Used to keep legacy or user-friendly names working without
|
|
20
|
+
* proliferating canonical IDs.
|
|
21
|
+
*/
|
|
22
|
+
export declare const FRAMEWORK_ALIASES: Record<string, AgentFramework>;
|
|
23
|
+
/**
|
|
24
|
+
* Resolves a user-supplied framework string through {@link FRAMEWORK_ALIASES}.
|
|
25
|
+
*
|
|
26
|
+
* Returns the canonical framework value when an alias is matched, or the
|
|
27
|
+
* input unchanged. Validation against {@link AGENT_FRAMEWORKS} happens
|
|
28
|
+
* separately via {@link isAgentFramework}.
|
|
29
|
+
*
|
|
30
|
+
* @param value - User-provided framework identifier or alias.
|
|
31
|
+
* @returns The canonical framework string.
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveFrameworkAlias(value: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Structured template source with explicit branch support.
|
|
36
|
+
*
|
|
37
|
+
* Used when the branch name contains `/` characters that break URL parsing.
|
|
38
|
+
*/
|
|
39
|
+
export interface TemplateSource {
|
|
40
|
+
owner: string;
|
|
41
|
+
repo: string;
|
|
42
|
+
branch: string;
|
|
43
|
+
path: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Emoji markers shown next to each framework in interactive prompts and
|
|
47
|
+
* completion messages. Mirrors the set used by the legacy CopilotKit CLI.
|
|
48
|
+
*/
|
|
49
|
+
export declare const FRAMEWORK_EMOJI: Record<AgentFramework, string>;
|
|
50
|
+
/**
|
|
51
|
+
* Framework display labels for interactive prompts.
|
|
52
|
+
*
|
|
53
|
+
* Each entry pairs a human-readable label with its corresponding
|
|
54
|
+
* {@link AgentFramework} value for use in ink select-input components.
|
|
55
|
+
*/
|
|
56
|
+
export declare const FRAMEWORK_CHOICES: Array<{
|
|
57
|
+
label: string;
|
|
58
|
+
value: AgentFramework;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* Checks whether a string is one of the supported CLI framework identifiers.
|
|
62
|
+
*
|
|
63
|
+
* @param value - User-provided framework string.
|
|
64
|
+
* @returns `true` when the value is a supported {@link AgentFramework}.
|
|
65
|
+
*/
|
|
66
|
+
export declare function isAgentFramework(value: string): value is AgentFramework;
|
|
67
|
+
/**
|
|
68
|
+
* Builds the user-facing invalid-framework error for CLI validation failures.
|
|
69
|
+
*
|
|
70
|
+
* @param value - Unsupported framework string provided by the user.
|
|
71
|
+
* @returns A human-readable validation error message.
|
|
72
|
+
*/
|
|
73
|
+
export declare function formatInvalidFrameworkError(value: string): string;
|
|
74
|
+
export declare const TEMPLATE_REPOS: Record<AgentFramework, string | TemplateSource>;
|
|
75
|
+
/**
|
|
76
|
+
* Template metadata used by `copilotkit init` to resolve scaffold behavior.
|
|
77
|
+
*/
|
|
78
|
+
export interface InitTemplateDefinition {
|
|
79
|
+
/** Stable identifier for the template choice. */
|
|
80
|
+
id: string;
|
|
81
|
+
/** Source used by the scaffold service to fetch the template. */
|
|
82
|
+
template: string | TemplateSource;
|
|
83
|
+
/** Whether the scaffold path must authenticate and issue a license key. */
|
|
84
|
+
requiresLicense: boolean;
|
|
85
|
+
/** Success flair shown when scaffolding completes. */
|
|
86
|
+
successEmoji: string;
|
|
87
|
+
/** Runtime and setup prerequisites expected by the scaffolded template. */
|
|
88
|
+
prerequisites: InitTemplatePrerequisite[];
|
|
89
|
+
/** Command used to install project dependencies after scaffolding. */
|
|
90
|
+
installCommand: string;
|
|
91
|
+
/** Additional setup commands needed after dependency installation. */
|
|
92
|
+
postInstallCommands?: string[];
|
|
93
|
+
/** Command used to run the scaffolded project after dependencies are ready. */
|
|
94
|
+
runCommand: string;
|
|
95
|
+
/** Environment variables the user should set before running the template. */
|
|
96
|
+
environment: InitTemplateEnvironmentKey[];
|
|
97
|
+
/**
|
|
98
|
+
* Optional template-specific patcher run after files land but before git init.
|
|
99
|
+
*
|
|
100
|
+
* Used by frameworks like AgentCore that need to specialize a generic
|
|
101
|
+
* template into a framework-specific variant, or by showcase frameworks
|
|
102
|
+
* (a2ui, opengenui) that need a sidecar config file written into the
|
|
103
|
+
* scaffolded project.
|
|
104
|
+
*/
|
|
105
|
+
postScaffold?: (projectDir: string) => Promise<void>;
|
|
106
|
+
}
|
|
107
|
+
/** Tool or runtime needed by an init template. */
|
|
108
|
+
export interface InitTemplatePrerequisite {
|
|
109
|
+
/** Executable name used for PATH checks. */
|
|
110
|
+
command: string;
|
|
111
|
+
/** Human-readable prerequisite label. */
|
|
112
|
+
label: string;
|
|
113
|
+
/** Whether the prerequisite is needed during setup or only while running. */
|
|
114
|
+
phase: 'setup' | 'runtime';
|
|
115
|
+
/** Template-specific install guidance shown when the command is missing. */
|
|
116
|
+
installHint: string;
|
|
117
|
+
}
|
|
118
|
+
/** Environment variable metadata shown in init next steps. */
|
|
119
|
+
export interface InitTemplateEnvironmentKey {
|
|
120
|
+
/** Environment variable name. */
|
|
121
|
+
key: string;
|
|
122
|
+
/** Whether the template cannot run usefully without this value. */
|
|
123
|
+
required: boolean;
|
|
124
|
+
/** Short user-facing note about how the value is used. */
|
|
125
|
+
note: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Catalog of standard framework templates.
|
|
129
|
+
*
|
|
130
|
+
* These templates scaffold without requiring CLI authentication or license
|
|
131
|
+
* issuance.
|
|
132
|
+
*/
|
|
133
|
+
export declare const FRAMEWORK_TEMPLATES: Record<AgentFramework, InitTemplateDefinition>;
|
|
134
|
+
/**
|
|
135
|
+
* Explicit template metadata for the langgraph-python-threads example.
|
|
136
|
+
*
|
|
137
|
+
* Uses structured fields instead of a URL because the branch name contains a
|
|
138
|
+
* `/` which breaks URL-based parsing.
|
|
139
|
+
*/
|
|
140
|
+
export declare const THREADS_TEMPLATE: InitTemplateDefinition;
|
|
141
|
+
/**
|
|
142
|
+
* Shape of user/org data returned by ops-api after successful CLI authentication.
|
|
143
|
+
*
|
|
144
|
+
* Received from the `/cli/auth/callback` endpoint and used to populate
|
|
145
|
+
* the local {@link StoredAuth} credential store.
|
|
146
|
+
*/
|
|
147
|
+
export interface AuthPayload {
|
|
148
|
+
/** Short-lived CLI session token issued by ops-api. */
|
|
149
|
+
cliToken: string;
|
|
150
|
+
/** Authenticated user record. */
|
|
151
|
+
user: {
|
|
152
|
+
id: string;
|
|
153
|
+
email: string;
|
|
154
|
+
name: string | null;
|
|
155
|
+
};
|
|
156
|
+
/** Organization the user authenticated under. */
|
|
157
|
+
organization: {
|
|
158
|
+
clerkOrgId: string;
|
|
159
|
+
organizationName?: string;
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Scope accepted by CLI license listing requests.
|
|
164
|
+
*/
|
|
165
|
+
export type CliLicenseScope = 'org' | 'user';
|
|
166
|
+
/**
|
|
167
|
+
* License metadata returned by the authenticated CLI license API.
|
|
168
|
+
*/
|
|
169
|
+
export interface CliLicenseRecord {
|
|
170
|
+
/** Stable license identifier. */
|
|
171
|
+
license_id: string;
|
|
172
|
+
/** Issued license tier. */
|
|
173
|
+
tier: string;
|
|
174
|
+
/** Maximum seat count for the license. */
|
|
175
|
+
seat_limit: number;
|
|
176
|
+
/** Feature flags embedded in the license payload. */
|
|
177
|
+
features: Record<string, boolean>;
|
|
178
|
+
/** Whether the license grants remove-branding rights. */
|
|
179
|
+
remove_branding: boolean;
|
|
180
|
+
/** Timestamp when the license was formally issued, or null when pending. */
|
|
181
|
+
issued_at: string | null;
|
|
182
|
+
/** Timestamp when the license expires. */
|
|
183
|
+
expires_at: string;
|
|
184
|
+
/** Timestamp when the license row was created. */
|
|
185
|
+
created_at: string;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Shape stored in the copilotkit-auth conf store on disk.
|
|
189
|
+
*
|
|
190
|
+
* Written after a successful login and read by subsequent CLI commands
|
|
191
|
+
* that require an authenticated session.
|
|
192
|
+
*/
|
|
193
|
+
export interface StoredAuth {
|
|
194
|
+
/** CLI session token used to authenticate requests to ops-api. */
|
|
195
|
+
cliToken: string;
|
|
196
|
+
/** Stable identifier for the authenticated user. */
|
|
197
|
+
userId: string;
|
|
198
|
+
/** Email address of the authenticated user. */
|
|
199
|
+
email: string;
|
|
200
|
+
/** Active Clerk organization identifier for the authenticated session. */
|
|
201
|
+
clerkOrgId: string;
|
|
202
|
+
/** Display name for the authenticated organization, when available. */
|
|
203
|
+
organizationName?: string;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Shape of init options after flag parsing and interactive prompts are resolved.
|
|
207
|
+
*
|
|
208
|
+
* Represents the fully-resolved configuration for a `copilotkit init` invocation,
|
|
209
|
+
* ready to be handed to the scaffold service.
|
|
210
|
+
*/
|
|
211
|
+
export interface InitOptions {
|
|
212
|
+
/** Human-readable name for the project being initialized. */
|
|
213
|
+
name: string;
|
|
214
|
+
/** Whether the user chose the Intelligence (threads) path. */
|
|
215
|
+
intelligence: boolean;
|
|
216
|
+
/** Target agent framework — only set when intelligence is false. */
|
|
217
|
+
framework: AgentFramework | null;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Resolves the init template metadata for the supplied scaffold options.
|
|
221
|
+
*
|
|
222
|
+
* @param options - Resolved init options that determine the scaffold path.
|
|
223
|
+
* @returns The template definition that should drive scaffolding.
|
|
224
|
+
* @throws {Error} When a non-threads scaffold is missing a framework.
|
|
225
|
+
*/
|
|
226
|
+
export declare function resolveInitTemplate(options: Pick<InitOptions, 'intelligence' | 'framework'>): InitTemplateDefinition;
|
|
227
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../apps/cli/src/types.ts"],"names":[],"mappings":"AAGA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B,CACjC,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,cAAc,GAAG,WAAW,CAAC,GACvD,sBAAsB,CAgBxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/ui/banner.tsx"],"names":[],"mappings":"AAsBA,2DAA2D;AAC3D,wBAAgB,MAAM,4CAOrB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
+
import { login as defaultLogin } from "../services/auth.service.js";
|
|
3
|
+
/** Message shown before the CLI opens the browser for authentication. */
|
|
4
|
+
export declare const BROWSER_LOGIN_CONFIRMATION_MESSAGE = "Sign in to your \uD83E\uDE81 CopilotKit account in your browser.";
|
|
5
|
+
/** Prompt shown after the pre-login explanation. */
|
|
6
|
+
export declare const BROWSER_LOGIN_CONFIRMATION_PROMPT = "Press Enter to continue...";
|
|
7
|
+
/** Browser login function shape shared by command flows. */
|
|
8
|
+
export type BrowserLoginRunner = typeof defaultLogin;
|
|
9
|
+
/** Rendered state for the shared browser-login interaction. */
|
|
10
|
+
export type BrowserLoginPhase = "idle" | "confirming" | "waiting" | "success" | "error";
|
|
11
|
+
/** User and organization data displayed after a successful login. */
|
|
12
|
+
export interface BrowserLoginIdentity {
|
|
13
|
+
/** Authenticated user email. */
|
|
14
|
+
email: string;
|
|
15
|
+
/** Authenticated organization display name or Clerk organization id. */
|
|
16
|
+
organizationName: string;
|
|
17
|
+
}
|
|
18
|
+
/** Current state exposed by {@link useBrowserLogin}. */
|
|
19
|
+
export interface BrowserLoginState {
|
|
20
|
+
/** Current interaction phase. */
|
|
21
|
+
phase: BrowserLoginPhase;
|
|
22
|
+
/** Authenticated identity, available after success. */
|
|
23
|
+
identity: BrowserLoginIdentity | null;
|
|
24
|
+
/** User-facing error message, available after failure. */
|
|
25
|
+
errorMessage: string;
|
|
26
|
+
}
|
|
27
|
+
/** Context value exposed by {@link BrowserLoginProvider}. */
|
|
28
|
+
export interface BrowserLoginContextValue {
|
|
29
|
+
/** Runs the shared browser login flow, including confirmation when interactive. */
|
|
30
|
+
runLogin: BrowserLoginRunner;
|
|
31
|
+
/** Current browser login UI state. */
|
|
32
|
+
state: BrowserLoginState;
|
|
33
|
+
/** Confirms that the browser login may begin. */
|
|
34
|
+
confirmBrowserLoginStart: () => unknown;
|
|
35
|
+
}
|
|
36
|
+
/** Props for {@link BrowserLoginProvider}. */
|
|
37
|
+
export interface BrowserLoginProviderProps {
|
|
38
|
+
/** Child Ink tree that can call {@link useBrowserLogin}. */
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
/** Injectable login implementation, primarily for tests. */
|
|
41
|
+
loginRunner?: BrowserLoginRunner;
|
|
42
|
+
/** Overrides TTY detection, primarily for tests. */
|
|
43
|
+
isInteractive?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Returns whether the CLI should pause for a browser-login confirmation.
|
|
47
|
+
*
|
|
48
|
+
* @returns True when both standard input and output are interactive TTYs.
|
|
49
|
+
*/
|
|
50
|
+
export declare function isBrowserLoginConfirmationInteractive(): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Provides a shared browser-login runner and UI state to CLI Ink flows.
|
|
53
|
+
*
|
|
54
|
+
* @param props - Provider props.
|
|
55
|
+
* @returns Provider element for descendant command UI.
|
|
56
|
+
*/
|
|
57
|
+
export declare function BrowserLoginProvider({ children, loginRunner, isInteractive, }: BrowserLoginProviderProps): ReactElement;
|
|
58
|
+
/**
|
|
59
|
+
* Reads the shared browser-login runner and UI state.
|
|
60
|
+
*
|
|
61
|
+
* @returns Browser-login context value.
|
|
62
|
+
* @throws When rendered outside {@link BrowserLoginProvider}.
|
|
63
|
+
*/
|
|
64
|
+
export declare function useBrowserLogin(): BrowserLoginContextValue;
|
|
65
|
+
/**
|
|
66
|
+
* Renders the shared browser-login confirmation and result states.
|
|
67
|
+
*
|
|
68
|
+
* @returns Ink element for the current browser-login phase.
|
|
69
|
+
*/
|
|
70
|
+
export declare function BrowserLoginConfirmation(): ReactElement | null;
|
|
71
|
+
//# sourceMappingURL=browser-login.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-login.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/ui/browser-login.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAIpE,yEAAyE;AACzE,eAAO,MAAM,kCAAkC,qEACW,CAAC;AAE3D,oDAAoD;AACpD,eAAO,MAAM,iCAAiC,+BAChB,CAAC;AAE/B,4DAA4D;AAC5D,MAAM,MAAM,kBAAkB,GAAG,OAAO,YAAY,CAAC;AAErD,+DAA+D;AAC/D,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,YAAY,GACZ,SAAS,GACT,SAAS,GACT,OAAO,CAAC;AAEZ,qEAAqE;AACrE,MAAM,WAAW,oBAAoB;IACnC,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,wDAAwD;AACxD,MAAM,WAAW,iBAAiB;IAChC,iCAAiC;IACjC,KAAK,EAAE,iBAAiB,CAAC;IACzB,uDAAuD;IACvD,QAAQ,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACtC,0DAA0D;IAC1D,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,6DAA6D;AAC7D,MAAM,WAAW,wBAAwB;IACvC,mFAAmF;IACnF,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,sCAAsC;IACtC,KAAK,EAAE,iBAAiB,CAAC;IACzB,iDAAiD;IACjD,wBAAwB,EAAE,MAAM,OAAO,CAAC;CACzC;AAED,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC,4DAA4D;IAC5D,QAAQ,EAAE,SAAS,CAAC;IACpB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,oDAAoD;IACpD,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAmBD;;;;GAIG;AACH,wBAAgB,qCAAqC,IAAI,OAAO,CAE/D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,WAA0B,EAC1B,aAAa,GACd,EAAE,yBAAyB,GAAG,YAAY,CA4F1C;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,wBAAwB,CAO1D;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,YAAY,GAAG,IAAI,CAiD9D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { InitOptions } from "../types.js";
|
|
2
|
+
/** Props for the {@link InitFlow} component. */
|
|
3
|
+
export interface InitFlowProps {
|
|
4
|
+
/** Pre-filled project name from --name flag, or `null` to prompt. */
|
|
5
|
+
initialName: string | null;
|
|
6
|
+
/** Pre-selected via --intelligence flag, or `null` to prompt. */
|
|
7
|
+
initialIntelligence: boolean | null;
|
|
8
|
+
/** Pre-selected via --framework flag, or `null` to prompt. */
|
|
9
|
+
initialFramework: string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Callback invoked when all prompts are complete.
|
|
12
|
+
*
|
|
13
|
+
* Receives a fully-resolved {@link InitOptions} object, or `null` when the
|
|
14
|
+
* user cancels (future extension point).
|
|
15
|
+
*/
|
|
16
|
+
onComplete: (options: InitOptions | null) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Callback invoked when the user wants to sign up for threads access.
|
|
19
|
+
*
|
|
20
|
+
* The init flow renders the mailing list screen; this callback fires the
|
|
21
|
+
* API request. When it resolves, the flow returns to the password screen.
|
|
22
|
+
*/
|
|
23
|
+
onRequestThreadsAccess: () => Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Ink component that steps through the interactive `init` prompts.
|
|
27
|
+
*
|
|
28
|
+
* Flow:
|
|
29
|
+
* 1. Project name
|
|
30
|
+
* 2. Do you want Intelligence?
|
|
31
|
+
* - Yes → password gate (or skip if already unlocked) → done with threads template
|
|
32
|
+
* - No → framework picker → done with framework template
|
|
33
|
+
*/
|
|
34
|
+
export declare function InitFlow({ initialName, initialIntelligence, initialFramework, onComplete, onRequestThreadsAccess, }: InitFlowProps): import("react/jsx-runtime").JSX.Element | null;
|
|
35
|
+
//# sourceMappingURL=init-flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-flow.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/ui/init-flow.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAkB,WAAW,EAAE,MAAM,aAAa,CAAC;AA4B/D,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,iEAAiE;IACjE,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAAC;IACpC,8DAA8D;IAC9D,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;;;OAKG;IACH,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAClD;;;;;OAKG;IACH,sBAAsB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C;AA0BD;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,EACvB,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,sBAAsB,GACvB,EAAE,aAAa,kDA4Of"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import { type KiteGameRng } from '../services/kite-game-engine.js';
|
|
3
|
+
/** Props for the {@link KiteGame} component. */
|
|
4
|
+
export interface KiteGameProps {
|
|
5
|
+
/** Random source used by the deterministic game engine. */
|
|
6
|
+
readonly rng?: KiteGameRng;
|
|
7
|
+
/** Interval between engine ticks in milliseconds. */
|
|
8
|
+
readonly tickMs?: number;
|
|
9
|
+
/** Called when the player quits the game. */
|
|
10
|
+
readonly onExit?: () => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Renders the hidden terminal kite game.
|
|
14
|
+
*
|
|
15
|
+
* @param props - Component configuration.
|
|
16
|
+
* @returns The Ink game UI.
|
|
17
|
+
*/
|
|
18
|
+
export declare function KiteGame({ rng, tickMs, onExit, }: KiteGameProps): ReactElement;
|
|
19
|
+
/**
|
|
20
|
+
* Converts terminal width into the playable board width.
|
|
21
|
+
*
|
|
22
|
+
* @param terminalWidth - Terminal column count.
|
|
23
|
+
* @returns Playable board width in terminal cells.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getPlayableWidth(terminalWidth: number): number;
|
|
26
|
+
//# sourceMappingURL=kite-game.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kite-game.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/ui/kite-game.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAML,KAAK,WAAW,EAEjB,MAAM,iCAAiC,CAAC;AAMzC,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,2DAA2D;IAC3D,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC;IAE3B,qDAAqD;IACrD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEzB,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CAC9B;AAMD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EACvB,GAAiB,EACjB,MAAwB,EACxB,MAAM,GACP,EAAE,aAAa,GAAG,YAAY,CA4G9B;AAuCD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAE9D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Props for the {@link LoginFlow} component. */
|
|
2
|
+
interface LoginFlowProps {
|
|
3
|
+
/**
|
|
4
|
+
* Callback invoked once the login attempt has settled.
|
|
5
|
+
*
|
|
6
|
+
* @param result - Final login result.
|
|
7
|
+
*/
|
|
8
|
+
onComplete: (result: {
|
|
9
|
+
error?: Error;
|
|
10
|
+
success: boolean;
|
|
11
|
+
}) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Ink component that drives the browser-based login flow.
|
|
15
|
+
*
|
|
16
|
+
* On mount it calls the shared browser-login runner, renders the shared
|
|
17
|
+
* confirmation and status UI, then notifies the caller when the attempt has
|
|
18
|
+
* settled.
|
|
19
|
+
*/
|
|
20
|
+
export declare function LoginFlow({ onComplete }: LoginFlowProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=login-flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login-flow.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/ui/login-flow.tsx"],"names":[],"mappings":"AAMA,iDAAiD;AACjD,UAAU,cAAc;IACtB;;;;OAIG;IACH,UAAU,EAAE,CAAC,MAAM,EAAE;QAAE,KAAK,CAAC,EAAE,KAAK,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;CACnE;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EAAE,UAAU,EAAE,EAAE,cAAc,2CAoBvD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Props for the {@link Spinner} component. */
|
|
2
|
+
interface SpinnerProps {
|
|
3
|
+
/** Label displayed next to the spinner. */
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
/** Spinner with a label, animated as a kite drifting on the wind. */
|
|
7
|
+
export declare function Spinner({ label }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../../../apps/cli/src/ui/spinner.tsx"],"names":[],"mappings":"AAGA,+CAA+C;AAC/C,UAAU,YAAY;IACpB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;CACf;AAoBD,qEAAqE;AACrE,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,YAAY,2CAiB9C"}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Atai Barkai
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
package/README.md
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
# 🪁 CopilotKit CLI
|
|
2
|
-
|
|
3
|
-
> **NOTE:** The CopilotKit CLI is an optional tool that enhances the developer experience of CopilotKit. [It is not required to use CopilotKit. Click here to get started with CopilotKit](https://docs.copilotkit.ai)..
|
|
4
|
-
|
|
5
|
-
[](https://npmjs.org/package/copilotkit)
|
|
6
|
-
[](https://npmjs.org/package/copilotkit)
|
|
7
|
-
|
|
8
|
-
- [Installation](#installation)
|
|
9
|
-
- [Commands](#commands)
|
|
10
|
-
- [init](#init-add-copilotkit-to-your-nextjs-project)
|
|
11
|
-
- [login](#login-authenticating-with-copilot-cloud)
|
|
12
|
-
- [dev](#dev-local-endpoint-development)
|
|
13
|
-
- [Need help?](#need-help)
|
|
14
|
-
|
|
15
|
-
## What is the CopilotKit CLI?
|
|
16
|
-
|
|
17
|
-
The CopilotKit CLI boosts your [CopilotKit](https://github.com/copilotkit/copilotkit) development experience. It integrates neatly with Copilot Cloud.
|
|
18
|
-
|
|
19
|
-
## Installation
|
|
20
|
-
|
|
21
|
-
```sh
|
|
22
|
-
# npm
|
|
23
|
-
npm install -g copilotkit
|
|
24
|
-
|
|
25
|
-
# pnpm
|
|
26
|
-
pnpm install -g copilotkit
|
|
27
|
-
|
|
28
|
-
# yarn
|
|
29
|
-
yarn global add copilotkit
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Commands
|
|
33
|
-
|
|
34
|
-
### `init`: Add CopilotKit to your Next.js project
|
|
35
|
-
|
|
36
|
-
The fastest way to add CopilotKit to your Next.js project is with the init command:
|
|
37
|
-
|
|
38
|
-
```sh
|
|
39
|
-
# Navigate to your Next.js project
|
|
40
|
-
cd my-nextjs-app
|
|
41
|
-
|
|
42
|
-
# Run the init command
|
|
43
|
-
copilotkit init
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
This interactive command will:
|
|
47
|
-
|
|
48
|
-
- Set up the required UI components
|
|
49
|
-
- Configure AI agents if desired (LangGraph, CrewAI)
|
|
50
|
-
- Connect to Copilot Cloud (optional)
|
|
51
|
-
- Create all necessary configuration files
|
|
52
|
-
|
|
53
|
-
You can also pass flags to automate the setup:
|
|
54
|
-
|
|
55
|
-
```sh
|
|
56
|
-
copilotkit init --mode LangGraph
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### `login`: Authenticating with Copilot Cloud
|
|
60
|
-
|
|
61
|
-
First, ensure you have an account on [Copilot Cloud](https://cloud.copilotkit.ai).
|
|
62
|
-
|
|
63
|
-
Then, run the following command to authenticate with Copilot Cloud:
|
|
64
|
-
|
|
65
|
-
```sh
|
|
66
|
-
copilotkit login
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### `dev`: Local Endpoint Development
|
|
70
|
-
|
|
71
|
-
The CopilotKit CLI allows you to create a local tunnel to your CopilotKit remote endpoints, agents, and LangGraph apps.
|
|
72
|
-
|
|
73
|
-
For example, to create a local tunnel to an endpoint running locally on port 8000, you can run:
|
|
74
|
-
|
|
75
|
-
```sh
|
|
76
|
-
copilotkit dev --port 8000
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Need help?
|
|
80
|
-
|
|
81
|
-
You can always run `copilotkit --help` to get help on the CopilotKit CLI.
|
|
82
|
-
|
|
83
|
-
You're welcome to join our [Discord](https://discord.gg/copilotkit) to get help from the CopilotKit team and community.
|
package/bin/dev.cmd
DELETED
package/bin/dev.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env -S node --loader ts-node/esm --disable-warning=ExperimentalWarning
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line n/shebang
|
|
4
|
-
import {execute} from '@oclif/core'
|
|
5
|
-
|
|
6
|
-
process.env.SENTRY_DISABLED = 'true'
|
|
7
|
-
process.env.SEGMENT_DISABLED = 'true'
|
|
8
|
-
await execute({development: true, dir: import.meta.url})
|
package/bin/run.cmd
DELETED
package/bin/run.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import {execute} from '@oclif/core'
|
|
4
|
-
|
|
5
|
-
const main = async () => {
|
|
6
|
-
try {
|
|
7
|
-
await execute({dir: import.meta.url})
|
|
8
|
-
} catch (error) {
|
|
9
|
-
// Rely on command-level error handling to surface friendly messages.
|
|
10
|
-
// If we reach here it means something happened before oclif handed off to the command.
|
|
11
|
-
const message = error?.message || 'Unknown error'
|
|
12
|
-
console.error(message)
|
|
13
|
-
process.exitCode = 1
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
void main()
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
|
|
3
|
-
declare class BaseCommand extends Command {
|
|
4
|
-
init(): Promise<void>;
|
|
5
|
-
catch(err: any): Promise<void>;
|
|
6
|
-
finally(): Promise<void>;
|
|
7
|
-
run(): Promise<void>;
|
|
8
|
-
checkCLIVersion(): Promise<void>;
|
|
9
|
-
gracefulError(message: string): Promise<void>;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export { BaseCommand };
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// src/commands/base-command.ts
|
|
2
|
-
import { Command } from "@oclif/core";
|
|
3
|
-
import Sentry, { consoleIntegration } from "@sentry/node";
|
|
4
|
-
|
|
5
|
-
// src/utils/version.ts
|
|
6
|
-
var LIB_VERSION = "1.54.0";
|
|
7
|
-
|
|
8
|
-
// src/utils/trpc.ts
|
|
9
|
-
import { createTRPCClient as trpcClient, httpBatchLink } from "@trpc/client";
|
|
10
|
-
import superjson from "superjson";
|
|
11
|
-
var COPILOT_CLOUD_BASE_URL = process.env.COPILOT_CLOUD_BASE_URL || "https://cloud.copilotkit.ai";
|
|
12
|
-
|
|
13
|
-
// src/commands/base-command.ts
|
|
14
|
-
import chalk from "chalk";
|
|
15
|
-
var BaseCommand = class extends Command {
|
|
16
|
-
async init() {
|
|
17
|
-
await this.checkCLIVersion();
|
|
18
|
-
if (process.env.SENTRY_DISABLED === "true") {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
Sentry.init({
|
|
22
|
-
dsn: process.env.SENTRY_DSN || "https://1eea15d32e2eacb0456a77db5e39aeeb@o4507288195170304.ingest.us.sentry.io/4508581448581120",
|
|
23
|
-
integrations: [consoleIntegration()],
|
|
24
|
-
// Tracing
|
|
25
|
-
tracesSampleRate: 1
|
|
26
|
-
// Capture 100% of the transactions
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
async catch(err) {
|
|
30
|
-
if (process.env.SENTRY_DISABLED !== "true") {
|
|
31
|
-
Sentry.captureException(err);
|
|
32
|
-
}
|
|
33
|
-
const message = err?.message ?? "Unknown error";
|
|
34
|
-
this.log("\n" + chalk.red(message) + "\n");
|
|
35
|
-
const exitCode = err?.oclif?.exit ?? 1;
|
|
36
|
-
this.exit(exitCode);
|
|
37
|
-
}
|
|
38
|
-
async finally() {
|
|
39
|
-
if (process.env.SENTRY_DISABLED === "true") {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
Sentry.close();
|
|
43
|
-
}
|
|
44
|
-
async run() {
|
|
45
|
-
}
|
|
46
|
-
async checkCLIVersion() {
|
|
47
|
-
try {
|
|
48
|
-
const response = await fetch(`${COPILOT_CLOUD_BASE_URL}/api/healthz`);
|
|
49
|
-
const data = await response.json();
|
|
50
|
-
const cloudVersion = data.cliVersion;
|
|
51
|
-
if (!cloudVersion || cloudVersion === LIB_VERSION) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
} catch {
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
async gracefulError(message) {
|
|
58
|
-
this.log("\n" + chalk.red(message));
|
|
59
|
-
process.exit(1);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
export {
|
|
63
|
-
BaseCommand
|
|
64
|
-
};
|
|
65
|
-
//# sourceMappingURL=base-command.js.map
|