Build steps 1, 2 and 4 of the plan in DESIGN.md. core/ is pure JS with zero Foundry globals and 11 passing invariants. The fiction model has one root draw — an APPETITE plus the ACCOMMODATION someone made for it — and projects the motif, danger, prize, faction, cue fragments and the appeasement move from it, so the fiction coheres instead of being four unrelated draws. 336 kernels from 21 authored lines; 60 generated delves gave 51 distinct kernels. Cue fragments are tagged by facet (institution/ritual/demand/wound/anchor) and dealt without replacement. The facet progression across the arc reproduces the hand-authored paper delve's structure, which had arrived at it by instinct. Generation and table dice stay apart: pressure.mjs decides when a clock roll is due and what it means, and never rolls. That is what makes the skeleton seed an honest promise rather than a half-truth. paper/ holds the hand-written delve and both playtest logs. spike/ holds the instrumented harness that measured the Forge outside Foundry. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
21 lines
986 B
JavaScript
Executable File
21 lines
986 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
/** DELVE CLI — map-free by necessity: forgeStage needs browser APIs (see spike report §3A). */
|
|
import { readFileSync, writeFileSync } from 'fs';
|
|
import { fileURLToPath } from 'url';
|
|
import { dirname, join } from 'path';
|
|
import { generateDelve } from './delve.mjs';
|
|
import { renderMarkdown } from './render.mjs';
|
|
|
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
const args = Object.fromEntries(process.argv.slice(2).map(a => {
|
|
const [k, v = true] = a.replace(/^--/, '').split('=');
|
|
return [k, v === true ? true : (/^\d+$/.test(v) ? Number(v) : v)];
|
|
}));
|
|
|
|
const theme = args.theme ?? 'barrow';
|
|
const pack = JSON.parse(readFileSync(join(here, 'content', `${theme}.json`), 'utf8'));
|
|
const delve = generateDelve({ pack, ...args });
|
|
|
|
if (args.json) { const out = JSON.stringify(delve, null, 2); args.out ? writeFileSync(args.out, out) : console.log(out); }
|
|
else { const md = renderMarkdown(delve); args.out ? writeFileSync(args.out, md) : console.log(md); }
|