code wiki / (root) / nx_mgmt_call.nx

nx_mgmt_call.nx

buildroot/runtime/nx_mgmt_call.nx

5653 B94 linesdepth 11pulls 21 transitivereach 0 importersview sourcekind tooltopic mgmt
docsdependenciesstructsconstsfunctions

about

nx_mgmt_call.nx -- the mgmt-API driver forked as an MCP tool. Mints a FRESH admin session from the NAS key bundle (no staleness, no stored secret) and issues one authenticated call to the loopback mgmt API (:18098), printing the response body. This is what makes the SOTA control plane (deploy/reconcile/restart/services/health) reachable over MCP without the shell. Runs as the (root) tools daemon's child, which can read the elderwesto-owned key bundle. CLI: nx_mgmt_call <METHOD> <path> [json_body] e.g. nx_mgmt_call GET /api/services nx_mgmt_call POST /api/deploy '{"target":"tools_api"}'

dependencies 2 imports · 0 importers

nx_session_mint_lib.nx nx_tool_http_backend.nx nx_mgmt_call.nx

imports: nx_session_mint_lib.nxnx_tool_http_backend.nx

imported by: nobody (leaf or entry point)

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

main msm_slen sys_now_realtime_sec sys_mmap sys_clock_gettime_real msm_mint_b64 msm_mint_raw msm_load_edpriv sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close msm_hexval nx_ncs_derive_user_id_hash sys_mmap ↻ nx_ncs_derive_realm_id_has nx_ncs_mint_token _ncs_put_i64_be nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd ↻ sys_read ↻ sys_close ↻ ed25519_sign_full sys_mmap ↻ ed25519_sha512 sys_mmap ↻ sha512_init sha512_update sha512_final ge_p3_alloc sys_mmap ↻ fe_alloc fe_zero ed25519_basepoint_p3 sys_mmap ↻ ge_p3_decompress

structs

none

consts

9const MC_MAGIC_86400: i64 = 86400
10const MC_MAGIC_131072: i64 = 131072
11const MC_MAGIC_1048576: i64 = 1048576
13const MC_KEYS: *u8 = "opaque_keys.bin" as *u8 // relative to the daemon cwd (nishihost)
14const MC_REALM: *u8 = "nishi_site_admin" as *u8
15const MC_HANDLE: *u8 = "elderwesto" as *u8
16const MC_PORT: i64 = 18098

functions

18func mc_puts(buf: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { buf[off] = s[i]; off = off + 1; i = i + 1 } return off }
called by 1: main
19func mc_putn(buf: *u8, off: i64, s: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { buf[off] = s[i]; off = off + 1; i = i + 1 } return off }
called by 1: main
20func mc_puti(buf: *u8, off: i64, v: i64) -> i64
called by 1: main
29func main(argc: i64, argv: *i64) -> i64