auto-coder-web 0.1.107__py3-none-any.whl → 0.1.109__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.
Files changed (72) hide show
  1. auto_coder_web/routers/file_command_router.py +4 -4
  2. auto_coder_web/terminal.py +21 -15
  3. auto_coder_web/version.py +1 -1
  4. auto_coder_web/web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  5. auto_coder_web/web/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  6. auto_coder_web/web/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  7. auto_coder_web/web/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  8. auto_coder_web/web/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  9. auto_coder_web/web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  10. auto_coder_web/web/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  11. auto_coder_web/web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  12. auto_coder_web/web/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  13. auto_coder_web/web/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  14. auto_coder_web/web/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  15. auto_coder_web/web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  16. auto_coder_web/web/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  17. auto_coder_web/web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  18. auto_coder_web/web/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  19. auto_coder_web/web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  20. auto_coder_web/web/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  21. auto_coder_web/web/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  22. auto_coder_web/web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  23. auto_coder_web/web/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  24. auto_coder_web/web/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  25. auto_coder_web/web/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  26. auto_coder_web/web/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  27. auto_coder_web/web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  28. auto_coder_web/web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  29. auto_coder_web/web/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  30. auto_coder_web/web/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  31. auto_coder_web/web/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  32. auto_coder_web/web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  33. auto_coder_web/web/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  34. auto_coder_web/web/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  35. auto_coder_web/web/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  36. auto_coder_web/web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  37. auto_coder_web/web/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  38. auto_coder_web/web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  39. auto_coder_web/web/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  40. auto_coder_web/web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  41. auto_coder_web/web/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  42. auto_coder_web/web/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  43. auto_coder_web/web/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  44. auto_coder_web/web/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  45. auto_coder_web/web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  46. auto_coder_web/web/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  47. auto_coder_web/web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  48. auto_coder_web/web/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  49. auto_coder_web/web/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  50. auto_coder_web/web/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  51. auto_coder_web/web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  52. auto_coder_web/web/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  53. auto_coder_web/web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  54. auto_coder_web/web/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  55. auto_coder_web/web/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  56. auto_coder_web/web/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  57. auto_coder_web/web/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  58. auto_coder_web/web/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  59. auto_coder_web/web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  60. auto_coder_web/web/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  61. auto_coder_web/web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  62. auto_coder_web/web/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  63. auto_coder_web/web/assets/main-BtXMe4GC.css +32 -0
  64. auto_coder_web/web/assets/main.js +770 -508
  65. auto_coder_web/web/index.html +1 -1
  66. {auto_coder_web-0.1.107.dist-info → auto_coder_web-0.1.109.dist-info}/METADATA +2 -2
  67. {auto_coder_web-0.1.107.dist-info → auto_coder_web-0.1.109.dist-info}/RECORD +70 -12
  68. auto_coder_web/web/assets/katex-ChWnQ-fc.js +0 -261
  69. auto_coder_web/web/assets/main-BPF_xhU6.css +0 -32
  70. {auto_coder_web-0.1.107.dist-info → auto_coder_web-0.1.109.dist-info}/WHEEL +0 -0
  71. {auto_coder_web-0.1.107.dist-info → auto_coder_web-0.1.109.dist-info}/entry_points.txt +0 -0
  72. {auto_coder_web-0.1.107.dist-info → auto_coder_web-0.1.109.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/{file_name}", response_model=ReadDocumentResponse)
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/{file_name}/variables", response_model=AnalyzeDocumentResponse)
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.
@@ -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
- data = await websocket.receive_text()
245
- try:
246
- message = json.loads(data)
247
- if message['type'] == 'resize':
248
- session.resize(
249
- message['rows'], message['cols'])
250
- elif message['type'] == 'heartbeat':
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
- else:
253
- session.write(data)
254
- except json.JSONDecodeError:
255
- session.write(data)
256
- except RuntimeError as e:
257
- if "WebSocket is not connected" in str(e):
258
- break
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.107"
1
+ __version__ = "0.1.109"