@sjawhar/pi-legion-envoy 0.17.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/envoy.js +2 -2
- package/dist/legion.js +2 -8
- package/package.json +1 -1
package/dist/envoy.js
CHANGED
|
@@ -16117,7 +16117,7 @@ import { dirname, resolve } from "path";
|
|
|
16117
16117
|
import { fileURLToPath } from "url";
|
|
16118
16118
|
|
|
16119
16119
|
// ../contracts/src/dispatch-tools.ts
|
|
16120
|
-
var ISSUE_REFERENCE = "An issue is a native KEY or external owner/repo#n reference; an external reference creates its native issue on first use
|
|
16120
|
+
var ISSUE_REFERENCE = "An issue is a native KEY or external owner/repo#n reference; an external reference creates its native issue on first use in the repository's mapped project (DISPATCH_REPO_PROJECTS) or, failing that, the default project (DISPATCH_DEFAULT_PROJECT).";
|
|
16121
16121
|
var ASK_URGENCIES = ["low", "med", "high", "blocking"];
|
|
16122
16122
|
var DOC_EDIT_OPS = ["replace", "delete", "insert"];
|
|
16123
16123
|
var dispatchToolSpecs = [
|
|
@@ -31684,7 +31684,7 @@ async function ensureIssue(client, issueReference, actor) {
|
|
|
31684
31684
|
} catch (error) {
|
|
31685
31685
|
if (error instanceof DispatchServiceError && error.code === "PROJECT_UNMAPPED") {
|
|
31686
31686
|
const repository = issueReference.slice(0, issueReference.lastIndexOf("#"));
|
|
31687
|
-
throw new Error(`repository ${repository} is not mapped in DISPATCH_REPO_PROJECTS`);
|
|
31687
|
+
throw new Error(`repository ${repository} is not mapped in DISPATCH_REPO_PROJECTS and no DISPATCH_DEFAULT_PROJECT is configured`);
|
|
31688
31688
|
}
|
|
31689
31689
|
throw error;
|
|
31690
31690
|
}
|
package/dist/legion.js
CHANGED
|
@@ -16115,7 +16115,7 @@ var require_mod4 = __commonJS(function(exports) {
|
|
|
16115
16115
|
import path4 from "path";
|
|
16116
16116
|
|
|
16117
16117
|
// ../contracts/src/dispatch-tools.ts
|
|
16118
|
-
var ISSUE_REFERENCE = "An issue is a native KEY or external owner/repo#n reference; an external reference creates its native issue on first use
|
|
16118
|
+
var ISSUE_REFERENCE = "An issue is a native KEY or external owner/repo#n reference; an external reference creates its native issue on first use in the repository's mapped project (DISPATCH_REPO_PROJECTS) or, failing that, the default project (DISPATCH_DEFAULT_PROJECT).";
|
|
16119
16119
|
var ASK_URGENCIES = ["low", "med", "high", "blocking"];
|
|
16120
16120
|
var DOC_EDIT_OPS = ["replace", "delete", "insert"];
|
|
16121
16121
|
var dispatchToolSpecs = [
|
|
@@ -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");
|
|
@@ -32174,7 +32169,7 @@ async function ensureIssue(client, issueReference, actor) {
|
|
|
32174
32169
|
} catch (error) {
|
|
32175
32170
|
if (error instanceof DispatchServiceError && error.code === "PROJECT_UNMAPPED") {
|
|
32176
32171
|
const repository = issueReference.slice(0, issueReference.lastIndexOf("#"));
|
|
32177
|
-
throw new Error(`repository ${repository} is not mapped in DISPATCH_REPO_PROJECTS`);
|
|
32172
|
+
throw new Error(`repository ${repository} is not mapped in DISPATCH_REPO_PROJECTS and no DISPATCH_DEFAULT_PROJECT is configured`);
|
|
32178
32173
|
}
|
|
32179
32174
|
throw error;
|
|
32180
32175
|
}
|
|
@@ -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" })));
|