nx_tools_api_serve.nx
buildroot/runtime/nx_tools_api_serve.nx
about
nx_tools_api_serve.nx -- standalone loopback HTTP server for the R0 agent-facing API (nx_tools_api).
Composes nx_http_server (bind/listen/accept, loopback-default) + nx_tools_api (ta_handle). ADDITIVE + ISOLATED:
a NEW service on a caller-chosen port that touches NOTHING existing -> never-brick by construction.
nx_tools_api_serve serve [port] -- bootstrap-register a few real tools (idempotent), then accept-loop
nx_tools_api_serve probe <port> <p> -- sovereign plain-HTTP GET client (self-test the live round-trip)
license_tier: ORIGINAL
dependencies 3 imports · 2 importers
imports: nx_http_server.nxnx_connect.nxnx_api_edge.nx
imported by: nx_tools_listener_child_gate.nxnx_tools_timing_serve_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 10 | const TSV_MAGIC_2048: i64 = 2048 |
| 12 | const TSV_PORT_DEFAULT: i64 = 8799 |
| 21 | const TSV_REQ_CAP: i64 = 65536 |
| 22 | const TSV_RESP_CAP: i64 = 1048576 |
| 23 | const TSV_RESERVE_CONF: *u8 = "knowledge/tools_req_reserve.conf" as *u8 |
| 64 | const TSV_MAXKIDS: i64 = 16 |
| 65 | const TSV_WNOHANG: i64 = 1 |
| 73 | const TSV_BACKLOG: i64 = 64 |
functions
| 25 | func tsv_puts(s: *u8) -> i64 { sys_write(1, s, ta_slen(s)); return 0 } |
| 26 | func tsv_atoi_cstr(s: *u8) -> i64 { return tr_atoi(s, 0, ta_slen(s)) } called by 1: main |
| 30 | func tsv_seed() -> i64 |
| 80 | func tsv_load_reserve() -> i64 called by 1: tsv_serve |
| 109 | func tsv_emit_413(out: *u8, limit: i64, received: i64) -> i64 called by 1: tsv_serve_one |
| 124 | func tsv_serve_one(cfd: i64, req: *u8, out: *u8, reserve: i64) -> i64 |
| 167 | func tsv_serve_child(lfd: i64, cfd: i64, req: *u8, out: *u8, reserve: i64) -> i64 |
| 174 | func tsv_serve(port: i64) -> i64 |
| 307 | func tsv_probe(port: i64, path: *u8) -> i64 |
| 331 | func main(argc: i64, argv: *i64) -> i64 |