Mod UI

Mods describe their UI with chained builders, in GPUI's names, from gpui-kit and gpui-base.

Chained builders with GPUI's snake_case names: div(), h_flex(), v_flex(); .size_full(), .flex_1(), .gap(n), .p(n), .px(n), .w(n), .h(n), .items_center(), .justify_between(), .overflow_y_scrollbar(); .child("text"), .text_size(n), .font_semibold(), .truncate(), .text_color(c); .bg(c), .border(1), .border_color(c), .rounded(n); .id("unique") then .on_click(...), .on_mouse_down("right", ...), .hover((s) => s.bg(c)), .on_scroll_wheel(...); keyboard: this.h = cx.focus_handle() in init, .track_focus(this.h).on_key_down((e, cx) => …), this.h.focus(). .on_drop((event, cx) => …) on a plain layout element receives external files as event.paths (absolute paths). The feedback form accepts dropped images with the same limits, previews and removal as picked images. .on_hover((hovered, cx) => …) reports pointer entry and exit on buttons and other interactive controls too. .when(cond, (el) => …), .children([...]). A long feed of unequal rows: list(id, count, key, render, { align: "bottom" }) draws only what's on screen and follows its end while the person is scrolled there (a chat, a log); rows take no handlers, so use the list's .on_item_click((key, cx, event) => …): event.local_position and event.bounds say where in the row it landed (a row with buttons of its own), and .on_item_hover((key, hovered, cx) => …) says when the pointer comes onto or leaves a row. Controls from gpui-base (Button, Checkbox, Switch, InputState + Input) are unstyled: style them. Text: TextView.markdown(id, text) renders markdown (.copy_quotes(): a Copy button beside each quoted block); EditorState.new({ language, value, readonly, font_family: settings().font_family, syntax: { keyword: theme().ansi5, ... } }) + Editor.new(state) is a code view (readonly) or editor with syntax highlighting, line numbers and folding. A viewer opens beside the shell as a pane: pane.split {direction, mod, props: { file }}. The full surface is in gpui-kit.d.ts next to this file.

Your agents read these same words: Woolshed writes this guide to ~/.config/woolshed/AGENTS.md on every start. In it, “you” is the agent and “the person” is you.