@sjawhar/claude-envoy 5.28.0 → 5.29.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": "5.28.0"
5
+ "version": "5.29.0"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-envoy",
3
- "version": "5.28.0",
3
+ "version": "5.29.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
  }
@@ -14576,8 +14576,8 @@ var dispatchToolSpecs = [
14576
14576
  route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
14577
14577
  parent: z.string().describe("Parent issue key, in any project; an empty string clears the parent. A parent in another project passes on no repository, components or legion label.").optional(),
14578
14578
  blocked_by: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_BLOCKERS }).describe("Replacement list of issue keys this issue waits on, of any project; [] clears it. Dispatch refuses a dependency cycle.").optional(),
14579
- advances: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_ADVANCES }).describe("Replacement list of priority ids this issue advances, which dispatch priorities lists; [] clears the issue's own, leaving every priority it inherits from the issues above it. A set that moves two or more relations is a whole-set write and carries advances_revision; the call reads the issue and sends the revision that read answered, so pass advances_revision only to answer a 409 ADVANCES_REVISION.").optional(),
14580
- advances_revision: z.number().describe("The advances_revision the read this set answers returned, sent with advances and alone changing nothing. Omit it and the call sends the revision of its own read; pass the revision a 409 ADVANCES_REVISION named to write the set you mean against it.").optional(),
14579
+ advances: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_ADVANCES }).describe("Replacement list of priority ids this issue advances, which dispatch priorities lists; [] clears the issue's own, leaving every priority it inherits from the issues above it. Without advances_revision, Dispatch takes a list that adds or removes one priority, and refuses a list that changes two or more with 409 ADVANCES_REVISION, which names the issue's revision.").optional(),
14580
+ advances_revision: z.number().describe("The issue's advances revision, which the Advances line of dispatch read --issue <KEY> prints and a 409 ADVANCES_REVISION names. To change two or more priorities, read the issue, then send this revision with the whole list you mean. Alone it changes nothing.").optional(),
14581
14581
  components: componentsArgument(z).optional(),
14582
14582
  repo: z.string().describe("The repository the issue targets, owner/name. An empty string clears it, so the issue takes the nearest ancestor's in its own project, or the project's default, again.").optional(),
14583
14583
  before: z.string().describe(`Move the issue above this issue on its project's board: an issue key in the same project. With after, the issue lands between the two. ${BOARD_NEIGHBOUR_REFUSAL}`).optional(),
@@ -25616,9 +25616,9 @@ function advancesLine(issue) {
25616
25616
  return "Advances: unknown (this Dispatch server predates priorities; upgrade it)";
25617
25617
  }
25618
25618
  const advances = issue.advances ?? [];
25619
- if (advances.length === 0)
25620
- return "Advances: no priority";
25621
- return `Advances: ${advances.map(advanceText).join(", ")}`;
25619
+ const set = advances.length === 0 ? "no priority" : advances.map(advanceText).join(", ");
25620
+ const revision = issue.advances_revision === undefined ? "" : `; revision ${issue.advances_revision}`;
25621
+ return `Advances: ${set}${revision}`;
25622
25622
  }
