nextcloud-agent 2.4.0__tar.gz → 2.4.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.
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/PKG-INFO +1 -1
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/__init__.py +2 -2
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/auth.py +24 -11
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/ontology/certification.json +1 -1
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent.egg-info/PKG-INFO +1 -1
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/pyproject.toml +1 -1
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/tests/test_auth.py +17 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/LICENSE +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/README.md +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/__main__.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/api/__init__.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/api/api_client_base.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/api/api_client_calendar.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/api/api_client_contacts.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/api/api_client_files.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/api/xml_security.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/api_client.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/connector_sources.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/kg_ingest.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/mcp_config.json +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/mcp_server.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/ontology/__init__.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/ontology/fixtures/records.json +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/ontology/mappings/source.yaml +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/ontology/migrations/manifest.json +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/ontology/nextcloud.ttl +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/ontology/shapes/connector.shacl.ttl +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/prompts/file_steward.json +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/skills/nextcloud-agent-development/SKILL.md +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/skills/nextcloud-agent-operations/SKILL.md +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/skills/nextcloud-agent-operations/agents/openai.yaml +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/skills/nextcloud-agent-operations/references/catalog.md +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/skills/nextcloud-files/SKILL.md +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/skills/nextcloud-files/WORKFLOW.md +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/skills/nextcloud-ingest/SKILL.md +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/skills/nextcloud-ingest/WORKFLOW.md +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/skills/nextcloud-shares/SKILL.md +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/skills/nextcloud-shares/WORKFLOW.md +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent.egg-info/SOURCES.txt +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent.egg-info/dependency_links.txt +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent.egg-info/entry_points.txt +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent.egg-info/requires.txt +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent.egg-info/top_level.txt +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/setup.cfg +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/tests/conftest.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/tests/test_api_client.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/tests/test_files_webdav.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/tests/test_fleet_name.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/tests/test_init.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/tests/test_init_dynamics.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/tests/test_kg_ingest.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/tests/test_mcp_server.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/tests/test_publication_workflow.py +0 -0
- {nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/tests/test_xml_security.py +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
from scion_sdk.connector import Connector
|
|
2
2
|
|
|
3
3
|
from nextcloud_agent.api_client import NextcloudAPI
|
|
4
|
-
from nextcloud_agent.auth import
|
|
4
|
+
from nextcloud_agent.auth import make_client
|
|
5
5
|
|
|
6
6
|
connector = Connector(
|
|
7
7
|
api=NextcloudAPI,
|
|
8
|
-
get_client=
|
|
8
|
+
get_client=make_client,
|
|
9
9
|
tools="nextcloud_agent.mcp_server",
|
|
10
10
|
instructions="nextcloud-agent MCP Server — Condensed Action-Routed Tools.",
|
|
11
11
|
)
|
|
@@ -8,19 +8,16 @@ from nextcloud_agent.api_client import NextcloudAPI
|
|
|
8
8
|
logger = logging.getLogger(__name__)
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
def
|
|
11
|
+
def make_client(
|
|
12
12
|
base_url: str | None = None,
|
|
13
13
|
username: str | None = None,
|
|
14
14
|
password: str | None = None,
|
|
15
|
-
):
|
|
16
|
-
"""
|
|
17
|
-
Yield a NextcloudAPI client and close it afterwards.
|
|
15
|
+
) -> NextcloudAPI:
|
|
16
|
+
"""Build one NextcloudAPI client from arguments or the connector settings.
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
CONCEPT:AU-OS.config.secrets-authentication
|
|
18
|
+
The SDK per-operation tools call this factory once per call
|
|
19
|
+
(CONN-NEXTCLOUD-AGENT-R002); ``get_client`` wraps it as a FastMCP
|
|
20
|
+
generator dependency that also closes the client.
|
|
24
21
|
"""
|
|
25
22
|
if not base_url:
|
|
26
23
|
base_url = setting("NEXTCLOUD_URL", None)
|
|
@@ -32,15 +29,31 @@ def get_client(
|
|
|
32
29
|
raise ValueError(
|
|
33
30
|
"Nextcloud URL, username, and password must be provided via arguments or environment variables."
|
|
34
31
|
)
|
|
35
|
-
|
|
36
32
|
try:
|
|
37
|
-
|
|
33
|
+
return NextcloudAPI(base_url=base_url, username=username, password=password)
|
|
38
34
|
except (AuthError, UnauthorizedError) as e:
|
|
39
35
|
raise RuntimeError(
|
|
40
36
|
"AUTHENTICATION ERROR: The configured credentials were rejected. "
|
|
41
37
|
f"Please check your NEXTCLOUD_USERNAME and NEXTCLOUD_PASSWORD environment variables. "
|
|
42
38
|
f"Error details: {type(e).__name__}"
|
|
43
39
|
) from e
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def get_client(
|
|
43
|
+
base_url: str | None = None,
|
|
44
|
+
username: str | None = None,
|
|
45
|
+
password: str | None = None,
|
|
46
|
+
):
|
|
47
|
+
"""
|
|
48
|
+
Yield a NextcloudAPI client and close it afterwards.
|
|
49
|
+
|
|
50
|
+
A plain generator, because FastMCP's ``Depends`` drives generator
|
|
51
|
+
dependencies itself; wrapping it in ``contextlib.contextmanager`` handed
|
|
52
|
+
every tool the context-manager object instead of the client.
|
|
53
|
+
|
|
54
|
+
CONCEPT:AU-OS.config.secrets-authentication
|
|
55
|
+
"""
|
|
56
|
+
client = make_client(base_url=base_url, username=username, password=password)
|
|
44
57
|
try:
|
|
45
58
|
yield client
|
|
46
59
|
finally:
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "nextcloud-agent"
|
|
7
|
-
version = "2.4.
|
|
7
|
+
version = "2.4.1"
|
|
8
8
|
description = "Nextcloud MCP Server for Agentic AI!"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
classifiers = [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Environment :: Console", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3",]
|
|
@@ -75,3 +75,20 @@ def test_get_client_is_a_generator_dependency_that_yields_the_client():
|
|
|
75
75
|
assert client.base_url == "https://x.test"
|
|
76
76
|
assert not hasattr(client, "__enter__") or hasattr(client, "get_user_info")
|
|
77
77
|
gen.close()
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
@pytest.mark.spec("CONN-NEXTCLOUD-AGENT-R002")
|
|
81
|
+
async def test_per_operation_tools_resolve_a_client_not_a_generator(monkeypatch):
|
|
82
|
+
"""The SDK per-operation tools call ``connector.get_client()`` directly."""
|
|
83
|
+
from scion_sdk.mcp._method_invoke import _resolve_client
|
|
84
|
+
|
|
85
|
+
from nextcloud_agent import connector
|
|
86
|
+
|
|
87
|
+
monkeypatch.setenv("NEXTCLOUD_URL", "https://cloud.example")
|
|
88
|
+
monkeypatch.setenv("NEXTCLOUD_USERNAME", "svc")
|
|
89
|
+
monkeypatch.setenv("NEXTCLOUD_PASSWORD", "pw")
|
|
90
|
+
client = await _resolve_client(connector.get_client)
|
|
91
|
+
try:
|
|
92
|
+
assert callable(client.list_files)
|
|
93
|
+
finally:
|
|
94
|
+
client.close()
|
|
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
|
{nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/ontology/fixtures/records.json
RENAMED
|
File without changes
|
{nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/ontology/mappings/source.yaml
RENAMED
|
File without changes
|
{nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/ontology/migrations/manifest.json
RENAMED
|
File without changes
|
|
File without changes
|
{nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/ontology/shapes/connector.shacl.ttl
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/skills/nextcloud-files/SKILL.md
RENAMED
|
File without changes
|
{nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/skills/nextcloud-files/WORKFLOW.md
RENAMED
|
File without changes
|
{nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/skills/nextcloud-ingest/SKILL.md
RENAMED
|
File without changes
|
{nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/skills/nextcloud-ingest/WORKFLOW.md
RENAMED
|
File without changes
|
{nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/skills/nextcloud-shares/SKILL.md
RENAMED
|
File without changes
|
{nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent/skills/nextcloud-shares/WORKFLOW.md
RENAMED
|
File without changes
|
|
File without changes
|
{nextcloud_agent-2.4.0 → nextcloud_agent-2.4.1}/nextcloud_agent.egg-info/dependency_links.txt
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|