auto-coder-web 0.1.108__py3-none-any.whl → 0.1.110__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- auto_coder_web/routers/file_command_router.py +4 -4
- auto_coder_web/terminal.py +21 -15
- auto_coder_web/version.py +1 -1
- auto_coder_web/web/assets/main.js +326 -326
- {auto_coder_web-0.1.108.dist-info → auto_coder_web-0.1.110.dist-info}/METADATA +2 -2
- {auto_coder_web-0.1.108.dist-info → auto_coder_web-0.1.110.dist-info}/RECORD +9 -9
- {auto_coder_web-0.1.108.dist-info → auto_coder_web-0.1.110.dist-info}/WHEEL +0 -0
- {auto_coder_web-0.1.108.dist-info → auto_coder_web-0.1.110.dist-info}/entry_points.txt +0 -0
- {auto_coder_web-0.1.108.dist-info → auto_coder_web-0.1.110.dist-info}/top_level.txt +0 -0
@@ -127,13 +127,13 @@ async def list_documents(request: Request, recursive: bool = False):
|
|
127
127
|
errors=[f"Error listing documents: {str(e)}"]
|
128
128
|
)
|
129
129
|
|
130
|
-
@router.get("/api/file_commands
|
130
|
+
@router.get("/api/file_commands", response_model=ReadDocumentResponse)
|
131
131
|
async def read_document(file_name: str, request: Request):
|
132
132
|
"""
|
133
133
|
Read a document file.
|
134
134
|
|
135
135
|
Args:
|
136
|
-
file_name: The name of the file to read.
|
136
|
+
file_name: The name of the file to read (passed as query parameter).
|
137
137
|
|
138
138
|
Returns:
|
139
139
|
A ReadDocumentResponse object.
|
@@ -168,13 +168,13 @@ async def read_document(file_name: str, request: Request):
|
|
168
168
|
errors=[f"Error reading document: {str(e)}"]
|
169
169
|
)
|
170
170
|
|
171
|
-
@router.get("/api/file_commands/
|
171
|
+
@router.get("/api/file_commands/variables", response_model=AnalyzeDocumentResponse)
|
172
172
|
async def analyze_document(file_name: str, request: Request):
|
173
173
|
"""
|
174
174
|
Analyze a document file to extract variables.
|
175
175
|
|
176
176
|
Args:
|
177
|
-
file_name: The name of the file to analyze.
|
177
|
+
file_name: The name of the file to analyze (passed as query parameter).
|
178
178
|
|
179
179
|
Returns:
|
180
180
|
An AnalyzeDocumentResponse object.
|
auto_coder_web/terminal.py
CHANGED
@@ -240,23 +240,29 @@ class TerminalManager:
|
|
240
240
|
|
241
241
|
try:
|
242
242
|
while True:
|
243
|
+
data = await websocket.receive_text()
|
244
|
+
|
245
|
+
# ① 尝试解析 JSON
|
243
246
|
try:
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
247
|
+
msg = json.loads(data)
|
248
|
+
except json.JSONDecodeError:
|
249
|
+
session.write(data)
|
250
|
+
continue # 不是 JSON,直接当终端输入
|
251
|
+
|
252
|
+
# ② 只有当解析结果是 dict 且包含 type 字段时,才按控制消息处理
|
253
|
+
if isinstance(msg, dict) and 'type' in msg:
|
254
|
+
match msg['type']:
|
255
|
+
case 'resize':
|
256
|
+
session.resize(msg['rows'], msg['cols'])
|
257
|
+
case 'heartbeat':
|
251
258
|
session._last_heartbeat = time.time()
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
raise
|
259
|
+
case 'stdin':
|
260
|
+
if 'payload' in msg:
|
261
|
+
session.write(msg['payload'])
|
262
|
+
case _:
|
263
|
+
session.write(data) # 兜底:未知控制消息 → 直接写
|
264
|
+
else:
|
265
|
+
session.write(data)
|
260
266
|
except websockets.exceptions.ConnectionClosed:
|
261
267
|
print("WebSocket closed normally during terminal session")
|
262
268
|
pass
|
auto_coder_web/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.1.
|
1
|
+
__version__ = "0.1.110"
|