code wiki / _hdl_build / nx_json_lib.nx
nx_json_lib.nx
buildroot/runtime/_hdl_build/nx_json_lib.nx
about
nx_json_lib.nx -- minimal SOVEREIGN JSON field reader (no jq, no shell, no 3rd-party). Built for
the work-journal: extract "transcript_path" from a Claude-Code hook's stdin JSON and scan tool_use
blocks out of the session transcript .jsonl. NOT a full JSON parser -- it linearly finds
"key":"value" string fields and literal anchors, which is exactly what capture needs and is robust
to the harness's compact (space-free) emission. De-escapes backslash sequences and neutralizes any
TAB/NL/CR so an extracted value can never tear the TSV work-journal line.
Sovereign: imports nx_syscalls only. license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_work_predict_lib.nxnx_worklog_ingest_lib.nx
structs
| none |
consts
| none |
functions
| 10 | func jx_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 13 | func jx_find(buf: *u8, n: i64, start: i64, pat: *u8) -> i64 |
| 31 | func jx_copy_str(buf: *u8, n: i64, vstart: i64, out: *u8, outcap: i64) -> i64 |
| 61 | func jx_get_str(buf: *u8, n: i64, start: i64, key: *u8, out: *u8, outcap: i64) -> i64 |