mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-12 12:47:42 +02:00
[hAIk]: refactor backend settings and tools routes to use explicit endpoint names (/get_settings, /update_settings, /get_builtin_permissions, /update_builtin_permissions) with matching frontend updates; simplify base_routes.ts to relative /api path; add new appsSlice Redux slice and register in store; remove unused GET_HISTORY reducer; rename structlint to lint across CI workflow, local.sh, and publish.sh; strip ANSI escape codes from NineRouter forwarded output; add swarm-debug as backend dependency
This commit is contained in:
+5
-1
@@ -1,12 +1,16 @@
|
||||
import re
|
||||
|
||||
from typeguard import typechecked
|
||||
|
||||
_ANSI_RE = re.compile(r"\x1b\[[0-9;]*[A-Za-z]|\x1b[c78]")
|
||||
|
||||
|
||||
# TODO: type spec this entirely
|
||||
@typechecked
|
||||
def forward_output(pipe) -> None:
|
||||
try:
|
||||
for line in iter(pipe.readline, b""):
|
||||
text = line.decode("utf-8", errors="replace").rstrip()
|
||||
text = _ANSI_RE.sub("", line.decode("utf-8", errors="replace")).rstrip()
|
||||
if text:
|
||||
print(f"[9router] {text}", flush=True)
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user