feat: interactive ephemeral terminal per transcript session

Replace one-shot HTTP POST sendPrompt with a persistent ephemeral
terminal per session. Terminal auto-starts on session select, stays
running in background when modal is closed, and gets killed on
session switch or page unload.

- Add sendInput() to useEphemeralTerminal (text + Enter as separate WS messages)
- useTranscriptDebug owns terminal lifecycle (create/dispose on select/switch)
- ResumeTerminalButton receives shared terminal prop, only toggles modal
- UserInput shows "Starting terminal..." when not ready
- Add "New Session" button that starts a fresh agent session
- beforeunload sends sendBeacon to kill terminal on page close
This commit is contained in:
2026-02-19 18:55:23 -06:00
parent eb2bafaea1
commit 016e92ffe5
7 changed files with 233 additions and 108 deletions

View File

@@ -30,9 +30,12 @@ const {
error,
isRealtime,
processing,
ephemeral,
terminalReady,
init,
switchAgent,
selectSession,
createNewSession,
disconnectRealtime,
sendPrompt
} = useTranscriptDebug()
@@ -335,6 +338,10 @@ function handleSend(message: string) {
sendPrompt(message)
}
function handleCreateSession() {
createNewSession()
}
// ============================================================================
// WATCHERS
// ============================================================================
@@ -485,6 +492,8 @@ onBeforeUnmount(() => {
v-if="conversation"
:conversation="conversation"
:processing="processing"
:terminal-ready="terminalReady"
:terminal="ephemeral"
:show-selector="showSelector"
:agents="agents"
:selected-agent="selectedAgent"
@@ -494,6 +503,7 @@ onBeforeUnmount(() => {
@send="handleSend"
@switch-agent="handleAgentSwitch"
@select-session="handleSessionSelect"
@create-session="handleCreateSession"
/>
<div v-else class="empty-state">
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">