adjustments to remote mode
This commit is contained in:
parent
72e91d5c10
commit
ba07b80855
6 changed files with 14 additions and 8 deletions
|
|
@ -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}...`));
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ program
|
|||
.command("remote-test [prompt]")
|
||||
.description("Test remote TUI mode with a local server")
|
||||
.option("--url <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);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -393,10 +393,9 @@ const TUIChat: React.FC<TUIChatProps> = ({
|
|||
onTransitionStateChange={setIsShowingFreeTrialTransition}
|
||||
/>
|
||||
)}
|
||||
{isRemoteMode && <Text color="cyan">Remote Mode</Text>}
|
||||
</Box>
|
||||
<Box marginRight={2}>
|
||||
<UpdateNotification />
|
||||
<UpdateNotification isRemoteMode={isRemoteMode} />
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
|
|
|
|||
|
|
@ -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<UpdateNotificationProps> = ({ isRemoteMode = false }) => {
|
||||
const [updateAvailable, setUpdateAvailable] = useState(false);
|
||||
const [latestVersion, setLatestVersion] = useState<string>("");
|
||||
const [currentVersion] = useState(getVersion());
|
||||
|
|
@ -27,6 +31,9 @@ const UpdateNotification: React.FC = () => {
|
|||
}, [currentVersion]);
|
||||
|
||||
if (!updateAvailable) {
|
||||
if (isRemoteMode) {
|
||||
return <Text color="cyan">◉ Remote Mode</Text>;
|
||||
}
|
||||
return <Text color="gray">● Continue CLI</Text>;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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..."
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue