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 · 0 importers
imports: nx_http_server.nxnx_connect.nxnx_api_edge.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
| 10 | const TSV_MAGIC_2048: i64 = 2048 |
| 12 | const TSV_PORT_DEFAULT: i64 = 8799 |
| 13 | const TSV_REQ_CAP: i64 = 65536 |
| 14 | const TSV_RESP_CAP: i64 = 1048576 |
| 55 | const TSV_MAXKIDS: i64 = 16 |
| 56 | const TSV_WNOHANG: i64 = 1 |
functions
| 16 | func tsv_puts(s: *u8) -> i64 { sys_write(1, s, ta_slen(s)); return 0 } |
| 17 | func tsv_atoi_cstr(s: *u8) -> i64 { return tr_atoi(s, 0, ta_slen(s)) } called by 1: main |
| 21 | func tsv_seed() -> i64 |
| 59 | func tsv_serve_one(cfd: i64, req: *u8, out: *u8) -> i64 |
| 68 | func tsv_serve(port: i64) -> i64 called by 1: main calls 12: sys_ignore_sigpipetsv_seednx_http_server_addr_loopbacknx_http_server_listen_hottsv_putsta_catn+6 |
| 122 | func tsv_probe(port: i64, path: *u8) -> i64 called by 1: main calls 6: nx_http_server_addr_loopbacksys_sockettsv_putsnx_connect_boundedta_catsys_read |
| 146 | func main(argc: i64, argv: *i64) -> i64 |