claude-use 9.7.1 → 9.8.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, path48) {
322
- if (!path48)
321
+ function getElementAtPath(obj, path50) {
322
+ if (!path50)
323
323
  return obj;
324
- return path48.reduce((acc, key) => acc?.[key], obj);
324
+ return path50.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(path48, issues) {
583
+ function prefixIssues(path50, issues) {
584
584
  return issues.map((iss) => {
585
585
  var _a4;
586
586
  (_a4 = iss).path ?? (_a4.path = []);
587
- iss.path.unshift(path48);
587
+ iss.path.unshift(path50);
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, path48 = []) => {
1108
+ const processError = (error64, path50 = []) => {
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 }, [...path48, ...issue2.path]));
1111
+ issue2.errors.map((issues) => processError({ issues }, [...path50, ...issue2.path]));
1112
1112
  } else if (issue2.code === "invalid_key") {
1113
- processError({ issues: issue2.issues }, [...path48, ...issue2.path]);
1113
+ processError({ issues: issue2.issues }, [...path50, ...issue2.path]);
1114
1114
  } else if (issue2.code === "invalid_element") {
1115
- processError({ issues: issue2.issues }, [...path48, ...issue2.path]);
1115
+ processError({ issues: issue2.issues }, [...path50, ...issue2.path]);
1116
1116
  } else {
1117
- const fullpath = [...path48, ...issue2.path];
1117
+ const fullpath = [...path50, ...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, path48 = []) => {
1156
+ const processError = (error64, path50 = []) => {
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 }, [...path48, ...issue2.path]));
1160
+ issue2.errors.map((issues) => processError({ issues }, [...path50, ...issue2.path]));
1161
1161
  } else if (issue2.code === "invalid_key") {
1162
- processError({ issues: issue2.issues }, [...path48, ...issue2.path]);
1162
+ processError({ issues: issue2.issues }, [...path50, ...issue2.path]);
1163
1163
  } else if (issue2.code === "invalid_element") {
1164
- processError({ issues: issue2.issues }, [...path48, ...issue2.path]);
1164
+ processError({ issues: issue2.issues }, [...path50, ...issue2.path]);
1165
1165
  } else {
1166
- const fullpath = [...path48, ...issue2.path];
1166
+ const fullpath = [...path50, ...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 path48 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
1206
- for (const seg of path48) {
1205
+ const path50 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
1206
+ for (const seg of path50) {
1207
1207
  if (typeof seg === "number")
1208
1208
  segs.push(`[${seg}]`);
1209
1209
  else if (typeof seg === "symbol")
@@ -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 path48 = ref.slice(1).split("/").filter(Boolean);
19203
- if (path48.length === 0) {
19202
+ const path50 = ref.slice(1).split("/").filter(Boolean);
19203
+ if (path50.length === 0) {
19204
19204
  return ctx.rootSchema;
19205
19205
  }
19206
19206
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
19207
- if (path48[0] === defsKey) {
19208
- const key = path48[1] === void 0 ? void 0 : decodeJSONPointerSegment(path48[1]);
19207
+ if (path50[0] === defsKey) {
19208
+ const key = path50[1] === void 0 ? void 0 : decodeJSONPointerSegment(path50[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 path48 = require("path");
23715
+ var path50 = require("path");
23716
23716
  var os12 = require("os");
23717
23717
  var homedir = os12.homedir();
23718
23718
  var tmpdir = os12.tmpdir();
23719
23719
  var { env } = process;
23720
23720
  var macos = (name) => {
23721
- const library = path48.join(homedir, "Library");
23721
+ const library = path50.join(homedir, "Library");
23722
23722
  return {
23723
- data: path48.join(library, "Application Support", name),
23724
- config: path48.join(library, "Preferences", name),
23725
- cache: path48.join(library, "Caches", name),
23726
- log: path48.join(library, "Logs", name),
23727
- temp: path48.join(tmpdir, name)
23723
+ data: path50.join(library, "Application Support", name),
23724
+ config: path50.join(library, "Preferences", name),
23725
+ cache: path50.join(library, "Caches", name),
23726
+ log: path50.join(library, "Logs", name),
23727
+ temp: path50.join(tmpdir, name)
23728
23728
  };
23729
23729
  };
23730
23730
  var windows = (name) => {
23731
- const appData = env.APPDATA || path48.join(homedir, "AppData", "Roaming");
23732
- const localAppData = env.LOCALAPPDATA || path48.join(homedir, "AppData", "Local");
23731
+ const appData = env.APPDATA || path50.join(homedir, "AppData", "Roaming");
23732
+ const localAppData = env.LOCALAPPDATA || path50.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: path48.join(localAppData, name, "Data"),
23736
- config: path48.join(appData, name, "Config"),
23737
- cache: path48.join(localAppData, name, "Cache"),
23738
- log: path48.join(localAppData, name, "Log"),
23739
- temp: path48.join(tmpdir, name)
23735
+ data: path50.join(localAppData, name, "Data"),
23736
+ config: path50.join(appData, name, "Config"),
23737
+ cache: path50.join(localAppData, name, "Cache"),
23738
+ log: path50.join(localAppData, name, "Log"),
23739
+ temp: path50.join(tmpdir, name)
23740
23740
  };
23741
23741
  };
23742
23742
  var linux = (name) => {
23743
- const username = path48.basename(homedir);
23743
+ const username = path50.basename(homedir);
23744
23744
  return {
23745
- data: path48.join(env.XDG_DATA_HOME || path48.join(homedir, ".local", "share"), name),
23746
- config: path48.join(env.XDG_CONFIG_HOME || path48.join(homedir, ".config"), name),
23747
- cache: path48.join(env.XDG_CACHE_HOME || path48.join(homedir, ".cache"), name),
23745
+ data: path50.join(env.XDG_DATA_HOME || path50.join(homedir, ".local", "share"), name),
23746
+ config: path50.join(env.XDG_CONFIG_HOME || path50.join(homedir, ".config"), name),
23747
+ cache: path50.join(env.XDG_CACHE_HOME || path50.join(homedir, ".cache"), name),
23748
23748
  // https://wiki.debian.org/XDGBaseDirectorySpecification#state
23749
- log: path48.join(env.XDG_STATE_HOME || path48.join(homedir, ".local", "state"), name),
23750
- temp: path48.join(tmpdir, username, name)
23749
+ log: path50.join(env.XDG_STATE_HOME || path50.join(homedir, ".local", "state"), name),
23750
+ temp: path50.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, path48) {
23819
- if (typeof path48 === "string" && Object.prototype.hasOwnProperty.call(source, path48)) {
23820
- return source[path48];
23818
+ function getPropertyByPath(source, path50) {
23819
+ if (typeof path50 === "string" && Object.prototype.hasOwnProperty.call(source, path50)) {
23820
+ return source[path50];
23821
23821
  }
23822
- const parsedPath = typeof path48 === "string" ? path48.split(".") : path48;
23822
+ const parsedPath = typeof path50 === "string" ? path50.split(".") : path50;
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(path48) {
23845
+ async function isDirectory(path50) {
23846
23846
  try {
23847
- const stat = await fs_1.promises.stat(path48);
23847
+ const stat = await fs_1.promises.stat(path50);
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(path48) {
23857
+ function isDirectorySync(path50) {
23858
23858
  try {
23859
- const stat = fs_1.default.statSync(path48);
23859
+ const stat = fs_1.default.statSync(path50);
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((path48, i10) => `${i10 + 1}. ${path48}`).join("\n")} (same as ${idx + 1}.)`);
23957
+ ${[...importStack, fullPath].map((path50, i10) => `${i10 + 1}. ${path50}`).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(path48) {
24145
+ async #fileExists(path50) {
24146
24146
  try {
24147
- await promises_1.default.stat(path48);
24147
+ await promises_1.default.stat(path50);
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(path48) {
24307
+ #fileExists(path50) {
24308
24308
  try {
24309
- fs_1.default.statSync(path48);
24309
+ fs_1.default.statSync(path50);
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((path48) => path48.replace("{name}", moduleName));
24433
+ const userConfiguredSearchPlaces = userConfiguredOptions.searchPlaces?.map((path50) => path50.replace("{name}", moduleName));
24434
24434
  if (userConfiguredOptions.mergeSearchPlaces) {
24435
24435
  return [...userConfiguredSearchPlaces ?? [], ...toolDefinedSearchPlaces];
24436
24436
  }
@@ -28870,8 +28870,8 @@ var require_utils = __commonJS({
28870
28870
  }
28871
28871
  return output2;
28872
28872
  };
28873
- exports2.basename = (path48, { windows } = {}) => {
28874
- const segs = path48.split(windows ? /[\\/]/ : "/");
28873
+ exports2.basename = (path50, { windows } = {}) => {
28874
+ const segs = path50.split(windows ? /[\\/]/ : "/");
28875
28875
  const last = segs[segs.length - 1];
28876
28876
  if (last === "") {
28877
28877
  return segs[segs.length - 2];
@@ -33242,7 +33242,7 @@ var init_package = __esm({
33242
33242
  "package.json"() {
33243
33243
  package_default = {
33244
33244
  name: "claude-use",
33245
- version: "9.7.1",
33245
+ version: "9.8.0",
33246
33246
  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.",
33247
33247
  license: "MIT",
33248
33248
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -33513,11 +33513,11 @@ function identifyRequest(headers) {
33513
33513
  function directOrigin(port) {
33514
33514
  return `http://127.0.0.1:${String(port)}`;
33515
33515
  }
33516
- function parseProviderPath(path48) {
33517
- if (!path48.startsWith(PROVIDER_PATH_PREFIX)) {
33516
+ function parseProviderPath(path50) {
33517
+ if (!path50.startsWith(PROVIDER_PATH_PREFIX)) {
33518
33518
  return void 0;
33519
33519
  }
33520
- const tail = path48.slice(PROVIDER_PATH_PREFIX.length);
33520
+ const tail = path50.slice(PROVIDER_PATH_PREFIX.length);
33521
33521
  const slash = tail.indexOf("/");
33522
33522
  if (slash <= 0) {
33523
33523
  return void 0;
@@ -33843,9 +33843,9 @@ function decoderFor(encoding) {
33843
33843
  return void 0;
33844
33844
  }
33845
33845
  }
33846
- function destinationOf(path48) {
33847
- const scoped = parseProviderPath(path48);
33848
- return scoped === void 0 ? { provider: ANTHROPIC_PROVIDER, endpoint: path48 } : { provider: scoped.provider, endpoint: scoped.rest };
33846
+ function destinationOf(path50) {
33847
+ const scoped = parseProviderPath(path50);
33848
+ return scoped === void 0 ? { provider: ANTHROPIC_PROVIDER, endpoint: path50 } : { provider: scoped.provider, endpoint: scoped.rest };
33849
33849
  }
33850
33850
  function buildRecord(event, context) {
33851
33851
  const { scan } = context;
@@ -36255,14 +36255,14 @@ var require_util2 = __commonJS({
36255
36255
  }
36256
36256
  const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
36257
36257
  let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`;
36258
- let path48 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
36258
+ let path50 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
36259
36259
  if (origin[origin.length - 1] === "/") {
36260
36260
  origin = origin.slice(0, origin.length - 1);
36261
36261
  }
36262
- if (path48 && path48[0] !== "/") {
36263
- path48 = `/${path48}`;
36262
+ if (path50 && path50[0] !== "/") {
36263
+ path50 = `/${path50}`;
36264
36264
  }
36265
- return new URL(`${origin}${path48}`);
36265
+ return new URL(`${origin}${path50}`);
36266
36266
  }
36267
36267
  if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) {
36268
36268
  throw new InvalidArgumentError2("Invalid URL protocol: the URL must start with `http:` or `https:`.");
@@ -37083,9 +37083,9 @@ var require_diagnostics = __commonJS({
37083
37083
  "undici:client:sendHeaders",
37084
37084
  (evt) => {
37085
37085
  const {
37086
- request: { method, path: path48, origin }
37086
+ request: { method, path: path50, origin }
37087
37087
  } = evt;
37088
- debugLog("sending request to %s %s%s", method, origin, path48);
37088
+ debugLog("sending request to %s %s%s", method, origin, path50);
37089
37089
  }
37090
37090
  );
37091
37091
  }
@@ -37103,14 +37103,14 @@ var require_diagnostics = __commonJS({
37103
37103
  "undici:request:headers",
37104
37104
  (evt) => {
37105
37105
  const {
37106
- request: { method, path: path48, origin },
37106
+ request: { method, path: path50, origin },
37107
37107
  response: { statusCode }
37108
37108
  } = evt;
37109
37109
  debugLog(
37110
37110
  "received response to %s %s%s - HTTP %d",
37111
37111
  method,
37112
37112
  origin,
37113
- path48,
37113
+ path50,
37114
37114
  statusCode
37115
37115
  );
37116
37116
  }
@@ -37119,23 +37119,23 @@ var require_diagnostics = __commonJS({
37119
37119
  "undici:request:trailers",
37120
37120
  (evt) => {
37121
37121
  const {
37122
- request: { method, path: path48, origin }
37122
+ request: { method, path: path50, origin }
37123
37123
  } = evt;
37124
- debugLog("trailers received from %s %s%s", method, origin, path48);
37124
+ debugLog("trailers received from %s %s%s", method, origin, path50);
37125
37125
  }
37126
37126
  );
37127
37127
  diagnosticsChannel.subscribe(
37128
37128
  "undici:request:error",
37129
37129
  (evt) => {
37130
37130
  const {
37131
- request: { method, path: path48, origin },
37131
+ request: { method, path: path50, origin },
37132
37132
  error: error63
37133
37133
  } = evt;
37134
37134
  debugLog(
37135
37135
  "request to %s %s%s errored - %s",
37136
37136
  method,
37137
37137
  origin,
37138
- path48,
37138
+ path50,
37139
37139
  error63.message
37140
37140
  );
37141
37141
  }
@@ -37250,7 +37250,7 @@ var require_request = __commonJS({
37250
37250
  var kHandler = /* @__PURE__ */ Symbol("handler");
37251
37251
  var Request2 = class {
37252
37252
  constructor(origin, {
37253
- path: path48,
37253
+ path: path50,
37254
37254
  method,
37255
37255
  body,
37256
37256
  headers,
@@ -37267,11 +37267,11 @@ var require_request = __commonJS({
37267
37267
  maxRedirections,
37268
37268
  typeOfService
37269
37269
  }, handler) {
37270
- if (typeof path48 !== "string") {
37270
+ if (typeof path50 !== "string") {
37271
37271
  throw new InvalidArgumentError2("path must be a string");
37272
- } else if (path48[0] !== "/" && !(path48.startsWith("http://") || path48.startsWith("https://")) && method !== "CONNECT") {
37272
+ } else if (path50[0] !== "/" && !(path50.startsWith("http://") || path50.startsWith("https://")) && method !== "CONNECT") {
37273
37273
  throw new InvalidArgumentError2("path must be an absolute URL or start with a slash");
37274
- } else if (invalidPathRegex.test(path48)) {
37274
+ } else if (invalidPathRegex.test(path50)) {
37275
37275
  throw new InvalidArgumentError2("invalid request path");
37276
37276
  }
37277
37277
  if (typeof method !== "string") {
@@ -37346,7 +37346,7 @@ var require_request = __commonJS({
37346
37346
  this.completed = false;
37347
37347
  this.aborted = false;
37348
37348
  this.upgrade = upgrade || null;
37349
- this.path = query ? serializePathWithQuery(path48, query) : path48;
37349
+ this.path = query ? serializePathWithQuery(path50, query) : path50;
37350
37350
  this.origin = origin;
37351
37351
  this.protocol = getProtocolFromUrlString(origin);
37352
37352
  this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
@@ -42528,7 +42528,7 @@ var require_client_h1 = __commonJS({
42528
42528
  return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
42529
42529
  }
42530
42530
  function writeH1(client, request7) {
42531
- const { method, path: path48, host, upgrade, blocking, reset } = request7;
42531
+ const { method, path: path50, host, upgrade, blocking, reset } = request7;
42532
42532
  let { body, headers, contentLength } = request7;
42533
42533
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
42534
42534
  if (util2.isFormDataLike(body)) {
@@ -42606,7 +42606,7 @@ var require_client_h1 = __commonJS({
42606
42606
  if (socket.setTypeOfService) {
42607
42607
  socket.setTypeOfService(request7.typeOfService);
42608
42608
  }
42609
- let header = `${method} ${path48} HTTP/1.1\r
42609
+ let header = `${method} ${path50} HTTP/1.1\r
42610
42610
  `;
42611
42611
  if (typeof host === "string") {
42612
42612
  header += `host: ${host}\r
@@ -43285,7 +43285,7 @@ var require_client_h2 = __commonJS({
43285
43285
  const headersTimeout = request7.headersTimeout ?? client[kHeadersTimeout];
43286
43286
  const bodyTimeout = request7.bodyTimeout ?? client[kBodyTimeout];
43287
43287
  const session = client[kHTTP2Session];
43288
- const { method, path: path48, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request7;
43288
+ const { method, path: path50, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request7;
43289
43289
  let { body } = request7;
43290
43290
  if (upgrade != null && upgrade !== "websocket") {
43291
43291
  util2.errorRequest(client, request7, new InvalidArgumentError2(`Custom upgrade "${upgrade}" not supported over HTTP/2`));
@@ -43354,7 +43354,7 @@ var require_client_h2 = __commonJS({
43354
43354
  }
43355
43355
  headers[HTTP2_HEADER_METHOD] = "CONNECT";
43356
43356
  headers[HTTP2_HEADER_PROTOCOL] = "websocket";
43357
- headers[HTTP2_HEADER_PATH] = path48;
43357
+ headers[HTTP2_HEADER_PATH] = path50;
43358
43358
  if (protocol === "ws:" || protocol === "wss:") {
43359
43359
  headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
43360
43360
  } else {
@@ -43396,7 +43396,7 @@ var require_client_h2 = __commonJS({
43396
43396
  stream.setTimeout(headersTimeout);
43397
43397
  return true;
43398
43398
  }
43399
- headers[HTTP2_HEADER_PATH] = path48;
43399
+ headers[HTTP2_HEADER_PATH] = path50;
43400
43400
  headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
43401
43401
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
43402
43402
  if (body && typeof body.read === "function") {
@@ -45748,10 +45748,10 @@ var require_proxy_agent = __commonJS({
45748
45748
  };
45749
45749
  const {
45750
45750
  origin,
45751
- path: path48 = "/",
45751
+ path: path50 = "/",
45752
45752
  headers = {}
45753
45753
  } = opts;
45754
- opts.path = origin + path48;
45754
+ opts.path = origin + path50;
45755
45755
  if (!("host" in headers) && !("Host" in headers)) {
45756
45756
  const { host } = new URL(origin);
45757
45757
  headers.host = host;
@@ -47860,20 +47860,20 @@ var require_mock_utils = __commonJS({
47860
47860
  }
47861
47861
  return normalizedQp;
47862
47862
  }
47863
- function safeUrl(path48) {
47864
- if (typeof path48 !== "string") {
47865
- return path48;
47863
+ function safeUrl(path50) {
47864
+ if (typeof path50 !== "string") {
47865
+ return path50;
47866
47866
  }
47867
- const pathSegments = path48.split("?", 3);
47867
+ const pathSegments = path50.split("?", 3);
47868
47868
  if (pathSegments.length !== 2) {
47869
- return path48;
47869
+ return path50;
47870
47870
  }
47871
47871
  const qp2 = new URLSearchParams(pathSegments.pop());
47872
47872
  qp2.sort();
47873
47873
  return [...pathSegments, qp2.toString()].join("?");
47874
47874
  }
47875
- function matchKey(mockDispatch2, { path: path48, method, body, headers }) {
47876
- const pathMatch = matchValue(mockDispatch2.path, path48);
47875
+ function matchKey(mockDispatch2, { path: path50, method, body, headers }) {
47876
+ const pathMatch = matchValue(mockDispatch2.path, path50);
47877
47877
  const methodMatch = matchValue(mockDispatch2.method, method);
47878
47878
  const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
47879
47879
  const headersMatch = matchHeaders(mockDispatch2, headers);
@@ -47898,8 +47898,8 @@ var require_mock_utils = __commonJS({
47898
47898
  const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
47899
47899
  const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
47900
47900
  const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
47901
- let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path48, ignoreTrailingSlash }) => {
47902
- return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path48)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path48), resolvedPath);
47901
+ let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path50, ignoreTrailingSlash }) => {
47902
+ return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path50)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path50), resolvedPath);
47903
47903
  });
47904
47904
  if (matchedMockDispatches.length === 0) {
47905
47905
  throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
@@ -47938,19 +47938,19 @@ var require_mock_utils = __commonJS({
47938
47938
  mockDispatches.splice(index, 1);
47939
47939
  }
47940
47940
  }
47941
- function removeTrailingSlash(path48) {
47942
- while (path48.endsWith("/")) {
47943
- path48 = path48.slice(0, -1);
47941
+ function removeTrailingSlash(path50) {
47942
+ while (path50.endsWith("/")) {
47943
+ path50 = path50.slice(0, -1);
47944
47944
  }
47945
- if (path48.length === 0) {
47946
- path48 = "/";
47945
+ if (path50.length === 0) {
47946
+ path50 = "/";
47947
47947
  }
47948
- return path48;
47948
+ return path50;
47949
47949
  }
47950
47950
  function buildKey(opts) {
47951
- const { path: path48, method, body, headers, query } = opts;
47951
+ const { path: path50, method, body, headers, query } = opts;
47952
47952
  return {
47953
- path: path48,
47953
+ path: path50,
47954
47954
  method,
47955
47955
  body,
47956
47956
  headers,
@@ -48640,10 +48640,10 @@ var require_pending_interceptors_formatter = __commonJS({
48640
48640
  }
48641
48641
  format(pendingInterceptors) {
48642
48642
  const withPrettyHeaders = pendingInterceptors.map(
48643
- ({ method, path: path48, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
48643
+ ({ method, path: path50, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
48644
48644
  Method: method,
48645
48645
  Origin: origin,
48646
- Path: path48,
48646
+ Path: path50,
48647
48647
  "Status code": statusCode,
48648
48648
  Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
48649
48649
  Invocations: timesInvoked,
@@ -48725,9 +48725,9 @@ var require_mock_agent = __commonJS({
48725
48725
  const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
48726
48726
  const dispatchOpts = { ...opts };
48727
48727
  if (acceptNonStandardSearchParameters && dispatchOpts.path) {
48728
- const [path48, searchParams] = dispatchOpts.path.split("?");
48728
+ const [path50, searchParams] = dispatchOpts.path.split("?");
48729
48729
  const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
48730
- dispatchOpts.path = `${path48}?${normalizedSearchParams}`;
48730
+ dispatchOpts.path = `${path50}?${normalizedSearchParams}`;
48731
48731
  }
48732
48732
  return this[kAgent].dispatch(dispatchOpts, handler);
48733
48733
  }
@@ -49128,12 +49128,12 @@ var require_snapshot_recorder = __commonJS({
49128
49128
  * @return {Promise<void>} - Resolves when snapshots are loaded
49129
49129
  */
49130
49130
  async loadSnapshots(filePath) {
49131
- const path48 = filePath || this.#snapshotPath;
49132
- if (!path48) {
49131
+ const path50 = filePath || this.#snapshotPath;
49132
+ if (!path50) {
49133
49133
  throw new InvalidArgumentError2("Snapshot path is required");
49134
49134
  }
49135
49135
  try {
49136
- const data = await readFile(resolve2(path48), "utf8");
49136
+ const data = await readFile(resolve2(path50), "utf8");
49137
49137
  const parsed = JSON.parse(data);
49138
49138
  if (Array.isArray(parsed)) {
49139
49139
  this.#snapshots.clear();
@@ -49147,7 +49147,7 @@ var require_snapshot_recorder = __commonJS({
49147
49147
  if (error63.code === "ENOENT") {
49148
49148
  this.#snapshots.clear();
49149
49149
  } else {
49150
- throw new UndiciError(`Failed to load snapshots from ${path48}`, { cause: error63 });
49150
+ throw new UndiciError(`Failed to load snapshots from ${path50}`, { cause: error63 });
49151
49151
  }
49152
49152
  }
49153
49153
  }
@@ -49158,11 +49158,11 @@ var require_snapshot_recorder = __commonJS({
49158
49158
  * @returns {Promise<void>} - Resolves when snapshots are saved
49159
49159
  */
49160
49160
  async saveSnapshots(filePath) {
49161
- const path48 = filePath || this.#snapshotPath;
49162
- if (!path48) {
49161
+ const path50 = filePath || this.#snapshotPath;
49162
+ if (!path50) {
49163
49163
  throw new InvalidArgumentError2("Snapshot path is required");
49164
49164
  }
49165
- const resolvedPath = resolve2(path48);
49165
+ const resolvedPath = resolve2(path50);
49166
49166
  await mkdir(dirname3(resolvedPath), { recursive: true });
49167
49167
  const data = Array.from(this.#snapshots.entries()).map(([hash2, snapshot]) => ({
49168
49168
  hash: hash2,
@@ -49794,15 +49794,15 @@ var require_redirect_handler = __commonJS({
49794
49794
  return;
49795
49795
  }
49796
49796
  const { origin, pathname, search } = util2.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
49797
- const path48 = search ? `${pathname}${search}` : pathname;
49798
- const redirectUrlString = `${origin}${path48}`;
49797
+ const path50 = search ? `${pathname}${search}` : pathname;
49798
+ const redirectUrlString = `${origin}${path50}`;
49799
49799
  for (const historyUrl of this.history) {
49800
49800
  if (historyUrl.toString() === redirectUrlString) {
49801
49801
  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.`);
49802
49802
  }
49803
49803
  }
49804
49804
  this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
49805
- this.opts.path = path48;
49805
+ this.opts.path = path50;
49806
49806
  this.opts.origin = origin;
49807
49807
  this.opts.query = null;
49808
49808
  }
@@ -51562,10 +51562,10 @@ var require_cache_handler = __commonJS({
51562
51562
  }
51563
51563
  return locationUrl.pathname + locationUrl.search;
51564
51564
  }
51565
- function deleteCachedUri(store, cacheKey, path48) {
51565
+ function deleteCachedUri(store, cacheKey, path50) {
51566
51566
  deleteCachedValue(store, {
51567
51567
  ...cacheKey,
51568
- path: path48
51568
+ path: path50
51569
51569
  });
51570
51570
  for (let i10 = 0; i10 < util2.safeHTTPMethods.length; i10++) {
51571
51571
  const method = util2.safeHTTPMethods[i10];
@@ -51573,7 +51573,7 @@ var require_cache_handler = __commonJS({
51573
51573
  deleteCachedValue(store, {
51574
51574
  ...cacheKey,
51575
51575
  method,
51576
- path: path48
51576
+ path: path50
51577
51577
  });
51578
51578
  }
51579
51579
  }
@@ -51584,9 +51584,9 @@ var require_cache_handler = __commonJS({
51584
51584
  }
51585
51585
  const values = Array.isArray(headerValue2) ? headerValue2 : [headerValue2];
51586
51586
  for (let i10 = 0; i10 < values.length; i10++) {
51587
- const path48 = getSameOriginPath(cacheKey, values[i10]);
51588
- if (path48 !== void 0) {
51589
- deleteCachedUri(store, cacheKey, path48);
51587
+ const path50 = getSameOriginPath(cacheKey, values[i10]);
51588
+ if (path50 !== void 0) {
51589
+ deleteCachedUri(store, cacheKey, path50);
51590
51590
  }
51591
51591
  }
51592
51592
  }
@@ -56586,11 +56586,11 @@ var require_fetch = __commonJS({
56586
56586
  function dispatch({ body }) {
56587
56587
  const url2 = requestCurrentURL(request7);
56588
56588
  const agent = fetchParams.controller.dispatcher;
56589
- const path48 = url2.pathname + url2.search;
56589
+ const path50 = url2.pathname + url2.search;
56590
56590
  const hasTrailingQuestionMark = url2.search.length === 0 && url2.href[url2.href.length - url2.hash.length - 1] === "?";
56591
56591
  return new Promise((resolve2, reject) => agent.dispatch(
56592
56592
  {
56593
- path: hasTrailingQuestionMark ? `${path48}?` : path48,
56593
+ path: hasTrailingQuestionMark ? `${path50}?` : path50,
56594
56594
  origin: url2.origin,
56595
56595
  method: request7.method,
56596
56596
  body: agent.isMockActive ? request7.body && (request7.body.source || request7.body.stream) : body,
@@ -57537,9 +57537,9 @@ var require_util5 = __commonJS({
57537
57537
  }
57538
57538
  }
57539
57539
  }
57540
- function validateCookiePath(path48) {
57541
- for (let i10 = 0; i10 < path48.length; ++i10) {
57542
- const code = path48.charCodeAt(i10);
57540
+ function validateCookiePath(path50) {
57541
+ for (let i10 = 0; i10 < path50.length; ++i10) {
57542
+ const code = path50.charCodeAt(i10);
57543
57543
  if (code < 32 || // exclude CTLs (0-31)
57544
57544
  code > 126 || // exclude DEL and non-ascii
57545
57545
  code === 59) {
@@ -60887,11 +60887,11 @@ var require_undici = __commonJS({
60887
60887
  if (typeof opts.path !== "string") {
60888
60888
  throw new InvalidArgumentError2("invalid opts.path");
60889
60889
  }
60890
- let path48 = opts.path;
60890
+ let path50 = opts.path;
60891
60891
  if (!opts.path.startsWith("/")) {
60892
- path48 = `/${path48}`;
60892
+ path50 = `/${path50}`;
60893
60893
  }
60894
- url2 = new URL(util2.parseOrigin(url2).origin + path48);
60894
+ url2 = new URL(util2.parseOrigin(url2).origin + path50);
60895
60895
  } else {
60896
60896
  if (!opts) {
60897
60897
  opts = typeof url2 === "object" ? url2 : {};
@@ -62430,10 +62430,16 @@ function decideLaunch(params, readOnly) {
62430
62430
  const assembled = assembleCascade(launchCascade);
62431
62431
  const flattened = flattenLayers(assembled.layers, { home: params.farm.home });
62432
62432
  cascadeLaunch = flattened.launch;
62433
- if (readOnly) {
62433
+ if (readOnly || farmContext === void 0) {
62434
62434
  for (const diagnostic of [...assembled.diagnostics, ...flattened.diagnostics]) {
62435
- if (diagnostic.severity !== "info") {
62436
- log.warn(`agent-shim: ${diagnostic.code}: ${diagnostic.message}`);
62435
+ if (diagnostic.severity === "info") {
62436
+ continue;
62437
+ }
62438
+ const message = `agent-shim: ${diagnostic.code}: ${diagnostic.message}`;
62439
+ if (diagnostic.severity === "error" && !readOnly) {
62440
+ log.error(message);
62441
+ } else {
62442
+ log.warn(message);
62437
62443
  }
62438
62444
  }
62439
62445
  }
@@ -99841,8 +99847,8 @@ var require_utils3 = __commonJS({
99841
99847
  }
99842
99848
  return ind;
99843
99849
  }
99844
- function removeDotSegments(path48) {
99845
- let input2 = path48;
99850
+ function removeDotSegments(path50) {
99851
+ let input2 = path50;
99846
99852
  const output2 = [];
99847
99853
  let nextSlash = -1;
99848
99854
  let len = 0;
@@ -100251,8 +100257,8 @@ var require_schemes = __commonJS({
100251
100257
  }
100252
100258
  if (wsComponent.resourceName) {
100253
100259
  const queryIndex = wsComponent.resourceName.indexOf("?");
100254
- const path48 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
100255
- wsComponent.path = path48 && path48 !== "/" ? path48 : void 0;
100260
+ const path50 = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
100261
+ wsComponent.path = path50 && path50 !== "/" ? path50 : void 0;
100256
100262
  wsComponent.query = queryIndex === -1 ? void 0 : wsComponent.resourceName.slice(queryIndex + 1);
100257
100263
  wsComponent.resourceName = void 0;
100258
100264
  }
@@ -103779,7 +103785,7 @@ var require_dist2 = __commonJS({
103779
103785
  });
103780
103786
 
103781
103787
  // src/cli.ts
103782
- var import_node_path47 = __toESM(require("node:path"), 1);
103788
+ var import_node_path49 = __toESM(require("node:path"), 1);
103783
103789
 
103784
103790
  // node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/error.js
103785
103791
  var CommanderError = class extends Error {
@@ -106892,9 +106898,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
106892
106898
  * @param {string} [path]
106893
106899
  * @return {(string|null|Command)}
106894
106900
  */
106895
- executableDir(path48) {
106896
- if (path48 === void 0) return this._executableDir;
106897
- this._executableDir = path48;
106901
+ executableDir(path50) {
106902
+ if (path50 === void 0) return this._executableDir;
106903
+ this._executableDir = path50;
106898
106904
  return this;
106899
106905
  }
106900
106906
  /**
@@ -108543,19 +108549,19 @@ function writePools(paths, pools) {
108543
108549
  applyPatch(paths.globalConfigFile, GlobalConfigSchema, { pools }, { defaults: {} });
108544
108550
  }
108545
108551
  function poolCycleOf(pools, name) {
108546
- const walk = (current, path48) => {
108552
+ const walk = (current, path50) => {
108547
108553
  for (const entry of pools[current]?.identities ?? []) {
108548
108554
  const nested = poolNameOf(poolMemberIdentity(entry));
108549
108555
  if (nested === void 0) {
108550
108556
  continue;
108551
108557
  }
108552
108558
  if (nested === name) {
108553
- return [...path48, nested];
108559
+ return [...path50, nested];
108554
108560
  }
108555
- if (path48.includes(nested)) {
108561
+ if (path50.includes(nested)) {
108556
108562
  continue;
108557
108563
  }
108558
- const found = walk(nested, [...path48, nested]);
108564
+ const found = walk(nested, [...path50, nested]);
108559
108565
  if (found !== void 0) {
108560
108566
  return found;
108561
108567
  }
@@ -111372,7 +111378,7 @@ function registerCodexCommand(program2, deps) {
111372
111378
 
111373
111379
  // src/frontdoor/commands.ts
111374
111380
  var import_node_crypto20 = require("node:crypto");
111375
- var import_node_path44 = __toESM(require("node:path"), 1);
111381
+ var import_node_path45 = __toESM(require("node:path"), 1);
111376
111382
  var import_node_fs16 = __toESM(require("node:fs"), 1);
111377
111383
  init_commandDeps();
111378
111384
  init_schema();
@@ -112323,8 +112329,8 @@ function parseConnectTarget(authority) {
112323
112329
  }
112324
112330
  return { host, port };
112325
112331
  }
112326
- function servedByPipeline(path48) {
112327
- return path48?.startsWith(ROUTED_PATH_PREFIX) === true;
112332
+ function servedByPipeline(path50) {
112333
+ return path50?.startsWith(ROUTED_PATH_PREFIX) === true;
112328
112334
  }
112329
112335
  var HOP_BY_HOP_HEADERS = /* @__PURE__ */ new Set([
112330
112336
  "connection",
@@ -112843,11 +112849,11 @@ function createRcSessionTracker(deps) {
112843
112849
  };
112844
112850
  const observeExchange = (request7) => {
112845
112851
  const method = (request7.method ?? "").toUpperCase();
112846
- const path48 = new URL(request7.url ?? "/", "http://127.0.0.1").pathname;
112847
- if (!path48.startsWith(RC_SESSIONS_PATH_PREFIX)) {
112852
+ const path50 = new URL(request7.url ?? "/", "http://127.0.0.1").pathname;
112853
+ if (!path50.startsWith(RC_SESSIONS_PATH_PREFIX)) {
112848
112854
  return void 0;
112849
112855
  }
112850
- const tail = path48.slice(RC_SESSIONS_PATH_PREFIX.length);
112856
+ const tail = path50.slice(RC_SESSIONS_PATH_PREFIX.length);
112851
112857
  const facts = {
112852
112858
  oauthAuthorization: oauthAuthorizationOf(request7.headers),
112853
112859
  anthropicVersion: singleHeader(request7.headers, "anthropic-version"),
@@ -113208,8 +113214,8 @@ var RC_READ_FILE_ENCODINGS = ["utf-8", "base64"];
113208
113214
  function isRcReadFileEncoding(value2) {
113209
113215
  return RC_READ_FILE_ENCODINGS.some((encoding) => encoding === value2);
113210
113216
  }
113211
- function buildRcReadFilePayload(requestId, path48, options) {
113212
- return buildRcControlRequestPayload(requestId, { subtype: "read_file", path: path48, ...options?.maxBytes === void 0 ? {} : { max_bytes: options.maxBytes }, ...options?.encoding === void 0 ? {} : { encoding: options.encoding } });
113217
+ function buildRcReadFilePayload(requestId, path50, options) {
113218
+ return buildRcControlRequestPayload(requestId, { subtype: "read_file", path: path50, ...options?.maxBytes === void 0 ? {} : { max_bytes: options.maxBytes }, ...options?.encoding === void 0 ? {} : { encoding: options.encoding } });
113213
113219
  }
113214
113220
  function buildRcFileSuggestionsPayload(requestId, query) {
113215
113221
  return buildRcControlRequestPayload(requestId, { subtype: "file_suggestions", query });
@@ -113311,15 +113317,15 @@ async function getRcSessionContextUsage(deps, sessionId, detail) {
113311
113317
  const result = await deliverRcClientPayload(deps, sessionId, buildRcGetContextUsagePayload(requestId, detail), `request the context usage of session ${sessionId}`);
113312
113318
  return result.ok ? { ...result, requestId } : result;
113313
113319
  }
113314
- async function readRcSessionFile(deps, sessionId, path48, options) {
113315
- if (path48 === "") {
113320
+ async function readRcSessionFile(deps, sessionId, path50, options) {
113321
+ if (path50 === "") {
113316
113322
  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" };
113317
113323
  }
113318
113324
  if (options?.maxBytes !== void 0 && (!Number.isInteger(options.maxBytes) || options.maxBytes <= 0)) {
113319
113325
  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" };
113320
113326
  }
113321
113327
  const requestId = deps.newUuid();
113322
- const result = await deliverRcClientPayload(deps, sessionId, buildRcReadFilePayload(requestId, path48, options), `read ${path48} from session ${sessionId}`);
113328
+ const result = await deliverRcClientPayload(deps, sessionId, buildRcReadFilePayload(requestId, path50, options), `read ${path50} from session ${sessionId}`);
113323
113329
  return result.ok ? { ...result, requestId } : result;
113324
113330
  }
113325
113331
  async function suggestRcSessionFiles(deps, sessionId, query) {
@@ -113490,11 +113496,11 @@ function createRcControlHandler(deps) {
113490
113496
  path: "read-file",
113491
113497
  read: (body) => {
113492
113498
  const session = bodyString(body, "session");
113493
- const path48 = bodyString(body, "path");
113499
+ const path50 = bodyString(body, "path");
113494
113500
  const maxBytes = "maxBytes" in body ? bodyPositiveInteger(body, "maxBytes") : void 0;
113495
113501
  const encoding = "encoding" in body && isRcReadFileEncoding(body.encoding) ? body.encoding : void 0;
113496
- const refused2 = session === void 0 || path48 === void 0 || "maxBytes" in body && maxBytes === void 0 || "encoding" in body && encoding === void 0;
113497
- 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, path48, { ...maxBytes === void 0 ? {} : { maxBytes }, ...encoding === void 0 ? {} : { encoding } }) };
113502
+ const refused2 = session === void 0 || path50 === void 0 || "maxBytes" in body && maxBytes === void 0 || "encoding" in body && encoding === void 0;
113503
+ 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, path50, { ...maxBytes === void 0 ? {} : { maxBytes }, ...encoding === void 0 ? {} : { encoding } }) };
113498
113504
  }
113499
113505
  },
113500
113506
  {
@@ -113804,9 +113810,9 @@ function requestIdOfBody(body) {
113804
113810
  }
113805
113811
  function frontDoorRcControl(transport, token) {
113806
113812
  const headers = { authorization: `Bearer ${token}` };
113807
- const listAnswerOf = async (path48, what) => {
113813
+ const listAnswerOf = async (path50, what) => {
113808
113814
  try {
113809
- return await transport.request({ method: "GET", path: path48, headers });
113815
+ return await transport.request({ method: "GET", path: path50, headers });
113810
113816
  } catch (error63) {
113811
113817
  throw new Error(`${what}: could not reach the front door's control listener: ${error63 instanceof Error ? error63.message : String(error63)}`, { cause: error63 });
113812
113818
  }
@@ -113878,10 +113884,10 @@ function frontDoorRcControl(transport, token) {
113878
113884
  }
113879
113885
  return pending;
113880
113886
  };
113881
- const writeOf = async (path48, body, describeFailure) => {
113887
+ const writeOf = async (path50, body, describeFailure) => {
113882
113888
  let answer;
113883
113889
  try {
113884
- answer = await transport.request({ method: "POST", path: path48, headers: { ...headers, "content-type": "application/json" }, body });
113890
+ answer = await transport.request({ method: "POST", path: path50, headers: { ...headers, "content-type": "application/json" }, body });
113885
113891
  } catch (error63) {
113886
113892
  return { ok: false, message: `could not reach the front door's control listener: ${error63 instanceof Error ? error63.message : String(error63)}` };
113887
113893
  }
@@ -113912,10 +113918,10 @@ function frontDoorRcControl(transport, token) {
113912
113918
  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}`),
113913
113919
  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}`),
113914
113920
  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}`),
113915
- readFile: async (sessionId, path48, options) => await writeOf(
113921
+ readFile: async (sessionId, path50, options) => await writeOf(
113916
113922
  `${CONTROL_PATH_PREFIX}/read-file`,
113917
- JSON.stringify({ session: sessionId, path: path48, ...options?.maxBytes === void 0 ? {} : { maxBytes: options.maxBytes }, ...options?.encoding === void 0 ? {} : { encoding: options.encoding } }),
113918
- (status, message) => `reading ${path48} from ${sessionId} failed (HTTP ${String(status)}): ${message}`
113923
+ JSON.stringify({ session: sessionId, path: path50, ...options?.maxBytes === void 0 ? {} : { maxBytes: options.maxBytes }, ...options?.encoding === void 0 ? {} : { encoding: options.encoding } }),
113924
+ (status, message) => `reading ${path50} from ${sessionId} failed (HTTP ${String(status)}): ${message}`
113919
113925
  ),
113920
113926
  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}`),
113921
113927
  keepAlive: async (sessionId) => await writeOf(`${CONTROL_PATH_PREFIX}/keep-alive`, JSON.stringify({ session: sessionId }), (status, message) => `keeping ${sessionId} alive failed (HTTP ${String(status)}): ${message}`),
@@ -114209,12 +114215,12 @@ function tlsFacts(options) {
114209
114215
  }
114210
114216
  function realRcEventDial(target = { host: CONNECT_INTERCEPT_HOST, port: HTTPS_PORT }) {
114211
114217
  const agent = new ExemptTlsAgent();
114212
- const post = async (path48, headers, body) => await new Promise((resolve2, reject) => {
114218
+ const post = async (path50, headers, body) => await new Promise((resolve2, reject) => {
114213
114219
  const options = {
114214
114220
  host: target.host,
114215
114221
  port: target.port,
114216
114222
  method: "POST",
114217
- path: path48,
114223
+ path: path50,
114218
114224
  // 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.
114219
114225
  headers: { ...headers, host: target.servername ?? target.host, "content-length": String(Buffer.byteLength(body, "utf8")) },
114220
114226
  agent
@@ -114279,12 +114285,12 @@ function lateRcStreamDial(resolve2) {
114279
114285
  }
114280
114286
  function realRcStreamDial(target = { host: CONNECT_INTERCEPT_HOST, port: HTTPS_PORT }) {
114281
114287
  const agent = new ExemptTlsAgent();
114282
- const request7 = async (method, path48, headers, body, signal) => await new Promise((resolve2, reject) => {
114288
+ const request7 = async (method, path50, headers, body, signal) => await new Promise((resolve2, reject) => {
114283
114289
  const options = {
114284
114290
  host: target.host,
114285
114291
  port: target.port,
114286
114292
  method,
114287
- path: path48,
114293
+ path: path50,
114288
114294
  // 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.
114289
114295
  headers: { ...headers, host: target.servername ?? target.host, ...body === void 0 ? {} : { "content-length": String(Buffer.byteLength(body, "utf8")) } },
114290
114296
  agent,
@@ -114326,9 +114332,9 @@ function realRcStreamDial(target = { host: CONNECT_INTERCEPT_HOST, port: HTTPS_P
114326
114332
  return { status, body: await readAll(response) };
114327
114333
  },
114328
114334
  openStream: async (sessionId, headers, resume, signal) => {
114329
- const path48 = resume === void 0 ? `/v1/code/sessions/${encodeURIComponent(sessionId)}/events/stream` : `/v1/code/sessions/${encodeURIComponent(sessionId)}/events/stream?from_sequence_num=${String(resume.fromSequenceNum)}`;
114335
+ const path50 = resume === void 0 ? `/v1/code/sessions/${encodeURIComponent(sessionId)}/events/stream` : `/v1/code/sessions/${encodeURIComponent(sessionId)}/events/stream?from_sequence_num=${String(resume.fromSequenceNum)}`;
114330
114336
  const streamHeaders = resume === void 0 ? headers : { ...headers, "last-event-id": String(resume.fromSequenceNum) };
114331
- const { status, response } = await request7("GET", path48, streamHeaders, void 0, signal);
114337
+ const { status, response } = await request7("GET", path50, streamHeaders, void 0, signal);
114332
114338
  if (!isSuccessful2(status)) {
114333
114339
  await readAll(response);
114334
114340
  return { status, chunks: NO_CHUNKS };
@@ -114544,7 +114550,40 @@ init_claudeShim();
114544
114550
  init_store();
114545
114551
  init_realPorts();
114546
114552
  var import_node_fs15 = __toESM(require("node:fs"), 1);
114553
+ var import_node_path40 = __toESM(require("node:path"), 1);
114554
+
114555
+ // src/usage/signIn.ts
114547
114556
  var import_node_path39 = __toESM(require("node:path"), 1);
114557
+ var CREDENTIALS_FILE = ".credentials.json";
114558
+ function keychainHasItem(run, account) {
114559
+ return run.run("security", ["find-generic-password", "-a", account]).status === 0;
114560
+ }
114561
+ function decideSignIn(facts) {
114562
+ if (facts.hasCredentialBlock) {
114563
+ return { state: "token", detail: "supplies its own credential through a credential block, so a stored login is not what a launch uses" };
114564
+ }
114565
+ if (facts.keychainItem === true) {
114566
+ return { state: "signed-in", detail: "a login is stored in the macOS Keychain" };
114567
+ }
114568
+ if (facts.credentialsFile) {
114569
+ return { state: "signed-in", detail: `a login is stored in ${CREDENTIALS_FILE}` };
114570
+ }
114571
+ return { state: "signed-out", detail: facts.platform === "darwin" ? `no Keychain item and no ${CREDENTIALS_FILE}` : `no ${CREDENTIALS_FILE}` };
114572
+ }
114573
+ function credentialsFilePath(farmRoot) {
114574
+ return import_node_path39.default.join(farmRoot, CREDENTIALS_FILE);
114575
+ }
114576
+ function identitySignIn(fs21, probe, identity) {
114577
+ const probing = !identity.hasCredentialBlock;
114578
+ return decideSignIn({
114579
+ hasCredentialBlock: identity.hasCredentialBlock,
114580
+ keychainItem: probing && probe.platform === "darwin" && probe.run !== void 0 ? keychainHasItem(probe.run, identity.farmRoot) : void 0,
114581
+ credentialsFile: probing && fs21.lstat(credentialsFilePath(identity.farmRoot)) !== void 0,
114582
+ platform: probe.platform
114583
+ });
114584
+ }
114585
+
114586
+ // src/doctorReport.ts
114548
114587
  init_load();
114549
114588
  init_schema();
114550
114589
  init_credential();
@@ -114566,6 +114605,7 @@ var DOCTOR_SECTIONS = [
114566
114605
  "legacy-name",
114567
114606
  "config-profile",
114568
114607
  "identity",
114608
+ "sign-in",
114569
114609
  "pool",
114570
114610
  "provider",
114571
114611
  "keychain",
@@ -114608,7 +114648,7 @@ function tcpPortEraRecord(raw) {
114608
114648
  return (has("port") || has("lastPort")) && !has("socketPath");
114609
114649
  }
114610
114650
  function pushPathResolution(push, resolution) {
114611
- const ownDir = import_node_path39.default.dirname(resolution.ownExecutablePath);
114651
+ const ownDir = import_node_path40.default.dirname(resolution.ownExecutablePath);
114612
114652
  switch (resolution.agentShim.status) {
114613
114653
  case "ok":
114614
114654
  push("path-resolution", "pass", `\`agent-shim\` on PATH resolves to this running executable, ${resolution.ownExecutablePath}.`, "agent-shim");
@@ -114707,14 +114747,14 @@ function pushProvider(push, entry, cacheEnv, signIn) {
114707
114747
  }
114708
114748
  function pushLegacyName(push, params) {
114709
114749
  const legacyVariables = Object.keys(params.env).filter((name) => name.startsWith(LEGACY_ENV_PREFIX) && params.env[name] !== void 0).sort();
114710
- if (legacyVariables.length === 0 && import_node_path39.default.basename(params.rootPath) !== LEGACY_HOME_DIRNAME) {
114750
+ if (legacyVariables.length === 0 && import_node_path40.default.basename(params.rootPath) !== LEGACY_HOME_DIRNAME) {
114711
114751
  push("legacy-name", "pass", "Nothing here still uses the former `claude-use` name.");
114712
114752
  return;
114713
114753
  }
114714
114754
  for (const name of legacyVariables) {
114715
114755
  push("legacy-name", "warn", `${name} is the former name of ${name.replace(LEGACY_ENV_PREFIX, ENV_PREFIX)}. Rename it; the old name still works but is only a fallback.`, name);
114716
114756
  }
114717
- if (import_node_path39.default.basename(params.rootPath) === LEGACY_HOME_DIRNAME) {
114757
+ if (import_node_path40.default.basename(params.rootPath) === LEGACY_HOME_DIRNAME) {
114718
114758
  push(
114719
114759
  "legacy-name",
114720
114760
  "warn",
@@ -114811,6 +114851,18 @@ function runDoctor(params) {
114811
114851
  `${entry.name} is valid and authenticates with ${credential === void 0 ? "its stored login" : `credential ${describeCredential(credential)}`}${cache.text}.`,
114812
114852
  entry.name
114813
114853
  );
114854
+ const signIn = decideSignIn({
114855
+ hasCredentialBlock: credential !== void 0,
114856
+ keychainItem: params.platform === "darwin" && params.run !== void 0 ? keychainHasItem(params.run, entry.farmRoot) : void 0,
114857
+ credentialsFile: entry.credentialsFilePresent,
114858
+ platform: params.platform
114859
+ });
114860
+ push(
114861
+ "sign-in",
114862
+ signIn.state === "signed-out" ? "warn" : "pass",
114863
+ signIn.state === "signed-out" ? `${entry.name} is signed out (${signIn.detail}). Run \`agent-shim run @${entry.name}\` and sign in.` : `${entry.name} ${signIn.state === "token" ? "uses a credential block" : "is signed in"} (${signIn.detail}).`,
114864
+ entry.name
114865
+ );
114814
114866
  }
114815
114867
  }
114816
114868
  const validatedGlobalConfig = params.globalConfig.raw === void 0 ? void 0 : validateJson(GlobalConfigSchema, params.globalConfig);
@@ -114856,7 +114908,7 @@ function runDoctor(params) {
114856
114908
  } else {
114857
114909
  for (const entry of params.identities) {
114858
114910
  const result = lookupKeychainService(params.run, entry.farmRoot);
114859
- push("keychain", result.found ? "pass" : "warn", result.note, entry.name);
114911
+ push("keychain", "pass", result.found ? result.note : `${result.note} The sign-in section reports whether a login is stored elsewhere.`, entry.name);
114860
114912
  }
114861
114913
  }
114862
114914
  if (params.directoryRules.raw === void 0) {
@@ -114991,6 +115043,7 @@ var SECTION_TITLES = {
114991
115043
  "legacy-name": "Former `claude-use` name",
114992
115044
  "config-profile": "Configuration profiles",
114993
115045
  identity: "Identities",
115046
+ "sign-in": "Sign-in",
114994
115047
  pool: "Pools",
114995
115048
  provider: "Providers",
114996
115049
  keychain: "macOS Keychain",
@@ -115007,6 +115060,7 @@ var SECTION_ORDER = [
115007
115060
  "path-resolution",
115008
115061
  "config-profile",
115009
115062
  "identity",
115063
+ "sign-in",
115010
115064
  "pool",
115011
115065
  "provider",
115012
115066
  "keychain",
@@ -115056,18 +115110,18 @@ function collectDoctorReport(params) {
115056
115110
  const { paths } = params;
115057
115111
  const identityNames = import_node_fs15.default.existsSync(paths.identitiesDir) ? import_node_fs15.default.readdirSync(paths.identitiesDir, { withFileTypes: true }).filter((entry) => entry.isDirectory() && isIdentityDirectoryName(entry.name)).map((entry) => entry.name).sort() : [];
115058
115112
  const identities = identityNames.map((name) => {
115059
- const farmRoot = import_node_path39.default.join(paths.identitiesDir, name);
115060
- const identityPath = import_node_path39.default.join(farmRoot, "identity.json");
115061
- return { name, path: identityPath, raw: realFsPort.readFileUtf8(identityPath), farmRoot };
115113
+ const farmRoot = import_node_path40.default.join(paths.identitiesDir, name);
115114
+ const identityPath = import_node_path40.default.join(farmRoot, "identity.json");
115115
+ return { name, path: identityPath, raw: realFsPort.readFileUtf8(identityPath), farmRoot, credentialsFilePresent: import_node_fs15.default.existsSync(credentialsFilePath(farmRoot)) };
115062
115116
  });
115063
115117
  const profileNames = import_node_fs15.default.existsSync(paths.configProfilesDir) ? import_node_fs15.default.readdirSync(paths.configProfilesDir, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => entry.name.slice(0, -".json".length)).sort() : [];
115064
115118
  const configProfiles = profileNames.map((name) => {
115065
- const profilePath = import_node_path39.default.join(paths.configProfilesDir, `${name}.json`);
115119
+ const profilePath = import_node_path40.default.join(paths.configProfilesDir, `${name}.json`);
115066
115120
  return { name, path: profilePath, raw: realFsPort.readFileUtf8(profilePath) };
115067
115121
  });
115068
115122
  const providerNames = import_node_fs15.default.existsSync(paths.providersDir) ? import_node_fs15.default.readdirSync(paths.providersDir, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".json")).map((entry) => entry.name.slice(0, -".json".length)).sort() : [];
115069
115123
  const providers = providerNames.map((name) => {
115070
- const providerPath = import_node_path39.default.join(paths.providersDir, `${name}.json`);
115124
+ const providerPath = import_node_path40.default.join(paths.providersDir, `${name}.json`);
115071
115125
  return { name, path: providerPath, raw: realFsPort.readFileUtf8(providerPath) };
115072
115126
  });
115073
115127
  const ownExecutablePath = realOwnExecutablePath();
@@ -115079,12 +115133,12 @@ function collectDoctorReport(params) {
115079
115133
  binaryDiscovery = { ok: false, message: error63 instanceof Error ? error63.message : String(error63) };
115080
115134
  }
115081
115135
  const shimState = readJson(paths.claudeShimFile, ClaudeShimStateSchema);
115082
- const pathDirs = (params.env.PATH ?? "").split(import_node_path39.default.delimiter).filter((dir) => dir !== "");
115136
+ const pathDirs = (params.env.PATH ?? "").split(import_node_path40.default.delimiter).filter((dir) => dir !== "");
115083
115137
  const claudeShimShadow = shimState === void 0 ? void 0 : refinePathShadow(
115084
115138
  findPathShadow({
115085
115139
  pathDirs,
115086
- targetDir: import_node_path39.default.dirname(shimState.targetPath),
115087
- targetFilename: import_node_path39.default.basename(shimState.targetPath),
115140
+ targetDir: import_node_path40.default.dirname(shimState.targetPath),
115141
+ targetFilename: import_node_path40.default.basename(shimState.targetPath),
115088
115142
  findExecutableInDir
115089
115143
  }),
115090
115144
  shimState.targetPath,
@@ -115110,7 +115164,7 @@ function collectDoctorReport(params) {
115110
115164
  agentShim: refinePathShadow(
115111
115165
  findPathShadow({
115112
115166
  pathDirs,
115113
- targetDir: import_node_path39.default.dirname(ownExecutablePath),
115167
+ targetDir: import_node_path40.default.dirname(ownExecutablePath),
115114
115168
  targetFilename: commandFilename(ownExecutablePath, "agent-shim"),
115115
115169
  findExecutableInDir
115116
115170
  }),
@@ -115368,11 +115422,11 @@ function tryOrUndefined(fn2) {
115368
115422
  return void 0;
115369
115423
  }
115370
115424
  }
115371
- function pathToHttpPath(path48) {
115372
- return `/${path48.map(safeEncodeURIComponent).join("/")}`;
115425
+ function pathToHttpPath(path50) {
115426
+ return `/${path50.map(safeEncodeURIComponent).join("/")}`;
115373
115427
  }
115374
- function normalizeHttpPath(path48) {
115375
- const paths = path48.split("/");
115428
+ function normalizeHttpPath(path50) {
115429
+ const paths = path50.split("/");
115376
115430
  if (paths.at(0) === "") {
115377
115431
  paths.shift();
115378
115432
  }
@@ -115557,9 +115611,9 @@ function isPlainObject2(value2) {
115557
115611
  function getOwn(object3, key) {
115558
115612
  return Object.hasOwn(object3, key) ? object3[key] : void 0;
115559
115613
  }
115560
- function get(object3, path48) {
115614
+ function get(object3, path50) {
115561
115615
  let current = object3;
115562
- for (const key of path48) {
115616
+ for (const key of path50) {
115563
115617
  if (!isTypescriptObject(current)) {
115564
115618
  return void 0;
115565
115619
  }
@@ -116782,7 +116836,7 @@ function resolveClientRest(rest) {
116782
116836
  // rest[1] can be undefined if all fields of FriendlyClientOptions are optional
116783
116837
  ];
116784
116838
  }
116785
- function createORPCClient(link, { path: path48 = [], ...options } = {}) {
116839
+ function createORPCClient(link, { path: path50 = [], ...options } = {}) {
116786
116840
  const procedureClient = (...rest) => {
116787
116841
  const [input2, callOptions] = resolveClientRest(rest);
116788
116842
  const interceptors = [
@@ -116791,7 +116845,7 @@ function createORPCClient(link, { path: path48 = [], ...options } = {}) {
116791
116845
  ];
116792
116846
  return intercept(
116793
116847
  interceptors,
116794
- { ...callOptions, input: input2, path: path48 },
116848
+ { ...callOptions, input: input2, path: path50 },
116795
116849
  ({ path: path210, input: input22, ...callOptions2 }) => link.call(path210, input22, callOptions2)
116796
116850
  );
116797
116851
  };
@@ -116805,7 +116859,7 @@ function createORPCClient(link, { path: path48 = [], ...options } = {}) {
116805
116859
  if (client === void 0) {
116806
116860
  client = createORPCClient(link, {
116807
116861
  ...options,
116808
- path: [...path48, key],
116862
+ path: [...path50, key],
116809
116863
  scoped: options.scoped?.[key]
116810
116864
  });
116811
116865
  cache.set(key, client);
@@ -116827,24 +116881,24 @@ var BracketNotationSerializer = class {
116827
116881
  this.internalSerialize(data, "", true, result);
116828
116882
  return result;
116829
116883
  }
116830
- internalSerialize(data, path48, isRoot, result) {
116884
+ internalSerialize(data, path50, isRoot, result) {
116831
116885
  if (Array.isArray(data)) {
116832
116886
  data.forEach((item, i10) => {
116833
- this.internalSerialize(item, isRoot ? i10.toString() : `${path48}[${i10}]`, false, result);
116887
+ this.internalSerialize(item, isRoot ? i10.toString() : `${path50}[${i10}]`, false, result);
116834
116888
  });
116835
116889
  } else if (isPlainObject2(data)) {
116836
116890
  for (const key of Object.keys(data)) {
116837
- this.internalSerialize(data[key], isRoot ? key : `${path48}[${key}]`, false, result);
116891
+ this.internalSerialize(data[key], isRoot ? key : `${path50}[${key}]`, false, result);
116838
116892
  }
116839
116893
  } else {
116840
- result.push([path48, data]);
116894
+ result.push([path50, data]);
116841
116895
  }
116842
116896
  }
116843
116897
  deserialize(serialized) {
116844
116898
  const arrayPushStyles = /* @__PURE__ */ new WeakSet();
116845
116899
  const root = new NullProtoObj();
116846
- for (const [path48, value2] of serialized) {
116847
- const segments = this.parsePath(path48);
116900
+ for (const [path50, value2] of serialized) {
116901
+ const segments = this.parsePath(path50);
116848
116902
  let currentRef = root;
116849
116903
  let nextSegment = segments[0];
116850
116904
  for (let i10 = 1; i10 < segments.length; i10++) {
@@ -116895,13 +116949,13 @@ var BracketNotationSerializer = class {
116895
116949
  }
116896
116950
  return result;
116897
116951
  }
116898
- parsePath(path48) {
116952
+ parsePath(path50) {
116899
116953
  const segments = [];
116900
116954
  let inBrackets = false;
116901
116955
  let currentSegment = "";
116902
- for (let i10 = 0; i10 < path48.length; i10++) {
116903
- const char = path48[i10];
116904
- const nextChar = path48[i10 + 1];
116956
+ for (let i10 = 0; i10 < path50.length; i10++) {
116957
+ const char = path50[i10];
116958
+ const nextChar = path50[i10 + 1];
116905
116959
  if (inBrackets && char === "]" && (nextChar === void 0 || nextChar === "[")) {
116906
116960
  if (nextChar === void 0) {
116907
116961
  inBrackets = false;
@@ -116917,7 +116971,7 @@ var BracketNotationSerializer = class {
116917
116971
  currentSegment += char;
116918
116972
  }
116919
116973
  }
116920
- return inBrackets || segments.length === 0 ? [path48] : segments;
116974
+ return inBrackets || segments.length === 0 ? [path50] : segments;
116921
116975
  }
116922
116976
  };
116923
116977
  var INTEGER_PATTERN = /^0$|^[1-9]\d*$/;
@@ -117490,11 +117544,11 @@ var OpenAPISerializer = class {
117490
117544
  return json2;
117491
117545
  }
117492
117546
  const form = new FormData();
117493
- for (const [path48, value22] of this.bracketNotation.serialize(json2)) {
117547
+ for (const [path50, value22] of this.bracketNotation.serialize(json2)) {
117494
117548
  if (value22 instanceof Blob) {
117495
- form.append(path48, value22);
117549
+ form.append(path50, value22);
117496
117550
  } else if (value22 !== void 0 && value22 !== null) {
117497
- form.append(path48, String(value22));
117551
+ form.append(path50, String(value22));
117498
117552
  }
117499
117553
  }
117500
117554
  return form;
@@ -117532,30 +117586,30 @@ function isBodylessMethod(method) {
117532
117586
  return method === "GET" || method === "HEAD";
117533
117587
  }
117534
117588
  var PARAMETER_NAME_REGEX = /^[\w-]+$/;
117535
- function getDynamicPathParams(path48) {
117536
- if (!path48.includes("{")) {
117589
+ function getDynamicPathParams(path50) {
117590
+ if (!path50.includes("{")) {
117537
117591
  return void 0;
117538
117592
  }
117539
- const len = path48.length;
117593
+ const len = path50.length;
117540
117594
  let params;
117541
117595
  let index = 1;
117542
117596
  while (index < len) {
117543
117597
  const segmentStart = index;
117544
- const slashPos = path48.indexOf("/", index);
117598
+ const slashPos = path50.indexOf("/", index);
117545
117599
  const segmentEnd = slashPos === -1 ? len : slashPos;
117546
- if (segmentEnd > segmentStart && path48.charCodeAt(segmentStart) === 123 && path48.charCodeAt(segmentEnd - 1) === 125) {
117600
+ if (segmentEnd > segmentStart && path50.charCodeAt(segmentStart) === 123 && path50.charCodeAt(segmentEnd - 1) === 125) {
117547
117601
  let parameterStart = segmentStart + 1;
117548
117602
  let allowsSlash = false;
117549
- const operator = path48.charCodeAt(parameterStart);
117603
+ const operator = path50.charCodeAt(parameterStart);
117550
117604
  if (operator === 43) {
117551
117605
  allowsSlash = true;
117552
117606
  parameterStart++;
117553
117607
  }
117554
- const parameterName = path48.slice(parameterStart, segmentEnd - 1);
117608
+ const parameterName = path50.slice(parameterStart, segmentEnd - 1);
117555
117609
  if (PARAMETER_NAME_REGEX.test(parameterName)) {
117556
117610
  params ??= [];
117557
117611
  params.push({
117558
- segment: path48.slice(segmentStart, segmentEnd),
117612
+ segment: path50.slice(segmentStart, segmentEnd),
117559
117613
  startIndex: segmentStart,
117560
117614
  parameterName,
117561
117615
  allowsSlash
@@ -117598,8 +117652,8 @@ openapi.method = (method) => ({
117598
117652
  ...openapi({ method }),
117599
117653
  name: "~openapi/method"
117600
117654
  });
117601
- openapi.path = (path48) => ({
117602
- ...openapi({ path: path48 }),
117655
+ openapi.path = (path50) => ({
117656
+ ...openapi({ path: path50 }),
117603
117657
  name: "~openapi/path"
117604
117658
  });
117605
117659
  openapi.spec = (spec) => ({
@@ -118460,22 +118514,22 @@ function visitJsonSchemaRefs(value2, visit2, schemaLevel = true, seen = /* @__PU
118460
118514
  }
118461
118515
  }
118462
118516
  }
118463
- function mapJsonSchemaRefs(value2, map2, schemaLevel = true, path48 = []) {
118517
+ function mapJsonSchemaRefs(value2, map2, schemaLevel = true, path50 = []) {
118464
118518
  if (!value2 || typeof value2 !== "object") {
118465
118519
  return value2;
118466
118520
  }
118467
118521
  if (Array.isArray(value2)) {
118468
- return value2.map((item, index) => mapJsonSchemaRefs(item, map2, schemaLevel, [...path48, index]));
118522
+ return value2.map((item, index) => mapJsonSchemaRefs(item, map2, schemaLevel, [...path50, index]));
118469
118523
  }
118470
118524
  const result = {};
118471
118525
  for (const key of Object.keys(value2)) {
118472
118526
  const val = value2[key];
118473
118527
  if (key === "$ref" && typeof val === "string") {
118474
- setOwn(result, key, map2(val, [...path48, key]));
118528
+ setOwn(result, key, map2(val, [...path50, key]));
118475
118529
  } else if (!schemaLevel) {
118476
- setOwn(result, key, mapJsonSchemaRefs(val, map2, true, [...path48, key]));
118530
+ setOwn(result, key, mapJsonSchemaRefs(val, map2, true, [...path50, key]));
118477
118531
  } else if (JSON_SCHEMA_LOGIC_KEYWORDS.has(key) || JSON_SCHEMA_RECORD_KEYWORDS.has(key)) {
118478
- setOwn(result, key, mapJsonSchemaRefs(val, map2, !JSON_SCHEMA_RECORD_KEYWORDS.has(key), [...path48, key]));
118532
+ setOwn(result, key, mapJsonSchemaRefs(val, map2, !JSON_SCHEMA_RECORD_KEYWORDS.has(key), [...path50, key]));
118479
118533
  } else {
118480
118534
  setOwn(result, key, val);
118481
118535
  }
@@ -119005,7 +119059,7 @@ function unlazy(maybeLazy) {
119005
119059
  function createProcedureClient(lazyableProcedure, ...rest) {
119006
119060
  const options = resolveMaybeOptionalOptions(rest);
119007
119061
  return async (...[input2, callerOptions]) => {
119008
- const path48 = toArray(options.path);
119062
+ const path50 = toArray(options.path);
119009
119063
  const { default: procedure } = await unlazy(lazyableProcedure);
119010
119064
  const clientContext = callerOptions?.context ?? {};
119011
119065
  const context = await value(options.context, clientContext) ?? {};
@@ -119018,7 +119072,7 @@ function createProcedureClient(lazyableProcedure, ...rest) {
119018
119072
  };
119019
119073
  try {
119020
119074
  const output2 = await runWithSpan("call_procedure", (span) => {
119021
- span?.setAttribute("procedure.path", path48);
119075
+ span?.setAttribute("procedure.path", path50);
119022
119076
  return intercept(
119023
119077
  options.interceptors,
119024
119078
  {
@@ -119026,7 +119080,7 @@ function createProcedureClient(lazyableProcedure, ...rest) {
119026
119080
  // input can be optional if it is undefinable
119027
119081
  input: input2,
119028
119082
  errors,
119029
- path: path48,
119083
+ path: path50,
119030
119084
  procedure,
119031
119085
  signal: callerOptions?.signal,
119032
119086
  lastEventId: callerOptions?.lastEventId
@@ -119277,10 +119331,10 @@ function augmentRouter(router, options) {
119277
119331
  }
119278
119332
  return enhanced;
119279
119333
  }
119280
- function getRouter(router, path48) {
119334
+ function getRouter(router, path50) {
119281
119335
  let current = router;
119282
- for (let i10 = 0; i10 < path48.length; i10++) {
119283
- const segment = path48[i10];
119336
+ for (let i10 = 0; i10 < path50.length; i10++) {
119337
+ const segment = path50[i10];
119284
119338
  if (!isTypescriptObject(current)) {
119285
119339
  return void 0;
119286
119340
  }
@@ -119292,7 +119346,7 @@ function getRouter(router, path48) {
119292
119346
  continue;
119293
119347
  }
119294
119348
  const lazied = current;
119295
- const rest = path48.slice(i10);
119349
+ const rest = path50.slice(i10);
119296
119350
  return new Lazy({
119297
119351
  ...lazied["~orpc"],
119298
119352
  async loader() {
@@ -119307,40 +119361,40 @@ function getRouter(router, path48) {
119307
119361
  }
119308
119362
  return current;
119309
119363
  }
119310
- function walkProcedureContractsSync(router, callback, path48 = []) {
119364
+ function walkProcedureContractsSync(router, callback, path50 = []) {
119311
119365
  const lazyResults = [];
119312
- walkProcedureContractsSyncInternal(router, callback, path48.slice(), lazyResults);
119366
+ walkProcedureContractsSyncInternal(router, callback, path50.slice(), lazyResults);
119313
119367
  return lazyResults;
119314
119368
  }
119315
- function walkProcedureContractsSyncInternal(router, callback, path48, lazyResults) {
119369
+ function walkProcedureContractsSyncInternal(router, callback, path50, lazyResults) {
119316
119370
  const hiddenContract = getHiddenRouterContract(router);
119317
119371
  if (hiddenContract !== void 0) {
119318
119372
  router = hiddenContract;
119319
119373
  }
119320
119374
  if (router instanceof ProcedureContract) {
119321
- callback(router, path48.slice());
119375
+ callback(router, path50.slice());
119322
119376
  return;
119323
119377
  }
119324
119378
  if (!isTypescriptObject(router)) {
119325
119379
  return;
119326
119380
  }
119327
119381
  for (const [key, value2] of Object.entries(router)) {
119328
- path48.push(key);
119382
+ path50.push(key);
119329
119383
  if (value2 instanceof Lazy) {
119330
- lazyResults.push({ router: value2, path: path48.slice() });
119384
+ lazyResults.push({ router: value2, path: path50.slice() });
119331
119385
  } else {
119332
- walkProcedureContractsSyncInternal(value2, callback, path48, lazyResults);
119386
+ walkProcedureContractsSyncInternal(value2, callback, path50, lazyResults);
119333
119387
  }
119334
- path48.pop();
119388
+ path50.pop();
119335
119389
  }
119336
119390
  }
119337
- async function walkProcedureContractsAsync(router, callback, path48 = []) {
119391
+ async function walkProcedureContractsAsync(router, callback, path50 = []) {
119338
119392
  const hiddenContract = getHiddenRouterContract(router);
119339
119393
  if (hiddenContract !== void 0) {
119340
119394
  router = hiddenContract;
119341
119395
  }
119342
119396
  if (router instanceof ProcedureContract) {
119343
- await callback(router, path48);
119397
+ await callback(router, path50);
119344
119398
  return;
119345
119399
  }
119346
119400
  if (!isTypescriptObject(router)) {
@@ -119349,9 +119403,9 @@ async function walkProcedureContractsAsync(router, callback, path48 = []) {
119349
119403
  for (const [key, value2] of Object.entries(router)) {
119350
119404
  if (value2 instanceof Lazy) {
119351
119405
  const { default: router2 } = await unlazy(value2);
119352
- await walkProcedureContractsAsync(router2, callback, [...path48, key]);
119406
+ await walkProcedureContractsAsync(router2, callback, [...path50, key]);
119353
119407
  } else {
119354
- await walkProcedureContractsAsync(value2, callback, [...path48, key]);
119408
+ await walkProcedureContractsAsync(value2, callback, [...path50, key]);
119355
119409
  }
119356
119410
  }
119357
119411
  }
@@ -119837,18 +119891,18 @@ function rewriteComponentSchemaRefs(schema, renameMap) {
119837
119891
  }
119838
119892
  var OpenAPIGeneratorError = class extends TypeError {
119839
119893
  };
119840
- function toOpenAPIPath(path48, dynamicPathParams) {
119894
+ function toOpenAPIPath(path50, dynamicPathParams) {
119841
119895
  if (!dynamicPathParams?.length) {
119842
- return path48;
119896
+ return path50;
119843
119897
  }
119844
119898
  let normalized = "";
119845
119899
  let currentIndex = 0;
119846
119900
  for (const param of dynamicPathParams) {
119847
- normalized += path48.slice(currentIndex, param.startIndex);
119901
+ normalized += path50.slice(currentIndex, param.startIndex);
119848
119902
  normalized += `{${param.parameterName}}`;
119849
119903
  currentIndex = param.startIndex + param.segment.length;
119850
119904
  }
119851
- normalized += path48.slice(currentIndex);
119905
+ normalized += path50.slice(currentIndex);
119852
119906
  return normalized;
119853
119907
  }
119854
119908
  function buildRequest(ctx, operation, def, meta3, dynamicPathParams) {
@@ -120282,8 +120336,8 @@ var OpenAPIGenerator = class {
120282
120336
  customErrorResponseBodySchema: options.customErrorResponseBodySchema
120283
120337
  };
120284
120338
  const errors = [];
120285
- await walkProcedureContractsAsync(router, (contract, path48) => {
120286
- if (value(options.filter, contract, path48) === false) {
120339
+ await walkProcedureContractsAsync(router, (contract, path50) => {
120340
+ if (value(options.filter, contract, path50) === false) {
120287
120341
  return;
120288
120342
  }
120289
120343
  try {
@@ -120295,7 +120349,7 @@ var OpenAPIGenerator = class {
120295
120349
  `QUERY operations require OpenAPI 3.2, but version "${version2}" was requested.`
120296
120350
  );
120297
120351
  }
120298
- const postPath = meta3?.path ?? pathToHttpPath(path48);
120352
+ const postPath = meta3?.path ?? pathToHttpPath(path50);
120299
120353
  const httpPath = meta3?.prefix ? mergeHttpPath(meta3.prefix, postPath) : postPath;
120300
120354
  const dynamicPathParams = getDynamicPathParams(httpPath);
120301
120355
  const openApiPath = toOpenAPIPath(httpPath, dynamicPathParams);
@@ -120304,7 +120358,7 @@ var OpenAPIGenerator = class {
120304
120358
  operation = meta3.spec;
120305
120359
  } else {
120306
120360
  operation = {
120307
- operationId: meta3?.operationId ?? path48.join("."),
120361
+ operationId: meta3?.operationId ?? path50.join("."),
120308
120362
  summary: meta3?.summary,
120309
120363
  description: meta3?.description,
120310
120364
  deprecated: meta3?.deprecated,
@@ -120324,7 +120378,7 @@ var OpenAPIGenerator = class {
120324
120378
  if (!(e14 instanceof OpenAPIGeneratorError)) {
120325
120379
  throw e14;
120326
120380
  }
120327
- errors.push(`Procedure at ${path48.join(".") || "(root)"}: ${e14.message}`);
120381
+ errors.push(`Procedure at ${path50.join(".") || "(root)"}: ${e14.message}`);
120328
120382
  }
120329
120383
  });
120330
120384
  if (errors.length) {
@@ -120556,7 +120610,7 @@ init_middleware();
120556
120610
  init_preflight();
120557
120611
 
120558
120612
  // src/frontdoor/controlSchemas.ts
120559
- var import_node_path40 = __toESM(require("node:path"), 1);
120613
+ var import_node_path41 = __toESM(require("node:path"), 1);
120560
120614
  init_zod();
120561
120615
  init_schema2();
120562
120616
 
@@ -120768,11 +120822,11 @@ var FrontDoorSessionsOutputSchema = external_exports.strictObject({ sessions: ex
120768
120822
  var CheckRunInputSchema = external_exports.strictObject({
120769
120823
  path: external_exports.string().min(1),
120770
120824
  identity: external_exports.string().min(1).optional()
120771
- }).refine((input2) => import_node_path40.default.isAbsolute(input2.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
120825
+ }).refine((input2) => import_node_path41.default.isAbsolute(input2.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
120772
120826
  var PoolPickInputSchema = external_exports.strictObject({
120773
120827
  pool: external_exports.string().min(1),
120774
120828
  path: external_exports.string().min(1)
120775
- }).refine((input2) => import_node_path40.default.isAbsolute(input2.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
120829
+ }).refine((input2) => import_node_path41.default.isAbsolute(input2.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
120776
120830
  var DoctorFindingSchema = external_exports.strictObject({
120777
120831
  section: external_exports.enum(DOCTOR_SECTIONS),
120778
120832
  subject: external_exports.string().optional(),
@@ -121093,16 +121147,16 @@ var StandardLink = class {
121093
121147
  /**
121094
121148
  * @throws ORPCError, transport-level errors (network failures, timeouts, etc.)
121095
121149
  */
121096
- call(path48, input2, options) {
121097
- return runWithSpan(`${ORPC_NAME}.${path48.join("/")}`, (span) => {
121150
+ call(path50, input2, options) {
121151
+ return runWithSpan(`${ORPC_NAME}.${path50.join("/")}`, (span) => {
121098
121152
  span?.setAttribute("rpc.system", ORPC_NAME);
121099
- span?.setAttribute("rpc.method", path48.join("."));
121153
+ span?.setAttribute("rpc.method", path50.join("."));
121100
121154
  if (getTracer() && isAsyncIteratorObject(input2)) {
121101
121155
  input2 = override(input2, traceAsyncIterator("consume_async_iterator_object_input", input2));
121102
121156
  } else if (getTracer() && input2 instanceof ReadableStream) {
121103
121157
  input2 = override(input2, traceReadableStream("consume_octet_stream_input", input2));
121104
121158
  }
121105
- return intercept(this.interceptors, { ...options, path: path48, input: input2 }, async ({ path: path210, input: input22, ...options2 }) => {
121159
+ return intercept(this.interceptors, { ...options, path: path50, input: input2 }, async ({ path: path210, input: input22, ...options2 }) => {
121106
121160
  const tracer = getTracer();
121107
121161
  const activeSpan = tracer?.getActiveSpan() ?? span;
121108
121162
  let request7 = await runWithSpan(
@@ -121159,18 +121213,18 @@ var RPCLinkCodec = class {
121159
121213
  this.headers = options.headers ?? {};
121160
121214
  this.serializer = options.serializer ?? new RPCSerializer();
121161
121215
  }
121162
- async encodeInput(input2, path48, options) {
121163
- let headers = toResolvedStandardHeaders(await value(this.headers, options, path48, input2));
121216
+ async encodeInput(input2, path50, options) {
121217
+ let headers = toResolvedStandardHeaders(await value(this.headers, options, path50, input2));
121164
121218
  if (options.lastEventId !== void 0) {
121165
121219
  headers = mergeStandardHeaders(headers, { "last-event-id": options.lastEventId });
121166
121220
  }
121167
- const expectedMethod = await value(this.expectedMethod, options, path48, input2);
121168
- const baseUrl = await value(this.baseUrl, options, path48, input2);
121221
+ const expectedMethod = await value(this.expectedMethod, options, path50, input2);
121222
+ const baseUrl = await value(this.baseUrl, options, path50, input2);
121169
121223
  const [pathname, search, hash2] = parseStandardUrl(baseUrl);
121170
- const newPathname = `${pathname.replace(END_SLASH_REGEX, "")}${pathToHttpPath(path48)}`;
121224
+ const newPathname = `${pathname.replace(END_SLASH_REGEX, "")}${pathToHttpPath(path50)}`;
121171
121225
  const serialized = this.serializer.serialize(input2);
121172
121226
  if (expectedMethod === "GET" && !(serialized instanceof Blob) && !(serialized instanceof ReadableStream) && !(serialized instanceof FormData) && !isAsyncIteratorObject(serialized)) {
121173
- const maxUrlLength = await value(this.maxUrlLength, options, path48, input2);
121227
+ const maxUrlLength = await value(this.maxUrlLength, options, path50, input2);
121174
121228
  const mergedSearch = new URLSearchParams(search);
121175
121229
  mergedSearch.append("data", stringifyJSON(serialized) ?? "");
121176
121230
  const url22 = `${newPathname}?${mergedSearch}${hash2 ?? ""}`;
@@ -121255,8 +121309,8 @@ var FetchLinkTransport = class {
121255
121309
  this.fetch = options.fetch ?? ((url2, init) => globalThis.fetch(url2, init));
121256
121310
  this.toFetchRequestOptions = options.toFetchRequest;
121257
121311
  }
121258
- async send(standardRequest, path48, options) {
121259
- let origin = await value(this.origin, options, path48);
121312
+ async send(standardRequest, path50, options) {
121313
+ let origin = await value(this.origin, options, path50);
121260
121314
  if (origin?.endsWith("/")) {
121261
121315
  origin = origin.slice(0, -1);
121262
121316
  }
@@ -121276,7 +121330,7 @@ var FetchLinkTransport = class {
121276
121330
  }
121277
121331
  }
121278
121332
  const fetch3 = this.fetch;
121279
- const response = await fetch3(url2, init, options, path48);
121333
+ const response = await fetch3(url2, init, options, path50);
121280
121334
  const standardResponse = toStandardLazyResponse(response);
121281
121335
  return standardResponse;
121282
121336
  }
@@ -121667,14 +121721,14 @@ var StandardHandler = class {
121667
121721
  span?.setAttribute("url.path", request22.url);
121668
121722
  return { matched: false };
121669
121723
  }
121670
- const { path: path48, procedure, decodeInput } = matchedOrNot;
121671
- span?.updateName(`${ORPC_NAME}.${path48.join("/")}`);
121724
+ const { path: path50, procedure, decodeInput } = matchedOrNot;
121725
+ span?.updateName(`${ORPC_NAME}.${path50.join("/")}`);
121672
121726
  span?.setAttribute("rpc.system", ORPC_NAME);
121673
- span?.setAttribute("rpc.method", path48.join("."));
121727
+ span?.setAttribute("rpc.method", path50.join("."));
121674
121728
  try {
121675
121729
  const response = await intercept(
121676
121730
  this.interceptors,
121677
- { context: context2, prefix: prefix2, request: request22, path: path48, procedure, decodeInput },
121731
+ { context: context2, prefix: prefix2, request: request22, path: path50, procedure, decodeInput },
121678
121732
  async ({ context: context3, prefix: prefix3, request: request32, path: path210, procedure: procedure2, decodeInput: decodeInput2 }) => {
121679
121733
  step2 = "decode_input";
121680
121734
  let input2 = await runWithSpan("decode_input", decodeInput2);
@@ -121708,7 +121762,7 @@ var StandardHandler = class {
121708
121762
  message: `Malformed request. Ensure the request body is properly formatted and the 'Content-Type' header is set correctly.`,
121709
121763
  cause: e14
121710
121764
  }) : toORPCError(e14);
121711
- const response = await this.codec.encodeError(error63, procedure, path48, { context: context2, prefix: prefix2 });
121765
+ const response = await this.codec.encodeError(error63, procedure, path50, { context: context2, prefix: prefix2 });
121712
121766
  return { matched: true, response };
121713
121767
  }
121714
121768
  }
@@ -121814,7 +121868,7 @@ var RPCMatcher = class {
121814
121868
  this.rootRouter = router;
121815
121869
  this.index(router);
121816
121870
  }
121817
- index(router, path48 = []) {
121871
+ index(router, path50 = []) {
121818
121872
  const lazyResults = walkProcedureContractsSync(router, (procedure, procedurePath) => {
121819
121873
  if (!value(this.filter, procedure, procedurePath)) {
121820
121874
  return;
@@ -121825,7 +121879,7 @@ var RPCMatcher = class {
121825
121879
  // contract-first entries have no implementation yet, resolveProcedure fills it in on demand
121826
121880
  procedure: procedure instanceof Procedure ? procedure : void 0
121827
121881
  });
121828
- }, path48);
121882
+ }, path50);
121829
121883
  for (const result of lazyResults) {
121830
121884
  this.pendingLazyRouters.set(pathToHttpPath(result.path), result);
121831
121885
  }
@@ -121957,10 +122011,10 @@ var RPCHandlerCodec = class {
121957
122011
  }
121958
122012
  };
121959
122013
  }
121960
- encodeOutput(output2, procedure, path48, options) {
122014
+ encodeOutput(output2, procedure, path50, options) {
121961
122015
  return {
121962
122016
  headers: {},
121963
- status: value(this.outputStatus, output2, procedure, path48, options) ?? DEFAULT_SUCCESS_STATUS,
122017
+ status: value(this.outputStatus, output2, procedure, path50, options) ?? DEFAULT_SUCCESS_STATUS,
121964
122018
  body: this.serializer.serialize(output2)
121965
122019
  };
121966
122020
  }
@@ -122014,39 +122068,39 @@ function createRouter() {
122014
122068
  static: new NullProtoObj2()
122015
122069
  };
122016
122070
  }
122017
- function scanFirstGroup(path48) {
122071
+ function scanFirstGroup(path50) {
122018
122072
  let i10 = 0;
122019
122073
  let depth = 0;
122020
- for (; i10 < path48.length; i10++) {
122021
- const c10 = path48.charCodeAt(i10);
122074
+ for (; i10 < path50.length; i10++) {
122075
+ const c10 = path50.charCodeAt(i10);
122022
122076
  if (c10 === 92) i10++;
122023
122077
  else if (c10 === 40) depth++;
122024
122078
  else if (c10 === 41 && depth > 0) depth--;
122025
122079
  else if (c10 === 123 && depth === 0) break;
122026
122080
  }
122027
- if (i10 >= path48.length) return;
122081
+ if (i10 >= path50.length) return;
122028
122082
  let j10 = i10 + 1;
122029
122083
  depth = 0;
122030
- for (; j10 < path48.length; j10++) {
122031
- const c10 = path48.charCodeAt(j10);
122084
+ for (; j10 < path50.length; j10++) {
122085
+ const c10 = path50.charCodeAt(j10);
122032
122086
  if (c10 === 92) j10++;
122033
122087
  else if (c10 === 40) depth++;
122034
122088
  else if (c10 === 41 && depth > 0) depth--;
122035
122089
  else if (c10 === 125 && depth === 0) break;
122036
122090
  }
122037
- if (j10 >= path48.length) return;
122038
- const mod = path48[j10 + 1];
122091
+ if (j10 >= path50.length) return;
122092
+ const mod = path50[j10 + 1];
122039
122093
  const hasMod = mod === "?" || mod === "+" || mod === "*";
122040
122094
  return [
122041
- path48.slice(0, i10),
122042
- path48.slice(i10 + 1, j10),
122043
- path48.slice(j10 + (hasMod ? 2 : 1)),
122095
+ path50.slice(0, i10),
122096
+ path50.slice(i10 + 1, j10),
122097
+ path50.slice(j10 + (hasMod ? 2 : 1)),
122044
122098
  hasMod ? mod : void 0
122045
122099
  ];
122046
122100
  }
122047
- function expandGroupDelimiters(path48) {
122048
- if (!path48.includes("{")) return;
122049
- const group = scanFirstGroup(path48);
122101
+ function expandGroupDelimiters(path50) {
122102
+ if (!path50.includes("{")) return;
122103
+ const group = scanFirstGroup(path50);
122050
122104
  if (!group) return;
122051
122105
  const [pre2, body, suf, mod] = group;
122052
122106
  if (!mod) return [pre2 + body + suf];
@@ -122116,9 +122170,9 @@ function replaceSegmentWildcards(segment, unnamedStart, toGroupKey = toUnnamedGr
122116
122170
  }
122117
122171
  return [replaced, nextIndex];
122118
122172
  }
122119
- function encodeEscapes(path48) {
122120
- if (!path48.includes("\\")) return path48;
122121
- return path48.replace(/\\([:(){}])/g, (_, c10) => "\uFFFD" + "ABCDE"[":(){}".indexOf(c10)]);
122173
+ function encodeEscapes(path50) {
122174
+ if (!path50.includes("\\")) return path50;
122175
+ return path50.replace(/\\([:(){}])/g, (_, c10) => "\uFFFD" + "ABCDE"[":(){}".indexOf(c10)]);
122122
122176
  }
122123
122177
  function segmentKey(segment) {
122124
122178
  if (segment.startsWith("**")) return 2;
@@ -122147,22 +122201,22 @@ function expandModifiers(segments) {
122147
122201
  return m10[2] === "+" ? [wc2] : [wc2, without];
122148
122202
  }
122149
122203
  }
122150
- function normalizePath(path48) {
122151
- if (!path48.includes("/.")) return path48;
122204
+ function normalizePath(path50) {
122205
+ if (!path50.includes("/.")) return path50;
122152
122206
  const r10 = [];
122153
- for (const s of path48.split("/")) if (s === ".") continue;
122207
+ for (const s of path50.split("/")) if (s === ".") continue;
122154
122208
  else if (s === ".." && r10.length > 1) r10.pop();
122155
122209
  else r10.push(s);
122156
122210
  return r10.join("/") || "/";
122157
122211
  }
122158
- function splitPath(path48) {
122159
- const s = path48.split("/");
122212
+ function splitPath(path50) {
122213
+ const s = path50.split("/");
122160
122214
  s.shift();
122161
122215
  if (s[s.length - 1] === "") s.pop();
122162
122216
  return s;
122163
122217
  }
122164
- function splitRoute(path48) {
122165
- const s = splitPath(path48);
122218
+ function splitRoute(path50) {
122219
+ const s = splitPath(path50);
122166
122220
  while (s[s.length - 1] === "") s.pop();
122167
122221
  return s;
122168
122222
  }
@@ -122178,16 +122232,16 @@ function getMatchParams(segments, paramsMap) {
122178
122232
  }
122179
122233
  return params;
122180
122234
  }
122181
- function addRoute(ctx, method = "", path48, data) {
122235
+ function addRoute(ctx, method = "", path50, data) {
122182
122236
  method = method.toUpperCase();
122183
- if (path48.charCodeAt(0) !== 47) path48 = `/${path48}`;
122184
- const groupExpanded = expandGroupDelimiters(path48);
122237
+ if (path50.charCodeAt(0) !== 47) path50 = `/${path50}`;
122238
+ const groupExpanded = expandGroupDelimiters(path50);
122185
122239
  if (groupExpanded) {
122186
122240
  for (const expandedPath of groupExpanded) addRoute(ctx, method, expandedPath, data);
122187
122241
  return;
122188
122242
  }
122189
- path48 = encodeEscapes(path48);
122190
- const segments = splitRoute(path48);
122243
+ path50 = encodeEscapes(path50);
122244
+ const segments = splitRoute(path50);
122191
122245
  const expanded = expandModifiers(segments);
122192
122246
  if (expanded) {
122193
122247
  for (const p of expanded) addRoute(ctx, method, p, data);
@@ -122278,15 +122332,15 @@ function getParamRegexp(segment, unnamedStart = 0) {
122278
122332
  const regex = _s2.replace(/:([\w-]+)(?:\(([^)]*)\))?/g, (_, id2, p) => `(?<${toGroupName(id2)}>${p || "[^/]+"})`).replace(/\((?![?<])/g, () => `(?<${toUnnamedGroupKey(_i2++)}>`).replace(/\uFFFE(.)/g, (_, c10) => /[.*+?^${}()|[\]\\]/.test(c10) ? `\\${c10}` : c10);
122279
122333
  return [new RegExp(`^${regex}$`), _i2];
122280
122334
  }
122281
- function findRoute(ctx, method = "", path48, opts) {
122282
- if (opts?.normalize) path48 = normalizePath(path48);
122283
- if (path48.charCodeAt(path48.length - 1) === 47) path48 = path48.slice(0, -1);
122284
- const staticNode = ctx.static[path48];
122335
+ function findRoute(ctx, method = "", path50, opts) {
122336
+ if (opts?.normalize) path50 = normalizePath(path50);
122337
+ if (path50.charCodeAt(path50.length - 1) === 47) path50 = path50.slice(0, -1);
122338
+ const staticNode = ctx.static[path50];
122285
122339
  if (staticNode && staticNode.methods) {
122286
122340
  const staticMatch = staticNode.methods[method] || staticNode.methods[""];
122287
122341
  if (staticMatch !== void 0) return staticMatch[0];
122288
122342
  }
122289
- const segments = splitPath(path48);
122343
+ const segments = splitPath(path50);
122290
122344
  const match = _lookupTree(ctx.root, method, segments, 0);
122291
122345
  if (match === void 0) return;
122292
122346
  if (opts?.params === false) return match;
@@ -122486,7 +122540,7 @@ var OpenAPIMatcher = class {
122486
122540
  this.rootRouter = router;
122487
122541
  this.index(router);
122488
122542
  }
122489
- index(router, path48 = []) {
122543
+ index(router, path50 = []) {
122490
122544
  const lazyResults = walkProcedureContractsSync(router, (contract, path210) => {
122491
122545
  if (!value(this.filter, contract, path210)) {
122492
122546
  return;
@@ -122501,7 +122555,7 @@ var OpenAPIMatcher = class {
122501
122555
  contract,
122502
122556
  procedure: contract instanceof Procedure ? contract : void 0
122503
122557
  });
122504
- }, path48);
122558
+ }, path50);
122505
122559
  for (const result of lazyResults) {
122506
122560
  const prefix = getOpenAPIMeta(result.router)?.prefix;
122507
122561
  this.pendingLazyRouters.add({
@@ -122588,20 +122642,20 @@ var OpenAPIMatcher = class {
122588
122642
  return entry.procedure;
122589
122643
  }
122590
122644
  };
122591
- function toRou3Pattern(path48) {
122592
- const params = getDynamicPathParams(path48);
122645
+ function toRou3Pattern(path50) {
122646
+ const params = getDynamicPathParams(path50);
122593
122647
  if (!params?.length) {
122594
- return path48;
122648
+ return path50;
122595
122649
  }
122596
122650
  for (let i10 = params.length - 1; i10 >= 0; i10--) {
122597
122651
  const param = params[i10];
122598
122652
  const pattern = param.allowsSlash ? `**:${param.parameterName}` : `:${param.parameterName}`;
122599
- path48 = path48.slice(0, param.startIndex) + pattern + path48.slice(param.startIndex + param.segment.length);
122653
+ path50 = path50.slice(0, param.startIndex) + pattern + path50.slice(param.startIndex + param.segment.length);
122600
122654
  }
122601
- return path48;
122655
+ return path50;
122602
122656
  }
122603
- function toRou3PrefixMatcher(path48) {
122604
- const pattern = toRou3Pattern(path48);
122657
+ function toRou3PrefixMatcher(path50) {
122658
+ const pattern = toRou3Pattern(path50);
122605
122659
  return routeToRegExp(pattern === "/" ? "/**" : `${pattern}/**`);
122606
122660
  }
122607
122661
  function decodeParams(params) {
@@ -122680,7 +122734,7 @@ var OpenAPIHandlerCodecCore = class {
122680
122734
  /**
122681
122735
  * @throws {TypeError} If `outputStructure` is "detailed" and the output doesn't match the expected structure.
122682
122736
  */
122683
- encodeOutput(output2, procedure, path48) {
122737
+ encodeOutput(output2, procedure, path50) {
122684
122738
  const meta3 = getOpenAPIMeta(procedure);
122685
122739
  const successStatus = meta3?.successStatus ?? DEFAULT_SUCCESS_STATUS;
122686
122740
  const outputStructure = meta3?.outputStructure ?? DEFAULT_OPENAPI_OUTPUT_STRUCTURE;
@@ -122693,7 +122747,7 @@ var OpenAPIHandlerCodecCore = class {
122693
122747
  }
122694
122748
  if (!isValidDetailedOutput(output2)) {
122695
122749
  throw new TypeError(`
122696
- Invalid "detailed" output structure returned by procedure (${path48.join(".")}):
122750
+ Invalid "detailed" output structure returned by procedure (${path50.join(".")}):
122697
122751
  \u2022 Expected an object with optional properties:
122698
122752
  - status (number <400)
122699
122753
  - headers (object)
@@ -123241,7 +123295,7 @@ function profileValue(name, paths) {
123241
123295
  function createConfigApiRouter(deps) {
123242
123296
  const authed = doorApiAuth(deps.expectedToken);
123243
123297
  const { paths } = deps;
123244
- const route = (path48, summary) => authed.meta(openapi({ method: "POST", path: path48, summary, tags: [CONFIG_API_TAG] }));
123298
+ const route = (path50, summary) => authed.meta(openapi({ method: "POST", path: path50, summary, tags: [CONFIG_API_TAG] }));
123245
123299
  return {
123246
123300
  config: {
123247
123301
  identity: {
@@ -123591,7 +123645,7 @@ function createLifecycleApiRouter(deps) {
123591
123645
  init_cliError();
123592
123646
 
123593
123647
  // src/frontdoor/launchSchemas.ts
123594
- var import_node_path41 = __toESM(require("node:path"), 1);
123648
+ var import_node_path42 = __toESM(require("node:path"), 1);
123595
123649
  init_zod();
123596
123650
  init_claudeVersion();
123597
123651
  init_identity();
@@ -123601,7 +123655,7 @@ var LaunchResolveInputSchema = external_exports.strictObject({
123601
123655
  argv: external_exports.readonly(external_exports.array(external_exports.string())).optional(),
123602
123656
  /** The launch's inherited environment. Absent means an empty one: the door's own environment is never a substitute for the caller's, so a caller that wants `AGENT_SHIM_*` switches or a `CLAUDE_CONFIG_DIR` considered names them here. Values are read, never reported. */
123603
123657
  env: external_exports.record(external_exports.string(), external_exports.string()).optional()
123604
- }).refine((input2) => import_node_path41.default.isAbsolute(input2.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
123658
+ }).refine((input2) => import_node_path42.default.isAbsolute(input2.path), { message: "path must be absolute: the door cannot resolve a relative path against the caller's working directory" });
123605
123659
  var LaunchPoolDecisionSchema = external_exports.strictObject({
123606
123660
  name: external_exports.string(),
123607
123661
  reasons: external_exports.readonly(external_exports.array(external_exports.string())),
@@ -125091,8 +125145,8 @@ function createCodexRouteMount(ports, upstreamBase, provider) {
125091
125145
  request7.body.resume();
125092
125146
  return;
125093
125147
  }
125094
- const path48 = new URL(request7.url, "http://127.0.0.1").pathname;
125095
- const translated = { method: request7.method, path: path48, body, signal: request7.signal };
125148
+ const path50 = new URL(request7.url, "http://127.0.0.1").pathname;
125149
+ const translated = { method: request7.method, path: path50, body, signal: request7.signal };
125096
125150
  const routed = await route(translated);
125097
125151
  if (request7.signal.aborted) {
125098
125152
  return;
@@ -125126,7 +125180,7 @@ function createPassthroughRoute(name, target) {
125126
125180
  headroomUpstream: target.headroomUpstream,
125127
125181
  serve: async (request7, response) => {
125128
125182
  const incoming = new URL(request7.url, "http://127.0.0.1");
125129
- const path48 = target.stripPrefix !== void 0 && incoming.pathname.startsWith(target.stripPrefix) ? incoming.pathname.slice(target.stripPrefix.length) : incoming.pathname;
125183
+ const path50 = target.stripPrefix !== void 0 && incoming.pathname.startsWith(target.stripPrefix) ? incoming.pathname.slice(target.stripPrefix.length) : incoming.pathname;
125130
125184
  const headers = forwardableHeaders(request7.headers);
125131
125185
  delete headers.host;
125132
125186
  await new Promise((resolve2) => {
@@ -125134,7 +125188,7 @@ function createPassthroughRoute(name, target) {
125134
125188
  host: base.hostname,
125135
125189
  port: base.port === "" ? void 0 : Number(base.port),
125136
125190
  method: request7.method,
125137
- path: `${basePath}${path48}${incoming.search}`,
125191
+ path: `${basePath}${path50}${incoming.search}`,
125138
125192
  headers,
125139
125193
  agent
125140
125194
  };
@@ -125267,7 +125321,7 @@ async function scanRequestHead(request7, wholeBody = false) {
125267
125321
 
125268
125322
  // src/frontdoor/providerRoute.ts
125269
125323
  function createProviderRouteResolver(deps) {
125270
- const isRcSelfHostPath = (path48) => path48 === "/v1/code/sessions" || path48.startsWith("/v1/code/sessions/") || path48 === "/v1/sessions" || path48.startsWith("/v1/sessions/");
125324
+ const isRcSelfHostPath = (path50) => path50 === "/v1/code/sessions" || path50.startsWith("/v1/code/sessions/") || path50 === "/v1/sessions" || path50.startsWith("/v1/sessions/");
125271
125325
  const oauthRoute = createPassthroughRoute("anthropic", { baseUrl: `https://${CONNECT_INTERCEPT_HOST}:${String(HTTPS_PORT)}`, stripPrefix: void 0, headroomUpstream: void 0 });
125272
125326
  const passthroughByTarget = /* @__PURE__ */ new Map();
125273
125327
  const passthroughFor = (name, target) => {
@@ -125281,16 +125335,16 @@ function createProviderRouteResolver(deps) {
125281
125335
  return route;
125282
125336
  };
125283
125337
  const resolve2 = (request7) => {
125284
- const path48 = new URL(request7.url, "http://127.0.0.1").pathname;
125285
- const scoped = parseProviderPath(path48);
125338
+ const path50 = new URL(request7.url, "http://127.0.0.1").pathname;
125339
+ const scoped = parseProviderPath(path50);
125286
125340
  if (scoped === void 0) {
125287
- if (deps.rcSelfHostRoute !== void 0 && isRcSelfHostPath(path48)) {
125341
+ if (deps.rcSelfHostRoute !== void 0 && isRcSelfHostPath(path50)) {
125288
125342
  return { ok: true, route: deps.rcSelfHostRoute };
125289
125343
  }
125290
- if (request7.session.provider !== void 0 && path48.startsWith("/v1/") && !isRcSelfHostPath(path48)) {
125344
+ if (request7.session.provider !== void 0 && path50.startsWith("/v1/") && !isRcSelfHostPath(path50)) {
125291
125345
  return resolve2({ ...request7, url: `${PROVIDER_PATH_PREFIX}${encodeURIComponent(request7.session.provider)}${request7.url}` });
125292
125346
  }
125293
- return path48.startsWith("/v1/") ? { ok: true, route: oauthRoute } : { ok: false, status: HTTP_STATUS.notFound, message: `no such endpoint: ${path48}` };
125347
+ return path50.startsWith("/v1/") ? { ok: true, route: oauthRoute } : { ok: false, status: HTTP_STATUS.notFound, message: `no such endpoint: ${path50}` };
125294
125348
  }
125295
125349
  const { provider } = scoped;
125296
125350
  let definition;
@@ -125343,8 +125397,8 @@ function createProviderRouteResolver(deps) {
125343
125397
  let replay;
125344
125398
  const visited = /* @__PURE__ */ new Set();
125345
125399
  for (; ; ) {
125346
- const path48 = new URL(current.url, "http://127.0.0.1").pathname;
125347
- const scoped = parseProviderPath(path48);
125400
+ const path50 = new URL(current.url, "http://127.0.0.1").pathname;
125401
+ const scoped = parseProviderPath(path50);
125348
125402
  const providerName = scoped?.provider ?? current.session.provider;
125349
125403
  if (providerName !== void 0 && visited.has(providerName)) {
125350
125404
  return { ok: false, status: HTTP_STATUS.internalServerError, message: `provider routing cycle: ${[...visited, providerName].join(" -> ")}` };
@@ -125402,7 +125456,7 @@ function createProviderRouteResolver(deps) {
125402
125456
  const headers = Object.fromEntries(Object.entries(replay.headers).filter(([name]) => name.toLowerCase() !== "content-length"));
125403
125457
  replay = { ...replay, headers, body: import_node_stream3.Readable.from([Buffer.from(rewritten, "utf8")]) };
125404
125458
  }
125405
- const rest = scoped === void 0 ? path48 : path48.slice(`${PROVIDER_PATH_PREFIX}${encodeURIComponent(scoped.provider)}`.length);
125459
+ const rest = scoped === void 0 ? path50 : path50.slice(`${PROVIDER_PATH_PREFIX}${encodeURIComponent(scoped.provider)}`.length);
125406
125460
  const query = current.url.includes("?") ? current.url.slice(current.url.indexOf("?")) : "";
125407
125461
  current = { ...current, url: `${PROVIDER_PATH_PREFIX}${encodeURIComponent(matched.provider)}${rest}${query}`, body: replay.body, headers: replay.headers };
125408
125462
  }
@@ -125509,7 +125563,7 @@ function createRcLiveUsage(deps) {
125509
125563
  }
125510
125564
 
125511
125565
  // src/frontdoor/rcSelfHostMint.ts
125512
- var import_node_path42 = __toESM(require("node:path"), 1);
125566
+ var import_node_path43 = __toESM(require("node:path"), 1);
125513
125567
  init_account();
125514
125568
 
125515
125569
  // src/frontdoor/rcSelfHostLocal.ts
@@ -125616,7 +125670,7 @@ function createRcSelfHostLocal(deps) {
125616
125670
  }
125617
125671
 
125618
125672
  // src/frontdoor/rcSelfHostMint.ts
125619
- var CREDENTIALS_FILE = ".credentials.json";
125673
+ var CREDENTIALS_FILE2 = ".credentials.json";
125620
125674
  var CLAUDE_JSON2 = ".claude.json";
125621
125675
  var RC_SELF_HOST_RECORD_DIR = "rc-selfhost";
125622
125676
  var RC_SELF_HOST_RECORD_FILE = "credential.json";
@@ -125639,7 +125693,7 @@ function readJsonObject(fs21, file2) {
125639
125693
  return isRecord7(parsed) ? parsed : void 0;
125640
125694
  }
125641
125695
  function readRcSelfHostRecord(fs21, frontdoorDir) {
125642
- const parsed = readJsonObject(fs21, import_node_path42.default.join(frontdoorDir, RC_SELF_HOST_RECORD_DIR, RC_SELF_HOST_RECORD_FILE));
125696
+ const parsed = readJsonObject(fs21, import_node_path43.default.join(frontdoorDir, RC_SELF_HOST_RECORD_DIR, RC_SELF_HOST_RECORD_FILE));
125643
125697
  if (parsed === void 0) {
125644
125698
  return void 0;
125645
125699
  }
@@ -125653,11 +125707,11 @@ function mintRcSelfHostCredential(deps) {
125653
125707
  if (!isIdentityName(deps.identity)) {
125654
125708
  throw new Error(`"${deps.identity}" is not a valid identity name.`);
125655
125709
  }
125656
- const identityDir = import_node_path42.default.join(deps.identitiesDir, deps.identity);
125657
- const credentialsFile = import_node_path42.default.join(identityDir, CREDENTIALS_FILE);
125658
- const claudeJsonFile = import_node_path42.default.join(identityDir, CLAUDE_JSON2);
125659
- const recordDir = import_node_path42.default.join(deps.frontdoorDir, RC_SELF_HOST_RECORD_DIR);
125660
- const recordFile = import_node_path42.default.join(recordDir, RC_SELF_HOST_RECORD_FILE);
125710
+ const identityDir = import_node_path43.default.join(deps.identitiesDir, deps.identity);
125711
+ const credentialsFile = import_node_path43.default.join(identityDir, CREDENTIALS_FILE2);
125712
+ const claudeJsonFile = import_node_path43.default.join(identityDir, CLAUDE_JSON2);
125713
+ const recordDir = import_node_path43.default.join(deps.frontdoorDir, RC_SELF_HOST_RECORD_DIR);
125714
+ const recordFile = import_node_path43.default.join(recordDir, RC_SELF_HOST_RECORD_FILE);
125661
125715
  const previousRecord = readRcSelfHostRecord(deps.fs, deps.frontdoorDir);
125662
125716
  const existingCredentials = readJsonObject(deps.fs, credentialsFile);
125663
125717
  const existingOauth = isRecord7(existingCredentials?.claudeAiOauth) ? existingCredentials.claudeAiOauth : void 0;
@@ -125673,7 +125727,7 @@ function mintRcSelfHostCredential(deps) {
125673
125727
  const organizationUuid = deps.newUuid();
125674
125728
  const accountUuid = deps.newUuid();
125675
125729
  const mintedAt = new Date(deps.now()).toISOString();
125676
- deps.fs.mkdirPrivate(import_node_path42.default.dirname(credentialsFile));
125730
+ deps.fs.mkdirPrivate(import_node_path43.default.dirname(credentialsFile));
125677
125731
  deps.fs.writeFilePrivate(credentialsFile, `${JSON.stringify({ ...existingCredentials, claudeAiOauth: { accessToken, refreshToken, expiresAt: null, scopes: [...RC_SELF_HOST_SCOPE_LIST], subscriptionType: SELF_HOST_SUBSCRIPTION_TYPE, rateLimitTier: null } }, null, 2)}
125678
125732
  `);
125679
125733
  const claudeJson = readJsonObject(deps.fs, claudeJsonFile) ?? {};
@@ -126060,7 +126114,7 @@ function registerRcCommand(frontdoor, paths) {
126060
126114
  }
126061
126115
 
126062
126116
  // src/frontdoor/rcCredentialStore.ts
126063
- var import_node_path43 = __toESM(require("node:path"), 1);
126117
+ var import_node_path44 = __toESM(require("node:path"), 1);
126064
126118
  function isSafeSessionId(sessionId) {
126065
126119
  return /^[A-Za-z0-9_-]+$/.test(sessionId);
126066
126120
  }
@@ -126086,7 +126140,7 @@ function sequenceNumOfJson(value2) {
126086
126140
  }
126087
126141
  function createRcCredentialStore(fs21, dir) {
126088
126142
  fs21.mkdirPrivate(dir);
126089
- const fileFor = (sessionId) => import_node_path43.default.join(dir, `${sessionId}.json`);
126143
+ const fileFor = (sessionId) => import_node_path44.default.join(dir, `${sessionId}.json`);
126090
126144
  const readParsed = (sessionId) => {
126091
126145
  const raw = fs21.readFileUtf8(fileFor(sessionId));
126092
126146
  if (raw === void 0) {
@@ -128510,7 +128564,7 @@ function realFrontDoorSupervisorPorts(paths) {
128510
128564
  const leafFor = createLeafCache(loadCa(), () => /* @__PURE__ */ new Date());
128511
128565
  const capture = captureFromEnv(process.env, paths.logsDir);
128512
128566
  if (capture !== void 0) {
128513
- log(`capture enabled, recording CONNECT targets and piped exchanges to ${import_node_path44.default.join(paths.logsDir, "frontdoor-capture.jsonl")}`);
128567
+ log(`capture enabled, recording CONNECT targets and piped exchanges to ${import_node_path45.default.join(paths.logsDir, "frontdoor-capture.jsonl")}`);
128514
128568
  }
128515
128569
  if (rcSelfHostSurface !== void 0) {
128516
128570
  log("self-hosted Remote Control surface on: the door serves the CCR session family itself, and its own client-half dials its own transparent surface");
@@ -130646,8 +130700,8 @@ function getErrorMap2() {
130646
130700
 
130647
130701
  // node_modules/.pnpm/zod@4.6.5/node_modules/zod/v3/helpers/parseUtil.js
130648
130702
  var makeIssue = (params) => {
130649
- const { data, path: path48, errorMaps, issueData } = params;
130650
- const fullPath = [...path48, ...issueData.path || []];
130703
+ const { data, path: path50, errorMaps, issueData } = params;
130704
+ const fullPath = [...path50, ...issueData.path || []];
130651
130705
  const fullIssue = {
130652
130706
  ...issueData,
130653
130707
  path: fullPath
@@ -130762,11 +130816,11 @@ var errorUtil;
130762
130816
 
130763
130817
  // node_modules/.pnpm/zod@4.6.5/node_modules/zod/v3/types.js
130764
130818
  var ParseInputLazyPath = class {
130765
- constructor(parent, value2, path48, key) {
130819
+ constructor(parent, value2, path50, key) {
130766
130820
  this._cachedPath = [];
130767
130821
  this.parent = parent;
130768
130822
  this.data = value2;
130769
- this._path = path48;
130823
+ this._path = path50;
130770
130824
  this._key = key;
130771
130825
  }
130772
130826
  get path() {
@@ -134329,11 +134383,11 @@ function normalizeObjectSchema(schema) {
134329
134383
  }
134330
134384
  return void 0;
134331
134385
  }
134332
- function getDotPath(path48) {
134333
- if (path48.length === 0) {
134386
+ function getDotPath(path50) {
134387
+ if (path50.length === 0) {
134334
134388
  return "object root";
134335
134389
  }
134336
- return path48.reduce((acc, seg, index) => {
134390
+ return path50.reduce((acc, seg, index) => {
134337
134391
  if (index === 0) {
134338
134392
  return String(seg);
134339
134393
  }
@@ -138630,16 +138684,16 @@ init_credentialCache();
138630
138684
 
138631
138685
  // src/identityToken.ts
138632
138686
  var import_node_fs17 = __toESM(require("node:fs"), 1);
138633
- var import_node_path45 = __toESM(require("node:path"), 1);
138687
+ var import_node_path46 = __toESM(require("node:path"), 1);
138634
138688
  init_cliError();
138635
138689
  var TOKEN_FILE_MODE = 384;
138636
138690
  var TOKEN_DIR_MODE = 448;
138637
138691
  var OAUTH_TOKEN_RE = /^sk-ant-oat\d+-[A-Za-z0-9_-]+$/;
138638
138692
  function identityTokenDir(paths) {
138639
- return import_node_path45.default.join(paths.root, "credentials");
138693
+ return import_node_path46.default.join(paths.root, "credentials");
138640
138694
  }
138641
138695
  function identityTokenPath(paths, identityName) {
138642
- return import_node_path45.default.join(identityTokenDir(paths), `${identityName}.token`);
138696
+ return import_node_path46.default.join(identityTokenDir(paths), `${identityName}.token`);
138643
138697
  }
138644
138698
  function storeIdentityToken(paths, identityName, raw) {
138645
138699
  const token = raw.trim();
@@ -138650,7 +138704,7 @@ function storeIdentityToken(paths, identityName, raw) {
138650
138704
  import_node_fs17.default.mkdirSync(dir, { recursive: true, mode: TOKEN_DIR_MODE });
138651
138705
  import_node_fs17.default.chmodSync(dir, TOKEN_DIR_MODE);
138652
138706
  const target = identityTokenPath(paths, identityName);
138653
- const temp = import_node_path45.default.join(dir, `.${identityName}.${String(process.pid)}.tmp`);
138707
+ const temp = import_node_path46.default.join(dir, `.${identityName}.${String(process.pid)}.tmp`);
138654
138708
  import_node_fs17.default.writeFileSync(temp, `${token}
138655
138709
  `, { mode: TOKEN_FILE_MODE });
138656
138710
  import_node_fs17.default.renameSync(temp, target);
@@ -138818,7 +138872,7 @@ function registerDoctorCommand(program2, deps) {
138818
138872
  // src/headroom/commands.ts
138819
138873
  var import_node_fs18 = __toESM(require("node:fs"), 1);
138820
138874
  var import_node_http4 = __toESM(require("node:http"), 1);
138821
- var import_node_path46 = __toESM(require("node:path"), 1);
138875
+ var import_node_path47 = __toESM(require("node:path"), 1);
138822
138876
  var import_node_child_process6 = require("node:child_process");
138823
138877
  init_commandDeps();
138824
138878
  init_realFrontDoorPort();
@@ -138932,12 +138986,12 @@ function readInstalledHeadroomCommit() {
138932
138986
  if (toolDir.status !== 0) {
138933
138987
  return void 0;
138934
138988
  }
138935
- const libDir = import_node_path46.default.join(toolDir.stdout.trim(), HEADROOM_TOOL_NAME, "lib");
138989
+ const libDir = import_node_path47.default.join(toolDir.stdout.trim(), HEADROOM_TOOL_NAME, "lib");
138936
138990
  for (const python of realFarmFs.readdir(libDir)) {
138937
- const sitePackages = import_node_path46.default.join(libDir, python, "site-packages");
138991
+ const sitePackages = import_node_path47.default.join(libDir, python, "site-packages");
138938
138992
  for (const entry of realFarmFs.readdir(sitePackages)) {
138939
138993
  if (entry.startsWith("headroom_ai-") && entry.endsWith(".dist-info")) {
138940
- const directUrl = realFarmFs.readFileUtf8(import_node_path46.default.join(sitePackages, entry, "direct_url.json"));
138994
+ const directUrl = realFarmFs.readFileUtf8(import_node_path47.default.join(sitePackages, entry, "direct_url.json"));
138941
138995
  return directUrl === void 0 ? void 0 : parseInstalledCommit(directUrl);
138942
138996
  }
138943
138997
  }
@@ -139477,6 +139531,7 @@ function registerRunCommand(program2, handler) {
139477
139531
  }
139478
139532
 
139479
139533
  // src/usage/commands.ts
139534
+ var import_node_path48 = __toESM(require("node:path"), 1);
139480
139535
  init_commandDeps();
139481
139536
  init_realPorts();
139482
139537
  init_account();
@@ -139615,7 +139670,7 @@ function formatUsageReport(report) {
139615
139670
  }
139616
139671
  return lines;
139617
139672
  }
139618
- function collectAccounts(fs21, paths, identity) {
139673
+ function collectAccounts(fs21, paths, identity, probe) {
139619
139674
  if (identity !== void 0) {
139620
139675
  requireIdentity(paths, identity);
139621
139676
  }
@@ -139623,6 +139678,7 @@ function collectAccounts(fs21, paths, identity) {
139623
139678
  return names.map((name) => ({
139624
139679
  identity: name,
139625
139680
  account: readAccountMetadata(fs21, paths.identitiesDir, name),
139681
+ signIn: identitySignIn(fs21, probe, { farmRoot: import_node_path48.default.join(paths.identitiesDir, name), hasCredentialBlock: readIdentity(paths, name)?.credential !== void 0 }),
139626
139682
  usage: readUsageSnapshot(fs21, paths.usageSnapshotsDir, name)
139627
139683
  }));
139628
139684
  }
@@ -139633,6 +139689,7 @@ function formatAccounts(views) {
139633
139689
  return views.flatMap((view, index) => {
139634
139690
  const { account } = view;
139635
139691
  const lines = [...index === 0 ? [] : [""], `Identity: ${view.identity}`];
139692
+ lines.push(`Sign-in: ${view.signIn.state === "signed-out" ? "signed out" : view.signIn.state === "token" ? "token" : "signed in"} (${view.signIn.detail})`);
139636
139693
  if (account === void 0) {
139637
139694
  lines.push("Account: (no stored login profile: never logged in, or a setup-token identity, which has no profile scope)");
139638
139695
  } else {
@@ -139725,7 +139782,7 @@ function registerUsageCommands(program2, deps) {
139725
139782
  console.error(warning);
139726
139783
  }
139727
139784
  }
139728
- const views = collectAccounts(realFarmFs, paths, identity);
139785
+ const views = collectAccounts(realFarmFs, paths, identity, { platform: process.platform, run: realRunPort });
139729
139786
  if (options.json === true) {
139730
139787
  printJson(identity === void 0 ? views : views[0]);
139731
139788
  return;
@@ -139954,7 +140011,7 @@ async function runClaude(argvOverride) {
139954
140011
  // src/cli.ts
139955
140012
  async function main() {
139956
140013
  aliasLegacyEnv(process.env);
139957
- const invokedName = import_node_path47.default.basename(process.argv[1] ?? "agent-shim");
140014
+ const invokedName = import_node_path49.default.basename(process.argv[1] ?? "agent-shim");
139958
140015
  if (isInvokedAsClaude(invokedName)) {
139959
140016
  await runClaude();
139960
140017
  return;