android / debug (push) Successful in 2m16s
android / release (push) Successful in 2m9s
ci / checks (push) Successful in 3m39s
ci / test (push) Successful in 2m5s
ci / docker (push) Successful in 1m52s
ci / web (push) Successful in 13s
ci / publish-edge-images (deploy/docker/claw.Dockerfile, rhema-claw) (push) Successful in 1m56s
ci / chart (push) Successful in 6s
ci / publish-edge-images (deploy/docker/ui.Dockerfile, rhema-claw-ui) (push) Successful in 20s
ci / publish-edge-chart (push) Successful in 4s
The web client kept its own dark shell: an icon rail, neon jade accents, and rows that reported state with colored dots and pills. Rhema Together had since settled on a warmer, quieter language, and the two surfaces no longer looked like one product. The shell is now one 232px sidebar plus a view. Chat lists sessions in the sidebar and renders the transcript in a 760px column; settings moves its searchable nav into the same sidebar and its pages onto an 880px column. The palette, type scale, controls, cards, and markdown come from Together's light theme, with its dark values following the OS. FiraCode Nerd Font Mono sets code, and the product mark, logo, and lucide icons replace the glyph characters. Status is a word now: running, waiting, held, connected, live, snapshot. The rail, its dots, the duplicate consent deny action, and the session key tag are gone. The model backend moved into the chat topbar beside the stream state. The mobile shell keeps the composer fixed in chat and lets settings scroll as a document. README and component docs follow the new layout. nuxt typecheck and build pass; checked light and dark at 1280x800 and 390x844 against mock API data.
378 lines
11 KiB
Vue
378 lines
11 KiB
Vue
<script setup lang="ts">
|
|
// The Sandbox page: where the agent's `bash` runs. The choice saves as
|
|
// a whole; the token is write-only, so an empty field keeps whatever
|
|
// the claw already stored. Presentational: data flows in as props,
|
|
// intent flows up as events.
|
|
import type { SandboxKind, SandboxSelection, SandboxState } from '~/composables/useClaw'
|
|
|
|
const props = defineProps<{
|
|
state: SandboxState | null
|
|
saving: boolean
|
|
}>()
|
|
|
|
const emit = defineEmits<{
|
|
save: [choice: SandboxSelection]
|
|
}>()
|
|
|
|
const kind = ref<SandboxKind>('local')
|
|
const url = ref('')
|
|
const token = ref('')
|
|
const clearToken = ref(false)
|
|
const host = ref('')
|
|
const workspace = ref('')
|
|
const privateKey = ref('')
|
|
const clearPrivateKey = ref(false)
|
|
|
|
const dirty = computed(() => {
|
|
const state = props.state
|
|
if (!state) return false
|
|
if (kind.value !== state.kind) return true
|
|
if (kind.value === 'http') {
|
|
const normalized = url.value.trim().replace(/\/+$/, '')
|
|
if (normalized !== (state.url ?? '')) return true
|
|
return token.value.trim() !== '' || clearToken.value
|
|
}
|
|
if (kind.value === 'ssh') {
|
|
if (host.value.trim() !== (state.host ?? '')) return true
|
|
if (workspace.value.trim() !== (state.ssh_workspace ?? '')) return true
|
|
return privateKey.value.trim() !== '' || clearPrivateKey.value
|
|
}
|
|
return false
|
|
})
|
|
|
|
const urlValid = computed(() => /^https?:\/\/.+/.test(url.value.trim()))
|
|
|
|
const hostValid = computed(
|
|
() => host.value.trim() !== '' && !host.value.trim().includes(' '),
|
|
)
|
|
|
|
const ready = computed(() => {
|
|
if (kind.value === 'http') return urlValid.value
|
|
if (kind.value === 'ssh') return hostValid.value
|
|
return true
|
|
})
|
|
|
|
const urlHint = computed(() =>
|
|
url.value.trim() && !urlValid.value
|
|
? 'The URL must start with http:// or https://.'
|
|
: 'The sandboxd base URL, for example https://box.example:7600.',
|
|
)
|
|
|
|
const hostHint = computed(() =>
|
|
host.value.trim() && !hostValid.value
|
|
? 'One destination, no spaces: an alias or user@host your ssh config resolves.'
|
|
: 'An alias or user@host your ssh config resolves.',
|
|
)
|
|
|
|
function sync(): void {
|
|
const state = props.state
|
|
if (!state) return
|
|
kind.value = state.kind
|
|
url.value = state.url ?? ''
|
|
token.value = ''
|
|
clearToken.value = false
|
|
host.value = state.host ?? ''
|
|
workspace.value = state.ssh_workspace ?? ''
|
|
privateKey.value = ''
|
|
clearPrivateKey.value = false
|
|
}
|
|
|
|
watch(
|
|
() => props.state,
|
|
(state) => {
|
|
if (state) sync()
|
|
},
|
|
{ immediate: true },
|
|
)
|
|
|
|
function discard(): void {
|
|
sync()
|
|
}
|
|
|
|
function save(): void {
|
|
if (!dirty.value || props.saving || !ready.value) return
|
|
const choice: SandboxSelection = { kind: kind.value }
|
|
if (kind.value === 'http') {
|
|
choice.url = url.value.trim()
|
|
if (token.value.trim() !== '') {
|
|
choice.token = token.value.trim()
|
|
} else if (clearToken.value) {
|
|
choice.clear_token = true
|
|
}
|
|
}
|
|
if (kind.value === 'ssh') {
|
|
choice.host = host.value.trim()
|
|
choice.workspace = workspace.value.trim()
|
|
if (privateKey.value.trim() !== '') {
|
|
choice.private_key = privateKey.value
|
|
} else if (clearPrivateKey.value) {
|
|
choice.clear_private_key = true
|
|
}
|
|
}
|
|
emit('save', choice)
|
|
}
|
|
|
|
// The path the staged choice would use, not the saved one.
|
|
const workspacePath = computed(() => {
|
|
const state = props.state
|
|
if (!state) return ''
|
|
if (kind.value === 'local') return state.local_workspace
|
|
if (kind.value === 'http') return state.remote_workspace
|
|
return state.workspace
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<div class="page">
|
|
<PageHeader title="Sandbox" subtitle="Where the agent's bash runs.">
|
|
<template #actions>
|
|
<button :disabled="!dirty || saving" @click="discard">Discard</button>
|
|
<button class="primary" :disabled="!dirty || saving || !ready" @click="save">
|
|
{{ saving ? 'Saving…' : 'Save' }}
|
|
</button>
|
|
</template>
|
|
</PageHeader>
|
|
|
|
<div class="scroll">
|
|
<p v-if="!state" class="muted">loading sandbox…</p>
|
|
|
|
<template v-else>
|
|
<SettingCard title="Execution" meta="applies on the next turn">
|
|
<label class="option" :class="{ selected: kind === 'local' }">
|
|
<input v-model="kind" type="radio" value="local" :disabled="saving" />
|
|
<span class="option-text">
|
|
<span class="option-title">
|
|
This machine
|
|
<span v-if="state.kind === 'local'" class="current">current</span>
|
|
</span>
|
|
<span class="option-detail">
|
|
Commands run as processes on the daemon's host.
|
|
</span>
|
|
</span>
|
|
</label>
|
|
|
|
<label class="option" :class="{ selected: kind === 'http' }">
|
|
<input v-model="kind" type="radio" value="http" :disabled="saving" />
|
|
<span class="option-text">
|
|
<span class="option-title">
|
|
Remote sandbox
|
|
<span v-if="state.kind === 'http'" class="current">current</span>
|
|
</span>
|
|
<span class="option-detail">
|
|
Commands run on a host that speaks the sandbox protocol over HTTP.
|
|
</span>
|
|
</span>
|
|
</label>
|
|
|
|
<label class="option" :class="{ selected: kind === 'ssh' }">
|
|
<input v-model="kind" type="radio" value="ssh" :disabled="saving" />
|
|
<span class="option-text">
|
|
<span class="option-title">
|
|
SSH host
|
|
<span v-if="state.kind === 'ssh'" class="current">current</span>
|
|
</span>
|
|
<span class="option-detail">
|
|
Commands run on a box the claw reaches with ssh, nothing installed on the far end.
|
|
</span>
|
|
</span>
|
|
</label>
|
|
</SettingCard>
|
|
|
|
<SettingCard v-if="kind === 'ssh'" title="SSH host">
|
|
<SettingRow title="Destination" :description="hostHint">
|
|
<input
|
|
v-model="host"
|
|
type="text"
|
|
class="mono"
|
|
placeholder="me@box.example"
|
|
autocomplete="off"
|
|
spellcheck="false"
|
|
:disabled="saving"
|
|
/>
|
|
</SettingRow>
|
|
<SettingRow
|
|
title="Workspace base"
|
|
description="The remote directory the claw's workspaces live under. Defaults to /root."
|
|
>
|
|
<input
|
|
v-model="workspace"
|
|
type="text"
|
|
class="mono"
|
|
placeholder="/root"
|
|
autocomplete="off"
|
|
spellcheck="false"
|
|
:disabled="saving"
|
|
/>
|
|
</SettingRow>
|
|
<SettingRow
|
|
title="Private key"
|
|
:description="state.private_key_set
|
|
? 'A key is stored. Leave this blank to keep it, or paste a replacement.'
|
|
: 'The key text itself (OpenSSH or PEM), not a path: the claw stores it, it stages no file. Leave blank to authenticate through an agent or the default key files.'"
|
|
>
|
|
<textarea
|
|
v-model="privateKey"
|
|
class="mono key-input"
|
|
rows="3"
|
|
:placeholder="state.private_key_set ? 'stored' : '-----BEGIN OPENSSH PRIVATE KEY-----'"
|
|
autocomplete="off"
|
|
spellcheck="false"
|
|
:disabled="saving || clearPrivateKey"
|
|
/>
|
|
</SettingRow>
|
|
<SettingRow
|
|
v-if="state.private_key_set"
|
|
title="Stored key"
|
|
:description="clearPrivateKey
|
|
? 'The stored key is removed when you save.'
|
|
: 'The key stays in the settings table until you replace or forget it.'"
|
|
>
|
|
<button class="ghost" :disabled="saving" @click="clearPrivateKey = !clearPrivateKey">
|
|
{{ clearPrivateKey ? 'Keep key' : 'Forget key' }}
|
|
</button>
|
|
</SettingRow>
|
|
</SettingCard>
|
|
|
|
<SettingCard v-if="kind === 'http'" title="Remote sandbox">
|
|
<SettingRow
|
|
title="URL"
|
|
:description="urlHint"
|
|
>
|
|
<input
|
|
v-model="url"
|
|
type="text"
|
|
class="mono"
|
|
placeholder="https://box.example:7600"
|
|
autocomplete="off"
|
|
spellcheck="false"
|
|
:disabled="saving"
|
|
/>
|
|
</SettingRow>
|
|
<SettingRow
|
|
title="Token"
|
|
:description="state.token_set
|
|
? 'A token is stored. Leave this blank to keep it.'
|
|
: 'The shared secret the daemon checks. Leave it blank when the daemon has none.'"
|
|
>
|
|
<input
|
|
v-model="token"
|
|
type="password"
|
|
:placeholder="state.token_set ? 'stored' : 'optional'"
|
|
autocomplete="off"
|
|
:disabled="saving || clearToken"
|
|
/>
|
|
</SettingRow>
|
|
<SettingRow
|
|
v-if="state.token_set"
|
|
title="Stored token"
|
|
:description="clearToken
|
|
? 'The stored token is removed when you save.'
|
|
: 'The token stays in the settings table until you replace or forget it.'"
|
|
>
|
|
<button class="ghost" :disabled="saving" @click="clearToken = !clearToken">
|
|
{{ clearToken ? 'Keep token' : 'Forget token' }}
|
|
</button>
|
|
</SettingRow>
|
|
</SettingCard>
|
|
|
|
<AppCallout v-if="kind !== 'local'" variant="info" title="Remote commands start from a copy">
|
|
On first use the claw sends the local workspace to the sandbox as a tarball.
|
|
Later edits stay in the sandbox; the claw does not copy them back.
|
|
</AppCallout>
|
|
|
|
<SettingCard title="Workspace">
|
|
<SettingRow
|
|
title="Path"
|
|
description="Where the agent's bash starts under this choice."
|
|
>
|
|
<code>{{ workspacePath }}</code>
|
|
</SettingRow>
|
|
</SettingCard>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.page {
|
|
display: flex;
|
|
flex-direction: column;
|
|
min-height: 0;
|
|
min-width: 0;
|
|
flex: 1;
|
|
}
|
|
|
|
.scroll {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
padding: 0 var(--sp-8) var(--sp-10);
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--sp-4);
|
|
width: 100%;
|
|
max-width: 880px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.muted {
|
|
color: var(--text3);
|
|
padding: 8px 2px;
|
|
}
|
|
|
|
.option {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 12px;
|
|
padding: 13px 16px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.option:hover {
|
|
background: var(--elevated);
|
|
}
|
|
|
|
.option.selected {
|
|
background: color-mix(in srgb, var(--accent) 8%, var(--surface));
|
|
}
|
|
|
|
.option input[type='radio'] {
|
|
flex: none;
|
|
margin: 3px 0 0;
|
|
accent-color: var(--accent);
|
|
}
|
|
|
|
.option-text {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 1px;
|
|
min-width: 0;
|
|
}
|
|
|
|
.option-title {
|
|
display: flex;
|
|
align-items: baseline;
|
|
gap: 8px;
|
|
color: var(--text);
|
|
font-weight: 600;
|
|
}
|
|
|
|
.option-detail {
|
|
color: var(--text3);
|
|
font-size: 12.5px;
|
|
}
|
|
|
|
.current {
|
|
color: var(--accent-text);
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.key-input {
|
|
width: 100%;
|
|
min-width: 0;
|
|
resize: vertical;
|
|
font-size: 12px;
|
|
word-break: break-all;
|
|
}
|
|
</style>
|