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.
Files changed (29) hide show
  1. {ragfly_cli-2.0.0/ragfly_cli.egg-info → ragfly_cli-2.0.1}/PKG-INFO +1 -1
  2. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/pyproject.toml +1 -1
  3. ragfly_cli-2.0.1/ragfly_cli/__init__.py +1 -0
  4. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/cli.py +9 -3
  5. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/config.py +0 -1
  6. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1/ragfly_cli.egg-info}/PKG-INFO +1 -1
  7. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli.egg-info/SOURCES.txt +1 -0
  8. ragfly_cli-2.0.1/tests/test_login_summary_cli.py +34 -0
  9. ragfly_cli-2.0.0/ragfly_cli/__init__.py +0 -1
  10. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/LICENSE +0 -0
  11. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/README.md +0 -0
  12. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/__main__.py +0 -0
  13. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/_http.py +0 -0
  14. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/_runtime.py +0 -0
  15. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/cloud_commands.py +0 -0
  16. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/grupo_activo.py +0 -0
  17. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/keyring_store.py +0 -0
  18. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/oop/__init__.py +0 -0
  19. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/oop/cli_command.py +0 -0
  20. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/oop/http_client.py +0 -0
  21. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli/version_check.py +0 -0
  22. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli.egg-info/dependency_links.txt +0 -0
  23. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli.egg-info/entry_points.txt +0 -0
  24. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli.egg-info/requires.txt +0 -0
  25. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/ragfly_cli.egg-info/top_level.txt +0 -0
  26. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/setup.cfg +0 -0
  27. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/tests/test_agent_context_cli.py +0 -0
  28. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/tests/test_api_key_group_override.py +0 -0
  29. {ragfly_cli-2.0.0 → ragfly_cli-2.0.1}/tests/test_surface_parity_cli.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ragfly-cli
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: RAGfly CLI — operate RAGfly from the terminal and CI (login + cloud API). Lightweight, no desktop dependencies.
5
5
  Author: CAB Ltda
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ragfly-cli"
7
- version = "2.0.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
- usuario = data.get("usuario", {}) if isinstance(data.get("usuario"), dict) else {}
183
- console.print(f" Active group: {data.get('grupo_activo') or usuario.get('grupo_por_defecto') or '—'}")
184
- console.print(f" Active workspace: {data.get('entidad_activa') or usuario.get('entidad_por_defecto') or '—'}")
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
 
@@ -39,7 +39,6 @@ class ClienteConfig(BaseSettings):
39
39
 
40
40
  # --- Contexto multi-tenant ---
41
41
  codigo_grupo: str = ""
42
- codigo_entidad: str = ""
43
42
 
44
43
  # --- Rutas locales ---
45
44
  directorio_documentos: str = ""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ragfly-cli
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: RAGfly CLI — operate RAGfly from the terminal and CI (login + cloud API). Lightweight, no desktop dependencies.
5
5
  Author: CAB Ltda
6
6
  License: MIT
@@ -22,4 +22,5 @@ ragfly_cli/oop/cli_command.py
22
22
  ragfly_cli/oop/http_client.py
23
23
  tests/test_agent_context_cli.py
24
24
  tests/test_api_key_group_override.py
25
+ tests/test_login_summary_cli.py
25
26
  tests/test_surface_parity_cli.py
@@ -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