Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
fix: add from __future__ import annotations across codebase
Tink6b3997c463df
diff --git a/nanobot/agent/context.py b/nanobot/agent/context.pyindex 6a43d3e91..905562a98 100644--- a/nanobot/agent/context.py+++ b/nanobot/agent/context.py@@ -1,5 +1,7 @@"""Context builder for assembling agent prompts."""+from __future__ import annotations+import base64import mimetypesimport platformdiff --git a/nanobot/agent/subagent.py b/nanobot/agent/subagent.pyindex f2d6ee5f2..20dbaede0 100644--- a/nanobot/agent/subagent.py+++ b/nanobot/agent/subagent.py@@ -1,5 +1,7 @@"""Subagent manager for background task execution."""+from __future__ import annotations+import asyncioimport jsonimport uuiddiff --git a/nanobot/agent/tools/base.py b/nanobot/agent/tools/base.pyindex 051fc9acf..ea5b66318 100644--- a/nanobot/agent/tools/base.py+++ b/nanobot/agent/tools/base.py@@ -1,5 +1,7 @@"""Base class for agent tools."""+from __future__ import annotations+from abc import ABC, abstractmethodfrom typing import Anydiff --git a/nanobot/agent/tools/cron.py b/nanobot/agent/tools/cron.pyindex f8e737b39..350e261f8 100644--- a/nanobot/agent/tools/cron.py+++ b/nanobot/agent/tools/cron.py@@ -1,5 +1,7 @@"""Cron tool for scheduling reminders and tasks."""+from __future__ import annotations+from contextvars import ContextVarfrom typing import Anydiff --git a/nanobot/agent/tools/filesystem.py b/nanobot/agent/tools/filesystem.pyindex 7b0b86725..c13464e69 100644--- a/nanobot/agent/tools/filesystem.py+++ b/nanobot/agent/tools/filesystem.py@@ -1,5 +1,7 @@"""File system tools: read, write, edit."""+from __future__ import annotations+import difflibfrom pathlib import Pathfrom typing import Anydiff --git a/nanobot/agent/tools/mcp.py b/nanobot/agent/tools/mcp.pyindex 2cbffd09d..dd6ce8c52 100644--- a/nanobot/agent/tools/mcp.py+++ b/nanobot/agent/tools/mcp.py@@ -1,5 +1,7 @@"""MCP client: connects to MCP servers and wraps their tools as native nanobot tools."""+from __future__ import annotations+import asynciofrom contextlib import AsyncExitStackfrom typing import Anydiff --git a/nanobot/agent/tools/message.py b/nanobot/agent/tools/message.pyindex 35e519a00..9d7cfbdca 100644--- a/nanobot/agent/tools/message.py+++ b/nanobot/agent/tools/message.py@@ -1,5 +1,7 @@"""Message tool for sending messages to users."""+from __future__ import annotations+from typing import Any, Awaitable, Callablefrom nanobot.agent.tools.base import Tooldiff --git a/nanobot/agent/tools/registry.py b/nanobot/agent/tools/registry.pyindex 5d36e52cd..6edb88e16 100644--- a/nanobot/agent/tools/registry.py+++ b/nanobot/agent/tools/registry.py@@ -1,5 +1,7 @@"""Tool registry for dynamic tool management."""+from __future__ import annotations+from typing import Anyfrom nanobot.agent.tools.base import Tooldiff --git a/nanobot/agent/tools/shell.py b/nanobot/agent/tools/shell.pyindex ce1992092..74d1923f5 100644--- a/nanobot/agent/tools/shell.py+++ b/nanobot/agent/tools/shell.py@@ -1,5 +1,7 @@"""Shell execution tool."""+from __future__ import annotations+import asyncioimport osimport rediff --git a/nanobot/agent/tools/spawn.py b/nanobot/agent/tools/spawn.pyindex fc62bf8df..935dd319f 100644--- a/nanobot/agent/tools/spawn.py+++ b/nanobot/agent/tools/spawn.py@@ -1,5 +1,7 @@"""Spawn tool for creating background subagents."""+from __future__ import annotations+from typing import TYPE_CHECKING, Anyfrom nanobot.agent.tools.base import Tooldiff --git a/nanobot/agent/tools/web.py b/nanobot/agent/tools/web.pyindex 0d8f4d167..61920d981 100644--- a/nanobot/agent/tools/web.py+++ b/nanobot/agent/tools/web.py@@ -1,5 +1,7 @@"""Web tools: web_search and web_fetch."""+from __future__ import annotations+import htmlimport jsonimport osdiff --git a/nanobot/bus/events.py b/nanobot/bus/events.pyindex 018c25b3d..0bc8f3971 100644--- a/nanobot/bus/events.py+++ b/nanobot/bus/events.py@@ -1,5 +1,7 @@"""Event types for the message bus."""+from __future__ import annotations+from dataclasses import dataclass, fieldfrom datetime import datetimefrom typing import Anydiff --git a/nanobot/channels/base.py b/nanobot/channels/base.pyindex b38fcaf28..296426c68 100644--- a/nanobot/channels/base.py+++ b/nanobot/channels/base.py@@ -1,5 +1,7 @@"""Base channel interface for chat platforms."""+from __future__ import annotations+from abc import ABC, abstractmethodfrom typing import Anydiff --git a/nanobot/channels/dingtalk.py b/nanobot/channels/dingtalk.pyindex 8d02fa6cd..76f25d11a 100644--- a/nanobot/channels/dingtalk.py+++ b/nanobot/channels/dingtalk.py@@ -1,5 +1,7 @@"""DingTalk/DingDing channel implementation using Stream Mode."""+from __future__ import annotations+import asyncioimport jsonimport mimetypesdiff --git a/nanobot/channels/discord.py b/nanobot/channels/discord.pyindex c868bbf3a..fd4926742 100644--- a/nanobot/channels/discord.py+++ b/nanobot/channels/discord.py@@ -1,5 +1,7 @@"""Discord channel implementation using Discord Gateway websocket."""+from __future__ import annotations+import asyncioimport jsonfrom pathlib import Pathdiff --git a/nanobot/channels/email.py b/nanobot/channels/email.pyindex 16771fb64..d0e1b61d1 100644--- a/nanobot/channels/email.py+++ b/nanobot/channels/email.py@@ -1,5 +1,7 @@"""Email channel implementation using IMAP polling + SMTP replies."""+from __future__ import annotations+import asyncioimport htmlimport imaplibdiff --git a/nanobot/channels/feishu.py b/nanobot/channels/feishu.pyindex 8f69c0952..e56b7da23 100644--- a/nanobot/channels/feishu.py+++ b/nanobot/channels/feishu.py@@ -1,5 +1,7 @@"""Feishu/Lark channel implementation using lark-oapi SDK with WebSocket long connection."""+from __future__ import annotations+import asyncioimport jsonimport osdiff --git a/nanobot/channels/matrix.py b/nanobot/channels/matrix.pyindex 4967ac13c..488b607ec 100644--- a/nanobot/channels/matrix.py+++ b/nanobot/channels/matrix.py@@ -1,5 +1,7 @@"""Matrix (Element) channel — inbound sync + outbound message/media delivery."""+from __future__ import annotations+import asyncioimport loggingimport mimetypesdiff --git a/nanobot/channels/qq.py b/nanobot/channels/qq.pyindex 6c5804900..1a4c8af03 100644--- a/nanobot/channels/qq.py+++ b/nanobot/channels/qq.py@@ -1,5 +1,7 @@"""QQ channel implementation using botpy SDK."""+from __future__ import annotations+import asynciofrom collections import dequefrom typing import TYPE_CHECKINGdiff --git a/nanobot/channels/slack.py b/nanobot/channels/slack.pyindex afd1d2dcd..7301ced67 100644--- a/nanobot/channels/slack.py+++ b/nanobot/channels/slack.py@@ -1,5 +1,7 @@"""Slack channel implementation using Socket Mode."""+from __future__ import annotations+import asyncioimport refrom typing import Anydiff --git a/nanobot/cli/commands.py b/nanobot/cli/commands.pyindex b28dcedc9..8035b2639 100644--- a/nanobot/cli/commands.py+++ b/nanobot/cli/commands.py@@ -1,5 +1,7 @@"""CLI commands for nanobot."""+from __future__ import annotations+import asyncioimport osimport selectdiff --git a/nanobot/config/loader.py b/nanobot/config/loader.pyindex c789efdaf..d16c0d468 100644--- a/nanobot/config/loader.py+++ b/nanobot/config/loader.py@@ -1,5 +1,7 @@"""Configuration loading utilities."""+from __future__ import annotations+import jsonfrom pathlib import Pathdiff --git a/nanobot/config/schema.py b/nanobot/config/schema.pyindex 2073eeb07..5eefa831a 100644--- a/nanobot/config/schema.py+++ b/nanobot/config/schema.py@@ -1,5 +1,7 @@"""Configuration schema using Pydantic."""+from __future__ import annotations+from pathlib import Pathfrom typing import Literaldiff --git a/nanobot/cron/service.py b/nanobot/cron/service.pyindex 1ed71f0f4..c9cd86811 100644--- a/nanobot/cron/service.py+++ b/nanobot/cron/service.py@@ -1,5 +1,7 @@"""Cron service for scheduling agent tasks."""+from __future__ import annotations+import asyncioimport jsonimport timediff --git a/nanobot/cron/types.py b/nanobot/cron/types.pyindex 2b4206057..209fddf57 100644--- a/nanobot/cron/types.py+++ b/nanobot/cron/types.py@@ -1,5 +1,7 @@"""Cron types."""+from __future__ import annotations+from dataclasses import dataclass, fieldfrom typing import Literaldiff --git a/nanobot/providers/base.py b/nanobot/providers/base.pyindex 55bd80571..7a90db4d1 100644--- a/nanobot/providers/base.py+++ b/nanobot/providers/base.py@@ -1,5 +1,7 @@"""Base LLM provider interface."""+from __future__ import annotations+from abc import ABC, abstractmethodfrom dataclasses import dataclass, fieldfrom typing import Anydiff --git a/nanobot/providers/litellm_provider.py b/nanobot/providers/litellm_provider.pyindex 620424e61..5a76cb0ea 100644--- a/nanobot/providers/litellm_provider.py+++ b/nanobot/providers/litellm_provider.py@@ -1,5 +1,7 @@"""LiteLLM provider implementation for multi-provider support."""+from __future__ import annotations+import osimport secretsimport stringdiff --git a/nanobot/providers/transcription.py b/nanobot/providers/transcription.pyindex 1c8cb6a3f..d7fa9b3d0 100644--- a/nanobot/providers/transcription.py+++ b/nanobot/providers/transcription.py@@ -1,5 +1,7 @@"""Voice transcription provider using Groq."""+from __future__ import annotations+import osfrom pathlib import Pathdiff --git a/nanobot/session/manager.py b/nanobot/session/manager.pyindex dce4b2ec4..2cde436ed 100644--- a/nanobot/session/manager.py+++ b/nanobot/session/manager.py@@ -1,5 +1,7 @@"""Session management for conversation history."""+from __future__ import annotations+import jsonimport shutilfrom dataclasses import dataclass, field