mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-11 07:00:48 +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
|
|
@ -19,21 +19,21 @@ _DEPREC_UPDATE = (
|
|||
" • If you use the OpenClaw app: use `openclaw plugins update`.\n"
|
||||
)
|
||||
|
||||
from oclaw.platform.config.runtime_paths import runtime_hooks_bundled_root
|
||||
from oclaw.runtime.hooks.config import should_include_hook
|
||||
from oclaw.runtime.hooks.frontmatter import resolve_hook_key
|
||||
from oclaw.runtime.hooks.hooks_status import build_workspace_hook_status
|
||||
from oclaw.runtime.hooks.hook_types import HookEntry
|
||||
from oclaw.runtime.hooks.merge_skill_hook_dirs import merge_skill_hook_extra_dirs_into_config
|
||||
from oclaw.runtime.hooks.user_config_hooks import (
|
||||
from svc.config.runtime_paths import runtime_hooks_bundled_root
|
||||
from runtime.hooks.config import should_include_hook
|
||||
from runtime.hooks.frontmatter import resolve_hook_key
|
||||
from runtime.hooks.hooks_status import build_workspace_hook_status
|
||||
from runtime.hooks.hook_types import HookEntry
|
||||
from runtime.hooks.merge_skill_hook_dirs import merge_skill_hook_extra_dirs_into_config
|
||||
from runtime.hooks.user_config_hooks import (
|
||||
apply_hook_entry_enabled,
|
||||
load_storage_config_document,
|
||||
resolve_hooks_config_storage_path,
|
||||
save_storage_config_document,
|
||||
)
|
||||
from oclaw.runtime.hooks.workspace import load_workspace_hook_entries
|
||||
from oclaw.runtime.hooks_runtime import resolve_runtime_config
|
||||
from oclaw.runtime.tools.path_guard import workspace_root
|
||||
from runtime.hooks.workspace import load_workspace_hook_entries
|
||||
from runtime.hooks_runtime import resolve_runtime_config
|
||||
from runtime.tools.path_guard import workspace_root
|
||||
|
||||
|
||||
def _resolve_cli_workspace(ns: argparse.Namespace) -> str:
|
||||
|
|
@ -196,7 +196,7 @@ def _cmd_hooks_info(args: argparse.Namespace) -> int:
|
|||
if args.json:
|
||||
print(json.dumps({"error": "not_found", "hook": name}, indent=2))
|
||||
else:
|
||||
print(f'Hook "{name}" not found. Try: python -m oclaw.runtime.operations hooks list')
|
||||
print(f'Hook "{name}" not found. Try: python -m runtime.operations hooks list')
|
||||
return 1
|
||||
if args.json:
|
||||
print(json.dumps(row, indent=2, default=str))
|
||||
|
|
@ -223,7 +223,7 @@ def _cmd_hooks_enable(args: argparse.Namespace) -> int:
|
|||
name = str(getattr(args, "name", "") or "").strip()
|
||||
entry = find_hook_entry_for_name(ws, name, config=None)
|
||||
if entry is None:
|
||||
print(f'Hook "{name}" not found. Try: python -m oclaw.runtime.operations hooks list --workspace ...')
|
||||
print(f'Hook "{name}" not found. Try: python -m runtime.operations hooks list --workspace ...')
|
||||
return 1
|
||||
if entry.hook.source == "oclaw-plugin":
|
||||
print("Plugin-managed hooks cannot be enabled via this CLI; enable or configure the plugin instead.")
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ import argparse
|
|||
import os
|
||||
import sys
|
||||
|
||||
from oclaw.runtime.operations.hooks_cmd import register_hooks_parser
|
||||
from oclaw.runtime.operations.memory import register_memory_parser
|
||||
from oclaw.runtime.operations.providers.registry import build_channel_registry
|
||||
from oclaw.runtime.operations.stack import register_stack_parser
|
||||
from runtime.operations.hooks_cmd import register_hooks_parser
|
||||
from runtime.operations.memory import register_memory_parser
|
||||
from runtime.operations.providers.registry import build_channel_registry
|
||||
from runtime.operations.stack import register_stack_parser
|
||||
|
||||
|
||||
def _cmd_gateway_start(args: argparse.Namespace) -> int:
|
||||
|
|
@ -15,16 +15,16 @@ def _cmd_gateway_start(args: argparse.Namespace) -> int:
|
|||
os.environ["AIA_ASSISTANT_GATEWAY_HOST"] = args.host
|
||||
if args.port is not None:
|
||||
os.environ["AIA_ASSISTANT_GATEWAY_PORT"] = str(args.port)
|
||||
from oclaw.runtime.operations.mcp_env import apply_gateway_mcp_env_to_os
|
||||
from runtime.operations.mcp_env import apply_gateway_mcp_env_to_os
|
||||
|
||||
apply_gateway_mcp_env_to_os()
|
||||
from oclaw.interfaces.http.fastapi_app import main as fastapi_main
|
||||
from interfaces.http.fastapi_app import main as fastapi_main
|
||||
|
||||
return fastapi_main()
|
||||
|
||||
|
||||
def _build_parser() -> argparse.ArgumentParser:
|
||||
p = argparse.ArgumentParser(prog="python -m oclaw.runtime.operations", description="Unified operational CLI")
|
||||
p = argparse.ArgumentParser(prog="python -m runtime.operations", description="Unified operational CLI")
|
||||
root_sub = p.add_subparsers(dest="root_cmd", required=True)
|
||||
|
||||
registry = build_channel_registry()
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from __future__ import annotations
|
|||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from oclaw.platform.config.paths import PROJECT_ROOT, db_path
|
||||
from svc.config.paths import PROJECT_ROOT, db_path
|
||||
|
||||
_DEFAULT_ALLOWLIST = (
|
||||
"BRAVE_API_KEY,GOOGLE_OAUTH_CREDENTIALS,GOOGLE_CALENDAR_MCP_TOKEN_PATH,"
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ from datetime import datetime, timezone
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from oclaw.platform.config.paths import PROJECT_ROOT
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from oclaw.runtime.tools.mcp.registry import McpRegistry
|
||||
from svc.config.paths import PROJECT_ROOT
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
from runtime.tools.mcp.registry import McpRegistry
|
||||
|
||||
_EXPORT_FILENAME = "mcp_registry_migrated.json"
|
||||
_LOCAL_DIR = (PROJECT_ROOT / "_local").resolve()
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ import secrets
|
|||
import sys
|
||||
from argparse import _SubParsersAction
|
||||
|
||||
from oclaw.interfaces.channels.wecom.longconn_runner import run_forever as run_wecom_longconn
|
||||
from oclaw.platform.config.paths import db_path
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from interfaces.channels.wecom.longconn_runner import run_forever as run_wecom_longconn
|
||||
from svc.config.paths import db_path
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
|
||||
from .base import ChannelProvider
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ class WecomProvider(ChannelProvider):
|
|||
return run_wecom_longconn()
|
||||
|
||||
def _cmd_status(self, _args: argparse.Namespace) -> int:
|
||||
from oclaw.runtime.operations.scripts.wecom_status import main as status_main
|
||||
from runtime.operations.scripts.wecom_status import main as status_main
|
||||
|
||||
return status_main()
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ class WecomProvider(ChannelProvider):
|
|||
return 0
|
||||
|
||||
def _cmd_smoke(self, args: argparse.Namespace) -> int:
|
||||
from oclaw.runtime.operations.scripts.wecom_smoke_test import main as smoke_main
|
||||
from runtime.operations.scripts.wecom_smoke_test import main as smoke_main
|
||||
|
||||
old = sys.argv
|
||||
try:
|
||||
|
|
@ -206,6 +206,6 @@ class WecomProvider(ChannelProvider):
|
|||
print("ok=1")
|
||||
print("mode=bot_api")
|
||||
print(f"bot_id={args.bot_id}")
|
||||
print("next=python -m oclaw.runtime.operations channel wecom start")
|
||||
print("next=python -m runtime.operations channel wecom start")
|
||||
return 0
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ from dataclasses import dataclass
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from oclaw.platform.config.paths import db_path
|
||||
from svc.config.paths import db_path
|
||||
|
||||
|
||||
def _runtime_file() -> Path:
|
||||
|
|
@ -76,13 +76,13 @@ def _python_bin() -> str:
|
|||
def _service_signature(name: str) -> str | None:
|
||||
n = str(name or "").strip().lower()
|
||||
if n == "gateway":
|
||||
return "-m oclaw.runtime.operations gateway start"
|
||||
return "-m runtime.operations gateway start"
|
||||
if n == "ui":
|
||||
return "-m oclaw.runtime.operations ui start"
|
||||
return "-m runtime.operations ui start"
|
||||
if n.startswith("channel:"):
|
||||
ch = n.split(":", 1)[1].strip()
|
||||
if ch:
|
||||
return f"-m oclaw.runtime.operations channel {ch} start"
|
||||
return f"-m runtime.operations channel {ch} start"
|
||||
return None
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ from __future__ import annotations
|
|||
import secrets
|
||||
import sys
|
||||
|
||||
from oclaw.platform.config.paths import db_path
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from svc.config.paths import db_path
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
|
||||
|
||||
def main() -> int:
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
|||
|
||||
from pathlib import Path
|
||||
|
||||
from oclaw.platform.config.runtime_paths import oclaw_root
|
||||
from svc.config.runtime_paths import oclaw_root
|
||||
|
||||
|
||||
_PS1_FORWARDERS: dict[str, str] = {
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ from pathlib import Path
|
|||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from oclaw.platform.config.paths import db_path # noqa: E402
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore # noqa: E402
|
||||
from oclaw.runtime.tools.mcp.installer import McpServerManifest, _safe_server_id, install_mcp_server # noqa: E402
|
||||
from svc.config.paths import db_path # noqa: E402
|
||||
from svc.persistence.sqlite_store import SqliteStore # noqa: E402
|
||||
from runtime.tools.mcp.installer import McpServerManifest, _safe_server_id, install_mcp_server # noqa: E402
|
||||
|
||||
|
||||
# (server_id_seed, npm package ref, entry_args for npx)
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ from pathlib import Path
|
|||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from oclaw.platform.config.paths import db_path # noqa: E402
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore # noqa: E402
|
||||
from oclaw.runtime.tools.mcp.installer import McpServerManifest, install_mcp_server # noqa: E402
|
||||
from oclaw.runtime.tools.mcp.runtime import McpProcessRuntime # noqa: E402
|
||||
from svc.config.paths import db_path # noqa: E402
|
||||
from svc.persistence.sqlite_store import SqliteStore # noqa: E402
|
||||
from runtime.tools.mcp.installer import McpServerManifest, install_mcp_server # noqa: E402
|
||||
from runtime.tools.mcp.runtime import McpProcessRuntime # noqa: E402
|
||||
|
||||
_BINDING_KEY = "mcp_specialist_server_binding"
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ from pathlib import Path
|
|||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from oclaw.platform.config.paths import db_path # noqa: E402
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore # noqa: E402
|
||||
from oclaw.runtime.tools.mcp.installer import McpServerManifest, install_mcp_server # noqa: E402
|
||||
from oclaw.runtime.tools.mcp.runtime import McpProcessRuntime # noqa: E402
|
||||
from svc.config.paths import db_path # noqa: E402
|
||||
from svc.persistence.sqlite_store import SqliteStore # noqa: E402
|
||||
from runtime.tools.mcp.installer import McpServerManifest, install_mcp_server # noqa: E402
|
||||
from runtime.tools.mcp.runtime import McpProcessRuntime # noqa: E402
|
||||
|
||||
|
||||
def _sync_tools(store: SqliteStore, server_id: str) -> bool:
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ if str(_REPO_ROOT) not in sys.path:
|
|||
# Same bootstrap as gateway: ``interfaces/http/fastapi_app.py`` calls ``load_system_env()`` so
|
||||
# ``oclaw/_local/system.env`` is merged before reading ``OPENAI_*``.
|
||||
try:
|
||||
from oclaw.platform.config.bootstrap_env import load_system_env
|
||||
from svc.config.bootstrap_env import load_system_env
|
||||
|
||||
load_system_env()
|
||||
except ImportError:
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@ from pathlib import Path
|
|||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from oclaw.platform.config.paths import PROJECT_ROOT, db_path # noqa: E402
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore # noqa: E402
|
||||
from oclaw.runtime.tools.mcp.installer import McpServerManifest, _safe_server_id, install_mcp_server # noqa: E402
|
||||
from svc.config.paths import PROJECT_ROOT, db_path # noqa: E402
|
||||
from svc.persistence.sqlite_store import SqliteStore # noqa: E402
|
||||
from runtime.tools.mcp.installer import McpServerManifest, _safe_server_id, install_mcp_server # noqa: E402
|
||||
|
||||
|
||||
def _subst_repo(path_str: str) -> str:
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
import sys
|
||||
|
||||
from oclaw.platform.config.paths import db_path
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from svc.config.paths import db_path
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
|
||||
|
||||
def _to_bool(v: str) -> str:
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
import sys
|
||||
|
||||
from oclaw.platform.config.paths import db_path
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from svc.config.paths import db_path
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
|
||||
|
||||
def main() -> int:
|
||||
|
|
|
|||
|
|
@ -43,9 +43,8 @@ if (-not $repoRoot) {
|
|||
# Fallback: old relative layout assumption
|
||||
$repoRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $PSScriptRoot))
|
||||
}
|
||||
$repoParent = Split-Path -Parent $repoRoot
|
||||
Set-Location $repoRoot
|
||||
$env:PYTHONPATH = $repoParent
|
||||
$env:PYTHONPATH = $repoRoot
|
||||
$env:PYTHONSAFEPATH = "1"
|
||||
$env:AIA_WORKSPACE_ROOT = $repoRoot
|
||||
$env:OPS_WORKSPACE_ROOT = $repoRoot
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$repoRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $PSScriptRoot))
|
||||
$repoParent = Split-Path -Parent $repoRoot
|
||||
$desktopDir = Join-Path $repoRoot "desktop"
|
||||
$runDir = Join-Path $PSScriptRoot ".run"
|
||||
New-Item -ItemType Directory -Force -Path $runDir | Out-Null
|
||||
|
|
@ -22,7 +21,7 @@ if (-not (Test-Path $desktopDir)) {
|
|||
}
|
||||
|
||||
Set-Location $desktopDir
|
||||
$env:PYTHONPATH = $repoParent
|
||||
$env:PYTHONPATH = $repoRoot
|
||||
$env:PYTHONSAFEPATH = "1"
|
||||
$env:AIA_WORKSPACE_ROOT = $repoRoot
|
||||
$env:OPS_WORKSPACE_ROOT = $repoRoot
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ if (-not $repoRoot) {
|
|||
# Fallback: old relative layout assumption
|
||||
$repoRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $PSScriptRoot))
|
||||
}
|
||||
$repoParent = Split-Path -Parent $repoRoot
|
||||
Set-Location $repoRoot
|
||||
|
||||
$runDir = Join-Path $PSScriptRoot ".run"
|
||||
|
|
@ -49,7 +48,8 @@ $pidFile = Join-Path $runDir "gateway.pid"
|
|||
Write-Step "Project root: $repoRoot"
|
||||
Write-Step "Working directory: $repoRoot"
|
||||
|
||||
$env:PYTHONPATH = $repoParent
|
||||
# Repo root must be on PYTHONPATH (top-level packages: runtime, svc, interfaces).
|
||||
$env:PYTHONPATH = $repoRoot
|
||||
$env:PYTHONSAFEPATH = "1"
|
||||
$env:AIA_WORKSPACE_ROOT = $repoRoot
|
||||
$env:OPS_WORKSPACE_ROOT = $repoRoot
|
||||
|
|
@ -95,7 +95,7 @@ if ($WithWikiWorker) {
|
|||
|
||||
if ($Background) {
|
||||
Write-Step "Starting gateway in background"
|
||||
$p = Start-Process -FilePath $pythonExe -ArgumentList @("-m","oclaw.runtime.operations","gateway","start","--host",$BindHost,"--port",$Port) -WorkingDirectory $repoRoot -PassThru -WindowStyle Hidden
|
||||
$p = Start-Process -FilePath $pythonExe -ArgumentList @("-m","runtime.operations","gateway","start","--host",$BindHost,"--port",$Port) -WorkingDirectory $repoRoot -PassThru -WindowStyle Hidden
|
||||
Set-Content -Path $pidFile -Value "$($p.Id)" -Encoding ascii
|
||||
Write-Host "gateway.pid = $pidFile" -ForegroundColor DarkGray
|
||||
Write-Host "PID = $($p.Id)" -ForegroundColor Green
|
||||
|
|
@ -103,7 +103,7 @@ if ($Background) {
|
|||
}
|
||||
|
||||
Write-Step "Starting gateway (foreground)"
|
||||
& $pythonExe -m oclaw.runtime.operations gateway start --host $BindHost --port $Port
|
||||
& $pythonExe -m runtime.operations gateway start --host $BindHost --port $Port
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -37,13 +37,12 @@ if (-not $repoRoot) {
|
|||
# Fallback: old relative layout assumption
|
||||
$repoRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $PSScriptRoot))
|
||||
}
|
||||
$repoParent = Split-Path -Parent $repoRoot
|
||||
Set-Location $repoRoot
|
||||
|
||||
Write-Step "Project root: $repoRoot"
|
||||
Write-Step "Working directory: $repoRoot"
|
||||
|
||||
$env:PYTHONPATH = $repoParent
|
||||
$env:PYTHONPATH = $repoRoot
|
||||
$env:PYTHONSAFEPATH = "1"
|
||||
$env:AIA_WORKSPACE_ROOT = $repoRoot
|
||||
$env:OPS_WORKSPACE_ROOT = $repoRoot
|
||||
|
|
@ -72,21 +71,21 @@ if (-not $SkipInstall) {
|
|||
if (-not $SkipConfigHint) {
|
||||
Write-Step "Current WeCom status"
|
||||
try {
|
||||
& $pythonExe -m oclaw.runtime.operations channel wecom status
|
||||
& $pythonExe -m runtime.operations channel wecom status
|
||||
} catch {
|
||||
Write-Host "[WARN] Unable to read WeCom status yet." -ForegroundColor Yellow
|
||||
}
|
||||
Write-Host ""
|
||||
Write-Host "If WeCom is not configured yet, run this first:" -ForegroundColor Yellow
|
||||
Write-Host " python -m oclaw.runtime.operations channel wecom config --help"
|
||||
Write-Host " python -m runtime.operations channel wecom config --help"
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
Write-Step "Stopping previous stack (safe if not running)"
|
||||
& $pythonExe -m oclaw.runtime.operations stack down
|
||||
& $pythonExe -m runtime.operations stack down
|
||||
|
||||
Write-Step "Starting stack: python -m oclaw.runtime.operations stack up --channel $Channel"
|
||||
& $pythonExe -m oclaw.runtime.operations stack up --channel $Channel
|
||||
Write-Step "Starting stack: python -m runtime.operations stack up --channel $Channel"
|
||||
& $pythonExe -m runtime.operations stack up --channel $Channel
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Started successfully." -ForegroundColor Green
|
||||
|
|
@ -94,8 +93,8 @@ Write-Host "Admin: http://127.0.0.1:8787/admin"
|
|||
Write-Host "Chat: http://127.0.0.1:8787/chat"
|
||||
Write-Host ""
|
||||
Write-Host "Useful commands:"
|
||||
Write-Host " python -m oclaw.runtime.operations stack status"
|
||||
Write-Host " python -m oclaw.runtime.operations stack down"
|
||||
Write-Host " python -m runtime.operations stack status"
|
||||
Write-Host " python -m runtime.operations stack down"
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ function Resolve-RepoRoot {
|
|||
}
|
||||
|
||||
$repoRoot = Resolve-RepoRoot
|
||||
$repoParent = Split-Path -Parent $repoRoot
|
||||
$runDir = Join-Path $PSScriptRoot ".run"
|
||||
$null = New-Item -ItemType Directory -Force -Path $runDir -ErrorAction SilentlyContinue
|
||||
$pidFile = Join-Path $runDir "wiki_worker.pid"
|
||||
|
|
@ -30,7 +29,7 @@ function Test-IsWikiWorkerPid([int]$procId) {
|
|||
try {
|
||||
$wmi = Get-CimInstance Win32_Process -Filter "ProcessId = $procId" -ErrorAction Stop
|
||||
$cmd = [string]($wmi.CommandLine)
|
||||
return $cmd -like "*oclaw.runtime.workers.wiki.main*"
|
||||
return $cmd -like "*runtime.workers.wiki.main*"
|
||||
} catch {
|
||||
return $false
|
||||
}
|
||||
|
|
@ -46,14 +45,14 @@ if (Test-Path $venvPython) {
|
|||
}
|
||||
$pythonExe = "python"
|
||||
}
|
||||
$env:PYTHONPATH = $repoParent
|
||||
$env:PYTHONPATH = $repoRoot
|
||||
$env:PYTHONSAFEPATH = "1"
|
||||
$env:AIA_WORKSPACE_ROOT = $repoRoot
|
||||
$env:OPS_WORKSPACE_ROOT = $repoRoot
|
||||
$env:OCLAW_WORKSPACE = $repoRoot
|
||||
|
||||
if (-not $Background) {
|
||||
& $pythonExe -m oclaw.runtime.workers.wiki.main
|
||||
& $pythonExe -m runtime.workers.wiki.main
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +66,7 @@ if (Test-Path $pidFile) {
|
|||
}
|
||||
}
|
||||
|
||||
$p = Start-Process -FilePath $pythonExe -ArgumentList @("-m", "oclaw.runtime.workers.wiki.main") -WorkingDirectory $repoRoot -PassThru -WindowStyle Hidden -RedirectStandardOutput $outLog -RedirectStandardError $errLog
|
||||
$p = Start-Process -FilePath $pythonExe -ArgumentList @("-m", "runtime.workers.wiki.main") -WorkingDirectory $repoRoot -PassThru -WindowStyle Hidden -RedirectStandardOutput $outLog -RedirectStandardError $errLog
|
||||
Set-Content -Path $pidFile -Value $p.Id -Encoding ascii
|
||||
Write-Host "[ok] started wiki worker pid=$($p.Id) out=$outLog err=$errLog"
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,8 @@ function Write-Step([string]$msg) {
|
|||
}
|
||||
|
||||
$repoRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $PSScriptRoot))
|
||||
$repoParent = Split-Path -Parent $repoRoot
|
||||
Set-Location $repoRoot
|
||||
$env:PYTHONPATH = $repoParent
|
||||
$env:PYTHONPATH = $repoRoot
|
||||
$env:PYTHONSAFEPATH = "1"
|
||||
$env:AIA_WORKSPACE_ROOT = $repoRoot
|
||||
$env:OPS_WORKSPACE_ROOT = $repoRoot
|
||||
|
|
@ -23,11 +22,11 @@ if (Test-Path $venvPython) {
|
|||
Write-Step "Project root: $repoRoot"
|
||||
Write-Step "Working directory: $repoRoot"
|
||||
Write-Step "Stack status"
|
||||
& $pythonExe -m oclaw.runtime.operations stack status
|
||||
& $pythonExe -m runtime.operations stack status
|
||||
|
||||
Write-Host ""
|
||||
Write-Step "WeCom status"
|
||||
& $pythonExe -m oclaw.runtime.operations channel wecom status
|
||||
& $pythonExe -m runtime.operations channel wecom status
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Admin: http://127.0.0.1:8787/admin"
|
||||
|
|
|
|||
|
|
@ -30,9 +30,8 @@ if (-not $repoRoot) {
|
|||
# Fallback: old relative layout assumption
|
||||
$repoRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $PSScriptRoot))
|
||||
}
|
||||
$repoParent = Split-Path -Parent $repoRoot
|
||||
Set-Location $repoRoot
|
||||
$env:PYTHONPATH = $repoParent
|
||||
$env:PYTHONPATH = $repoRoot
|
||||
$env:PYTHONSAFEPATH = "1"
|
||||
$env:AIA_WORKSPACE_ROOT = $repoRoot
|
||||
$env:OPS_WORKSPACE_ROOT = $repoRoot
|
||||
|
|
@ -50,7 +49,7 @@ Write-Step "Working directory: $repoRoot"
|
|||
Write-Step "Stopping stack services..."
|
||||
|
||||
try {
|
||||
& $pythonExe -m oclaw.runtime.operations stack down
|
||||
& $pythonExe -m runtime.operations stack down
|
||||
Write-Host "Stack stopped." -ForegroundColor Green
|
||||
} catch {
|
||||
Write-Host "[WARN] stack down failed: $($_.Exception.Message)" -ForegroundColor Yellow
|
||||
|
|
@ -61,7 +60,7 @@ try {
|
|||
|
||||
Write-Step "Current status"
|
||||
try {
|
||||
& $pythonExe -m oclaw.runtime.operations stack status
|
||||
& $pythonExe -m runtime.operations stack status
|
||||
} catch {
|
||||
Write-Host "[WARN] Unable to read status after stop." -ForegroundColor Yellow
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ from __future__ import annotations
|
|||
|
||||
import sys
|
||||
|
||||
from oclaw.platform.config.paths import db_path
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from svc.config.paths import db_path
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
|
||||
|
||||
_CLEAR_KEYS = [
|
||||
|
|
@ -40,7 +40,7 @@ def main() -> int:
|
|||
print("mode=bot_api")
|
||||
print(f"bot_id={bot_id}")
|
||||
print("cleared=" + ",".join(_CLEAR_KEYS))
|
||||
print("next=python -m oclaw.runtime.operations stack up --channel wecom")
|
||||
print("next=python -m runtime.operations stack up --channel wecom")
|
||||
return 0
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from oclaw.platform.config.paths import db_path
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from svc.config.paths import db_path
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
|
||||
|
||||
_CLEAR_KEYS = [
|
||||
|
|
@ -39,7 +39,7 @@ def main() -> int:
|
|||
print(f"deleted_channel_identity={ident_deleted}")
|
||||
print(f"deleted_channel_session={sess_deleted}")
|
||||
print("cleared_settings=" + ",".join(_CLEAR_KEYS))
|
||||
print("next=python -m oclaw.runtime.operations channel wecom config set --type bot --bot-id <bot_id> --bot-secret <bot_secret>")
|
||||
print("next=python -m runtime.operations channel wecom config set --type bot --bot-id <bot_id> --bot-secret <bot_secret>")
|
||||
return 0
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
|||
|
||||
from pathlib import Path
|
||||
|
||||
from oclaw.platform.config.runtime_paths import oclaw_root, runtime_operations_scripts_root
|
||||
from svc.config.runtime_paths import oclaw_root, runtime_operations_scripts_root
|
||||
|
||||
|
||||
def verify_forwarders() -> tuple[bool, list[str]]:
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ import json
|
|||
import sys
|
||||
import uuid
|
||||
|
||||
from oclaw.platform.config.paths import db_path
|
||||
from oclaw.platform.integrations.wecom_client import WeComClient
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from svc.config.paths import db_path
|
||||
from svc.integrations.wecom_client import WeComClient
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
|
||||
|
||||
def main() -> int:
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ from __future__ import annotations
|
|||
import json
|
||||
from datetime import datetime, timezone
|
||||
|
||||
from oclaw.platform.config.paths import db_path
|
||||
from oclaw.platform.integrations.wecom_client import WeComClient
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from svc.config.paths import db_path
|
||||
from svc.integrations.wecom_client import WeComClient
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
|
||||
|
||||
def _fmt_ts(ts: str) -> str:
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ _REPO_ROOT = Path(__file__).resolve().parents[2]
|
|||
if str(_REPO_ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(_REPO_ROOT))
|
||||
|
||||
from oclaw.platform.config.paths import PROJECT_ROOT, db_path
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from svc.config.paths import PROJECT_ROOT, db_path
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
|
||||
|
||||
def _load_cfg() -> dict:
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ def cmd_stack_up(args: argparse.Namespace) -> int:
|
|||
gateway_cmd = default_python_command(
|
||||
[
|
||||
"-m",
|
||||
"oclaw.runtime.operations",
|
||||
"runtime.operations",
|
||||
"gateway",
|
||||
"start",
|
||||
"--host",
|
||||
|
|
@ -27,7 +27,7 @@ def cmd_stack_up(args: argparse.Namespace) -> int:
|
|||
channel_cmd = default_python_command(
|
||||
[
|
||||
"-m",
|
||||
"oclaw.runtime.operations",
|
||||
"runtime.operations",
|
||||
"channel",
|
||||
args.channel,
|
||||
"start",
|
||||
|
|
@ -51,7 +51,7 @@ def cmd_stack_up(args: argparse.Namespace) -> int:
|
|||
print("ok=1")
|
||||
for name, pid in started:
|
||||
print(f"{name}_pid={pid}")
|
||||
print("hint=use `python -m oclaw.runtime.operations stack status` to check running services")
|
||||
print("hint=use `python -m runtime.operations stack status` to check running services")
|
||||
return 0
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue