listmonk-api 2.3.5__tar.gz → 2.3.6__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 (60) hide show
  1. {listmonk_api-2.3.5/listmonk_api.egg-info → listmonk_api-2.3.6}/PKG-INFO +1 -1
  2. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/api/api_client_campaigns.py +4 -5
  3. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/api/api_client_lists.py +4 -5
  4. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/api/api_client_subscribers.py +4 -5
  5. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/models.py +24 -23
  6. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/ontology/certification.json +1 -1
  7. listmonk_api-2.3.6/listmonk_api/skills/listmonk-api-development/SKILL.md +116 -0
  8. {listmonk_api-2.3.5 → listmonk_api-2.3.6/listmonk_api.egg-info}/PKG-INFO +1 -1
  9. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api.egg-info/SOURCES.txt +2 -0
  10. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/pyproject.toml +1 -1
  11. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/tests/test_api_clients.py +4 -2
  12. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/tests/test_auth_and_server.py +3 -4
  13. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/tests/test_init.py +3 -8
  14. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/tests/test_mcp_server.py +6 -4
  15. listmonk_api-2.3.6/tests/test_publication_workflow.py +86 -0
  16. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/tests/test_startup.py +0 -2
  17. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/LICENSE +0 -0
  18. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/MANIFEST.in +0 -0
  19. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/README.md +0 -0
  20. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/__init__.py +0 -0
  21. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/__main__.py +0 -0
  22. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/api/__init__.py +0 -0
  23. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/api/api_client_base.py +0 -0
  24. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/api/api_client_import_api.py +1 -1
  25. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/api/api_client_media.py +1 -1
  26. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/api/api_client_templates.py +0 -0
  27. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/api/api_client_transactional.py +1 -1
  28. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/api_client.py +0 -0
  29. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/auth.py +0 -0
  30. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/connector_sources.py +0 -0
  31. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/kg_ingest.py +0 -0
  32. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/mcp_config.json +0 -0
  33. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/mcp_server.py +0 -0
  34. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/ontology/__init__.py +0 -0
  35. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/ontology/fixtures/records.json +0 -0
  36. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/ontology/listmonk.ttl +0 -0
  37. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/ontology/mappings/source.yaml +0 -0
  38. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/ontology/migrations/manifest.json +0 -0
  39. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/ontology/shapes/connector.shacl.ttl +0 -0
  40. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/skills/listmonk-api-operations/SKILL.md +0 -0
  41. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/skills/listmonk-api-operations/agents/openai.yaml +0 -0
  42. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/skills/listmonk-api-operations/references/catalog.md +0 -0
  43. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/skills/listmonk-campaign-management/SKILL.md +0 -0
  44. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/skills/listmonk-campaign-management/WORKFLOW.md +0 -0
  45. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/skills/listmonk-subscriber-lists/SKILL.md +0 -0
  46. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/skills/listmonk-subscriber-lists/WORKFLOW.md +0 -0
  47. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/skills/listmonk-transactional-messaging/SKILL.md +0 -0
  48. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api/skills/listmonk-transactional-messaging/WORKFLOW.md +0 -0
  49. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api.egg-info/dependency_links.txt +0 -0
  50. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api.egg-info/entry_points.txt +0 -0
  51. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api.egg-info/requires.txt +0 -0
  52. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/listmonk_api.egg-info/top_level.txt +0 -0
  53. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/requirements.txt +0 -0
  54. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/setup.cfg +0 -0
  55. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/tests/conftest.py +0 -0
  56. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/tests/test_action_discovery.py +0 -0
  57. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/tests/test_fleet_name.py +1 -1
  58. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/tests/test_init_dynamics.py +0 -0
  59. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/tests/test_kg_ingest.py +0 -0
  60. {listmonk_api-2.3.5 → listmonk_api-2.3.6}/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.5
3
+ Version: 2.3.6
4
4
  Summary: Agent package for Listmonk
5
5
  Author-email: Repository Maintainers <maintainers@knuckles.team>
