revert: restore context.py and manager.py to tanishra baseline (out of scope)
This commit is contained in:
@@ -102,11 +102,8 @@ Your workspace is at: {workspace_path}
|
||||
- Custom skills: {workspace_path}/skills/{{skill-name}}/SKILL.md
|
||||
|
||||
IMPORTANT: When responding to direct questions or conversations, reply directly with your text response.
|
||||
Use the 'message' tool only when you need explicit channel delivery behavior:
|
||||
- Send to a different channel/chat than the current session
|
||||
- Send one or more file attachments via `media` (local file paths)
|
||||
For normal conversation text, respond directly without calling the message tool.
|
||||
Do not claim that attachments are impossible if a channel supports file send and you can provide local paths.
|
||||
Only use the 'message' tool when you need to send a message to a specific chat channel (like WhatsApp).
|
||||
For normal conversation, just respond with text - do not call the message tool.
|
||||
|
||||
Always be helpful, accurate, and concise. Before calling tools, briefly tell the user what you're about to do (one short sentence in the user's language).
|
||||
When remembering something important, write to {workspace_path}/memory/MEMORY.md
|
||||
|
||||
@@ -38,7 +38,6 @@ class ChannelManager:
|
||||
if self.config.channels.telegram.enabled:
|
||||
try:
|
||||
from nanobot.channels.telegram import TelegramChannel
|
||||
|
||||
self.channels["telegram"] = TelegramChannel(
|
||||
self.config.channels.telegram,
|
||||
self.bus,
|
||||
@@ -52,8 +51,9 @@ class ChannelManager:
|
||||
if self.config.channels.whatsapp.enabled:
|
||||
try:
|
||||
from nanobot.channels.whatsapp import WhatsAppChannel
|
||||
|
||||
self.channels["whatsapp"] = WhatsAppChannel(self.config.channels.whatsapp, self.bus)
|
||||
self.channels["whatsapp"] = WhatsAppChannel(
|
||||
self.config.channels.whatsapp, self.bus
|
||||
)
|
||||
logger.info("WhatsApp channel enabled")
|
||||
except ImportError as e:
|
||||
logger.warning(f"WhatsApp channel not available: {e}")
|
||||
@@ -62,8 +62,9 @@ class ChannelManager:
|
||||
if self.config.channels.discord.enabled:
|
||||
try:
|
||||
from nanobot.channels.discord import DiscordChannel
|
||||
|
||||
self.channels["discord"] = DiscordChannel(self.config.channels.discord, self.bus)
|
||||
self.channels["discord"] = DiscordChannel(
|
||||
self.config.channels.discord, self.bus
|
||||
)
|
||||
logger.info("Discord channel enabled")
|
||||
except ImportError as e:
|
||||
logger.warning(f"Discord channel not available: {e}")
|
||||
@@ -72,8 +73,9 @@ class ChannelManager:
|
||||
if self.config.channels.feishu.enabled:
|
||||
try:
|
||||
from nanobot.channels.feishu import FeishuChannel
|
||||
|
||||
self.channels["feishu"] = FeishuChannel(self.config.channels.feishu, self.bus)
|
||||
self.channels["feishu"] = FeishuChannel(
|
||||
self.config.channels.feishu, self.bus
|
||||
)
|
||||
logger.info("Feishu channel enabled")
|
||||
except ImportError as e:
|
||||
logger.warning(f"Feishu channel not available: {e}")
|
||||
@@ -83,7 +85,9 @@ class ChannelManager:
|
||||
try:
|
||||
from nanobot.channels.mochat import MochatChannel
|
||||
|
||||
self.channels["mochat"] = MochatChannel(self.config.channels.mochat, self.bus)
|
||||
self.channels["mochat"] = MochatChannel(
|
||||
self.config.channels.mochat, self.bus
|
||||
)
|
||||
logger.info("Mochat channel enabled")
|
||||
except ImportError as e:
|
||||
logger.warning(f"Mochat channel not available: {e}")
|
||||
@@ -92,8 +96,9 @@ class ChannelManager:
|
||||
if self.config.channels.dingtalk.enabled:
|
||||
try:
|
||||
from nanobot.channels.dingtalk import DingTalkChannel
|
||||
|
||||
self.channels["dingtalk"] = DingTalkChannel(self.config.channels.dingtalk, self.bus)
|
||||
self.channels["dingtalk"] = DingTalkChannel(
|
||||
self.config.channels.dingtalk, self.bus
|
||||
)
|
||||
logger.info("DingTalk channel enabled")
|
||||
except ImportError as e:
|
||||
logger.warning(f"DingTalk channel not available: {e}")
|
||||
@@ -102,8 +107,9 @@ class ChannelManager:
|
||||
if self.config.channels.email.enabled:
|
||||
try:
|
||||
from nanobot.channels.email import EmailChannel
|
||||
|
||||
self.channels["email"] = EmailChannel(self.config.channels.email, self.bus)
|
||||
self.channels["email"] = EmailChannel(
|
||||
self.config.channels.email, self.bus
|
||||
)
|
||||
logger.info("Email channel enabled")
|
||||
except ImportError as e:
|
||||
logger.warning(f"Email channel not available: {e}")
|
||||
@@ -112,8 +118,9 @@ class ChannelManager:
|
||||
if self.config.channels.slack.enabled:
|
||||
try:
|
||||
from nanobot.channels.slack import SlackChannel
|
||||
|
||||
self.channels["slack"] = SlackChannel(self.config.channels.slack, self.bus)
|
||||
self.channels["slack"] = SlackChannel(
|
||||
self.config.channels.slack, self.bus
|
||||
)
|
||||
logger.info("Slack channel enabled")
|
||||
except ImportError as e:
|
||||
logger.warning(f"Slack channel not available: {e}")
|
||||
@@ -122,7 +129,6 @@ class ChannelManager:
|
||||
if self.config.channels.qq.enabled:
|
||||
try:
|
||||
from nanobot.channels.qq import QQChannel
|
||||
|
||||
self.channels["qq"] = QQChannel(
|
||||
self.config.channels.qq,
|
||||
self.bus,
|
||||
@@ -182,7 +188,10 @@ class ChannelManager:
|
||||
|
||||
while True:
|
||||
try:
|
||||
msg = await asyncio.wait_for(self.bus.consume_outbound(), timeout=1.0)
|
||||
msg = await asyncio.wait_for(
|
||||
self.bus.consume_outbound(),
|
||||
timeout=1.0
|
||||
)
|
||||
|
||||
channel = self.channels.get(msg.channel)
|
||||
if channel:
|
||||
@@ -205,7 +214,10 @@ class ChannelManager:
|
||||
def get_status(self) -> dict[str, Any]:
|
||||
"""Get status of all channels."""
|
||||
return {
|
||||
name: {"enabled": True, "running": channel.is_running}
|
||||
name: {
|
||||
"enabled": True,
|
||||
"running": channel.is_running
|
||||
}
|
||||
for name, channel in self.channels.items()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user