@sjawhar/pi-legion-envoy 7.7.0 → 7.8.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.
package/dist/envoy.js CHANGED
@@ -29896,6 +29896,7 @@ var AGENT_STREAM_WATCH_TTL_MS = 30000;
29896
29896
  var AGENT_STREAM_LIMITS = {
29897
29897
  partChars: 16000,
29898
29898
  toolChars: 8000,
29899
+ modelChars: 200,
29899
29900
  historyMessages: 200,
29900
29901
  historyBytes: 512 * 1024,
29901
29902
  snapshotIntervalMs: 100
@@ -35179,6 +35180,13 @@ var import_nats2 = __toESM(require_mod4(), 1);
35179
35180
 
35180
35181
  // src/agent-stream.ts
35181
35182
  var encoder = new TextEncoder;
35183
+ function readModel(message) {
35184
+ if (typeof message.model !== "string" || message.model === "")
35185
+ return;
35186
+ if (typeof message.provider !== "string" || message.provider === "")
35187
+ return;
35188
+ return capAgentStreamText(`${message.provider}/${message.model}`, AGENT_STREAM_LIMITS.modelChars);
35189
+ }
35182
35190
  function readMessage(raw) {
35183
35191
  if (typeof raw !== "object" || raw === null)
35184
35192
  return null;
@@ -35188,6 +35196,7 @@ function readMessage(raw) {
35188
35196
  return {
35189
35197
  host: message,
35190
35198
  isError: message.isError === true,
35199
+ model: readModel(message),
35191
35200
  role: message.role,
35192
35201
  timestamp: message.timestamp,
35193
35202
  toolCallId: typeof message.toolCallId === "string" ? message.toolCallId : undefined,
@@ -35285,7 +35294,8 @@ function frameFor(entry) {
35285
35294
  parts: conversationParts(message.host.content),
35286
35295
  role: message.role === "assistant" ? "assistant" : "user",
35287
35296
  streaming: entry.streaming,
35288
- ...dispatchMessageId === undefined ? {} : { dispatchMessageId }
35297
+ ...dispatchMessageId === undefined ? {} : { dispatchMessageId },
35298
+ ...message.role === "assistant" && message.model !== undefined ? { model: message.model } : {}
35289
35299
  },
35290
35300
  seq: entry.seq,
35291
35301
  v: AGENT_STREAM_PROTOCOL
package/dist/legion.js CHANGED
@@ -13983,6 +13983,7 @@ var AGENT_STREAM_WATCH_TTL_MS = 30000;
13983
13983
  var AGENT_STREAM_LIMITS = {
13984
13984
  partChars: 16000,
13985
13985
  toolChars: 8000,
13986
+ modelChars: 200,
13986
13987
  historyMessages: 200,
13987
13988
  historyBytes: 512 * 1024,
13988
13989
  snapshotIntervalMs: 100
@@ -17554,7 +17555,7 @@ function endInjectedUserTurns(sessionID) {
17554
17555
  // package.json
17555
17556
  var package_default = {
17556
17557
  name: "@sjawhar/pi-legion-envoy",
17557
- version: "7.7.0",
17558
+ version: "7.8.0",
17558
17559
  license: "Apache-2.0",
17559
17560
  type: "module",
17560
17561
  omp: {
@@ -18490,7 +18491,7 @@ function handoffSchemaFields(z2) {
18490
18491
  ready: z2.boolean().optional()
18491
18492
  };
18492
18493
  }
18493
- var HANDOFF_DESCRIPTION = "Handoff actions (phase workers; the daemon accepts a completion only from the role working " + "the issue's current phase, never from an architect): 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, or the merger's READY packet; `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.";
18494
+ var HANDOFF_DESCRIPTION = "Handoff actions (phase workers; the daemon accepts a completion only from the role working " + "the issue's current phase, never from an architect): handoff_write writes this phase's handoff " + "(`phase`, and `data`: the phase-specific fields as a JSON object, never the schemaVersion, " + "phase, completed and issue 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, or the merger's READY packet; `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.";
18494
18495
  function rootArchitectHandoffRefusal(operation) {
18495
18496
  return `${operation} is not available to a root architect session; a root architect reads handoffs with \`legion handoff read [--phase <phase>]\` from bash`;
18496
18497
  }
@@ -250,8 +250,10 @@ The daemon keeps this order from its fixed table; you start none of its steps:
250
250
 
251
251
  1. tester green and review cycles complete;
252
252
  2. on a clean review, the reviewer approves the head by SHA, and the daemon moves the issue to
253
- `retro`. No role pushes a `.legion/` deletion: the approved head still carries `.legion/`, and
254
- the operator removes it from the default branch in a follow-up pull request after the merge;
253
+ `retro`. No role pushes a `.legion/` deletion: the approved head still carries `.legion/`. The
254
+ daemon strips whatever `.legion/` main still carries from the next issue's branch before any of
255
+ its roles start, so that tree's own merge carries the removal onto the default branch; no
256
+ operator sweep follows;
255
257
  3. retro commits its learnings under `docs/solutions/` on top of the approved head; that
256
258
  commit does not void the approval and never returns the tree to the tester or reviewer;
257
259
  4. the merger verifies the current head is the reviewer-approved head plus only commits that
@@ -19,7 +19,9 @@ retrospective's durable output.
19
19
 
20
20
  1. Tester green and all code-review cycles finish.
21
21
  2. The reviewer approves the head. It still carries `.legion/`: no role removes it before the
22
- merge, and the operator removes it from the default branch after the merge.
22
+ merge. The daemon strips whatever `.legion/` main still carries from the next issue's branch
23
+ before any of its roles start, so that tree's own merge carries the removal onto the default
24
+ branch; no operator sweep follows.
23
25
  3. Run this retro: commit durable learnings to `docs/solutions/` and post the retro message on
24
26
  the Dispatch issue.
25
27
  Retro writes **no `.legion` file**, so it never changes the approved head's handoffs.
@@ -397,9 +397,11 @@ pushes nothing.
397
397
 
398
398
  Do not report phase completion until the write, existence check, handoff commit, and push
399
399
  succeed. This is the committed copy the next phase reads after revival. No phase removes
400
- `.legion/`: the reviewer approves a head that carries it, and the operator removes it from the
401
- default branch after the merge. Retro and the post-merge production check write no
402
- `.legion/<phase>.json`, commit no handoff, and report with `handoff_complete` alone (below).
400
+ `.legion/`: the reviewer approves a head that carries it. The daemon strips any `.legion/` still on
401
+ main from the next issue's branch before any of its roles start (dispatch://LEGION-565), so that
402
+ tree's own merge carries the removal onto the default branch; no operator sweep follows. Retro and
403
+ the post-merge production check write no `.legion/<phase>.json`, commit no handoff, and report with
404
+ `handoff_complete` alone (below).
403
405
 
404
406
  ## Completion: report to the architect, then stay
405
407
 
@@ -6,11 +6,13 @@ path it cites is in sjawhar/legion.
6
6
 
7
7
  The order, in full: the tester's evidence green → the reviewer's approval of the head →
8
8
  retro → the merger's READY → the human merge → the implementer's production check. No role
9
- removes `.legion/` before the merge: the approved head carries it, and the operator removes it
10
- from the default branch after the merge. After the approval, only retro's `docs/solutions/`
11
- commit leaves it standing on its own (*Retro*, below). A conflict-forced merge goes back to the
12
- reviewer for a confirmation or a new round, as the fingerprint decides (*The reviewer*, below,
13
- and `skill://legion-worker/references/conflicts-and-rewrites.md`), and any other change voids it.
9
+ removes `.legion/` before the merge: the approved head carries it. The daemon strips whatever
10
+ `.legion/` main still carries from the next issue's branch before any of its roles start
11
+ (dispatch://LEGION-565), so that tree's own merge carries the removal onto the default branch; no
12
+ operator sweep follows. After the approval, only retro's `docs/solutions/` commit leaves it
13
+ standing on its own (*Retro*, below). A conflict-forced merge goes back to the reviewer for a
14
+ confirmation or a new round, as the fingerprint decides (*The reviewer*, below, and
15
+ `skill://legion-worker/references/conflicts-and-rewrites.md`), and any other change voids it.
14
16
 
15
17
  ## The reviewer
16
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-legion-envoy",
3
- "version": "7.7.0",
3
+ "version": "7.8.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "omp": {