6
6
  License: MIT
@@ -1,17 +1,16 @@
1
- from typing import Optional, Dict
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: Optional[Dict] = None,
13
- order_by: Optional[str] = None,
14
- order: Optional[str] = None,
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 typing import Optional, Dict
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: Optional[Dict] = None,
13
- order_by: Optional[str] = None,
14
- order: Optional[str] = None,
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 typing import Optional, List, Dict, Union
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: Optional[Union[int, List[int]]]) -> str:
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: Optional[Dict] = None,
21
- list_id: Optional[Union[int, List[int]]] = None,
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,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: Optional[List[int]] = None
10
- attribs: Optional[Dict[str, Any]] = None
11
- preconfirm_subscriptions: Optional[bool] = True
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: Optional[List[str]] = None
19
+ tags: list[str] | None = None
19
20
 
20
21
 
21
22
  class ListEditRequest(BaseModel):
22
- name: Optional[str] = None
23
- type: Optional[str] = None
24
- optin: Optional[str] = None
25
- tags: Optional[List[str]] = None
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: List[int]
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: List[int]
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: Optional[str] = None
52
- send_at: Optional[str] = None
53
- messenger: Optional[str] = None
54
- template_id: Optional[int] = None
55
- tags: Optional[List[str]] = None
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: Optional[List[int]] = None
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: Optional[str] = None
78
- subscriber_id: Optional[int] = None
79
- data: Optional[Dict[str, Any]] = None
80
- headers: Optional[List[Dict[str, str]]] = None
81
- content_type: Optional[str] = None
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: Optional[List[Dict[str, str]]] = None
84
+ attachments: list[dict[str, str]] | None = None
@@ -29,5 +29,5 @@
29
29
  "signer": "UNSIGNED-PREVIEW",
30
30
  "signing_public_key": "",
31
31
  "status": "source-validated",
32
- "validated_at": "2026-10-24T13:19:21Z"
32
+ "validated_at": "2026-10-26T21:59:50Z"
33
33
  }
