@sjawhar/pi-legion-envoy 1.53.0 → 1.53.2
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/README.md +5 -4
- package/dist/envoy.js +17 -15
- package/dist/legion.js +10 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,10 +7,11 @@ in-flight turn instead of queueing behind it).
|
|
|
7
7
|
|
|
8
8
|
Normal topic subscriptions are direct NATS subscriptions owned by this extension. A role claim is
|
|
9
9
|
different: the listener arbitrates the core-NATS role lane for the current live holder, then sends
|
|
10
|
-
a receipt-backed request with the original role topic to the holder's direct agent subject.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
a receipt-backed request with the original role topic to the holder's direct agent subject.
|
|
11
|
+
`envoy_unsubscribe` manages only normal topic subscriptions; it does not relinquish a held role.
|
|
12
|
+
The agent pump replies after accepting the envelope; without a receipt within two seconds the
|
|
13
|
+
listener emits a `delivery_failed` exception. Role messages are live only; they are not retained
|
|
14
|
+
for a later claimant.
|
|
14
15
|
|
|
15
16
|
`envoy_list()` shows the union of the local subscriptions and the listener's persisted interest
|
|
16
17
|
registry. Each reported interest identifies whether it is `live`, `registry`, or `both`, so
|
package/dist/envoy.js
CHANGED
|
@@ -29756,13 +29756,20 @@ var CommentEventPayloadSchema = object({
|
|
|
29756
29756
|
ask_state: _enum2(["open", "answered", "resolved"]).optional(),
|
|
29757
29757
|
ask_waiting_on: _enum2(ASK_TURNS).optional(),
|
|
29758
29758
|
turn: _enum2(ASK_TURNS).nullish(),
|
|
29759
|
-
anchor: object({
|
|
29759
|
+
anchor: object({
|
|
29760
|
+
artifact_id: string2().optional(),
|
|
29761
|
+
block_id: string2().nullable().optional(),
|
|
29762
|
+
mark_id: string2().optional(),
|
|
29763
|
+
orphaned: boolean2().optional(),
|
|
29764
|
+
quote: string2().optional(),
|
|
29765
|
+
version: number2().int().optional()
|
|
29766
|
+
}).nullish(),
|
|
29760
29767
|
suggestion: object({ replace_with: string2().optional() }).nullish(),
|
|
29761
29768
|
author: object({ kind: string2(), id: string2() }).optional(),
|
|
29762
29769
|
created_at: string2().optional(),
|
|
29763
29770
|
mentions: array(CommentMentionSchema).optional(),
|
|
29764
29771
|
deliveries: array(CommentDeliverySchema).optional()
|
|
29765
|
-
});
|
|
29772
|
+
}).passthrough();
|
|
29766
29773
|
var MessageEventPayloadSchema = object({
|
|
29767
29774
|
id: string2().optional(),
|
|
29768
29775
|
body: string2().optional(),
|
|
@@ -31452,10 +31459,12 @@ var DISPATCH_PAYLOAD_SCHEMAS = {
|
|
|
31452
31459
|
"artifact.created": ArtifactCreatedEventPayloadSchema,
|
|
31453
31460
|
"artifact.version": ArtifactVersionEventPayloadSchema,
|
|
31454
31461
|
"ask.opened": AskEventPayloadSchema,
|
|
31462
|
+
"ask.anchor_refreshed": AskEventPayloadSchema,
|
|
31455
31463
|
"ask.edited": AskEditedEventPayloadSchema,
|
|
31456
31464
|
"ask.answered": AskEventPayloadSchema,
|
|
31457
31465
|
"ask.resolved": AskEventPayloadSchema,
|
|
31458
31466
|
"comment.created": CommentEventPayloadSchema,
|
|
31467
|
+
"comment.anchor_refreshed": CommentEventPayloadSchema,
|
|
31459
31468
|
"comment.resolved": CommentEventPayloadSchema,
|
|
31460
31469
|
"comment.reopened": CommentEventPayloadSchema,
|
|
31461
31470
|
"comment.edited": CommentEventPayloadSchema,
|
|
@@ -33141,12 +33150,14 @@ function logSummary(issue, events) {
|
|
|
33141
33150
|
function eventHead(event) {
|
|
33142
33151
|
switch (event.type) {
|
|
33143
33152
|
case "ask.opened":
|
|
33153
|
+
case "ask.anchor_refreshed":
|
|
33144
33154
|
case "ask.edited":
|
|
33145
33155
|
case "ask.resolved":
|
|
33146
33156
|
return textHead(event.payload.question);
|
|
33147
33157
|
case "ask.answered":
|
|
33148
33158
|
return `${textHead(event.payload.question)} -> ${textHead(askAnswerText(event.payload.answer))}`;
|
|
33149
33159
|
case "comment.created":
|
|
33160
|
+
case "comment.anchor_refreshed":
|
|
33150
33161
|
case "comment.edited":
|
|
33151
33162
|
case "comment.resolved":
|
|
33152
33163
|
case "comment.reopened":
|
|
@@ -34775,10 +34786,6 @@ function envoyExtension(pi) {
|
|
|
34775
34786
|
}
|
|
34776
34787
|
return true;
|
|
34777
34788
|
};
|
|
34778
|
-
const releaseClaimedRole = () => {
|
|
34779
|
-
claimedRoleTopic = undefined;
|
|
34780
|
-
pi.appendEntry(ROLE_CLAIM_ENTRY, { role: null });
|
|
34781
|
-
};
|
|
34782
34789
|
const transcriptClaimedRole = (branch) => {
|
|
34783
34790
|
let role;
|
|
34784
34791
|
for (const entry of branch) {
|
|
@@ -35071,17 +35078,12 @@ Warnings: ${warnings.join("; ")}`, {
|
|
|
35071
35078
|
}
|
|
35072
35079
|
case EnvoyToolOperation.unsubscribe: {
|
|
35073
35080
|
const inbox = agentSubject(sessionID);
|
|
35074
|
-
const targets = topicsFor(parameters, [
|
|
35075
|
-
|
|
35076
|
-
|
|
35077
|
-
|
|
35078
|
-
const removed = targets.filter((topic) => closeIntentionally(topic) || topic === claimedRoleTopic);
|
|
35079
|
-
const releasingRole = claimedRoleTopic !== undefined && removed.includes(claimedRoleTopic);
|
|
35080
|
-
const registrationError = removed.length === 0 ? undefined : await client.unsubscribe({ sessionID, topics: removed }).then(registerSession).then(() => {
|
|
35081
|
+
const targets = topicsFor(parameters, [...subscriptions.keys()]).filter((topic) => topic !== inbox);
|
|
35082
|
+
const removed = targets.filter(closeIntentionally);
|
|
35083
|
+
const registryRemoved = removed.filter((topic) => !topic.startsWith(ROLE_TOPIC_PREFIX));
|
|
35084
|
+
const registrationError = registryRemoved.length === 0 ? undefined : await client.unsubscribe({ sessionID, topics: registryRemoved }).then(registerSession).then(() => {
|
|
35081
35085
|
return;
|
|
35082
35086
|
}, messageFor);
|
|
35083
|
-
if (releasingRole && registrationError === undefined)
|
|
35084
|
-
releaseClaimedRole();
|
|
35085
35087
|
return toolSuccess(`Unsubscribed: ${removed.join(", ") || "(none)"}`, {
|
|
35086
35088
|
removed,
|
|
35087
35089
|
...registrationError === undefined ? {} : { registrationError }
|
package/dist/legion.js
CHANGED
|
@@ -16145,7 +16145,7 @@ import { logger } from "@oh-my-pi/pi-utils";
|
|
|
16145
16145
|
// package.json
|
|
16146
16146
|
var package_default = {
|
|
16147
16147
|
name: "@sjawhar/pi-legion-envoy",
|
|
16148
|
-
version: "1.53.
|
|
16148
|
+
version: "1.53.2",
|
|
16149
16149
|
type: "module",
|
|
16150
16150
|
omp: {
|
|
16151
16151
|
extensions: [
|
|
@@ -29075,13 +29075,20 @@ var CommentEventPayloadSchema = object({
|
|
|
29075
29075
|
ask_state: _enum2(["open", "answered", "resolved"]).optional(),
|
|
29076
29076
|
ask_waiting_on: _enum2(ASK_TURNS).optional(),
|
|
29077
29077
|
turn: _enum2(ASK_TURNS).nullish(),
|
|
29078
|
-
anchor: object({
|
|
29078
|
+
anchor: object({
|
|
29079
|
+
artifact_id: string2().optional(),
|
|
29080
|
+
block_id: string2().nullable().optional(),
|
|
29081
|
+
mark_id: string2().optional(),
|
|
29082
|
+
orphaned: boolean2().optional(),
|
|
29083
|
+
quote: string2().optional(),
|
|
29084
|
+
version: number2().int().optional()
|
|
29085
|
+
}).nullish(),
|
|
29079
29086
|
suggestion: object({ replace_with: string2().optional() }).nullish(),
|
|
29080
29087
|
author: object({ kind: string2(), id: string2() }).optional(),
|
|
29081
29088
|
created_at: string2().optional(),
|
|
29082
29089
|
mentions: array(CommentMentionSchema).optional(),
|
|
29083
29090
|
deliveries: array(CommentDeliverySchema).optional()
|
|
29084
|
-
});
|
|
29091
|
+
}).passthrough();
|
|
29085
29092
|
var MessageEventPayloadSchema = object({
|
|
29086
29093
|
id: string2().optional(),
|
|
29087
29094
|
body: string2().optional(),
|