feat(maestro): tile-first web spawn form — host/command tiles, recents, worktree-by-branch, generated name (#27)
ci / rust (push) Successful in 4m29s

Rework web/src/spawn.ts from raw text boxes into a low-friction, tile-first
flow: pick host tile → pick command tile → pick recent dir → Spawn, name
already filled.

- Command tiles from the daemon's advertised presets (GET /api/web/info, #26),
  with built-in fallback; `custom` reveals the free-text command input.
- Host tiles replace the <select> (label hostname, sub daemon_id); most-
  recently-spawned-on host sorts first + pre-selected; overflow behind "More…".
- Recent-dirs picker per host (GET /api/daemons/:id/recent-dirs, #26), rows show
  dir + last command, re-queried on host change; picking a dir can pre-select
  its last command. Persistent "Other directory…" drops to the raw input +
  NAP-329 autocomplete; empty history prefills raw with home_dir.
- Worktree by branch alone: toggle infers base_repo via /gitroot from the
  chosen dir (#26); non-repo dir disables the toggle with an inline hint;
  WorktreeSpec.base_repo filled client-side (wire unchanged).
- Name field prefilled with a generated cyberpunk handle (names.ts mirrors the
  maestro-names wordlists); ↻ rerolls.

Adds api.ts getWebInfo/recentDirs/gitRoot, the WebInfo/SpawnPreset/RecentDirs/
GitRoot types, and stubs the new endpoints in the `?mock&spawn` review fixture.

Closes #27

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-20 21:22:25 +00:00
co-authored by Claude Opus 4.8
parent f38b948aa6
commit b3ef2e543e
8 changed files with 792 additions and 137 deletions
+39
View File
@@ -37,6 +37,45 @@ export interface DirListing {
truncated?: boolean;
}
/** A spawn-form command preset advertised by the daemon (#22/#26). The `custom`
* preset has an empty `command` and reveals the free-text command input. */
export interface SpawnPreset {
id: string;
label: string;
command: string;
}
/** `GET /api/web/info` — the connected daemon's identity plus its spawn presets
* (#26). Mirrors the daemon-side `WebInfo`. */
export interface WebInfo {
daemon_id: string;
hostname: string;
version: string;
daemon_url: string;
/** Command presets (claude/opencode/zsh + custom), config-resolved. */
presets: SpawnPreset[];
}
/** One deduplicated recent working dir for the spawn form's recents picker
* (#24/#26). */
export interface RecentDir {
cwd: string;
last_command: string;
last_used: IsoTimestamp;
}
/** `GET /api/daemons/:id/recent-dirs` — a host's recent working dirs (#26). */
export interface RecentDirs {
dirs: RecentDir[];
truncated?: boolean;
}
/** `GET /api/daemons/:id/gitroot?path=` — the enclosing repo toplevel of a path
* on a host, or absent when the path isn't inside a repo (#26). */
export interface GitRoot {
root?: string;
}
export interface WorktreeSpec {
base_repo: string;
branch: string;