@sjawhar/claude-envoy 5.12.5 → 5.14.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.
Files changed (25) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.omp-plugin/plugin.json +1 -1
  3. package/dist/codex-hook.js +8 -8
  4. package/dist/dispatch.js +8 -8
  5. package/dist/envoy-channel.js +52 -18
  6. package/dist/session-hook.js +8 -8
  7. package/legion/skills/legion-architect/SKILL.md +76 -84
  8. package/legion/skills/legion-architect/references/acceptance.md +83 -79
  9. package/legion/skills/legion-architect/references/decomposition.md +73 -77
  10. package/legion/skills/legion-architect/references/design-gate.md +1 -1
  11. package/legion/skills/legion-architect/references/plan-changes.md +30 -0
  12. package/legion/skills/legion-architect/references/plan.md +66 -0
  13. package/legion/skills/legion-architect/references/wake-routing.md +28 -27
  14. package/legion/skills/legion-controller/references/admission.md +34 -10
  15. package/legion/skills/legion-controller/references/daily-report.md +57 -17
  16. package/legion/skills/legion-retro/SKILL.md +65 -60
  17. package/legion/skills/legion-retro/references/pr-body-content.md +22 -23
  18. package/legion/skills/legion-worker/SKILL.md +89 -21
  19. package/legion/skills/legion-worker/references/ci-checks.md +28 -7
  20. package/legion/skills/legion-worker/references/conflicts-and-rewrites.md +1 -1
  21. package/legion/skills/legion-worker/references/merge-gate.md +64 -25
  22. package/legion/skills/legion-worker/references/pr-body.md +22 -29
  23. package/legion/skills/legion-worker/references/results.md +50 -0
  24. package/legion/skills/legion-worker/references/review-threads.md +19 -4
  25. package/package.json +2 -2
@@ -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.12.5"
5
+ "version": "5.14.0"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-envoy",
3
- "version": "5.12.5",
3
+ "version": "5.14.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
  }
@@ -14238,7 +14238,7 @@ var readValidation = {
14238
14238
  var ISSUE_COMPONENTS_MODES = ["inherit", "explicit", "none"];
14239
14239
  function componentsArgument(z) {
14240
14240
  return z.object({
14241
- mode: z.enum(ISSUE_COMPONENTS_MODES).describe("inherit: take the parent chain's attachment (the default; deletes this issue's own). explicit: attach to ids. none: not architectural work, with reason."),
14241
+ mode: z.enum(ISSUE_COMPONENTS_MODES).describe("inherit: take the parent chain's attachment within the issue's own project (the default; deletes this issue's own). explicit: attach to ids. none: not architectural work, with reason."),
14242
14242
  ids: z.array(z.string({ min: 1 }), { min: 1, max: 50 }).describe("For mode explicit: bare component ids from the project's architecture model (web, dispatch-server), not external ones.").optional(),
14243
14243
  reason: z.string({ min: 1 }).describe("For mode none: why this issue is not architectural (process, hiring, ops).").optional()
14244
14244
  }).describe("Attach the issue to architecture components. Attach the root before decomposing it; children inherit unless they choose.");
@@ -14375,7 +14375,7 @@ var dispatchToolSpecs = [
14375
14375
  arguments: (z) => ({
14376
14376
  project: z.string({ min: 1 }).describe("Project key for the new issue. Every create needs one, also a create that names external."),
14377
14377
  title: z.string({ max: ISSUE_TITLE_MAX }).describe("Concise issue title, at most 1,000 characters."),
14378
- parent: z.string().describe("Optional parent issue.").optional(),
14378
+ parent: z.string().describe("Optional parent issue, in any project.").optional(),
14379
14379
  blocked_by: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_BLOCKERS }).describe("Issue keys this issue waits on; a key of any project, so work tracked elsewhere can be named. Dispatch refuses a dependency cycle.").optional(),
14380
14380
  advances: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_ADVANCES }).describe("Ids of the deployment's priorities this issue advances, which dispatch priorities lists. A child inherits every priority the issues above it advance, so name here only what this issue adds.").optional(),
14381
14381
  external: z.string().describe("Optional external issue reference.").optional(),
@@ -14383,9 +14383,9 @@ var dispatchToolSpecs = [
14383
14383
  spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_POINTER}`).optional(),
14384
14384
  labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Optional initial labels, at most 20 labels of up to 40 characters.").optional(),
14385
14385
  priority: z.number({ int: true, min: 0, max: 3 }).describe("Optional coarse priority, a number from 0 to 3: 0 is highest and 3 is lowest.").optional(),
14386
- assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
14386
+ assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A parent in another project passes on no assignee. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
14387
14387
  components: componentsArgument(z).optional(),
14388
- repo: z.string().describe("The repository the issue targets, owner/name. A child inherits its parent's when unset, and an issue with none on its parent chain takes the project's default.").optional()
14388
+ repo: z.string().describe("The repository the issue targets, owner/name. When unset, the issue takes the nearest ancestor's in its own project, and an issue with none above it in its own project takes the project's default.").optional()
14389
14389
  })
14390
14390
  },
14391
14391
  {
@@ -14406,12 +14406,12 @@ var dispatchToolSpecs = [
14406
14406
  assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue, and every ask on it then waits on the project's default assignee. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
14407
14407
  external_links: z.array(z.string({ min: 1 })).describe("URLs to link; a non-empty list merges into the issue's existing external links by URL, an empty list removes every link instead.").optional(),
14408
14408
  route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
14409
- parent: z.string().describe("Parent issue key in the same project; an empty string clears the parent.").optional(),
14409
+ 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(),
14410
14410
  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(),
14411
14411
  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(),
14412
14412
  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(),
14413
14413
  components: componentsArgument(z).optional(),
14414
- repo: z.string().describe("The repository the issue targets, owner/name. An empty string clears it, so the issue inherits its parent's or the project's default again.").optional(),
14414
+ 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(),
14415
14415
  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(),
14416
14416
  after: z.string().describe(`Move the issue below this issue on its project's board: an issue key in the same project. With before, the issue lands between the two. ${BOARD_NEIGHBOUR_REFUSAL}`).optional()
14417
14417
  }),
