@sjawhar/pi-legion-envoy 5.5.9 → 5.5.10

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 (2) hide show
  1. package/dist/legion.js +28 -10
  2. package/package.json +1 -1
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.10",
16146
16146
  type: "module",
16147
16147
  omp: {
16148
16148
  extensions: [
@@ -31587,6 +31587,10 @@ var LegionGoSignOffRequest = exports_external.strictObject({
31587
31587
  grantId: nonEmptyString2,
31588
31588
  issue: nonEmptyString2
31589
31589
  });
31590
+ var LegionGoChildRequest = exports_external.strictObject({
31591
+ grantId: nonEmptyString2,
31592
+ issue: nonEmptyString2
31593
+ });
31590
31594
 
31591
31595
  // src/legion/go-daemon-client.ts
31592
31596
  class LegionGoDaemonApiError extends Error {
@@ -31682,7 +31686,9 @@ function createLegionGoDaemonClient(baseUrl, fetchFn = fetch) {
31682
31686
  waveRelease: (input) => post("/legion/v1/waves/release", LegionGoWaveReleaseRequest, LegionGoWaveReleaseResponse, input),
31683
31687
  phaseBackward: (input) => post("/legion/v1/phase/backward", LegionGoPhaseBackwardRequest, LegionGoEmptyResponse, input),
31684
31688
  phaseRetry: (input) => post("/legion/v1/phase/retry", LegionGoPhaseRetryRequest, LegionGoEmptyResponse, input),
31685
- signOff: (input) => post("/legion/v1/signoff", LegionGoSignOffRequest, LegionGoEmptyResponse, input)
31689
+ signOff: (input) => post("/legion/v1/signoff", LegionGoSignOffRequest, LegionGoEmptyResponse, input),
31690
+ childPark: (input) => post("/legion/v1/children/park", LegionGoChildRequest, LegionGoEmptyResponse, input),
31691
+ childRerun: (input) => post("/legion/v1/children/rerun", LegionGoChildRequest, LegionGoEmptyResponse, input)
31686
31692
  };
31687
31693
  }
31688
31694
 
@@ -31900,17 +31906,16 @@ function handoffSchemaFields(z2) {
31900
31906
  ready: z2.boolean().optional()
31901
31907
  };
31902
31908
  }
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.";
31909
+ 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.";
31910
+ function rootArchitectHandoffRefusal(operation) {
31911
+ return `${operation} is not available to a root architect session; a root architect reads handoffs with \`legion handoff read [--phase <phase>]\` from bash`;
31912
+ }
31904
31913
  var ROLE_HANDOFF_PHASE = {
31905
31914
  architect: "architect",
31906
31915
  planner: "plan",
31907
- plan: "plan",
31908
31916
  implementer: "implement",
31909
- implement: "implement",
31910
31917
  tester: "test",
31911
- test: "test",
31912
- reviewer: "review",
31913
- review: "review"
31918
+ reviewer: "review"
31914
31919
  };
31915
31920
  var COMMAND_TIMEOUT_MS = 300000;
31916
31921
  function required2(parameters, operation, name) {
@@ -32015,6 +32020,8 @@ var OPERATIONS = {
32015
32020
  "request_backward_move",
32016
32021
  "retry_or_escalate",
32017
32022
  "sign_off",
32023
+ "park_child",
32024
+ "rerun_child",
32018
32025
  "read_record"
32019
32026
  ],
32020
32027
  "phase-worker": ["request_backward_move", "read_record"]
@@ -32025,6 +32032,8 @@ var OPERATION_FIELDS = {
32025
32032
  request_backward_move: ["to", "reason"],
32026
32033
  retry_or_escalate: ["issue", "decision"],
32027
32034
  sign_off: ["issue"],
32035
+ park_child: ["issue"],
32036
+ rerun_child: ["issue"],
32028
32037
  read_record: ["issue"]
32029
32038
  };
32030
32039
  var jsonSuccess = (details) => toolSuccess(JSON.stringify(details), details);
@@ -32037,6 +32046,8 @@ function toolSchema(pi) {
32037
32046
  "request_backward_move",
32038
32047
  "retry_or_escalate",
32039
32048
  "sign_off",
32049
+ "park_child",
32050
+ "rerun_child",
32040
32051
  "read_record",
32041
32052
  ...HANDOFF_OPERATIONS
32042
32053
  ]),
@@ -32097,7 +32108,7 @@ function createGoLegionTool(deps) {
32097
32108
  const operation = requiredString(parameters, "legion", "op");
32098
32109
  if (isHandoffOperation(operation)) {
32099
32110
  if (active.kind === "architect" && active.issue === active.tree) {
32100
- throw new Error(`${operation} is not available to a root architect session`);
32111
+ throw new Error(rootArchitectHandoffRefusal(operation));
32101
32112
  }
32102
32113
  return await runHandoffAction({
32103
32114
  operation,
@@ -32169,6 +32180,13 @@ function createGoLegionTool(deps) {
32169
32180
  });
32170
32181
  return jsonSuccess({});
32171
32182
  }
32183
+ case "park_child":
32184
+ case "rerun_child": {
32185
+ const grantId = await grantFor(client, active);
32186
+ const request = { grantId, issue: requiredString(parameters, operation, "issue") };
32187
+ await (operation === "park_child" ? client.childPark(request) : client.childRerun(request));
32188
+ return jsonSuccess({});
32189
+ }
32172
32190
  default:
32173
32191
  throw new Error(`Unsupported Go Legion operation: ${operation}`);
32174
32192
  }
@@ -32282,7 +32300,7 @@ function createLegionTool(deps) {
32282
32300
  const op = String(parameters.op);
32283
32301
  if (isHandoffOperation(op)) {
32284
32302
  if (active.kind !== "phase-worker") {
32285
- throw new Error(`${op} is not available to a root architect session`);
32303
+ throw new Error(rootArchitectHandoffRefusal(op));
32286
32304
  }
32287
32305
  return await runHandoffAction({
32288
32306
  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.10",
4
4
  "type": "module",
5
5
  "omp": {
6
6
  "extensions": [