From ba07b808558c18bee64a55f826d76137a19ee78c Mon Sep 17 00:00:00 2001 From: Nate Date: Sun, 20 Jul 2025 19:47:31 -0700 Subject: [PATCH] adjustments to remote mode --- src/commands/remote-test.ts | 2 +- src/commands/remote.ts | 4 ++-- src/index.ts | 2 +- src/ui/TUIChat.tsx | 3 +-- src/ui/UpdateNotification.tsx | 9 ++++++++- test-remote-tui.sh | 2 +- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/commands/remote-test.ts b/src/commands/remote-test.ts index 8068a91ac..119cbc1d0 100644 --- a/src/commands/remote-test.ts +++ b/src/commands/remote-test.ts @@ -4,7 +4,7 @@ import { startRemoteTUIChat } from "../ui/index.js"; import logger from "../util/logger.js"; export async function remoteTest( - prompt: string, + prompt?: string, url: string = "http://localhost:8000" ) { console.info(chalk.white(`Connecting to remote environment at ${url}...`)); diff --git a/src/commands/remote.ts b/src/commands/remote.ts index 58adacfd3..fb766ddbd 100644 --- a/src/commands/remote.ts +++ b/src/commands/remote.ts @@ -62,8 +62,8 @@ export async function remote(prompt: string) { telemetryService.startActiveTime(); try { - // Start the TUI in remote mode - await startRemoteTUIChat(remoteUrl, prompt); + // Start the TUI in remote mode (prompt is optional) + await startRemoteTUIChat(remoteUrl, undefined); } finally { telemetryService.stopActiveTime(); } diff --git a/src/index.ts b/src/index.ts index a8ebac5e5..888f51e0f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -135,7 +135,7 @@ program .command("remote-test [prompt]") .description("Test remote TUI mode with a local server") .option("--url ", "Server URL (default: http://localhost:8000)") - .action(async (prompt: string = "Hello from remote!", options) => { + .action(async (prompt: string | undefined, options) => { await remoteTest(prompt, options.url); }); diff --git a/src/ui/TUIChat.tsx b/src/ui/TUIChat.tsx index 64ad9be6c..bcb8b1536 100644 --- a/src/ui/TUIChat.tsx +++ b/src/ui/TUIChat.tsx @@ -393,10 +393,9 @@ const TUIChat: React.FC = ({ onTransitionStateChange={setIsShowingFreeTrialTransition} /> )} - {isRemoteMode && Remote Mode} - + diff --git a/src/ui/UpdateNotification.tsx b/src/ui/UpdateNotification.tsx index 5a80b5632..6890aeb69 100644 --- a/src/ui/UpdateNotification.tsx +++ b/src/ui/UpdateNotification.tsx @@ -2,7 +2,11 @@ import { Text } from "ink"; import React, { useEffect, useState } from "react"; import { compareVersions, getLatestVersion, getVersion } from "../version.js"; -const UpdateNotification: React.FC = () => { +interface UpdateNotificationProps { + isRemoteMode?: boolean; +} + +const UpdateNotification: React.FC = ({ isRemoteMode = false }) => { const [updateAvailable, setUpdateAvailable] = useState(false); const [latestVersion, setLatestVersion] = useState(""); const [currentVersion] = useState(getVersion()); @@ -27,6 +31,9 @@ const UpdateNotification: React.FC = () => { }, [currentVersion]); if (!updateAvailable) { + if (isRemoteMode) { + return ◉ Remote Mode; + } return ● Continue CLI; } diff --git a/test-remote-tui.sh b/test-remote-tui.sh index 7467515ac..006b628f9 100755 --- a/test-remote-tui.sh +++ b/test-remote-tui.sh @@ -19,7 +19,7 @@ echo "" echo " This will connect to the local server and you'll see:" echo " - The input border will be cyan instead of gray" echo " - The prompt icon will be ◉ instead of ●" -echo " - 'Remote Mode' will be shown at the bottom" +echo " - 'Remote Mode' will replace 'Continue CLI' at the bottom right" echo "" echo "Press Ctrl+C to stop the server..."