Files
rhema-together/web/app/layouts/default.vue
T
vhaudiquet 0035f4e031 feat: add the multiplayer room server and client
A room is one conversation, one ssh sandbox, and one agent. Accounts
create rooms; friends join through a single-use invite link and a
display name; the agent speaks only through the message tool.

The server is Axum and SQLite. It serves the built Nuxt client, streams
room events over SSE, and runs one serialized turn loop per room with
turn-level steering copied from rhema-code. The client has the chat,
preview iframe, read-only file pane, xterm terminal, and presence.

Preview URLs are signed wildcard hosts, and the proxy tunnels HTTP over
ssh direct-tcpip. HostAgent::step remains deferred in the framework.
2026-11-28 01:09:37 +01:00

95 lines
2.5 KiB
Vue

<script setup lang="ts">
import { onMounted, watch } from 'vue'
import { LogOut, Plus, Settings } from 'lucide-vue-next'
const { user, signOut, session } = useSession()
const {
rooms: roomList,
loading: roomsLoading,
error: roomsError,
creating,
openCreate,
closeCreate,
refresh: refreshRooms,
} = useRooms()
onMounted(() => {
if (session.value.loaded && user.value) void refreshRooms()
})
watch(user, (current) => {
if (current) void refreshRooms()
})
async function onSignOut() {
await signOut()
}
</script>
<template>
<div class="app-shell">
<aside class="sidebar">
<div class="sidebar-top">
<NuxtLink to="/rooms" class="sidebar-brand">
<span class="sidebar-brand-mark" aria-hidden="true">r</span>
<span>rhema together</span>
</NuxtLink>
</div>
<div class="sidebar-label">
<span>Rooms</span>
<button
type="button"
class="icon-btn"
aria-label="New room"
title="New room"
@click="openCreate()"
>
<Plus :size="16" aria-hidden="true" />
</button>
</div>
<nav class="sidebar-rooms" aria-label="Rooms">
<p v-if="roomsLoading && roomList.length === 0" class="sidebar-room muted">Loading rooms.</p>
<p v-else-if="roomsError" class="sidebar-room muted">{{ roomsError }}</p>
<p v-else-if="roomList.length === 0" class="sidebar-room muted">No rooms yet.</p>
<NuxtLink
v-for="room in roomList"
:key="room.id"
:to="`/room/${room.id}`"
class="sidebar-room"
:title="room.name"
>
{{ room.name }}
</NuxtLink>
</nav>
<div class="sidebar-bottom">
<NuxtLink to="/settings" class="sidebar-link">
<Settings :size="16" aria-hidden="true" />
<span>Settings</span>
</NuxtLink>
<div class="sidebar-account">
<AppAvatar v-if="user" :name="user.display_name" color="var(--member-1)" size="sm" />
<span class="sidebar-account-name" :title="user?.handle">{{ user?.display_name }}</span>
<button
type="button"
class="icon-btn"
aria-label="Sign out"
title="Sign out"
@click="onSignOut"
>
<LogOut :size="16" aria-hidden="true" />
</button>
</div>
</div>
</aside>
<div class="main">
<slot />
</div>
<NewRoomDialog v-if="creating" @close="closeCreate()" />
</div>
</template>