feat(cli): add login command and authenticated TUI sessions (#114)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful

Co-authored-by: Jason Woltje <jason@diversecanvas.com>
Co-committed-by: Jason Woltje <jason@diversecanvas.com>
This commit was merged in pull request #114.
This commit is contained in:
2026-03-15 17:00:08 +00:00
committed by jason.woltje
parent 8aaf229483
commit 997a6d134f
3 changed files with 200 additions and 8 deletions

View File

@@ -12,9 +12,14 @@ interface Message {
interface TuiAppProps {
gatewayUrl: string;
conversationId?: string;
sessionCookie?: string;
}
export function TuiApp({ gatewayUrl, conversationId: initialConversationId }: TuiAppProps) {
export function TuiApp({
gatewayUrl,
conversationId: initialConversationId,
sessionCookie,
}: TuiAppProps) {
const { exit } = useApp();
const [messages, setMessages] = useState<Message[]>([]);
const [input, setInput] = useState('');
@@ -27,6 +32,7 @@ export function TuiApp({ gatewayUrl, conversationId: initialConversationId }: Tu
useEffect(() => {
const socket = io(`${gatewayUrl}/chat`, {
transports: ['websocket'],
extraHeaders: sessionCookie ? { Cookie: sessionCookie } : undefined,
});
socketRef.current = socket;