chore: lint 修复(TC001/TC003 类型导入优化)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-06 23:15:06 -04:00
parent dc6f8e047e
commit c2ba3ed591
7 changed files with 31 additions and 30 deletions
+7 -11
View File
@@ -1,11 +1,13 @@
"""Agent 专属 Protocol 端口。"""
from __future__ import annotations
from typing import Any, Protocol, runtime_checkable
from typing import TYPE_CHECKING, Any, Protocol, runtime_checkable
import pluggy
from core.agent.types import LoopResult, Step
if TYPE_CHECKING:
from core.agent.types import LoopResult, Step
hookspec = pluggy.HookspecMarker("agent_loop")
hookimpl = pluggy.HookimplMarker("agent_loop")
@@ -27,19 +29,13 @@ class AgentLoopSpec:
"""
@hookspec
async def before_step(
self, iteration: int, messages: list[dict[str, Any]]
) -> None: ...
async def before_step(self, iteration: int, messages: list[dict[str, Any]]) -> None: ...
@hookspec
async def after_tool(
self, iteration: int, step: Step
) -> str | None: ...
async def after_tool(self, iteration: int, step: Step) -> str | None: ...
@hookspec
async def after_step(
self, iteration: int, messages: list[dict[str, Any]]
) -> None: ...
async def after_step(self, iteration: int, messages: list[dict[str, Any]]) -> None: ...
@hookspec
async def on_finish(self, result: LoopResult) -> None: ...
+1
View File
@@ -1,4 +1,5 @@
"""AgentLoop 数据类型。"""
from __future__ import annotations
from dataclasses import dataclass, field
+6 -3
View File
@@ -4,12 +4,15 @@ LLMProvider / VLMProvider / TelemetryRecorder 是跨子包共享接口,
被 core/agent/、core/evolution/、app/ 各模块引用。
adapters/ 提供具体实现。
"""
from __future__ import annotations
from pathlib import Path
from typing import Any, Protocol, runtime_checkable
from typing import TYPE_CHECKING, Any, Protocol, runtime_checkable
from core.types import LLMResponse
if TYPE_CHECKING:
from pathlib import Path
from core.types import LLMResponse
@runtime_checkable
+1
View File
@@ -1,4 +1,5 @@
"""跨模块共享类型。"""
from __future__ import annotations
from dataclasses import dataclass