codegpt-ai 2.16.0 → 2.17.0
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.
- package/chat.py +35 -21
- package/package.json +1 -1
package/chat.py
CHANGED
|
@@ -7171,33 +7171,47 @@ def main():
|
|
|
7171
7171
|
continue
|
|
7172
7172
|
|
|
7173
7173
|
elif cmd == "/desktop":
|
|
7174
|
-
#
|
|
7174
|
+
# Find desktop.py — check multiple locations
|
|
7175
|
+
desktop_paths = [
|
|
7176
|
+
os.path.join(str(Path(__file__).parent), "desktop.py"),
|
|
7177
|
+
os.path.join(str(Path.home()), "codegpt", "desktop.py"),
|
|
7178
|
+
os.path.join(str(Path.home()), "OneDrive", "Desktop", "Coding", "claude-chat", "desktop.py"),
|
|
7179
|
+
]
|
|
7180
|
+
desktop_py = None
|
|
7181
|
+
for dp in desktop_paths:
|
|
7182
|
+
if os.path.isfile(dp):
|
|
7183
|
+
desktop_py = dp
|
|
7184
|
+
break
|
|
7185
|
+
|
|
7186
|
+
if not desktop_py:
|
|
7187
|
+
# Download it
|
|
7188
|
+
print_sys("Downloading desktop app...")
|
|
7189
|
+
desktop_py = os.path.join(str(Path.home()), ".codegpt", "desktop.py")
|
|
7190
|
+
try:
|
|
7191
|
+
r = requests.get("https://raw.githubusercontent.com/CCguvycu/codegpt/master/desktop.py", timeout=15)
|
|
7192
|
+
Path(desktop_py).parent.mkdir(parents=True, exist_ok=True)
|
|
7193
|
+
Path(desktop_py).write_text(r.text, encoding="utf-8")
|
|
7194
|
+
print_success("Downloaded.")
|
|
7195
|
+
except Exception as e:
|
|
7196
|
+
print_err(f"Cannot download: {e}")
|
|
7197
|
+
continue
|
|
7198
|
+
|
|
7199
|
+
# Install pywebview if needed
|
|
7175
7200
|
try:
|
|
7176
7201
|
import webview
|
|
7177
|
-
print_sys("Launching desktop app...")
|
|
7178
|
-
project_dir = str(Path(__file__).parent)
|
|
7179
|
-
subprocess.Popen(
|
|
7180
|
-
[sys.executable, os.path.join(project_dir, "desktop.py")],
|
|
7181
|
-
cwd=project_dir,
|
|
7182
|
-
)
|
|
7183
|
-
print_sys("Desktop app opened in a new window.")
|
|
7184
7202
|
except ImportError:
|
|
7185
|
-
print_sys("Installing
|
|
7186
|
-
|
|
7203
|
+
print_sys("Installing pywebview...")
|
|
7204
|
+
subprocess.run(
|
|
7187
7205
|
[sys.executable, "-m", "pip", "install", "pywebview"],
|
|
7188
7206
|
capture_output=True, text=True, timeout=120,
|
|
7189
7207
|
)
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
print_sys("Desktop app opened.")
|
|
7198
|
-
else:
|
|
7199
|
-
print_err(f"Install failed: {result.stderr[:200]}")
|
|
7200
|
-
print_sys("Try manually: pip install pywebview")
|
|
7208
|
+
|
|
7209
|
+
print_sys("Launching desktop app...")
|
|
7210
|
+
subprocess.Popen(
|
|
7211
|
+
[sys.executable, desktop_py],
|
|
7212
|
+
cwd=str(Path(desktop_py).parent),
|
|
7213
|
+
)
|
|
7214
|
+
print_sys("Desktop app opened in a new window.")
|
|
7201
7215
|
continue
|
|
7202
7216
|
|
|
7203
7217
|
elif cmd == "/permissions":
|