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:
@@ -17,9 +17,12 @@ const {
|
||||
isRealtime,
|
||||
sending,
|
||||
processing,
|
||||
ephemeral,
|
||||
terminalReady,
|
||||
init,
|
||||
switchAgent,
|
||||
selectSession,
|
||||
createNewSession,
|
||||
disconnectRealtime,
|
||||
sendPrompt
|
||||
} = useTranscriptDebug()
|
||||
@@ -34,6 +37,10 @@ function handleSend(message: string) {
|
||||
sendPrompt(message)
|
||||
}
|
||||
|
||||
function handleCreateSession() {
|
||||
createNewSession()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init()
|
||||
})
|
||||
@@ -109,8 +116,11 @@ onUnmounted(() => {
|
||||
v-if="conversation"
|
||||
:conversation="conversation"
|
||||
:processing="processing"
|
||||
:terminal-ready="terminalReady"
|
||||
:terminal="ephemeral"
|
||||
:selected-agent="selectedAgent"
|
||||
@send="handleSend"
|
||||
@create-session="handleCreateSession"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user