Files
hermes-agent/persistence/sqlite/_dashboard_procs.py
yoniebans 1156b1e343 feat(persistence/sqlite): the state.db schema, DDL and migrations
_schema_ddl.py holds the state.db DDL and the FTS layout checks; _schema.py runs schema creation, column reconciliation, the data-migration ladder and the FTS setup on open; _dashboard_procs.py is the Desktop backend argv test the orphan holder reaper runs.
2026-11-17 17:49:46 +01:00

15 lines
688 B
Python

"""The Desktop backend argv test the orphan holder reaper runs, as ``hermes_cli.dashboard_procs`` runs it."""
def _dashboard_subcommand_index(argv: list[str]) -> int | None:
return next((i for i, tok in enumerate(argv) if tok in ("serve", "dashboard")), None)
def _is_ephemeral_port_zero_backend(argv: list[str]) -> bool:
"""True for Desktop-style ``serve|dashboard --port 0`` backends."""
if _dashboard_subcommand_index(argv) is None:
return False
return any((tok == "--port" and i + 1 < len(argv) and str(argv[i + 1]) == "0")
or (tok.startswith("--port=") and tok.split("=", 1)[1].strip() == "0")
for i, tok in enumerate(argv))