ragfly-cli 2.0.0__tar.gz → 2.0.1__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.
- {ragfly_cli-2.0.0/ragfly_cli.egg-info → ragfly_cli-2.0.1}/PKG-INFO +1 -1
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/pyproject.toml +1 -1
- ragfly_cli-2.0.1/ragfly_cli/__init__.py +1 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/cli.py +9 -3
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/config.py +0 -1
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1/ragfly_cli.egg-info}/PKG-INFO +1 -1
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli.egg-info/SOURCES.txt +1 -0
- ragfly_cli-2.0.1/tests/test_login_summary_cli.py +34 -0
- ragfly_cli-2.0.0/ragfly_cli/__init__.py +0 -1
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/LICENSE +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/README.md +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/__main__.py +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/_http.py +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/_runtime.py +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/cloud_commands.py +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/grupo_activo.py +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/keyring_store.py +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/oop/__init__.py +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/oop/cli_command.py +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/oop/http_client.py +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/version_check.py +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli.egg-info/dependency_links.txt +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli.egg-info/entry_points.txt +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli.egg-info/requires.txt +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli.egg-info/top_level.txt +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/setup.cfg +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/tests/test_agent_context_cli.py +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/tests/test_api_key_group_override.py +0 -0
- {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/tests/test_surface_parity_cli.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ragfly-cli"
|
|
7
|
-
version = "2.0.
|
|
7
|
+
version = "2.0.1"
|
|
8
8
|
description = "RAGfly CLI — operate RAGfly from the terminal and CI (login + cloud API). Lightweight, no desktop dependencies."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.0.1"
|
|
@@ -179,9 +179,15 @@ def login(email: str | None, password_stdin: bool):
|
|
|
179
179
|
|
|
180
180
|
console.print()
|
|
181
181
|
console.print(f"[green]✓ Logged in as[/green] {email}")
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
# The summary reads the public session (`/v1/session`), never the internal
|
|
183
|
+
# login payload: the CLI speaks workspace, not the backend's own names.
|
|
184
|
+
try:
|
|
185
|
+
from .cloud_commands import cloud_request
|
|
186
|
+
sesion = cloud_request("GET", "/v1/session", token=data.get("access_token") or data.get("token"), timeout=15) or {}
|
|
187
|
+
except Exception:
|
|
188
|
+
sesion = {}
|
|
189
|
+
console.print(f" Active group: {sesion.get('active_group') or '—'}")
|
|
190
|
+
console.print(f" Active workspace: {sesion.get('active_workspace') or '—'}")
|
|
185
191
|
console.print(" Session stored in [dim]OS keyring[/dim]")
|
|
186
192
|
console.print()
|
|
187
193
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""`ragfly login` shows the active group and workspace from the public session, never from the internal login payload."""
|
|
2
|
+
from click.testing import CliRunner
|
|
3
|
+
|
|
4
|
+
from ragfly_cli import cloud_commands
|
|
5
|
+
from ragfly_cli.cli import app
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_login_summary_reads_the_public_session(monkeypatch):
|
|
9
|
+
internal = {"access_token": "jwt.a.b", "grupo_activo": "OLD-G", "entidad_activa": "OLD-E"}
|
|
10
|
+
monkeypatch.setattr(cloud_commands, "login", lambda email, password: internal)
|
|
11
|
+
calls = []
|
|
12
|
+
|
|
13
|
+
def fake_request(method, path, params=None, body=None, token=None, timeout=None):
|
|
14
|
+
calls.append((method, path, token))
|
|
15
|
+
return {"active_group": "G1", "active_workspace": "W1"}
|
|
16
|
+
|
|
17
|
+
monkeypatch.setattr(cloud_commands, "cloud_request", fake_request)
|
|
18
|
+
result = CliRunner().invoke(app, ["login", "--email", "a@b.c", "--password-stdin"], input="pw\n")
|
|
19
|
+
assert result.exit_code == 0, result.output
|
|
20
|
+
assert calls == [("GET", "/v1/session", "jwt.a.b")]
|
|
21
|
+
assert "Active workspace: W1" in result.output and "Active group: G1" in result.output
|
|
22
|
+
assert "OLD-" not in result.output
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def test_login_summary_survives_an_unreachable_session(monkeypatch):
|
|
26
|
+
monkeypatch.setattr(cloud_commands, "login", lambda email, password: {"access_token": "jwt.a.b"})
|
|
27
|
+
|
|
28
|
+
def failing(*args, **kwargs):
|
|
29
|
+
raise cloud_commands.CloudError("down", exit_code=2)
|
|
30
|
+
|
|
31
|
+
monkeypatch.setattr(cloud_commands, "cloud_request", failing)
|
|
32
|
+
result = CliRunner().invoke(app, ["login", "--email", "a@b.c", "--password-stdin"], input="pw\n")
|
|
33
|
+
assert result.exit_code == 0, result.output
|
|
34
|
+
assert "Active workspace: —" in result.output
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.0.0"
|
|
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
|