copilotkit 0.0.4 → 0.0.7

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.
Files changed (44) hide show
  1. package/README.md +56 -2
  2. package/bin/dev.cmd +3 -0
  3. package/bin/dev.js +8 -0
  4. package/bin/run.cmd +3 -0
  5. package/bin/run.js +5 -0
  6. package/dist/commands/base-command.d.ts +11 -0
  7. package/dist/commands/base-command.js +70 -0
  8. package/dist/commands/base-command.js.map +1 -0
  9. package/dist/commands/dev.d.ts +25 -0
  10. package/dist/commands/dev.js +591 -0
  11. package/dist/commands/dev.js.map +1 -0
  12. package/dist/commands/login.d.ts +13 -0
  13. package/dist/commands/login.js +306 -0
  14. package/dist/commands/login.js.map +1 -0
  15. package/dist/commands/logout.d.ts +13 -0
  16. package/dist/commands/logout.js +309 -0
  17. package/dist/commands/logout.js.map +1 -0
  18. package/dist/index.d.ts +1 -0
  19. package/dist/index.js +6 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/services/analytics.service.d.ts +25 -0
  22. package/dist/services/analytics.service.js +75 -0
  23. package/dist/services/analytics.service.js.map +1 -0
  24. package/dist/services/auth.service.d.ts +23 -0
  25. package/dist/services/auth.service.js +226 -0
  26. package/dist/services/auth.service.js.map +1 -0
  27. package/dist/services/events.d.ts +31 -0
  28. package/dist/services/events.js +1 -0
  29. package/dist/services/events.js.map +1 -0
  30. package/dist/services/tunnel.service.d.ts +15 -0
  31. package/dist/services/tunnel.service.js +17 -0
  32. package/dist/services/tunnel.service.js.map +1 -0
  33. package/dist/utils/detect-endpoint-type.utils.d.ts +13 -0
  34. package/dist/utils/detect-endpoint-type.utils.js +117 -0
  35. package/dist/utils/detect-endpoint-type.utils.js.map +1 -0
  36. package/dist/utils/trpc.d.ts +139 -0
  37. package/dist/utils/trpc.js +25 -0
  38. package/dist/utils/trpc.js.map +1 -0
  39. package/dist/utils/version.d.ts +3 -0
  40. package/dist/utils/version.js +6 -0
  41. package/dist/utils/version.js.map +1 -0
  42. package/oclif.manifest.json +106 -0
  43. package/package.json +85 -81
  44. package/LICENSE +0 -13
