44 title : Sofie Package Manager API
55 version : 1.0.0
66 description : >
7- WebSocket API between **Sofie Core ** and the **Package Manager**.
7+ WebSocket API between an **external consumer ** and the **Package Manager**.
88
99 ## Overview
1010
1111 This document describes the full message contract for the Package Manager API.
12- The Package Manager (PM) connects to Sofie Core over a persistent WebSocket
13- connection. Once connected, both sides exchange messages on named logical channels.
12+ An external consumer (e.g. Sofie Core or any other application) connects to the
13+ Package Manager (PM) over a persistent WebSocket connection. Once connected,
14+ both sides exchange messages on named logical channels.
1415
1516 ## Authentication / identification
1617
2021 | Query param | Type | Description |
2122 |---------------|--------|--------------------------------------------------|
2223 | `clientId` | string | Stable identifier for this PM instance |
23- | `expectationManagerId` | string | The Expectation Manager this PM hosts |
2424
2525 No token-based authentication is defined here — network-level controls
2626 (firewall, VPN, mutual TLS) are assumed.
@@ -29,22 +29,17 @@ info:
2929
3030 | Channel address | Direction | Pattern | Description |
3131 |--------------------------|-------------|-------------------|-----------------------------------------|
32- | `expectations` | Core → PM | Event (CRUD) | Expectation lifecycle deltas |
33- | `packageContainers` | Core → PM | Event (CRUD) | PackageContainer config deltas |
34- | `workStatuses` | PM → Core | Event (CRUD) | ExpectationStatus lifecycle deltas |
35- | `containerStatuses` | PM → Core | Event (update/rm) | PackageContainer health status |
36- | `containerPackageStatuses` | PM → Core | Event (update/rm) | Per-package transfer status |
37- | `packageInfo` | PM → Core | Event (fire-forget)| Scan/probe results and removals |
38- | `rpc/core -to-pm` | Bidirectional | JSON-RPC 2.0 | Core calls RPC methods on PM (7 methods)|
39- | `rpc/pm-to-core ` | Bidirectional | JSON-RPC 2.0 | PM calls RPC methods on Core (1 method) |
32+ | `expectations` | Consumer → PM | Event (CRUD) | Expectation lifecycle deltas |
33+ | `packageContainers` | Consumer → PM | Event (CRUD) | PackageContainer config deltas |
34+ | `workStatuses` | PM → Consumer | Event (CRUD) | ExpectationStatus lifecycle deltas |
35+ | `containerStatuses` | PM → Consumer | Event (update/rm) | PackageContainer health status |
36+ | `containerPackageStatuses` | PM → Consumer | Event (update/rm) | Per-package transfer status |
37+ | `packageInfo` | PM → Consumer | Event (fire-forget)| Scan/probe results and removals |
38+ | `rpc/consumer -to-pm` | Bidirectional | JSON-RPC 2.0 | Consumer calls RPC methods on PM (7 methods)|
39+ | `rpc/pm-to-consumer ` | Bidirectional | JSON-RPC 2.0 | PM calls RPC methods on consumer (1 method) |
4040
4141 ## Design constraints
4242
43- - There is **no** `ExpectedPackageId` in the protocol. All statuses and
44- package-info entries are keyed by `ExpectationId`. Core maps back to its
45- own expected packages internally.
46- - There is **no** `requiredForPlayout` field. Urgency is expressed via the
47- numeric `priority` field.
4843 - JSON-RPC 2.0 is used for request-reply RPC calls. The `id` field on the
4944 JSON-RPC envelope correlates requests to responses.
5045
@@ -53,33 +48,32 @@ info:
5348 url : https://opensource.org/licenses/MIT
5449
5550servers :
56- coreWebSocket :
57- host : ' {coreHost }:{corePort }'
58- pathname : /package-manager
51+ packageManagerApiWebSocket :
52+ host : ' {pmApiHost }:{pmApiPort }'
53+ pathname : /
5954 protocol : wss
6055 description : >
61- Sofie Core WebSocket endpoint for the Package Manager API.
62- The Package Manager connects here. Both parties then exchange messages
63- across the channels defined below.
56+ WebSocket endpoint exposed by the Package Manager API.
57+ The external consumer connects here as a client.
6458 variables :
65- coreHost :
66- description : Hostname or IP address of the Sofie Core server .
59+ pmApiHost :
60+ description : Hostname or IP address of the Package Manager API .
6761 default : localhost
68- corePort :
69- description : WebSocket port for the Package Manager API.
70- default : ' 3000 '
62+ pmApiPort :
63+ description : WebSocket port exposed by the Package Manager API.
64+ default : ' 8080 '
7165
7266# ---------------------------------------------------------------------------
7367# Channels
7468# ---------------------------------------------------------------------------
7569channels :
76- # Core → PM event channels
70+ # Consumer → PM event channels
7771 expectations :
78- $ref : ' ./channels/from-core .yaml#/expectations'
72+ $ref : ' ./channels/from-consumer .yaml#/expectations'
7973 packageContainers :
80- $ref : ' ./channels/from-core .yaml#/packageContainers'
74+ $ref : ' ./channels/from-consumer .yaml#/packageContainers'
8175
82- # PM → Core event channels
76+ # PM → Consumer event channels
8377 workStatuses :
8478 $ref : ' ./channels/from-pm.yaml#/workStatuses'
8579 containerStatuses :
@@ -90,60 +84,60 @@ channels:
9084 $ref : ' ./channels/from-pm.yaml#/packageInfo'
9185
9286 # JSON-RPC channels
93- rpcCoreTopm :
94- $ref : ' ./channels/rpc-core -to-pm.yaml#/rpcCoreTopm '
95- rpcPmToCore :
96- $ref : ' ./channels/rpc-pm-to-core .yaml#/rpcPmToCore '
87+ rpcConsumerToPm :
88+ $ref : ' ./channels/rpc-consumer -to-pm.yaml#/rpcConsumerToPm '
89+ rpcPmToConsumer :
90+ $ref : ' ./channels/rpc-pm-to-consumer .yaml#/rpcPmToConsumer '
9791
9892# ---------------------------------------------------------------------------
99- # Operations — from Core 's perspective
93+ # Operations — from the consumer 's perspective
10094# ---------------------------------------------------------------------------
10195operations :
102- # Core → PM sends
96+ # Consumer → PM sends
10397 sendExpectationAdded :
104- $ref : ' ./operations/from-core .yaml#/sendExpectationAdded'
98+ $ref : ' ./operations/from-consumer .yaml#/sendExpectationAdded'
10599 sendExpectationUpdated :
106- $ref : ' ./operations/from-core .yaml#/sendExpectationUpdated'
100+ $ref : ' ./operations/from-consumer .yaml#/sendExpectationUpdated'
107101 sendExpectationRemoved :
108- $ref : ' ./operations/from-core .yaml#/sendExpectationRemoved'
102+ $ref : ' ./operations/from-consumer .yaml#/sendExpectationRemoved'
109103 sendPackageContainerAdded :
110- $ref : ' ./operations/from-core .yaml#/sendPackageContainerAdded'
104+ $ref : ' ./operations/from-consumer .yaml#/sendPackageContainerAdded'
111105 sendPackageContainerUpdated :
112- $ref : ' ./operations/from-core .yaml#/sendPackageContainerUpdated'
106+ $ref : ' ./operations/from-consumer .yaml#/sendPackageContainerUpdated'
113107 sendPackageContainerRemoved :
114- $ref : ' ./operations/from-core .yaml#/sendPackageContainerRemoved'
108+ $ref : ' ./operations/from-consumer .yaml#/sendPackageContainerRemoved'
115109
116- # Core receives from PM
110+ # Consumer receives from PM
117111 receiveExpectationStatusAdded :
118- $ref : ' ./operations/from-core .yaml#/receiveExpectationStatusAdded'
112+ $ref : ' ./operations/from-consumer .yaml#/receiveExpectationStatusAdded'
119113 receiveExpectationStatusUpdated :
120- $ref : ' ./operations/from-core .yaml#/receiveExpectationStatusUpdated'
114+ $ref : ' ./operations/from-consumer .yaml#/receiveExpectationStatusUpdated'
121115 receiveExpectationStatusRemoved :
122- $ref : ' ./operations/from-core .yaml#/receiveExpectationStatusRemoved'
116+ $ref : ' ./operations/from-consumer .yaml#/receiveExpectationStatusRemoved'
123117 receiveContainerStatusUpdated :
124- $ref : ' ./operations/from-core .yaml#/receiveContainerStatusUpdated'
118+ $ref : ' ./operations/from-consumer .yaml#/receiveContainerStatusUpdated'
125119 receiveContainerStatusRemoved :
126- $ref : ' ./operations/from-core .yaml#/receiveContainerStatusRemoved'
120+ $ref : ' ./operations/from-consumer .yaml#/receiveContainerStatusRemoved'
127121 receiveContainerPackageStatusUpdated :
128- $ref : ' ./operations/from-core .yaml#/receiveContainerPackageStatusUpdated'
122+ $ref : ' ./operations/from-consumer .yaml#/receiveContainerPackageStatusUpdated'
129123 receiveContainerPackageStatusRemoved :
130- $ref : ' ./operations/from-core .yaml#/receiveContainerPackageStatusRemoved'
124+ $ref : ' ./operations/from-consumer .yaml#/receiveContainerPackageStatusRemoved'
131125 receivePackageInfoUpdated :
132- $ref : ' ./operations/from-core .yaml#/receivePackageInfoUpdated'
126+ $ref : ' ./operations/from-consumer .yaml#/receivePackageInfoUpdated'
133127 receivePackageInfoRemoved :
134- $ref : ' ./operations/from-core .yaml#/receivePackageInfoRemoved'
135-
136- # Core RPC (send requests, receive responses)
137- sendRpcCoreTopm :
138- $ref : ' ./operations/from-core .yaml#/sendRpcCoreTopm '
139- receiveRpcCoreTopmResponse :
140- $ref : ' ./operations/from-core .yaml#/receiveRpcCoreTopmResponse '
141-
142- # Core answers PM's RPC calls
143- receiveRpcPmToCoreRequest :
144- $ref : ' ./operations/from-core .yaml#/receiveRpcPmToCoreRequest '
145- sendRpcPmToCoreResponse :
146- $ref : ' ./operations/from-core .yaml#/sendRpcPmToCoreResponse '
128+ $ref : ' ./operations/from-consumer .yaml#/receivePackageInfoRemoved'
129+
130+ # Consumer RPC (send requests, receive responses)
131+ sendRpcConsumerToPm :
132+ $ref : ' ./operations/from-consumer .yaml#/sendRpcConsumerToPm '
133+ receiveRpcConsumerToPmResponse :
134+ $ref : ' ./operations/from-consumer .yaml#/receiveRpcConsumerToPmResponse '
135+
136+ # Consumer answers PM's RPC calls
137+ receiveRpcPmToConsumerRequest :
138+ $ref : ' ./operations/from-consumer .yaml#/receiveRpcPmToConsumerRequest '
139+ sendRpcPmToConsumerResponse :
140+ $ref : ' ./operations/from-consumer .yaml#/sendRpcPmToConsumerResponse '
147141
148142# ---------------------------------------------------------------------------
149143# Components — inline references for tooling convenience.
0 commit comments