{"id":51002158,"url":"https://github.com/fru-dev3/prevail-tui","last_synced_at":"2026-06-20T15:33:26.056Z","repository":{"id":363125616,"uuid":"1262055735","full_name":"fru-dev3/prevail-tui","owner":"fru-dev3","description":"prevAIl TUI — a terminal cockpit that drives the prevail engine over its --json/NDJSON contract (thin subprocess client; same seam as the desktop app).","archived":false,"fork":false,"pushed_at":"2026-06-07T15:58:06.000Z","size":81,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-07T16:10:48.873Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fru-dev3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-07T14:11:53.000Z","updated_at":"2026-06-07T15:58:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/fru-dev3/prevail-tui","commit_stats":null,"previous_names":["fru-dev3/prevail-tui"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/fru-dev3/prevail-tui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fru-dev3%2Fprevail-tui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fru-dev3%2Fprevail-tui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fru-dev3%2Fprevail-tui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fru-dev3%2Fprevail-tui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fru-dev3","download_url":"https://codeload.github.com/fru-dev3/prevail-tui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fru-dev3%2Fprevail-tui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34576043,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-20T15:33:22.683Z","updated_at":"2026-06-20T15:33:26.048Z","avatar_url":"https://github.com/fru-dev3.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prevail-tui\n\n[![ci](https://github.com/fru-dev3/prevail-tui/actions/workflows/ci.yml/badge.svg)](https://github.com/fru-dev3/prevail-tui/actions/workflows/ci.yml)\n\nA terminal cockpit for the **prevail** engine — built as a **thin subprocess\nclient** of the `prevail … --json` / NDJSON contract.\n\nThis is the same decoupled architecture the **desktop app** uses\n(`fd-apps-prevail-desktop` → `src-tauri/src/engine.rs`): the engine\n(`fd-apps-prevail-cli`) is the single source of truth, and every frontend\ndrives it over the JSON contract rather than importing it in-process.\n\n```\n                 ┌─────────────────────────────┐\n                 │   prevail (engine + CLI)     │   fd-apps-prevail-cli\n                 │   `prevail … --json` / NDJSON │   (do not edit here)\n                 └──────────────┬──────────────┘\n            ┌──────────────────┼──────────────────┐\n            ▼                  ▼                  ▼\n     prevail (cmds)     desktop (Tauri)       prevail-tui   ◄── this repo\n                       engine.rs seam      engine.ts seam\n```\n\n\u003e **Why not import the engine in-process** (like the original cockpit does)?\n\u003e Decoupling matches the desktop, keeps the engine the single contract owner,\n\u003e and means a TUI can be rewritten in any language later. The cost is one\n\u003e subprocess hop per call — negligible for a cockpit.\n\n## Requirements\n\n- [Bun](https://bun.sh) ≥ 1.3\n- The `prevail` binary installed and on PATH (or in `~/.local/bin`,\n  `~/.bun/bin`, `/opt/homebrew/bin`). Build it from `fd-apps-prevail-cli`.\n\n## Run\n\n```bash\nbun install\nbun run dev                 # uses ~/.prevail/config.json's vaultPath\nbun run dev -- --vault /path/to/vault\nbun run build               # → dist/prevail-tui (single binary, bun --compile)\n```\n\n## What it does\n\nA six-tab cockpit over every life domain in the vault:\n\n- **Sidebar** — all domains with a color-coded readiness **score badge** and\n  open-loop count; the streaming domain is marked. Header shows the\n  **life-readiness** aggregate, a live clock, the vault path, and a **Bunker**\n  chip when local-only mode is on.\n- **Chat** — streaming chat (NDJSON). With Council on (or `/council \u003cq\u003e`), the\n  turn fans out to the engine's council. Engine label, `↑/↓` recall, slash\n  commands, and a config bar (web/save/serendipity/auto + framework/lens) that\n  **persists to the engine**.\n- **Insights** — the engine's proactive **surface** (questions + next actions,\n  `a` to (re)generate), the **decision log** with the `↑/↓` feedback the council\n  learns from, and the domain's distilled **long-term memory**.\n- **Score** — the headline score, the six breakdown dimensions as bars with\n  their detail, the domain **relevance** rubric, surfaced gaps by severity,\n  and the cached LLM assessment. `a` runs a fresh `score --audit`.\n- **State** — read-only vault markdown (`state.md`/`_state.md` + open-loops).\n- **Manifest** — identity + config; `e`/`m` edit label/summary inline.\n- **History** — sparkline of `score history` + delta + recent samples.\n\n### Keys\n\n| Context | Keys |\n|---------|------|\n| Sidebar | `↑/↓` (or `j/k`) domain · `g/G` first/last · `←/→` (or `tab`, `1`–`6`) switch tab · `i`/`⏎` focus chat · `a` audit (score) / surface (insights) · `e`/`m` edit label/summary (manifest) · `r` refresh · `q` quit |\n| Chat | type · `⏎` send · `↑/↓` recall · `esc` → domains |\n| Manifest edit | `⏎` save · `esc` cancel |\n\nSlash commands: `/council \u003cq\u003e` · `/quorum \u003cn\\|off\u003e` · `/feedback up\\|down [note]` ·\n`/bunker on\\|off` · `/search \u003ctext\u003e` · `/insights` · `/surface` · `/score` ·\n`/audit` · `/state` · `/manifest` · `/history` · `/clear` · `/help` · `/exit`.\n`ctrl+c` quits from anywhere.\n\n## Architecture\n\n| File | Role |\n|------|------|\n| `src/contract.ts` | Typed mirror of the engine's `--json`/NDJSON shapes (see `fd-apps-prevail-cli/docs/schemas`). |\n| `src/engine.ts` | **The only seam to the engine.** Binary resolution + env enrichment + `runJson()` (request/response) + `streamChat()` (NDJSON). Ported from the desktop's `engine.rs`. |\n| `src/council.ts` | Thin adapter over the engine's `council run --json` NDJSON stream (panel + chair + quorum + persisted decision). The engine owns the fan-out. |\n| `src/format.ts` | Pure presentation helpers: score color, bars, sparkline, relative time, severity. |\n| `src/sidebar.tsx` | Header banner + life-domains sidebar. |\n| `src/panes.tsx` | Insights / Score / State / Manifest / History detail panes. |\n| `src/chat.tsx` | Chat transcript + message rows + input. |\n| `src/app.tsx` | OpenTUI + React orchestrator: layout, tabs, state, keyboard. |\n| `src/index.tsx` | Entry: resolve vault, prefetch `score --all`, load domains, boot the renderer. |\n\n### Contract used (engine v1.7.0+)\n\nRequest/response `--json`: `domains`, `score [--audit]`, `score --all`,\n`score history`, `manifest get/set`, `onboard recommend/apply`, `vault …`,\n`heartbeat …`, `gateway status`, and the v1.7.0 additions —\n`council feedback`, `decisions list`, `memory read`, `surface`,\n`frameworks/lenses list`, `modes get/set`, `privacy get/set`, `search`,\n`bench list`, `connectors list`. Failure envelope: `{ ok:false, error, code }`.\n\nStreaming (NDJSON, message on stdin):\n- `chat --domain \u003cd\u003e --json`: `start → user → delta* → assistant → usage → done`.\n- `council run --domain \u003cd\u003e --json`: `start → panel → delta* → panelist* →\n  chair → verdict-delta* → verdict → decision → done` (or `error`).\n\n## Engine seam\n\nEverything goes through `src/engine.ts` — the only place this TUI talks to the\n`prevail` binary, the same decoupled architecture the desktop uses (`engine.rs`).\nThe engine (v1.7.0+) now owns council orchestration, the decision log, surface,\nmodes, privacy, and search, so the TUI carries **no** business logic of its own —\nit reads and writes the same `--json` contract the desktop does, against the\nsame vault files.\n\n## Status\n\nFull working cockpit driven entirely over the `--json` contract: domains\nsidebar with live score badges + life-readiness aggregate, streaming chat,\n**engine-driven council** (quorum + verdict feedback), the **Insights** tab\n(surface + decision log + long-term memory), per-domain **modes** and global\n**Bunker** that persist to the engine, framework/lens, and Score / State /\nManifest / History detail tabs. Not yet surfaced: a dedicated benchmark page\nand the onboarding wizard (the engine exposes `bench list` / `onboard` for both).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffru-dev3%2Fprevail-tui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffru-dev3%2Fprevail-tui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffru-dev3%2Fprevail-tui/lists"}