postiz-agent 2.4.2__tar.gz → 2.4.4__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.
- {postiz_agent-2.4.2/postiz_agent.egg-info → postiz_agent-2.4.4}/PKG-INFO +15 -15
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/README.md +13 -13
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/api/api_client_base.py +1 -1
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/api/api_client_posts.py +13 -11
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/auth.py +1 -1
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/kg_ingest.py +15 -5
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/kg_media.py +6 -5
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/ontology/__init__.py +1 -1
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/ontology/certification.json +4 -4
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/ontology/mappings/source.yaml +4 -4
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/ontology/pack.ttl +108 -107
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/ontology/shapes/connector.shacl.ttl +2 -42
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/ontology/social.ttl +117 -162
- postiz_agent-2.4.4/postiz_agent/skills/postiz-account-administration/SKILL.md +38 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/skills/postiz-agent-development/SKILL.md +17 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/skills/postiz-agent-operations/SKILL.md +16 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/skills/postiz-audience-analytics/SKILL.md +19 -6
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/skills/postiz-campaign-post-from-asset/SKILL.md +20 -8
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/skills/postiz-channel-management/SKILL.md +20 -6
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/skills/postiz-content-scheduling/SKILL.md +20 -6
- {postiz_agent-2.4.2 → postiz_agent-2.4.4/postiz_agent.egg-info}/PKG-INFO +15 -15
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent.egg-info/SOURCES.txt +2 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent.egg-info/requires.txt +1 -1
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/pyproject.toml +3 -3
- postiz_agent-2.4.4/requirements.txt +1 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/tests/conftest.py +3 -1
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/tests/test_coverage_gap_fillers.py +13 -9
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/tests/test_kg_ingest.py +7 -3
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/tests/test_kg_media.py +7 -3
- postiz_agent-2.4.4/tests/test_pack_extends_core.py +48 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/tests/test_pack_surface.py +29 -9
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/tests/test_post_lifecycle.py +3 -3
- postiz_agent-2.4.4/tests/test_scion_sdk_0_10_imports.py +59 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/tests/test_tool_surface.py +2 -2
- postiz_agent-2.4.2/postiz_agent/skills/postiz-account-administration/SKILL.md +0 -22
- postiz_agent-2.4.2/requirements.txt +0 -1
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/LICENSE +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/MANIFEST.in +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/__init__.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/__main__.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/api/__init__.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/api/api_client_admin.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/api/api_client_analytics.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/api/api_client_integrations.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/api/api_client_notifications.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/api/api_client_uploads.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/api/api_client_video.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/api_client.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/connector_contracts.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/connector_sources.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/lifecycle.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/mcp_config.json +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/mcp_server.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/ontology/fixtures/records.json +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/ontology/migrations/manifest.json +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/postiz_models.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/prompts/postiz-channel-administrator.json +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/prompts/postiz-operator.json +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/prompts/social_media_manager.json +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/skills/postiz-agent-operations/agents/openai.yaml +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/skills/postiz-agent-operations/references/catalog.md +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/skills/postiz-audience-analytics/WORKFLOW.md +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/skills/postiz-campaign-post-from-asset/WORKFLOW.md +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/skills/postiz-channel-management/WORKFLOW.md +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent/skills/postiz-content-scheduling/WORKFLOW.md +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent.egg-info/dependency_links.txt +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent.egg-info/entry_points.txt +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/postiz_agent.egg-info/top_level.txt +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/scripts/security_contract.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/setup.cfg +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/tests/test_init.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/tests/test_init_dynamics.py +0 -0
- {postiz_agent-2.4.2 → postiz_agent-2.4.4}/tests/test_publication_workflow.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: postiz-agent
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.4
|
|
4
4
|
Summary: Agent for interacting with Postiz Public API
|
|
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.15,>=3.12
|
|
13
13
|
Description-Content-Type: text/markdown
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: scion-sdk[mcp]
|
|
15
|
+
Requires-Dist: scion-sdk[mcp]<0.15,>=0.14.1
|
|
16
16
|
Requires-Dist: requests>=2.34.2
|
|
17
17
|
Provides-Extra: test
|
|
18
18
|
Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
|
|
@@ -43,9 +43,9 @@ Dynamic: license-file
|
|
|
43
43
|

