Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
__pycache__/
*.py[cod]
*$py.class
*.egg-info/
dist/
build/
*.egg
.env
.venv/
venv/
env/
*.exe
*.zip
14 changes: 6 additions & 8 deletions Desktop_App/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
THIS IS NOT YET DEPLOYED.
Here it is about Desktop APP.
"""
import sys, os, math, random, threading, json
import sys, os, math, random, json
from pathlib import Path
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))

Expand All @@ -14,8 +14,8 @@
QApplication, QWidget, QVBoxLayout, QHBoxLayout, QLabel,
QTextEdit, QLineEdit, QPushButton, QFrame, QScrollArea,
QStackedWidget, QSizePolicy, QGraphicsOpacityEffect,
QTabWidget, QDialog, QDialogButtonBox, QMessageBox,
QGroupBox, QComboBox
QDialog, QDialogButtonBox, QMessageBox,
QComboBox
)
from PySide6.QtCore import (
QThread, Signal, Qt, QTimer, QPointF, QRectF, QRect,
Expand Down Expand Up @@ -339,10 +339,8 @@ def __init__(self,text,accent="#2AFFA0",parent=None):
super().__init__(text,parent); self._ac=QColor(accent); self._h=0.0
self.setCursor(Qt.PointingHandCursor); self.setFixedHeight(48)
self.setFont(QFont("Segoe UI",11,QFont.DemiBold))
QTimer(self,timeout=self.update,interval=16).start()

def enterEvent(self,e): self._h=1.0
def leaveEvent(self,e): self._h=0.0
def enterEvent(self,e): self._h=1.0; self.update()
def leaveEvent(self,e): self._h=0.0; self.update()

def paintEvent(self,_):
p=QPainter(self); p.setRenderHint(QPainter.Antialiasing)
Expand Down Expand Up @@ -1039,7 +1037,7 @@ def __init__(self, parent=None, group_name="", existing_data=None, lock_name=Fal
title="🔑 Credential Group", subtitle=None):
super().__init__(parent)
self.setWindowTitle(title.replace("🔑","").strip() or "Credential Group")
self.setWindowIcon("npmai.png")
self.setWindowIcon(QIcon("npmai.png"))
self.setMinimumWidth(440)
self.setStyleSheet(f"QDialog{{background:{P['void']};}}")
self._row_widgets = []
Expand Down
17 changes: 14 additions & 3 deletions Desktop_App/mcp_link.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import json
import uuid
import threading
Expand All @@ -13,13 +12,25 @@
CONFIG_URL = "https://raw.githubusercontent.com/npmaiecosystem/NPM-AutoCode-AI/refs/heads/main/Desktop_App/app_config.json"

def load_config() -> dict:
"""Fetch latest config from GitHub"""
"""Fetch latest config from GitHub, falling back to local cache."""
try:
response = requests.get(CONFIG_URL, timeout=8)
if response.status_code == 200:
return response.json()
data = response.json()
try:
CONFIG_PATH.parent.mkdir(exist_ok=True)
CONFIG_PATH.write_text(json.dumps(data))
except Exception:
pass
return data
except Exception as e:
print(f"Failed to fetch remote config: {e}")
if CONFIG_PATH.exists():
try:
return json.loads(CONFIG_PATH.read_text())
except Exception:
pass
return {}


def save_config(url: str, anon_key: str, mcp_base_url: str = None):
Expand Down
1 change: 0 additions & 1 deletion Docs/app.py

This file was deleted.

2 changes: 0 additions & 2 deletions Docs/requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Install the app:
[Download Latest Release](https://github.com/sonuramashishnpm/NPM-AutoCode-AI/releases/download/v2.2/NPM_AutoCode_AI.zip)

1. Unzip the file.
2. Run `NPM_AutoCode_AI.exe` (Windows) or `python main.py` (Python 3.12+).
2. Run `NPM_AutoCode_AI.exe` (Windows) or `python Desktop_App/app.py` (Python 3.12+).
3. Enter your task in the input box (e.g., "Plot a sine wave").
4. Click **Generate & Execute**.
5. Watch logs and progress bar – AI generates, checks safety, executes, and fixes errors if needed.
Expand Down
Loading