From d1cf57506413c2e358a2663b5b16ac07509b8535 Mon Sep 17 00:00:00 2001 From: Adam Jeniski Date: Tue, 20 Jan 2026 16:59:03 -0500 Subject: [PATCH] session maangement updates --- client/src/lib/api.ts | 25 +++++ client/src/lib/components/MessageList.svelte | 24 ++--- client/src/lib/components/TerminalView.svelte | 72 ++++++++------ client/src/routes/+page.svelte | 99 ++++++++++++++++++- script/dev | 2 +- server/src/spiceflow/adapters/tmux.clj | 40 +++++++- server/src/spiceflow/api/routes.clj | 41 +++++--- 7 files changed, 241 insertions(+), 62 deletions(-) diff --git a/client/src/lib/api.ts b/client/src/lib/api.ts index f034be6..ada8717 100644 --- a/client/src/lib/api.ts +++ b/client/src/lib/api.ts @@ -97,6 +97,19 @@ export interface TerminalContent { layout?: 'desktop' | 'landscape' | 'portrait'; } +export interface ExternalTmuxSession { + name: string; + 'working-dir': string; + workingDir?: string; +} + +export interface ImportedSession { + id: string; + name: string; + 'working-dir': string; + workingDir?: string; +} + class ApiClient { private baseUrl: string; @@ -197,6 +210,18 @@ class ApiClient { body: JSON.stringify({ mode }) }); } + + // External tmux sessions + async getExternalTmuxSessions(): Promise { + return this.request('/tmux/external'); + } + + async importTmuxSession(name: string): Promise { + return this.request('/tmux/import', { + method: 'POST', + body: JSON.stringify({ name }) + }); + } } export const api = new ApiClient(); diff --git a/client/src/lib/components/MessageList.svelte b/client/src/lib/components/MessageList.svelte index ce63ac9..c44ddde 100644 --- a/client/src/lib/components/MessageList.svelte +++ b/client/src/lib/components/MessageList.svelte @@ -1,6 +1,6 @@ Spiceflow - (showNewSessionMenu = false)} /> + { showNewSessionMenu = false; showImportMenu = false; }} />
@@ -49,9 +87,64 @@
+
+ + {#if showImportMenu} +
+
+ Import tmux session +
+ {#if loadingExternal} +
+ + + + + Loading... +
+ {:else if externalSessions.length === 0} +
+ No external tmux sessions +
+ {:else} + {#each externalSessions as session} + + {/each} + {/if} +
+ {/if} +
+ + +
+