feat(claw): load skills and subagents and edit the identity files
android / debug (push) Successful in 2m12s
ci / checks (push) Successful in 3m42s
ci / web (push) Successful in 12s
android / release (push) Successful in 2m5s
ci / test (push) Successful in 2m12s
ci / chart (push) Successful in 6s
ci / docker (push) Successful in 1m58s
ci / publish-edge-images (deploy/docker/claw.Dockerfile, rhema-claw) (push) Successful in 1m55s
ci / publish-edge-images (deploy/docker/ui.Dockerfile, rhema-claw-ui) (push) Successful in 15s
ci / publish-edge-chart (push) Successful in 4s
android / debug (push) Successful in 2m12s
ci / checks (push) Successful in 3m42s
ci / web (push) Successful in 12s
android / release (push) Successful in 2m5s
ci / test (push) Successful in 2m12s
ci / chart (push) Successful in 6s
ci / docker (push) Successful in 1m58s
ci / publish-edge-images (deploy/docker/claw.Dockerfile, rhema-claw) (push) Successful in 1m55s
ci / publish-edge-images (deploy/docker/ui.Dockerfile, rhema-claw-ui) (push) Successful in 15s
ci / publish-edge-chart (push) Successful in 4s
The claw's agents had no skills and no way to delegate, and the settings
surface could only read a pair of booleans.
Skills now seed the bundled `commit-message` and `unslop` folders into
the global directory, discover the global and workspace tiers on every
dispatch, and list them in the prompt. The settings table owns an off
switch per skill, so the Skills page can hold one back without editing
YAML. The config set is the seed.
Subagents build on `rhema-subagents`. Definitions are `SUBAGENT.md`
folders under the global directory and the workspace tier, and the
parent prompt advertises the `subagent` tool. The wire passes the
parent's skills, environment report, and USER.md to the child, so a
delegated turn knows the same context.
The Bootstrap page reads the three identity files and writes SOUL.md
and USER.md. ENVIRONMENT.md stays read-only because the boot pass
rewrites it. The MCP page reads the client's config through the same
file the shell uses and shows servers, transports, and the daemon's
mute set. It stays read-only: the standalone client owns that file.
`GET` and `PUT /v1/bootstrap/{kind}`, `GET /v1/bootstrap/files`, `GET`
and `PUT /v1/skills`, and `GET /v1/mcp` carry the pages. The config
gains `skills_root`, `skills_disabled`, `subagents_root`, and
`disabled_subagents`.
fmt, clippy with -D warnings over all targets, the 304 lib and 46 HTTP
tests, and nuxt typecheck and build pass.
This commit is contained in:
1 parent
eb9f4e9ec5
commit
829f30d27e
31 files changed
+2604
-102
No files matched your search
@@ -27,6 +27,11 @@ const routes = [
|
||||
{ method: 'PUT', path: '/v1/providers/{kind}/credentials', note: 'add a backend or replace its login' },
|
||||
{ method: 'DELETE', path: '/v1/providers/{kind}', note: 'drop a backend from the roster' },
|
||||
{ method: 'GET', path: '/v1/providers/{kind}/models', note: "a kind's live model listing" },
|
||||
{ method: 'GET', path: '/v1/bootstrap/files', note: 'the identity documents, live' },
|
||||
{ method: 'PUT', path: '/v1/bootstrap/{kind}', note: 'save SOUL.md or USER.md' },
|
||||
{ method: 'GET', path: '/v1/skills', note: "installed skills, triggers, and paths" },
|
||||
{ method: 'PUT', path: '/v1/skills/{name}', note: "flip one skill's off switch" },
|
||||
{ method: 'GET', path: '/v1/mcp', note: "the MCP client's servers and mute set" },
|
||||
]
|
||||
</script>
|
||||
|
||||
|
||||
@@ -0,0 +1,204 @@
|
||||
<script setup lang="ts">
|
||||
// The Bootstrap page: the three identity documents the resident prompt
|
||||
// renders, editable in place. SOUL.md and USER.md save as whole files;
|
||||
// ENVIRONMENT.md is generated at every boot, so its editor is read-only
|
||||
// and says so. Presentational: data flows in as props, intent flows up
|
||||
// as events.
|
||||
import type { BootstrapFile, BootstrapFiles } from '~/composables/useClaw'
|
||||
|
||||
const props = defineProps<{
|
||||
state: BootstrapFiles | null
|
||||
loading: boolean
|
||||
/** The kind whose save is in flight. */
|
||||
saving: string | null
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
refresh: []
|
||||
save: [kind: string, content: string]
|
||||
}>()
|
||||
|
||||
// 16 KiB, the same cap bootstrap_save enforces in the daemon.
|
||||
const CAP = 16 * 1024
|
||||
|
||||
const drafts = reactive<Record<string, string>>({})
|
||||
|
||||
function sync(): void {
|
||||
const state = props.state
|
||||
if (!state) return
|
||||
for (const file of state.files) {
|
||||
drafts[file.kind] = file.content ?? ''
|
||||
}
|
||||
}
|
||||
|
||||
// The page's only refresh is explicit, so a state arrival always wins:
|
||||
// there is no background poll that could overwrite a live edit.
|
||||
watch(() => props.state, sync, { immediate: true })
|
||||
|
||||
function dirty(file: BootstrapFile): boolean {
|
||||
return (drafts[file.kind] ?? '') !== (file.content ?? '')
|
||||
}
|
||||
|
||||
function discard(file: BootstrapFile): void {
|
||||
drafts[file.kind] = file.content ?? ''
|
||||
}
|
||||
|
||||
function save(file: BootstrapFile): void {
|
||||
if (file.generated || props.saving || !dirty(file)) return
|
||||
emit('save', file.kind, drafts[file.kind] ?? '')
|
||||
}
|
||||
|
||||
function size(file: BootstrapFile): number {
|
||||
return new TextEncoder().encode(drafts[file.kind] ?? '').length
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<PageHeader title="Bootstrap" subtitle="The identity files every turn renders.">
|
||||
<template #actions>
|
||||
<button :disabled="loading" @click="$emit('refresh')">
|
||||
{{ loading ? 'Refreshing…' : 'Refresh' }}
|
||||
</button>
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<div class="scroll">
|
||||
<p v-if="!state" class="muted">loading bootstrap…</p>
|
||||
|
||||
<template v-else>
|
||||
<AppCallout variant="info" title="These files enter every request">
|
||||
SOUL.md is who the agent is; USER.md is who you are. Keep both
|
||||
small — they are read on every turn. ENVIRONMENT.md is written
|
||||
from the machine at boot.
|
||||
</AppCallout>
|
||||
|
||||
<SettingCard
|
||||
v-for="file in state.files"
|
||||
:key="file.kind"
|
||||
:title="file.name"
|
||||
:meta="file.generated ? 'generated at boot' : file.exists ? 'present' : 'missing'"
|
||||
>
|
||||
<div class="editor">
|
||||
<textarea
|
||||
v-model="drafts[file.kind]"
|
||||
class="mono"
|
||||
rows="10"
|
||||
spellcheck="false"
|
||||
:readonly="file.generated"
|
||||
:disabled="saving === file.kind"
|
||||
:aria-label="`${file.name} content`"
|
||||
/>
|
||||
<div class="editor-foot">
|
||||
<span class="hint">
|
||||
<template v-if="file.generated">
|
||||
Rewritten at every boot; edit the template, not this file.
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ size(file) }} of {{ CAP }} bytes
|
||||
<span v-if="size(file) > CAP" class="over">over the cap</span>
|
||||
</template>
|
||||
</span>
|
||||
<span class="actions">
|
||||
<button
|
||||
v-if="!file.generated"
|
||||
:disabled="!dirty(file) || saving === file.kind"
|
||||
@click="discard(file)"
|
||||
>
|
||||
Discard
|
||||
</button>
|
||||
<button
|
||||
v-if="!file.generated"
|
||||
class="primary"
|
||||
:disabled="!dirty(file) || saving === file.kind || size(file) > CAP"
|
||||
@click="save(file)"
|
||||
>
|
||||
{{ saving === file.kind ? 'Saving…' : 'Save' }}
|
||||
</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</SettingCard>
|
||||
|
||||
<p class="footnote">
|
||||
The agent can also write SOUL.md and USER.md through its
|
||||
<code>bootstrap_save</code> tool. Both paths land in the same
|
||||
store, so the next turn sees either.
|
||||
</p>
|
||||
</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 24px 24px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
max-width: 900px;
|
||||
}
|
||||
|
||||
.muted {
|
||||
color: var(--text3);
|
||||
}
|
||||
|
||||
.editor {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
padding: 14px 16px;
|
||||
}
|
||||
|
||||
textarea {
|
||||
width: 100%;
|
||||
min-height: 180px;
|
||||
resize: vertical;
|
||||
line-height: 1.5;
|
||||
font-size: 12.5px;
|
||||
}
|
||||
|
||||
textarea[readonly] {
|
||||
color: var(--text2);
|
||||
background: var(--sunken);
|
||||
}
|
||||
|
||||
.editor-foot {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.hint {
|
||||
color: var(--text3);
|
||||
font-size: 11.5px;
|
||||
}
|
||||
|
||||
.over {
|
||||
color: var(--error);
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.footnote {
|
||||
margin: 0;
|
||||
padding: 0 2px;
|
||||
color: var(--text3);
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,171 @@
|
||||
<script setup lang="ts">
|
||||
// The MCP page: the standalone client's configured servers and the
|
||||
// names claw.yaml mutes. Read-only by design — the config file belongs
|
||||
// to the client, and the claw only names it through MCP_CONFIG.
|
||||
import type { McpState } from '~/composables/useClaw'
|
||||
|
||||
const props = defineProps<{
|
||||
state: McpState | null
|
||||
loading: boolean
|
||||
}>()
|
||||
|
||||
defineEmits<{ refresh: [] }>()
|
||||
|
||||
// The missing-file line is the callout's job; every other notice is a
|
||||
// parse or shape problem worth its own warn.
|
||||
const notices = computed(() =>
|
||||
(props.state?.notices ?? []).filter((notice) => !notice.startsWith('no MCP config file')),
|
||||
)
|
||||
|
||||
const TRANSPORTS: Record<string, string> = {
|
||||
stdio: 'local process',
|
||||
http: 'HTTP',
|
||||
unknown: 'unrecognized',
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<PageHeader title="MCP" subtitle="Servers the agent's shell can call.">
|
||||
<template #actions>
|
||||
<button :disabled="loading" @click="$emit('refresh')">
|
||||
{{ loading ? 'Refreshing…' : 'Refresh' }}
|
||||
</button>
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<div class="scroll">
|
||||
<p v-if="!state" class="muted">loading MCP servers…</p>
|
||||
|
||||
<template v-else>
|
||||
<AppCallout v-if="!state.exists" variant="info" title="No MCP config file">
|
||||
The client has no servers configured at
|
||||
<span class="mono">{{ state.config }}</span>. Add a
|
||||
<code>servers</code> object there, then refresh.
|
||||
</AppCallout>
|
||||
|
||||
<AppCallout
|
||||
v-for="notice in notices"
|
||||
:key="notice"
|
||||
variant="warn"
|
||||
title="MCP config"
|
||||
>
|
||||
{{ notice }}
|
||||
</AppCallout>
|
||||
|
||||
<SettingCard
|
||||
title="Servers"
|
||||
:meta="`${state.servers.length} configured${state.disabled.length ? `, ${state.disabled.length} muted` : ''}`"
|
||||
>
|
||||
<p v-if="state.servers.length === 0 && state.exists" class="empty">
|
||||
The config exists but holds no servers.
|
||||
</p>
|
||||
|
||||
<template v-else>
|
||||
<div v-for="server in state.servers" :key="server.name" class="server">
|
||||
<div class="server-head">
|
||||
<span class="server-name mono">{{ server.name }}</span>
|
||||
<span class="server-transport">{{ TRANSPORTS[server.transport] }}</span>
|
||||
<span class="server-state" :class="{ off: state.disabled.includes(server.name) }">
|
||||
{{ state.disabled.includes(server.name) ? 'muted' : 'active' }}
|
||||
</span>
|
||||
</div>
|
||||
<p v-if="server.description" class="server-description">{{ server.description }}</p>
|
||||
<p v-if="server.program" class="server-program mono">{{ server.program }}</p>
|
||||
</div>
|
||||
</template>
|
||||
</SettingCard>
|
||||
|
||||
<p class="footnote">
|
||||
Config: <span class="mono">{{ state.config }}</span>.
|
||||
Mutes: <code>disabled_mcp_servers</code> in <code>claw.yaml</code>.
|
||||
The page is read-only; the client owns the file.
|
||||
</p>
|
||||
</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 24px 24px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
max-width: 860px;
|
||||
}
|
||||
|
||||
.muted {
|
||||
color: var(--text3);
|
||||
}
|
||||
|
||||
.empty {
|
||||
margin: 0;
|
||||
padding: 13px 16px;
|
||||
color: var(--text3);
|
||||
}
|
||||
|
||||
.server {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
padding: 12px 16px;
|
||||
}
|
||||
|
||||
.server-head {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.server-name {
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.server-transport {
|
||||
color: var(--text3);
|
||||
font-size: 11.5px;
|
||||
}
|
||||
|
||||
.server-state {
|
||||
margin-left: auto;
|
||||
color: var(--ok);
|
||||
font-size: 11.5px;
|
||||
}
|
||||
|
||||
.server-state.off {
|
||||
color: var(--text3);
|
||||
}
|
||||
|
||||
.server-description {
|
||||
margin: 0;
|
||||
color: var(--text2);
|
||||
font-size: 12.5px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.server-program {
|
||||
margin: 0;
|
||||
color: var(--text3);
|
||||
font-size: 11.5px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.footnote {
|
||||
margin: 0;
|
||||
padding: 0 2px;
|
||||
color: var(--text3);
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,179 @@
|
||||
<script setup lang="ts">
|
||||
// The Skills page: what discovery finds for the chat workspace, what
|
||||
// each skill's trigger is, and its on/off switch. Toggles persist in
|
||||
// the daemon's settings table, so a row flips without editing config.
|
||||
import type { ClawSkill, SkillsState } from '~/composables/useClaw'
|
||||
|
||||
defineProps<{
|
||||
state: SkillsState | null
|
||||
loading: boolean
|
||||
/** The skill whose toggle is in flight. */
|
||||
saving: string | null
|
||||
}>()
|
||||
|
||||
defineEmits<{
|
||||
refresh: []
|
||||
toggle: [name: string, enabled: boolean]
|
||||
}>()
|
||||
|
||||
const TIERS: Record<ClawSkill['tier'], string> = {
|
||||
workspace: 'workspace',
|
||||
global: 'global',
|
||||
'workspace-agents': 'workspace .agents',
|
||||
'home-agents': 'home .agents',
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<PageHeader title="Skills" subtitle="Instruction files the agent reads on demand.">
|
||||
<template #actions>
|
||||
<button :disabled="loading" @click="$emit('refresh')">
|
||||
{{ loading ? 'Refreshing…' : 'Refresh' }}
|
||||
</button>
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<div class="scroll">
|
||||
<p v-if="!state" class="muted">loading skills…</p>
|
||||
|
||||
<template v-else>
|
||||
<AppCallout
|
||||
v-if="state.disabled.length"
|
||||
variant="info"
|
||||
title="Some skills are held back"
|
||||
>
|
||||
A disabled skill keeps its files and disappears from the prompt
|
||||
and the transcript. The switch persists across restarts.
|
||||
</AppCallout>
|
||||
|
||||
<SettingCard title="Installed" :meta="`${state.skills.length} found`">
|
||||
<p v-if="state.skills.length === 0" class="empty">
|
||||
No skills found. Put a <code>SKILL.md</code> under a folder in the
|
||||
global directory, or in the workspace's
|
||||
<code>.rhema/skills</code>.
|
||||
</p>
|
||||
|
||||
<template v-else>
|
||||
<div v-for="skill in state.skills" :key="skill.name" class="skill">
|
||||
<div class="skill-head">
|
||||
<span class="skill-name mono">{{ skill.name }}</span>
|
||||
<span class="skill-tier">{{ TIERS[skill.tier] }}</span>
|
||||
<span class="skill-state" :class="{ off: !skill.enabled }">
|
||||
{{ skill.enabled ? 'enabled' : 'disabled' }}
|
||||
</span>
|
||||
<button
|
||||
class="skill-toggle"
|
||||
:disabled="saving === skill.name"
|
||||
:aria-label="`${skill.enabled ? 'Disable' : 'Enable'} ${skill.name}`"
|
||||
@click="$emit('toggle', skill.name, !skill.enabled)"
|
||||
>
|
||||
{{ saving === skill.name ? 'Saving…' : skill.enabled ? 'Disable' : 'Enable' }}
|
||||
</button>
|
||||
</div>
|
||||
<p class="skill-trigger">{{ skill.description }}</p>
|
||||
<p class="skill-path mono">{{ skill.path }}</p>
|
||||
</div>
|
||||
</template>
|
||||
</SettingCard>
|
||||
|
||||
<p class="footnote">
|
||||
Discovery reads <span class="mono">{{ state.root }}</span>, then the
|
||||
chat workspace's <code>.rhema/skills</code> and
|
||||
<code>.agents/skills</code> under
|
||||
<span class="mono">{{ state.workspace }}</span>. A skill in a rhema
|
||||
directory shadows the same name in an <code>.agents</code> directory.
|
||||
</p>
|
||||
</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 24px 24px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
max-width: 860px;
|
||||
}
|
||||
|
||||
.muted {
|
||||
color: var(--text3);
|
||||
}
|
||||
|
||||
.empty {
|
||||
margin: 0;
|
||||
padding: 13px 16px;
|
||||
color: var(--text3);
|
||||
}
|
||||
|
||||
.skill {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
padding: 12px 16px;
|
||||
}
|
||||
|
||||
.skill-head {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.skill-name {
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.skill-tier {
|
||||
color: var(--text3);
|
||||
font-size: 11.5px;
|
||||
}
|
||||
|
||||
.skill-state {
|
||||
margin-left: auto;
|
||||
color: var(--ok);
|
||||
font-size: 11.5px;
|
||||
}
|
||||
|
||||
.skill-state.off {
|
||||
color: var(--text3);
|
||||
}
|
||||
|
||||
.skill-toggle {
|
||||
padding: 2px 9px;
|
||||
font-size: 11.5px;
|
||||
}
|
||||
|
||||
.skill-trigger {
|
||||
margin: 0;
|
||||
color: var(--text2);
|
||||
font-size: 12.5px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.skill-path {
|
||||
margin: 0;
|
||||
color: var(--text3);
|
||||
font-size: 11.5px;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.footnote {
|
||||
margin: 0;
|
||||
padding: 0 2px;
|
||||
color: var(--text3);
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user