@sjawhar/pi-legion 19.29.0 → 19.29.2

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 +31 -11
  2. package/package.json +1 -1
package/dist/legion.js CHANGED
@@ -13599,6 +13599,20 @@ function messageFor(error) {
13599
13599
  function hasErrnoCode(error, code) {
13600
13600
  return error instanceof Error && "code" in error && error.code === code;
13601
13601
  }
13602
+ function withoutUserinfo(url) {
13603
+ let parsed;
13604
+ try {
13605
+ parsed = new URL(url);
13606
+ } catch {
13607
+ return url.slice(url.lastIndexOf("@") + 1);
13608
+ }
13609
+ if (parsed.username === "" && parsed.password === "")
13610
+ return url;
13611
+ parsed.username = "";
13612
+ parsed.password = "";
13613
+ const shown = parsed.toString();
13614
+ return shown.endsWith("/") && !url.endsWith("/") ? shown.slice(0, -1) : shown;
13615
+ }
13602
13616
 
13603
13617
  // ../envoy-client/src/json-position.ts
13604
13618
  function jsonErrorPosition(text) {
@@ -21045,7 +21059,8 @@ class DispatchWriteLandedError extends Error {
21045
21059
  name = "DispatchWriteLandedError";
21046
21060
  constructor(code, status, method, url) {
21047
21061
  const lost = code === IDEMPOTENCY_ANSWER_NOT_KEPT ? "Dispatch kept no copy of its answer, which was too large" : "its answer was lost on the way back";
21048
- super(`${method} ${url} was made, but ${lost} (${code}), so this command cannot print what it ` + "made: read it back with `dispatch read`, or with the matching list for something it created.");
21062
+ const request = `${method} ${withoutUserinfo(url)}`;
21063
+ super(`${request} was made, but ${lost} (${code}), so this command cannot print what it ` + "made: read it back with `dispatch read`, or with the matching list for something it created.");
21049
21064
  this.code = code;
21050
21065
  this.status = status;
21051
21066
  }
@@ -21066,7 +21081,8 @@ class DispatchNoRouteError extends DispatchServiceError {
21066
21081
  }
21067
21082
  }
21068
21083
  function reviewNoRouteRefusal(baseUrl, route, version) {
21069
- return new DispatchServiceError("NOT_FOUND", 404, `Dispatch at ${baseUrl} answered no route for ${route} each time the review was sent, and an ` + "answer of no route records no review. This build is older than that route. No other review " + "route was asked: the review route an older build serves takes no version, and it " + `would record the review at a version that build chooses, which may not be version ${version}. ` + `The no-route answer does not name the build; GET ${baseUrl}/healthz names the commit of the ` + "build that answers it, when that build was stamped with one.");
21084
+ const shown = withoutUserinfo(baseUrl);
21085
+ return new DispatchServiceError("NOT_FOUND", 404, `Dispatch at ${shown} answered no route for ${route} each time the review was sent, and an ` + "answer of no route records no review. This build is older than that route. No other review " + "route was asked: the review route an older build serves takes no version, and it " + `would record the review at a version that build chooses, which may not be version ${version}. ` + `The no-route answer does not name the build; GET ${shown}/healthz names the commit of the ` + "build that answers it, when that build was stamped with one.");
21070
21086
  }
21071
21087
  var ISSUE_EVENTS_PAGE_MAX = 200;
21072
21088
  var DISPATCH_TOOL_DEADLINE_MS = 60000;
@@ -21299,7 +21315,8 @@ class DispatchClient {
21299
21315
  const refusal = whyNotAPage(answer);
21300
21316
  if (refusal === undefined)
21301
21317
  return answer;
21302
- throw new Error(`GET ${this.#url(path, query)} asked for a page ({issues, total, limit, offset}) and got ` + refusal);
21318
+ const url = withoutUserinfo(this.#url(path, query));
21319
+ throw new Error(`GET ${url} asked for a page ({issues, total, limit, offset}) and got ${refusal}`);
21303
21320
  }
21304
21321
  async listAllIssues(options) {
21305
21322
  const path = ["api", "v1", "issues"];
@@ -21307,7 +21324,8 @@ class DispatchClient {
21307
21324
  const answer = await this.#json("GET", path, undefined, query);
21308
21325
  if (Array.isArray(answer))
21309
21326
  return answer;
21310
- throw new Error(`GET ${this.#url(path, query)} asked for the unpaged listing and got ${whyNotAnArray(answer)}.`);
21327
+ const url = withoutUserinfo(this.#url(path, query));
21328
+ throw new Error(`GET ${url} asked for the unpaged listing and got ${whyNotAnArray(answer)}.`);
21311
21329
  }
21312
21330
  async listIssueArtifacts(issue) {
21313
21331
  return this.#json("GET", ["api", "v1", "issues", await this.#resolveIssue(issue), "artifacts"]);
@@ -21774,7 +21792,7 @@ class DispatchClient {
21774
21792
  headers[IDEMPOTENCY_KEY_HEADER] = key;
21775
21793
  const { pausesMs, withinMs, silenceMs, inFlightPauseMs, inFlightWithinMs } = this.writeRetry;
21776
21794
  const pause = this.writeRetry.pause ?? pauseFor;
21777
- const request = `${method} ${url}`;
21795
+ const request = `${method} ${withoutUserinfo(url)}`;
21778
21796
  const started = this.#now();
21779
21797
  const bodyBytes = body === undefined ? 0 : typeof body.content === "string" ? Buffer.byteLength(body.content) : body.content.byteLength;
21780
21798
  const upload = bodyBytes >= STREAMED_BODY_MIN;
@@ -21957,7 +21975,8 @@ class DispatchClient {
21957
21975
  }
21958
21976
  const reasonPhrase = excerpt(response.statusText, this.token);
21959
21977
  const reason = reasonPhrase === "" ? "" : ` ${reasonPhrase}`;
21960
- throw new DispatchGatewayError(response.status, `${method} ${url} answered ${response.status}${reason} with ${body}, ${GATEWAY_PAGE}`, gatewayAdvice(method, response.status));
21978
+ const request = `${method} ${withoutUserinfo(url)}`;
21979
+ throw new DispatchGatewayError(response.status, `${request} answered ${response.status}${reason} with ${body}, ${GATEWAY_PAGE}`, gatewayAdvice(method, response.status));
21961
21980
  }
21962
21981
  const replayed = response.headers.get(IDEMPOTENCY_REPLAYED_HEADER)?.trim() === "?1";
21963
21982
  if (answerNotKept(response.status, replayed, payload)) {
@@ -23281,6 +23300,7 @@ function openAskLine(ask, baseUrl) {
23281
23300
  return `- ${openAskAge(ask.age_seconds)} \xB7 ${priority}${ownerTitle(ask.owner)} \xB7 asked of ${waitsOnPerson(ask) ?? "nobody"} \xB7 ${ask.question} \xB7 ${new URL(ask.ref, baseUrl).toString()}`;
23282
23301
  }
23283
23302
  function formatOpenAsksSummary(response, baseUrl) {
23303
+ const linkBase = withoutUserinfo(baseUrl);
23284
23304
  const scope = "active open asks you authored on open issues and project documents";
23285
23305
  if (response.count === 0) {
23286
23306
  return ["There are no unanswered asks for this session.", `Scope: ${scope}.`].join(`
@@ -23292,10 +23312,10 @@ function formatOpenAsksSummary(response, baseUrl) {
23292
23312
  `${response.count} unanswered ${response.count === 1 ? "ask" : "asks"} you authored on active issues and project documents.`,
23293
23313
  "",
23294
23314
  `Waiting on human (${waitingOnHuman.length}):`,
23295
- ...waitingOnHuman.map((ask) => openAskLine(ask, baseUrl)),
23315
+ ...waitingOnHuman.map((ask) => openAskLine(ask, linkBase)),
23296
23316
  "",
23297
23317
  `Waiting on agent (${waitingOnAgent.length}):`,
23298
- ...waitingOnAgent.map((ask) => openAskLine(ask, baseUrl))
23318
+ ...waitingOnAgent.map((ask) => openAskLine(ask, linkBase))
23299
23319
  ].join(`
23300
23320
  `);
23301
23321
  }
@@ -26531,7 +26551,7 @@ function createEnvoyClient(config) {
26531
26551
  }
26532
26552
  if (unminted !== undefined && (response.status === 401 || response.status === 403)) {
26533
26553
  return {
26534
- unanswered: new Error(`${init.method ?? "GET"} ${url} answered ${response.status}, and this machine's Envoy credential could not be minted: ${messageFor(unminted)}`, { cause: unminted })
26554
+ unanswered: new Error(`${init.method ?? "GET"} ${withoutUserinfo(url)} answered ${response.status}, and this machine's Envoy credential could not be minted: ${messageFor(unminted)}`, { cause: unminted })
26535
26555
  };
26536
26556
  }
26537
26557
  try {
@@ -26561,7 +26581,7 @@ function createEnvoyClient(config) {
26561
26581
  return body;
26562
26582
  const error = new EnvoyApiError({
26563
26583
  method: init.method ?? "GET",
26564
- url,
26584
+ url: withoutUserinfo(url),
26565
26585
  status: response.status,
26566
26586
  responseBody: body
26567
26587
  });
@@ -29743,7 +29763,7 @@ import { logger as logger3 } from "@oh-my-pi/pi-utils";
29743
29763
  // package.json
29744
29764
  var package_default = {
29745
29765
  name: "@sjawhar/pi-legion",
29746
- version: "19.29.0",
29766
+ version: "19.29.2",
29747
29767
  license: "Apache-2.0",
29748
29768
  type: "module",
29749
29769
  omp: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-legion",
3
- "version": "19.29.0",
3
+ "version": "19.29.2",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "omp": {