#!/usr/bin/env -S bun --no-env-file --config=/dev/null /** * gstack-gate — render and parse the one gate list (plan B9). * * gstack-gate render [--page N | --all] * gstack-gate parse --reply "" --gate-rev N [--json] * gstack-gate decisions [--reply "" --gate-rev N] [--answered-at ISO] * * Logic: lib/gate-list.ts. Codes: lib/result-codes.ts (GATE_REV_STALE, GATE_REPLY_UNPARSED). */ import * as fs from 'node:fs'; import { EXIT, exitTableHelp } from '../lib/headless-artifacts'; import { applyReply, decisionRows, parseReply, renderGate, validateGateList, type GateList } from '../lib/gate-list'; import { resultLine } from '../lib/result-codes'; const HELP = `gstack-gate — one gate list, one reply grammar render [--page N | --all] numbered items with stable ids, auto/approval, the reply shape; --all prints every item on one page (relay every page) parse --reply "" --gate-rev N [--json] resolved choices as JSON; unparsed tokens are listed, never guessed decisions [--reply "" --gate-rev N] [--answered-at ISO] decisions.jsonl rows (pending, or applied when a reply is given) Reply grammar: \`rec\` (alias \`all\`) · \`rec except \` · \`