neuroncli 2.1.1__tar.gz → 2.2.0__tar.gz
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.
- {neuroncli-2.1.1 → neuroncli-2.2.0}/PKG-INFO +1 -1
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli/auth.py +19 -4
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli/config.py +1 -1
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli.egg-info/PKG-INFO +1 -1
- {neuroncli-2.1.1 → neuroncli-2.2.0}/pyproject.toml +1 -1
- {neuroncli-2.1.1 → neuroncli-2.2.0}/README.md +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli/__init__.py +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli/__main__.py +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli/agent.py +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli/cli.py +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli/git_integration.py +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli/ollama_client.py +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli/openrouter_client.py +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli/prompts.py +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli/provider.py +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli/session.py +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli/tools.py +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli/ui.py +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli.egg-info/SOURCES.txt +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli.egg-info/dependency_links.txt +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli.egg-info/entry_points.txt +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli.egg-info/requires.txt +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/neuroncli.egg-info/top_level.txt +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/setup.cfg +0 -0
- {neuroncli-2.1.1 → neuroncli-2.2.0}/tests/test_agent.py +0 -0
|
@@ -27,8 +27,10 @@ from pathlib import Path
|
|
|
27
27
|
|
|
28
28
|
CONFIG_DIR = Path.home() / ".neuroncli"
|
|
29
29
|
CONFIG_FILE = CONFIG_DIR / "config.json"
|
|
30
|
-
CALLBACK_PORT = 19284 #
|
|
31
|
-
|
|
30
|
+
CALLBACK_PORT = 19284 # Local server port to catch the redirect from zero-x.live
|
|
31
|
+
LOCAL_CALLBACK = f"http://localhost:{CALLBACK_PORT}"
|
|
32
|
+
# OpenRouter callback → zero-x.live → redirects to localhost with ?code=
|
|
33
|
+
CALLBACK_URL = "https://zero-x.live/neuroncli/callback"
|
|
32
34
|
|
|
33
35
|
|
|
34
36
|
# ── PKCE helpers ──────────────────────────────────────────────────
|
|
@@ -78,10 +80,22 @@ def store_api_key(key: str) -> None:
|
|
|
78
80
|
# ── OAuth PKCE flow ──────────────────────────────────────────────
|
|
79
81
|
|
|
80
82
|
class _OAuthCallbackHandler(http.server.BaseHTTPRequestHandler):
|
|
81
|
-
"""Tiny HTTP handler that captures the OAuth redirect code.
|
|
83
|
+
"""Tiny HTTP handler that captures the OAuth redirect code.
|
|
84
|
+
Handles redirects from zero-x.live callback page."""
|
|
82
85
|
|
|
83
86
|
auth_code: str | None = None
|
|
84
87
|
|
|
88
|
+
def _send_cors_headers(self):
|
|
89
|
+
"""Allow cross-origin requests from zero-x.live."""
|
|
90
|
+
self.send_header("Access-Control-Allow-Origin", "*")
|
|
91
|
+
self.send_header("Access-Control-Allow-Methods", "GET, OPTIONS")
|
|
92
|
+
|
|
93
|
+
def do_OPTIONS(self):
|
|
94
|
+
"""Handle CORS preflight."""
|
|
95
|
+
self.send_response(200)
|
|
96
|
+
self._send_cors_headers()
|
|
97
|
+
self.end_headers()
|
|
98
|
+
|
|
85
99
|
def do_GET(self):
|
|
86
100
|
parsed = urllib.parse.urlparse(self.path)
|
|
87
101
|
params = urllib.parse.parse_qs(parsed.query)
|
|
@@ -93,6 +107,7 @@ class _OAuthCallbackHandler(http.server.BaseHTTPRequestHandler):
|
|
|
93
107
|
# Show success page
|
|
94
108
|
self.send_response(200)
|
|
95
109
|
self.send_header("Content-Type", "text/html")
|
|
110
|
+
self._send_cors_headers()
|
|
96
111
|
self.end_headers()
|
|
97
112
|
self.wfile.write(b"""
|
|
98
113
|
<html>
|
|
@@ -112,7 +127,7 @@ class _OAuthCallbackHandler(http.server.BaseHTTPRequestHandler):
|
|
|
112
127
|
border-radius: 24px;
|
|
113
128
|
backdrop-filter: blur(20px);
|
|
114
129
|
}
|
|
115
|
-
h1 { color: #
|
|
130
|
+
h1 { color: #f0a028; font-size: 2em; }
|
|
116
131
|
p { color: #aaa; font-size: 1.1em; }
|
|
117
132
|
</style>
|
|
118
133
|
</head>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|