wip
  • TypeScript 73.6%
  • Go 25%
  • JavaScript 1.3%
Find a file
2026-07-13 06:35:41 -04:00
.pi/dev-suite/task-graph chore(task-graph): make feature commits automatic 2026-06-15 21:26:20 -04:00
docs Stabilize responsive Charm UI 2026-07-13 06:30:27 -04:00
packages Fix setup stream recovery races 2026-07-13 06:35:41 -04:00
patches start switching to monorepo 2025-04-28 19:10:22 -04:00
scratchpad start switching to monorepo 2025-04-28 19:10:22 -04:00
scripts Stabilize responsive Charm UI 2026-07-13 06:30:27 -04:00
.editorconfig start switching to monorepo 2025-04-28 19:10:22 -04:00
.gitattributes initial commit 2025-04-25 20:53:43 -04:00
.gitignore docs: refresh project and agent guidance 2026-07-12 17:35:00 -04:00
AGENTS.md docs: refresh project and agent guidance 2026-07-12 17:35:00 -04:00
ARCHITECTURE_OPPORTUNITIES.md Remove non-Charm user interfaces 2026-07-12 18:01:50 -04:00
BUILD_SYSTEM_OPPORTUNITIES.md Remove non-Charm user interfaces 2026-07-12 18:01:50 -04:00
dprint.json feat(cli): align modal layout slots 2026-06-20 21:56:57 -04:00
EFFECT_TS_OPPORTUNITIES.md Remove non-Charm user interfaces 2026-07-12 18:01:50 -04:00
eslint.config.mjs chore(lint): enforce Effect backend rules 2026-06-15 21:29:27 -04:00
flake.lock feat(cli): add alternate TUI experiments 2026-06-14 10:39:12 -04:00
flake.nix feat(cli): add alternate TUI experiments 2026-06-14 10:39:12 -04:00
FP_IMMUTABILITY_OPPORTUNITIES.md Remove non-Charm user interfaces 2026-07-12 18:01:50 -04:00
LICENSE start switching to monorepo 2025-04-28 19:10:22 -04:00
originalreadme.md fix(build): align CLI imports and format gate 2026-05-29 22:53:23 -04:00
package.json Build immersive campground and tunnel experience 2026-07-12 20:58:47 -04:00
pnpm-lock.yaml Remove non-Charm user interfaces 2026-07-12 18:01:50 -04:00
pnpm-workspace.yaml Add audit remediation gates 2026-05-29 20:45:40 -04:00
README.org Enable graceful server hot reload 2026-07-13 03:12:34 -04:00
setupTests.ts start switching to monorepo 2025-04-28 19:10:22 -04:00
TODO.org Remove non-Charm user interfaces 2026-07-12 18:01:50 -04:00
tsconfig.base.json Remove non-Charm user interfaces 2026-07-12 18:01:50 -04:00
tsconfig.build.json Remove non-Charm user interfaces 2026-07-12 18:01:50 -04:00
tsconfig.json Remove non-Charm user interfaces 2026-07-12 18:01:50 -04:00
vitest.bench.ts Add audit remediation gates 2026-05-29 20:45:40 -04:00
vitest.shared.ts Remove non-Charm user interfaces 2026-07-12 18:01:50 -04:00
vitest.workspace.ts Add audit remediation gates 2026-05-29 20:45:40 -04:00

WORK IN PROGRESS

description

rewrite of the famous game flaghack

Validation gates

Audit-remediation work should use the project gates documented in docs/testing-gates.md. The short version is:

  pnpm generated:guard
  pnpm format:check
  pnpm check
  pnpm test:unit
  pnpm test:charm
  pnpm test:perf
  pnpm test:api:bot
  pnpm test:e2e:tmux:bot

For the smoke aggregate, run pnpm verify:smoke. For the stricter readiness gate that also runs pnpm check, run pnpm verify:gates.

The full build/codegen lifecycle is still known to be fragile; this setup does not claim that pnpm run build is fixed. Do not edit generated build/, dist/, declaration, map, backup, or generated schema JavaScript files by hand.

Running the game

downloading and installing

  git clone git@github.com:htayj/flaghack.git
  cd flaghack
  corepack enable
  corepack prepare pnpm@9.10.0 --activate
  pnpm install

The default CLI uses the Go Charmbracelet frontend. Use the Nix development shell for the matching Node, pnpm, Go, Python, and tmux toolchain:

  nix develop

to run the game

in one terminal run (this starts the server):

  pnpm run serve

and then in a second terminal run:

  pnpm run cli

to start the default Charmbracelet terminal client

A fresh game starts with role selection; the only current role is virgin. The default client supports NetHack movement, , pickup, d drop, e eat, q quaff, M-l loot, ; look, and _ travel. Use o or c followed by a direction to open or close a door; moving into a closed door also opens it.

Use C-s or #save to save and exit. Use C-q or #quit and confirm with y to permanently quit without saving. The server lazily resumes an existing save on first access; the explicit restore endpoint consumes a successfully decoded save. Saves default to $XDG_STATE_HOME/flag-hack/save.json, ~/.local/state/flag-hack/save.json when XDG_STATE_HOME is unset, or .flaghack/save.json when no home is available. Override the location with FLAGHACK_SAVE_PATH.

For agent/bot testing while a human server is already running on port 3000, use the bot port commands:

  pnpm run bot:serve
  pnpm run bot:cli

These use port 3100.

server hot reloading

The development server watches both server and shared domain TypeScript sources. Start it with:

  pnpm run serve

Changes are coalesced for 200 milliseconds and then restart the server through its nodemon-aware graceful shutdown path, including the normal shutdown autosave.

exiting the game

Use C-s or #save for a resumable save-and-exit. Use C-q or #quit for confirmed permanent quit. C-c disconnects the terminal client without saving; use C-s for durable progress. Autosave runs only when the server itself shuts down cleanly.