#!/usr/bin/env python3
"""
SignalBridge – simulated Signal-Cli communication
Input: config/admin_access, output: signal_response.json
"""

import json
import os

PATHS = {
    "config": os.path.expanduser("~/natiris/config/character_genesis.json"),
    "output": os.path.expanduser("~/natiris/bridges/signal_response.json"),
}

def check_admin_access(config):
    admin = config.get("admin", {})
    return admin.get("access", "protected") == "protected"

def main():
    with open(PATHS["config"]) as f:
        config = json.load(f)

    admin_ok = check_admin_access(config)

    result = {
        "timestamp": __import__('datetime').datetime.now(__import__('datetime').timezone.utc).isoformat(),
        "signal_cli_available": False,
        "simulated": True,
        "admin_access": "protected" if admin_ok else "open",
        "signal_status": "ready (simulated)"
    }

    with open(PATHS["output"], "w") as f:
        json.dump(result, f, indent=2)

    print(json.dumps(result, indent=2))

if __name__ == "__main__":
    main()
