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": "252",
  "prompt": "Two ants shuttle between a nest in the bottom-left and food in the top-right, and I want to SEE their pheromone trail: each ant walks 2px per frame toward its current goal plus LCG jitter of -1..1 on each axis, flipping goals when it arrives (a completed food run bumps a TRIPS counter). Every few frames an ant stamps its position into a 24-entry ring buffer of trail points held in state slots 16..63, drawn as dim mustard dots that the ants keep refreshing. Ant state is 3 slots each: x, y, and which way it is headed.",
  "solution_rl": "fn sgn(v: i32) -> i32 {\n    if v > 0 { return 1; }\n    if v < 0 { return -1; }\n    0\n}\n\nfn iabs(v: i32) -> i32 {\n    if v < 0 { -v } else { v }\n}\n\nfn frame(t: i32) {\n    let w: i32 = host::display::width();\n    let h: i32 = host::display::height();\n    let nx: i32 = 60;\n    let ny: i32 = h - 60;\n    let fx: i32 = w - 60;\n    let fy: i32 = 70;\n    if host::display::state_get(0) == 0 {\n        host::display::state_set(0, 1);\n        host::display::state_set(2, 55);\n        let mut a: i32 = 0;\n        while a < 2 {\n            host::display::state_set(8 + a * 3, nx);\n            host::display::state_set(9 + a * 3, ny);\n            host::display::state_set(10 + a * 3, 0);\n            a = a + 1;\n        }\n        let mut p: i32 = 0;\n        while p < 24 {\n            host::display::state_set(16 + p * 2, nx);\n            host::display::state_set(17 + p * 2, ny);\n            p = p + 1;\n        }\n    }\n    let mut seed: i32 = host::display::state_get(2);\n    let mut trips: i32 = host::display::state_get(3);\n    let mut a: i32 = 0;\n    while a < 2 {\n        let b: i32 = 8 + a * 3;\n        let mut x: i32 = host::display::state_get(b);\n        let mut y: i32 = host::display::state_get(b + 1);\n        let mut mode: i32 = host::display::state_get(b + 2);\n        let tx: i32 = if mode == 0 { fx } else { nx };\n        let ty: i32 = if mode == 0 { fy } else { ny };\n        seed = seed * 1103515245 + 12345;\n        let jx: i32 = ((seed >> 16) & 4095) % 3 - 1;\n        let jy: i32 = ((seed >> 8) & 4095) % 3 - 1;\n        x = x + sgn(tx - x) * 2 + jx;\n        y = y + sgn(ty - y) * 2 + jy;\n        if iabs(tx - x) <= 8 && iabs(ty - y) <= 8 {\n            if mode == 0 { trips = trips + 1; }\n            mode = 1 - mode;\n        }\n        host::display::state_set(b, x);\n        host::display::state_set(b + 1, y);\n        host::display::state_set(b + 2, mode);\n        if t % 4 == a * 2 {\n            let head: i32 = host::display::state_get(4);\n            host::display::state_set(16 + head * 2, x);\n            host::display::state_set(17 + head * 2, y);\n            host::display::state_set(4, (head + 1) % 24);\n        }\n        a = a + 1;\n    }\n    host::display::state_set(2, seed);\n    host::display::state_set(3, trips);\n    host::display::clear(0x100e0a);\n    let mut p: i32 = 0;\n    while p < 24 {\n        let px: i32 = host::display::state_get(16 + p * 2);\n        let py: i32 = host::display::state_get(17 + p * 2);\n        host::display::fill_rect(px - 2, py - 2, 4, 4, 0x706428);\n        p = p + 1;\n    }\n    host::display::fill_rect(nx - 12, ny - 12, 24, 24, 0x805030);\n    host::display::fill_rect(fx - 10, fy - 10, 20, 20, 0x30a040);\n    a = 0;\n    while a < 2 {\n        let x: i32 = host::display::state_get(8 + a * 3);\n        let y: i32 = host::display::state_get(9 + a * 3);\n        host::display::fill_rect(x - 4, y - 4, 8, 8, 0xe0e0e0);\n        a = a + 1;\n    }\n    host::display::draw_string(8, 8, \"TRIPS\", 0x808080, 1);\n    host::display::draw_number(60, 8, trips, 0xffffff, 1);\n    host::display::present();\n}\n",
  "tags": [
    "simulation",
    "ants",
    "state",
    "prng"
  ]
}