wger-agent 2.2.4__tar.gz → 2.2.5__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 (86) hide show
  1. {wger_agent-2.2.4/wger_agent.egg-info → wger_agent-2.2.5}/PKG-INFO +5 -5
  2. {wger_agent-2.2.4 → wger_agent-2.2.5}/README.md +1 -1
  3. {wger_agent-2.2.4 → wger_agent-2.2.5}/pyproject.toml +9 -12
  4. {wger_agent-2.2.4 → wger_agent-2.2.5}/scripts/verify_api_integration.py +4 -1
  5. wger_agent-2.2.5/tests/test_default_content_surfaces.py +131 -0
  6. {wger_agent-2.2.4 → wger_agent-2.2.5}/tests/test_fleet_name.py +1 -1
  7. wger_agent-2.2.5/tests/test_publication_workflow.py +82 -0
  8. wger_agent-2.2.5/tests/test_wheel_inventory.py +47 -0
  9. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/__init__.py +17 -0
  10. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/connector_sources.py +0 -20
  11. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/mcp/mcp_server.py +11 -16
  12. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/mcp_server.py +3 -1
  13. {wger_agent-2.2.4 → wger_agent-2.2.5/wger_agent.egg-info}/PKG-INFO +5 -5
  14. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent.egg-info/SOURCES.txt +2 -0
  15. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent.egg-info/entry_points.txt +1 -7
  16. wger_agent-2.2.5/wger_agent.egg-info/requires.txt +14 -0
  17. wger_agent-2.2.4/tests/test_default_content_surfaces.py +0 -43
  18. wger_agent-2.2.4/wger_agent.egg-info/requires.txt +0 -14
  19. {wger_agent-2.2.4 → wger_agent-2.2.5}/LICENSE +0 -0
  20. {wger_agent-2.2.4 → wger_agent-2.2.5}/MANIFEST.in +0 -0
  21. {wger_agent-2.2.4 → wger_agent-2.2.5}/requirements.txt +0 -0
  22. {wger_agent-2.2.4 → wger_agent-2.2.5}/scripts/security_contract.py +0 -0
  23. {wger_agent-2.2.4 → wger_agent-2.2.5}/scripts/security_sanitizer.py +0 -0
  24. {wger_agent-2.2.4 → wger_agent-2.2.5}/setup.cfg +0 -0
  25. {wger_agent-2.2.4 → wger_agent-2.2.5}/tests/conftest.py +0 -0
  26. {wger_agent-2.2.4 → wger_agent-2.2.5}/tests/test_bug_cx_046_ctx_await.py +0 -0
  27. {wger_agent-2.2.4 → wger_agent-2.2.5}/tests/test_coverage_booster.py +0 -0
  28. {wger_agent-2.2.4 → wger_agent-2.2.5}/tests/test_init.py +0 -0
  29. {wger_agent-2.2.4 → wger_agent-2.2.5}/tests/test_init_dynamics.py +0 -0
  30. {wger_agent-2.2.4 → wger_agent-2.2.5}/tests/test_kg_ingest.py +0 -0
  31. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/__main__.py +0 -0
  32. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/api/__init__.py +0 -0
  33. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/api/api_client_base.py +0 -0
  34. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/api/api_client_body.py +0 -0
  35. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/api/api_client_configs.py +0 -0
  36. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/api/api_client_exercises.py +0 -0
  37. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/api/api_client_nutrition.py +0 -0
  38. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/api/api_client_routine.py +0 -0
  39. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/api/api_client_user_system.py +0 -0
  40. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/api/api_client_workout_sessions.py +0 -0
  41. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/api_client.py +0 -0
  42. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/auth.py +0 -0
  43. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/connectors/__init__.py +0 -0
  44. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/kg_ingest.py +0 -0
  45. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/mcp/__init__.py +0 -0
  46. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/mcp/tools.py +0 -0
  47. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/mcp_config.json +0 -0
  48. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/ontology/__init__.py +0 -0
  49. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/ontology/certification.json +0 -0
  50. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/ontology/fixtures/records.json +0 -0
  51. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/ontology/mappings/source.yaml +0 -0
  52. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/ontology/migrations/manifest.json +0 -0
  53. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/ontology/shapes/connector.shacl.ttl +0 -0
  54. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/ontology/wellness.ttl +0 -0
  55. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/prompts/__init__.py +0 -0
  56. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/prompts/fitness_specialist.json +0 -0
  57. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/__init__.py +0 -0
  58. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/SKILL.md +0 -0
  59. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/WORKFLOW.md +0 -0
  60. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/reference/_images_logo.png.md +0 -0
  61. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/reference/administration_auth_proxy.html.md +0 -0
  62. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/reference/administration_commands.html.md +0 -0
  63. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/reference/administration_gym.html.md +0 -0
  64. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/reference/administration_settings.html.md +0 -0
  65. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/reference/api_api.html.md +0 -0
  66. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/reference/api_routines.html.md +0 -0
  67. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/reference/changelog.html.md +0 -0
  68. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/reference/contributing.html.md +0 -0
  69. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/reference/development_backend.html.md +0 -0
  70. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/reference/development_frontend.html.md +0 -0
  71. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/reference/development_mobile_app.html.md +0 -0
  72. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/reference/en_latest.md +0 -0
  73. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/reference/manual_routines.html.md +0 -0
  74. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/reference/production_docker.html.md +0 -0
  75. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-docs/reference/production_installation.html.md +0 -0
  76. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-operations/SKILL.md +0 -0
  77. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-operations/agents/openai.yaml +0 -0
  78. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-agent-operations/references/catalog.md +0 -0
  79. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-exercise-library/SKILL.md +0 -0
  80. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-exercise-library/WORKFLOW.md +0 -0
  81. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-nutrition-tracking/SKILL.md +0 -0
  82. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-nutrition-tracking/WORKFLOW.md +0 -0
  83. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-workout-routines/SKILL.md +0 -0
  84. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent/skills/wger-workout-routines/WORKFLOW.md +0 -0
  85. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent.egg-info/dependency_links.txt +0 -0
  86. {wger_agent-2.2.4 → wger_agent-2.2.5}/wger_agent.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wger-agent
