nx_resource.nx
buildroot/runtime/nx_resource.nx
about
nx_resource.nx -- MCP Resources-primitive parity, sovereign: register read-only data resources (uri / description /
kind / source) and DISCOVER + READ them. Composes the canonical nx_registry (register/list on seg_store) + file
content. Record (tab-separated): uri <TAB> description <TAB> kind <TAB> source. kind "file" reads `source` as a path.
license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_registry.nxnx_tabrec.nx
imported by: nx_resource_gate.nx
structs
| none |
consts
| 7 | const RES_MAGIC_2048: i64 = 2048 |
| 9 | const RES_KP: *u8 = "res:" as *u8 |
| 10 | const RES_IDX: *u8 = "__residx__" as *u8 |
| 11 | const RES_PREFIX: *u8 = "knowledge/resreg-" as *u8 |
functions
| 13 | func resource_register_pfx(prefix: *u8, uri: *u8, desc: *u8, kind: *u8, source: *u8) -> i64 |
| 18 | func resource_list_pfx(prefix: *u8, idxbuf: *u8, cap: i64) -> i64 { return reg_index(prefix, RES_IDX, idxbuf, cap) } |
| 21 | func resource_read_pfx(prefix: *u8, uri: *u8, outbuf: *u8, cap: i64) -> i64 |
| 39 | func resource_register(uri: *u8, desc: *u8, kind: *u8, source: *u8) -> i64 { return resource_register_pfx(RES_PREFIX, uri, desc, kind, source) } calls 1: resource_register_pfx |
| 40 | func resource_list(idxbuf: *u8, cap: i64) -> i64 { return resource_list_pfx(RES_PREFIX, idxbuf, cap) } calls 1: resource_list_pfx |
| 41 | func resource_read(uri: *u8, outbuf: *u8, cap: i64) -> i64 { return resource_read_pfx(RES_PREFIX, uri, outbuf, cap) } calls 1: resource_read_pfx |