diff --git a/patch_index.py b/patch_index.py index 675da0c..1ec80bb 100644 --- a/patch_index.py +++ b/patch_index.py @@ -40,4 +40,22 @@ if "x-coop-build" not in html: html = html.replace("", "\n " + marker, 1) open(PATH, "w", encoding="utf-8").write(html) + +# 4. Web manifest identity: co-op name + a 512 icon installable as "any". +# (theme_color/background_color are fixed by the later Dockerfile sed.) +MPATH = "/app/code/librechat/client/dist/manifest.webmanifest" +try: + import json as _json + + mf = _json.load(open(MPATH, encoding="utf-8")) + mf["name"] = "Inference Co\u2011op" + mf["short_name"] = "Inference" + mf["description"] = "Member-governed AI inference — private and renewable model choices." + for icon in mf.get("icons", []): + if icon.get("sizes") == "512x512": + icon["purpose"] = "any maskable" + open(MPATH, "w", encoding="utf-8").write(_json.dumps(mf, indent=2)) + print("manifest: co-op identity set") +except OSError: + raise SystemExit(0) print("index.html: co-op branding + build marker injected")