@sjawhar/claude-envoy 1.27.2 → 1.28.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.
@@ -2,5 +2,5 @@
2
2
  "name": "claude-envoy",
3
3
  "description": "Put Envoy events into the Claude Code session's own conversation and expose Envoy MCP tools.",
4
4
  "mcpServers": "./.mcp.json",
5
- "version": "1.27.2"
5
+ "version": "1.28.0"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-envoy",
3
- "version": "1.27.2",
3
+ "version": "1.28.0",
4
4
  "description": "Put Envoy events into the Claude Code session's own conversation and expose Envoy MCP tools.",
5
5
  "mcpServers": {}
6
6
  }
package/dist/dispatch.js CHANGED
@@ -15492,6 +15492,22 @@ var dispatchToolSpecs = [
15492
15492
  }),
15493
15493
  validation: messageValidation
15494
15494
  },
15495
+ {
15496
+ name: "dispatch_send_to_agent",
15497
+ example: {
15498
+ session: "01234567-0000-4000-8000-000000000001",
15499
+ body: "DSP-1: the rota is nowhere written down. Please write it up.",
15500
+ delivery: "aside"
15501
+ },
15502
+ description: "Hand a piece of work to one agent session, in that session's own conversation, which belongs to no " + "issue: the way to reach the agent already on the work - the session holding an issue's claim, or one " + "you are working with. Name the issue in the body, because this message carries none. It is not how " + "you reach a person (dispatch message, or dispatch ask for something only a person can do), and not a " + "note on an issue (dispatch message --issue), which everyone reading that issue sees; this reaches that " + "one session. It spends that session a turn, so send once and read the reply with " + "dispatch read --message <id> rather than sending again. The call is answered once its first delivery " + "attempt has settled. It needs a credential holding the person scope, and one without it is refused " + `403 OAUTH_SCOPE_REQUIRED, naming the scope. ${BODY_BLOCK_RULE}`,
15503
+ arguments: (z) => ({
15504
+ session: z.string({ min: 1 }).describe("The session to send to, by its bare session id. An issue's claim names the session holding it, " + "and dispatch whoami names this session's own."),
15505
+ body: z.string({ min: 1 }).describe(`The words the session reads. Name the issue they are about: this message carries none. ${BODY_BLOCK_RULE}`),
15506
+ delivery: z.enum(["btw", "aside", "steer"]).describe("How the words reach the session: btw waits for its next turn, aside reaches it while a turn " + "runs, and steer goes in as a keystroke at its terminal. A session advertises the modes it " + "takes, and Dispatch sends the mode you name rather than another."),
15507
+ in_reply_to: z.string().describe("Optional id of a message in this same session-to-session conversation, threading this message " + "under it; without it the message starts a conversation of its own.").optional()
15508
+ }),
15509
+ strict: true
15510
+ },
15495
15511
  {
15496
15512
  name: "dispatch_doc_edit",
15497
15513
  example: {
@@ -18257,6 +18273,9 @@ class DispatchClient {
18257
18273
  async message(issue, input) {
18258
18274
  return this.#json("POST", ["api", "v1", "issues", await this.#resolveIssue(issue), "messages"], input);
18259
18275
  }
18276
+ async agentMessage(sessionId, input) {
18277
+ return this.#json("POST", ["api", "v1", "agents", sessionId, "messages"], input);
18278
+ }
18260
18279
  async messageReply(id, input, options = {}) {
18261
18280
  return this.#json("POST", ["api", "v1", "messages", id, "reply"], input, options.followUp === true ? { follow_up: "true" } : undefined);
18262
18281
  }
@@ -21470,6 +21489,9 @@ function itemBlockOf(value) {
21470
21489
  function article(kind) {
21471
21490
  return kind === "ask" ? "an ask" : `a ${kind}`;
21472
21491
  }
21492
+ function conversationReadBack(messageId) {
21493
+ return `${commandLine("dispatch_read", { message: messageId })} reads the conversation back.`;
21494
+ }
21473
21495
  function replyBlockProblem(field, kind, value) {
21474
21496
  if (!/^dispatch:\/\/[^#]*#b-/.test(value))
21475
21497
  return;
@@ -23889,7 +23911,7 @@ async function executeDispatchTool(input) {
23889
23911
  details: { message: reply.id, in_reply_to: inReplyTo, posted: false }
23890
23912
  };
23891
23913
  }
23892
- const readBack = `${commandLine("dispatch_read", { message: inReplyTo })} reads the conversation back.`;
23914
+ const readBack = conversationReadBack(inReplyTo);
23893
23915
  const parent = reply.in_reply_to ?? undefined;
23894
23916
  const follows = parent === inReplyTo ? undefined : parent;
23895
23917
  return {
@@ -23925,6 +23947,27 @@ async function executeDispatchTool(input) {
23925
23947
  }
23926
23948
  };
23927
23949
  }
23950
+ case "dispatch_send_to_agent": {
23951
+ const session = stringArg(args, "session");
23952
+ const inReplyTo = optionalString(args, "in_reply_to");
23953
+ const message = await client.agentMessage(session, {
23954
+ body: stringArg(args, "body"),
23955
+ delivery: stringArg(args, "delivery"),
23956
+ ...inReplyTo === undefined ? {} : { in_reply_to: inReplyTo }
23957
+ });
23958
+ const attempt = message.deliveries?.at(-1);
23959
+ const readBack = conversationReadBack(message.id);
23960
+ const arrival = attempt === undefined ? "Dispatch recorded no delivery attempt for it" : attempt.state === "failed" ? `its delivery failed: ${attempt.error ?? "the listener gave no reason"}` : attempt.state === "pending" ? "its delivery is still on its way" : `it reached that session as ${attempt.delivery}`;
23961
+ return {
23962
+ text: `Sent message ${message.id} to session ${session}; ${arrival}. ${readBack}`,
23963
+ details: {
23964
+ session,
23965
+ message: message.id,
23966
+ ...attempt === undefined ? {} : { delivery: attempt.state },
23967
+ ...inReplyTo === undefined ? {} : { in_reply_to: inReplyTo }
23968
+ }
23969
+ };
23970
+ }
23928
23971
  case "dispatch_doc_edit": {
23929
23972
  const resolved = await resolveDocument(documentOwner(), optionalString(args, "artifact"));
23930
23973
  const ops = args.ops;
@@ -37141,6 +37141,22 @@ var dispatchToolSpecs = [
37141
37141
  }),
37142
37142
  validation: messageValidation
37143
37143
  },
37144
+ {
37145
+ name: "dispatch_send_to_agent",
37146
+ example: {
37147
+ session: "01234567-0000-4000-8000-000000000001",
37148
+ body: "DSP-1: the rota is nowhere written down. Please write it up.",
37149
+ delivery: "aside"
37150
+ },
37151
+ description: "Hand a piece of work to one agent session, in that session's own conversation, which belongs to no " + "issue: the way to reach the agent already on the work - the session holding an issue's claim, or one " + "you are working with. Name the issue in the body, because this message carries none. It is not how " + "you reach a person (dispatch message, or dispatch ask for something only a person can do), and not a " + "note on an issue (dispatch message --issue), which everyone reading that issue sees; this reaches that " + "one session. It spends that session a turn, so send once and read the reply with " + "dispatch read --message <id> rather than sending again. The call is answered once its first delivery " + "attempt has settled. It needs a credential holding the person scope, and one without it is refused " + `403 OAUTH_SCOPE_REQUIRED, naming the scope. ${BODY_BLOCK_RULE}`,
37152
+ arguments: (z) => ({
37153
+ session: z.string({ min: 1 }).describe("The session to send to, by its bare session id. An issue's claim names the session holding it, " + "and dispatch whoami names this session's own."),
37154
+ body: z.string({ min: 1 }).describe(`The words the session reads. Name the issue they are about: this message carries none. ${BODY_BLOCK_RULE}`),
37155
+ delivery: z.enum(["btw", "aside", "steer"]).describe("How the words reach the session: btw waits for its next turn, aside reaches it while a turn " + "runs, and steer goes in as a keystroke at its terminal. A session advertises the modes it " + "takes, and Dispatch sends the mode you name rather than another."),
37156
+ in_reply_to: z.string().describe("Optional id of a message in this same session-to-session conversation, threading this message " + "under it; without it the message starts a conversation of its own.").optional()
37157
+ }),
37158
+ strict: true
37159
+ },
37144
37160
  {
37145
37161
  name: "dispatch_doc_edit",
37146
37162
  example: {
@@ -42742,6 +42758,9 @@ class DispatchClient {
42742
42758
  async message(issue, input) {
42743
42759
  return this.#json("POST", ["api", "v1", "issues", await this.#resolveIssue(issue), "messages"], input);
42744
42760
  }
42761
+ async agentMessage(sessionId, input) {
42762
+ return this.#json("POST", ["api", "v1", "agents", sessionId, "messages"], input);
42763
+ }
42745
42764
  async messageReply(id, input, options = {}) {
42746
42765
  return this.#json("POST", ["api", "v1", "messages", id, "reply"], input, options.followUp === true ? { follow_up: "true" } : undefined);
42747
42766
  }
@@ -48390,6 +48409,9 @@ function itemBlockOf(value) {
48390
48409
  function article(kind) {
48391
48410
  return kind === "ask" ? "an ask" : `a ${kind}`;
48392
48411
  }
48412
+ function conversationReadBack(messageId) {
48413
+ return `${commandLine("dispatch_read", { message: messageId })} reads the conversation back.`;
48414
+ }
48393
48415
  function replyBlockProblem(field, kind, value) {
48394
48416
  if (!/^dispatch:\/\/[^#]*#b-/.test(value))
48395
48417
  return;
@@ -50809,7 +50831,7 @@ async function executeDispatchTool(input) {
50809
50831
  details: { message: reply.id, in_reply_to: inReplyTo, posted: false }
50810
50832
  };
50811
50833
  }
50812
- const readBack = `${commandLine("dispatch_read", { message: inReplyTo })} reads the conversation back.`;
50834
+ const readBack = conversationReadBack(inReplyTo);
50813
50835
  const parent = reply.in_reply_to ?? undefined;
50814
50836
  const follows = parent === inReplyTo ? undefined : parent;
50815
50837
  return {
@@ -50845,6 +50867,27 @@ async function executeDispatchTool(input) {
50845
50867
  }
50846
50868
  };
50847
50869
  }
50870
+ case "dispatch_send_to_agent": {
50871
+ const session = stringArg(args, "session");
50872
+ const inReplyTo = optionalString(args, "in_reply_to");
50873
+ const message = await client.agentMessage(session, {
50874
+ body: stringArg(args, "body"),
50875
+ delivery: stringArg(args, "delivery"),
50876
+ ...inReplyTo === undefined ? {} : { in_reply_to: inReplyTo }
50877
+ });
50878
+ const attempt = message.deliveries?.at(-1);
50879
+ const readBack = conversationReadBack(message.id);
50880
+ const arrival = attempt === undefined ? "Dispatch recorded no delivery attempt for it" : attempt.state === "failed" ? `its delivery failed: ${attempt.error ?? "the listener gave no reason"}` : attempt.state === "pending" ? "its delivery is still on its way" : `it reached that session as ${attempt.delivery}`;
50881
+ return {
50882
+ text: `Sent message ${message.id} to session ${session}; ${arrival}. ${readBack}`,
50883
+ details: {
50884
+ session,
50885
+ message: message.id,
50886
+ ...attempt === undefined ? {} : { delivery: attempt.state },
50887
+ ...inReplyTo === undefined ? {} : { in_reply_to: inReplyTo }
50888
+ }
50889
+ };
50890
+ }
50848
50891
  case "dispatch_doc_edit": {
50849
50892
  const resolved = await resolveDocument(documentOwner(), optionalString(args, "artifact"));
50850
50893
  const ops = args.ops;
@@ -55348,7 +55391,7 @@ var import_nats2 = __toESM(require_mod4(), 1);
55348
55391
 
55349
55392
  // package.json
55350
55393
  var name = "@sjawhar/claude-envoy";
55351
- var version2 = "1.27.2";
55394
+ var version2 = "1.28.0";
55352
55395
  var legion = {
55353
55396
  daemonApiVersion: 59
55354
55397
  };
@@ -14491,6 +14491,22 @@ var dispatchToolSpecs = [
14491
14491
  }),
14492
14492
  validation: messageValidation
14493
14493
  },
14494
+ {
14495
+ name: "dispatch_send_to_agent",
14496
+ example: {
14497
+ session: "01234567-0000-4000-8000-000000000001",
14498
+ body: "DSP-1: the rota is nowhere written down. Please write it up.",
14499
+ delivery: "aside"
14500
+ },
14501
+ description: "Hand a piece of work to one agent session, in that session's own conversation, which belongs to no " + "issue: the way to reach the agent already on the work - the session holding an issue's claim, or one " + "you are working with. Name the issue in the body, because this message carries none. It is not how " + "you reach a person (dispatch message, or dispatch ask for something only a person can do), and not a " + "note on an issue (dispatch message --issue), which everyone reading that issue sees; this reaches that " + "one session. It spends that session a turn, so send once and read the reply with " + "dispatch read --message <id> rather than sending again. The call is answered once its first delivery " + "attempt has settled. It needs a credential holding the person scope, and one without it is refused " + `403 OAUTH_SCOPE_REQUIRED, naming the scope. ${BODY_BLOCK_RULE}`,
14502
+ arguments: (z) => ({
14503
+ session: z.string({ min: 1 }).describe("The session to send to, by its bare session id. An issue's claim names the session holding it, " + "and dispatch whoami names this session's own."),
14504
+ body: z.string({ min: 1 }).describe(`The words the session reads. Name the issue they are about: this message carries none. ${BODY_BLOCK_RULE}`),
14505
+ delivery: z.enum(["btw", "aside", "steer"]).describe("How the words reach the session: btw waits for its next turn, aside reaches it while a turn " + "runs, and steer goes in as a keystroke at its terminal. A session advertises the modes it " + "takes, and Dispatch sends the mode you name rather than another."),
14506
+ in_reply_to: z.string().describe("Optional id of a message in this same session-to-session conversation, threading this message " + "under it; without it the message starts a conversation of its own.").optional()
14507
+ }),
14508
+ strict: true
14509
+ },
14494
14510
  {
14495
14511
  name: "dispatch_doc_edit",
14496
14512
  example: {
@@ -17261,6 +17277,9 @@ class DispatchClient {
17261
17277
  async message(issue, input) {
17262
17278
  return this.#json("POST", ["api", "v1", "issues", await this.#resolveIssue(issue), "messages"], input);
17263
17279
  }
17280
+ async agentMessage(sessionId, input) {
17281
+ return this.#json("POST", ["api", "v1", "agents", sessionId, "messages"], input);
17282
+ }
17264
17283
  async messageReply(id, input, options = {}) {
17265
17284
  return this.#json("POST", ["api", "v1", "messages", id, "reply"], input, options.followUp === true ? { follow_up: "true" } : undefined);
17266
17285
  }
@@ -20474,6 +20493,9 @@ function itemBlockOf(value) {
20474
20493
  function article(kind) {
20475
20494
  return kind === "ask" ? "an ask" : `a ${kind}`;
20476
20495
  }
20496
+ function conversationReadBack(messageId) {
20497
+ return `${commandLine("dispatch_read", { message: messageId })} reads the conversation back.`;
20498
+ }
20477
20499
  function replyBlockProblem(field, kind, value) {
20478
20500
  if (!/^dispatch:\/\/[^#]*#b-/.test(value))
20479
20501
  return;
@@ -22893,7 +22915,7 @@ async function executeDispatchTool(input) {
22893
22915
  details: { message: reply.id, in_reply_to: inReplyTo, posted: false }
22894
22916
  };
22895
22917
  }
22896
- const readBack = `${commandLine("dispatch_read", { message: inReplyTo })} reads the conversation back.`;
22918
+ const readBack = conversationReadBack(inReplyTo);
22897
22919
  const parent = reply.in_reply_to ?? undefined;
22898
22920
  const follows = parent === inReplyTo ? undefined : parent;
22899
22921
  return {
@@ -22929,6 +22951,27 @@ async function executeDispatchTool(input) {
22929
22951
  }
22930
22952
  };
22931
22953
  }
22954
+ case "dispatch_send_to_agent": {
22955
+ const session = stringArg(args, "session");
22956
+ const inReplyTo = optionalString(args, "in_reply_to");
22957
+ const message = await client.agentMessage(session, {
22958
+ body: stringArg(args, "body"),
22959
+ delivery: stringArg(args, "delivery"),
22960
+ ...inReplyTo === undefined ? {} : { in_reply_to: inReplyTo }
22961
+ });
22962
+ const attempt = message.deliveries?.at(-1);
22963
+ const readBack = conversationReadBack(message.id);
22964
+ const arrival = attempt === undefined ? "Dispatch recorded no delivery attempt for it" : attempt.state === "failed" ? `its delivery failed: ${attempt.error ?? "the listener gave no reason"}` : attempt.state === "pending" ? "its delivery is still on its way" : `it reached that session as ${attempt.delivery}`;
22965
+ return {
22966
+ text: `Sent message ${message.id} to session ${session}; ${arrival}. ${readBack}`,
22967
+ details: {
22968
+ session,
22969
+ message: message.id,
22970
+ ...attempt === undefined ? {} : { delivery: attempt.state },
22971
+ ...inReplyTo === undefined ? {} : { in_reply_to: inReplyTo }
22972
+ }
22973
+ };
22974
+ }
22932
22975
  case "dispatch_doc_edit": {
22933
22976
  const resolved = await resolveDocument(documentOwner(), optionalString(args, "artifact"));
22934
22977
  const ops = args.ops;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/claude-envoy",
3
- "version": "1.27.2",
3
+ "version": "1.28.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Claude Code plugin for Legion's Envoy bus",
6
6
  "type": "module",