@sjawhar/opencode-legion-envoy 1.9.0 → 1.10.0

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.
@@ -13633,10 +13633,20 @@ var CommentEventPayloadSchema = object({
13633
13633
  var MessageEventPayloadSchema = object({
13634
13634
  id: string2().optional(),
13635
13635
  body: string2().optional(),
13636
- reply_to: string2().nullish(),
13636
+ target: string2().nullish(),
13637
+ in_reply_to: string2().nullish(),
13637
13638
  reply_body: string2().optional(),
13638
13639
  author: object({ kind: string2(), id: string2() }).optional()
13639
13640
  });
13641
+ var MessageDeliveryEventPayloadSchema = object({
13642
+ message_id: string2().optional(),
13643
+ attempt: number2().int().positive().optional(),
13644
+ delivery: _enum2(["btw", "aside", "steer"]).optional(),
13645
+ session_id: string2().optional(),
13646
+ title: string2().optional(),
13647
+ state: _enum2(["sent", "failed"]).optional(),
13648
+ error: string2().optional()
13649
+ });
13640
13650
  var ChildStatusEventPayloadSchema = object({
13641
13651
  child_key: string2().optional(),
13642
13652
  from: string2().optional(),
@@ -13835,7 +13845,7 @@ var dispatchToolSpecs = [
13835
13845
  arguments: (z) => ({
13836
13846
  issue: z.string().describe(ISSUE_REFERENCE),
13837
13847
  body: z.string({ max: 2000 }).describe("Update text, at most 2,000 characters."),
13838
- reply_to: z.string().describe("Optional message id or dispatch://KEY/message/<id> reference to reply to, threading " + "this message under it so the reply stays with the original in the Conversation.").optional()
13848
+ in_reply_to: z.string().describe("Optional message id or dispatch://KEY/message/<id> reference to reply to, threading " + "this message under it so the reply stays with the original in the Conversation.").optional()
13839
13849
  })
13840
13850
  },
13841
13851
  {
@@ -14998,13 +15008,13 @@ function askId(args) {
14998
15008
  }
14999
15009
  return reference.id;
15000
15010
  }
15001
- function messageReplyTo(args) {
15002
- const replyTo = optionalString(args, "reply_to");
15003
- if (replyTo === undefined || !replyTo.startsWith("dispatch://"))
15004
- return replyTo;
15005
- const reference = parseDispatchRef(replyTo);
15011
+ function messageInReplyTo(args) {
15012
+ const inReplyTo = optionalString(args, "in_reply_to");
15013
+ if (inReplyTo === undefined || !inReplyTo.startsWith("dispatch://"))
15014
+ return inReplyTo;
15015
+ const reference = parseDispatchRef(inReplyTo);
15006
15016
  if (reference?.kind !== "message") {
15007
- throw new Error("reply_to must be a bare message id or a dispatch://.../message/<id> reference");
15017
+ throw new Error("in_reply_to must be a bare message id or a dispatch://.../message/<id> reference");
15008
15018
  }
15009
15019
  return reference.id;
15010
15020
  }
@@ -15452,10 +15462,10 @@ async function executeDispatchTool(input) {
15452
15462
  };
15453
15463
  }
15454
15464
  case "dispatch_message": {
15455
- const replyTo = messageReplyTo(args);
15465
+ const inReplyTo = messageInReplyTo(args);
15456
15466
  const message = await client.message(issue(), {
15457
15467
  body: stringArg(args, "body"),
15458
- ...replyTo === undefined ? {} : { reply_to: replyTo },
15468
+ ...inReplyTo === undefined ? {} : { in_reply_to: inReplyTo },
15459
15469
  actor
15460
15470
  });
15461
15471
  const messageRef = `dispatch://${message.issue_key}/message/${message.id}`;
@@ -15790,6 +15800,7 @@ var SessionWireSchema = object({
15790
15800
  title: string2(),
15791
15801
  topics: array(string2()),
15792
15802
  roles: array(string2()).optional(),
15803
+ capabilities: array(string2()).optional(),
15793
15804
  self_subscribed: boolean2(),
15794
15805
  last_seen: number2().int().optional()
15795
15806
  });
@@ -15898,6 +15909,7 @@ function createEnvoyClient(config) {
15898
15909
  topics: expandSubscriptionTopics(input.topics),
15899
15910
  port: input.port,
15900
15911
  title: input.title,
15912
+ ...input.capabilities === undefined ? {} : { capabilities: input.capabilities },
15901
15913
  driving: input.driving,
15902
15914
  ...input.selfSubscribed === undefined ? {} : { self_subscribed: input.selfSubscribed }
15903
15915
  }))),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/opencode-legion-envoy",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "type": "module",
5
5
  "main": "dist/src/server.js",
6
6
  "exports": {
@@ -298,6 +298,24 @@ dispatch_message({ issue, body })
298
298
  It returns `details` `{ issue, topic, message }`. `body` is capped at 2,000 characters. A message is not a decision
299
299
  (`dispatch_ask`) or document feedback (`dispatch_comment`), and it does not wake anyone unless the issue is routed.
300
300
 
301
+ ### Targeted agent messages
302
+
303
+ A human can target the issue message at a live Envoy session or role as **BTW**, **Aside**, or
304
+ **Steer**. The incoming Dispatch frame names the issue and includes a `reply_with` instruction;
305
+ reply on the same open issue with the existing tool, never a new targeted send:
306
+
307
+ ```ts
308
+ dispatch_message({
309
+ issue: "CORE-1",
310
+ in_reply_to: "<targeted-message-id>",
311
+ body: "The requested answer.",
312
+ })
313
+ ```
314
+
315
+ `in_reply_to` correlates the answer under the human's message in its Conversation card. A BTW
316
+ delivery can post its answer automatically; use this call when the frame asks the primary agent to
317
+ reply. Agent bearers cannot set `target` or `delivery`.
318
+
301
319
  ## What comes back
302
320
 
303
321
  A write result's `details.topic` subscribes the host to its owner, and the first such subscription on an issue or document also tells