@sjawhar/pi-legion-envoy 1.47.0 → 1.48.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 nineteen native Dispatch tools: `dispatch_issue`, `dispatch_issue_update`, `dispatch_ask`, `dispatch_edit_ask`,
88
+ The extension registers twenty 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_issues`, `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_architecture_sync`, `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 nineteen tools unavailable and
115
+ an invalid URL, or an empty token leaves the twenty 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
@@ -30133,6 +30133,14 @@ var dispatchToolSpecs = [
30133
30133
  limit: z.number({ int: true, min: 1, max: 250 }).describe("Maximum rows, 1-250; default 50.").optional()
30134
30134
  })
30135
30135
  },
30136
+ {
30137
+ name: "dispatch_architecture_sync",
30138
+ description: "Import a project's architecture model from its configured source repository now, instead of " + "waiting for the server's five-minute schedule. Returns the imported commit and component " + "count, or the recorded error when the model was rejected (the previous model stays up). " + "The source itself is configured by a human in Settings; 404 SOURCE_NOT_FOUND without one.",
30139
+ arguments: (z) => ({
30140
+ project: z.string().describe("Project key whose architecture source to sync, such as CORE.")
30141
+ }),
30142
+ strict: true
30143
+ },
30136
30144
  {
30137
30145
  name: "dispatch_open_asks",
30138
30146
  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.",
@@ -31939,6 +31947,9 @@ class DispatchClient {
31939
31947
  async whoami() {
31940
31948
  return this.#json("GET", ["api", "v1", "whoami"]);
31941
31949
  }
31950
+ async syncArchitectureSource(project) {
31951
+ return this.#json("POST", ["api", "v1", "projects", project, "architecture-source", "sync"]);
31952
+ }
31942
31953
  async resolveAsk(id, input) {
31943
31954
  return this.#json("POST", ["api", "v1", "asks", id, "resolve"], input);
31944
31955
  }
@@ -32354,7 +32365,8 @@ var issueFreeTools = {
32354
32365
  dispatch_search: true,
32355
32366
  dispatch_issues: true,
32356
32367
  dispatch_open_asks: true,
32357
- dispatch_whoami: true
32368
+ dispatch_whoami: true,
32369
+ dispatch_architecture_sync: true
32358
32370
  };
32359
32371
  function canonicalExternalIssueRef(value) {
32360
32372
  const match = value.trim().match(externalIssueRefPattern);
@@ -33202,6 +33214,25 @@ async function executeDispatchTool(input) {
33202
33214
  details: { issues: rows }
33203
33215
  };
33204
33216
  }
33217
+ case "dispatch_architecture_sync": {
33218
+ const project = stringArg(args, "project");
33219
+ const source = await client.syncArchitectureSource(project);
33220
+ const at = source.last_sync_at ?? "unknown time";
33221
+ return {
33222
+ text: source.last_error === null ? `Synced ${project} architecture from ${source.repo}@${source.branch}: commit ${source.last_commit ?? "unknown"} (${at}).` : [
33223
+ `Sync failed for ${project} (${source.repo}@${source.branch}): ${source.last_error}`,
33224
+ source.last_commit === null ? "No model has ever imported for this project." : `The previous model stays up (commit ${source.last_commit}).`
33225
+ ].join(`
33226
+ `),
33227
+ details: {
33228
+ project,
33229
+ repo: source.repo,
33230
+ branch: source.branch,
33231
+ commit: source.last_commit,
33232
+ error: source.last_error
33233
+ }
33234
+ };
33235
+ }
33205
33236
  case "dispatch_resolve_ask": {
33206
33237
  const kind = stringArg(args, "kind");
33207
33238
  const ask = await client.resolveAsk(stringArg(args, "ask"), {
package/dist/legion.js CHANGED
@@ -29407,6 +29407,14 @@ var dispatchToolSpecs = [
29407
29407
  limit: z.number({ int: true, min: 1, max: 250 }).describe("Maximum rows, 1-250; default 50.").optional()
29408
29408
  })
29409
29409
  },
29410
+ {
29411
+ name: "dispatch_architecture_sync",
29412
+ description: "Import a project's architecture model from its configured source repository now, instead of " + "waiting for the server's five-minute schedule. Returns the imported commit and component " + "count, or the recorded error when the model was rejected (the previous model stays up). " + "The source itself is configured by a human in Settings; 404 SOURCE_NOT_FOUND without one.",
29413
+ arguments: (z) => ({
29414
+ project: z.string().describe("Project key whose architecture source to sync, such as CORE.")
29415
+ }),
29416
+ strict: true
29417
+ },
29410
29418
  {
29411
29419
  name: "dispatch_open_asks",
29412
29420
  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.",
@@ -248,6 +248,12 @@ that follow from it:
248
248
  the question carries `dispatch://KEY/artifact/<slug>` (or `ref`), never just its filename. Text
249
249
  they must read to decide belongs in the spec in the first place — see [Artifacts](#artifacts).
250
250
 
251
+ Import a project's architecture model from its configured source repository now (a human configures the source in Settings):
252
+ ```ts
253
+ dispatch_architecture_sync({ project: "CORE" })
254
+ ```
255
+ It returns the imported commit, or the recorded error when the model was rejected — the previous model stays up. Without a configured source it answers 404 `SOURCE_NOT_FOUND`.
256
+
251
257
  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.
252
258
 
253
259
  **Anything that needs the human is an ask, or it does not exist.** An approval, a credential,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-legion-envoy",
3
- "version": "1.47.0",
3
+ "version": "1.48.0",
4
4
  "type": "module",
5
5
  "omp": {
6
6
  "extensions": [