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
@@ -289,6 +289,63 @@ export interface SandboxSelection {
|
||||
workspace?: string
|
||||
}
|
||||
|
||||
/** One skill `/v1/skills` lists: the folder name, its trigger, the
|
||||
* `SKILL.md` path, the tier discovery read it from, and whether the
|
||||
* prompt holds it back. */
|
||||
export interface ClawSkill {
|
||||
name: string
|
||||
description: string
|
||||
path: string
|
||||
tier: 'workspace' | 'global' | 'workspace-agents' | 'home-agents'
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
/** The skills state `GET /v1/skills` serves: the global root, the
|
||||
* workspace whose tiers were read, the disabled names, and every
|
||||
* discovered skill. */
|
||||
export interface SkillsState {
|
||||
root: string
|
||||
workspace: string
|
||||
disabled: string[]
|
||||
skills: ClawSkill[]
|
||||
}
|
||||
|
||||
/** One bootstrap document `GET /v1/bootstrap/files` serves. */
|
||||
export interface BootstrapFile {
|
||||
kind: 'soul' | 'user' | 'environment'
|
||||
name: string
|
||||
content: string | null
|
||||
exists: boolean
|
||||
/** ENVIRONMENT.md is written at boot, never through the editor. */
|
||||
generated: boolean
|
||||
}
|
||||
|
||||
/** The bootstrap editor's state: the onboarding badge plus the three
|
||||
* documents, live. */
|
||||
export interface BootstrapFiles {
|
||||
status: { soul: boolean; user: boolean }
|
||||
files: BootstrapFile[]
|
||||
}
|
||||
|
||||
/** One MCP server row `GET /v1/mcp` serves. Narrow by design: command
|
||||
* arguments and URLs can carry credentials and never ride the wire. */
|
||||
export interface McpServer {
|
||||
name: string
|
||||
description: string
|
||||
transport: 'stdio' | 'http' | 'unknown'
|
||||
program: string | null
|
||||
}
|
||||
|
||||
/** The MCP page's state: the client's config path, its servers, the
|
||||
* names `claw.yaml` mutes, and parse notices. */
|
||||
export interface McpState {
|
||||
config: string
|
||||
exists: boolean
|
||||
servers: McpServer[]
|
||||
disabled: string[]
|
||||
notices: string[]
|
||||
}
|
||||
|
||||
/** A failed API call: the status plus the claw's `error` string when it sent one. */
|
||||
export class ClawError extends Error {
|
||||
/** HTTP status; 0 when the claw was unreachable at all. */
|
||||
@@ -466,6 +523,17 @@ export interface ClawApi {
|
||||
/** `DELETE /v1/providers/{id}` — remove a backend instance; answers
|
||||
* the new providers state. The last backend is refused claw-side. */
|
||||
removeProvider(id: string): Promise<ProvidersState>
|
||||
/** `GET /v1/skills` — installed skills, their triggers, paths, and
|
||||
* whether the prompt currently holds each one back. */
|
||||
skills(): Promise<SkillsState>
|
||||
/** `PUT /v1/skills/{name}` — flip one skill and persist the set. */
|
||||
setSkillEnabled(name: string, enabled: boolean): Promise<{ name: string; enabled: boolean; disabled: string[] }>
|
||||
/** `GET /v1/bootstrap/files` — SOUL.md, USER.md, ENVIRONMENT.md. */
|
||||
bootstrapFiles(): Promise<BootstrapFiles>
|
||||
/** `PUT /v1/bootstrap/{kind}` — overwrite SOUL.md or USER.md. */
|
||||
saveBootstrap(kind: string, content: string): Promise<{ saved: boolean; kind: string }>
|
||||
/** `GET /v1/mcp` — the client's config path, servers, and mute set. */
|
||||
mcp(): Promise<McpState>
|
||||
/** `GET /v1/sandbox`: where the agent's `bash` runs. */
|
||||
sandbox(): Promise<SandboxState>
|
||||
/** `PUT /v1/sandbox`: switch the sandbox, persisted claw-side. The
|
||||
@@ -685,6 +753,37 @@ export function useClaw(token: Ref<string | null>): ClawApi {
|
||||
})) as ProvidersState
|
||||
}
|
||||
|
||||
async function skills(): Promise<SkillsState> {
|
||||
return (await get('/v1/skills', token.value)) as SkillsState
|
||||
}
|
||||
|
||||
async function setSkillEnabled(
|
||||
name: string,
|
||||
enabled: boolean,
|
||||
): Promise<{ name: string; enabled: boolean; disabled: string[] }> {
|
||||
return (await send(`/v1/skills/${encodeURIComponent(name)}`, {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json', ...authHeaders(token.value) },
|
||||
body: JSON.stringify({ enabled }),
|
||||
})) as { name: string; enabled: boolean; disabled: string[] }
|
||||
}
|
||||
|
||||
async function bootstrapFiles(): Promise<BootstrapFiles> {
|
||||
return (await get('/v1/bootstrap/files', token.value)) as BootstrapFiles
|
||||
}
|
||||
|
||||
async function saveBootstrap(kind: string, content: string): Promise<{ saved: boolean; kind: string }> {
|
||||
return (await send(`/v1/bootstrap/${encodeURIComponent(kind)}`, {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json', ...authHeaders(token.value) },
|
||||
body: JSON.stringify({ content }),
|
||||
})) as { saved: boolean; kind: string }
|
||||
}
|
||||
|
||||
async function mcp(): Promise<McpState> {
|
||||
return (await get('/v1/mcp', token.value)) as McpState
|
||||
}
|
||||
|
||||
async function sandbox(): Promise<SandboxState> {
|
||||
return (await get('/v1/sandbox', token.value)) as SandboxState
|
||||
}
|
||||
@@ -928,6 +1027,11 @@ export function useClaw(token: Ref<string | null>): ClawApi {
|
||||
models,
|
||||
setCredentials,
|
||||
removeProvider,
|
||||
skills,
|
||||
setSkillEnabled,
|
||||
bootstrapFiles,
|
||||
saveBootstrap,
|
||||
mcp,
|
||||
sandbox,
|
||||
setSandbox,
|
||||
accounts,
|
||||
|
||||
Reference in new issue
Block a user