cite-agent 1.0.0__tar.gz → 1.0.2__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.
Potentially problematic release.
This version of cite-agent might be problematic. Click here for more details.
- {cite_agent-1.0.0/cite_agent.egg-info → cite_agent-1.0.2}/PKG-INFO +1 -1
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent/account_client.py +25 -10
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent/cli.py +4 -3
- {cite_agent-1.0.0 → cite_agent-1.0.2/cite_agent.egg-info}/PKG-INFO +1 -1
- {cite_agent-1.0.0 → cite_agent-1.0.2}/setup.py +1 -1
- {cite_agent-1.0.0 → cite_agent-1.0.2}/LICENSE +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/MANIFEST.in +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/README.md +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent/__distribution__.py +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent/__init__.py +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent/agent_backend_only.py +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent/ascii_plotting.py +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent/auth.py +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent/backend_only_client.py +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent/cli_enhanced.py +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent/dashboard.py +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent/enhanced_ai_agent.py +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent/rate_limiter.py +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent/setup_config.py +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent/telemetry.py +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent/ui.py +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent/updater.py +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent/web_search.py +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent.egg-info/SOURCES.txt +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent.egg-info/dependency_links.txt +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent.egg-info/entry_points.txt +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent.egg-info/requires.txt +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/cite_agent.egg-info/top_level.txt +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/requirements.txt +0 -0
- {cite_agent-1.0.0 → cite_agent-1.0.2}/setup.cfg +0 -0
|
@@ -29,17 +29,21 @@ class AccountCredentials:
|
|
|
29
29
|
@classmethod
|
|
30
30
|
def from_payload(cls, email: str, payload: Dict[str, Any]) -> "AccountCredentials":
|
|
31
31
|
try:
|
|
32
|
+
# Support both old format (accountId/authToken) and new format (user_id/access_token)
|
|
33
|
+
account_id = str(payload.get("accountId") or payload.get("user_id"))
|
|
34
|
+
auth_token = str(payload.get("authToken") or payload.get("access_token"))
|
|
35
|
+
|
|
32
36
|
return cls(
|
|
33
|
-
account_id=
|
|
37
|
+
account_id=account_id,
|
|
34
38
|
email=email,
|
|
35
|
-
auth_token=
|
|
36
|
-
refresh_token=str(payload.get("refreshToken"
|
|
37
|
-
telemetry_token=str(payload.get("telemetryToken"
|
|
38
|
-
issued_at=str(payload.get("issuedAt"
|
|
39
|
+
auth_token=auth_token,
|
|
40
|
+
refresh_token=str(payload.get("refreshToken") or payload.get("refresh_token") or ""),
|
|
41
|
+
telemetry_token=str(payload.get("telemetryToken") or payload.get("telemetry_token") or ""),
|
|
42
|
+
issued_at=str(payload.get("issuedAt") or payload.get("issued_at") or "") or None,
|
|
39
43
|
)
|
|
40
|
-
except KeyError as exc: # pragma: no cover - defensive guard
|
|
44
|
+
except (KeyError, TypeError) as exc: # pragma: no cover - defensive guard
|
|
41
45
|
raise AccountProvisioningError(
|
|
42
|
-
f"Account provisioning payload missing
|
|
46
|
+
f"Account provisioning payload missing required fields: {exc!s}" # noqa: TRY200
|
|
43
47
|
) from exc
|
|
44
48
|
|
|
45
49
|
|
|
@@ -74,13 +78,24 @@ class AccountClient:
|
|
|
74
78
|
"The 'requests' package is required for control-plane authentication"
|
|
75
79
|
) from exc
|
|
76
80
|
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
# Try login first
|
|
82
|
+
login_endpoint = self.base_url.rstrip("/") + "/api/auth/login"
|
|
83
|
+
body = {"email": email, "password": password}
|
|
84
|
+
|
|
79
85
|
try:
|
|
80
|
-
response = requests.post(
|
|
86
|
+
response = requests.post(login_endpoint, json=body, timeout=self.timeout)
|
|
81
87
|
except Exception as exc: # pragma: no cover - network failure
|
|
82
88
|
raise AccountProvisioningError("Failed to reach control plane") from exc
|
|
83
89
|
|
|
90
|
+
# If login fails with 401 (user doesn't exist), try registration
|
|
91
|
+
if response.status_code == 401:
|
|
92
|
+
register_endpoint = self.base_url.rstrip("/") + "/api/auth/register"
|
|
93
|
+
try:
|
|
94
|
+
response = requests.post(register_endpoint, json=body, timeout=self.timeout)
|
|
95
|
+
except Exception as exc:
|
|
96
|
+
raise AccountProvisioningError("Failed to register account") from exc
|
|
97
|
+
|
|
98
|
+
# If still failing, raise error
|
|
84
99
|
if response.status_code >= 400:
|
|
85
100
|
detail = self._extract_error_detail(response)
|
|
86
101
|
raise AccountProvisioningError(
|
|
@@ -83,10 +83,11 @@ class NocturnalCLI:
|
|
|
83
83
|
success = await self.agent.initialize()
|
|
84
84
|
|
|
85
85
|
if not success:
|
|
86
|
-
self.console.print("[error]❌ Failed to initialize agent. Please check your
|
|
86
|
+
self.console.print("[error]❌ Failed to initialize agent. Please check your configuration.[/error]")
|
|
87
87
|
self.console.print("\n💡 Setup help:")
|
|
88
|
-
self.console.print(" •
|
|
89
|
-
self.console.print(" •
|
|
88
|
+
self.console.print(" • Run `cite-agent --setup` to configure your account")
|
|
89
|
+
self.console.print(" • Ensure you're logged in with valid credentials")
|
|
90
|
+
self.console.print(" • Check your internet connection to the backend")
|
|
90
91
|
return False
|
|
91
92
|
|
|
92
93
|
self._show_ready_panel()
|
|
@@ -7,7 +7,7 @@ long_description = readme_path.read_text() if readme_path.exists() else "AI Rese
|
|
|
7
7
|
|
|
8
8
|
setup(
|
|
9
9
|
name="cite-agent",
|
|
10
|
-
version="1.0.
|
|
10
|
+
version="1.0.2",
|
|
11
11
|
author="Cite-Agent Team",
|
|
12
12
|
author_email="contact@citeagent.dev",
|
|
13
13
|
description="AI Research Assistant - Backend-Only Distribution",
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|