mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 03:30: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
|
|
@ -5,7 +5,7 @@ import threading
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from oclaw.platform.config.paths import PROJECT_ROOT
|
||||
from svc.config.paths import PROJECT_ROOT
|
||||
|
||||
_ROLE_CONTEXT_CACHE_LOCK = threading.Lock()
|
||||
_ROLE_CONTEXT_CACHE: dict[tuple[str, tuple[Any, ...], tuple[tuple[str, str], ...]], str] = {}
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@ import json
|
|||
from dataclasses import dataclass
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
from oclaw.runtime.chat.turn_types import TurnRunOutcome
|
||||
from oclaw.runtime.direct_loop import run_direct_loop
|
||||
from oclaw.runtime.memory_stage import after_turn_memory
|
||||
from oclaw.runtime.types import AttemptState, OclawMemoryContext, StandardMessage
|
||||
from oclaw.runtime.orchestration.trace import new_span_id
|
||||
from runtime.chat.turn_types import TurnRunOutcome
|
||||
from runtime.direct_loop import run_direct_loop
|
||||
from runtime.memory_stage import after_turn_memory
|
||||
from runtime.types import AttemptState, OclawMemoryContext, StandardMessage
|
||||
from runtime.orchestration.trace import new_span_id
|
||||
|
||||
def _workspace_owner_session_id_from_msg(msg: StandardMessage) -> str | None:
|
||||
md = msg.metadata if isinstance(msg.metadata, dict) else {}
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ import uuid
|
|||
from dataclasses import dataclass
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
from oclaw.runtime.chat.turn_types import TurnRunOutcome
|
||||
from oclaw.runtime.agent_core_attempt import ALL_ATTEMPT_ERROR_CODES
|
||||
from oclaw.runtime.agent_core_attempt import AttemptRunnerInput, run_attempt
|
||||
from oclaw.runtime.memory_stage import compact_memory_context
|
||||
from oclaw.runtime.types import AttemptState, OclawMemoryContext, RunState, StandardMessage
|
||||
from oclaw.runtime.orchestration.trace import new_span_id
|
||||
from runtime.chat.turn_types import TurnRunOutcome
|
||||
from runtime.agent_core_attempt import ALL_ATTEMPT_ERROR_CODES
|
||||
from runtime.agent_core_attempt import AttemptRunnerInput, run_attempt
|
||||
from runtime.memory_stage import compact_memory_context
|
||||
from runtime.types import AttemptState, OclawMemoryContext, RunState, StandardMessage
|
||||
from runtime.orchestration.trace import new_span_id
|
||||
|
||||
_AGENT_CORE_OC_STAGE: dict[str, str] = {
|
||||
"run_started": "run_start",
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ from __future__ import annotations
|
|||
import os
|
||||
from typing import Any
|
||||
|
||||
from oclaw.runtime.agents.agent_scope import resolve_default_agent_id
|
||||
from oclaw.runtime.agents.network_ops_agent import NetworkOpsAgent
|
||||
from oclaw.runtime.agents.specialist_agent import SpecialistProfile
|
||||
from oclaw.runtime.agents.specialists import (
|
||||
from runtime.agents.agent_scope import resolve_default_agent_id
|
||||
from runtime.agents.network_ops_agent import NetworkOpsAgent
|
||||
from runtime.agents.specialist_agent import SpecialistProfile
|
||||
from runtime.agents.specialists import (
|
||||
AGENT_PROFILE_BINDINGS_KEY,
|
||||
normalize_specialist_id,
|
||||
agent_role_ids,
|
||||
|
|
@ -20,21 +20,21 @@ from oclaw.runtime.agents.specialists import (
|
|||
expert_name_for_specialist,
|
||||
parse_agent_profile_bindings,
|
||||
)
|
||||
from oclaw.runtime.chat.agent import Agent
|
||||
from oclaw.runtime.orchestration.inventory import inventory_snapshot
|
||||
from oclaw.runtime.orchestration.memory import upsert_knowledge_chunks
|
||||
from oclaw.platform.llm.chat_models import GoogleGeminiChatModel, OpenAIChatModel, RuleBasedChatModel, StaticTextChatModel
|
||||
from oclaw.platform.llm.transports.anthropic_messages import AnthropicMessagesModel
|
||||
from oclaw.platform.llm.transports.openai_responses import OpenAIResponsesModel
|
||||
from oclaw.platform.persistence.sqlite_store import (
|
||||
from runtime.chat.agent import Agent
|
||||
from runtime.orchestration.inventory import inventory_snapshot
|
||||
from runtime.orchestration.memory import upsert_knowledge_chunks
|
||||
from svc.llm.chat_models import GoogleGeminiChatModel, OpenAIChatModel, RuleBasedChatModel, StaticTextChatModel
|
||||
from svc.llm.transports.anthropic_messages import AnthropicMessagesModel
|
||||
from svc.llm.transports.openai_responses import OpenAIResponsesModel
|
||||
from svc.persistence.sqlite_store import (
|
||||
SqliteStore,
|
||||
active_llm_profile_setting_key,
|
||||
agent_profile_bindings_setting_key,
|
||||
is_administrator_model_pool,
|
||||
)
|
||||
from oclaw.runtime.prompt_templates import render_prompt
|
||||
from oclaw.runtime.tools.catalog import default_registry
|
||||
from oclaw.runtime.tools.plugin_loader import sync_plugin_metadata
|
||||
from runtime.prompt_templates import render_prompt
|
||||
from runtime.tools.catalog import default_registry
|
||||
from runtime.tools.plugin_loader import sync_plugin_metadata
|
||||
|
||||
|
||||
def _openai_missing_key_user_message(lang: str) -> str:
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ from __future__ import annotations
|
|||
|
||||
from typing import Any
|
||||
|
||||
from oclaw.runtime.chat.agent import Agent
|
||||
from oclaw.runtime.agent_context import build_role_system_context
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from oclaw.runtime.tools import default_registry
|
||||
from runtime.chat.agent import Agent
|
||||
from runtime.agent_context import build_role_system_context
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
from runtime.tools import default_registry
|
||||
|
||||
# Ops 专家走与 specialists 相同的工作区框架:runtime/workspaces/ops/{SOUL,ROLE_SYSTEM}.md
|
||||
NETWORK_SYSTEM_PROMPT_ZH = build_role_system_context("ops")
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ from collections.abc import Callable
|
|||
from dataclasses import dataclass, field
|
||||
from typing import Any, Optional
|
||||
|
||||
from oclaw.runtime.chat.agent import Agent
|
||||
from oclaw.runtime.chat.agent import GenerationInterrupted
|
||||
from oclaw.runtime.agents.network_ops_agent import NetworkOpsAgent
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from oclaw.platform.llm.image_legacy_client import (
|
||||
from runtime.chat.agent import Agent
|
||||
from runtime.chat.agent import GenerationInterrupted
|
||||
from runtime.agents.network_ops_agent import NetworkOpsAgent
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
from svc.llm.image_legacy_client import (
|
||||
IMAGE_SPECIALIST_DEFAULT_PROMPT_ZH,
|
||||
collect_legacy_lane_images_from_attachments,
|
||||
collect_legacy_lane_images_with_session_fallback,
|
||||
|
|
@ -21,19 +21,19 @@ from oclaw.platform.llm.image_legacy_client import (
|
|||
legacy_image_turn_bundle,
|
||||
send_legacy_image_messages,
|
||||
)
|
||||
from oclaw.platform.llm.video_generation_client import (
|
||||
from svc.llm.video_generation_client import (
|
||||
VIDEO_SPECIALIST_DEFAULT_PROMPT_ZH,
|
||||
legacy_video_assistant_body_with_placeholder,
|
||||
legacy_video_turn_bundle,
|
||||
send_video_generation_request,
|
||||
)
|
||||
from oclaw.runtime.tools import default_registry
|
||||
from oclaw.runtime.agents.specialists import expert_name_for_specialist
|
||||
from runtime.tools import default_registry
|
||||
from runtime.agents.specialists import expert_name_for_specialist
|
||||
|
||||
from oclaw.runtime.chat.turn_types import TurnRunOutcome
|
||||
from oclaw.runtime.relay_pointer import build_manifest_from_attachment_refs
|
||||
from oclaw.runtime.types import RelayShareEnvelope
|
||||
from oclaw.runtime.orchestration.protocol import (
|
||||
from runtime.chat.turn_types import TurnRunOutcome
|
||||
from runtime.relay_pointer import build_manifest_from_attachment_refs
|
||||
from runtime.types import RelayShareEnvelope
|
||||
from runtime.orchestration.protocol import (
|
||||
AgentTask,
|
||||
PlanStep,
|
||||
SpecialistDelivery,
|
||||
|
|
@ -361,8 +361,8 @@ class SpecialistAgentRunner:
|
|||
path_policy_tenant_id=_path_tenant,
|
||||
path_policy_user_id=_path_user,
|
||||
)
|
||||
from oclaw.runtime.gateway import OclawGateway
|
||||
from oclaw.runtime.types import StandardMessage
|
||||
from runtime.gateway import OclawGateway
|
||||
from runtime.types import StandardMessage
|
||||
|
||||
gw = OclawGateway(store=self.store)
|
||||
msg = StandardMessage(
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ from dataclasses import dataclass
|
|||
import json
|
||||
from typing import Any
|
||||
|
||||
from oclaw.runtime.agent_context import build_role_system_context
|
||||
from oclaw.runtime.workspaces.experts import specialist_registry_snapshot
|
||||
from runtime.agent_context import build_role_system_context
|
||||
from runtime.workspaces.experts import specialist_registry_snapshot
|
||||
|
||||
|
||||
SpecialistId = str
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ import hashlib
|
|||
import re
|
||||
from typing import Any
|
||||
|
||||
from oclaw.interfaces.channels.base import InboundMessage, OutboundMessage
|
||||
from oclaw.interfaces.channels.wecom.wecom_bridge import WeComAdapter
|
||||
from oclaw.runtime.types import normalize_interaction_mode, normalize_requested_specialist
|
||||
from interfaces.channels.base import InboundMessage, OutboundMessage
|
||||
from interfaces.channels.wecom.wecom_bridge import WeComAdapter
|
||||
from runtime.types import normalize_interaction_mode, normalize_requested_specialist
|
||||
|
||||
_CHANNEL_DISPATCH_INTERACTION_KEY_PREFIX = "channel.dispatch.interaction_mode."
|
||||
_CHANNEL_DISPATCH_SPECIALIST_KEY_PREFIX = "channel.dispatch.specialist."
|
||||
|
|
@ -36,7 +36,7 @@ def _resolve_channel_dispatch(store: Any, *, channel: str, account: dict[str, An
|
|||
|
||||
|
||||
def _build_admin_gateway_executor(store: Any, *, tenant_id: str, specialist: str, session_id: str) -> Any:
|
||||
from oclaw.runtime.agents.factory import build_gateway_executor
|
||||
from runtime.agents.factory import build_gateway_executor
|
||||
|
||||
return build_gateway_executor(
|
||||
store,
|
||||
|
|
@ -71,8 +71,8 @@ def _handle_productivity_commands(*, text: str, tenant_id: str, user_id: str) ->
|
|||
if t in ("帮助", "菜单", "help", "/help"):
|
||||
return _menu_text()
|
||||
|
||||
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
|
||||
|
||||
store = SqliteStore(db_path())
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ def _handle_productivity_commands(*, text: str, tenant_id: str, user_id: str) ->
|
|||
content = t[len("加知识 ") :].strip()
|
||||
if not content:
|
||||
return "知识内容不能为空。示例:加知识 办公室WiFi密码是12345678"
|
||||
from oclaw.runtime.tools.experts.productivity.kb_tools import kb_add_tool
|
||||
from runtime.tools.experts.productivity.kb_tools import kb_add_tool
|
||||
|
||||
res = kb_add_tool().handler({"tenant_id": tenant_id, "user_id": user_id, "text": content})
|
||||
if not res.get("ok"):
|
||||
|
|
@ -125,7 +125,7 @@ def _handle_productivity_commands(*, text: str, tenant_id: str, user_id: str) ->
|
|||
q = t[len("查知识 ") :].strip()
|
||||
if not q:
|
||||
return "请提供关键词。示例:查知识 WiFi 密码"
|
||||
from oclaw.runtime.tools.experts.productivity.kb_tools import kb_search_tool
|
||||
from runtime.tools.experts.productivity.kb_tools import kb_search_tool
|
||||
|
||||
res = kb_search_tool().handler({"tenant_id": tenant_id, "query": q, "limit": 5})
|
||||
if not res.get("ok"):
|
||||
|
|
@ -202,7 +202,7 @@ def _ensure_administrator_owner(store: Any) -> dict[str, Any] | None:
|
|||
user = store.get_user_by_username(tenant_id=tenant_id, username="administrator")
|
||||
if not user:
|
||||
try:
|
||||
from oclaw.platform.config.passwords import load_expected_password
|
||||
from svc.config.passwords import load_expected_password
|
||||
except Exception:
|
||||
load_expected_password = None # type: ignore
|
||||
pwd = load_expected_password(store) if callable(load_expected_password) else None
|
||||
|
|
@ -366,7 +366,7 @@ def _collect_recent_tool_attachments(*, store: Any, session_id: str) -> list[dic
|
|||
def _maybe_add_media_path_for_wechat_reply(reply: dict[str, Any]) -> None:
|
||||
"""For wechat/weixin sidecar, prefer a local file path for media send."""
|
||||
try:
|
||||
from oclaw.platform.files.attachment_assets import AttachmentAssetStore
|
||||
from svc.files.attachment_assets import AttachmentAssetStore
|
||||
except Exception:
|
||||
return
|
||||
if not isinstance(reply, dict):
|
||||
|
|
@ -421,7 +421,7 @@ def _maybe_expand_reply_attachments_for_channel(reply: dict[str, Any]) -> None:
|
|||
try:
|
||||
import base64
|
||||
|
||||
from oclaw.platform.files.attachment_assets import AttachmentAssetStore
|
||||
from svc.files.attachment_assets import AttachmentAssetStore
|
||||
except Exception:
|
||||
return
|
||||
ast = AttachmentAssetStore()
|
||||
|
|
@ -495,7 +495,7 @@ def _should_suppress_channel_reply(*, channel: str, text: str) -> bool:
|
|||
|
||||
|
||||
def process_inbound_payload(payload: dict[str, Any]) -> dict[str, Any]:
|
||||
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()
|
||||
channel_name = str(payload.get("channel") or "wecom").strip().lower()
|
||||
|
|
@ -505,8 +505,8 @@ def process_inbound_payload(payload: dict[str, Any]) -> dict[str, Any]:
|
|||
else:
|
||||
adapter = None
|
||||
inbound = _parse_generic_inbound(channel_name, payload)
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from oclaw.platform.config.paths import db_path
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
from svc.config.paths import db_path
|
||||
|
||||
store = SqliteStore(db_path())
|
||||
if channel_name == "wecom":
|
||||
|
|
@ -567,8 +567,8 @@ def process_inbound_payload(payload: dict[str, Any]) -> dict[str, Any]:
|
|||
if not ident:
|
||||
reply = "账号初始化失败,请检查 administrator/tenant 配置。"
|
||||
if ident:
|
||||
from oclaw.runtime.orchestration.policy import ActionPolicyContext, PolicyEngine
|
||||
from oclaw.runtime.orchestration.security import has_explicit_confirmation_token
|
||||
from runtime.orchestration.policy import ActionPolicyContext, PolicyEngine
|
||||
from runtime.orchestration.security import has_explicit_confirmation_token
|
||||
|
||||
tenant_id = str(ident.get("tenant_id") or "")
|
||||
user_id = str(ident.get("user_id") or "")
|
||||
|
|
@ -630,8 +630,8 @@ def process_inbound_payload(payload: dict[str, Any]) -> dict[str, Any]:
|
|||
user_text = (inbound.text or "").strip()
|
||||
if user_text:
|
||||
try:
|
||||
from oclaw.runtime.gateway import OclawGateway
|
||||
from oclaw.runtime.types import StandardMessage
|
||||
from runtime.gateway import OclawGateway
|
||||
from runtime.types import StandardMessage
|
||||
|
||||
interaction_mode, selected_specialist = _resolve_channel_dispatch(
|
||||
store, channel=inbound.channel, account=account
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ from collections.abc import Callable
|
|||
from dataclasses import dataclass
|
||||
from typing import Any, Optional
|
||||
|
||||
from oclaw.runtime.tools.base import ToolRegistry
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from oclaw.platform.llm.chat_models import (
|
||||
from runtime.tools.base import ToolRegistry
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
from svc.llm.chat_models import (
|
||||
ChatModel,
|
||||
LLMResponse,
|
||||
LLMToolCall,
|
||||
|
|
@ -22,8 +22,8 @@ from oclaw.platform.llm.chat_models import (
|
|||
build_default_model,
|
||||
gemini_openai_compat_client,
|
||||
)
|
||||
from oclaw.runtime.prompt_templates import render_prompt_for_lang
|
||||
from oclaw.runtime.tools.tool_validation import validate_tool_arguments
|
||||
from runtime.prompt_templates import render_prompt_for_lang
|
||||
from runtime.tools.tool_validation import validate_tool_arguments
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -81,13 +81,13 @@ class Agent:
|
|||
|
||||
def _format_ollama_failure_banner(self, exc: BaseException) -> str:
|
||||
# Backward compat wrapper; implementation lives in `src.chat.agent_errors`.
|
||||
from oclaw.runtime.chat.agent_errors import format_ollama_failure_banner
|
||||
from runtime.chat.agent_errors import format_ollama_failure_banner
|
||||
|
||||
return format_ollama_failure_banner(lang=self.lang, exc=exc)
|
||||
|
||||
def _format_openai_transport_error(self, exc: BaseException) -> str:
|
||||
# Backward compat wrapper; implementation lives in `src.chat.agent_errors`.
|
||||
from oclaw.runtime.chat.agent_errors import format_openai_transport_error
|
||||
from runtime.chat.agent_errors import format_openai_transport_error
|
||||
|
||||
return format_openai_transport_error(lang=self.lang, exc=exc)
|
||||
|
||||
|
|
@ -197,8 +197,8 @@ class Agent:
|
|||
interaction_mode: str | None = None,
|
||||
selected_specialist: str | None = None,
|
||||
) -> str:
|
||||
from oclaw.runtime.gateway import OclawGateway
|
||||
from oclaw.runtime.types import StandardMessage
|
||||
from runtime.gateway import OclawGateway
|
||||
from runtime.types import StandardMessage
|
||||
|
||||
tenant_id = str(path_policy_tenant_id or "").strip()
|
||||
user_id = str(path_policy_user_id or "").strip()
|
||||
|
|
@ -256,7 +256,7 @@ class Agent:
|
|||
return str(res.reply_text or "")
|
||||
|
||||
def _build_llm_messages(self, session_id: str) -> list[dict[str, Any]]:
|
||||
from oclaw.runtime.chat.agent_messages import build_llm_messages
|
||||
from runtime.chat.agent_messages import build_llm_messages
|
||||
|
||||
msgs = self.store.get_messages(session_id=session_id, limit=self.config.max_messages)
|
||||
trunc_raw = str(self.store.get_setting("AIA_TOOL_CONTEXT_TRUNCATE_ENABLED") or "").strip().lower()
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from __future__ import annotations
|
|||
"""
|
||||
|
||||
from typing import Any
|
||||
from oclaw.runtime.prompt_templates import render_prompt
|
||||
from runtime.prompt_templates import render_prompt
|
||||
|
||||
|
||||
def format_ollama_failure_banner(*, lang: str, exc: BaseException) -> str:
|
||||
|
|
|
|||
|
|
@ -13,12 +13,12 @@ import os
|
|||
import re
|
||||
from typing import Any
|
||||
|
||||
from oclaw.platform.llm.chat_models import _normalize_image_b64_payload, gemini_openai_compat_client, ChatModel
|
||||
from oclaw.runtime.chat.media_redact import redact_embedded_image_blobs
|
||||
from oclaw.runtime.chat.tool_runtime import tool_llm_message_max_chars, truncate_tool_result_for_llm_messages
|
||||
from oclaw.runtime.prompt_templates import render_prompt
|
||||
from oclaw.platform.files.attachment_assets import attachment_id_to_data_url
|
||||
from oclaw.runtime.relay_pointer import parse_pointer_uri
|
||||
from svc.llm.chat_models import _normalize_image_b64_payload, gemini_openai_compat_client, ChatModel
|
||||
from runtime.chat.media_redact import redact_embedded_image_blobs
|
||||
from runtime.chat.tool_runtime import tool_llm_message_max_chars, truncate_tool_result_for_llm_messages
|
||||
from runtime.prompt_templates import render_prompt
|
||||
from svc.files.attachment_assets import attachment_id_to_data_url
|
||||
from runtime.relay_pointer import parse_pointer_uri
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
_THINK_BLOCK_RE = re.compile(r"<think>\s*(.*?)\s*</think>\s*", flags=re.IGNORECASE | re.DOTALL)
|
||||
|
|
@ -207,7 +207,7 @@ def build_llm_messages(
|
|||
|
||||
When ``active_turn_uuid`` matches a tool/user row ``turn_uuid``, that turn is treated as the
|
||||
in-flight MCP turn: tool JSON is not stripped of nested image payloads here (see also
|
||||
:func:`~oclaw.runtime.direct_loop._guard_tool_results_for_llm_context`). Omit or leave empty
|
||||
:func:`~runtime.direct_loop._guard_tool_results_for_llm_context`). Omit or leave empty
|
||||
to apply image-blob stripping for every tool row (safe default for callers without turn context).
|
||||
|
||||
Only the **last** user message may expand attachments into native multimodal ``input_image``
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import json
|
|||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
from oclaw.runtime.chat.media_redact import redact_embedded_image_blobs
|
||||
from oclaw.runtime.direct_loop import (
|
||||
from runtime.chat.media_redact import redact_embedded_image_blobs
|
||||
from runtime.direct_loop import (
|
||||
_OCLAW_TOOL_RESULT_HARD_CAP_CHARS,
|
||||
_image_tool_result_replay_cap_chars,
|
||||
_video_tool_result_replay_cap_chars,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from __future__ import annotations
|
|||
import base64
|
||||
import os
|
||||
from typing import Any
|
||||
from oclaw.platform.files.attachment_assets import AttachmentAssetStore
|
||||
from svc.files.attachment_assets import AttachmentAssetStore
|
||||
|
||||
_IMAGE_CONTENT_TYPES = frozenset({"image", "input_image"})
|
||||
_BASE64_PAYLOAD_KEYS = ("data", "image_base64", "base64", "content_base64", "body_base64")
|
||||
|
|
|
|||
|
|
@ -17,16 +17,16 @@ from concurrent.futures import TimeoutError as FuturesTimeoutError
|
|||
from dataclasses import dataclass
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from oclaw.runtime.tools.base import ToolRegistry
|
||||
from oclaw.platform.llm.chat_models import LLMToolCall
|
||||
from oclaw.runtime.tools.tool_validation import validate_tool_arguments
|
||||
from oclaw.runtime.chat.media_redact import ingest_embedded_image_blobs_as_refs
|
||||
from oclaw.runtime.tools.path_guard import (
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
from runtime.tools.base import ToolRegistry
|
||||
from svc.llm.chat_models import LLMToolCall
|
||||
from runtime.tools.tool_validation import validate_tool_arguments
|
||||
from runtime.chat.media_redact import ingest_embedded_image_blobs_as_refs
|
||||
from runtime.tools.path_guard import (
|
||||
workspace_path_access_scope,
|
||||
workspace_write_namespace_scope,
|
||||
)
|
||||
from oclaw.runtime.chat.tool_invocation_context import tool_workspace_lane_scope
|
||||
from runtime.chat.tool_invocation_context import tool_workspace_lane_scope
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
_tool_exec_log = logging.getLogger("oclaw.tool_exec")
|
||||
|
|
@ -628,7 +628,7 @@ class ToolExecutor:
|
|||
if not ctx.trace_id:
|
||||
return
|
||||
try:
|
||||
from oclaw.runtime.orchestration.trace import new_span_id
|
||||
from runtime.orchestration.trace import new_span_id
|
||||
|
||||
ctx.store.add_trace_event(
|
||||
session_id=ctx.session_id,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from oclaw.runtime.agent_core_run import AgentCoreRunInput, run_agent_core
|
||||
from oclaw.runtime.direct_loop import run_direct_loop
|
||||
from oclaw.runtime.memory_stage import build_memory_context
|
||||
from runtime.agent_core_run import AgentCoreRunInput, run_agent_core
|
||||
from runtime.direct_loop import run_direct_loop
|
||||
from runtime.memory_stage import build_memory_context
|
||||
|
||||
__all__ = ["AgentCoreRunInput", "run_agent_core", "run_direct_loop", "build_memory_context"]
|
||||
|
||||
|
|
|
|||
|
|
@ -12,20 +12,20 @@ from pathlib import Path
|
|||
from types import SimpleNamespace
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
from oclaw.runtime.chat.agent_messages import build_llm_messages, get_last_build_llm_messages_stats
|
||||
from oclaw.runtime.chat.media_redact import redact_embedded_image_blobs
|
||||
from oclaw.runtime.chat.tool_runtime import ToolExecutionConfig
|
||||
from oclaw.runtime.chat.turn_types import TurnRunOutcome
|
||||
from oclaw.runtime.skill_executor import SkillExecutionContext, SkillExecutor
|
||||
from oclaw.runtime.skills import build_skill_manifest
|
||||
from oclaw.platform.llm.chat_models import ChatModel
|
||||
from oclaw.runtime.system_prompt import build_oclaw_executor_system_prompt
|
||||
from oclaw.runtime.types import OclawMemoryContext
|
||||
from oclaw.runtime.orchestration.trace import new_span_id
|
||||
from oclaw.runtime.tools.base import ToolRegistry
|
||||
from oclaw.runtime.hooks_runtime import trigger_hook_event
|
||||
from oclaw.runtime.dsml_tool_parse import strip_first_dsml_tool_calls_block, try_parse_deepseek_v4_dsml_tool_calls
|
||||
from oclaw.runtime.tools.experts.network_ops.netx_tools import ops_netx_system_context_extension
|
||||
from runtime.chat.agent_messages import build_llm_messages, get_last_build_llm_messages_stats
|
||||
from runtime.chat.media_redact import redact_embedded_image_blobs
|
||||
from runtime.chat.tool_runtime import ToolExecutionConfig
|
||||
from runtime.chat.turn_types import TurnRunOutcome
|
||||
from runtime.skill_executor import SkillExecutionContext, SkillExecutor
|
||||
from runtime.skills import build_skill_manifest
|
||||
from svc.llm.chat_models import ChatModel
|
||||
from runtime.system_prompt import build_oclaw_executor_system_prompt
|
||||
from runtime.types import OclawMemoryContext
|
||||
from runtime.orchestration.trace import new_span_id
|
||||
from runtime.tools.base import ToolRegistry
|
||||
from runtime.hooks_runtime import trigger_hook_event
|
||||
from runtime.dsml_tool_parse import strip_first_dsml_tool_calls_block, try_parse_deepseek_v4_dsml_tool_calls
|
||||
from runtime.tools.experts.network_ops.netx_tools import ops_netx_system_context_extension
|
||||
|
||||
_OCLAW_TOOL_RESULT_HARD_CAP_CHARS = 24_000
|
||||
_OCLAW_ATTACHMENT_TEXT_REPLAY_CAP_CHARS = 4_000
|
||||
|
|
@ -726,7 +726,7 @@ def _prepare_llm_tools(
|
|||
raw_llm_tools = [s.as_openai_tool() for s in skill_specs]
|
||||
else:
|
||||
raw_llm_tools = tools.as_openai_tools()
|
||||
from oclaw.runtime.tools.exposure_plan import build_llm_tools_plan
|
||||
from runtime.tools.exposure_plan import build_llm_tools_plan
|
||||
|
||||
plan = build_llm_tools_plan(
|
||||
store=store,
|
||||
|
|
@ -1136,7 +1136,7 @@ def _maybe_image_specialist_legacy_gateway_turn(
|
|||
) -> TurnRunOutcome | None:
|
||||
"""When the UI selects **image** specialist, skip Responses/chat-model transports.
|
||||
|
||||
Vision/gen HTTP goes through :func:`oclaw.platform.llm.image_legacy_client.send_legacy_image_messages`
|
||||
Vision/gen HTTP goes through :func:`svc.llm.image_legacy_client.send_legacy_image_messages`
|
||||
(``/chat/completions`` lane). Disable with ``AIA_IMAGE_SPECIALIST_DISABLE_LEGACY_GATEWAY_LANE=1``.
|
||||
|
||||
End-to-end notes and safe edit boundaries: ``docs/IMAGE_SPECIALIST_LANE.md``.
|
||||
|
|
@ -1151,7 +1151,7 @@ def _maybe_image_specialist_legacy_gateway_turn(
|
|||
if str(skill_binding_role or "").strip().lower() != "image":
|
||||
return None
|
||||
|
||||
from oclaw.platform.llm.image_legacy_client import (
|
||||
from svc.llm.image_legacy_client import (
|
||||
IMAGE_SPECIALIST_DEFAULT_PROMPT_ZH,
|
||||
collect_legacy_lane_images_with_session_fallback,
|
||||
legacy_image_assistant_body_with_placeholder,
|
||||
|
|
@ -1241,7 +1241,7 @@ def _maybe_video_specialist_legacy_gateway_turn(
|
|||
) -> TurnRunOutcome | None:
|
||||
"""When the UI selects **video** specialist, skip Responses/chat-model transports.
|
||||
|
||||
Uses DashScope async ``video-synthesis`` (see :mod:`oclaw.platform.llm.video_generation_client`).
|
||||
Uses DashScope async ``video-synthesis`` (see :mod:`svc.llm.video_generation_client`).
|
||||
With a user image (or session image fallback), sends ``input.img_url`` for **image-to-video**;
|
||||
otherwise **text-to-video**. Disable with ``AIA_VIDEO_SPECIALIST_DISABLE_LEGACY_GATEWAY_LANE=1``.
|
||||
"""
|
||||
|
|
@ -1255,8 +1255,8 @@ def _maybe_video_specialist_legacy_gateway_turn(
|
|||
if str(skill_binding_role or "").strip().lower() != "video":
|
||||
return None
|
||||
|
||||
from oclaw.platform.llm.image_legacy_client import collect_legacy_lane_images_with_session_fallback
|
||||
from oclaw.platform.llm.video_generation_client import (
|
||||
from svc.llm.image_legacy_client import collect_legacy_lane_images_with_session_fallback
|
||||
from svc.llm.video_generation_client import (
|
||||
VIDEO_SPECIALIST_DEFAULT_PROMPT_ZH,
|
||||
legacy_video_assistant_body_with_placeholder,
|
||||
legacy_video_turn_bundle,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import re
|
|||
import uuid
|
||||
from typing import Any
|
||||
|
||||
from oclaw.platform.llm.transports.base import LLMToolCall
|
||||
from svc.llm.transports.base import LLMToolCall
|
||||
|
||||
# Official DeepSeek-V4 DSML token uses FULLWIDTH VERTICAL LINE (U+FF5C).
|
||||
_DSML_PIPE = "\uFF5C"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from .api import build_anthropic_provider
|
||||
from oclaw.runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
from runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
|
||||
|
||||
PLUGIN_ID = "anthropic"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from .api import build_deepseek_provider
|
||||
from oclaw.runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
from runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
|
||||
PROVIDER_ID = "deepseek"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from oclaw.runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
from runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
|
||||
from .api import list_runtime_image_generation_providers
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from .api import build_kimi_coding_provider
|
||||
from oclaw.runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
from runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
|
||||
PLUGIN_ID = "kimi"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from oclaw.runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
from runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
|
||||
PLUGIN_ID = "memory-core"
|
||||
PLUGIN_NAME = "Memory (Core)"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from oclaw.runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
from runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
|
||||
__all__ = ["PluginEntry", "define_plugin_entry"]
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
import html
|
||||
import re
|
||||
|
||||
from oclaw.runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
from runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
|
||||
PROMPT_INJECTION_PATTERNS = (
|
||||
re.compile(r"ignore (all|any|previous|above|prior) instructions", re.I),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from oclaw.runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
from runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
from .api import build_plugin_config_schema, build_wiki_tool_specs
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from .api import (
|
|||
build_openai_image_generation_provider,
|
||||
build_openai_provider,
|
||||
)
|
||||
from oclaw.runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
from runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
|
||||
|
||||
def register_openai_plugin(api) -> None:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from oclaw.runtime.extensions.api.plugin_api import PluginApi, PluginEntry, PluginLogger, PluginRuntime, define_plugin_entry
|
||||
from runtime.extensions.api.plugin_api import PluginApi, PluginEntry, PluginLogger, PluginRuntime, define_plugin_entry
|
||||
|
||||
__all__ = ["PluginApi", "PluginEntry", "PluginLogger", "PluginRuntime", "define_plugin_entry"]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from .api import QWEN_BASE_URL, build_qwen_provider
|
||||
from oclaw.runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
from runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
|
||||
PROVIDER_ID = "qwen"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from .api import telegram_plugin
|
||||
from oclaw.runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
from runtime.extensions.plugin_api import PluginEntry, define_plugin_entry
|
||||
|
||||
|
||||
def register_telegram_channel(api) -> None:
|
||||
|
|
|
|||
|
|
@ -10,39 +10,39 @@ from dataclasses import dataclass
|
|||
from pathlib import Path
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
from oclaw.runtime.agents.factory import build_ephemeral_executor
|
||||
from oclaw.runtime.hooks.eligibility_from_metadata import hook_eligibility_from_message_metadata
|
||||
from oclaw.runtime.hooks_runtime import (
|
||||
from runtime.agents.factory import build_ephemeral_executor
|
||||
from runtime.hooks.eligibility_from_metadata import hook_eligibility_from_message_metadata
|
||||
from runtime.hooks_runtime import (
|
||||
get_active_hooks_config,
|
||||
initialize_hooks_runtime,
|
||||
trigger_hook_event,
|
||||
)
|
||||
from oclaw.runtime.relay_pointer import summarize_relay_ttl
|
||||
from oclaw.runtime.skills import build_skill_manifest
|
||||
from oclaw.runtime.prompt_prebuild import get_manager_prompt_prebuild
|
||||
from oclaw.runtime.types import (
|
||||
from runtime.relay_pointer import summarize_relay_ttl
|
||||
from runtime.skills import build_skill_manifest
|
||||
from runtime.prompt_prebuild import get_manager_prompt_prebuild
|
||||
from runtime.types import (
|
||||
OclawSessionContext,
|
||||
StandardMessage,
|
||||
normalize_interaction_mode,
|
||||
normalize_requested_specialist,
|
||||
)
|
||||
from oclaw.platform.config.paths import PROJECT_ROOT
|
||||
from oclaw.runtime.prompt_templates import render_prompt
|
||||
from svc.config.paths import PROJECT_ROOT
|
||||
from runtime.prompt_templates import render_prompt
|
||||
|
||||
from oclaw.runtime.command_parser import parse_internal_command
|
||||
from oclaw.runtime.core.agent_execution import AgentCoreRunInput, build_memory_context, run_agent_core
|
||||
from oclaw.runtime.router import decide_route
|
||||
from oclaw.runtime.worker import ensure_worker_started
|
||||
from oclaw.runtime.orchestration.trace import new_span_id, new_trace_id
|
||||
from oclaw.runtime.chat.tool_runtime import compact_turn_tool_messages_for_storage
|
||||
from oclaw.runtime.chat.model_path_audit import ensure_no_tool_or_embedded_image_payload
|
||||
from oclaw.runtime.session_auto_title import (
|
||||
from runtime.command_parser import parse_internal_command
|
||||
from runtime.core.agent_execution import AgentCoreRunInput, build_memory_context, run_agent_core
|
||||
from runtime.router import decide_route
|
||||
from runtime.worker import ensure_worker_started
|
||||
from runtime.orchestration.trace import new_span_id, new_trace_id
|
||||
from runtime.chat.tool_runtime import compact_turn_tool_messages_for_storage
|
||||
from runtime.chat.model_path_audit import ensure_no_tool_or_embedded_image_payload
|
||||
from runtime.session_auto_title import (
|
||||
AUTO_TITLE_SYSTEM_PROMPT_EN,
|
||||
AUTO_TITLE_SYSTEM_PROMPT_ZH,
|
||||
finalize_auto_title,
|
||||
)
|
||||
from oclaw.runtime.tools.base import ToolRegistry
|
||||
from oclaw.runtime.tools.public.local_sdk import local_adapter_startup_self_check
|
||||
from runtime.tools.base import ToolRegistry
|
||||
from runtime.tools.public.local_sdk import local_adapter_startup_self_check
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -953,8 +953,8 @@ class OclawGateway:
|
|||
system_prompt_override = ""
|
||||
tools_override = None
|
||||
if interaction_mode == "expert":
|
||||
from oclaw.runtime.plan_agent_v2.gateway_adapter import evaluate_gateway_expert_turn_shadow
|
||||
from oclaw.runtime.plan_agent_v2.tool_specs import DEFAULT_SESSION_KEY, materialize_plan_mode_v2_tools
|
||||
from runtime.plan_agent_v2.gateway_adapter import evaluate_gateway_expert_turn_shadow
|
||||
from runtime.plan_agent_v2.tool_specs import DEFAULT_SESSION_KEY, materialize_plan_mode_v2_tools
|
||||
|
||||
execution_mode = str(base_metadata.get("execution_mode") or "agent").strip().lower()
|
||||
if execution_mode not in {"agent", "plan"}:
|
||||
|
|
@ -1022,7 +1022,7 @@ class OclawGateway:
|
|||
except Exception:
|
||||
plan_mode = ""
|
||||
if plan_mode == "plan":
|
||||
from oclaw.runtime.plan_agent_v2.tool_policy import filter_tools_for_mode
|
||||
from runtime.plan_agent_v2.tool_policy import filter_tools_for_mode
|
||||
|
||||
if isinstance(tools_override, ToolRegistry):
|
||||
filtered = filter_tools_for_mode(registry=tools_override, mode="plan")
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ For role-specific behavior, contributors can add files under `data/wiki/experts/
|
|||
#### Quick check
|
||||
|
||||
```bash
|
||||
python -m oclaw.runtime.operations hooks info session-bootstrap --workspace "D:/project/chatgpt/oclaw" --json
|
||||
python -m runtime.operations hooks info session-bootstrap --workspace "D:/project/chatgpt/oclaw" --json
|
||||
```
|
||||
|
||||
Expected key fields: `enabled_by_config=true`, `eligible=true`, `loadable=true`.
|
||||
|
|
@ -99,7 +99,7 @@ Legend: **Done** / **Partial** / **TODO**
|
|||
| package.json `openclaw.hooks` / `oclaw.hooks` | Done |
|
||||
| plugin hook dirs (`.codex-plugin` + `hooks`) | Done |
|
||||
| legacy `hooks.internal.handlers` | Done |
|
||||
| `hooks list/check/info` CLI (`python -m oclaw.runtime.operations hooks …`) | Done |
|
||||
| `hooks list/check/info` CLI (`python -m runtime.operations hooks …`) | Done |
|
||||
| `hooks enable` / `hooks disable` (config file patch) | Done |
|
||||
| install / update hook packs (npm/git; TS `install.ts` / `update.ts`) | Partial (`hooks install` / `hooks update` print deprecation + manual/OpenClaw guidance; no npm/git runner) |
|
||||
| gmail watcher family | Partial (config gates + ``initialize_hooks_runtime`` → ``start_gmail_watcher_with_logs``; ``gog``/API loop not ported). Set ``OCLAW_SKIP_GMAIL_WATCHER=1`` (or ``OPENCLAW_SKIP_GMAIL_WATCHER``) to no-op. |
|
||||
|
|
@ -122,14 +122,14 @@ pytest tests/test_oclaw_hooks_bundled_parity.py tests/test_oclaw_hooks_runtime.p
|
|||
### Operations CLI (from parent of this repo on `sys.path`, see `tests/conftest.py`)
|
||||
|
||||
```bash
|
||||
python -m oclaw.runtime.operations hooks list
|
||||
python -m oclaw.runtime.operations hooks list --eligible --verbose
|
||||
python -m oclaw.runtime.operations hooks check --json
|
||||
python -m oclaw.runtime.operations hooks info session-memory --workspace /path/to/workspace
|
||||
python -m oclaw.runtime.operations hooks enable session-memory --workspace /path/to/workspace
|
||||
python -m oclaw.runtime.operations hooks disable command-logger --workspace /path/to/workspace
|
||||
python -m oclaw.runtime.operations hooks install ./path-or-npm-spec # deprecated, exit 2 + hints
|
||||
python -m oclaw.runtime.operations hooks update --dry-run # deprecated, exit 2 + hints
|
||||
python -m runtime.operations hooks list
|
||||
python -m runtime.operations hooks list --eligible --verbose
|
||||
python -m runtime.operations hooks check --json
|
||||
python -m runtime.operations hooks info session-memory --workspace /path/to/workspace
|
||||
python -m runtime.operations hooks enable session-memory --workspace /path/to/workspace
|
||||
python -m runtime.operations hooks disable command-logger --workspace /path/to/workspace
|
||||
python -m runtime.operations hooks install ./path-or-npm-spec # deprecated, exit 2 + hints
|
||||
python -m runtime.operations hooks update --dry-run # deprecated, exit 2 + hints
|
||||
```
|
||||
|
||||
Uses the same merged config as the agent runtime (including skill `hooks/` extra dirs via `merge_skill_hook_extra_dirs_into_config`).
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ OCLAW_DIR = HOOKS_PY_DIR.parent
|
|||
if str(OCLAW_DIR) not in sys.path:
|
||||
sys.path.insert(0, str(OCLAW_DIR))
|
||||
|
||||
from oclaw.runtime.hooks.internal_hooks import create_hook_event, trigger_hook # noqa: E402
|
||||
from oclaw.runtime.hooks.loader import load_internal_hooks # noqa: E402
|
||||
from runtime.hooks.internal_hooks import create_hook_event, trigger_hook # noqa: E402
|
||||
from runtime.hooks.loader import load_internal_hooks # noqa: E402
|
||||
|
||||
|
||||
def main() -> int:
|
||||
|
|
|
|||
|
|
@ -122,8 +122,8 @@ def handle(event: Any) -> None:
|
|||
# Fetch recent messages from sqlite.
|
||||
try:
|
||||
_ensure_repo_imports()
|
||||
from oclaw.platform.config.paths import db_path # type: ignore
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore # type: ignore
|
||||
from svc.config.paths import db_path # type: ignore
|
||||
from svc.persistence.sqlite_store import SqliteStore # type: ignore
|
||||
|
||||
store = SqliteStore(db_path())
|
||||
msgs = store.get_messages(session_id=session_id, limit=max_msgs_n)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from oclaw.runtime.skills import discover_workspace_skill_manifests
|
||||
from runtime.skills import discover_workspace_skill_manifests
|
||||
|
||||
|
||||
def merge_skill_hook_extra_dirs_into_config(cfg: dict[str, Any]) -> dict[str, Any]:
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import os
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from oclaw.platform.config.paths import PROJECT_ROOT
|
||||
from svc.config.paths import PROJECT_ROOT
|
||||
|
||||
|
||||
def resolve_hooks_config_storage_path() -> Path:
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ from dataclasses import dataclass
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from oclaw.runtime.hooks.hook_types import HookEligibilityContext
|
||||
from oclaw.runtime.hooks.merge_skill_hook_dirs import merge_skill_hook_extra_dirs_into_config
|
||||
from oclaw.platform.config.paths import PROJECT_ROOT
|
||||
from oclaw.platform.config.runtime_paths import runtime_hooks_bundled_root
|
||||
from runtime.hooks.hook_types import HookEligibilityContext
|
||||
from runtime.hooks.merge_skill_hook_dirs import merge_skill_hook_extra_dirs_into_config
|
||||
from svc.config.paths import PROJECT_ROOT
|
||||
from svc.config.runtime_paths import runtime_hooks_bundled_root
|
||||
|
||||
|
||||
@dataclass
|
||||
|
|
@ -42,7 +42,7 @@ class _GmailWatcherLogAdapter:
|
|||
def _maybe_start_gmail_watcher_with_logs(resolved_cfg: dict[str, Any]) -> None:
|
||||
"""After hooks load: parity hook for OpenClaw gateway post-attach Gmail lifecycle."""
|
||||
try:
|
||||
from oclaw.runtime.hooks.gmail_watcher_lifecycle import start_gmail_watcher_with_logs
|
||||
from runtime.hooks.gmail_watcher_lifecycle import start_gmail_watcher_with_logs
|
||||
|
||||
start_gmail_watcher_with_logs(cfg=resolved_cfg, log=_GmailWatcherLogAdapter())
|
||||
except Exception:
|
||||
|
|
@ -128,7 +128,7 @@ def initialize_hooks_runtime(
|
|||
return int(_STATE.loaded_count or 0)
|
||||
try:
|
||||
oclaw_dir = _ensure_oclaw_path()
|
||||
from oclaw.runtime import hooks as hooks_mod # type: ignore
|
||||
from runtime import hooks as hooks_mod # type: ignore
|
||||
|
||||
bundled_dir = runtime_hooks_bundled_root()
|
||||
resolved_cfg = merge_skill_hook_extra_dirs_into_config(dict(cfg or resolve_runtime_config() or {}))
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ import json
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from oclaw.runtime.types import OclawMemoryContext
|
||||
from oclaw.runtime.orchestration.memory import semantic_retrieve, session_memory_digest
|
||||
from oclaw.runtime.prompt_templates import render_runtime_prompt
|
||||
from runtime.types import OclawMemoryContext
|
||||
from runtime.orchestration.memory import semantic_retrieve, session_memory_digest
|
||||
from runtime.prompt_templates import render_runtime_prompt
|
||||
|
||||
_SPECIALIST_FLAGS_SETTING_KEY = "AIA_CHAT_SPECIALIST_FLAGS_JSON"
|
||||
|
||||
|
|
@ -145,8 +145,8 @@ def after_turn_memory(
|
|||
assistant_text=assistant_text,
|
||||
)
|
||||
try:
|
||||
from oclaw.runtime.orchestration.memory import maybe_write_turn_memory
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from runtime.orchestration.memory import maybe_write_turn_memory
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
|
||||
if isinstance(store, SqliteStore):
|
||||
maybe_write_turn_memory(
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
from collections import defaultdict
|
||||
from typing import Any
|
||||
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
|
||||
|
||||
def log_eval_event(
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
|||
|
||||
from typing import Any
|
||||
|
||||
from oclaw.runtime.tools import tool_inventory
|
||||
from runtime.tools import tool_inventory
|
||||
|
||||
|
||||
def inventory_snapshot() -> dict[str, Any]:
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ import re
|
|||
import uuid
|
||||
from typing import Any
|
||||
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from oclaw.platform.embeddings.embedding_client import build_default_embedding_client
|
||||
from oclaw.runtime.orchestration.vector_store import (
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
from svc.embeddings.embedding_client import build_default_embedding_client
|
||||
from runtime.orchestration.vector_store import (
|
||||
MemoryVectorItem,
|
||||
read_vector_memory_runtime,
|
||||
semantic_search,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
|||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from oclaw.runtime.orchestration.protocol import AgentTask
|
||||
from runtime.orchestration.protocol import AgentTask
|
||||
|
||||
_HIGH_RISK_ACTIONS = ("删除", "drop", "重启", "批量", "扫描", "写入", "变更")
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
|||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
import time
|
||||
from typing import Any
|
||||
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
|
||||
|
||||
class ToolAuditAdapter:
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ from dataclasses import dataclass
|
|||
from datetime import datetime, timezone
|
||||
from typing import Any, Protocol
|
||||
|
||||
from oclaw.platform.embeddings.embedding_client import EmbeddingClient
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from svc.embeddings.embedding_client import EmbeddingClient
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
|
||||
|
||||
def _utc_now_iso() -> str:
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
from typing import Any
|
||||
|
||||
from .adapter import PlanAgentV2Decision
|
||||
from oclaw.runtime.gateway import OclawGatewayResult
|
||||
from runtime.gateway import OclawGatewayResult
|
||||
|
||||
|
||||
def legacy_gateway_result_keys() -> set[str]:
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from typing import Any
|
|||
|
||||
from .adapter import PlanAgentV2Decision, evaluate_for_expert_mode
|
||||
from .switch import should_route_to_v2
|
||||
from oclaw.runtime.types import StandardMessage
|
||||
from runtime.types import StandardMessage
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
from typing import Iterable
|
||||
|
||||
from .models import PLAN_MODE_PLAN
|
||||
from oclaw.runtime.tools.base import ToolRegistry, ToolSpec
|
||||
from runtime.tools.base import ToolRegistry, ToolSpec
|
||||
|
||||
|
||||
_DEFAULT_PLAN_ALLOWLIST = frozenset(
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from typing import Any
|
|||
from .manager import PlanModeManagerV2
|
||||
from .models import PLAN_MODE_PLAN
|
||||
from .trace import emit_plan_agent_v2_trace
|
||||
from oclaw.runtime.tools.base import ToolSpec
|
||||
from runtime.tools.base import ToolSpec
|
||||
|
||||
DEFAULT_SESSION_KEY = "AIA_PLAN_AGENT_V2_DEFAULT_SESSION_ID"
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ def emit_plan_agent_v2_trace(
|
|||
merged.setdefault("pipeline", "plan_agent_v2")
|
||||
merged.setdefault("ts_ms", int(time.time() * 1000))
|
||||
try:
|
||||
from oclaw.runtime.orchestration.trace import new_span_id
|
||||
from runtime.orchestration.trace import new_span_id
|
||||
|
||||
store.add_trace_event(
|
||||
session_id=str(session_id or ""),
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from oclaw.runtime.plan_agent_v2.adapter import * # noqa: F403
|
||||
from runtime.plan_agent_v2.adapter import * # noqa: F403
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from oclaw.runtime.plan_agent_v2.compat import * # noqa: F403
|
||||
from runtime.plan_agent_v2.compat import * # noqa: F403
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from oclaw.runtime.plan_agent_v2.gateway_adapter import * # noqa: F403
|
||||
from runtime.plan_agent_v2.gateway_adapter import * # noqa: F403
|
||||
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@ import uuid
|
|||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
from oclaw.runtime.gateway import OclawGatewayResult
|
||||
from oclaw.runtime.plan_agent_v2 import (
|
||||
from runtime.gateway import OclawGatewayResult
|
||||
from runtime.plan_agent_v2 import (
|
||||
build_shadow_gateway_result,
|
||||
evaluate_gateway_expert_turn_shadow,
|
||||
)
|
||||
from oclaw.runtime.types import StandardMessage
|
||||
from runtime.types import StandardMessage
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from oclaw.runtime.plan_agent_v2.manager import * # noqa: F403
|
||||
from runtime.plan_agent_v2.manager import * # noqa: F403
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from oclaw.runtime.plan_agent_v2.models import * # noqa: F403
|
||||
from runtime.plan_agent_v2.models import * # noqa: F403
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from oclaw.runtime.plan_agent_v2.prompt_injector import * # noqa: F403
|
||||
from runtime.plan_agent_v2.prompt_injector import * # noqa: F403
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from oclaw.runtime.plan_agent_v2.state_store import * # noqa: F403
|
||||
from runtime.plan_agent_v2.state_store import * # noqa: F403
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from oclaw.runtime.plan_agent_v2.switch import * # noqa: F403
|
||||
from runtime.plan_agent_v2.switch import * # noqa: F403
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from oclaw.runtime.plan_agent_v2.tool_policy import * # noqa: F403
|
||||
from runtime.plan_agent_v2.tool_policy import * # noqa: F403
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from oclaw.runtime.plan_agent_v2.tool_specs import * # noqa: F403
|
||||
from runtime.plan_agent_v2.tool_specs import * # noqa: F403
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
from oclaw.runtime.plan_agent_v2.trace import * # noqa: F403
|
||||
from runtime.plan_agent_v2.trace import * # noqa: F403
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ import os
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from oclaw.runtime.agents.agent_scope import resolve_agent_id_by_workspace_path
|
||||
from oclaw.runtime.hooks_runtime import get_active_hooks_config, trigger_hook_event
|
||||
from oclaw.platform.config.paths import PROJECT_ROOT
|
||||
from oclaw.runtime.prompt_templates import render_runtime_prompt
|
||||
from runtime.agents.agent_scope import resolve_agent_id_by_workspace_path
|
||||
from runtime.hooks_runtime import get_active_hooks_config, trigger_hook_event
|
||||
from svc.config.paths import PROJECT_ROOT
|
||||
from runtime.prompt_templates import render_runtime_prompt
|
||||
|
||||
_PROJECT_CONTEXT_FILES: tuple[str, ...] = (
|
||||
"TOOLS.md",
|
||||
|
|
|
|||
|
|
@ -4,16 +4,16 @@ import threading
|
|||
import time
|
||||
from typing import Any
|
||||
|
||||
from oclaw.platform.config.paths import db_path
|
||||
from oclaw.platform.persistence.sqlite_store import SqliteStore
|
||||
from oclaw.runtime.agent_context import build_role_system_context
|
||||
from oclaw.runtime.agents.specialists import discover_specialist_ids
|
||||
from oclaw.runtime.direct_loop import tool_wire_freeze_status, warm_tool_wire_cache
|
||||
from oclaw.runtime.skill_role_binding import SKILL_ROLE_BINDING_KEY
|
||||
from oclaw.runtime.skills import workspace_skills_layout_signature
|
||||
from oclaw.runtime.system_prompt import get_executor_prompt_static, warm_executor_prompt_cache
|
||||
from oclaw.runtime.tools.catalog import default_registry
|
||||
from oclaw.runtime.workspaces.experts import expert_workspace_signature_token, list_experts
|
||||
from svc.config.paths import db_path
|
||||
from svc.persistence.sqlite_store import SqliteStore
|
||||
from runtime.agent_context import build_role_system_context
|
||||
from runtime.agents.specialists import discover_specialist_ids
|
||||
from runtime.direct_loop import tool_wire_freeze_status, warm_tool_wire_cache
|
||||
from runtime.skill_role_binding import SKILL_ROLE_BINDING_KEY
|
||||
from runtime.skills import workspace_skills_layout_signature
|
||||
from runtime.system_prompt import get_executor_prompt_static, warm_executor_prompt_cache
|
||||
from runtime.tools.catalog import default_registry
|
||||
from runtime.workspaces.experts import expert_workspace_signature_token, list_experts
|
||||
|
||||
_MANAGER_PREBUILD_CACHE_LOCK = threading.Lock()
|
||||
_MANAGER_PREBUILD_CACHE: dict[tuple[Any, ...], dict[str, Any]] = {}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ from functools import lru_cache
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from oclaw.platform.config.paths import PROJECT_ROOT
|
||||
from oclaw.runtime.prompt_templates.frontmatter import parse_markdown_document
|
||||
from svc.config.paths import PROJECT_ROOT
|
||||
from runtime.prompt_templates.frontmatter import parse_markdown_document
|
||||
|
||||
_VAR_RE = re.compile(r"\{\{\s*([a-zA-Z0-9_]+)\s*\}\}")
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from dataclasses import dataclass
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from oclaw.runtime.types import SharedAttachmentManifest, SharedFilePointer
|
||||
from runtime.types import SharedAttachmentManifest, SharedFilePointer
|
||||
|
||||
_SAFE_FILE_NAME = re.compile(r"^[A-Za-z0-9._-]{1,128}$")
|
||||
_SAFE_SCOPE_ID = re.compile(r"^[A-Za-z0-9._-]{1,128}$")
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ import os
|
|||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
|
||||
from oclaw.runtime.types import StandardMessage
|
||||
from oclaw.runtime.types import normalize_interaction_mode, normalize_requested_specialist
|
||||
from oclaw.runtime.prompt_templates import render_runtime_prompt
|
||||
from oclaw.runtime.chat.model_path_audit import ensure_no_tool_or_embedded_image_payload
|
||||
from runtime.types import StandardMessage
|
||||
from runtime.types import normalize_interaction_mode, normalize_requested_specialist
|
||||
from runtime.prompt_templates import render_runtime_prompt
|
||||
from runtime.chat.model_path_audit import ensure_no_tool_or_embedded_image_payload
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
|
|
|||
|
|
@ -3,16 +3,16 @@ from __future__ import annotations
|
|||
from dataclasses import dataclass
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
from oclaw.runtime.chat.tool_runtime import (
|
||||
from runtime.chat.tool_runtime import (
|
||||
ToolExecutionConfig,
|
||||
ToolExecutionContext,
|
||||
ToolExecutor,
|
||||
)
|
||||
from oclaw.runtime.hooks.hook_types import HookEligibilityContext
|
||||
from oclaw.runtime.hooks_runtime import get_active_hooks_config, initialize_hooks_runtime, trigger_hook_event
|
||||
from oclaw.runtime.orchestration.trace import new_span_id
|
||||
from oclaw.platform.llm.chat_models import LLMToolCall
|
||||
from oclaw.runtime.tools.base import ToolRegistry
|
||||
from runtime.hooks.hook_types import HookEligibilityContext
|
||||
from runtime.hooks_runtime import get_active_hooks_config, initialize_hooks_runtime, trigger_hook_event
|
||||
from runtime.orchestration.trace import new_span_id
|
||||
from svc.llm.chat_models import LLMToolCall
|
||||
from runtime.tools.base import ToolRegistry
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
|
|
|||
|
|
@ -17,19 +17,19 @@ from dataclasses import dataclass
|
|||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from oclaw.runtime.skills_market import get_market_adapter
|
||||
from oclaw.runtime.skill_role_binding import (
|
||||
from runtime.skills_market import get_market_adapter
|
||||
from runtime.skill_role_binding import (
|
||||
SKILL_ROLE_BINDING_ENABLED_SETTING,
|
||||
SKILL_ROLE_BINDING_KEY,
|
||||
normalize_skill_role_binding,
|
||||
ordered_binding_roles,
|
||||
)
|
||||
from oclaw.runtime.skills import (
|
||||
from runtime.skills import (
|
||||
default_skills_root,
|
||||
discover_workspace_skill_manifests,
|
||||
load_skill_manifest,
|
||||
)
|
||||
from oclaw.runtime.skills_workspace_lane import skills_home_containing_workspace_lane
|
||||
from runtime.skills_workspace_lane import skills_home_containing_workspace_lane
|
||||
|
||||
_DISABLED_SKILLS_KEY = "AIA_SKILL_DISABLED_NAMES"
|
||||
_AUTO_INSTALL_KEY = "AIA_SKILL_AUTO_INSTALL_ENABLED"
|
||||
|
|
@ -459,7 +459,7 @@ def _resolve_registry_archive_url(url: str) -> str:
|
|||
# Resolve via clawhub client first (matches test + avoids adapter drift).
|
||||
try:
|
||||
if len(segs) >= 2:
|
||||
from oclaw.runtime.tools.skills.clawhub_client import get_skill_detail
|
||||
from runtime.tools.skills.clawhub_client import get_skill_detail
|
||||
|
||||
slug = str(segs[-1] or "").strip()
|
||||
if slug:
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import json
|
|||
import os
|
||||
from typing import Any
|
||||
|
||||
from oclaw.runtime.agents.specialists import discover_specialist_ids
|
||||
from runtime.agents.specialists import discover_specialist_ids
|
||||
|
||||
SKILL_ROLE_BINDING_KEY = "skill_role_binding"
|
||||
SKILL_ROLE_BINDING_ENABLED_SETTING = "AIA_SKILL_ROLE_BINDING_ENABLED"
|
||||
|
|
@ -100,7 +100,7 @@ def allowed_workspace_skill_names_for_role(*, store: Any, role: str) -> set[str]
|
|||
r = str(role or "").strip().lower()
|
||||
if not r:
|
||||
return set()
|
||||
from oclaw.runtime.skills import discover_public_workspace_skill_names
|
||||
from runtime.skills import discover_public_workspace_skill_names
|
||||
|
||||
public = discover_public_workspace_skill_names()
|
||||
mapping = normalize_skill_role_binding(
|
||||
|
|
@ -122,7 +122,7 @@ def allowed_workspace_skill_names_for_role(*, store: Any, role: str) -> set[str]
|
|||
|
||||
|
||||
def _all_installed_skill_names(store: Any) -> set[str]:
|
||||
from oclaw.runtime.skills import discover_workspace_skill_manifests
|
||||
from runtime.skills import discover_workspace_skill_manifests
|
||||
|
||||
return {str(m.name).strip() for m in discover_workspace_skill_manifests() if str(m.name or "").strip()}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,17 +8,17 @@ from dataclasses import dataclass, field
|
|||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from oclaw.platform.config.paths import PROJECT_ROOT
|
||||
from oclaw.platform.config.runtime_paths import runtime_skills_root
|
||||
from oclaw.runtime.prompt_templates.frontmatter import parse_frontmatter_dict, split_markdown_frontmatter
|
||||
from oclaw.runtime.skill_manifest_core import (
|
||||
from svc.config.paths import PROJECT_ROOT
|
||||
from svc.config.runtime_paths import runtime_skills_root
|
||||
from runtime.prompt_templates.frontmatter import parse_frontmatter_dict, split_markdown_frontmatter
|
||||
from runtime.skill_manifest_core import (
|
||||
SkillInstallSpec,
|
||||
normalize_frontmatter,
|
||||
parse_skill_frontmatter,
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from oclaw.runtime.tools.base import ToolRegistry, ToolSpec
|
||||
from runtime.tools.base import ToolRegistry, ToolSpec
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
|
@ -221,7 +221,7 @@ def _allowed_tool_names_after_wire_policy(
|
|||
) -> tuple[set[str], list[str]]:
|
||||
raw = registry.as_openai_tools()
|
||||
try:
|
||||
from oclaw.platform.llm.tool_wire_policy import prepare_openai_tools_for_llm_api
|
||||
from svc.llm.tool_wire_policy import prepare_openai_tools_for_llm_api
|
||||
|
||||
prepared = prepare_openai_tools_for_llm_api(
|
||||
raw,
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@ from __future__ import annotations
|
|||
from dataclasses import dataclass
|
||||
from typing import Any, Protocol
|
||||
|
||||
from oclaw.runtime.tools.skills.clawhub_client import get_skill_detail, search_skills
|
||||
from oclaw.runtime.tools.skills.cocoloop_client import get_skill_detail_by_slug as cocoloop_get_skill_detail
|
||||
from oclaw.runtime.tools.skills.cocoloop_client import search_store_skills as cocoloop_search_skills
|
||||
from runtime.tools.skills.clawhub_client import get_skill_detail, search_skills
|
||||
from runtime.tools.skills.cocoloop_client import get_skill_detail_by_slug as cocoloop_get_skill_detail
|
||||
from runtime.tools.skills.cocoloop_client import search_store_skills as cocoloop_search_skills
|
||||
|
||||
|
||||
def normalize_skill_market_provider_setting(raw: str | None) -> str:
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue