check to code-server-like

This commit is contained in:
Cai
2025-09-21 15:33:00 +08:00
parent 252c426c3e
commit 271672c904
10 changed files with 129416 additions and 1673 deletions

View File

@@ -32,10 +32,10 @@ def realtime_response(config: dict, realtime_action: dict) -> None:
elif rtype == "activeFile":
file_path = realtime_action.get("filePath")
assert isinstance(file_path, str)
with open(file_path, "r", encoding="utf-8") as f:
bb.active_file_content = f.read()
bb.active_file_path = file_path
assert isinstance(file_path, str)
with open(os.path.join(bb.root_path, bb.active_file_content), "r", encoding="utf-8") as f:
bb.active_file_content = f.read()
elif rtype == "paste":
file_path = realtime_action.get("filePath")
@@ -43,14 +43,14 @@ def realtime_response(config: dict, realtime_action: dict) -> None:
bb.pasted_file_path = file_path
bb.pasted_content = realtime_action.get("content")
bb.active_file_path = file_path
with open(file_path, "r", encoding="utf-8") as f:
with open(os.path.join(bb.root_path, bb.active_file_content), "r", encoding="utf-8") as f:
bb.active_file_content = f.read()
elif rtype == "fileEdit":
file_path = realtime_action.get("filePath")
assert isinstance(file_path, str)
bb.active_file_path = file_path
with open(file_path, "r", encoding="utf-8") as f:
with open(os.path.join(bb.root_path, bb.active_file_content), "r", encoding="utf-8") as f:
bb.active_file_content = f.read()