@sjawhar/pi-envoy 16.40.0 → 16.41.1

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/dispatch.js CHANGED
@@ -14710,6 +14710,9 @@ var askEventPayloadFields = {
14710
14710
  actor: object({ kind: string2().optional(), id: string2().optional() }).passthrough().optional(),
14711
14711
  at: string2().optional()
14712
14712
  }).nullish(),
14713
+ asked_of: string2().nullish(),
14714
+ asked_of_by: string2().nullish(),
14715
+ asked_of_at: string2().nullish(),
14713
14716
  thread_logins: array(string2()).optional()
14714
14717
  };
14715
14718
  var AskEventPayloadSchema = intersection(object(askEventPayloadFields), object({
@@ -15025,6 +15028,8 @@ var BOARD_NEIGHBOUR_REFUSAL = "The server refuses a key that does not exist, one
15025
15028
  var OWNER_REFERENCE = "Exactly one of issue and project is required. An issue is a native KEY or external owner/repo#n reference; a project is a project key such as CORE and addresses an unlinked project document named by artifact.";
15026
15029
  var ASK_QUESTION_CONTRACT = "The question names the concrete case first: which machines, files, sessions or people, and the " + "numbers. It asks the choice in those terms, saying what happens to whom under each option " + '("Ship Friday and risk signing out 1,240 users, or hold to Monday?"), never "How should we ' + 'proceed?" or "Which option?", because a reader cannot work back from a general question to ' + "the case. It carries every fact the reader needs to decide and nothing " + "that does not change the decision. Generalize only after the specifics, if at all. Then give " + "your recommendation and its reason.";
15027
15030
  var ASK_OPTIONS_CONTRACT = "Options carry the genuinely different approaches. Each option has a label, and its description " + "says what that approach costs.";
15031
+ var ASK_IS_FOR_A_PERSON = "An ask is a question for a person, never a request to another agent. Ask an agent by envoy_send or a comment on the issue.";
15032
+ var ASK_WAITS_ON_THE_ASSIGNEE = "An ask waits on the issue's assignee until a person hands it on. No agent can hand one on.";
15028
15033
  var HUMAN_AGREED_TO_DOCUMENT = "the human has agreed to every point in the document";
15029
15034
  function documentOwnerValidation(requireArtifact, alwaysRequireArtifact = false) {
15030
15035
  return {
@@ -15105,7 +15110,7 @@ var commentValidation = {
15105
15110
  message: `${commentOwner.message} ${COMMENT_TURN_RULE}`,
15106
15111
  refusal: (value) => commentProblem(value) ?? `${commentOwner.message} ${COMMENT_TURN_RULE}`
15107
15112
  };
15108
- var ISSUE_UPDATE_FIELDS_RULE = "Issue update requires at least one field besides issue: status, title, labels, priority, external_links, route, parent, blocked_by, components, repo, before, or after.";
15113
+ var ISSUE_UPDATE_FIELDS_RULE = "Issue update requires at least one field besides issue: status, title, labels, priority, assignee, external_links, route, parent, blocked_by, components, repo, before, or after.";
15109
15114
  var ISSUE_UPDATE_DONE_RULE = "status done requires reason, a non-empty note saying why the issue is closing, posted on the issue before it closes so the close carries its note";
15110
15115
  var ISSUE_UPDATE_REASON_RULE = "reason goes only with status done";
15111
15116
  var ISSUE_UPDATE_RULE = `${ISSUE_UPDATE_FIELDS_RULE} ${ISSUE_UPDATE_DONE_RULE}; ${ISSUE_UPDATE_REASON_RULE}.`;
@@ -15119,7 +15124,7 @@ function issueUpdateProblem(value) {
15119
15124
  const status = typeof input.status === "string" ? `status ${input.status}` : "an update without status done";
15120
15125
  return `${ISSUE_UPDATE_REASON_RULE}: it is the note posted on the issue as it closes, and ${status} closes nothing. Drop reason, or set status done to close the issue.`;
15121
15126
  }
15122
- const changesAField = typeof input.status === "string" || typeof input.title === "string" || Array.isArray(input.labels) || typeof input.priority === "number" || input.priority === null || Array.isArray(input.external_links) || typeof input.route === "string" || typeof input.parent === "string" || Array.isArray(input.blocked_by) || typeof input.components === "object" && input.components !== null || typeof input.repo === "string" || typeof input.before === "string" || typeof input.after === "string";
15127
+ const changesAField = typeof input.status === "string" || typeof input.title === "string" || Array.isArray(input.labels) || typeof input.priority === "number" || input.priority === null || typeof input.assignee === "string" || input.assignee === null || Array.isArray(input.external_links) || typeof input.route === "string" || typeof input.parent === "string" || Array.isArray(input.blocked_by) || typeof input.components === "object" && input.components !== null || typeof input.repo === "string" || typeof input.before === "string" || typeof input.after === "string";
15123
15128
  return changesAField ? undefined : ISSUE_UPDATE_FIELDS_RULE;
15124
15129
  }
15125
15130
  var messageValidation = {
@@ -15251,7 +15256,7 @@ var dispatchToolSpecs = [
15251
15256
  priority: 1,
15252
15257
  before: "DSP-2"
15253
15258
  },
15254
- description: "Update an existing issue: move its lifecycle status, retitle it, replace its labels, set " + "its priority, link a URL (the pull request that delivers it, a run, a document), set its " + "route, set or clear its parent, replace the issues it is blocked by, attach it to " + "architecture components, set the repository it targets, or move it on its project's " + "board. Status is one of " + `${ISSUE_STATUSES.join(", ")}; outside Legion, move it yourself as the work advances; inside ` + "Legion the daemon moves it. A non-empty external_links is " + "merged into the issue's existing links by URL, so linking the pull request you just opened " + "keeps every earlier link; an empty external_links removes every link instead. components " + "replaces the issue's own attachment. Closing an issue " + "(status done) requires reason, the note that says why: it is posted on the issue as a " + "message, then the issue closes, so the close carries its note; closing an issue that is " + "already closed is refused (ISSUE_CLOSED) before anything is posted. Reason goes only " + "with status done. Closing an issue withdraws every open ask " + "it holds (resolution kind withdrawn, naming the closer), and reopening it brings exactly " + "those asks back. " + "A closed issue still takes messages and comments, though not asks or artifacts; of this " + "tool's fields it takes only a board move " + "(before, after), components, " + "a reopening status (any status but done), and an external_links write that adds no new " + "link (so a link can move to the issue that replaced it); everything else, priority " + "included, waits for the reopen. " + "priority is yours to set and a human overrides it. before and after move the issue on " + "its project's board: before puts it above that issue, after below, and both together " + "land it between them. A project's board order is one agent's to keep; in a Legion " + "deployment that is the controller. Never reassign an issue a person holds to get a " + "faster answer: who holds it is their call. At least one " + `field besides issue is required. ${ISSUE_REFERENCE}`,
15259
+ description: "Update an existing issue: move its lifecycle status, retitle it, replace its labels, set " + "its priority, set or clear its assignee, link a URL (the pull request that delivers it, a " + "run, a document), set its " + "route, set or clear its parent, replace the issues it is blocked by, attach it to " + "architecture components, set the repository it targets, or move it on its project's " + "board. Status is one of " + `${ISSUE_STATUSES.join(", ")}; outside Legion, move it yourself as the work advances; inside ` + "Legion the daemon moves it. A non-empty external_links is " + "merged into the issue's existing links by URL, so linking the pull request you just opened " + "keeps every earlier link; an empty external_links removes every link instead. components " + "replaces the issue's own attachment. Closing an issue " + "(status done) requires reason, the note that says why: it is posted on the issue as a " + "message, then the issue closes, so the close carries its note; closing an issue that is " + "already closed is refused (ISSUE_CLOSED) before anything is posted. Reason goes only " + "with status done. Closing an issue withdraws every open ask " + "it holds (resolution kind withdrawn, naming the closer), and reopening it brings exactly " + "those asks back. " + "A closed issue still takes messages and comments, though not asks or artifacts; of this " + "tool's fields it takes only a board move " + "(before, after), components, " + "a reopening status (any status but done), and an external_links write that adds no new " + "link (so a link can move to the issue that replaced it); everything else, priority " + "included, waits for the reopen. " + "priority is yours to set and a human overrides it. assignee is the person who answers " + "this issue's asks, and every ask on it waits on them until a person hands that ask on. " + "Passing null unassigns the issue. Set the assignee when a person said who owns the work, as you " + "file the issue or hand it over. before and after move the issue on " + "its project's board: before puts it above that issue, after below, and both together " + "land it between them. A project's board order is one agent's to keep; in a Legion " + "deployment that is the controller. Never reassign an issue a person holds to get a " + "faster answer: who holds it is their call. At least one " + `field besides issue is required. ${ISSUE_REFERENCE}`,
15255
15260
  arguments: (z) => ({
15256
15261
  issue: z.string().describe(ISSUE_REFERENCE),
15257
15262
  status: z.enum(ISSUE_STATUSES).describe("New lifecycle status.").optional(),
@@ -15259,6 +15264,7 @@ var dispatchToolSpecs = [
15259
15264
  title: z.string({ min: 1, max: ISSUE_TITLE_MAX }).describe("Replacement title, at most 1,000 characters.").optional(),
15260
15265
  labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Replacement label set, at most 20 labels of up to 40 characters; replaces every existing label.").optional(),
15261
15266
  priority: z.number({ int: true, min: 0, max: 3 }).nullable().optional().describe("Coarse priority: 0 is P0 (highest) through 3 is P3 (lowest); null clears it."),
15267
+ assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
15262
15268
  external_links: z.array(z.string({ min: 1 })).describe("URLs to link; a non-empty list merges into the issue's existing external links by URL, an empty list removes every link instead.").optional(),
15263
15269
  route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
15264
15270
  parent: z.string().describe("Parent issue key in the same project; an empty string clears the parent.").optional(),
@@ -15301,7 +15307,7 @@ var dispatchToolSpecs = [
15301
15307
  }
15302
15308
  ]
15303
15309
  },
15304
- description: "Open a to-do or permission only a human can give, or a decision that has no document to " + "live in. A question about the design an issue's document records is not this tool: write " + "it into that document as a decision block (dispatch doc-edit inserting an ask block at the " + "end of the section it concerns), at every phase, approved spec or not; the block reaches " + "the Inbox and its answer lands next to its context. Never give an ask an Approve option: a " + "document is approved through dispatch request-approval. Do not use this tool for a status " + "update or discussion; use dispatch message instead. Never create an issue to park a " + "question: the question is an ask on the issue it concerns. " + ASK_QUESTION_CONTRACT + " " + ASK_OPTIONS_CONTRACT + " For an action only a human can perform, state what it changes and risks as constraints. " + "Anything that requires a human to do, including a credential or grant renewal, is an ask, " + "never a message. Measure what you can first, and put the measurement and the size of the " + "population it covers in the question; drop an option that cannot fix most of that " + "population, never offer it cut down, and keep an option not to act (Hold). Set urgency high " + "when your work halts on the answer, and keep working on everything else. " + "Anchor a to-do about a document passage, thread reply_to/reply_to_ask, or cite a dispatch:// " + `reference \u2014 it must be answerable from its own text and anchor alone, never "see above". ` + `A quote anchor is pinned to its block. ${ASK_BOUND_RULE} The lines images appends count ` + `toward that bound, and an ask has at most 8 options. ${RELATED_CHECK_RESULT} ` + `An ask among the related items says whether it is answered, by whom and with which options. ${OWNER_REFERENCE}`,
15310
+ description: `${ASK_IS_FOR_A_PERSON} ${ASK_WAITS_ON_THE_ASSIGNEE} ` + "Open a to-do or permission only a human can give, or a decision that has no document to " + "live in. A question about the design an issue's document records is not this tool: write " + "it into that document as a decision block (dispatch doc-edit inserting an ask block at the " + "end of the section it concerns), at every phase, approved spec or not; the block reaches " + "the Inbox and its answer lands next to its context. Never give an ask an Approve option: a " + "document is approved through dispatch request-approval. Do not use this tool for a status " + "update or discussion; use dispatch message instead. Never create an issue to park a " + "question: the question is an ask on the issue it concerns. " + ASK_QUESTION_CONTRACT + " " + ASK_OPTIONS_CONTRACT + " For an action only a human can perform, state what it changes and risks as constraints. " + "Anything that requires a human to do, including a credential or grant renewal, is an ask, " + "never a message. Measure what you can first, and put the measurement and the size of the " + "population it covers in the question; drop an option that cannot fix most of that " + "population, never offer it cut down, and keep an option not to act (Hold). Set urgency high " + "when your work halts on the answer, and keep working on everything else. " + "Anchor a to-do about a document passage, thread reply_to/reply_to_ask, or cite a dispatch:// " + `reference \u2014 it must be answerable from its own text and anchor alone, never "see above". ` + `A quote anchor is pinned to its block. ${ASK_BOUND_RULE} The lines images appends count ` + `toward that bound, and an ask has at most 8 options. ${RELATED_CHECK_RESULT} ` + `An ask among the related items says whether it is answered, by whom and with which options. ${OWNER_REFERENCE}`,
15305
15311
  arguments: (z) => ({
15306
15312
  issue: z.string().describe(ISSUE_REFERENCE).optional(),
15307
15313
  project: z.string().describe("Project key owning the document.").optional(),
@@ -15339,7 +15345,7 @@ var dispatchToolSpecs = [
15339
15345
  }
15340
15346
  ]
15341
15347
  },
15342
- description: "Edit an open question in place. Use it to correct or refine the same decision; retract the " + "old ask and open a new one when the decision itself changes. " + ASK_QUESTION_CONTRACT + " " + ASK_OPTIONS_CONTRACT + " Previous text remains in the event log. Only the asking session can edit it; answered or " + "resolved asks cannot be edited. An ask that lives as an `ask` block in a document is written " + "in the document too, changing only the fields you name - pass urgency alone and the " + "question's wording, formatting, links and comment anchors are untouched - so the edit " + "writes a document version and closes a spec's design gate until that version is approved; " + "text the block cannot carry back unchanged is refused, naming the field - an option label " + 'containing ": ", the separator between a label and its description, is one example.',
15348
+ description: `${ASK_IS_FOR_A_PERSON} ${ASK_WAITS_ON_THE_ASSIGNEE} ` + "Edit an open question in place. Use it to correct or refine the same decision; retract the " + "old ask and open a new one when the decision itself changes. " + ASK_QUESTION_CONTRACT + " " + ASK_OPTIONS_CONTRACT + " Previous text remains in the event log. Only the asking session can edit it; answered or " + "resolved asks cannot be edited. An ask that lives as an `ask` block in a document is written " + "in the document too, changing only the fields you name - pass urgency alone and the " + "question's wording, formatting, links and comment anchors are untouched - so the edit " + "writes a document version and closes a spec's design gate until that version is approved; " + "text the block cannot carry back unchanged is refused, naming the field - an option label " + 'containing ": ", the separator between a label and its description, is one example.',
15343
15349
  arguments: (z) => ({
15344
15350
  ask: z.string().describe("Ask id (uuid); an 8+ hex prefix unique among this session's own open asks works too."),
15345
15351
  question: z.string().optional().describe(`${ASK_QUESTION_CONTRACT} Replaces the ask's question. ${ASK_BOUND_RULE}`),
@@ -17586,6 +17592,14 @@ async function resolveOrigin(env, exec, cwd) {
17586
17592
  return origin;
17587
17593
  }
17588
17594
 
17595
+ // ../contracts/src/trailing-slash.ts
17596
+ function withoutTrailingSlashes(url) {
17597
+ let end = url.length;
17598
+ while (end > 0 && url[end - 1] === "/")
17599
+ end -= 1;
17600
+ return url.slice(0, end);
17601
+ }
17602
+
17589
17603
  // ../envoy-client/src/dispatch-http.ts
17590
17604
  class DispatchServiceError extends Error {
17591
17605
  code;
@@ -17894,7 +17908,7 @@ class DispatchClient {
17894
17908
  this.fetchImpl = fetchImpl;
17895
17909
  this.writeRetry = writeRetry;
17896
17910
  this.#credential = credential;
17897
- this.#baseUrl = baseUrl.replace(/\/+$/, "");
17911
+ this.#baseUrl = withoutTrailingSlashes(baseUrl);
17898
17912
  this.#signal = requestSignal(signal);
17899
17913
  this.#madeAt = this.#now();
17900
17914
  }
@@ -19722,6 +19736,12 @@ function optionalString(args, name) {
19722
19736
  const value = args[name];
19723
19737
  return typeof value === "string" ? value : undefined;
19724
19738
  }
19739
+ function optionalNullableString(args, name) {
19740
+ const value = args[name];
19741
+ if (value === null)
19742
+ return null;
19743
+ return typeof value === "string" ? value : undefined;
19744
+ }
19725
19745
  function optionalBoolean(args, name) {
19726
19746
  const value = args[name];
19727
19747
  return typeof value === "boolean" ? value : undefined;
@@ -20919,6 +20939,8 @@ function eventHead(event) {
20919
20939
  const previousAnswer = event.payload.previous_answer;
20920
20940
  return `${textHead(event.payload.question)} -> ${textHead(askAnswerText(event.payload.answer))}${previousAnswer === undefined ? "" : ` (was: ${textHead(askAnswerText(previousAnswer))})`}`;
20921
20941
  }
20942
+ case "ask.asked_of":
20943
+ return `${textHead(event.payload.question)} -> asked of ${event.payload.asked_of ?? "the assignee of its issue"}`;
20922
20944
  case "comment.created":
20923
20945
  case "comment.answered":
20924
20946
  case "comment.anchor_refreshed":
@@ -21057,9 +21079,13 @@ function openAskAge(ageSeconds) {
21057
21079
  const days = Math.floor(hours / 24);
21058
21080
  return `${days}d${hours % 24 === 0 ? "" : ` ${hours % 24}h`}`;
21059
21081
  }
21082
+ function openAskAskedOf(ask) {
21083
+ const person = ask.waiting_on_person;
21084
+ return person === undefined || person === "" ? "nobody" : person;
21085
+ }
21060
21086
  function openAskLine(ask, baseUrl) {
21061
21087
  const priority = ask.priority === null ? "" : `P${ask.priority} \xB7 `;
21062
- return `- ${openAskAge(ask.age_seconds)} \xB7 ${priority}${ownerTitle(ask.owner)} \xB7 ${ask.question} \xB7 ${new URL(ask.ref, baseUrl).toString()}`;
21088
+ return `- ${openAskAge(ask.age_seconds)} \xB7 ${priority}${ownerTitle(ask.owner)} \xB7 asked of ${openAskAskedOf(ask)} \xB7 ${ask.question} \xB7 ${new URL(ask.ref, baseUrl).toString()}`;
21063
21089
  }
21064
21090
  function formatOpenAsksSummary(response, baseUrl) {
21065
21091
  const scope = "active open asks you authored on open issues and project documents";
@@ -21810,6 +21836,7 @@ async function executeDispatchTool(input) {
21810
21836
  const rankBefore = optionalString(args, "before");
21811
21837
  const rankAfter = optionalString(args, "after");
21812
21838
  const priority = optionalPriority(args, "priority");
21839
+ const assignee = optionalNullableString(args, "assignee");
21813
21840
  const labels = Array.isArray(args.labels) ? args.labels : undefined;
21814
21841
  const blockedBy = Array.isArray(args.blocked_by) ? args.blocked_by : undefined;
21815
21842
  const requestedLinks = Array.isArray(args.external_links) ? [...new Set(args.external_links)] : undefined;
@@ -21855,6 +21882,7 @@ async function executeDispatchTool(input) {
21855
21882
  ...title === undefined ? {} : { title },
21856
21883
  ...labels === undefined ? {} : { labels },
21857
21884
  ...priority === undefined ? {} : { priority },
21885
+ ...assignee === undefined ? {} : { assignee },
21858
21886
  ...route === undefined ? {} : { route },
21859
21887
  ...parent === undefined ? {} : { parent: parent === "" ? null : parent },
21860
21888
  ...blockedBy === undefined ? {} : { blocked_by: blockedBy },
@@ -21888,6 +21916,7 @@ async function executeDispatchTool(input) {
21888
21916
  (after.labels ?? []).length === 0 ? "labels cleared" : `labels ${(after.labels ?? []).join(", ")}`
21889
21917
  ],
21890
21918
  ...priority === undefined ? [] : [after.priority === null ? "priority cleared" : `priority -> P${after.priority}`],
21919
+ ...assignee === undefined ? [] : [after.assignee === null ? "assignee cleared" : `assignee -> ${after.assignee}`],
21891
21920
  ...rank === undefined ? [] : [
21892
21921
  `rank -> ${[
21893
21922
  ...rankAfter === undefined ? [] : [`after ${rankAfter}`],
@@ -25653,12 +25682,6 @@ function statusOf(error) {
25653
25682
  }
25654
25683
  return 0;
25655
25684
  }
25656
- function withoutTrailingSlashes(url) {
25657
- let end = url.length;
25658
- while (end > 0 && url[end - 1] === "/")
25659
- end -= 1;
25660
- return url.slice(0, end);
25661
- }
25662
25685
 
25663
25686
  class BrokerTokenClient {
25664
25687
  #brokerUrl;
@@ -25936,12 +25959,6 @@ function brokerCredential(env, session) {
25936
25959
 
25937
25960
  // ../envoy-client/src/dispatch-config.ts
25938
25961
  var DEFAULT_SERVER_URL = "http://localhost:8766";
25939
- function withoutTrailingSlashes2(url) {
25940
- let end = url.length;
25941
- while (end > 0 && url[end - 1] === "/")
25942
- end -= 1;
25943
- return url.slice(0, end);
25944
- }
25945
25962
  function checkoutPair(checkout, serverUrl) {
25946
25963
  const { token } = checkout.dispatch;
25947
25964
  if (token === undefined) {
@@ -26003,7 +26020,7 @@ function dispatchSettings(env, config, options = {}) {
26003
26020
  enabled: true,
26004
26021
  url,
26005
26022
  credential,
26006
- ...publicUrl === undefined ? {} : { publicUrl: publicUrl.replace(/\/+$/, "") }
26023
+ ...publicUrl === undefined ? {} : { publicUrl: withoutTrailingSlashes(publicUrl) }
26007
26024
  };
26008
26025
  }
26009
26026
  function brokerRouteForced(env) {
@@ -26059,7 +26076,7 @@ function dispatchTarget(env, config) {
26059
26076
  return offWithError(messageFor(error));
26060
26077
  }
26061
26078
  if (route.traded) {
26062
- const brokered = withoutTrailingSlashes2(explicitUrl ?? own.serverUrl ?? DEFAULT_SERVER_URL);
26079
+ const brokered = withoutTrailingSlashes(explicitUrl ?? own.serverUrl ?? DEFAULT_SERVER_URL);
26063
26080
  return { enabled: true, url: brokered, source: { kind: "broker" } };
26064
26081
  }
26065
26082
  if (forced) {
@@ -26067,7 +26084,7 @@ function dispatchTarget(env, config) {
26067
26084
  }
26068
26085
  return offWithError(explicitUrl === undefined ? `${config.path}: dispatch is enabled and no token is: set dispatch.token, or DISPATCH_TOKEN or DISPATCH_TOKEN_FILE` : `DISPATCH_URL is set and no token is: set DISPATCH_TOKEN or DISPATCH_TOKEN_FILE, or dispatch.token in ${config.path}`);
26069
26086
  }
26070
- const url = (explicitUrl ?? (source.kind === "file" ? source.server : own.serverUrl ?? DEFAULT_SERVER_URL)).replace(/\/+$/, "");
26087
+ const url = withoutTrailingSlashes(explicitUrl ?? (source.kind === "file" ? source.server : own.serverUrl ?? DEFAULT_SERVER_URL));
26071
26088
  return { enabled: true, url, source };
26072
26089
  }
26073
26090
 
@@ -26110,7 +26127,7 @@ function natsServerKey(url) {
26110
26127
  if (match === null)
26111
26128
  return url;
26112
26129
  const [, scheme = "", userinfo = "", host = "", port = "4222", rest = ""] = match;
26113
- return `${scheme.toLowerCase()}://${userinfo}${host.toLowerCase()}:${port}${rest.replace(/\/+$/, "")}`;
26130
+ return `${scheme.toLowerCase()}://${userinfo}${host.toLowerCase()}:${port}${withoutTrailingSlashes(rest)}`;
26114
26131
  }
26115
26132
  function natsCredential(env, section, namedNatsUrls, filePath) {
26116
26133
  const fromEnvironment = natsSeedFromEnvironment(env);
@@ -26181,7 +26198,7 @@ function envoySettings(env, config, options = {}) {
26181
26198
  const namedPassDeadlineMs = namedInterval(env.ENVOY_PASS_DEADLINE_MS);
26182
26199
  return {
26183
26200
  enabled: true,
26184
- url: normalizeEnvoyUrl(url),
26201
+ url: withoutTrailingSlashes(url),
26185
26202
  credential,
26186
26203
  inbound,
26187
26204
  heartbeatMs,
@@ -26190,9 +26207,6 @@ function envoySettings(env, config, options = {}) {
26190
26207
  passDeadlineRaisedFrom: namedPassDeadlineMs !== undefined && namedPassDeadlineMs < heartbeatMs ? namedPassDeadlineMs : undefined
26191
26208
  };
26192
26209
  }
26193
- function normalizeEnvoyUrl(value) {
26194
- return value.replace(/\/+$/, "");
26195
- }
26196
26210
 
26197
26211
  // ../envoy-client/src/session-settings.ts
26198
26212
  function sessionConfigFile(harness, env) {
@@ -26439,7 +26453,7 @@ function resolveCallTiming(config) {
26439
26453
  };
26440
26454
  }
26441
26455
  function createEnvoyClient(config) {
26442
- const baseUrl = normalizeEnvoyUrl(config.baseUrl);
26456
+ const baseUrl = withoutTrailingSlashes(config.baseUrl);
26443
26457
  const { timeoutMs, attempts, retryDelayMs } = resolveCallTiming(config);
26444
26458
  const credential = config.credential;
26445
26459
  const attemptOnce = async (url, init, deadlineMs, actingSession) => {