@zodeus/reaping-mcp 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46057,7 +46057,7 @@ var import_websocket = __toESM(require_websocket(), 1);
46057
46057
  var import_websocket_server = __toESM(require_websocket_server(), 1);
46058
46058
 
46059
46059
  // scripts/mcp/link.ts
46060
- var ORIGINS = /^https?:\/\/(127\.0\.0\.1|localhost|\[::1\]|reaping\.zodeus\.com)(:\d+)?$/;
46060
+ var ORIGINS = /^(https?:\/\/(127\.0\.0\.1|localhost|\[::1\]|reaping\.zodeus\.com)(:\d+)?|app:\/\/reaping)$/;
46061
46061
  var NEWS_MAX = 60;
46062
46062
  var GameLink = class {
46063
46063
  constructor(port) {
@@ -46371,10 +46371,10 @@ var TOOLS = [
46371
46371
  {
46372
46372
  name: "pace",
46373
46373
  title: "Pace",
46374
- description: "turns (default): the world holds still between your calls and time runs only while you wait. live: the clock runs on its own at speed 1 or 2. follow: whether the camera glides to what you do.",
46374
+ description: "turns (default): the world holds still between your calls and time runs only while you wait. live: the clock runs on its own at speed 1, 2 or 3. follow: whether the camera glides to what you do.",
46375
46375
  shape: {
46376
46376
  pace: external_exports.enum(["turns", "live"]).optional(),
46377
- speed: external_exports.union([external_exports.literal(0), external_exports.literal(1), external_exports.literal(2)]).optional().describe("Live only: 0 paused, 1, 2."),
46377
+ speed: external_exports.union([external_exports.literal(0), external_exports.literal(1), external_exports.literal(2), external_exports.literal(3)]).optional().describe("Live only: 0 paused, 1, 2, 3."),
46378
46378
  follow: external_exports.boolean().optional()
46379
46379
  }
46380
46380
  },
@@ -46382,12 +46382,12 @@ var TOOLS = [
46382
46382
  name: "wait",
46383
46383
  title: "Let time run",
46384
46384
  timeout: 6e4,
46385
- description: "Lets time run until dawn, morning, dusk or night, or for seconds or days of game time (a day is 450 s), up to two days, at hurry 1-8 times speed. Comes back early when something urgent happens (raid, Reaping, a death, an omen) and after about 45 real seconds regardless; it says how far it got and what happened meanwhile. In turns pace this is the only time the world moves.",
46385
+ description: "Lets time run until dawn, morning, dusk or night, or for seconds or days of game time (a day is 450 s), up to two days, at speed hurry (1-3, as the HUD speeds 1x 2x 3x). Comes back early when something urgent happens (raid, Reaping, a death, an omen) and after about 45 real seconds regardless; it says how far it got and what happened meanwhile. In turns pace this is the only time the world moves.",
46386
46386
  shape: {
46387
46387
  until: external_exports.enum(["dawn", "morning", "dusk", "night"]).optional(),
46388
46388
  seconds: external_exports.number().min(1).max(900).optional(),
46389
46389
  days: external_exports.number().min(0.05).max(2).optional(),
46390
- hurry: external_exports.number().int().min(1).max(8).optional().describe("Speed multiplier while waiting (default 1).")
46390
+ hurry: external_exports.number().int().min(1).max(3).optional().describe("Speed while waiting: 1, 2 or 3 (default 1).")
46391
46391
  }
46392
46392
  }
46393
46393
  ];
@@ -46396,9 +46396,9 @@ var TOOLS = [
46396
46396
  var PORT = Number(process.env.REAPING_AI_PORT) || 5341;
46397
46397
  var GUIDE_FILE = new URL("../../.claude/skills/play-reaping/SKILL.md", import.meta.url);
46398
46398
  var CALL_TIMEOUT = 1e4;
46399
- var VERSION = true ? "0.1.0" : "0.0.0-dev";
46399
+ var VERSION = true ? "0.1.2" : "0.0.0-dev";
46400
46400
  function guide() {
46401
- if (true) return '# Playing The Last Reaping as the Reeve\n\nThe Last Reaping is a plague and folk-horror colony sim. The villagers choose their own work:\nthey haul, build, farm, bury and fight. You are **the Reeve**. You place buildings, zones and\nfields; set how many hands work where; set stock targets; choose rites to remember; and answer\nomens. Someone is watching the game. Everything you do is drawn on their map in violet: brackets\nclose in on a site, ants march round a zone, a red cross marks a refusal, and your hand glides\nfrom deed to deed. Your `why` shows as the caption on their screen.\n\n## Setup\n\n1. The server. Players get it from npm: the MCP client runs `npx -y @zodeus/reaping-mcp` (Node 18+),\n for example `{ "mcpServers": { "reaping": { "command": "npx", "args": ["-y", "@zodeus/reaping-mcp"] } } }`\n in Claude Desktop, or `claude mcp add reaping -- npx -y @zodeus/reaping-mcp` in Claude Code. The\n package README (`packages/reaping-mcp/README.md`) has every client. In this repo, `.mcp.json`\n registers the source as `reaping` (`npm run mcp`), so a Claude Code session here already has it.\n2. The person opens the game with the Reeve: the Reeve poster on the title screen, then\n **Open with the Reeve**, or `https://reaping.zodeus.com/?ai=1`. Chrome may ask to let the page\n reach the local network: they allow it. In this repo, `http://127.0.0.1:5327/?ai=1` is the\n person\'s own dev server: **never start or drive port 5327 yourself**. For automated checks use\n the verify rig on 5328 with `?ai=<port>&fresh=1&title=0` and the server on that port\n (`REAPING_AI_PORT`).\n3. A plate in the bottom-left corner says "The Reeve". When its dot glows violet, you are\n linked. Call `status`. If the game is on the title or founding screen, the person has to\n start or continue a village; you can\'t press it.\n4. Keep the tab visible. A browser stops a hidden tab, so time stands still.\n\n## The turn loop\n\n1. `status`: the date and hour, food and firewood in days, alerts with tiles, omens waiting, and\n the news since your last look. Read every line of it.\n2. Look where it matters: `map` (centred on the hearth by default, 64x40 at most), `list`, or\n `inspect`.\n3. Do **two to five** deeds, each with a `why` in one plain sentence ("Two hovels: eight sleep\n rough and strangers come at dawn."). Use `find_spot` for coordinates, never guesses. Read each\n reply: a refusal says why.\n4. `wait`: `until: "dusk"` before night, `until: "dawn"` through it, or `seconds` for a short\n while. `hurry: 2-4` while nothing is happening; `hurry: 1` when danger is near, so the watcher\n can follow. `wait` comes back early for raids, deaths and omens. When it does, look again\n before acting.\n\nIn `turns` pace (the default), the world is still while you think and runs only during `wait`.\n`pace` switches to `live` if the person wants the clock to run freely.\n\n## How the valley works\n\n- **Time.** A day is 450 game seconds. A season is 4 days and a year is 16 days. Dusk comes at\n 84% of the day and night at 90%. Spring: till and sow. Summer: grow. Autumn: harvest, then\n Reaping Night. Winter: nothing grows, homes burn firewood, and the cold kills.\n- **Food.** `status` gives food in days at the rate the village eats. Fields need a farmhouse\n within 16 tiles (labourers work them before there is one) and are sown in season: grain in\n spring and summer. Berries and meat rot fast; a granary slows it, and smoked meat keeps.\n Foragers and hunters bridge the gap until the first harvest.\n- **Firewood.** The chopping block turns wood into firewood. Homes burn it only in cold seasons,\n so stock up before winter (`set_target firewood`).\n- **Beds.** Anyone without a bed sleeps rough: cold, miserable, and prey for the night hunters\n from the third night on. Strangers walk in at dawn, more when beds and food wait for them, and\n some carry the plague.\n- **The dead.** Bodies must go in a **graveyard** (12 graves; it needs stone) or on a **pyre**\n (faster, burns firewood, and the faiths remember it). Unburied bodies are the worst miasma, and\n miasma breeds plague. Plague is the biggest killer after raids. Answer it with a lazar house,\n herbs, a healer and wells (washing sheds taint).\n- **Nights.** After 2 grace nights, a horde comes every night, warned at dusk and stronger each\n day. From day 4 a smaller band also walks in by daylight. Light (torch posts, braziers) keeps the\n worst off the paths. Palisades and gates keep walkers out (carrion fly over), and watchtowers\n shoot. The **bell** (`command {"type":"bell","on":true}`) sends everyone home and musters the\n militia at the watch house. Ring it when a horde is at the door, and stand down after.\n- **The Tithe Stone.** Each autumn the Stone names its due in grain, meat and effigies (effigies\n come from a wickerwright, taught by *The Straw Man*). It is judged on Reaping Night, the last\n night of autumn. Paid in full, the year is blessed. Short, Dread rises: Hollows climb out of\n the fields, and the Reaping horde comes 2.5x as strong. Send items with\n `command {"type":"titheSend","item":"meat","on":true}`.\n- **Lore.** Most buildings are forgotten at first. Build a **telling house**, give it a scholar,\n and `study` a rite. `catalog` lists what can be studied now and what each teaches. Most later\n rites are lost until their book turns up in gathering, hunting, farming, burials or kills.\n- **Faith.** The villagers follow the Stone, the Bell or the Green. Each faith wants a place to\n pray, and favour moves its tier, which helps or hurts the whole village. Omens ask a question\n with numbered choices. Answer them (`answer_omen`) before their dawn or they take the default.\n- **Dark land.** Nothing can be built where nobody has walked (blank on the map). Workers carry\n the known land outward, and a watchtower sees far.\n\n## An opening that holds\n\nThis order is distilled from the headless autopilot (`scripts/sim/autopilot.ts`, `Autopilot.daily`).\nEven its colonies fall between day 7 and day 28 when nobody tends them. The usual killers are\nraids by night and by day, then plague bred by bodies left unburied because no stone meant no\ngraveyard. Watch those three.\n\n- **Day 1:** `study` a first rite. The order the autopilot uses is *deerPath*, *strawMan*, *furrow*,\n *commonPot*, *hueCry*, *midden*, *hewing*, *leavings*, *greenMan*, *lamb*, *bankedFire*,\n *tallow*, then plague care (*rue*, *comfrey*). Then:\n - hovels until beds \u2265 souls + 2;\n - a woodcutter\'s hut by the trees;\n - a forager\'s hut;\n - a telling house;\n - a stockpile zone of about 5x4 near the hearth.\n- **Days 1-2:** a chopping block, a farmhouse in spring or summer, and a first field of grain of\n about 6x5 beside it. Add a granary and a woodshed.\n- **Day 3, before the raids grow:**\n - a **quarry by the nearest rock** (`find_spot quarry` searches from it);\n - a **graveyard** at least 6 tiles out;\n - a well;\n - a hunter (meat for the tithe);\n - a chandler (candles).\n- **Days 4-6:**\n - a pyre and a midden downwind;\n - two braziers;\n - a place for each faith (green chapel, offering stone, chapel);\n - a herb garden, a healer, a cookhouse;\n - a watch house;\n - torch posts out at the edge;\n - a palisade ring about 16 tiles out with a gate on the road side (`build_line`, a stretch at\n a time as wood allows).\n- **After that:**\n - bakehouse, watchtowers, wickerwright (effigies), alehouse;\n - a lazar house the moment anyone sickens;\n - more woodcutters and foragers as the village grows: one woodcutter per 10 adults, one\n forager per 15;\n - improvements on homes first (`upgrade`).\n\nKeep spare hands: a trade wants its workers plus about two labourers left over to haul and\nbuild. Don\'t stake out more than stock can pay. Unpaid sites still tie up builders.\n\n## Tool notes\n\n- Coordinates are tiles: x across, y down. A building\'s x, y is its **top-left**, and its door\n is under the middle of its bottom row.\n- "Clear the ground first." means `clear` the rectangle and let labourers take it down by day.\n "Nobody has walked that land yet." means dark land.\n- Improvements are raised with `upgrade` on the finished base, never placed fresh.\n- `inspect` a workshop to see its recipes; `set_recipe` switches one, and `set_target` decides\n when makers stop.\n- `command` sends anything else in the game\'s command set (bell, titheSend, offer, setService,\n invoke, setLabourers, setCrop, flag, unzone...).\n- `screenshot` shows what the camera sees; `look_at` points it first.\n\n## Playing for the person watching\n\n- Always give a `why`. It is the only voice you have on their screen.\n- Act in small batches and then let time run. Thirty deeds at once is noise.\n- Never demolish the starting buildings (the hearth, the Tithe Stone), and never offer a\n villager to the Stone unless the person agrees. It is a life.\n- If they say "follow off" or "go live", use `pace`. If they take over, stop acting.\n';
46401
+ if (true) return '# Playing The Last Reaping as the Reeve\n\nThe Last Reaping is a plague and folk-horror colony sim. The villagers choose their own work:\nthey haul, build, farm, bury and fight. You are **the Reeve**. You place buildings, zones and\nfields; set how many hands work where; set stock targets; choose rites to remember; and answer\nomens. Someone is watching the game. Everything you do is drawn on their map in violet: brackets\nclose in on a site, ants march round a zone, a red cross marks a refusal, and your hand glides\nfrom deed to deed. Your `why` shows as the caption on their screen.\n\n## Setup\n\n1. The server. Players get it from npm: the MCP client runs `npx -y @zodeus/reaping-mcp` (Node 18+),\n for example `{ "mcpServers": { "reaping": { "command": "npx", "args": ["-y", "@zodeus/reaping-mcp"] } } }`\n in Claude Desktop, or `claude mcp add reaping -- npx -y @zodeus/reaping-mcp` in Claude Code. The\n package README (`packages/reaping-mcp/README.md`) has every client. In this repo, `.mcp.json`\n registers the source as `reaping` (`npm run mcp`), so a Claude Code session here already has it.\n2. The person opens the game with the Reeve: the Reeve poster on the title screen, then\n **Open with the Reeve**, or `https://reaping.zodeus.com/?ai=1`. Chrome may ask to let the page\n reach the local network: they allow it. In the desktop app the same poster works, or the app\n started with `--ai` (`--ai=<port>` for another port). In this repo, `http://127.0.0.1:5327/?ai=1` is the\n person\'s own dev server: **never start or drive port 5327 yourself**. For automated checks use\n the verify rig on 5328 with `?ai=<port>&fresh=1&title=0` and the server on that port\n (`REAPING_AI_PORT`).\n3. A plate in the bottom-left corner says "The Reeve". When its dot glows violet, you are\n linked. Call `status`. If the game is on the title or founding screen, the person has to\n start or continue a village; you can\'t press it.\n4. Keep the tab visible. A browser stops a hidden tab, so time stands still.\n\n## The turn loop\n\n1. `status`: the date and hour, food and firewood in days, alerts with tiles, omens waiting, and\n the news since your last look. Read every line of it.\n2. Look where it matters: `map` (centred on the hearth by default, 64x40 at most), `list`, or\n `inspect`.\n3. Do **two to five** deeds, each with a `why` in one plain sentence ("Two hovels: eight sleep\n rough and strangers come at dawn."). Use `find_spot` for coordinates, never guesses. Read each\n reply: a refusal says why.\n4. `wait`: `until: "dusk"` before night, `until: "dawn"` through it, or `seconds` for a short\n while. `hurry: 2-3` while nothing is happening; `hurry: 1` when danger is near, so the watcher\n can follow. `wait` comes back early for raids, deaths and omens. When it does, look again\n before acting.\n\nIn `turns` pace (the default), the world is still while you think and runs only during `wait`.\n`pace` switches to `live` if the person wants the clock to run freely.\n\n## How the valley works\n\n- **Time.** A day is 450 game seconds. A season is 4 days and a year is 16 days. Dusk comes at\n 84% of the day and night at 90%. Spring: till and sow. Summer: grow. Autumn: harvest, then\n Reaping Night. Winter: nothing grows, homes burn firewood, and the cold kills.\n- **Food.** `status` gives food in days at the rate the village eats. Fields need a farmhouse\n within 16 tiles (labourers work them before there is one) and are sown in season: grain in\n spring and summer. Berries and meat rot fast; a granary slows it, and smoked meat keeps.\n Foragers and hunters bridge the gap until the first harvest.\n- **Firewood.** The chopping block turns wood into firewood. Homes burn it only in cold seasons,\n so stock up before winter (`set_target firewood`).\n- **Beds.** Anyone without a bed sleeps rough: cold, miserable, and prey for the night hunters\n from the third night on. Strangers walk in at dawn, more when beds and food wait for them, and\n some carry the plague.\n- **The dead.** Bodies must go in a **graveyard** (12 graves; it needs stone) or on a **pyre**\n (faster, burns firewood, and the faiths remember it). Unburied bodies are the worst miasma, and\n miasma breeds plague. Plague is the biggest killer after raids. Answer it with a lazar house,\n herbs, a healer and wells (washing sheds taint).\n- **Nights.** After 2 grace nights, a horde comes every night, warned at dusk and stronger each\n day. From day 4 a smaller band also walks in by daylight. Light (torch posts, braziers) keeps the\n worst off the paths. Palisades and gates keep walkers out (carrion fly over), and watchtowers\n shoot. The **bell** (`command {"type":"bell","on":true}`) sends everyone home and musters the\n militia at the watch house. Ring it when a horde is at the door, and stand down after.\n- **The Tithe Stone.** Each autumn the Stone names its due in grain, meat and effigies (effigies\n come from a wickerwright, taught by *The Straw Man*). It is judged on Reaping Night, the last\n night of autumn. Paid in full, the year is blessed. Short, Dread rises: Hollows climb out of\n the fields, and the Reaping horde comes 2.5x as strong. Send items with\n `command {"type":"titheSend","item":"meat","on":true}`.\n- **Lore.** Most buildings are forgotten at first. Build a **telling house**, give it a scholar,\n and `study` a rite. `catalog` lists what can be studied now and what each teaches. Most later\n rites are lost until their book turns up in gathering, hunting, farming, burials or kills.\n- **Faith.** The villagers follow the Stone, the Bell or the Green. Each faith wants a place to\n pray, and favour moves its tier, which helps or hurts the whole village. Omens ask a question\n with numbered choices. Answer them (`answer_omen`) before their dawn or they take the default.\n- **Dark land.** Nothing can be built where nobody has walked (blank on the map). Workers carry\n the known land outward, and a watchtower sees far.\n\n## An opening that holds\n\nThis order is distilled from the headless autopilot (`scripts/sim/autopilot.ts`, `Autopilot.daily`).\nEven its colonies fall between day 7 and day 28 when nobody tends them. The usual killers are\nraids by night and by day, then plague bred by bodies left unburied because no stone meant no\ngraveyard. Watch those three.\n\n- **Day 1:** `study` a first rite. The order the autopilot uses is *deerPath*, *strawMan*, *furrow*,\n *commonPot*, *hueCry*, *midden*, *hewing*, *leavings*, *greenMan*, *lamb*, *bankedFire*,\n *tallow*, then plague care (*rue*, *comfrey*). Then:\n - hovels until beds \u2265 souls + 2;\n - a woodcutter\'s hut by the trees;\n - a forager\'s hut;\n - a telling house;\n - a stockpile zone of about 5x4 near the hearth.\n- **Days 1-2:** a chopping block, a farmhouse in spring or summer, and a first field of grain of\n about 6x5 beside it. Add a granary and a woodshed.\n- **Day 3, before the raids grow:**\n - a **quarry by the nearest rock** (`find_spot quarry` searches from it);\n - a **graveyard** at least 6 tiles out;\n - a well;\n - a hunter (meat for the tithe);\n - a chandler (candles).\n- **Days 4-6:**\n - a pyre and a midden downwind;\n - two braziers;\n - a place for each faith (green chapel, offering stone, chapel);\n - a herb garden, a healer, a cookhouse;\n - a watch house;\n - torch posts out at the edge;\n - a palisade ring about 16 tiles out with a gate on the road side (`build_line`, a stretch at\n a time as wood allows).\n- **After that:**\n - bakehouse, watchtowers, wickerwright (effigies), alehouse;\n - a lazar house the moment anyone sickens;\n - more woodcutters and foragers as the village grows: one woodcutter per 10 adults, one\n forager per 15;\n - improvements on homes first (`upgrade`).\n\nKeep spare hands: a trade wants its workers plus about two labourers left over to haul and\nbuild. Don\'t stake out more than stock can pay. Unpaid sites still tie up builders.\n\n## Tool notes\n\n- Coordinates are tiles: x across, y down. A building\'s x, y is its **top-left**, and its door\n is under the middle of its bottom row.\n- "Clear the ground first." means `clear` the rectangle and let labourers take it down by day.\n "Nobody has walked that land yet." means dark land.\n- Improvements are raised with `upgrade` on the finished base, never placed fresh.\n- `inspect` a workshop to see its recipes; `set_recipe` switches one, and `set_target` decides\n when makers stop.\n- `command` sends anything else in the game\'s command set (bell, titheSend, offer, setService,\n invoke, setLabourers, setCrop, flag, unzone...).\n- `screenshot` shows what the camera sees; `look_at` points it first.\n\n## Playing for the person watching\n\n- Always give a `why`. It is the only voice you have on their screen.\n- Act in small batches and then let time run. Thirty deeds at once is noise.\n- Never demolish the starting buildings (the hearth, the Tithe Stone), and never offer a\n villager to the Stone unless the person agrees. It is a life.\n- If they say "follow off" or "go live", use `pace`. If they take over, stop acting.\n';
46402
46402
  try {
46403
46403
  return readFileSync(GUIDE_FILE, "utf8").replace(/^---[\s\S]*?\n---\s*/, "");
46404
46404
  } catch {
@@ -46415,7 +46415,7 @@ var link = new GameLink(PORT);
46415
46415
  function notLinked() {
46416
46416
  if (link.failed) return link.failed;
46417
46417
  const q = PORT === 5341 ? "1" : String(PORT);
46418
- return `No game tab is linked. Ask the person to open the game with the Reeve: the Reeve poster on the title screen, Open with the Reeve, or https://reaping.zodeus.com/?ai=${q} (http://127.0.0.1:5327/?ai=${q} on a dev server). Keep that tab in front, then call status.`;
46418
+ return `No game tab is linked. Ask the person to open the game with the Reeve: the Reeve poster on the title screen, Open with the Reeve, or https://reaping.zodeus.com/?ai=${q} (http://127.0.0.1:5327/?ai=${q} on a dev server). In the desktop app the same poster works, or start it with --ai${PORT === 5341 ? "" : `=${PORT}`}. Keep that tab in front, then call status.`;
46419
46419
  }
46420
46420
  var server = new McpServer({ name: "the-last-reaping", version: VERSION }, { instructions: INSTRUCTIONS });
46421
46421
  for (const t of TOOLS) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zodeus/reaping-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Let an AI play The Last Reaping: an MCP server that links your AI client to the game in your browser, as the Reeve.",
5
5
  "type": "module",
6
6
  "bin": {