import json

path = "/Users/harvey/.openclaw/openclaw.json"
with open(path) as f:
    cfg = json.load(f)

slack_channels = cfg["channels"]["slack"]["channels"]

# The 7 contractor channels Mike wants Harvey to monitor (respond to Mike only)
# requireMention=False so Harvey receives all messages, but Harvey will self-enforce only responding to Mike
monitor_channels = {
    "C02N9GXMDEK": "elbas-team",
    "C02NFPKNZ1U": "emilys-team",
    "C03RTHVS2L8": "helens-team",
    "C02LZ9LNTP1": "jessicas-team",
    "C043WS97YMU": "livias-team",
    "C02N15MKH1R": "samiras-team",
    "C02JVDLLCNT": "team-vadim",
}

# Disable ALL other contractor/team channels
all_contractor_ids = [
    "C01U2947AUS",  # vadims-team (dupe)
    "C02NFPA3WA2",  # samira-team (dupe)
    "C03NZ5YGXLM",  # jackies-team
    "C03TPK0FTRQ",  # michelles-team
    "C0412NBNZ70",  # taheelas-team (was wrong mapping before)
    "C0485H4QE95",  # joans-team
    "C04H65KBJ3E",  # team-irais
    "C04PUGKUL58",  # ravinders-team
    "C04Q75V860Z",  # merons-team
    "C04RL46LM1S",  # ashleys-team
    "C04V69CKMPY",  # isas-team
    "C056K3U39NY",  # julias-team
    "C05SJPMLPPS",  # sharons-team
    "C0613N473SM",  # pahulpreets-team
    "C06BDMHSVAP",  # nas-team
    "C0AP2L7U3C2",  # contractors
    "C0APKR676TV",  # jobs
    "C083CUZURJ9",  # commercial-cleaning
]

for cid in all_contractor_ids:
    slack_channels[cid] = {"enabled": False}
    print(f"Disabled: {cid}")

# Set the 7 active monitor channels
for cid, name in monitor_channels.items():
    slack_channels[cid] = {"enabled": True, "requireMention": False}
    print(f"Monitor (Mike-only response): #{name}")

with open(path, "w") as f:
    json.dump(cfg, f, indent=2)

print("\nDone.")
