klapcontext 0.3.1__tar.gz → 0.3.3__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.
- {klapcontext-0.3.1/src/klapcontext.egg-info → klapcontext-0.3.3}/PKG-INFO +1 -1
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/__init__.py +1 -1
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/cli.py +2 -1
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/portal.py +6 -6
- {klapcontext-0.3.1 → klapcontext-0.3.3/src/klapcontext.egg-info}/PKG-INFO +1 -1
- {klapcontext-0.3.1 → klapcontext-0.3.3}/tests/test_klapcontext.py +13 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/LICENSE +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/README.md +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/pyproject.toml +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/setup.cfg +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/agent/__init__.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/agent/capabilities.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/agent/compiler.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/agent/impact.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/agent/intents.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/agent/models.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/agent/planner.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/agent/verification.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/agent/workflows.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/agent_context.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/context_builder.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/detector.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/evidence.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/frameworks/__init__.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/frameworks/base.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/frameworks/fastapi.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/frameworks/generic_php.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/frameworks/laravel.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/frameworks/node.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/git.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/graphify.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/providers/__init__.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/providers/base.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/providers/code_intelligence.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/providers/graphify.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/providers/javascript_intelligence.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/providers/python_intelligence.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/semantic.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/system.py +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext.egg-info/SOURCES.txt +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext.egg-info/dependency_links.txt +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext.egg-info/entry_points.txt +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext.egg-info/requires.txt +0 -0
- {klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext.egg-info/top_level.txt +0 -0
|
@@ -30,7 +30,8 @@ def cmd_init(args):
|
|
|
30
30
|
except (RuntimeError, GraphifyError) as e:
|
|
31
31
|
print(f"✗ {e}", file=sys.stderr); return 1
|
|
32
32
|
print("✓ Git repository detected\n✓ Graphify available\n✓ Graph generated\n✓ Engineering context generated\n✓ Agent context generated\n✓ Human portal generated")
|
|
33
|
-
|
|
33
|
+
stack_items = [item for values in context["stack"].values() if isinstance(values, list) for item in values]
|
|
34
|
+
print(f"\nProject: {context['project']['name']}\nStack: {' / '.join(stack_items) or 'unknown'}\nContext: CURRENT\n\nHuman portal:\n.klap/index.html\n\nAgent context:\n.klap/agent-context.md")
|
|
34
35
|
return 0
|
|
35
36
|
|
|
36
37
|
def cmd_update(args):
|
|
@@ -43,7 +43,7 @@ def system_map(interactions: dict) -> str:
|
|
|
43
43
|
if edge.get("source") in points and edge.get("target") in points
|
|
44
44
|
)
|
|
45
45
|
boxes = "".join(
|
|
46
|
-
f"<g class='map-node'><rect x='{points[node['name']][0] - 65}' y='{points[node['name']][1] - 24}' width='130' height='48' rx='8'/>"
|
|
46
|
+
f"<g class='map-node' tabindex='0' role='button' data-node='{e(node['name'])}' data-kind='{e(node.get('type', 'componente'))}'><rect x='{points[node['name']][0] - 65}' y='{points[node['name']][1] - 24}' width='130' height='48' rx='8'/>"
|
|
47
47
|
f"<text x='{points[node['name']][0]}' y='{points[node['name']][1] - 2}'>{e(node['name'])[:18]}</text>"
|
|
48
48
|
f"<text class='map-kind' x='{points[node['name']][0]}' y='{points[node['name']][1] + 13}'>{e(node.get('type', 'componente'))[:18]}</text></g>"
|
|
49
49
|
for node in nodes
|
|
@@ -63,7 +63,7 @@ def section(title: str, content: str, view: str, icon: str) -> str:
|
|
|
63
63
|
def render(context: dict, agent_text: str, graphify_files: list[str]) -> str:
|
|
64
64
|
project = context["project"]
|
|
65
65
|
system = context.get("system_model", {})
|
|
66
|
-
stack = [item for values in context.get("stack", {}).values() for item in values]
|
|
66
|
+
stack = [item for values in context.get("stack", {}).values() if isinstance(values, list) for item in values]
|
|
67
67
|
points = system.get("entry_points", [])
|
|
68
68
|
flows = system.get("main_flows", [])
|
|
69
69
|
evidence = context.get("evidence", [])
|
|
@@ -113,10 +113,10 @@ def render(context: dict, agent_text: str, graphify_files: list[str]) -> str:
|
|
|
113
113
|
</section>
|
|
114
114
|
<section class='map-card' aria-label='Mapa de interacción del sistema'><header><div><span class='icon'>⌘</span><div><h2>Mapa del sistema</h2><p>Componentes, relaciones y puntos de entrada en una sola lectura.</p></div></div><button class='outline' data-go='tecnico'>Explorar evidencia <span>→</span></button></header>{system_map(system.get('system_interactions', {}))}</section>
|
|
115
115
|
<section class='quick-grid'>
|
|
116
|
-
<article><b>{len(points)}</b><span>Puntos de entrada</span><small>CLI, HTTP, archivos o scheduler</small></article>
|
|
117
|
-
<article><b>{len(flows)}</b><span>Flujos principales</span><small>Procesos y secuencias detectadas</small></article>
|
|
118
|
-
<article><b>{len(evidence)}</b><span>Hechos confirmados</span><small>Con respaldo en el código</small></article>
|
|
119
|
-
<article class='attention'><b>{len(unknowns)}</b><span>
|
|
116
|
+
<article data-go='entradas'><b>{len(points)}</b><span>Puntos de entrada</span><small>CLI, HTTP, archivos o scheduler</small></article>
|
|
117
|
+
<article data-go='flujos'><b>{len(flows)}</b><span>Flujos principales</span><small>Procesos y secuencias detectadas</small></article>
|
|
118
|
+
<article data-go='evidencia'><b>{len(evidence)}</b><span>Hechos confirmados</span><small>Con respaldo en el código</small></article>
|
|
119
|
+
<article class='attention' data-go='evidencia'><b>{len(unknowns)}</b><span>Pendientes de validar</span><small>Aspectos con evidencia insuficiente</small></article>
|
|
120
120
|
</section>
|
|
121
121
|
<section class='dashboard-bottom'><div class='compact-panel'><header><h2>Cómo se ejecuta</h2><button class='text-button' data-go='entradas'>Ver entradas →</button></header><div class='surfaces'>{surface_cards}</div></div>
|
|
122
122
|
<div class='compact-panel'><header><h2>Lectura recomendada</h2><button class='text-button' data-go='flujos'>Ver flujos →</button></header><ul class='start-list'>{start_rows}</ul></div></section>
|
|
@@ -71,6 +71,19 @@ def test_portal_has_dashboard_and_real_views(tmp_path):
|
|
|
71
71
|
assert "data-view='flujos'" in page
|
|
72
72
|
assert "data-go='evidencia'" in page
|
|
73
73
|
assert "Copiar contexto" in page
|
|
74
|
+
assert "data-go='entradas'" in page
|
|
75
|
+
assert "data-node=" in page or "map-empty" in page
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def test_cli_and_portal_ignore_scalar_stack_metadata(tmp_path, monkeypatch, capsys):
|
|
79
|
+
context = build(fixture_repo(tmp_path), {"nodes": []})
|
|
80
|
+
monkeypatch.setattr(cli, "generate_all", lambda root: context)
|
|
81
|
+
assert cli.cmd_init(type("Args", (), {"path": str(tmp_path)})()) == 0
|
|
82
|
+
output = capsys.readouterr().out
|
|
83
|
+
assert "Stack: PHP / Laravel" in output
|
|
84
|
+
assert "backend-api" not in output
|
|
85
|
+
page = render_portal(context, render_agent(context), [])
|
|
86
|
+
assert "<span>backend-api</span>" not in page
|
|
74
87
|
|
|
75
88
|
|
|
76
89
|
def test_exclude_klap_is_idempotent(tmp_path, monkeypatch):
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{klapcontext-0.3.1 → klapcontext-0.3.3}/src/klapcontext/providers/javascript_intelligence.py
RENAMED
|
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
|