Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agentmain.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def run(self):
except Exception as e: print(f'[Reflect] on_done error: {e}')
if getattr(mod, 'ONCE', False): print('[Reflect] ONCE=True, exiting.'); break
else:
try: import readline
try: import readline # noqa: F401 — side-effect: enables REPL history
except Exception: pass
agent.inc_out = True
if sys.stdout.isatty():
Expand Down
2 changes: 1 addition & 1 deletion assets/agent_bbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sqlite3, uuid, time, json, os
from threading import Lock
from fastapi import FastAPI, HTTPException, Query, Body, UploadFile, File
from fastapi.responses import JSONResponse, HTMLResponse, PlainTextResponse, FileResponse
from fastapi.responses import HTMLResponse, PlainTextResponse, FileResponse
from contextlib import contextmanager
from starlette.requests import Request
from starlette.responses import Response
Expand Down
2 changes: 1 addition & 1 deletion assets/code_run_header.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sys, os, json, re, time, subprocess
import sys, os, subprocess
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'memory'))
_r = subprocess.run
def _d(b):
Expand Down
4 changes: 2 additions & 2 deletions frontends/conductor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os, sys, re, time, json, uuid, queue, asyncio, threading, builtins
import os, sys, re, time, uuid, queue, asyncio, threading, builtins
from dataclasses import dataclass, field
from typing import Dict, Any, Optional, List
from typing import Dict, Optional, List

# Silence print() from subagent threads (they share stdout with conductor)
_original_print = builtins.print
Expand Down
2 changes: 1 addition & 1 deletion frontends/dcapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from agentmain import GeneraticAgent
from chatapp_common import (
AgentChatMixin, build_done_text, ensure_single_instance, extract_files,
AgentChatMixin, ensure_single_instance, extract_files,
public_access, redirect_log, require_runtime, split_text, strip_files, clean_reply,
HELP_TEXT, FILE_HINT, format_restore,
_handle_continue_frontend, _reset_conversation,
Expand Down
5 changes: 2 additions & 3 deletions frontends/qtapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
)
from PySide6.QtCore import (
Qt, QTimer, QPoint, QPointF, QByteArray, QSize,
Signal, QMetaObject, Q_ARG, QObject, QDateTime, QEvent,
QDateTime, QEvent,
)
from PySide6.QtGui import (
QPainter, QColor, QLinearGradient, QRadialGradient,
Expand All @@ -29,7 +29,7 @@

sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from agentmain import GeneraticAgent
from chatapp_common import FILE_HINT, HELP_TEXT, clean_reply, build_done_text, format_restore
from chatapp_common import FILE_HINT, HELP_TEXT, format_restore


# ══════════════════════════════════════════════════════════════════════
Expand Down Expand Up @@ -823,7 +823,6 @@ def _do_rewrite(self):

def _export_as_md(self):
from PySide6.QtWidgets import QFileDialog
import os
from datetime import datetime
default_name = f"msg_{datetime.now().strftime('%Y%m%d_%H%M%S')}.md"
file_path, _ = QFileDialog.getSaveFileName(
Expand Down
1 change: 0 additions & 1 deletion frontends/stapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import streamlit as st
import time, json, re, threading, queue
from agentmain import GeneraticAgent
import chatapp_common # activate /continue command (monkey patches GeneraticAgent)
from continue_cmd import handle_frontend_command, reset_conversation, list_sessions, extract_ui_messages
from btw_cmd import handle_frontend_command as btw_handle_frontend
from export_cmd import last_assistant_text, export_to_temp, wrap_for_clipboard
Expand Down
2 changes: 0 additions & 2 deletions frontends/tui_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@
from agentmain import GeneraticAgent
from dataclasses import dataclass
from dataclasses import dataclass, field
from functools import lru_cache
from io import StringIO
from rich.cells import cell_len
from rich.console import Console
from rich.markdown import Markdown
from rich.text import Text
from rich.theme import Theme
from typing import Callable


# Module-level `clip` shim: keep sb.py-style `clip.copy(...)` calls
Expand Down
1 change: 0 additions & 1 deletion frontends/tuiapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import re
import sys
import threading
import time
from dataclasses import dataclass, field
from itertools import count
from typing import Any, Callable, Optional
Expand Down
2 changes: 1 addition & 1 deletion frontends/wechatapp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os, sys, re, threading, queue, time, socket, json, struct, base64, uuid, hashlib, math
import os, sys, re, threading, queue, time, socket, json, struct, base64, uuid, hashlib
from pathlib import Path
from urllib.parse import quote
import requests, qrcode
Expand Down
2 changes: 1 addition & 1 deletion frontends/wecomapp.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio, os, select, sys, threading, time, traceback
from collections import deque
from datetime import datetime
from typing import Any, Callable, Dict, Optional, TypedDict
from typing import Any, Callable, Optional, TypedDict


class TurnContext(TypedDict, total=False):
Expand Down
2 changes: 1 addition & 1 deletion llmcore.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os, json, re, time, requests, sys, threading, urllib3, base64, importlib, uuid
import os, json, re, time, requests, sys, threading, urllib3, importlib, uuid
from datetime import datetime
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
_RESP_CACHE_KEY = str(uuid.uuid4())
Expand Down
2 changes: 1 addition & 1 deletion memory/L4_raw_sessions/compress_session.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""L4 Session Log Processor — compress & extract history.
Format A (JSON): kept as-is. Format B (Raw): strip sys prompt & assistant echo.
"""
import re, os, json, ast
import re, os
from datetime import datetime

L4_DIR = os.path.dirname(os.path.abspath(__file__))
Expand Down
1 change: 0 additions & 1 deletion memory/autonomous_operation_sop/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
set_todo() → 返回TODO真实路径
"""

import os
import re
import shutil
from pathlib import Path
Expand Down
4 changes: 2 additions & 2 deletions memory/ljqCtrl.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
- GrabWindow(hwnd) -> PIL Image: DPI-safe window screenshot
"""

import os, sys, time, random, math, win32api, win32con, ctypes
import time, win32api, win32con, ctypes
import numpy as np

dpi_scale = 1
try:
from PIL import ImageGrab, Image, ImageEnhance, ImageFilter, ImageDraw
from PIL import ImageGrab, Image
import cv2
except: pass

Expand Down
2 changes: 0 additions & 2 deletions memory/procmem_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import ctypes.wintypes
import argparse
import yara
import sys
import os
import json

# Define WinAPI Types for 64-bit compatibility
Expand Down
1 change: 0 additions & 1 deletion memory/ui_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from pathlib import Path
from ultralytics import YOLO
from PIL import Image, ImageDraw
import numpy as np

DEFAULT_MODEL = str(Path(__file__).resolve().parent.parent / 'temp' / 'weights' / 'icon_detect' / 'model.pt')

Expand Down
2 changes: 1 addition & 1 deletion plugins/langfuse_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Usage tracking (SSE parser wrapping) stays as internal llmcore patch.
"""
import threading, sys
import threading

try:
from llmcore import _load_mykeys
Expand Down
2 changes: 1 addition & 1 deletion reflect/agent_team_worker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# reflect module: BBS接单
# check()内预检BBS,无新帖返回None不唤醒agent
import json, time, os
import json, os
from urllib import request

INTERVAL = 60
Expand Down
2 changes: 1 addition & 1 deletion simphtml.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ def get_temp_texts(driver):
print(e)
return []

import time, re, os
import time, re
def get_main_block(driver, extra_js="", text_only=False):
page = driver.execute_js(f"{extra_js}\n{js_optHTML}\nreturn optHTML({str(text_only).lower()});").get('data', '')
if text_only:
Expand Down