25623
25623
  function claimText(claim, agents, read = {}) {
25624
25624
  const titles = agents?.titles;
@@ -26292,11 +26292,16 @@ function refuseUnsavedRepository(verb, issue, repo) {
26292
26292
  const lost = repo === "" ? "the repository was not cleared" : `${repo} was not saved`;
26293
26293
  throw new Error(`Dispatch ${verb} ${issue.key} without its repository: this Dispatch server predates repository fields, so ${lost}; upgrade the server`);
26294
26294
  }
26295
- function advancesRevisionToSend(issue, named) {
26296
- if (issue.advances_revision === undefined) {
26297
- throw new Error(`Dispatch read ${issue.key} without its advances: this Dispatch server predates priorities, so nothing was sent; upgrade the server`);
26298
- }
26299
- return named ?? issue.advances_revision;
26295
+ function refuseServerWithoutAdvances(issue) {
26296
+ if (issue.advances_revision !== undefined)
26297
+ return;
26298
+ throw new Error(`Dispatch read ${issue.key} without its advances: this Dispatch server predates priorities, so nothing was sent; upgrade the server`);
26299
+ }
26300
+ function advancesRevisionAnswer(issueKey, error) {
26301
+ if (!dispatchAnswered(error, 409) || error.code !== "ADVANCES_REVISION")
26302
+ return "";
26303
+ const held = /(\d+)\D*$/.exec(error.message)?.[1] ?? "<the revision named above>";
26304
+ return `read the issue with ${commandLine("dispatch_read", { issue: issueKey })}, then send the whole set you mean with ${fieldFlag("dispatch_issue_update", "advances_revision")} ${held}`;
26300
26305
  }
26301
26306
  async function issueCommand(context) {
26302
26307
  const { args, client, actor, input, linkBase } = context;
@@ -26407,7 +26412,9 @@ async function issueUpdateCommand(context) {
26407
26412
  } catch (error) {
26408
26413
  throw refusalWithCode(error);
26409
26414
  }
26410
- const advancesWrite = advances === undefined ? undefined : { advances, advances_revision: advancesRevisionToSend(before, advancesRevision) };
26415
+ if (advances !== undefined)
26416
+ refuseServerWithoutAdvances(before);
26417
+ const advancesWrite = advances === undefined ? undefined : { advances, ...defined("advances_revision", advancesRevision) };
26411
26418
  if (status === "done" && typeof before.closed_at === "string") {
26412
26419
  throw refusalWithCode(new DispatchServiceError("ISSUE_CLOSED", 409, "issue is closed"), `${issueKey} closed at ${before.closed_at}, so the reason was not posted and the close was not sent`);
26413
26420
  }
@@ -26465,15 +26472,17 @@ async function issueUpdateCommand(context) {
26465
26472
  throw error;
26466
26473
  const answered = error instanceof DispatchWriteUnsettledError ? error.last : error;
26467
26474
  const taken = dispatchAnswered(answered, 500) && newLinks.length > 0 ? `one of ${newLinks.join(", ")} may already be linked from another issue (a URL links exactly one issue)` : "";
26475
+ const revisionClause = advancesRevisionAnswer(issueKey, error);
26468
26476
  if (closingNote === undefined) {
26469
26477
  if (taken !== "" && !(error instanceof DispatchServiceError)) {
26470
26478
  throw withAccount(error, taken);
26471
26479
  }
26472
- throw refusalWithCode(error, taken);
26480
+ throw refusalWithCode(error, taken, revisionClause);
26473
26481
  }
26474
26482
  const landed = closeAccount(error, closingNote);
26475
- if (error instanceof DispatchServiceError)
26476
- throw refusalWithCode(error, taken, landed);
26483
+ if (error instanceof DispatchServiceError) {
26484
+ throw refusalWithCode(error, taken, revisionClause, landed);
26485
+ }
26477
26486
  throw withAccount(error, [taken, landed].filter((clause) => clause !== "").join("; "));
26478
26487
  }
26479
26488
  refuseUnsavedRepository("updated", after, repo);
@@ -28592,7 +28601,7 @@ function priorityWorkLine(work) {
28592
28601
  }
28593
28602
  function priorityIssueLine(issue, agents) {
28594
28603
  const advances = issue.advances ?? [];
28595
- const moved = issue.moved_at === null ? "" : ` \xB7 parked ${issue.moved_at}${issue.moved_by === null ? "" : ` by ${actorLabel(issue.moved_by, agents?.titles)}`}`;
28604
+ const moved = issue.moved_at === null ? "" : ` \xB7 moved to ${issue.status} ${issue.moved_at}${issue.moved_by === null ? "" : ` by ${actorLabel(issue.moved_by, agents?.titles)}`}`;
28596
28605
  return `- ${issue.key} [${issue.status}] ${issue.title} \xB7 ${issue.project}` + (issue.assignee === null ? "" : ` \xB7 ${issue.assignee}`) + (issue.claim === null ? "" : ` \xB7 claimed by ${claimText(issue.claim, agents)}`) + (advances.length === 0 ? "" : ` \xB7 advances ${advances.map(advanceText).join(", ")}`) + moved + ` \xB7 changed ${issue.changed_at}`;
28597
28606
  }
28598
28607
  function priorityFaultLines(heading, fault, agents) {
@@ -28608,7 +28617,7 @@ function priorityFaultLines(heading, fault, agents) {
28608
28617
  }
28609
28618
  function formatPriorities(response, agents) {
28610
28619
  const priorities = response.priorities ?? [];
28611
- const parked = response.priority_work_parked;
28620
+ const backlog = response.priority_work_parked;
28612
28621
  const unplaced = response.work_under_no_priority;
28613
28622
  if (response.empty !== undefined)
28614
28623
  return response.empty;
@@ -28621,7 +28630,7 @@ function formatPriorities(response, agents) {
28621
28630
  "",
28622
28631
  ...priorityFaultLines("Work under no priority", { count: unplaced.count, issues: unplaced.issues, by: unplaced.by_project }, agents),
28623
28632
  "",
28624
- ...priorityFaultLines("Priority work parked", { count: parked.count, issues: parked.issues, by: parked.by_priority }, agents)
28633
+ ...priorityFaultLines("Priority work in backlog or icebox", { count: backlog.count, issues: backlog.issues, by: backlog.by_priority }, agents)
28625
28634
  ].join(`
28626
28635
  `);
28627
28636
  }
package/dist/dispatch.js CHANGED
@@ -15182,8 +15182,8 @@ var dispatchToolSpecs = [
15182
15182
  route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
15183
15183
  parent: z.string().describe("Parent issue key, in any project; an empty string clears the parent. A parent in another project passes on no repository, components or legion label.").optional(),
15184
15184
  blocked_by: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_BLOCKERS }).describe("Replacement list of issue keys this issue waits on, of any project; [] clears it. Dispatch refuses a dependency cycle.").optional(),
15185
- advances: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_ADVANCES }).describe("Replacement list of priority ids this issue advances, which dispatch priorities lists; [] clears the issue's own, leaving every priority it inherits from the issues above it. A set that moves two or more relations is a whole-set write and carries advances_revision; the call reads the issue and sends the revision that read answered, so pass advances_revision only to answer a 409 ADVANCES_REVISION.").optional(),
15186
- advances_revision: z.number().describe("The advances_revision the read this set answers returned, sent with advances and alone changing nothing. Omit it and the call sends the revision of its own read; pass the revision a 409 ADVANCES_REVISION named to write the set you mean against it.").optional(),
15185
+ advances: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_ADVANCES }).describe("Replacement list of priority ids this issue advances, which dispatch priorities lists; [] clears the issue's own, leaving every priority it inherits from the issues above it. Without advances_revision, Dispatch takes a list that adds or removes one priority, and refuses a list that changes two or more with 409 ADVANCES_REVISION, which names the issue's revision.").optional(),
15186
+ advances_revision: z.number().describe("The issue's advances revision, which the Advances line of dispatch read --issue <KEY> prints and a 409 ADVANCES_REVISION names. To change two or more priorities, read the issue, then send this revision with the whole list you mean. Alone it changes nothing.").optional(),
15187
15187
  components: componentsArgument(z).optional(),
