mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-10 22:15:57 +08:00
refactor: root-package imports (svc/runtime/interfaces) and fix PYTHONPATH
- 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>
This commit is contained in:
parent
7941b27f58
commit
420abac9f1
405 changed files with 1316 additions and 1345 deletions
|
|
@ -1,57 +0,0 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from oclaw.platform.config.paths import PROJECT_ROOT
|
||||
|
||||
|
||||
def oclaw_root() -> Path:
|
||||
return Path(PROJECT_ROOT).resolve()
|
||||
|
||||
|
||||
def runtime_root() -> Path:
|
||||
return (oclaw_root() / "runtime").resolve()
|
||||
|
||||
|
||||
def runtime_skills_root() -> Path:
|
||||
"""Canonical skills tree lives at repo ``skills/``; ``runtime/skills`` remains a migration fallback."""
|
||||
root_skills = (oclaw_root() / "skills").resolve()
|
||||
legacy_runtime_skills = (runtime_root() / "skills").resolve()
|
||||
if root_skills.is_dir():
|
||||
return root_skills
|
||||
if legacy_runtime_skills.is_dir():
|
||||
return legacy_runtime_skills
|
||||
return root_skills
|
||||
|
||||
|
||||
def runtime_hooks_root() -> Path:
|
||||
return (runtime_root() / "hooks").resolve()
|
||||
|
||||
|
||||
def runtime_hooks_bundled_root() -> Path:
|
||||
return (runtime_hooks_root() / "bundled").resolve()
|
||||
|
||||
|
||||
def runtime_extensions_root() -> Path:
|
||||
return (runtime_root() / "extensions").resolve()
|
||||
|
||||
|
||||
def runtime_operations_scripts_root() -> Path:
|
||||
return (runtime_root() / "operations" / "scripts").resolve()
|
||||
|
||||
|
||||
def ws_protocol_schemas_root() -> Path:
|
||||
return (oclaw_root() / "interfaces" / "ws" / "protocol_schemas").resolve()
|
||||
|
||||
|
||||
__all__ = [
|
||||
"oclaw_root",
|
||||
"runtime_root",
|
||||
"runtime_skills_root",
|
||||
"runtime_hooks_root",
|
||||
"runtime_hooks_bundled_root",
|
||||
"runtime_extensions_root",
|
||||
"runtime_operations_scripts_root",
|
||||
"ws_protocol_schemas_root",
|
||||
]
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue