Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Found bercail on [herdr.dev](https://herdr.dev/layouts/)? Its recipe walks your
dev # this directory's space, with its desk agent
```

`Ctrl+Shift+A` focuses the desk, `Ctrl+Shift+R` opens Review, and `bercail doctor` tells you if anything is missing. Something else? `bercail help`.
The layout opens on Shep, OpenClaw's terminal UI, with your spaces beside it: click one to work in it, `Ctrl+Shift+H` to come back. `Ctrl+Shift+A` focuses the desk, `Ctrl+Shift+R` opens Review, and `bercail doctor` tells you if anything is missing. Something else? `bercail help`.

## Docs

Expand All @@ -59,7 +59,7 @@ dev # this directory's space, with its desk agent
- [review](docs/review.md): tuicr, and how Review opens and closes.
- [handoff](docs/handoff.md): stages, headless runs, result files.
- [bstack](docs/bstack.md): opencode on your own plans, roles, autopilot. Then [the bstack guide](docs/bstack/README.md).
- [Shep](docs/shep.md): the Grok bot, and agent status webhooks.
- [Shep](docs/shep.md): the Grok bot, the Shep view, and agent status webhooks.
- [development](docs/development.md): tests, dependencies, platforms.
- [Herdr agents and subagents](docs/herdr-agents-subagents.md): a proposal for Herdr's agents list.

Expand Down
175 changes: 145 additions & 30 deletions bercail/RECIPE.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion bercail/keys.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"ctrl-alt-down": "bercail-desk.subspace-next",
"alt-shift-up": "bercail-desk.agent-prev",
"alt-shift-down": "bercail-desk.agent-next",
"ctrl-shift-q": "space.close"
"ctrl-shift-q": "space.close",
"ctrl-shift-h": "bercail-shep.toggle"
}
}
78 changes: 76 additions & 2 deletions bercail/layouts/bercail.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,66 @@
},
"type": "row",
"children": [
{
"id": "shep",
"type": "column",
"children": [
{
"id": "shep-card",
"type": "column",
"children": [
{
"id": "shep-header",
"type": "block",
"content": {
"mod": "bercail-shep",
"props": {
"role": "header"
}
},
"size": {
"px": 32
},
"window_drag": true
},
{
"id": "shep-stack",
"type": "stack",
"children": [
{
"id": "shep-empty",
"type": "block",
"content": {
"mod": "bercail-shep",
"props": {
"role": "empty"
}
}
}
],
"active": "shep-empty"
}
],
"background": "background",
"border": {
"width": 1,
"color": "border"
},
"radius": 10,
"focus": {
"border": {
"width": 1,
"color": "accent"
}
}
}
],
"size": {
"weight": 1
},
"min": 320,
"padding": 8
},
{
"id": "sidebar",
"type": "column",
Expand All @@ -21,6 +81,19 @@
},
"window_drag": true
},
{
"id": "shep-nav",
"type": "block",
"content": {
"mod": "bercail-shep",
"props": {
"role": "nav"
}
},
"size": {
"px": 44
}
},
{
"id": "sidebar-lists",
"type": "column",
Expand All @@ -29,7 +102,7 @@
"id": "spaces",
"type": "block",
"content": {
"mod": "spaces"
"mod": "bercail-spaces"
},
"size": {
"weight": 1
Expand Down Expand Up @@ -218,7 +291,8 @@
}
}
],
"resizable": false
"resizable": false,
"hidden": true
}
],
"background": "canvas",
Expand Down
27 changes: 20 additions & 7 deletions bercail/mods/bercail-agents/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// A viewed done agent stays in Done until left.
// bercail's copy of Herdr's agents mod (mod.clone): it also lists each space's desk,
// a sub-agent of the space's Shell, which agents() leaves out when the Shell isn't an agent.
// A click opens the agent's own terminal in a dialog over the Shep or space view
// (bercail-shep draws its bar) instead of switching spaces.

import { View, div, image, svg } from "gpui-kit";
import { v_flex, h_flex } from "gpui-base";
Expand Down Expand Up @@ -80,8 +82,23 @@ export function withDesks(list, desks, spaceList) {
return [...desks, ...list].sort((x, y) => rank(x) - rank(y));
}

// A desk has no pane to focus: bercail-desk selects its space and its desk block.
const open = (a) => (a.desk ? run(`bercail-desk.agent:${a.address}`) : run("pane.focus", { pane: a.pane }));
// The agent's terminal itself, in a dialog: its pane, desk and space stay as they are,
// and closing the dialog puts the keyboard back (`back`).
export function agentDialog(address, f) {
return {
kind: "dialog",
width: 0.86,
height: 0.86,
layout: {
type: "column",
children: [
{ type: "block", size: { px: 34 }, content: { mod: "bercail-shep", props: { role: "modal", terminal: address, back: { pane: f?.pane ?? null, terminal: f?.terminal ?? null } } } },
{ type: "block", content: { terminal: address }, padding: [6, 6] },
],
},
};
}
const open = (a) => openOverlay(agentDialog(a.address, focused()));

const SORTS = [
{ id: "priority", label: "Priority", icon: "clock" },
Expand Down Expand Up @@ -191,10 +208,6 @@ export default class Agents extends View {
.when(s.id === on, (el) => el.child(svg("mods/workspace-chrome/check.svg").size(14).flex_none().text_color(t.foreground)))));
}

peek(addr) {
run("terminal.peek", { terminal: addr });
}

// Live sub-agents of `addr`, depth first, each with the tree lines in front of it.
tree(all, addr, lead = []) {
const kids = all.filter((k) => k.parent === addr && k.state === "live");
Expand Down Expand Up @@ -224,7 +237,7 @@ export default class Agents extends View {
.text_size(12.5)
.when(on, (el) => el.bg(t.raised))
.hover((s) => s.bg(t.hover))
.on_click(() => this.peek(k.address))
.on_click(() => open(k))
.children(s.lines.map(l => div().self_start().mt(-4).w(9).h(17).mr(4).flex_none()
.when(Boolean(l), el => el.border_l(1.5).border_color(t.input))
.when(l === "└" || l === "├", el => el.border_b(1.5).rounded_bl(6))))
Expand Down
Loading
Loading