@@ -14884,7 +14884,7 @@ var dispatchToolSpecs = [
14884
14884
  {
14885
14885
  name: "dispatch_whoami",
14886
14886
  example: {},
14887
- description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee and then to the project's default assignee, which every project names, so every issue you create has an assignee. A question on an issue reaches the person it was handed to, else the issue's assignee, else the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
14887
+ description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee, when the parent is in the issue's own project, and then to the project's default assignee, which every project names, so every issue you create has an assignee. A question on an issue reaches the person it was handed to, else the issue's assignee, else the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
14888
14888
  arguments: () => ({}),
14889
14889
  strict: true
14890
14890
  },
@@ -28387,7 +28387,7 @@ async function whoamiCommand(context) {
28387
28387
  const proved = identity.kind === "agent" ? identity.session ?? null : null;
28388
28388
  const project = identity.kind === "agent" ? identity.project ?? null : null;
28389
28389
  const session = proved ?? sessionId;
28390
- const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee, else the project's default assignee, which every project names, so the issue always has one.";
28390
+ const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee when the parent is in the same project, else the project's default assignee, which every project names, so the issue always has one.";
28391
28391
  const signInNeeded = owner === null && service !== null && proved !== null;
28392
28392
  const acting = owner !== null ? `Session ${session} acts for ${owner}: issues you create without an assignee are assigned to ${owner}.` : service !== null ? signInNeeded ? `Session ${session} runs as service ${serviceSubjectLabel(service)} and no person, so it may read but Dispatch refuses every write it makes: run \`agent-secrets login\` on this machine to write as yourself.` : `Session ${session} runs as service ${serviceSubjectLabel(service)}: ${unowned}` : `Session ${session} runs under the shared token: ${unowned}`;
28393
28393
  const elsewhere = proved !== null && proved !== sessionId ? ` Your credential names session ${proved}, which is not this host session (${sessionId}): Dispatch records every write you make as ${proved}.` : "";
package/dist/dispatch.js CHANGED
@@ -14838,7 +14838,7 @@ var readValidation = {
14838
14838
  var ISSUE_COMPONENTS_MODES = ["inherit", "explicit", "none"];
14839
14839
  function componentsArgument(z) {
14840
14840
  return z.object({
14841
- mode: z.enum(ISSUE_COMPONENTS_MODES).describe("inherit: take the parent chain's attachment (the default; deletes this issue's own). explicit: attach to ids. none: not architectural work, with reason."),
14841
+ mode: z.enum(ISSUE_COMPONENTS_MODES).describe("inherit: take the parent chain's attachment within the issue's own project (the default; deletes this issue's own). explicit: attach to ids. none: not architectural work, with reason."),
14842
14842
  ids: z.array(z.string({ min: 1 }), { min: 1, max: 50 }).describe("For mode explicit: bare component ids from the project's architecture model (web, dispatch-server), not external ones.").optional(),
14843
14843
  reason: z.string({ min: 1 }).describe("For mode none: why this issue is not architectural (process, hiring, ops).").optional()
14844
14844
  }).describe("Attach the issue to architecture components. Attach the root before decomposing it; children inherit unless they choose.");
@@ -14975,7 +14975,7 @@ var dispatchToolSpecs = [
14975
14975
  arguments: (z) => ({
14976
14976
  project: z.string({ min: 1 }).describe("Project key for the new issue. Every create needs one, also a create that names external."),
14977
14977
  title: z.string({ max: ISSUE_TITLE_MAX }).describe("Concise issue title, at most 1,000 characters."),
14978
- parent: z.string().describe("Optional parent issue.").optional(),
14978
+ parent: z.string().describe("Optional parent issue, in any project.").optional(),
14979
14979
  blocked_by: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_BLOCKERS }).describe("Issue keys this issue waits on; a key of any project, so work tracked elsewhere can be named. Dispatch refuses a dependency cycle.").optional(),
14980
14980
  advances: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_ADVANCES }).describe("Ids of the deployment's priorities this issue advances, which dispatch priorities lists. A child inherits every priority the issues above it advance, so name here only what this issue adds.").optional(),
14981
14981
  external: z.string().describe("Optional external issue reference.").optional(),
@@ -14983,9 +14983,9 @@ var dispatchToolSpecs = [
14983
14983
  spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_POINTER}`).optional(),
14984
14984
  labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Optional initial labels, at most 20 labels of up to 40 characters.").optional(),
14985
14985
  priority: z.number({ int: true, min: 0, max: 3 }).describe("Optional coarse priority, a number from 0 to 3: 0 is highest and 3 is lowest.").optional(),
14986
- assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
14986
+ assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A parent in another project passes on no assignee. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
14987
14987
  components: componentsArgument(z).optional(),
14988
- repo: z.string().describe("The repository the issue targets, owner/name. A child inherits its parent's when unset, and an issue with none on its parent chain takes the project's default.").optional()
14988
+ repo: z.string().describe("The repository the issue targets, owner/name. When unset, the issue takes the nearest ancestor's in its own project, and an issue with none above it in its own project takes the project's default.").optional()
14989
14989
  })
14990
14990
  },
14991
14991
  {
@@ -15006,12 +15006,12 @@ var dispatchToolSpecs = [
15006
15006
  assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue, and every ask on it then waits on the project's default assignee. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
15007
15007
  external_links: z.array(z.string({ min: 1 })).describe("URLs to link; a non-empty list merges into the issue's existing external links by URL, an empty list removes every link instead.").optional(),
15008
15008
  route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
15009
- parent: z.string().describe("Parent issue key in the same project; an empty string clears the parent.").optional(),
15009
+ 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(),
15010
15010
  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(),
15011
15011
  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(),
15012
15012
  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(),
15013
15013
  components: componentsArgument(z).optional(),
15014
- repo: z.string().describe("The repository the issue targets, owner/name. An empty string clears it, so the issue inherits its parent's or the project's default again.").optional(),
15014
+ 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(),
15015
15015
  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(),
15016
15016
  after: z.string().describe(`Move the issue below this issue on its project's board: an issue key in the same project. With before, the issue lands between the two. ${BOARD_NEIGHBOUR_REFUSAL}`).optional()
15017
15017
  }),
@@ -15484,7 +15484,7 @@ var dispatchToolSpecs = [
15484
15484
  {
15485
15485
  name: "dispatch_whoami",
15486
15486
  example: {},
15487
- description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee and then to the project's default assignee, which every project names, so every issue you create has an assignee. A question on an issue reaches the person it was handed to, else the issue's assignee, else the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
15487
+ description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee, when the parent is in the issue's own project, and then to the project's default assignee, which every project names, so every issue you create has an assignee. A question on an issue reaches the person it was handed to, else the issue's assignee, else the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
15488
15488
  arguments: () => ({}),
15489
15489
  strict: true
15490
15490
  },
@@ -33308,7 +33308,7 @@ async function whoamiCommand(context) {
33308
33308
  const proved = identity.kind === "agent" ? identity.session ?? null : null;
33309
33309
  const project = identity.kind === "agent" ? identity.project ?? null : null;
33310
33310
  const session = proved ?? sessionId;
33311
- const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee, else the project's default assignee, which every project names, so the issue always has one.";
33311
+ const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee when the parent is in the same project, else the project's default assignee, which every project names, so the issue always has one.";
33312
33312
  const signInNeeded = owner === null && service !== null && proved !== null;
33313
33313
  const acting = owner !== null ? `Session ${session} acts for ${owner}: issues you create without an assignee are assigned to ${owner}.` : service !== null ? signInNeeded ? `Session ${session} runs as service ${serviceSubjectLabel(service)} and no person, so it may read but Dispatch refuses every write it makes: run \`agent-secrets login\` on this machine to write as yourself.` : `Session ${session} runs as service ${serviceSubjectLabel(service)}: ${unowned}` : `Session ${session} runs under the shared token: ${unowned}`;
33314
33314
  const elsewhere = proved !== null && proved !== sessionId ? ` Your credential names session ${proved}, which is not this host session (${sessionId}): Dispatch records every write you make as ${proved}.` : "";
@@ -37038,7 +37038,7 @@ var readValidation = {
37038
37038
  var ISSUE_COMPONENTS_MODES = ["inherit", "explicit", "none"];
37039
37039
  function componentsArgument(z) {
37040
37040
  return z.object({
37041
- mode: z.enum(ISSUE_COMPONENTS_MODES).describe("inherit: take the parent chain's attachment (the default; deletes this issue's own). explicit: attach to ids. none: not architectural work, with reason."),
37041
+ mode: z.enum(ISSUE_COMPONENTS_MODES).describe("inherit: take the parent chain's attachment within the issue's own project (the default; deletes this issue's own). explicit: attach to ids. none: not architectural work, with reason."),
37042
37042
  ids: z.array(z.string({ min: 1 }), { min: 1, max: 50 }).describe("For mode explicit: bare component ids from the project's architecture model (web, dispatch-server), not external ones.").optional(),
37043
37043
  reason: z.string({ min: 1 }).describe("For mode none: why this issue is not architectural (process, hiring, ops).").optional()
37044
37044
  }).describe("Attach the issue to architecture components. Attach the root before decomposing it; children inherit unless they choose.");
@@ -37175,7 +37175,7 @@ var dispatchToolSpecs = [
37175
37175
  arguments: (z) => ({
37176
37176
  project: z.string({ min: 1 }).describe("Project key for the new issue. Every create needs one, also a create that names external."),
37177
37177
  title: z.string({ max: ISSUE_TITLE_MAX }).describe("Concise issue title, at most 1,000 characters."),
37178
- parent: z.string().describe("Optional parent issue.").optional(),
37178
+ parent: z.string().describe("Optional parent issue, in any project.").optional(),
37179
37179
  blocked_by: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_BLOCKERS }).describe("Issue keys this issue waits on; a key of any project, so work tracked elsewhere can be named. Dispatch refuses a dependency cycle.").optional(),
37180
37180
  advances: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_ADVANCES }).describe("Ids of the deployment's priorities this issue advances, which dispatch priorities lists. A child inherits every priority the issues above it advance, so name here only what this issue adds.").optional(),
37181
37181
  external: z.string().describe("Optional external issue reference.").optional(),
@@ -37183,9 +37183,9 @@ var dispatchToolSpecs = [
37183
37183
  spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_POINTER}`).optional(),
37184
37184
  labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Optional initial labels, at most 20 labels of up to 40 characters.").optional(),
37185
37185
  priority: z.number({ int: true, min: 0, max: 3 }).describe("Optional coarse priority, a number from 0 to 3: 0 is highest and 3 is lowest.").optional(),
37186
- assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
37186
+ assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A parent in another project passes on no assignee. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
37187
37187
  components: componentsArgument(z).optional(),
37188
- repo: z.string().describe("The repository the issue targets, owner/name. A child inherits its parent's when unset, and an issue with none on its parent chain takes the project's default.").optional()
37188
+ repo: z.string().describe("The repository the issue targets, owner/name. When unset, the issue takes the nearest ancestor's in its own project, and an issue with none above it in its own project takes the project's default.").optional()
37189
37189
  })
37190
37190
  },
37191
37191
  {
@@ -37206,12 +37206,12 @@ var dispatchToolSpecs = [
37206
37206
  assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue, and every ask on it then waits on the project's default assignee. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
37207
37207
  external_links: z.array(z.string({ min: 1 })).describe("URLs to link; a non-empty list merges into the issue's existing external links by URL, an empty list removes every link instead.").optional(),
37208
37208
  route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
37209
- parent: z.string().describe("Parent issue key in the same project; an empty string clears the parent.").optional(),
37209
+ 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(),
37210
37210
  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(),
37211
37211
  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(),
37212
37212
  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(),
37213
37213
  components: componentsArgument(z).optional(),
37214
- repo: z.string().describe("The repository the issue targets, owner/name. An empty string clears it, so the issue inherits its parent's or the project's default again.").optional(),
37214
+ 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(),
37215
37215
  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(),
37216
37216
  after: z.string().describe(`Move the issue below this issue on its project's board: an issue key in the same project. With before, the issue lands between the two. ${BOARD_NEIGHBOUR_REFUSAL}`).optional()
37217
37217
  }),
@@ -37684,7 +37684,7 @@ var dispatchToolSpecs = [
37684
37684
  {
37685
37685
  name: "dispatch_whoami",
37686
37686
  example: {},
37687
- description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee and then to the project's default assignee, which every project names, so every issue you create has an assignee. A question on an issue reaches the person it was handed to, else the issue's assignee, else the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
37687
+ description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee, when the parent is in the issue's own project, and then to the project's default assignee, which every project names, so every issue you create has an assignee. A question on an issue reaches the person it was handed to, else the issue's assignee, else the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
37688
37688
  arguments: () => ({}),
37689
37689
  strict: true
37690
37690
  },
@@ -55589,7 +55589,7 @@ async function whoamiCommand(context) {
55589
55589
  const proved = identity.kind === "agent" ? identity.session ?? null : null;
55590
55590
  const project = identity.kind === "agent" ? identity.project ?? null : null;
55591
55591
  const session = proved ?? sessionId;
55592
- const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee, else the project's default assignee, which every project names, so the issue always has one.";
55592
+ const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee when the parent is in the same project, else the project's default assignee, which every project names, so the issue always has one.";
55593
55593
  const signInNeeded = owner === null && service !== null && proved !== null;
55594
55594
  const acting = owner !== null ? `Session ${session} acts for ${owner}: issues you create without an assignee are assigned to ${owner}.` : service !== null ? signInNeeded ? `Session ${session} runs as service ${serviceSubjectLabel(service)} and no person, so it may read but Dispatch refuses every write it makes: run \`agent-secrets login\` on this machine to write as yourself.` : `Session ${session} runs as service ${serviceSubjectLabel(service)}: ${unowned}` : `Session ${session} runs under the shared token: ${unowned}`;
55595
55595
  const elsewhere = proved !== null && proved !== sessionId ? ` Your credential names session ${proved}, which is not this host session (${sessionId}): Dispatch records every write you make as ${proved}.` : "";
@@ -62199,9 +62199,9 @@ var import_nats5 = __toESM(require_mod4(), 1);
62199
62199
 
62200
62200
  // package.json
62201
62201
  var name2 = "@sjawhar/claude-envoy";
62202
- var version2 = "5.12.5";
62202
+ var version2 = "5.14.0";
62203
62203
  var legion = {
62204
- daemonApiVersion: 217
62204
+ daemonApiVersion: 219
62205
62205
  };
62206
62206
  var package_default = {
62207
62207
  name: name2,
@@ -63997,7 +63997,7 @@ var legionIssue = object({
63997
63997
  tree: issueKey.optional(),
63998
63998
  repo: nonEmptyString2.optional(),
63999
63999
  defaultBranch: nonEmptyString2.optional(),
64000
- holdReason: literal("escalated").optional(),
64000
+ holdReason: _enum2(["escalated", "task-stopped", "children"]).optional(),
64001
64001
  heldFrom: _enum2(LEGION_WORKFLOW_PHASES).optional(),
64002
64002
  lingerUntil: timestamp.optional(),
64003
64003
  ancestry: array(issueKey).optional(),
@@ -64049,6 +64049,8 @@ var LEGION_HELD_REASONS = [
64049
64049
  "dispatch_blocker",
64050
64050
  "children_first",
64051
64051
  "accepted_ancestor",
64052
+ "children_before_retro",
64053
+ "task_stopped",
64052
64054
  "at_work",
64053
64055
  "unclassified"
64054
64056
  ];
@@ -64403,6 +64405,12 @@ var legionAnsweredPause = object({
64403
64405
  endedAt: timestamp.optional(),
64404
64406
  endedBy: legionPauseActor.optional()
64405
64407
  });
64408
+ var LegionPlanRegisterResponse = object({
64409
+ plan: object({
64410
+ version: number2().int().positive().optional(),
64411
+ tasks: array(object({ id: nonEmptyString2.optional(), steps: array(nonEmptyString2).optional() })).optional()
64412
+ }).optional()
64413
+ });
64406
64414
  var LegionProjectPauseResponse = object({
64407
64415
  pause: legionAnsweredPause.optional()
64408
64416
  });
@@ -64454,8 +64462,11 @@ var LegionHandoffCompleteRequest = strictObject({
64454
64462
  handoffVersion: number2().int().positive().optional(),
64455
64463
  wakeAt: LegionInstant.optional(),
64456
64464
  planRating: legionPlanRatingScale(number2()).optional(),
64457
- planReason: legionPlanReason.optional()
64458
- }).refine((request) => legionPlanRatingLoneField(request.planRating, request.planReason) === undefined, { message: "planRating and planReason appear together" });
64465
+ planReason: legionPlanReason.optional(),
64466
+ returnTo: number2().int().positive().optional()
64467
+ }).refine((request) => legionPlanRatingLoneField(request.planRating, request.planReason) === undefined, { message: "planRating and planReason appear together" }).refine((request) => request.returnTo === undefined || request.verdict === "fail", {
64468
+ message: "returnTo is carried only by a completion with the verdict fail"
64469
+ });
64459
64470
  var LegionIssueStatusRequest = strictObject({
64460
64471
  grantId: nonEmptyString2,
64461
64472
  issue: nonEmptyString2,
@@ -64512,6 +64523,17 @@ var LegionChildRequest = strictObject({
64512
64523
  grantId: nonEmptyString2,
64513
64524
  issue: nonEmptyString2
64514
64525
  });
64526
+ var LegionPlanRegisterRequest = strictObject({
64527
+ grantId: nonEmptyString2,
64528
+ issue: nonEmptyString2,
64529
+ artifactId: uuid2(),
64530
+ version: number2().int().positive()
64531
+ });
64532
+ var LegionTaskStopRequest = strictObject({
64533
+ grantId: nonEmptyString2,
64534
+ issue: nonEmptyString2,
64535
+ task: nonEmptyString2
64536
+ });
64515
64537
  var ISSUE_RECORD_READS = [
64516
64538
  "phase",
64517
64539
  "status",
@@ -64875,7 +64897,9 @@ function createLegionDaemonClient(baseUrl, options) {
64875
64897
  phaseRetry: (input) => post("/legion/v1/phase/retry", LegionPhaseRetryRequest, LegionEmptyResponse, input),
64876
64898
  signOff: (input) => post("/legion/v1/signoff", LegionSignOffRequest, LegionEmptyResponse, input),
64877
64899
  rootClose: (input) => post("/legion/v1/roots/close", LegionRootCloseRequest, LegionEmptyResponse, input),
64878
- childRerun: (input) => post("/legion/v1/children/rerun", LegionChildRequest, LegionEmptyResponse, input)
64900
+ childRerun: (input) => post("/legion/v1/children/rerun", LegionChildRequest, LegionEmptyResponse, input),
64901
+ planRegister: (input) => post("/legion/v1/plans/register", LegionPlanRegisterRequest, LegionPlanRegisterResponse, input),
64902
+ taskStop: (input) => post("/legion/v1/tasks/stop", LegionTaskStopRequest, LegionEmptyResponse, input)
64879
64903
  };
64880
64904
  }
64881
64905
 
@@ -65943,6 +65967,8 @@ var planReason = legionPlanReasonRules(string2({ error: PLAN_REASON_REQUIRED }),
65943
65967
  blank: PLAN_REASON_REQUIRED,
65944
65968
  long: `handoff_complete's plan_reason holds at most ${PLAN_REASON_MOST} characters`
65945
65969
  });
65970
+ var RETURN_TO_REFUSAL = "handoff_complete's return_to is a whole number of 1 or more: the place of a step of your task, 1 for its first";
65971
+ var returnTo = number2({ error: RETURN_TO_REFUSAL }).int({ error: RETURN_TO_REFUSAL }).min(1, { error: RETURN_TO_REFUSAL });
65946
65972
  var unknownFieldsRefusal = (op, refused, takes) => [
65947
65973
  ...refused.map((field) => `${op} does not accept field "${field}"`),
65948
65974
  `it takes ${takes.length === 0 ? "none" : takes.join(", ")}`
@@ -65965,7 +65991,8 @@ var PhaseOpArguments = discriminatedUnion("op", [
65965
65991
  }).optional(),
65966
65992
  wake_at: nextLook.optional(),
65967
65993
  plan_rating: planRating.optional(),
65968
- plan_reason: planReason.optional()
65994
+ plan_reason: planReason.optional(),
65995
+ return_to: returnTo.optional()
65969
65996
  }).refine((args) => legionPlanRatingLoneField(args.plan_rating, args.plan_reason) !== "rating", {
65970
65997
  error: "handoff_complete names plan_rating without plan_reason: send the rating of the plan with one sentence of why, the two together"
65971
65998
  }).refine((args) => legionPlanRatingLoneField(args.plan_rating, args.plan_reason) !== "reason", {
@@ -66015,14 +66042,14 @@ function phaseOpParameters(zod) {
66015
66042
  return byField;
66016
66043
  }
66017
66044
  var PHASE_OP_SENTENCES = {
66018
- readRecord: "read_record returns the record of `issue` from the daemon's record route for that issue, your own issue when you leave `issue` out. " + "A held issue names in `heldFrom` the phase the hold took it out of. A failed claim carries `failure`: the " + "`cause` word for what failed it, the `detail` sentence beside that word, `at`, when it failed, and " + "`attempts`, the four counts it failed with. A todo written on a held root releases the hold and starts " + "that phase again, as the architect's retry_or_escalate with retry does. ",
66045
+ readRecord: "read_record returns the record of `issue` from the daemon's record route for that issue, your own issue when you leave `issue` out. " + "A held issue names in `heldFrom` the phase the hold took it out of, and in `holdReason` why it is held when its hold has a reason: " + "`escalated` (its architect sent it to the controller), `task-stopped` (its owner stopped its task with stop_task) or `children` (it " + "waits, before its retro, for the issues beneath it). A failed claim carries `failure`: the " + "`cause` word for what failed it, the `detail` sentence beside that word, `at`, when it failed, and " + "`attempts`, the four counts it failed with. A todo written on a held root releases the hold and starts " + "that phase again, as the architect's retry_or_escalate with retry does, but a root held `task-stopped` starts its task again at its " + "first step (a task that never started waits for its gate and its line, as any task does before its first step), and a root held " + "`children` stays held until the issues beneath it close. ",
66019
66046
  readReleaseRecords: "read_release_records returns this deployment's idle-release records from `since` (an RFC 3339 time) on, read with this session's own claim: " + "every release, resume and hold the daemon recorded, and over them the counts of releases, of the releases among them that suspended no " + "role, of resumes by wake kind and of holds by reason, the pod-hours released, the share of releases woken again within ten minutes, and " + "the median, 90th percentile and maximum seconds from a wake to the woken role's first turn. A wake that a project pause held is " + "counted as `heldByPause` and left out of those seconds, since its wait measures the pause. A release that suspended no role is woken by " + "nothing, so the pod-hours released and the woken share count the releases that suspended a role alone. ",
66020
66047
  requestBackwardMove: "request_backward_move returns an issue to an earlier phase (`to`, `reason`). A phase worker moves its own issue. " + "The architect that owns an issue in accepting moves it, named by `issue`, back to planning, implementing or testing. That move counts no review round. ",
66021
66048
  readBuild: "read_build reports the build this process runs: the plugin package and version the process loaded, and the contract that build speaks. " + "It also reports the contract the daemon states on its answer to the health route. " + "That contract is null where the daemon stated none, where the daemon refused the health route and where no answer reached this process at all, and a note of its own says which. " + "The two numbers can differ, and the answer shows both. " + "Report the version this call answers, never the one at the plugin's path on the image. " + "In a pod, an Oh My Pi role relaunched onto the daemon's contract loads the build that relaunch installed under the role's own state home, " + "and a Claude Code role installs no plugin: it loads its pod image's own claude-envoy. " + "read_build reads no project state. "
66022
66049
  };
66023
66050
  var STALE_ENTRY_INSTRUCTION = "End this turn without completing. The task of the entry the phase is on is owed to this claim, and the daemon sends it by itself. " + "That task is work of its own: do what it asks at the head it names and complete it with a handoff of its own, never this completion's " + "record, commit or verdict";
66024
66051
  function legionToolDescription(host) {
66025
- return "Perform the workflow operation the Legion daemon assigned this role. The daemon advances phases; this tool cannot spawn workers. " + (host.before ?? "") + "handoff_complete (phase workers alone: the daemon refuses an architect's completion, with ACCEPTANCE_IS_SIGN_OFF where nothing else refuses it first, since an architect accepts with sign_off; " + "the daemon accepts a completion only from the role working the issue's current phase, " + "or a role's first completion of the phase it left, which it records and which moves nothing, " + "and the checking role's report on a look of its closed issue's production check) reports this phase complete: `summary` (two sentences for the " + "architect), `verdict` pass|fail from the tester alone on a phase completion (the daemon refuses a verdict from " + "any other role there) and pass|pending|fail on a production check report (pending: production does not carry the merge " + "yet, or carries it with a requirement only the deploy can show still unobserved and a look still to follow; on the check's last look, only for an issue with no such requirement). " + "A planning, implementing, testing or reviewing phase ends with a handoff record on the " + "Dispatch issue: write it with `dispatch handoff-write --issue <issue> --phase <plan|implement|test|review> --body-file <file>` before " + "calling. This call reads from Dispatch the newest record of the phase your role works or, once the issue has moved on, of the phase it left, " + "and reports it with `commit`, the head that record's body names " + "(`head`, the 40-character lower-case commit the work it reports was done against); in implementing, the implementer's must be the commit its " + "workspace stands on, `@-`, pushed to `legion/<issue>@origin`, so push the branch first; retro, the merger's completion and a phase you left with no record, or with an implement record naming no head, report the commit the workspace stands on. It " + "refuses, posting nothing, a phase you work with no record, a Dispatch that does not answer, and, in implementing, an implement record naming no head, an " + "implementer's `@-` not yet on `legion/<issue>@origin`, or an implement record whose head is not that pushed `@-`, each naming the remedy. A production check report " + "(the task whose first line is `Production check of <KEY>`, handed once the merge closed the issue to the role the check records) needs no " + "handoff and no commit: it carries its verdict and summary alone. A pending report also names `wake_at`, an RFC 3339 time: when you want the " + "next look. A pass, a fail, and a pending on the check's last look end the check, so none of them carries `wake_at` " + "(CHECK_WAKE_UNEXPECTED), and a pending on any other look is refused without one (CHECK_WAKE_REQUIRED). A report on an issue whose check is " + "closed or never opened is refused (CHECK_NOT_OPEN), and so is one from a role the check does not record (CHECK_ROLE_MISMATCH). " + `The completion that ends the retro carries \`plan_rating\` (${LEGION_PLAN_RATING_LEAST} to ${LEGION_PLAN_RATING_MOST}) and \`plan_reason\`, as ` + "skill://legion-retro says, and the daemon refuses a completion that breaks that skill's rating rule " + "(PLAN_RATING_REQUIRED, PLAN_RATING_UNEXPECTED or PLAN_RATING_INPUT). " + "The daemon refuses " + "HANDOFF_SESSION_MISMATCH (another session wrote the record), HANDOFF_NOT_NEW (the record is the one you named for your previous phase: " + "write this phase's handoff), " + "HANDOFF_STALE_ENTRY (this completion is of a phase entry behind the one your role's phases row names, because the phase was entered " + `again while your turn ran, and nothing was recorded. ${STALE_ENTRY_INSTRUCTION}), the implementer's completion of implementing with no open ` + "pull request on `legion/<issue>` and none recorded " + "merged (HANDOFF_NO_PULL_REQUEST: open it; one naming a closed pull request is the architect's to decide); a refused completion changed " + "nothing, so fix what it names and complete again. " + "ready_for_update answers the daemon's update message on this issue's pod: `round` is the round id that message names, and the " + "daemon takes your answer for that round alone. Push every commit you want kept to the issue branch " + "first. Then let each subagent and each background job that you started finish, or stop it. Commit and push what it made " + "before you answer. The daemon replaces the pod and its disk when the round ends. The round ends at the moment the message " + "names. It can end earlier, once every role has answered, no role is in a turn and each role's last report names no running " + "subagent or background job. No answer delays that moment, and the end of a turn is no answer. If a subagent or a background " + "job finishes after you answer, commit and push what it made. Then call ready_for_update again with the same round. " + "The call ends no phase. The daemon holds your next task until your process comes back on the new pod, in this same session. " + (host.after ?? "") + `What a later phase needs goes in your handoff; a question for another live role goes to its role topic with ${host.envoyPublish}.`;
66052
+ return "Perform the workflow operation the Legion daemon assigned this role. The daemon advances phases; this tool cannot spawn workers. " + (host.before ?? "") + "handoff_complete (phase workers alone: the daemon refuses an architect's completion, with ACCEPTANCE_IS_SIGN_OFF where nothing else refuses it first, since an architect accepts with sign_off; " + "the daemon accepts a completion only from the role working the issue's current phase, " + "or a role's first completion of the phase it left, which it records and which moves nothing, " + "and the checking role's report on a look of its closed issue's production check) reports this phase complete: `summary` (two sentences for the " + "architect), `verdict` pass|fail from the tester alone on a phase completion (the daemon refuses a verdict from " + "any other role there) and pass|pending|fail on a production check report (pending: production does not carry the merge " + "yet, or carries it with a requirement only the deploy can show still unobserved and a look still to follow; on the check's last look, only for an issue with no such requirement). " + "A tester's fail may name `return_to`, the place of a step of the task its issue runs, 1 for its first: the step the task goes back " + "to; without it, the task goes back to the first implementation step before the step that failed. Only a completion with the verdict " + "fail names it (RETURN_TO_NEEDS_FAIL), a place below 1 is refused (INVALID_RETURN_TO), and so is a step the task cannot go back to " + "(RETURN_REFUSED). " + "A planning, implementing, testing or reviewing phase ends with a handoff record on the " + "Dispatch issue: write it with `dispatch handoff-write --issue <issue> --phase <plan|implement|test|review> --body-file <file>` before " + "calling. This call reads from Dispatch the newest record of the phase your role works or, once the issue has moved on, of the phase it left, " + "and reports it with `commit`, the head that record's body names " + "(`head`, the 40-character lower-case commit the work it reports was done against); in implementing, the implementer's must be the commit its " + "workspace stands on, `@-`, pushed to `legion/<issue>@origin`, so push the branch first; retro, the merger's completion and a phase you left with no record, or with an implement record naming no head, report the commit the workspace stands on. It " + "refuses, posting nothing, a phase you work with no record, a Dispatch that does not answer, and, in implementing, an implement record naming no head, an " + "implementer's `@-` not yet on `legion/<issue>@origin`, or an implement record whose head is not that pushed `@-`, each naming the remedy. A production check report " + "(the task whose first line is `Production check of <KEY>`, handed once the merge closed the issue to the role the check records) needs no " + "handoff and no commit: it carries its verdict and summary alone. A pending report also names `wake_at`, an RFC 3339 time: when you want the " + "next look. A pass, a fail, and a pending on the check's last look end the check, so none of them carries `wake_at` " + "(CHECK_WAKE_UNEXPECTED), and a pending on any other look is refused without one (CHECK_WAKE_REQUIRED). A report on an issue whose check is " + "closed or never opened is refused (CHECK_NOT_OPEN), and so is one from a role the check does not record (CHECK_ROLE_MISMATCH). " + `The completion that ends the retro carries \`plan_rating\` (${LEGION_PLAN_RATING_LEAST} to ${LEGION_PLAN_RATING_MOST}) and \`plan_reason\`, as ` + "skill://legion-retro says, and the daemon refuses a completion that breaks that skill's rating rule " + "(PLAN_RATING_REQUIRED, PLAN_RATING_UNEXPECTED or PLAN_RATING_INPUT). " + "The daemon refuses " + "HANDOFF_SESSION_MISMATCH (another session wrote the record), HANDOFF_NOT_NEW (the record is the one you named for your previous phase: " + "write this phase's handoff), " + "HANDOFF_STALE_ENTRY (this completion is of a phase entry behind the one your role's phases row names, because the phase was entered " + `again while your turn ran, and nothing was recorded. ${STALE_ENTRY_INSTRUCTION}), the implementer's completion of implementing with no open ` + "pull request on `legion/<issue>` and none recorded " + "merged (HANDOFF_NO_PULL_REQUEST: open it; one naming a closed pull request is the architect's to decide); a refused completion changed " + "nothing, so fix what it names and complete again. " + "ready_for_update answers the daemon's update message on this issue's pod: `round` is the round id that message names, and the " + "daemon takes your answer for that round alone. Push every commit you want kept to the issue branch " + "first. Then let each subagent and each background job that you started finish, or stop it. Commit and push what it made " + "before you answer. The daemon replaces the pod and its disk when the round ends. The round ends at the moment the message " + "names. It can end earlier, once every role has answered, no role is in a turn and each role's last report names no running " + "subagent or background job. No answer delays that moment, and the end of a turn is no answer. If a subagent or a background " + "job finishes after you answer, commit and push what it made. Then call ready_for_update again with the same round. " + "The call ends no phase. The daemon holds your next task until your process comes back on the new pod, in this same session. " + (host.after ?? "") + `What a later phase needs goes in your handoff; a question for another live role goes to its role topic with ${host.envoyPublish}.`;
66026
66053
  }
66027
66054
  function pluginBuildOf(manifest) {
66028
66055
  return {
@@ -66099,6 +66126,9 @@ async function executePhaseOp(runtime, input) {
66099
66126
  if (named !== "" && named !== claim.issue) {
66100
66127
  throw new Error(`handoff_complete reports this session's own issue ${claim.issue}; leave issue out, or name ${claim.issue}, not ${named}`);
66101
66128
  }
66129
+ if (args.return_to !== undefined && args.verdict !== "fail") {
66130
+ throw new Error("handoff_complete names return_to without the verdict fail: only the completion of a step that failed, with the verdict fail, names the step its task returns to; send it again without return_to");
66131
+ }
66102
66132
  const { plan_rating: planRating, plan_reason: planReason } = args;
66103
66133
  const rating = planRating === undefined || planReason === undefined ? undefined : { planRating, planReason };
66104
66134
  return retryWhileDaemonRestarts("handoff_complete", () => completeHandoff(runtime, args, rating), runtime.restart);
@@ -66248,6 +66278,9 @@ async function completeHandoff(runtime, args, rating) {
66248
66278
  const { daemon, claim } = runtime;
66249
66279
  const record = await recordFrom(daemon, claim.issue);
66250
66280
  if (record.phase === "done") {
66281
+ if (args.return_to !== undefined) {
66282
+ throw new Error("handoff_complete's return_to names the step a failed step's task returns to, and a report on a production check names none; send it again without return_to");
66283
+ }
66251
66284
  const check = record.check;
66252
66285
  if (check !== undefined) {
66253
66286
  if (args.verdict === undefined) {
@@ -66284,7 +66317,8 @@ async function completeHandoff(runtime, args, rating) {
66284
66317
  summary: args.summary,
66285
66318
  verdict: args.verdict ?? "",
66286
66319
  ...report,
66287
- ...rating
66320
+ ...rating,
66321
+ ...args.return_to === undefined ? {} : { returnTo: args.return_to }
66288
66322
  });
66289
66323
  }
66290
66324
 
@@ -14442,7 +14442,7 @@ var readValidation = {
14442
14442
  var ISSUE_COMPONENTS_MODES = ["inherit", "explicit", "none"];
14443
14443
  function componentsArgument(z) {
14444
14444
  return z.object({
14445
- mode: z.enum(ISSUE_COMPONENTS_MODES).describe("inherit: take the parent chain's attachment (the default; deletes this issue's own). explicit: attach to ids. none: not architectural work, with reason."),
14445
+ mode: z.enum(ISSUE_COMPONENTS_MODES).describe("inherit: take the parent chain's attachment within the issue's own project (the default; deletes this issue's own). explicit: attach to ids. none: not architectural work, with reason."),
14446
14446
  ids: z.array(z.string({ min: 1 }), { min: 1, max: 50 }).describe("For mode explicit: bare component ids from the project's architecture model (web, dispatch-server), not external ones.").optional(),
14447
14447
  reason: z.string({ min: 1 }).describe("For mode none: why this issue is not architectural (process, hiring, ops).").optional()
14448
14448
  }).describe("Attach the issue to architecture components. Attach the root before decomposing it; children inherit unless they choose.");
@@ -14579,7 +14579,7 @@ var dispatchToolSpecs = [
14579
14579
  arguments: (z) => ({
14580
14580
  project: z.string({ min: 1 }).describe("Project key for the new issue. Every create needs one, also a create that names external."),
14581
14581
  title: z.string({ max: ISSUE_TITLE_MAX }).describe("Concise issue title, at most 1,000 characters."),
14582
- parent: z.string().describe("Optional parent issue.").optional(),
14582
+ parent: z.string().describe("Optional parent issue, in any project.").optional(),
14583
14583
  blocked_by: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_BLOCKERS }).describe("Issue keys this issue waits on; a key of any project, so work tracked elsewhere can be named. Dispatch refuses a dependency cycle.").optional(),
14584
14584
  advances: z.array(z.string({ min: 1 }), { max: MAX_ISSUE_ADVANCES }).describe("Ids of the deployment's priorities this issue advances, which dispatch priorities lists. A child inherits every priority the issues above it advance, so name here only what this issue adds.").optional(),
14585
14585
  external: z.string().describe("Optional external issue reference.").optional(),
@@ -14587,9 +14587,9 @@ var dispatchToolSpecs = [
14587
14587
  spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_POINTER}`).optional(),
14588
14588
  labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Optional initial labels, at most 20 labels of up to 40 characters.").optional(),
14589
14589
  priority: z.number({ int: true, min: 0, max: 3 }).describe("Optional coarse priority, a number from 0 to 3: 0 is highest and 3 is lowest.").optional(),
14590
- assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
14590
+ assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A parent in another project passes on no assignee. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
14591
14591
  components: componentsArgument(z).optional(),
14592
- repo: z.string().describe("The repository the issue targets, owner/name. A child inherits its parent's when unset, and an issue with none on its parent chain takes the project's default.").optional()
14592
+ repo: z.string().describe("The repository the issue targets, owner/name. When unset, the issue takes the nearest ancestor's in its own project, and an issue with none above it in its own project takes the project's default.").optional()
14593
14593
  })
14594
14594
  },
14595
14595
  {
@@ -14610,12 +14610,12 @@ var dispatchToolSpecs = [
14610
14610
  assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue, and every ask on it then waits on the project's default assignee. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
14611
14611
  external_links: z.array(z.string({ min: 1 })).describe("URLs to link; a non-empty list merges into the issue's existing external links by URL, an empty list removes every link instead.").optional(),
14612
14612
  route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
14613
- parent: z.string().describe("Parent issue key in the same project; an empty string clears the parent.").optional(),
14613
+ 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(),
14614
14614
  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(),
14615
14615
  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(),
14616
14616
  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(),
14617
14617
  components: componentsArgument(z).optional(),
14618
- repo: z.string().describe("The repository the issue targets, owner/name. An empty string clears it, so the issue inherits its parent's or the project's default again.").optional(),
14618
+ 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(),
14619
14619
  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(),
14620
14620
  after: z.string().describe(`Move the issue below this issue on its project's board: an issue key in the same project. With before, the issue lands between the two. ${BOARD_NEIGHBOUR_REFUSAL}`).optional()
14621
14621
  }),
@@ -15088,7 +15088,7 @@ var dispatchToolSpecs = [
15088
15088
  {
15089
15089
  name: "dispatch_whoami",
15090
15090
  example: {},
15091
- description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee and then to the project's default assignee, which every project names, so every issue you create has an assignee. A question on an issue reaches the person it was handed to, else the issue's assignee, else the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
15091
+ description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee, when the parent is in the issue's own project, and then to the project's default assignee, which every project names, so every issue you create has an assignee. A question on an issue reaches the person it was handed to, else the issue's assignee, else the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
15092
15092
  arguments: () => ({}),
15093
15093
  strict: true
15094
15094
  },
@@ -28388,7 +28388,7 @@ async function whoamiCommand(context) {
28388
28388
  const proved = identity.kind === "agent" ? identity.session ?? null : null;
28389
28389
  const project = identity.kind === "agent" ? identity.project ?? null : null;
28390
28390
  const session = proved ?? sessionId;
28391
- const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee, else the project's default assignee, which every project names, so the issue always has one.";
28391
+ const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee when the parent is in the same project, else the project's default assignee, which every project names, so the issue always has one.";
28392
28392
  const signInNeeded = owner === null && service !== null && proved !== null;
28393
28393
  const acting = owner !== null ? `Session ${session} acts for ${owner}: issues you create without an assignee are assigned to ${owner}.` : service !== null ? signInNeeded ? `Session ${session} runs as service ${serviceSubjectLabel(service)} and no person, so it may read but Dispatch refuses every write it makes: run \`agent-secrets login\` on this machine to write as yourself.` : `Session ${session} runs as service ${serviceSubjectLabel(service)}: ${unowned}` : `Session ${session} runs under the shared token: ${unowned}`;
28394
28394
  const elsewhere = proved !== null && proved !== sessionId ? ` Your credential names session ${proved}, which is not this host session (${sessionId}): Dispatch records every write you make as ${proved}.` : "";