@@ -0,0 +1,591 @@
1
+ // src/commands/dev.ts
2
+ import { Flags } from "@oclif/core";
3
+ import inquirer2 from "inquirer";
4
+ import { createId } from "@paralleldrive/cuid2";
5
+ import ora2 from "ora";
6
+ import chalk3 from "chalk";
7
+
8
+ // src/services/auth.service.ts
9
+ import Conf2 from "conf";
10
+ import cors from "cors";
11
+ import express from "express";
12
+ import crypto2 from "node:crypto";
13
+ import open from "open";
14
+ import getPort from "get-port";
15
+ import ora from "ora";
16
+ import chalk from "chalk";
17
+ import inquirer from "inquirer";
18
+
19
+ // src/utils/trpc.ts
20
+ import { createTRPCClient as createTRPClient_, unstable_httpBatchStreamLink } from "@trpc/client";
21
+ import superjson from "superjson";
22
+ var COPILOT_CLOUD_BASE_URL = process.env.COPILOT_CLOUD_BASE_URL || "https://cloud.copilotkit.ai";
23
+ function createTRPCClient(cliToken) {
24
+ return createTRPClient_({
25
+ links: [
26
+ unstable_httpBatchStreamLink({
27
+ transformer: superjson,
28
+ url: `${COPILOT_CLOUD_BASE_URL}/api/trpc-cli`,
29
+ headers: () => {
30
+ const headers = new Headers();
31
+ headers.set("x-trpc-source", "cli");
32
+ headers.set("x-cli-token", cliToken);
33
+ return headers;
34
+ }
35
+ })
36
+ ]
37
+ });
38
+ }
39
+
40
+ // src/services/analytics.service.ts
41
+ import { Analytics } from "@segment/analytics-node";
42
+ import Conf from "conf";
43
+ var AnalyticsService = class {
44
+ constructor(authData) {
45
+ this.authData = authData;
46
+ if (process.env.SEGMENT_DISABLED === "true") {
47
+ return;
48
+ }
49
+ const segmentWriteKey = process.env.SEGMENT_WRITE_KEY || "9Pv6QyExYef2P4hPz4gks6QAvNMi2AOf";
50
+ this.globalProperties = {
51
+ service: "cli"
52
+ };
53
+ if (this.authData?.userId) {
54
+ this.userId = this.authData.userId;
55
+ }
56
+ if (this.authData?.email) {
57
+ this.email = this.authData.email;
58
+ this.globalProperties.email = this.authData.email;
59
+ }
60
+ if (this.authData?.organizationId) {
61
+ this.organizationId = this.authData.organizationId;
62
+ }
63
+ this.segment = new Analytics({
64
+ writeKey: segmentWriteKey,
65
+ disable: process.env.SEGMENT_DISABLE === "true"
66
+ });
67
+ const config = new Conf({ projectName: "CopilotKitCLI" });
68
+ if (!config.get("anonymousId")) {
69
+ config.set("anonymousId", crypto.randomUUID());
70
+ }
71
+ }
72
+ segment;
73
+ globalProperties = {};
74
+ userId;
75
+ email;
76
+ organizationId;
77
+ config = new Conf({ projectName: "CopilotKitCLI" });
78
+ getAnonymousId() {
79
+ const anonymousId = this.config.get("anonymousId");
80
+ if (!anonymousId) {
81
+ const anonymousId2 = crypto.randomUUID();
82
+ this.config.set("anonymousId", anonymousId2);
83
+ return anonymousId2;
84
+ }
85
+ return anonymousId;
86
+ }
87
+ track(event) {
88
+ if (!this.segment) {
89
+ return;
90
+ }
91
+ const payload = {
92
+ userId: this.userId ? this.userId : void 0,
93
+ email: this.email ? this.email : void 0,
94
+ anonymousId: this.getAnonymousId(),
95
+ event: event.event,
96
+ properties: {
97
+ ...this.globalProperties,
98
+ ...event.properties,
99
+ $groups: this.organizationId ? {
100
+ segment_group: this.organizationId
101
+ } : void 0,
102
+ eventProperties: {
103
+ ...event.properties,
104
+ ...this.globalProperties
105
+ }
106
+ }
107
+ };
108
+ this.segment.track(payload);
109
+ }
110
+ };
111
+
112
+ // src/services/auth.service.ts
113
+ var AuthService = class {
114
+ config = new Conf2({ projectName: "CopilotKitCLI" });
115
+ COPILOT_CLOUD_BASE_URL = process.env.COPILOT_CLOUD_BASE_URL || "https://cloud.copilotkit.ai";
116
+ getToken() {
117
+ return this.config.get("cliToken");
118
+ }
119
+ getCLIToken() {
120
+ const cliToken = this.config.get("cliToken");
121
+ return cliToken;
122
+ }
123
+ async logout() {
124
+ const cliToken = this.getCLIToken();
125
+ if (!cliToken) {
126
+ throw new Error("You are not logged in");
127
+ }
128
+ const trpcClient = createTRPCClient(cliToken);
129
+ const me = await trpcClient.me.query();
130
+ const analytics = new AnalyticsService({ userId: me.user.id, organizationId: me.organization.id, email: me.user.email });
131
+ this.config.delete("cliToken");
132
+ analytics.track({
133
+ event: "cli.logout",
134
+ properties: {
135
+ organizationId: me.organization.id,
136
+ userId: me.user.id,
137
+ email: me.user.email
138
+ }
139
+ });
140
+ }
141
+ async requireLogin(cmd) {
142
+ let cliToken = this.getCLIToken();
143
+ if (!cliToken) {
144
+ try {
145
+ const { shouldLogin } = await inquirer.prompt([
146
+ {
147
+ name: "shouldLogin",
148
+ type: "confirm",
149
+ message: "You are not yet authenticated. Authenticate with Copilot Cloud? (press Enter to confirm)",
150
+ default: true
151
+ }
152
+ ]);
153
+ if (shouldLogin) {
154
+ const loginResult = await this.login();
155
+ cliToken = loginResult.cliToken;
156
+ cmd.log(`\u{1FA81} Logged in as ${chalk.hex("#7553fc")(loginResult.user.email)}
157
+ `);
158
+ return loginResult;
159
+ } else {
160
+ cmd.error("Authentication required to proceed.");
161
+ }
162
+ } catch (error) {
163
+ if (error instanceof Error && error.name === "ExitPromptError") {
164
+ cmd.error(chalk.yellow("\nAuthentication cancelled"));
165
+ }
166
+ throw error;
167
+ }
168
+ }
169
+ let me;
170
+ const trpcClient = createTRPCClient(cliToken);
171
+ try {
172
+ me = await trpcClient.me.query();
173
+ } catch (error) {
174
+ cmd.log(chalk.red("Could not authenticate with Copilot Cloud. Please try again."));
175
+ process.exit(1);
176
+ }
177
+ if (!me.organization || !me.user) {
178
+ cmd.error("Authentication required to proceed.");
179
+ }
180
+ return { cliToken, user: me.user, organization: me.organization };
181
+ }
182
+ async login() {
183
+ let analytics;
184
+ analytics = new AnalyticsService();
185
+ const app = express();
186
+ app.use(cors());
187
+ app.use(express.urlencoded({ extended: true }));
188
+ app.use(express.json());
189
+ const port = await getPort();
190
+ const state = crypto2.randomBytes(16).toString("hex");
191
+ return new Promise((resolve) => {
192
+ const server = app.listen(port, () => {
193
+ });
194
+ analytics.track({
195
+ event: "cli.login.initiated",
196
+ properties: {}
197
+ });
198
+ const spinner = ora("Waiting for browser authentication to complete...\n").start();
199
+ app.post("/callback", async (req, res) => {
200
+ const { cliToken, user, organization } = req.body;
201
+ analytics = new AnalyticsService({ userId: user.id, organizationId: organization.id, email: user.email });
202
+ analytics.track({
203
+ event: "cli.login.success",
204
+ properties: {
205
+ organizationId: organization.id,
206
+ userId: user.id,
207
+ email: user.email
208
+ }
209
+ });
210
+ if (state !== req.query.state) {
211
+ res.status(401).json({ message: "Invalid state" });
212
+ spinner.fail("Invalid state");
213
+ return;
214
+ }
215
+ this.config.set("cliToken", cliToken);
216
+ res.status(200).json({ message: "Callback called" });
217
+ spinner.succeed(`\u{1FA81} Successfully logged in as ${chalk.hex("#7553fc")(user.email)}
218
+ `);
219
+ server.close();
220
+ resolve({
221
+ cliToken,
222
+ organization,
223
+ user
224
+ });
225
+ });
226
+ open(`${this.COPILOT_CLOUD_BASE_URL}/cli-auth?callbackUrl=http://localhost:${port}/callback&state=${state}`);
227
+ });
228
+ }
229
+ };
230
+
231
+ // src/utils/detect-endpoint-type.utils.ts
232
+ var removeTrailingSlash = (url) => url.replace(/\/$/, "");
233
+ var getHumanReadableEndpointType = (type) => {
234
+ switch (type) {
235
+ case "LangGraphPlatform" /* LangGraphPlatform */:
236
+ return "LangGraph Platform";
237
+ case "CopilotKit" /* CopilotKit */:
238
+ return "CopilotKit";
239
+ default:
240
+ return "Invalid";
241
+ }
242
+ };
243
+ async function detectRemoteEndpointType(url) {
244
+ const promises = [
245
+ isLangGraphPlatformEndpoint(url),
246
+ isCopilotKitEndpoint(url)
247
+ ];
248
+ if (!url.endsWith("/copilotkit")) {
249
+ promises.push(isCopilotKitEndpoint(`${removeTrailingSlash(url)}/copilotkit`));
250
+ }
251
+ const results = await Promise.all(promises);
252
+ if (results[0]) {
253
+ return {
254
+ url,
255
+ type: "LangGraphPlatform" /* LangGraphPlatform */,
256
+ humanReadableType: "LangGraph Platform"
257
+ };
258
+ }
259
+ if (results[1]) {
260
+ return {
261
+ url,
262
+ type: "CopilotKit" /* CopilotKit */,
263
+ humanReadableType: "CopilotKit"
264
+ };
265
+ }
266
+ if (results[2]) {
267
+ return {
268
+ url: `${removeTrailingSlash(url)}/copilotkit`,
269
+ type: "CopilotKit" /* CopilotKit */,
270
+ humanReadableType: "CopilotKit"
271
+ };
272
+ }
273
+ return {
274
+ url,
275
+ type: "Invalid" /* Invalid */,
276
+ humanReadableType: "Invalid"
277
+ };
278
+ }
279
+ async function isLangGraphPlatformEndpoint(url, retries = 0) {
280
+ let response;
281
+ try {
282
+ response = await fetch(`${url}/assistants/search`, {
283
+ method: "POST",
284
+ body: JSON.stringify({
285
+ metadata: {},
286
+ limit: 99,
287
+ offset: 0
288
+ })
289
+ });
290
+ } catch (error) {
291
+ return false;
292
+ }
293
+ if (!response.ok) {
294
+ if (response.status === 502) {
295
+ if (retries < 3) {
296
+ console.log("RETRYING LGC", retries + 1);
297
+ return isLangGraphPlatformEndpoint(url, retries + 1);
298
+ }
299
+ }
300
+ if (response.status === 403) {
301
+ return true;
302
+ }
303
+ return false;
304
+ }
305
+ const data = await response.json();
306
+ if (data[0].assistant_id) {
307
+ return true;
308
+ }
309
+ return false;
310
+ }
311
+ async function isCopilotKitEndpoint(url, retries = 0) {
312
+ let response;
313
+ try {
314
+ response = await fetch(`${url}/info`, {
315
+ method: "POST",
316
+ body: JSON.stringify({})
317
+ });
318
+ } catch (error) {
319
+ return false;
320
+ }
321
+ if (!response.ok) {
322
+ if (response.status === 502) {
323
+ if (retries < 3) {
324
+ console.log("RETRYING CK", retries + 1);
325
+ return isCopilotKitEndpoint(url, retries + 1);
326
+ }
327
+ }
328
+ return false;
329
+ }
330
+ const data = await response.json();
331
+ if (data.agents && data.actions) {
332
+ return true;
333
+ }
334
+ return false;
335
+ }
336
+
337
+ // src/services/tunnel.service.ts
338
+ import axios from "axios";
339
+ import localtunnel from "localtunnel";
340
+ var TunnelService = class {
341
+ META_DATA_URL = "https://metadata-cdn.copilotkit.ai/cloud.config.json";
342
+ async create(options) {
343
+ return localtunnel(options);
344
+ }
345
+ async getMetaData() {
346
+ const response = await axios.get(this.META_DATA_URL);
347
+ return response.data;
348
+ }
349
+ };
350
+
351
+ // src/commands/base-command.ts
352
+ import { Command } from "@oclif/core";
353
+ import Sentry, { consoleIntegration } from "@sentry/node";
354
+
355
+ // src/utils/version.ts
356
+ var LIB_VERSION = "0.0.7";
357
+
358
+ // src/commands/base-command.ts
359
+ import chalk2 from "chalk";
360
+ var BaseCommand = class extends Command {
361
+ async init() {
362
+ await this.checkCLIVersion();
363
+ if (process.env.SENTRY_DISABLED === "true") {
364
+ return;
365
+ }
366
+ Sentry.init({
367
+ dsn: process.env.SENTRY_DSN || "https://1eea15d32e2eacb0456a77db5e39aeeb@o4507288195170304.ingest.us.sentry.io/4508581448581120",
368
+ integrations: [
369
+ consoleIntegration()
370
+ ],
371
+ // Tracing
372
+ tracesSampleRate: 1
373
+ // Capture 100% of the transactions
374
+ });
375
+ }
376
+ async catch(err) {
377
+ if (process.env.SENTRY_DISABLED === "true") {
378
+ super.catch(err);
379
+ return;
380
+ }
381
+ Sentry.captureException(err);
382
+ super.catch(err);
383
+ }
384
+ async finally() {
385
+ if (process.env.SENTRY_DISABLED === "true") {
386
+ return;
387
+ }
388
+ Sentry.close();
389
+ }
390
+ async run() {
391
+ }
392
+ async checkCLIVersion() {
393
+ const response = await fetch(`${COPILOT_CLOUD_BASE_URL}/api/healthz`);
394
+ const data = await response.json();
395
+ const cloudVersion = data.cliVersion;
396
+ if (cloudVersion === LIB_VERSION) {
397
+ return;
398
+ }
399
+ this.log(chalk2.yellow("================ New version available! =================\n"));
400
+ this.log(`A new CopilotKit CLI version is available (${LIB_VERSION}).
401
+ `);
402
+ this.log("Please update your CLI to the latest version:\n\n");
403
+ this.log(`${chalk2.cyan(chalk2.underline(chalk2.bold("npm:")))} npm install -g copilotkit@${LIB_VERSION}
404
+ `);
405
+ this.log(`${chalk2.cyan(chalk2.underline(chalk2.bold("pnpm:")))} pnpm install -g copilotkit@${LIB_VERSION}
406
+ `);
407
+ this.log(`${chalk2.cyan(chalk2.underline(chalk2.bold("yarn:")))} yarn global add copilotkit@${LIB_VERSION}
408
+ `);
409
+ process.exit(0);
410
+ }
411
+ };
412
+
413
+ // src/commands/dev.ts
414
+ var Dev = class _Dev extends BaseCommand {
415
+ constructor(argv, config, authService = new AuthService(), tunnelService = new TunnelService()) {
416
+ super(argv, config);
417
+ this.authService = authService;
418
+ this.tunnelService = tunnelService;
419
+ }
420
+ static flags = {
421
+ port: Flags.string({ description: "port", required: true }),
422
+ project: Flags.string({ description: "project" })
423
+ };
424
+ static description = "describe the command here";
425
+ static examples = ["<%= config.bin %> <%= command.id %>"];
426
+ trpcClient = null;
427
+ copilotCloudTunnelId = null;
428
+ async pingTunnelRecursively() {
429
+ if (!this.copilotCloudTunnelId) {
430
+ return;
431
+ }
432
+ try {
433
+ await this.trpcClient.pingLocalTunnel.query({
434
+ localTunnelId: this.copilotCloudTunnelId
435
+ });
436
+ } catch (error) {
437
+ if (error?.data?.code === "NOT_FOUND") {
438
+ this.error(error.message);
439
+ } else {
440
+ this.error("Failed to ping tunnel. The connection may have been lost.");
441
+ }
442
+ }
443
+ await new Promise((resolve) => setTimeout(resolve, 5e3));
444
+ await this.pingTunnelRecursively();
445
+ }
446
+ async run() {
447
+ const { flags } = await this.parse(_Dev);
448
+ const { cliToken, organization, user } = await this.authService.requireLogin(this);
449
+ const analytics = new AnalyticsService({ userId: user.id, organizationId: organization.id, email: user.email });
450
+ this.trpcClient = createTRPCClient(cliToken);
451
+ const availableProjects = await this.trpcClient.listOrgProjects.query({ orgId: organization.id });
452
+ let selectedProjectId = null;
453
+ if (flags.project) {
454
+ if (!availableProjects.some((project) => project.id === flags.project)) {
455
+ this.log(chalk3.red(`Project with ID ${flags.project} not found`));
456
+ process.exit(1);
457
+ }
458
+ selectedProjectId = flags.project;
459
+ this.log(chalk3.green(`\u2705 Selected project ${selectedProjectId}`));
460
+ } else {
461
+ const { projectId } = await inquirer2.prompt([
462
+ {
463
+ name: "projectId",
464
+ type: "list",
465
+ message: "Select a project",
466
+ choices: availableProjects.map((project) => ({
467
+ value: project.id,
468
+ name: `${project.name} (ID: ${project.id})${availableProjects.length === 1 ? " (press Enter to confirm)" : ""}`
469
+ }))
470
+ }
471
+ ]);
472
+ selectedProjectId = projectId;
473
+ }
474
+ const { type: remoteEndpointType } = await detectRemoteEndpointType(`http://localhost:${flags.port}`);
475
+ if (remoteEndpointType === "Invalid" /* Invalid */) {
476
+ this.error(
477
+ `Invalid remote endpoint. Please ensure you are running a compatible endpoint at port ${flags.port} and try again.`
478
+ );
479
+ }
480
+ const humanReadableRemoteEndpointType = getHumanReadableEndpointType(remoteEndpointType);
481
+ analytics.track({
482
+ event: "cli.dev.initiatied",
483
+ properties: {
484
+ port: flags.port,
485
+ projectId: selectedProjectId,
486
+ endpointType: remoteEndpointType
487
+ }
488
+ });
489
+ this.log(chalk3.green(`\u2705 ${humanReadableRemoteEndpointType} endpoint detected`));
490
+ const spinner = ora2("Creating tunnel...\n").start();
491
+ const tunnelId = createId();
492
+ const setupTunnel = this.setupTunnel({
493
+ tunnelId,
494
+ port: parseInt(flags.port),
495
+ subdomain: createId(),
496
+ onSuccess: async ({ url, id }) => {
497
+ this.log("\nTunnel Information:\n");
498
+ this.log(`${chalk3.bold.cyan("\u2022 Tunnel URL: ")} ${chalk3.white(url)}`);
499
+ this.log(`${chalk3.bold.cyan("\u2022 Endpoint Type: ")} ${chalk3.white(humanReadableRemoteEndpointType)}`);
500
+ this.log(
501
+ `${chalk3.bold.cyan("\u2022 Project: ")} ${chalk3.white(`${process.env.COPILOT_CLOUD_BASE_URL}/projects/${selectedProjectId}`)}`
502
+ );
503
+ this.log(chalk3.yellow("\nPress Ctrl+C to stop the tunnel"));
504
+ this.log("\n");
505
+ spinner.text = "Linking local tunnel to Copilot Cloud...";
506
+ const { localTunnelId } = await this.trpcClient.reportRemoteEndpointLocalTunnel.mutate({
507
+ tunnelId: id,
508
+ projectId: selectedProjectId,
509
+ endpointType: remoteEndpointType === "CopilotKit" /* CopilotKit */ ? "CopilotKit" : "LangGraphCloud",
510
+ tunnelUrl: url,
511
+ port: parseInt(flags.port)
512
+ });
513
+ this.copilotCloudTunnelId = localTunnelId;
514
+ analytics.track({
515
+ event: "cli.dev.tunnel.created",
516
+ properties: {
517
+ tunnelId: localTunnelId,
518
+ port: flags.port,
519
+ projectId: selectedProjectId,
520
+ endpointType: remoteEndpointType
521
+ }
522
+ });
523
+ spinner.color = "green";
524
+ spinner.text = "\u{1F680} Local tunnel is live and linked to Copilot Cloud!\n";
525
+ spinner.succeed();
526
+ await this.pingTunnelRecursively();
527
+ },
528
+ onTunnelClose: async ({ id }) => {
529
+ if (this.copilotCloudTunnelId) {
530
+ analytics.track({
531
+ event: "cli.dev.tunnel.closed",
532
+ properties: {
533
+ tunnelId: id
534
+ }
535
+ });
536
+ await this.trpcClient.deleteLocalTunnel.mutate({
537
+ localTunnelId: this.copilotCloudTunnelId
538
+ });
539
+ this.copilotCloudTunnelId = null;
540
+ }
541
+ },
542
+ spinner
543
+ });
544
+ await Promise.all([setupTunnel]);
545
+ }
546
+ async setupTunnel({
547
+ port,
548
+ subdomain,
549
+ onSuccess,
550
+ onTunnelClose,
551
+ spinner,
552
+ tunnelId
553
+ }) {
554
+ const tunnel = await this.tunnelService.create({
555
+ port,
556
+ subdomain: tunnelId
557
+ });
558
+ tunnel.on("request", (info) => {
559
+ this.log(`${chalk3.green("\u279C")} ${chalk3.white((/* @__PURE__ */ new Date()).toISOString())} - ${info.method} ${info.path}`);
560
+ });
561
+ tunnel.on("error", (err) => {
562
+ this.error(chalk3.red(`Tunnel error: ${err.message}`));
563
+ });
564
+ tunnel.on("close", async () => {
565
+ this.log(chalk3.yellow("\nTunnel closed"));
566
+ await onTunnelClose({ id: tunnelId });
567
+ process.exit(0);
568
+ });
569
+ await Promise.all([
570
+ new Promise(() => {
571
+ process.on("SIGINT", async () => {
572
+ this.log("\nShutting down tunnel...");
573
+ await onTunnelClose({ id: tunnelId });
574
+ tunnel.close();
575
+ process.exit(0);
576
+ });
577
+ process.on("SIGTERM", async () => {
578
+ this.log("\nShutting down tunnel...");
579
+ await onTunnelClose({ id: tunnelId });
580
+ tunnel.close();
581
+ process.exit(0);
582
+ });
583
+ }),
584
+ onSuccess({ url: tunnel.url, id: tunnelId })
585
+ ]);
586
+ }
587
+ };
588
+ export {
589
+ Dev as default
590
+ };
591
+ //# sourceMappingURL=dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/commands/dev.ts","../../src/services/auth.service.ts","../../src/utils/trpc.ts","../../src/services/analytics.service.ts","../../src/utils/detect-endpoint-type.utils.ts","../../src/services/tunnel.service.ts","../../src/commands/base-command.ts","../../src/utils/version.ts"],"sourcesContent":["import {Config, Flags} from '@oclif/core'\nimport inquirer from 'inquirer'\nimport {createId} from '@paralleldrive/cuid2'\nimport ora, {Ora} from 'ora'\nimport chalk from 'chalk'\n\nimport {AuthService} from '../services/auth.service.js'\nimport {createTRPCClient} from '../utils/trpc.js'\nimport {\n detectRemoteEndpointType,\n getHumanReadableEndpointType,\n RemoteEndpointType,\n} from '../utils/detect-endpoint-type.utils.js'\nimport {TunnelService} from '../services/tunnel.service.js'\nimport {AnalyticsService} from '../services/analytics.service.js'\nimport {BaseCommand} from './base-command.js'\n\nexport default class Dev extends BaseCommand {\n static override flags = {\n port: Flags.string({description: 'port', required: true}),\n project: Flags.string({description: 'project'}),\n }\n\n static override description = 'describe the command here'\n static override examples = ['<%= config.bin %> <%= command.id %>']\n\n private trpcClient: ReturnType<typeof createTRPCClient> | null = null\n private copilotCloudTunnelId: string | null = null\n\n constructor(\n argv: string[],\n config: Config,\n private authService = new AuthService(),\n private tunnelService = new TunnelService(),\n ) {\n super(argv, config)\n }\n\n private async pingTunnelRecursively(): Promise<void> {\n if (!this.copilotCloudTunnelId) {\n return\n }\n\n try {\n await this.trpcClient!.pingLocalTunnel.query({\n localTunnelId: this.copilotCloudTunnelId!,\n })\n } catch (error: any) {\n if (error?.data?.code === 'NOT_FOUND') {\n this.error(error.message)\n } else {\n this.error('Failed to ping tunnel. The connection may have been lost.')\n }\n }\n\n await new Promise((resolve) => setTimeout(resolve, 5000))\n await this.pingTunnelRecursively()\n }\n\n public async run(): Promise<void> {\n const {flags} = await this.parse(Dev)\n\n // Check authentication\n const {cliToken, organization, user} = await this.authService.requireLogin(this)\n const analytics = new AnalyticsService({userId: user.id, organizationId: organization.id, email: user.email})\n\n this.trpcClient = createTRPCClient(cliToken)\n\n const availableProjects = await this.trpcClient.listOrgProjects.query({orgId: organization.id})\n let selectedProjectId: string | null = null\n\n // Get project ID\n if (flags.project) {\n if (!availableProjects.some((project: any) => project.id === flags.project)) {\n this.log(chalk.red(`Project with ID ${flags.project} not found`))\n process.exit(1)\n }\n\n selectedProjectId = flags.project\n this.log(chalk.green(`✅ Selected project ${selectedProjectId}`))\n } else {\n const {projectId} = await inquirer.prompt([\n {\n name: 'projectId',\n type: 'list',\n message: 'Select a project',\n choices: availableProjects.map((project: any) => ({\n value: project.id,\n name: `${project.name} (ID: ${project.id})${availableProjects.length === 1 ? ' (press Enter to confirm)' : ''}`,\n })),\n },\n ])\n\n selectedProjectId = projectId\n }\n\n // Remote endpoint type detection\n const {type: remoteEndpointType} = await detectRemoteEndpointType(`http://localhost:${flags.port}`)\n\n if (remoteEndpointType === RemoteEndpointType.Invalid) {\n this.error(\n `Invalid remote endpoint. Please ensure you are running a compatible endpoint at port ${flags.port} and try again.`,\n )\n }\n\n const humanReadableRemoteEndpointType = getHumanReadableEndpointType(remoteEndpointType)\n\n analytics.track({\n event: 'cli.dev.initiatied',\n properties: {\n port: flags.port,\n projectId: selectedProjectId!,\n endpointType: remoteEndpointType,\n },\n })\n\n this.log(chalk.green(`✅ ${humanReadableRemoteEndpointType} endpoint detected`))\n const spinner = ora('Creating tunnel...\\n').start()\n\n const tunnelId = createId()\n\n // Starting tunnel\n const setupTunnel = this.setupTunnel({\n tunnelId,\n port: parseInt(flags.port),\n subdomain: createId(),\n onSuccess: async ({url, id}) => {\n // Print tunnel info\n this.log('\\nTunnel Information:\\n')\n this.log(`${chalk.bold.cyan('• Tunnel URL:\\t\\t')} ${chalk.white(url)}`)\n this.log(`${chalk.bold.cyan('• Endpoint Type:\\t')} ${chalk.white(humanReadableRemoteEndpointType)}`)\n this.log(\n `${chalk.bold.cyan('• Project:\\t\\t')} ${chalk.white(`${process.env.COPILOT_CLOUD_BASE_URL}/projects/${selectedProjectId!}`)}`,\n )\n this.log(chalk.yellow('\\nPress Ctrl+C to stop the tunnel'))\n this.log('\\n')\n\n spinner.text = 'Linking local tunnel to Copilot Cloud...'\n\n // Report to Cloud\n const {localTunnelId} = await this.trpcClient!.reportRemoteEndpointLocalTunnel.mutate({\n tunnelId: id,\n projectId: selectedProjectId!,\n endpointType: remoteEndpointType === RemoteEndpointType.CopilotKit ? 'CopilotKit' : 'LangGraphCloud',\n tunnelUrl: url,\n port: parseInt(flags.port),\n })\n\n this.copilotCloudTunnelId = localTunnelId\n\n analytics.track({\n event: 'cli.dev.tunnel.created',\n properties: {\n tunnelId: localTunnelId,\n port: flags.port,\n projectId: selectedProjectId!,\n endpointType: remoteEndpointType,\n },\n })\n\n spinner.color = 'green'\n spinner.text = '🚀 Local tunnel is live and linked to Copilot Cloud!\\n'\n spinner.succeed()\n\n await this.pingTunnelRecursively()\n },\n onTunnelClose: async ({id}) => {\n if (this.copilotCloudTunnelId) {\n analytics.track({\n event: 'cli.dev.tunnel.closed',\n properties: {\n tunnelId: id,\n },\n })\n\n await this.trpcClient!.deleteLocalTunnel.mutate({\n localTunnelId: this.copilotCloudTunnelId!,\n })\n this.copilotCloudTunnelId = null\n }\n },\n spinner,\n })\n\n await Promise.all([setupTunnel])\n }\n\n private async setupTunnel({\n port,\n subdomain,\n onSuccess,\n onTunnelClose,\n spinner,\n tunnelId,\n }: {\n port: number\n subdomain?: string\n onSuccess: (params: {url: string; id: string}) => Promise<void>\n onTunnelClose: (params: {id: string}) => Promise<void>\n spinner: Ora\n tunnelId: string\n }) {\n // Create the tunnel using the service\n const tunnel = await this.tunnelService.create({\n port,\n subdomain: tunnelId,\n })\n // Handle tunnel events\n tunnel.on('request', (info) => {\n this.log(`${chalk.green('➜')} ${chalk.white(new Date().toISOString())} - ${info.method} ${info.path}`)\n })\n\n tunnel.on('error', (err) => {\n this.error(chalk.red(`Tunnel error: ${err.message}`))\n })\n\n tunnel.on('close', async () => {\n this.log(chalk.yellow('\\nTunnel closed'))\n // eslint-disable-next-line n/no-process-exit, unicorn/no-process-exit\n await onTunnelClose({id: tunnelId})\n process.exit(0)\n })\n\n // Keep the process alive until Ctrl+C\n await Promise.all([\n new Promise<void>(() => {\n process.on('SIGINT', async () => {\n this.log('\\nShutting down tunnel...')\n await onTunnelClose({id: tunnelId})\n tunnel.close()\n process.exit(0)\n })\n\n process.on('SIGTERM', async () => {\n this.log('\\nShutting down tunnel...')\n await onTunnelClose({id: tunnelId})\n tunnel.close()\n process.exit(0)\n })\n }),\n onSuccess({url: tunnel.url, id: tunnelId}),\n ])\n }\n}\n","// @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'\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(): Promise<void> {\n const cliToken = this.getCLIToken();\n \n if (!cliToken) {\n throw new Error('You are not logged in');\n }\n\n const trpcClient = createTRPCClient(cliToken)\n const me = await trpcClient.me.query()\n\n const analytics = new AnalyticsService({ userId: me.user!.id, organizationId: me.organization!.id, email: me.user!.email });\n \n this.config.delete('cliToken')\n \n analytics.track({\n event: \"cli.logout\",\n properties: {\n organizationId: me.organization!.id,\n userId: me.user!.id,\n email: me.user!.email,\n }\n });\n }\n\n async requireLogin(cmd: Command): Promise<LoginResponse> {\n let cliToken = this.getCLIToken()\n\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\n if (shouldLogin) {\n const loginResult = await this.login()\n cliToken = loginResult.cliToken\n cmd.log(`🪁 Logged in as ${chalk.hex('#7553fc')(loginResult.user.email)}\\n`)\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(): Promise<LoginResponse> {\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((resolve) => {\n const server = app.listen(port, () => {})\n\n analytics.track({\n event: \"cli.login.initiated\",\n properties: {}\n });\n\n const spinner = ora('Waiting for browser authentication to complete...\\n').start()\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 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`)\n server.close()\n resolve({\n cliToken,\n organization,\n user,\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 createTRPClient_, unstable_httpBatchStreamLink} from '@trpc/client'\nimport type {CLIRouter} from '@repo/trpc-cli/cli-router'\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) {\n return createTRPClient_<CLIRouter>({\n links: [\n unstable_httpBatchStreamLink({\n transformer: superjson,\n url: `${COPILOT_CLOUD_BASE_URL}/api/trpc-cli`,\n headers: () => {\n const headers = new Headers()\n headers.set('x-trpc-source', 'cli')\n headers.set('x-cli-token', cliToken)\n return headers\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 ): void {\n if (!this.segment) {\n return;\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 this.segment.track(payload)\n }\n}\n","import { TRPCError } from \"@trpc/server\";\nimport { z } from \"zod\";\n\nexport enum RemoteEndpointType {\n LangGraphPlatform = 'LangGraphPlatform',\n CopilotKit = 'CopilotKit',\n Invalid = 'Invalid',\n}\n\nconst removeTrailingSlash = (url: string) => url.replace(/\\/$/, '');\n\nexport const getHumanReadableEndpointType = (type: RemoteEndpointType) => {\n switch (type) {\n case RemoteEndpointType.LangGraphPlatform:\n return 'LangGraph Platform';\n case RemoteEndpointType.CopilotKit:\n return 'CopilotKit';\n default:\n return 'Invalid';\n }\n}\n\nexport async function detectRemoteEndpointType(url: string): Promise<{\n url: string;\n type: RemoteEndpointType;\n humanReadableType: string;\n}> {\n\n const promises = [\n isLangGraphPlatformEndpoint(url),\n isCopilotKitEndpoint(url),\n ];\n\n if (!url.endsWith('/copilotkit')) {\n promises.push(isCopilotKitEndpoint(`${removeTrailingSlash(url)}/copilotkit`));\n }\n\n const results = await Promise.all(promises);\n\n // LangGraph Platform\n if (results[0]) {\n return {\n url,\n type: RemoteEndpointType.LangGraphPlatform,\n humanReadableType: 'LangGraph Platform',\n }\n }\n\n // CopilotKit\n if (results[1]) {\n return {\n url,\n type: RemoteEndpointType.CopilotKit,\n humanReadableType: 'CopilotKit',\n }\n }\n\n // CopilotKit with appended /copilotkit\n if (results[2]) {\n return {\n url: `${removeTrailingSlash(url)}/copilotkit`,\n type: RemoteEndpointType.CopilotKit,\n humanReadableType: 'CopilotKit',\n }\n }\n\n return {\n url,\n type: RemoteEndpointType.Invalid,\n humanReadableType: 'Invalid',\n };\n}\n\nasync function isLangGraphPlatformEndpoint(url: string, retries: number = 0): Promise<boolean> {\n let response\n\n try {\n response = await fetch(`${url}/assistants/search`, {\n method: 'POST',\n\n body: JSON.stringify({\n metadata: {},\n limit: 99,\n offset: 0,\n }),\n });\n } catch (error) {\n return false;\n }\n\n if (!response.ok) {\n if (response.status === 502) {\n if (retries < 3) {\n console.log(\"RETRYING LGC\", retries + 1);\n return isLangGraphPlatformEndpoint(url, retries + 1);\n }\n }\n\n if (response.status === 403) {\n return true;\n }\n\n return false;\n }\n\n const data = await response.json();\n\n if (data[0].assistant_id) {\n return true;\n }\n\n return false;\n}\n\nasync function isCopilotKitEndpoint(url: string, retries: number = 0): Promise<boolean> {\n let response\n\n try {\n response = await fetch(`${url}/info`, {\n method: \"POST\",\n body: JSON.stringify({}),\n });\n } catch (error) {\n return false;\n }\n\n if (!response.ok) {\n if (response.status === 502) {\n if (retries < 3) {\n console.log(\"RETRYING CK\", retries + 1);\n return isCopilotKitEndpoint(url, retries + 1);\n }\n }\n\n return false;\n }\n\n const data = await response.json();\n\n if (data.agents && data.actions) {\n return true;\n }\n\n return false;\n}","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 return localtunnel(options)\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","import { Command } from \"@oclif/core\";\nimport Sentry, { consoleIntegration } from \"@sentry/node\";\nimport { LIB_VERSION } from \"../utils/version.js\";\nimport { COPILOT_CLOUD_BASE_URL } from \"../utils/trpc.js\";\nimport chalk from \"chalk\";\n\nexport class BaseCommand extends Command {\n async init() {\n await this.checkCLIVersion();\n\n if (process.env.SENTRY_DISABLED === 'true') {\n return;\n }\n\n Sentry.init({\n dsn: process.env.SENTRY_DSN || \"https://1eea15d32e2eacb0456a77db5e39aeeb@o4507288195170304.ingest.us.sentry.io/4508581448581120\",\n integrations: [\n consoleIntegration(),\n ],\n // Tracing\n tracesSampleRate: 1.0, // Capture 100% of the transactions\n });\n }\n\n async catch(err: any) {\n if (process.env.SENTRY_DISABLED === 'true') {\n super.catch(err)\n return;\n }\n\n Sentry.captureException(err)\n super.catch(err)\n }\n\n async finally() {\n if (process.env.SENTRY_DISABLED === 'true') {\n return;\n }\n\n Sentry.close()\n }\n \n async run() {}\n\n async checkCLIVersion() {\n const response = await fetch(`${COPILOT_CLOUD_BASE_URL}/api/healthz`)\n const data = await response.json()\n const cloudVersion = data.cliVersion\n\n if (cloudVersion === LIB_VERSION) {\n return;\n }\n\n this.log(chalk.yellow('================ New version available! =================\\n'))\n this.log(`A new CopilotKit CLI version is available (${LIB_VERSION}).\\n`)\n this.log('Please update your CLI to the latest version:\\n\\n')\n this.log(`${chalk.cyan(chalk.underline(chalk.bold('npm:')))}\\t npm install -g copilotkit@${LIB_VERSION}\\n`)\n this.log(`${chalk.cyan(chalk.underline(chalk.bold('pnpm:')))}\\t pnpm install -g copilotkit@${LIB_VERSION}\\n`)\n this.log(`${chalk.cyan(chalk.underline(chalk.bold('yarn:')))}\\t yarn global add copilotkit@${LIB_VERSION}\\n`)\n\n process.exit(0)\n }\n}\n","// This is auto generated!\nexport const LIB_VERSION = \"0.0.7\";\n"],"mappings":";AAAA,SAAgB,aAAY;AAC5B,OAAOA,eAAc;AACrB,SAAQ,gBAAe;AACvB,OAAOC,UAAgB;AACvB,OAAOC,YAAW;;;ACHlB,OAAOC,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,kBAAkB,oCAAmC;AAEjF,OAAO,eAAe;AAEf,IAAM,yBAAyB,QAAQ,IAAI,0BAA0B;AAErE,SAAS,iBAAiB,UAAkB;AACjD,SAAO,iBAA4B;AAAA,IACjC,OAAO;AAAA,MACL,6BAA6B;AAAA,QAC3B,aAAa;AAAA,QACb,KAAK,GAAG,sBAAsB;AAAA,QAC9B,SAAS,MAAM;AACb,gBAAM,UAAU,IAAI,QAAQ;AAC5B,kBAAQ,IAAI,iBAAiB,KAAK;AAClC,kBAAQ,IAAI,eAAe,QAAQ;AACnC,iBAAO;AAAA,QACT;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AACH;;;ACrBA,SAAQ,iBAAgB;AAExB,OAAO,UAAU;AAEV,IAAM,mBAAN,MAAuB;AAAA,EAQ5B,YAA6B,UAI1B;AAJ0B;AAK3B,QAAI,QAAQ,IAAI,qBAAqB,QAAQ;AAC3C;AAAA,IACF;AAEA,UAAM,kBAAkB,QAAQ,IAAI,qBA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","crypto","anonymousId","Conf","crypto","chalk","chalk","inquirer","ora"]}
@@ -0,0 +1,13 @@
1
+ import { Config } from '@oclif/core';
2
+ import { AuthService } from '../services/auth.service.js';
3
+ import { BaseCommand } from './base-command.js';
4
+
5
+ declare class CloudLogin extends BaseCommand {
6
+ private authService;
7
+ static description: string;
8
+ static examples: string[];
9
+ constructor(argv: string[], config: Config, authService?: AuthService);
10
+ run(): Promise<void>;
11
+ }
12
+
13
+ export { CloudLogin as default };