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.
This commit is contained in:
vhaudiquet committed 2026-11-28 01:09:37 +01:00
1 parent 04dd63c4ca
commit 0035f4e031
69 files changed
+22501 -48

No files matched your search

+49
View File
@@ -0,0 +1,49 @@
<script setup lang="ts">
import { computed } from 'vue'
import type { Message } from '~/types'
import { fullTime, relativeTime } from '~/utils/format'
import { memberColorVar } from '~/utils/member'
const props = defineProps<{ message: Message; color?: string | null }>()
const segments = computed(() => {
const parts = props.message.text.split(/(@rhema\b)/gi)
return parts
.filter((part) => part.length > 0)
.map((part) => ({ text: part, mention: /^@rhema$/i.test(part) }))
})
const style = computed(() => ({ '--member': memberColorVar(props.color) }))
</script>
<template>
<div v-if="message.author_kind === 'system'" class="msg msg-system">
{{ message.text }}
</div>
<div v-else-if="message.author_kind === 'agent'" class="msg msg-agent">
<div class="msg-head">
<span class="msg-agent-label">rhema</span>
<span class="msg-time" :title="fullTime(message.created_at)">{{ relativeTime(message.created_at) }}</span>
</div>
<div class="msg-text">
<template v-for="(segment, index) in segments" :key="index">
<span v-if="segment.mention" class="mention">{{ segment.text }}</span>
<template v-else>{{ segment.text }}</template>
</template>
</div>
</div>
<div v-else class="msg">
<div class="msg-head">
<span class="msg-author member-name" :style="style">{{ message.author_name }}</span>
<span class="msg-time" :title="fullTime(message.created_at)">{{ relativeTime(message.created_at) }}</span>
</div>
<div class="msg-text">
<template v-for="(segment, index) in segments" :key="index">
<span v-if="segment.mention" class="mention">{{ segment.text }}</span>
<template v-else>{{ segment.text }}</template>
</template>
</div>
</div>
</template>