@sjawhar/pi-legion-envoy 0.18.0 → 0.18.1
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.
- package/dist/legion.js +0 -6
- package/package.json +1 -1
package/dist/legion.js
CHANGED
|
@@ -30235,9 +30235,6 @@ async function handleLegionControlDirective(directive, actions) {
|
|
|
30235
30235
|
case "reclaim-architect":
|
|
30236
30236
|
await actions.reclaimArchitect();
|
|
30237
30237
|
break;
|
|
30238
|
-
case "shutdown":
|
|
30239
|
-
actions.requestShutdown();
|
|
30240
|
-
break;
|
|
30241
30238
|
}
|
|
30242
30239
|
actions.acknowledge();
|
|
30243
30240
|
} catch (error) {
|
|
@@ -30249,8 +30246,6 @@ function parseControlDirective(raw) {
|
|
|
30249
30246
|
if (typeof payload !== "object" || payload === null || !("type" in payload)) {
|
|
30250
30247
|
throw new Error("Legion control directive must be an object with a type");
|
|
30251
30248
|
}
|
|
30252
|
-
if (payload.type === "shutdown")
|
|
30253
|
-
return { type: "shutdown" };
|
|
30254
30249
|
if (payload.type === "reclaim-architect") {
|
|
30255
30250
|
if (!("redeliver" in payload) || typeof payload.redeliver !== "object" || payload.redeliver === null || !("topic" in payload.redeliver) || typeof payload.redeliver.topic !== "string" || !("payload" in payload.redeliver) || typeof payload.redeliver.payload !== "string" || !("eventId" in payload.redeliver) || typeof payload.redeliver.eventId !== "string") {
|
|
30256
30251
|
throw new Error("Legion control directive is missing redelivery metadata");
|
|
@@ -33336,7 +33331,6 @@ function legionExtension(pi) {
|
|
|
33336
33331
|
}
|
|
33337
33332
|
await handleLegionControlDirective(directive, {
|
|
33338
33333
|
reclaimArchitect,
|
|
33339
|
-
requestShutdown: () => pi.sendMessage({ type: "shutdown-request" }),
|
|
33340
33334
|
acknowledge: () => {
|
|
33341
33335
|
if (reply)
|
|
33342
33336
|
connection.publish(reply, controlCodec.encode(JSON.stringify({ type: "ack" })));
|