code wiki / (root) / nx_nxtask_main.nx

nx_nxtask_main.nx

buildroot/runtime/nx_nxtask_main.nx

10487 B279 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind tooltopic nxtask
docsdependenciesstructsconstsfunctions

about

nxtask_main.nx -- CLI driver for the sovereign agent task graph. Usage: nxtask demo build + dump sample graph as JSON nxtask ready build + dump ready-task count nxtask show N build + show task N's JSON nxtask save <path> serialize demo graph to <path> nxtask load <path> deserialize <path> + dump as JSON nxtask roundtrip <path> save+load e2e smoke test Once multi-agent merge + durable event log ship (see docs/NXTASK_AGENT_TASK_GRAPH.md v0.1.0), the CLI will manage a default store under ~/.nxtask/ so the <path> argument becomes optional. Today every subcommand takes an explicit path. When Mormon v0 picks this up, the shape becomes: run("nxtask load ~/.nxtask/graph.bin | jq '.tasks[] | select(.state==\"open\")'") let next_task = parse_json(...).id ...do the work... run("nxtask close " + next_task.id + " 'summary' && nxtask save ~/.nxtask/graph.bin") Exit codes: 0 success 1 no args 2 unknown subcommand / missing arg 3 I/O failure (open/read/write) 4 malformed input (deserialize failure)

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_json_emit.nx nx_nxtask.nx nx_nxtask_store.nx nx_nxtask_main.nx

imports: nx_syscalls.nxnx_json_emit.nxnx_nxtask.nxnx_nxtask_store.nx

imported by: nobody (leaf or entry point)

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

main write_out sys_write build_demo_graph nxtask_graph_new sys_mmap nxtask_add task_at sys_mmap ↻ nxtask_add_dep task_at ↻ sys_mmap ↻ nxtask_claim task_at ↻ sys_mmap ↻ nxtask_close task_at ↻ sys_mmap ↻ sys_mmap ↻ json_writer_init streq emit_graph json_begin_object je_sep je_put je_put ↻ json_emit_key je_sep ↻ je_emit_string_raw je_put ↻ je_put ↻ json_begin_array je_sep ↻ je_put ↻ task_at ↻ emit_task json_begin_object ↻ json_emit_key ↻ json_emit_int je_sep ↻

structs

none

consts

45const STATE_OPEN: i64 = 0
46const STATE_CLAIMED: i64 = 1
47const STATE_CLOSED: i64 = 2

functions

49func state_name(s: i64) -> *u8
called by 1: emit_task
56func state_name_len(s: i64) -> i64
called by 1: emit_task
63func emit_task(w: *JsonWriter, t: *Task, idx: i64) -> i64
89func emit_graph(w: *JsonWriter, g: *TaskGraph) -> i64
109func build_demo_graph() -> *TaskGraph
131func streq(a: *u8, b: *u8, n: i64) -> i64
called by 1: main
142func write_out(o: *u8, n: i64) -> i64
called by 1: main calls 1: sys_write
148func main(argc: i64, argv: *i64) -> i64