- Go 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Run 6964 on
|
||
| .forgejo/workflows | ||
| cmd/lazymartha | ||
| internal | ||
| testdata | ||
| .gitignore | ||
| .tool-versions | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| README.md | ||
lazymartha
The martha.json editor: one Go + bubbletea TUI that martha init and martha config
start, reading its fields, defaults and hints from one schema file Martha publishes. It
hard-codes no field, and it never validates — Martha's reader does that.
The crew screen (lazymartha crew) is the one-stop TUI in progress (martha-ai/lazymartha#6):
the members of a declared crew, each in its own pane — the martha-engine members as child
processes speaking ACP on their stdio, the Claude Code members as the real CLI in a terminal —
with one permission queue for the engine members. See "The crew screen" below.
The handshake
Martha starts lazymartha as a child process with files, and reads back an exit code:
lazymartha --schema <schema.json> --in <declaration.json> --out <proposed.json> [--new] [--message "<line>"]
exit 0— saved:--outholds the proposed declaration.exit 3— quit, nothing saved.- anything else — refused or crashed; Martha prints its stderr.
--new marks a fresh crew (a no-op for the editor today); --message is a line Martha
handed over — a reader's refusal — shown to the owner so they keep their edits and see why.
The schema
--schema is a JSON Schema 2020-12 document with three extensions:
x-martha-schema(a number) — the schema major. lazymartha refuses a major it does not know, in one line naming both. A new field or enum value keeps the major; a renamed or removed field bumps it.x-martha-tabs(a list) — the editor's tabs in order. Each tab is aform(namedfields), atable(fields,repeatable), or alist(rows).$id— a name, never fetched: lazymartha reads only the file it is handed.
The tabs, their field labels, types and choices come from this file alone.
The crew screen
martha up hands the workspace to the screen, and the screen draws the crew:
lazymartha crew --root <root> [--martha martha] [--agent "martha start {member} --acp"]
[--terminal-agent "martha start {member}"]
[--room "martha room --follow"] [--prompt <text>]
- The places come from
martha whererun in--root, and the members from the declaration it names. A member runs here when the declaration gives it a host this screen starts and the owner has not parked it: one on the engine speaks ACP, one on Claude Code runs as the real CLI. Every other member is named on screen with why it is not drawn. - The crew strip above the panes reads every drawn member's dashboard row (
<CREW>/row/) and draws the wordsmartha crewdraws: how many are online, waiting and need the owner, then a line per member with its state — and the flag a loss of the crew's tools raises, since when, in the crew'sclock_zone— its task (the member's own word, or the task its session's list has open), how far it is, what it holds, what holds it up, what it needs, and the spend the row carries. A row quiet past the crew's offline time readsoffline. - One
--agentchild per engine member speaks ACP on its stdio. The default is Martha serving an engine member upward; until that lands,--agentcan name the engine itself. The child's standard error is read into its own pane, so Martha's own refusal is read where the member is. - An engine member's pane shows its stream, its tool calls (title and status) and its own prompt line; Enter sends the typed turn to the member on screen.
- One permission queue holds every ask the crew raises, oldest first, with the member and the
call's kind.
ctrl+aallows once andctrl+rrejects once the oldest ask — never an "always" — and the ask leaves the queue the moment it is answered. - A Claude Code member is
--terminal-agent,martha start <member>unchanged, run in a pty and drawn through a VT emulator: its pane is the CLI's own screen. While that pane is on screen every key butf12is the CLI's —ctrl+cinterrupts its turn there, not the screen — andf12hands the keyboard back to the crew and takes it again. Resizing the terminal resizes the CLI with it. The CLI's own asks stay in its own dialog. Its keys reach the CLI through a writer of the terminal's own, so a CLI that stops reading them is named on screen and never holds the crew. - The room pane (
f10) runs one--roomchild,martha room --follow: the crew room's messages, as the follow prints them, oldest first and each new one as it lands. A line typed there is sent to the whole crew through that same child, and the follow's answer comes back into the pane. A room that cannot start says why where the room would be drawn. - The martha.json editor is a tab (
f11): its schema ismartha schema's answer, so it hard-codes no field, and it edits the declaration the crew was read from. A save writes the proposal beside the crew's own state and asksmartha declare --from <file>to check and write it; a refusal is shown in the tab and the owner's edits stay where they are. --prompt <text>is the first turn for every member the screen starts, with the meaningmartha up --promptgives it (martha-ai/martha#134): an engine member is sent it once its session opens, and for a Claude Code member — whosemartha startrefuses--promptoutside Martha's own tmux window — it is typed into the member's terminal once its composer has settled, astmux send-keysdoes.- A restart asks each engine member's agent for the session it had (
session/load) and starts a new one (session/new) when there is none or the agent no longer holds it. The ids are kept in the crew's own state directory, underlazymartha/sessions.json.
Layout
cmd/lazymartha— the handshake, and the crew screen's wiring.internal/schema— read the schema and check its major.internal/editor— the pure model: a key in, a screen out, a declaration out.internal/acp— the ACP client: one agent child, its requests, its updates.internal/terminal— one Claude Code member's CLI in a pty, and the emulator that draws it.internal/room— the crew room's one child (martha room --follow): its lines, and the owner's.internal/crew— the crew screen: its places, its members and their rows, its strip, its live members, its pure model.internal/files— read the declaration, write the proposal through a temp file.
go test ./... and go vet ./... are the gate; no test reaches an outside service.