refactor(management): replace curses TUIs with API-backed ncp subcommands; panel/autostart/install integration

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
jon
2026-07-11 07:25:08 -05:00
parent f4f77c5196
commit 53eaed4c7f
792 changed files with 2782 additions and 2240 deletions
+24
View File
@@ -0,0 +1,24 @@
"""Pin the SSE parser in nexus_api. Run: python management/test_nexus_api.py"""
import sys, os
sys.path.insert(0, os.path.dirname(__file__))
from nexus_api import iter_chunks
# A realistic /chat/stream frame: two token chunks, a meta block, then done.
lines = [
'data: "Hello"', "",
'data: " world"', "",
"event: meta", 'data: {"model":"mistral"}', "",
"event: done", "data: {}", "",
]
out = list(iter_chunks(lines))
assert out == [
("chunk", "Hello"),
("chunk", " world"),
("meta", '{"model":"mistral"}'),
("done", "{}"),
], out
# error frame surfaces as its own kind, not a chunk
assert list(iter_chunks(["event: error", 'data: {"detail":"boom"}'])) == [
("error", '{"detail":"boom"}')
]
print("ok")