@sjawhar/pi-legion-envoy 1.45.0 → 1.47.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/README.md CHANGED
@@ -85,10 +85,10 @@ extension files it does not contain.
85
85
 
86
86
  ## Native Dispatch tools
87
87
 
88
- The extension registers eighteen native Dispatch tools: `dispatch_issue`, `dispatch_issue_update`, `dispatch_ask`, `dispatch_edit_ask`,
88
+ The extension registers nineteen native Dispatch tools: `dispatch_issue`, `dispatch_issue_update`, `dispatch_ask`, `dispatch_edit_ask`,
89
89
  `dispatch_resolve_ask`, `dispatch_resolve_comment`, `dispatch_follow`, `dispatch_comment`, `dispatch_suggest`,
90
90
  `dispatch_message`, `dispatch_doc_edit`, `dispatch_doc_read`, `dispatch_request_approval`, `dispatch_artifact`,
91
- `dispatch_read`, `dispatch_search`, `dispatch_open_asks`, and `dispatch_whoami`, when Dispatch configuration resolves both a base URL and bearer token.
91
+ `dispatch_read`, `dispatch_search`, `dispatch_issues`, `dispatch_open_asks`, and `dispatch_whoami`, when Dispatch configuration resolves both a base URL and bearer token.
92
92
 
93
93
  Configure the shared `envoy.json` with:
94
94
 
@@ -112,7 +112,7 @@ whose trimmed contents are the token — how the Legion daemon delivers it to a
112
112
  pane) wins over every other token source and never falls back when unreadable.
113
113
  Omitting `dispatch.serverUrl` while `dispatch.enabled` is true targets
114
114
  `http://localhost:8766`, the Go server's listen address. Invalid configuration,
115
- an invalid URL, or an empty token leaves the eighteen tools unavailable and
115
+ an invalid URL, or an empty token leaves the nineteen tools unavailable and
116
116
  reports the source of the error.
117
117
 
118
118
  Owner-scoped calls use either an issue (a native `KEY` or external `owner/repo#n` reference) or
package/dist/envoy.js CHANGED
@@ -30121,10 +30121,24 @@ var dispatchToolSpecs = [
30121
30121
  limit: z.number({ int: true, min: 1, max: 50 }).describe("Maximum results, 1-50; default 20.").optional()
30122
30122
  })
30123
30123
  },
30124
+ {
30125
+ name: "dispatch_issues",
30126
+ description: "List a project's issues for a roadmap or backlog pass: every issue in one project, each carrying " + "its status, priority, parent, labels, and open-ask count, so you can see backlog shape without " + "opening every issue. Optionally filter by status, parent, label, or how recently it changed. Do " + "not use it to search by keyword or phrase; dispatch_search remains the keyword surface. Rows are " + "capped at limit (default 50, max 250), applied to the response here, not by the server.",
30127
+ arguments: (z) => ({
30128
+ project: z.string().describe("Project key to list issues from."),
30129
+ status: z.enum(ISSUE_STATUSES).describe("Optional lifecycle status filter.").optional(),
30130
+ parent: z.string().describe("Optional parent issue key filter.").optional(),
30131
+ label: z.string().describe("Optional label filter.").optional(),
30132
+ updated_since: z.string().describe("Optional RFC3339 timestamp; only issues updated at or after it.").optional(),
30133
+ limit: z.number({ int: true, min: 1, max: 250 }).describe("Maximum rows, 1-250; default 50.").optional()
30134
+ })
30135
+ },
30124
30136
  {
30125
30137
  name: "dispatch_open_asks",
30126
- description: "List this session's active unanswered asks across issues and project documents, including age and whose reply is needed. Call before saying you are waiting for human input.",
30127
- arguments: () => ({}),
30138
+ description: "List active unanswered asks, oldest first, with age and whose reply is needed. Omit project to " + "see only this session's own authored asks (call before saying you are waiting for human input); " + "supply project to see every open ask across that project's issues and documents, whoever authored " + "them.",
30139
+ arguments: (z) => ({
30140
+ project: z.string().describe("Project key; when supplied, lists every open ask in the project instead of only this session's own.").optional()
30141
+ }),
30128
30142
  strict: true
30129
30143
  },
30130
30144
  {
@@ -31919,6 +31933,9 @@ class DispatchClient {
31919
31933
  ...since === undefined ? {} : { since }
31920
31934
  });
31921
31935
  }
31936
+ async openAsksForProject(project) {
31937
+ return this.#json("GET", ["api", "v1", "asks", "open"], undefined, { project });
31938
+ }
31922
31939
  async whoami() {
31923
31940
  return this.#json("GET", ["api", "v1", "whoami"]);
31924
31941
  }
@@ -32335,6 +32352,7 @@ var issueFreeTools = {
32335
32352
  dispatch_resolve_comment: true,
32336
32353
  dispatch_follow: true,
32337
32354
  dispatch_search: true,
32355
+ dispatch_issues: true,
32338
32356
  dispatch_open_asks: true,
32339
32357
  dispatch_whoami: true
32340
32358
  };
