Elffuss BraidHub

kikocis/continue public

8eb3ae7b8d16 · 803 BRawPermalink
1import chalk from "chalk";
2
3import { telemetryService } from "../telemetry/telemetryService.js";
4import { startRemoteTUIChat } from "../ui/index.js";
5import { logger } from "../util/logger.js";
6
7export async function remoteTest(
8 prompt?: string,
9 url: string = "http://localhost:8000",
10) {
11 console.info(chalk.white(`Connecting to remote environment at ${url}...`));
12
13 try {
14 // Record session start
15 telemetryService.recordSessionStart();
16 telemetryService.startActiveTime();
17
18 try {
19 // Start the TUI in remote mode
20 await startRemoteTUIChat(url, prompt);
21 } finally {
22 telemetryService.stopActiveTime();
23 }
24 } catch (error: any) {
25 logger.error(
26 chalk.red(`Failed to connect to remote environment: ${error.message}`),
27 );
28 process.exit(1);
29 }
30}