15188
15188
  repo: z.string().describe("The repository the issue targets, owner/name. An empty string clears it, so the issue takes the nearest ancestor's in its own project, or the project's default, again.").optional(),
15189
15189
  before: z.string().describe(`Move the issue above this issue on its project's board: an issue key in the same project. With after, the issue lands between the two. ${BOARD_NEIGHBOUR_REFUSAL}`).optional(),
@@ -26670,9 +26670,9 @@ function advancesLine(issue) {
26670
26670
  return "Advances: unknown (this Dispatch server predates priorities; upgrade it)";
26671
26671
  }
26672
26672
  const advances = issue.advances ?? [];
26673
- if (advances.length === 0)
26674
- return "Advances: no priority";
26675
- return `Advances: ${advances.map(advanceText).join(", ")}`;
26673
+ const set = advances.length === 0 ? "no priority" : advances.map(advanceText).join(", ");
26674
+ const revision = issue.advances_revision === undefined ? "" : `; revision ${issue.advances_revision}`;
26675
+ return `Advances: ${set}${revision}`;
26676
26676
  }
26677
26677
  function claimText(claim, agents, read = {}) {
26678
26678
  const titles = agents?.titles;
@@ -27346,11 +27346,16 @@ function refuseUnsavedRepository(verb, issue, repo) {
27346
27346
  const lost = repo === "" ? "the repository was not cleared" : `${repo} was not saved`;
27347
27347
  throw new Error(`Dispatch ${verb} ${issue.key} without its repository: this Dispatch server predates repository fields, so ${lost}; upgrade the server`);
27348
27348
  }
27349
- function advancesRevisionToSend(issue, named) {
27350
- if (issue.advances_revision === undefined) {
27351
- throw new Error(`Dispatch read ${issue.key} without its advances: this Dispatch server predates priorities, so nothing was sent; upgrade the server`);
27352
- }
27353
- return named ?? issue.advances_revision;
27349
+ function refuseServerWithoutAdvances(issue) {
27350
+ if (issue.advances_revision !== undefined)
27351
+ return;
27352
+ throw new Error(`Dispatch read ${issue.key} without its advances: this Dispatch server predates priorities, so nothing was sent; upgrade the server`);
27353
+ }
27354
+ function advancesRevisionAnswer(issueKey, error) {
27355
+ if (!dispatchAnswered(error, 409) || error.code !== "ADVANCES_REVISION")
27356
+ return "";
27357
+ const held = /(\d+)\D*$/.exec(error.message)?.[1] ?? "<the revision named above>";
27358
+ return `read the issue with ${commandLine("dispatch_read", { issue: issueKey })}, then send the whole set you mean with ${fieldFlag("dispatch_issue_update", "advances_revision")} ${held}`;
27354
27359
  }
27355
27360
  async function issueCommand(context) {
27356
27361
  const { args, client, actor, input, linkBase } = context;
@@ -27461,7 +27466,9 @@ async function issueUpdateCommand(context) {
27461
27466
  } catch (error) {
27462
27467
  throw refusalWithCode(error);
27463
27468
  }
27464
- const advancesWrite = advances === undefined ? undefined : { advances, advances_revision: advancesRevisionToSend(before, advancesRevision) };
27469
+ if (advances !== undefined)
27470
+ refuseServerWithoutAdvances(before);
27471
+ const advancesWrite = advances === undefined ? undefined : { advances, ...defined("advances_revision", advancesRevision) };
27465
27472
  if (status === "done" && typeof before.closed_at === "string") {
27466
27473
  throw refusalWithCode(new DispatchServiceError("ISSUE_CLOSED", 409, "issue is closed"), `${issueKey} closed at ${before.closed_at}, so the reason was not posted and the close was not sent`);
27467
27474
  }
@@ -27519,15 +27526,17 @@ async function issueUpdateCommand(context) {
27519
27526
  throw error;
27520
27527
  const answered = error instanceof DispatchWriteUnsettledError ? error.last : error;
27521
27528
  const taken = dispatchAnswered(answered, 500) && newLinks.length > 0 ? `one of ${newLinks.join(", ")} may already be linked from another issue (a URL links exactly one issue)` : "";
27529
+ const revisionClause = advancesRevisionAnswer(issueKey, error);
27522
27530
  if (closingNote === undefined) {
27523
27531
  if (taken !== "" && !(error instanceof DispatchServiceError)) {
27524
27532
  throw withAccount(error, taken);
27525
27533
  }
27526
- throw refusalWithCode(error, taken);
27534
+ throw refusalWithCode(error, taken, revisionClause);
27527
27535
  }
27528
27536
  const landed = closeAccount(error, closingNote);
27529
- if (error instanceof DispatchServiceError)
27530
- throw refusalWithCode(error, taken, landed);
27537
+ if (error instanceof DispatchServiceError) {
27538
+ throw refusalWithCode(error, taken, revisionClause, landed);
27539
+ }
27531
27540
  throw withAccount(error, [taken, landed].filter((clause) => clause !== "").join("; "));
27532
27541
  }
27533
27542
  refuseUnsavedRepository("updated", after, repo);
@@ -34079,7 +34088,7 @@ function priorityWorkLine(work) {
34079
34088
  }
34080
34089
  function priorityIssueLine(issue, agents) {
34081
34090
  const advances = issue.advances ?? [];
34082
- const moved = issue.moved_at === null ? "" : ` \xB7 parked ${issue.moved_at}${issue.moved_by === null ? "" : ` by ${actorLabel(issue.moved_by, agents?.titles)}`}`;
34091
+ const moved = issue.moved_at === null ? "" : ` \xB7 moved to ${issue.status} ${issue.moved_at}${issue.moved_by === null ? "" : ` by ${actorLabel(issue.moved_by, agents?.titles)}`}`;
34083
34092
  return `- ${issue.key} [${issue.status}] ${issue.title} \xB7 ${issue.project}` + (issue.assignee === null ? "" : ` \xB7 ${issue.assignee}`) + (issue.claim === null ? "" : ` \xB7 claimed by ${claimText(issue.claim, agents)}`) + (advances.length === 0 ? "" : ` \xB7 advances ${advances.map(advanceText).join(", ")}`) + moved + ` \xB7 changed ${issue.changed_at}`;
34084
34093
  }
34085
34094
  function priorityFaultLines(heading, fault, agents) {
@@ -34095,7 +34104,7 @@ function priorityFaultLines(heading, fault, agents) {
34095
34104
  }
34096
34105
  function formatPriorities(response, agents) {
34097
34106
  const priorities = response.priorities ?? [];
34098
- const parked = response.priority_work_parked;
34107
+ const backlog = response.priority_work_parked;
34099
34108
  const unplaced = response.work_under_no_priority;
34100
34109
  if (response.empty !== undefined)
34101
34110
  return response.empty;
@@ -34108,7 +34117,7 @@ function formatPriorities(response, agents) {
34108
34117
  "",
34109
34118
  ...priorityFaultLines("Work under no priority", { count: unplaced.count, issues: unplaced.issues, by: unplaced.by_project }, agents),
34110
34119
  "",
34111
- ...priorityFaultLines("Priority work parked", { count: parked.count, issues: parked.issues, by: parked.by_priority }, agents)
34120
+ ...priorityFaultLines("Priority work in backlog or icebox", { count: backlog.count, issues: backlog.issues, by: backlog.by_priority }, agents)
34112
34121
  ].join(`
34113
34122
  `);
34114
34123
  }
@@ -37376,8 +37376,8 @@ var dispatchToolSpecs = [
37376
37376
  route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
37377
37377
  parent: z.string().describe("Parent issue key, in any project; an empty string clears the parent. A parent in another project passes on no repository, components or legion label.").optional(),
37378
37378
  blocked_by: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_BLOCKERS }).describe("Replacement list of issue keys this issue waits on, of any project; [] clears it. Dispatch refuses a dependency cycle.").optional(),
37379
- advances: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_ADVANCES }).describe("Replacement list of priority ids this issue advances, which dispatch priorities lists; [] clears the issue's own, leaving every priority it inherits from the issues above it. A set that moves two or more relations is a whole-set write and carries advances_revision; the call reads the issue and sends the revision that read answered, so pass advances_revision only to answer a 409 ADVANCES_REVISION.").optional(),
37380
- advances_revision: z.number().describe("The advances_revision the read this set answers returned, sent with advances and alone changing nothing. Omit it and the call sends the revision of its own read; pass the revision a 409 ADVANCES_REVISION named to write the set you mean against it.").optional(),
37379
+ advances: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_ADVANCES }).describe("Replacement list of priority ids this issue advances, which dispatch priorities lists; [] clears the issue's own, leaving every priority it inherits from the issues above it. Without advances_revision, Dispatch takes a list that adds or removes one priority, and refuses a list that changes two or more with 409 ADVANCES_REVISION, which names the issue's revision.").optional(),
37380
+ advances_revision: z.number().describe("The issue's advances revision, which the Advances line of dispatch read --issue <KEY> prints and a 409 ADVANCES_REVISION names. To change two or more priorities, read the issue, then send this revision with the whole list you mean. Alone it changes nothing.").optional(),
37381
37381
  components: componentsArgument(z).optional(),
