nx_writehub_seat.nx
buildroot/runtime/nx_writehub_seat.nx
about
nx_writehub_seat.nx -- WRITING HUB rung R1: the sovereign SEAT WIRE. Closes the #1 census gap (nothing in .nx
POSTed to the local generation seats). Drives the operator's LOCAL models over sovereign HTTP -- no cloud, no
curl, no shell: gen-llm:11434 /chat (prose seat, sd-server/Qwen) or gen-img:7861 /generate (image seat, Z-Image).
Composes nx_http_client's sockaddr + POST-request builder (same primitive as nx_http_post) but application/json.
File-driven so there is zero arg-quoting: read knowledge/staging/writehub_seat_req.txt (line1 = llm|img target,
the rest = the writer artifact/prompt) -> POST -> bank the seat's reply to knowledge/staging/writehub_seat_out.txt.
SEAM BY CONSTRUCTION: this organ only ever connects to 127.0.0.1, so explicit content never leaves the box.
license_tier: ORIGINAL module: nishi-core.writehub.seat capability: WRITEHUB_SEAT_WIRE
dependencies 3 imports · 0 importers
imports: nx_http_client.nxnx_connect.nxnx_gate.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 12 | const K_MAGIC_1048576: i64 = 1048576 |
| 13 | const K_MAGIC_1310720: i64 = 1310720 |
| 14 | const K_MAGIC_11434: i64 = 11434 |
| 15 | const K_MAGIC_7861: i64 = 7861 |
| 16 | const K_MAGIC_8388608: i64 = 8388608 |
functions
| 18 | func ws_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: main |
| 19 | func ws_atoi3(buf: *u8, off: i64) -> i64 { var v: i64=0; var i: i64=0; while i<3 { let d: i64=buf[off+i] as i64; if d>=48 { if d<=57 { v=v*10+(d-48) } } i=i+1 } return v } called by 1: main |
| 20 | func ws_drain(fd: i64, buf: *u8, cap: i64) -> i64 { var off: i64=0; var go: i64=1; while go==1 { if off>=cap { go=0 } else { let r: i64=sys_read(fd, ((buf as i64)+off) as *u8, cap-off); if r<=0 { go=0 } else { off=off+r } } } return off } |
| 23 | func ws_app(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){ dst[o]=s[i]; o=o+1; i=i+1 } return o } |
| 25 | func ws_appc(dst: *u8, off: i64, ch: i64) -> i64 { dst[off]=ch as u8; return off+1 } |
| 27 | func ws_appq(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; o=ws_appc(dst,o,34); o=ws_app(dst,o,s); o=ws_appc(dst,o,34); return o } |
| 29 | func ws_app_esc(dst: *u8, off: i64, src: *u8, len: i64) -> i64 |
| 44 | func ws_starts(buf: *u8, n: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ if i>=n {return 0} if buf[i]!=s[i] {return 0} i=i+1 } return 1 } called by 1: main |
| 46 | func main() -> i64 |