mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 05:50:44 +08:00
- Rename platform/ to svc/ to avoid shadowing stdlib platform. - Replace from oclaw.* with from svc/runtime/interfaces; update -m CLI paths. - tests/conftest: prepend repo root to sys.path (no parent-folder package name). - CI: paths and offline_eval script under repo root. - Ops scripts: PYTHONPATH must be repo root for python -m runtime.* (fixes gateway/WhatsApp sidecar startup). - Fix default oclaw.json path in tabular/file attachment limits; stabilize attachment test config. Co-authored-by: Cursor <cursoragent@cursor.com>
58 lines
1.7 KiB
Python
58 lines
1.7 KiB
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
from svc.config.runtime_paths import oclaw_root, runtime_operations_scripts_root
|
|
|
|
|
|
def verify_forwarders() -> tuple[bool, list[str]]:
|
|
root_scripts = (oclaw_root() / "scripts").resolve()
|
|
real_scripts = runtime_operations_scripts_root()
|
|
errors: list[str] = []
|
|
required = [
|
|
"start_all.ps1",
|
|
"start_gateway.ps1",
|
|
"start_desktop.ps1",
|
|
"start_ops.ps1",
|
|
"start_ops.sh",
|
|
"status_ops.sh",
|
|
"stop_ops.sh",
|
|
]
|
|
for name in required:
|
|
rp = root_scripts / name
|
|
if not rp.exists():
|
|
errors.append(f"missing forwarder: {rp}")
|
|
continue
|
|
tp = real_scripts / name
|
|
if not tp.exists():
|
|
errors.append(f"missing target: {tp}")
|
|
continue
|
|
text = rp.read_text(encoding="utf-8", errors="ignore")
|
|
normalized = text.replace("\\", "/")
|
|
while "//" in normalized:
|
|
normalized = normalized.replace("//", "/")
|
|
marker_exact = f"runtime/operations/scripts/{name}".replace("\\", "/")
|
|
marker_base = "runtime/operations/scripts"
|
|
if name.endswith(".sh"):
|
|
ok = (marker_base in normalized) and (f"/{name}" in normalized)
|
|
else:
|
|
ok = marker_exact in normalized
|
|
if not ok:
|
|
errors.append(f"forwarder target mismatch: {rp}")
|
|
return (len(errors) == 0), errors
|
|
|
|
|
|
def main() -> int:
|
|
ok, errors = verify_forwarders()
|
|
if ok:
|
|
print("forwarders_ok=1")
|
|
return 0
|
|
print("forwarders_ok=0")
|
|
for err in errors:
|
|
print(err)
|
|
return 1
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|
|
|