37382
37382
  repo: z.string().describe("The repository the issue targets, owner/name. An empty string clears it, so the issue takes the nearest ancestor's in its own project, or the project's default, again.").optional(),
37383
37383
  before: z.string().describe(`Move the issue above this issue on its project's board: an issue key in the same project. With after, the issue lands between the two. ${BOARD_NEIGHBOUR_REFUSAL}`).optional(),
@@ -53101,9 +53101,9 @@ function advancesLine(issue) {
53101
53101
  return "Advances: unknown (this Dispatch server predates priorities; upgrade it)";
53102
53102
  }
53103
53103
  const advances = issue.advances ?? [];
53104
- if (advances.length === 0)
53105
- return "Advances: no priority";
53106
- return `Advances: ${advances.map(advanceText).join(", ")}`;
53104
+ const set = advances.length === 0 ? "no priority" : advances.map(advanceText).join(", ");
53105
+ const revision = issue.advances_revision === undefined ? "" : `; revision ${issue.advances_revision}`;
53106
+ return `Advances: ${set}${revision}`;
53107
53107
  }
53108
53108
  function claimText(claim, agents, read = {}) {
53109
53109
  const titles = agents?.titles;
@@ -53777,11 +53777,16 @@ function refuseUnsavedRepository(verb, issue, repo) {
53777
53777
  const lost = repo === "" ? "the repository was not cleared" : `${repo} was not saved`;
53778
53778
  throw new Error(`Dispatch ${verb} ${issue.key} without its repository: this Dispatch server predates repository fields, so ${lost}; upgrade the server`);
53779
53779
  }
53780
- function advancesRevisionToSend(issue, named) {
53781
- if (issue.advances_revision === undefined) {
53782
- throw new Error(`Dispatch read ${issue.key} without its advances: this Dispatch server predates priorities, so nothing was sent; upgrade the server`);
53783
- }
53784
- return named ?? issue.advances_revision;
53780
+ function refuseServerWithoutAdvances(issue) {
53781
+ if (issue.advances_revision !== undefined)
53782
+ return;
53783
+ throw new Error(`Dispatch read ${issue.key} without its advances: this Dispatch server predates priorities, so nothing was sent; upgrade the server`);
53784
+ }
53785
+ function advancesRevisionAnswer(issueKey, error) {
53786
+ if (!dispatchAnswered(error, 409) || error.code !== "ADVANCES_REVISION")
53787
+ return "";
53788
+ const held = /(\d+)\D*$/.exec(error.message)?.[1] ?? "<the revision named above>";
53789
+ return `read the issue with ${commandLine("dispatch_read", { issue: issueKey })}, then send the whole set you mean with ${fieldFlag("dispatch_issue_update", "advances_revision")} ${held}`;
53785
53790
  }
53786
53791
  async function issueCommand(context) {
53787
53792
  const { args, client, actor, input, linkBase } = context;
@@ -53892,7 +53897,9 @@ async function issueUpdateCommand(context) {
53892
53897
  } catch (error) {
53893
53898
  throw refusalWithCode(error);
53894
53899
  }
53895
- const advancesWrite = advances === undefined ? undefined : { advances, advances_revision: advancesRevisionToSend(before, advancesRevision) };
53900
+ if (advances !== undefined)
53901
+ refuseServerWithoutAdvances(before);
53902
+ const advancesWrite = advances === undefined ? undefined : { advances, ...defined("advances_revision", advancesRevision) };
53896
53903
  if (status === "done" && typeof before.closed_at === "string") {
53897
53904
  throw refusalWithCode(new DispatchServiceError("ISSUE_CLOSED", 409, "issue is closed"), `${issueKey} closed at ${before.closed_at}, so the reason was not posted and the close was not sent`);
53898
53905
  }
@@ -53950,15 +53957,17 @@ async function issueUpdateCommand(context) {
53950
53957
  throw error;
53951
53958
  const answered = error instanceof DispatchWriteUnsettledError ? error.last : error;
53952
53959
  const taken = dispatchAnswered(answered, 500) && newLinks.length > 0 ? `one of ${newLinks.join(", ")} may already be linked from another issue (a URL links exactly one issue)` : "";
53960
+ const revisionClause = advancesRevisionAnswer(issueKey, error);
53953
53961
  if (closingNote === undefined) {
53954
53962
  if (taken !== "" && !(error instanceof DispatchServiceError)) {
53955
53963
  throw withAccount(error, taken);
53956
53964
  }
53957
- throw refusalWithCode(error, taken);
53965
+ throw refusalWithCode(error, taken, revisionClause);
53958
53966
  }
53959
53967
  const landed = closeAccount(error, closingNote);
53960
- if (error instanceof DispatchServiceError)
53961
- throw refusalWithCode(error, taken, landed);
53968
+ if (error instanceof DispatchServiceError) {
53969
+ throw refusalWithCode(error, taken, revisionClause, landed);
53970
+ }
53962
53971
  throw withAccount(error, [taken, landed].filter((clause) => clause !== "").join("; "));
53963
53972
  }
53964
53973
  refuseUnsavedRepository("updated", after, repo);
@@ -56077,7 +56086,7 @@ function priorityWorkLine(work) {
56077
56086
  }
56078
56087
  function priorityIssueLine(issue, agents) {
56079
56088
  const advances = issue.advances ?? [];
56080
- const moved = issue.moved_at === null ? "" : ` \xB7 parked ${issue.moved_at}${issue.moved_by === null ? "" : ` by ${actorLabel(issue.moved_by, agents?.titles)}`}`;
56089
+ const moved = issue.moved_at === null ? "" : ` \xB7 moved to ${issue.status} ${issue.moved_at}${issue.moved_by === null ? "" : ` by ${actorLabel(issue.moved_by, agents?.titles)}`}`;
56081
56090
  return `- ${issue.key} [${issue.status}] ${issue.title} \xB7 ${issue.project}` + (issue.assignee === null ? "" : ` \xB7 ${issue.assignee}`) + (issue.claim === null ? "" : ` \xB7 claimed by ${claimText(issue.claim, agents)}`) + (advances.length === 0 ? "" : ` \xB7 advances ${advances.map(advanceText).join(", ")}`) + moved + ` \xB7 changed ${issue.changed_at}`;
56082
56091
  }
56083
56092
  function priorityFaultLines(heading, fault, agents) {
@@ -56093,7 +56102,7 @@ function priorityFaultLines(heading, fault, agents) {
56093
56102
  }
56094
56103
  function formatPriorities(response, agents) {
56095
56104
  const priorities = response.priorities ?? [];
56096
- const parked = response.priority_work_parked;
56105
+ const backlog = response.priority_work_parked;
56097
56106
  const unplaced = response.work_under_no_priority;
56098
56107
  if (response.empty !== undefined)
56099
56108
  return response.empty;
@@ -56106,7 +56115,7 @@ function formatPriorities(response, agents) {
56106
56115
  "",
56107
56116
  ...priorityFaultLines("Work under no priority", { count: unplaced.count, issues: unplaced.issues, by: unplaced.by_project }, agents),
56108
56117
  "",
56109
- ...priorityFaultLines("Priority work parked", { count: parked.count, issues: parked.issues, by: parked.by_priority }, agents)
56118
+ ...priorityFaultLines("Priority work in backlog or icebox", { count: backlog.count, issues: backlog.issues, by: backlog.by_priority }, agents)
56110
56119
  ].join(`
56111
56120
  `);
56112
56121
  }
@@ -63498,7 +63507,7 @@ var import_nats5 = __toESM(require_mod4(), 1);
63498
63507
 
63499
63508
  // package.json
63500
63509
  var name2 = "@sjawhar/claude-envoy";
63501
- var version2 = "5.28.0";
63510
+ var version2 = "5.29.0";
63502
63511
  var legion = {
63503
63512
  daemonApiVersion: 275
63504
63513
  };
@@ -18078,8 +18078,8 @@ var dispatchToolSpecs = [
18078
18078
  route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
18079
18079
  parent: z.string().describe("Parent issue key, in any project; an empty string clears the parent. A parent in another project passes on no repository, components or legion label.").optional(),
18080
18080
  blocked_by: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_BLOCKERS }).describe("Replacement list of issue keys this issue waits on, of any project; [] clears it. Dispatch refuses a dependency cycle.").optional(),
18081
- advances: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_ADVANCES }).describe("Replacement list of priority ids this issue advances, which dispatch priorities lists; [] clears the issue's own, leaving every priority it inherits from the issues above it. A set that moves two or more relations is a whole-set write and carries advances_revision; the call reads the issue and sends the revision that read answered, so pass advances_revision only to answer a 409 ADVANCES_REVISION.").optional(),
18082
- advances_revision: z.number().describe("The advances_revision the read this set answers returned, sent with advances and alone changing nothing. Omit it and the call sends the revision of its own read; pass the revision a 409 ADVANCES_REVISION named to write the set you mean against it.").optional(),
18081
+ advances: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_ADVANCES }).describe("Replacement list of priority ids this issue advances, which dispatch priorities lists; [] clears the issue's own, leaving every priority it inherits from the issues above it. Without advances_revision, Dispatch takes a list that adds or removes one priority, and refuses a list that changes two or more with 409 ADVANCES_REVISION, which names the issue's revision.").optional(),
18082
+ advances_revision: z.number().describe("The issue's advances revision, which the Advances line of dispatch read --issue <KEY> prints and a 409 ADVANCES_REVISION names. To change two or more priorities, read the issue, then send this revision with the whole list you mean. Alone it changes nothing.").optional(),
18083
18083
  components: componentsArgument(z).optional(),
