@sjawhar/pi-legion-envoy 5.5.9 → 5.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/envoy.js CHANGED
@@ -30517,11 +30517,8 @@ var phaseHandoffSchema = exports_external.discriminatedUnion("phase", [
30517
30517
  var AGENT_TOPIC_PREFIX = "notifications.agent.";
30518
30518
  var ROLE_TOPIC_PREFIX = "notifications.role.";
30519
30519
  var LEGION_NOTICE_TOPIC_PREFIX = "notifications.legion.";
30520
- function legionNoticeSubject(project, issue2) {
30521
- return `${LEGION_NOTICE_TOPIC_PREFIX}${project}.${issue2}`;
30522
- }
30523
30520
  function legionControllerNoticeSubject(project) {
30524
- return legionNoticeSubject(project, "controller");
30521
+ return `${LEGION_NOTICE_TOPIC_PREFIX}${project}.controller`;
30525
30522
  }
30526
30523
  var DISPATCH_TOPIC_PREFIX = "notifications.dispatch.";
30527
30524
  var DISPATCH_ISSUE_TOPIC_PREFIX = `${DISPATCH_TOPIC_PREFIX}issue.`;
package/dist/legion.js CHANGED
@@ -16142,7 +16142,7 @@ import { logger } from "@oh-my-pi/pi-utils";
16142
16142
  // package.json
16143
16143
  var package_default = {
16144
16144
  name: "@sjawhar/pi-legion-envoy",
16145
- version: "5.5.9",
16145
+ version: "5.5.11",
16146
16146
  type: "module",
16147
16147
  omp: {
16148
16148
  extensions: [
@@ -30590,11 +30590,8 @@ var phaseHandoffSchema = exports_external.discriminatedUnion("phase", [
30590
30590
  var AGENT_TOPIC_PREFIX = "notifications.agent.";
30591
30591
  var ROLE_TOPIC_PREFIX = "notifications.role.";
30592
30592
  var LEGION_NOTICE_TOPIC_PREFIX = "notifications.legion.";
30593
- function legionNoticeSubject(project, issue2) {
30594
- return `${LEGION_NOTICE_TOPIC_PREFIX}${project}.${issue2}`;
30595
- }
30596
30593
  function legionControllerNoticeSubject(project) {
30597
- return legionNoticeSubject(project, "controller");
30594
+ return `${LEGION_NOTICE_TOPIC_PREFIX}${project}.controller`;
30598
30595
  }
30599
30596
  var DISPATCH_TOPIC_PREFIX = "notifications.dispatch.";
30600
30597
  var DISPATCH_ISSUE_TOPIC_PREFIX = `${DISPATCH_TOPIC_PREFIX}issue.`;
@@ -31587,6 +31584,10 @@ var LegionGoSignOffRequest = exports_external.strictObject({
31587
31584
  grantId: nonEmptyString2,
31588
31585
  issue: nonEmptyString2
31589
31586
  });
31587
+ var LegionGoChildRequest = exports_external.strictObject({
31588
+ grantId: nonEmptyString2,
31589
+ issue: nonEmptyString2
31590
+ });
31590
31591
 
31591
31592
  // src/legion/go-daemon-client.ts
31592
31593
  class LegionGoDaemonApiError extends Error {
@@ -31682,7 +31683,9 @@ function createLegionGoDaemonClient(baseUrl, fetchFn = fetch) {
31682
31683
  waveRelease: (input) => post("/legion/v1/waves/release", LegionGoWaveReleaseRequest, LegionGoWaveReleaseResponse, input),
31683
31684
  phaseBackward: (input) => post("/legion/v1/phase/backward", LegionGoPhaseBackwardRequest, LegionGoEmptyResponse, input),
31684
31685
  phaseRetry: (input) => post("/legion/v1/phase/retry", LegionGoPhaseRetryRequest, LegionGoEmptyResponse, input),
31685
- signOff: (input) => post("/legion/v1/signoff", LegionGoSignOffRequest, LegionGoEmptyResponse, input)
31686
+ signOff: (input) => post("/legion/v1/signoff", LegionGoSignOffRequest, LegionGoEmptyResponse, input),
31687
+ childPark: (input) => post("/legion/v1/children/park", LegionGoChildRequest, LegionGoEmptyResponse, input),
31688
+ childRerun: (input) => post("/legion/v1/children/rerun", LegionGoChildRequest, LegionGoEmptyResponse, input)
31686
31689
  };
31687
31690
  }
31688
31691
 
@@ -31846,7 +31849,6 @@ async function bootstrapGoClaim(context, state) {
31846
31849
  secret: claim.secret
31847
31850
  });
31848
31851
  await claimEnvoyRole(sessionID, claim.claimToken, context);
31849
- await subscribeLegionNotice(sessionID, legionNoticeSubject(requiredEnvironment(process.env, "LEGION_PROJECT"), claim.role === "architect" ? claim.tree : claim.issue), context);
31850
31852
  await callGoReadyWithRetry("claims/ready", () => daemon.ready(ready));
31851
31853
  onEnvoyRoleRegained(async (role, reason) => {
31852
31854
  if (role !== claim.claimToken)
@@ -31900,17 +31902,16 @@ function handoffSchemaFields(z2) {
31900
31902
  ready: z2.boolean().optional()
31901
31903
  };
31902
31904
  }
31903
- var HANDOFF_DESCRIPTION = "Handoff actions (phase workers and sub-architects): handoff_write writes this phase's handoff " + "(`phase`, and `data`: the phase-specific fields as a JSON object) to `.legion/<phase>.json` in " + "the issue workspace; handoff_read returns the handoffs (every phase, or `phase`); " + "handoff_complete reports this phase complete to the daemon (`summary`: two sentences for the " + "architect; `verdict` pass|fail when your role's instructions require one; `ready: true` for " + "the merger's READY; no `phase` is needed, and one other than your own is refused). Each " + "returns the command's output; a failed action changed nothing. What a later phase needs goes " + "in your handoff; a question for another live role goes to its role topic with envoy_publish.";
31905
+ var HANDOFF_DESCRIPTION = "Handoff actions (phase workers and sub-architects): handoff_write writes this phase's handoff " + "(`phase`, and `data`: the phase-specific fields as a JSON object, never the schemaVersion, " + "phase and completed the command writes itself) to `.legion/<phase>.json` in " + "the issue workspace; handoff_read returns the handoffs (every phase, or `phase`); " + "handoff_complete reports this phase complete to the daemon (`summary`: two sentences for the " + "architect; `verdict` pass|fail when your role's instructions require one; `ready: true` for " + "the merger's READY; no `phase` is needed, and one other than your own is refused). Each " + "returns the command's output; a failed action changed nothing. What a later phase needs goes " + "in your handoff; a question for another live role goes to its role topic with envoy_publish.";
31906
+ function rootArchitectHandoffRefusal(operation) {
31907
+ return `${operation} is not available to a root architect session; a root architect reads handoffs with \`legion handoff read [--phase <phase>]\` from bash`;
31908
+ }
31904
31909
  var ROLE_HANDOFF_PHASE = {
31905
31910
  architect: "architect",
31906
31911
  planner: "plan",
31907
- plan: "plan",
31908
31912
  implementer: "implement",
31909
- implement: "implement",
31910
31913
  tester: "test",
31911
- test: "test",
31912
- reviewer: "review",
31913
- review: "review"
31914
+ reviewer: "review"
31914
31915
  };
31915
31916
  var COMMAND_TIMEOUT_MS = 300000;
31916
31917
  function required2(parameters, operation, name) {
@@ -32015,6 +32016,8 @@ var OPERATIONS = {
32015
32016
  "request_backward_move",
32016
32017
  "retry_or_escalate",
32017
32018
  "sign_off",
32019
+ "park_child",
32020
+ "rerun_child",
32018
32021
  "read_record"
32019
32022
  ],
32020
32023
  "phase-worker": ["request_backward_move", "read_record"]
@@ -32025,6 +32028,8 @@ var OPERATION_FIELDS = {
32025
32028
  request_backward_move: ["to", "reason"],
32026
32029
  retry_or_escalate: ["issue", "decision"],
32027
32030
  sign_off: ["issue"],
32031
+ park_child: ["issue"],
32032
+ rerun_child: ["issue"],
32028
32033
  read_record: ["issue"]
32029
32034
  };
32030
32035
  var jsonSuccess = (details) => toolSuccess(JSON.stringify(details), details);
@@ -32037,6 +32042,8 @@ function toolSchema(pi) {
32037
32042
  "request_backward_move",
32038
32043
  "retry_or_escalate",
32039
32044
  "sign_off",
32045
+ "park_child",
32046
+ "rerun_child",
32040
32047
  "read_record",
32041
32048
  ...HANDOFF_OPERATIONS
32042
32049
  ]),
@@ -32097,7 +32104,7 @@ function createGoLegionTool(deps) {
32097
32104
  const operation = requiredString(parameters, "legion", "op");
32098
32105
  if (isHandoffOperation(operation)) {
32099
32106
  if (active.kind === "architect" && active.issue === active.tree) {
32100
- throw new Error(`${operation} is not available to a root architect session`);
32107
+ throw new Error(rootArchitectHandoffRefusal(operation));
32101
32108
  }
32102
32109
  return await runHandoffAction({
32103
32110
  operation,
@@ -32169,6 +32176,13 @@ function createGoLegionTool(deps) {
32169
32176
  });
32170
32177
  return jsonSuccess({});
32171
32178
  }
32179
+ case "park_child":
32180
+ case "rerun_child": {
32181
+ const grantId = await grantFor(client, active);
32182
+ const request = { grantId, issue: requiredString(parameters, operation, "issue") };
32183
+ await (operation === "park_child" ? client.childPark(request) : client.childRerun(request));
32184
+ return jsonSuccess({});
32185
+ }
32172
32186
  default:
32173
32187
  throw new Error(`Unsupported Go Legion operation: ${operation}`);
32174
32188
  }
@@ -32282,7 +32296,7 @@ function createLegionTool(deps) {
32282
32296
  const op = String(parameters.op);
32283
32297
  if (isHandoffOperation(op)) {
32284
32298
  if (active.kind !== "phase-worker") {
32285
- throw new Error(`${op} is not available to a root architect session`);
32299
+ throw new Error(rootArchitectHandoffRefusal(op));
32286
32300
  }
32287
32301
  return await runHandoffAction({
32288
32302
  operation: op,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-legion-envoy",
3
- "version": "5.5.9",
3
+ "version": "5.5.11",
4
4
  "type": "module",
5
5
  "omp": {
6
6
  "extensions": [