code wiki / _hdl_build / nx_printer_ctl.nx

nx_printer_ctl.nx

buildroot/runtime/_hdl_build/nx_printer_ctl.nx

10151 B252 linesdepth 8pulls 12 transitivereach 0 importersview sourcekind tooltopic printer
docsdependenciesstructsconstsfunctions

about

nx_printer_ctl.nx -- sovereign 3D-printer / home-IoT control ORGAN (CLI + MCP tool). The operator's ask: integrate the 3D printers + home electronics into the existing website behind the opaque secure login. The pasted reference design used Node/Express + nginx + http-proxy-middleware + WAN mTLS. This organ is the SOVEREIGN realization on the nishi fabric (no third-party stack, per the ecosystem-only + api-first doctrine): the sovereign edge already does opaque cap-token auth + reverse-proxy; this organ is the cap-gated LAN control leg. Verbs (JSON on stdout = the MCP/API/agent interchange): nx_printer_ctl info <ip> <port> [apikey] -- GET /printer/info nx_printer_ctl estop <ip> <port> [apikey] -- POST /printer/emergency_stop nx_printer_ctl pause <ip> <port> [apikey] -- POST /printer/print/pause nx_printer_ctl resume <ip> <port> [apikey] -- POST /printer/print/resume nx_printer_ctl cancel <ip> <port> [apikey] -- POST /printer/print/cancel nx_printer_ctl contract -- emit the security/routing contract (no network) Composes nx_printer_ctl_lib (parse/emit/allowlist) over the shipped Moonraker primitives. NEVER-BRICK by construction: fixed safe-endpoint allowlist, no raw-gcode passthrough (see the lib header + nx_printer_ctl_gate). license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_printer_ctl_lib.nx nx_printer_ctl.nx

imports: nx_syscalls.nxnx_printer_ctl_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main pc_werr sys_write sys_exit pctl_verb_id pctl_streq sys_mmap pctl_emit_contract pctl_cat sys_write ↻ pctl_parse_prefix lscan_parse_prefix pctl_parse_port pctl_discover_scan lscan_sweep sys_mmap ↻ sys_socket lscan_fill_sockaddr nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll sys_poll ↻ sys_close pctl_emit_discover pctl_cat ↻ pctl_catn sys_mmap ↻ pctl_cat_ip pctl_catn ↻ pctl_survey_scan sys_mmap ↻ pctl_survey_port pctl_discover_scan ↻ pctl_emit_survey pctl_cat ↻ pctl_cat_ip ↻ pctl_survey_kind pctl_catn ↻

structs

none

consts

26const PC_STDERR: i64 = 2
27const PC_EXIT_USAGE: i64 = 2

functions

29func pc_werr(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(PC_STDERR, s, n); return 0 }
called by 1: main calls 1: sys_write
31func main(argc: i64, argv: *i64) -> i64