18084
18084
  repo: z.string().describe("The repository the issue targets, owner/name. An empty string clears it, so the issue takes the nearest ancestor's in its own project, or the project's default, again.").optional(),
18085
18085
  before: z.string().describe(`Move the issue above this issue on its project's board: an issue key in the same project. With after, the issue lands between the two. ${BOARD_NEIGHBOUR_REFUSAL}`).optional(),
@@ -28450,9 +28450,9 @@ function advancesLine(issue) {
28450
28450
  return "Advances: unknown (this Dispatch server predates priorities; upgrade it)";
28451
28451
  }
28452
28452
  const advances = issue.advances ?? [];
28453
- if (advances.length === 0)
28454
- return "Advances: no priority";
28455
- return `Advances: ${advances.map(advanceText).join(", ")}`;
28453
+ const set = advances.length === 0 ? "no priority" : advances.map(advanceText).join(", ");
28454
+ const revision = issue.advances_revision === undefined ? "" : `; revision ${issue.advances_revision}`;
28455
+ return `Advances: ${set}${revision}`;
28456
28456
  }
28457
28457
  function claimText(claim, agents, read = {}) {
28458
28458
  const titles = agents?.titles;
@@ -29126,11 +29126,16 @@ function refuseUnsavedRepository(verb, issue, repo) {
29126
29126
  const lost = repo === "" ? "the repository was not cleared" : `${repo} was not saved`;
29127
29127
  throw new Error(`Dispatch ${verb} ${issue.key} without its repository: this Dispatch server predates repository fields, so ${lost}; upgrade the server`);
29128
29128
  }
29129
- function advancesRevisionToSend(issue, named) {
29130
- if (issue.advances_revision === undefined) {
29131
- throw new Error(`Dispatch read ${issue.key} without its advances: this Dispatch server predates priorities, so nothing was sent; upgrade the server`);
29132
- }
29133
- return named ?? issue.advances_revision;
29129
+ function refuseServerWithoutAdvances(issue) {
29130
+ if (issue.advances_revision !== undefined)
29131
+ return;
29132
+ throw new Error(`Dispatch read ${issue.key} without its advances: this Dispatch server predates priorities, so nothing was sent; upgrade the server`);
29133
+ }
29134
+ function advancesRevisionAnswer(issueKey, error) {
29135
+ if (!dispatchAnswered(error, 409) || error.code !== "ADVANCES_REVISION")
29136
+ return "";
29137
+ const held = /(\d+)\D*$/.exec(error.message)?.[1] ?? "<the revision named above>";
29138
+ return `read the issue with ${commandLine("dispatch_read", { issue: issueKey })}, then send the whole set you mean with ${fieldFlag("dispatch_issue_update", "advances_revision")} ${held}`;
29134
29139
  }
29135
29140
  async function issueCommand(context) {
29136
29141
  const { args, client, actor, input, linkBase } = context;
@@ -29241,7 +29246,9 @@ async function issueUpdateCommand(context) {
29241
29246
  } catch (error) {
29242
29247
  throw refusalWithCode(error);
29243
29248
  }
29244
- const advancesWrite = advances === undefined ? undefined : { advances, advances_revision: advancesRevisionToSend(before, advancesRevision) };
29249
+ if (advances !== undefined)
29250
+ refuseServerWithoutAdvances(before);
29251
+ const advancesWrite = advances === undefined ? undefined : { advances, ...defined("advances_revision", advancesRevision) };
29245
29252
  if (status === "done" && typeof before.closed_at === "string") {
29246
29253
  throw refusalWithCode(new DispatchServiceError("ISSUE_CLOSED", 409, "issue is closed"), `${issueKey} closed at ${before.closed_at}, so the reason was not posted and the close was not sent`);
29247
29254
  }
@@ -29299,15 +29306,17 @@ async function issueUpdateCommand(context) {
29299
29306
  throw error;
29300
29307
  const answered = error instanceof DispatchWriteUnsettledError ? error.last : error;
29301
29308
  const taken = dispatchAnswered(answered, 500) && newLinks.length > 0 ? `one of ${newLinks.join(", ")} may already be linked from another issue (a URL links exactly one issue)` : "";
29309
+ const revisionClause = advancesRevisionAnswer(issueKey, error);
29302
29310
  if (closingNote === undefined) {
29303
29311
  if (taken !== "" && !(error instanceof DispatchServiceError)) {
29304
29312
  throw withAccount(error, taken);
29305
29313
  }
29306
- throw refusalWithCode(error, taken);
29314
+ throw refusalWithCode(error, taken, revisionClause);
29307
29315
  }
29308
29316
  const landed = closeAccount(error, closingNote);
29309
- if (error instanceof DispatchServiceError)
29310
- throw refusalWithCode(error, taken, landed);
29317
+ if (error instanceof DispatchServiceError) {
29318
+ throw refusalWithCode(error, taken, revisionClause, landed);
29319
+ }
29311
29320
  throw withAccount(error, [taken, landed].filter((clause) => clause !== "").join("; "));
29312
29321
  }
29313
29322
  refuseUnsavedRepository("updated", after, repo);
@@ -31426,7 +31435,7 @@ function priorityWorkLine(work) {
31426
31435
  }
31427
31436
  function priorityIssueLine(issue, agents) {
31428
31437
  const advances = issue.advances ?? [];
31429
- const moved = issue.moved_at === null ? "" : ` \xB7 parked ${issue.moved_at}${issue.moved_by === null ? "" : ` by ${actorLabel(issue.moved_by, agents?.titles)}`}`;
31438
+ const moved = issue.moved_at === null ? "" : ` \xB7 moved to ${issue.status} ${issue.moved_at}${issue.moved_by === null ? "" : ` by ${actorLabel(issue.moved_by, agents?.titles)}`}`;
31430
31439
  return `- ${issue.key} [${issue.status}] ${issue.title} \xB7 ${issue.project}` + (issue.assignee === null ? "" : ` \xB7 ${issue.assignee}`) + (issue.claim === null ? "" : ` \xB7 claimed by ${claimText(issue.claim, agents)}`) + (advances.length === 0 ? "" : ` \xB7 advances ${advances.map(advanceText).join(", ")}`) + moved + ` \xB7 changed ${issue.changed_at}`;
31431
31440
  }
31432
31441
  function priorityFaultLines(heading, fault, agents) {
@@ -31442,7 +31451,7 @@ function priorityFaultLines(heading, fault, agents) {
31442
31451
  }
31443
31452
  function formatPriorities(response, agents) {
31444
31453
  const priorities = response.priorities ?? [];
31445
- const parked = response.priority_work_parked;
31454
+ const backlog = response.priority_work_parked;
31446
31455
  const unplaced = response.work_under_no_priority;
31447
31456
  if (response.empty !== undefined)
31448
31457
  return response.empty;
@@ -31455,7 +31464,7 @@ function formatPriorities(response, agents) {
31455
31464
  "",
31456
31465
  ...priorityFaultLines("Work under no priority", { count: unplaced.count, issues: unplaced.issues, by: unplaced.by_project }, agents),
31457
31466
  "",
31458
- ...priorityFaultLines("Priority work parked", { count: parked.count, issues: parked.issues, by: parked.by_priority }, agents)
31467
+ ...priorityFaultLines("Priority work in backlog or icebox", { count: backlog.count, issues: backlog.issues, by: backlog.by_priority }, agents)
31459
31468
  ].join(`
31460
31469
  `);
31461
31470
  }
@@ -31,6 +31,6 @@ dispatch issue-update --issue <KEY> --label '<each current label>' --label legio
31
31
 
32
32
  A label holding a `'` or a line break cannot be quoted and never goes in a command: tell the person (`<KEY>: label <label> cannot be quoted`), so they hand it over from the issue header.
33
33
 
34
- The daemon queues nothing for a label a session set, so admit a `triage` root in the same turn, from step 3. In any other status, `set_status` it to `todo` only when the person asked Legion to start it now. When you file or admit an issue, name each priority it advances (`--advance <id>`; `dispatch priorities` lists them). A child needs no label: it runs in its tree.
34
+ The daemon queues nothing for a label a session set, so admit a `triage` root in the same turn, from step 3. In any other status, `set_status` it to `todo` only when the person asked Legion to start it now. When you file or admit an issue, name each priority it advances (`--advance <id>`; `dispatch priorities` lists them). An issue in flight that advances none is named on the priorities page, in its `Active under no priority` tab (`/priorities?tab=none`), and by `dispatch priorities`. A child needs no label: it runs in its tree.
35
35
 
36
36
  Work that must start at a commit other than its base branch's head needs `legion/<KEY>` there before Legion starts the issue: a root before admission, a child before its first phase. You push nothing, so whoever gives you the root, or the architect that owns a child's parent, runs `gh api -X POST repos/<owner>/<name>/git/refs -f ref=refs/heads/legion/<KEY> -f sha=<commit>`. Read it back before `set_status` to `todo`: `gh api repos/<owner>/<name>/git/ref/heads/legion/<KEY>`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/claude-envoy",
3
- "version": "5.28.0",
3
+ "version": "5.29.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Claude Code plugin for Legion's Envoy bus",
6
6
  "type": "module",
@@ -40,9 +40,9 @@ The question and the recommendation (`skill://dispatch-writing-specs`).
40
40
  - Move an issue to `backlog`, `icebox` or `triage` only when a person asked for that move, or when the work is done, folded into another issue or no longer needed, and cite that reason in a comment on the issue. An agent's directive citing no person's request is no reason.
41
41
  - When you stop work on an issue before it is done, release your claim and say why in a comment. Set its status to the one it had when you took it (`todo` for an issue from the queue). Change no priority or board rank.
42
42
  - Record each wait in that comment. A wait on any project's issue also goes in a `blocked_by` link.
43
- - `dispatch issue-update --blocked-by` replaces the issue's whole list, so read its links first. A one-project credential links only its own issues (`PROJECT_SCOPE`).
43
+ - `dispatch issue-update --blocked-by` replaces the issue's whole list, so read that list first. A one-project credential links only its own issues (`PROJECT_SCOPE`).
44
44
  - Never reorder the board: one agent keeps each project's order (`issue-update --before`/`--after`). If the top looks wrong, tell `notifications.role.legion-<project>-controller`.
45
- - Name an issue's priority: `--advance <id>`; `dispatch priorities` lists what advances no priority.
45
+ - Name an issue's priority: `--advance <id>`; the priorities page (`/priorities?tab=none`) and `dispatch priorities` list what advances no priority.
46
46
 
47
47
  ## Issue status is yours to move
48
48