claude-use 11.53.0 → 11.54.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/cli.cjs CHANGED
@@ -318,10 +318,10 @@ function mergeDefs(...defs) {
318
318
  function cloneDef(schema) {
319
319
  return mergeDefs(schema._zod.def);
320
320
  }
321
- function getElementAtPath(obj, path67) {
322
- if (!path67)
321
+ function getElementAtPath(obj, path68) {
322
+ if (!path68)
323
323
  return obj;
324
- return path67.reduce((acc, key) => acc?.[key], obj);
324
+ return path68.reduce((acc, key) => acc?.[key], obj);
325
325
  }
326
326
  function promiseAllObject(promisesObj) {
327
327
  const keys = Object.keys(promisesObj);
@@ -580,11 +580,11 @@ function explicitlyAborted(x, startIndex = 0) {
580
580
  }
581
581
  return false;
582
582
  }
583
- function prefixIssues(path67, issues) {
583
+ function prefixIssues(path68, issues) {
584
584
  return issues.map((iss) => {
585
585
  var _a4;
586
586
  (_a4 = iss).path ?? (_a4.path = []);
587
- iss.path.unshift(path67);
587
+ iss.path.unshift(path68);
588
588
  return iss;
589
589
  });
590
590
  }
@@ -1105,16 +1105,16 @@ function flattenError(error63, mapper = (issue2) => issue2.message) {
1105
1105
  }
1106
1106
  function formatError(error63, mapper = (issue2) => issue2.message) {
1107
1107
  const fieldErrors = { _errors: [] };
1108
- const processError = (error64, path67 = []) => {
1108
+ const processError = (error64, path68 = []) => {
1109
1109
  for (const issue2 of error64.issues) {
1110
1110
  if (issue2.code === "invalid_union" && issue2.errors.length) {
1111
- issue2.errors.map((issues) => processError({ issues }, [...path67, ...issue2.path]));
1111
+ issue2.errors.map((issues) => processError({ issues }, [...path68, ...issue2.path]));
1112
1112
  } else if (issue2.code === "invalid_key") {
1113
- processError({ issues: issue2.issues }, [...path67, ...issue2.path]);
1113
+ processError({ issues: issue2.issues }, [...path68, ...issue2.path]);
1114
1114
  } else if (issue2.code === "invalid_element") {
1115
- processError({ issues: issue2.issues }, [...path67, ...issue2.path]);
1115
+ processError({ issues: issue2.issues }, [...path68, ...issue2.path]);
1116
1116
  } else {
1117
- const fullpath = [...path67, ...issue2.path];
1117
+ const fullpath = [...path68, ...issue2.path];
1118
1118
  if (fullpath.length === 0) {
1119
1119
  fieldErrors._errors.push(mapper(issue2));
1120
1120
  } else {
@@ -1153,17 +1153,17 @@ function formatError(error63, mapper = (issue2) => issue2.message) {
1153
1153
  }
1154
1154
  function treeifyError(error63, mapper = (issue2) => issue2.message) {
1155
1155
  const result = { errors: [] };
1156
- const processError = (error64, path67 = []) => {
1156
+ const processError = (error64, path68 = []) => {
1157
1157
  var _a4;
1158
1158
  for (const issue2 of error64.issues) {
1159
1159
  if (issue2.code === "invalid_union" && issue2.errors.length) {
1160
- issue2.errors.map((issues) => processError({ issues }, [...path67, ...issue2.path]));
1160
+ issue2.errors.map((issues) => processError({ issues }, [...path68, ...issue2.path]));
1161
1161
  } else if (issue2.code === "invalid_key") {
1162
- processError({ issues: issue2.issues }, [...path67, ...issue2.path]);
1162
+ processError({ issues: issue2.issues }, [...path68, ...issue2.path]);
1163
1163
  } else if (issue2.code === "invalid_element") {
1164
- processError({ issues: issue2.issues }, [...path67, ...issue2.path]);
1164
+ processError({ issues: issue2.issues }, [...path68, ...issue2.path]);
1165
1165
  } else {
1166
- const fullpath = [...path67, ...issue2.path];
1166
+ const fullpath = [...path68, ...issue2.path];
1167
1167
  if (fullpath.length === 0) {
1168
1168
  result.errors.push(mapper(issue2));
1169
1169
  continue;
@@ -1202,8 +1202,8 @@ function treeifyError(error63, mapper = (issue2) => issue2.message) {
1202
1202
  }
1203
1203
  function toDotPath(_path) {
1204
1204
  const segs = [];
1205
- const path67 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
1206
- for (const seg of path67) {
1205
+ const path68 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
1206
+ for (const seg of path68) {
1207
1207
  if (typeof seg === "number")
1208
1208
  segs.push(`[${seg}]`);
1209
1209
  else if (typeof seg === "symbol")
@@ -9041,8 +9041,8 @@ var capitalizeFirstCharacter, error33;
9041
9041
  var init_lt = __esm({
9042
9042
  "node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/lt.js"() {
9043
9043
  init_util();
9044
- capitalizeFirstCharacter = (text3) => {
9045
- return text3.charAt(0).toUpperCase() + text3.slice(1);
9044
+ capitalizeFirstCharacter = (text4) => {
9045
+ return text4.charAt(0).toUpperCase() + text4.slice(1);
9046
9046
  };
9047
9047
  error33 = () => {
9048
9048
  const Sizable = {
@@ -19199,13 +19199,13 @@ function resolveRef(ref, ctx) {
19199
19199
  if (!ref.startsWith("#")) {
19200
19200
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
19201
19201
  }
19202
- const path67 = ref.slice(1).split("/").filter(Boolean);
19203
- if (path67.length === 0) {
19202
+ const path68 = ref.slice(1).split("/").filter(Boolean);
19203
+ if (path68.length === 0) {
19204
19204
  return ctx.rootSchema;
19205
19205
  }
19206
19206
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
19207
- if (path67[0] === defsKey) {
19208
- const key = path67[1] === void 0 ? void 0 : decodeJSONPointerSegment(path67[1]);
19207
+ if (path68[0] === defsKey) {
19208
+ const key = path68[1] === void 0 ? void 0 : decodeJSONPointerSegment(path68[1]);
19209
19209
  if (!key || !ctx.defs[key]) {
19210
19210
  throw new Error(`Reference not found: ${ref}`);
19211
19211
  }
@@ -23712,42 +23712,42 @@ var require_defaults = __commonJS({
23712
23712
  var require_env_paths = __commonJS({
23713
23713
  "node_modules/.pnpm/env-paths@2.2.1/node_modules/env-paths/index.js"(exports2, module2) {
23714
23714
  "use strict";
23715
- var path67 = require("path");
23715
+ var path68 = require("path");
23716
23716
  var os14 = require("os");
23717
23717
  var homedir = os14.homedir();
23718
23718
  var tmpdir = os14.tmpdir();
23719
23719
  var { env } = process;
23720
23720
  var macos = (name) => {
23721
- const library = path67.join(homedir, "Library");
23721
+ const library = path68.join(homedir, "Library");
23722
23722
  return {
23723
- data: path67.join(library, "Application Support", name),
23724
- config: path67.join(library, "Preferences", name),
23725
- cache: path67.join(library, "Caches", name),
23726
- log: path67.join(library, "Logs", name),
23727
- temp: path67.join(tmpdir, name)
23723
+ data: path68.join(library, "Application Support", name),
23724
+ config: path68.join(library, "Preferences", name),
23725
+ cache: path68.join(library, "Caches", name),
23726
+ log: path68.join(library, "Logs", name),
23727
+ temp: path68.join(tmpdir, name)
23728
23728
  };
23729
23729
  };
23730
23730
  var windows = (name) => {
23731
- const appData = env.APPDATA || path67.join(homedir, "AppData", "Roaming");
23732
- const localAppData = env.LOCALAPPDATA || path67.join(homedir, "AppData", "Local");
23731
+ const appData = env.APPDATA || path68.join(homedir, "AppData", "Roaming");
23732
+ const localAppData = env.LOCALAPPDATA || path68.join(homedir, "AppData", "Local");
23733
23733
  return {
23734
23734
  // Data/config/cache/log are invented by me as Windows isn't opinionated about this
23735
- data: path67.join(localAppData, name, "Data"),
23736
- config: path67.join(appData, name, "Config"),
23737
- cache: path67.join(localAppData, name, "Cache"),
23738
- log: path67.join(localAppData, name, "Log"),
23739
- temp: path67.join(tmpdir, name)
23735
+ data: path68.join(localAppData, name, "Data"),
23736
+ config: path68.join(appData, name, "Config"),
23737
+ cache: path68.join(localAppData, name, "Cache"),
23738
+ log: path68.join(localAppData, name, "Log"),
23739
+ temp: path68.join(tmpdir, name)
23740
23740
  };
23741
23741
  };
23742
23742
  var linux = (name) => {
23743
- const username = path67.basename(homedir);
23743
+ const username = path68.basename(homedir);
23744
23744
  return {
23745
- data: path67.join(env.XDG_DATA_HOME || path67.join(homedir, ".local", "share"), name),
23746
- config: path67.join(env.XDG_CONFIG_HOME || path67.join(homedir, ".config"), name),
23747
- cache: path67.join(env.XDG_CACHE_HOME || path67.join(homedir, ".cache"), name),
23745
+ data: path68.join(env.XDG_DATA_HOME || path68.join(homedir, ".local", "share"), name),
23746
+ config: path68.join(env.XDG_CONFIG_HOME || path68.join(homedir, ".config"), name),
23747
+ cache: path68.join(env.XDG_CACHE_HOME || path68.join(homedir, ".cache"), name),
23748
23748
  // https://wiki.debian.org/XDGBaseDirectorySpecification#state
23749
- log: path67.join(env.XDG_STATE_HOME || path67.join(homedir, ".local", "state"), name),
23750
- temp: path67.join(tmpdir, username, name)
23749
+ log: path68.join(env.XDG_STATE_HOME || path68.join(homedir, ".local", "state"), name),
23750
+ temp: path68.join(tmpdir, username, name)
23751
23751
  };
23752
23752
  };
23753
23753
  var envPaths = (name, options) => {
@@ -23815,11 +23815,11 @@ var require_util = __commonJS({
23815
23815
  return result;
23816
23816
  }
23817
23817
  exports2.emplace = emplace;
23818
- function getPropertyByPath(source, path67) {
23819
- if (typeof path67 === "string" && Object.prototype.hasOwnProperty.call(source, path67)) {
23820
- return source[path67];
23818
+ function getPropertyByPath(source, path68) {
23819
+ if (typeof path68 === "string" && Object.prototype.hasOwnProperty.call(source, path68)) {
23820
+ return source[path68];
23821
23821
  }
23822
- const parsedPath = typeof path67 === "string" ? path67.split(".") : path67;
23822
+ const parsedPath = typeof path68 === "string" ? path68.split(".") : path68;
23823
23823
  return parsedPath.reduce((previous, key) => {
23824
23824
  if (previous === void 0) {
23825
23825
  return previous;
@@ -23842,9 +23842,9 @@ var require_util = __commonJS({
23842
23842
  return Object.fromEntries(Object.entries(options).filter(([, value2]) => value2 !== void 0));
23843
23843
  }
23844
23844
  exports2.removeUndefinedValuesFromObject = removeUndefinedValuesFromObject;
23845
- async function isDirectory(path67) {
23845
+ async function isDirectory(path68) {
23846
23846
  try {
23847
- const stat = await fs_1.promises.stat(path67);
23847
+ const stat = await fs_1.promises.stat(path68);
23848
23848
  return stat.isDirectory();
23849
23849
  } catch (e14) {
23850
23850
  if (e14.code === "ENOENT") {
@@ -23854,9 +23854,9 @@ var require_util = __commonJS({
23854
23854
  }
23855
23855
  }
23856
23856
  exports2.isDirectory = isDirectory;
23857
- function isDirectorySync(path67) {
23857
+ function isDirectorySync(path68) {
23858
23858
  try {
23859
- const stat = fs_1.default.statSync(path67);
23859
+ const stat = fs_1.default.statSync(path68);
23860
23860
  return stat.isDirectory();
23861
23861
  } catch (e14) {
23862
23862
  if (e14.code === "ENOENT") {
@@ -23954,7 +23954,7 @@ var require_ExplorerBase = __commonJS({
23954
23954
  const idx = importStack.indexOf(fullPath);
23955
23955
  if (idx !== -1) {
23956
23956
  throw new Error(`Circular import detected:
23957
- ${[...importStack, fullPath].map((path67, i10) => `${i10 + 1}. ${path67}`).join("\n")} (same as ${idx + 1}.)`);
23957
+ ${[...importStack, fullPath].map((path68, i10) => `${i10 + 1}. ${path68}`).join("\n")} (same as ${idx + 1}.)`);
23958
23958
  }
23959
23959
  }
23960
23960
  }
@@ -24142,9 +24142,9 @@ var require_Explorer = __commonJS({
24142
24142
  throw error63;
24143
24143
  }
24144
24144
  }
24145
- async #fileExists(path67) {
24145
+ async #fileExists(path68) {
24146
24146
  try {
24147
- await promises_1.default.stat(path67);
24147
+ await promises_1.default.stat(path68);
24148
24148
  return true;
24149
24149
  } catch (e14) {
24150
24150
  return false;
@@ -24304,9 +24304,9 @@ var require_ExplorerSync = __commonJS({
24304
24304
  throw error63;
24305
24305
  }
24306
24306
  }
24307
- #fileExists(path67) {
24307
+ #fileExists(path68) {
24308
24308
  try {
24309
- fs_1.default.statSync(path67);
24309
+ fs_1.default.statSync(path68);
24310
24310
  return true;
24311
24311
  } catch (e14) {
24312
24312
  return false;
@@ -24430,7 +24430,7 @@ var require_dist = __commonJS({
24430
24430
  };
24431
24431
  }
24432
24432
  function getResolvedSearchPlaces(moduleName, toolDefinedSearchPlaces, userConfiguredOptions) {
24433
- const userConfiguredSearchPlaces = userConfiguredOptions.searchPlaces?.map((path67) => path67.replace("{name}", moduleName));
24433
+ const userConfiguredSearchPlaces = userConfiguredOptions.searchPlaces?.map((path68) => path68.replace("{name}", moduleName));
24434
24434
  if (userConfiguredOptions.mergeSearchPlaces) {
24435
24435
  return [...userConfiguredSearchPlaces ?? [], ...toolDefinedSearchPlaces];
24436
24436
  }
@@ -24560,7 +24560,7 @@ function parseIgnoringUnrecognisedKeys(schema, raw) {
24560
24560
  return second.success ? { success: true, data: second.data, ignored } : { success: false, issues: second.error.issues };
24561
24561
  }
24562
24562
  function describeIgnoredKeys(filePath, ignored) {
24563
- const places = ignored.map(({ path: path67, keys }) => `${path67.length === 0 ? "" : `${path67.map(String).join(".")}.`}${keys.join(", ")}`);
24563
+ const places = ignored.map(({ path: path68, keys }) => `${path68.length === 0 ? "" : `${path68.map(String).join(".")}.`}${keys.join(", ")}`);
24564
24564
  return `${filePath} has settings this version of agent-shim does not know and ignores: ${places.join("; ")}. A newer release may read them.`;
24565
24565
  }
24566
24566
  function noteIgnoredKeys(filePath, ignored) {
@@ -24582,9 +24582,9 @@ function restoreIgnoredKeys(filePath, value2) {
24582
24582
  return value2;
24583
24583
  }
24584
24584
  const restored = structuredClone(value2);
24585
- for (const { path: path67, values } of ignored) {
24585
+ for (const { path: path68, values } of ignored) {
24586
24586
  let holder = restored;
24587
- for (const step2 of path67) {
24587
+ for (const step2 of path68) {
24588
24588
  holder = isRecord(holder) ? holder[step2] : void 0;
24589
24589
  }
24590
24590
  if (isRecord(holder)) {
@@ -25038,10 +25038,10 @@ var init_proxyBypass = __esm({
25038
25038
 
25039
25039
  // src/config/statusline.ts
25040
25040
  function distinctList(member) {
25041
- return external_exports.array(member).refine((items) => new Set(items).size === items.length, "must not repeat a segment");
25041
+ return external_exports.array(member).refine((items) => new Set(items).size === items.length, "must not repeat an entry");
25042
25042
  }
25043
- function isSingleVisibleGrapheme(text3) {
25044
- return [...GRAPHEMES.segment(text3)].length === 1 && !/[\p{C}\p{Z}]/u.test(text3);
25043
+ function isSingleVisibleGrapheme(text4) {
25044
+ return [...GRAPHEMES.segment(text4)].length === 1 && !/[\p{C}\p{Z}]/u.test(text4);
25045
25045
  }
25046
25046
  function isPlainObject2(value2) {
25047
25047
  return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
@@ -25063,12 +25063,12 @@ function resolveStatusline(settings2) {
25063
25063
  }
25064
25064
  return resolved;
25065
25065
  }
25066
- var STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, STATUSLINE_COLOUR_NAMES, DEFAULT_HEADER_SEGMENTS, DEFAULT_ROWS, STATUSLINE_PATH_LEVELS, MAX_PERCENT, MAX_STATUSLINE_PALETTE_INDEX, MAX_STATUSLINE_LABEL_CHARS, MAX_BAR_CELLS, LABEL_RE2, colourValue, GRAPHEMES, barCharacter, labelText, wholePercent, SHAPES, StatuslineSchema, ResolvedStatuslineSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
25066
+ var STATUSLINE_HEADER_SEGMENTS, STATUSLINE_ROWS, STATUSLINE_COLOUR_NAMES, DEFAULT_HEADER_SEGMENTS, DEFAULT_ROWS, STATUSLINE_PATH_LEVELS, MAX_PERCENT, MAX_STATUSLINE_PALETTE_INDEX, MAX_STATUSLINE_LABEL_CHARS, MAX_BAR_CELLS, MAX_ACCOUNT_USER_CHARS, MAX_DISPLAY_TEXT_CHARS, LABEL_RE2, OPTIONAL_LABEL_RE, colourValue, GRAPHEMES, barCharacter, labelText, overrideText, wholePercent, SHAPES, StatuslineSchema, ResolvedStatuslineSchema, STATUSLINE_DEFAULTS, STATUSLINE_ENV;
25067
25067
  var init_statusline = __esm({
25068
25068
  "src/config/statusline.ts"() {
25069
25069
  "use strict";
25070
25070
  init_zod();
25071
- STATUSLINE_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom", "project", "vcs"];
25071
+ STATUSLINE_HEADER_SEGMENTS = ["model", "provider", "route", "account", "identity", "headroom", "project", "vcs", "effort", "advisor", "version", "outputStyle"];
25072
25072
  STATUSLINE_ROWS = ["context", "quota", "addedDirs", "gitFiles"];
25073
25073
  STATUSLINE_COLOUR_NAMES = [
25074
25074
  "default",
@@ -25097,17 +25097,39 @@ var init_statusline = __esm({
25097
25097
  MAX_STATUSLINE_PALETTE_INDEX = 255;
25098
25098
  MAX_STATUSLINE_LABEL_CHARS = 12;
25099
25099
  MAX_BAR_CELLS = 40;
25100
+ MAX_ACCOUNT_USER_CHARS = 254;
25101
+ MAX_DISPLAY_TEXT_CHARS = 80;
25100
25102
  LABEL_RE2 = /^[^\p{C}\p{Z}]+(?: [^\p{C}\p{Z}]+)*$/u;
25103
+ OPTIONAL_LABEL_RE = /^(?:[^\p{C}\p{Z}]+(?: [^\p{C}\p{Z}]+)*)?$/u;
25101
25104
  colourValue = external_exports.union([external_exports.enum(STATUSLINE_COLOUR_NAMES), external_exports.number().int().min(0).max(MAX_STATUSLINE_PALETTE_INDEX), external_exports.string().regex(/^#[0-9a-fA-F]{6}$/, "must be a colour name, a palette index from 0 to 255 or #rrggbb")]);
25102
25105
  GRAPHEMES = new Intl.Segmenter(void 0, { granularity: "grapheme" });
25103
25106
  barCharacter = external_exports.string().refine(isSingleVisibleGrapheme, "must be a single visible character");
25104
25107
  labelText = external_exports.string().max(MAX_STATUSLINE_LABEL_CHARS).regex(LABEL_RE2, "must be visible text without control characters");
25108
+ overrideText = external_exports.string().max(MAX_DISPLAY_TEXT_CHARS).regex(OPTIONAL_LABEL_RE, "must be visible text without control characters");
25105
25109
  wholePercent = external_exports.number().int().min(1).max(MAX_PERCENT);
25106
25110
  SHAPES = {
25107
25111
  layout: {
25108
25112
  header: distinctList(external_exports.enum(STATUSLINE_HEADER_SEGMENTS)).describe("The header segments to draw, in drawing order; a segment left out is hidden, and an empty list hides the header."),
25109
25113
  rows: distinctList(external_exports.enum(STATUSLINE_ROWS)).describe("The rows to draw below the header, in drawing order; a row left out is hidden, and an empty list hides every row.")
25110
25114
  },
25115
+ model: {
25116
+ format: external_exports.enum(["full", "compact", "short"]).describe("How the model's name is written: full is the name as the client gives it, compact drops a context-window suffix such as (1M context), and short also drops a leading Claude."),
25117
+ override: overrideText.describe("A name to show in place of the client's own model name, whatever model is running; empty shows the model's own name. A dynamic mode's served model still follows it."),
25118
+ source: external_exports.enum(["client", "transcript", "auto"]).describe("Where the model's name comes from: client is the name the client reports, transcript is the model the session's last reply came from (what a proxy actually served), and auto uses the transcript's model only when it is not a Claude model, which is what a proxy redirect looks like.")
25119
+ },
25120
+ provider: {
25121
+ name: overrideText.describe("A label to show in place of the launch's provider name, or on its own when the launch has no provider; empty shows the provider's own name.")
25122
+ },
25123
+ account: {
25124
+ parts: distinctList(external_exports.enum(["user", "organisation", "plan"])).describe("What the account segment says about the login account, in drawing order: the account's email address, its organisation (shown for team and enterprise accounts) and its plan. A part left out is hidden, and an empty list hides the segment."),
25125
+ userLength: external_exports.number().int().min(0).max(MAX_ACCOUNT_USER_CHARS).describe("The most characters of the account's email address to show, with an ellipsis after a cut one; 0 shows all of it.")
25126
+ },
25127
+ effort: {
25128
+ format: external_exports.enum(["full", "symbol", "text"]).describe("How the reasoning effort is written: full is a symbol and the level (a filled circle that grows with the level, then the name), symbol is the symbol alone, and text is the level's name alone. A level with no symbol is always written as its name.")
25129
+ },
25130
+ advisor: {
25131
+ override: overrideText.describe("A name to show for the advisor model in place of the one the session's transcript records; empty shows the transcript's, prettified.")
25132
+ },
25111
25133
  bands: {
25112
25134
  warnAt: wholePercent.describe("The whole percentage of use at which a bar turns yellow; it must be below criticalAt."),
25113
25135
  criticalAt: wholePercent.describe("The whole percentage of use at which a bar turns red.")
@@ -25155,6 +25177,11 @@ var init_statusline = __esm({
25155
25177
  };
25156
25178
  StatuslineSchema = external_exports.strictObject({
25157
25179
  layout: external_exports.strictObject(SHAPES.layout).partial().optional(),
25180
+ model: external_exports.strictObject(SHAPES.model).partial().optional(),
25181
+ provider: external_exports.strictObject(SHAPES.provider).partial().optional(),
25182
+ account: external_exports.strictObject(SHAPES.account).partial().optional(),
25183
+ effort: external_exports.strictObject(SHAPES.effort).partial().optional(),
25184
+ advisor: external_exports.strictObject(SHAPES.advisor).partial().optional(),
25158
25185
  bands: external_exports.strictObject(SHAPES.bands).partial().optional(),
25159
25186
  labels: external_exports.strictObject(SHAPES.labels).partial().optional(),
25160
25187
  bar: external_exports.strictObject(SHAPES.bar).partial().optional(),
@@ -25165,6 +25192,11 @@ var init_statusline = __esm({
25165
25192
  });
25166
25193
  ResolvedStatuslineSchema = external_exports.strictObject({
25167
25194
  layout: external_exports.strictObject(SHAPES.layout),
25195
+ model: external_exports.strictObject(SHAPES.model),
25196
+ provider: external_exports.strictObject(SHAPES.provider),
25197
+ account: external_exports.strictObject(SHAPES.account),
25198
+ effort: external_exports.strictObject(SHAPES.effort),
25199
+ advisor: external_exports.strictObject(SHAPES.advisor),
25168
25200
  bands: external_exports.strictObject(SHAPES.bands),
25169
25201
  labels: external_exports.strictObject(SHAPES.labels),
25170
25202
  bar: external_exports.strictObject(SHAPES.bar),
@@ -25175,6 +25207,11 @@ var init_statusline = __esm({
25175
25207
  });
25176
25208
  STATUSLINE_DEFAULTS = {
25177
25209
  layout: { header: [...DEFAULT_HEADER_SEGMENTS], rows: [...DEFAULT_ROWS] },
25210
+ model: { format: "full", override: "", source: "client" },
25211
+ provider: { name: "" },
25212
+ account: { parts: ["user", "organisation", "plan"], userLength: 0 },
25213
+ effort: { format: "full" },
25214
+ advisor: { override: "" },
25178
25215
  bands: { warnAt: 70, criticalAt: 90 },
25179
25216
  labels: { fiveHour: "5h", sevenDay: "Wk" },
25180
25217
  bar: { width: 10, filled: "\u2588", empty: "\u2591" },
@@ -28281,8 +28318,8 @@ function redactHeaders(headers) {
28281
28318
  }
28282
28319
  return result;
28283
28320
  }
28284
- function redactText(text3) {
28285
- return SECRET_BODY_PATTERNS.reduce((accumulated, { pattern, replacement }) => accumulated.replace(pattern, replacement), text3);
28321
+ function redactText(text4) {
28322
+ return SECRET_BODY_PATTERNS.reduce((accumulated, { pattern, replacement }) => accumulated.replace(pattern, replacement), text4);
28286
28323
  }
28287
28324
  function redactJsonValue(value2) {
28288
28325
  if (typeof value2 === "string") {
@@ -28297,12 +28334,12 @@ function redactJsonValue(value2) {
28297
28334
  return value2;
28298
28335
  }
28299
28336
  function redactBody(chunk2) {
28300
- const text3 = chunk2.toString("utf8");
28337
+ const text4 = chunk2.toString("utf8");
28301
28338
  try {
28302
- const parsed = JSON.parse(text3);
28339
+ const parsed = JSON.parse(text4);
28303
28340
  return JSON.stringify(redactJsonValue(parsed));
28304
28341
  } catch {
28305
- return redactText(text3);
28342
+ return redactText(text4);
28306
28343
  }
28307
28344
  }
28308
28345
  function captureFromEnv(env, logsDir) {
@@ -28337,8 +28374,8 @@ function createFileCapture(file2, now = () => /* @__PURE__ */ new Date()) {
28337
28374
  }
28338
28375
  const excerpt2 = chunk2.subarray(0, Math.min(CHUNK_LOG_CAP_BYTES, budget));
28339
28376
  stored[direction] += excerpt2.length;
28340
- const text3 = excerpt2.toString("utf8");
28341
- const faithful = Buffer.from(text3, "utf8").equals(excerpt2);
28377
+ const text4 = excerpt2.toString("utf8");
28378
+ const faithful = Buffer.from(text4, "utf8").equals(excerpt2);
28342
28379
  append({
28343
28380
  kind: "stream-chunk",
28344
28381
  id: id2,
@@ -28347,7 +28384,7 @@ function createFileCapture(file2, now = () => /* @__PURE__ */ new Date()) {
28347
28384
  bytes: chunk2.length,
28348
28385
  stored: excerpt2.length,
28349
28386
  truncated: excerpt2.length < chunk2.length,
28350
- ...faithful ? { body: redactText(text3) } : { b64: excerpt2.toString("base64") }
28387
+ ...faithful ? { body: redactText(text4) } : { b64: excerpt2.toString("base64") }
28351
28388
  });
28352
28389
  },
28353
28390
  onEnd: () => {
@@ -29031,8 +29068,8 @@ var init_report = __esm({
29031
29068
  });
29032
29069
 
29033
29070
  // src/logStyle.ts
29034
- function styledDiagnostic(style, colour, text3) {
29035
- return text3.split("\n").map((line, index) => {
29071
+ function styledDiagnostic(style, colour, text4) {
29072
+ return text4.split("\n").map((line, index) => {
29036
29073
  const lead = index === 0 ? DIAGNOSTIC_LEAD.exec(line) : null;
29037
29074
  if (lead === null) {
29038
29075
  return style([colour], line);
@@ -29060,7 +29097,7 @@ function createLogPort(sinks, styleFor) {
29060
29097
  };
29061
29098
  }
29062
29099
  function styleTextFor(stream) {
29063
- return (formats, text3) => (0, import_node_util3.styleText)([...formats], text3, { stream });
29100
+ return (formats, text4) => (0, import_node_util3.styleText)([...formats], text4, { stream });
29064
29101
  }
29065
29102
  var import_node_util3, DIAGNOSTIC_LEAD;
29066
29103
  var init_logStyle = __esm({
@@ -30204,8 +30241,8 @@ var require_utils = __commonJS({
30204
30241
  }
30205
30242
  return output2;
30206
30243
  };
30207
- exports2.basename = (path67, { windows } = {}) => {
30208
- const segs = path67.split(windows ? /[\\/]/ : "/");
30244
+ exports2.basename = (path68, { windows } = {}) => {
30245
+ const segs = path68.split(windows ? /[\\/]/ : "/");
30209
30246
  const last = segs[segs.length - 1];
30210
30247
  if (last === "") {
30211
30248
  return segs[segs.length - 2];
@@ -31970,9 +32007,9 @@ var init_identity = __esm({
31970
32007
  });
31971
32008
 
31972
32009
  // src/statusline/keys.ts
31973
- function valueAt(source, path67) {
32010
+ function valueAt(source, path68) {
31974
32011
  let current = source;
31975
- for (const part of path67) {
32012
+ for (const part of path68) {
31976
32013
  if (!isPlainObject2(current)) {
31977
32014
  return void 0;
31978
32015
  }
@@ -31980,8 +32017,8 @@ function valueAt(source, path67) {
31980
32017
  }
31981
32018
  return current;
31982
32019
  }
31983
- function keyOf(path67, leaf) {
31984
- const common = { path: path67.join("."), description: leaf.description ?? "", defaultValue: valueAt(STATUSLINE_DEFAULTS, path67) };
32020
+ function keyOf(path68, leaf) {
32021
+ const common = { path: path68.join("."), description: leaf.description ?? "", defaultValue: valueAt(STATUSLINE_DEFAULTS, path68) };
31985
32022
  if (leaf instanceof external_exports.ZodNumber) {
31986
32023
  return { ...common, kind: "integer", choices: [] };
31987
32024
  }
@@ -32000,7 +32037,7 @@ function keyOf(path67, leaf) {
32000
32037
  if (leaf instanceof external_exports.ZodArray && leaf.element instanceof external_exports.ZodEnum) {
32001
32038
  return { ...common, kind: "list", choices: Object.values(leaf.element.enum).map(String) };
32002
32039
  }
32003
- throw new TypeError(`statusline setting ${path67.join(".")} has a kind the key listing does not describe`);
32040
+ throw new TypeError(`statusline setting ${path68.join(".")} has a kind the key listing does not describe`);
32004
32041
  }
32005
32042
  function walk(shape, prefix) {
32006
32043
  return Object.entries(shape).flatMap(([name, schema]) => schema instanceof external_exports.ZodObject ? walk(schema.shape, [...prefix, name]) : [keyOf([...prefix, name], schema)]);
@@ -32024,47 +32061,47 @@ var init_keys = __esm({
32024
32061
  });
32025
32062
 
32026
32063
  // src/statusline/change.ts
32027
- function keyNamed(path67) {
32028
- const found = statuslineKeys().find((key) => key.path === path67);
32064
+ function keyNamed(path68) {
32065
+ const found = statuslineKeys().find((key) => key.path === path68);
32029
32066
  if (found === void 0) {
32030
- throw new UsageError(`"${path67}" is not a statusline setting; \`agent-shim statusline keys\` lists them.`);
32067
+ throw new UsageError(`"${path68}" is not a statusline setting; \`agent-shim statusline keys\` lists them.`);
32031
32068
  }
32032
32069
  return found;
32033
32070
  }
32034
- function parseStatuslineAssignment(text3) {
32035
- const split = text3.indexOf("=");
32071
+ function parseStatuslineAssignment(text4) {
32072
+ const split = text4.indexOf("=");
32036
32073
  if (split < 1) {
32037
- throw new UsageError(`"${text3}" is not <setting>=<value>.`);
32074
+ throw new UsageError(`"${text4}" is not <setting>=<value>.`);
32038
32075
  }
32039
- const path67 = text3.slice(0, split);
32040
- const raw = text3.slice(split + 1);
32041
- const key = keyNamed(path67);
32076
+ const path68 = text4.slice(0, split);
32077
+ const raw = text4.slice(split + 1);
32078
+ const key = keyNamed(path68);
32042
32079
  switch (key.kind) {
32043
32080
  case "integer": {
32044
32081
  const number5 = Number(raw);
32045
32082
  if (raw.trim() === "" || !Number.isFinite(number5)) {
32046
- throw new UsageError(`${path67}: "${raw}" is not a number.`);
32083
+ throw new UsageError(`${path68}: "${raw}" is not a number.`);
32047
32084
  }
32048
- return { path: path67, value: number5 };
32085
+ return { path: path68, value: number5 };
32049
32086
  }
32050
32087
  case "boolean":
32051
32088
  if (raw !== "true" && raw !== "false") {
32052
- throw new UsageError(`${path67}: "${raw}" is not true or false.`);
32089
+ throw new UsageError(`${path68}: "${raw}" is not true or false.`);
32053
32090
  }
32054
- return { path: path67, value: raw === "true" };
32091
+ return { path: path68, value: raw === "true" };
32055
32092
  case "text":
32056
32093
  case "choice":
32057
- return { path: path67, value: raw };
32094
+ return { path: path68, value: raw };
32058
32095
  case "colour":
32059
- return { path: path67, value: /^\d+$/.test(raw) ? Number(raw) : raw };
32096
+ return { path: path68, value: /^\d+$/.test(raw) ? Number(raw) : raw };
32060
32097
  case "list":
32061
- return { path: path67, value: raw === "" ? [] : raw.split(",") };
32098
+ return { path: path68, value: raw === "" ? [] : raw.split(",") };
32062
32099
  default:
32063
32100
  return key.kind;
32064
32101
  }
32065
32102
  }
32066
- function setAt(target, path67, value2) {
32067
- const [head, ...rest] = path67;
32103
+ function setAt(target, path68, value2) {
32104
+ const [head, ...rest] = path68;
32068
32105
  if (head === void 0) {
32069
32106
  return;
32070
32107
  }
@@ -32077,8 +32114,8 @@ function setAt(target, path67, value2) {
32077
32114
  target[head] = next;
32078
32115
  setAt(next, rest, value2);
32079
32116
  }
32080
- function removeAt(target, path67) {
32081
- const [head, ...rest] = path67;
32117
+ function removeAt(target, path68) {
32118
+ const [head, ...rest] = path68;
32082
32119
  if (head === void 0) {
32083
32120
  return;
32084
32121
  }
@@ -32096,13 +32133,13 @@ function removeAt(target, path67) {
32096
32133
  }
32097
32134
  function applyStatuslineChange(existing, change) {
32098
32135
  const draft = structuredClone(existing ?? {});
32099
- for (const [path67, value2] of Object.entries(change.set ?? {})) {
32100
- keyNamed(path67);
32101
- setAt(draft, path67.split("."), value2);
32136
+ for (const [path68, value2] of Object.entries(change.set ?? {})) {
32137
+ keyNamed(path68);
32138
+ setAt(draft, path68.split("."), value2);
32102
32139
  }
32103
- for (const path67 of change.unset ?? []) {
32104
- keyNamed(path67);
32105
- removeAt(draft, path67.split("."));
32140
+ for (const path68 of change.unset ?? []) {
32141
+ keyNamed(path68);
32142
+ removeAt(draft, path68.split("."));
32106
32143
  }
32107
32144
  const result = StatuslineSchema.safeParse(draft);
32108
32145
  if (!result.success) {
@@ -35161,7 +35198,7 @@ function keyUsageExtension(bits) {
35161
35198
  }
35162
35199
  function ipv6Groups(address) {
35163
35200
  const [head = "", tail] = address.split("::");
35164
- const split = (text3) => text3 === "" ? [] : text3.split(":");
35201
+ const split = (text4) => text4 === "" ? [] : text4.split(":");
35165
35202
  const expand = (groups) => groups.flatMap((group) => {
35166
35203
  if (!import_node_net.default.isIPv4(group)) {
35167
35204
  return [Number.parseInt(group, HEX_RADIX)];
@@ -35495,11 +35532,11 @@ function identifyRequest(headers) {
35495
35532
  function directOrigin2(port) {
35496
35533
  return `http://127.0.0.1:${String(port)}`;
35497
35534
  }
35498
- function parseProviderPath(path67) {
35499
- if (!path67.startsWith(PROVIDER_PATH_PREFIX)) {
35535
+ function parseProviderPath(path68) {
35536
+ if (!path68.startsWith(PROVIDER_PATH_PREFIX)) {
35500
35537
  return void 0;
35501
35538
  }
35502
- const tail = path67.slice(PROVIDER_PATH_PREFIX.length);
35539
+ const tail = path68.slice(PROVIDER_PATH_PREFIX.length);
35503
35540
  const slash = tail.indexOf("/");
35504
35541
  if (slash <= 0) {
35505
35542
  return void 0;
@@ -35772,8 +35809,8 @@ function parseConnectTarget(authority) {
35772
35809
  }
35773
35810
  return { host, port };
35774
35811
  }
35775
- function servedByPipeline(path67) {
35776
- return path67?.startsWith(ROUTED_PATH_PREFIX) === true;
35812
+ function servedByPipeline(path68) {
35813
+ return path68?.startsWith(ROUTED_PATH_PREFIX) === true;
35777
35814
  }
35778
35815
  function forwardableHeaders(headers) {
35779
35816
  const connectionTokens = new Set(
@@ -36251,7 +36288,7 @@ var init_package = __esm({
36251
36288
  "package.json"() {
36252
36289
  package_default = {
36253
36290
  name: "claude-use",
36254
- version: "11.53.0",
36291
+ version: "11.54.0",
36255
36292
  description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
36256
36293
  license: "MIT",
36257
36294
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -36515,9 +36552,9 @@ function errorInfo(raw) {
36515
36552
  function isObject3(value2) {
36516
36553
  return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
36517
36554
  }
36518
- function parseJson2(text3) {
36555
+ function parseJson2(text4) {
36519
36556
  try {
36520
- const parsed = JSON.parse(text3);
36557
+ const parsed = JSON.parse(text4);
36521
36558
  return parsed;
36522
36559
  } catch {
36523
36560
  return void 0;
@@ -36565,26 +36602,26 @@ function createSseScanner() {
36565
36602
  return void 0;
36566
36603
  };
36567
36604
  const completeLine = (complete) => {
36568
- const text3 = complete.endsWith("\r") ? complete.slice(0, -1) : complete;
36569
- if (text3 === "") {
36605
+ const text4 = complete.endsWith("\r") ? complete.slice(0, -1) : complete;
36606
+ if (text4 === "") {
36570
36607
  dispatch();
36571
36608
  return;
36572
36609
  }
36573
- if (text3.startsWith("event:")) {
36574
- eventName = text3.slice("event:".length).trim();
36610
+ if (text4.startsWith("event:")) {
36611
+ eventName = text4.slice("event:".length).trim();
36575
36612
  return;
36576
36613
  }
36577
- if (text3.startsWith("data:")) {
36578
- const value2 = text3.slice("data:".length);
36614
+ if (text4.startsWith("data:")) {
36615
+ const value2 = text4.slice("data:".length);
36579
36616
  data.push(value2.startsWith(" ") ? value2.slice(1) : value2);
36580
36617
  }
36581
36618
  };
36582
36619
  return {
36583
- push: (text3) => {
36620
+ push: (text4) => {
36584
36621
  let start = 0;
36585
36622
  for (; ; ) {
36586
- const newline = text3.indexOf("\n", start);
36587
- const piece = newline === -1 ? text3.slice(start) : text3.slice(start, newline);
36623
+ const newline = text4.indexOf("\n", start);
36624
+ const piece = newline === -1 ? text4.slice(start) : text4.slice(start, newline);
36588
36625
  if (!skipping) {
36589
36626
  line += piece;
36590
36627
  if (worthKeeping(line) === false) {
@@ -36698,8 +36735,8 @@ function createJsonScanner() {
36698
36735
  }
36699
36736
  };
36700
36737
  return {
36701
- push: (text3) => {
36702
- for (const char of text3) {
36738
+ push: (text4) => {
36739
+ for (const char of text4) {
36703
36740
  step2(char);
36704
36741
  }
36705
36742
  },
@@ -36773,12 +36810,12 @@ function decoderFor(encoding) {
36773
36810
  return void 0;
36774
36811
  }
36775
36812
  }
36776
- function destinationOf(path67, sessionProvider) {
36777
- const scoped = parseProviderPath(path67);
36813
+ function destinationOf(path68, sessionProvider) {
36814
+ const scoped = parseProviderPath(path68);
36778
36815
  if (scoped !== void 0) {
36779
36816
  return { provider: scoped.provider, endpoint: scoped.rest };
36780
36817
  }
36781
- return { provider: sessionProvider ?? ANTHROPIC_PROVIDER, endpoint: path67 };
36818
+ return { provider: sessionProvider ?? ANTHROPIC_PROVIDER, endpoint: path68 };
36782
36819
  }
36783
36820
  function modelChoiceOf(event, servedModel, provider) {
36784
36821
  if (event.modelChoice !== void 0) return event.modelChoice;
@@ -36826,13 +36863,13 @@ function createUsageMiddleware(deps) {
36826
36863
  const scanner = scannerFor(event.headers);
36827
36864
  const decoder = scanner === void 0 ? null : decoderFor(headerValue(event.headers, "content-encoding"));
36828
36865
  let scanning = scanner !== void 0 && decoder !== void 0;
36829
- const text3 = new TextDecoder();
36866
+ const text4 = new TextDecoder();
36830
36867
  const feed = (bytes, final) => {
36831
36868
  if (!scanning || scanner === void 0) {
36832
36869
  return;
36833
36870
  }
36834
36871
  try {
36835
- scanner.push(text3.decode(bytes, { stream: !final }));
36872
+ scanner.push(text4.decode(bytes, { stream: !final }));
36836
36873
  } catch (error63) {
36837
36874
  scanning = false;
36838
36875
  deps.log(`usage: body scan failed for ${event.route}: ${error63 instanceof Error ? error63.message : String(error63)}`);
@@ -38007,9 +38044,9 @@ function buildFamilies(refs, models) {
38007
38044
  const groups = [];
38008
38045
  for (const ref of refs) {
38009
38046
  const pinnedKey = Object.entries(settingsByKey).find(([, settings2]) => pinnedTo(settings2, ref))?.[0];
38010
- const joined2 = groups.find((group) => pinnedKey === void 0 ? group.refs.some((first) => sameModel(first, ref, assertions)) : group.key === pinnedKey);
38011
- if (joined2 !== void 0) {
38012
- joined2.refs.push(ref);
38047
+ const joined3 = groups.find((group) => pinnedKey === void 0 ? group.refs.some((first) => sameModel(first, ref, assertions)) : group.key === pinnedKey);
38048
+ if (joined3 !== void 0) {
38049
+ joined3.refs.push(ref);
38013
38050
  } else {
38014
38051
  groups.push({ key: pinnedKey ?? familyKeyOf(modelOf(ref)), refs: [ref] });
38015
38052
  }
@@ -39748,14 +39785,14 @@ var require_util2 = __commonJS({
39748
39785
  }
39749
39786
  const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
39750
39787
  let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`;
39751
- let path67 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
39788
+ let path68 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
39752
39789
  if (origin[origin.length - 1] === "/") {
39753
39790
  origin = origin.slice(0, origin.length - 1);
39754
39791
  }
39755
- if (path67 && path67[0] !== "/") {
39756
- path67 = `/${path67}`;
39792
+ if (path68 && path68[0] !== "/") {
39793
+ path68 = `/${path68}`;
39757
39794
  }
39758
- return new URL(`${origin}${path67}`);
39795
+ return new URL(`${origin}${path68}`);
39759
39796
  }
39760
39797
  if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) {
39761
39798
  throw new InvalidArgumentError2("Invalid URL protocol: the URL must start with `http:` or `https:`.");
@@ -40576,9 +40613,9 @@ var require_diagnostics = __commonJS({
40576
40613
  "undici:client:sendHeaders",
40577
40614
  (evt) => {
40578
40615
  const {
40579
- request: { method, path: path67, origin }
40616
+ request: { method, path: path68, origin }
40580
40617
  } = evt;
40581
- debugLog("sending request to %s %s%s", method, origin, path67);
40618
+ debugLog("sending request to %s %s%s", method, origin, path68);
40582
40619
  }
40583
40620
  );
40584
40621
  }
@@ -40596,14 +40633,14 @@ var require_diagnostics = __commonJS({
40596
40633
  "undici:request:headers",
40597
40634
  (evt) => {
40598
40635
  const {
40599
- request: { method, path: path67, origin },
40636
+ request: { method, path: path68, origin },
40600
40637
  response: { statusCode }
40601
40638
  } = evt;
40602
40639
  debugLog(
40603
40640
  "received response to %s %s%s - HTTP %d",
40604
40641
  method,
40605
40642
  origin,
40606
- path67,
40643
+ path68,
40607
40644
  statusCode
40608
40645
  );
40609
40646
  }
@@ -40612,23 +40649,23 @@ var require_diagnostics = __commonJS({
40612
40649
  "undici:request:trailers",
40613
40650
  (evt) => {
40614
40651
  const {
40615
- request: { method, path: path67, origin }
40652
+ request: { method, path: path68, origin }
40616
40653
  } = evt;
40617
- debugLog("trailers received from %s %s%s", method, origin, path67);
40654
+ debugLog("trailers received from %s %s%s", method, origin, path68);
40618
40655
  }
40619
40656
  );
40620
40657
  diagnosticsChannel.subscribe(
40621
40658
  "undici:request:error",
40622
40659
  (evt) => {
40623
40660
  const {
40624
- request: { method, path: path67, origin },
40661
+ request: { method, path: path68, origin },
40625
40662
  error: error63
40626
40663
  } = evt;
40627
40664
  debugLog(
40628
40665
  "request to %s %s%s errored - %s",
40629
40666
  method,
40630
40667
  origin,
40631
- path67,
40668
+ path68,
40632
40669
  error63.message
40633
40670
  );
40634
40671
  }
@@ -40743,7 +40780,7 @@ var require_request = __commonJS({
40743
40780
  var kHandler = /* @__PURE__ */ Symbol("handler");
40744
40781
  var Request2 = class {
40745
40782
  constructor(origin, {
40746
- path: path67,
40783
+ path: path68,
40747
40784
  method,
40748
40785
  body,
40749
40786
  headers,
@@ -40760,11 +40797,11 @@ var require_request = __commonJS({
40760
40797
  maxRedirections,
40761
40798
  typeOfService
40762
40799
  }, handler) {
40763
- if (typeof path67 !== "string") {
40800
+ if (typeof path68 !== "string") {
40764
40801
  throw new InvalidArgumentError2("path must be a string");
40765
- } else if (path67[0] !== "/" && !(path67.startsWith("http://") || path67.startsWith("https://")) && method !== "CONNECT") {
40802
+ } else if (path68[0] !== "/" && !(path68.startsWith("http://") || path68.startsWith("https://")) && method !== "CONNECT") {
40766
40803
  throw new InvalidArgumentError2("path must be an absolute URL or start with a slash");
40767
- } else if (invalidPathRegex.test(path67)) {
40804
+ } else if (invalidPathRegex.test(path68)) {
40768
40805
  throw new InvalidArgumentError2("invalid request path");
40769
40806
  }
40770
40807
  if (typeof method !== "string") {
@@ -40839,7 +40876,7 @@ var require_request = __commonJS({
40839
40876
  this.completed = false;
40840
40877
  this.aborted = false;
40841
40878
  this.upgrade = upgrade || null;
40842
- this.path = query ? serializePathWithQuery(path67, query) : path67;
40879
+ this.path = query ? serializePathWithQuery(path68, query) : path68;
40843
40880
  this.origin = origin;
40844
40881
  this.protocol = getProtocolFromUrlString(origin);
40845
40882
  this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
@@ -46021,7 +46058,7 @@ var require_client_h1 = __commonJS({
46021
46058
  return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
46022
46059
  }
46023
46060
  function writeH1(client, request7) {
46024
- const { method, path: path67, host, upgrade, blocking, reset } = request7;
46061
+ const { method, path: path68, host, upgrade, blocking, reset } = request7;
46025
46062
  let { body, headers, contentLength } = request7;
46026
46063
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
46027
46064
  if (util2.isFormDataLike(body)) {
@@ -46099,7 +46136,7 @@ var require_client_h1 = __commonJS({
46099
46136
  if (socket.setTypeOfService) {
46100
46137
  socket.setTypeOfService(request7.typeOfService);
46101
46138
  }
46102
- let header = `${method} ${path67} HTTP/1.1\r
46139
+ let header = `${method} ${path68} HTTP/1.1\r
46103
46140
  `;
46104
46141
  if (typeof host === "string") {
46105
46142
  header += `host: ${host}\r
@@ -46778,7 +46815,7 @@ var require_client_h2 = __commonJS({
46778
46815
  const headersTimeout = request7.headersTimeout ?? client[kHeadersTimeout];
46779
46816
  const bodyTimeout = request7.bodyTimeout ?? client[kBodyTimeout];
46780
46817
  const session = client[kHTTP2Session];
46781
- const { method, path: path67, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request7;
46818
+ const { method, path: path68, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request7;
46782
46819
  let { body } = request7;
46783
46820
  if (upgrade != null && upgrade !== "websocket") {
46784
46821
  util2.errorRequest(client, request7, new InvalidArgumentError2(`Custom upgrade "${upgrade}" not supported over HTTP/2`));
@@ -46847,7 +46884,7 @@ var require_client_h2 = __commonJS({
46847
46884
  }
46848
46885
  headers[HTTP2_HEADER_METHOD] = "CONNECT";
46849
46886
  headers[HTTP2_HEADER_PROTOCOL] = "websocket";
46850
- headers[HTTP2_HEADER_PATH] = path67;
46887
+ headers[HTTP2_HEADER_PATH] = path68;
46851
46888
  if (protocol === "ws:" || protocol === "wss:") {
46852
46889
  headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
46853
46890
  } else {
@@ -46889,7 +46926,7 @@ var require_client_h2 = __commonJS({
46889
46926
  stream.setTimeout(headersTimeout);
46890
46927
  return true;
46891
46928
  }
46892
- headers[HTTP2_HEADER_PATH] = path67;
46929
+ headers[HTTP2_HEADER_PATH] = path68;
46893
46930
  headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
46894
46931
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
46895
46932
  if (body && typeof body.read === "function") {
@@ -49241,10 +49278,10 @@ var require_proxy_agent = __commonJS({
49241
49278
  };
49242
49279
  const {
49243
49280
  origin,
49244
- path: path67 = "/",
49281
+ path: path68 = "/",
49245
49282
  headers = {}
49246
49283
  } = opts;
49247
- opts.path = origin + path67;
49284
+ opts.path = origin + path68;
49248
49285
  if (!("host" in headers) && !("Host" in headers)) {
49249
49286
  const { host } = new URL(origin);
49250
49287
  headers.host = host;
@@ -51353,20 +51390,20 @@ var require_mock_utils = __commonJS({
51353
51390
  }
51354
51391
  return normalizedQp;
51355
51392
  }
51356
- function safeUrl(path67) {
51357
- if (typeof path67 !== "string") {
51358
- return path67;
51393
+ function safeUrl(path68) {
51394
+ if (typeof path68 !== "string") {
51395
+ return path68;
51359
51396
  }
51360
- const pathSegments = path67.split("?", 3);
51397
+ const pathSegments = path68.split("?", 3);
51361
51398
  if (pathSegments.length !== 2) {
51362
- return path67;
51399
+ return path68;
51363
51400
  }
51364
51401
  const qp2 = new URLSearchParams(pathSegments.pop());
51365
51402
  qp2.sort();
51366
51403
  return [...pathSegments, qp2.toString()].join("?");
51367
51404
  }
51368
- function matchKey(mockDispatch2, { path: path67, method, body, headers }) {
51369
- const pathMatch = matchValue(mockDispatch2.path, path67);
51405
+ function matchKey(mockDispatch2, { path: path68, method, body, headers }) {
51406
+ const pathMatch = matchValue(mockDispatch2.path, path68);
51370
51407
  const methodMatch = matchValue(mockDispatch2.method, method);
51371
51408
  const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
51372
51409
  const headersMatch = matchHeaders(mockDispatch2, headers);
@@ -51391,8 +51428,8 @@ var require_mock_utils = __commonJS({
51391
51428
  const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
51392
51429
  const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
51393
51430
  const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
51394
- let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path67, ignoreTrailingSlash }) => {
51395
- return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path67)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path67), resolvedPath);
51431
+ let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path68, ignoreTrailingSlash }) => {
51432
+ return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path68)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path68), resolvedPath);
51396
51433
  });
51397
51434
  if (matchedMockDispatches.length === 0) {
51398
51435
  throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
@@ -51431,19 +51468,19 @@ var require_mock_utils = __commonJS({
51431
51468
  mockDispatches.splice(index, 1);
51432
51469
  }
51433
51470
  }
51434
- function removeTrailingSlash(path67) {
51435
- while (path67.endsWith("/")) {
51436
- path67 = path67.slice(0, -1);
51471
+ function removeTrailingSlash(path68) {
51472
+ while (path68.endsWith("/")) {
51473
+ path68 = path68.slice(0, -1);
51437
51474
  }
51438
- if (path67.length === 0) {
51439
- path67 = "/";
51475
+ if (path68.length === 0) {
51476
+ path68 = "/";
51440
51477
  }
51441
- return path67;
51478
+ return path68;
51442
51479
  }
51443
51480
  function buildKey(opts) {
51444
- const { path: path67, method, body, headers, query } = opts;
51481
+ const { path: path68, method, body, headers, query } = opts;
51445
51482
  return {
51446
- path: path67,
51483
+ path: path68,
51447
51484
  method,
51448
51485
  body,
51449
51486
  headers,
@@ -52133,10 +52170,10 @@ var require_pending_interceptors_formatter = __commonJS({
52133
52170
  }
52134
52171
  format(pendingInterceptors) {
52135
52172
  const withPrettyHeaders = pendingInterceptors.map(
52136
- ({ method, path: path67, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
52173
+ ({ method, path: path68, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
52137
52174
  Method: method,
52138
52175
  Origin: origin,
52139
- Path: path67,
52176
+ Path: path68,
52140
52177
  "Status code": statusCode,
52141
52178
  Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
52142
52179
  Invocations: timesInvoked,
@@ -52218,9 +52255,9 @@ var require_mock_agent = __commonJS({
52218
52255
  const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
52219
52256
  const dispatchOpts = { ...opts };
52220
52257
  if (acceptNonStandardSearchParameters && dispatchOpts.path) {
52221
- const [path67, searchParams] = dispatchOpts.path.split("?");
52258
+ const [path68, searchParams] = dispatchOpts.path.split("?");
52222
52259
  const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
52223
- dispatchOpts.path = `${path67}?${normalizedSearchParams}`;
52260
+ dispatchOpts.path = `${path68}?${normalizedSearchParams}`;
52224
52261
  }
52225
52262
  return this[kAgent].dispatch(dispatchOpts, handler);
52226
52263
  }
@@ -52621,12 +52658,12 @@ var require_snapshot_recorder = __commonJS({
52621
52658
  * @return {Promise<void>} - Resolves when snapshots are loaded
52622
52659
  */
52623
52660
  async loadSnapshots(filePath) {
52624
- const path67 = filePath || this.#snapshotPath;
52625
- if (!path67) {
52661
+ const path68 = filePath || this.#snapshotPath;
52662
+ if (!path68) {
52626
52663
  throw new InvalidArgumentError2("Snapshot path is required");
52627
52664
  }
52628
52665
  try {
52629
- const data = await readFile(resolve2(path67), "utf8");
52666
+ const data = await readFile(resolve2(path68), "utf8");
52630
52667
  const parsed = JSON.parse(data);
52631
52668
  if (Array.isArray(parsed)) {
52632
52669
  this.#snapshots.clear();
@@ -52640,7 +52677,7 @@ var require_snapshot_recorder = __commonJS({
52640
52677
  if (error63.code === "ENOENT") {
52641
52678
  this.#snapshots.clear();
52642
52679
  } else {
52643
- throw new UndiciError(`Failed to load snapshots from ${path67}`, { cause: error63 });
52680
+ throw new UndiciError(`Failed to load snapshots from ${path68}`, { cause: error63 });
52644
52681
  }
52645
52682
  }
52646
52683
  }
@@ -52651,11 +52688,11 @@ var require_snapshot_recorder = __commonJS({
52651
52688
  * @returns {Promise<void>} - Resolves when snapshots are saved
52652
52689
  */
52653
52690
  async saveSnapshots(filePath) {
52654
- const path67 = filePath || this.#snapshotPath;
52655
- if (!path67) {
52691
+ const path68 = filePath || this.#snapshotPath;
52692
+ if (!path68) {
52656
52693
  throw new InvalidArgumentError2("Snapshot path is required");
52657
52694
  }
52658
- const resolvedPath = resolve2(path67);
52695
+ const resolvedPath = resolve2(path68);
52659
52696
  await mkdir(dirname3(resolvedPath), { recursive: true });
52660
52697
  const data = Array.from(this.#snapshots.entries()).map(([hash2, snapshot]) => ({
52661
52698
  hash: hash2,
@@ -53287,15 +53324,15 @@ var require_redirect_handler = __commonJS({
53287
53324
  return;
53288
53325
  }
53289
53326
  const { origin, pathname, search } = util2.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
53290
- const path67 = search ? `${pathname}${search}` : pathname;
53291
- const redirectUrlString = `${origin}${path67}`;
53327
+ const path68 = search ? `${pathname}${search}` : pathname;
53328
+ const redirectUrlString = `${origin}${path68}`;
53292
53329
  for (const historyUrl of this.history) {
53293
53330
  if (historyUrl.toString() === redirectUrlString) {
53294
53331
  throw new InvalidArgumentError2(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);
53295
53332
  }
53296
53333
  }
53297
53334
  this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
53298
- this.opts.path = path67;
53335
+ this.opts.path = path68;
53299
53336
  this.opts.origin = origin;
53300
53337
  this.opts.query = null;
53301
53338
  }
@@ -55055,10 +55092,10 @@ var require_cache_handler = __commonJS({
55055
55092
  }
55056
55093
  return locationUrl.pathname + locationUrl.search;
55057
55094
  }
55058
- function deleteCachedUri(store, cacheKey, path67) {
55095
+ function deleteCachedUri(store, cacheKey, path68) {
55059
55096
  deleteCachedValue(store, {
55060
55097
  ...cacheKey,
55061
- path: path67
55098
+ path: path68
55062
55099
  });
55063
55100
  for (let i10 = 0; i10 < util2.safeHTTPMethods.length; i10++) {
55064
55101
  const method = util2.safeHTTPMethods[i10];
@@ -55066,7 +55103,7 @@ var require_cache_handler = __commonJS({
55066
55103
  deleteCachedValue(store, {
55067
55104
  ...cacheKey,
55068
55105
  method,
55069
- path: path67
55106
+ path: path68
55070
55107
  });
55071
55108
  }
55072
55109
  }
@@ -55077,9 +55114,9 @@ var require_cache_handler = __commonJS({
55077
55114
  }
55078
55115
  const values = Array.isArray(headerValue2) ? headerValue2 : [headerValue2];
55079
55116
  for (let i10 = 0; i10 < values.length; i10++) {
55080
- const path67 = getSameOriginPath(cacheKey, values[i10]);
55081
- if (path67 !== void 0) {
55082
- deleteCachedUri(store, cacheKey, path67);
55117
+ const path68 = getSameOriginPath(cacheKey, values[i10]);
55118
+ if (path68 !== void 0) {
55119
+ deleteCachedUri(store, cacheKey, path68);
55083
55120
  }
55084
55121
  }
55085
55122
  }
@@ -60079,11 +60116,11 @@ var require_fetch = __commonJS({
60079
60116
  function dispatch({ body }) {
60080
60117
  const url2 = requestCurrentURL(request7);
60081
60118
  const agent = fetchParams.controller.dispatcher;
60082
- const path67 = url2.pathname + url2.search;
60119
+ const path68 = url2.pathname + url2.search;
60083
60120
  const hasTrailingQuestionMark = url2.search.length === 0 && url2.href[url2.href.length - url2.hash.length - 1] === "?";
60084
60121
  return new Promise((resolve2, reject) => agent.dispatch(
60085
60122
  {
60086
- path: hasTrailingQuestionMark ? `${path67}?` : path67,
60123
+ path: hasTrailingQuestionMark ? `${path68}?` : path68,
60087
60124
  origin: url2.origin,
60088
60125
  method: request7.method,
60089
60126
  body: agent.isMockActive ? request7.body && (request7.body.source || request7.body.stream) : body,
@@ -61030,9 +61067,9 @@ var require_util5 = __commonJS({
61030
61067
  }
61031
61068
  }
61032
61069
  }
61033
- function validateCookiePath(path67) {
61034
- for (let i10 = 0; i10 < path67.length; ++i10) {
61035
- const code = path67.charCodeAt(i10);
61070
+ function validateCookiePath(path68) {
61071
+ for (let i10 = 0; i10 < path68.length; ++i10) {
61072
+ const code = path68.charCodeAt(i10);
61036
61073
  if (code < 32 || // exclude CTLs (0-31)
61037
61074
  code > 126 || // exclude DEL and non-ascii
61038
61075
  code === 59) {
@@ -64380,11 +64417,11 @@ var require_undici = __commonJS({
64380
64417
  if (typeof opts.path !== "string") {
64381
64418
  throw new InvalidArgumentError2("invalid opts.path");
64382
64419
  }
64383
- let path67 = opts.path;
64420
+ let path68 = opts.path;
64384
64421
  if (!opts.path.startsWith("/")) {
64385
- path67 = `/${path67}`;
64422
+ path68 = `/${path68}`;
64386
64423
  }
64387
- url2 = new URL(util2.parseOrigin(url2).origin + path67);
64424
+ url2 = new URL(util2.parseOrigin(url2).origin + path68);
64388
64425
  } else {
64389
64426
  if (!opts) {
64390
64427
  opts = typeof url2 === "object" ? url2 : {};
@@ -65796,8 +65833,8 @@ function countOf(usage, key) {
65796
65833
  const value2 = key in usage ? Reflect.get(usage, key) : void 0;
65797
65834
  return typeof value2 === "number" && Number.isFinite(value2) && value2 >= 0 ? value2 : 0;
65798
65835
  }
65799
- function contextTokensOfTranscript(text3) {
65800
- const lines = text3.split("\n");
65836
+ function contextTokensOfTranscript(text4) {
65837
+ const lines = text4.split("\n");
65801
65838
  for (let index = lines.length - 1; index >= 0; index -= 1) {
65802
65839
  const line = lines[index];
65803
65840
  if (line === void 0 || line === "") {
@@ -65848,8 +65885,8 @@ function resumedContextTokens(fs30, params) {
65848
65885
  }
65849
65886
  const projectDir = import_node_path43.default.join(params.claudeHome, "projects", projectDirNameOf(params.cwd));
65850
65887
  const file2 = target.kind === "id" ? import_node_path43.default.join(projectDir, `${target.id}.jsonl`) : newestTranscript(fs30, projectDir);
65851
- const text3 = file2 === void 0 ? void 0 : fs30.readFileUtf8(file2);
65852
- return text3 === void 0 ? void 0 : contextTokensOfTranscript(text3);
65888
+ const text4 = file2 === void 0 ? void 0 : fs30.readFileUtf8(file2);
65889
+ return text4 === void 0 ? void 0 : contextTokensOfTranscript(text4);
65853
65890
  }
65854
65891
  var import_node_path43;
65855
65892
  var init_resumeContext = __esm({
@@ -66112,8 +66149,8 @@ function farmRow(links, builtDirectories, adopted) {
66112
66149
  const parts = [counted(links, "link", "links"), counted(builtDirectories, "built directory", "built directories"), ...adopted === 0 ? [] : [`${String(adopted)} adopted`]];
66113
66150
  return { label: "farm", value: "resynced", detail: parts.join(", ") };
66114
66151
  }
66115
- function noteRow(text3) {
66116
- return { label: "note", value: text3 };
66152
+ function noteRow(text4) {
66153
+ return { label: "note", value: text4 };
66117
66154
  }
66118
66155
  var init_launchReport = __esm({
66119
66156
  "src/launcher/launchReport.ts"() {
@@ -66890,9 +66927,9 @@ function flattenToolResult(content) {
66890
66927
  }
66891
66928
  return content.map((block2) => isTextBlock(block2) ? block2.text : NON_TEXT_TOOL_RESULT).join("\n");
66892
66929
  }
66893
- function systemReminder(text3) {
66930
+ function systemReminder(text4) {
66894
66931
  return `<system-reminder>
66895
- ${text3}
66932
+ ${text4}
66896
66933
  </system-reminder>`;
66897
66934
  }
66898
66935
  function turnBlocks(message) {
@@ -67129,9 +67166,9 @@ function flattenToolResult2(content) {
67129
67166
  }
67130
67167
  return content.map((block2) => isTextBlock(block2) ? block2.text : NON_TEXT_TOOL_RESULT2).join("\n");
67131
67168
  }
67132
- function systemReminder2(text3) {
67169
+ function systemReminder2(text4) {
67133
67170
  return `<system-reminder>
67134
- ${text3}
67171
+ ${text4}
67135
67172
  </system-reminder>`;
67136
67173
  }
67137
67174
  function turnBlocks2(message) {
@@ -67256,12 +67293,12 @@ var init_translate2 = __esm({
67256
67293
  function catalogueCachePath(paths, name) {
67257
67294
  return import_node_path44.default.join(paths.catalogueDir, `${name}.json`);
67258
67295
  }
67259
- function parseCatalogueCache(text3) {
67260
- if (text3 === void 0) {
67296
+ function parseCatalogueCache(text4) {
67297
+ if (text4 === void 0) {
67261
67298
  return void 0;
67262
67299
  }
67263
67300
  try {
67264
- const parsed = CatalogueCacheSchema.safeParse(JSON.parse(text3));
67301
+ const parsed = CatalogueCacheSchema.safeParse(JSON.parse(text4));
67265
67302
  return parsed.success ? parsed.data : void 0;
67266
67303
  } catch {
67267
67304
  return void 0;
@@ -67466,8 +67503,8 @@ function addSameGroup(paths, refs) {
67466
67503
  const current = readModels(paths) ?? {};
67467
67504
  const overlapping = (current.same ?? []).filter((group) => group.some((ref) => refs.includes(ref)));
67468
67505
  const rest = (current.same ?? []).filter((group) => !overlapping.includes(group));
67469
- const joined2 = [.../* @__PURE__ */ new Set([...overlapping.flat(), ...refs])];
67470
- writeModels(paths, stripEmpty({ ...current, same: [...rest, joined2] }));
67506
+ const joined3 = [.../* @__PURE__ */ new Set([...overlapping.flat(), ...refs])];
67507
+ writeModels(paths, stripEmpty({ ...current, same: [...rest, joined3] }));
67471
67508
  }
67472
67509
  function addDistinctPair(paths, left, right) {
67473
67510
  const current = readModels(paths) ?? {};
@@ -105648,8 +105685,8 @@ var require_utils3 = __commonJS({
105648
105685
  }
105649
105686
  return ind;
105650
105687
  }
105651
- function removeDotSegments(path67) {
105652
- let input2 = path67;
105688
+ function removeDotSegments(path68) {
105689
+ let input2 = path68;
105653
105690
  const output2 = [];
105654
105691
  let nextSlash = -1;
105655
105692
  let len = 0;
@@ -106058,8 +106095,8 @@ var require_schemes = __commonJS({
106058
106095
  }
106059
106096
  if (wsComponent.resourceName) {
106060
106097
  const queryIndex = wsComponent.resourceName.indexOf("?");
106061
- const path67 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
106062
- wsComponent.path = path67 && path67 !== "/" ? path67 : void 0;
106098
+ const path68 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
106099
+ wsComponent.path = path68 && path68 !== "/" ? path68 : void 0;
106063
106100
  wsComponent.query = queryIndex === -1 ? void 0 : wsComponent.resourceName.slice(queryIndex + 1);
106064
106101
  wsComponent.resourceName = void 0;
106065
106102
  }
@@ -107011,7 +107048,7 @@ var require_core2 = __commonJS({
107011
107048
  errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) {
107012
107049
  if (!errors || errors.length === 0)
107013
107050
  return "No errors";
107014
- return errors.map((e14) => `${dataVar}${e14.instancePath} ${e14.message}`).reduce((text3, msg) => text3 + separator + msg);
107051
+ return errors.map((e14) => `${dataVar}${e14.instancePath} ${e14.message}`).reduce((text4, msg) => text4 + separator + msg);
107015
107052
  }
107016
107053
  $dataMetaSchema(metaSchema, keywordsJsonPointers) {
107017
107054
  const rules = this.RULES.all;
@@ -109586,7 +109623,7 @@ var require_dist2 = __commonJS({
109586
109623
  });
109587
109624
 
109588
109625
  // src/cli.ts
109589
- var import_node_path66 = __toESM(require("node:path"), 1);
109626
+ var import_node_path67 = __toESM(require("node:path"), 1);
109590
109627
 
109591
109628
  // node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/error.js
109592
109629
  var CommanderError = class extends Error {
@@ -112699,9 +112736,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
112699
112736
  * @param {string} [path]
112700
112737
  * @return {(string|null|Command)}
112701
112738
  */
112702
- executableDir(path67) {
112703
- if (path67 === void 0) return this._executableDir;
112704
- this._executableDir = path67;
112739
+ executableDir(path68) {
112740
+ if (path68 === void 0) return this._executableDir;
112741
+ this._executableDir = path68;
112705
112742
  return this;
112706
112743
  }
112707
112744
  /**
@@ -112718,9 +112755,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
112718
112755
  helpWidth: context.helpWidth,
112719
112756
  outputHasColors: context.hasColors
112720
112757
  });
112721
- const text3 = helper.formatHelp(this, helper);
112722
- if (context.hasColors) return text3;
112723
- return this._outputConfiguration.stripColor(text3);
112758
+ const text4 = helper.formatHelp(this, helper);
112759
+ if (context.hasColors) return text4;
112760
+ return this._outputConfiguration.stripColor(text4);
112724
112761
  }
112725
112762
  /**
112726
112763
  * @typedef HelpContext
@@ -112880,7 +112917,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
112880
112917
  * @param {(string | Function)} text - string to add, or a function returning a string
112881
112918
  * @return {Command} `this` command for chaining
112882
112919
  */
112883
- addHelpText(position, text3) {
112920
+ addHelpText(position, text4) {
112884
112921
  const allowedValues = ["beforeAll", "before", "after", "afterAll"];
112885
112922
  if (!allowedValues.includes(position)) {
112886
112923
  throw new Error(`Unexpected value for position to addHelpText.
@@ -112889,10 +112926,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
112889
112926
  const helpEvent = `${position}Help`;
112890
112927
  this.on(helpEvent, (context) => {
112891
112928
  let helpStr;
112892
- if (typeof text3 === "function") {
112893
- helpStr = text3({ error: context.error, command: context.command });
112929
+ if (typeof text4 === "function") {
112930
+ helpStr = text4({ error: context.error, command: context.command });
112894
112931
  } else {
112895
- helpStr = text3;
112932
+ helpStr = text4;
112896
112933
  }
112897
112934
  if (helpStr) {
112898
112935
  context.write(`${helpStr}
@@ -114177,19 +114214,19 @@ function writePools(paths, pools) {
114177
114214
  applyPatch(paths.globalConfigFile, GlobalConfigSchema, { pools }, { defaults: {} });
114178
114215
  }
114179
114216
  function poolCycleOf(pools, name) {
114180
- const walk3 = (current, path67) => {
114217
+ const walk3 = (current, path68) => {
114181
114218
  for (const entry of pools[current]?.identities ?? []) {
114182
114219
  const nested = poolNameOf(poolMemberIdentity(entry));
114183
114220
  if (nested === void 0) {
114184
114221
  continue;
114185
114222
  }
114186
114223
  if (nested === name) {
114187
- return [...path67, nested];
114224
+ return [...path68, nested];
114188
114225
  }
114189
- if (path67.includes(nested)) {
114226
+ if (path68.includes(nested)) {
114190
114227
  continue;
114191
114228
  }
114192
- const found = walk3(nested, [...path67, nested]);
114229
+ const found = walk3(nested, [...path68, nested]);
114193
114230
  if (found !== void 0) {
114194
114231
  return found;
114195
114232
  }
@@ -115390,7 +115427,7 @@ function statuslineChangeOf(options) {
115390
115427
  return void 0;
115391
115428
  }
115392
115429
  const assignments = (options.statusline ?? []).map(parseStatuslineAssignment);
115393
- return { set: Object.fromEntries(assignments.map(({ path: path67, value: value2 }) => [path67, value2])), unset: options.unsetStatusline ?? [] };
115430
+ return { set: Object.fromEntries(assignments.map(({ path: path68, value: value2 }) => [path68, value2])), unset: options.unsetStatusline ?? [] };
115394
115431
  }
115395
115432
  function registerProfileCommand(program2, deps) {
115396
115433
  const { paths } = deps;
@@ -117412,9 +117449,9 @@ function listDirOrReport(fs30, configDir, relative, report) {
117412
117449
  return [];
117413
117450
  }
117414
117451
  }
117415
- function parseJson3(text3) {
117452
+ function parseJson3(text4) {
117416
117453
  try {
117417
- const value2 = JSON.parse(text3);
117454
+ const value2 = JSON.parse(text4);
117418
117455
  return value2;
117419
117456
  } catch {
117420
117457
  return void 0;
@@ -117460,11 +117497,11 @@ function readSessionAgentTree(fs30, configDir, ref, options = {}) {
117460
117497
  }
117461
117498
  const agents = /* @__PURE__ */ new Map();
117462
117499
  for (const candidate of located) {
117463
- const text3 = readFileOrReport(fs30, configDir, candidate.metaPath, report);
117464
- if (text3 === void 0) {
117500
+ const text4 = readFileOrReport(fs30, configDir, candidate.metaPath, report);
117501
+ if (text4 === void 0) {
117465
117502
  continue;
117466
117503
  }
117467
- const parsed = AgentMetaSchema.safeParse(parseJson3(text3));
117504
+ const parsed = AgentMetaSchema.safeParse(parseJson3(text4));
117468
117505
  if (!parsed.success) {
117469
117506
  report({ path: candidate.metaPath, reason: "meta file is not a JSON object with an agentType" });
117470
117507
  continue;
@@ -117508,9 +117545,9 @@ function resolveParents(fs30, configDir, agents, report) {
117508
117545
  if (cached2 !== void 0) {
117509
117546
  return cached2;
117510
117547
  }
117511
- const text3 = readFileOrReport(fs30, configDir, agent.located.transcriptPath, report) ?? "";
117512
- transcriptCache.set(agent.located.id, text3);
117513
- return text3;
117548
+ const text4 = readFileOrReport(fs30, configDir, agent.located.transcriptPath, report) ?? "";
117549
+ transcriptCache.set(agent.located.id, text4);
117550
+ return text4;
117514
117551
  };
117515
117552
  const wouldCycle = (child, parent) => {
117516
117553
  for (let cursor3 = parent; cursor3 !== void 0; cursor3 = parentOf4.get(cursor3)) {
@@ -117567,11 +117604,11 @@ function readTasks(fs30, configDir, ownLists, sharedLists, report) {
117567
117604
  continue;
117568
117605
  }
117569
117606
  const relative = import_node_path35.default.join(relativeDir, name);
117570
- const text3 = readFileOrReport(fs30, configDir, relative, report);
117571
- const parsed = TaskFileSchema.safeParse(text3 === void 0 ? void 0 : parseJson3(text3));
117607
+ const text4 = readFileOrReport(fs30, configDir, relative, report);
117608
+ const parsed = TaskFileSchema.safeParse(text4 === void 0 ? void 0 : parseJson3(text4));
117572
117609
  if (parsed.success) {
117573
117610
  tasks.push(index < ownLists.length ? parsed.data : { ...parsed.data, taskList: scope });
117574
- } else if (text3 !== void 0) {
117611
+ } else if (text4 !== void 0) {
117575
117612
  report({ path: relative, reason: "task file is not a task" });
117576
117613
  }
117577
117614
  }
@@ -117585,10 +117622,10 @@ function readWorkflowRuns(fs30, configDir, relativeDir, report) {
117585
117622
  continue;
117586
117623
  }
117587
117624
  const relative = import_node_path35.default.join(relativeDir, name);
117588
- const text3 = readFileOrReport(fs30, configDir, relative, report);
117589
- const parsed = WorkflowRunFileSchema.safeParse(text3 === void 0 ? void 0 : parseJson3(text3));
117625
+ const text4 = readFileOrReport(fs30, configDir, relative, report);
117626
+ const parsed = WorkflowRunFileSchema.safeParse(text4 === void 0 ? void 0 : parseJson3(text4));
117590
117627
  if (!parsed.success) {
117591
- if (text3 !== void 0) {
117628
+ if (text4 !== void 0) {
117592
117629
  report({ path: relative, reason: "workflow run file is not a run record" });
117593
117630
  }
117594
117631
  continue;
@@ -118951,8 +118988,8 @@ function finiteNumber(record2, field) {
118951
118988
  const value2 = record2 === void 0 ? void 0 : record2[field];
118952
118989
  return typeof value2 === "number" && Number.isFinite(value2) ? value2 : void 0;
118953
118990
  }
118954
- function excerpt(text3) {
118955
- return text3.length <= RC_PENDING_SUMMARY_EXCERPT_CHARS ? text3 : `${text3.slice(0, RC_PENDING_SUMMARY_EXCERPT_CHARS)}...`;
118991
+ function excerpt(text4) {
118992
+ return text4.length <= RC_PENDING_SUMMARY_EXCERPT_CHARS ? text4 : `${text4.slice(0, RC_PENDING_SUMMARY_EXCERPT_CHARS)}...`;
118956
118993
  }
118957
118994
  function payloadEventsOf(body) {
118958
118995
  const parsed = parseJsonObject(body);
@@ -119057,11 +119094,11 @@ function createRcSessionTracker(deps) {
119057
119094
  };
119058
119095
  const observeExchange = (request7) => {
119059
119096
  const method = (request7.method ?? "").toUpperCase();
119060
- const path67 = new URL(request7.url ?? "/", "http://127.0.0.1").pathname;
119061
- if (!path67.startsWith(RC_SESSIONS_PATH_PREFIX)) {
119097
+ const path68 = new URL(request7.url ?? "/", "http://127.0.0.1").pathname;
119098
+ if (!path68.startsWith(RC_SESSIONS_PATH_PREFIX)) {
119062
119099
  return void 0;
119063
119100
  }
119064
- const tail = path67.slice(RC_SESSIONS_PATH_PREFIX.length);
119101
+ const tail = path68.slice(RC_SESSIONS_PATH_PREFIX.length);
119065
119102
  const facts = {
119066
119103
  oauthAuthorization: oauthAuthorizationOf(request7.headers),
119067
119104
  anthropicVersion: singleHeader(request7.headers, "anthropic-version"),
@@ -119082,8 +119119,8 @@ function createRcSessionTracker(deps) {
119082
119119
  if (!accepted2 || buffered2 >= RC_CREATE_RESPONSE_CAP_BYTES) {
119083
119120
  return;
119084
119121
  }
119085
- const text3 = Buffer.from(chunk2).toString("utf8");
119086
- body = body + text3.slice(0, RC_CREATE_RESPONSE_CAP_BYTES - buffered2);
119122
+ const text4 = Buffer.from(chunk2).toString("utf8");
119123
+ body = body + text4.slice(0, RC_CREATE_RESPONSE_CAP_BYTES - buffered2);
119087
119124
  buffered2 = body.length;
119088
119125
  },
119089
119126
  onEnd: () => {
@@ -119301,13 +119338,13 @@ function teeRoutedResponse(response, observer, onSettled) {
119301
119338
  }
119302
119339
 
119303
119340
  // src/frontdoor/rcWrites.ts
119304
- function buildRcUserMessagePayload(uuid3, sessionId, text3) {
119341
+ function buildRcUserMessagePayload(uuid3, sessionId, text4) {
119305
119342
  return {
119306
119343
  type: "user",
119307
119344
  uuid: uuid3,
119308
119345
  session_id: sessionId,
119309
119346
  parent_tool_use_id: null,
119310
- message: { role: "user", content: text3 }
119347
+ message: { role: "user", content: text4 }
119311
119348
  };
119312
119349
  }
119313
119350
  function buildRcEventWriteBody(payload) {
@@ -119372,7 +119409,7 @@ function rcWriteHeaders(credential) {
119372
119409
  }
119373
119410
  return headers;
119374
119411
  }
119375
- async function injectRcUserMessage(deps, sessionId, text3) {
119412
+ async function injectRcUserMessage(deps, sessionId, text4) {
119376
119413
  const credential = deps.credentialOf(sessionId);
119377
119414
  if (credential === void 0) {
119378
119415
  return { ok: false, message: rcSessionNotObservedMessage(sessionId) };
@@ -119380,7 +119417,7 @@ async function injectRcUserMessage(deps, sessionId, text3) {
119380
119417
  if (credential.authorization === void 0) {
119381
119418
  return noOAuthCredentialResult(sessionId);
119382
119419
  }
119383
- const body = JSON.stringify(buildRcEventWriteBody(buildRcUserMessagePayload(deps.newUuid(), sessionId, text3)));
119420
+ const body = JSON.stringify(buildRcEventWriteBody(buildRcUserMessagePayload(deps.newUuid(), sessionId, text4)));
119384
119421
  let answer;
119385
119422
  try {
119386
119423
  answer = await deps.dial.writeEvents(sessionId, rcWriteHeaders(credential), body);
@@ -119430,8 +119467,8 @@ var RC_READ_FILE_ENCODINGS = ["utf-8", "base64"];
119430
119467
  function isRcReadFileEncoding(value2) {
119431
119468
  return RC_READ_FILE_ENCODINGS.some((encoding) => encoding === value2);
119432
119469
  }
119433
- function buildRcReadFilePayload(requestId, path67, options) {
119434
- return buildRcControlRequestPayload(requestId, { subtype: "read_file", path: path67, ...options?.maxBytes === void 0 ? {} : { max_bytes: options.maxBytes }, ...options?.encoding === void 0 ? {} : { encoding: options.encoding } });
119470
+ function buildRcReadFilePayload(requestId, path68, options) {
119471
+ return buildRcControlRequestPayload(requestId, { subtype: "read_file", path: path68, ...options?.maxBytes === void 0 ? {} : { max_bytes: options.maxBytes }, ...options?.encoding === void 0 ? {} : { encoding: options.encoding } });
119435
119472
  }
119436
119473
  function buildRcFileSuggestionsPayload(requestId, query) {
119437
119474
  return buildRcControlRequestPayload(requestId, { subtype: "file_suggestions", query });
@@ -119533,15 +119570,15 @@ async function getRcSessionContextUsage(deps, sessionId, detail) {
119533
119570
  const result = await deliverRcClientPayload(deps, sessionId, buildRcGetContextUsagePayload(requestId, detail), `request the context usage of session ${sessionId}`);
119534
119571
  return result.ok ? { ...result, requestId } : result;
119535
119572
  }
119536
- async function readRcSessionFile(deps, sessionId, path67, options) {
119537
- if (path67 === "") {
119573
+ async function readRcSessionFile(deps, sessionId, path68, options) {
119574
+ if (path68 === "") {
119538
119575
  return { ok: false, message: "a read-file write needs a non-empty path: the SDK's own field names the file the worker resolves against the session's cwd, and an empty string names none" };
119539
119576
  }
119540
119577
  if (options?.maxBytes !== void 0 && (!Number.isInteger(options.maxBytes) || options.maxBytes <= 0)) {
119541
119578
  return { ok: false, message: "a read-file write's max-bytes is a positive whole number of bytes: the SDK's own field caps the read, and a zero or negative cap reads nothing" };
119542
119579
  }
119543
119580
  const requestId = deps.newUuid();
119544
- const result = await deliverRcClientPayload(deps, sessionId, buildRcReadFilePayload(requestId, path67, options), `read ${path67} from session ${sessionId}`);
119581
+ const result = await deliverRcClientPayload(deps, sessionId, buildRcReadFilePayload(requestId, path68, options), `read ${path68} from session ${sessionId}`);
119545
119582
  return result.ok ? { ...result, requestId } : result;
119546
119583
  }
119547
119584
  async function suggestRcSessionFiles(deps, sessionId, query) {
@@ -119603,9 +119640,9 @@ var RC_PERMISSION_MODE_LIST = RC_PERMISSION_MODES.join(", ");
119603
119640
  var CONTROL_PATH_PREFIX = "/__agent-shim/rc";
119604
119641
  var CONTROL_BODY_CAP_BYTES = 10485760;
119605
119642
  function answerJson(response, status, body) {
119606
- const text3 = JSON.stringify(body);
119607
- response.writeHead(status, { "content-type": "application/json", "content-length": String(Buffer.byteLength(text3, "utf8")) });
119608
- response.end(text3);
119643
+ const text4 = JSON.stringify(body);
119644
+ response.writeHead(status, { "content-type": "application/json", "content-length": String(Buffer.byteLength(text4, "utf8")) });
119645
+ response.end(text4);
119609
119646
  }
119610
119647
  function isJsonObject(value2) {
119611
119648
  return typeof value2 === "object" && value2 !== null && !Array.isArray(value2);
@@ -119712,11 +119749,11 @@ function createRcControlHandler(deps) {
119712
119749
  path: "read-file",
119713
119750
  read: (body) => {
119714
119751
  const session = bodyString(body, "session");
119715
- const path67 = bodyString(body, "path");
119752
+ const path68 = bodyString(body, "path");
119716
119753
  const maxBytes = "maxBytes" in body ? bodyPositiveInteger(body, "maxBytes") : void 0;
119717
119754
  const encoding = "encoding" in body && isRcReadFileEncoding(body.encoding) ? body.encoding : void 0;
119718
- const refused2 = session === void 0 || path67 === void 0 || "maxBytes" in body && maxBytes === void 0 || "encoding" in body && encoding === void 0;
119719
- return refused2 ? { error: `the read-file body must be JSON naming a non-empty session id and path, maxBytes only as a positive whole number or absent, and an encoding the SDK's own type permits (${RC_READ_FILE_ENCODINGS.join(", ")}) or none` } : { session, run: async () => await deps.readFile(session, path67, { ...maxBytes === void 0 ? {} : { maxBytes }, ...encoding === void 0 ? {} : { encoding } }) };
119755
+ const refused2 = session === void 0 || path68 === void 0 || "maxBytes" in body && maxBytes === void 0 || "encoding" in body && encoding === void 0;
119756
+ return refused2 ? { error: `the read-file body must be JSON naming a non-empty session id and path, maxBytes only as a positive whole number or absent, and an encoding the SDK's own type permits (${RC_READ_FILE_ENCODINGS.join(", ")}) or none` } : { session, run: async () => await deps.readFile(session, path68, { ...maxBytes === void 0 ? {} : { maxBytes }, ...encoding === void 0 ? {} : { encoding } }) };
119720
119757
  }
119721
119758
  },
119722
119759
  {
@@ -119854,12 +119891,12 @@ function createRcControlHandler(deps) {
119854
119891
  answerJson(response, HTTP_STATUS.badRequest, { error: "the answer body must be JSON naming a non-empty session id, request id, and an approve boolean" });
119855
119892
  return;
119856
119893
  }
119857
- const text3 = "text" in parsed && typeof parsed.text === "string" ? parsed.text : void 0;
119858
- if (parsed.approve && text3 !== void 0 && text3 !== "") {
119894
+ const text4 = "text" in parsed && typeof parsed.text === "string" ? parsed.text : void 0;
119895
+ if (parsed.approve && text4 !== void 0 && text4 !== "") {
119859
119896
  answerJson(response, HTTP_STATUS.badRequest, { error: "an approval carries no text (the protocol's allow result has no message field); text is the denial message" });
119860
119897
  return;
119861
119898
  }
119862
- const result = await deps.answer(parsed.session, parsed.request, { approve: parsed.approve, message: parsed.approve ? void 0 : text3 });
119899
+ const result = await deps.answer(parsed.session, parsed.request, { approve: parsed.approve, message: parsed.approve ? void 0 : text4 });
119863
119900
  if (result.ok) {
119864
119901
  answerJson(response, HTTP_STATUS.ok, { session: parsed.session, request: parsed.request, sequenceNums: result.sequenceNums });
119865
119902
  return;
@@ -120026,9 +120063,9 @@ function requestIdOfBody(body) {
120026
120063
  }
120027
120064
  function frontDoorRcControl(transport, token) {
120028
120065
  const headers = { authorization: `Bearer ${token}` };
120029
- const listAnswerOf = async (path67, what) => {
120066
+ const listAnswerOf = async (path68, what) => {
120030
120067
  try {
120031
- return await transport.request({ method: "GET", path: path67, headers });
120068
+ return await transport.request({ method: "GET", path: path68, headers });
120032
120069
  } catch (error63) {
120033
120070
  throw new Error(`${what}: could not reach the front door's control listener: ${error63 instanceof Error ? error63.message : String(error63)}`, { cause: error63 });
120034
120071
  }
@@ -120100,10 +120137,10 @@ function frontDoorRcControl(transport, token) {
120100
120137
  }
120101
120138
  return pending;
120102
120139
  };
120103
- const writeOf = async (path67, body, describeFailure2) => {
120140
+ const writeOf = async (path68, body, describeFailure2) => {
120104
120141
  let answer;
120105
120142
  try {
120106
- answer = await transport.request({ method: "POST", path: path67, headers: { ...headers, "content-type": "application/json" }, body });
120143
+ answer = await transport.request({ method: "POST", path: path68, headers: { ...headers, "content-type": "application/json" }, body });
120107
120144
  } catch (error63) {
120108
120145
  return { ok: false, message: `could not reach the front door's control listener: ${error63 instanceof Error ? error63.message : String(error63)}` };
120109
120146
  }
@@ -120122,7 +120159,7 @@ function frontDoorRcControl(transport, token) {
120122
120159
  listSessions: async () => sessionsOf(await listAnswerOf(`${CONTROL_PATH_PREFIX}/sessions`, "listing the door's Remote Control sessions"), "listing the door's Remote Control sessions"),
120123
120160
  statusOf: async (sessionId) => statusesOf(await listAnswerOf(`${CONTROL_PATH_PREFIX}/status${sessionQuery(sessionId)}`, "reading the door's Remote Control session status"), "reading the door's Remote Control session status"),
120124
120161
  pendingOf: async (sessionId) => pendingOfAnswer(await listAnswerOf(`${CONTROL_PATH_PREFIX}/pending${sessionQuery(sessionId)}`, "listing the door's pending Remote Control control requests"), "listing the door's pending Remote Control control requests"),
120125
- sendPrompt: async (sessionId, text3) => await writeOf(`${CONTROL_PATH_PREFIX}/inject`, JSON.stringify({ session: sessionId, text: text3 }), (status, message) => `injecting into ${sessionId} failed (HTTP ${String(status)}): ${message}`),
120162
+ sendPrompt: async (sessionId, text4) => await writeOf(`${CONTROL_PATH_PREFIX}/inject`, JSON.stringify({ session: sessionId, text: text4 }), (status, message) => `injecting into ${sessionId} failed (HTTP ${String(status)}): ${message}`),
120126
120163
  answerRequest: async (sessionId, requestId, decision) => await writeOf(
120127
120164
  `${CONTROL_PATH_PREFIX}/answer`,
120128
120165
  JSON.stringify({ session: sessionId, request: requestId, approve: decision.approve, ...decision.approve || decision.message === void 0 ? {} : { text: decision.message } }),
@@ -120134,10 +120171,10 @@ function frontDoorRcControl(transport, token) {
120134
120171
  endSession: async (sessionId, reason) => await writeOf(`${CONTROL_PATH_PREFIX}/end-session`, JSON.stringify({ session: sessionId, ...reason === void 0 ? {} : { reason } }), (status, message) => `ending ${sessionId} failed (HTTP ${String(status)}): ${message}`),
120135
120172
  getUsage: async (sessionId, skipBehaviors) => await writeOf(`${CONTROL_PATH_PREFIX}/get-usage`, JSON.stringify({ session: sessionId, ...skipBehaviors === void 0 ? {} : { skipBehaviors } }), (status, message) => `requesting the usage of ${sessionId} failed (HTTP ${String(status)}): ${message}`),
120136
120173
  getContextUsage: async (sessionId, detail) => await writeOf(`${CONTROL_PATH_PREFIX}/get-context-usage`, JSON.stringify({ session: sessionId, ...detail === void 0 ? {} : { detail } }), (status, message) => `requesting the context usage of ${sessionId} failed (HTTP ${String(status)}): ${message}`),
120137
- readFile: async (sessionId, path67, options) => await writeOf(
120174
+ readFile: async (sessionId, path68, options) => await writeOf(
120138
120175
  `${CONTROL_PATH_PREFIX}/read-file`,
120139
- JSON.stringify({ session: sessionId, path: path67, ...options?.maxBytes === void 0 ? {} : { maxBytes: options.maxBytes }, ...options?.encoding === void 0 ? {} : { encoding: options.encoding } }),
120140
- (status, message) => `reading ${path67} from ${sessionId} failed (HTTP ${String(status)}): ${message}`
120176
+ JSON.stringify({ session: sessionId, path: path68, ...options?.maxBytes === void 0 ? {} : { maxBytes: options.maxBytes }, ...options?.encoding === void 0 ? {} : { encoding: options.encoding } }),
120177
+ (status, message) => `reading ${path68} from ${sessionId} failed (HTTP ${String(status)}): ${message}`
120141
120178
  ),
120142
120179
  fileSuggestions: async (sessionId, query) => await writeOf(`${CONTROL_PATH_PREFIX}/file-suggestions`, JSON.stringify({ session: sessionId, query }), (status, message) => `requesting file suggestions from ${sessionId} failed (HTTP ${String(status)}): ${message}`),
120143
120180
  keepAlive: async (sessionId) => await writeOf(`${CONTROL_PATH_PREFIX}/keep-alive`, JSON.stringify({ session: sessionId }), (status, message) => `keeping ${sessionId} alive failed (HTTP ${String(status)}): ${message}`),
@@ -120450,12 +120487,12 @@ function tlsFacts(options) {
120450
120487
  }
120451
120488
  function realRcEventDial(target = { host: CONNECT_INTERCEPT_HOST, port: HTTPS_PORT }) {
120452
120489
  const agent = new ExemptTlsAgent();
120453
- const post = async (path67, headers, body) => await new Promise((resolve2, reject) => {
120490
+ const post = async (path68, headers, body) => await new Promise((resolve2, reject) => {
120454
120491
  const options = {
120455
120492
  host: target.host,
120456
120493
  port: target.port,
120457
120494
  method: "POST",
120458
- path: path67,
120495
+ path: path68,
120459
120496
  // The Host header names the host whose API this is, not the address dialled: a redirected test dials a loopback stand-in while still speaking to the API host by name, exactly as the forwarded paths present their SNI.
120460
120497
  headers: { ...headers, host: target.servername ?? target.host, "content-length": String(Buffer.byteLength(body, "utf8")) },
120461
120498
  agent
@@ -120520,12 +120557,12 @@ function lateRcStreamDial(resolve2) {
120520
120557
  }
120521
120558
  function realRcStreamDial(target = { host: CONNECT_INTERCEPT_HOST, port: HTTPS_PORT }) {
120522
120559
  const agent = new ExemptTlsAgent();
120523
- const request7 = async (method, path67, headers, body, signal) => await new Promise((resolve2, reject) => {
120560
+ const request7 = async (method, path68, headers, body, signal) => await new Promise((resolve2, reject) => {
120524
120561
  const options = {
120525
120562
  host: target.host,
120526
120563
  port: target.port,
120527
120564
  method,
120528
- path: path67,
120565
+ path: path68,
120529
120566
  // The Host header names the host whose API this is, not the address dialled: a redirected test dials a loopback stand-in while still speaking to the API host by name, exactly as the forwarded paths present their SNI.
120530
120567
  headers: { ...headers, host: target.servername ?? target.host, ...body === void 0 ? {} : { "content-length": String(Buffer.byteLength(body, "utf8")) } },
120531
120568
  agent,
@@ -120567,9 +120604,9 @@ function realRcStreamDial(target = { host: CONNECT_INTERCEPT_HOST, port: HTTPS_P
120567
120604
  return { status, body: await readAll(response) };
120568
120605
  },
120569
120606
  openStream: async (sessionId, headers, resume, signal) => {
120570
- const path67 = resume === void 0 ? `/v1/code/sessions/${encodeURIComponent(sessionId)}/events/stream` : `/v1/code/sessions/${encodeURIComponent(sessionId)}/events/stream?from_sequence_num=${String(resume.fromSequenceNum)}`;
120607
+ const path68 = resume === void 0 ? `/v1/code/sessions/${encodeURIComponent(sessionId)}/events/stream` : `/v1/code/sessions/${encodeURIComponent(sessionId)}/events/stream?from_sequence_num=${String(resume.fromSequenceNum)}`;
120571
120608
  const streamHeaders = resume === void 0 ? headers : { ...headers, "last-event-id": String(resume.fromSequenceNum) };
120572
- const { status, response } = await request7("GET", path67, streamHeaders, void 0, signal);
120609
+ const { status, response } = await request7("GET", path68, streamHeaders, void 0, signal);
120573
120610
  if (!isSuccessful2(status)) {
120574
120611
  await readAll(response);
120575
120612
  return { status, chunks: NO_CHUNKS };
@@ -121835,11 +121872,11 @@ var AsyncIteratorClass = class {
121835
121872
  return this;
121836
121873
  }
121837
121874
  };
121838
- function parseEmptyableJSON(text3) {
121839
- if (!text3) {
121875
+ function parseEmptyableJSON(text4) {
121876
+ if (!text4) {
121840
121877
  return void 0;
121841
121878
  }
121842
- return JSON.parse(text3);
121879
+ return JSON.parse(text4);
121843
121880
  }
121844
121881
  function stringifyJSON(value2) {
121845
121882
  return JSON.stringify(value2);
@@ -121970,11 +122007,11 @@ function tryOrUndefined(fn2) {
121970
122007
  return void 0;
121971
122008
  }
121972
122009
  }
121973
- function pathToHttpPath(path67) {
121974
- return `/${path67.map(safeEncodeURIComponent).join("/")}`;
122010
+ function pathToHttpPath(path68) {
122011
+ return `/${path68.map(safeEncodeURIComponent).join("/")}`;
121975
122012
  }
121976
- function normalizeHttpPath(path67) {
121977
- const paths = path67.split("/");
122013
+ function normalizeHttpPath(path68) {
122014
+ const paths = path68.split("/");
121978
122015
  if (paths.at(0) === "") {
121979
122016
  paths.shift();
121980
122017
  }
@@ -122159,9 +122196,9 @@ function isPlainObject3(value2) {
122159
122196
  function getOwn(object3, key) {
122160
122197
  return Object.hasOwn(object3, key) ? object3[key] : void 0;
122161
122198
  }
122162
- function get(object3, path67) {
122199
+ function get(object3, path68) {
122163
122200
  let current = object3;
122164
- for (const key of path67) {
122201
+ for (const key of path68) {
122165
122202
  if (!isTypescriptObject(current)) {
122166
122203
  return void 0;
122167
122204
  }
@@ -122890,8 +122927,8 @@ function createORPCErrorFromMalformedResponse(options) {
122890
122927
  }
122891
122928
  var INFERRED_MESSAGE_MIN_LENGTH = 1;
122892
122929
  var INFERRED_MESSAGE_MAX_LENGTH = 256;
122893
- function isInferableMessage(text3) {
122894
- return text3.length >= INFERRED_MESSAGE_MIN_LENGTH && text3.length <= INFERRED_MESSAGE_MAX_LENGTH;
122930
+ function isInferableMessage(text4) {
122931
+ return text4.length >= INFERRED_MESSAGE_MIN_LENGTH && text4.length <= INFERRED_MESSAGE_MAX_LENGTH;
122895
122932
  }
122896
122933
  function inferMalformedResponseMessage(response) {
122897
122934
  if (typeof response.body === "string" && isInferableMessage(response.body)) {
@@ -123384,7 +123421,7 @@ function resolveClientRest(rest) {
123384
123421
  // rest[1] can be undefined if all fields of FriendlyClientOptions are optional
123385
123422
  ];
123386
123423
  }
123387
- function createORPCClient(link, { path: path67 = [], ...options } = {}) {
123424
+ function createORPCClient(link, { path: path68 = [], ...options } = {}) {
123388
123425
  const procedureClient = (...rest) => {
123389
123426
  const [input2, callOptions] = resolveClientRest(rest);
123390
123427
  const interceptors = [
@@ -123393,7 +123430,7 @@ function createORPCClient(link, { path: path67 = [], ...options } = {}) {
123393
123430
  ];
123394
123431
  return intercept(
123395
123432
  interceptors,
123396
- { ...callOptions, input: input2, path: path67 },
123433
+ { ...callOptions, input: input2, path: path68 },
123397
123434
  ({ path: path210, input: input22, ...callOptions2 }) => link.call(path210, input22, callOptions2)
123398
123435
  );
123399
123436
  };
@@ -123407,7 +123444,7 @@ function createORPCClient(link, { path: path67 = [], ...options } = {}) {
123407
123444
  if (client === void 0) {
123408
123445
  client = createORPCClient(link, {
123409
123446
  ...options,
123410
- path: [...path67, key],
123447
+ path: [...path68, key],
123411
123448
  scoped: options.scoped?.[key]
123412
123449
  });
123413
123450
  cache.set(key, client);
@@ -123429,24 +123466,24 @@ var BracketNotationSerializer = class {
123429
123466
  this.internalSerialize(data, "", true, result);
123430
123467
  return result;
123431
123468
  }
123432
- internalSerialize(data, path67, isRoot, result) {
123469
+ internalSerialize(data, path68, isRoot, result) {
123433
123470
  if (Array.isArray(data)) {
123434
123471
  data.forEach((item, i10) => {
123435
- this.internalSerialize(item, isRoot ? i10.toString() : `${path67}[${i10}]`, false, result);
123472
+ this.internalSerialize(item, isRoot ? i10.toString() : `${path68}[${i10}]`, false, result);
123436
123473
  });
123437
123474
  } else if (isPlainObject3(data)) {
123438
123475
  for (const key of Object.keys(data)) {
123439
- this.internalSerialize(data[key], isRoot ? key : `${path67}[${key}]`, false, result);
123476
+ this.internalSerialize(data[key], isRoot ? key : `${path68}[${key}]`, false, result);
123440
123477
  }
123441
123478
  } else {
123442
- result.push([path67, data]);
123479
+ result.push([path68, data]);
123443
123480
  }
123444
123481
  }
123445
123482
  deserialize(serialized) {
123446
123483
  const arrayPushStyles = /* @__PURE__ */ new WeakSet();
123447
123484
  const root = new NullProtoObj();
123448
- for (const [path67, value2] of serialized) {
123449
- const segments = this.parsePath(path67);
123485
+ for (const [path68, value2] of serialized) {
123486
+ const segments = this.parsePath(path68);
123450
123487
  let currentRef = root;
123451
123488
  let nextSegment = segments[0];
123452
123489
  for (let i10 = 1; i10 < segments.length; i10++) {
@@ -123497,13 +123534,13 @@ var BracketNotationSerializer = class {
123497
123534
  }
123498
123535
  return result;
123499
123536
  }
123500
- parsePath(path67) {
123537
+ parsePath(path68) {
123501
123538
  const segments = [];
123502
123539
  let inBrackets = false;
123503
123540
  let currentSegment = "";
123504
- for (let i10 = 0; i10 < path67.length; i10++) {
123505
- const char = path67[i10];
123506
- const nextChar = path67[i10 + 1];
123541
+ for (let i10 = 0; i10 < path68.length; i10++) {
123542
+ const char = path68[i10];
123543
+ const nextChar = path68[i10 + 1];
123507
123544
  if (inBrackets && char === "]" && (nextChar === void 0 || nextChar === "[")) {
123508
123545
  if (nextChar === void 0) {
123509
123546
  inBrackets = false;
@@ -123519,7 +123556,7 @@ var BracketNotationSerializer = class {
123519
123556
  currentSegment += char;
123520
123557
  }
123521
123558
  }
123522
- return inBrackets || segments.length === 0 ? [path67] : segments;
123559
+ return inBrackets || segments.length === 0 ? [path68] : segments;
123523
123560
  }
123524
123561
  };
123525
123562
  var INTEGER_PATTERN = /^0$|^[1-9]\d*$/;
@@ -124092,11 +124129,11 @@ var OpenAPISerializer = class {
124092
124129
  return json2;
124093
124130
  }
124094
124131
  const form = new FormData();
124095
- for (const [path67, value22] of this.bracketNotation.serialize(json2)) {
124132
+ for (const [path68, value22] of this.bracketNotation.serialize(json2)) {
124096
124133
  if (value22 instanceof Blob) {
124097
- form.append(path67, value22);
124134
+ form.append(path68, value22);
124098
124135
  } else if (value22 !== void 0 && value22 !== null) {
124099
- form.append(path67, String(value22));
124136
+ form.append(path68, String(value22));
124100
124137
  }
124101
124138
  }
124102
124139
  return form;
@@ -124134,30 +124171,30 @@ function isBodylessMethod(method) {
124134
124171
  return method === "GET" || method === "HEAD";
124135
124172
  }
124136
124173
  var PARAMETER_NAME_REGEX = /^[\w-]+$/;
124137
- function getDynamicPathParams(path67) {
124138
- if (!path67.includes("{")) {
124174
+ function getDynamicPathParams(path68) {
124175
+ if (!path68.includes("{")) {
124139
124176
  return void 0;
124140
124177
  }
124141
- const len = path67.length;
124178
+ const len = path68.length;
124142
124179
  let params;
124143
124180
  let index = 1;
124144
124181
  while (index < len) {
124145
124182
  const segmentStart = index;
124146
- const slashPos = path67.indexOf("/", index);
124183
+ const slashPos = path68.indexOf("/", index);
124147
124184
  const segmentEnd = slashPos === -1 ? len : slashPos;
124148
- if (segmentEnd > segmentStart && path67.charCodeAt(segmentStart) === 123 && path67.charCodeAt(segmentEnd - 1) === 125) {
124185
+ if (segmentEnd > segmentStart && path68.charCodeAt(segmentStart) === 123 && path68.charCodeAt(segmentEnd - 1) === 125) {
124149
124186
  let parameterStart = segmentStart + 1;
124150
124187
  let allowsSlash = false;
124151
- const operator = path67.charCodeAt(parameterStart);
124188
+ const operator = path68.charCodeAt(parameterStart);
124152
124189
  if (operator === 43) {
124153
124190
  allowsSlash = true;
124154
124191
  parameterStart++;
124155
124192
  }
124156
- const parameterName = path67.slice(parameterStart, segmentEnd - 1);
124193
+ const parameterName = path68.slice(parameterStart, segmentEnd - 1);
124157
124194
  if (PARAMETER_NAME_REGEX.test(parameterName)) {
124158
124195
  params ??= [];
124159
124196
  params.push({
124160
- segment: path67.slice(segmentStart, segmentEnd),
124197
+ segment: path68.slice(segmentStart, segmentEnd),
124161
124198
  startIndex: segmentStart,
124162
124199
  parameterName,
124163
124200
  allowsSlash
@@ -124200,8 +124237,8 @@ openapi.method = (method) => ({
124200
124237
  ...openapi({ method }),
124201
124238
  name: "~openapi/method"
124202
124239
  });
124203
- openapi.path = (path67) => ({
124204
- ...openapi({ path: path67 }),
124240
+ openapi.path = (path68) => ({
124241
+ ...openapi({ path: path68 }),
124205
124242
  name: "~openapi/path"
124206
124243
  });
124207
124244
  openapi.spec = (spec) => ({
@@ -125062,22 +125099,22 @@ function visitJsonSchemaRefs(value2, visit2, schemaLevel = true, seen = /* @__PU
125062
125099
  }
125063
125100
  }
125064
125101
  }
125065
- function mapJsonSchemaRefs(value2, map2, schemaLevel = true, path67 = []) {
125102
+ function mapJsonSchemaRefs(value2, map2, schemaLevel = true, path68 = []) {
125066
125103
  if (!value2 || typeof value2 !== "object") {
125067
125104
  return value2;
125068
125105
  }
125069
125106
  if (Array.isArray(value2)) {
125070
- return value2.map((item, index) => mapJsonSchemaRefs(item, map2, schemaLevel, [...path67, index]));
125107
+ return value2.map((item, index) => mapJsonSchemaRefs(item, map2, schemaLevel, [...path68, index]));
125071
125108
  }
125072
125109
  const result = {};
125073
125110
  for (const key of Object.keys(value2)) {
125074
125111
  const val = value2[key];
125075
125112
  if (key === "$ref" && typeof val === "string") {
125076
- setOwn(result, key, map2(val, [...path67, key]));
125113
+ setOwn(result, key, map2(val, [...path68, key]));
125077
125114
  } else if (!schemaLevel) {
125078
- setOwn(result, key, mapJsonSchemaRefs(val, map2, true, [...path67, key]));
125115
+ setOwn(result, key, mapJsonSchemaRefs(val, map2, true, [...path68, key]));
125079
125116
  } else if (JSON_SCHEMA_LOGIC_KEYWORDS.has(key) || JSON_SCHEMA_RECORD_KEYWORDS.has(key)) {
125080
- setOwn(result, key, mapJsonSchemaRefs(val, map2, !JSON_SCHEMA_RECORD_KEYWORDS.has(key), [...path67, key]));
125117
+ setOwn(result, key, mapJsonSchemaRefs(val, map2, !JSON_SCHEMA_RECORD_KEYWORDS.has(key), [...path68, key]));
125081
125118
  } else {
125082
125119
  setOwn(result, key, val);
125083
125120
  }
@@ -125607,7 +125644,7 @@ function unlazy(maybeLazy) {
125607
125644
  function createProcedureClient(lazyableProcedure, ...rest) {
125608
125645
  const options = resolveMaybeOptionalOptions(rest);
125609
125646
  return async (...[input2, callerOptions]) => {
125610
- const path67 = toArray(options.path);
125647
+ const path68 = toArray(options.path);
125611
125648
  const { default: procedure } = await unlazy(lazyableProcedure);
125612
125649
  const clientContext = callerOptions?.context ?? {};
125613
125650
  const context = await value(options.context, clientContext) ?? {};
@@ -125620,7 +125657,7 @@ function createProcedureClient(lazyableProcedure, ...rest) {
125620
125657
  };
125621
125658
  try {
125622
125659
  const output2 = await runWithSpan("call_procedure", (span) => {
125623
- span?.setAttribute("procedure.path", path67);
125660
+ span?.setAttribute("procedure.path", path68);
125624
125661
  return intercept(
125625
125662
  options.interceptors,
125626
125663
  {
@@ -125628,7 +125665,7 @@ function createProcedureClient(lazyableProcedure, ...rest) {
125628
125665
  // input can be optional if it is undefinable
125629
125666
  input: input2,
125630
125667
  errors,
125631
- path: path67,
125668
+ path: path68,
125632
125669
  procedure,
125633
125670
  signal: callerOptions?.signal,
125634
125671
  lastEventId: callerOptions?.lastEventId
@@ -125879,10 +125916,10 @@ function augmentRouter(router, options) {
125879
125916
  }
125880
125917
  return enhanced;
125881
125918
  }
125882
- function getRouter(router, path67) {
125919
+ function getRouter(router, path68) {
125883
125920
  let current = router;
125884
- for (let i10 = 0; i10 < path67.length; i10++) {
125885
- const segment = path67[i10];
125921
+ for (let i10 = 0; i10 < path68.length; i10++) {
125922
+ const segment = path68[i10];
125886
125923
  if (!isTypescriptObject(current)) {
125887
125924
  return void 0;
125888
125925
  }
@@ -125894,7 +125931,7 @@ function getRouter(router, path67) {
125894
125931
  continue;
125895
125932
  }
125896
125933
  const lazied = current;
125897
- const rest = path67.slice(i10);
125934
+ const rest = path68.slice(i10);
125898
125935
  return new Lazy({
125899
125936
  ...lazied["~orpc"],
125900
125937
  async loader() {
@@ -125909,40 +125946,40 @@ function getRouter(router, path67) {
125909
125946
  }
125910
125947
  return current;
125911
125948
  }
125912
- function walkProcedureContractsSync(router, callback, path67 = []) {
125949
+ function walkProcedureContractsSync(router, callback, path68 = []) {
125913
125950
  const lazyResults = [];
125914
- walkProcedureContractsSyncInternal(router, callback, path67.slice(), lazyResults);
125951
+ walkProcedureContractsSyncInternal(router, callback, path68.slice(), lazyResults);
125915
125952
  return lazyResults;
125916
125953
  }
125917
- function walkProcedureContractsSyncInternal(router, callback, path67, lazyResults) {
125954
+ function walkProcedureContractsSyncInternal(router, callback, path68, lazyResults) {
125918
125955
  const hiddenContract = getHiddenRouterContract(router);
125919
125956
  if (hiddenContract !== void 0) {
125920
125957
  router = hiddenContract;
125921
125958
  }
125922
125959
  if (router instanceof ProcedureContract) {
125923
- callback(router, path67.slice());
125960
+ callback(router, path68.slice());
125924
125961
  return;
125925
125962
  }
125926
125963
  if (!isTypescriptObject(router)) {
125927
125964
  return;
125928
125965
  }
125929
125966
  for (const [key, value2] of Object.entries(router)) {
125930
- path67.push(key);
125967
+ path68.push(key);
125931
125968
  if (value2 instanceof Lazy) {
125932
- lazyResults.push({ router: value2, path: path67.slice() });
125969
+ lazyResults.push({ router: value2, path: path68.slice() });
125933
125970
  } else {
125934
- walkProcedureContractsSyncInternal(value2, callback, path67, lazyResults);
125971
+ walkProcedureContractsSyncInternal(value2, callback, path68, lazyResults);
125935
125972
  }
125936
- path67.pop();
125973
+ path68.pop();
125937
125974
  }
125938
125975
  }
125939
- async function walkProcedureContractsAsync(router, callback, path67 = []) {
125976
+ async function walkProcedureContractsAsync(router, callback, path68 = []) {
125940
125977
  const hiddenContract = getHiddenRouterContract(router);
125941
125978
  if (hiddenContract !== void 0) {
125942
125979
  router = hiddenContract;
125943
125980
  }
125944
125981
  if (router instanceof ProcedureContract) {
125945
- await callback(router, path67);
125982
+ await callback(router, path68);
125946
125983
  return;
125947
125984
  }
125948
125985
  if (!isTypescriptObject(router)) {
@@ -125951,9 +125988,9 @@ async function walkProcedureContractsAsync(router, callback, path67 = []) {
125951
125988
  for (const [key, value2] of Object.entries(router)) {
125952
125989
  if (value2 instanceof Lazy) {
125953
125990
  const { default: router2 } = await unlazy(value2);
125954
- await walkProcedureContractsAsync(router2, callback, [...path67, key]);
125991
+ await walkProcedureContractsAsync(router2, callback, [...path68, key]);
125955
125992
  } else {
125956
- await walkProcedureContractsAsync(value2, callback, [...path67, key]);
125993
+ await walkProcedureContractsAsync(value2, callback, [...path68, key]);
125957
125994
  }
125958
125995
  }
125959
125996
  }
@@ -126439,18 +126476,18 @@ function rewriteComponentSchemaRefs(schema, renameMap) {
126439
126476
  }
126440
126477
  var OpenAPIGeneratorError = class extends TypeError {
126441
126478
  };
126442
- function toOpenAPIPath(path67, dynamicPathParams) {
126479
+ function toOpenAPIPath(path68, dynamicPathParams) {
126443
126480
  if (!dynamicPathParams?.length) {
126444
- return path67;
126481
+ return path68;
126445
126482
  }
126446
126483
  let normalized = "";
126447
126484
  let currentIndex = 0;
126448
126485
  for (const param of dynamicPathParams) {
126449
- normalized += path67.slice(currentIndex, param.startIndex);
126486
+ normalized += path68.slice(currentIndex, param.startIndex);
126450
126487
  normalized += `{${param.parameterName}}`;
126451
126488
  currentIndex = param.startIndex + param.segment.length;
126452
126489
  }
126453
- normalized += path67.slice(currentIndex);
126490
+ normalized += path68.slice(currentIndex);
126454
126491
  return normalized;
126455
126492
  }
126456
126493
  function buildRequest(ctx, operation, def, meta3, dynamicPathParams) {
@@ -126884,8 +126921,8 @@ var OpenAPIGenerator = class {
126884
126921
  customErrorResponseBodySchema: options.customErrorResponseBodySchema
126885
126922
  };
126886
126923
  const errors = [];
126887
- await walkProcedureContractsAsync(router, (contract, path67) => {
126888
- if (value(options.filter, contract, path67) === false) {
126924
+ await walkProcedureContractsAsync(router, (contract, path68) => {
126925
+ if (value(options.filter, contract, path68) === false) {
126889
126926
  return;
126890
126927
  }
126891
126928
  try {
@@ -126897,7 +126934,7 @@ var OpenAPIGenerator = class {
126897
126934
  `QUERY operations require OpenAPI 3.2, but version "${version2}" was requested.`
126898
126935
  );
126899
126936
  }
126900
- const postPath = meta3?.path ?? pathToHttpPath(path67);
126937
+ const postPath = meta3?.path ?? pathToHttpPath(path68);
126901
126938
  const httpPath = meta3?.prefix ? mergeHttpPath(meta3.prefix, postPath) : postPath;
126902
126939
  const dynamicPathParams = getDynamicPathParams(httpPath);
126903
126940
  const openApiPath = toOpenAPIPath(httpPath, dynamicPathParams);
@@ -126906,7 +126943,7 @@ var OpenAPIGenerator = class {
126906
126943
  operation = meta3.spec;
126907
126944
  } else {
126908
126945
  operation = {
126909
- operationId: meta3?.operationId ?? path67.join("."),
126946
+ operationId: meta3?.operationId ?? path68.join("."),
126910
126947
  summary: meta3?.summary,
126911
126948
  description: meta3?.description,
126912
126949
  deprecated: meta3?.deprecated,
@@ -126926,7 +126963,7 @@ var OpenAPIGenerator = class {
126926
126963
  if (!(e14 instanceof OpenAPIGeneratorError)) {
126927
126964
  throw e14;
126928
126965
  }
126929
- errors.push(`Procedure at ${path67.join(".") || "(root)"}: ${e14.message}`);
126966
+ errors.push(`Procedure at ${path68.join(".") || "(root)"}: ${e14.message}`);
126930
126967
  }
126931
126968
  });
126932
126969
  if (errors.length) {
@@ -127628,15 +127665,15 @@ async function toStandardBody(re, options) {
127628
127665
  throw new TypeError("Failed to read body: body stream already read");
127629
127666
  }
127630
127667
  if (hint === "json") {
127631
- const text3 = await re.text();
127632
- return parseEmptyableJSON(text3);
127668
+ const text4 = await re.text();
127669
+ return parseEmptyableJSON(text4);
127633
127670
  }
127634
127671
  if (hint === "form-data") {
127635
127672
  return await re.formData();
127636
127673
  }
127637
127674
  if (hint === "url-search-params") {
127638
- const text3 = await re.text();
127639
- return new URLSearchParams(text3);
127675
+ const text4 = await re.text();
127676
+ return new URLSearchParams(text4);
127640
127677
  }
127641
127678
  if (hint === "event-stream") {
127642
127679
  return toAsyncIteratorObject(re.body);
@@ -127773,16 +127810,16 @@ var StandardLink = class {
127773
127810
  /**
127774
127811
  * @throws ORPCError, transport-level errors (network failures, timeouts, etc.)
127775
127812
  */
127776
- call(path67, input2, options) {
127777
- return runWithSpan(`${ORPC_NAME}.${path67.join("/")}`, (span) => {
127813
+ call(path68, input2, options) {
127814
+ return runWithSpan(`${ORPC_NAME}.${path68.join("/")}`, (span) => {
127778
127815
  span?.setAttribute("rpc.system", ORPC_NAME);
127779
- span?.setAttribute("rpc.method", path67.join("."));
127816
+ span?.setAttribute("rpc.method", path68.join("."));
127780
127817
  if (getTracer() && isAsyncIteratorObject(input2)) {
127781
127818
  input2 = override(input2, traceAsyncIterator("consume_async_iterator_object_input", input2));
127782
127819
  } else if (getTracer() && input2 instanceof ReadableStream) {
127783
127820
  input2 = override(input2, traceReadableStream("consume_octet_stream_input", input2));
127784
127821
  }
127785
- return intercept(this.interceptors, { ...options, path: path67, input: input2 }, async ({ path: path210, input: input22, ...options2 }) => {
127822
+ return intercept(this.interceptors, { ...options, path: path68, input: input2 }, async ({ path: path210, input: input22, ...options2 }) => {
127786
127823
  const tracer = getTracer();
127787
127824
  const activeSpan = tracer?.getActiveSpan() ?? span;
127788
127825
  let request7 = await runWithSpan(
@@ -127839,18 +127876,18 @@ var RPCLinkCodec = class {
127839
127876
  this.headers = options.headers ?? {};
127840
127877
  this.serializer = options.serializer ?? new RPCSerializer();
127841
127878
  }
127842
- async encodeInput(input2, path67, options) {
127843
- let headers = toResolvedStandardHeaders(await value(this.headers, options, path67, input2));
127879
+ async encodeInput(input2, path68, options) {
127880
+ let headers = toResolvedStandardHeaders(await value(this.headers, options, path68, input2));
127844
127881
  if (options.lastEventId !== void 0) {
127845
127882
  headers = mergeStandardHeaders(headers, { "last-event-id": options.lastEventId });
127846
127883
  }
127847
- const expectedMethod = await value(this.expectedMethod, options, path67, input2);
127848
- const baseUrl = await value(this.baseUrl, options, path67, input2);
127884
+ const expectedMethod = await value(this.expectedMethod, options, path68, input2);
127885
+ const baseUrl = await value(this.baseUrl, options, path68, input2);
127849
127886
  const [pathname, search, hash2] = parseStandardUrl(baseUrl);
127850
- const newPathname = `${pathname.replace(END_SLASH_REGEX, "")}${pathToHttpPath(path67)}`;
127887
+ const newPathname = `${pathname.replace(END_SLASH_REGEX, "")}${pathToHttpPath(path68)}`;
127851
127888
  const serialized = this.serializer.serialize(input2);
127852
127889
  if (expectedMethod === "GET" && !(serialized instanceof Blob) && !(serialized instanceof ReadableStream) && !(serialized instanceof FormData) && !isAsyncIteratorObject(serialized)) {
127853
- const maxUrlLength = await value(this.maxUrlLength, options, path67, input2);
127890
+ const maxUrlLength = await value(this.maxUrlLength, options, path68, input2);
127854
127891
  const mergedSearch = new URLSearchParams(search);
127855
127892
  mergedSearch.append("data", stringifyJSON(serialized) ?? "");
127856
127893
  const url22 = `${newPathname}?${mergedSearch}${hash2 ?? ""}`;
@@ -127935,8 +127972,8 @@ var FetchLinkTransport = class {
127935
127972
  this.fetch = options.fetch ?? ((url2, init) => globalThis.fetch(url2, init));
127936
127973
  this.toFetchRequestOptions = options.toFetchRequest;
127937
127974
  }
127938
- async send(standardRequest, path67, options) {
127939
- let origin = await value(this.origin, options, path67);
127975
+ async send(standardRequest, path68, options) {
127976
+ let origin = await value(this.origin, options, path68);
127940
127977
  if (origin?.endsWith("/")) {
127941
127978
  origin = origin.slice(0, -1);
127942
127979
  }
@@ -127956,7 +127993,7 @@ var FetchLinkTransport = class {
127956
127993
  }
127957
127994
  }
127958
127995
  const fetch3 = this.fetch;
127959
- const response = await fetch3(url2, init, options, path67);
127996
+ const response = await fetch3(url2, init, options, path68);
127960
127997
  const standardResponse = toStandardLazyResponse(response);
127961
127998
  return standardResponse;
127962
127999
  }
@@ -128112,16 +128149,16 @@ async function toStandardBody2(req, options = {}) {
128112
128149
  throw new TypeError("Failed to read body: body stream already read or destroyed");
128113
128150
  }
128114
128151
  if (hint === "json") {
128115
- const text3 = await _streamToString(req);
128116
- return parseEmptyableJSON(text3);
128152
+ const text4 = await _streamToString(req);
128153
+ return parseEmptyableJSON(text4);
128117
128154
  }
128118
128155
  const contentType = req.headers["content-type"];
128119
128156
  if (hint === "form-data") {
128120
128157
  return _streamToFormData(req, contentType);
128121
128158
  }
128122
128159
  if (hint === "url-search-params") {
128123
- const text3 = await _streamToString(req);
128124
- return new URLSearchParams(text3);
128160
+ const text4 = await _streamToString(req);
128161
+ return new URLSearchParams(text4);
128125
128162
  }
128126
128163
  if (hint === "event-stream") {
128127
128164
  return toAsyncIteratorObject2(req);
@@ -128347,14 +128384,14 @@ var StandardHandler = class {
128347
128384
  span?.setAttribute("url.path", request22.url);
128348
128385
  return { matched: false };
128349
128386
  }
128350
- const { path: path67, procedure, decodeInput } = matchedOrNot;
128351
- span?.updateName(`${ORPC_NAME}.${path67.join("/")}`);
128387
+ const { path: path68, procedure, decodeInput } = matchedOrNot;
128388
+ span?.updateName(`${ORPC_NAME}.${path68.join("/")}`);
128352
128389
  span?.setAttribute("rpc.system", ORPC_NAME);
128353
- span?.setAttribute("rpc.method", path67.join("."));
128390
+ span?.setAttribute("rpc.method", path68.join("."));
128354
128391
  try {
128355
128392
  const response = await intercept(
128356
128393
  this.interceptors,
128357
- { context: context2, prefix: prefix2, request: request22, path: path67, procedure, decodeInput },
128394
+ { context: context2, prefix: prefix2, request: request22, path: path68, procedure, decodeInput },
128358
128395
  async ({ context: context3, prefix: prefix3, request: request32, path: path210, procedure: procedure2, decodeInput: decodeInput2 }) => {
128359
128396
  step2 = "decode_input";
128360
128397
  let input2 = await runWithSpan("decode_input", decodeInput2);
@@ -128388,7 +128425,7 @@ var StandardHandler = class {
128388
128425
  message: `Malformed request. Ensure the request body is properly formatted and the 'Content-Type' header is set correctly.`,
128389
128426
  cause: e14
128390
128427
  }) : toORPCError(e14);
128391
- const response = await this.codec.encodeError(error63, procedure, path67, { context: context2, prefix: prefix2 });
128428
+ const response = await this.codec.encodeError(error63, procedure, path68, { context: context2, prefix: prefix2 });
128392
128429
  return { matched: true, response };
128393
128430
  }
128394
128431
  }
@@ -128494,7 +128531,7 @@ var RPCMatcher = class {
128494
128531
  this.rootRouter = router;
128495
128532
  this.index(router);
128496
128533
  }
128497
- index(router, path67 = []) {
128534
+ index(router, path68 = []) {
128498
128535
  const lazyResults = walkProcedureContractsSync(router, (procedure, procedurePath) => {
128499
128536
  if (!value(this.filter, procedure, procedurePath)) {
128500
128537
  return;
@@ -128505,7 +128542,7 @@ var RPCMatcher = class {
128505
128542
  // contract-first entries have no implementation yet, resolveProcedure fills it in on demand
128506
128543
  procedure: procedure instanceof Procedure ? procedure : void 0
128507
128544
  });
128508
- }, path67);
128545
+ }, path68);
128509
128546
  for (const result of lazyResults) {
128510
128547
  this.pendingLazyRouters.set(pathToHttpPath(result.path), result);
128511
128548
  }
@@ -128637,10 +128674,10 @@ var RPCHandlerCodec = class {
128637
128674
  }
128638
128675
  };
128639
128676
  }
128640
- encodeOutput(output2, procedure, path67, options) {
128677
+ encodeOutput(output2, procedure, path68, options) {
128641
128678
  return {
128642
128679
  headers: {},
128643
- status: value(this.outputStatus, output2, procedure, path67, options) ?? DEFAULT_SUCCESS_STATUS,
128680
+ status: value(this.outputStatus, output2, procedure, path68, options) ?? DEFAULT_SUCCESS_STATUS,
128644
128681
  body: this.serializer.serialize(output2)
128645
128682
  };
128646
128683
  }
@@ -128694,39 +128731,39 @@ function createRouter() {
128694
128731
  static: new NullProtoObj2()
128695
128732
  };
128696
128733
  }
128697
- function scanFirstGroup(path67) {
128734
+ function scanFirstGroup(path68) {
128698
128735
  let i10 = 0;
128699
128736
  let depth = 0;
128700
- for (; i10 < path67.length; i10++) {
128701
- const c10 = path67.charCodeAt(i10);
128737
+ for (; i10 < path68.length; i10++) {
128738
+ const c10 = path68.charCodeAt(i10);
128702
128739
  if (c10 === 92) i10++;
128703
128740
  else if (c10 === 40) depth++;
128704
128741
  else if (c10 === 41 && depth > 0) depth--;
128705
128742
  else if (c10 === 123 && depth === 0) break;
128706
128743
  }
128707
- if (i10 >= path67.length) return;
128744
+ if (i10 >= path68.length) return;
128708
128745
  let j10 = i10 + 1;
128709
128746
  depth = 0;
128710
- for (; j10 < path67.length; j10++) {
128711
- const c10 = path67.charCodeAt(j10);
128747
+ for (; j10 < path68.length; j10++) {
128748
+ const c10 = path68.charCodeAt(j10);
128712
128749
  if (c10 === 92) j10++;
128713
128750
  else if (c10 === 40) depth++;
128714
128751
  else if (c10 === 41 && depth > 0) depth--;
128715
128752
  else if (c10 === 125 && depth === 0) break;
128716
128753
  }
128717
- if (j10 >= path67.length) return;
128718
- const mod = path67[j10 + 1];
128754
+ if (j10 >= path68.length) return;
128755
+ const mod = path68[j10 + 1];
128719
128756
  const hasMod = mod === "?" || mod === "+" || mod === "*";
128720
128757
  return [
128721
- path67.slice(0, i10),
128722
- path67.slice(i10 + 1, j10),
128723
- path67.slice(j10 + (hasMod ? 2 : 1)),
128758
+ path68.slice(0, i10),
128759
+ path68.slice(i10 + 1, j10),
128760
+ path68.slice(j10 + (hasMod ? 2 : 1)),
128724
128761
  hasMod ? mod : void 0
128725
128762
  ];
128726
128763
  }
128727
- function expandGroupDelimiters(path67) {
128728
- if (!path67.includes("{")) return;
128729
- const group = scanFirstGroup(path67);
128764
+ function expandGroupDelimiters(path68) {
128765
+ if (!path68.includes("{")) return;
128766
+ const group = scanFirstGroup(path68);
128730
128767
  if (!group) return;
128731
128768
  const [pre2, body, suf, mod] = group;
128732
128769
  if (!mod) return [pre2 + body + suf];
@@ -128796,9 +128833,9 @@ function replaceSegmentWildcards(segment, unnamedStart, toGroupKey = toUnnamedGr
128796
128833
  }
128797
128834
  return [replaced, nextIndex];
128798
128835
  }
128799
- function encodeEscapes(path67) {
128800
- if (!path67.includes("\\")) return path67;
128801
- return path67.replace(/\\([:(){}])/g, (_, c10) => "\uFFFD" + "ABCDE"[":(){}".indexOf(c10)]);
128836
+ function encodeEscapes(path68) {
128837
+ if (!path68.includes("\\")) return path68;
128838
+ return path68.replace(/\\([:(){}])/g, (_, c10) => "\uFFFD" + "ABCDE"[":(){}".indexOf(c10)]);
128802
128839
  }
128803
128840
  function segmentKey(segment) {
128804
128841
  if (segment.startsWith("**")) return 2;
@@ -128827,22 +128864,22 @@ function expandModifiers(segments) {
128827
128864
  return m10[2] === "+" ? [wc2] : [wc2, without];
128828
128865
  }
128829
128866
  }
128830
- function normalizePath(path67) {
128831
- if (!path67.includes("/.")) return path67;
128867
+ function normalizePath(path68) {
128868
+ if (!path68.includes("/.")) return path68;
128832
128869
  const r10 = [];
128833
- for (const s of path67.split("/")) if (s === ".") continue;
128870
+ for (const s of path68.split("/")) if (s === ".") continue;
128834
128871
  else if (s === ".." && r10.length > 1) r10.pop();
128835
128872
  else r10.push(s);
128836
128873
  return r10.join("/") || "/";
128837
128874
  }
128838
- function splitPath(path67) {
128839
- const s = path67.split("/");
128875
+ function splitPath(path68) {
128876
+ const s = path68.split("/");
128840
128877
  s.shift();
128841
128878
  if (s[s.length - 1] === "") s.pop();
128842
128879
  return s;
128843
128880
  }
128844
- function splitRoute(path67) {
128845
- const s = splitPath(path67);
128881
+ function splitRoute(path68) {
128882
+ const s = splitPath(path68);
128846
128883
  while (s[s.length - 1] === "") s.pop();
128847
128884
  return s;
128848
128885
  }
@@ -128858,16 +128895,16 @@ function getMatchParams(segments, paramsMap) {
128858
128895
  }
128859
128896
  return params;
128860
128897
  }
128861
- function addRoute(ctx, method = "", path67, data) {
128898
+ function addRoute(ctx, method = "", path68, data) {
128862
128899
  method = method.toUpperCase();
128863
- if (path67.charCodeAt(0) !== 47) path67 = `/${path67}`;
128864
- const groupExpanded = expandGroupDelimiters(path67);
128900
+ if (path68.charCodeAt(0) !== 47) path68 = `/${path68}`;
128901
+ const groupExpanded = expandGroupDelimiters(path68);
128865
128902
  if (groupExpanded) {
128866
128903
  for (const expandedPath of groupExpanded) addRoute(ctx, method, expandedPath, data);
128867
128904
  return;
128868
128905
  }
128869
- path67 = encodeEscapes(path67);
128870
- const segments = splitRoute(path67);
128906
+ path68 = encodeEscapes(path68);
128907
+ const segments = splitRoute(path68);
128871
128908
  const expanded = expandModifiers(segments);
128872
128909
  if (expanded) {
128873
128910
  for (const p of expanded) addRoute(ctx, method, p, data);
@@ -128958,15 +128995,15 @@ function getParamRegexp(segment, unnamedStart = 0) {
128958
128995
  const regex = _s2.replace(/:([\w-]+)(?:\(([^)]*)\))?/g, (_, id2, p) => `(?<${toGroupName(id2)}>${p || "[^/]+"})`).replace(/\((?![?<])/g, () => `(?<${toUnnamedGroupKey(_i2++)}>`).replace(/\uFFFE(.)/g, (_, c10) => /[.*+?^${}()|[\]\\]/.test(c10) ? `\\${c10}` : c10);
128959
128996
  return [new RegExp(`^${regex}$`), _i2];
128960
128997
  }
128961
- function findRoute(ctx, method = "", path67, opts) {
128962
- if (opts?.normalize) path67 = normalizePath(path67);
128963
- if (path67.charCodeAt(path67.length - 1) === 47) path67 = path67.slice(0, -1);
128964
- const staticNode = ctx.static[path67];
128998
+ function findRoute(ctx, method = "", path68, opts) {
128999
+ if (opts?.normalize) path68 = normalizePath(path68);
129000
+ if (path68.charCodeAt(path68.length - 1) === 47) path68 = path68.slice(0, -1);
129001
+ const staticNode = ctx.static[path68];
128965
129002
  if (staticNode && staticNode.methods) {
128966
129003
  const staticMatch = staticNode.methods[method] || staticNode.methods[""];
128967
129004
  if (staticMatch !== void 0) return staticMatch[0];
128968
129005
  }
128969
- const segments = splitPath(path67);
129006
+ const segments = splitPath(path68);
128970
129007
  const match = _lookupTree(ctx.root, method, segments, 0);
128971
129008
  if (match === void 0) return;
128972
129009
  if (opts?.params === false) return match;
@@ -129166,7 +129203,7 @@ var OpenAPIMatcher = class {
129166
129203
  this.rootRouter = router;
129167
129204
  this.index(router);
129168
129205
  }
129169
- index(router, path67 = []) {
129206
+ index(router, path68 = []) {
129170
129207
  const lazyResults = walkProcedureContractsSync(router, (contract, path210) => {
129171
129208
  if (!value(this.filter, contract, path210)) {
129172
129209
  return;
@@ -129181,7 +129218,7 @@ var OpenAPIMatcher = class {
129181
129218
  contract,
129182
129219
  procedure: contract instanceof Procedure ? contract : void 0
129183
129220
  });
129184
- }, path67);
129221
+ }, path68);
129185
129222
  for (const result of lazyResults) {
129186
129223
  const prefix = getOpenAPIMeta(result.router)?.prefix;
129187
129224
  this.pendingLazyRouters.add({
@@ -129268,20 +129305,20 @@ var OpenAPIMatcher = class {
129268
129305
  return entry.procedure;
129269
129306
  }
129270
129307
  };
129271
- function toRou3Pattern(path67) {
129272
- const params = getDynamicPathParams(path67);
129308
+ function toRou3Pattern(path68) {
129309
+ const params = getDynamicPathParams(path68);
129273
129310
  if (!params?.length) {
129274
- return path67;
129311
+ return path68;
129275
129312
  }
129276
129313
  for (let i10 = params.length - 1; i10 >= 0; i10--) {
129277
129314
  const param = params[i10];
129278
129315
  const pattern = param.allowsSlash ? `**:${param.parameterName}` : `:${param.parameterName}`;
129279
- path67 = path67.slice(0, param.startIndex) + pattern + path67.slice(param.startIndex + param.segment.length);
129316
+ path68 = path68.slice(0, param.startIndex) + pattern + path68.slice(param.startIndex + param.segment.length);
129280
129317
  }
129281
- return path67;
129318
+ return path68;
129282
129319
  }
129283
- function toRou3PrefixMatcher(path67) {
129284
- const pattern = toRou3Pattern(path67);
129320
+ function toRou3PrefixMatcher(path68) {
129321
+ const pattern = toRou3Pattern(path68);
129285
129322
  return routeToRegExp(pattern === "/" ? "/**" : `${pattern}/**`);
129286
129323
  }
129287
129324
  function decodeParams(params) {
@@ -129360,7 +129397,7 @@ var OpenAPIHandlerCodecCore = class {
129360
129397
  /**
129361
129398
  * @throws {TypeError} If `outputStructure` is "detailed" and the output doesn't match the expected structure.
129362
129399
  */
129363
- encodeOutput(output2, procedure, path67) {
129400
+ encodeOutput(output2, procedure, path68) {
129364
129401
  const meta3 = getOpenAPIMeta(procedure);
129365
129402
  const successStatus = meta3?.successStatus ?? DEFAULT_SUCCESS_STATUS;
129366
129403
  const outputStructure = meta3?.outputStructure ?? DEFAULT_OPENAPI_OUTPUT_STRUCTURE;
@@ -129373,7 +129410,7 @@ var OpenAPIHandlerCodecCore = class {
129373
129410
  }
129374
129411
  if (!isValidDetailedOutput(output2)) {
129375
129412
  throw new TypeError(`
129376
- Invalid "detailed" output structure returned by procedure (${path67.join(".")}):
129413
+ Invalid "detailed" output structure returned by procedure (${path68.join(".")}):
129377
129414
  \u2022 Expected an object with optional properties:
129378
129415
  - status (number <400)
129379
129416
  - headers (object)
@@ -129941,7 +129978,7 @@ function profileValue(name, paths) {
129941
129978
  function createConfigApiRouter(deps) {
129942
129979
  const authed = doorApiAuth(deps.expectedToken);
129943
129980
  const { paths } = deps;
129944
- const route = (path67, summary) => authed.meta(openapi({ method: "POST", path: path67, summary, tags: [CONFIG_API_TAG] }));
129981
+ const route = (path68, summary) => authed.meta(openapi({ method: "POST", path: path68, summary, tags: [CONFIG_API_TAG] }));
129945
129982
  return {
129946
129983
  config: {
129947
129984
  identity: {
@@ -130903,16 +130940,16 @@ function walk2(body, hashing, parentAfter) {
130903
130940
  continue;
130904
130941
  }
130905
130942
  const isKey = kind === STRING && depth >= 1 && expectKey[depth - 1] === true;
130906
- const text3 = isKey ? body.toString("latin1", start, end) : void 0;
130907
- if (isKey && text3 === CACHE_MARKER_KEY) {
130943
+ const text4 = isKey ? body.toString("latin1", start, end) : void 0;
130944
+ if (isKey && text4 === CACHE_MARKER_KEY) {
130908
130945
  skipNextValue = true;
130909
130946
  continue;
130910
130947
  }
130911
130948
  if (depth === 1 && isKey) {
130912
- topKey = text3;
130949
+ topKey = text4;
130913
130950
  }
130914
130951
  const closesMessages = kind === CLOSE && inMessages && depth === MESSAGES_ARRAY_DEPTH;
130915
- if (hashing && !closesMessages && !(depth === 1 && isKey && !THREAD_MEMBER_KEYS.has(text3 ?? ""))) {
130952
+ if (hashing && !closesMessages && !(depth === 1 && isKey && !THREAD_MEMBER_KEYS.has(text4 ?? ""))) {
130916
130953
  const target = inMessages ? messages : depth >= 1 && topKey !== void 0 && THREAD_MEMBER_KEYS.has(topKey) ? thread : void 0;
130917
130954
  if (target !== void 0) {
130918
130955
  target.update(body.subarray(start, end));
@@ -131882,8 +131919,8 @@ function createCodexRoute(ports) {
131882
131919
  if (!parsed.success) {
131883
131920
  return errorResponse(HTTP_STATUS.badRequest, "not a count_tokens request");
131884
131921
  }
131885
- const text3 = JSON.stringify({ system: parsed.data.system, messages: parsed.data.messages, tools: parsed.data.tools });
131886
- return { status: HTTP_STATUS.ok, headers: { "Content-Type": "application/json" }, body: JSON.stringify({ input_tokens: Math.ceil(text3.length / CHARS_PER_TOKEN) }) };
131922
+ const text4 = JSON.stringify({ system: parsed.data.system, messages: parsed.data.messages, tools: parsed.data.tools });
131923
+ return { status: HTTP_STATUS.ok, headers: { "Content-Type": "application/json" }, body: JSON.stringify({ input_tokens: Math.ceil(text4.length / CHARS_PER_TOKEN) }) };
131887
131924
  };
131888
131925
  return async (request7) => {
131889
131926
  if (request7.method === "GET" && request7.path === "/healthz") {
@@ -131966,8 +132003,8 @@ function createCodexRouteMount(ports, upstreamBase, provider) {
131966
132003
  request7.body.resume();
131967
132004
  return;
131968
132005
  }
131969
- const path67 = new URL(request7.url, "http://127.0.0.1").pathname;
131970
- const translated = { method: request7.method, path: path67, body, signal: request7.signal };
132006
+ const path68 = new URL(request7.url, "http://127.0.0.1").pathname;
132007
+ const translated = { method: request7.method, path: path68, body, signal: request7.signal };
131971
132008
  const routed = await route(translated);
131972
132009
  if (request7.signal.aborted) {
131973
132010
  return;
@@ -132588,8 +132625,8 @@ function createAntigravityRouteMount(ports, upstreamBase, provider) {
132588
132625
  request7.body.resume();
132589
132626
  return;
132590
132627
  }
132591
- const path67 = new URL(request7.url, "http://127.0.0.1").pathname;
132592
- const translated = { method: request7.method, path: path67, body, signal: request7.signal };
132628
+ const path68 = new URL(request7.url, "http://127.0.0.1").pathname;
132629
+ const translated = { method: request7.method, path: path68, body, signal: request7.signal };
132593
132630
  const routed = await route(translated);
132594
132631
  if (request7.signal.aborted) {
132595
132632
  return;
@@ -132630,7 +132667,7 @@ function createPassthroughRoute(name, target) {
132630
132667
  headroomUpstream: target.headroomUpstream,
132631
132668
  serve: async (request7, response) => {
132632
132669
  const incoming = new URL(request7.url, "http://127.0.0.1");
132633
- const path67 = target.stripPrefix !== void 0 && incoming.pathname.startsWith(target.stripPrefix) ? incoming.pathname.slice(target.stripPrefix.length) : incoming.pathname;
132670
+ const path68 = target.stripPrefix !== void 0 && incoming.pathname.startsWith(target.stripPrefix) ? incoming.pathname.slice(target.stripPrefix.length) : incoming.pathname;
132634
132671
  const headers = forwardableHeaders(request7.headers);
132635
132672
  delete headers.host;
132636
132673
  await new Promise((resolve2) => {
@@ -132638,7 +132675,7 @@ function createPassthroughRoute(name, target) {
132638
132675
  host: base.hostname,
132639
132676
  port: base.port === "" ? void 0 : Number(base.port),
132640
132677
  method: request7.method,
132641
- path: `${basePath}${path67}${incoming.search}`,
132678
+ path: `${basePath}${path68}${incoming.search}`,
132642
132679
  headers,
132643
132680
  agent
132644
132681
  };
@@ -132744,28 +132781,28 @@ async function scanRequestHead(request7, wholeBody = false) {
132744
132781
  const body = request7.body;
132745
132782
  const head = [];
132746
132783
  let seen = 0;
132747
- let text3 = "";
132784
+ let text4 = "";
132748
132785
  let decided = false;
132749
132786
  let ended = false;
132750
132787
  let error63;
132751
132788
  const replay = new import_node_stream2.PassThrough();
132752
- const modelIn = () => /"model"\s*:\s*"([^"]+)"/.exec(text3)?.[1];
132789
+ const modelIn = () => /"model"\s*:\s*"([^"]+)"/.exec(text4)?.[1];
132753
132790
  const settled = new Promise((resolve2) => {
132754
132791
  const settle2 = () => {
132755
132792
  const model = modelIn();
132756
- const hasImage = /"type"\s*:\s*"image"/.test(text3);
132793
+ const hasImage = /"type"\s*:\s*"image"/.test(text4);
132757
132794
  for (const chunk2 of head) {
132758
132795
  replay.write(chunk2);
132759
132796
  }
132760
- const maxTokens = /"max_tokens"\s*:\s*([0-9]+)/.exec(text3)?.[1];
132797
+ const maxTokens = /"max_tokens"\s*:\s*([0-9]+)/.exec(text4)?.[1];
132761
132798
  resolve2({
132762
132799
  ...model === void 0 ? {} : { model },
132763
132800
  hasImage,
132764
- toolsPresent: /"tools"\s*:\s*\[\s*\{/.test(text3),
132765
- thinking: /"thinking"\s*:\s*\{\s*"type"\s*:\s*"enabled"/.test(text3),
132801
+ toolsPresent: /"tools"\s*:\s*\[\s*\{/.test(text4),
132802
+ thinking: /"thinking"\s*:\s*\{\s*"type"\s*:\s*"enabled"/.test(text4),
132766
132803
  ...maxTokens === void 0 ? {} : { maxTokens: Number(maxTokens) },
132767
132804
  isCountTokens: request7.url.includes("/v1/messages/count_tokens"),
132768
- ...wholeBody ? { whole: true, text: text3 } : {},
132805
+ ...wholeBody ? { whole: true, text: text4 } : {},
132769
132806
  replayed: { ...request7, body: replay }
132770
132807
  });
132771
132808
  };
@@ -132781,7 +132818,7 @@ async function scanRequestHead(request7, wholeBody = false) {
132781
132818
  }
132782
132819
  head.push(chunk2);
132783
132820
  seen += chunk2.length;
132784
- text3 += chunk2.toString("utf8");
132821
+ text4 += chunk2.toString("utf8");
132785
132822
  if (!wholeBody && (modelIn() !== void 0 || seen >= REQUEST_SCAN_CAP_BYTES)) {
132786
132823
  decided = true;
132787
132824
  settle2();
@@ -132810,13 +132847,13 @@ async function scanRequestHead(request7, wholeBody = false) {
132810
132847
  }
132811
132848
 
132812
132849
  // src/frontdoor/providerRoute.ts
132813
- var isRcSelfHostPath = (path67) => path67 === "/v1/code/sessions" || path67.startsWith("/v1/code/sessions/") || path67 === "/v1/sessions" || path67.startsWith("/v1/sessions/");
132850
+ var isRcSelfHostPath = (path68) => path68 === "/v1/code/sessions" || path68.startsWith("/v1/code/sessions/") || path68 === "/v1/sessions" || path68.startsWith("/v1/sessions/");
132814
132851
  function scopeSessionProviderPath(request7) {
132815
132852
  if (request7.session.provider === void 0) {
132816
132853
  return request7;
132817
132854
  }
132818
- const path67 = new URL(request7.url, "http://127.0.0.1").pathname;
132819
- if (!path67.startsWith("/v1/") || isRcSelfHostPath(path67)) {
132855
+ const path68 = new URL(request7.url, "http://127.0.0.1").pathname;
132856
+ if (!path68.startsWith("/v1/") || isRcSelfHostPath(path68)) {
132820
132857
  return request7;
132821
132858
  }
132822
132859
  return { ...request7, url: `${PROVIDER_PATH_PREFIX}${encodeURIComponent(request7.session.provider)}${request7.url}` };
@@ -132939,13 +132976,13 @@ function createProviderRouteResolver(deps) {
132939
132976
  return route;
132940
132977
  };
132941
132978
  const resolve2 = (request7) => {
132942
- const path67 = new URL(request7.url, "http://127.0.0.1").pathname;
132943
- const scoped = parseProviderPath(path67);
132979
+ const path68 = new URL(request7.url, "http://127.0.0.1").pathname;
132980
+ const scoped = parseProviderPath(path68);
132944
132981
  if (scoped === void 0) {
132945
- if (deps.rcSelfHostRoute !== void 0 && isRcSelfHostPath(path67)) {
132982
+ if (deps.rcSelfHostRoute !== void 0 && isRcSelfHostPath(path68)) {
132946
132983
  return { ok: true, route: deps.rcSelfHostRoute };
132947
132984
  }
132948
- return path67.startsWith("/v1/") ? { ok: true, route: oauthRoute } : { ok: false, status: HTTP_STATUS.notFound, message: `no such endpoint: ${path67}` };
132985
+ return path68.startsWith("/v1/") ? { ok: true, route: oauthRoute } : { ok: false, status: HTTP_STATUS.notFound, message: `no such endpoint: ${path68}` };
132949
132986
  }
132950
132987
  const { provider } = scoped;
132951
132988
  let definition;
@@ -133037,8 +133074,8 @@ function createProviderRouteResolver(deps) {
133037
133074
  let modelChoice;
133038
133075
  const visited = /* @__PURE__ */ new Set();
133039
133076
  for (; ; ) {
133040
- const path67 = new URL(current.url, "http://127.0.0.1").pathname;
133041
- const scoped = parseProviderPath(path67);
133077
+ const path68 = new URL(current.url, "http://127.0.0.1").pathname;
133078
+ const scoped = parseProviderPath(path68);
133042
133079
  const providerName = scoped?.provider ?? current.session.provider;
133043
133080
  if (providerName !== void 0 && visited.has(providerName)) {
133044
133081
  return { ok: false, status: HTTP_STATUS.internalServerError, message: `provider routing cycle: ${[...visited, providerName].join(" -> ")}` };
@@ -133053,7 +133090,7 @@ function createProviderRouteResolver(deps) {
133053
133090
  } catch {
133054
133091
  routes = void 0;
133055
133092
  }
133056
- const resolvesNames = !nameResolved && !isRcSelfHostPath(path67);
133093
+ const resolvesNames = !nameResolved && !isRcSelfHostPath(path68);
133057
133094
  if (resolvesNames) {
133058
133095
  const scan2 = await scanRequestHead(current, true);
133059
133096
  if (scan2.replayed === void 0) {
@@ -133092,7 +133129,7 @@ function createProviderRouteResolver(deps) {
133092
133129
  }
133093
133130
  if (routed.provider !== providerName) {
133094
133131
  const scopedPrefix = providerName === void 0 ? void 0 : `${PROVIDER_PATH_PREFIX}${encodeURIComponent(providerName)}`;
133095
- const rest2 = scopedPrefix !== void 0 && path67.startsWith(scopedPrefix) ? path67.slice(scopedPrefix.length) : path67;
133132
+ const rest2 = scopedPrefix !== void 0 && path68.startsWith(scopedPrefix) ? path68.slice(scopedPrefix.length) : path68;
133096
133133
  const query2 = current.url.includes("?") ? current.url.slice(current.url.indexOf("?")) : "";
133097
133134
  const carried = replay;
133098
133135
  current = { ...current, url: `${PROVIDER_PATH_PREFIX}${encodeURIComponent(routed.provider)}${rest2}${query2}`, body: carried.body, headers: carried.headers };
@@ -133146,7 +133183,7 @@ function createProviderRouteResolver(deps) {
133146
133183
  const headers = Object.fromEntries(Object.entries(replay.headers).filter(([name]) => name.toLowerCase() !== "content-length"));
133147
133184
  replay = { ...replay, headers, body: import_node_stream3.Readable.from([Buffer.from(rewritten, "utf8")]) };
133148
133185
  }
133149
- const rest = scoped === void 0 ? path67 : path67.slice(`${PROVIDER_PATH_PREFIX}${encodeURIComponent(scoped.provider)}`.length);
133186
+ const rest = scoped === void 0 ? path68 : path68.slice(`${PROVIDER_PATH_PREFIX}${encodeURIComponent(scoped.provider)}`.length);
133150
133187
  const query = current.url.includes("?") ? current.url.slice(current.url.indexOf("?")) : "";
133151
133188
  current = { ...current, url: `${PROVIDER_PATH_PREFIX}${encodeURIComponent(matched.provider)}${rest}${query}`, body: replay.body, headers: replay.headers };
133152
133189
  }
@@ -133284,9 +133321,9 @@ function growthBookFeatures() {
133284
133321
  };
133285
133322
  }
133286
133323
  var answerServerJson = (response, status, body) => {
133287
- const text3 = JSON.stringify(body);
133288
- response.writeHead(status, { "content-type": "application/json", "content-length": String(Buffer.byteLength(text3, "utf8")) });
133289
- response.end(text3);
133324
+ const text4 = JSON.stringify(body);
133325
+ response.writeHead(status, { "content-type": "application/json", "content-length": String(Buffer.byteLength(text4, "utf8")) });
133326
+ response.end(text4);
133290
133327
  };
133291
133328
  function createRcSelfHostLocal(deps) {
133292
133329
  return {
@@ -133497,8 +133534,8 @@ function formatRcPendingList(pending) {
133497
133534
  }
133498
133535
  return pending.map((request7) => `${request7.sessionId} ${request7.requestId} ${request7.type}${request7.summary === "" ? "" : ` ${request7.summary}`} observed ${new Date(request7.observedAt).toISOString()}`);
133499
133536
  }
133500
- function eventExcerpt(text3) {
133501
- return text3.length <= RC_PENDING_SUMMARY_EXCERPT_CHARS ? text3 : `${text3.slice(0, RC_PENDING_SUMMARY_EXCERPT_CHARS)}...`;
133537
+ function eventExcerpt(text4) {
133538
+ return text4.length <= RC_PENDING_SUMMARY_EXCERPT_CHARS ? text4 : `${text4.slice(0, RC_PENDING_SUMMARY_EXCERPT_CHARS)}...`;
133502
133539
  }
133503
133540
  var PERCENT_SCALE = 100;
133504
133541
  var MS_PER_SECOND14 = 1e3;
@@ -135197,9 +135234,9 @@ data: ${JSON.stringify(envelope)}
135197
135234
  };
135198
135235
  const sessionRow = (session) => ({ id: session.id, title: session.title, created_at: new Date(session.createdAt).toISOString(), status: "active", conversation_id: session.conversation.id });
135199
135236
  const answerJson2 = async (response, status, body, extraHeaders = {}) => {
135200
- const text3 = JSON.stringify(body);
135201
- response.start(status, { "content-type": "application/json", "content-length": String(Buffer.byteLength(text3, "utf8")), ...extraHeaders });
135202
- await response.write(text3);
135237
+ const text4 = JSON.stringify(body);
135238
+ response.start(status, { "content-type": "application/json", "content-length": String(Buffer.byteLength(text4, "utf8")), ...extraHeaders });
135239
+ await response.write(text4);
135203
135240
  response.end();
135204
135241
  };
135205
135242
  const noCredential = async (response) => {
@@ -135601,8 +135638,8 @@ function createSseParser() {
135601
135638
  let dataLines = [];
135602
135639
  let seenAnyText = false;
135603
135640
  return {
135604
- write: (text3) => {
135605
- let incoming = text3;
135641
+ write: (text4) => {
135642
+ let incoming = text4;
135606
135643
  if (!seenAnyText) {
135607
135644
  seenAnyText = true;
135608
135645
  incoming = incoming.charCodeAt(0) === SSE_BYTE_ORDER_MARK ? incoming.slice(1) : incoming;
@@ -136494,7 +136531,7 @@ function realFrontDoorSupervisorPorts(paths, respawnGeneration, retire, trackTun
136494
136531
  startProviderListener: async (preferredPort) => {
136495
136532
  const authority = loadCa();
136496
136533
  const rcDial = rcSelfHost ? lateRcEventDial(rcSelfHostDialTarget) : realRcEventDial();
136497
- const rcInject = async (sessionId, text3) => await injectRcUserMessage({ credentialOf: rcTracker.credentialOf, noteSequenceNums: rcTracker.noteSequenceNums, dial: rcDial, newUuid: import_node_crypto25.randomUUID }, sessionId, text3);
136534
+ const rcInject = async (sessionId, text4) => await injectRcUserMessage({ credentialOf: rcTracker.credentialOf, noteSequenceNums: rcTracker.noteSequenceNums, dial: rcDial, newUuid: import_node_crypto25.randomUUID }, sessionId, text4);
136498
136535
  const rcAnswer = async (sessionId, requestId, decision) => await answerRcControlRequest({ credentialOf: rcTracker.credentialOf, pendingOf: (id2) => rcTracker.pendingOf(id2), completePending: rcTracker.completePending, noteSequenceNums: rcTracker.noteSequenceNums, dial: rcDial }, sessionId, requestId, decision);
136499
136536
  const rcControlRequestDeps = { credentialOf: rcTracker.credentialOf, noteSequenceNums: rcTracker.noteSequenceNums, dial: rcDial, newUuid: import_node_crypto25.randomUUID };
136500
136537
  const rcInterrupt = async (sessionId) => await interruptRcSession(rcControlRequestDeps, sessionId);
@@ -136780,7 +136817,7 @@ function registerFrontDoorCommand(program2, deps) {
136780
136817
  // src/statusline/commands.ts
136781
136818
  var import_node_child_process8 = require("node:child_process");
136782
136819
  var import_node_os13 = __toESM(require("node:os"), 1);
136783
- var import_node_path57 = __toESM(require("node:path"), 1);
136820
+ var import_node_path58 = __toESM(require("node:path"), 1);
136784
136821
  init_commandDeps();
136785
136822
  init_statusline();
136786
136823
  init_providersStore();
@@ -137107,6 +137144,10 @@ var ClientPayloadSchema = external_exports.looseObject({
137107
137144
  session_id: text2,
137108
137145
  transcript_path: text2,
137109
137146
  cwd: text2,
137147
+ /** The Claude Code release the session runs. */
137148
+ version: text2,
137149
+ /** The reasoning effort: a level name, or an object carrying one in `level` (Claude Code 2.1.115 and later). */
137150
+ effort: external_exports.union([external_exports.string(), external_exports.looseObject({ level: text2 })]).optional().catch(void 0),
137110
137151
  workspace: external_exports.looseObject({
137111
137152
  current_dir: text2,
137112
137153
  project_dir: text2,
@@ -137155,9 +137196,24 @@ function realStatuslinePorts(env) {
137155
137196
  return {
137156
137197
  env,
137157
137198
  homeDirectory: import_node_os12.default.homedir(),
137158
- readText: (path67) => {
137199
+ readText: (path68) => {
137159
137200
  try {
137160
- return import_node_fs22.default.readFileSync(path67, "utf8");
137201
+ return import_node_fs22.default.readFileSync(path68, "utf8");
137202
+ } catch {
137203
+ return void 0;
137204
+ }
137205
+ },
137206
+ readRange: (file2, start, length) => {
137207
+ try {
137208
+ const descriptor = import_node_fs22.default.openSync(file2, "r");
137209
+ try {
137210
+ const { size } = import_node_fs22.default.fstatSync(descriptor);
137211
+ const buffer2 = Buffer.alloc(Math.max(0, Math.min(length, size - start)));
137212
+ const read = import_node_fs22.default.readSync(descriptor, buffer2, 0, buffer2.length, start);
137213
+ return { size, bytes: buffer2.subarray(0, read) };
137214
+ } finally {
137215
+ import_node_fs22.default.closeSync(descriptor);
137216
+ }
137161
137217
  } catch {
137162
137218
  return void 0;
137163
137219
  }
@@ -137169,23 +137225,23 @@ function realStatuslinePorts(env) {
137169
137225
  return void 0;
137170
137226
  }
137171
137227
  },
137172
- entryKind: (path67) => {
137228
+ entryKind: (path68) => {
137173
137229
  try {
137174
- return import_node_fs22.default.lstatSync(path67).isDirectory() ? "directory" : "other";
137230
+ return import_node_fs22.default.lstatSync(path68).isDirectory() ? "directory" : "other";
137175
137231
  } catch {
137176
137232
  return void 0;
137177
137233
  }
137178
137234
  },
137179
- realPath: (path67) => {
137235
+ realPath: (path68) => {
137180
137236
  try {
137181
- return import_node_fs22.default.realpathSync(path67);
137237
+ return import_node_fs22.default.realpathSync(path68);
137182
137238
  } catch {
137183
137239
  return void 0;
137184
137240
  }
137185
137241
  },
137186
- modifiedAtMs: (path67) => {
137242
+ modifiedAtMs: (path68) => {
137187
137243
  try {
137188
- return import_node_fs22.default.statSync(path67).mtimeMs;
137244
+ return import_node_fs22.default.statSync(path68).mtimeMs;
137189
137245
  } catch {
137190
137246
  return void 0;
137191
137247
  }
@@ -137200,8 +137256,8 @@ init_statusline();
137200
137256
  var ESCAPE_CHAR_CODE = 27;
137201
137257
  var ESCAPE = String.fromCharCode(ESCAPE_CHAR_CODE);
137202
137258
  var ANSI_REGEX = new RegExp(`${ESCAPE}\\[[0-9;]*[a-zA-Z]`, "g");
137203
- function visibleLength(text3) {
137204
- return text3.replace(ANSI_REGEX, "").length;
137259
+ function visibleLength(text4) {
137260
+ return text4.replace(ANSI_REGEX, "").length;
137205
137261
  }
137206
137262
 
137207
137263
  // src/statusline/barGrid.ts
@@ -137230,8 +137286,8 @@ function measureGrid(rows, separatorLength, baseBarCells) {
137230
137286
  const fixed = [...prefixWidths, ...suffixWidths].reduce((total, width) => total + width, 0) + columns * (baseBarCells + BRACKET_COLUMNS);
137231
137287
  return { rows, columns, prefixWidths, suffixWidths, baseWidth: fixed + separatorLength * (columns - 1) };
137232
137288
  }
137233
- function padTo(text3, width) {
137234
- return text3 + " ".repeat(Math.max(0, width - visibleLength(text3)));
137289
+ function padTo(text4, width) {
137290
+ return text4 + " ".repeat(Math.max(0, width - visibleLength(text4)));
137235
137291
  }
137236
137292
  function renderGrid(grid, maxWidth, separator, baseBarCells) {
137237
137293
  const separatorLength = visibleLength(separator);
@@ -137274,6 +137330,12 @@ function layoutBarGrid(groups, maxWidth, separator, baseBarCells) {
137274
137330
  return renderGrid(layoutFor(1), maxWidth, separator, baseBarCells);
137275
137331
  }
137276
137332
 
137333
+ // src/statusline/graphemes.ts
137334
+ var SEGMENTER = new Intl.Segmenter(void 0, { granularity: "grapheme" });
137335
+ function graphemesOf(text4) {
137336
+ return Array.from(SEGMENTER.segment(text4), (part) => part.segment);
137337
+ }
137338
+
137277
137339
  // src/statusline/elements/header/account.ts
137278
137340
  function tierSuffixOf(tier) {
137279
137341
  const match = /_(\d+x)$/i.exec(tier ?? "");
@@ -137323,14 +137385,79 @@ function planLabelOf(tier) {
137323
137385
  }
137324
137386
  return cleaned;
137325
137387
  }
137326
- function accountSegment({ summary }) {
137388
+ function truncatedUser(email3, length) {
137389
+ const characters = graphemesOf(email3);
137390
+ return length === 0 || characters.length <= length ? email3 : `${characters.slice(0, length).join("")}\u2026`;
137391
+ }
137392
+ function accountSegment({ summary, settings: settings2 }) {
137327
137393
  const loginPlan = summary.provider === void 0 ? summary.loginPlan ?? accountPlanLabel(summary) : void 0;
137328
137394
  const loginOrgName = summary.loginOrganizationType === "claude_team" || summary.loginOrganizationType === "claude_enterprise" ? summary.loginOrganizationName : void 0;
137329
- const loginParts = [summary.loginAccountEmail, loginOrgName, loginPlan].filter((part) => part !== void 0);
137330
- if (summary.loginAccountEmail !== void 0 && summary.loginAccountEmail !== summary.providerAccountEmail) {
137331
- return loginParts.join(" \xB7 ");
137395
+ const available = {
137396
+ user: summary.loginAccountEmail === void 0 ? void 0 : truncatedUser(summary.loginAccountEmail, settings2.account.userLength),
137397
+ organisation: loginOrgName,
137398
+ plan: loginPlan
137399
+ };
137400
+ const namesLogin = summary.loginAccountEmail !== void 0 && summary.loginAccountEmail !== summary.providerAccountEmail || summary.provider === void 0;
137401
+ const shown = settings2.account.parts.map((part) => available[part]).filter((part) => part !== void 0);
137402
+ return namesLogin && shown.length > 0 ? shown.join(" \xB7 ") : void 0;
137403
+ }
137404
+
137405
+ // src/statusline/sanitise.ts
137406
+ init_statusline();
137407
+ var BELL = "\\u0007";
137408
+ var ESCAPE_SEQUENCES = new RegExp([`${ESCAPE}\\[[0-?]*[ -/]*[@-~]`, `${ESCAPE}\\][^${BELL}${ESCAPE}]*(?:${BELL}|${ESCAPE}\\\\)`, `${ESCAPE}[@-Z\\\\-_]`].join("|"), "g");
137409
+ var CONTROL_AND_BIDI = /[\p{Cc}؜‎‏‪-‮⁦-⁩-]/gu;
137410
+ function sanitiseDisplayText(text4) {
137411
+ return text4.replace(ESCAPE_SEQUENCES, "").replace(CONTROL_AND_BIDI, "");
137412
+ }
137413
+ function boundedDisplayText(text4) {
137414
+ return graphemesOf(sanitiseDisplayText(text4).trim()).slice(0, MAX_DISPLAY_TEXT_CHARS).join("").trim();
137415
+ }
137416
+
137417
+ // src/statusline/elements/header/advisor.ts
137418
+ var MODEL_ID = /^(?:claude-)?(?:(\d{1,2})(?:-(\d{1,2}))?-)?(opus|sonnet|haiku)(?:-(\d{1,2})(?:-(\d{1,2}))?)?(?:-\d{8})?$/i;
137419
+ function prettifyModelId(id2) {
137420
+ const match = MODEL_ID.exec(id2);
137421
+ if (match === null) {
137422
+ return id2.replace(/^claude-/i, "");
137423
+ }
137424
+ const [, leadingMajor, leadingMinor, family = "", trailingMajor, trailingMinor] = match;
137425
+ const major = leadingMajor ?? trailingMajor;
137426
+ const minor = leadingMajor === void 0 ? trailingMinor : leadingMinor;
137427
+ const version2 = major === void 0 ? "" : ` ${major}${minor === void 0 ? "" : `.${minor}`}`;
137428
+ return `${family.charAt(0).toUpperCase()}${family.slice(1).toLowerCase()}${version2}`;
137429
+ }
137430
+ function advisorSegment({ settings: settings2, transcriptIdentity }) {
137431
+ if (settings2.advisor.override !== "") {
137432
+ return `Advisor: ${settings2.advisor.override}`;
137433
+ }
137434
+ const recorded = transcriptIdentity().advisor;
137435
+ const advisor = recorded === void 0 ? "" : boundedDisplayText(prettifyModelId(recorded));
137436
+ return advisor === "" ? void 0 : `Advisor: ${advisor}`;
137437
+ }
137438
+
137439
+ // src/statusline/elements/header/effort.ts
137440
+ var EFFORT_SYMBOLS = /* @__PURE__ */ new Map([
137441
+ ["low", "\u25CB"],
137442
+ ["medium", "\u25D4"],
137443
+ ["high", "\u25D1"],
137444
+ ["xhigh", "\u25D5"],
137445
+ ["max", "\u25CF"]
137446
+ ]);
137447
+ function effortLevelOf(effort) {
137448
+ const level = boundedDisplayText((typeof effort === "string" ? effort : effort?.level) ?? "").toLowerCase();
137449
+ return level === "" ? void 0 : level;
137450
+ }
137451
+ function formatEffort(level, format) {
137452
+ const symbol3 = EFFORT_SYMBOLS.get(level);
137453
+ if (symbol3 === void 0 || format === "text") {
137454
+ return level;
137332
137455
  }
137333
- return summary.provider === void 0 && loginParts.length > 0 ? loginParts.join(" \xB7 ") : void 0;
137456
+ return format === "symbol" ? symbol3 : `${symbol3} ${level}`;
137457
+ }
137458
+ function effortSegment({ payload, settings: settings2 }) {
137459
+ const level = effortLevelOf(payload.effort);
137460
+ return level === void 0 ? void 0 : formatEffort(level, settings2.effort.format);
137334
137461
  }
137335
137462
 
137336
137463
  // src/statusline/palette.ts
@@ -137382,9 +137509,9 @@ function createPalette(colours, enabled) {
137382
137509
  };
137383
137510
  return {
137384
137511
  ansi,
137385
- paint: (role, text3) => {
137512
+ paint: (role, text4) => {
137386
137513
  const start = ansi(role);
137387
- return start === "" ? text3 : `${start}${text3}${RESET}`;
137514
+ return start === "" ? text4 : `${start}${text4}${RESET}`;
137388
137515
  }
137389
137516
  };
137390
137517
  }
@@ -137399,8 +137526,8 @@ var TEN = 10;
137399
137526
  var TWENTY = 20;
137400
137527
  var FULL_PERCENT3 = 100;
137401
137528
  var ONE_PERCENT = 1;
137402
- function withColor(color, text3) {
137403
- return color === "" ? text3 : `${color}${text3}${RESET}`;
137529
+ function withColor(color, text4) {
137530
+ return color === "" ? text4 : `${color}${text4}${RESET}`;
137404
137531
  }
137405
137532
  function statusColor(fraction, isUsedMetric, style) {
137406
137533
  const yellowAt = style.bands.warnAt / FULL_PERCENT3;
@@ -137495,18 +137622,72 @@ function identitySegment({ summary }) {
137495
137622
  function choiceNamesProvider(summary) {
137496
137623
  return summary.modelChoice !== void 0 && (summary.modelChoice.providers.length > 1 || summary.routedTarget !== void 0);
137497
137624
  }
137498
- function modelSegment({ summary, view }) {
137499
- const namesProvider = choiceNamesProvider(summary);
137500
- const segment = summary.modelChoice !== void 0 && view.modelDisplayName !== void 0 && view.modelDisplayName !== "" ? `${view.modelDisplayName} -> ${namesProvider ? `${summary.modelChoice.provider}/${summary.modelChoice.served}` : summary.modelChoice.served}` : view.modelDisplayName;
137501
- return segment !== void 0 && segment !== "" ? segment : void 0;
137625
+ var CLAUDE_MODEL_ID_PREFIXES = ["claude-", "anthropic."];
137626
+ function isClaudeModelId(id2) {
137627
+ const lower = id2.toLowerCase();
137628
+ return CLAUDE_MODEL_ID_PREFIXES.some((prefix) => lower.startsWith(prefix));
137629
+ }
137630
+ function formatModelName(name, format) {
137631
+ if (format === "full") {
137632
+ return name;
137633
+ }
137634
+ const withoutContext = name.replace(/\s*\([^)]*\bcontext\b[^)]*\)/i, "").trim();
137635
+ return format === "short" ? withoutContext.replace(/^Claude\s+/i, "") : withoutContext;
137636
+ }
137637
+ function modelNameOf({ view, settings: settings2, transcriptIdentity }) {
137638
+ if (settings2.model.override !== "") {
137639
+ return { name: settings2.model.override, isServed: false };
137640
+ }
137641
+ if (settings2.model.source !== "client") {
137642
+ const served = transcriptIdentity().model;
137643
+ if (served !== void 0 && (settings2.model.source === "transcript" || !isClaudeModelId(served))) {
137644
+ return { name: formatModelName(served, settings2.model.format), isServed: true };
137645
+ }
137646
+ }
137647
+ return view.modelDisplayName === void 0 || view.modelDisplayName === "" ? void 0 : { name: formatModelName(view.modelDisplayName, settings2.model.format), isServed: false };
137648
+ }
137649
+ function modelSegment(context) {
137650
+ const { summary } = context;
137651
+ const model = modelNameOf(context);
137652
+ if (model === void 0 || model.name === "") {
137653
+ return void 0;
137654
+ }
137655
+ if (summary.modelChoice === void 0 || model.isServed) {
137656
+ return model.name;
137657
+ }
137658
+ return `${model.name} -> ${choiceNamesProvider(summary) ? `${summary.modelChoice.provider}/${summary.modelChoice.served}` : summary.modelChoice.served}`;
137502
137659
  }
137503
137660
 
137504
- // src/statusline/sanitise.ts
137505
- var BELL = "\\u0007";
137506
- var ESCAPE_SEQUENCES = new RegExp([`${ESCAPE}\\[[0-?]*[ -/]*[@-~]`, `${ESCAPE}\\][^${BELL}${ESCAPE}]*(?:${BELL}|${ESCAPE}\\\\)`, `${ESCAPE}[@-Z\\\\-_]`].join("|"), "g");
137507
- var CONTROL_AND_BIDI = /[\p{Cc}؜‎‏‪-‮⁦-⁩-]/gu;
137508
- function sanitiseDisplayText(text3) {
137509
- return text3.replace(ESCAPE_SEQUENCES, "").replace(CONTROL_AND_BIDI, "");
137661
+ // src/statusline/elements/header/outputStyle.ts
137662
+ var import_node_path56 = __toESM(require("node:path"), 1);
137663
+ init_zod();
137664
+ var SettingsFileSchema = external_exports.looseObject({ outputStyle: external_exports.string().optional().catch(void 0) });
137665
+ function outputStyleIn(file2, readText) {
137666
+ const text4 = readText(file2);
137667
+ if (text4 === void 0) {
137668
+ return void 0;
137669
+ }
137670
+ let parsed;
137671
+ try {
137672
+ parsed = JSON.parse(text4);
137673
+ } catch {
137674
+ return void 0;
137675
+ }
137676
+ const settings2 = SettingsFileSchema.safeParse(parsed);
137677
+ const style = settings2.success ? boundedDisplayText(settings2.data.outputStyle ?? "") : "";
137678
+ return style === "" ? void 0 : style;
137679
+ }
137680
+ function outputStyleSegment({ payload, ports }) {
137681
+ const pinned = ports.env.CLAUDE_CONFIG_DIR;
137682
+ const configDirectory = pinned === void 0 || pinned === "" ? import_node_path56.default.join(ports.homeDirectory, ".claude") : pinned;
137683
+ const projectDirectory = payload.cwd ?? payload.workspace?.current_dir;
137684
+ const files = [
137685
+ import_node_path56.default.join(configDirectory, "settings.json"),
137686
+ import_node_path56.default.join(configDirectory, "settings.local.json"),
137687
+ ...projectDirectory === void 0 ? [] : [import_node_path56.default.join(projectDirectory, ".claude", "settings.json"), import_node_path56.default.join(projectDirectory, ".claude", "settings.local.json")]
137688
+ ];
137689
+ const style = files.map((file2) => outputStyleIn(file2, ports.readText)).findLast((name) => name !== void 0);
137690
+ return style === void 0 ? void 0 : `style: ${style}`;
137510
137691
  }
137511
137692
 
137512
137693
  // src/statusline/projectPath.ts
@@ -137527,8 +137708,8 @@ function formatProjectPath(cwd, levels) {
137527
137708
  return segments.length > 0 ? `//${segments.join("/")}` : "//";
137528
137709
  }
137529
137710
  if (DRIVE_PREFIX.test(safe)) {
137530
- const joined2 = segments.join("/");
137531
- return segments.length === 1 ? `${joined2}/` : joined2;
137711
+ const joined3 = segments.join("/");
137712
+ return segments.length === 1 ? `${joined3}/` : joined3;
137532
137713
  }
137533
137714
  if (SEPARATOR_AT_START.test(safe)) {
137534
137715
  return segments.length > 0 ? `/${segments.join("/")}` : "/";
@@ -137553,7 +137734,7 @@ function workingDirectoryOf(payload) {
137553
137734
  function inlineAddedDirs({ payload, palette }) {
137554
137735
  const { names, more } = addedDirNames(payload.workspace?.added_dirs);
137555
137736
  const drawn = [...names.map((name) => `+${name}`), ...more > 0 ? [`+${String(more)} more`] : []];
137556
- return drawn.length === 0 ? void 0 : drawn.map((text3) => palette.paint("label", text3)).join(" ");
137737
+ return drawn.length === 0 ? void 0 : drawn.map((text4) => palette.paint("label", text4)).join(" ");
137557
137738
  }
137558
137739
  function projectSegment(context) {
137559
137740
  const { payload, settings: settings2 } = context;
@@ -137563,12 +137744,13 @@ function projectSegment(context) {
137563
137744
  }
137564
137745
 
137565
137746
  // src/statusline/elements/header/provider.ts
137566
- function providerSegment({ summary }) {
137567
- if (summary.provider === void 0) {
137747
+ function providerSegment({ summary, settings: settings2 }) {
137748
+ const label2 = settings2.provider.name === "" ? summary.provider : settings2.provider.name;
137749
+ if (label2 === void 0) {
137568
137750
  return void 0;
137569
137751
  }
137570
137752
  const account = [summary.providerAccountEmail, summary.providerPlan].filter((part) => part !== void 0);
137571
- return account.length > 0 ? `${summary.provider} \xB7 ${account.join(" \xB7 ")}` : summary.provider;
137753
+ return account.length > 0 ? `${label2} \xB7 ${account.join(" \xB7 ")}` : label2;
137572
137754
  }
137573
137755
 
137574
137756
  // src/statusline/elements/header/route.ts
@@ -137576,6 +137758,12 @@ function routeSegment({ summary }) {
137576
137758
  return summary.routedTarget !== void 0 && !choiceNamesProvider(summary) ? `via ${summary.routedTarget}` : void 0;
137577
137759
  }
137578
137760
 
137761
+ // src/statusline/elements/header/version.ts
137762
+ function versionSegment({ payload }) {
137763
+ const version2 = boundedDisplayText(payload.version ?? "");
137764
+ return version2 === "" ? void 0 : `CC v${version2}`;
137765
+ }
137766
+
137579
137767
  // src/statusline/vcs/git.ts
137580
137768
  var GIT = "git";
137581
137769
  var NUL = "\0";
@@ -137652,15 +137840,15 @@ function parseNumstat(output2) {
137652
137840
  if (addedText === void 0 || deletedText === void 0 || pathText === void 0) {
137653
137841
  continue;
137654
137842
  }
137655
- const path67 = pathText === "" ? fields[index + 2] : pathText;
137843
+ const path68 = pathText === "" ? fields[index + 2] : pathText;
137656
137844
  if (pathText === "") {
137657
137845
  index += 2;
137658
137846
  }
137659
137847
  const lines = { added: Number(addedText), deleted: Number(deletedText) };
137660
- if (path67 !== void 0 && Number.isInteger(lines.added) && Number.isInteger(lines.deleted)) {
137848
+ if (path68 !== void 0 && Number.isInteger(lines.added) && Number.isInteger(lines.deleted)) {
137661
137849
  added += lines.added;
137662
137850
  deleted += lines.deleted;
137663
- byPath.set(path67, lines);
137851
+ byPath.set(path68, lines);
137664
137852
  }
137665
137853
  }
137666
137854
  return { total: { added, deleted }, byPath };
@@ -137715,7 +137903,7 @@ function readGitStatus(ports, cwd, query) {
137715
137903
  }
137716
137904
 
137717
137905
  // src/statusline/vcs/jj.ts
137718
- var import_node_path56 = __toESM(require("node:path"), 1);
137906
+ var import_node_path57 = __toESM(require("node:path"), 1);
137719
137907
  var JJ2 = "jj";
137720
137908
  var MAX_WALK_DEPTH = 64;
137721
137909
  var MAX_LABEL_CODE_POINTS = 64;
@@ -137728,13 +137916,13 @@ function isJjRepository(ports, cwd) {
137728
137916
  return false;
137729
137917
  }
137730
137918
  for (let depth = 0; depth < MAX_WALK_DEPTH; depth += 1) {
137731
- if (ports.entryKind(import_node_path56.default.join(directory, ".jj")) === "directory") {
137919
+ if (ports.entryKind(import_node_path57.default.join(directory, ".jj")) === "directory") {
137732
137920
  return true;
137733
137921
  }
137734
- if (ports.entryKind(import_node_path56.default.join(directory, ".git")) !== void 0) {
137922
+ if (ports.entryKind(import_node_path57.default.join(directory, ".git")) !== void 0) {
137735
137923
  return false;
137736
137924
  }
137737
- const parent = import_node_path56.default.dirname(directory);
137925
+ const parent = import_node_path57.default.dirname(directory);
137738
137926
  if (parent === directory) {
137739
137927
  return false;
137740
137928
  }
@@ -137752,8 +137940,8 @@ var TEMPLATE = [
137752
137940
  'if(self.conflict(), "1", "0")'
137753
137941
  ].join(" ++ ");
137754
137942
  var ARGS = ["--ignore-working-copy", "--at-operation=@", "--no-pager", "log", "-r", "@", "--no-graph", "--color", "never", "-T", TEMPLATE];
137755
- function label(text3) {
137756
- const clean = sanitiseDisplayText(text3).trim();
137943
+ function label(text4) {
137944
+ const clean = sanitiseDisplayText(text4).trim();
137757
137945
  return clean === "" ? void 0 : Array.from(clean).slice(0, MAX_LABEL_CODE_POINTS).join("");
137758
137946
  }
137759
137947
  function parse4(output2) {
@@ -137813,12 +138001,12 @@ function vcsStatusOf(context) {
137813
138001
 
137814
138002
  // src/statusline/elements/header/vcs.ts
137815
138003
  function aheadText(ahead, { settings: settings2, palette }) {
137816
- const text3 = `\u2191${String(ahead)}`;
138004
+ const text4 = `\u2191${String(ahead)}`;
137817
138005
  const { pushCriticalAt, pushWarnAt } = settings2.git;
137818
138006
  if (pushCriticalAt > 0 && ahead >= pushCriticalAt) {
137819
- return palette.paint("critical", text3);
138007
+ return palette.paint("critical", text4);
137820
138008
  }
137821
- return pushWarnAt > 0 && ahead >= pushWarnAt ? palette.paint("warning", text3) : palette.paint("gitBranch", text3);
138009
+ return pushWarnAt > 0 && ahead >= pushWarnAt ? palette.paint("warning", text4) : palette.paint("gitBranch", text4);
137822
138010
  }
137823
138011
  function vcsSegment(context) {
137824
138012
  const status = vcsStatusOf(context);
@@ -137856,7 +138044,7 @@ function addedDirsRow({ payload, settings: settings2, palette }) {
137856
138044
  if (settings2.project.addedDirsLayout !== "row" || names.length === 0) {
137857
138045
  return { kind: "text", lines: [] };
137858
138046
  }
137859
- const drawn = [...names, ...more > 0 ? [`+${String(more)} more`] : []].map((text3) => palette.paint("label", text3));
138047
+ const drawn = [...names, ...more > 0 ? [`+${String(more)} more`] : []].map((text4) => palette.paint("label", text4));
137860
138048
  return { kind: "text", lines: [`${palette.paint("label", "Added dirs:")} ${drawn.join(palette.paint("label", ", "))}`] };
137861
138049
  }
137862
138050
 
@@ -137968,10 +138156,14 @@ var HEADER_ROLES = {
137968
138156
  identity: "label",
137969
138157
  headroom: "label",
137970
138158
  project: "project",
137971
- vcs: "git"
138159
+ vcs: "git",
138160
+ effort: "model",
138161
+ advisor: "label",
138162
+ version: "label",
138163
+ outputStyle: "label"
137972
138164
  };
137973
138165
  var ELEMENTS = {
137974
- header: { model: modelSegment, provider: providerSegment, route: routeSegment, account: accountSegment, identity: identitySegment, headroom: headroomSegment, project: projectSegment, vcs: vcsSegment },
138166
+ header: { model: modelSegment, provider: providerSegment, route: routeSegment, account: accountSegment, identity: identitySegment, headroom: headroomSegment, project: projectSegment, vcs: vcsSegment, effort: effortSegment, advisor: advisorSegment, version: versionSegment, outputStyle: outputStyleSegment },
137975
138167
  rows: { context: contextRow, quota: quotaRow, addedDirs: addedDirsRow, gitFiles: gitFilesRow }
137976
138168
  };
137977
138169
 
@@ -137993,7 +138185,7 @@ function justify(texts, maxWidth, separator) {
137993
138185
  return texts.join(separator);
137994
138186
  }
137995
138187
  const separatorLength = visibleLength(separator);
137996
- const total = texts.reduce((sum, text3) => sum + visibleLength(text3), 0) + separatorLength * (texts.length - 1);
138188
+ const total = texts.reduce((sum, text4) => sum + visibleLength(text4), 0) + separatorLength * (texts.length - 1);
137997
138189
  const spare = maxWidth - total;
137998
138190
  if (spare <= 0) {
137999
138191
  return texts.join(separator);
@@ -138002,7 +138194,7 @@ function justify(texts, maxWidth, separator) {
138002
138194
  const extraPerGap = Math.floor(spare / gaps);
138003
138195
  let remainder = spare % gaps;
138004
138196
  const parts = [];
138005
- texts.forEach((text3, index) => {
138197
+ texts.forEach((text4, index) => {
138006
138198
  if (index > 0) {
138007
138199
  const extra = extraPerGap + (remainder > 0 ? 1 : 0);
138008
138200
  if (remainder > 0) {
@@ -138011,7 +138203,7 @@ function justify(texts, maxWidth, separator) {
138011
138203
  const left = Math.floor(extra / 2);
138012
138204
  parts.push(`${" ".repeat(left + 1)}|${" ".repeat(extra - left + 1)}`);
138013
138205
  }
138014
- parts.push(text3);
138206
+ parts.push(text4);
138015
138207
  });
138016
138208
  return parts.join("");
138017
138209
  }
@@ -138020,15 +138212,15 @@ function layoutHeader(texts, maxWidth, separator) {
138020
138212
  const lines = [];
138021
138213
  let current = [];
138022
138214
  let currentWidth = 0;
138023
- for (const text3 of texts) {
138024
- const width = visibleLength(text3);
138215
+ for (const text4 of texts) {
138216
+ const width = visibleLength(text4);
138025
138217
  const added = current.length === 0 ? width : width + separatorLength;
138026
138218
  if (current.length > 0 && currentWidth + added > maxWidth) {
138027
138219
  lines.push(current);
138028
- current = [text3];
138220
+ current = [text4];
138029
138221
  currentWidth = width;
138030
138222
  } else {
138031
- current.push(text3);
138223
+ current.push(text4);
138032
138224
  currentWidth += added;
138033
138225
  }
138034
138226
  }
@@ -138038,9 +138230,106 @@ function layoutHeader(texts, maxWidth, separator) {
138038
138230
  return lines.map((line) => justify(line, maxWidth, separator)).join("\n");
138039
138231
  }
138040
138232
 
138233
+ // src/statusline/identityTranscript.ts
138234
+ init_zod();
138235
+ var TRANSCRIPT_CHUNK_BYTES = 65536;
138236
+ var MAX_TRANSCRIPT_SCAN_BYTES = 4194304;
138237
+ var NOT_FOUND = { model: void 0, advisor: void 0 };
138238
+ var SYNTHETIC_MODEL = "<synthetic>";
138239
+ var NEWLINE = 10;
138240
+ var text3 = external_exports.string().optional().catch(void 0);
138241
+ var RecordSchema = external_exports.looseObject({
138242
+ type: text3,
138243
+ advisorModel: text3,
138244
+ message: external_exports.looseObject({ model: text3 }).optional().catch(void 0)
138245
+ });
138246
+ var ASSISTANT_TYPE = /"type"\s*:\s*"assistant"/;
138247
+ function identityOfLine(line) {
138248
+ if (!ASSISTANT_TYPE.test(line)) {
138249
+ return void 0;
138250
+ }
138251
+ let parsed;
138252
+ try {
138253
+ parsed = JSON.parse(line);
138254
+ } catch {
138255
+ return void 0;
138256
+ }
138257
+ const record2 = RecordSchema.safeParse(parsed);
138258
+ if (!record2.success || record2.data.type !== "assistant") {
138259
+ return void 0;
138260
+ }
138261
+ const model = boundedDisplayText(record2.data.message?.model ?? "");
138262
+ if (model === "" || model === SYNTHETIC_MODEL) {
138263
+ return void 0;
138264
+ }
138265
+ const advisor = boundedDisplayText(record2.data.advisorModel ?? "");
138266
+ return { model, advisor: advisor === "" ? void 0 : advisor };
138267
+ }
138268
+ function joined2(pieces) {
138269
+ const whole = new Uint8Array(pieces.reduce((total, piece) => total + piece.length, 0));
138270
+ let at2 = 0;
138271
+ for (const piece of pieces) {
138272
+ whole.set(piece, at2);
138273
+ at2 += piece.length;
138274
+ }
138275
+ return whole;
138276
+ }
138277
+ var EMPTY_LINE = new Uint8Array();
138278
+ function splitAtNewlines(bytes) {
138279
+ const firstBreak = bytes.indexOf(NEWLINE);
138280
+ if (firstBreak === -1) {
138281
+ return { head: bytes, rest: [] };
138282
+ }
138283
+ const rest = [];
138284
+ let from = firstBreak + 1;
138285
+ for (let at2 = bytes.indexOf(NEWLINE, from); at2 !== -1; at2 = bytes.indexOf(NEWLINE, from)) {
138286
+ rest.push(bytes.subarray(from, at2));
138287
+ from = at2 + 1;
138288
+ }
138289
+ rest.push(bytes.subarray(from));
138290
+ return { head: bytes.subarray(0, firstBreak), rest };
138291
+ }
138292
+ function readTranscriptIdentity(ports, transcriptPath) {
138293
+ const size = ports.readRange(transcriptPath, 0, 0)?.size;
138294
+ if (size === void 0) {
138295
+ return NOT_FOUND;
138296
+ }
138297
+ let carry = [];
138298
+ const decoder = new TextDecoder();
138299
+ const floor = Math.max(0, size - MAX_TRANSCRIPT_SCAN_BYTES);
138300
+ for (let end = size; end > floor; end = Math.max(floor, end - TRANSCRIPT_CHUNK_BYTES)) {
138301
+ const start = Math.max(floor, end - TRANSCRIPT_CHUNK_BYTES);
138302
+ const chunk2 = ports.readRange(transcriptPath, start, end - start);
138303
+ if (chunk2 === void 0) {
138304
+ return NOT_FOUND;
138305
+ }
138306
+ const { head, rest } = splitAtNewlines(chunk2.bytes);
138307
+ if (rest.length === 0) {
138308
+ carry = [head, ...carry];
138309
+ continue;
138310
+ }
138311
+ const [tail = EMPTY_LINE, ...older] = rest.toReversed();
138312
+ for (const line of [joined2([tail, ...carry]), ...older]) {
138313
+ const found = identityOfLine(decoder.decode(line));
138314
+ if (found !== void 0) {
138315
+ return found;
138316
+ }
138317
+ }
138318
+ carry = [head];
138319
+ }
138320
+ return floor === 0 ? identityOfLine(decoder.decode(joined2(carry))) ?? NOT_FOUND : NOT_FOUND;
138321
+ }
138322
+
138041
138323
  // src/statusline/render.ts
138042
138324
  var RESERVED_COLUMNS = 4;
138043
138325
  var SEPARATOR2 = " | ";
138326
+ function once2(read) {
138327
+ let kept;
138328
+ return () => {
138329
+ kept ??= { value: read() };
138330
+ return kept.value;
138331
+ };
138332
+ }
138044
138333
  function renderStatuslineBlock(input2) {
138045
138334
  const { terminalWidth, settings: settings2 = STATUSLINE_DEFAULTS, elements = ELEMENTS } = input2;
138046
138335
  const context = {
@@ -138051,11 +138340,12 @@ function renderStatuslineBlock(input2) {
138051
138340
  terminalWidth,
138052
138341
  settings: settings2,
138053
138342
  palette: createPalette(settings2.colours, colourEnabled(input2.ports.env)),
138054
- ports: input2.ports
138343
+ ports: input2.ports,
138344
+ transcriptIdentity: once2(() => input2.payload.transcript_path === void 0 ? { model: void 0, advisor: void 0 } : readTranscriptIdentity(input2.ports, input2.payload.transcript_path))
138055
138345
  };
138056
138346
  const parts = settings2.layout.header.flatMap((name) => {
138057
- const text3 = elements.header[name](context);
138058
- return text3 === void 0 ? [] : { name, text: context.palette.paint(HEADER_ROLES[name], text3) };
138347
+ const text4 = elements.header[name](context);
138348
+ return text4 === void 0 ? [] : { name, text: context.palette.paint(HEADER_ROLES[name], text4) };
138059
138349
  });
138060
138350
  const header = headerUnits(parts, settings2.git.branchOverflow);
138061
138351
  const width = Math.max(TWENTY, terminalWidth - RESERVED_COLUMNS);
@@ -138137,7 +138427,7 @@ function registerStatuslineCommand(program2, deps) {
138137
138427
  } else {
138138
138428
  const configDir = process.env.CLAUDE_CONFIG_DIR;
138139
138429
  try {
138140
- account = readAccountMetadataFile(realFarmFs, configDir === void 0 || configDir === "" ? import_node_path57.default.join(import_node_os13.default.homedir(), ".claude.json") : import_node_path57.default.join(configDir, ".claude.json"));
138430
+ account = readAccountMetadataFile(realFarmFs, configDir === void 0 || configDir === "" ? import_node_path58.default.join(import_node_os13.default.homedir(), ".claude.json") : import_node_path58.default.join(configDir, ".claude.json"));
138141
138431
  } catch {
138142
138432
  account = void 0;
138143
138433
  }
@@ -140234,8 +140524,8 @@ function getErrorMap2() {
140234
140524
 
140235
140525
  // node_modules/.pnpm/zod@4.6.5/node_modules/zod/v3/helpers/parseUtil.js
140236
140526
  var makeIssue = (params) => {
140237
- const { data, path: path67, errorMaps, issueData } = params;
140238
- const fullPath = [...path67, ...issueData.path || []];
140527
+ const { data, path: path68, errorMaps, issueData } = params;
140528
+ const fullPath = [...path68, ...issueData.path || []];
140239
140529
  const fullIssue = {
140240
140530
  ...issueData,
140241
140531
  path: fullPath
@@ -140350,11 +140640,11 @@ var errorUtil;
140350
140640
 
140351
140641
  // node_modules/.pnpm/zod@4.6.5/node_modules/zod/v3/types.js
140352
140642
  var ParseInputLazyPath = class {
140353
- constructor(parent, value2, path67, key) {
140643
+ constructor(parent, value2, path68, key) {
140354
140644
  this._cachedPath = [];
140355
140645
  this.parent = parent;
140356
140646
  this.data = value2;
140357
- this._path = path67;
140647
+ this._path = path68;
140358
140648
  this._key = key;
140359
140649
  }
140360
140650
  get path() {
@@ -143917,11 +144207,11 @@ function normalizeObjectSchema(schema) {
143917
144207
  }
143918
144208
  return void 0;
143919
144209
  }
143920
- function getDotPath(path67) {
143921
- if (path67.length === 0) {
144210
+ function getDotPath(path68) {
144211
+ if (path68.length === 0) {
143922
144212
  return "object root";
143923
144213
  }
143924
- return path67.reduce((acc, seg, index) => {
144214
+ return path68.reduce((acc, seg, index) => {
143925
144215
  if (index === 0) {
143926
144216
  return String(seg);
143927
144217
  }
@@ -147964,7 +148254,7 @@ async function serveMcp(mcp, transport, options = {}) {
147964
148254
 
147965
148255
  // src/mcp/permissions.ts
147966
148256
  var import_node_fs23 = __toESM(require("node:fs"), 1);
147967
- var import_node_path58 = __toESM(require("node:path"), 1);
148257
+ var import_node_path59 = __toESM(require("node:path"), 1);
147968
148258
  init_zod();
147969
148259
  init_store();
147970
148260
  var StoredMcpPermissionsSchema = external_exports.strictObject({
@@ -147986,10 +148276,10 @@ function effectiveMcpPermissions(flags, stored) {
147986
148276
  return { writes: flags.writes || stored.writes, remoteControl: flags.remoteControl || stored.remoteControl, history: flags.history || stored.history };
147987
148277
  }
147988
148278
  function watchMcpPermissions(paths, onChange) {
147989
- const directory = import_node_path58.default.dirname(paths.mcpPermissionsFile);
148279
+ const directory = import_node_path59.default.dirname(paths.mcpPermissionsFile);
147990
148280
  import_node_fs23.default.mkdirSync(directory, { recursive: true });
147991
148281
  const watcher = import_node_fs23.default.watch(directory, (_event, filename) => {
147992
- if (filename === null || filename === import_node_path58.default.basename(paths.mcpPermissionsFile)) {
148282
+ if (filename === null || filename === import_node_path59.default.basename(paths.mcpPermissionsFile)) {
147993
148283
  onChange();
147994
148284
  }
147995
148285
  });
@@ -148154,9 +148444,9 @@ init_cliError();
148154
148444
  init_argv();
148155
148445
  init_legacy();
148156
148446
  var COMPLETION_SHELLS = ["bash", "zsh", "fish"];
148157
- function firstSentence(text3) {
148158
- const end = text3.search(/\.(\s|$)/);
148159
- return end === -1 ? text3 : text3.slice(0, end);
148447
+ function firstSentence(text4) {
148448
+ const end = text4.search(/\.(\s|$)/);
148449
+ return end === -1 ? text4 : text4.slice(0, end);
148160
148450
  }
148161
148451
  function collectNodes(program2) {
148162
148452
  const help = new Help();
@@ -148177,11 +148467,11 @@ function collectNodes(program2) {
148177
148467
  visit2(program2, "root");
148178
148468
  return nodes;
148179
148469
  }
148180
- function singleQuote(text3) {
148181
- return `'${text3.replaceAll("'", `'\\''`)}'`;
148470
+ function singleQuote(text4) {
148471
+ return `'${text4.replaceAll("'", `'\\''`)}'`;
148182
148472
  }
148183
- function fishQuote(text3) {
148184
- return `'${text3.replaceAll("\\", "\\\\").replaceAll("'", "\\'")}'`;
148473
+ function fishQuote(text4) {
148474
+ return `'${text4.replaceAll("\\", "\\\\").replaceAll("'", "\\'")}'`;
148185
148475
  }
148186
148476
  function transitionArms(nodes, indent) {
148187
148477
  return nodes.flatMap((node2) => [...node2.children].map(([name, child]) => `${indent}${singleQuote(`${node2.id}:${name}`)}) node=${singleQuote(child)} ;;`)).join("\n");
@@ -148303,16 +148593,16 @@ init_credentialCache();
148303
148593
 
148304
148594
  // src/identityToken.ts
148305
148595
  var import_node_fs24 = __toESM(require("node:fs"), 1);
148306
- var import_node_path59 = __toESM(require("node:path"), 1);
148596
+ var import_node_path60 = __toESM(require("node:path"), 1);
148307
148597
  init_cliError();
148308
148598
  var TOKEN_FILE_MODE = 384;
148309
148599
  var TOKEN_DIR_MODE = 448;
148310
148600
  var OAUTH_TOKEN_RE = /^sk-ant-oat\d+-[A-Za-z0-9_-]+$/;
148311
148601
  function identityTokenDir(paths) {
148312
- return import_node_path59.default.join(paths.root, "credentials");
148602
+ return import_node_path60.default.join(paths.root, "credentials");
148313
148603
  }
148314
148604
  function identityTokenPath(paths, identityName) {
148315
- return import_node_path59.default.join(identityTokenDir(paths), `${identityName}.token`);
148605
+ return import_node_path60.default.join(identityTokenDir(paths), `${identityName}.token`);
148316
148606
  }
148317
148607
  function storeIdentityToken(paths, identityName, raw) {
148318
148608
  const token = raw.trim();
@@ -148323,7 +148613,7 @@ function storeIdentityToken(paths, identityName, raw) {
148323
148613
  import_node_fs24.default.mkdirSync(dir, { recursive: true, mode: TOKEN_DIR_MODE });
148324
148614
  import_node_fs24.default.chmodSync(dir, TOKEN_DIR_MODE);
148325
148615
  const target = identityTokenPath(paths, identityName);
148326
- const temp = import_node_path59.default.join(dir, `.${identityName}.${String(process.pid)}.tmp`);
148616
+ const temp = import_node_path60.default.join(dir, `.${identityName}.${String(process.pid)}.tmp`);
148327
148617
  import_node_fs24.default.writeFileSync(temp, `${token}
148328
148618
  `, { mode: TOKEN_FILE_MODE });
148329
148619
  import_node_fs24.default.renameSync(temp, target);
@@ -148494,7 +148784,7 @@ function registerDoctorCommand(program2, deps) {
148494
148784
  // src/headroom/commands.ts
148495
148785
  var import_node_fs25 = __toESM(require("node:fs"), 1);
148496
148786
  var import_node_http5 = __toESM(require("node:http"), 1);
148497
- var import_node_path60 = __toESM(require("node:path"), 1);
148787
+ var import_node_path61 = __toESM(require("node:path"), 1);
148498
148788
  var import_node_child_process10 = require("node:child_process");
148499
148789
  init_commandDeps();
148500
148790
  init_configProfilesStore();
@@ -148684,12 +148974,12 @@ function readInstalledHeadroomCommit() {
148684
148974
  if (toolDir.status !== 0) {
148685
148975
  return void 0;
148686
148976
  }
148687
- const libDir = import_node_path60.default.join(toolDir.stdout.trim(), HEADROOM_TOOL_NAME, "lib");
148977
+ const libDir = import_node_path61.default.join(toolDir.stdout.trim(), HEADROOM_TOOL_NAME, "lib");
148688
148978
  for (const python of realFarmFs.readdir(libDir)) {
148689
- const sitePackages = import_node_path60.default.join(libDir, python, "site-packages");
148979
+ const sitePackages = import_node_path61.default.join(libDir, python, "site-packages");
148690
148980
  for (const entry of realFarmFs.readdir(sitePackages)) {
148691
148981
  if (entry.startsWith("headroom_ai-") && entry.endsWith(".dist-info")) {
148692
- const directUrl = realFarmFs.readFileUtf8(import_node_path60.default.join(sitePackages, entry, "direct_url.json"));
148982
+ const directUrl = realFarmFs.readFileUtf8(import_node_path61.default.join(sitePackages, entry, "direct_url.json"));
148693
148983
  return directUrl === void 0 ? void 0 : parseInstalledCommit(directUrl);
148694
148984
  }
148695
148985
  }
@@ -148920,9 +149210,9 @@ init_providersStore();
148920
149210
  init_realPorts();
148921
149211
  var realCatalogueFetch = async (url2, headers, timeoutMs) => {
148922
149212
  const response = await fetch(url2, { headers: { ...headers }, signal: AbortSignal.timeout(timeoutMs) });
148923
- const text3 = await response.text();
149213
+ const text4 = await response.text();
148924
149214
  try {
148925
- const body = JSON.parse(text3);
149215
+ const body = JSON.parse(text4);
148926
149216
  return { status: response.status, body };
148927
149217
  } catch {
148928
149218
  return { status: response.status, body: void 0 };
@@ -148945,7 +149235,7 @@ async function refreshCatalogueForReal(paths, name, env) {
148945
149235
  init_realPorts();
148946
149236
 
148947
149237
  // src/usage/realJobRunner.ts
148948
- var import_node_path61 = __toESM(require("node:path"), 1);
149238
+ var import_node_path62 = __toESM(require("node:path"), 1);
148949
149239
  init_conditions();
148950
149240
  init_identityClaude();
148951
149241
  var JOB_LAUNCH_FLAGS = ["--no-headroom", "--no-remote-control", "--track-usage"];
@@ -148958,7 +149248,7 @@ ${outcome.trimEnd()}
148958
149248
  }
148959
149249
  function createRealJobRunner(params) {
148960
149250
  return async (name, identity, job) => {
148961
- const logFile = import_node_path61.default.join(params.paths.jobLogsDir, `${name}.log`);
149251
+ const logFile = import_node_path62.default.join(params.paths.jobLogsDir, `${name}.log`);
148962
149252
  const append = (outcome) => {
148963
149253
  params.fs.mkdirPrivate(params.paths.jobLogsDir);
148964
149254
  params.fs.appendFilePrivate(logFile, logEntry(name, identity, params.now(), outcome));
@@ -149015,7 +149305,7 @@ function registerHeadlessCommands(program2, deps) {
149015
149305
  }
149016
149306
 
149017
149307
  // src/jobs.ts
149018
- var import_node_path62 = __toESM(require("node:path"), 1);
149308
+ var import_node_path63 = __toESM(require("node:path"), 1);
149019
149309
  init_commandDeps();
149020
149310
  init_cliError();
149021
149311
  init_schema();
@@ -149040,7 +149330,7 @@ function jobOf(options) {
149040
149330
  target: options.identity === void 0 ? { pool: options.pool ?? "" } : { identity: options.identity },
149041
149331
  trigger: options.at === void 0 ? { beforeReset: options.beforeReset ?? "fiveHour", lead: options.lead ?? "" } : { at: options.at },
149042
149332
  prompt: options.prompt,
149043
- cwd: import_node_path62.default.resolve(options.cwd ?? process.cwd()),
149333
+ cwd: import_node_path63.default.resolve(options.cwd ?? process.cwd()),
149044
149334
  timeout: options.timeout,
149045
149335
  ...options.model === void 0 ? {} : { model: options.model },
149046
149336
  ...options.allowedTool === void 0 ? {} : { allowedTools: options.allowedTool }
@@ -149113,7 +149403,7 @@ function registerJobCommand(program2, deps) {
149113
149403
  console.log(`Allowed tools: ${entry.allowedTools.join(", ")}`);
149114
149404
  }
149115
149405
  console.log(`Prompt: ${entry.prompt}`);
149116
- console.log(`Results: ${import_node_path62.default.join(paths.jobLogsDir, `${name}.log`)}`);
149406
+ console.log(`Results: ${import_node_path63.default.join(paths.jobLogsDir, `${name}.log`)}`);
149117
149407
  }),
149118
149408
  ["agent-shim job show digest"]
149119
149409
  );
@@ -149136,7 +149426,7 @@ function registerJobCommand(program2, deps) {
149136
149426
  throw new UsageError(`No member of the job's pool can be picked right now.`);
149137
149427
  }
149138
149428
  await createRealJobRunner({ paths, spawnDaemon: spawnDetachedSupervisor, fs: realFarmFs, now: () => /* @__PURE__ */ new Date() })(name, identity, entry);
149139
- console.log(`Ran job "${name}" as ${identity}; the result is in ${import_node_path62.default.join(paths.jobLogsDir, `${name}.log`)}.`);
149429
+ console.log(`Ran job "${name}" as ${identity}; the result is in ${import_node_path63.default.join(paths.jobLogsDir, `${name}.log`)}.`);
149140
149430
  }),
149141
149431
  ["agent-shim job run digest"]
149142
149432
  );
@@ -149300,7 +149590,7 @@ init_providerAliases();
149300
149590
 
149301
149591
  // src/providerRename.ts
149302
149592
  var import_node_fs26 = __toESM(require("node:fs"), 1);
149303
- var import_node_path63 = __toESM(require("node:path"), 1);
149593
+ var import_node_path64 = __toESM(require("node:path"), 1);
149304
149594
  init_schema();
149305
149595
  init_store();
149306
149596
  init_load();
@@ -149417,7 +149707,7 @@ function rewriteReferences(paths, from, to2) {
149417
149707
  const launch = renamedLaunch(profile.launch, from, to2);
149418
149708
  const models = profile.models === void 0 ? void 0 : renamedModels(profile.models, from, to2);
149419
149709
  if (launch !== void 0 || models !== void 0) {
149420
- applyPatch(import_node_path63.default.join(paths.configProfilesDir, `${name}.json`), ConfigProfileSchema, { ...launch === void 0 ? {} : { launch }, ...models === void 0 ? {} : { models } });
149710
+ applyPatch(import_node_path64.default.join(paths.configProfilesDir, `${name}.json`), ConfigProfileSchema, { ...launch === void 0 ? {} : { launch }, ...models === void 0 ? {} : { models } });
149421
149711
  rewritten.push(`profile ${name}`);
149422
149712
  }
149423
149713
  }
@@ -150244,7 +150534,7 @@ function registerSessionCommands(program2, deps) {
150244
150534
  }
150245
150535
 
150246
150536
  // src/usage/commands.ts
150247
- var import_node_path64 = __toESM(require("node:path"), 1);
150537
+ var import_node_path65 = __toESM(require("node:path"), 1);
150248
150538
  init_commandDeps();
150249
150539
  init_realPorts();
150250
150540
  init_account();
@@ -150383,7 +150673,7 @@ function collectAccounts(fs30, paths, identity, probe) {
150383
150673
  return names.map((name) => ({
150384
150674
  identity: name,
150385
150675
  account: readAccountMetadata(fs30, paths.identitiesDir, name),
150386
- signIn: identitySignIn(fs30, probe, { farmRoot: import_node_path64.default.join(paths.identitiesDir, name), hasCredentialBlock: readIdentity(paths, name)?.credential !== void 0 }),
150676
+ signIn: identitySignIn(fs30, probe, { farmRoot: import_node_path65.default.join(paths.identitiesDir, name), hasCredentialBlock: readIdentity(paths, name)?.credential !== void 0 }),
150387
150677
  usage: readUsageSnapshot(fs30, paths.usageSnapshotsDir, name)
150388
150678
  }));
150389
150679
  }
@@ -150720,8 +151010,8 @@ function createRealCompactor(params) {
150720
151010
  sizes = boundarySizes(message);
150721
151011
  }
150722
151012
  if (message.type === "result") {
150723
- const text3 = successfulResult(message);
150724
- return sizes === void 0 ? { kind: "unchanged", reason: text3 === "" ? "nothing was compacted" : text3 } : { kind: "compacted", ...sizes };
151013
+ const text4 = successfulResult(message);
151014
+ return sizes === void 0 ? { kind: "unchanged", reason: text4 === "" ? "nothing was compacted" : text4 } : { kind: "compacted", ...sizes };
150725
151015
  }
150726
151016
  }
150727
151017
  throw new Error("the compaction ended without a result");
@@ -150790,7 +151080,7 @@ function quotaHitOf(fs30, paths, identity, sessionId, sinceMs, nowMs) {
150790
151080
  }
150791
151081
 
150792
151082
  // src/supervise/move.ts
150793
- var import_node_path65 = __toESM(require("node:path"), 1);
151083
+ var import_node_path66 = __toESM(require("node:path"), 1);
150794
151084
  init_lock();
150795
151085
  init_poolPick();
150796
151086
  init_read();
@@ -150836,7 +151126,7 @@ function createMover(deps) {
150836
151126
  if (resolution.identity === request7.from) {
150837
151127
  return { kind: "stay", reason: `no other member of pool "${pool}" can take it` };
150838
151128
  }
150839
- const transcript = import_node_path65.default.join(paths.identitiesDir, resolution.identity, "projects", projectDirNameOf(deps.cwd), `${request7.sessionId}.jsonl`);
151129
+ const transcript = import_node_path66.default.join(paths.identitiesDir, resolution.identity, "projects", projectDirNameOf(deps.cwd), `${request7.sessionId}.jsonl`);
150840
151130
  if (farmFs.lstat(transcript)?.kind !== "file") {
150841
151131
  return { kind: "stay", reason: `${resolution.identity} does not share this conversation's history, so it could not resume it` };
150842
151132
  }
@@ -150870,13 +151160,13 @@ function createIdentityMover(deps) {
150870
151160
  throw error63;
150871
151161
  }
150872
151162
  try {
150873
- if (farmFs.readFileUtf8(import_node_path65.default.join(paths.identitiesDir, request7.to, "identity.json")) === void 0) {
151163
+ if (farmFs.readFileUtf8(import_node_path66.default.join(paths.identitiesDir, request7.to, "identity.json")) === void 0) {
150874
151164
  return { kind: "stay", reason: `no identity "${request7.to}"` };
150875
151165
  }
150876
151166
  if (request7.to === request7.from) {
150877
151167
  return { kind: "stay", reason: `the model already runs under this session's identity` };
150878
151168
  }
150879
- const transcript = import_node_path65.default.join(paths.identitiesDir, request7.to, "projects", projectDirNameOf(deps.cwd), `${request7.sessionId}.jsonl`);
151169
+ const transcript = import_node_path66.default.join(paths.identitiesDir, request7.to, "projects", projectDirNameOf(deps.cwd), `${request7.sessionId}.jsonl`);
150880
151170
  if (farmFs.lstat(transcript)?.kind !== "file") {
150881
151171
  return { kind: "stay", reason: `${request7.to} does not share this conversation's history, so it could not resume it` };
150882
151172
  }
@@ -151454,7 +151744,7 @@ async function runClaude(argvOverride) {
151454
151744
  // src/cli.ts
151455
151745
  async function main() {
151456
151746
  aliasLegacyEnv(process.env);
151457
- const invokedName = import_node_path66.default.basename(process.argv[1] ?? "agent-shim");
151747
+ const invokedName = import_node_path67.default.basename(process.argv[1] ?? "agent-shim");
151458
151748
  if (isInvokedAsClaude(invokedName)) {
151459
151749
  await runClaude();
151460
151750
  return;