This commit is contained in:
Soulter
2026-01-12 22:22:35 +08:00
parent 350c18b741
commit ea7c387fcb
8 changed files with 27 additions and 15 deletions
@@ -1,12 +1,14 @@
import os
from astrbot.api.event import AstrMessageEvent, MessageChain
import astrbot.api.message_components as Comp
from astrbot.api import logger
from astrbot.api.all import Context
import astrbot.api.message_components as Comp
from astrbot.api.event import AstrMessageEvent, MessageChain
from astrbot.core.utils.session_waiter import (
session_waiter,
SessionController,
session_waiter,
)
from ..sandbox_client import SandboxClient
@@ -1,13 +1,14 @@
import os
import astrbot.api.star as star
from astrbot.api import logger
from astrbot.api.event import filter, AstrMessageEvent
from astrbot.api import AstrBotConfig, logger
from astrbot.api.event import AstrMessageEvent, filter
from astrbot.api.provider import ProviderRequest
from astrbot.api import AstrBotConfig
from .tools.fs import CreateFileTool, ReadFileTool
from .tools.shell import ExecuteShellTool
from .tools.python import PythonTool
from .commands.file import FileCommand
from .tools.fs import CreateFileTool, ReadFileTool
from .tools.python import PythonTool
from .tools.shell import ExecuteShellTool
class Main(star.Star):
@@ -21,7 +22,7 @@ class Main(star.Star):
os.environ["SHIPYARD_ENDPOINT"] = self.endpoint
os.environ["SHIPYARD_ACCESS_TOKEN"] = self.access_token
context.add_llm_tool(
context.add_llm_tools(
CreateFileTool(), ExecuteShellTool(), PythonTool(), ReadFileTool()
)
@@ -1,6 +1,8 @@
import os
import uuid
from shipyard import ShipyardClient, SessionShip, Spec
from shipyard import SessionShip, ShipyardClient, Spec
from astrbot.api import logger
@@ -11,7 +13,7 @@ class SandboxClient:
def __new__(cls):
if cls._instance is None:
cls._instance = super(SandboxClient, cls).__new__(cls)
cls._instance = super().__new__(cls)
return cls._instance
def __init__(self):
@@ -1,7 +1,9 @@
import json
from dataclasses import dataclass, field
from astrbot.api import FunctionTool
from astrbot.api.event import AstrMessageEvent
from dataclasses import dataclass, field
from ..sandbox_client import SandboxClient
@@ -1,7 +1,10 @@
from dataclasses import dataclass, field
import mcp
from astrbot.api import FunctionTool
from astrbot.api.event import AstrMessageEvent
from dataclasses import dataclass, field
from ..sandbox_client import SandboxClient
@@ -1,7 +1,9 @@
import json
from dataclasses import dataclass, field
from astrbot.api import FunctionTool
from astrbot.api.event import AstrMessageEvent
from dataclasses import dataclass, field
from ..sandbox_client import SandboxClient