3
- Version: 2.2.4
3
+ Version: 2.2.5
4
4
  Summary: Wger Workout Manager — exercise database, workout routines, nutrition plans, body measurements, and progress tracking.
5
5
  Author-email: Project Maintainers <maintainers@users.noreply.github.com>
6
6
  License: MIT
@@ -12,12 +12,12 @@ Classifier: Programming Language :: Python :: 3
12
12
  Requires-Python: <3.15,>=3.12
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
- Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.4.1
15
+ Requires-Dist: scion-sdk[mcp]<1.0.0,>=0.5.6
16
16
  Requires-Dist: requests>=2.34.2
17
17
  Provides-Extra: mcp
18
- Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.4.1; extra == "mcp"
18
+ Requires-Dist: scion-sdk[mcp]<1.0.0,>=0.5.6; extra == "mcp"
19
19
  Provides-Extra: all
20
- Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.4.1; extra == "all"
20
+ Requires-Dist: scion-sdk[mcp]<1.0.0,>=0.5.6; extra == "all"
21
21
  Provides-Extra: test
22
22
  Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
23
23
  Requires-Dist: pytest>=9.1.1; extra == "test"
@@ -47,7 +47,7 @@ Dynamic: license-file
47
47
  ![PyPI - Wheel](https://img.shields.io/pypi/wheel/wger-agent)
48
48
  ![PyPI - Implementation](https://img.shields.io/pypi/implementation/wger-agent)
49
49
 
50
- *Version: 2.2.4*
50
+ *Version: 2.2.5*
51
51
 
52
52
  > **Documentation** — Installation, deployment, usage across the MCP, API, and agent
53
53
  > interfaces, and guidance for provisioning the Wger Workout Manager platform are
@@ -20,7 +20,7 @@
20
20
  ![PyPI - Wheel](https://img.shields.io/pypi/wheel/wger-agent)
21
21
  ![PyPI - Implementation](https://img.shields.io/pypi/implementation/wger-agent)
22
22
 
23
- *Version: 2.2.4*
23
+ *Version: 2.2.5*
24
24
 
25
25
  > **Documentation** — Installation, deployment, usage across the MCP, API, and agent
26
26
  > interfaces, and guidance for provisioning the Wger Workout Manager platform are
@@ -4,12 +4,12 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "wger-agent"
7
- version = "2.2.4"
7
+ version = "2.2.5"
8
8
  description = "Wger Workout Manager — exercise database, workout routines, nutrition plans, body measurements, and progress tracking."
9
9
  readme = "README.md"
10
10
  classifiers = [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Environment :: Console", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3",]
11
11
  requires-python = ">=3.12, <3.15"
12
- dependencies = [ "agent-connector-sdk[mcp]>=0.4.1,<1.0.0", "requests>=2.34.2",]
12
+ dependencies = [ "scion-sdk[mcp]>=0.5.6,<1.0.0", "requests>=2.34.2",]
13
13
  [[project.authors]]
14
14
  name = "Project Maintainers"
15
15
  email = "maintainers@users.noreply.github.com"
@@ -18,26 +18,19 @@ email = "maintainers@users.noreply.github.com"
18
18
  text = "MIT"
19
19
 
20
20
  [project.optional-dependencies]
21
- mcp = [ "agent-connector-sdk[mcp]>=0.4.1,<1.0.0",]
22
- all = [ "agent-connector-sdk[mcp]>=0.4.1,<1.0.0",]
21
+ mcp = [ "scion-sdk[mcp]>=0.5.6,<1.0.0",]
22
+ all = [ "scion-sdk[mcp]>=0.5.6,<1.0.0",]
23
23
  test = [
24
24
  "pytest-xdist>=3.8.0", "pytest>=9.1.1", "pytest-asyncio>=1.4.0", "pytest-cov>=7.1.0",]
25
25
 
26
26
  [project.scripts]
27
27
  wger-mcp = "wger_agent.mcp_server:mcp_server"
28
28
 
29
- [project.entry-points."agent_connector_sdk.skill_providers"]
30
- wger-agent = "wger_agent.skills"
31
-
32
29
  [project.entry-points."agent_connector_sdk.prompt_providers"]
33
30
  wger-agent = "wger_agent.prompts"
34
31
 
35
- [project.entry-points."agent_connector_sdk.ontology_providers"]
36
- wger-agent = "wger_agent.ontology"
37
-
38
- # The one declared connector identity: the fleet name (SDK-CONNECTOR-CONTROL-R071).
39
32
  [project.entry-points."agent_connector_sdk.connector"]
40
- wger-mcp = "wger_agent"
33
+ wger-mcp = "wger_agent:connector"
41
34
 
42
35
  [tool.uv.workspace]
43
36
  members = ["."]
@@ -61,6 +54,7 @@ check_untyped_defs = true
61
54
 
62
55
  [dependency-groups]
63
56
  dev = [
57
+ "bump2version>=1.0.1,<2",
64
58
  "pytest-timeout>=2.4.0",
65
59
  ]
66
60
 
@@ -79,3 +73,6 @@ ignore_names = ["request", "config"]
79
73
 
80
74
  [tool.pipelines_hooks.ste]
81
75
  exempt = ["specs/*", "specs/**/*"]
76
+
77
+ [tool.setuptools.exclude-package-data]
78
+ "*" = ["**/__pycache__/**", "**/*.pyc"]
@@ -3,6 +3,7 @@ import os
3
3
  import ast
4
4
  import glob
5
5
  import sys
6
+ from typing import TypeGuard
6
7
 
7
8
  BASELINES = {
8
9
  "adguard-home-agent": 89.2,
@@ -35,7 +36,9 @@ def _is_api_client_class(node: ast.ClassDef) -> bool:
35
36
  return "api" in class_name or "client" in class_name or node.name == "Api"
36
37
 
37
38
 
38
- def _is_public_client_method(item) -> bool:
39
+ def _is_public_client_method(
40
+ item: ast.AST,
41
+ ) -> TypeGuard[ast.FunctionDef | ast.AsyncFunctionDef]:
39
42
  return (
40
43
  isinstance(item, (ast.FunctionDef, ast.AsyncFunctionDef))
41
44
  and not item.name.startswith("_")
@@ -0,0 +1,131 @@
1
+ """CONN-WGER-AGENT-CONNECTOR-CONTENT-R001: the server lists its packaged skills, ontology and prompts by default."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import asyncio
6
+ import importlib
7
+ from pathlib import Path
8
+
9
+ import pytest
10
+ from fastmcp import Client
11
+
12
+ PACKAGE = "wger_agent"
13
+ ROOT = Path(list(importlib.import_module(PACKAGE).__path__)[0])
14
+
15
+ pytestmark = pytest.mark.spec("CONN-WGER-AGENT-CONNECTOR-CONTENT-R001")
16
+
17
+
18
+ def _server():
19
+ from wger_agent.mcp_server import get_mcp_instance
20
+
21
+ return get_mcp_instance(command_args=["--transport", "stdio", "--auth-type", "none"])[0]
22
+
23
+
24
+ async def _listings():
25
+ async with Client(_server()) as client:
26
+ resources = {str(r.uri) for r in await client.list_resources()}
27
+ prompts = {p.name for p in await client.list_prompts()}
28
+ for uri in resources:
29
+ if uri.startswith(("ontology://", "shapes://")):
30
+ directory = ROOT / "ontology"
31
+ if uri.startswith("shapes://"):
32
+ directory = directory / "shapes"
33
+ actual = await client.read_resource(uri)
34
+ assert (
35
+ actual[0].text.encode()
36
+ == (directory / uri.rsplit("/", 1)[-1]).read_bytes()
37
+ )
38
+ return resources, prompts
39
+
40
+
41
+ def test_default_content_surfaces() -> None:
42
+ resources, prompts = asyncio.run(_listings())
43
+ if list(ROOT.glob("skills/*/SKILL.md")):
44
+ assert any(u.startswith("skill://") for u in resources)
45
+ if list(ROOT.glob("ontology/*.ttl")):
46
+ assert any(u.startswith("ontology://wger-mcp/") for u in resources)
47
+ for path in ROOT.glob("prompts/*.json"):
48
+ if not path.name.startswith("_"):
49
+ assert path.stem in prompts
50
+
51
+
52
+ @pytest.fixture(autouse=True)
53
+ def _no_outbound_network(monkeypatch):
54
+ import socket
55
+
56
+ def refuse(*_args, **_kwargs):
57
+ raise AssertionError("content publication must not contact an external system")
58
+
59
+ monkeypatch.setenv("MCP_FLEET_REGISTRATION", "false")
60
+ monkeypatch.setattr(socket.socket, "connect", refuse)
61
+
62
+
63
+
64
+ def test_sdk_floor_supports_content_identity_and_current_pack_protocol() -> None:
65
+ import tomllib
66
+
67
+ from packaging.requirements import Requirement
68
+
69
+ project = tomllib.loads((ROOT.parent / "pyproject.toml").read_text())["project"]
70
+ declared = list(project.get("dependencies", []))
71
+ for extra in project.get("optional-dependencies", {}).values():
72
+ declared.extend(extra)
73
+ sdk = [Requirement(value) for value in declared if value.startswith("scion-sdk")]
74
+ assert sdk
75
+ for requirement in sdk:
76
+ assert requirement.specifier.contains("0.5.6")
77
+ assert not requirement.specifier.contains("0.5.5")
78
+
79
+
80
+ def test_production_pack_binds_packaged_ontology_and_shapes():
81
+ import hashlib
82
+ from importlib.metadata import version
83
+
84
+ from agent_connector_sdk.artifacts.pack import build_content_pack
85
+ from agent_connector_sdk.artifacts.resources import ResourceArtifactKind
86
+ from agent_connector_sdk.ports.session import TransportEndpoint
87
+ from agent_connector_sdk.transports.mcp import McpTransport
88
+
89
+ async def capture():
90
+ async with McpTransport().session(
91
+ TransportEndpoint(in_process=_server())
92
+ ) as session:
93
+ return await build_content_pack(
94
+ session, connector="wger-mcp", kinds=(ResourceArtifactKind(),)
95
+ )
96
+
97
+ pack = asyncio.run(capture())
98
+ assert pack.server_package_version == version("wger-agent")
99
+ entries = {str(entry.uri): entry for entry in pack.archive.entries}
100
+ assert "connector://resources" in entries
101
+ for path in ROOT.glob("ontology/**/*.ttl"):
102
+ scheme = "shapes" if path.parent.name == "shapes" else "ontology"
103
+ uri = f"{scheme}://wger-mcp/{path.name}"
104
+ assert entries[uri].body.sha256 == hashlib.sha256(path.read_bytes()).hexdigest()
105
+
106
+
107
+ def test_canonical_and_legacy_routes_preserve_the_full_tool_surface():
108
+ from agent_connector_sdk.connector import build_server
109
+
110
+ async def capture():
111
+ _, canonical = build_server(PACKAGE, command_args=["--transport", "stdio", "--auth-type", "none"])
112
+ async with Client(_server()) as legacy_client, Client(canonical) as canonical_client:
113
+ legacy = {tool.name: tool.model_dump(mode="json") for tool in await legacy_client.list_tools()}
114
+ declared = {tool.name: tool.model_dump(mode="json") for tool in await canonical_client.list_tools()}
115
+ assert len(legacy) == 135
116
+ assert declared == legacy
117
+
118
+ asyncio.run(capture())
119
+
120
+
121
+ def test_legacy_cli_configuration_file_still_controls_host_and_port(tmp_path, monkeypatch):
122
+ import json
123
+ from wger_agent.mcp_server import get_mcp_instance
124
+
125
+ config = tmp_path / "connector.json"
126
+ config.write_text(json.dumps({"HOST": "127.0.0.1", "PORT": 9187}))
127
+ monkeypatch.delenv("HOST", raising=False)
128
+ monkeypatch.delenv("PORT", raising=False)
129
+ monkeypatch.setenv("CONNECTOR_CONFIG_FILE", str(config))
130
+ _, args, _ = get_mcp_instance(command_args=["--transport", "stdio", "--auth-type", "none"])
131
+ assert (args.host, args.port) == ("127.0.0.1", 9187)
@@ -35,7 +35,7 @@ def _call_connectors(path: Path) -> list[str]:
35
35
  def test_connector_name_is_the_fleet_name() -> None:
36
36
  pyproject = tomllib.loads((ROOT / "pyproject.toml").read_text(encoding="utf-8"))
37
37
  assert pyproject["project"]["entry-points"]["agent_connector_sdk.connector"] == {
38
- FLEET: "wger_agent"
38
+ FLEET: "wger_agent:connector"
39
39
  }
40
40
  assert connector_name("wger_agent") == FLEET
41
41
  for module in sorted(PACKAGE.glob("*.py")):
@@ -0,0 +1,82 @@
1
+ """Keep docs pushes separate from guarded package publication."""
2
+
3
+ from fnmatch import fnmatchcase
4
+ from pathlib import Path
5
+
6
+ import pytest
7
+ import yaml
8
+
9
+ ROOT = Path(__file__).resolve().parents[1]
10
+
11
+
12
+ def _workflow(name):
13
+ return yaml.safe_load((ROOT / ".github/workflows" / name).read_text())
14
+
15
+
16
+ def _push_matches(workflow, ref):
17
+ # PyYAML's YAML 1.1 reader represents the Actions "on" key as True.
18
+ push = workflow[True]["push"]
19
+ kind, name = ref.removeprefix("refs/").split("/", 1)
20
+ filters = push.get({"heads": "branches", "tags": "tags"}[kind], [])
21
+ return any(fnmatchcase(name, pattern) for pattern in filters)
22
+
23
+
24
+ @pytest.mark.parametrize(
25
+ "ref, expected",
26
+ [
27
+ ("refs/heads/main", True),
28
+ ("refs/heads/docs-update", False),
29
+ ("refs/tags/v2.1.0", False),
30
+ ],
31
+ )
32
+ def test_only_main_starts_package_publication(ref, expected):
33
+ assert _push_matches(_workflow("pipeline.yml"), ref) is expected
34
+
35
+
36
+ def test_each_package_publisher_uses_the_shared_pipelines():
37
+ jobs = _workflow("pipeline.yml")["jobs"]
38
+ assert set(jobs) == {"publish-pypi"}
39
+ assert jobs["publish-pypi"]["uses"].endswith("/python_pipeline.yml@main")
40
+ assert _workflow("pipeline.yml")[True]["push"]["paths-ignore"] == [
41
+ "docker/Dockerfile",
42
+ ".bumpversion.cfg",
43
+ "specs/**/status.json",
44
+ ]
45
+ container = _workflow("container-release.yml")
46
+ assert container[True]["push"] == {
47
+ "branches": ["main"],
48
+ "paths": ["docker/Dockerfile"],
49
+ }
50
+ assert container["jobs"]["publish-docker"]["needs"] == "verify-public-wheel"
51
+ assert container["jobs"]["publish-docker"]["uses"].endswith(
52
+ "/container_pipeline.yml@main"
53
+ )
54
+ for publisher in (jobs["publish-pypi"], container["jobs"]["publish-docker"]):
55
+ assert "if" not in publisher
56
+ assert not publisher.get("continue-on-error", False)
57
+ guard = container["jobs"]["verify-public-wheel"]["steps"][-1]
58
+ assert guard["with"] == {
59
+ "mode": "published-wheel",
60
+ "distribution": "wger-agent",
61
+ "module": "wger_agent",
62
+ }
63
+
64
+
65
+
66
+ @pytest.mark.parametrize(
67
+ "path, expected",
68
+ [
69
+ ("docker/Dockerfile", False),
70
+ (".bumpversion.cfg", False),
71
+ ("specs/connector-content/status.json", False),
72
+ ("wger_agent/specs/openapi.json", True),
73
+ ("pyproject.toml", True),
74
+ ("uv.lock", True),
75
+ ("wger_agent/mcp_server.py", True),
76
+ ("README.md", True),
77
+ (".github/workflows/pipeline.yml", True),
78
+ ],
79
+ )
80
+ def test_package_publication_skips_only_container_pin_refresh(path, expected):
81
+ ignores = _workflow("pipeline.yml")[True]["push"]["paths-ignore"]
82
+ assert (not any(fnmatchcase(path, pattern) for pattern in ignores)) is expected
@@ -0,0 +1,47 @@
1
+ """The published wheel preserves tracked resources and excludes bytecode."""
2
+
3
+ import shutil
4
+ import subprocess
5
+ from pathlib import Path
6
+ from zipfile import ZipFile
7
+
8
+
9
+ def _clean_build_source(root, destination):
10
+ paths = (
11
+ subprocess.check_output(["git", "ls-files", "-z"], cwd=root)
12
+ .decode()
13
+ .split("\0")
14
+ )
15
+ for name in filter(None, paths):
16
+ source = root / name
17
+ if source.is_file():
18
+ target = destination / name
19
+ target.parent.mkdir(parents=True, exist_ok=True)
20
+ shutil.copy2(source, target)
21
+ cache = destination / "wger_agent/connectors/__pycache__/unshipped.pyc"
22
+ cache.parent.mkdir(parents=True, exist_ok=True)
23
+ cache.write_bytes(b"bytecode must not enter a wheel")
24
+
25
+
26
+ def test_wheel_matches_the_full_tracked_package_inventory(tmp_path):
27
+ root = Path(__file__).resolve().parents[1]
28
+ tracked = subprocess.check_output(
29
+ ["git", "ls-tree", "-r", "--name-only", "HEAD", "--", "wger_agent/"],
30
+ cwd=root,
31
+ text=True,
32
+ ).splitlines()
33
+ source = tmp_path / "source"
34
+ _clean_build_source(root, source)
35
+ output = tmp_path / "dist"
36
+ subprocess.run(
37
+ ["uv", "build", "--wheel", "--out-dir", str(output)], cwd=source, check=True
38
+ )
39
+ with ZipFile(next(output.glob("*.whl"))) as wheel:
40
+ payload = {
41
+ name
42
+ for name in wheel.namelist()
43
+ if name.startswith("wger_agent/") and not name.endswith("/")
44
+ }
45
+ assert payload == set(tracked)
46
+ for name in payload:
47
+ assert wheel.read(name) == (root / name).read_bytes(), name
@@ -86,3 +86,20 @@ def __getattr__(name: str) -> Any:
86
86
 
87
87
  def __dir__() -> list[str]:
88
88
  return sorted(list(globals().keys()) + __all__)
89
+
90
+
91
+ from agent_connector_sdk.connector import Connector
92
+ from agent_connector_sdk.connector_hooks import RegistrationContext
93
+
94
+
95
+ def _register_legacy_surface(context: RegistrationContext) -> None:
96
+ """Register the existing Wger surface through the public SDK hook."""
97
+ from wger_agent.mcp.mcp_server import register_server_surface
98
+
99
+ register_server_surface(context.server)
100
+
101
+
102
+ connector = Connector(
103
+ instructions="wger-agent MCP Server — Condensed Action-Routed Tools.",
104
+ extra_registrations=(_register_legacy_surface,),
105
+ )
@@ -7,7 +7,6 @@ Served live as ``connector://resources``. Regenerate by editing the declarations
7
7
  from __future__ import annotations
8
8
 
9
9
  from agent_connector_sdk.ingest.live_declaration import source_meta
10
- from agent_connector_sdk.ingest.sources import IngestSourceDeclaration, IngestSourceSpec
11
10
 
12
11
  CONNECTOR = "wger-mcp"
13
12
 
@@ -533,22 +532,3 @@ RESOURCES = (
533
532
  "name": "WorkoutSession",
534
533
  },
535
534
  )
536
-
537
-
538
- def declaration() -> IngestSourceDeclaration:
539
- """The declaration the server assembles from this module."""
540
- specs = []
541
- for item in SOURCES:
542
- for entry in item["connector_sources"]:
543
- body = {k: v for k, v in entry.items() if k not in ("tool", "mapping")}
544
- specs.append(
545
- IngestSourceSpec.model_validate({**body, "tools": (entry["tool"],)})
546
- )
547
- return IngestSourceDeclaration.model_validate(
548
- {
549
- "connector": CONNECTOR,
550
- "sources": specs,
551
- "schema_mappings": SCHEMA_MAPPINGS,
552
- "resources": RESOURCES,
553
- }
554
- )
@@ -23,7 +23,8 @@ import sys
23
23
  from typing import Any
24
24
 
25
25
  from agent_connector_sdk.config import load_config
26
- from agent_connector_sdk.mcp.server import create_mcp_server
26
+ from agent_connector_sdk.connector import build_server
27
+ from agent_connector_sdk.connector_identity import connector_version
27
28
  from agent_connector_sdk.mcp.tool_surface import register_tool_surface
28
29
  from starlette.requests import Request
29
30
  from starlette.responses import JSONResponse
@@ -32,23 +33,14 @@ from wger_agent.api_client import WgerApi
32
33
  from wger_agent.auth import get_client
33
34
  from wger_agent.mcp import tools
34
35
 
35
- __version__ = "0.14.0"
36
+ __version__ = connector_version("wger_agent")
36
37
 
37
38
  logger = get_logger(name="wger-agent")
38
39
  logger.setLevel(logging.INFO)
39
40
 
40
41
 
41
- def get_mcp_instance() -> tuple[Any, ...]:
42
- """Initialize and return the MCP instance.
43
-
44
- Bootstraps FastMCP instance, custom routes, and conditionally registers tools.
45
- """
46
- load_config()
47
- args, mcp, middlewares = create_mcp_server(
48
- name="wger-agent MCP",
49
- version=__version__,
50
- instructions="wger-agent MCP Server — Condensed Action-Routed Tools.",
51
- )
42
+ def register_server_surface(mcp):
43
+ """Reuse the existing health route and Wger API registrations."""
52
44
 
53
45
  @mcp.custom_route("/health", methods=["GET"])
54
46
  async def health_check(request: Request | None = None) -> JSONResponse:
@@ -63,9 +55,12 @@ def get_mcp_instance() -> tuple[Any, ...]:
63
55
  tools_module=tools,
64
56
  )
65
57
 
66
- for mw in middlewares:
67
- mcp.add_middleware(mw)
68
- return mcp, args, middlewares
58
+
59
+ def get_mcp_instance(*, command_args=None) -> tuple[Any, ...]:
60
+ """Load legacy configuration and compose the declared SDK connector."""
61
+ load_config()
62
+ args, mcp = build_server("wger_agent", command_args=command_args)
63
+ return mcp, args, list(mcp.middleware)
69
64
 
70
65
 
71
66
  def mcp_server() -> None:
@@ -1,7 +1,9 @@
1
1
  # wger_agent/mcp_server.py
2
2
  """Backward compatibility wrapper redirecting to wger_agent/mcp/ package."""
3
3
 
4
- __version__ = "2.2.4"
4
+ from agent_connector_sdk.connector_identity import connector_version
5
+
6
+ __version__ = connector_version("wger_agent")
5
7
 
6
8
  from wger_agent.mcp.mcp_server import (
7
9
  get_mcp_instance,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wger-agent
3
- Version: 2.2.4
3
+ Version: 2.2.5
4
4
  Summary: Wger Workout Manager — exercise database, workout routines, nutrition plans, body measurements, and progress tracking.
5
5
  Author-email: Project Maintainers <maintainers@users.noreply.github.com>
6
6
  License: MIT
@@ -12,12 +12,12 @@ Classifier: Programming Language :: Python :: 3
12
12
  Requires-Python: <3.15,>=3.12
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
- Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.4.1
15
+ Requires-Dist: scion-sdk[mcp]<1.0.0,>=0.5.6
16
16
  Requires-Dist: requests>=2.34.2
17
17
  Provides-Extra: mcp
18
- Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.4.1; extra == "mcp"
18
+ Requires-Dist: scion-sdk[mcp]<1.0.0,>=0.5.6; extra == "mcp"
19
19
  Provides-Extra: all
20
- Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.4.1; extra == "all"
20
+ Requires-Dist: scion-sdk[mcp]<1.0.0,>=0.5.6; extra == "all"
21
21
  Provides-Extra: test
22
22
  Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
23
23
  Requires-Dist: pytest>=9.1.1; extra == "test"
@@ -47,7 +47,7 @@ Dynamic: license-file
47
47
  ![PyPI - Wheel](https://img.shields.io/pypi/wheel/wger-agent)
48
48
  ![PyPI - Implementation](https://img.shields.io/pypi/implementation/wger-agent)
49
49
 
50
- *Version: 2.2.4*
50
+ *Version: 2.2.5*
51
51
 
52
52
  > **Documentation** — Installation, deployment, usage across the MCP, API, and agent
53
53
  > interfaces, and guidance for provisioning the Wger Workout Manager platform are
@@ -14,6 +14,8 @@ tests/test_fleet_name.py
14
14
  tests/test_init.py
15
15
  tests/test_init_dynamics.py
16
16
  tests/test_kg_ingest.py
17
+ tests/test_publication_workflow.py
18
+ tests/test_wheel_inventory.py
17
19
  wger_agent/__init__.py
18
20
  wger_agent/__main__.py
19
21
  wger_agent/api_client.py
@@ -1,14 +1,8 @@
1
1
  [agent_connector_sdk.connector]
2
- wger-mcp = wger_agent
3
-
4
- [agent_connector_sdk.ontology_providers]
5
- wger-agent = wger_agent.ontology
2
+ wger-mcp = wger_agent:connector
6
3
 
7
4
  [agent_connector_sdk.prompt_providers]
8
5
  wger-agent = wger_agent.prompts
9
6
 
10
- [agent_connector_sdk.skill_providers]
11
- wger-agent = wger_agent.skills
12
-
13
7
  [console_scripts]
14
8
  wger-mcp = wger_agent.mcp_server:mcp_server
@@ -0,0 +1,14 @@
1
+ scion-sdk[mcp]<1.0.0,>=0.5.6
2
+ requests>=2.34.2
3
+
4
+ [all]
5
+ scion-sdk[mcp]<1.0.0,>=0.5.6
6
+
7
+ [mcp]
8
+ scion-sdk[mcp]<1.0.0,>=0.5.6
9
+
10
+ [test]
11
+ pytest-xdist>=3.8.0
12
+ pytest>=9.1.1
13
+ pytest-asyncio>=1.4.0
14
+ pytest-cov>=7.1.0
@@ -1,43 +0,0 @@
1
- """CONN-WGER-AGENT-CONNECTOR-CONTENT-R001: the server lists its packaged skills, ontology and prompts by default."""
2
-
3
- from __future__ import annotations
4
-
5
- import asyncio
6
- import importlib
7
- from pathlib import Path
8
-
9
- import pytest
10
- from fastmcp import Client
11
-
12
- PACKAGE = "wger_agent"
13
- ROOT = Path(list(importlib.import_module(PACKAGE).__path__)[0])
14
-
15
- pytestmark = pytest.mark.spec("CONN-WGER-AGENT-CONNECTOR-CONTENT-R001")
16
-
17
-
18
- def _server():
19
- namespace = {"__name__": PACKAGE + ".mcp_server"}
20
- exec(
21
- "from agent_connector_sdk.mcp.server import create_mcp_server\n"
22
- "result = create_mcp_server('wger-mcp', version='0', command_args=[])",
23
- namespace,
24
- )
25
- return namespace["result"][1]
26
-
27
-
28
- async def _listings():
29
- async with Client(_server()) as client:
30
- resources = {str(r.uri) for r in await client.list_resources()}
31
- prompts = {p.name for p in await client.list_prompts()}
32
- return resources, prompts
33
-
34
-
35
- def test_default_content_surfaces() -> None:
36
- resources, prompts = asyncio.run(_listings())
37
- if list(ROOT.glob("skills/*/SKILL.md")):
38
- assert any(u.startswith("skill://") for u in resources)
39
- if list(ROOT.glob("ontology/*.ttl")):
40
- assert any(u.startswith("ontology://wger-mcp/") for u in resources)
41
- for path in ROOT.glob("prompts/*.json"):
42
- if not path.name.startswith("_"):
43
- assert path.stem in prompts
@@ -1,14 +0,0 @@
1
- agent-connector-sdk[mcp]<1.0.0,>=0.4.1
2
- requests>=2.34.2
3
-
4
- [all]
5
- agent-connector-sdk[mcp]<1.0.0,>=0.4.1
6
-
7
- [mcp]
8
- agent-connector-sdk[mcp]<1.0.0,>=0.4.1
9
-
10
- [test]
11
- pytest-xdist>=3.8.0
12
- pytest>=9.1.1
13
- pytest-asyncio>=1.4.0
14
- pytest-cov>=7.1.0
File without changes
File without changes
File without changes
File without changes
File without changes