@@ -32996,10 +33014,15 @@ async function executeDispatchTool(input) {
32996
33014
  if (problems.length > 0)
32997
33015
  throw new ToolInputError(input.tool, problems);
32998
33016
  if (input.tool === "dispatch_open_asks") {
33017
+ const client = new DispatchClient(configUrl, configToken, fetchImpl, input.signal);
33018
+ const project = optionalString(ownerArguments.args, "project");
33019
+ if (project !== undefined) {
33020
+ const response = await client.openAsksForProject(project);
33021
+ return { text: formatOpenAsksSummary(response, configUrl), details: { ...response } };
33022
+ }
32999
33023
  const sessionId = input.sessionId?.trim();
33000
33024
  if (!sessionId)
33001
33025
  throw new Error("host session id is required for dispatch_open_asks");
33002
- const client = new DispatchClient(configUrl, configToken, fetchImpl, input.signal);
33003
33026
  const response = await client.openAsks(sessionId);
33004
33027
  return { text: formatOpenAsksSummary(response, configUrl), details: { ...response } };
33005
33028
  }
@@ -33146,6 +33169,39 @@ async function executeDispatchTool(input) {
33146
33169
  details: { query, results }
33147
33170
  };
33148
33171
  }
33172
+ case "dispatch_issues": {
33173
+ const project = stringArg(args, "project");
33174
+ const status = optionalString(args, "status");
33175
+ const parent = optionalString(args, "parent");
33176
+ const label = optionalString(args, "label");
33177
+ const updatedSince = optionalString(args, "updated_since");
33178
+ const limit = Math.min(Math.max(optionalNumber(args, "limit") ?? 50, 1), 250);
33179
+ const issues = await client.listIssues({
33180
+ project,
33181
+ ...status === undefined ? {} : { status },
33182
+ ...parent === undefined ? {} : { parent },
33183
+ ...label === undefined ? {} : { label },
33184
+ ...updatedSince === undefined ? {} : { updated_since: updatedSince }
33185
+ });
33186
+ const rows = issues.slice(0, limit).map((row) => ({
33187
+ key: row.key,
33188
+ title: row.title,
33189
+ status: row.status,
33190
+ priority: row.priority,
33191
+ parent: row.parent,
33192
+ labels: row.labels ?? [],
33193
+ open_asks: row.open_asks,
33194
+ updated_at: row.updated_at
33195
+ }));
33196
+ return {
33197
+ text: rows.length === 0 ? `No issues in ${project}.` : [
33198
+ `${rows.length} ${rows.length === 1 ? "issue" : "issues"} in ${project}` + (issues.length > rows.length ? ` (showing ${rows.length} of ${issues.length})` : ""),
33199
+ ...rows.map((row) => `${row.key} [${row.status}]${row.priority === null ? "" : ` P${row.priority}`} ${row.title}` + (row.open_asks === 0 ? "" : ` \xB7 ${row.open_asks} open ${row.open_asks === 1 ? "ask" : "asks"}`))
33200
+ ].join(`
33201
+ `),
33202
+ details: { issues: rows }
33203
+ };
33204
+ }
33149
33205
  case "dispatch_resolve_ask": {
33150
33206
  const kind = stringArg(args, "kind");
33151
33207
  const ask = await client.resolveAsk(stringArg(args, "ask"), {
package/dist/legion.js CHANGED
@@ -29395,10 +29395,24 @@ var dispatchToolSpecs = [
29395
29395
  limit: z.number({ int: true, min: 1, max: 50 }).describe("Maximum results, 1-50; default 20.").optional()
29396
29396
  })
29397
29397
  },
29398
+ {
29399
+ name: "dispatch_issues",
29400
+ description: "List a project's issues for a roadmap or backlog pass: every issue in one project, each carrying " + "its status, priority, parent, labels, and open-ask count, so you can see backlog shape without " + "opening every issue. Optionally filter by status, parent, label, or how recently it changed. Do " + "not use it to search by keyword or phrase; dispatch_search remains the keyword surface. Rows are " + "capped at limit (default 50, max 250), applied to the response here, not by the server.",
29401
+ arguments: (z) => ({
29402
+ project: z.string().describe("Project key to list issues from."),
29403
+ status: z.enum(ISSUE_STATUSES).describe("Optional lifecycle status filter.").optional(),
29404
+ parent: z.string().describe("Optional parent issue key filter.").optional(),
29405
+ label: z.string().describe("Optional label filter.").optional(),
29406
+ updated_since: z.string().describe("Optional RFC3339 timestamp; only issues updated at or after it.").optional(),
29407
+ limit: z.number({ int: true, min: 1, max: 250 }).describe("Maximum rows, 1-250; default 50.").optional()
29408
+ })
29409
+ },
29398
29410
  {
29399
29411
  name: "dispatch_open_asks",
29400
- description: "List this session's active unanswered asks across issues and project documents, including age and whose reply is needed. Call before saying you are waiting for human input.",
29401
- arguments: () => ({}),
29412
+ description: "List active unanswered asks, oldest first, with age and whose reply is needed. Omit project to " + "see only this session's own authored asks (call before saying you are waiting for human input); " + "supply project to see every open ask across that project's issues and documents, whoever authored " + "them.",
29413
+ arguments: (z) => ({
29414
+ project: z.string().describe("Project key; when supplied, lists every open ask in the project instead of only this session's own.").optional()
29415
+ }),
29402
29416
  strict: true
29403
29417
  },
29404
29418
  {
@@ -148,6 +148,20 @@ start with the issue key; standalone project-document hit lines start with
148
148
  `dispatch_issue` refuses a title that near-duplicates an issue in the same project and returns the candidates (`POSSIBLE_DUPLICATE`).
149
149
  Read them; reference the existing issue, or repeat the call with `force: true` when it is genuinely new work.
150
150
 
151
+ ## Reading a project's backlog
152
+
153
+ To see the shape of a project rather than find a phrase, list its issues:
154
+ ```ts
155
+ dispatch_issues({ project, status?, parent?, label?, updated_since?, limit? })
156
+ ```
157
+ Each row carries the issue key, title, status, priority, parent, labels, its open-ask count, and
158
+ when it last changed — a roadmap or backlog pass without opening every issue. Filter with `status`
159
+ (a lifecycle status), `parent` (one issue's children), `label`, or `updated_since` (an RFC3339
160
+ timestamp, for "what moved this week"). `limit` caps the rows at 50 by default and 250 at most.
161
+
162
+ This is not search: it matches no text. Use `dispatch_search` for a keyword or phrase, and
163
+ `dispatch_issues` when you want every issue in a project and its current state.
164
+
151
165
  ## Asking
152
166
 
153
167
  ### Before you ask
@@ -171,8 +185,8 @@ production import). Every `dispatch_ask` passes three gates first:
171
185
  would have to define. This is the phone test in [Writing for the human](#writing-for-the-human).
172
186
  If you cannot write it that way, you do not understand it well enough to ask.
173
187
 
174
- The platform PO audits open asks. One that fails a gate is retracted, with the PO's answer as the
175
- record.
188
+ The platform PO audits open asks. One that fails a gate — or that points at another message in
189
+ prose instead of carrying its content (below) — is retracted, with the PO's answer as the record.
176
190
 
177
191
  Open a decision with:
178
192
  ```ts
@@ -209,11 +223,32 @@ passage with `anchor`. Follow up on an ask or comment with `dispatch_comment`; c
209
223
  with a `dispatch://` reference (see [References](#references)). Never write "see above", "the
210
224
  message above", or "as attached".
211
225
 
226
+ **Pointing at another message is a defect, not a shortcut.** Sami, 2026-09-17, verbatim, on an
227
+ ask that read "the settings listed in my comment just above" after a long procedure had been posted
228
+ as a comment: "you just dump information into messages and then add a new ask that references a
229
+ previous message in prose with no link or no context whatsoever and uses compressed shorthand
230
+ jargon." The ask view does not show the issue's comments, so that ask was unanswerable; "Cloud
231
+ Identity licence check / 2SV override / 1-day grace" was shorthand he had never used. The rules
232
+ that follow from it:
233
+
234
+ - An ask that names another message in prose — "my comment above", "the procedure I posted",
235
+ "see the earlier message" — is retracted by the PO as failing the gates. Put the content IN the
236
+ ask. If it does not fit the 800-character budget, the step is too big: split the step, never
237
+ point elsewhere. The only pointers an ask may carry are a `dispatch://` reference or a document
238
+ `anchor`, and they cite — the ask still says in one line what the reader will find there and can
239
+ be answered without following them.
240
+ - Expand every term the reader has not used first. A product name, an internal setting, an
241
+ acronym, a value you coined this session — write what it is in the ask, in his words.
242
+ - A runbook the human must execute is one ask per step, each self-contained: what to do, where,
243
+ what result proves it, `Done` / `Can't` options. Each later step opens only after the previous is
244
+ answered and states that step's verified result in one line ("Step 1 done: the licence shows
245
+ Cloud Identity Free on the admin console.") — never a pointer to the earlier ask.
246
+
212
247
  **A decision about an uploaded artifact links it.** If the human must read an artifact to answer,
213
248
  the question carries `dispatch://KEY/artifact/<slug>` (or `ref`), never just its filename. Text
214
249
  they must read to decide belongs in the spec in the first place — see [Artifacts](#artifacts).
215
250
 
216
- Before saying you are waiting for human input, call `dispatch_open_asks`. It lists this session's active asks across open issues and project documents, including whether the human or agent owes the next reply.
251
+ Before saying you are waiting for human input, call `dispatch_open_asks`. With no arguments it lists this session's active asks across open issues and project documents, including whether the human or agent owes the next reply. With `dispatch_open_asks({ project })` it lists every open ask in that project — on its issues and on its documents, whoever authored them — which is how you audit what a whole project is waiting on rather than just your own asks.
217
252
 
218
253
  **Anything that needs the human is an ask, or it does not exist.** An approval, a credential,
219
254
  a setting only they can change, a review click, a conflict between two of their own rules - if
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-legion-envoy",
3
- "version": "1.45.0",
3
+ "version": "1.47.0",
4
4
  "type": "module",
5
5
  "omp": {
6
6
  "extensions": [