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
{
  "id": "156",
  "prompt": "Write a GEOMETRY library cartridge others mount with host::compose::spawn_lib and invoke by export name: dist2(dx, dy) squared length, manhattan(dx, dy), in_circle(dx, dy, r) returning 0/1, and wrap(v, max) - a modulo that stays positive for negative v. compose::call forwards at most 4 ints, so keep every export within 4 params. Add dims() and a frame() landing card listing the exports (a headless mount never ticks frame; it is just the subdomain landing page) and prove dist2 by printing dist2(3, 4).",
  "solution_rl": "fn dist2(dx: i32, dy: i32) -> i32 {\n    dx * dx + dy * dy\n}\n\nfn manhattan(dx: i32, dy: i32) -> i32 {\n    let mut a: i32 = dx;\n    if a < 0 { a = 0 - a; }\n    let mut b: i32 = dy;\n    if b < 0 { b = 0 - b; }\n    a + b\n}\n\nfn in_circle(dx: i32, dy: i32, r: i32) -> i32 {\n    if dist2(dx, dy) <= r * r { 1 } else { 0 }\n}\n\nfn wrap(v: i32, max: i32) -> i32 {\n    let m: i32 = v % max;\n    if m < 0 { m + max } else { m }\n}\n\nfn dims() -> i32 {\n    (256 << 16) | 112\n}\n\nfn frame(t: i32) {\n    host::display::clear(0x000000);\n    host::display::draw_string(8, 8, \"LIB GEOM\", 0xffffff, 2);\n    host::display::draw_string(8, 34, \"DIST2 MANHATTAN\", 0x00ff66, 1);\n    host::display::draw_string(8, 48, \"IN_CIRCLE WRAP\", 0x00ff66, 1);\n    host::display::draw_string(8, 70, \"MOUNT: SPAWN_LIB\", 0x808080, 1);\n    host::display::draw_number(8, 88, dist2(3, 4), 0xffff00, 1);\n    host::display::present();\n}\n",
  "tags": [
    "library",
    "functions"
  ]
}