{"at":"2026-11-23T03:18:52.048Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T03:18:52.463Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"message":"Method not found"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T03:18:52.564Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T03:18:52.986Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"prompts":{"listChanged":true},"tools":{"listChanged":true}},"instructions":"Tools for building 2D web games with debuff. Start with inspect_project; if a tool fails on setup (packages, config, browser), call doctor. To see the game, call game_start, then game_state / game_capture. If the human has the game open under `debuff dev`, game_start attaches to it (mode live): they see your actions in their overlay, and their flagged moments are in game_notes, so read those first. Otherwise you get a private paused copy (mode headless) where time only advances through game_step. Use game_pause before inspecting a live game, and game_profile to explain stutter (game_frames for raw numbers). Prompts (playtest, fix-errors, tune-feel, add-mechanic, explain-stutter) give step-by-step workflows. Prefer tuning params (game_params, game_set_param) over code changes, and verify changes with run_tests (fast logic tests in tests/, no browser) and run_scenarios (screenshots). Creative direction belongs to the human: propose alternatives rather than deciding art or feel. When a debuff tool costs you time (slow, flaky, a missing API, docs that misled you), report it with report_papercut once you are unstuck, without waiting to be asked: add a hit when it returns a match. Send only the symptom, minutes and workaround, never code or project details. When the game needs pixel art drawn and the human has not named a tool, draw it with the tenten MCP server (tt_new, tt_draw, tt_save to assets/<name>.tt) rather than writing image bytes by hand. Likewise make music and sound effects with plonk (the plonkjs package: songs and in-key effects as data) unless the human names another tool.","protocolVersion":"2025-11-25","serverInfo":{"name":"debuff","version":"0.35.0"}}}}
{"at":"2026-11-23T03:18:52.986Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T03:18:52.986Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T03:18:52.992Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"annotations":{"readOnlyHint":true},"description":"Summary of the project: dependencies, plugins and their contributions, assets, last build size.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"root":{"description":"Project root. Absolute path, or relative to the server's root. Default: the server's root.","type":"string"}},"type":"object"},"name":"inspect_project","title":"Inspect project"},{"annotations":{"readOnlyHint":true},"description":"Check the project's setup in one pass: Node, debuff package versions, node_modules, debuff.config.ts, assets, saves.json, agent files and the browser. Every check has an id, ok, a message and a fix; ok is false only when a required check failed. Call it when another tool fails on setup. live: true also starts the dev server and waits for the game's dev hooks (about 5 to 15 s).","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"live":{"description":"Also boot the game and check its dev hooks. Default false.","type":"boolean"},"root":{"description":"Project root. Absolute path, or relative to the server's root. Default: the server's root.","type":"string"}},"type":"object"},"name":"doctor","title":"Check setup"},{"annotations":{"readOnlyHint":true},"description":"Run the asset pipeline: every asset id, type, size and importer, plus generated files, warnings and possibly unused ids.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"root":{"description":"Project root. Absolute path, or relative to the server's root. Default: the server's root.","type":"string"}},"type":"object"},"name":"list_assets","title":"List assets"},{"annotations":{"readOnlyHint":true},"description":"Type-check the project with its own tsc (no emit, no browser needed). Returns diagnostics: file (relative to the root), line, column, TypeScript code and message. Run it after editing code; vite doesn't type-check, so the game can run with type errors.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"root":{"description":"Project root. Absolute path, or relative to the server's root. Default: the server's root.","type":"string"}},"type":"object"},"name":"typecheck","title":"Type-check"},{"annotations":{"destructiveHint":false,"readOnlyHint":false},"description":"Build for production and return the size report (raw, gzip, brotli per file). `leaks` lists dev-only code found in the output; it must be empty. `saves` compares the game's saves with saves.json: an error means players would lose saved progress. Don't accept save changes yourself; tell the human (they run `debuff build --accept-saves`).","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"root":{"description":"Project root. Absolute path, or relative to the server's root. Default: the server's root.","type":"string"}},"type":"object"},"name":"build","title":"Production build"},{"annotations":{"destructiveHint":false,"readOnlyHint":false},"description":"Run the logic tests in tests/**/*.test.ts (keiko): the real game in Node, no browser, in milliseconds. Each failure has its message, the source line, and the game's tick, scene and state when it failed. After each edit pass `changed: true`: only the tests whose code or files changed since they last passed run, and `due` says why each one did. Run everything once when the work is done. One test per mechanic: search tests/ first; fixes, tweaks and fuzz replays go into the existing test.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"changed":{"description":"Only run tests whose code or files changed since they last passed, plus new and failed ones.","type":"boolean"},"files":{"description":"Test files relative to the root. Default: all.","items":{"type":"string"},"type":"array"},"filter":{"description":"Only run tests whose name contains this text.","type":"string"},"root":{"description":"Project root. Absolute path, or relative to the server's root. Default: the server's root.","type":"string"}},"type":"object"},"name":"run_tests","title":"Run logic tests"},{"annotations":{"destructiveHint":false,"readOnlyHint":false},"description":"Run scenarios/*.json (or the given files) in a headless browser. Returns per-step results, runtime errors, captures and final state. Pass `files` while iterating; a full run starts a browser, so run it once when the work is done.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"files":{"description":"Scenario files relative to the root. Default: all.","items":{"type":"string"},"type":"array"},"root":{"description":"Project root. Absolute path, or relative to the server's root. Default: the server's root.","type":"string"},"update":{"description":"Accept new captures as baselines. Only when the human has approved the visual change.","type":"boolean"}},"type":"object"},"name":"run_scenarios","title":"Run scenarios"},{"annotations":{"destructiveHint":false,"readOnlyHint":false},"description":"Play the game headlessly with random but plausible input (movement keys held, action keys tapped) to find runtime errors, stuck states and back-and-forth loops. Each finding includes the explained error (kind, source-mapped file:line, hint) and `repro`: a scenario file that replays it exactly. Pass that file to run_scenarios to reproduce, then again after fixing to verify. The same seed gives the same inputs.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"keys":{"description":"KeyboardEvent.code values to press. Default: arrows, WASD, Space, Enter, Z, X.","items":{"type":"string"},"type":"array"},"root":{"description":"Project root. Absolute path, or relative to the server's root. Default: the server's root.","type":"string"},"runs":{"description":"Independent runs. Default 3.","maximum":20,"minimum":1,"type":"integer"},"seconds":{"description":"Simulated seconds of play per run. Default 60.","maximum":600,"minimum":1,"type":"number"},"seed":{"description":"Input seed; reuse it to repeat a run exactly.","maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"}},"type":"object"},"name":"fuzz","title":"Fuzz playtest"},{"annotations":{"destructiveHint":false,"readOnlyHint":false},"description":"Connect to the game. auto (default): attach to the human's live game if `debuff dev` has it open in a browser, else start a private headless copy, paused. Returns the mode, state and how many notes the human has flagged. Replaces any running session. A headless copy holds a browser (about ten Chromium processes) until game_stop, so call that when you are done; it also closes after 15 idle minutes.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"mode":{"description":"Default auto.","enum":["auto","live","headless"],"type":"string"},"page":{"description":"Path to open in headless mode. Default \"/\".","type":"string"},"reducedMotion":{"description":"Force game.reducedMotion on or off for this session. Default: leave it; the state's reducedMotion says what it is. When true, games may freeze animations.","type":"boolean"},"root":{"description":"Project root. Absolute path, or relative to the server's root. Default: the server's root.","type":"string"},"viewport":{"additionalItems":false,"description":"Headless only: browser viewport [width, height] in CSS pixels. Default [960, 540]. Try [390, 844] to test a scale: \"expand\" game in phone portrait.","items":[{"maximum":4096,"minimum":64,"type":"integer"},{"maximum":4096,"minimum":64,"type":"integer"}],"maxItems":2,"minItems":2,"type":"array"}},"type":"object"},"name":"game_start","title":"Start game"},{"annotations":{"readOnlyHint":true},"description":"Current scene, tick, time, logical width and height, renderer, frame stats, the scene's inspect() data and plugin inspect data. reducedMotion true means the game may freeze or tone down its animations (reducedMotionForced: game_start forced it).","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"game_state","title":"Game state"},{"annotations":{"destructiveHint":false,"readOnlyHint":false},"description":"Advance the simulation by fixed steps (60 per second by default) and return the new state.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"quiet":{"description":"Leave out the scene's inspect() state and plugin data, to keep the result short.","type":"boolean"},"steps":{"description":"Fixed simulation steps to run.","maximum":36000,"minimum":1,"type":"integer"}},"required":["steps"],"type":"object"},"name":"game_step","title":"Advance time"},{"annotations":{"destructiveHint":false,"readOnlyHint":false},"description":"Run a command the game registered with devTools({ commands }) (warp to a level, grant an item, select a cell), like a scenario's { command, args } step; recorded in replays. Prefer it over computing screen coordinates for game_input. An unknown name lists the registered ones. Returns the command's result and the new state.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"args":{"description":"JSON arguments, passed in order.","items":{},"type":"array"},"name":{"description":"Command name.","type":"string"}},"required":["name"],"type":"object"},"name":"game_command","title":"Run a game command"},{"annotations":{"destructiveHint":false,"readOnlyHint":false},"description":"Keyboard, pointer, wheel or touch input. press/release take a KeyboardEvent.code (e.g. Space, ArrowLeft, KeyZ), or PointerRight / PointerMiddle for mouse buttons. tap/pointer_down/pointer_move take logical x, y; tap and pointer_down also take kind (mouse, touch or pen). wheel takes dy (and dx) in CSS pixels. touch_down/touch_move take id, x, y (touch_down also kind: touch or pen); touch_up takes id. Input takes effect on the next game_step.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"action":{"enum":["press","release","tap","pointer_down","pointer_move","pointer_up","wheel","touch_down","touch_move","touch_up"],"type":"string"},"code":{"description":"For press/release.","type":"string"},"dx":{"description":"For wheel: horizontal scroll.","type":"number"},"dy":{"description":"For wheel: vertical scroll, positive = down.","type":"number"},"id":{"description":"Touch contact id for touch_down/touch_move/touch_up.","maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"kind":{"description":"Pointer kind for tap, pointer_down and touch_down.","enum":["mouse","touch","pen"],"type":"string"},"x":{"type":"number"},"y":{"type":"number"}},"required":["action"],"type":"object"},"name":"game_input","title":"Send input"},{"annotations":{"readOnlyHint":true},"description":"Every tunable param group: schema (type, default, min, max, units, description) and current values.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"game_params","title":"List params"},{"annotations":{"destructiveHint":false,"readOnlyHint":false},"description":"Set a tunable param live. Values are validated against the param's type and range. Changes last until game_start or a reload.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"group":{"type":"string"},"key":{"type":"string"},"value":{"type":["number","boolean"]}},"required":["group","key","value"],"type":"object"},"name":"game_set_param","title":"Set param"},{"annotations":{"destructiveHint":false,"readOnlyHint":false},"description":"Screenshot of the current frame as a PNG image. With `path`, also saves it to that file in the project. social: true letterboxes it into 1200×675 (16:9), the size X and Bluesky show for post images and link cards; save those under .debuff/captures/ and `debuff ship press` adds them to the press kit.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"background":{"description":"Letterbox colour with social, as CSS (default #000000).","type":"string"},"path":{"description":"Save the PNG here, relative to the project root (e.g. public/thumbnail.png). Overwrites.","type":"string"},"social":{"description":"Letterbox into 1200×675, scaled by whole pixels so pixel art stays crisp.","type":"boolean"}},"type":"object"},"name":"game_capture","title":"Capture frame"},{"annotations":{"destructiveHint":false,"readOnlyHint":false},"description":"Video clips of the live game for devlogs, store pages and press kits. action start keeps a rolling recording of the last 15 s; save writes what it has (between about 7 and 15 s) to .debuff/captures/<name>.mp4 (WebM in browsers that can't record MP4) and keeps recording; stop ends it. Play or drive the game with game_input between start and save. Live mode only: clips record real time. The human posts; never post anywhere yourself.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"action":{"enum":["start","save","stop","status"],"type":"string"},"name":{"description":"File name for save, without extension (letters, digits, - and _). Default clip-<timestamp>.","pattern":"^[\\w-]{1,80}$","type":"string"}},"required":["action"],"type":"object"},"name":"game_clip","title":"Record a clip"},{"annotations":{"destructiveHint":false,"readOnlyHint":false},"description":"Pause or resume a live game (headless games are always paused). game_step also pauses first.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"paused":{"type":"boolean"}},"required":["paused"],"type":"object"},"name":"game_pause","title":"Pause or resume"},{"annotations":{"readOnlyHint":true},"description":"Recent frames, oldest first: intervalMs (what the player feels), updateMs, renderMs, steps (>1 means catching up), quads, drawCalls and longTaskMs (browser-reported main-thread stalls). Use it to explain stutter; in headless mode times reflect stepping, not real play. summary: true returns percentiles and the 3 slowest frames instead of every frame.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"count":{"description":"Default 60.","maximum":240,"minimum":1,"type":"integer"},"summary":{"description":"Count, p50/p95/max of updateMs, renderMs, quads and drawCalls, and the 3 slowest frames.","type":"boolean"}},"type":"object"},"name":"game_frames","title":"Frame breakdown"},{"annotations":{"readOnlyHint":true},"description":"Why the game stutters, from myaku: frame-time percentiles (p50/p95/p99), hitches per minute, and the worst hitches explained. Each has a cause (script, gc, upload, compile, layout, throttled, hidden, unknown), a confidence, the script and function to look at when known, and a hint. Spans show time in debuff's update and render. Prefer this over game_frames to explain stutter; measure in live mode, since headless stepping doesn't reflect real play.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"game_profile","title":"Frame profile"},{"annotations":{"readOnlyHint":true},"description":"Moments the human flagged in the overlay (live mode): their words, the tick, the scene's inspect() state then, and the frames leading up to it.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"game_notes","title":"Human notes"},{"annotations":{"destructiveHint":false,"readOnlyHint":false},"description":"Everything played since the game loaded (keys, pointer, param changes) up to `toTick` (default: now), saved as a scenario in .debuff/replays/ that replays it exactly. Use a note's `tick` to reproduce what the human saw when they flagged it, then run_scenarios with the returned file. `warnings` lists anything a replay can't reproduce (for example slow motion). The file holds a checkpoint of the game's state every second, so if the replay stops matching, run_scenarios warns with the tick and the parts of the state that differ.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"toTick":{"description":"Last tick to include. Default: the current tick.","maximum":9007199254740991,"minimum":0,"type":"integer"}},"type":"object"},"name":"game_replay","title":"Save a replay"},{"annotations":{"destructiveHint":false,"readOnlyHint":false},"description":"Live mode only. Take the human's game back (or forward, within the known session) to `tick`: the page reloads, replays the session's inputs to that tick and stays paused, so the state is exactly what it was then. Use a note's `tick` to look at the moment the human flagged. The page needs a second to reload; then use game_state or game_capture.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"tick":{"description":"Tick to go to, e.g. a note's tick.","maximum":9007199254740991,"minimum":0,"type":"integer"}},"required":["tick"],"type":"object"},"name":"game_rewind","title":"Rewind the live game"},{"annotations":{"readOnlyHint":true},"description":"Runtime errors since the game started, explained: kind (your-code, debuff-usage, debuff-bug, outside), where (source file:line, source-mapped), a hint, the loop phase and tick, and a repeat count. A loop error stops the game; fix it, then game_pause false to resume. For debuff-bug, tell the human and share reportUrl rather than working around it. Type errors aren't runtime errors: use typecheck.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"game_errors","title":"Runtime errors"},{"annotations":{"destructiveHint":false,"readOnlyHint":false},"description":"Headless: close the browser and dev server. Live: resume the human's game and disconnect.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"game_stop","title":"Stop game"},{"annotations":{"destructiveHint":false,"openWorldHint":true,"readOnlyHint":false},"description":"Report tooling friction in debuff, keiko, myaku, spryte or debuff.jp to the public board at papercuts.debuff.jp: a slow or flaky tool, a missing API, confusing docs. Call it on your own, without being asked, whenever a debuff tool cost you time, once you are unstuck; then tell the human in one line. It checks for duplicates first: when it returns action \"similar\", call again with hit set to the matching id (that adds your minutes to it) or with force: true if none is the same problem. Write the title as the symptom. Never include secrets, file contents or personal data: open entries are public.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{"area":{"description":"Package, command or page: \"cli test\", \"docs/assets\".","type":"string"},"body":{"description":"What happened. With hit, a short note for the hit.","type":"string"},"force":{"description":"File it even when similar papercuts exist.","type":"boolean"},"hit":{"description":"Add a hit to this papercut id instead of filing a new one.","maximum":9007199254740991,"minimum":-9007199254740991,"type":"integer"},"kind":{"enum":["slow","flaky","missing-api","docs","confusing","broken","other"],"type":"string"},"minutes":{"description":"Minutes it cost you this time.","type":"number"},"repo":{"description":"Default debuff.","enum":["debuff","keiko","myaku","spryte","site","other"],"type":"string"},"title":{"description":"The symptom, at least 8 characters: \"vitest times out on tsc tests under load\".","type":"string"},"workaround":{"description":"What got you unstuck. With hit, it fills the papercut's workaround when it has none.","type":"string"}},"required":["title"],"type":"object"},"name":"report_papercut","title":"Report papercut"}]}}}
