autoglm-gui 0.4.9__py3-none-any.whl → 0.4.12__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.
- AutoGLM_GUI/__init__.py +8 -0
- AutoGLM_GUI/__main__.py +64 -21
- AutoGLM_GUI/adb_plus/__init__.py +8 -0
- AutoGLM_GUI/adb_plus/device.py +50 -0
- AutoGLM_GUI/adb_plus/ip.py +78 -0
- AutoGLM_GUI/adb_plus/keyboard_installer.py +380 -0
- AutoGLM_GUI/adb_plus/serial.py +35 -0
- AutoGLM_GUI/api/__init__.py +8 -0
- AutoGLM_GUI/api/agents.py +132 -1
- AutoGLM_GUI/api/devices.py +96 -6
- AutoGLM_GUI/api/media.py +13 -243
- AutoGLM_GUI/config_manager.py +565 -0
- AutoGLM_GUI/exceptions.py +7 -0
- AutoGLM_GUI/logger.py +85 -0
- AutoGLM_GUI/platform_utils.py +30 -5
- AutoGLM_GUI/schemas.py +50 -0
- AutoGLM_GUI/scrcpy_protocol.py +46 -0
- AutoGLM_GUI/scrcpy_stream.py +208 -327
- AutoGLM_GUI/server.py +7 -2
- AutoGLM_GUI/socketio_server.py +125 -0
- AutoGLM_GUI/state.py +2 -1
- AutoGLM_GUI/static/assets/{about-BI6OV6gm.js → about-kgOkkOWe.js} +1 -1
- AutoGLM_GUI/static/assets/chat-CZV3RByK.js +149 -0
- AutoGLM_GUI/static/assets/{index-Do7ha9Kf.js → index-BPYHsweG.js} +1 -1
- AutoGLM_GUI/static/assets/index-Beu9cbSy.css +1 -0
- AutoGLM_GUI/static/assets/index-DfI_Z1Cx.js +10 -0
- AutoGLM_GUI/static/assets/worker-D6BRitjy.js +1 -0
- AutoGLM_GUI/static/index.html +2 -2
- {autoglm_gui-0.4.9.dist-info → autoglm_gui-0.4.12.dist-info}/METADATA +15 -2
- autoglm_gui-0.4.12.dist-info/RECORD +56 -0
- AutoGLM_GUI/static/assets/chat-C_2Cot0q.js +0 -25
- AutoGLM_GUI/static/assets/index-DCrxTz-A.css +0 -1
- AutoGLM_GUI/static/assets/index-Dn3vR6uV.js +0 -10
- autoglm_gui-0.4.9.dist-info/RECORD +0 -46
- {autoglm_gui-0.4.9.dist-info → autoglm_gui-0.4.12.dist-info}/WHEEL +0 -0
- {autoglm_gui-0.4.9.dist-info → autoglm_gui-0.4.12.dist-info}/entry_points.txt +0 -0
- {autoglm_gui-0.4.9.dist-info → autoglm_gui-0.4.12.dist-info}/licenses/LICENSE +0 -0
AutoGLM_GUI/schemas.py
CHANGED
|
@@ -125,3 +125,53 @@ class TouchUpResponse(BaseModel):
|
|
|
125
125
|
|
|
126
126
|
class DeviceListResponse(BaseModel):
|
|
127
127
|
devices: list[dict]
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class ConfigResponse(BaseModel):
|
|
131
|
+
"""配置读取响应."""
|
|
132
|
+
|
|
133
|
+
base_url: str
|
|
134
|
+
model_name: str
|
|
135
|
+
api_key: str # 返回实际值(明文)
|
|
136
|
+
source: str # "CLI arguments" | "environment variables" | "config file (...)" | "default"
|
|
137
|
+
conflicts: list[dict] | None = None # 配置冲突信息(可选)
|
|
138
|
+
# conflicts 示例:
|
|
139
|
+
# [
|
|
140
|
+
# {
|
|
141
|
+
# "field": "base_url",
|
|
142
|
+
# "file_value": "http://localhost:8080/v1",
|
|
143
|
+
# "override_value": "https://api.example.com",
|
|
144
|
+
# "override_source": "CLI arguments"
|
|
145
|
+
# }
|
|
146
|
+
# ]
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
class ConfigSaveRequest(BaseModel):
|
|
150
|
+
"""配置保存请求."""
|
|
151
|
+
|
|
152
|
+
base_url: str
|
|
153
|
+
model_name: str = "autoglm-phone-9b"
|
|
154
|
+
api_key: str | None = None
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
class WiFiConnectRequest(BaseModel):
|
|
158
|
+
device_id: str | None = None
|
|
159
|
+
port: int = 5555
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
class WiFiConnectResponse(BaseModel):
|
|
163
|
+
success: bool
|
|
164
|
+
message: str
|
|
165
|
+
device_id: str | None = None
|
|
166
|
+
address: str | None = None
|
|
167
|
+
error: str | None = None
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
class WiFiDisconnectRequest(BaseModel):
|
|
171
|
+
device_id: str
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
class WiFiDisconnectResponse(BaseModel):
|
|
175
|
+
success: bool
|
|
176
|
+
message: str
|
|
177
|
+
error: str | None = None
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Scrcpy protocol helpers aligned with ya-webadb implementations."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
from typing import Optional
|
|
7
|
+
|
|
8
|
+
SCRCPY_CODEC_H264 = 0x68323634
|
|
9
|
+
SCRCPY_CODEC_H265 = 0x68323635
|
|
10
|
+
SCRCPY_CODEC_AV1 = 0x00617631
|
|
11
|
+
|
|
12
|
+
SCRCPY_CODEC_NAME_TO_ID: dict[str, int] = {
|
|
13
|
+
"h264": SCRCPY_CODEC_H264,
|
|
14
|
+
"h265": SCRCPY_CODEC_H265,
|
|
15
|
+
"av1": SCRCPY_CODEC_AV1,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
SCRCPY_KNOWN_CODECS = set(SCRCPY_CODEC_NAME_TO_ID.values())
|
|
19
|
+
|
|
20
|
+
PTS_CONFIG = 1 << 63
|
|
21
|
+
PTS_KEYFRAME = 1 << 62
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@dataclass
|
|
25
|
+
class ScrcpyVideoStreamMetadata:
|
|
26
|
+
device_name: Optional[str]
|
|
27
|
+
width: Optional[int]
|
|
28
|
+
height: Optional[int]
|
|
29
|
+
codec: int
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@dataclass
|
|
33
|
+
class ScrcpyMediaStreamPacket:
|
|
34
|
+
type: str
|
|
35
|
+
data: bytes
|
|
36
|
+
keyframe: Optional[bool] = None
|
|
37
|
+
pts: Optional[int] = None
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@dataclass
|
|
41
|
+
class ScrcpyVideoStreamOptions:
|
|
42
|
+
send_device_meta: bool = True
|
|
43
|
+
send_codec_meta: bool = True
|
|
44
|
+
send_frame_meta: bool = True
|
|
45
|
+
send_dummy_byte: bool = True
|
|
46
|
+
video_codec: str = "h264"
|