|
|
44
44
|

|
|
45
45
|
|
|
46
|
-
> **Documentation** — Installation, deployment, usage across the API, CLI,
|
|
47
|
-
>
|
|
48
|
-
>
|
|
46
|
+
> **Documentation** — Installation, deployment, and usage across the API, CLI, MCP,
|
|
47
|
+
> and A2A agent interfaces are maintained in the
|
|
48
|
+
> [official documentation](https://knuckles-team.github.io/postiz-agent/).
|
|
49
49
|
|
|
50
50
|
---
|
|
51
51
|
|
|
@@ -88,8 +88,8 @@ This table is auto-generated from the live server — do not edit by hand.
|
|
|
88
88
|
|----------|----------------|-------------|
|
|
89
89
|
| `postiz_analytics` | `ANALYTICSTOOL` | Manage postiz analytics operations. |
|
|
90
90
|
| `postiz_ingest_analytics` | `INGESTTOOL` | Natively ingest Postiz analytics as :DailyEngagement / :AggregatedEngagement time-series. |
|
|
91
|
-
| `postiz_ingest_integrations` | `INGESTTOOL` | Natively ingest Postiz integrations into
|
|
92
|
-
| `postiz_ingest_posts` | `INGESTTOOL` | Natively ingest Postiz posts into
|
|
91
|
+
| `postiz_ingest_integrations` | `INGESTTOOL` | Natively ingest Postiz integrations into medulla as :SocialChannel nodes. |
|
|
92
|
+
| `postiz_ingest_posts` | `INGESTTOOL` | Natively ingest Postiz posts into medulla as typed :SocialPost nodes. |
|
|
93
93
|
| `postiz_integrations` | `INTEGRATIONSTOOL` | Manage postiz integrations operations. |
|
|
94
94
|
| `postiz_notifications` | `NOTIFICATIONSTOOL` | Manage postiz notifications operations. |
|
|
95
95
|
| `postiz_posts` | `POSTSTOOL` | Manage postiz posts operations. |
|
|
@@ -156,7 +156,7 @@ When query strings or parameters are supplied, an LLM-free **Knowledge Graph res
|
|
|
156
156
|
|
|
157
157
|
> **Install the connector-focused `[mcp]` extra.** Examples use `postiz-agent[mcp]` to add
|
|
158
158
|
> FastMCP / FastAPI through `scion-sdk`; the required Scion SDK core
|
|
159
|
-
> still carries `
|
|
159
|
+
> still carries `medulla[full]`. The `[agent-runtime]` extra additionally
|
|
160
160
|
> enables model orchestration.
|
|
161
161
|
|
|
162
162
|
#### stdio Transport (local IDEs — Cursor, Claude Desktop, VS Code)
|
|
@@ -284,6 +284,8 @@ the detailed transport contract.
|
|
|
284
284
|
`MCP_ALLOWED_HOSTS` in `AgentConfig`.
|
|
285
285
|
<!-- END GENERATED: additional-deployment-options -->
|
|
286
286
|
|
|
287
|
+
---
|
|
288
|
+
|
|
287
289
|
## Agent
|
|
288
290
|
|
|
289
291
|
This repository features a fully integrated Pydantic AI Graph Agent. It communicates over the **Agent Control Protocol (ACP)** and interacts smoothly with the **Agent Web UI (AG-UI)** and Terminal interface.
|
|
@@ -493,7 +495,7 @@ Pick the extra that matches what the operator want to run:
|
|
|
493
495
|
|
|
494
496
|
| Extra | Installs | Use when |
|
|
495
497
|
|-------|----------|----------|
|
|
496
|
-
| `postiz-agent[mcp]` | Connector-focused MCP server (`scion-sdk` — FastMCP/FastAPI + `
|
|
498
|
+
| `postiz-agent[mcp]` | Connector-focused MCP server (`scion-sdk` — FastMCP/FastAPI + `medulla[full]`) | The operator only run the **MCP server** (smallest install / image) |
|
|
497
499
|
| `postiz-agent[all]` | Everything (`mcp` + `agent` + `logfire`) | Development / both surfaces |
|
|
498
500
|
|
|
499
501
|
```bash
|
|
@@ -518,14 +520,14 @@ One multi-stage `docker/Dockerfile` builds the MCP-only image (`--target mcp`):
|
|
|
518
520
|
|
|
519
521
|
agent (`immutable agent digest`) with a co-located `:mcp` sidecar.
|
|
520
522
|
|
|
521
|
-
### Knowledge-graph database (`
|
|
523
|
+
### Knowledge-graph database (`medulla`)
|
|
522
524
|
|
|
523
|
-
Scion SDK core dependency (`
|
|
525
|
+
Scion SDK core dependency (`medulla[full]`). The `[mcp]` extra keeps
|
|
524
526
|
deployments can use the bundled engine. For production or shared state, run
|
|
525
|
-
**
|
|
527
|
+
**medulla as a dedicated database service** and configure the runtime to use it.
|
|
526
528
|
Deployment recipes (single-node + Raft HA), connection configuration, and architecture
|
|
527
529
|
diagrams are documented in the
|
|
528
|
-
[
|
|
530
|
+
[medulla deployment guide](https://knuckles-team.github.io/medulla/deployment/).
|
|
529
531
|
|
|
530
532
|
---
|
|
531
533
|
|
|
@@ -565,8 +567,6 @@ Contributions are welcome! Please ensure code quality by running local checks be
|
|
|
565
567
|
- Validate type-safety with `mypy .`
|
|
566
568
|
- Ran test suites using `pytest`
|
|
567
569
|
|
|
568
|
-
|
|
569
|
-
|
|
570
570
|
<!-- GOVERNED-CAPABILITY:START -->
|
|
571
571
|
## Governed capability contract
|
|
572
572
|
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|

|
|
21
21
|

|
|
22
22
|
|
|
23
|
-
> **Documentation** — Installation, deployment, usage across the API, CLI,
|
|
24
|
-
>
|
|
25
|
-
>
|
|
23
|
+
> **Documentation** — Installation, deployment, and usage across the API, CLI, MCP,
|
|
24
|
+
> and A2A agent interfaces are maintained in the
|
|
25
|
+
> [official documentation](https://knuckles-team.github.io/postiz-agent/).
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
@@ -65,8 +65,8 @@ This table is auto-generated from the live server — do not edit by hand.
|
|
|
65
65
|
|----------|----------------|-------------|
|
|
66
66
|
| `postiz_analytics` | `ANALYTICSTOOL` | Manage postiz analytics operations. |
|
|
67
67
|
| `postiz_ingest_analytics` | `INGESTTOOL` | Natively ingest Postiz analytics as :DailyEngagement / :AggregatedEngagement time-series. |
|
|
68
|
-
| `postiz_ingest_integrations` | `INGESTTOOL` | Natively ingest Postiz integrations into
|
|
69
|
-
| `postiz_ingest_posts` | `INGESTTOOL` | Natively ingest Postiz posts into
|
|
68
|
+
| `postiz_ingest_integrations` | `INGESTTOOL` | Natively ingest Postiz integrations into medulla as :SocialChannel nodes. |
|
|
69
|
+
| `postiz_ingest_posts` | `INGESTTOOL` | Natively ingest Postiz posts into medulla as typed :SocialPost nodes. |
|
|
70
70
|
| `postiz_integrations` | `INTEGRATIONSTOOL` | Manage postiz integrations operations. |
|
|
71
71
|
| `postiz_notifications` | `NOTIFICATIONSTOOL` | Manage postiz notifications operations. |
|
|
72
72
|
| `postiz_posts` | `POSTSTOOL` | Manage postiz posts operations. |
|
|
@@ -133,7 +133,7 @@ When query strings or parameters are supplied, an LLM-free **Knowledge Graph res
|
|
|
133
133
|
|
|
134
134
|
> **Install the connector-focused `[mcp]` extra.** Examples use `postiz-agent[mcp]` to add
|
|
135
135
|
> FastMCP / FastAPI through `scion-sdk`; the required Scion SDK core
|
|
136
|
-
> still carries `
|
|
136
|
+
> still carries `medulla[full]`. The `[agent-runtime]` extra additionally
|
|
137
137
|
> enables model orchestration.
|
|
138
138
|
|
|
139
139
|
#### stdio Transport (local IDEs — Cursor, Claude Desktop, VS Code)
|
|
@@ -261,6 +261,8 @@ the detailed transport contract.
|
|
|
261
261
|
`MCP_ALLOWED_HOSTS` in `AgentConfig`.
|
|
262
262
|
<!-- END GENERATED: additional-deployment-options -->
|
|
263
263
|
|
|
264
|
+
---
|
|
265
|
+
|
|
264
266
|
## Agent
|
|
265
267
|
|
|
266
268
|
This repository features a fully integrated Pydantic AI Graph Agent. It communicates over the **Agent Control Protocol (ACP)** and interacts smoothly with the **Agent Web UI (AG-UI)** and Terminal interface.
|
|
@@ -470,7 +472,7 @@ Pick the extra that matches what the operator want to run:
|
|
|
470
472
|
|
|
471
473
|
| Extra | Installs | Use when |
|
|
472
474
|
|-------|----------|----------|
|
|
473
|
-
| `postiz-agent[mcp]` | Connector-focused MCP server (`scion-sdk` — FastMCP/FastAPI + `
|
|
475
|
+
| `postiz-agent[mcp]` | Connector-focused MCP server (`scion-sdk` — FastMCP/FastAPI + `medulla[full]`) | The operator only run the **MCP server** (smallest install / image) |
|
|
474
476
|
| `postiz-agent[all]` | Everything (`mcp` + `agent` + `logfire`) | Development / both surfaces |
|
|
475
477
|
|
|
476
478
|
```bash
|
|
@@ -495,14 +497,14 @@ One multi-stage `docker/Dockerfile` builds the MCP-only image (`--target mcp`):
|
|
|
495
497
|
|
|
496
498
|
agent (`immutable agent digest`) with a co-located `:mcp` sidecar.
|
|
497
499
|
|
|
498
|
-
### Knowledge-graph database (`
|
|
500
|
+
### Knowledge-graph database (`medulla`)
|
|
499
501
|
|
|
500
|
-
Scion SDK core dependency (`
|
|
502
|
+
Scion SDK core dependency (`medulla[full]`). The `[mcp]` extra keeps
|
|
501
503
|
deployments can use the bundled engine. For production or shared state, run
|
|
502
|
-
**
|
|
504
|
+
**medulla as a dedicated database service** and configure the runtime to use it.
|
|
503
505
|
Deployment recipes (single-node + Raft HA), connection configuration, and architecture
|
|
504
506
|
diagrams are documented in the
|
|
505
|
-
[
|
|
507
|
+
[medulla deployment guide](https://knuckles-team.github.io/medulla/deployment/).
|
|
506
508
|
|
|
507
509
|
---
|
|
508
510
|
|
|
@@ -542,8 +544,6 @@ Contributions are welcome! Please ensure code quality by running local checks be
|
|
|
542
544
|
- Validate type-safety with `mypy .`
|
|
543
545
|
- Ran test suites using `pytest`
|
|
544
546
|
|
|
545
|
-
|
|
546
|
-
|
|
547
547
|
<!-- GOVERNED-CAPABILITY:START -->
|
|
548
548
|
## Governed capability contract
|
|
549
549
|
|
|
@@ -24,7 +24,7 @@ class BaseApiClient:
|
|
|
24
24
|
|
|
25
25
|
self.token = token
|
|
26
26
|
self.tls_profile = tls_profile or resolve_tls_profile("postiz")
|
|
27
|
-
self.session = self.tls_profile.configure_requests_session(requests.Session())
|
|
27
|
+
self.session = self.tls_profile.configure_requests_session(requests.Session()) # noqa: V105 — individual requests set timeout=30
|
|
28
28
|
self.session.headers.update(
|
|
29
29
|
{"Authorization": self.token, "Content-Type": "application/json"}
|
|
30
30
|
)
|
|
@@ -39,13 +39,13 @@ _ALL_TIME = (datetime(2000, 1, 1, tzinfo=UTC), datetime(2100, 1, 1, tzinfo=UTC))
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
class PostsClient(BaseApiClient):
|
|
42
|
-
|
|
42
|
+
_publishing_store_cache: PublishingStore | None = None
|
|
43
43
|
|
|
44
44
|
@property
|
|
45
|
-
def
|
|
46
|
-
if self.
|
|
47
|
-
self.
|
|
48
|
-
return self.
|
|
45
|
+
def _publishing_store(self) -> PublishingStore:
|
|
46
|
+
if self._publishing_store_cache is None:
|
|
47
|
+
self._publishing_store_cache = PublishingStore()
|
|
48
|
+
return self._publishing_store_cache
|
|
49
49
|
|
|
50
50
|
def _raw_posts(self, start: datetime, end: datetime) -> list[dict[str, Any]]:
|
|
51
51
|
params = {"startDate": start.isoformat(), "endDate": end.isoformat()}
|
|
@@ -61,7 +61,7 @@ class PostsClient(BaseApiClient):
|
|
|
61
61
|
|
|
62
62
|
def _guard(self, post_id: str, event: PostEvent) -> tuple[PostState, PostState]:
|
|
63
63
|
"""Read the post, decide the move; raise before any write. Returns (from, to)."""
|
|
64
|
-
state = reconcile(self._locate(post_id), self.
|
|
64
|
+
state = reconcile(self._locate(post_id), self._publishing_store)
|
|
65
65
|
return state, post_transition(state, event, str(post_id))
|
|
66
66
|
|
|
67
67
|
@require_auth
|
|
@@ -137,7 +137,7 @@ class PostsClient(BaseApiClient):
|
|
|
137
137
|
if event is PostEvent.PUBLISH_NOW: # the server accepted the publish-now call
|
|
138
138
|
for item in result if isinstance(result, list) else []:
|
|
139
139
|
if isinstance(item, dict) and item.get("postId"):
|
|
140
|
-
self.
|
|
140
|
+
self._publishing_store.enter(str(item["postId"]))
|
|
141
141
|
return result
|
|
142
142
|
|
|
143
143
|
@require_auth
|
|
@@ -152,7 +152,7 @@ class PostsClient(BaseApiClient):
|
|
|
152
152
|
"""
|
|
153
153
|
state, _ = self._guard(post_id, PostEvent.DELETE)
|
|
154
154
|
result = self._json(self.session.delete(f"{self.base_url}/posts/{post_id}"))
|
|
155
|
-
self.
|
|
155
|
+
self._publishing_store.leave(post_id)
|
|
156
156
|
if state is PostState.PUBLISHED and isinstance(result, dict):
|
|
157
157
|
result = {
|
|
158
158
|
**result,
|
|
@@ -174,11 +174,13 @@ class PostsClient(BaseApiClient):
|
|
|
174
174
|
raise IllegalTransition("UnknownPost", post_id=f"group:{group}")
|
|
175
175
|
for post in members:
|
|
176
176
|
post_transition(
|
|
177
|
-
reconcile(post, self.
|
|
177
|
+
reconcile(post, self._publishing_store),
|
|
178
|
+
PostEvent.DELETE,
|
|
179
|
+
str(post["id"]),
|
|
178
180
|
)
|
|
179
181
|
result = self._json(self.session.delete(f"{self.base_url}/posts/group/{group}"))
|
|
180
182
|
for post in members:
|
|
181
|
-
self.
|
|
183
|
+
self._publishing_store.leave(str(post["id"]))
|
|
182
184
|
return result
|
|
183
185
|
|
|
184
186
|
@require_auth
|
|
@@ -241,7 +243,7 @@ class PostsClient(BaseApiClient):
|
|
|
241
243
|
if status == "draft":
|
|
242
244
|
self._guard(post_id, PostEvent.UNSCHEDULE)
|
|
243
245
|
else:
|
|
244
|
-
state = reconcile(self._locate(post_id), self.
|
|
246
|
+
state = reconcile(self._locate(post_id), self._publishing_store)
|
|
245
247
|
event = PostEvent.RETRY if state is PostState.ERROR else PostEvent.SCHEDULE
|
|
246
248
|
post_transition(state, event, str(post_id))
|
|
247
249
|
return self._json(
|
|
@@ -31,7 +31,7 @@ def get_client(tls_profile: ResolvedTLSProfile | None = None):
|
|
|
31
31
|
except Exception as e:
|
|
32
32
|
raise RuntimeError(
|
|
33
33
|
"AUTHENTICATION ERROR: The configured credentials were rejected. "
|
|
34
|
-
|
|
34
|
+
"Please check your configuration and try again. "
|
|
35
35
|
f"Error details: {type(e).__name__}"
|
|
36
36
|
) from e
|
|
37
37
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"""Native
|
|
1
|
+
"""Native medulla ingestion for Postiz records (typed graph nodes).
|
|
2
2
|
|
|
3
3
|
CONCEPT:AU-KG.ingest.enterprise-source-extractor. This is the record-source twin of
|
|
4
4
|
media-downloader's blob ingestion: the postiz-agent connector natively pushes its data
|
|
5
|
-
into the ONE
|
|
5
|
+
into the ONE medulla knowledge graph as **typed OWL nodes** (``:SocialPost``,
|
|
6
6
|
``:SocialChannel``, ``:DailyEngagement``, ``:AggregatedEngagement`` …) + links.
|
|
7
7
|
|
|
8
8
|
The write path is the ``scion_sdk.ingest`` knowledge-ingest facade. Engine
|
|
@@ -13,14 +13,16 @@ federated by ``postiz_agent.ontology``.
|
|
|
13
13
|
|
|
14
14
|
from __future__ import annotations
|
|
15
15
|
|
|
16
|
+
import hashlib
|
|
16
17
|
import logging
|
|
18
|
+
from pathlib import Path
|
|
17
19
|
from typing import Any
|
|
18
20
|
|
|
19
21
|
from scion_sdk.connector_identity import connector_name
|
|
20
22
|
from scion_sdk.ingest import (
|
|
21
23
|
ChangeSet,
|
|
24
|
+
ContractSource,
|
|
22
25
|
Entity,
|
|
23
|
-
IngestBinding,
|
|
24
26
|
IngestError,
|
|
25
27
|
IngestUnavailableError,
|
|
26
28
|
KnowledgeIngest,
|
|
@@ -32,7 +34,15 @@ logger = logging.getLogger("postiz_agent.kg")
|
|
|
32
34
|
|
|
33
35
|
_SOURCE = connector_name("postiz_agent")
|
|
34
36
|
_DOMAIN = "social"
|
|
35
|
-
|
|
37
|
+
#: The local declaration the engine must have accepted: the connector's mappings.
|
|
38
|
+
_DECLARATION = Path(__file__).parent / "ontology" / "mappings" / "source.yaml"
|
|
39
|
+
|
|
40
|
+
#: The contract every binding of this connector runs under; its digest is the
|
|
41
|
+
#: SHA-256 of the shipped mapping declaration, so a changed declaration is
|
|
42
|
+
#: refused (``contract_not_accepted``) until the engine accepts the new one.
|
|
43
|
+
CONTRACT = ContractSource(digest=hashlib.sha256(_DECLARATION.read_bytes()).hexdigest())
|
|
44
|
+
|
|
45
|
+
_BINDING = CONTRACT.bind(_SOURCE, _DOMAIN)
|
|
36
46
|
|
|
37
47
|
|
|
38
48
|
def _to_entity(record: dict[str, Any]) -> Entity:
|
|
@@ -61,7 +71,7 @@ async def ingest_entities(
|
|
|
61
71
|
*,
|
|
62
72
|
ingest: KnowledgeIngest | None = None,
|
|
63
73
|
) -> dict[str, int]:
|
|
64
|
-
"""Write typed OWL nodes (+ edges) into
|
|
74
|
+
"""Write typed OWL nodes (+ edges) into medulla in one change set."""
|
|
65
75
|
if not entities:
|
|
66
76
|
raise IngestError("ingest_entities needs at least one entity")
|
|
67
77
|
change_set = ChangeSet(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"""Native
|
|
1
|
+
"""Native medulla blob ingestion for Postiz media assets.
|
|
2
2
|
|
|
3
3
|
CONCEPT:AU-KG.ingest.list-durable-media. Postiz posts carry image/video attachments
|
|
4
|
-
(and the ``/upload`` endpoint mints media assets). When a live
|
|
4
|
+
(and the ``/upload`` endpoint mints media assets). When a live medulla engine is
|
|
5
5
|
reachable, the raw bytes of such an asset are stored as a content-addressed **blob** with a
|
|
6
6
|
``:MediaAsset`` graph node (carrying its Postiz metadata), via the SDK's knowledge-ingest
|
|
7
7
|
facade (:mod:`scion_sdk.ingest`) — the same ``ChangeSet.media`` path every
|
|
@@ -25,7 +25,6 @@ from typing import Any
|
|
|
25
25
|
from scion_sdk.connector_identity import connector_name
|
|
26
26
|
from scion_sdk.ingest import (
|
|
27
27
|
ChangeSet,
|
|
28
|
-
IngestBinding,
|
|
29
28
|
IngestError,
|
|
30
29
|
IngestUnavailableError,
|
|
31
30
|
KnowledgeIngest,
|
|
@@ -33,11 +32,13 @@ from scion_sdk.ingest import (
|
|
|
33
32
|
current_ingest,
|
|
34
33
|
)
|
|
35
34
|
|
|
35
|
+
from postiz_agent.kg_ingest import CONTRACT
|
|
36
|
+
|
|
36
37
|
logger = logging.getLogger("postiz_agent.kg_media")
|
|
37
38
|
|
|
38
39
|
_SOURCE = connector_name("postiz_agent")
|
|
39
40
|
_DOMAIN = "social"
|
|
40
|
-
_BINDING =
|
|
41
|
+
_BINDING = CONTRACT.bind(_SOURCE, _DOMAIN)
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
def _media_type_for(mime: str) -> str:
|
|
@@ -168,7 +169,7 @@ async def ingest_media_url(
|
|
|
168
169
|
from scion_sdk.tls.resolve import resolve_tls_profile
|
|
169
170
|
|
|
170
171
|
owned_profile = resolve_tls_profile("postiz")
|
|
171
|
-
with owned_profile.configure_requests_session(requests.Session()) as client:
|
|
172
|
+
with owned_profile.configure_requests_session(requests.Session()) as client: # noqa: V105
|
|
172
173
|
resp = client.get(url, timeout=30)
|
|
173
174
|
resp.raise_for_status()
|
|
174
175
|
data = resp.content
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Social & Content ontology contribution (CONCEPT:AU-KG.ontology.package-federation-migration).
|
|
2
2
|
|
|
3
3
|
Data-only subpackage: it carries ``social.ttl`` (the ``owl:Ontology``
|
|
4
|
-
``
|
|
4
|
+
``https://knuckles-team.github.io/ontology/connector/social`` module — social media, content creation and
|
|
5
5
|
audience engagement bridging Postiz, Owncast and social network analytics, with
|
|
6
6
|
both time-series engagement observations and aggregated snapshots) which the
|
|
7
7
|
scion-sdk hub federates in via the ``scion_sdk.ontology_providers``
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"api_version": "graphos.io/v1",
|
|
3
3
|
"artifacts": {
|
|
4
4
|
"postiz_agent/ontology/fixtures/records.json": "4f1bccc8e13cf25763fa0c4238a9892881bc10a73ddca02bfd93563134f61717",
|
|
5
|
-
"postiz_agent/ontology/mappings/source.yaml": "
|
|
5
|
+
"postiz_agent/ontology/mappings/source.yaml": "ad1c927f4fcc76d115fe276feafcd65fd21f5f9283d35c8dadab99538a886995",
|
|
6
6
|
"postiz_agent/ontology/migrations/manifest.json": "95d7ba63fc270473d62dbe55d545335f30da40a1292efafbd1fb60434236ee86",
|
|
7
|
-
"postiz_agent/ontology/shapes/connector.shacl.ttl": "
|
|
8
|
-
"postiz_agent/ontology/social.ttl": "
|
|
7
|
+
"postiz_agent/ontology/shapes/connector.shacl.ttl": "7a828c741d2ed3cbb0b0559ed99585298e27402549aafa02241ad1f2fff19b56",
|
|
8
|
+
"postiz_agent/ontology/social.ttl": "236af313da34aae74c66083095ad15bf5f3782f863f66f469c01e37f7f7e1091"
|
|
9
9
|
},
|
|
10
10
|
"checks": {
|
|
11
11
|
"declared_tool_schema": "passed",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"signer": "UNSIGNED-PREVIEW",
|
|
30
30
|
"signing_public_key": "",
|
|
31
31
|
"status": "source-validated",
|
|
32
|
-
"validated_at": "2026-
|
|
32
|
+
"validated_at": "2026-12-03T21:52:21Z"
|
|
33
33
|
}
|
|
@@ -12,7 +12,7 @@ sync:
|
|
|
12
12
|
text_field: content
|
|
13
13
|
updated_field: publishDate
|
|
14
14
|
doc_type: social_post
|
|
15
|
-
tool_schema_sha256:
|
|
15
|
+
tool_schema_sha256: 4dfaadc0f615a9f2f4985c31339d30ffcc377726dcae89746cbb4bc821fe0b83
|
|
16
16
|
- preset: postiz-channels
|
|
17
17
|
server: postiz-mcp
|
|
18
18
|
tool: postiz_list_integrations
|
|
@@ -21,7 +21,7 @@ sync:
|
|
|
21
21
|
title_field: name
|
|
22
22
|
text_field: name
|
|
23
23
|
doc_type: social_channel
|
|
24
|
-
tool_schema_sha256:
|
|
24
|
+
tool_schema_sha256: 356f9a598eef5f8c12fdf1f519b54652e42421edb1b61d9f554a1c5f9e1ccac2
|
|
25
25
|
- preset: postiz-media
|
|
26
26
|
server: postiz-mcp
|
|
27
27
|
tool: postiz_list_media
|
|
@@ -32,7 +32,7 @@ sync:
|
|
|
32
32
|
text_field: name
|
|
33
33
|
updated_field: createdAt
|
|
34
34
|
doc_type: social_media_asset
|
|
35
|
-
tool_schema_sha256:
|
|
35
|
+
tool_schema_sha256: be1a72f4df27cdd6e6472c5a8bdee630a8c58a5b685436d3426a03be11a90ecb
|
|
36
36
|
- preset: postiz-notifications
|
|
37
37
|
server: postiz-mcp
|
|
38
38
|
tool: postiz_list_notifications
|
|
@@ -43,7 +43,7 @@ sync:
|
|
|
43
43
|
text_field: content
|
|
44
44
|
updated_field: createdAt
|
|
45
45
|
doc_type: social_notification
|
|
46
|
-
tool_schema_sha256:
|
|
46
|
+
tool_schema_sha256: 57d6bc9f93c0643e1337cce1d3ddf1d9bd1cb9587ca45190d8316e83b8f6c840
|
|
47
47
|
governance:
|
|
48
48
|
default_acl: quarantine
|
|
49
49
|
identity: opaque-reference
|