@@ -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
+ `agent_connector_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.5
3
+ Version: 2.3.6
4
4
  Summary: Agent package for Listmonk
5
5
  Author-email: Repository Maintainers <maintainers@knuckles.team>
6
6
  License: MIT
@@ -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.5"
7
+ version = "2.3.6"
8
8
  description = "Agent package for Listmonk"
9
9
  readme = "README.md"
10
10
  authors = [{ name = "Repository Maintainers", email = "maintainers@knuckles.team" }]
@@ -1,6 +1,8 @@
1
- import pytest
2
1
  from unittest.mock import Mock, patch
3
- from requests import Response, HTTPError
2
+
3
+ import pytest
4
+ from requests import Response
5
+
4
6
  from listmonk_api.api_client import ListmonkAPI
5
7
  from listmonk_api.models import (
6
8
  CampaignCreateRequest,
@@ -1,7 +1,8 @@
1
- import os
1
+ from unittest.mock import patch
2
+
2
3
  import pytest
3
- from unittest.mock import Mock, patch
4
4
  from agent_connector_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
-
@@ -1,11 +1,8 @@
1
- import sys
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,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,86 @@
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
+ workflow = _workflow("pages.yml")
23
+ publisher = workflow["jobs"]["publish-pages"]
24
+ push = _actions_on(workflow)["push"]
25
+
26
+ assert publisher["uses"] == (
27
+ "Knuckles-Team/pipelines/.github/workflows/pages_pipeline.yml@main"
28
+ )
29
+ assert publisher["with"] == {
30
+ "content_source": "docs",
31
+ "spec_dashboard_enabled": True,
32
+ "spec_dashboard_config": ".github/spec-dashboard.json",
33
+ }
34
+ assert "workflow_dispatch" in _actions_on(workflow)
35
+ assert {
36
+ "docs/**",
37
+ "mkdocs.yml",
38
+ "README.md",
39
+ "specs/**",
40
+ ".github/spec-dashboard.json",
41
+ ".github/workflows/pages.yml",
42
+ } <= set(push["paths"])
43
+
44
+ config = json.loads((ROOT / ".github/spec-dashboard.json").read_text())
45
+ assert config == {
46
+ "version": 1,
47
+ "sources": [{"glob": "specs/*/status.json", "kind": "spec"}],
48
+ }
49
+
50
+
51
+ def test_single_pages_publisher_and_release_flags_remain_canonical():
52
+ assert not (ROOT / ".github/workflows/docs.yml").exists()
53
+
54
+ jobs = _workflow("pipeline.yml")["jobs"]
55
+ assert jobs["publish-pypi"]["uses"] == (
56
+ "Knuckles-Team/pipelines/.github/workflows/python_pipeline.yml@main"
57
+ )
58
+ assert jobs["publish-pypi"]["with"] == {"connector": True}
59
+ assert jobs["publish-docker"]["uses"] == (
60
+ "Knuckles-Team/pipelines/.github/workflows/container_pipeline.yml@main"
61
+ )
62
+ assert jobs["publish-docker"]["with"] == {"render_connector": True}
63
+ assert jobs["publish-docker"]["needs"] == "publish-pypi"
64
+
65
+
66
+ def test_development_skill_and_runtime_entrypoints_match_source_tree():
67
+ skill = ROOT / "listmonk_api/skills/listmonk-api-development/SKILL.md"
68
+ content = skill.read_text()
69
+
70
+ assert "name: listmonk-api-development" in content
71
+ assert "## Rapid delivery: the 5-minute contract" in content
72
+ for path in (
73
+ "listmonk_api/__init__.py",
74
+ "listmonk_api/auth.py",
75
+ "listmonk_api/mcp_server.py",
76
+ "listmonk_api/api_client.py",
77
+ "tests/test_action_discovery.py",
78
+ "tests/test_auth_and_server.py",
79
+ ):
80
+ assert (ROOT / path).exists(), path
81
+
82
+ project = tomllib.loads((ROOT / "pyproject.toml").read_text())["project"]
83
+ assert project["scripts"]["listmonk-mcp"] == "agent_connector_sdk.cli:serve"
84
+ assert project["entry-points"]["agent_connector_sdk.connector"]["listmonk-mcp"] == (
85
+ "listmonk_api:connector"
86
+ )
@@ -3,8 +3,6 @@
3
3
  import subprocess
4
4
  import sys
5
5
 
6
- import pytest
7
-
8
6
 
9
7
  def test_module_runnable():
10
8
  """Package module should be runnable with --help or similar."""
File without changes
File without changes
File without changes
@@ -1,7 +1,7 @@
1
+ from listmonk_api.api.api_client_base import BaseApiClient
1
2
  from listmonk_api.models import (
2
3
  ImportSubscribersRequest,
3
4
  )
4
- from listmonk_api.api.api_client_base import BaseApiClient
5
5
 
6
6
 
7
7
  class ListmonkAPI(BaseApiClient):
@@ -1,7 +1,7 @@
1
+ from listmonk_api.api.api_client_base import BaseApiClient
1
2
  from listmonk_api.models import (
2
3
  MediaUploadRequest,
3
4
  )
4
- from listmonk_api.api.api_client_base import BaseApiClient
5
5
 
6
6
 
7
7
  class ListmonkAPI(BaseApiClient):
@@ -1,7 +1,7 @@
1
+ from listmonk_api.api.api_client_base import BaseApiClient
1
2
  from listmonk_api.models import (
2
3
  TransactionalMessageRequest,
3
4
  )
4
- from listmonk_api.api.api_client_base import BaseApiClient
5
5
 
6
6
 
7
7
  class ListmonkAPI(BaseApiClient):
File without changes
@@ -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 agent_connector_sdk.connector_identity import connector_name
11
11
 
12
12
  ROOT = Path(__file__).resolve().parents[1]
13
13
  PACKAGE = ROOT / "listmonk_api"