listmonk-api 2.3.5__tar.gz → 2.3.7__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.
- {listmonk_api-2.3.5/listmonk_api.egg-info → listmonk_api-2.3.7}/PKG-INFO +8 -8
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/README.md +6 -6
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/__init__.py +1 -1
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/__main__.py +1 -1
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/api/api_client_base.py +2 -2
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/api/api_client_campaigns.py +4 -5
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/api/api_client_lists.py +4 -5
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/api/api_client_subscribers.py +4 -5
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/auth.py +3 -3
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/connector_sources.py +1 -1
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/kg_ingest.py +2 -2
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/mcp_server.py +3 -3
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/models.py +24 -23
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/ontology/__init__.py +2 -2
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/ontology/certification.json +2 -2
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/ontology/listmonk.ttl +1 -1
- listmonk_api-2.3.7/listmonk_api/skills/listmonk-api-development/SKILL.md +116 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/skills/listmonk-campaign-management/SKILL.md +1 -1
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/skills/listmonk-subscriber-lists/SKILL.md +1 -1
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/skills/listmonk-transactional-messaging/SKILL.md +1 -1
- {listmonk_api-2.3.5 → listmonk_api-2.3.7/listmonk_api.egg-info}/PKG-INFO +8 -8
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api.egg-info/SOURCES.txt +2 -0
- listmonk_api-2.3.7/listmonk_api.egg-info/entry_points.txt +5 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api.egg-info/requires.txt +1 -1
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/pyproject.toml +5 -5
- listmonk_api-2.3.7/requirements.txt +1 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/tests/test_api_clients.py +4 -2
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/tests/test_auth_and_server.py +4 -5
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/tests/test_fleet_name.py +2 -2
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/tests/test_init.py +3 -8
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/tests/test_kg_ingest.py +10 -11
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/tests/test_mcp_server.py +6 -4
- listmonk_api-2.3.7/tests/test_publication_workflow.py +54 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/tests/test_startup.py +0 -2
- listmonk_api-2.3.5/listmonk_api.egg-info/entry_points.txt +0 -5
- listmonk_api-2.3.5/requirements.txt +0 -1
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/LICENSE +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/MANIFEST.in +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/api/__init__.py +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/api/api_client_import_api.py +1 -1
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/api/api_client_media.py +1 -1
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/api/api_client_templates.py +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/api/api_client_transactional.py +1 -1
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/api_client.py +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/mcp_config.json +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/ontology/fixtures/records.json +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/ontology/mappings/source.yaml +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/ontology/migrations/manifest.json +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/ontology/shapes/connector.shacl.ttl +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/skills/listmonk-api-operations/SKILL.md +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/skills/listmonk-api-operations/agents/openai.yaml +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/skills/listmonk-api-operations/references/catalog.md +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/skills/listmonk-campaign-management/WORKFLOW.md +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/skills/listmonk-subscriber-lists/WORKFLOW.md +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/skills/listmonk-transactional-messaging/WORKFLOW.md +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api.egg-info/dependency_links.txt +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api.egg-info/top_level.txt +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/setup.cfg +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/tests/conftest.py +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/tests/test_action_discovery.py +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/tests/test_init_dynamics.py +0 -0
- {listmonk_api-2.3.5 → listmonk_api-2.3.7}/tests/test_token_auth.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: listmonk-api
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.7
|
|
4
4
|
Summary: Agent package for Listmonk
|
|
5
5
|
Author-email: Repository Maintainers <maintainers@knuckles.team>
|
|
6
6
|
License: MIT
|
|
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
12
12
|
Requires-Python: >=3.12
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist:
|
|
15
|
+
Requires-Dist: scion-sdk[mcp]<0.7.0,>=0.6.3
|
|
16
16
|
Requires-Dist: requests>=2.34.2
|
|
17
17
|
Provides-Extra: test
|
|
18
18
|
Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
|
|
@@ -162,7 +162,7 @@ When query strings or parameters are supplied, an LLM-free **Knowledge Graph res
|
|
|
162
162
|
<!-- MCP-CONFIG-EXAMPLES:START -->
|
|
163
163
|
|
|
164
164
|
> **Install the connector-focused `[mcp]` extra.** Examples use `listmonk-api[mcp]` to add
|
|
165
|
-
> FastMCP / FastAPI through `
|
|
165
|
+
> FastMCP / FastAPI through `scion-sdk`; the required Scion SDK core
|
|
166
166
|
> still carries `epistemic-graph[full]`. The `[agent-runtime]` extra additionally
|
|
167
167
|
> enables model orchestration.
|
|
168
168
|
|
|
@@ -389,7 +389,7 @@ Detailed graph node architecture explanations, custom skill configurations, and
|
|
|
389
389
|
|
|
390
390
|
## Security & Governance
|
|
391
391
|
|
|
392
|
-
Built directly upon the enterprise-ready [`
|
|
392
|
+
Built directly upon the enterprise-ready [`scion-sdk`](https://github.com/Knuckles-Team/scion-sdk) core, standard security parameters are fully supported:
|
|
393
393
|
|
|
394
394
|
### Access Control & Policy Enforcement
|
|
395
395
|
- **Eunomia Policies:** Fine-grained, policy-driven tool authorization. Supports `none`, local `embedded` (`mcp_policies.json`), or centralized `remote` modes.
|
|
@@ -442,7 +442,7 @@ Built directly upon the enterprise-ready [`agent-connector-sdk`](https://github.
|
|
|
442
442
|
| `LISTMONK_TEMPLATESTOOL` | `True` | |
|
|
443
443
|
| `LISTMONK_TXTOOL` | `True` | |
|
|
444
444
|
|
|
445
|
-
#### Inherited
|
|
445
|
+
#### Inherited scion-sdk variables (apply to every connector)
|
|
446
446
|
|
|
447
447
|
| Variable | Example | Description |
|
|
448
448
|
|----------|---------|-------------|
|
|
@@ -463,7 +463,7 @@ Built directly upon the enterprise-ready [`agent-connector-sdk`](https://github.
|
|
|
463
463
|
| `MODEL_ID` | `gpt-4o` | Model id for the agent |
|
|
464
464
|
| `ENABLE_WEB_UI` | `True` | Serve the AG-UI web interface |
|
|
465
465
|
|
|
466
|
-
_28 package + 16 inherited variable(s). Auto-generated from `.env.example` + the shared
|
|
466
|
+
_28 package + 16 inherited variable(s). Auto-generated from `.env.example` + the shared scion-sdk set — do not edit._
|
|
467
467
|
<!-- ENV-VARS-TABLE:END -->
|
|
468
468
|
|
|
469
469
|
|
|
@@ -504,7 +504,7 @@ Pick the extra that matches what the operator want to run:
|
|
|
504
504
|
|
|
505
505
|
| Extra | Installs | Use when |
|
|
506
506
|
|-------|----------|----------|
|
|
507
|
-
| `listmonk-api[mcp]` | Connector-focused MCP server (`
|
|
507
|
+
| `listmonk-api[mcp]` | Connector-focused MCP server (`scion-sdk` — FastMCP/FastAPI + `epistemic-graph[full]`) | The operator only run the **MCP server** (smallest install / image) |
|
|
508
508
|
| `listmonk-api[all]` | Everything (`mcp` + `agent` + `logfire`) | Development / both surfaces |
|
|
509
509
|
|
|
510
510
|
```bash
|
|
@@ -533,7 +533,7 @@ agent (`immutable agent digest`) with a co-located `:mcp` sidecar.
|
|
|
533
533
|
|
|
534
534
|
### Knowledge-graph database (`epistemic-graph`)
|
|
535
535
|
|
|
536
|
-
|
|
536
|
+
Scion SDK core dependency (`epistemic-graph[full]`). The `[mcp]` extra keeps
|
|
537
537
|
deployments can use the bundled engine. For production or shared state, run
|
|
538
538
|
**epistemic-graph as a dedicated database service** and configure the runtime to use it.
|
|
539
539
|
Deployment recipes (single-node + Raft HA), connection configuration, and architecture
|
|
@@ -139,7 +139,7 @@ When query strings or parameters are supplied, an LLM-free **Knowledge Graph res
|
|
|
139
139
|
<!-- MCP-CONFIG-EXAMPLES:START -->
|
|
140
140
|
|
|
141
141
|
> **Install the connector-focused `[mcp]` extra.** Examples use `listmonk-api[mcp]` to add
|
|
142
|
-
> FastMCP / FastAPI through `
|
|
142
|
+
> FastMCP / FastAPI through `scion-sdk`; the required Scion SDK core
|
|
143
143
|
> still carries `epistemic-graph[full]`. The `[agent-runtime]` extra additionally
|
|
144
144
|
> enables model orchestration.
|
|
145
145
|
|
|
@@ -366,7 +366,7 @@ Detailed graph node architecture explanations, custom skill configurations, and
|
|
|
366
366
|
|
|
367
367
|
## Security & Governance
|
|
368
368
|
|
|
369
|
-
Built directly upon the enterprise-ready [`
|
|
369
|
+
Built directly upon the enterprise-ready [`scion-sdk`](https://github.com/Knuckles-Team/scion-sdk) core, standard security parameters are fully supported:
|
|
370
370
|
|
|
371
371
|
### Access Control & Policy Enforcement
|
|
372
372
|
- **Eunomia Policies:** Fine-grained, policy-driven tool authorization. Supports `none`, local `embedded` (`mcp_policies.json`), or centralized `remote` modes.
|
|
@@ -419,7 +419,7 @@ Built directly upon the enterprise-ready [`agent-connector-sdk`](https://github.
|
|
|
419
419
|
| `LISTMONK_TEMPLATESTOOL` | `True` | |
|
|
420
420
|
| `LISTMONK_TXTOOL` | `True` | |
|
|
421
421
|
|
|
422
|
-
#### Inherited
|
|
422
|
+
#### Inherited scion-sdk variables (apply to every connector)
|
|
423
423
|
|
|
424
424
|
| Variable | Example | Description |
|
|
425
425
|
|----------|---------|-------------|
|
|
@@ -440,7 +440,7 @@ Built directly upon the enterprise-ready [`agent-connector-sdk`](https://github.
|
|
|
440
440
|
| `MODEL_ID` | `gpt-4o` | Model id for the agent |
|
|
441
441
|
| `ENABLE_WEB_UI` | `True` | Serve the AG-UI web interface |
|
|
442
442
|
|
|
443
|
-
_28 package + 16 inherited variable(s). Auto-generated from `.env.example` + the shared
|
|
443
|
+
_28 package + 16 inherited variable(s). Auto-generated from `.env.example` + the shared scion-sdk set — do not edit._
|
|
444
444
|
<!-- ENV-VARS-TABLE:END -->
|
|
445
445
|
|
|
446
446
|
|
|
@@ -481,7 +481,7 @@ Pick the extra that matches what the operator want to run:
|
|
|
481
481
|
|
|
482
482
|
| Extra | Installs | Use when |
|
|
483
483
|
|-------|----------|----------|
|
|
484
|
-
| `listmonk-api[mcp]` | Connector-focused MCP server (`
|
|
484
|
+
| `listmonk-api[mcp]` | Connector-focused MCP server (`scion-sdk` — FastMCP/FastAPI + `epistemic-graph[full]`) | The operator only run the **MCP server** (smallest install / image) |
|
|
485
485
|
| `listmonk-api[all]` | Everything (`mcp` + `agent` + `logfire`) | Development / both surfaces |
|
|
486
486
|
|
|
487
487
|
```bash
|
|
@@ -510,7 +510,7 @@ agent (`immutable agent digest`) with a co-located `:mcp` sidecar.
|
|
|
510
510
|
|
|
511
511
|
### Knowledge-graph database (`epistemic-graph`)
|
|
512
512
|
|
|
513
|
-
|
|
513
|
+
Scion SDK core dependency (`epistemic-graph[full]`). The `[mcp]` extra keeps
|
|
514
514
|
deployments can use the bundled engine. For production or shared state, run
|
|
515
515
|
**epistemic-graph as a dedicated database service** and configure the runtime to use it.
|
|
516
516
|
Deployment recipes (single-node + Raft HA), connection configuration, and architecture
|
|
@@ -94,7 +94,7 @@ def __dir__() -> list[str]:
|
|
|
94
94
|
return sorted(list(globals().keys()) + __all__)
|
|
95
95
|
|
|
96
96
|
|
|
97
|
-
from
|
|
97
|
+
from scion_sdk.connector import Connector
|
|
98
98
|
|
|
99
99
|
from listmonk_api.api_client import ListmonkAPI
|
|
100
100
|
from listmonk_api.auth import get_client
|
|
@@ -2,8 +2,8 @@ from dataclasses import dataclass, field
|
|
|
2
2
|
from typing import Any
|
|
3
3
|
|
|
4
4
|
import requests
|
|
5
|
-
from
|
|
6
|
-
from
|
|
5
|
+
from scion_sdk.tls.profile import ResolvedTLSProfile
|
|
6
|
+
from scion_sdk.tls.resolve import resolve_tls_profile
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
@dataclass(frozen=True)
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
from
|
|
1
|
+
from listmonk_api.api.api_client_base import BaseApiClient, PaginationRequest
|
|
2
2
|
from listmonk_api.models import (
|
|
3
3
|
CampaignCreateRequest,
|
|
4
4
|
CampaignStatusRequest,
|
|
5
5
|
)
|
|
6
|
-
from listmonk_api.api.api_client_base import BaseApiClient, PaginationRequest
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class ListmonkAPI(BaseApiClient):
|
|
10
9
|
def get_campaigns(
|
|
11
10
|
self,
|
|
12
|
-
query:
|
|
13
|
-
order_by:
|
|
14
|
-
order:
|
|
11
|
+
query: dict | None = None,
|
|
12
|
+
order_by: str | None = None,
|
|
13
|
+
order: str | None = None,
|
|
15
14
|
max_pages: int = 0,
|
|
16
15
|
per_page: int = 100,
|
|
17
16
|
):
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
from
|
|
1
|
+
from listmonk_api.api.api_client_base import BaseApiClient, PaginationRequest
|
|
2
2
|
from listmonk_api.models import (
|
|
3
3
|
ListCreateRequest,
|
|
4
4
|
ListEditRequest,
|
|
5
5
|
)
|
|
6
|
-
from listmonk_api.api.api_client_base import BaseApiClient, PaginationRequest
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class ListmonkAPI(BaseApiClient):
|
|
10
9
|
def get_lists(
|
|
11
10
|
self,
|
|
12
|
-
query:
|
|
13
|
-
order_by:
|
|
14
|
-
order:
|
|
11
|
+
query: dict | None = None,
|
|
12
|
+
order_by: str | None = None,
|
|
13
|
+
order: str | None = None,
|
|
15
14
|
max_pages: int = 0,
|
|
16
15
|
per_page: int = 100,
|
|
17
16
|
):
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
from
|
|
1
|
+
from listmonk_api.api.api_client_base import BaseApiClient, PaginationRequest
|
|
2
2
|
from listmonk_api.models import (
|
|
3
3
|
SubscriberCreateRequest,
|
|
4
4
|
)
|
|
5
|
-
from listmonk_api.api.api_client_base import BaseApiClient, PaginationRequest
|
|
6
5
|
|
|
7
6
|
|
|
8
|
-
def _list_id_filter(list_id:
|
|
7
|
+
def _list_id_filter(list_id: int | list[int] | None) -> str:
|
|
9
8
|
"""Build the ``&list_id=...`` query-filter suffix for one or many list ids."""
|
|
10
9
|
if not list_id:
|
|
11
10
|
return ""
|
|
@@ -17,8 +16,8 @@ def _list_id_filter(list_id: Optional[Union[int, List[int]]]) -> str:
|
|
|
17
16
|
class ListmonkAPI(BaseApiClient):
|
|
18
17
|
def get_subscribers(
|
|
19
18
|
self,
|
|
20
|
-
query:
|
|
21
|
-
list_id:
|
|
19
|
+
query: dict | None = None,
|
|
20
|
+
list_id: int | list[int] | None = None,
|
|
22
21
|
max_pages: int = 0,
|
|
23
22
|
per_page: int = 100,
|
|
24
23
|
):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
from
|
|
2
|
-
from
|
|
3
|
-
from
|
|
1
|
+
from scion_sdk.config import setting
|
|
2
|
+
from scion_sdk.exceptions import AuthError, UnauthorizedError
|
|
3
|
+
from scion_sdk.tls.resolve import resolve_tls_profile
|
|
4
4
|
|
|
5
5
|
from listmonk_api.api_client import ListmonkAPI
|
|
6
6
|
|
|
@@ -6,7 +6,7 @@ Served live as ``connector://resources``. Regenerate by editing the declarations
|
|
|
6
6
|
# ruff: noqa: E501
|
|
7
7
|
from __future__ import annotations
|
|
8
8
|
|
|
9
|
-
from
|
|
9
|
+
from scion_sdk.ingest.live_declaration import source_meta
|
|
10
10
|
|
|
11
11
|
SOURCES = (
|
|
12
12
|
source_meta(
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
CONCEPT:AU-KG.ingest.enterprise-source-extractor. The listmonk-api connector pushes
|
|
4
4
|
campaigns/lists/subscribers into the ONE epistemic-graph knowledge graph as **typed
|
|
5
5
|
OWL nodes** (``:Campaign``, ``:SubscriptionList``, ``:Subscriber``, ``:EmailTemplate``)
|
|
6
|
-
+ text bodies as ``:Document`` nodes, through ``
|
|
6
|
+
+ text bodies as ``:Document`` nodes, through ``scion_sdk.ingest`` -- the
|
|
7
7
|
generated ``SourceIngest`` client, not a local ingestion helper.
|
|
8
8
|
"""
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ from __future__ import annotations
|
|
|
12
12
|
import logging
|
|
13
13
|
from typing import Any
|
|
14
14
|
|
|
15
|
-
from
|
|
15
|
+
from scion_sdk.ingest import (
|
|
16
16
|
ChangeSet,
|
|
17
17
|
Document,
|
|
18
18
|
Entity,
|
|
@@ -29,9 +29,9 @@ import sys
|
|
|
29
29
|
from threading import local
|
|
30
30
|
from typing import Any
|
|
31
31
|
|
|
32
|
-
from
|
|
33
|
-
from
|
|
34
|
-
from
|
|
32
|
+
from scion_sdk.config import setting
|
|
33
|
+
from scion_sdk.connector_hooks import RegistrationContext
|
|
34
|
+
from scion_sdk.mcp.action_dispatch import resolve_action
|
|
35
35
|
|
|
36
36
|
from listmonk_api.auth import get_client
|
|
37
37
|
|
|
@@ -1,42 +1,43 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
1
3
|
from pydantic import AliasChoices, BaseModel, Field
|
|
2
|
-
from typing import Optional, List, Dict, Any
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
class SubscriberCreateRequest(BaseModel):
|
|
6
7
|
email: str
|
|
7
8
|
name: str
|
|
8
9
|
status: str
|
|
9
|
-
lists:
|
|
10
|
-
attribs:
|
|
11
|
-
preconfirm_subscriptions:
|
|
10
|
+
lists: list[int] | None = None
|
|
11
|
+
attribs: dict[str, Any] | None = None
|
|
12
|
+
preconfirm_subscriptions: bool | None = True
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
class ListCreateRequest(BaseModel):
|
|
15
16
|
name: str
|
|
16
17
|
type: str # visibility_type: 'public' or 'private'
|
|
17
18
|
optin: str # 'single' or 'double'
|
|
18
|
-
tags:
|
|
19
|
+
tags: list[str] | None = None
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
class ListEditRequest(BaseModel):
|
|
22
|
-
name:
|
|
23
|
-
type:
|
|
24
|
-
optin:
|
|
25
|
-
tags:
|
|
23
|
+
name: str | None = None
|
|
24
|
+
type: str | None = None
|
|
25
|
+
optin: str | None = None
|
|
26
|
+
tags: list[str] | None = None
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
class ImportSubscribersRequest(BaseModel):
|
|
29
30
|
file: str # Base64 encoded or content depending on Listmonk API docs, wait, Listmonk expects binary upload or text? The wrapper takes 'file' as text or base64. Wait, the old wrapper did json dump with `file`... wait, it actually just sent `{"file": "..."}`.
|
|
30
31
|
mode: str
|
|
31
32
|
delim: str = ","
|
|
32
|
-
lists:
|
|
33
|
+
lists: list[int]
|
|
33
34
|
overwrite: bool = True
|
|
34
35
|
|
|
35
36
|
|
|
36
37
|
class CampaignCreateRequest(BaseModel):
|
|
37
38
|
name: str
|
|
38
39
|
subject: str
|
|
39
|
-
lists:
|
|
40
|
+
lists: list[int]
|
|
40
41
|
from_email: str
|
|
41
42
|
# Issue #3: listmonk's create-campaign payload key is "type" (older wrappers
|
|
42
43
|
# used "send_type"). Accept either on input (legacy "send_type" or "type"),
|
|
@@ -48,16 +49,16 @@ class CampaignCreateRequest(BaseModel):
|
|
|
48
49
|
)
|
|
49
50
|
content_type: str
|
|
50
51
|
body: str
|
|
51
|
-
altbody:
|
|
52
|
-
send_at:
|
|
53
|
-
messenger:
|
|
54
|
-
template_id:
|
|
55
|
-
tags:
|
|
52
|
+
altbody: str | None = None
|
|
53
|
+
send_at: str | None = None
|
|
54
|
+
messenger: str | None = None
|
|
55
|
+
template_id: int | None = None
|
|
56
|
+
tags: list[str] | None = None
|
|
56
57
|
# Issue #4: attach uploaded media to a campaign. Listmonk campaigns reference
|
|
57
58
|
# attachments by media ID (upload first via the Media API), serialized as the
|
|
58
59
|
# "media" key, e.g. {"media": [1, 2]}. (Base64/file attachments are a
|
|
59
60
|
# transactional-message feature — see TransactionalMessageRequest.)
|
|
60
|
-
media:
|
|
61
|
+
media: list[int] | None = None
|
|
61
62
|
|
|
62
63
|
|
|
63
64
|
class CampaignStatusRequest(BaseModel):
|
|
@@ -74,10 +75,10 @@ class TemplateDefaultRequest(BaseModel):
|
|
|
74
75
|
|
|
75
76
|
class TransactionalMessageRequest(BaseModel):
|
|
76
77
|
template_id: int
|
|
77
|
-
subscriber_email:
|
|
78
|
-
subscriber_id:
|
|
79
|
-
data:
|
|
80
|
-
headers:
|
|
81
|
-
content_type:
|
|
78
|
+
subscriber_email: str | None = None
|
|
79
|
+
subscriber_id: int | None = None
|
|
80
|
+
data: dict[str, Any] | None = None
|
|
81
|
+
headers: list[dict[str, str]] | None = None
|
|
82
|
+
content_type: str | None = None
|
|
82
83
|
# Fix: Added attachment support
|
|
83
|
-
attachments:
|
|
84
|
+
attachments: list[dict[str, str]] | None = None
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Listmonk ontology contribution (CONCEPT:AU-KG.ontology.federation-provider-leg).
|
|
2
2
|
|
|
3
3
|
Data-only subpackage: it carries ``listmonk.ttl`` (the ``owl:Ontology``
|
|
4
|
-
``http://knuckles.team/kg/listmonk`` module) which the
|
|
5
|
-
the ``
|
|
4
|
+
``http://knuckles.team/kg/listmonk`` module) which the scion-sdk hub federates in via
|
|
5
|
+
the ``scion_sdk.ontology_providers`` entry-point. It holds no business logic
|
|
6
6
|
and no heavy imports so the hub can resolve it cheaply.
|
|
7
7
|
"""
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"api_version": "graphos.io/v1",
|
|
3
3
|
"artifacts": {
|
|
4
4
|
"listmonk_api/ontology/fixtures/records.json": "3bfc9ad808b89d144406d45d220b63c8c40e969068f525844780c02a91e88b3a",
|
|
5
|
-
"listmonk_api/ontology/listmonk.ttl": "
|
|
5
|
+
"listmonk_api/ontology/listmonk.ttl": "7f508ce7abc1ccb8ee8b87e680daa2e6c9592a814dc3abf61d72a232ea9d3c37",
|
|
6
6
|
"listmonk_api/ontology/mappings/source.yaml": "30a210462b94e96490ad68d8e3958b9018486a84e48a3338995c69fa0103fa12",
|
|
7
7
|
"listmonk_api/ontology/migrations/manifest.json": "dcc939c0c761d526c8ec9fd65b0738c519bdc71f7b5d50156b3930057c77ff66",
|
|
8
8
|
"listmonk_api/ontology/shapes/connector.shacl.ttl": "154123bcff104aa4716d3ff7a6f1187ed00a5fe0efad8ced25d002d7aa376472"
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"signer": "UNSIGNED-PREVIEW",
|
|
30
30
|
"signing_public_key": "",
|
|
31
31
|
"status": "source-validated",
|
|
32
|
-
"validated_at": "2026-10-
|
|
32
|
+
"validated_at": "2026-10-30T22:45:21Z"
|
|
33
33
|
}
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
rdfs:label "Listmonk Email-Marketing Ontology" ;
|
|
117
117
|
rdfs:comment """Listmonk newsletter and mailing-list model — campaigns, subscription
|
|
118
118
|
lists, subscribers, email templates and transactional messages, with their targeting,
|
|
119
|
-
subscription and templating relationships — federated into the
|
|
119
|
+
subscription and templating relationships — federated into the scion-sdk
|
|
120
120
|
knowledge-graph hub. Reuses the shared :Person and :Document classes.""" .
|
|
121
121
|
|
|
122
122
|
# ontology-codemod R3
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: listmonk-api-development
|
|
3
|
+
skill_type: skill
|
|
4
|
+
description: >-
|
|
5
|
+
Develop and verify listmonk-api as a connector-owned package while preserving
|
|
6
|
+
its SDK entry point, action-routed tools, Listmonk authentication boundary,
|
|
7
|
+
packaged content, and source-backed spec-delivery publication.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Listmonk API Development
|
|
11
|
+
|
|
12
|
+
Use this skill for changes to the `listmonk-api` connector. The package owns
|
|
13
|
+
Listmonk API calls, mappings, MCP tools, and connector content; it does not own
|
|
14
|
+
the connector SDK, Arbora admission, the shared Pages renderer, or Pipelines
|
|
15
|
+
hooks.
|
|
16
|
+
|
|
17
|
+
## Repository map and runtime boundary
|
|
18
|
+
|
|
19
|
+
- `listmonk_api/__init__.py` creates the SDK `Connector` with `ListmonkAPI`,
|
|
20
|
+
`get_client`, and `listmonk_api.mcp_server` as its tool module. Preserve this
|
|
21
|
+
wiring when changing a tool or client.
|
|
22
|
+
- `listmonk_api/mcp_server.py` registers the action-routed domains
|
|
23
|
+
`subscribers`, `lists`, `imports`, `campaigns`, `media`, `templates`, `tx`,
|
|
24
|
+
and `ingest`, plus prompt registration. The domain API classes live under
|
|
25
|
+
`listmonk_api/api/` and are composed by `listmonk_api/api_client.py`.
|
|
26
|
+
- `listmonk_api/auth.py` reads `LISTMONK_URL`, `LISTMONK_TOKEN`, and optional
|
|
27
|
+
`LISTMONK_USERNAME` through the SDK setting boundary and resolves the named
|
|
28
|
+
`listmonk` TLS profile from `LISTMONK_TLS_PROFILE` or
|
|
29
|
+
`LISTMONK_TLS_PROFILE_REF`.
|
|
30
|
+
- `listmonk_api/ontology/`, `listmonk_api/prompts/`, and
|
|
31
|
+
`listmonk_api/skills/` are packaged connector content. The package-data table
|
|
32
|
+
in `pyproject.toml` includes `skills/**`, `prompts/**`, `ontology/**`, and
|
|
33
|
+
`connectors/**`; inspect a built wheel when changing these files.
|
|
34
|
+
- The only declared current console script is `listmonk-mcp`, provided by
|
|
35
|
+
`scion_sdk.cli:serve`; `python -m listmonk_api` delegates to the SDK
|
|
36
|
+
runner. The tracked `docker/compose.yml` and older docs still mention a
|
|
37
|
+
`listmonk-agent` profile, but current `pyproject.toml` declares no such script
|
|
38
|
+
or `agent_server.py`. Do not invent that runtime or rewrite it as part of a
|
|
39
|
+
Pages/skill change.
|
|
40
|
+
|
|
41
|
+
## Rapid delivery: the 5-minute contract
|
|
42
|
+
|
|
43
|
+
1. Read the owning `specs/` row and this repository's `AGENTS.md` before editing.
|
|
44
|
+
2. Inspect the active client/tool path and its focused tests before changing API
|
|
45
|
+
behavior, auth, ontology content, or packaged skills.
|
|
46
|
+
3. Prefer the smallest connector-owned change. Preserve action names, parameter
|
|
47
|
+
schemas, SDK `Connector` wiring, Listmonk auth/TLS verification, and package
|
|
48
|
+
data declarations unless the owning requirement changes them.
|
|
49
|
+
4. Run the focused tests through the narrow test-slot wrapper, then run the
|
|
50
|
+
repository pre-commit and pre-push gates without bypasses.
|
|
51
|
+
5. For public packaged content, update the patch version and `uv.lock` together;
|
|
52
|
+
inspect the built wheel for the new skill.
|
|
53
|
+
6. Treat Pages as a separate proof: after the exact main SHA has a successful
|
|
54
|
+
Pages run, check `/spec-delivery/`, its `index.html`, and `snapshot.json` over
|
|
55
|
+
HTTPS and record the revision from the snapshot.
|
|
56
|
+
|
|
57
|
+
## Focused development commands
|
|
58
|
+
|
|
59
|
+
From the repository root:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
uv sync --locked
|
|
63
|
+
|
|
64
|
+
/var/tmp/arbora-delivery/scale/run-narrow-test-slot.sh \
|
|
65
|
+
uv run --locked --extra test pytest -q \
|
|
66
|
+
tests/test_init.py \
|
|
67
|
+
tests/test_init_dynamics.py \
|
|
68
|
+
tests/test_action_discovery.py \
|
|
69
|
+
tests/test_auth_and_server.py \
|
|
70
|
+
tests/test_mcp_server.py \
|
|
71
|
+
tests/test_publication_workflow.py
|
|
72
|
+
|
|
73
|
+
uvx pre-commit run --all-files
|
|
74
|
+
uvx pre-commit run --all-files --hook-stage pre-push
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
These checks cover SDK server construction, runtime entry points, action
|
|
78
|
+
discovery, auth/tool behavior, and the Pages/release contract. Do not replace
|
|
79
|
+
them with a live Listmonk call or a credential-bearing test.
|
|
80
|
+
|
|
81
|
+
## Pages and package publication
|
|
82
|
+
|
|
83
|
+
`.github/workflows/pages.yml` is the one Pages caller. It invokes the shared
|
|
84
|
+
Pipelines `pages_pipeline.yml@main` with `content_source: docs` and the version 1
|
|
85
|
+
`.github/spec-dashboard.json` source declaration for `specs/*/status.json`.
|
|
86
|
+
Keep manual dispatch and the docs/spec/config/workflow path filters. The old
|
|
87
|
+
direct `mkdocs gh-deploy` publisher must not be restored because it would compete
|
|
88
|
+
with the shared dashboard build.
|
|
89
|
+
|
|
90
|
+
After a merge, verify the exact main SHA in the successful Pages run and probe:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
curl -fsSI https://knuckles-team.github.io/listmonk-api/
|
|
94
|
+
curl -fsSI https://knuckles-team.github.io/listmonk-api/spec-delivery/
|
|
95
|
+
curl -fsSI https://knuckles-team.github.io/listmonk-api/spec-delivery/index.html
|
|
96
|
+
curl -fsS https://knuckles-team.github.io/listmonk-api/spec-delivery/snapshot.json
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Keep `.github/workflows/pipeline.yml` on the shared `connector: true` and
|
|
100
|
+
`render_connector: true` flags. Central generation owns generated connector
|
|
101
|
+
manifests and release container artifacts; preserve this package's existing
|
|
102
|
+
runtime/auth/port semantics and inspect generated output before making claims.
|
|
103
|
+
|
|
104
|
+
## Change discipline
|
|
105
|
+
|
|
106
|
+
- Keep Listmonk API calls, request models, ontology mappings, and MCP schemas
|
|
107
|
+
under this repository's `CONN-LISTMONK-API-*` boundary. SDK transport and
|
|
108
|
+
central renderer behavior belong to their owner repositories.
|
|
109
|
+
- Use `LISTMONK_URL`, `LISTMONK_TOKEN`, and `LISTMONK_USERNAME` only in injected
|
|
110
|
+
runtime configuration; never print or commit their values. Preserve TLS
|
|
111
|
+
certificate verification and the named profile path.
|
|
112
|
+
- For mutations, inspect current state first, require operator approval where
|
|
113
|
+
the existing connector procedure calls for it, and verify the result. Keep KG
|
|
114
|
+
ingestion opt-in and preserve its provenance/tenant contract.
|
|
115
|
+
- Keep generated status changes and central promotion with the Pipelines/status
|
|
116
|
+
owner. Do not claim Pages or public package results from a local build.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: listmonk-api
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.7
|
|
4
4
|
Summary: Agent package for Listmonk
|
|
5
5
|
Author-email: Repository Maintainers <maintainers@knuckles.team>
|
|
6
6
|
License: MIT
|
|
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
12
12
|
Requires-Python: >=3.12
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist:
|
|
15
|
+
Requires-Dist: scion-sdk[mcp]<0.7.0,>=0.6.3
|
|
16
16
|
Requires-Dist: requests>=2.34.2
|
|
17
17
|
Provides-Extra: test
|
|
18
18
|
Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
|
|
@@ -162,7 +162,7 @@ When query strings or parameters are supplied, an LLM-free **Knowledge Graph res
|
|
|
162
162
|
<!-- MCP-CONFIG-EXAMPLES:START -->
|
|
163
163
|
|
|
164
164
|
> **Install the connector-focused `[mcp]` extra.** Examples use `listmonk-api[mcp]` to add
|
|
165
|
-
> FastMCP / FastAPI through `
|
|
165
|
+
> FastMCP / FastAPI through `scion-sdk`; the required Scion SDK core
|
|
166
166
|
> still carries `epistemic-graph[full]`. The `[agent-runtime]` extra additionally
|
|
167
167
|
> enables model orchestration.
|
|
168
168
|
|
|
@@ -389,7 +389,7 @@ Detailed graph node architecture explanations, custom skill configurations, and
|
|
|
389
389
|
|
|
390
390
|
## Security & Governance
|
|
391
391
|
|
|
392
|
-
Built directly upon the enterprise-ready [`
|
|
392
|
+
Built directly upon the enterprise-ready [`scion-sdk`](https://github.com/Knuckles-Team/scion-sdk) core, standard security parameters are fully supported:
|
|
393
393
|
|
|
394
394
|
### Access Control & Policy Enforcement
|
|
395
395
|
- **Eunomia Policies:** Fine-grained, policy-driven tool authorization. Supports `none`, local `embedded` (`mcp_policies.json`), or centralized `remote` modes.
|
|
@@ -442,7 +442,7 @@ Built directly upon the enterprise-ready [`agent-connector-sdk`](https://github.
|
|
|
442
442
|
| `LISTMONK_TEMPLATESTOOL` | `True` | |
|
|
443
443
|
| `LISTMONK_TXTOOL` | `True` | |
|
|
444
444
|
|
|
445
|
-
#### Inherited
|
|
445
|
+
#### Inherited scion-sdk variables (apply to every connector)
|
|
446
446
|
|
|
447
447
|
| Variable | Example | Description |
|
|
448
448
|
|----------|---------|-------------|
|
|
@@ -463,7 +463,7 @@ Built directly upon the enterprise-ready [`agent-connector-sdk`](https://github.
|
|
|
463
463
|
| `MODEL_ID` | `gpt-4o` | Model id for the agent |
|
|
464
464
|
| `ENABLE_WEB_UI` | `True` | Serve the AG-UI web interface |
|
|
465
465
|
|
|
466
|
-
_28 package + 16 inherited variable(s). Auto-generated from `.env.example` + the shared
|
|
466
|
+
_28 package + 16 inherited variable(s). Auto-generated from `.env.example` + the shared scion-sdk set — do not edit._
|
|
467
467
|
<!-- ENV-VARS-TABLE:END -->
|
|
468
468
|
|
|
469
469
|
|
|
@@ -504,7 +504,7 @@ Pick the extra that matches what the operator want to run:
|
|
|
504
504
|
|
|
505
505
|
| Extra | Installs | Use when |
|
|
506
506
|
|-------|----------|----------|
|
|
507
|
-
| `listmonk-api[mcp]` | Connector-focused MCP server (`
|
|
507
|
+
| `listmonk-api[mcp]` | Connector-focused MCP server (`scion-sdk` — FastMCP/FastAPI + `epistemic-graph[full]`) | The operator only run the **MCP server** (smallest install / image) |
|
|
508
508
|
| `listmonk-api[all]` | Everything (`mcp` + `agent` + `logfire`) | Development / both surfaces |
|
|
509
509
|
|
|
510
510
|
```bash
|
|
@@ -533,7 +533,7 @@ agent (`immutable agent digest`) with a co-located `:mcp` sidecar.
|
|
|
533
533
|
|
|
534
534
|
### Knowledge-graph database (`epistemic-graph`)
|
|
535
535
|
|
|
536
|
-
|
|
536
|
+
Scion SDK core dependency (`epistemic-graph[full]`). The `[mcp]` extra keeps
|
|
537
537
|
deployments can use the bundled engine. For production or shared state, run
|
|
538
538
|
**epistemic-graph as a dedicated database service** and configure the runtime to use it.
|
|
539
539
|
Deployment recipes (single-node + Raft HA), connection configuration, and architecture
|
|
@@ -34,6 +34,7 @@ listmonk_api/ontology/fixtures/records.json
|
|
|
34
34
|
listmonk_api/ontology/mappings/source.yaml
|
|
35
35
|
listmonk_api/ontology/migrations/manifest.json
|
|
36
36
|
listmonk_api/ontology/shapes/connector.shacl.ttl
|
|
37
|
+
listmonk_api/skills/listmonk-api-development/SKILL.md
|
|
37
38
|
listmonk_api/skills/listmonk-api-operations/SKILL.md
|
|
38
39
|
listmonk_api/skills/listmonk-api-operations/agents/openai.yaml
|
|
39
40
|
listmonk_api/skills/listmonk-api-operations/references/catalog.md
|
|
@@ -52,5 +53,6 @@ tests/test_init.py
|
|
|
52
53
|
tests/test_init_dynamics.py
|
|
53
54
|
tests/test_kg_ingest.py
|
|
54
55
|
tests/test_mcp_server.py
|
|
56
|
+
tests/test_publication_workflow.py
|
|
55
57
|
tests/test_startup.py
|
|
56
58
|
tests/test_token_auth.py
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "listmonk-api"
|
|
7
|
-
version = "2.3.
|
|
7
|
+
version = "2.3.7"
|
|
8
8
|
description = "Agent package for Listmonk"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Repository Maintainers", email = "maintainers@knuckles.team" }]
|
|
@@ -17,7 +17,7 @@ classifiers = [
|
|
|
17
17
|
"Programming Language :: Python :: 3"]
|
|
18
18
|
requires-python = ">=3.12"
|
|
19
19
|
dependencies = [
|
|
20
|
-
"
|
|
20
|
+
"scion-sdk[mcp]>=0.6.3,<0.7.0",
|
|
21
21
|
"requests>=2.34.2",
|
|
22
22
|
]
|
|
23
23
|
|
|
@@ -25,10 +25,10 @@ dependencies = [
|
|
|
25
25
|
test = [ "pytest-xdist>=3.8.0", "pytest>=9.1.1", "pytest-asyncio>=1.4.0", "pytest-cov>=7.1.0",]
|
|
26
26
|
|
|
27
27
|
[project.scripts]
|
|
28
|
-
listmonk-mcp = "
|
|
28
|
+
listmonk-mcp = "scion_sdk.cli:serve"
|
|
29
29
|
|
|
30
|
-
# The one declared connector identity: the fleet name (
|
|
31
|
-
[project.entry-points."
|
|
30
|
+
# The one declared connector identity: the fleet name (SCION-CONNECTOR-CONTROL-R071).
|
|
31
|
+
[project.entry-points."scion_sdk.connector"]
|
|
32
32
|
listmonk-mcp = "listmonk_api:connector"
|
|
33
33
|
|
|
34
34
|
[tool.setuptools.packages.find]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
scion-sdk[mcp]>=0.6.3,<0.7.0
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
from unittest.mock import patch
|
|
2
|
+
|
|
2
3
|
import pytest
|
|
3
|
-
from
|
|
4
|
-
|
|
4
|
+
from scion_sdk.exceptions import AuthError
|
|
5
|
+
|
|
5
6
|
from listmonk_api.auth import get_client
|
|
6
7
|
|
|
7
8
|
# ==============================================================================
|
|
@@ -55,5 +56,3 @@ def test_get_client_auth_error(mock_listmonk_api):
|
|
|
55
56
|
# ==============================================================================
|
|
56
57
|
# Agent Server Launcher CLI Tests
|
|
57
58
|
# ==============================================================================
|
|
58
|
-
|
|
59
|
-
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from agent_connector_sdk.connector_identity import connector_name
|
|
6
5
|
import ast
|
|
7
6
|
import tomllib
|
|
8
7
|
from pathlib import Path
|
|
9
8
|
|
|
10
9
|
import pytest
|
|
10
|
+
from scion_sdk.connector_identity import connector_name
|
|
11
11
|
|
|
12
12
|
ROOT = Path(__file__).resolve().parents[1]
|
|
13
13
|
PACKAGE = ROOT / "listmonk_api"
|
|
@@ -34,7 +34,7 @@ def _call_connectors(path: Path) -> list[str]:
|
|
|
34
34
|
@pytest.mark.spec("CONN-LISTMONK-API-R004")
|
|
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
|
-
assert pyproject["project"]["entry-points"]["
|
|
37
|
+
assert pyproject["project"]["entry-points"]["scion_sdk.connector"] == {
|
|
38
38
|
FLEET: "listmonk_api:connector"
|
|
39
39
|
}
|
|
40
40
|
assert connector_name("listmonk_api") == FLEET
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import pytest
|
|
3
|
-
from unittest.mock import patch, MagicMock
|
|
4
|
-
import listmonk_api
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
from unittest.mock import patch
|
|
7
2
|
|
|
3
|
+
import pytest
|
|
8
4
|
|
|
5
|
+
import listmonk_api
|
|
9
6
|
|
|
10
7
|
|
|
11
8
|
def test_init_attribute_error():
|
|
@@ -28,5 +25,3 @@ def test_init_import_error_handling():
|
|
|
28
25
|
|
|
29
26
|
res = _import_module_safely("listmonk_api.non_existent")
|
|
30
27
|
assert res is None
|
|
31
|
-
|
|
32
|
-
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"""Epistemic-graph typed-node + document ingestion -- Wire-First coverage for listmonk-api.
|
|
2
2
|
|
|
3
3
|
Exercises the real ``ingest_entities`` / ``ingest_documents`` / ``ingest_campaigns`` /
|
|
4
|
-
``ingest_lists`` / ``ingest_subscribers`` seam against a fake ``
|
|
4
|
+
``ingest_lists`` / ``ingest_subscribers`` seam against a fake ``scion_sdk.ingest``
|
|
5
5
|
transport (no engine required). The real SDK request builder
|
|
6
|
-
(``
|
|
6
|
+
(``scion_sdk.ingest.request.build_request``) still runs, so a malformed change
|
|
7
7
|
set and the PII privacy guard are still exercised by the SDK's own contract, not
|
|
8
8
|
re-derived here; only the final network commit is faked.
|
|
9
9
|
CONCEPT:AU-KG.ingest.enterprise-source-extractor.
|
|
@@ -15,7 +15,7 @@ from types import SimpleNamespace
|
|
|
15
15
|
from typing import Any
|
|
16
16
|
|
|
17
17
|
import pytest
|
|
18
|
-
from
|
|
18
|
+
from scion_sdk.ingest import IngestError, KnowledgeIngest
|
|
19
19
|
from epistemic_graph.generated.source_ingestion import SourceIngestionRequest
|
|
20
20
|
|
|
21
21
|
from listmonk_api.kg_ingest import (
|
|
@@ -34,7 +34,9 @@ class _FakeTransport:
|
|
|
34
34
|
self.requests: list[SourceIngestionRequest] = []
|
|
35
35
|
|
|
36
36
|
async def source_status(self, _connector: str, _stream: str) -> Any:
|
|
37
|
-
return SimpleNamespace(
|
|
37
|
+
return SimpleNamespace(
|
|
38
|
+
connector=_connector, stream=_stream, accepted_checkpoint=None
|
|
39
|
+
)
|
|
38
40
|
|
|
39
41
|
async def submit(self, request: SourceIngestionRequest) -> Any:
|
|
40
42
|
self.requests.append(request)
|
|
@@ -85,7 +87,8 @@ async def test_ingest_documents_writes_document_nodes(ingest):
|
|
|
85
87
|
)
|
|
86
88
|
assert res == {"nodes": 1, "edges": 0}
|
|
87
89
|
record = next(
|
|
88
|
-
r
|
|
90
|
+
r
|
|
91
|
+
for r in transport.requests[0].records
|
|
89
92
|
if r.record_id == "listmonk:campaign:1:body"
|
|
90
93
|
)
|
|
91
94
|
assert record.payload["text"] == "<h1>Hi</h1>"
|
|
@@ -124,9 +127,7 @@ async def test_ingest_campaigns_maps_campaign_list_template_and_body(ingest):
|
|
|
124
127
|
assert camp.payload["externalToolId"] == "42"
|
|
125
128
|
assert any(r.record_id == "listmonk:list:3" for r in all_records)
|
|
126
129
|
assert any(r.record_id == "listmonk:template:5" for r in all_records)
|
|
127
|
-
body = next(
|
|
128
|
-
r for r in all_records if r.record_id == "listmonk:campaign:42:body"
|
|
129
|
-
)
|
|
130
|
+
body = next(r for r in all_records if r.record_id == "listmonk:campaign:42:body")
|
|
130
131
|
assert body.payload["text"] == "<p>hello</p>"
|
|
131
132
|
edge_types = {r.relation_reference.rsplit("/", 1)[-1] for r in all_relationships}
|
|
132
133
|
assert edge_types == {"targetsList", "usesTemplate", "hasBody"}
|
|
@@ -167,9 +168,7 @@ async def test_ingest_subscribers_maps_subscriber_and_membership(ingest):
|
|
|
167
168
|
)
|
|
168
169
|
assert res == {"nodes": 1, "edges": 1}
|
|
169
170
|
request = transport.requests[0]
|
|
170
|
-
record = next(
|
|
171
|
-
r for r in request.records if r.record_id == "listmonk:subscriber:9"
|
|
172
|
-
)
|
|
171
|
+
record = next(r for r in request.records if r.record_id == "listmonk:subscriber:9")
|
|
173
172
|
# the SDK's PersistencePrivacyGuard redacts email-shaped values by default.
|
|
174
173
|
assert record.payload["email"] == "[REDACTED_EMAIL]"
|
|
175
174
|
assert record.payload["subscriberStatus"] == "enabled"
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import pytest
|
|
2
1
|
from unittest.mock import Mock
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
3
4
|
from fastmcp import FastMCP
|
|
5
|
+
|
|
4
6
|
from listmonk_api.mcp_server import (
|
|
5
|
-
register_listmonk_subscribers_tools,
|
|
6
|
-
register_listmonk_lists_tools,
|
|
7
|
-
register_listmonk_imports_tools,
|
|
8
7
|
register_listmonk_campaigns_tools,
|
|
8
|
+
register_listmonk_imports_tools,
|
|
9
|
+
register_listmonk_lists_tools,
|
|
9
10
|
register_listmonk_media_tools,
|
|
11
|
+
register_listmonk_subscribers_tools,
|
|
10
12
|
register_listmonk_templates_tools,
|
|
11
13
|
register_listmonk_tx_tools,
|
|
12
14
|
)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""Keep the connector's shared Pages and publication contracts explicit."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import tomllib
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
import yaml
|
|
8
|
+
|
|
9
|
+
ROOT = Path(__file__).resolve().parents[1]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _workflow(name: str):
|
|
13
|
+
return yaml.safe_load((ROOT / ".github/workflows" / name).read_text())
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _actions_on(workflow):
|
|
17
|
+
# PyYAML's YAML 1.1 reader represents the Actions ``on`` key as True.
|
|
18
|
+
return workflow["on"] if "on" in workflow else workflow[True]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def test_pages_publishes_spec_dashboard_and_supports_manual_refresh():
|
|
22
|
+
|
|
23
|
+
config = json.loads((ROOT / ".github/spec-dashboard.json").read_text())
|
|
24
|
+
assert config == {
|
|
25
|
+
"version": 1,
|
|
26
|
+
"sources": [{"glob": "specs/*/status.json", "kind": "spec"}],
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def test_single_pages_publisher_and_release_flags_remain_canonical():
|
|
31
|
+
assert not (ROOT / ".github/workflows/docs.yml").exists()
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def test_development_skill_and_runtime_entrypoints_match_source_tree():
|
|
35
|
+
skill = ROOT / "listmonk_api/skills/listmonk-api-development/SKILL.md"
|
|
36
|
+
content = skill.read_text()
|
|
37
|
+
|
|
38
|
+
assert "name: listmonk-api-development" in content
|
|
39
|
+
assert "## Rapid delivery: the 5-minute contract" in content
|
|
40
|
+
for path in (
|
|
41
|
+
"listmonk_api/__init__.py",
|
|
42
|
+
"listmonk_api/auth.py",
|
|
43
|
+
"listmonk_api/mcp_server.py",
|
|
44
|
+
"listmonk_api/api_client.py",
|
|
45
|
+
"tests/test_action_discovery.py",
|
|
46
|
+
"tests/test_auth_and_server.py",
|
|
47
|
+
):
|
|
48
|
+
assert (ROOT / path).exists(), path
|
|
49
|
+
|
|
50
|
+
project = tomllib.loads((ROOT / "pyproject.toml").read_text())["project"]
|
|
51
|
+
assert project["scripts"]["listmonk-mcp"] == "scion_sdk.cli:serve"
|
|
52
|
+
assert project["entry-points"]["scion_sdk.connector"]["listmonk-mcp"] == (
|
|
53
|
+
"listmonk_api:connector"
|
|
54
|
+
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
agent-connector-sdk[mcp]>=0.4.1,<1.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
|
{listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/skills/listmonk-api-operations/SKILL.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{listmonk_api-2.3.5 → listmonk_api-2.3.7}/listmonk_api/skills/listmonk-subscriber-lists/WORKFLOW.md
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
|