localharness 0.78.0

Agents that own themselves: one Rust crate that's both an agent SDK (streaming, tools, hooks, policies, triggers, MCP) and a wallet-owning, self-sovereign agent that runs in the browser.
Documentation
1
2
3
4
5
6
7
8
9
10
11
{
  "id": "140",
  "prompt": "Finish with a boss fight: a wide boss strafes the top of the screen on a folded-triangle sweep, my ship follows pointer_x and auto-fires every 15 frames (a single bullet slot). Chip the 20-point HP bar down while dodging the bombs it drops every 40 frames - they fall faster as it weakens and cost me one of 3 lives. BOSS DOWN on victory, SHIP DESTROYED on defeat, tap restarts either way.",
  "solution_rl": "fn frame(t: i32) {\n    let w: i32 = host::display::width();\n    let h: i32 = host::display::height();\n    if host::display::state_get(0) == 0 {\n        host::display::state_set(0, 1);\n        host::display::state_set(1, 20);\n        host::display::state_set(2, 3);\n        host::display::state_set(3, 0);\n        host::display::state_set(5, 0);\n        host::display::state_set(7, 0);\n        host::display::state_set(9, 0);\n        host::display::state_set(10, 0);\n    }\n    let down: i32 = host::display::pointer_down();\n    let tap: bool = down == 1 && host::display::state_get(8) == 0;\n    host::display::state_set(8, down);\n    let hp: i32 = host::display::state_get(1);\n    let lives: i32 = host::display::state_get(2);\n    let phase: i32 = host::display::state_get(7);\n    if phase != 0 {\n        if phase == 1 {\n            host::display::clear(0x041808);\n            host::display::draw_string(120, 190, \"BOSS DOWN\", 0x00ff88, 4);\n        } else {\n            host::display::clear(0x180408);\n            host::display::draw_string(110, 190, \"SHIP DESTROYED\", 0xff4040, 3);\n        }\n        host::display::draw_string(130, 270, \"TAP FOR ROUND 2\", 0x808080, 2);\n        if tap { host::display::state_set(0, 0); }\n    } else {\n        let span: i32 = w - 120;\n        let mut m: i32 = (t * 3) % (2 * span);\n        if m > span { m = 2 * span - m; }\n        let bossx: i32 = m;\n        let mut px: i32 = host::display::pointer_x() - 20;\n        if px < 0 { px = 0; }\n        if px > w - 40 { px = w - 40; }\n        let mut ft: i32 = host::display::state_get(9) + 1;\n        let mut blx: i32 = host::display::state_get(4);\n        let mut bly: i32 = host::display::state_get(3);\n        if ft >= 15 && bly == 0 {\n            ft = 0;\n            blx = px + 18;\n            bly = h - 46;\n        }\n        host::display::state_set(9, ft);\n        if bly > 0 {\n            bly = bly - 9;\n            if bly <= 70 && blx >= bossx && blx < bossx + 120 {\n                host::display::state_set(1, hp - 1);\n                if hp - 1 <= 0 { host::display::state_set(7, 1); }\n                bly = 0;\n            }\n            if bly < 4 { bly = 0; }\n        }\n        host::display::state_set(3, bly);\n        host::display::state_set(4, blx);\n        let mut bt: i32 = host::display::state_get(10) + 1;\n        let mut bmx: i32 = host::display::state_get(6);\n        let mut bmy: i32 = host::display::state_get(5);\n        if bt >= 40 && bmy == 0 {\n            bt = 0;\n            bmx = bossx + 56;\n            bmy = 74;\n        }\n        host::display::state_set(10, bt);\n        if bmy > 0 {\n            bmy = bmy + 5 + (20 - hp) / 5;\n            if bmy > h - 44 && bmy < h - 20 && bmx + 8 > px && bmx < px + 40 {\n                host::display::state_set(2, lives - 1);\n                if lives - 1 <= 0 { host::display::state_set(7, 2); }\n                bmy = 0;\n            }\n            if bmy > h { bmy = 0; }\n        }\n        host::display::state_set(5, bmy);\n        host::display::state_set(6, bmx);\n        host::display::clear(0x060610);\n        host::display::fill_rect(bossx, 30, 120, 40, 0x8833aa);\n        host::display::fill_rect(bossx + 44, 42, 32, 16, 0xffee66);\n        host::display::fill_rect(bossx + 52, 46, 16, 8, 0x201030);\n        host::display::fill_rect(0, 8, hp * w / 20, 6, 0xff3366);\n        if bly > 0 {\n            host::display::fill_rect(blx - 2, bly, 4, 12, 0x00ffcc);\n        }\n        if bmy > 0 {\n            host::display::fill_rect(bmx, bmy, 8, 8, 0xffaa00);\n        }\n        host::display::fill_rect(px, h - 32, 40, 12, 0x00ddff);\n        host::display::fill_triangle(px + 12, h - 32, px + 28, h - 32, px + 20, h - 44, 0x00ddff);\n        let mut lf: i32 = 0;\n        while lf < lives {\n            host::display::fill_rect(8 + lf * 18, h - 16, 12, 8, 0x00ddff);\n            lf = lf + 1;\n        }\n    }\n    host::display::present();\n}\n",
  "tags": [
    "game",
    "state",
    "pointer",
    "animation"
  ]
}